/* Screen-only postal workspace. Printed layouts keep their physical dimensions. */
:root {
  --canvas: #f5f6f2;
  --rail: #153e34;
  --rail-ink: #eff9ef;
  --rail-muted: #c3d7ca;
  --stroke: #b9c9bf;
  --field: #f8faf7;
  --cover: #e1eee2;
  --cover-ink: #184637;
  --state-bg: #eef0e9;
  --state-ink: #46544b;
  --travel-bg: #faf0d3;
  --travel-ink: #785b14;
  --radius: 14px;
  --ease: cubic-bezier(.2,.75,.25,1);
}
:root[data-theme="dark"] {
  --canvas: #141b19;
  --rail: #102a24;
  --rail-ink: #f0f7ed;
  --rail-muted: #bfcec5;
  --field: #202925;
  --stroke: #506058;
  --cover: #233f34;
  --cover-ink: #e4f3e2;
  --state-bg: #323a35;
  --state-ink: #d0d9d1;
  --travel-bg: #443b26;
  --travel-ink: #f3d684;
}
body {
  background: var(--canvas);
  font-family: Inter, 'Segoe UI', 'Microsoft YaHei UI', 'PingFang SC', system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
}
body > .app-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.admin-shell > .app-header { min-height: 74px; padding: 14px clamp(20px,3vw,48px); }
.admin-shell > .app-header h1 { font-size: clamp(20px,2vw,27px); font-weight: 700; letter-spacing: -.04em; }
@media (max-width: 1100px) {
  .records-page .app-header .site-home-link,
  .records-page .app-header .site-home-link [data-site-name] { display: inline-flex; }
}
.records-page .app-header .site-home-link { width: auto; gap: 9px; color: var(--muted); font-size: 14px; }
.site-navigation { color: var(--rail-ink); background: var(--rail); border: none; padding-inline: 14px; }
.site-navigation .navigation-group { border-color: #ffffff20; padding-block: 15px; gap: 4px; }
.site-navigation a.navigation-brand { padding-inline: 17px; min-height: 86px; color: var(--rail-ink); border: none; }
.site-navigation .navigation-brand [data-site-name] { font-size: 16px; letter-spacing: -.03em; }
.site-navigation a { color: var(--rail-muted); border-radius: 9px; font-weight: 550; }
.site-navigation a img, :root[data-theme="dark"] .site-navigation img { filter: invert(1); }
.site-navigation .navigation-brand .qsl-logo { padding: 7px; background: #e2efd9; border-radius: 10px; filter: none !important; }
.site-navigation a:hover { color: white; background: #ffffff12; }
.site-navigation a[aria-current="page"] { color: white; background: #ffffff20; }
.site-navigation a[aria-current="page"]::before { left: auto; right: 13px; top: calc(50% - 3px); width: 6px; height: 6px; border-radius: 50%; background: #a9e190; }
body > .site-footer { background: var(--canvas); }
body .language-options { border-radius: 12px; padding: 5px; }
body .language-options button { border-radius: 7px; }

/* Shared native controls, including fields inserted by page controllers. */
body :is(input:not([type="checkbox"],[type="radio"],[type="hidden"],[type="range"],[type="color"],[type="image"],[type="button"],[type="submit"]), select, textarea) {
  min-width: 0; max-width: 100%; min-height: 44px;
  padding: 10px 13px; border: 1px solid var(--stroke); border-radius: 9px;
  background-color: var(--field); color: var(--ink); font: inherit; font-size: 15px; font-weight: 400;
  line-height: 1.45; box-shadow: none;
}
body textarea { resize: vertical; }
body select { padding-inline-end: 28px; cursor: pointer; }
body input::placeholder, body textarea::placeholder { color: var(--muted); opacity: .88; }
body :is(input,select,textarea):hover:not(:disabled):not(:focus) { border-color: var(--muted); }
body :is(input,select,textarea):focus-visible {
  outline: 2px solid var(--brand); outline-offset: 2px; border-color: var(--brand); background-color: var(--surface);
}
body :is(input,textarea,select):is(:user-invalid,[aria-invalid="true"]) { border-color: var(--danger); outline-color: var(--danger); }
body :is(input,select,textarea):disabled, body :is(input,textarea)[readonly] {
  background-color: var(--surface-soft); color: var(--muted); border-style: dashed;
}
body :is(input[type="checkbox"],input[type="radio"]) { accent-color: #00843d; width: 18px; height: 18px; min-height: 0; flex: none; cursor: pointer; }
body input[type="file"] { padding: 5px 9px; }
body input::file-selector-button { margin-inline-end: 10px; padding: 7px 10px; background: var(--active); color: var(--brand-strong); border: 0; border-radius: 6px; font: inherit; cursor: pointer; }
body .date-parts input { padding-inline: 2px; }
body label:has(:focus-visible) { color: var(--brand-strong); }
body :is(.primary-button,.text-button,.icon-button,.danger-button), body button:not([class]) { border-radius: 9px; }
body .primary-button, :root[data-theme="dark"] body .primary-button { background: #00843d; color: #fff; border-color: transparent; }
body .primary-button:hover:not(:disabled) { background: #006e33; }
body .icon-button { width: 42px; min-height: 42px; }
body .primary-button, body .text-button { min-height: 42px; }
body .pm-dialog { border-radius: 19px; padding: clamp(18px,3vw,34px); }
body .pm-dialog::backdrop { background: #0c251ecc; }
body .pm-dialog-heading { padding-bottom: 16px; border-bottom: 1px solid var(--line); }
body .pm-fields { gap: 18px 22px; }
body .pm-fields label, body .form label, body .pm-toolbar label { font-size: 13px; font-weight: 600; }
body .pm-public, body .account-settings-section, body .pm-pool-card, body .shipment-filter-panel,
body .pm-gallery-item, .request-layout:has(#registerForm) {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
body .pm-public { flex-grow: 0; width: min(calc(100% - 32px),760px); margin: 32px auto; padding: clamp(20px,4vw,40px); border-top: 4px solid #00843d; }
body .pm-public h1, body .pm-public h2 { letter-spacing: -.04em; }
body .account-settings-section, .request-layout:has(#registerForm) { padding: clamp(16px,2.4vw,28px); }
.request-layout:has(#registerForm) { flex-grow: 0; width: min(560px,calc(100% - 32px)); margin: 32px auto; }
body .pm-gallery-item { padding: 10px 10px 16px; }
body .pm-gallery-item :is(a,p,small) { margin-inline: 5px; }
body .pm-gallery-preview { border-radius: 9px; background: var(--field); }
body .login-main { background: var(--canvas); }
body .login-content { width: min(100%,460px); padding: clamp(20px,4vw,40px); border-radius: 20px; border: 1px solid var(--line); background: var(--surface); }
body .login-content h1::before { content: ''; display: block; width: 37px; height: 5px; border-radius: 3px; background: #00843d; margin-bottom: 18px; }

/* Record workspace */
body .pm-layout { padding: clamp(18px,3vw,44px); }
.ledger-cover { position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: center; min-height: 210px; padding: clamp(22px,3vw,42px); border-radius: 18px; background: var(--cover); color: var(--cover-ink); }
.ledger-intro { z-index: 1; }
.ledger-intro h1 { margin: 0; color: inherit; letter-spacing: -.055em; font-size: clamp(29px,3.2vw,48px); line-height: 1.16; }
.ledger-intro p { margin: 10px 0 18px; font-size: 14px; }
.ledger-intro .primary-button { padding-inline: 16px; }
.postal-art { position: absolute; right: 8%; top: 50%; width: 230px; height: 144px; transform: translateY(-50%); pointer-events: none; }
.postal-art i { position: absolute; display: block; }
.postal-back { width: 158px; height: 102px; left: 54px; top: 2px; transform: rotate(12deg); background: #b8d5b5; border-radius: 5px; }
.postal-front { width: 172px; height: 113px; left: 13px; top: 23px; transform: rotate(-10deg); background: #fffdf1; border: 1px solid #779e83; border-radius: 5px; }
.postal-front::before { content: ''; position: absolute; right: 13px; top: 11px; width: 29px; height: 34px; background: #40875e; outline: 2px dashed #40875e; outline-offset: 1px; }
.postal-front::after { content: ''; position: absolute; right: 20px; top: 20px; width: 15px; height: 15px; border: 1px solid #d7ebc9; border-radius: 50% 50% 3px 3px; }
.postal-front b { position: absolute; left: 17px; bottom: 25px; width: 67px; height: 2px; background: #8ea699; box-shadow: 0 8px #c8d4c7; }
.postal-cancel { left: 122px; top: 42px; width: 45px; height: 45px; border: 4px double #31624e; border-radius: 50%; transform: rotate(-14deg); opacity: .84; }
.postal-cancel::after { content: ''; position: absolute; top: 16px; left: 34px; width: 43px; height: 2px; background: #31624e; box-shadow: 0 5px #31624e,0 -5px #31624e; }
.record-tools { margin-top: 22px; padding: 17px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.record-tools #statusFilter { min-width: 135px; }
#recordList #pageStatus:empty { min-height: 0; margin: 0; }
#recordList .pm-table-scroll { margin-block: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
#recordList th { padding-block: 13px; background: var(--surface-soft); color: var(--muted); font-size: 12px; }
#recordList th:first-child, #recordList td:first-child { padding-left: 20px; }
#recordList tbody tr:last-child td { border-bottom: 0; }
#recordList td { vertical-align: middle; }
#recordList .record-entry:hover { background: var(--field); }
.record-status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 20px; background: var(--state-bg); color: var(--state-ink); white-space: nowrap; font-size: 12px; font-weight: 600; }
.record-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.record-status[data-state="sent"] { background: var(--travel-bg); color: var(--travel-ink); }
.record-status:is([data-state="returned"],[data-state="delivered"]) { background: var(--success-bg); color: var(--success); }
#recordList .mobile-field { display: none; }
#recordList .record-empty { text-align: center; padding: 38px 14px; color: var(--muted); }
.record-empty img { display: block; margin: 0 auto 12px; opacity: .65; filter: var(--icon-filter); }
#pagination, #galleryPagination { justify-content: flex-end; align-items: center; color: var(--muted); font-size: 13px; }
@media (min-width: 1101px) {
  .admin-shell { padding-left: 248px; }
  .site-navigation { width: 248px; }
}
@media (max-width: 600px) {
  .admin-shell > .app-header { min-height: 62px; padding: 11px 14px; gap: 8px; }
  .admin-shell .app-header .header-actions { flex: 0 1 auto; }
  .records-page .app-header .site-home-link [data-site-name] { display: none; }
  body .pm-layout { padding: 16px 12px 26px; }
  .ledger-cover { min-height: 167px; border-radius: 14px; padding: 19px; }
  .postal-art { transform: translateY(-50%) scale(.55); transform-origin: right center; right: 2%; }
  .record-tools { gap: 12px; margin-top: 14px; padding: 12px; }
  .record-tools label:has(select) { flex: 1; }
  #recordList .pm-table-scroll { background: transparent; border: 0; overflow: visible; }
  #recordList table, #recordList tbody { display: block; }
  #recordList thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  #recordList tbody tr { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; margin-bottom: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
  #recordList .record-entry td, #recordList .record-entry td:first-child { padding: 0; border: 0; overflow-wrap: anywhere; }
  #recordList .record-entry td:first-child { grid-column: 1; grid-row: 1; }
  #recordList .record-entry td:nth-child(2) { grid-column: 1 / -1; }
  #recordList .record-entry td:nth-child(3) { grid-column: 2; grid-row: 1; text-align: right; }
  #recordList .record-entry td:nth-child(4), #recordList .record-entry td:nth-child(5) { font-size: 13px; }
  #recordList .mobile-field { display: block; margin: 0 0 2px; color: var(--muted); }
  #recordList .record-entry .pm-row-actions { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 10px; text-align: right; }
  #recordList .record-empty { grid-column: 1 / -1; }
  #pagination, #galleryPagination { justify-content: center; }
  body :is(input:not([type="checkbox"],[type="radio"]),select,textarea) { font-size: 16px; }
}
@media (prefers-reduced-motion: no-preference) {
  body :is(button,a,input,textarea,select) { transition: background-color 140ms, border-color 140ms, color 140ms, transform 140ms var(--ease); }
  button:active:not(:disabled) { transform: translateY(1px); }
  .navigation-group a:hover { transform: translateX(2px); }
  .ledger-cover:hover .postal-front { transform: translateY(-3px) rotate(-8deg); }
  .postal-front { transition: transform 230ms var(--ease); }
  .ledger-cover, .login-content, .pm-public, dialog[open], .language-options:not([hidden]), .navigation-open .site-navigation { animation: workspace-enter 190ms var(--ease) both; }
  @keyframes workspace-enter { from { transform: translateY(5px); } to { transform: translateY(0); } }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}



#editorFields, .editor-group { min-width: 0; padding: 0; margin: 0; border: 0; }
.editor-group { margin: 0 0 20px; padding: 16px; background: var(--field); border: 1px solid var(--line); border-radius: 12px; }
.editor-group legend { padding: 0 6px; color: var(--brand-strong); font-size: 14px; font-weight: 700; }
.editor-group :is(input,textarea) { background-color: var(--surface); }
.field-required, .field-error { color: var(--danger); }
@media (max-width: 600px) { .editor-group { padding: 12px; } }

body.has-language-menu > .app-header {
  display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: center;
}
.site-tools .theme-picker { margin: 0; }
.site-tools .icon-button { width: 42px; height: 42px; border: 1px solid var(--line); background: var(--surface); }
.app-header .logout-icon { display: none; }
@media (max-width: 1100px) {
  body.admin-shell.has-language-menu > .app-header { grid-template-columns: auto minmax(0,1fr) auto auto; }
}
@media (max-width: 600px) {
  body.has-language-menu > .app-header { padding: 10px 12px; gap: 6px; }
  .app-header .site-tools { gap: 4px; }
  .admin-shell .app-header > div:has(h1) .site-home-link { display: none; }
  .admin-shell > .app-header h1 { overflow-wrap: anywhere; font-size: 17px; }
  .app-header .logout-button { display: grid; place-items: center; width: 40px; padding: 0; }
  .app-header .logout-icon { display: block; }
  .app-header .logout-label { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
}

.work-panel, section:has(> #participantScanForm), #platformAdmin, #platformInvites { padding: clamp(14px,2vw,24px); margin-block: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.work-panel > .pm-toolbar + .pm-toolbar { padding-top: 16px; margin-top: 16px; border-top: 1px solid var(--line); }
body input[type="search"] { padding-inline-start: 38px; background-image: url("/assets/vendor/lucide/navigation/Search.svg"); background-size: 17px; background-repeat: no-repeat; background-position: 12px center; }
:root[data-theme="dark"] input[type="search"] { background-image: none; padding-inline-start: 13px; }

/* Shared work surfaces for dispatch, participation and print preparation. */
.workflow-layout > .work-panel:first-child { margin-top: 0; }
.workflow-layout .work-panel h2 { margin: 0 0 14px; font-size: 19px; letter-spacing: -.025em; }
.workflow-layout .work-panel p { line-height: 1.6; }
.workflow-layout .work-panel > [role="status"]:empty { display: none; }
.workflow-layout .workflow-summary:not(:empty) {
  margin-block: 16px; padding: 14px 18px; color: var(--cover-ink);
  background: var(--cover); border-radius: 12px; font-weight: 600;
}
.workflow-layout .workflow-address { margin-top: 18px; }
.workflow-layout .workflow-pager { justify-content: flex-end; align-items: center; margin-block: 16px; font-size: 13px; color: var(--muted); }
.workflow-layout .pm-table-scroll, .workflow-layout .shipment-results { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.workflow-layout .pm-table th { color: var(--muted); background: var(--surface-soft); }
.workflow-layout .shipment-filter-panel { border: 0; border-top: 1px solid var(--line); border-radius: 0; margin: 16px 0 0; padding: 10px 0 0; }
.workflow-layout .shipment-batch-bar { gap: 10px; }
.workflow-layout .pm-pool-card { padding: clamp(16px, 2vw, 24px); }
.workflow-layout .pm-unit-qr { grid-column: 1/-1; }
.workflow-layout .pm-pool-card p { margin: 0; }
.workflow-layout .pm-pool-card .pm-fields { padding-block: 16px; border-block: 1px solid var(--line); }
.workflow-layout .pm-pool-card .pm-fields textarea { width: 100%; }
#labelDialog { background: var(--surface); border-radius: 18px; padding: clamp(16px, 2.2vw, 28px); }
#labelDialog::backdrop { background: #0c251ecc; }
#labelDialog .label-preview { border: 1px solid var(--line); border-radius: 12px; background: var(--field); }
.workflow-field-caption { display: none; }
@media (max-width: 600px) {
  .workflow-layout .workflow-pager { justify-content: center; }
  .workflow-layout .pm-dispatch-table, .workflow-layout .pm-dispatch-table tbody { display: block; min-width: 0; }
  .workflow-layout .pm-dispatch-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .workflow-layout .pm-table-scroll:has(.pm-dispatch-table) { border: 0; background: transparent; }
  .workflow-layout .pm-dispatch-table tbody tr {
    display: grid; grid-template-columns: auto minmax(0,1fr); gap: 8px 12px;
    background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 8px;
  }
  .workflow-layout .pm-dispatch-table td { border: 0; padding: 0; min-width: 0; overflow-wrap: anywhere; }
  .workflow-layout .pm-dispatch-table td:nth-child(n+3) { grid-column: 2; }
  .workflow-layout .pm-dispatch-table td:only-child { grid-column: 1/-1; }
  .workflow-field-caption { display: inline; margin-inline-end: 8px; color: var(--muted); font-size: 12px; }
  .workflow-layout .work-panel .pm-toolbar > label { min-width: 0; max-width: 100%; }
  .workflow-layout select { max-width: 100%; }
}
@media (prefers-reduced-motion: no-preference) {
  .workflow-layout .pm-pool-card, #labelDialog[open] { animation: workspace-enter 160ms var(--ease); }
}

.office-lookup { min-width: 0; padding-top: 14px; border-top: 1px solid var(--line); }
.office-lookup p:empty { display: none; }
.office-candidates { max-height: 320px; overflow: auto; list-style: none; padding: 0 6px 0 0; }
.office-candidates li { display: grid; gap: 5px; padding: 12px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.office-candidates small { color: var(--muted); }
.spb-search { margin-block: 1rem; }
.spb-results { list-style: none; padding: 0; max-height: 16rem; overflow: auto; }
.spb-results li { margin-block: .3rem; }
.spb-results button { text-align: start; white-space: normal; }
.spb-compare { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,14rem),1fr)); gap: .75rem; }
.spb-compare article { padding: .85rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow-wrap: anywhere; }
.spb-compare h4 { margin: 0 0 .6rem; }
.download-regions, .branch-offices { list-style:none; padding:0; }
.download-regions > li { padding-block:8px; border-bottom:1px solid var(--line); }
.download-regions > li > p { margin:4px 0; color:var(--muted); }
.job-progress-row { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:6px 22px; align-items:center; padding:10px 0; color:var(--muted); font-size:13px; }
.job-progress-label, .job-progress-counts { display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 12px; }
.job-progress-label { justify-content:space-between; font-weight:600; color:var(--ink); }
.job-progress-row strong { font-variant-numeric:tabular-nums; color:var(--ink); }
.job-progress-row progress, .job-empty-track { display:block; width:100%; height:7px; margin-top:6px; border-radius:9px; }
.job-progress-row progress { accent-color:var(--muted); }
.office-progress-row progress { accent-color:var(--brand-strong); }
.job-empty-track { background:var(--line); }
@media (max-width:700px) { .job-progress-row { grid-template-columns:minmax(0,1fr); } }
.job-metrics { display:flex; flex-wrap:wrap; gap:4px 20px; margin:6px 0; color:var(--muted); }
.job-metrics strong { color:var(--ink); font-variant-numeric:tabular-nums; }
.branch-heading { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:4px 12px; }
.branch-heading button.branch-toggle { flex:1; display:flex; align-items:center; gap:9px; min-height:42px; padding:6px 8px; border:0; text-align:start; background:transparent; color:var(--ink); font:inherit; font-weight:600; }
.branch-heading .branch-toggle:is(:hover,:focus-visible) { background:var(--active); }
.branch-toggle i { flex:none; width:7px; height:7px; border:solid var(--brand-strong); border-width:0 2px 2px 0; transform:rotate(-45deg); }
.branch-toggle[aria-expanded=true] i { transform:rotate(45deg); }
.branch-toggle small { margin-inline-start:auto; white-space:nowrap; font-size:12px; color:var(--muted); }
.branch-content { margin:2px 0 8px 10px; padding-inline-start:clamp(6px,1.2vw,16px); border-inline-start:2px solid var(--line); }
.branch-content > p { margin:6px 0; color:var(--muted); }
.branch-offices { margin:0; }
.branch-offices li { display:flex; align-items:center; flex-wrap:wrap; gap:5px 14px; padding:12px 0; border-top:1px solid var(--line); }
.branch-offices .office-entry { flex:1 1 12rem; }
.branch-content .catalog-pager { margin-block-end:10px; }
.spb-compare a { margin-inline-end: .5rem; }
.office-book #officeBookList { margin-top: 12px; }
.office-book .office-candidates { padding: 0 4px; }
.office-book .office-candidates li { padding: 3px 0; border: 0; }
.office-book .office-book-choice { display: grid; gap: 3px; width: 100%; text-align: start; white-space: normal; overflow-wrap: anywhere; color: var(--ink); background: var(--surface); border: 1px solid var(--line); }
.office-book .office-book-choice:is(:hover,:focus-visible) { border-color: var(--brand-strong); }
.office-map iframe { display: block; width: 100%; height: clamp(200px,36vh,360px); margin-block: 10px; border: 1px solid var(--line); border-radius: 10px; }

/* Downloaded office directory */
.catalog-heading, .area-heading, .catalog-pager, .office-actions {
  display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px 16px;
}
.workflow-layout .catalog-heading h2 { margin:0; font-size:22px; }
.catalog-heading { margin-bottom:18px; }
.catalog-heading > span, .catalog-feedback, .catalog-pager, .office-entry p, .office-entry > span { color:var(--muted); }
.downloaded-browser { padding:16px; border-radius:12px; background:var(--field); border:1px solid var(--line); min-width:0; }
.area-heading { font-size:14px; }
.area-heading nav { display:flex; align-items:center; flex-wrap:wrap; gap:6px; color:var(--muted); }
.area-heading nav button, .office-actions button {
  background:transparent; color:var(--brand-strong); padding:4px 2px; min-height:32px; border:none; font:inherit;
}
.area-heading nav b { color:var(--ink); }
.area-choices { display:flex; flex-wrap:wrap; gap:8px; margin-top:12px; }
.area-choices button {
  display:inline-flex; align-items:center; gap:10px; min-height:38px; padding:5px 12px;
  color:var(--ink); border:1px solid var(--stroke); background:var(--surface); font-weight:600;
}
.area-choices button span { color:var(--brand-strong); font-size:12px; font-variant-numeric:tabular-nums; }
.area-choices i { font-size:18px; color:var(--muted); font-style:normal; }
.area-choices button:is(:hover,:focus-visible), .catalog-pager button:not(:disabled):hover { border-color:var(--brand-strong); background:var(--active); }
.catalog-search { display:flex; align-items:stretch; gap:8px; margin:16px 0; }
.catalog-search label { flex:1; min-width:0; }
.catalog-search input { width:100%; }
.catalog-search button { background:#00843d; border:0; color:white; font-weight:650; padding-inline:20px; }
.catalog-feedback { font-size:13px; margin:8px 0; }
.catalog-list { list-style:none; margin:0; padding:0; }
.catalog-list > li { display:grid; grid-template-columns:minmax(0,1fr) auto auto; align-items:center; gap:12px 26px; padding:18px 0; border-top:1px solid var(--line); }
.office-entry { display:grid; min-width:0; gap:5px; overflow-wrap:anywhere; }
.office-entry strong { font-size:16px; line-height:1.4; color:var(--ink); }
.office-entry p, .office-entry > span { margin:0; font-size:14px; }
.office-entry small { color:var(--brand-strong); }
.office-postal { display:inline-flex; gap:6px; align-items:center; justify-self:start; font:600 14px/1.5 Consolas,monospace; color:var(--cover-ink); background:var(--cover); border-radius:5px; padding:3px 8px; white-space:nowrap; }
.office-postal small { font:normal 11px/1.5 system-ui,sans-serif; }
.office-actions { justify-content:start; gap:12px; font-size:13px; }
.office-actions :is(a,button) { color:var(--brand-strong); text-decoration:none; }
.office-actions :is(a,button):hover { text-decoration:underline; }
.catalog-pager { padding-top:12px; border-top:1px solid var(--line); font-size:13px; }
.catalog-pager > div { display:flex; align-items:center; gap:12px; }
.catalog-pager button { width:38px; height:38px; padding:0; color:var(--ink); border:1px solid var(--line); background:var(--field); font-size:21px; }
.catalog-pager button:disabled { opacity:.45; }
.catalog-sr { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
.spb-results button { display:flex; align-items:center; justify-content:space-between; gap:8px; width:100%; padding:12px; text-align:start; background:var(--surface); color:var(--ink); border:1px solid var(--line); }
.spb-search .catalog-pager { margin-block:8px 18px; }
@media (max-width:700px) {
  .catalog-list > li { grid-template-columns:minmax(0,1fr) auto; gap:10px; }
  .catalog-list .office-entry { grid-column:1/-1; }
  .office-actions { justify-content:end; }
  .downloaded-browser { padding:12px; }
  .spb-results button { align-items:start; flex-direction:column; }
}

@media (max-width: 700px) {
  .area-choices { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,8rem),1fr)); }
  .area-choices button span { margin-inline-start:auto; }
}
.install-layout { max-width:800px; }
.install-layout .form-error, #accountApp [data-error="true"] { color:var(--danger, #b42318); }
#platformApp :is(output, .account-settings-section p), #accountApp .account-session-row { overflow-wrap:anywhere; }
#platformApp fieldset, #accountApp fieldset, #notificationApp fieldset { min-width:0; }
#platformApp .form-actions { flex-wrap:wrap; }
#platformApp .form-actions label { min-width:0; max-width:100%; }
.settings-surface {
  min-width:0; margin-block:0 20px; padding:clamp(16px,2.4vw,28px);
  background:var(--surface); border:1px solid var(--line); border-radius:var(--radius);
}
.settings-surface > h2:first-child { margin-block-start:0; }
.settings-surface > :last-child { margin-block-end:0; }
:root[data-theme="dark"] .app-header .qsl-logo { filter:invert(1) !important; }

/* Record editor: keep actions available while the paperwork scrolls. */
body:has(.record-editor[open]) { overflow:hidden; }
body dialog.record-editor {
  width:min(840px,calc(100% - 40px)); max-width:none; max-height:min(90dvh,960px);
  padding:0; overflow:hidden; color:var(--ink); background:var(--surface);
}
.record-editor[open] { display:flex; flex-direction:column; }
.record-editor > .pm-dialog-heading, .record-editor > .editor-actions {
  flex:none; padding:12px clamp(16px,3vw,28px); margin:0; background:var(--surface);
}
.record-editor .pm-dialog-heading h2 { font-size:clamp(18px,2vw,23px); }
.record-editor .pm-dialog-heading h2:focus { outline:0; }
.record-editor .editor-scroll {
  min-height:0; overflow:auto; overscroll-behavior:contain; scrollbar-gutter:stable;
  padding:20px clamp(16px,3vw,28px); scroll-padding-block:16px;
}
.record-editor .editor-group { background:var(--surface); margin-bottom:16px; }
.record-editor .editor-group:last-child { margin-bottom:0; }
.record-editor .pm-fields { align-items:start; }
.record-editor .field-error { font-size:13px; font-weight:500; }
.record-editor .editor-actions { border-top:1px solid var(--line); }
.record-editor .editor-buttons { display:flex; flex-wrap:wrap; align-items:center; justify-content:end; gap:8px; }
.record-editor #deleteLetter { margin-inline-end:auto; color:var(--danger); }
.record-editor #printLetter:not([hidden]) { display:inline-flex; align-items:center; justify-content:center; text-decoration:none; }
.record-editor .editor-buttons > *, .record-editor #closeEditor { min-height:44px; }
.record-editor button:is(:not([class]),[class=""]) {
  min-height:44px; padding:8px 12px; border:1px solid var(--line); border-radius:9px;
  background:var(--surface); color:var(--ink); cursor:pointer;
}
.record-editor button:is(:not([class]),[class=""]):hover:not(:disabled) { border-color:var(--stroke); background:var(--hover); }
.record-editor #closeEditor { width:44px; flex:none; }
.record-editor #editorStatus { min-height:0; margin:0; overflow-wrap:anywhere; }
.record-editor #editorStatus:not(:empty) { margin:0 0 8px; max-height:min(6em,20dvh); overflow:auto; font-size:14px; }
.record-editor #editorStatus:is([data-state="error"],[data-state="validation"]) { color:var(--danger); }
.record-editor #editorStatus[data-state="success"] { color:var(--success); }
.record-editor #poolEditor, .record-editor #savedDetails { margin-top:24px; }
.record-editor #poolContents { min-width:0; }
.record-editor .pm-qr-row > div { min-width:0; }
@media (max-width:600px) {
  body dialog.record-editor {
    position:fixed; inset:var(--editor-top,0px) 0 auto; margin:0; width:100%;
    height:min(100dvh,var(--editor-height,100dvh)); max-height:none; border:0; border-radius:0;
  }
  .record-editor > .pm-dialog-heading { padding:8px 14px; padding-top:max(8px,env(safe-area-inset-top)); }
  .record-editor .editor-scroll { padding:14px 12px; scrollbar-gutter:auto; }
  .record-editor > .editor-actions { padding:8px 12px max(8px,env(safe-area-inset-bottom)); }
  .record-editor .editor-buttons > * { padding-inline:10px; }
  .record-editor .editor-buttons { gap:6px; }
  .record-editor .editor-buttons:has(#printLetter[hidden]) #saveLetter { flex:1; }
  .record-editor :is(.pm-fields input,.pm-fields select,.pm-fields textarea) { font-size:16px; }
}
.pool-shortcuts, .pool-add-row, .pool-stepper { display:flex; align-items:center; gap:8px; }
.pool-shortcuts { flex-wrap:wrap; margin-bottom:16px; }
.record-editor .pool-shortcuts button { color:var(--brand-strong); background:var(--field); }
.pool-section { margin:10px 0; border:1px solid var(--line); border-radius:12px; background:var(--surface); scroll-margin-top:3rem; }
.pool-section > summary {
  display:flex; align-items:center; gap:8px; padding:12px 14px; min-height:48px;
  cursor:pointer; font-weight:650; list-style:none;
}
.pool-section > summary::-webkit-details-marker { display:none; }
.pool-section > summary::before { content:''; width:7px; height:7px; flex:none; border:solid var(--brand-strong); border-width:0 2px 2px 0; transform:rotate(-45deg); }
.pool-section[open] > summary::before { transform:rotate(45deg); }
.pool-section > summary small { margin-left:auto; font-weight:500; color:var(--muted); }
.pool-camera-state { display:none; font-size:12px; color:var(--brand-strong); }
#poolScanSection:has(#poolVideo:not([hidden])) .pool-camera-state { display:inline; }
.pool-section-content { min-width:0; margin:0; padding:14px; border:0; border-top:1px solid var(--line); }
.pool-add-row { align-items:end; flex-wrap:wrap; }
.pool-add-row label { flex:1; }
.pool-draft-card { margin-top:14px; padding:14px; border:1px solid var(--line); border-radius:10px; min-width:0; }
.pool-draft-card header { display:flex; justify-content:space-between; align-items:center; gap:8px; margin-bottom:12px; }
.pool-draft-card header h4 { margin:0; overflow-wrap:anywhere; }
.pool-draft-card header button { flex:none; }
.pool-draft-card > p, .pool-empty, .pool-quantity small, .pool-draft-card > small { color:var(--muted); }
.pool-draft-card .field-error { color:var(--danger); }
.pool-quantity { display:flex; align-items:center; gap:8px; flex-wrap:wrap; border-top:1px solid var(--line); margin-top:12px; padding-top:12px; }
.pool-quantity > div:first-child { flex:1; min-width:6rem; overflow-wrap:anywhere; }
.pool-stepper { gap:3px; }
.pool-stepper input { width:4.2rem; text-align:center; appearance:textfield; }
.pool-stepper input::-webkit-inner-spin-button { appearance:none; }
.record-editor .pool-stepper button { width:44px; height:44px; padding:0; font-size:18px; }
.pool-fill { min-height:44px; }
.pool-scan-form { display:flex; align-items:end; flex-wrap:wrap; gap:8px; }
.pool-scan-form label { flex:1 1 12rem; min-width:0; }
.pool-camera-controls { margin:12px 0; }
.pool-scan-help summary { padding-block:10px; cursor:pointer; color:var(--brand-strong); }
#poolFinish { margin-top:12px; }
.pack-views { display:flex; width:fit-content; padding:3px; gap:3px; margin-bottom:16px; background:var(--field); border:1px solid var(--line); border-radius:12px; }
.pack-views button { color:var(--ink); min-height:44px; }
.pack-views button[aria-pressed="true"] { background:var(--cover); color:var(--cover-ink); font-weight:650; }
.pack-person { background:var(--surface); border:1px solid var(--line); border-radius:14px; margin:10px 0; }
.pack-person-toggle { display:flex; align-items:center; gap:12px; width:100%; padding:14px 16px; text-align:start; border:0; border-radius:14px; background:transparent; color:var(--ink); cursor:pointer; }
.pack-person-toggle > span { min-width:0; overflow-wrap:anywhere; }
.pack-person-toggle small,.pack-review small { display:block; color:var(--muted); }
.pack-person-toggle i { width:8px; height:8px; flex:none; border:solid var(--brand-strong); border-width:0 2px 2px 0; transform:rotate(-45deg); }
.pack-person-toggle[aria-expanded=true] i { transform:rotate(45deg); }
.pack-tally { margin-inline-start:auto; flex:none; text-align:end; color:var(--brand-strong); }
.pack-person-toggle .pack-camera-state { display:none; }
.pack-person:has(video:not([hidden])) .pack-camera-state { display:block; }
.pack-person .pack-workspace { padding:14px; border-top:1px solid var(--line); }
.pack-person .pack-tools { margin:0; padding:0; border:0; box-shadow:none; }
.pack-tools #dispatchScanForm,.pack-tools .pack-unit-list { margin-top:16px; }
.pack-review > summary { min-height:44px; padding:10px 0; cursor:pointer; }
.pack-review ul { margin:0 0 12px; padding:0; list-style:none; max-height:16rem; overflow:auto; }
.pack-review li { display:flex; align-items:center; justify-content:space-between; gap:8px; overflow-wrap:anywhere; padding-block:6px; border-top:1px solid var(--line); }
.pack-address-choices button { margin:0 8px 8px 0; max-width:100%; overflow-wrap:anywhere; }
.pack-address-toggle { min-height:44px; padding-inline:0; color:var(--brand-strong); background:transparent; border:0; cursor:pointer; }
.return-person,.return-batch { min-width:0; background:var(--surface); border:1px solid var(--line); border-radius:14px; margin-block:10px; }
.return-search { margin-block:12px; }
.return-person .return-list { padding:0 12px; }
.return-batch { overflow-wrap:anywhere; }
.return-batch h3 { margin:0; font-size:1rem; }
.return-batch h3:not(:has(button)),.return-detail { padding:14px 16px; }
.return-toggle { width:100%; display:flex; align-items:center; justify-content:space-between; text-align:start; background:transparent; color:var(--ink); padding:12px 14px; border:0; }
.return-toggle::after { content:''; width:8px; height:8px; flex:none; border:solid var(--brand-strong); border-width:0 2px 2px 0; transform:rotate(-45deg); margin:8px; }
.return-toggle[aria-expanded=true]::after { transform:rotate(45deg); }
.return-toggle span,.return-registration label { min-width:0; }
.return-toggle small,.return-units small { display:block; font-weight:400; color:var(--muted); }
.return-detail { border-top:1px solid var(--line); }
.return-detail h4 { margin:0 0 6px; }
.return-detail > p { margin:0 0 12px; }
.return-units { list-style:none; margin:0 0 12px; padding:0; max-height:18rem; overflow:auto; }
.return-units li { padding:6px 0; border-bottom:1px solid var(--line); }
.return-labels { display:flex; align-items:center; flex-wrap:wrap; gap:12px; margin-bottom:12px; }
.return-labels svg { display:block; width:84px; height:84px; background:white; }
.return-labels a { display:flex; align-items:center; min-height:44px; color:var(--brand-strong); }
.return-labels a:last-child { width:fit-content; padding:0 12px; background:var(--cover); color:var(--cover-ink); border-radius:9px; font-weight:600; text-decoration:none; }
.return-labels a:last-child:hover { text-decoration:underline; }
.return-registration { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; border-top:1px solid var(--line); padding-top:14px; }
.return-registration h4,.return-registration .field-error { grid-column:1/-1; }
.return-registration input { width:100%; }
.return-registration button { min-height:44px; }
.return-sent,.return-feedback { color:var(--brand-strong); }
.participant-batch-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.workflow-layout .participant-batch-heading h2 { margin:0; }
.participant-parcel-meta { display:grid; grid-template-columns:auto minmax(0,1fr); gap:6px 14px; margin:0 0 16px; }
.participant-parcel-meta dt { color:var(--muted); }
.participant-parcel-meta dd { margin:0; overflow-wrap:anywhere; }
@media(max-width:600px){
  .return-detail { padding:12px; }
  .return-registration { grid-template-columns:1fr; }
  .return-registration input { font-size:16px; }
}
@media(max-width:600px){
  .pack-person .pack-workspace { padding:12px; }
  .pack-person .pm-table-scroll { margin-block:10px; }
  .pack-person .pack-tools #dispatchScanForm label { flex-basis:100%; }
  .pack-person .pack-tools button,.pack-review button { min-height:44px; }
  .pack-person .pm-dispatch-table td:nth-child(3) { font-size:13px; color:var(--muted); }
}
#poolStatus:not(:empty) { position:sticky; top:0; z-index:1; padding:8px 12px; background:var(--cover); color:var(--cover-ink); border-radius:8px; overflow-wrap:anywhere; }
#poolStatus:empty { display:none; }
@media(max-width:600px) {
  .pool-section-content, .pool-draft-card { padding:10px; }
  .pool-shortcuts { gap:4px; }
  .record-editor .pool-shortcuts button { padding-inline:8px; }
  .pool-quantity > div:first-child { flex-basis:100%; }
  .pool-stepper input { font-size:16px; }
}


/* Keep navigation, page identity and related feedback in consistent surfaces. */
.admin-shell main.layout:has(> .ledger-cover) {
  width:100%; max-width:1440px; min-width:0; padding:clamp(18px,3vw,44px);
}
main > .ledger-cover { margin:0 0 22px; }
.ledger-intro { max-width:66%; overflow-wrap:anywhere; }
.ledger-intro p:last-child { margin-bottom:0; }
.settings-heading, .mail-test-actions, .verification-notice {
  display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px 20px;
}
.settings-heading h2, .mail-test-actions p, .verification-notice p { margin:0; }
.settings-heading { margin-bottom:16px; }
.settings-link {
  display:inline-flex; align-items:center; justify-content:center; min-height:44px;
  padding:8px 14px; border:1px solid var(--stroke); border-radius:9px;
  color:var(--cover-ink); background:var(--cover); font-weight:600; text-decoration:none;
}
.settings-link:hover { text-decoration:underline; }
.verification-notice, .inline-feedback, .shipment-mail-note {
  margin:14px 0 0; padding:12px 16px; border:1px solid var(--line); border-radius:10px;
  background:var(--field); color:var(--ink); overflow-wrap:anywhere;
}
.inline-feedback[data-error="true"], .shipment-mail-note[data-error="true"] { color:var(--danger); }
.notification-template-tools { display:flex; flex-wrap:wrap; align-items:end; gap:10px; margin-top:16px; }
.notification-template-tools label { width:min(18rem,100%); }
.mail-test-actions { margin-top:14px; }
.template-controls { display:grid; gap:14px; }
.invite-management > fieldset + fieldset { border-top:1px solid var(--line); padding-top:20px; margin-top:20px; }
.settings-surface > [role="status"]:empty, .invite-management output:empty { display:none; }
body .platform-audit.settings-surface { border:1px solid var(--line); }
.workflow-layout .shipment-batch-bar { padding:0; }
.shipment-batch-note { color:var(--muted); border-top:1px solid var(--line); padding-top:12px; margin:15px 0 0; }
.workspace-empty, .return-panel .pack-empty {
  display:grid; place-content:center; justify-items:center; gap:10px; grid-column:1/-1;
  min-height:116px; padding:24px; margin:0; text-align:center; color:var(--muted);
  background:var(--surface); border:1px solid var(--line); border-radius:var(--radius);
}
.workspace-empty::before, .return-panel .pack-empty::before {
  content:''; width:24px; height:24px; background:currentColor;
  mask:url('/assets/vendor/lucide/navigation/Mail.svg') no-repeat center / contain;
}
.gallery-empty::before { mask-image:url('/assets/vendor/lucide/navigation/Image.svg'); }
.return-panel .pack-empty { background:var(--field); }
.workflow-layout .pm-table td.unit-empty { text-align:center; padding:24px; color:var(--muted); }
#shipmentStatus.workspace-empty { min-height:116px; }
.workflow-layout #myPoolCounts + .workflow-pager, #pagination, #galleryPagination {
  padding:10px 14px; border:1px solid var(--line); border-radius:var(--radius); background:var(--surface);
}
@media (max-width:600px) {
  .admin-shell main.layout:has(> .ledger-cover) { padding:16px 12px 26px; }
  main > .ledger-cover { margin-bottom:14px; }
  .ledger-intro { max-width:60%; }
  .ledger-intro .primary-button { max-width:100%; white-space:normal; }
  .verification-notice { align-items:flex-start; flex-direction:column; }
  .notification-template-tools label { flex:1; min-width:9rem; }
}

.shipment-result-panel {
  background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); overflow:hidden;
}
.shipment-result-panel #shipmentStatus, .shipment-result-panel .shipment-results {
  margin:0; border:0; border-radius:0;
}
.shipment-result-panel .shipment-pagination { padding:12px 16px; margin:0; border-top:1px solid var(--line); }
.record-tools #pageStatus { flex-basis:100%; margin:0; color:var(--muted); }
.audit-results { margin-top:16px; }
.audit-results .audit-rows:empty { display:none; }
.audit-results .workspace-empty, .download-queue .workspace-empty { background:var(--field); }
.audit-results .workspace-empty::before { mask-image:url('/assets/vendor/lucide/navigation/LayoutList.svg'); }
.download-settings .pm-fields { align-items:start; }
.download-settings .pm-fields > div { display:grid; gap:8px; min-width:0; }
.download-settings form .pm-toolbar { margin-top:14px; }
.download-settings small { color:var(--muted); }
.download-settings > .pm-toolbar { border-top:1px solid var(--line); padding-top:14px; margin-top:16px; }
.download-queue h3 { margin:0 0 12px; }
.download-queue .workspace-empty::before { mask-image:url('/assets/vendor/lucide/navigation/Inbox.svg'); }
.download-queue .download-regions:empty { margin:0; }

.platform-columns { display:grid; gap:16px; align-items:start; margin:16px 0; }
.platform-columns > section { min-width:0; }
#platformApp .platform-columns > section { margin:0; }
#platformApp #createUser { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,13rem),1fr)); gap:16px; align-items:start; }
#platformApp #createUser button { grid-column:1/-1; justify-self:start; }
#platformAdmin > h2 { margin:0 0 16px; }
#platformAdmin .mail-fields > .checkbox-label { background:var(--field); border-radius:8px; padding:10px 12px; margin-bottom:14px; }
#platformApp .invite-policy { gap:12px; }
#platformApp .invite-policy input[type=number] { max-width:10rem; }
#platformApp :is(.invite-policy button,#createInvite) { width:fit-content; justify-self:start; }
#platformApp :is(#initialRule,.invite-management fieldset > p) { font-size:13px; font-weight:normal; color:var(--muted); }
#platformApp :is(#inviteList,#platformUsers):empty { display:none; }
.mail-summary { display:flex; flex-wrap:wrap; gap:12px 36px; margin:14px 0 0; }
.mail-summary > div { border-inline-start:3px solid var(--line); padding-inline-start:12px; }
.mail-summary dt { color:var(--muted); font-size:13px; }
.mail-summary dd { margin:4px 0 0; }
.email-verification { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:14px 20px; padding:14px 16px; background:var(--field); border:1px solid var(--line); border-radius:12px; }
.email-identity, .email-actions { display:flex; align-items:center; gap:10px; min-width:0; }
.email-identity > div { min-width:0; }
.email-address { display:block; overflow-wrap:anywhere; font-size:16px; }
.email-mark { display:grid; place-items:center; flex:none; width:40px; height:40px; border-radius:10px; background:var(--cover); color:var(--cover-ink); }
.email-mark::before, .verify-refresh-icon { content:''; display:block; width:19px; height:19px; background:currentColor; mask:center/contain no-repeat url('/assets/vendor/lucide/navigation/Mail.svg'); }
.verify-refresh-icon { mask-image:url('/assets/vendor/lucide/refresh-cw.svg'); }
#emailVerificationState { font-size:13px; color:var(--muted); }
#emailVerificationState[data-verified="true"] { color:var(--brand-strong); }
.email-editor { margin-top:14px; }
.email-editor summary { width:fit-content; cursor:pointer; padding:6px 0; font-weight:600; color:var(--brand-strong); }
#accountEmailFields { margin-top:12px; align-items:end; grid-template-columns:repeat(2,minmax(0,20rem)) auto; justify-content:start; }
#notificationSettingsStatus { font-size:13px; color:var(--muted); overflow-wrap:anywhere; }
#notificationSettingsStatus[data-state="saved"] { font-weight:600; color:var(--brand-strong); }
#notificationSettingsStatus[data-state="error"] { color:var(--danger); }
@media (max-width:700px) {
  #accountEmailFields { grid-template-columns:minmax(0,1fr); }
  .email-verification { padding:12px; }
  .email-actions { flex-wrap:wrap; }
}
@media (min-width:1100px) { .platform-columns:has(#platformAdmin:not([hidden])) { grid-template-columns:minmax(0,1.35fr) minmax(0,1fr); } }
