/* Archive surfaces: scoped to the directory and its three edit dialogs. */
@media screen {
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) { padding: 28px 24px 32px; min-width: 0; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) .far-head { padding: 0; margin: 0 0 24px; border: 0; gap: 20px; align-items: center; justify-content: space-between; background: transparent; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) .arch-heading { flex: 1 1 360px; min-width: 0; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) .far-head h3 { margin: 0; font-size: 24px !important; font-weight: 700; letter-spacing: 0 !important; line-height: 1.5; color: var(--ink); }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) [data-ar-sub] { margin-top: 6px; font-size: 13px; line-height: 1.7; color: #526878; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) .arch-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) .btn { min-height: 38px; padding: 8px 14px; border-radius: 6px; font-size: 13px; letter-spacing: 0; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) .arch-actions .primary { padding-inline: 18px; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) .arch-privacy { margin: 0 0 16px; padding: 12px 16px; background: #fff4dc; border-radius: 8px; color: #75500b; font-size: 13px; line-height: 1.7; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) .far-main { background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: none; overflow: hidden; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) .arch-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) .far-search { width: min(480px, 100%); flex: 0 1 480px; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) .far-search input { width: 100%; min-width: 0; height: 34px; padding: 6px 40px 6px 36px; border: 1px solid #becdd6; border-radius: 6px; font-size: 13px; background: #fff; color: var(--ink); }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) .far-search svg { left: 12px; width: 16px; height: 16px; color: #526878; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) .far-search input::placeholder { color: #607585; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) .far-search .x { right: 4px; width: 32px; height: 32px; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) [data-ar-summary] { margin: 0; font-size: 13px; color: #526878; font-variant-numeric: tabular-nums; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) .far-tblwrap { max-height: min(70dvh, 780px); overflow: auto; overscroll-behavior: contain; scrollbar-color: #aabdc9 #f2f6f8; scrollbar-width: auto; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) table.far-tbl { min-width: 1240px; font-size: 13px; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers)[data-archive=drivers] table.far-tbl { min-width: 800px; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers)[data-archive=customers] table.far-tbl { min-width: 1100px; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) table.far-tbl th { position: sticky; top: 0; z-index: 2; padding: 10px 16px !important; background: #f3f7f9 !important; color: #526878 !important; font-size: 12px !important; font-weight: 600; line-height: 1.5; text-align: left; white-space: nowrap; border: 0; border-bottom: 1px solid var(--line); letter-spacing: 0; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) table.far-tbl td { padding: 8px 16px; height: 56px; vertical-align: middle; text-align: left; line-height: 1.7; color: var(--ink); border: 0; border-bottom: 1px solid #e8eef2; background: #fff; overflow-wrap: anywhere; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers)[data-archive=drivers] table.far-tbl th { padding: 10px 16px !important; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers)[data-archive=drivers] table.far-tbl td:not(.empty) { height: 56px; padding: 8px 16px; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers)[data-archive=drivers] table.far-tbl .arch-identity strong { margin-bottom: 0; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) table.far-tbl tbody tr:nth-child(even) td { background: #fff; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) table.far-tbl tbody tr:hover td { background: #f5f9fb; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) table.far-tbl tbody tr:last-child td { border-bottom: 0; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) table.far-tbl th:first-child, :is(#view-farmers,#view-arch-drivers,#view-arch-customers) table.far-tbl td:first-child { position: sticky; left: 0; z-index: 1; border-right: 1px solid #e8eef2; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) table.far-tbl th:first-child { z-index: 3; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) table.far-tbl th:last-child, :is(#view-farmers,#view-arch-drivers,#view-arch-customers) table.far-tbl td.far-ops { position: sticky; right: 0; z-index: 1; border-left: 1px solid #e8eef2; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) table.far-tbl th:last-child { z-index: 3; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) table.far-tbl:has(.empty) { min-width: 0; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) table.far-tbl:has(.empty) thead { display: none; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) table.far-tbl .empty:first-child { position: static; border: 0; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) table.far-tbl .arch-identity strong { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600; line-height: 1.6; color: var(--ink); }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) .arch-value { display: flex; gap: 6px; align-items: baseline; font-size: 12px; line-height: 1.7; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) .arch-value + .arch-value { margin-top: 4px; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) .arch-value > .sel { min-width: 0; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) .arch-label { flex-shrink: 0; color: #607585; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) .arch-label::after { content: '：'; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) .arch-missing { color: #607585; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) .arch-docs > div { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-height: 24px; font-size: 12px; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) .arch-docs > div + div { margin-top: 2px; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) .arch-docs > div > span { min-width: 48px; color: #526878; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) .far-btn { min-height: 24px; padding: 2px 8px; border-radius: 4px; font-size: 12px; line-height: 1.5; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) .far-btn.off { min-width: 0; border: 0; background: transparent; color: #607585; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) .far-ops { display: table-cell; white-space: nowrap; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) .far-ops .btn { display: inline-flex; align-items: center; justify-content: center; min-height: 32px; padding: 4px 8px; border: 0; background: transparent; box-shadow: none; color: var(--brand); }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) .far-ops .btn:hover { background: #e9f2f7; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) .far-ops .danger { color: #a53731; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) .far-ops .danger:hover { background: #fcece9; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) .arch-remark { font-size: 12px; color: #526878; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) .arch-plate { display: inline-block; padding: 3px 10px; border: 1px solid #c3d2dc; border-radius: 4px; background: #f5f8fa; font-weight: 600; letter-spacing: .5px; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) table.far-tbl .empty { height: 160px; padding: 24px; text-align: center; white-space: normal; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) .empty strong { display: block; margin-bottom: 8px; font-size: 16px; font-weight: 600; color: var(--ink); }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) .empty span { display: block; font-size: 13px; color: #526878; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) .arch-list-foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 20px; padding: 12px 20px; border-top: 1px solid var(--line); color: #607585; font-size: 12px; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) :is(button, input, .far-tblwrap):focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; box-shadow: none; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) ::selection { color: #fff; background: #245c74; }
  :is(#maskFarmer, #maskDriver, #maskCustomer) .dlg { border-radius: 12px; }
  #maskFarmer .dlg { max-width: 820px !important; }
  #maskFarmer .fld-row:has(#farRemark) { grid-template-columns: minmax(0,1fr); }
  #maskCustomer .dlg { max-width: 680px !important; }
  #maskDriver .dlg { max-width: 600px !important; }
  :is(#maskFarmer, #maskDriver, #maskCustomer) .dlg-hd { padding: 14px 20px; background: #fff; }
  :is(#maskFarmer, #maskDriver, #maskCustomer) .dlg-hd h3 { font-size: 20px; color: var(--ink); letter-spacing: 0; }
  :is(#maskFarmer, #maskDriver, #maskCustomer) .dlg-bd { padding: 16px 20px; }
  :is(#maskFarmer, #maskDriver, #maskCustomer) .fld-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px !important; }
  :is(#maskFarmer, #maskDriver, #maskCustomer) .fld-row:first-child { margin-top: 0 !important; }
  :is(#maskFarmer, #maskDriver, #maskCustomer) .fld { min-width: 0; margin-bottom: 0; }
  :is(#maskFarmer, #maskDriver, #maskCustomer) .fld label { margin-bottom: 6px; color: #526878; font-size: 12px; }
  :is(#maskFarmer, #maskDriver, #maskCustomer) .fld input { width: 100%; min-width: 0; min-height: 34px; padding: 6px 12px; border: 1px solid #becdd6; border-radius: 6px; font-size: 13px; }
  :is(#maskFarmer, #maskDriver, #maskCustomer) input::placeholder { color: #607585; }
  :is(#maskFarmer, #maskDriver, #maskCustomer) .dlg-ft { padding: 12px 20px; background: #f8fafb; }
  :is(#maskFarmer, #maskDriver, #maskCustomer) .btn { min-height: 36px; letter-spacing: 0; }
  :is(#maskFarmer, #maskDriver, #maskCustomer) .dlg-ft .btn { min-width: 88px; min-height: 40px; }
  .arch-form-section { min-width: 0; border: 0; padding: 0; margin: 0; }
  .arch-form-section + .arch-form-section { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
  .arch-form-section legend { float: left; width: 100%; margin-bottom: 12px; padding: 0; color: var(--ink); font-size: 14px; font-weight: 600; }
  .arch-form-section legend + * { clear: both; }
  .arch-form-section legend span { font-size: 12px; color: #607585; font-weight: 400; margin-left: 8px; }
  .arch-form-intro { margin: 0 0 12px; color: #526878; font-size: 13px; line-height: 1.7; }
  .arch-upload-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .arch-doc-title { font-size: 13px; font-weight: 600; color: var(--ink); }
  #maskFarmer .upbox .prev { align-items: flex-start; min-height: 70px; }
  #maskFarmer .upbox .prev img { width: 58px; height: 58px; flex-shrink: 0; object-fit: contain; }
  .arch-pdf-file { flex-shrink: 0; display: flex; align-items: center; justify-content: center; width: 58px; min-height: 58px; padding: 6px; border: 1px solid #b8cbd6; border-radius: 6px; color: #245c74; background: #eaf2f6; font-size: 12px; text-align: center; }
  .arch-pdf-file[hidden] { display: none; }
  #maskImg .dlg { width: min(1000px,100%); max-width: 1000px !important; }
  #maskImg .imgview { min-width: 0; }
  #maskImg .imgview.is-pdf { display: block; }
  #maskImg .imgview > img { display: block; max-width: 100%; max-height: 65dvh; object-fit: contain; margin: auto; }
  #maskImg .arch-pdf-help { margin: 0 0 10px; font-size: 12px; color: #526878; line-height: 1.7; }
  #maskImg .arch-pdf-help a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
  #maskImg iframe { display: block; width: 100%; height: 62dvh; border: 1px solid var(--line); border-radius: 6px; background: #f3f7f9; }
  :is(#maskFarmer, #maskCustomer) .upbox { margin-top: 0 !important; padding: 12px; border: 1px dashed #bacbd6; border-radius: 8px; background: #f8fafb; min-width: 0; }
  #maskFarmer .upbox { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
  :is(#maskFarmer, #maskCustomer) .upbox .prev { min-width: 0; }
  :is(#maskFarmer, #maskCustomer) .upbox .hint { color: #526878; font-size: 12px; overflow-wrap: anywhere; line-height: 1.7; }
  #maskFarmer .upbox .acts { display: flex; flex-wrap: wrap; gap: 6px; }
  #maskCustomer .fld-row:has(.arch-address) { grid-template-columns: minmax(0, 1fr); }
  #maskCustomer .grp-title { margin: 16px 0 12px !important; padding: 0; border: 0; font-size: 14px; color: var(--ink); letter-spacing: 0; line-height: 1.7; }
}
@media screen and (max-width: 760px) {
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) { padding: 24px 12px; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) .far-head { gap: 16px; margin-bottom: 20px; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) .arch-heading { flex-basis: 100%; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) .far-head h3 { font-size: 22px !important; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) .arch-actions { width: 100%; display: grid; grid-template-columns: auto auto minmax(0, 1fr); }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) .arch-actions .btn { min-height: 44px; padding: 8px 10px; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) .arch-toolbar { padding: 16px; gap: 12px; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) .far-search { flex: 1 1 100%; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) .far-search input { height: 44px; font-size: 16px; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) .far-search .x { width: 40px; height: 40px; right: 2px; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) [data-ar-summary] { width: 100%; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) .far-tblwrap { max-height: 60dvh; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) table.far-tbl { min-width: 1240px; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) table.far-tbl th, :is(#view-farmers,#view-arch-drivers,#view-arch-customers) table.far-tbl td { padding: 8px 12px !important; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers)[data-archive=drivers] table.far-tbl :is(th,td):not(.empty) { padding: 8px 12px !important; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) table.far-tbl th:first-child, :is(#view-farmers,#view-arch-drivers,#view-arch-customers) table.far-tbl td:first-child { position: static; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) table.far-tbl th:first-child { position: sticky; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) table.far-tbl th:last-child, :is(#view-farmers,#view-arch-drivers,#view-arch-customers) table.far-tbl td.far-ops { position: static; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) table.far-tbl th:last-child { position: sticky; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) .far-ops .btn, :is(#view-farmers,#view-arch-drivers,#view-arch-customers) .far-btn { min-height: 44px; min-width: 44px; }
  :is(#view-farmers,#view-arch-drivers,#view-arch-customers) .arch-list-foot { padding: 12px 16px; }
  :is(#maskFarmer, #maskDriver, #maskCustomer) .dlg-hd, :is(#maskFarmer, #maskDriver, #maskCustomer) .dlg-bd { padding: 16px; }
  :is(#maskFarmer, #maskDriver, #maskCustomer) .fld-row, .arch-upload-grid { grid-template-columns: minmax(0, 1fr); }
  :is(#maskFarmer, #maskDriver, #maskCustomer) .fld input { font-size: 16px; min-height: 44px; }
  :is(#maskFarmer, #maskDriver, #maskCustomer) .dlg-ft { padding: 12px 16px; }
  :is(#maskFarmer, #maskDriver, #maskCustomer) .btn { min-height: 44px; }
  #maskFarmer .dlg-ft .btn, #maskFarmer .dlg-hd .x { min-height: 44px; }
  .arch-form-section legend span { display: block; margin: 4px 0 0; }
}

/* Adapt the presentation to the workspace router and native [data-lz-modal] focus handling. */
#viewPages:has(> .online-archives:not([hidden])) { max-width:none; padding:0; }
.online-archives .far-main { display:block; }
.online-archives .arch-feedback { margin:0 0 16px; color:#9d352c; font-size:13px; line-height:1.7; }
.online-archives .arch-feedback:empty { display:none; }
.online-archives button:disabled { cursor:not-allowed; opacity:.5; }
[data-lz-modal].ar-online-dialog { padding:0; border:0; background:transparent; margin:auto; width:calc(100vw - 44px); max-width:820px; max-height:88vh; overflow:visible; color:var(--ink); }
[data-lz-modal].ar-online-dialog::backdrop { background:rgba(16,34,44,.5); backdrop-filter:blur(2px); }
[data-lz-modal].ar-online-dialog > form { margin:0; }
[data-lz-modal].ar-online-dialog .dlg { margin:auto; width:100%; max-height:88vh; display:flex; flex-direction:column; overflow:hidden; }
[data-lz-modal].ar-online-dialog .dlg-bd { overflow:auto; min-height:0; }
[data-lz-modal].ar-online-dialog .dlg-ft { flex-shrink:0; }
[data-lz-modal].ar-online-dialog .archive-error { color:#9d352c; font-size:13px; line-height:1.7; padding:0 20px; margin:0; overflow-wrap:anywhere; }
[data-lz-modal].ar-online-dialog .archive-error:empty { display:none; }
[data-lz-modal].ar-online-dialog :is(input,button,a):focus-visible { outline:2px solid var(--brand); outline-offset:3px; }
[data-lz-modal].ar-online-dialog input[readonly] { color:#607585; background:#f3f7f9; }
[data-lz-modal].ar-online-dialog button:disabled { cursor:not-allowed; opacity:.5; }
[data-lz-modal].ar-online-dialog .arch-hidden-file { display:none; }
#maskDriver.ar-online-dialog { max-width:600px; }
#maskCustomer.ar-online-dialog { max-width:680px; }
#maskImg.ar-online-dialog { max-width:1000px; }
@media (max-width:760px) {
  [data-lz-modal].ar-online-dialog { width:calc(100vw - 24px); max-height:calc(100dvh - 24px); }
  [data-lz-modal].ar-online-dialog .dlg { max-height:calc(100dvh - 24px); }
}
