:root{--red:#c52b32;--red-dark:#a71f27;--ink:#202a3a;--muted:#647083;--line:#e3e7ee;--bg:#f5f6f9;--surface:#fff;--surface-soft:#fafbfd;--surface-hover:#f2f4f7;--readonly:#f3f4f7;--border-soft:#eff1f5;--field-border:#7b8798;--amber:#fff3dd;--warning-text:#93610e;--warning-border:#d4bb88;--green:#e6f4eb;--success-text:#267344;--success-border:#cae8d3;--error-bg:#fff0f0;--error-text:#a71f27;--error-border:#f4c9ce;--neutral:#eef0f3;--disabled-bg:#e9edf2;--disabled-border:#d5dce5;--sailing:#3482d4;--sailing-bg:#e5f0fc;--sailing-text:#2466a5;--arrived:#9663c8;--arrived-bg:#eee7f9;--arrived-text:#7041a2;--delivered:#47a16a;--complete-text:#496357;--brand-red:#f00000;--brand-ink:#161616;--shadow-card:#22335504;--shadow-soft:#0002;--shadow-dialog:#0004;--backdrop:#0006;--shadow-panel:#17203135;--focus-halo:#c52b3210;--surface-alt:var(--surface-soft);--border:var(--line);--space-5:24px;--danger:var(--red-dark);--radius:13px;--cell-gap:8px}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font:14px/1.55 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}a{color:var(--red-dark);text-decoration:none}a:hover{text-decoration:underline}button,a.button{font:inherit;cursor:pointer;border:1px solid transparent;border-radius:8px;background:var(--red);color:var(--surface);padding:10px 16px;font-weight:600;white-space:nowrap;display:inline-block;text-align:center}button:hover,a.button:hover{background:var(--red-dark);text-decoration:none}button:disabled{cursor:default;opacity:.65}.secondary,a.button.secondary{background:var(--surface);border-color:var(--line);color:var(--ink)}.secondary:hover,a.button.secondary:hover{background:var(--surface-hover)}.ghost{background:transparent;color:var(--muted);padding:6px 10px;border-color:var(--line)}.ghost:hover{background:var(--readonly);color:var(--ink)}.topbar{background:var(--surface);border-bottom:1px solid var(--line);height:88px;display:flex;align-items:center;justify-content:space-between;padding:16px 38px;gap:20px}.brand{display:flex;align-items:center;gap:18px;color:var(--ink);font-size:23px;font-weight:750}.brand:hover{text-decoration:none}.brand img{width:120px;height:48px;object-fit:contain}.brand small{font-size:11px;font-weight:500;letter-spacing:.05em;color:var(--muted);display:block}.account{display:flex;gap:18px;align-items:center;font-size:12px}.account span>small{display:block;color:var(--muted)}.account form{margin:0}.nav{background:var(--surface);padding:0 38px;display:flex;gap:24px;border-bottom:1px solid var(--line);overflow-x:auto}.nav a{display:block;padding:15px 3px;color:var(--muted);font-weight:600;border-bottom:3px solid transparent;white-space:nowrap}.nav a.active{border-color:var(--red);color:var(--red-dark)}main{padding:24px 38px;max-width:1720px;margin:auto;min-height:calc(100vh - 240px)}footer{padding:25px 38px;color:var(--muted);font-size:11px;text-align:center}.test-strip{font-size:11px;color:var(--warning-text);margin-bottom:18px;letter-spacing:.03em}.heading{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:24px}.heading h1{margin:4px 0 5px;font-size:29px;line-height:1.25;letter-spacing:-.035em}.heading h2{margin:0}.heading p{color:var(--muted);margin:0}h2{font-size:18px;margin:0 0 18px}h1{letter-spacing:-.03em}.actions{display:flex;gap:10px;flex-wrap:wrap}.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:24px;margin-bottom:22px;box-shadow:0 3px 16px var(--shadow-card)}.table-wrap{overflow-x:auto;padding:10px 0 4px}.table-wrap>h2,.table-wrap>.heading,.table-wrap>p{margin:14px 24px 18px}.metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:18px}.metrics .card{border-top:3px solid var(--red);padding:21px 24px}.metrics small{display:block;color:var(--muted);font-size:11px}.metrics strong{font-size:25px;display:block;margin-top:7px;letter-spacing:-.04em;font-variant-numeric:tabular-nums}table{border-collapse:collapse;width:100%;font-size:12px;font-variant-numeric:tabular-nums}th{text-align:left;color:var(--muted);background:var(--surface-soft);border-bottom:1px solid var(--line);font-weight:600;font-size:10px;text-transform:uppercase;letter-spacing:.045em;white-space:nowrap}td,th{padding:14px 16px;vertical-align:middle}th{vertical-align:top}td{border-bottom:1px solid var(--border-soft)}tr:last-child td{border-bottom:0}tbody tr:hover{background:var(--surface-soft)}td small{display:block;color:var(--muted);font-size:10px}td a{color:var(--ink)}td a:hover{color:var(--red)}.strong{font-weight:650}.empty{text-align:center;color:var(--muted);padding:45px 20px}.prepared{background:var(--amber)}.completed td{color:var(--complete-text)}.badge{border-radius:6px;padding:4px 8px;background:var(--neutral);color:var(--muted);font-size:10px;display:inline-block;white-space:nowrap}.badge.green{background:var(--green);color:var(--success-text)}.badge.amber{background:var(--amber);color:var(--warning-text)}.check{padding:5px 9px;font-size:11px;border:1px solid var(--line);background:var(--surface);color:var(--muted);border-radius:6px;font-weight:500;display:inline-flex;align-items:center;justify-content:center}.check.yes{background:var(--green);border-color:var(--success-border);color:var(--success-text)}.check:hover{background:var(--surface-hover);color:var(--ink)}.payment-table{min-width:1160px}input,select,textarea{font:inherit;width:100%;border:1px solid var(--line);border-radius:7px;padding:10px 12px;background:var(--surface);color:var(--ink);outline:none}input:focus,select:focus,textarea:focus{border-color:var(--red);box-shadow:0 0 0 3px var(--focus-halo)}input[type=checkbox]{width:auto;margin-right:8px;accent-color:var(--red)}input[type=hidden]{display:none}input:disabled{background:var(--readonly);color:var(--muted)}label{display:block;font-size:12px;font-weight:600;margin-bottom:8px}label>input,label>textarea{margin-top:7px}form>label{margin:16px 0}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px}.field>small{display:block;color:var(--muted);font-size:11px;margin-top:8px}.field.wide{grid-column:1/-1}.card.form-card{max-width:1000px}.form-actions{display:flex;gap:18px;align-items:center;margin-top:28px}.draft-status{color:var(--muted);font-size:11px;padding-bottom:18px;border-bottom:1px solid var(--line);margin-bottom:24px}.errorlist{color:var(--error-text);padding-left:20px;font-size:12px}.notice{background:var(--amber);border:1px solid var(--warning-border);color:var(--warning-text);padding:13px 17px;border-radius:9px;margin:0 0 18px;font-size:12px}.notice.error{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.notice.success{background:var(--green);border-color:var(--success-border);color:var(--success-text)}.muted{color:var(--muted)}.small{font-size:11px}.mono{font-family:ui-monospace,SFMono-Regular,Consolas,monospace}.break{word-break:break-all}.card.auth{max-width:460px;margin:42px auto;padding:34px}.auth h1{font-size:27px;margin:8px 0 16px}.auth label{margin-top:18px}.auth button{width:100%;margin-top:24px}.qr{width:220px;height:220px;display:block;margin:20px auto}.codes{font-family:monospace;columns:2;list-style:none;padding:0;line-height:2.5}.detail-grid{display:grid;grid-template-columns:190px 1fr;gap:15px;margin:0}.detail-grid dt{color:var(--muted);font-size:12px}.detail-grid dd{margin:0}.mix-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:20px}.plain-list{list-style:none;margin:0;padding:0}.plain-list li{padding:10px 0;border-bottom:1px solid var(--border-soft)}.plain-list small{display:block;color:var(--muted);font-size:11px}.big-number{display:block;font-size:30px;font-weight:700;font-variant-numeric:tabular-nums}.pagination{display:flex;justify-content:center;gap:22px;color:var(--muted);font-size:12px;margin:20px}details>summary{cursor:pointer;font-weight:600}details[open]:not(.account-menu)>summary{margin-bottom:20px}pre{max-width:600px;white-space:pre-wrap;word-break:break-word}.locked-submit{opacity:.5;pointer-events:none}@media(max-width:1023px){.topbar{padding:14px 20px;height:auto}.account{gap:8px}.account>span{display:none}.nav{padding:0 20px;gap:18px}main{padding:22px 20px}.heading{align-items:flex-start;flex-direction:column}.metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.form-grid{grid-template-columns:1fr}.auth{margin:22px auto}.detail-grid{grid-template-columns:130px 1fr}}@media(max-width:767px){.brand{gap:8px;font-size:18px}.brand img{width:85px}.metrics{gap:10px}.metrics .card{padding:15px}.metrics strong{font-size:19px}.card{padding:18px}.table-wrap{padding:4px 0}.actions{width:100%}.actions .button{flex:1}footer{padding:20px}}

.shipment-reminder{display:block;margin-top:.4rem;color:var(--warning-text);max-width:28rem}dialog{max-width:36rem;width:calc(100% - 3rem);border:0;border-radius:12px;padding:1.5rem;box-shadow:0 12px 50px var(--shadow-dialog)}dialog::backdrop{background:var(--backdrop)}dialog .field{margin:1rem 0}#eta-dialog-error{color:var(--error-text)}

[hidden]{display:none!important}select:disabled,textarea:disabled{background:var(--neutral);color:var(--muted);cursor:not-allowed}.account-menu{position:relative}.account-menu>summary{list-style:none;display:flex;align-items:center;justify-content:center;width:44px;height:44px;background:var(--red);color:var(--surface);border-radius:50%;font-size:19px;margin:0}.account-menu>summary::-webkit-details-marker{display:none}.account-menu>summary:focus-visible{outline:3px solid var(--ink);outline-offset:3px}.account-panel{position:absolute;right:0;top:54px;z-index:20;min-width:220px;padding:18px;background:var(--surface);border:1px solid var(--line);border-radius:12px;box-shadow:0 8px 24px var(--shadow-soft)}.account-panel>small{display:block;color:var(--muted);margin-bottom:12px}.account-panel>a{display:block;padding:9px 0}.account-panel form{margin-top:8px}.account-panel button{width:100%;text-align:left}.editing-label{display:inline-block;background:var(--error-text);color:var(--surface);padding:6px 10px;border-radius:5px;font-size:12px;font-weight:750}.being-edited,.being-edited:hover{background:var(--error-bg)}

.form-grid>.wide{grid-column:1/-1}.inline-proforma{padding:20px;background:var(--surface-soft);border:1px solid var(--line);border-radius:8px}
.shipment-options{max-height:320px;overflow:auto;border:1px solid var(--line);border-radius:8px;padding:.75rem}.shipment-options label{display:flex;align-items:center;gap:.65rem;padding:.45rem;line-height:1.4}.shipment-options input[type=checkbox]{width:20px;height:20px;flex-shrink:0}

/* UX37–UX44: original symbol, compact wordmark and responsive content. */
.topbar{height:auto;min-height:88px;flex-wrap:wrap}
.brand{flex-shrink:0}
.brand-mark{display:block;width:52px;height:52px;flex-shrink:0}
.brand-wordmark{display:block;width:149px;height:auto;overflow:visible}
.brand-name{fill:var(--brand-red)}
.brand-subtitle{fill:var(--brand-ink)}
.account-menu{flex-shrink:0;margin-left:auto}
.account-panel{max-width:calc(100vw - 32px);overflow-wrap:anywhere}
main,.card,.field,.heading>div{min-width:0}
.card{max-width:100%}
.codes{column-width:10rem}
button,a.button{white-space:normal;min-height:44px;max-width:100%;overflow-wrap:anywhere}
.form-actions{flex-wrap:wrap}
.form-actions>#lease-status{flex-basis:100%}
.detail-grid dd{min-width:0;overflow-wrap:anywhere}
.metrics strong{overflow-wrap:anywhere}
.table-scroll{position:relative;overflow-x:auto;max-width:100%;overscroll-behavior-x:contain}
.cancelled{opacity:1;background:var(--readonly)}

@media(max-width:767px){
 .topbar{padding:14px 16px;gap:10px}
 .brand{gap:8px}
 .brand-mark{width:42px;height:42px}
 .brand-wordmark{width:142px}
 main{padding:20px 16px}
 .card{padding:16px}
 .table-wrap{padding:4px 0}
 .metrics{grid-template-columns:1fr}
 .detail-grid{grid-template-columns:1fr;gap:5px}
 .detail-grid dd{margin-bottom:12px}
 .mix-grid{grid-template-columns:minmax(0,1fr)}
 .actions,.form-actions{align-items:stretch}
 .actions .button,.form-actions>button,.form-actions>.button{flex:1 1 100%}
 .auth{padding:22px 16px}
}

.status-error{background:var(--error-bg);border:1px solid var(--error-text);color:var(--error-text);padding:12px 16px;border-radius:8px;font-size:14px}

/* UX45–UX49: navigation, readable controls and keyboard focus. */
body{line-height:1.5}
button,input,select,textarea{font-size:16px}
label{font-size:13px}
table{font-size:14px}
th{font-size:12px;text-transform:none;letter-spacing:0}
td small,.small,.badge,.field>small,.draft-status,.plain-list small,.metrics small,.test-strip,footer{font-size:12px}
.check{min-width:44px;min-height:44px;font-size:13px}
input,select,textarea{border-color:var(--field-border)}
input:disabled,select:disabled,textarea:disabled{opacity:1;color:var(--muted)}
:where(a,button,input,select,textarea,summary,[tabindex]):focus-visible{outline:3px solid var(--ink);outline-offset:2px}
.table-scroll:focus-visible{outline-offset:-3px}
.table-card{padding:16px 0}
.table-card>h2,.table-card>.heading,.table-card>p{margin:4px 24px 16px}
.table-card>.table-scroll{border-radius:0}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
.field-error-summary{border:2px solid var(--error-text);background:var(--error-bg);color:var(--error-text);padding:16px;margin-bottom:20px;border-radius:8px}
.field-error-summary h2{font-size:18px;margin-bottom:8px}
.field-error-summary a{color:var(--red-dark);text-decoration:underline}
.field:has([aria-invalid=true]){border-left:3px solid var(--error-text);padding-left:12px}
.required-mark{font-weight:500;color:var(--muted)}
@media(max-width:767px){body{font-size:16px}.table-card{padding:12px 0}.table-card>h2,.table-card>.heading,.table-card>p{margin-left:16px;margin-right:16px}}

.numeric{text-align:center;font-variant-numeric:tabular-nums;white-space:nowrap}
.show-selected{display:flex;align-items:center;gap:8px;margin-top:12px}
.show-selected>input{margin:0}
#shipment-selection-status{font-size:13px;color:var(--ink)}

input:disabled,select:disabled,textarea:disabled{color:var(--ink)}
.cancelled:hover{background:var(--readonly)}
.check-legend{margin:16px 24px 0;font-size:13px}
.check-legend[open]>summary{margin-bottom:12px}
.check-legend .detail-grid{grid-template-columns:44px minmax(0,1fr);gap:8px}
@media(max-width:767px){.check-legend{margin-left:16px;margin-right:16px}}

/* UX52-UX66: component widths, consistent filters and stable menus. */
.filters{display:flex;align-items:flex-end;gap:16px;flex-wrap:wrap;margin-bottom:20px}
.filter-field{flex:1 1 180px;min-width:0}
.filter-field.search-field{flex:2 1 300px}
.filter-field.year-field{flex:0 1 120px}
.filter-field>label{margin:0 0 8px}
.filter-field>input,.filter-field>select{display:block;width:100%;min-width:0;min-height:48px;margin:0}
.filter-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:stretch}
.filters>.field-error-summary{flex-basis:100%;width:100%;margin-bottom:0}
.site-nav{background:var(--surface);border-bottom:1px solid var(--line)}
.nav{border:0;overflow:visible;flex-wrap:wrap;gap:6px;padding:10px 38px}
.nav a{padding:10px 12px;border-bottom:3px solid transparent;border-radius:6px;white-space:normal}
.nav a.active{background:var(--error-bg);color:var(--red-dark);border-color:var(--red)}
.nav-toggle{display:flex;justify-content:space-between;align-items:center;gap:12px;width:calc(100% - 32px);margin:12px 16px;text-align:left}
.account-menu[open]>summary{margin:0}
.account-panel{width:260px;min-width:0;top:calc(100% + 8px);max-height:calc(100dvh - 130px);overflow-y:auto}
.account-panel>a{min-height:44px}
.skip-link{visibility:hidden;position:fixed;top:8px;left:16px;z-index:100;transform:translateY(-200%);background:var(--surface);border:2px solid var(--ink);padding:10px 16px;border-radius:6px}
.skip-link:focus{visibility:visible;transform:none}
.heading h1{overflow-wrap:anywhere}

