/* DZ TOP Mission Control — calm, high-clarity dispatch workspace. */
:root {
  --canvas: #f3f6f8;
  --surface: #ffffff;
  --surface-muted: #f8fafb;
  --ink: #17212b;
  --ink-soft: #4d5b69;
  --muted: #586a79;
  --line: #dce4ea;
  --line-strong: #c8d3dc;
  --blue: #1267c4;
  --blue-dark: #0c539f;
  --blue-soft: #eaf3ff;
  --navy: #172a3a;
  --green: #08785c;
  --green-soft: #e6f5ef;
  --amber: #9a5b00;
  --amber-soft: #fff4dc;
  --red: #b4232f;
  --red-soft: #fff0f1;
  --violet: #6553a7;
  --violet-soft: #f0edfb;
  --shadow-sm: 0 1px 2px rgba(24, 39, 52, .05);
  --shadow-md: 0 12px 28px rgba(24, 39, 52, .08);
  --radius: 10px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--canvas);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}
a { color: var(--blue); }
a:hover { color: var(--blue-dark); }
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 9px 12px;
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 720;
  box-shadow: var(--shadow-md);
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(18, 103, 196, .26);
  outline-offset: 2px;
}

/* App chrome: the slim active rail is the persistent orientation cue. */
.app-shell { min-height: 100vh; }
.topnav {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  width: 232px;
  padding: 20px 12px 14px;
  background: var(--navy);
  color: #d9e4ec;
}
.topnav .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin: 0 8px 24px;
  color: #fff;
  font-size: 1.04rem;
  font-weight: 760;
  letter-spacing: -.02em;
  text-decoration: none;
}
.brand-name { display: grid; gap: 1px; line-height: 1.05; }
.brand-name strong { font-size: .94rem; letter-spacing: -.025em; }
.brand-name small { color: #9fb1bf; font-size: .58rem; font-weight: 700; letter-spacing: .045em; text-transform: uppercase; }
.brand-mark {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 7px;
  background: var(--blue);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
  color: white;
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: -.06em;
}
.topnav .nav-label {
  margin: 0 12px 7px;
  color: #8fa3b3;
  font-size: .68rem;
  font-weight: 750;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.topnav a:not(.brand) {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 7px;
  color: #c8d5df;
  font-size: .9rem;
  font-weight: 570;
  text-decoration: none;
  transition: background .14s ease, color .14s ease;
}
.topnav a:not(.brand):hover { background: rgba(255,255,255,.075); color: #fff; }
.topnav a.active { background: rgba(100, 173, 239, .16); color: #fff; font-weight: 700; }
.topnav a.active::before { position: absolute; left: -12px; width: 3px; height: 22px; border-radius: 0 3px 3px 0; background: #68b7ff; content: ""; }
.topnav .spacer { flex: 1; }
.mobile-logout { display: none; }
.topnav .user-block { margin: 16px 8px 0; padding: 13px 0 0; border-top: 1px solid rgba(215, 230, 240, .16); }
.topnav .me { display: block; overflow: hidden; color: #eff6fa; font-size: .8rem; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.topnav .role { display: block; margin-top: 2px; color: #91a5b4; font-size: .73rem; }
.topnav .version { display: block; margin-top: 8px; color: #91a5b4; font-size: .72rem; }
.topnav button.link { margin-top: 8px; color: #bdcfdb; }
.topnav button.link:hover { color: #fff; }

main { max-width: 1200px; margin-inline: auto; padding: 34px clamp(24px, 4vw, 64px) 60px; }
.app-shell > main { margin-right: 0; margin-left: 232px; }
@media (min-width: 1432px) {
  .app-shell > main { margin-left: calc(232px + (100vw - 1432px) / 2); }
}
h1, h2 { color: var(--ink); text-wrap: balance; }
h1 { margin: 0; font-size: 1.9rem; font-weight: 730; letter-spacing: -.037em; line-height: 1.16; }
h2 { margin: 0; font-size: 1rem; font-weight: 730; letter-spacing: -.015em; }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 0 0 22px; }
.page-heading { display: flex; align-items: baseline; gap: 11px; }
.page-header .muted { font-size: .84rem; }
.page-context { margin: 0 0 5px; color: var(--muted); font-size: .76rem; font-weight: 700; }
.count-badge { display: inline-flex; align-items: center; min-height: 24px; padding: 2px 8px; border-radius: 999px; background: var(--surface-muted); color: var(--ink-soft); font-size: .76rem; font-weight: 700; white-space: nowrap; }
.admin-page-header { align-items: flex-start; margin-bottom: 26px; }
.admin-page-header .section-intro { margin: 7px 0 0; }
.page-eyebrow, .eyebrow { margin: 0 0 5px; color: var(--blue); font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.muted { color: var(--muted); }
.error { color: var(--red); }
.mono { font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: .88em; }

/* Data first: quiet containers and generous row rhythm instead of tile clutter. */
.table-wrap, .card, .tile, .role-guide > div { border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-sm); }
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
.sku-column { width: 12%; }
.sku-title-column { width: 22%; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-size: .69rem; font-weight: 800; letter-spacing: .075em; text-transform: uppercase; white-space: nowrap; }
tbody tr { transition: background .14s ease; }
tbody tr:hover { background: #f7fafc; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.empty { padding: 42px 16px; color: var(--muted); text-align: center; }
.orders-header { align-items: flex-start; }
.orders-page-hint { max-width: 50ch; margin: 3px 0 0; color: var(--muted); font-size: .84rem; text-align: right; }
.queue-tabs { display: flex; gap: 4px; margin: 0 0 12px; padding-bottom: 2px; overflow-x: auto; scrollbar-width: thin; }
.queue-tabs a { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 7px; min-height: 38px; padding: 7px 10px; border-radius: 7px; color: var(--ink-soft); font-size: .82rem; font-weight: 680; text-decoration: none; }
.queue-tabs a:hover { background: #eaf0f4; color: var(--ink); }
.queue-tabs a.active { background: var(--navy); color: #fff; }
.queue-tabs strong { min-width: 20px; padding: 1px 6px; border-radius: 999px; background: rgba(23, 42, 58, .08); color: inherit; font-size: .72rem; text-align: center; }
.queue-tabs a.active strong { background: rgba(255, 255, 255, .16); }
.orders-filters { display: grid; grid-template-columns: minmax(250px, 1.4fr) minmax(160px, .7fr) minmax(160px, .7fr) auto; align-items: end; gap: 10px; margin: 0 0 14px; padding: 13px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-muted); }
.orders-filters label { display: grid; gap: 5px; color: var(--ink-soft); font-size: .76rem; font-weight: 720; }
.orders-filter-actions { display: flex; align-items: end; gap: 7px; }
.orders-filter-actions .btn-outline { min-height: 40px; }
.orders-table th:nth-child(1) { width: 20%; }
.orders-table th:nth-child(2) { width: 29%; }
.orders-table th:nth-child(3) { width: 20%; }
.orders-table th:nth-child(4) { width: 18%; }
.orders-table th:nth-child(5) { width: 13%; }
.orders-table td { padding-top: 15px; padding-bottom: 15px; }
.orders-table .order-id { display: inline-flex; align-items: center; min-height: 28px; color: var(--ink); font-size: .94rem; font-weight: 760; text-decoration: none; }
.orders-table .order-id:hover { color: var(--blue); }
.orders-table .order-identity { min-width: 185px; }
.orders-table .order-account, .orders-table .buyer-name, .orders-table .order-total, .orders-table .queue-state-detail, .orders-table .order-market-facts, .orders-table .dispatch-detail, .orders-table .order-created time { display: block; }
.orders-table .order-account { margin-top: 3px; color: var(--ink-soft); font-size: .79rem; }
.orders-table .buyer-name { margin-top: 1px; font-size: .87rem; font-weight: 650; }
.orders-table .order-items { max-width: 19rem; color: var(--ink-soft); font-size: .86rem; overflow-wrap: anywhere; }
.orders-table .order-total { margin-top: 5px; color: var(--ink); font-size: .81rem; font-weight: 720; font-variant-numeric: tabular-nums; }
.orders-table .order-work-state { min-width: 215px; }
.orders-table .queue-state-detail { margin-top: 4px; color: var(--ink-soft); font-size: .81rem; }
.order-comment-flag { display: inline-flex; align-items: center; gap: 5px; min-height: 23px; margin-top: 7px; padding: 2px 7px; border: 1px solid #ead3a8; border-radius: 999px; background: var(--amber-soft); color: #704a0a; font-size: .72rem; font-weight: 740; line-height: 1.2; white-space: nowrap; }
.order-comment-flag svg { width: 14px; height: 14px; flex: 0 0 14px; fill: none; stroke: currentColor; stroke-linejoin: round; stroke-width: 1.6; }
.orders-table .order-market-facts { margin-top: 5px; color: var(--muted); font-size: .76rem; }
.orders-table .order-dispatch { min-width: 150px; color: var(--ink-soft); font-size: .83rem; overflow-wrap: anywhere; }
.orders-table .dispatch-detail { margin-top: 4px; color: var(--muted); font-size: .76rem; }
.orders-table .order-created { min-width: 118px; font-variant-numeric: tabular-nums; }
.orders-table .order-created strong { display: block; color: var(--ink); font-size: .82rem; }
.orders-table .order-created time { margin-top: 3px; color: var(--muted); font-size: .76rem; white-space: nowrap; }
.queue-state { display: inline-flex; align-items: center; gap: 7px; color: var(--ink); font-size: .82rem; line-height: 1.3; }
.queue-state i { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: var(--muted); }
.queue-state--action i { background: var(--blue); }
.queue-state--waiting i { background: var(--violet); }
.queue-state--warning i { background: var(--amber); }
.queue-state--danger i { background: var(--red); }
.queue-state--success i { background: var(--green); }
.queue-state--neutral i { background: #8a99a5; }
.order-row--danger { background: #fffafb; }
.order-row--warning { background: #fffdf8; }
.orders-empty { display: grid; justify-items: center; gap: 7px; }
.orders-empty strong { color: var(--ink); font-size: .95rem; }
.orders-empty span { max-width: 54ch; }
.orders-empty .btn-outline { margin-top: 5px; }
.badge.ebay-fulfillment { background: var(--violet-soft); color: var(--violet); }
.badge.ebay-payment { background: var(--green-soft); color: var(--green); }
.case-flag { display: inline-flex; align-items: center; min-height: 21px; padding: 2px 7px; border-radius: 999px; background: var(--amber-soft); color: var(--amber); font-size: .69rem; font-weight: 740; white-space: nowrap; }
.case-flag--urgent { background: var(--red-soft); color: var(--red); }

/* Status carries meaning without taking over the screen. */
.badge { display: inline-flex; align-items: center; min-height: 22px; padding: 2px 8px; border-radius: 999px; font-size: .72rem; font-weight: 720; line-height: 1.2; white-space: nowrap; }
.badge.new { background: var(--blue-soft); color: var(--blue-dark); }
.badge.assembled { background: var(--amber-soft); color: var(--amber); }
.badge.shipped, .badge.ok { background: var(--green-soft); color: var(--green); }
.badge.cancelled { background: #edf1f4; color: #596774; }
.badge.incomplete { background: var(--red-soft); color: var(--red); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.dot.new { background: var(--blue); }.dot.shipped { background: var(--green); }.dot.delivered { background: #8b72d6; }.dot.cancelled { background: var(--red); }

/* Clear action hierarchy. */
input, select, button, textarea { min-height: 40px; border-radius: 7px; font: inherit; }
input, select, textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--line-strong); background: #fff; color: var(--ink); box-shadow: inset 0 1px 1px rgba(16, 32, 44, .02); }
input::placeholder, textarea::placeholder { color: #657684; }
input:hover, select:hover, textarea:hover { border-color: #aebdca; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); outline: 0; box-shadow: 0 0 0 3px rgba(18,103,196,.14); }
button { padding: 8px 13px; border: 1px solid transparent; background: var(--blue); color: #fff; cursor: pointer; font-weight: 720; line-height: 1.2; transition: background .14s ease, box-shadow .14s ease, transform .1s ease; }
button:hover { background: var(--blue-dark); box-shadow: 0 3px 8px rgba(12,83,159,.18); }
button:active { transform: translateY(1px); }
button:disabled, input:disabled, select:disabled { cursor: not-allowed; opacity: .55; }
.button-link { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 8px 13px; border: 1px solid transparent; border-radius: 7px; background: var(--blue); color: #fff; font-size: .88rem; font-weight: 720; line-height: 1.2; text-decoration: none; }
.button-link:hover { background: var(--blue-dark); color: #fff; box-shadow: 0 3px 8px rgba(12,83,159,.18); }
.copy-button { min-height: 34px; padding: 5px 9px; border-color: var(--line-strong); background: #fff; color: var(--ink-soft); font-size: .76rem; font-weight: 680; box-shadow: none; }
.copy-button:hover { border-color: #9eb5c9; background: var(--blue-soft); color: var(--blue-dark); box-shadow: none; }
.copy-button.copied { border-color: #9acbbb; background: var(--green-soft); color: var(--green); }
button.secondary { border-color: var(--line-strong); background: #fff; color: var(--ink); box-shadow: none; }
button.secondary:hover { border-color: #9eb5c9; background: var(--blue-soft); color: var(--blue-dark); }
button.link { min-height: auto; padding: 2px 0; border: 0; background: transparent; color: var(--blue); font-size: .8rem; font-weight: 700; box-shadow: none; }
button.link:hover { background: transparent; color: var(--blue-dark); box-shadow: none; }
.button-danger { background: var(--red); }.button-danger:hover { background: #941923; }
.card-spaced { margin-top: 1rem; }
.retry-form { display: block; margin-top: .8rem; }
.chart-maximum { margin-left: auto; font-size: .8rem; }
.swatch-created { background: var(--s1); }
.swatch-shipped { background: var(--s2); }
.btn-outline { display: inline-flex; align-items: center; min-height: 34px; padding: 6px 9px; border: 1px solid var(--line-strong); border-radius: 6px; color: var(--ink); font-size: .8rem; font-weight: 680; text-decoration: none; }
.btn-outline:hover { border-color: #9eb5c9; background: var(--blue-soft); color: var(--blue-dark); }
.tracking-link { color: var(--blue); font-weight: 730; text-decoration: none; white-space: nowrap; }.tracking-link:hover { text-decoration: underline; }
form.inline { display: inline; }
form.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 15px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-muted); }
form.filters input { flex: 1 1 280px; }.filters select { width: auto; min-width: 150px; }.filters label { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-soft); font-size: .86rem; }.filters label input { width: auto; min-height: auto; }
.form-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 13px; }.field { display: flex; min-width: 0; flex: 1 1 170px; flex-direction: column; gap: 5px; }.field > span, .field > label { color: var(--ink-soft); font-size: .77rem; font-weight: 720; }.field input, .field select { width: 100%; }
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: end; gap: 14px; }.form-grid .field.wide { grid-column: span 2; }.form-grid .actions { display: flex; align-items: end; gap: 8px; }.checkbox-field { display: inline-flex; align-items: center; min-height: 40px; gap: 8px; color: var(--ink-soft); font-size: .87rem; white-space: nowrap; }.checkbox-field input { width: 16px; min-height: 16px; height: 16px; accent-color: var(--blue); }

.card { padding: 20px; border-radius: var(--radius); }.stack { display: grid; gap: 12px; }.section-title { margin-top: 32px; }.section-intro { max-width: 72ch; margin: 5px 0 15px; color: var(--muted); font-size: .88rem; }.action-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }.action-row h2 { margin-right: auto; }.field-hint { margin: 5px 0 0; color: var(--muted); font-size: .8rem; }.inline-link { color: var(--blue); font-size: .82rem; font-weight: 720; }

/* Shared page language: every screen begins with context, purpose and one clear action. */
.header-note { margin: 4px 0 0; color: var(--muted); font-size: .82rem; }
.filter-field { display: grid !important; min-width: 150px; flex: 1 1 190px; gap: 5px !important; }
.filter-field > span { color: var(--ink-soft); font-size: .74rem; font-weight: 720; }
.filter-actions { display: flex; align-items: end; gap: 7px; }
.filter-actions .btn-outline { justify-content: center; min-height: 40px; }
.panel-empty { display: grid; justify-items: center; gap: 4px; color: var(--muted); font-size: .84rem; text-align: center; }
.panel-empty strong { color: var(--ink); font-size: .92rem; }
.panel-empty span { max-width: 52ch; }

/* Dashboard is a queue overview, not an ornamental metrics wall. */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 18px; }.tile { min-height: 104px; padding: 15px 16px; border-radius: var(--radius); }.tile.total { border-top: 3px solid var(--blue); background: #fff; }.tile .num { color: var(--ink); font-size: 1.65rem; font-weight: 760; font-variant-numeric: tabular-nums; letter-spacing: -.035em; }.tile .label { display: flex; align-items: center; gap: 6px; margin-top: 4px; color: var(--muted); font-size: .78rem; }.grid-2-1 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); align-items: start; gap: 16px; }
.chart-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 14px; margin-bottom: 14px; }.legend { display: flex; gap: 14px; color: var(--muted); font-size: .78rem; }.legend-item { display: inline-flex; align-items: center; gap: 5px; }.swatch { width: 9px; height: 9px; border-radius: 2px; }.plot { position: relative; display: flex; align-items: flex-end; height: 168px; gap: 6px; padding: 0 3px; border-bottom: 1px solid var(--line-strong); }.plot .col { display: flex; flex: 1; align-items: flex-end; justify-content: center; height: 100%; gap: 2px; border-radius: 4px 4px 0 0; cursor: pointer; outline: none; }.plot .col:hover, .plot .col:focus-visible, .plot .col.is-selected { background: var(--surface-muted); }.plot .col:focus-visible { box-shadow: inset 0 0 0 2px var(--blue); }.plot .bar { width: 9px; max-width: 40%; border-radius: 3px 3px 0 0; }.plot .bar.b1 { background: var(--blue); }.plot .bar.b2 { background: var(--green); }.xaxis { display: flex; gap: 6px; padding: 5px 3px 0; }.xaxis span { flex: 1; overflow: visible; color: var(--muted); font-size: .65rem; text-align: center; white-space: nowrap; }.chart-values { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; padding: 5px 3px 0; }.chart-value-cell { display: flex; justify-content: center; gap: 5px; min-width: 0; }.chart-value { font-size: .63rem; font-variant-numeric: tabular-nums; font-weight: 720; }.chart-value--created { color: var(--blue); }.chart-value--shipped { color: var(--green); }.chart-value--delivered { color: #8b72d6; }.chart-tooltip { position: absolute; z-index: 2; top: 8px; left: clamp(94px, var(--chart-tooltip-left), calc(100% - 94px)); display: grid; gap: 5px; width: min(186px, calc(100% - 20px)); padding: 10px 11px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface); color: var(--ink); font-size: .75rem; line-height: 1.3; text-align: left; transform: translateX(-50%); box-shadow: 0 4px 8px rgba(20, 33, 43, .16); pointer-events: none; }.chart-tooltip-title { display: block; margin-bottom: 2px; color: var(--ink); font-size: .78rem; }.chart-tooltip-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; color: var(--muted); }.chart-tooltip-row strong { color: var(--ink); font-variant-numeric: tabular-nums; }.chart-tooltip-row--created { color: var(--blue); }.chart-tooltip-row--shipped { color: var(--green); }.chart-tooltip-row--delivered { color: #8b72d6; }.chart-data { margin-top: 12px; }.chart-data summary { color: var(--muted); cursor: pointer; font-size: .82rem; }.chart-data table { margin-top: 8px; }
.chart-scroll--30 .chart-values, .chart-scroll--90 .chart-values { display: none; }
.chart-tooltip[hidden] { display: none; }
.metric-strip { display: grid; grid-template-columns: minmax(150px, 1.25fr) repeat(5, minmax(100px, 1fr)); margin: 0 0 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.metric-strip > div { min-width: 0; padding: 14px 14px 15px 0; }
.metric-strip > div + div { padding-left: 14px; border-left: 1px solid var(--line); }
.metric-strip strong { display: block; margin-top: 3px; color: var(--ink); font-size: 1.42rem; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.metric-primary strong { color: var(--blue-dark); }
.metric-label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .73rem; font-weight: 680; white-space: nowrap; }
.report-panel { min-width: 0; }
.report-panel > .section-heading { margin-bottom: 10px; }
.compact-table th, .compact-table td { padding-right: 0; padding-left: 0; }

/* Order details put the decision first and keep technical evidence secondary. */
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.kv { margin: 0; }
.kv dt { margin-top: 15px; color: var(--muted); font-size: .76rem; font-weight: 720; }
.kv dt:first-child { margin-top: 0; }
.kv dd { margin: 3px 0 0; color: var(--ink); overflow-wrap: anywhere; }
.back-link { margin: 0 0 12px; font-size: .84rem; font-weight: 680; }
.back-link a { text-decoration: none; }
.back-link a:hover { text-decoration: underline; }
.order-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 15px; }
.order-context { margin: 0 0 5px; color: var(--muted); font-size: .82rem; }
.order-title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.order-title-row h1 { overflow-wrap: anywhere; }
.order-header > .queue-state { margin-top: 5px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.order-action-panel { display: flex; align-items: center; justify-content: space-between; gap: 22px; margin-bottom: 14px; padding: 17px 18px; border: 1px solid #bdd5ed; border-radius: 9px; background: var(--blue-soft); }
.order-action-panel--danger { border-color: #efc8cd; background: var(--red-soft); }
.order-action-panel--warning { border-color: #ead3a8; background: var(--amber-soft); }
.order-action-panel--success { border-color: #b8dece; background: var(--green-soft); }
.order-action-panel--neutral { border-color: var(--line); background: var(--surface-muted); }
.order-action-context { margin: 0 0 3px; color: var(--muted); font-size: .76rem; font-weight: 720; }
.order-action-panel h2 { font-size: 1.06rem; }
.order-action-panel p:not(.order-action-context, .form-error) { max-width: 68ch; margin: 4px 0 0; color: var(--ink-soft); font-size: .88rem; }
.order-action-buttons { display: flex; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.order-action-buttons form { margin: 0; }
.form-error { max-width: 64ch; margin: 9px 0 0; color: var(--red); font-size: .84rem; font-weight: 680; }
.order-summary-facts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 0 0 24px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.order-summary-facts > div { min-width: 0; padding: 11px 14px 12px 0; }
.order-summary-facts > div + div { padding-left: 14px; border-left: 1px solid var(--line); }
.order-summary-facts dt { color: var(--muted); font-size: .72rem; font-weight: 700; }
.order-summary-facts dd { margin: 3px 0 0; color: var(--ink); font-size: .84rem; font-weight: 680; overflow-wrap: anywhere; }
.order-detail-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(300px, .7fr); gap: 26px; }
.order-section { min-width: 0; padding-top: 17px; border-top: 1px solid var(--line-strong); }
.order-section h2 { margin-bottom: 15px; }
.order-tax-details { grid-column: 1 / -1; }
.tax-detail-list { display: grid; gap: 10px; }
.tax-detail { min-width: 0; padding: 11px 13px; border-left: 3px solid var(--blue); background: var(--surface-muted); }
.tax-customs-line { margin: 0; color: var(--ink); font-size: .94rem; overflow-wrap: anywhere; }
.tax-customs-line strong { margin-left: 5px; font-weight: 760; }
.tax-detail-meta { margin: 4px 0 0; color: var(--muted); font-size: .79rem; }
.order-shipment-summary { align-self: start; }
.secondary-line { display: block; margin-top: 2px; color: var(--muted); font-size: .82rem; }
.address-value { line-height: 1.55; }
.buyer-note { margin-top: 18px; padding: 13px 14px 14px; border: 1px solid #ead3a8; border-radius: 8px; background: var(--amber-soft); color: var(--ink); }
.buyer-note-heading { display: flex; align-items: center; gap: 10px; }
.buyer-note-marker { display: grid; width: 25px; height: 25px; flex: 0 0 25px; place-items: center; border-radius: 50%; background: var(--amber); color: #fff; font-size: .82rem; font-weight: 800; }
.buyer-note-heading h3 { margin: 0; font-size: .9rem; line-height: 1.3; }
.buyer-note-heading p { margin: 1px 0 0; color: var(--amber); font-size: .76rem; font-weight: 680; }
.buyer-note-text { margin: 11px 0 0; padding-top: 10px; border-top: 1px solid #ead3a8; font-size: .9rem; font-weight: 590; line-height: 1.55; overflow-wrap: anywhere; white-space: pre-wrap; }
.value-with-action { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.document-links { display: flex; flex-wrap: wrap; gap: 7px; }
.technical-error { margin-top: 16px; padding-top: 13px; border-top: 1px solid var(--line); }
.technical-error summary { color: var(--red); cursor: pointer; font-size: .78rem; font-weight: 680; }
.technical-error p { margin: 8px 0 0; color: var(--ink-soft); font-size: .76rem; overflow-wrap: anywhere; }
.order-items-section { margin-top: 30px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.status-text { display: inline-flex; align-items: center; min-height: 24px; font-size: .8rem; font-weight: 700; text-decoration: none; }
.status-text--success { color: var(--green); }
.status-text--danger { color: var(--red); }
.order-disclosures { display: grid; gap: 9px; margin-top: 30px; border-top: 1px solid var(--line); }
.order-disclosure { border-bottom: 1px solid var(--line); scroll-margin-top: 16px; }
.order-disclosure > summary { display: flex; align-items: center; justify-content: space-between; min-height: 52px; cursor: pointer; font-size: .9rem; font-weight: 720; list-style: none; }
.order-disclosure > summary::-webkit-details-marker { display: none; }
.order-disclosure > summary::before { margin-right: 9px; color: var(--blue); content: "+"; font-size: 1.1rem; font-weight: 400; }
.order-disclosure[open] > summary::before { content: "–"; }
.order-disclosure > summary span:first-child { margin-right: auto; }
.order-disclosure > summary .muted { font-size: .78rem; font-weight: 600; }
.order-disclosure-content { padding: 2px 0 18px; }
.order-disclosure-content h3 { margin: 19px 0 8px; font-size: .86rem; }
.order-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0; }
.order-facts div { min-width: 0; }
.order-facts dt { color: var(--muted); font-size: .74rem; font-weight: 700; }
.order-facts dd { margin: 4px 0 0; font-size: .88rem; font-weight: 650; }
.settings-intro { margin-top: 0; }.settings-content { min-width: 0; }.settings-section { scroll-margin-top: 72px; margin-top: 36px; padding-top: 30px; border-top: 1px solid var(--line); }.settings-section:first-child { margin-top: 0; padding-top: 0; border-top: 0; }.password-settings { margin-bottom: 32px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }.settings-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 14px; }.settings-heading h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }.settings-heading p { max-width: 76ch; margin: 4px 0 0; color: var(--muted); font-size: .86rem; }.settings-heading > button { flex: 0 0 auto; }.settings-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }.settings-facts > div { min-width: 0; padding: 12px 16px 13px 0; }.settings-facts > div + div { padding-left: 16px; border-left: 1px solid var(--line); }.settings-facts dt, .connection-facts dt { margin: 0 0 4px; color: var(--muted); font-size: .68rem; font-weight: 800; letter-spacing: .075em; text-transform: uppercase; }.settings-facts dd, .connection-facts dd { margin: 0; color: var(--ink); font-size: .84rem; }.settings-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 13px; }.settings-actions form { margin: 0; }.schedule-result { margin: 0; color: var(--muted); font-size: .82rem; }.schedule-result.ok { color: var(--green); }.schedule-result.warning { color: var(--amber); }.connection-list { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }.connection-row { padding: 16px 0; }.connection-row + .connection-row { border-top: 1px solid var(--line); }.connection-row-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }.connection-name { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }.connection-name strong { overflow-wrap: anywhere; font-size: .96rem; }.connection-facts { display: grid; grid-template-columns: 1fr minmax(180px, 1.7fr) 1fr; gap: 16px; margin: 14px 0 0; }.connection-facts > div { min-width: 0; }.connection-facts dd { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }.connection-note { color: var(--muted); font-size: .8rem; line-height: 1.35; overflow-wrap: anywhere; }.connection-empty { display: grid; gap: 4px; padding: 26px 0; color: var(--muted); font-size: .86rem; }.connection-empty strong { color: var(--ink); font-size: .92rem; }
.settings-inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 14px; }.settings-inline-form .checkbox-field { margin-right: auto; color: var(--ink); }
.settings-nav { position: sticky; top: 0; z-index: 10; display: flex; gap: 4px; margin: -9px 0 27px; padding: 7px; overflow-x: auto; border: 1px solid var(--line); border-radius: 9px; background: rgba(248, 250, 251, .94); box-shadow: var(--shadow-sm); backdrop-filter: blur(8px); }
.settings-nav a { display: inline-flex; flex: 0 0 auto; align-items: center; min-height: 34px; padding: 6px 10px; border-radius: 6px; color: var(--ink-soft); font-size: .8rem; font-weight: 700; text-decoration: none; }
.settings-nav a:hover, .settings-nav a:focus-visible { background: var(--blue-soft); color: var(--blue-dark); }
.role-reference { margin: 0 0 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }.role-reference summary { display: flex; min-height: 43px; align-items: center; color: var(--ink-soft); cursor: pointer; font-size: .84rem; font-weight: 720; list-style: none; }.role-reference summary::-webkit-details-marker { display: none; }.role-reference summary::before { width: 16px; margin-right: 7px; color: var(--blue); content: "+"; font-size: 1rem; font-weight: 400; }.role-reference[open] summary::before { content: "–"; }.role-reference table { border-top: 1px solid var(--line); }.role-reference th, .role-reference td { padding: 10px 12px; }.role-reference td { color: var(--ink-soft); font-size: .84rem; }.role-reference td:first-child { width: 180px; color: var(--ink); }
.weekday-picker { grid-column: 1 / -1; margin: 0; padding: 11px 12px; border: 1px solid var(--line); border-radius: 7px; }.weekday-picker legend { padding: 0 4px; color: var(--muted); font-size: .77rem; }.weekday-picker > div { display: flex; flex-wrap: wrap; gap: 6px 14px; }.weekday-picker .checkbox-field { margin: 0; }.schedule-timezone { grid-column: 1 / -1; margin: -4px 0 0; }

/* Dialogs keep complex actions focused and visually separate from the queue. */
.modal { width: min(700px, calc(100vw - 28px)); max-height: min(780px, calc(100vh - 28px)); margin: auto; padding: 0; overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); box-shadow: var(--shadow-md); }.modal::backdrop { background: rgba(17, 32, 44, .48); backdrop-filter: blur(2px); }.modal-content { padding: 22px; }.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 19px; }.modal-head h2 { font-size: 1.12rem; }.modal-close { display: grid; width: 34px; min-width: 34px; min-height: 34px; padding: 0; place-items: center; background: transparent; color: var(--muted); font-size: 1.4rem; font-weight: 400; }.modal-close:hover { background: #eef3f7; color: var(--ink); box-shadow: none; }.modal .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }.modal .actions { grid-column: 1 / -1; justify-content: flex-end; }.modal-divider { margin: 20px 0; border: 0; border-top: 1px solid var(--line); }.modal--form { width: min(560px, calc(100vw - 28px)); }.modal--account { width: min(800px, calc(100vw - 28px)); }.modal--user { width: min(680px, calc(100vw - 28px)); }.modal-context { margin: 0 0 4px; color: var(--muted); font-size: .72rem; font-weight: 760; }.modal-description { max-width: 56ch; margin: 6px 0 0; color: var(--muted); font-size: .85rem; line-height: 1.45; }.modal-form { display: grid; gap: 16px; }.modal-form-section { padding: 16px; border-radius: 8px; background: var(--surface-muted); }.modal-form-section .field { gap: 6px; }.modal-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }.modal-next-step { display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--ink-soft); font-size: .82rem; }.modal-next-step strong { color: var(--ink); font-size: .78rem; }.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }.modal-actions button { min-width: 116px; }.user-form { display: grid; gap: 14px; }.user-section { padding: 16px; border-radius: 9px; background: var(--surface-muted); }.user-section h3 { margin: 0 0 13px; font-size: .9rem; }.user-section > p { margin: 0 0 13px; color: var(--muted); font-size: .83rem; }.user-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }.user-form-grid .field:first-child { grid-column: span 2; }.user-web-access { display: grid; gap: 9px; padding: 15px 16px; border: 1px solid var(--line); border-radius: 9px; }.user-web-access .checkbox-field { color: var(--ink); font-weight: 720; }.user-web-access p { margin: 0; color: var(--muted); font-size: .83rem; line-height: 1.45; }.account-health { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }.account-health > div { min-width: 0; padding: 11px 14px 12px 0; }.account-health > div + div { padding-left: 14px; border-left: 1px solid var(--line); }.account-health dt { margin: 0 0 5px; color: var(--muted); font-size: .67rem; font-weight: 800; letter-spacing: .075em; text-transform: uppercase; }.account-health dd { margin: 0; }.account-message { margin: 11px 0 0; color: var(--muted); font-size: .81rem; }.account-message.warning { color: var(--amber); }.account-modal-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(220px, .8fr); gap: 14px; margin-top: 16px; }.account-panel { display: grid; align-content: start; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 9px; }.account-panel h3 { margin: 0; font-size: .9rem; }.account-panel > p { margin: -4px 0 0; color: var(--muted); font-size: .83rem; line-height: 1.45; }.account-panel-actions { display: flex; justify-content: flex-start; }.account-connect { background: var(--surface-muted); }.account-connect form { margin-top: auto; }.sandbox-tools { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }.sandbox-tools summary { color: var(--ink-soft); cursor: pointer; font-size: .84rem; font-weight: 720; }.sandbox-tools > .field-hint { margin-bottom: 14px; }.sandbox-tools .form-grid { margin-top: 14px; }
.row-disclosure > summary, .add-panel > summary { display: inline-flex; align-items: center; min-height: 36px; padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: 7px; color: var(--blue); cursor: pointer; font-size: .84rem; font-weight: 700; list-style: none; }.row-disclosure > summary::-webkit-details-marker, .add-panel > summary::-webkit-details-marker { display: none; }.row-disclosure > summary::before, .add-panel > summary::before { margin-right: 7px; content: "+"; font-size: 1rem; font-weight: 400; }.row-disclosure[open] > summary::before, .add-panel[open] > summary::before { content: "–"; }.row-disclosure[open] > summary, .add-panel[open] > summary { border-color: #a9c9e8; background: var(--blue-soft); }.row-disclosure form { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }.add-panel { margin-top: 12px; }.add-panel > form { margin-top: 12px; }.form-grid--compact { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 900px; }

.pager { display: flex; align-items: center; gap: 11px; margin-top: 15px; }.pager a { padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; color: var(--ink); font-size: .84rem; font-weight: 650; text-decoration: none; }.pager a:hover { border-color: #9eb5c9; background: var(--blue-soft); color: var(--blue-dark); }
.modal-close { width: 44px; min-width: 44px; min-height: 44px; }
.public-body { background: linear-gradient(180deg, #edf3f7 0, var(--canvas) 240px); }
.public-page, .login-box { border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow-md); }.public-page { max-width: 760px; margin: 4rem auto; padding: 32px; border-radius: 12px; }.public-page--compact { max-width: 620px; }.public-page h1 { margin: 3px 0 14px; }.public-page h2 { margin: 28px 0 8px; }.public-page p { max-width: 68ch; }
.public-page-header { margin-bottom: 29px; padding-bottom: 23px; border-bottom: 1px solid var(--line); }
.auth-brand { display: flex; align-items: center; gap: 9px; margin-bottom: 26px; color: var(--ink); font-size: .94rem; font-weight: 760; letter-spacing: -.02em; }
.public-lead, .auth-intro { color: var(--ink-soft); font-size: .94rem; line-height: 1.55; }
.public-page-footer { margin-top: 31px; padding-top: 15px; border-top: 1px solid var(--line); color: var(--muted); font-size: .78rem; }
.public-state { padding-top: 27px; }
.state-marker { display: grid; width: 38px; height: 38px; margin: 4px 0 20px; place-items: center; border-radius: 50%; font-size: 1.15rem; font-weight: 760; }
.state-marker--neutral { background: #edf1f4; color: var(--ink-soft); }
.state-marker--progress { background: var(--blue-soft); color: var(--blue-dark); }
.public-next-step { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 15px; margin-top: 24px; padding: 15px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--ink-soft); font-size: .84rem; }
.public-next-step strong { color: var(--ink); }
.public-fallback { margin-top: 24px; padding-top: 15px; border-top: 1px solid var(--line); font-size: .84rem; }
.auth-shell { max-width: 420px; margin: 10vh auto; }
.auth-shell > .auth-brand { margin-left: 4px; }
.login-box { position: relative; margin: 0; padding: 30px; border-radius: 12px; }
.login-box h1 { margin-bottom: 8px; font-size: 1.65rem; }
.auth-intro { margin: 0 0 22px; }
.auth-form { display: grid; gap: 15px; }
.auth-form button { width: 100%; margin-top: 2px; }
.form-alert { display: grid; gap: 2px; margin: 0 0 18px; padding: 11px 12px; border: 1px solid #efc8cd; border-radius: 8px; background: var(--red-soft); color: var(--red); font-size: .82rem; }.form-success { margin: 0 0 18px; padding: 11px 12px; border: 1px solid #b9dfca; border-radius: 8px; background: #edf9f1; color: #217044; font-size: .82rem; }.password-panel { max-width: 560px; }.password-panel h2 { margin: 0; font-size: 1rem; }.password-form { display: grid; gap: 15px; margin-top: 16px; }
.auth-footnote { margin: 16px 4px 0; color: var(--muted); font-size: .76rem; text-align: center; }
.audit-details details { max-width: 260px; }
.audit-details summary { color: var(--blue); cursor: pointer; font-size: .8rem; font-weight: 700; }
.audit-details code { display: block; max-height: 130px; margin-top: 7px; padding: 8px; overflow: auto; border-radius: 6px; background: var(--surface-muted); color: var(--ink-soft); font-size: .72rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.audit-time { color: var(--muted); white-space: nowrap; }
.catalog-description { max-width: 240px; overflow-wrap: anywhere; }
.catalog-filters .filter-field { flex-basis: 330px; }
.catalog-incomplete { margin-top: 18px; }

@media (max-width: 1100px) {
  .orders-filters { grid-template-columns: minmax(240px, 1.3fr) minmax(150px, .7fr); }
  .orders-filter-actions { align-self: end; }
  .order-summary-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .order-summary-facts > div:nth-child(4) { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .order-summary-facts > div:nth-child(n+4) { border-top: 1px solid var(--line); }
  .metric-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .metric-strip > div:nth-child(4) { padding-left: 0; border-left: 0; }
  .metric-strip > div:nth-child(n+4) { border-top: 1px solid var(--line); }
}

@media (max-width: 940px) {
  .topnav { position: sticky; top: 0; z-index: 20; width: 100%; min-width: 0; height: auto; min-height: 62px; flex-direction: row; align-items: center; gap: 2px; padding: 10px 16px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -ms-overflow-style: none; overscroll-behavior-x: contain; }
  .topnav::-webkit-scrollbar { display: none; }
  .topnav .brand { flex: 0 0 auto; margin: 0 12px 0 0; }.topnav .nav-label, .topnav .user-block { display: none; }.topnav .spacer { display: none; }.topnav a:not(.brand) { flex: 0 0 auto; min-height: 36px; padding: 7px 9px; font-size: .82rem; }.topnav a.active::before { bottom: 4px; left: 9px; width: calc(100% - 18px); height: 3px; border-radius: 3px; }.mobile-logout { display: flex; flex: 0 0 auto; align-items: center; margin-left: 4px; }.topnav .mobile-logout button.link { min-height: 36px; margin-top: 0; padding: 7px 9px; color: #c8d5df; }.app-shell > main { margin-right: 0; margin-left: 0; padding-top: 28px; }
}
@media (max-width: 720px) {
  body { font-size: 14px; }.topnav { padding: 9px 12px; }.topnav .brand { margin-right: 5px; }.brand-mark { width: 25px; height: 25px; }.topnav a:not(.brand) { padding: 7px 8px; font-size: .78rem; } main { padding: 22px 14px 42px; }.page-header { align-items: flex-start; flex-direction: column; gap: 7px; margin-bottom: 16px; }.page-heading { align-items: flex-start; flex-direction: column; gap: 3px; }.orders-page-hint { text-align: left; }.orders-filters { grid-template-columns: 1fr; }.orders-filter-actions { width: 100%; }.orders-filter-actions > * { flex: 1; }.table-wrap { border-radius: 8px; } th, td { padding: 11px 12px; }.tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }.tile { min-height: 90px; padding: 12px; }.grid-2-1, .detail-grid, .connection-facts, .account-modal-grid, .account-health, .user-form-grid, .order-facts { grid-template-columns: 1fr; }.connection-row-head, .order-header, .order-next-step { align-items: flex-start; flex-direction: column; }.order-statuses { justify-content: flex-start; }.order-statuses > div > span, .order-next-step-status { text-align: left; }.connection-row-head button { width: 100%; }.account-health > div, .account-health > div + div { padding: 10px 0; border-left: 0; }.account-health > div + div { border-top: 1px solid var(--line); }.user-form-grid .field:first-child { grid-column: auto; }.order-flow { grid-template-columns: repeat(2, 1fr); }.order-flow span:nth-child(2) { border-right: 0; }.order-flow span:nth-child(-n+2) { border-bottom: 1px solid var(--line); }.form-grid, .modal .form-grid, .form-grid--compact, .modal-form-grid { grid-template-columns: 1fr; }.form-grid .field.wide { grid-column: auto; }.form-grid .actions, .modal .actions { grid-column: auto; }.form-grid .actions button { width: 100%; }.modal-actions { flex-direction: column-reverse; }.modal-actions button { width: 100%; }.settings-heading { flex-direction: column; gap: 10px; }.settings-facts { grid-template-columns: 1fr; }.settings-facts > div, .settings-facts > div + div { padding: 11px 0; border-left: 0; }.settings-facts > div + div { border-top: 1px solid var(--line); }.role-reference td:first-child { width: 120px; }.filters select { width: 100%; }.filters button { flex: 1; }.modal-content { padding: 18px; }.modal { width: calc(100vw - 20px); }.public-page { margin: 22px auto; padding: 22px; }.login-box { margin: 9vh 14px; padding: 24px; }
}
@media (max-width: 720px) {
  .topnav a:not(.brand), input, select, button, textarea, .button-link, .btn-outline { min-height: 44px; }
  .topnav .mobile-logout button.link { min-height: 44px; }
  .orders-header { gap: 10px; }
  .queue-tabs { margin-right: -14px; padding-right: 14px; }
  .queue-tabs a { min-height: 44px; }
  .orders-filters { grid-template-columns: 1fr; }
  .orders-table { overflow: visible; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
  .orders-table table, .orders-table tbody { display: block; }
  .orders-table thead { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
  .orders-table tbody { display: grid; gap: 10px; }
  .orders-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; padding: 15px; border: 1px solid var(--line); border-radius: 9px; background: #fff; box-shadow: var(--shadow-sm); }
  .orders-table tr.order-row--danger { border-color: #efc8cd; background: #fffafb; }
  .orders-table tr.order-row--warning { border-color: #ead3a8; background: #fffdf8; }
  .orders-table td { display: block; min-width: 0; padding: 0; border: 0; }
  .orders-table .order-identity, .orders-table .order-work-state, .orders-table td.empty { grid-column: 1 / -1; }
  .orders-table .order-work-state { padding: 11px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .orders-table td[data-label]::before { display: block; margin-bottom: 3px; color: var(--muted); content: attr(data-label); font-size: .72rem; font-weight: 680; }
  .orders-table .order-identity::before, .orders-table .order-work-state::before { display: none !important; }
  .orders-table .order-id { min-height: 44px; font-size: 1rem; }
  .orders-table .order-created { text-align: right; }
  .orders-table .order-created time { white-space: normal; }
  .orders-table .empty { padding: 22px 8px; }
  .order-header { align-items: flex-start; flex-direction: column; }
  .order-header > .queue-state { margin-top: 0; }
  .order-action-panel { align-items: stretch; flex-direction: column; gap: 14px; }
  .order-action-buttons, .order-action-buttons form, .order-action-buttons button, .order-action-buttons .button-link { width: 100%; }
  .order-summary-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .order-summary-facts > div, .order-summary-facts > div + div { padding: 10px 10px 11px 0; border-left: 0; border-top: 1px solid var(--line); }
  .order-summary-facts > div:nth-child(odd) { padding-left: 0; }
  .order-summary-facts > div:nth-child(even) { padding-left: 10px; border-left: 1px solid var(--line); }
  .order-summary-facts > div:nth-child(-n+2) { border-top: 0; }
  .order-detail-grid { grid-template-columns: 1fr; gap: 24px; }
  .order-items-table { overflow: visible; border: 0; border-radius: 0; box-shadow: none; }
  .order-items-table table, .order-items-table tbody { display: block; }
  .order-items-table thead { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
  .order-items-table tbody { display: grid; gap: 9px; }
  .order-items-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; padding: 13px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
  .order-items-table td { display: block; padding: 0; border: 0; text-align: left; overflow-wrap: anywhere; }
  .order-items-table td:nth-child(2) { grid-column: 1 / -1; grid-row: 1; }
  .order-items-table td[data-label]::before { display: block; margin-bottom: 2px; color: var(--muted); content: attr(data-label); font-size: .72rem; font-weight: 680; }
  .copy-button { min-height: 44px; }
  h1 { font-size: 1.62rem; }
  .header-note { text-align: left; }
  .metric-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-strip > div, .metric-strip > div + div { padding: 11px 10px 12px 0; border-top: 1px solid var(--line); border-left: 0; }
  .metric-strip > div:nth-child(even) { padding-left: 10px; border-left: 1px solid var(--line); }
  .metric-strip > div:nth-child(-n+2) { border-top: 0; }
  .metric-strip strong { font-size: 1.25rem; }
  .metric-label { white-space: normal; }
  .report-panel { padding: 16px; }
  .chart-head { align-items: flex-start; flex-direction: column; gap: 6px; }
  .chart-maximum { margin-left: 0; }
  .plot { gap: 3px; }
  .filter-field { width: 100%; flex-basis: 100% !important; }
  .filter-actions { width: 100%; }
  .filter-actions > * { flex: 1; }
  .catalog-incomplete { width: 100%; margin-top: 0; white-space: normal; }
  .settings-nav { top: 61px; margin-right: -14px; margin-left: -14px; border-right: 0; border-left: 0; border-radius: 0; }
  .public-next-step { grid-template-columns: 1fr; gap: 5px; }
  .auth-shell { margin: 6vh 0; }
  .auth-shell > .auth-brand { margin-left: 4px; }
  .login-box { margin: 0; }

  .catalog-table, .people-table, .audit-table, .settings-table { overflow: visible; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
  .catalog-table table, .catalog-table tbody,
  .people-table table, .people-table tbody,
  .audit-table table, .audit-table tbody,
  .settings-table table, .settings-table tbody { display: block; }
  .catalog-table thead, .people-table thead, .audit-table thead, .settings-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .catalog-table tbody, .people-table tbody, .audit-table tbody, .settings-table tbody { display: grid; gap: 10px; }
  .catalog-table tr, .people-table tr, .audit-table tr, .settings-table tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px 14px;
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
  }
  .catalog-table td, .people-table td, .audit-table td, .settings-table td {
    display: block;
    min-width: 0;
    padding: 0;
    border: 0;
    text-align: left;
    overflow-wrap: anywhere;
  }
  .catalog-table td[data-label]::before, .people-table td[data-label]::before,
  .audit-table td[data-label]::before, .settings-table td[data-label]::before {
    display: block;
    margin-bottom: 3px;
    color: var(--muted);
    content: attr(data-label);
    font-size: .7rem;
    font-weight: 700;
  }
  .catalog-table .catalog-identity, .catalog-table .catalog-title, .catalog-table .catalog-description,
  .people-table .person-identity, .people-table td:nth-child(4),
  .audit-table .audit-time, .audit-table .audit-entity-id, .audit-table .audit-details,
  .settings-table .service-identity { grid-column: 1 / -1; }
  .catalog-table .catalog-title, .people-table td:nth-child(4), .audit-table .audit-details { padding-top: 10px; border-top: 1px solid var(--line); }
  .catalog-table .catalog-action, .people-table .person-action, .settings-table .service-action { grid-column: 1 / -1; }
  .catalog-table .catalog-action button, .people-table .person-action button, .settings-table .service-action button { width: 100%; }
  .catalog-table td.empty, .people-table td.empty, .audit-table td.empty, .settings-table td.empty { grid-column: 1 / -1; padding: 18px 4px; }
  .audit-details details { max-width: none; }
  .audit-details code { max-height: 180px; }
}
.account-danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 22px; padding-top: 18px; border-top: 1px solid #efc8cd; }.account-danger-zone .modal-context { color: var(--red); }.account-danger-zone h3 { margin: 0; font-size: .9rem; }.account-danger-zone p:not(.modal-context) { max-width: 54ch; margin: 4px 0 0; color: var(--muted); font-size: .82rem; line-height: 1.4; }.account-danger-zone .button-danger { flex: 0 0 auto; }
@media (max-width: 720px) { .account-danger-zone { align-items: stretch; flex-direction: column; gap: 12px; }.account-danger-zone .button-danger { width: 100%; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; } }
.stats-header { align-items: end; }
.stats-period-filter { display: flex; align-items: center; gap: 9px; margin: 0; }
.stats-period-filter label { color: var(--muted); font-size: .76rem; font-weight: 720; }
.stats-period-filter select { min-width: 116px; }
.stats-metrics small { display: block; margin-top: 4px; color: var(--muted); font-size: .7rem; }
.stats-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(290px, .85fr); align-items: start; gap: 16px; }
.stats-chart-panel { min-height: 100%; }
.panel-lede { margin: 4px 0 0; color: var(--muted); font-size: .8rem; line-height: 1.4; }
.stats-chart-panel .chart-head { align-items: start; justify-content: space-between; margin-bottom: 8px; }
.stats-chart-panel .legend { margin-bottom: 13px; }
.swatch-created, .plot .bar.b1 { background: var(--blue); }
.swatch-shipped, .plot .bar.b2 { background: var(--green); }
.swatch-delivered, .plot .bar.b3 { background: #8b72d6; }
.stats-chart-panel .plot { width: 100%; min-width: 0; }
.stats-chart-panel .plot .col { min-width: 0; flex: 1 1 0; overflow: hidden; }
.stats-chart-panel .plot .bar { width: 8px; }
.stats-chart-panel .xaxis { width: 100%; min-width: 0; overflow: hidden; }
.chart-scroll { min-width: 0; }
.delivery-panel { min-height: 100%; }
.delivery-total { display: flex; align-items: baseline; gap: 8px; padding: 4px 0 17px; border-bottom: 1px solid var(--line); }
.delivery-total strong { color: var(--blue-dark); font-size: 2rem; font-variant-numeric: tabular-nums; letter-spacing: -.04em; }
.delivery-total span { color: var(--muted); font-size: .8rem; }
.delivery-breakdown { display: grid; gap: 0; }
.delivery-breakdown > div, .delivery-breakdown-link, .workflow-list > div { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 42px; border-bottom: 1px solid var(--line); color: var(--ink-soft); font-size: .82rem; }
.delivery-breakdown-link { text-decoration: none; transition: background-color .16s ease, color .16s ease; }
.delivery-breakdown-link:hover { background: var(--surface-muted); color: var(--ink); }
.delivery-breakdown-link:last-child, .workflow-list > div:last-child { border-bottom: 0; }
.delivery-breakdown strong, .workflow-list strong { color: var(--ink); font-size: .9rem; font-variant-numeric: tabular-nums; }
.delivery-breakdown .state-marker { display: block; width: 8px; height: 8px; margin: 0; align-self: center; border-radius: 50%; line-height: 1; }
.state-marker--transit { background: var(--green); }.state-marker--delivered { background: #8b72d6; }.state-marker--waiting { background: var(--amber); }.state-marker--exception { background: var(--red); }
.stats-bottom-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, .8fr); gap: 16px; margin-top: 16px; }
.workflow-list { margin-top: 4px; }.workflow-list .dot { width: 8px; height: 8px; }
.stats-note-panel { background: var(--navy); color: #fff; }.stats-note-panel .page-context, .stats-note-panel p { color: #b9c8d5; }.stats-note-panel h2 { max-width: 23ch; color: #fff; line-height: 1.2; }.stats-note-panel > p:last-child { max-width: 52ch; margin: 12px 0 0; font-size: .84rem; line-height: 1.55; }
@media (max-width: 940px) { .stats-layout, .stats-bottom-grid { grid-template-columns: 1fr; }.stats-chart-panel .plot .bar { width: 7px; } }
@media (max-width: 720px) {
  body { overflow-x: hidden; }
  .stats-header > *, .stats-layout > *, .stats-bottom-grid > *, .stats-metrics > * { min-width: 0; }
  .stats-header { align-items: flex-start; }
  .stats-period-filter { width: 100%; justify-content: space-between; }
  .stats-period-filter select { flex: 1; min-width: 0; }
  .stats-chart-panel { overflow: hidden; }
  .stats-chart-panel .chart-head > div { min-width: 0; }
  .stats-chart-panel .legend { flex-wrap: wrap; gap: 8px 12px; }
  .stats-chart-panel .plot { min-width: 0; overflow: hidden; }
  .stats-chart-panel .chart-values { display: none; }
  .stats-chart-panel .plot .bar { width: 6px; }
  .stats-chart-panel .chart-data { overflow-x: auto; }
  .stats-chart-panel .chart-data table { min-width: 520px; }
  .chart-scroll { overflow-x: auto; overscroll-behavior-x: contain; padding-bottom: 4px; }
  .chart-scroll--14 .xaxis span:last-child { text-align: right; }
  .chart-scroll--30 .plot, .chart-scroll--30 .xaxis, .chart-scroll--30 .chart-values { min-width: 620px; }
  .chart-scroll--90 .plot, .chart-scroll--90 .xaxis, .chart-scroll--90 .chart-values { min-width: 900px; }
  .delivery-total { padding-top: 0; }
}
