:root {
  color-scheme:light;
  --brand:#235e51;
  --dark:#173c33;
  --ink:#1d2c27;
  --muted:#52665f;
  --amber:#ffcd76;
  --line:#d7e1dc;
  --bg:#f2f5f3;
  --paper:#fff;
  --tint:#eaf2ed;
  --soft:#f7faf8;
  --alert:#8a3425;
  --radius:1.125rem;
  --shadow:0 2px 6px #1a3d3009;
  --page-width:1440px;
  --gutter:clamp(1rem,3.3vw,3rem);
  --section-space:clamp(1.4rem,3vw,2.5rem);
  --panel-pad:clamp(1rem,2.1vw,1.5rem);
  --control-height:44px;
  --mobile-bar:3.85rem;
  font-family:system-ui,-apple-system,"Segoe UI",sans-serif;
  color:var(--ink);
  background:var(--bg);
}

*, *::before, *::after { box-sizing:border-box; }
[hidden] { display:none !important; }
body { margin:0; line-height:1.5; }
body:has(dialog[open]) { overflow:hidden; }
h1,h2,h3,p { margin:0; }
h1,h2,h3 { line-height:1.2; overflow-wrap:anywhere; }
h1 { color:var(--dark); font-size:clamp(2rem,4.2vw,3.4rem); font-weight:740; letter-spacing:-.045em; line-height:1.08; }
h2 { color:var(--dark); font-size:clamp(1.2rem,2vw,1.5rem); letter-spacing:-.024em; }
h3 { font-size:1.0625rem; }
p+p { margin-top:.6rem; }
a { color:var(--brand); text-underline-offset:.18em; overflow-wrap:anywhere; }
a:hover { color:var(--dark); }
time { font-variant-numeric:tabular-nums; white-space:nowrap; }
:focus-visible { outline:3px solid #98621d; outline-offset:3px; }
button,input,select,textarea { font:inherit; }

button,.button,.barin nav a {
  display:inline-flex; align-items:center; justify-content:center; gap:.45rem;
  min-height:var(--control-height); min-width:0; max-width:100%; padding:.55rem 1rem;
  border:1px solid var(--line); border-radius:.75rem; background:var(--paper); color:var(--dark);
  font-size:.9375rem; font-weight:650; line-height:1.25; text-align:center;
  text-decoration:none; overflow-wrap:anywhere; cursor:pointer;
}
button:hover,.button:hover,.barin nav a:hover { background:var(--tint); border-color:#a9c2b5; }
button:disabled { opacity:.55; cursor:default; }
.primary { background:var(--brand); border-color:var(--brand); color:white; }
.primary:hover { background:var(--dark); border-color:var(--dark); color:white; }
.quiet-button { background:transparent; border-color:transparent; }
.quiet-button:hover { border-color:transparent; }
.create-action::before {
  content:""; flex:0 0 .875rem; height:.875rem;
  background:linear-gradient(currentColor,currentColor) center / .875rem 2px no-repeat,
    linear-gradient(currentColor,currentColor) center / 2px .875rem no-repeat;
}
button.danger { color:var(--alert); }
button.danger:hover { background:#fff0ea; border-color:#d4a69a; }

.skip { position:fixed; top:-5rem; left:var(--gutter); z-index:10; background:white; padding:.75rem; }
.skip:focus { top:.75rem; }
.bar {
  position:sticky; z-index:3; top:0; background:var(--paper);
  border-bottom:1px solid var(--line); box-shadow:var(--shadow);
}
.barin {
  display:grid; grid-template-columns:1fr auto 1fr; align-items:center;
  gap:.5rem 1rem; max-width:var(--page-width); margin:auto; padding:.625rem var(--gutter);
}
.brand { display:flex; justify-self:start; align-items:center; min-height:var(--control-height); }
.brand img { display:block; width:116px; max-width:100%; height:auto; }
.barin nav { display:flex; align-items:stretch; gap:.25rem; min-width:0; }
.barin nav a { background:transparent; border-color:transparent; color:var(--muted); white-space:nowrap; }
.barin nav a[aria-current="page"] { background:var(--tint); color:var(--dark); font-weight:750; }
.who { display:flex; justify-self:end; align-items:center; gap:.75rem; color:var(--muted); font-size:.875rem; }
.who .back { display:inline-flex; align-items:center; min-height:var(--control-height); text-decoration:none; font-weight:600; }
.who .back:is(:hover,[aria-current="page"]) { text-decoration:underline; }
.who button { padding-inline:.65rem; font-size:inherit; }
.account-link { border-inline-start:1px solid var(--line); padding-inline-start:.75rem; white-space:nowrap; }

.work {
  max-width:var(--page-width); margin:auto;
  padding:clamp(1.4rem,4vw,3rem) var(--gutter) 4rem;
}
.work:focus-visible { outline:none; }
.work:focus-visible h1 { width:fit-content; outline:3px solid #98621d; outline-offset:3px; border-radius:.125rem; }
.top h1:focus { outline:none; }
.top,.sectionhead,.actions,.line {
  display:flex; flex-wrap:wrap; align-items:center; gap:.55rem .75rem; min-width:0;
}
.top,.sectionhead,.line { justify-content:space-between; }
.top { align-items:end; gap:.9rem 1.25rem; margin-bottom:var(--section-space); }
.page-lead { flex:1 1 22rem; min-width:0; overflow-wrap:anywhere; }
.page-meta { margin-bottom:.625rem; color:var(--muted); font-size:.875rem; font-weight:650; }
.workspace-date { display:block; white-space:normal; }
.workspace-date::first-letter { text-transform:uppercase; }
.top .actions { max-width:100%; }
.page-description { margin-top:.625rem; color:var(--muted); max-width:64ch; }
.eyebrow { margin-bottom:.35rem; color:var(--brand); font-size:.8125rem; font-weight:750; }
.muted,small { color:var(--muted); }
small { font-size:.8125rem; }
.quiet { margin-top:.25rem; color:var(--muted); font-size:.875rem; }
.section { min-width:0; margin-block:var(--section-space); }
.sectionhead { margin-bottom:.875rem; }
.sectionhead h2 { min-width:0; }
.sectionhead .actions { gap:.5rem; }
.sectionhead button { font-size:.875rem; }
.section-link,.hero-link {
  display:inline-flex; align-items:center; gap:.5rem; min-height:var(--control-height);
  font-size:.875rem; font-weight:700; text-decoration:none;
}
.section-link:hover,.hero-link:hover { text-decoration:underline; }
.actions:empty { display:none; }

.card,details.panel,.hero,.record-list,.page-summary {
  min-width:0; border:1px solid var(--line); border-radius:var(--radius);
  background:var(--paper); box-shadow:var(--shadow); overflow-wrap:anywhere;
}
.card { padding:var(--panel-pad); }
.card :is(h2,h3)+p { margin-top:.55rem; }
.empty {
  padding:var(--panel-pad); border:1px solid var(--line); border-radius:var(--radius);
  background:var(--paper); color:var(--muted); overflow-wrap:anywhere;
}
.stack { display:grid; gap:.75rem; min-width:0; }
.line { align-items:baseline; }
.value,.amount { font-weight:750; font-variant-numeric:tabular-nums; }
.pill {
  display:inline-block; max-width:100%; padding:.225rem .65rem; border-radius:1rem;
  background:var(--tint); color:#235343; font-size:.8125rem; font-weight:650; line-height:1.35; overflow-wrap:anywhere;
}
.pill.neutral { background:#edf1f3; color:#43545c; }
.pill.warn { background:#ffebcf; color:#723a17; }
.breadcrumb { display:flex; align-items:center; justify-content:space-between; gap:.625rem; margin:-.625rem 0 .55rem; }
.back,.filelink { display:inline-flex; align-items:center; min-height:var(--control-height); font-weight:650; }
.breadcrumb>.back { gap:.5rem; font-size:.875rem; text-decoration:none; }
.breadcrumb>.back:hover { text-decoration:underline; }
.breadcrumb>.back::before {
  content:""; flex:0 0 .45rem; height:.45rem;
  border-left:1.5px solid currentColor; border-bottom:1.5px solid currentColor; transform:rotate(45deg);
}
.note { margin-top:.5rem; white-space:pre-wrap; overflow-wrap:anywhere; }

details.panel { padding:0; }
details.panel+details.panel { margin-top:.65rem; }
details.panel>summary {
  display:flex; justify-content:space-between; align-items:center; gap:.75rem;
  min-height:var(--control-height); padding:.65rem var(--panel-pad); border-radius:inherit;
  list-style:none; color:var(--dark); font-weight:700; cursor:pointer;
}
details.panel>summary::-webkit-details-marker { display:none; }
details.panel>summary:hover,details.panel[open]>summary { background:var(--tint); }
details.panel>summary::after {
  content:""; flex:0 0 .5rem; height:.5rem; margin:.2rem;
  border-right:1.5px solid currentColor; border-bottom:1.5px solid currentColor; transform:rotate(45deg);
}
details.panel[open]>summary { border-end-start-radius:0; border-end-end-radius:0; }
details.panel[open]>summary::after { transform:rotate(225deg); }
.panel-body {
  display:grid; gap:.75rem; min-width:0; padding:var(--panel-pad);
}
.panel-body p+p { margin-top:0; }
.panel-body>.section { margin:0; }
.record-list { padding:0; margin:0; list-style:none; }
.record-list>li { margin:0; padding:.75rem var(--panel-pad); overflow-wrap:anywhere; }
.record-list>li+li { border-top:1px solid var(--line); }
.record-list>li>details.panel { border:0; box-shadow:none; }
.record-list>li>details.panel>summary { padding-inline:.5rem; }
.record-list>li>details.panel>.panel-body { padding-inline:.5rem; }
.help-card { max-width:50rem; }
.help-card ol { margin:0 0 1rem; padding-inline-start:1.5rem; }
.help-card li { padding-inline-start:.25rem; }
.help-card li+li { margin-top:.6rem; }
.help-card li::marker { color:var(--brand); font-weight:700; }

#app:has(.welcome) {
  display:grid; place-items:center; min-height:100dvh; padding:1.25rem var(--gutter);
  background:radial-gradient(ellipse at 50% 0%,var(--tint),transparent 72%),var(--bg);
}
.welcome {
  width:min(100%,29rem); padding:clamp(1.4rem,6vw,2.5rem); border:1px solid var(--line);
  border-radius:1.5rem; background:var(--paper); box-shadow:0 16px 55px #173c3310;
}
.welcome img { display:block; width:128px; height:auto; margin-bottom:1.75rem; }
.welcome h1 { font-size:clamp(1.8rem,6vw,2.4rem); margin-bottom:.625rem; }
.welcome form { margin:1.5rem 0 1.125rem; }
.welcome form button { min-height:48px; }
.account-settings { display:grid; gap:1rem; align-items:start; }
.account-panel { display:grid; gap:1rem; min-width:0; }
.account-panel #change-password { max-width:27rem; }
.account-status { color:var(--brand); font-size:.875rem; }
.account-status:empty { display:none; }
.account-list { list-style:none; margin:0; padding:0; }
.account-row {
  display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between;
  gap:.5rem 1rem; padding:.75rem 0; border-top:1px solid var(--line); overflow-wrap:anywhere;
}
.account-row .muted { font-size:.875rem; }
@media (min-width:60rem) {
  .account-settings:has([data-accounts]) { grid-template-columns:minmax(0,24rem) minmax(0,1fr); }
}
form { display:grid; gap:.875rem; min-width:0; }
.field { min-width:0; }
label.field {
  display:flex; flex-direction:column; gap:.3rem; min-width:0; font-size:.875rem;
  font-weight:650; line-height:1.35; overflow-wrap:anywhere;
}
.field>small { font-weight:400; }
input,select,textarea {
  width:100%; min-width:0; min-height:var(--control-height); padding:.55rem .65rem;
  border:1px solid #91a69a; border-radius:.65rem; background:var(--paper); color:var(--ink);
  font-size:1rem; font-weight:400; line-height:1.35;
}
input::placeholder { color:#64776e; opacity:1; }
select {
  appearance:none; padding-right:2rem; text-overflow:ellipsis;
  background-image:linear-gradient(45deg,transparent 50%,var(--brand) 50%),linear-gradient(135deg,var(--brand) 50%,transparent 50%);
  background-position:right 1.05rem center,right .75rem center; background-size:.3rem .3rem; background-repeat:no-repeat;
}
input:is(:disabled,[readonly]),select:disabled { background-color:var(--bg); color:var(--muted); }
input:invalid:not(:placeholder-shown):focus { border-color:var(--alert); }
textarea { min-height:5rem; resize:vertical; }
input[type=file] { padding:.35rem; }
input::file-selector-button {
  border:0; padding:.4rem .6rem; margin-inline-end:.5rem; border-radius:.4rem;
  background:var(--tint); color:var(--dark); font:inherit; cursor:pointer;
}
.sku-photo-preview {
  width:min(100%,12rem); height:8rem; object-fit:contain;
  border:1px solid var(--line); border-radius:.55rem; background:var(--soft);
}
.fields {
  display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,9.25rem),1fr));
  gap:.75rem; align-items:end; min-width:0;
}
.fields:not(:has(>:not([hidden]))) { display:none; }
.rule-fields { grid-template-columns:minmax(0,1.7fr) minmax(7rem,1fr); }
.rule-fields>label:first-child,.rule-fields>.date-field { grid-column:1/-1; }
.check { display:flex; align-items:center; gap:.65rem; min-height:var(--control-height); overflow-wrap:anywhere; }
input[type=checkbox],input[type=radio] {
  flex:0 0 auto; width:20px; min-height:20px; margin:0; accent-color:var(--brand);
}
.box,fieldset {
  min-width:0; margin:0; padding:.75rem; border:1px solid var(--line); border-radius:.7rem; overflow-wrap:anywhere;
}
fieldset { background:var(--soft); }
legend { max-inline-size:100%; padding:0 .35rem; font-weight:700; line-height:1.35; overflow-wrap:anywhere; }
.preview {
  margin:0; padding:.65rem .8rem; border-radius:.65rem; background:var(--tint); overflow-wrap:anywhere;
}
.service-recipient { grid-template-columns:minmax(0,1.7fr) minmax(5.4rem,1fr); }
.error:empty { display:none; }
.error:not(:empty) { padding:.65rem .75rem; border-radius:.55rem; background:#fff1ea; color:var(--alert); overflow-wrap:anywhere; }

.date-field { position:relative; }
.date-field:has(button:not([hidden])) [data-date-text] { padding-inline-end:2.5rem; }
.date-field>input[type=date] {
  position:absolute; inset:auto 0 0 auto; width:2.5rem; height:var(--control-height); opacity:0; pointer-events:none;
}
.date-field>button {
  position:absolute; right:0; bottom:0; width:var(--control-height); border:0; padding:0; background:transparent;
}
.date-field>button:hover { color:var(--brand); background:#eaf2ed99; }
.date-icon { display:block; width:16px; height:15px; border:1.5px solid currentColor; border-radius:3px; }
.date-icon::before { display:block; height:3px; border-bottom:1.5px solid currentColor; content:""; }

.toolbar {
  display:grid; align-items:end; gap:.75rem; min-width:0; padding:var(--panel-pad);
  border:1px solid var(--line); border-radius:var(--radius); background:var(--paper); box-shadow:var(--shadow);
}
.filters {
  grid-template-columns:minmax(14rem,2fr) repeat(2,minmax(9rem,1fr)) auto;
  margin-bottom:1rem;
}
.filter-actions { gap:.5rem; }

.dashboard-head {
  display:grid; grid-template-columns:minmax(0,1.55fr) minmax(0,1fr); gap:1rem; align-items:stretch;
}
.hero {
  display:grid; grid-template-rows:auto 1fr auto; align-items:center; justify-items:start; gap:.65rem;
  padding:clamp(1.25rem,3vw,1.85rem); border-color:transparent; color:white;
  background:radial-gradient(ellipse at 100% 0%,#39715e,transparent 65%),linear-gradient(125deg,var(--dark),var(--brand));
}
.hero-heading { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:.5rem; width:100%; }
.hero h2 { color:#e2efe8; font-size:1rem; font-weight:650; letter-spacing:0; }
.hero p { color:#e2efe8; font-size:.875rem; }
.hero strong { display:block; font-size:clamp(1.15rem,2vw,1.55rem); line-height:1.2; }
.hero strong+p,.hero .hero-amount+p { margin-top:.35rem; }
.hero-payment { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-items:center; gap:1rem; width:100%; }
.hero-payment>div:last-child { text-align:end; }
.hero .hero-amount {
  color:white; font-size:clamp(1.6rem,3.2vw,2.7rem); font-weight:750; line-height:1.1;
  letter-spacing:-.045em; font-variant-numeric:tabular-nums;
}
.hero .hero-empty { align-self:center; font-size:clamp(1.45rem,3vw,2.1rem); }
.hero-link,.hero-link:hover { color:var(--amber); }
.hero-link:focus-visible { outline-color:var(--amber); }
.calendar-toolbar { align-content:center; }
.dashboard-head .actions { gap:.5rem; }
.dashboard-records {
  display:grid; grid-template-columns:minmax(0,1.15fr) minmax(0,1fr); gap:1rem;
  margin-block:var(--section-space);
}
.dashboard-records>.section { margin:0; }
.debt { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,.85fr); gap:.4rem 1rem; scroll-margin:1rem; }
.debt-payee { margin-top:.25rem; }
.debt-summary { display:grid; justify-items:end; align-content:start; gap:.35rem; text-align:right; }
.debt-summary .value { font-size:1.3rem; line-height:1.25; }
.task-record { display:grid; gap:.25rem; }
.task-meta {
  display:flex; flex-wrap:wrap; align-items:center; gap:.15rem .8rem; color:var(--muted); font-size:.875rem;
}
.task-meta .back { min-height:34px; }

.calendar { margin-top:1rem; }
.calendar .sectionhead { margin-bottom:1rem; }
.calendar-layout { display:grid; grid-template-columns:minmax(0,26rem) minmax(0,1fr); align-items:start; gap:1rem 1.4rem; }
.calendar-month { display:grid; gap:.5rem; min-width:0; }
.cal-nav { display:flex; align-items:center; justify-content:space-between; gap:.4rem; text-align:center; }
.cal-nav strong { text-transform:capitalize; }
.cal-nav button { flex:0 0 var(--control-height); padding:0; }
.cal-grid { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:.25rem; text-align:center; }
.cal-grid>span { padding-block:.25rem; color:var(--muted); font-size:.8125rem; font-weight:650; }
.cal-grid button {
  position:relative; padding:.3rem .05rem .55rem; border-radius:.5rem; font-variant-numeric:tabular-nums;
}
.cal-grid button[aria-pressed=true] { background:var(--brand); border-color:var(--brand); color:white; }
.cal-mark { position:absolute; bottom:.35rem; width:.28rem; height:.28rem; border-radius:50%; background:currentColor; }
#calendar-agenda {
  min-width:0; padding:.9rem; border:1px solid var(--line); border-radius:.7rem; background:var(--soft);
}
#calendar-agenda h3 { margin-bottom:.6rem; }
#calendar-agenda ul { list-style:none; margin:0; padding:0; }
#calendar-agenda li { padding:.6rem 0 .2rem; border-top:1px solid var(--line); }
#calendar-agenda li+li { margin-top:.35rem; }
.agenda-title { display:flex; flex-wrap:wrap; align-items:baseline; gap:.35rem .6rem; }

dialog {
  --dialog-gap:2rem;
  --dialog-width:40rem;
  --dialog-limit:min(56rem,calc(100dvh - var(--dialog-gap)));
  --dialog-inset:clamp(.875rem,3vw,1.375rem);
  --dialog-edge:.8rem;
  width:min(var(--dialog-width),calc(100% - var(--dialog-gap))); max-width:none; max-height:var(--dialog-limit);
  padding:0; border:1px solid var(--line); border-radius:1rem; overflow:hidden;
  background:var(--paper); color:var(--ink); box-shadow:0 18px 70px #102e3040;
}
dialog::backdrop { background:#17362ca6; }
dialog.info-editor { --dialog-width:32rem; }
dialog.shipment-editor { --dialog-width:65rem; }
dialog.order-editor { --dialog-width:72rem; background:var(--bg); }
#form-body {
  display:grid; grid-template-rows:auto minmax(0,1fr) auto; min-width:0;
  max-height:calc(var(--dialog-limit) - 2px);
}
#form-body:has(>form) { grid-template-rows:auto minmax(0,1fr); }
#form-body>form { grid-template-rows:minmax(0,1fr) auto; gap:0; min-height:0; }
.dialogtop,.dialog-footer { padding:var(--dialog-edge) var(--dialog-inset); }
.dialogtop {
  display:flex; align-items:center; justify-content:space-between; gap:.75rem; min-width:0;
  background:var(--paper); border-bottom:1px solid var(--line);
}
.dialogtop>div { min-width:0; }
.dialogtop h2 { font-size:clamp(1.125rem,2.55vw,1.5rem); }
.dialogtop p { margin-top:.25rem; color:var(--muted); font-size:.875rem; overflow-wrap:anywhere; }
.dialog-close {
  flex:0 0 var(--control-height); width:var(--control-height); padding:0;
  border-color:transparent; background:var(--tint); color:var(--dark); font-size:1.45rem;
}
.dialog-content {
  display:grid; align-content:start; gap:.875rem; min-width:0; min-height:0;
  padding:1rem var(--dialog-inset); overflow:auto; overscroll-behavior:contain;
  scroll-padding:.9rem; overflow-wrap:anywhere;
}
.dialog-content>p+p { margin:0; }
.dialog-content details.panel { box-shadow:none; }
.dialog-content .panel-body { --panel-pad:.8rem; }
.dialog-lead { color:var(--ink); font-weight:750; }
.dialog-summary {
  display:grid; gap:.55rem; padding:.75rem .9rem;
  border:1px solid var(--line); border-radius:.7rem; background:var(--soft);
}
.dialog-summary p { margin:0; }
.dialog-footer {
  border-top:1px solid var(--line); padding-bottom:max(var(--dialog-edge),env(safe-area-inset-bottom));
  background:var(--paper); box-shadow:0 -3px 12px #173c3309;
}
.formactions { justify-content:flex-end; gap:.5rem; }
.dialog-footer .error:not(:empty) { margin-bottom:.55rem; max-height:min(5.5rem,23dvh); overflow:auto; }
.formactions button.danger { border-color:var(--alert); background:var(--alert); color:white; }
.formactions button.danger:hover { border-color:#6e281d; background:#6e281d; }
.shipment-items:empty { display:none; }
.shipment-selection {
  padding:.8rem; border:1px solid var(--line); border-radius:.75rem; background:var(--soft);
}
.shipment-selection .table-wrap { box-shadow:none; }

.order-scroll { display:block; padding:0; }
.order-layout {
  display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-items:start;
  gap:1rem; padding:1rem var(--dialog-inset);
}
.order-column { display:grid; gap:.875rem; min-width:0; }
.order-panel {
  container:order-fields / inline-size;
  min-width:0; padding:clamp(.875rem,2vw,1.125rem);
  border:1px solid var(--line); border-radius:var(--radius); background:var(--paper);
}
.order-panel-heading {
  display:flex; align-items:center; justify-content:space-between;
  gap:.5rem .75rem; flex-wrap:wrap; margin-bottom:.75rem;
}
.order-panel-heading button { font-size:.875rem; }
.order-parameters,.order-line-fields,.order-funding,.order-rule {
  display:grid; align-items:end; gap:.7rem; min-width:0;
  grid-template-columns:repeat(2,minmax(0,1fr));
}
.order-parameters>.field:first-child:has([name=cargoId]),.order-line-fields>.field:has(select) { grid-column:1/-1; }
.order-line-product { grid-column:1/-1; display:flex; align-items:flex-end; gap:.625rem; }
.order-line-product .field { flex:1; }
.order-line-product [data-selected-photo]:empty { display:none; }
.order-line-product .product-photo { --product-photo-size:var(--control-height); }
.order-funding,.order-rule { grid-template-columns:minmax(0,1fr) minmax(0,1.5fr); }
.factory-rule {
  grid-template-columns:minmax(9rem,1.15fr) minmax(0,1.8fr) minmax(4.1rem,.62fr);
  margin-top:.35rem;
}
.factory-rule:has(.date-field:not([hidden])) { grid-template-columns:repeat(2,minmax(0,1fr)); }
.order-editor .box { background:var(--soft); }
.order-line-footer {
  display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap;
  gap:.25rem .65rem; margin-top:.375rem; color:var(--muted); font-size:.8125rem;
}
.order-line-footer strong { margin-inline-start:.25rem; color:var(--ink); }
.order-line-footer>button:last-child { margin-inline-start:auto; }
.order-editor .order-text-action {
  border:0; padding-inline:.3rem; background:transparent;
  font-size:.8125rem; text-decoration:underline; text-underline-offset:3px;
}
.order-editor .order-add { border-color:#bed4c7; background:var(--tint); font-size:.875rem; }
.order-pay-actions {
  display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:.25rem .6rem; margin-top:.65rem;
}
.order-payment-rule { border:0; padding:.25rem 0 .75rem; border-radius:0; background:transparent; }
.order-payment-rule+.order-payment-rule { margin-top:.25rem; }
.order-payment-rule legend { padding:0; font-size:.9rem; }
.order-editor .arrival-note,.payment-preview {
  padding:.65rem .75rem; border-radius:.55rem; background:var(--tint); color:var(--dark); font-size:.85rem;
}
.payment-preview {
  display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.75rem;
}
.payment-preview strong { display:block; margin-top:.15rem; font-size:1.025rem; }
.order-editor .stack>p.muted { margin:0; font-size:.875rem; }
.order-editor [data-supplier-payment]>fieldset { background:var(--paper); }
.order-editor [data-supplier-payment]>fieldset:not([hidden])~fieldset:not([hidden]) { margin-top:.5rem; }
.order-footer-row { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:.625rem 1rem; }
.order-total { display:grid; gap:.1rem; min-width:0; color:var(--muted); font-size:.8125rem; overflow-wrap:anywhere; }
.order-total strong { color:var(--ink); font-size:1.25rem; font-variant-numeric:tabular-nums; line-height:1.25; }

.order-extras { display:grid; gap:1rem; min-width:0; }
.order-extras>.section { margin:0; }
.order-extras>.section h2 { font-size:1.0625rem; }
.order-extras>.section .sectionhead { margin-bottom:.55rem; }
.page-summary {
  display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.2fr); flex:0 0 100%;
  margin:.25rem 0 0;
}
.page-summary>div { padding:.9rem var(--panel-pad); min-width:0; }
.page-summary>div+div { border-inline-start:1px solid var(--line); }
.page-summary dt { margin-bottom:.25rem; color:var(--muted); font-size:.8125rem; font-weight:650; }
.page-summary dd { margin:0; }
.page-summary dd>strong { font-size:1.0625rem; }
.summary-payment { display:flex; align-items:baseline; flex-wrap:wrap; gap:.15rem .65rem; }
.summary-payment .back {
  color:var(--brand); font-size:1.25rem; font-weight:750; font-variant-numeric:tabular-nums;
  line-height:1.2; min-height:1.5rem; text-decoration-color:#91ad9e;
}
.summary-payment .back:hover { text-decoration-color:currentColor; }
.summary-payment .quiet { margin:0; }

.table-wrap {
  container:records / inline-size;
  max-width:100%; border:1px solid var(--line); border-radius:var(--radius);
  background:var(--paper); box-shadow:var(--shadow);
}
.order-table {
  --cell-inline:clamp(.65rem,1cqw,.85rem);
  width:100%; border-collapse:separate; border-spacing:0; text-align:left; font-size:.9rem;
}
.order-table :is(th,td) {
  padding:.65rem var(--cell-inline); border-bottom:1px solid var(--line); vertical-align:top; overflow-wrap:anywhere;
}
.order-table thead th {
  background:var(--tint); color:var(--dark); font-weight:700; font-size:.8125rem; line-height:1.35;
  vertical-align:bottom; overflow-wrap:normal;
}
.order-table thead th:first-child { border-start-start-radius:calc(var(--radius) - 1px); }
.order-table thead th:last-child { border-start-end-radius:calc(var(--radius) - 1px); }
.order-table tbody th { font-weight:650; }
.order-table th .quiet { font-weight:400; }
.order-table tbody tr:last-child>* { border-bottom:0; }
.order-table tbody tr:last-child>:first-child { border-end-start-radius:calc(var(--radius) - 1px); }
.order-table tbody tr:last-child>:last-child { border-end-end-radius:calc(var(--radius) - 1px); }
.order-table :is(.back,.filelink) { min-height:0; }
.order-table tbody th .back { text-decoration-color:#91ad9e; }
.order-table tbody th .back:hover { text-decoration-color:currentColor; }
.order-registry .order-table { --cell-inline:clamp(.5rem,1cqw - .15rem,.85rem); }
.order-registry .order-table thead th:first-child,.shipment-registry .order-table thead th:first-child { min-width:6.75rem; }
.order-registry .order-table thead th:nth-child(3) { min-width:7rem; }
.order-registry .pill { white-space:nowrap; }
.shipment-registry .order-table td:nth-child(4) { white-space:nowrap; }
.order-table .row-actions { width:1%; padding:.3rem .45rem; text-align:right; }
.row-menu-trigger {
  width:var(--control-height); padding:0; border-color:transparent; background:transparent; font-size:1.35rem;
}
:is(.row-actions,.page-menu):has(:popover-open) .row-menu-trigger { anchor-name:--row-menu-trigger; background:var(--tint); }
.page-menu { min-width:0; max-width:100%; }
.page-menu .row-menu-trigger {
  width:auto; padding-inline:.875rem; border-color:var(--line); background:var(--paper); font-size:.9375rem;
}
.page-menu .row-menu-trigger:hover { background:var(--tint); }
.page-menu .row-menu-trigger span { font-size:1.2rem; }
.row-menu {
  inset:0; margin:auto; width:max-content; height:max-content; max-width:min(21rem,calc(100vw - 1.5rem));
  max-height:calc(100dvh - 1rem); padding:.3rem; border:1px solid var(--line); border-radius:.65rem;
  background:var(--paper); color:var(--ink); box-shadow:0 6px 24px #1a3d3026; overflow:auto; overscroll-behavior:contain;
}
.row-menu :is(a,button) {
  display:flex; width:100%; min-height:var(--control-height); padding:.55rem .7rem;
  align-items:center; justify-content:flex-start; border:0; border-radius:.4rem;
  background:transparent; color:var(--dark); text-decoration:none; text-align:start;
  font-size:.9rem; font-weight:650;
}
.row-menu :is(a,button):hover { background:var(--tint); }
.row-menu :is(a,button):focus-visible { outline-offset:-3px; }
.row-menu button.danger { color:var(--alert); }
.row-menu button.danger:hover { background:#fff0ea; }
@supports (position-anchor: --row-menu-trigger) {
  .row-menu {
    inset:auto; top:anchor(bottom); right:anchor(right); margin:.25rem 0;
    position-anchor:--row-menu-trigger; position-try-fallbacks:flip-block,--row-menu-centered;
  }
  @position-try --row-menu-centered { inset:0; margin:auto; }
}
.cell-label { display:none; }
.cell-value { min-width:0; }
.product-item { display:flex; align-items:flex-start; gap:.75rem; min-width:0; }
.product-text { min-width:0; }
.product-photo {
  display:block; flex:0 0 var(--product-photo-size,3.75rem);
  width:var(--product-photo-size,3.75rem); height:var(--product-photo-size,3.75rem); overflow:hidden;
  border:1px solid var(--line); border-radius:.55rem; background:var(--paper);
}
.product-photo img { display:block; width:100%; height:100%; object-fit:contain; }
.product-photos {
  --product-photo-size:var(--control-height);
  display:flex; flex-wrap:wrap; align-items:center; gap:.35rem; margin-top:.35rem;
}
.product-photos .quiet { margin:0; }
.compact-table .order-table th:first-child { width:38%; }
.movement-grid .order-table thead th:first-child { width:42%; }
.movement-grid .order-table tbody :is(td,th) { vertical-align:middle; }
.payment-grid .order-table { font-variant-numeric:tabular-nums; }
.payment-grid .order-table thead th:first-child { width:25%; }
.payment-grid .order-table thead th.row-actions { width:3.5rem; }
.payment-grid .order-table .quiet { font-size:.8125rem; }
.inline-stage { display:flex; gap:.5rem; align-items:center; min-height:32px; cursor:pointer; }
.inline-stage-status.complete,.inline-stage-status.next { color:var(--brand); }
.inline-stage-status.next { font-weight:700; }
.inline-stage-status.warn { color:var(--alert); }
.inline-cell {
  align-items:flex-start; min-height:32px; padding:0; border:0; border-radius:.25rem;
  text-align:start; font-size:inherit; line-height:inherit;
  background:transparent; color:var(--brand); text-decoration:underline dotted; text-underline-offset:.2rem;
}
.inline-cell:hover { background:transparent; color:var(--dark); text-decoration-style:solid; }
.inline-input {
  min-height:36px; max-width:10rem; padding:.3rem .4rem; border-color:var(--brand);
  font-size:inherit; font-variant-numeric:tabular-nums;
}
.inline-input[data-inline-input=date],.inline-input[data-inline-input=actual],.inline-input[data-inline-input=plan] {
  min-width:min(100%,7rem);
}
.inline-edit-help { display:grid; gap:.35rem; margin-top:.55rem; }
.inline-edit-help .inline-input { max-width:100%; }
.inline-edit-help small { font-weight:400; }
.inline-edit-actions { gap:.35rem; }
.inline-edit-actions button { padding-inline:.55rem; font-size:.8125rem; }
.shipment-quantity { max-width:7rem; font-variant-numeric:tabular-nums; }
.inline-unit { display:none; }
.inline-editing .inline-unit { display:block; margin-top:.2rem; }
.inline-feedback:empty { display:none; }
.inline-feedback { margin-top:.35rem; color:var(--alert); font-size:.8125rem; font-weight:600; }
.order-table tbody :is(tr.inline-editing,tr.inline-saving)>* { background:#edf5ef; }
.payment-grid .order-table tbody tr.selected>* { background:#fffaf0; }
.payment-grid .order-table tbody tr.selected>th { box-shadow:inset 3px 0 #d39034; }
.payment-continuation { margin-inline-start:.65rem; color:var(--muted); font-weight:550; }

#live:not(:empty) {
  position:fixed; z-index:5; bottom:calc(1rem + env(safe-area-inset-bottom)); left:50%; transform:translateX(-50%);
  width:max-content; max-width:90vw; padding:.75rem 1rem; border-radius:.65rem;
  background:var(--dark); color:white; box-shadow:var(--shadow); overflow-wrap:anywhere;
}

@container order-fields (max-width:27rem) {
  .factory-rule,.factory-rule:has(.date-field:not([hidden])) { grid-template-columns:minmax(0,1fr); }
}
@container order-fields (max-width:19rem) {
  .order-funding,.order-rule:not(.factory-rule) { grid-template-columns:minmax(0,1fr); }
}

@container records (max-width:59rem) {
  .table-wrap:not(.compact-table) .order-table { --cell-inline:.65rem; display:block; }
  .table-wrap:not(.compact-table) thead {
    position:absolute; width:1px; height:1px; padding:0;
    clip-path:inset(50%); white-space:nowrap; overflow:hidden;
  }
  .table-wrap:not(.compact-table) tbody { display:block; }
  .table-wrap:not(.compact-table) tbody tr {
    position:relative; display:grid; grid-template-columns:repeat(2,minmax(0,1fr));
    padding-bottom:.25rem;
  }
  .table-wrap:not(.compact-table) tbody tr+tr { border-top:1px solid var(--line); }
  .table-wrap:not(.compact-table) tbody th {
    display:grid; align-content:center; grid-column:1/-1; width:auto; padding-block:.65rem;
    border-radius:0; background:var(--tint);
  }
  .table-wrap:not(.compact-table) tbody tr:first-child th { border-radius:calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0; }
  .table-wrap:not(.compact-table) tbody tr:has(td.row-actions:not(:empty)) th {
    min-height:3.35rem; padding-inline-end:3.5rem;
  }
  .table-wrap:not(.compact-table) td {
    display:grid; gap:.2rem; align-content:start; padding-block:.55rem; border-bottom:0; border-radius:0;
  }
  .table-wrap:not(.compact-table) td.row-actions {
    position:absolute; top:0; inset-inline-end:0; width:auto; padding:.3rem .45rem; background:transparent;
  }
  .table-wrap:not(.compact-table) td.row-actions:empty,.table-wrap:not(.compact-table) td:has(>.cell-value:empty) { display:none; }
  .table-wrap:not(.compact-table) .cell-label { display:block; color:var(--muted); font-size:.8125rem; font-weight:650; }
  .table-wrap:not(.compact-table) :is(.back,.filelink,.inline-cell,.inline-stage,.inline-input) { min-height:var(--control-height); }
  .table-wrap:not(.compact-table) .cell-value :is(.back,.filelink) { align-items:flex-start; }
  .table-wrap:not(.compact-table) .inline-input { font-size:1rem; }
  .movement-grid .order-table td:last-child { grid-column:1/-1; }
  .payment-grid .order-table th:has(.payment-continuation) { background:var(--soft); }
}
@container records (min-width:38rem) and (max-width:59rem) {
  .order-registry .order-table tbody tr { grid-template-columns:repeat(4,minmax(0,1fr)); }
  :is(.shipment-registry,.payment-grid) .order-table tbody tr { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@container records (width > 59rem) {
  .order-table tbody tr:focus-within:not(.inline-editing,.inline-saving,.selected)>* { background:var(--soft); }
  @media (hover:hover) {
    .order-table tbody tr:hover:not(.inline-editing,.inline-saving,.selected)>* { background:var(--soft); }
  }
}

@media (min-width:61rem) {
  html { scroll-padding-block-start:4.25rem; }
}
@media (max-width:61rem) {
  .bar { position:relative; }
  .barin { grid-template-columns:1fr auto; gap:.4rem 1rem; }
  .barin nav { order:3; grid-column:1/-1; display:grid; grid-template-columns:repeat(4,minmax(max-content,1fr)); }
  .barin nav a { padding-inline:.35rem; }
}
@media (max-width:58rem) {
  .dashboard-records { grid-template-columns:minmax(0,1fr); gap:var(--section-space); }
}
@media (max-width:54rem) {
  dialog.order-editor { --dialog-width:41rem; }
  .order-layout { grid-template-columns:minmax(0,1fr); }
}
@media (max-width:51rem) {
  .filters { grid-template-columns:minmax(12rem,1.75fr) repeat(2,minmax(9rem,1fr)); }
  .filter-actions { grid-column:1/-1; justify-content:flex-end; }
}
@media (max-width:46rem) {
  .dashboard-head,.calendar-layout { grid-template-columns:minmax(0,1fr); }
  .filters { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .filters>.field:has(input[type=search]) { grid-column:1/-1; }
}
@media (max-width:42rem) {
  html:has(.work) { scroll-padding-block-end:calc(var(--mobile-bar) + .5rem + env(safe-area-inset-bottom)); }
  .brand img { width:94px; }
  .who { gap:.5rem; font-size:.8125rem; }
  .account-link { padding-inline-start:.5rem; }
  .barin nav {
    position:fixed; z-index:3; inset:auto 0 0; display:flex; gap:.2rem;
    min-height:var(--mobile-bar); padding:.45rem .625rem calc(.45rem + env(safe-area-inset-bottom));
    background:var(--paper); border-top:1px solid var(--line); box-shadow:0 -4px 20px #173c3310;
  }
  .barin nav a { flex:1 1 auto; font-size:clamp(.75rem,3.35vw,.9rem); padding-inline:.125rem; white-space:normal; }
  .work { padding-bottom:calc(var(--mobile-bar) + 1.5rem + env(safe-area-inset-bottom)); }
  body:has(.work) #live:not(:empty) { bottom:calc(var(--mobile-bar) + .65rem + env(safe-area-inset-bottom)); }
}
@media (max-width:38rem) {
  .page-lead { flex-basis:100%; }
  .top>.actions { width:100%; }
  .top .actions button { flex:1 1 auto; }
  .page-summary { grid-template-columns:minmax(0,1fr); }
  .page-summary>div+div { border-inline-start:0; border-top:1px solid var(--line); }
  .summary-payment .back { min-height:var(--control-height); }
  .dashboard-head .actions>* { flex:1 1 auto; }
  .filter-actions>* { flex:1 1 auto; }
  .task-meta .back { min-height:var(--control-height); }
  .debt { grid-template-columns:minmax(0,1fr); }
  .debt-summary {
    display:flex; flex-wrap:wrap; align-items:center; gap:.2rem .65rem; padding-top:.3rem; text-align:start;
  }
  .debt-summary .back { margin-inline-start:auto; }
  dialog { --dialog-gap:1rem; --dialog-inset:.875rem; --dialog-edge:.65rem; }
  .formactions :is(button[type=submit],.button.primary) { flex:1 1 auto; }
  .order-footer-row { display:grid; grid-template-columns:minmax(0,1fr); }
}
@media (max-width:32.5rem) {
  .rule-fields { grid-template-columns:minmax(0,1fr); }
  dialog:is(.order-editor,.shipment-editor) {
    --dialog-gap:0px; --dialog-limit:100dvh;
    height:100dvh; margin:0; border:0; border-radius:0;
  }
  dialog:is(.order-editor,.shipment-editor) #form-body { height:100%; max-height:none; }
  .order-layout { gap:.75rem; padding:.75rem var(--dialog-inset); }
  .order-column { gap:.75rem; }
  .order-parameters>.field:has([name=number],[name=cargoId]) { grid-column:1/-1; }
}
@media (max-width:28rem) {
  .compact-table .order-table .back { min-height:var(--control-height); }
  .cal-grid { gap:.15rem; }
  .barin { gap:.3rem .65rem; }
}
@media (max-width:23.5rem) {
  .filters { grid-template-columns:minmax(0,1fr); }
  .hero-payment { grid-template-columns:minmax(0,1fr); gap:.8rem; }
  .hero-payment>div:last-child { text-align:start; }
  .who { gap:.35rem; }
  .account-link { padding-inline-start:.35rem; }
  .who button { padding-inline:.55rem; }
  .barin nav { gap:.15rem; }
}
@media (max-height:34rem) {
  dialog { --dialog-edge:.4rem; }
}