.heading{margin-bottom:20px}
.page-actions{align-items:center}
.page-actions .auxiliary-actions{display:flex;gap:8px;flex-wrap:wrap}
.pagination{flex-wrap:wrap;align-items:center;gap:12px;margin:16px}
.pagination a{display:inline-flex;align-items:center;min-height:44px;padding:8px}
.result-count{color:var(--muted);font-size:13px;margin:12px 0}
.nbp-preview{min-height:126px;line-height:1.6;white-space:pre-wrap;overflow-wrap:anywhere;resize:vertical}
.mix-component{min-width:0;margin:0}
.mix-component legend{font-size:16px;font-weight:650;padding:0 8px}
.table-card>.result-count{margin:12px 24px}
td:not(.numeric){overflow-wrap:anywhere}
.table-scroll td:not(.numeric){min-width:100px;max-width:400px}
td details[open]{min-width:240px;max-width:420px}
td details input,td details textarea{display:block}
dialog{max-height:calc(100dvh - 32px);overflow-y:auto;width:calc(100% - 32px)}
@media(max-width:1023px){
 .nav{flex-direction:column;gap:4px;padding:0 16px 12px}
 .nav a{border-bottom:0;border-left:3px solid transparent;border-radius:6px}
 .nav a.active{border-color:var(--red)}
 .page-actions{width:100%}
}
@media(max-width:767px){
 main{padding:16px}
 .heading{gap:12px;margin-bottom:16px}
 .filters{display:grid;grid-template-columns:minmax(0,1fr);gap:14px}
 .filter-actions>*{flex:1 1 auto}
 .page-actions{display:flex;flex-direction:column;align-items:stretch;gap:8px}
 .page-actions>.button{width:100%;flex:none}
 .page-actions .auxiliary-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
 .page-actions .auxiliary-actions .button{flex:none;padding:10px}
 .test-strip{margin-bottom:12px}
 .notice{margin-bottom:12px}
}
@media(max-width:767px){.page-actions .auxiliary-actions{grid-template-columns:minmax(0,1fr)}}

.action-context{font-weight:600;overflow-wrap:anywhere}

.row-action{width:min(300px,calc(100vw - 96px));max-width:100%}

/* LOG1: history alone uses full-width details and vertical mobile comparisons. */
.audit-card{padding:0;overflow:hidden}
.audit-table{width:100%;table-layout:fixed}
.audit-table>thead th:nth-child(1){width:15%}
.audit-table>thead th:nth-child(2){width:15%}
.audit-table>thead th:nth-child(3){width:20%}
.audit-table>thead th:nth-child(4){width:27%}
.audit-table>thead th:nth-child(5){width:23%}
.audit-overview>td{vertical-align:top;border:0;overflow-wrap:anywhere;white-space:normal;padding-bottom:8px}
.audit-mobile-label{display:none}
.audit-detail-row>td{padding-top:0;padding-bottom:18px;border-bottom:1px solid var(--line)}
.audit-entry:last-child>.audit-detail-row>td{border-bottom:0}
.audit-details>summary{color:var(--red);min-height:44px;display:list-item;padding:10px 0;width:fit-content;max-width:100%}
.audit-details[open],.audit-technical[open]{width:100%;min-width:0;max-width:100%}
.audit-detail{border:1px solid var(--line);border-radius:8px;padding:20px;background:var(--surface);overflow-wrap:anywhere;min-width:0}
.audit-detail p{margin:0 0 16px}
.audit-context{color:var(--muted)}
.audit-context strong{color:var(--ink)}
.audit-diff{width:100%;table-layout:fixed;margin:18px 0}
.audit-diff caption{text-align:left;font-size:16px;font-weight:600;padding:8px 12px;background:var(--surface-soft)}
.audit-diff th{white-space:normal;overflow-wrap:anywhere}
.audit-diff th,.audit-diff td{padding:12px;vertical-align:top;border-bottom:1px solid var(--line)}
.audit-diff th:first-child{width:28%}
.audit-value{white-space:pre-wrap;overflow-wrap:anywhere}
.audit-technical{margin-top:18px;color:var(--muted);font-size:12px}
.audit-technical summary{min-height:44px;padding:10px 0}
.audit-technical dd{margin:0 0 12px;overflow-wrap:anywhere}
.audit-technical dt{font-weight:600}
.audit-filters .filter-field>small{display:block;color:var(--muted);font-size:12px;margin-top:6px}
@media(max-width:767px){
 .audit-card{background:transparent;border:0;overflow:visible;box-shadow:none}
 .audit-table,.audit-table>.audit-entry,.audit-overview,.audit-overview>td,.audit-detail-row,.audit-detail-row>td{display:block;width:100%}
 .audit-table>thead,.audit-diff>thead{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
 .audit-entry{background:var(--surface);border:1px solid var(--line);border-radius:12px;margin-bottom:16px;padding:16px}
 .audit-overview>td{padding:0 0 10px}
 .audit-overview>td:first-child{font-variant-numeric:tabular-nums}
 .audit-mobile-label{display:block;color:var(--muted);font-size:12px;font-weight:600;margin-bottom:2px}
 .audit-detail-row>td{padding:0;border:0}
 .audit-details>summary{width:100%}
 .audit-detail{padding:12px}
 .audit-diff,.audit-diff>tbody,.audit-diff>tbody>tr,.audit-diff>tbody>tr>td,.audit-diff>tbody>tr>th{display:block;width:100%}
 .audit-diff caption{display:block;width:100%}
 .audit-diff th:first-child{width:100%}
 .audit-diff>tbody>tr{border-bottom:1px solid var(--line);padding-bottom:8px;margin-bottom:8px}
 .audit-diff>tbody>tr>th{background:var(--surface-soft);padding:10px;border:0}
 .audit-diff>tbody>tr>td{padding:8px 10px;border:0}
 .audit-diff>tbody>tr>td:last-child{background:var(--green)}
}

/* Visible internal links and the current page path. */
main a:not(.button):not(.check){color:var(--red-dark);text-decoration:underline;text-underline-offset:.18em;text-decoration-thickness:1px}
main a:not(.button):not(.check):hover{color:var(--red-dark);text-decoration-thickness:2px}
.breadcrumbs{margin:0 0 20px;font-size:13px}
.breadcrumbs ol{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;list-style:none;margin:0;padding:0}
.breadcrumbs li{display:flex;align-items:center;gap:10px;min-width:0;overflow-wrap:anywhere}
.breadcrumbs li+li::before{content:"›";color:var(--muted);font-size:17px}
.breadcrumbs [aria-current]{color:var(--ink)}
#goods-value-dialog-error{color:var(--error-text)}

/* The header uses the same square mark as the approved application favicon. */
.brand img.brand-mark{width:52px;height:52px;object-fit:contain;flex:none}
@media(max-width:767px){.brand img.brand-mark{width:42px;height:42px}}

/* 0.1.12: matching cards and compact, responsive date groups. */
.register-tools{display:grid;grid-template-columns:minmax(0,1fr);gap:16px;margin-bottom:16px;align-items:stretch}
.register-tools>*{min-width:0}
.register-tools>.card{margin:0;padding:16px}
.register-filters{display:grid;gap:8px;align-content:start}
.register-filter-main{display:grid;grid-template-columns:minmax(0,2fr) minmax(140px,1fr);gap:12px;max-width:760px}
.register-filters label{display:block;font-weight:600;margin-bottom:6px}
.register-filters input:not([type=checkbox]),.register-filters select{width:100%}
.register-year-note{font-size:12px;line-height:1.5;margin:0;color:var(--muted)}
.register-extra-filters>summary{font-weight:600;cursor:pointer;padding:6px 0}
.register-filter-secondary{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:10px 0}
.register-date-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.register-date-grid fieldset{min-width:0;border:1px solid var(--line);border-radius:8px;padding:10px}
.register-date-grid legend{font-weight:600;font-size:13px}
.register-date-grid .check{margin-top:8px}
.date-range{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(140px,100%),1fr));gap:8px}
.date-range label{font-size:11px}
.date-range>div{min-width:0}
.register-filters .filter-actions{flex-wrap:wrap}
.selection-panel{margin:0}
.selection-actions,.selection-breakdown{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.selection-actions button{font-size:12px;padding:7px 10px}
.selection-metrics{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:12px 0}
.selection-metrics>div:last-child{grid-column:1/-1}
.selection-metrics small{display:block}
.selection-metrics strong{font-size:20px;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.selection-panel>small,.selection-panel p{font-size:12px}
.selection-breakdown{font-size:12px}
.selection-panel p{margin:8px 0}
.selection-panel details{margin-bottom:8px}
.selection-panel li{overflow-wrap:anywhere}
.selection-panel .status-error{color:var(--error-text);font-weight:600}


.selection-summary-details summary{font-weight:600;cursor:pointer}
.selection-summary-details .selection-breakdown{margin:8px 0}
.register-results-heading{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:10px 0}
.active-filter-tags{display:flex;gap:6px;flex-wrap:wrap}
.active-filter-tags a{display:inline-flex;align-items:center;gap:12px;border:1px solid var(--line);border-radius:6px;padding:5px 8px;font-size:12px;text-decoration:none}
.register-scroll-hint{display:none;font-size:12px;margin:8px 0}
.register-scroll .shipment-register{width:100%;table-layout:auto;font-size:12px}
.register-scroll .shipment-register th{padding:9px 6px;white-space:normal;line-height:1.25}
.register-scroll .shipment-register td{padding:9px 6px;min-width:0;max-width:none;line-height:1.35}
.register-scroll .shipment-register .numeric,.register-scroll .shipment-register .date-cell{white-space:nowrap;font-variant-numeric:tabular-nums}
.shipment-register .text-cell,.shipment-register .proforma-cell,.shipment-register .container-cell{overflow-wrap:break-word;word-break:normal}
.shipment-register .proforma-cell{min-width:105px}
.shipment-register .container-cell{min-width:110px}
.shipment-register .text-cell{min-width:100px}
.shipment-register .terms-cell{min-width:115px;max-width:190px;overflow-wrap:anywhere}
.terms-cell span{display:block}
.shipment-register .selection-col{padding:12px;width:42px;min-width:42px}
.shipment-register input[type=checkbox]{width:18px;height:18px;margin:0}
.shipment-register .settlement-cell{max-width:100px}
.register-scroll .shipment-reminder{font-size:10px}
.viewer-register{min-width:650px}

.withdrawal-card{max-width:900px}
.withdrawal-card .check{display:flex;gap:10px;align-items:flex-start;margin:14px 0}
.withdrawal-card .check input{flex:0 0 auto;margin-top:4px}
.withdrawal-card textarea{width:100%}
.withdrawal-blockers li{margin:12px 0}
@media(min-width:1024px){
 .register-tools.has-selection{grid-template-columns:repeat(2,minmax(0,1fr));}

 .register-tools.has-selection .register-filter-main{max-width:none}
}
@media(min-width:1280px){
 .register-scroll .shipment-register{font-size:13px}
}
@media(max-width:1023px){
 .register-tools{gap:16px}
 .register-scroll .shipment-register:not(.viewer-register){min-width:1160px}
}
@media(max-width:767px){
 .register-tools{gap:16px}
 .register-filter-main{grid-template-columns:minmax(0,1fr) 125px;gap:8px}
 .register-filter-secondary{grid-template-columns:1fr}
 .register-date-grid{grid-template-columns:minmax(0,1fr)}
 .selection-metrics{grid-template-columns:1fr}
 .selection-metrics>div:last-child{grid-column:auto}
 .selection-actions button{flex:1 1 auto}
 .selection-metrics strong{font-size:19px}
 .active-filter-tags a{padding:8px}
 .register-results-heading{gap:6px}
 .withdrawal-card{padding:16px}
}


/* Shared shell: one environment marker immediately above credits at every width. */
.brand-context{display:flex;align-items:center;gap:24px;min-width:0}
.test-strip.environment-footer{margin:0 0 8px;letter-spacing:0}
main{padding-top:12px}

/* Action spacing applies to intentional groups, including dynamically revealed actions. */
.table-actions{margin-bottom:16px}
.table-scroll+.filters,.table-scroll+.field-error-summary{margin-top:16px}
.stacked-form{display:grid;gap:16px}
.stacked-form>label{margin:0}
.stacked-form>button{justify-self:start}
.stacked-form+.button{margin-top:16px}
.row-action form{display:grid;gap:16px}
.row-action form>label{margin:0}
.row-action form>button{justify-self:start}
.field-action{margin-top:16px}
.mix-grid .muted+.table-scroll{margin-top:16px}
select:not([multiple]):where(:not([size]),[size="1"]){
 appearance:none;padding-right:42px;
 background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23202a3a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
 background-repeat:no-repeat;background-size:16px 16px;background-position:right 12px center;
}
@media(forced-colors:active){
 select:not([multiple]):where(:not([size]),[size="1"]){appearance:auto;background-image:none;padding-right:12px}
}

.permissions-fieldset{min-width:0;border:0;padding:0;margin:0}
.permissions-fieldset>legend{font-weight:650;font-size:16px;padding:0}
.permissions-fieldset>p{font-size:14px;margin:12px 0}
.permission-options{display:grid;gap:12px}
.permission-choice{border:1px solid var(--line);border-radius:8px;padding:12px 16px;min-width:0}
.permission-label{display:flex;align-items:center;gap:12px;min-height:44px;margin:0;font-size:14px}
.permission-label input[type=checkbox]{width:20px;height:20px;flex:0 0 20px;margin:0}
.permission-label strong{min-width:0;overflow-wrap:anywhere}
.permission-choice>p{margin:0 0 0 32px;font-size:14px;color:var(--muted);overflow-wrap:anywhere}



/* Explicit dictionary actions remain available beside long names. */
.dictionary-card>.heading{flex-direction:row;align-items:center;flex-wrap:wrap;gap:12px}
.dictionary-card h2{min-width:0;overflow-wrap:anywhere}
.dictionary-entry{display:flex;align-items:center;gap:12px}
.dictionary-entry-info{flex:1;min-width:0;overflow-wrap:anywhere}
.dictionary-entry>.button{flex:0 0 auto}

/* Delivery journey: keep the next action visible and each stage readable on mobile. */
.delivery-workflow .heading { margin-bottom: .5rem; }
.workflow-next { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem; margin: 1rem 0; background: var(--surface-alt, var(--surface-soft)); border-radius: .65rem; }
.workflow-next > div { flex: 1 1 18rem; min-width: 0; }
.workflow-next h3 { margin: .2rem 0; }
.workflow-next p, .workflow-step p { overflow-wrap: anywhere; }
.workflow-steps { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: .75rem; }
.workflow-step { border: 1px solid var(--line); border-radius: .65rem; padding: 1rem; min-width: 0; }
.workflow-step > strong, .workflow-step > .badge { display: block; margin-bottom: .5rem; }
.workflow-step .badge { width: fit-content; }
.workflow-step a { display: inline-block; padding: .4rem 0; }
.delivery-workflow details > summary { padding: .75rem 0; cursor: pointer; }
.settlement-cell > span, .settlement-cell > small, .table-scroll td > small { display: block; }
@media (max-width: 767px) { .workflow-next .button { width: 100%; text-align: center; } }
.preparation-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 1rem; }
.preparation-grid > div { padding: .75rem; border: 1px solid var(--line); border-radius: .5rem; }

.date-range input{min-width:0}
@media(max-width:1023px){.register-scroll-hint{display:block}}

/* Delivery reminders and compact desktop register (0.1.15). */
.notice.reminder-urgent{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}
.delivery-reminders p{margin:0 0 10px}.reminder-mobile{display:none}
.reminder-digest-list{padding-left:22px}.reminder-digest-list>li{padding:12px 0;border-bottom:1px solid var(--line)}
.reminder-digest-list p{margin:4px 0}#daily-reminder-dialog{max-width:850px}
.workflow-step{display:flex;flex-direction:column;align-items:flex-start;min-width:0}
.workflow-step .step-action{margin-top:auto;padding-top:14px}.workflow-step .step-action form{margin:0}
.workflow-step .step-action button{white-space:normal;text-align:left}.step-missing{margin:0 0 10px;padding-left:18px}

.shipment-register .editing-label{margin-top:8px;white-space:normal;overflow-wrap:anywhere;font-size:11px;padding:4px 6px}
.shipment-register .selection-col{position:relative;padding-left:12px}
.shipment-register .shipment-reminder{background:var(--error-bg);border:1px solid var(--error-border);color:var(--error-text);border-radius:5px;padding:5px}
.shipment-register .reminder-bank{background:var(--amber);border-color:var(--warning-border);color:var(--warning-text)}
.shipment-register .register-action{border:0;background:none;color:var(--red-dark);padding:0;text-align:left;white-space:normal;font-size:inherit;font-weight:500}
.register-results-heading .forward-warning{margin:0;padding:6px 10px;font-size:12px;font-weight:400}
.forward-low{background:var(--amber)}.forward-low td small{color:var(--warning-text)}
@media(min-width:1280px){
 body:has(.register-card) main{max-width:none;margin:0;padding-left:24px;padding-right:24px}
 .register-scroll .shipment-register{table-layout:auto;min-width:0;width:100%;font-size:12px}
 .shipment-register th{white-space:normal;font-size:11px;letter-spacing:0;line-height:1.35}
 .shipment-register td,.shipment-register th{padding:10px 6px;min-width:0;width:auto;max-width:none;overflow-wrap:anywhere;white-space:normal}
 .shipment-register .selection-col{width:32px;min-width:32px;padding-left:12px;padding-right:2px}
 .shipment-register .date-cell{white-space:nowrap;font-size:11px;letter-spacing:-.02em}
 .shipment-register .terms-cell,.shipment-register .settlement-cell,.shipment-register .text-cell,.shipment-register .proforma-cell,.shipment-register .container-cell{min-width:0;max-width:none;width:auto;white-space:normal}
 .register-scroll .shipment-register th{overflow-wrap:normal}
 .register-scroll .shipment-register .numeric{white-space:nowrap;font-size:11px}
 .register-scroll .shipment-register th.numeric{font-size:11px}
 .register-scroll-hint{display:none}
}
@media(max-width:1023px){
 .reminder-detail,.delivery-reminders{display:none}.reminder-mobile{display:block}
 .register-results-heading .forward-warning{max-width:100%;margin:0}
 #daily-reminder-dialog{display:none}
}



/* Full reminder text uses the delivery's width instead of stretching the proforma cell. */
.shipment-register .has-reminders td{border-bottom:0}
.shipment-register .shipment-reminders-row td{position:relative;padding:0 6px 12px 38px}
.register-reminders{display:flex;flex-wrap:wrap;align-items:flex-start;gap:6px}
.register-scroll .register-reminders .shipment-reminder{font-size:12px;line-height:1.4;max-width:100%;margin:0;padding:6px 8px}

/* 0.1.16: a row-group has one continuous state border, including its reminders. */
.shipment-group:not(:last-of-type){border-bottom:1px solid var(--line)}
.shipment-group.waiting{border-left:5px solid var(--surface)}
.shipment-group.sailing{border-left:5px solid var(--sailing)}
.shipment-group.arrived{border-left:5px solid var(--arrived)}
.shipment-group.delivered{border-left:5px solid var(--delivered)}
.card.form-card{margin-left:auto;margin-right:auto}
.register-sort{color:inherit;display:block;min-height:32px;align-content:center}
.register-sort:focus-visible{outline:2px solid var(--red);outline-offset:2px}
.shipment-register th[aria-sort="ascending"] .register-sort::after{content:" ↑";color:var(--red)}
.shipment-register th[aria-sort="descending"] .register-sort::after{content:" ↓";color:var(--red)}
@media(min-width:1280px){
 .shipment-register:not(.viewer-register) .column-select{width:2.5%}
 .shipment-register:not(.viewer-register) .column-supplier{width:6.7%}
 .shipment-register:not(.viewer-register) .column-proforma{width:7%}
 .shipment-register:not(.viewer-register) .column-container{width:7%}
 .shipment-register:not(.viewer-register) .column-goods{width:8.6%}
 .shipment-register:not(.viewer-register) .column-destination{width:4%}
 .shipment-register:not(.viewer-register) .column-value{width:6.7%}
 .shipment-register:not(.viewer-register) .column-etd,.shipment-register:not(.viewer-register) .column-actual_etd,.shipment-register:not(.viewer-register) .column-eta,.shipment-register:not(.viewer-register) .column-actual_eta,.shipment-register:not(.viewer-register) .column-delivery{width:5.6%}
 .shipment-register:not(.viewer-register) .column-terms{width:13%}
 .shipment-register:not(.viewer-register) .column-stage{width:16.5%}
 .shipment-register .container-cell{font-size:11px;white-space:nowrap}
}

/* Short desktop forms share the normal form styles and validation. */
.short-form-dialog {width:min(1000px,calc(100vw - 64px)); max-width:none; height:min(850px,calc(100dvh - 48px)); max-height:calc(100dvh - 48px); padding:0; overflow:hidden;}
.short-form-dialog[open] {display:flex; flex-direction:column;}
.short-form-bar {display:flex; justify-content:space-between; align-items:center; gap:1rem; padding:.7rem 1rem; border-bottom:1px solid var(--line,var(--line));}
.short-form-dialog iframe {display:block; width:100%; flex:1; min-height:0; border:0; background:var(--surface);}
.short-form-page main {width:100%; max-width:none; margin:0; padding:1.2rem;}
.short-form-page .form-card {max-width:none;}
.short-form-page .heading h1 {font-size:1.5rem;}
.invoice-deliveries ul {margin:.25rem 0 0; padding-left:1.2rem;}

/* Administration: readable identities and wrapping actions at narrow widths. */
.admin-users .admin-user{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,.8fr) 21rem;gap:1rem;align-items:center;padding:1rem 0;border-bottom:1px solid var(--border,var(--line))}
.admin-user small{display:block}.admin-entry-actions{display:flex;flex-wrap:wrap;gap:.4rem;align-items:center}.admin-entry-actions .button{white-space:nowrap}
.dictionary-entry{flex-wrap:wrap}.dictionary-entry-info{min-width:min(100%,12rem);overflow-wrap:anywhere}.dictionary-entry .admin-entry-actions{margin-left:auto}
.admin-roles{margin-top:1rem}.admin-roles summary{cursor:pointer;font-weight:600}.admin-roles dt{font-weight:600;margin-top:1rem}.admin-roles dd{margin:.3rem 0}.admin-roles li{margin-bottom:.65rem}
.admin-confirmation{max-width:48rem;margin-inline:auto}.admin-confirmation h2,.admin-user strong{overflow-wrap:anywhere}
@media(max-width:1023px){.admin-users .admin-user{grid-template-columns:1fr;gap:.5rem}.dictionary-entry .admin-entry-actions{margin-left:0;width:100%}}

.admin-user>.admin-entry-actions{justify-content:flex-end}.dictionary-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
@media(max-width:1023px){.admin-user>.admin-entry-actions{justify-content:flex-start}.dictionary-grid{grid-template-columns:1fr}}
/* 0.1.20: payment columns share the desktop viewport, retaining every control. */
.payment-scroll .payment-table{width:100%;min-width:1120px;table-layout:auto;font-size:12px}
.payment-scroll .payment-table th{padding:9px 6px;white-space:normal;line-height:1.3;font-size:12px}
.payment-scroll .payment-table td{min-width:0;max-width:none;padding:9px 6px;line-height:1.4;vertical-align:middle}
.payment-table .payment-column-reference{width:14%}
.payment-table .payment-column-date{width:7%}
.payment-table .payment-column-source{width:10%}
.payment-table .payment-column-amount{width:9%}
.payment-table .payment-column-rate{width:8%}
.payment-table .payment-column-check{width:4.5%}
.payment-table .payment-column-status{width:11%}
.payment-scroll .payment-table .payment-date,.payment-scroll .payment-table td.numeric{white-space:nowrap;font-variant-numeric:tabular-nums}
.payment-table .payment-reference,.payment-table .payment-source,.payment-table .payment-status{overflow-wrap:anywhere}
.payment-scroll .payment-table .payment-check{padding:9px 2px;text-align:center}
.payment-table .payment-check form{margin:0}
.payment-scroll .payment-table .payment-check a{overflow-wrap:normal;word-break:normal}
.payment-table .payment-check .check{padding:5px;min-width:44px;min-height:44px}
.payment-table .payment-status .badge{white-space:normal;overflow-wrap:normal;word-break:normal;min-width:min-content;max-width:100%;font-size:inherit;line-height:1.4}
.payment-table .payment-status small,.payment-table .payment-source small{margin-top:4px;font-size:inherit}
@media(min-width:1280px){.payment-scroll .payment-table{font-size:13px}}
/* Shared action typography: anchors and POST buttons have the same geometry. */
button,a.button{font-family:inherit;font-size:16px;line-height:1.5;white-space:normal;text-align:center}
.actions>form{display:flex;margin:0;max-width:100%}
.actions>form>button{width:100%}
.reminder-detail .actions>form,.reminder-detail .actions>a.button{flex:0 1 22rem;width:22rem;max-width:100%}
.reminder-detail .actions>form>button{width:100%}
.mix-summary{grid-template-columns:2fr 1fr 1fr}
.mix-summary>.field{display:flex;flex-direction:column;justify-content:flex-end}
.mix-summary input{min-height:48px}
.mix-summary output,.mix-component output{display:block;min-height:48px;padding:11px 12px;border:1px solid var(--line);border-radius:7px;background:var(--bg);font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
@media(max-width:767px){.mix-summary{grid-template-columns:1fr}.actions>form{flex:1 1 auto}.reminder-detail .actions>form,.reminder-detail .actions>a.button{flex:1 1 100%;width:100%}}

/* 0.1.22: accessible column menus, shared by all server-side tables. */
.column-menu{font-size:inherit;text-transform:none;letter-spacing:normal}
.column-menu>summary{display:block;align-content:start;min-height:44px;white-space:normal;overflow-wrap:normal;list-style:none;line-height:1.25;margin:0}
.column-menu>summary::-webkit-details-marker{display:none}
.column-menu>summary:focus-visible{outline:2px solid var(--red);outline-offset:2px}
.column-menu.filter-active>summary{color:var(--red-dark);font-weight:750}
.column-panel{position:fixed;z-index:170;left:max(8px,calc(50vw - 180px));top:18vh;width:min(360px,calc(100vw - 16px));max-height:60vh;overflow:visible;padding:10px;display:flex;flex-direction:column;gap:6px;background:var(--surface);border:1px solid var(--line);border-radius:10px;box-shadow:0 10px 35px var(--shadow-panel);color:var(--ink);font-size:14px;text-align:left;white-space:normal;line-height:1.4}
.column-panel form{margin:12px 0}.column-panel label{font-size:14px;text-transform:none;letter-spacing:normal;white-space:normal;margin:10px 0 5px}
.column-panel button,.column-panel a.button{font-size:14px;line-height:1.4;white-space:normal;min-height:44px;padding:8px 10px}
.column-sort-actions,.column-filter-actions,.column-search-row,.column-options-pages{display:flex;gap:8px;flex-wrap:wrap;margin:10px 0}
.column-sort-actions a{min-height:44px;display:flex;align-items:center;flex:1;color:var(--red-dark)}
.column-search-row input{width:auto;flex:1;min-width:100px}.column-search-row button{flex:0 0 auto}
.column-values{max-height:220px;overflow:auto;border:1px solid var(--line);border-radius:6px;padding:6px;margin:10px 0}
.column-values label{display:flex;align-items:flex-start;gap:8px;min-height:36px;overflow-wrap:anywhere;font-weight:400}
.column-values input[type=checkbox]{flex:0 0 auto;margin-top:4px}.column-values[aria-busy=true]{opacity:.6}
.column-range{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.column-range>label{min-width:0}.column-range input{min-width:0;padding:8px}
.column-criterion+ .column-criterion{border-top:1px solid var(--line);padding-top:14px;margin-top:14px}
.column-choice-error{color:var(--red-dark)}.table-filter-status{display:flex;gap:12px;align-items:center;justify-content:space-between;flex-wrap:wrap;margin:8px 0 14px}
.register-filter-secondary select[multiple]{min-height:110px}


.table-card>.table-filter-status{margin:8px 24px 14px}

.card-list-filters{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}.card-list-filters>.column-menu{border:1px solid var(--line,var(--line));border-radius:8px;padding:0 10px;background:var(--surface);min-width:0}.list-return{margin-bottom:16px}

/* Growing audit history keeps its column menus available above mobile cards. */
.audit-card>.table-filter-status{margin:12px 16px}
@media(max-width:767px){
 .audit-table>thead{display:block;position:static;width:auto;height:auto;overflow:visible;clip-path:none;white-space:normal;margin-bottom:16px}
 .audit-table>thead>tr{display:flex;flex-wrap:wrap;gap:8px}
 .audit-table>thead th:nth-child(n){display:block;width:auto;flex:1 1 auto;padding:0 10px;background:var(--surface);border:1px solid var(--line);border-radius:8px}
 .audit-card>.table-filter-status{margin-left:0;margin-right:0}
}

/* 0.1.24: heading actions stay together at the right; form actions start at the left. */
.heading>div:first-child{min-width:0}
.heading>.actions{justify-content:flex-end;margin-left:auto;align-items:center}
.heading>.button{flex-shrink:0;max-width:100%}
.heading p,.detail-grid dd{overflow-wrap:anywhere}
.form-actions{justify-content:flex-start;flex-wrap:wrap}
@media(max-width:1023px){.heading>.actions{margin-left:0;justify-content:flex-start;width:100%}}

/* 0.1.25: short modules share a row; tables and histories retain the full row. */
.page-card-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:22px;}
.page-card-grid>*{grid-column:1/-1;min-width:0;margin-bottom:0}
.page-card-grid>.card-short{grid-column:span 1}
.card-short .heading{flex-wrap:wrap;align-items:flex-start}
.card-short .heading>.button{white-space:normal;margin-inline-start:auto}
.card-short .detail-grid{grid-template-columns:minmax(110px,190px) minmax(0,1fr)}
.workflow-summary{display:block;font-size:14px;font-weight:400;margin-top:6px;overflow-wrap:anywhere}
.delivery-workflow>summary{min-height:44px;overflow-wrap:anywhere}
.table-filter-status>a{margin-inline-start:auto;text-align:right;min-height:44px;display:inline-flex;align-items:center}
.shipment-register th{vertical-align:top}
.shipment-register .column-menu>summary{text-align:inherit}
@media(max-width:1023px){
 .page-card-grid{grid-template-columns:minmax(0,1fr)}
 .page-card-grid>.card-short{grid-column:1/-1}
}
@media(max-width:767px){
 .page-actions .auxiliary-actions{grid-template-columns:minmax(0,1fr);width:100%}
 main .heading>.button,main .heading>.actions,main .actions:not(.admin-entry-actions){width:100%}
 main .heading>.button,main .actions:not(.admin-entry-actions)>.button,
 main .actions:not(.admin-entry-actions)>button,main .actions:not(.admin-entry-actions)>form,
 main .actions:not(.admin-entry-actions)>form>button,
 main .card>.button,main .card>form>button,main .workflow-next .button,
 main .workflow-next form,main .workflow-next form>button,
 main .stacked-form>button{width:100%;flex:0 0 100%;white-space:normal}
 main .heading>.actions{align-items:stretch}
 .workflow-next{flex-wrap:wrap}
 /* Row controls and pagination keep their compact layout. */
 main td .actions{width:auto}
 main td .actions>button,main td .actions>.button{width:auto;flex:0 1 auto}
}
@media(max-width:767px){.card-short .detail-grid{grid-template-columns:1fr}}

/* 0.1.26: each suggestion follows its own field, in both grid and mobile order. */
.payment-proposal{margin-top:12px;border-top:1px solid var(--line);padding-top:10px}
.payment-proposal .proposal-toggle{display:flex;gap:8px;align-items:center;min-height:44px;font-size:14px}
.proposal-toggle input[type=checkbox]{width:20px;min-height:20px;flex:0 0 20px;margin:0}
.payment-proposal p{margin:6px 0;font-size:14px;overflow-wrap:anywhere}
.field-help{display:inline-block;position:relative;font-weight:400;text-align:left;vertical-align:middle}
.field-help>button{cursor:pointer;display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;border:1px solid var(--line);border-radius:50%;list-style:none}
.field-help>span{position:absolute;z-index:160;top:100%;right:0;width:240px;max-width:80vw;padding:12px;background:var(--surface);border:1px solid var(--line);border-radius:8px;box-shadow:0 4px 16px var(--shadow-panel);white-space:normal;font-size:14px;line-height:1.5;color:var(--ink)}
.field-help>span{display:none}
.field-help:hover>span,.field-help:focus-within>span{display:block}

.payment-table .not-applicable{display:block;white-space:normal;line-height:1.2}
@media(min-width:1280px){
 .payment-table .payment-column-reference{width:12%}
 .payment-table .payment-column-date{width:6.4%}
 .payment-table .payment-column-source{width:6.8%}
 .payment-table .payment-column-amount{width:7%}
 .payment-table .payment-column-rate{width:7%}
 .payment-table .payment-column-check{width:5%}
 .payment-table .payment-column-status{width:21%}
}



/* Contract/day needs keep compact inputs local to this table. */
.purchase-need-group{border-top:1px solid var(--line);padding-top:1rem;margin-top:1rem;scroll-margin-top:1rem}
.purchase-need-group h3{font-size:16px;line-height:1.5;margin:0 0 12px}
.need-days{min-width:1060px;width:100%;table-layout:fixed;font-size:13px}
.need-days th{vertical-align:top;font-size:12px;white-space:normal;letter-spacing:0;text-transform:none}
.need-days th,.need-days td{padding:8px 5px;overflow-wrap:anywhere}
.need-days th:nth-child(1){width:126px}.need-days th:nth-child(2){width:110px}
.need-days th:nth-child(4){width:120px}.need-days th:nth-child(5){width:110px}
.need-days th:nth-child(6),.need-days th:nth-child(7){width:140px}.need-days th:nth-child(8){width:110px}
.need-days input{padding:8px 5px;min-height:44px;max-width:100%;font-size:14px}
.need-days input[data-money]{width:110px;text-align:right}.need-days input[name=rate]{width:100px}
.need-days input.date-display{width:130px}.need-days .date-field{min-width:0}
.need-days button{font-size:14px;padding:8px 10px;min-height:44px;white-space:nowrap}
.need-days summary{min-height:44px;display:flex;align-items:center;cursor:pointer}
.need-days summary::before{content:"▸";margin-right:5px}.need-days details[open]>summary::before{content:"▾"}
.need-days details[open]>summary{margin-bottom:8px}.need-days details p{margin:0 0 8px}

.need-days .badge{margin-top:8px;margin-inline-start:var(--cell-gap);background:var(--amber);color:var(--ink)}
.need-overdue>td:first-child small{color:var(--red-dark)}
.need-days:has(th:nth-child(3):last-child){max-width:800px;min-width:550px;table-layout:auto}
.check.yes:disabled{opacity:1}
.payment-table th{vertical-align:top}
table:has(.column-menu[open]) th[title]::after{display:none}

/* Invoice card: one document, explicit per-container calculation scope. */
.invoice-module-nav{display:flex;flex-wrap:wrap;gap:.5rem;grid-column:1/-1}
.invoice-module-nav a{display:inline-flex;align-items:center;min-height:44px;padding:.45rem .8rem;background:var(--surface);border:1px solid var(--border,var(--line));border-radius:.55rem}
.invoice-card [id^="module-"]{scroll-margin-top:1rem}
.invoice-scope-links{padding-left:1.2rem}
.invoice-scope-links li{margin:.6rem 0}
.invoice-scope-links a[aria-current="page"]{border-color:var(--red-dark);background:var(--error-bg);font-weight:600}
.invoice-card .module-revoke,.invoice-card details,.invoice-exports{margin-top:1.1rem}
.invoice-final-modules{display:grid;gap:var(--space-5,1.5rem);grid-column:1/-1;min-width:0}
.invoice-card .metrics{padding:1rem 0}
.invoice-card .table-card>:is(form,details,.metrics,.invoice-exports,.module-missing,.notice,h3){margin-inline:24px}
.invoice-card .table-card>a.button{margin-inline:24px;max-width:calc(100% - 48px)}
.table-card>.table-search{margin:0 24px 20px}
.invoice-details-editor>form>.form-actions{margin:1rem 24px 0}
@media(max-width:767px){
 .invoice-card .table-card>:is(form,details,.metrics,.invoice-exports,.module-missing,.notice,h3){margin-inline:16px}
 .invoice-card .table-card>a.button{margin-inline:16px;max-width:calc(100% - 32px)}
 .table-card>.table-search{margin-inline:16px}
 .invoice-details-editor>form>.form-actions{margin-inline:16px}
}
.invoice-card .metrics strong{display:block}
.invoice-card .detail-grid small{display:block;margin-top:.3rem}
.invoice-references fieldset{margin:1rem 0;padding:1rem;border:1px solid var(--border,var(--line));border-radius:.5rem;min-width:0}
.invoice-details-editor table{min-width:1480px}
.invoice-details-editor th:first-child{width:3.5rem}
.invoice-details-editor th:nth-child(2){width:24%}
.invoice-details-editor input:not([type=checkbox]),.invoice-details-editor textarea{min-width:7rem;width:100%;min-height:44px}
.invoice-details-editor input[type=checkbox]{min-width:24px;min-height:24px;margin:10px}
.invoice-details-editor textarea{min-width:18rem}
.invoice-details-editor .errorlist{white-space:normal;max-width:20rem}
.table-search input[type=search]{width:min(36rem,100%);flex:1;min-width:12rem}
#invoice-close-dialog{width:min(50rem,calc(100% - 2rem));max-height:85vh;overflow:auto}
#invoice-close-dialog li{margin:.75rem 0}

.export-mapping-table{min-width:850px}.export-mapping-table th:first-child{width:32%}.export-mapping-table label{font-weight:400}.invoice-exports .button{margin:0 8px 8px 0}

.table-search .form-actions{margin-top:12px}
#ihurt-price-dialog{width:min(42rem,calc(100% - 2rem));max-height:85vh;overflow:auto}

/* 0.1.32: explicitly classified compact cards retain DOM/process order. */
.card-short>ul,.card-short>ol{overflow-wrap:anywhere}
.card-short .filters>.filter-field{min-width:0;max-width:100%;flex:1 1 180px}
.card-table-five .table-scroll td:not(.numeric){min-width:0;max-width:none;overflow-wrap:anywhere}
.card-table-five .table-scroll td:first-child{min-width:110px}
.card-table-five .table-scroll td:last-child{min-width:125px;overflow-wrap:normal;word-break:normal}
.card-table-five .table-scroll .date-cell{white-space:nowrap;overflow-wrap:normal}
.card-table-five .table-scroll td.numeric{white-space:nowrap}
@media(min-width:1024px) and (max-width:1279px){
 .page-card-grid>.card-short.card-table-five{grid-column:1/-1}
}
@media(min-width:1280px){
 .shipment-register:not(.viewer-register) .column-supplier{width:6.5%}
 .shipment-register:not(.viewer-register) .column-container{width:6.5%}
 .shipment-register:not(.viewer-register) .column-goods{width:10%}
 .shipment-register:not(.viewer-register) .column-value{width:6.5%}
 .shipment-register:not(.viewer-register) .column-etd,.shipment-register:not(.viewer-register) .column-actual_etd,.shipment-register:not(.viewer-register) .column-eta,.shipment-register:not(.viewer-register) .column-actual_eta,.shipment-register:not(.viewer-register) .column-delivery{width:5.5%}
}

@media(min-width:1280px){
 .register-scroll .shipment-register:not(.viewer-register) td.goods-cell{min-width:140px}
 .register-scroll .shipment-register:not(.viewer-register) td:is(.supplier-cell,.container-cell,.numeric,.date-cell),
 .register-scroll .shipment-register:not(.viewer-register) th:is(.register-column-supplier,.register-column-container,.register-column-value,.register-column-etd,.register-column-actual_etd,.register-column-eta,.register-column-actual_eta,.register-column-delivery){padding-left:4px;padding-right:4px}
}

button.feature-unavailable:disabled,button.feature-unavailable:disabled:hover{background:var(--disabled-bg);border-color:var(--disabled-border);color:var(--muted);opacity:1;cursor:not-allowed}
.feature-unavailable-action{margin-top:8px}.feature-unavailable-action p{margin:4px 0 12px}

/* Equal-height neighbouring containers retain the white card surface. */
:is(.page-card-grid,.form-grid,.metrics,.dictionary-grid,.mix-grid,.register-tools){align-items:stretch}
.invoice-details-totals,.invoice-details-editor #edit-form>.help{margin:16px 24px}
.invoice-details-totals dt{color:var(--muted)}
.invoice-details-totals dd{margin:0;font-size:20px;font-weight:700;font-variant-numeric:tabular-nums}
.badge.red{background:var(--error-bg);color:var(--red-dark)}

.invoice-module-summary{padding:.8rem 0;cursor:pointer;display:flex;flex-wrap:wrap;align-items:center;gap:.6rem}
.invoice-module-summary .module-blockers{flex-basis:100%;font-weight:400}
.invoice-module.table-card>.invoice-module-summary{margin-inline:24px}
.invoice-module[open]>.invoice-module-summary{border-bottom:1px solid var(--line);margin-bottom:1rem}
.invoice-context{grid-column:1/-1;margin-top:-1rem}
.delivery-workflow .workflow-all{margin-top:1rem}

.document-search-pair {display:flex;gap:4%;flex-wrap:wrap}.document-search-pair>input,.document-search-pair>select {width:48%;min-width:0}@media(max-width:767px){.document-search-pair>input,.document-search-pair>select{width:100%}}

.form-fields-group{display:contents}.field:has([data-next-required]):has(input:placeholder-shown){border-color:var(--danger)}
[data-next-required].next-missing{border:2px solid var(--warning-border)}.field .missing-marker{color:var(--warning-text);font-weight:700}
#shipment-more{margin:1rem 0}#shipment-more>summary{cursor:pointer;font-weight:700;padding:.6rem 0}.transport-state{display:block;font-weight:600}
.page-card-grid>.card-short{min-width:0}.page-card-grid>.card-short table{width:100%}

.invoice-card .invoice-exports form { display: inline-block; }
.table-search { display: flex; align-items: center; flex-wrap: wrap; gap: .7rem; }
.table-search input[type="search"] { flex: 1 1 15rem; width: auto; }

.column-panel .column-values { display: flex; flex-direction: column; gap: .35rem; max-height: 16rem; overflow-y: auto; }
.column-panel .column-values label { display: flex; align-items: baseline; gap: .4rem; text-align: left; }
.column-panel .column-filter-actions { display: flex; gap: .4rem; position: sticky; bottom: 0; background: var(--surface); padding-top: .7rem; }
.column-sort { padding-bottom: .8rem; border-bottom: 1px solid var(--line); margin-bottom: .8rem; }
.column-panel .column-limit[hidden], .column-panel [hidden] { display: none; }
.table-page-size { display: flex; align-items: end; gap: .6rem; margin-top: .8rem; }
.table-page-size label { display: flex; align-items: center; gap: .5rem; }
.table-page-size select { width: auto; }

.table-page-size { flex-wrap: wrap; }
.table-page-size label { max-width: 100%; flex-wrap: wrap; }

/* 3c2: shared compact tables and cards. */
@media (min-width:768px){th .header-help{display:none}th{padding-top:10px;padding-bottom:10px}}

/* The sort separator already has padding; avoid counting it again on touch layouts. */
.column-panel{gap:2px}
.column-panel form{margin:0;min-height:0}.column-panel .column-apply{display:flex;flex-direction:column;gap:5px;min-height:0}
.column-options-search{display:none}.column-sort-actions{display:flex;gap:6px}.column-sort strong{display:none}
.column-panel label{margin:3px 0}.column-panel input:not([type=checkbox]),.column-panel select{padding:6px}
.column-panel button,.column-panel a.button{min-height:36px;padding:6px 8px}
.column-criterion{display:flex;flex-direction:column;min-height:0;gap:3px}
.column-panel .column-values{flex:0 1 auto;min-height:32px;max-height:15vh;margin:3px 0;padding:4px;gap:0;overflow-y:auto}
.column-panel .column-values label{min-height:26px;margin:0}.column-options-count{margin:3px 0}.column-options-pages:empty{display:none}
.column-panel .column-filter-actions{flex:none;position:static;padding-top:3px}.column-criterion>.column-range{flex:none}.column-criterion>.column-range>summary{display:none}
.column-criterion>.column-range{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px}.column-criterion>.column-range>label:last-child{grid-column:1/-1}
.column-panel .column-select-all{margin:1px 0}
.page-card-grid>.card-short:not(:has(+.card-short)):not(.card-short+.card-short){grid-column:1/-1}
.invoice-final-modules{grid-template-columns:repeat(2,minmax(0,1fr));align-items:stretch}.invoice-final-modules>.card:only-child{grid-column:1/-1}
.invoice-final-modules>.card{margin:0;min-width:0}.invoice-module-nav a.approved{background:var(--green);color:var(--success-text)}.invoice-module-nav a.unapproved{background:var(--error-bg);color:var(--error-text)}
.invoice-module>.heading:empty{display:none}.invoice-module>.heading{margin-top:12px;margin-bottom:12px}.invoice-module>form,.invoice-module>.logistics-approval{margin-top:12px}
.invoice-module>.detail-grid{display:grid;grid-template-columns:minmax(130px,1fr) minmax(0,1fr) minmax(130px,1fr) minmax(0,1fr);gap:8px 16px}
.workflow-next{display:flex;align-items:center;justify-content:space-between;gap:12px}.workflow-next h2{font-size:16px;margin:0}.workflow-next p{margin:3px 0;font-size:13px}.delivery-workflow{padding:14px 18px}.workflow-all{margin-top:8px}
.table-filter-status:empty{display:none}.table-filter-status{display:flex;justify-content:flex-end;align-items:center;gap:10px;margin:0 0 8px}
.card:has(> .table-scroll tbody>tr:only-child>td[colspan])> .table-scroll{margin:0}.card:has(> .table-scroll tbody>tr:only-child>td[colspan]) td[colspan]{border:0;padding:4px 0}
.card:has(> .table-scroll tbody>tr:only-child>td[colspan])> .heading{margin-bottom:5px}
.table-scroll table:not(.shipment-register):has(thead th:last-child:nth-child(-n+5)){max-width:1100px}
.card.form-card:has(h2+form .form-grid){max-width:none;width:100%}
@media(max-width:767px){.invoice-final-modules{grid-template-columns:1fr}.invoice-module>.detail-grid{grid-template-columns:1fr}.workflow-next{align-items:flex-start;flex-wrap:wrap}.column-panel button,.column-panel a.button{min-height:44px}}

@media(min-width:768px){th[title]{position:relative}th[title]:hover::after,th[title]:focus::after{content:attr(title);position:absolute;z-index:160;top:100%;left:0;width:240px;padding:10px;background:var(--surface);color:var(--ink);border:1px solid var(--line);border-radius:6px;white-space:normal;font-size:13px;line-height:1.4;font-weight:400}}

.table-description,.empty-table-line{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap}.table-description>p,.table-description>.table-filter-status,.empty-table-line>p{margin:0}.empty-table-line{padding:3px 0}.table-description{margin:8px 0}


.card:has(>.empty-table-line)>:is(.table-search,.card-list-filters,.table-filter-status,.table-page-size,.result-count,.pagination){display:none}
.card:has(>.empty-table-line)>.table-description>.table-filter-status{display:none}
main .invoice-module-nav a.approved:is(:link,:visited,:hover,:focus){background:var(--green);color:var(--success-text)}
main .invoice-module-nav a.unapproved:is(:link,:visited,:hover,:focus){background:var(--error-bg);color:var(--error-text)}

.invoice-module[open] .module-totals{display:none}

.table-scroll>table:not(.shipment-register):not(.payment-table){max-width:1280px}
.mix-grid>.card-short:last-child:nth-child(odd){grid-column:1/-1}

.table-card>.logistics-approval,.table-card>.empty-table-line,.table-card>.table-description{margin-inline:24px}
@media(max-width:767px){.table-card>.logistics-approval,.table-card>.empty-table-line,.table-card>.table-description{margin-inline:16px}}

.column-sort{padding-bottom:5px;margin-bottom:0}.column-sort>label{display:flex;align-items:center;gap:8px}.column-sort select{flex:1;min-width:0}
.column-panel .column-sort-actions,.column-panel .column-search-row,.column-panel .column-filter-actions{margin:3px 0}
.column-apply>strong,.column-criterion>strong{display:none}.column-range>label:has(.column-contains){grid-column:1/-1}
.column-panel .column-range input:not([type=checkbox]){margin-top:3px}.column-panel input[type=checkbox]{margin-top:3px}

.column-panel .column-sort{flex:none}.column-panel .column-range{gap:0}.column-panel .column-range>label{margin:1px 0}

.delivery-workflow{display:flex;align-items:center;flex-wrap:wrap;gap:12px}.delivery-workflow .workflow-next{flex:1 1 26rem;margin:0;padding:0;background:transparent;flex-wrap:nowrap}
.delivery-workflow .workflow-next>div{flex:1;min-width:0}.delivery-workflow .workflow-next .button{width:auto}.delivery-workflow .workflow-all{margin:0}.delivery-workflow .workflow-all[open]{flex-basis:100%}

/* Without JS, all grouped criteria stay reachable in the native menu. */
.column-menu:not([data-enhanced]) .column-panel{display:block;overflow:auto}

/* Independent register tables share an always visible selection summary. */

.register-section{margin-top:24px}.register-section .shipment-register{min-width:1100px;table-layout:auto;width:100%}
.register-section .goods-cell>span,.register-section .goods-cell>.mobile-card-value>span{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.register-section .goods-cell>span:focus,.register-section .goods-cell>.mobile-card-value>span:focus{display:block;-webkit-line-clamp:unset;overflow:visible}
.register-section .date-kind{white-space:nowrap;font-size:11px;color:var(--muted)}
.column-menu:has(>summary:focus-visible)+.header-help>span{display:block}
.column-menu>summary:focus-visible,.header-help>button:focus-visible{outline:2px solid var(--ink);outline-offset:2px}
@media(min-width:768px){
 th .header-help{display:inline-block;width:0;height:0;position:static}
 th .header-help>button{display:none}
 th:has(>.column-menu>summary:focus-visible)>.header-help>span,th:has(>.column-menu>summary:hover)>.header-help>span{display:block;top:auto;right:auto}
}

@media(min-width:1024px){
 .register-filters{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px 16px;align-items:end}
 .register-filters .register-filter-main{margin:0;grid-column:1;grid-row:1}
 .register-filters>button{grid-column:2;grid-row:1;margin:0}
 #register-year-note{grid-column:1/-1;font-size:12px;margin:0;color:var(--muted)}
}
/* Michał 07.11: invoice pairs A/B and C/D; wide position/price modules stay full. */
.invoice-card>.invoice-module{min-width:0;margin-top:0}
.invoice-card>.invoice-module .table-scroll{max-width:100%;min-width:0;overflow-x:auto}
@media(min-width:1280px){
 .invoice-card>:is(#module-A,#module-B,#module-C,#module-D){grid-column:span 1;align-self:stretch}
 .invoice-card>:is(#module-A,#module-D)>.detail-grid{grid-template-columns:minmax(130px,1fr) minmax(0,1fr)}
}
@media(max-width:1279px){
 .invoice-card{grid-template-columns:minmax(0,1fr)}
 .invoice-card>.invoice-final-modules{grid-template-columns:minmax(0,1fr)}
}
@media(max-width:767px){
 .delivery-workflow .workflow-next{flex-wrap:wrap}
 .delivery-workflow .workflow-next>div{flex-basis:100%}
}

/* Register: stable paired tools and compact transport/action rows. */
.register-tools>.card{height:100%}
.selection-panel .selection-actions>strong{margin-right:auto}
.selection-metrics{grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:10px 0}.selection-metrics>div:last-child{grid-column:auto}
.selection-metrics strong{font-size:18px}.selection-metrics small{min-height:32px;font-size:11px}
.selection-panel #selection-status{min-height:20px;margin:4px 0;padding:0;border:0;line-height:20px}
@media(max-width:767px){.selection-panel #selection-status{min-height:40px}}
.selection-panel #selection-details{margin:0}.selection-panel #selection-details[hidden]{display:none}
.selection-summary-details{margin:0}.selection-summary-details[open],#selection-details[open]{height:auto}
.register-results-heading h2{margin:0;font-size:19px;white-space:nowrap}.register-results-heading>a{font-size:12px}
.register-heading-tools{display:flex;align-items:center;justify-content:flex-end;gap:12px;margin-left:auto}
.hide-completed{margin:0;white-space:nowrap}.hide-completed label{display:flex;gap:6px;align-items:center;font-size:12px;margin:0}
.hide-completed input{margin:0}.register-stage{display:grid;grid-template-columns:88px minmax(150px,1fr) 68px;align-items:center;gap:var(--cell-gap);font-size:11px}
.register-stage form{display:inline-flex;margin:0}.register-stage .button.compact{grid-column:3;padding:4px 7px;font-size:11px}
.register-stage .register-action,.register-stage a{white-space:normal}
.stage-badge{display:inline-flex;justify-content:center;border-radius:5px;padding:4px 6px;background:var(--neutral);color:var(--ink);font-weight:600}
.stage-badge.sailing{background:var(--sailing-bg);color:var(--sailing-text)}.stage-badge.arrived{background:var(--arrived-bg);color:var(--arrived-text)}.stage-badge.delivered,.stage-badge.complete{background:var(--green);color:var(--success-text)}
.register-section .shipment-register th{font-size:11px;word-break:normal;overflow-wrap:normal;min-width:68px}
.register-section .shipment-register th .column-menu>summary{overflow-wrap:normal;word-break:normal;white-space:normal}
.register-section .shipment-register .text-cell{white-space:nowrap;overflow-wrap:normal;min-width:75px}
.register-section .shipment-register .supplier-cell{white-space:normal;min-width:95px;max-width:160px}
.register-section .shipment-register .goods-cell{white-space:normal;min-width:110px;max-width:190px}
.register-section .shipment-register .proforma-cell{min-width:110px;overflow-wrap:normal}
.register-section .shipment-register .date-cell{min-width:88px;font-size:11px}
.register-section .shipment-register .terms-cell{min-width:110px;font-size:11px;overflow-wrap:normal}
.register-section .shipment-register .container-cell{white-space:nowrap;min-width:100px}
.register-section .shipment-register .settlement-cell{min-width:330px;width:auto}
.shipment-register .editing-label{white-space:nowrap;overflow-wrap:normal;padding:2px 3px;margin-top:4px}
.register-section .shipment-data-row td{padding-block:9px}
@media(max-width:767px){
 body:has(.register-tools) .heading{gap:8px;margin-bottom:12px}
 body:has(.register-tools) .page-actions{display:flex;flex-direction:row;flex-wrap:nowrap;gap:6px;justify-content:flex-start}
 body:has(.register-tools) .page-actions .auxiliary-actions{display:flex;gap:6px;flex-wrap:nowrap;width:auto}
 body:has(.register-tools) .page-actions .button{font-size:11px;padding:8px;min-width:0;white-space:nowrap;width:auto;flex:0 1 auto}
 .register-tools{gap:10px;margin-bottom:10px}.register-tools>.card{padding:12px}
 .register-filters>button{justify-self:start}.register-section{margin-top:12px}
 #register-year-note{font-size:11px;margin:0}
 .selection-actions{gap:6px}.selection-actions>strong{flex-basis:100%}.selection-actions button{min-height:30px;padding:5px 7px;font-size:11px}
 .selection-metrics{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}.selection-metrics strong{font-size:14px}.selection-metrics small{min-height:42px}
 .register-results-heading{gap:6px}.register-results-heading h2{font-size:17px}
 .register-heading-tools{flex-basis:100%;gap:6px;justify-content:space-between}.register-heading-tools .forward-warning{font-size:10px;padding:5px;flex:1}.hide-completed label{font-size:10px}
}
/* Half-width B/C cards contain their tables; monetary cells keep decimals together. */
#module-B table,#module-C table{table-layout:fixed;width:100%;min-width:0;font-size:11px}
#module-B th,#module-C th{font-size:11px;white-space:normal;overflow-wrap:anywhere;padding:8px 5px}
#module-B td,#module-C td{padding:8px 5px;overflow-wrap:anywhere;min-width:0;max-width:none}
#module-B th:first-child{width:39%}#module-B th:nth-child(2){width:19%}#module-B th:nth-child(3){width:25%}#module-B th:nth-child(4){width:17%}
#module-B td.numeric,#module-C td.numeric{white-space:normal;font-variant-numeric:tabular-nums}
#module-C th:first-child{width:20%}#module-C th:nth-child(2){width:14%}#module-C th:nth-child(3){width:15%}#module-C th:nth-child(4){width:14%}#module-C th:nth-child(5){width:13%}#module-C th:last-child{width:24%}
#module-C td .button{font-size:11px;min-height:36px;padding:5px;white-space:normal;width:auto;max-width:100%}
#module-C td p{margin:4px 0}.invoice-card>.heading>.actions{justify-content:flex-end}
.actions{gap:10px}a.button.secondary.delete-action:is(:link,:visited),button.delete-action{color:var(--red);border:1px solid var(--red);background:var(--surface)}
.more-actions{position:relative}.more-actions>summary{cursor:pointer;white-space:nowrap}.more-actions[open]{display:flex;gap:8px;flex-wrap:wrap}
.preparation-grid a[href="#payment-email"]{display:inline-flex;white-space:nowrap;height:45px;min-height:45px;padding:10px;font-size:12px;max-width:100%}
.next-pending{border-color:var(--warning-border)}.missing-marker{color:var(--warning-text)}.field:has(.errorlist) :is(input,select,textarea){border-color:var(--red)}
.correction-note{display:block;margin-top:6px;color:var(--warning-text)}
#edit-form[data-kind="invoice_details"] table{width:100%;table-layout:fixed;min-width:0;font-size:12px}
#edit-form[data-kind="invoice_details"] th{font-size:11px;padding:6px;white-space:normal;overflow-wrap:anywhere}
#edit-form[data-kind="invoice_details"] td{padding:5px;min-width:0}
#edit-form[data-kind="invoice_details"] input:not([type=checkbox]),#edit-form[data-kind="invoice_details"] textarea{width:100%;min-width:0;padding:6px}
#edit-form[data-kind="invoice_details"] th:first-child{width:35px}
#edit-form[data-kind="invoice_details"] th[data-item-column="description"]{width:22%}
#edit-form[data-kind="invoice_details"] th[data-item-column="sku"]{width:12%}
#edit-form[data-kind="invoice_details"] th[data-item-column="service"],#edit-form[data-kind="invoice_details"] th[data-item-column="DELETE"]{width:54px}
.audit-overview td{padding:7px;font-size:12px}.audit-detail-row td{padding:0 7px 7px}.audit-details>summary{font-size:12px}
.reminder-settings{width:100%;font-size:12px}.reminder-settings td{padding:8px;vertical-align:top}.reminder-settings input:not([type=checkbox]),.reminder-settings textarea{width:100%;min-width:100px}.reminder-settings textarea{min-height:60px}

@media(min-width:1024px){.audit-entry{position:relative}.audit-overview td:last-child{padding-right:128px}.audit-details>summary{position:absolute;right:16px;top:8px;width:max-content;max-width:none;white-space:nowrap}.audit-detail-row td{padding:0}.audit-details[open] .audit-detail{padding:12px}.audit-details:not([open]){height:0}}

/* 3h: semantic columns, identical in every table and module. */
table :is(th,td).column-text{text-align:left}
table :is(th,td).column-value{ text-align:center }
th.column-value .column-menu>summary,th.numeric .column-menu>summary,th.date-cell .column-menu>summary{text-align:inherit;align-content:start}
table th{vertical-align:top}
table :is(.badge,.stage-badge)+*,table :is(a,button)+:is(a,button),table .cell-link{margin-inline-start:var(--cell-gap)}
table td>.badge:not(:last-child){margin-inline-end:var(--cell-gap)}
.cell-items{display:flex;align-items:center;flex-wrap:nowrap;gap:var(--cell-gap);width:max-content}
.table-scroll td:has(>.cell-items){max-width:none}
.cell-items>*{flex:none}
.cell-items>details{display:inline-block}.cell-items>details>summary{margin:0}
.cell-items .button{margin:0}
button.compact,a.button.compact{min-height:36px;padding:5px 8px;font-size:12px;line-height:24px}
table td .cell-link{display:inline-block}
.register-tools>.card{padding:12px}.register-filters{gap:6px}
.selection-metrics{margin:6px 0}.selection-metrics small{min-height:28px}
.table-scroll{min-width:0;max-width:100%}
@media(max-width:767px){button.compact,a.button.compact{min-height:44px;height:auto}.register-stage{grid-template-columns:88px minmax(150px,1fr) 68px}.selection-actions button{min-height:44px}}

.column-menu>summary{text-align:inherit}
.register-stage .button.compact{white-space:nowrap;word-break:normal}

@media(max-width:767px){#module-C td .button{min-height:44px}.pagination a{min-height:44px;display:inline-flex;align-items:center}}

/* 3i: scoped corrections and the shared pagination footer. */
.table-pagination-footer{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;padding:8px 12px}
.table-pagination-footer>.result-count{margin:0;flex:1 1 auto}
.table-pagination-footer>.pagination{margin:0;display:flex;align-items:center;justify-content:center;gap:8px;flex:1 1 auto}
.table-pagination-footer>.table-page-size{margin:0;display:flex;align-items:center;justify-content:flex-end;gap:8px;flex:1 1 auto}
.table-pagination-footer .table-page-size label{margin:0;display:flex;align-items:center;gap:8px;flex-wrap:nowrap}
.table-pagination-footer :is(select,button){height:24px;min-height:24px;padding:1px 8px;font-size:12px;line-height:20px;margin:0;min-width:44px}
.register-section{margin-bottom:24px}
.register-tools .selection-panel{display:flex;flex-direction:column;justify-content:space-between;gap:8px}
.selection-bottom{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}
.selection-bottom .selection-actions{display:flex;gap:8px;margin:0}
.selection-breakdown{display:flex;gap:8px;flex-wrap:wrap;margin:0}
/* K1: status and disclosure live below both cards; closed rows never move the tables. */
.selection-feedback{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:minmax(20px,auto);column-gap:16px;margin-bottom:8px;font-size:12px;line-height:20px}
.selection-feedback p{grid-column:1;grid-row:1;margin:0;padding:0;border:0;background:none;font-size:inherit}
.selection-feedback details{grid-column:2;grid-row:1;margin:0}
.selection-feedback summary{margin:0;font-size:12px;line-height:20px}
.selection-feedback details[open]>summary{margin-bottom:0}
.selection-feedback ul{margin:8px 0;padding-left:20px;overflow-wrap:anywhere}
.selection-feedback .status-error{color:var(--error-text);font-weight:600}
@media(max-width:767px){
 .selection-feedback{grid-template-columns:minmax(0,1fr);grid-template-rows:40px minmax(44px,auto);row-gap:4px}
 .selection-feedback details{grid-column:1;grid-row:2}
}
.payment-table .payment-status>*{display:block;margin:0 0 var(--cell-gap);margin-inline:0}
.payment-table .payment-status>:last-child{margin-bottom:0}
.ui-identifier{white-space:nowrap;overflow-wrap:normal;word-break:normal}
.invoice-index-table{min-width:1250px;table-layout:auto}
.invoice-index-table td:nth-last-child(-n+2){min-width:160px}
.invoice-index-table td:nth-child(3){min-width:130px;white-space:nowrap}
.invoice-index-table td:nth-child(2){min-width:180px}
.invoice-index-table td:nth-last-child(-n+2) :is(.button,button){min-width:144px;white-space:nowrap;font-size:13px;padding-inline:10px}
.invoice-index-table td:nth-child(2){overflow-wrap:normal;word-break:normal}
#module-F .table-scroll table{min-width:920px}
#module-F td:first-child.column-text{min-width:220px;overflow-wrap:normal;word-break:normal}
@media(max-width:767px){
#edit-form[data-kind="invoice_details"] table{min-width:1480px;table-layout:auto}
#edit-form[data-kind="invoice_details"] td:has(input:not([type=checkbox])){min-width:112px}
#edit-form[data-kind="invoice_details"] input:not([type=checkbox]){min-width:100px}
#edit-form[data-kind="invoice_details"] textarea{min-width:260px}
}
.payment-table :is(.payment-reference,.payment-status) small{overflow-wrap:normal;word-break:normal}
#module-B td.numeric,#module-C td.numeric{white-space:nowrap;overflow-wrap:normal;word-break:normal}
body:has(.register-tools) .heading .page-actions{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;gap:var(--cell-gap)}
body:has(.register-tools) .page-actions .auxiliary-actions{display:contents}
body:has(.register-tools) .heading .page-actions .button{height:44px;min-height:44px;flex:0 0 auto;width:auto;display:inline-flex;align-items:center;justify-content:center;padding:8px 12px}
@media(max-width:767px){
 .table-pagination-footer{flex-direction:column;align-items:stretch}
 .table-pagination-footer>.pagination{justify-content:flex-start;flex-wrap:wrap}
 .table-pagination-footer>.table-page-size{justify-content:flex-start}
 .table-pagination-footer a{display:inline-flex;align-items:center;min-width:44px;min-height:44px}
 .selection-bottom{align-items:flex-start}.selection-bottom .selection-actions{flex-wrap:wrap}
 .invoice-details-editor input[type=checkbox]{width:44px;min-width:44px;height:44px;margin:0}
}

@media(max-width:767px){.register-section .selection-col input{width:44px;height:44px;margin:0}.register-section .column-select{width:60px}}

.table-pagination-footer select{min-width:60px;padding-right:20px}

#shipment-payments a{overflow-wrap:normal;word-break:normal}

.invoice-index-table .invoice-cell{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden;line-height:1.4;overflow-wrap:normal;word-break:normal}

.selection-metrics strong{white-space:nowrap;overflow-wrap:normal;word-break:normal}

.legal-source-copy { overflow-wrap: anywhere; }
.legal-source-copy table { width: 100%; table-layout: fixed; }

.invoice-exports { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.invoice-exports h3 { flex-basis: 100%; }

.invoice-values-editor{max-width:1100px}
.invoice-values-editor .table-scroll table{min-width:620px}
.invoice-values-editor td input{width:140px;min-height:44px;text-align:center}
.invoice-values-editor .form-actions{gap:12px;flex-wrap:wrap}
.invoice-values-editor .column-text{min-width:180px;white-space:normal}

.ddp-allocation-editor { max-width: 1100px; }
.ddp-invoice-card #module-B table { table-layout: auto; }
.ddp-invoice-card #module-B td:nth-child(2) { white-space: nowrap; }
.ddp-details-editor #edit-form th[data-item-column="service"] { width: 70px; white-space: nowrap; }
.ddp-allocation-table { width: 100%; table-layout: fixed; }
.ddp-allocation-table th:first-child { width: 28%; }
.ddp-allocation-table input { min-width: 90px; width: 100%; }
.ddp-allocation-table th { white-space: normal; overflow-wrap: anywhere; }
main .invoice-module-nav a.not-applicable:is(:link,:visited,:hover,:focus) { background: var(--surface); color: var(--muted); }
@media (max-width: 767px) {
  .ddp-allocation-table { min-width: 620px; }
}

/* 3k: document split uses the same field spacing and surfaces as its editor. */
#cost-split{min-inline-size:0;margin-top:16px;padding:16px;border:1px solid var(--line);border-radius:8px}
#cost-split legend{font-weight:600;padding:0 6px}
#cost-split-reset{margin-top:12px}

.pool-history-table .date-cell{white-space:nowrap;overflow-wrap:normal;word-break:normal}

/* 3l: shared desktop layouts. */
@media(min-width:768px){
 .table-scroll>table{margin-left:auto;margin-right:auto}
 .table-pagination-footer{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr)}
 .table-pagination-footer>.pagination{position:relative;display:block;text-align:center}
 .table-pagination-footer>.pagination>a{position:absolute;white-space:nowrap;top:50%;transform:translateY(-50%)}
 .table-pagination-footer>.pagination>a:first-of-type{right:calc(100% + 12px)}
 .table-pagination-footer>.pagination>a:last-child{left:calc(100% + 12px);right:auto}
 .table-pagination-footer>.pagination>a:only-of-type:not(:last-child){right:calc(100% + 12px);left:auto}
 .register-tools{align-items:stretch}
 .register-tools>.card{height:100%}
 .invoice-exports{flex-wrap:nowrap;align-items:start}
 .invoice-exports h3{flex:0 0 auto;align-self:center;margin-right:12px}
 .invoice-exports .feature-unavailable-action{flex:0 1 auto}
 .invoice-exports .button{white-space:nowrap}
}
@media(min-width:1024px){
 .register-tools .selection-panel{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 12px;padding:12px 16px;align-content:space-between}
 .selection-panel [data-selection-field=selection-results],.selection-panel .selection-bottom{display:contents}
 .selection-panel .selection-metrics{grid-column:1;grid-row:1;margin:0;align-self:start}
 .selection-panel .selection-metrics small{line-height:14px}
 .selection-panel .selection-metrics strong{line-height:22px}
 .selection-panel .selection-breakdown{grid-column:1;grid-row:2;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));align-items:start;font-size:12px;line-height:16px;gap:10px}
 .selection-panel .selection-actions{grid-column:2;grid-row:1 / 3;display:flex;flex-direction:column;align-items:stretch;justify-content:space-between;gap:8px}
 .selection-panel .selection-actions button{padding:4px 6px;min-height:32px;font-size:12px}
 .register-filters .register-year-note{grid-column:1/-1}
}

.register-stage{grid-template-columns:80px minmax(70px,1fr) 70px}
.register-stage .button{justify-content:center;text-align:center}
.shipment-register input[type=checkbox]{width:16px;height:16px}
.ddp-warning{display:block;font-weight:700;color:var(--warning-text)}
.payment-search{max-width:none;width:100%}
.search-label-line,.search-input-line{display:flex;align-items:center;gap:12px}
.search-label-line{justify-content:space-between}
.search-label-line label{margin:0}
.search-input-line input{flex:1;min-width:0}
.search-input-line button{flex:none}
.badge.prepared-status{border:2px solid var(--warning-text);background:var(--warning-border);color:var(--ink);font-weight:700}
.payment-todo{display:block;white-space:normal;margin-top:6px}
.purchase-need-group:nth-of-type(even){background:var(--bg)}
.purchase-need-group{padding:12px;border-radius:var(--radius)}
.pool-rate-settings-card{margin-top:16px}
.reminder-settings{width:100%;max-width:none!important}
.reminder-settings td{vertical-align:top}
.reminder-settings th:first-child{width:22%}
.reminder-settings th:nth-child(3){width:40%}
.reminder-settings input[type=number]{max-width:160px}
.reminder-settings select{min-width:190px;max-width:220px}
@media(min-width:1280px){
 .register-section .register-scroll .shipment-register{table-layout:fixed;min-width:0;width:100%}
 .register-section .register-scroll .shipment-register :is(th,td){width:auto;min-width:0;max-width:none}
 .register-section .register-scroll .shipment-register :is(.supplier-cell,.proforma-cell,.goods-cell,.terms-cell,.container-cell){white-space:normal;overflow-wrap:anywhere}
 .register-section .register-scroll .shipment-register .selection-col{padding:9px 3px}
 .register-section .register-scroll .shipment-register .ui-identifier{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;overflow-wrap:normal}
 .shipment-register:not(.viewer-register) .column-select{width:2%}
 .shipment-register:not(.viewer-register) .column-destination{width:7.5%}
 .shipment-register:not(.viewer-register) .column-stage{width:25%}
 #register-orders .shipment-register .column-etd{width:7%}
}

.purchase-actions{white-space:nowrap}
.page-size-short,.mobile-table-controls{display:none}
@media(min-width:768px){
 .table-pagination-footer>.pagination>a.page-previous{right:calc(100% + 12px);left:auto}
 .table-pagination-footer>.pagination>a.page-next{left:calc(100% + 12px);right:auto}
}
@media(max-width:767px){
 .heading .actions,.heading .page-actions{align-items:stretch}
 .heading .actions>.button,.heading .page-actions>.button{height:auto;align-self:stretch;min-height:44px}
 .selection-panel .selection-breakdown{flex-direction:column;align-items:flex-start}
 .currency-operations>.metrics{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
 .currency-operations>.metrics>.card{padding:12px;min-width:0}
 .currency-operations>.metrics strong{font-size:20px;overflow-wrap:anywhere}
 .currency-operations>.metrics small{font-size:12px}
 .table-scroll:has(>.mobile-list),.table-scroll:has(>.mobile-editor){overflow:visible;min-width:0}
 table.mobile-list,table.mobile-editor{display:block;width:100%;min-width:0!important;max-width:none;table-layout:auto}
 :is(.mobile-list,.mobile-editor)>colgroup{display:none}
 :is(.mobile-list,.mobile-editor)>tbody{display:block}
 :is(.mobile-list,.mobile-editor)>tbody>tr{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;padding:12px;margin:10px 0;border:1px solid var(--line);border-radius:var(--radius);min-width:0}
 :is(.mobile-list,.mobile-editor)>tbody>tr>:is(td,th){display:block;grid-column:1/-1;min-width:0!important;max-width:100%;width:auto!important;padding:4px 0;border:0;white-space:normal!important;overflow-wrap:anywhere}
 .card .table-scroll :is(.mobile-list,.mobile-editor)>tbody>tr>:is(td,th){font-size:12px;line-height:18px}
 :is(.mobile-list,.mobile-editor)>tbody>tr>[data-label]::before{content:attr(data-label);display:block;color:var(--muted);font-size:12px;font-weight:600;line-height:1.4;margin-bottom:3px}
 .mobile-list>tbody>tr>:is(.mobile-card-id,[data-card-id=true]){grid-column:1;grid-row:1;align-self:center;text-align:left;font-weight:700}
 .mobile-list>tbody>tr>:is(.mobile-card-id,[data-card-id=true])::before{display:none}
 .mobile-list>tbody>tr>[data-card-status=true]{grid-column:2;grid-row:1;align-self:start;max-width:125px;text-align:right;font-weight:700}
 .mobile-list>tbody>tr>[data-card-status=true]::before{display:none}
 .mobile-list>tbody>tr>[data-card-action=true]{order:100}
 .mobile-list .invoice-cell{display:block;overflow:visible;-webkit-line-clamp:unset;overflow-wrap:anywhere}
 .mobile-list.mobile-menus-moved>thead,.mobile-editor>thead{display:none}
 .mobile-list:not(:has(thead .column-menu))>thead{display:none}
 .mobile-list>thead,.mobile-list>thead>tr,.mobile-list>thead>tr>th{display:block;width:auto}
 .mobile-list>thead th{min-width:0}
 .mobile-table-controls{display:block;margin:8px 0}
 .mobile-table-controls>summary{display:flex;align-items:center;min-height:44px;border:1px solid var(--line);border-radius:8px;padding:8px 12px;font-weight:600;cursor:pointer}
 .mobile-column-list{display:grid;gap:8px;padding:8px}
 .mobile-column-item{display:flex;align-items:center;gap:8px;position:relative}
 .mobile-column-item>.column-menu{flex:1;min-width:0}
 .mobile-column-item>.header-help{flex:none}
 .mobile-column-list .column-menu>summary{min-height:44px;display:flex;align-items:center;justify-content:space-between}
 .mobile-list .ui-identifier,.mobile-list a,.mobile-list small{white-space:normal;overflow-wrap:anywhere!important;word-break:normal}
 .mobile-list .ui-identifier{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;overflow-wrap:normal!important}
 .shipment-register>tbody>tr.shipment-data-row{grid-template-columns:44px minmax(0,1fr) auto}
 .shipment-register>tbody>tr>.selection-col{grid-column:1;grid-row:1;padding:0;align-self:start}
 .shipment-register>tbody>tr>.proforma-cell{grid-column:2;grid-row:1}
 .shipment-register>tbody>tr>.settlement-cell,.shipment-register .register-stage{display:contents}
 .shipment-register .register-stage>*{grid-column:1/-1;order:100}
 .shipment-register .register-stage>.primary-status{grid-column:3;grid-row:1;order:0;max-width:90px;white-space:normal;align-self:start}
 .shipment-register.viewer-register>tbody>tr{grid-template-columns:minmax(0,1fr)}
 .shipment-register.viewer-register>tbody>tr>.proforma-cell{grid-column:1}
 .shipment-register .selection-touch{display:flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;margin:0}
 .shipment-register .selection-touch input{width:16px!important;height:16px!important;min-width:16px!important;min-height:16px!important;margin:0;flex:none}
 .shipment-register>tbody>tr.shipment-reminders-row{display:none}
 .shipment-register .register-stage .button{display:flex;justify-content:center;width:100%;min-height:44px}
 .shipment-register .register-stage>.button.compact{grid-column:1/-1}
 .payment-table>tbody>tr>.payment-status{display:contents}
 .payment-table .payment-status>*{grid-column:1/-1;order:80}
 .payment-table .payment-status>.primary-status{grid-column:2;grid-row:1;order:0;max-width:120px;white-space:normal;align-self:start}
 .payment-table .payment-status>.payment-todo{grid-column:1/-1;grid-row:2;order:0;text-align:left}
 .payment-table .payment-status::before{display:none}
 .mobile-list .check{min-height:44px}
 .mobile-editor>tbody>tr{grid-template-columns:minmax(0,1fr)}
 .mobile-editor :is(input:not([type=checkbox]),select,textarea){width:100%;min-width:0!important;max-width:100%}
 .mobile-editor .field{min-width:0}
 .mobile-editor tfoot,.mobile-editor tfoot tr,.mobile-editor tfoot :is(th,td){display:block;width:100%;text-align:left}
 .mobile-editor tfoot :is(td,th){white-space:normal;overflow-wrap:anywhere}
 .mobile-editor tfoot td::before{content:attr(data-label);display:block;font-weight:600}
 .mobile-form-list input,.mobile-form-list select{width:100%;min-width:0!important}
 .table-pagination-footer{display:grid;grid-template-columns:auto auto;justify-content:center;align-items:center;gap:4px;padding:8px 0;font-size:11px}
 .table-pagination-footer>.result-count{grid-column:1;grid-row:1;white-space:nowrap}
 .table-pagination-footer>.table-page-size{grid-column:2;grid-row:1;justify-content:center;gap:4px}
 .table-pagination-footer>.pagination{grid-column:1/-1;grid-row:2;justify-content:center;flex-wrap:nowrap;gap:10px}
 .table-pagination-footer .page-size-long{display:none}
 .table-pagination-footer .page-size-short{display:inline}
 .table-pagination-footer .table-page-size label{gap:4px;font-size:11px}
 .table-pagination-footer :is(select,button){min-height:44px;height:44px;padding:4px;min-width:44px;font-size:11px}
 .table-pagination-footer select{min-width:50px;padding-right:16px}
 .table-pagination-footer .page-size-submit{display:none}
 .search-label-line{flex-wrap:wrap}
 .search-label-line .hide-finished{display:flex;align-items:center;gap:8px}
}

@media(max-width:767px){
 .heading>.actions,body:has(.register-tools) .heading .page-actions{display:grid;grid-template-columns:minmax(0,1fr);grid-auto-rows:1fr;align-items:stretch;width:100%}
 .heading .auxiliary-actions{display:contents}
 .heading>.actions .button,body:has(.register-tools) .heading .page-actions .button{width:100%;height:auto;min-height:44px;display:flex;align-items:center;justify-content:center;white-space:normal}
 .heading{align-items:stretch}
}

.need-card-heading,.need-date-label{display:none}
.mobile-card-value,.need-date-row{display:contents}
.table-scroll .mobile-card-value>small{display:block}
.metrics small.pool-reservation-warning{color:var(--warning-text)}
@media(max-width:767px){
 .need-date-label{display:block;color:var(--muted);font-size:12px;font-weight:600;margin-bottom:3px}
 .need-card-heading{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;text-align:left;font-weight:700;margin-bottom:6px}
 .need-card-heading a{overflow-wrap:anywhere}
 .need-card-heading .badge{align-self:start}
 :is(.mobile-list,.mobile-editor)>tbody>tr{gap:2px}
 .table-scroll .mobile-list>tbody>tr>td:has(>.mobile-card-value):not([data-card-id=true]){display:flex;flex-wrap:wrap;justify-content:space-between;align-items:baseline;column-gap:8px;row-gap:0;text-align:right;padding:1px 0;max-width:100%}
 .table-scroll .mobile-list>tbody>tr>td:has(>.mobile-card-value):not([data-card-id=true])::before{flex:0 1 auto;max-width:100%;text-align:left;line-height:18px;margin:0}
 .mobile-list>tbody>tr>td>.mobile-card-value{display:block;flex:0 1 auto;min-width:0;max-width:100%;margin-left:auto;text-align:right}
 .mobile-list>tbody>tr>[data-card-id=true]>.mobile-card-value{display:contents;text-align:inherit}
 .mobile-list .mobile-card-value :is(.invoice-cell,.ui-identifier){text-align:inherit}
 .mobile-list .goods-cell>.mobile-card-value>span{display:block;-webkit-line-clamp:unset;overflow:visible}
 .mobile-form-list .mobile-card-value:has(input){width:145px}
 .mobile-form-list .mobile-card-value input{max-width:100%}
 .need-date-row{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:baseline;gap:0 8px;text-align:right}
 .need-date-row>.need-date-label{text-align:left;margin:0;line-height:18px}
 .need-date-row>.mobile-card-value{display:block;margin-left:auto}
}

/* Closure: shared controls, compact cards and predictable headings. */
.purchase-search{display:block;width:auto;max-width:none}
.purchase-search>label{margin-bottom:8px}
.purchase-search>.actions{display:flex;flex-wrap:nowrap;align-items:center}
.purchase-search input{flex:1;min-width:0}
main .purchase-search>.actions>button{flex:0 0 auto;width:auto}
.payment-table .payment-status>.badge{display:block;width:fit-content;max-width:100%;white-space:normal}
.card>details+details{margin-top:12px}
@media(min-width:768px){
 .shipment-register .selection-touch{display:flex;align-items:center;justify-content:center;margin:0}
 .shipment-register .selection-touch input{display:block;margin:0}
 .shipment-register .register-stage{grid-template-columns:92px minmax(70px,1fr) 70px}
 .shipment-register .register-stage>.primary-status{white-space:normal;overflow-wrap:normal;word-break:normal}
}
@media(max-width:767px){
 .heading{min-width:0;height:auto;align-items:stretch;gap:12px}
 .heading>a.button{align-self:center;flex:none;height:auto;min-height:44px;max-width:100%}
 .heading>.actions,body:has(.register-tools) .heading .page-actions{grid-auto-rows:1fr}
 button,a.button{display:inline-flex;align-items:center;justify-content:center;line-height:20px;text-align:center;white-space:normal;max-width:100%;min-height:44px}
 :is(.card,.form-card,.column-filter-panel) :is(button,a.button){align-self:center;justify-self:center;margin-inline:auto}
 :is(.card,.form-card,.column-filter-panel) :is(.actions,.form-actions,.workflow-next){justify-content:center}
 .admin-entry-actions{justify-content:center;width:100%}
 .card>button,.card>a.button,.card>form>button{display:flex;margin-inline:auto}
 .mobile-list :is(button,a.button),.mobile-editor :is(button,a.button){margin-inline:auto}
 :is(.mobile-list,.mobile-editor) .mobile-card-value:has(button,a.button,.check){display:flex;justify-content:center;width:100%}
 .search-input-line{margin-top:8px}
 .card .table-scroll :is(.mobile-list,.mobile-editor) :is(td,th,small,.badge,.check,.mobile-card-value,.need-card-heading,.need-date-row,.need-date-label){font-size:12px;line-height:18px}
 .mobile-editor .ui-identifier{white-space:normal;overflow-wrap:anywhere;word-break:normal}
 .mobile-list>tbody>tr>[data-card-action=true]>.mobile-card-value{width:100%;text-align:center}
 body :is(input:not([type=checkbox]):not([type=radio]),select,textarea){font-size:16px;min-height:44px}
 body details>summary{min-height:44px;display:flex;align-items:center}
 body details:not(.account-menu,.column-menu)>summary:not(.check,.button,[role=button],.need-days summary)::before{content:"▶";flex:none;margin-right:8px;font-size:10px}
 body details[open]:not(.account-menu,.column-menu)>summary:not(.check,.button,[role=button],.need-days summary)::before{content:"▼"}
 :is(.preparation-grid>div,.purchase-confirmation) :is(.check,a.button){display:flex;width:fit-content;margin-inline:auto;justify-content:center}
}

/* Review corrections: predictable return controls and compact financial cards. */
.heading:has(.back-link,.close-control){position:relative;padding-right:92px;min-height:40px}
.heading :is(.back-link,.close-control){position:absolute;right:0;top:0;margin:0;width:auto}
@media(min-width:768px){.heading:has(>.close-control){min-height:46px;padding-right:128px}}
.column-panel-heading{display:flex;justify-content:flex-end;flex:none;margin-bottom:8px}
.column-panel-heading .column-close{margin:0}
textarea{line-height:1.5;height:calc(6em + 18px);min-height:calc(6em + 18px);overflow-y:auto}
[data-today-target]{margin-top:8px}
#payment-email [data-copy="email-subject"]{margin:8px 0 16px}
.preparation-grid>div{display:flex;flex-direction:column;align-items:stretch}
.preparation-grid>div>p:has(+form){margin-top:auto;padding-top:12px;margin-bottom:8px}
.preparation-grid>div>form{margin-bottom:0}
.purchase-actions{white-space:normal;overflow-wrap:anywhere}
.purchase-action-buttons{display:flex;gap:8px;flex-wrap:nowrap;width:max-content}
.purchase-action-buttons>a.button{margin:0}
.purchase-actions .actions{gap:8px}
.invoice-exports :is(form,.button,button){margin:0}
.invoice-exports .feature-unavailable-action>p{margin-top:8px}
#shipment-payments table,.invoice-final-modules table{min-width:0;table-layout:fixed;width:100%}
#shipment-payments :is(th,td),.invoice-final-modules :is(th,td){min-width:0;white-space:normal;overflow-wrap:anywhere}
#shipment-payments th:first-child{width:32%}
.table-actions{margin-bottom:12px}
.logistics-approval{display:flex;flex-direction:column;align-items:center;gap:8px}
@media(max-width:767px){
 .heading:has(.back-link,.close-control){padding:52px 0 0}
 .heading :is(.back-link,.close-control),body:has(.register-tools) .heading .page-actions .back-link{position:absolute;right:0;top:0;width:auto;min-height:44px}
 .selection-feedback{grid-template-rows:auto;row-gap:8px;min-height:0}
 .selection-feedback>p:empty{display:none}
 .selection-feedback:not(:has(p:not(:empty))):not(:has(details:not([hidden]))){display:none}
 .column-panel .column-values{flex:none;min-height:140px;max-height:220px;gap:0}
 .column-panel .column-values label{min-height:44px;flex-shrink:0;align-items:flex-start;white-space:normal;overflow-wrap:anywhere;line-height:20px;padding-block:10px}
 .column-panel .column-values input{flex:none}
 .column-panel{overflow-y:auto}
 .column-panel-heading .column-close{margin-left:auto;margin-right:0}
 .table-scroll>table:not(.mobile-list):not(.mobile-editor) :is(th,td).column-text{min-width:160px;white-space:normal;overflow-wrap:anywhere}
 .table-scroll>table:not(.mobile-list):not(.mobile-editor) :is(th,td){padding:8px}
 .card :is(.actions,.form-actions,.table-actions){gap:8px}
 .card :is(.table-scroll+form,.table-scroll+.actions){margin-top:8px}
 .invoice-card .table-card>form{margin-inline:16px}
 .invoice-card .table-scroll :is(td,th){font-size:12px}
 body:has(.register-tools) .heading .page-actions .button{font-size:12px}
 body details>summary{flex-wrap:nowrap;align-items:baseline}
 .table-scroll .mobile-list>tbody>tr>.payment-check{display:flex;flex-wrap:nowrap;align-items:center;gap:8px}
 .table-scroll .mobile-list>tbody>tr>.payment-check::before{flex:1;min-width:0}
 .table-scroll .mobile-list>tbody>tr>.payment-check>.mobile-card-value{width:auto;flex:0 0 auto;max-width:48%;margin:0;justify-content:flex-end}
 .preparation-grid>div{display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:8px;align-items:center}
 .preparation-grid>div>h3{grid-column:1;grid-row:1;margin:0}
 .preparation-grid>div>:is(form,.check){grid-column:2;grid-row:1}
 .preparation-grid>div>p{grid-column:1/-1}
 .preparation-grid>div>p:has(+form){margin:0;padding:0}
 .preparation-grid>div>a{grid-column:1/-1;margin-block:8px}
 .preparation-grid>div .check{margin:0}
 .logistics-approval{margin-inline:16px}
}

.short-form-bar>button{margin-left:auto}
@media(max-width:767px){
 body details>summary.invoice-module-summary{display:grid;grid-template-columns:16px minmax(0,1fr);gap:8px;align-items:baseline}
 body details>summary.invoice-module-summary::before{grid-column:1;grid-row:1;margin-right:0}
 .invoice-module-summary>strong:first-child{grid-column:2;grid-row:1;min-width:0}
 .invoice-module-summary>:not(strong:first-child){grid-column:2;justify-self:start}
}

@media(max-width:767px){
 .column-panel :is(.column-sort-actions,.column-filter-actions){gap:8px}
 .purchase-actions>.button{margin:4px}
}

@media(max-width:767px){
 .purchase-confirmation{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:center}
 .purchase-confirmation>h3{grid-column:1;grid-row:1;margin:0}
 .purchase-confirmation>:is(form,.check){grid-column:2;grid-row:1}
 .purchase-confirmation>p{grid-column:1/-1;margin:0}
}

/* Return control is independent of the action group; amounts remain whole. */
main .heading a.button.back-link{width:auto;flex:0 0 auto}
#shipment-payments table,.invoice-final-modules table{table-layout:auto}
#shipment-payments td.numeric,.invoice-final-modules td.numeric{white-space:nowrap;overflow-wrap:normal;padding-inline:8px}
@media(min-width:768px){
 .heading :is(button,a.button){white-space:nowrap}
}
@media(max-width:767px){
 #shipment-payments table,.invoice-final-modules table{min-width:600px}
 main .heading:not(:has(h1,h2,h3,.back-link,.close-control)){display:grid;grid-template-columns:minmax(0,1fr);grid-auto-rows:1fr;align-items:stretch}
 main .heading:not(:has(h1,h2,h3,.back-link,.close-control))>a.button{align-self:stretch;height:100%}
}

#shipment-payments :is(th,td):last-child{white-space:nowrap;overflow-wrap:normal;min-width:70px;padding-inline:8px}
#shipment-payments td.date-cell{white-space:nowrap;overflow-wrap:normal;min-width:98px;padding-inline:8px}
#shipment-payments th{overflow-wrap:normal;word-break:normal}
#credits>.button{margin:8px 16px 0;max-width:calc(100% - 32px)}
@media(min-width:1024px){
 .preparation-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
 .preparation-grid>div{min-width:0}
 .preparation-grid a.button{white-space:normal;max-width:100%}
 .preparation-grid>div>p:has(+form,+.check){margin-top:auto;padding-top:12px;margin-bottom:8px}
 .preparation-grid>div>.check{align-self:flex-start}
}

.invoice-final-modules :is(th,td){overflow-wrap:normal;padding-inline:8px}
.invoice-final-modules td summary{overflow-wrap:normal;word-break:normal}


.invoice-exports .feature-unavailable-action{margin-top:0}
.admin-entry-actions{gap:8px}
@media(min-width:1024px){
 .selection-panel .selection-actions{gap:8px}
 .selection-panel .selection-actions button{min-height:28px}
}
@media(max-width:767px){
 #module-B table,#module-C table{table-layout:auto;min-width:600px}
 #module-B :is(td,th).column-text,#module-C :is(td,th).column-text{min-width:200px}
 .table-scroll>.reminder-settings :is(td,th):first-child{width:600px;min-width:600px}
 .table-scroll>.reminder-settings textarea{min-height:calc(6em + 18px)}
}
.purchase-confirmation{margin-top:16px}
@media(max-width:767px){
 .table-scroll>table.reminder-settings:not(.mobile-list):not(.mobile-editor) :is(td,th):first-child{width:600px;min-width:600px}
}


/* 3o: the existing pale red palette marks important card actions. */
button.important,.button.important{background:var(--error-bg);color:var(--error-text);border:1px solid var(--error-border)}
button.important:hover,.button.important:hover{background:var(--error-border);color:var(--error-text)}
:where(body:not(:has(#main-navigation a.active[href="/administracja/"]))) .heading>.actions{align-items:center}:where(body:not(:has(#main-navigation a.active[href="/administracja/"]))) .heading>.actions>.back-link{align-self:center;margin-block:0}
.info-window{display:inline-block;flex:0 0 44px;margin:0;position:relative}
.info-window>summary{display:flex;align-items:center;justify-content:center;list-style:none;width:44px;height:44px;min-height:44px;margin:0!important;padding:0;background:var(--surface);color:var(--ink);border:1px solid var(--line);border-radius:7px}
.info-window>summary::before,.info-window>summary::after{display:none!important}.info-window>summary::-webkit-details-marker{display:none}
.info-window>summary span{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border:1px solid currentColor;border-radius:50%;font-weight:700}
.info-window[open]>.info-content{min-width:280px;max-width:640px;background:var(--surface);padding:20px}
.info-content li{margin-block:10px}.content-dialog{width:min(680px,calc(100% - 32px));max-width:680px;max-height:90dvh;overflow:auto}.content-dialog .short-form-bar{display:flex;justify-content:flex-end;margin-bottom:16px}
.content-dialog form{width:100%}.content-dialog form>button{display:block;margin-inline:auto}
.invoice-exports{align-items:center}.invoice-exports h3{margin-block:0}.logistics-approval>p{margin-inline:0}
#credits.table-card>h2{padding-inline:0}
@media(max-width:767px){
 .short-form-dialog,.content-dialog{width:100%;max-width:100%;margin-inline:0;border-radius:0;padding:16px;max-height:100dvh}
 .content-dialog input,.content-dialog select,.content-dialog textarea{font-size:16px}
 .content-dialog button,.content-dialog .button{min-height:44px}
 :where(body:not(:has(#main-navigation a.active[href="/administracja/"]))) .heading>.actions>.info-window{flex:0 0 44px}
 .preparation-grid .confirm-action-caption,.purchase-confirmation .confirm-action-caption{display:none}
 .invoice-exports{display:flex;flex-direction:column;align-items:stretch;width:auto}
 .invoice-exports>form,.invoice-exports>.button,.invoice-exports>.feature-unavailable-action{width:100%;margin:0}
 .invoice-exports button{width:100%}
 .logistics-approval form>button{display:block;width:100%;margin-inline:auto}
 #credits.table-card>h2{padding-inline:0}
}
/* Header controls share one 44 px row; the return remains at the upper right. */
:where(body:not(:has(#main-navigation a.active[href="/administracja/"]))) .heading:has(.back-link)>.actions,:where(body:not(:has(#main-navigation a.active[href="/administracja/"]))) .heading:has(.back-link)>.page-actions{align-self:flex-start;margin-top:0;align-items:flex-start}
:where(body:not(:has(#main-navigation a.active[href="/administracja/"]))) .heading:has(.back-link)>.info-window{align-self:flex-start}
:where(body:not(:has(#main-navigation a.active[href="/administracja/"]))) .heading:has(.back-link) :is(a.button,button){min-height:44px;height:44px;margin-block:0}

.logistics-approval{align-items:stretch}.logistics-approval form>button{display:block;margin-inline:auto}
@media(max-width:767px){
 :where(body:not(:has(#main-navigation a.active[href="/administracja/"]))) .heading:has(.back-link)>.info-window,:where(body:not(:has(#main-navigation a.active[href="/administracja/"]))) .heading:has(.back-link)>.actions>.info-window{position:absolute;right:90px;top:0}
 :where(body:not(:has(#main-navigation a.active[href="/administracja/"]))) .heading:has(.back-link)>.actions>.info-window+.info-window{right:142px}
 :where(body:not(:has(#main-navigation a.active[href="/administracja/"]))) .heading:not(:has(.back-link,.close-control)):has(>.info-window,>.actions>.info-window,>.page-actions>.info-window){position:relative;padding-top:52px}
 :where(body:not(:has(#main-navigation a.active[href="/administracja/"]))) .heading:not(:has(.back-link,.close-control))>.info-window,:where(body:not(:has(#main-navigation a.active[href="/administracja/"]))) .heading:not(:has(.back-link,.close-control))>:is(.actions,.page-actions)>.info-window{position:absolute;right:0;top:0}
 .invoice-exports .feature-unavailable-action{width:100%;display:block}
}

.invoice-card .info-window{margin:0}

/* Keep module information accessible even when its body is collapsed. */
.invoice-module>.invoice-module-summary,summary.has-info-trigger{position:relative;padding-right:56px;min-height:44px}
.info-module-trigger{position:absolute;right:0;top:0;width:44px;height:44px;min-height:44px;padding:0;display:inline-flex;align-items:center;justify-content:center}
.info-module-trigger span{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border:1px solid currentColor;border-radius:50%;font-weight:700}
.invoice-module>.heading{justify-content:flex-end}
.page-card-grid:not(.invoice-card) #credits>.table-scroll{margin-inline:24px}
.page-card-grid:not(.invoice-card) #credits table{margin-inline:0}
.page-card-grid:not(.invoice-card) #credits :is(th,td):first-child{padding-left:0}
@media(max-width:767px){.page-card-grid:not(.invoice-card) #credits>.table-scroll{margin-inline:16px}}
@media(min-width:1024px){
 :where(body:not(:has(#main-navigation a.active[href="/administracja/"]))) .heading:has(.back-link){align-items:flex-start}
 :where(body:not(:has(#main-navigation a.active[href="/administracja/"]))) .heading:has(.back-link)>div:first-child:not(.actions){min-width:240px;flex:1 0 240px}
 :where(body:not(:has(#main-navigation a.active[href="/administracja/"]))) .heading:has(.back-link)>.actions{flex:0 1 auto;flex-wrap:wrap;justify-content:flex-end;min-width:0;max-width:calc(100% - 260px)}
}

@media(min-width:768px){
 .invoice-exports{align-items:flex-start}
 .invoice-exports h3{height:46px;display:flex;align-items:center;align-self:flex-start}
}

/* PR #114 review: shared 8 px spacing and the approved card widths. */
.forward-metrics .forward-available{background:var(--green);border-color:var(--success-border)}
.forward-metrics .forward-available strong{color:var(--success-text)}
#saved-draft-notice{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.admin-entry-actions .more-actions>.actions{gap:8px}
:is(a.button,button,.actions,form):has(+table,+.table-scroll){margin-bottom:8px}
:is(table,.table-scroll)+:is(a.button,button,.actions,form){margin-top:8px}
@media(min-width:768px){
 .page-card-grid:not(.invoice-card) #credits>.button{margin-left:24px}
 .page-card-grid:not(.invoice-card) #credits table{max-width:none;width:100%}
}
@media(min-width:1280px){
 .invoice-card>.invoice-final-modules>#credits{grid-column:auto;width:100%;max-width:none}
 .invoice-card>.invoice-final-modules>#credits table{table-layout:auto;min-width:0}
 .invoice-card>.invoice-final-modules>#credits th:last-child{width:24%}
 .invoice-card>.invoice-final-modules>#credits td details{min-width:0;max-width:100%}
 .invoice-card>.invoice-final-modules>#credits td :is(summary,button){white-space:normal;overflow-wrap:anywhere}
 .invoice-card>.invoice-final-modules>#credits :is(th,td){white-space:normal;overflow-wrap:anywhere}
 .invoice-card>.invoice-final-modules>#credits td.numeric{white-space:nowrap;overflow-wrap:normal}
}
@media(max-width:767px){
 .table-scroll .mobile-list>tbody>tr>.payment-check+.payment-check{margin-top:8px}
}
