/* Deployments: pushed to GitHub, published by Vercel. */
/* Layout: fixed left rail (brand + nav) beside a single scrolling work column; collapses to a top bar on phones.
   Dark-first single look, matching the 78 Strange studio mockups: plum-black ground, cream ink and cream buttons. */
:root {
  --bg: #1b161d;
  --surface: #241e27;
  --surface-2: #2c2530;
  --line: #3a3140;
  --line-soft: #2f2833;
  --fg: #f1ebe0;
  --muted: #a69ba6;
  --faint: #776c78;
  --accent: #ece3cd;
  --accent-fg: #1b161d;
  --ok: #3cb37f;   --ok-bg: rgba(60,179,127,.12);
  --warn: #dba844; --warn-bg: rgba(219,168,68,.12);
  --bad: #ec5257;  --bad-bg: rgba(236,82,87,.12);
  --info: #6b93f0; --info-bg: rgba(107,147,240,.13);
  --event: #a77bf0;
  --font-display: "Bricolage Grotesque", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --r: 12px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 14px/1.5 var(--font-body); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; }
[hidden] { display: none !important; }

/* sign-in */
.auth { min-height: 100%; display: grid; place-items: center; padding-block: 40px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line-soft); border-radius: 16px; padding: 32px 28px; display: flex; flex-direction: column; gap: 18px; }
.auth-card .brand { border: 0; padding: 0; }
.auth-card h1 { font-size: 24px; }
.auth-card p { margin: 0; color: var(--muted); }
.auth-card form { display: flex; flex-direction: column; gap: 12px; }
.auth-card .btn { justify-content: center; padding: 10px 14px; }
.auth-sent { padding: 14px; border-radius: 10px; background: var(--ok-bg); border: 1px solid rgba(60,179,127,.35); color: var(--fg); }
.userbar { display: flex; flex-direction: column; gap: 6px; }
.userbar span { overflow-wrap: anywhere; color: var(--muted); }
.userbar button { align-self: flex-start; background: none; border: 0; padding: 0; color: var(--fg); cursor: pointer; text-decoration: underline; font-size: 12px; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; text-wrap: balance; }
h1 { font-size: 30px; font-weight: 800; letter-spacing: -.01em; line-height: 1.1; }
h2 { font-size: 15px; font-weight: 700; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); font-size: 12px; letter-spacing: .02em; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
svg.i { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* shell */
.app { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100%; }
.side { border-right: 1px solid var(--line-soft); background: var(--bg); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 12px; padding: 22px 20px; border-bottom: 1px solid var(--line-soft); }
.brand img { width: 40px; height: 40px; border-radius: 10px; }
.brand b { font-family: var(--font-display); font-size: 15.5px; white-space: nowrap; font-weight: 800; display: block; line-height: 1.1; }
.brand span { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.nav { display: flex; flex-direction: column; gap: 4px; padding: 14px 10px; }
.nav button { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px; border: 0; background: none; color: var(--muted); cursor: pointer; text-align: left; font-weight: 500; }
.nav button:hover { color: var(--fg); background: var(--surface); }
.nav button[aria-current="page"] { color: var(--fg); background: var(--surface-2); }
.side-foot { margin-top: auto; padding: 16px 20px; font-size: 12px; color: var(--faint); border-top: 1px solid var(--line-soft); }
.main { padding-block: 32px 64px; padding-left: max(32px, env(safe-area-inset-left, 0px)); padding-right: max(32px, env(safe-area-inset-right, 0px)); min-width: 0; }
.wrap { max-width: 1120px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }

.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.head p { margin: 6px 0 0; color: var(--muted); }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; border: 0; background: none; color: var(--muted); cursor: pointer; margin-right: 6px; vertical-align: middle; }
.back:hover { background: var(--surface); color: var(--fg); }

.btn { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); cursor: pointer; font-weight: 600; font-size: 13px; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--faint); }
.btn.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.danger { color: var(--bad); border-color: rgba(236,82,87,.45); background: transparent; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--fg); background: var(--surface); }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.card { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r); padding: 20px 22px; min-width: 0; }
.card.alert { border-color: rgba(236,82,87,.55); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.card-h h2 { display: flex; align-items: center; gap: 8px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-notes { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 16px; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r); padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.kpi .lbl { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); display: flex; justify-content: space-between; align-items: center; }
.kpi .val { font-family: var(--font-display); font-size: 28px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 12px; color: var(--muted); }
.kpi.flag { border-color: rgba(236,82,87,.4); }
.kpi.flag .val { color: var(--bad); }

/* pills */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; border: 1px solid; white-space: nowrap; line-height: 1.6; }
.pill.stage { color: var(--fg); border-color: var(--line); background: var(--surface-2); }
.pill.st-6 { color: var(--ok); border-color: rgba(60,179,127,.4); background: var(--ok-bg); }
.pill.st-5, .pill.st-4 { color: var(--info); border-color: rgba(107,147,240,.4); background: var(--info-bg); }
.pill.st-3 { color: var(--warn); border-color: rgba(219,168,68,.4); background: var(--warn-bg); }
.pill.pay-Unpaid { color: var(--bad); border-color: rgba(236,82,87,.4); background: var(--bad-bg); }
.pill.pay-Partial { color: var(--info); border-color: rgba(107,147,240,.4); background: var(--info-bg); }
.pill.pay-Paid { color: var(--ok); border-color: rgba(60,179,127,.4); background: var(--ok-bg); }
.tag { font-size: 11.5px; padding: 1px 8px; border-radius: 6px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.overdue { color: var(--bad); font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; display: inline-flex; align-items: center; gap: 4px; }

/* lists */
.rows { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; gap: 14px; padding: 14px 18px; background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r); cursor: pointer; text-align: left; width: 100%; color: inherit; position: relative; }
.row:hover { border-color: var(--line); background: var(--surface-2); }
.row.flagged { box-shadow: inset 3px 0 0 var(--bad); }
.row .grow { flex: 1; min-width: 0; }
.row .t { font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row .s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.row .right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.flat .row { background: transparent; border: 0; border-radius: 9px; padding: 10px; }
.flat .row:hover { background: var(--surface-2); }
.avatar { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 13px; flex: none; color: #1b161d; }
.avatar.lg { width: 46px; height: 46px; font-size: 17px; border-radius: 12px; }

.kv { display: flex; flex-direction: column; gap: 12px; }
.kv > div { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; }
.kv dt { color: var(--muted); display: flex; align-items: center; gap: 6px; }
.kv dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; min-width: 0; overflow-wrap: anywhere; }
.kv .total { border-top: 1px solid var(--line); padding-top: 12px; }
.kv .total dt, .kv .total dd { color: var(--fg); font-weight: 700; }
dl { margin: 0; }
.late { color: var(--bad) !important; display: inline-flex; align-items: center; gap: 5px; }
.soon { color: var(--warn) !important; }

/* stage tracker */
.tracker { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); position: relative; padding: 4px 0; }
.tracker::before { content: ""; position: absolute; left: calc(100% / 14); right: calc(100% / 14); top: 17px; height: 2px; background: var(--line); }
.tracker .fill { position: absolute; left: calc(100% / 14); top: 17px; height: 2px; background: var(--accent); }
.step { display: flex; flex-direction: column; align-items: center; gap: 6px; position: relative; text-align: center; font-size: 11.5px; color: var(--muted); padding: 0 2px; }
.dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 2px solid var(--line); color: var(--faint); font-weight: 700; font-size: 12px; position: relative; z-index: 1; }
.step.done .dot { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.step.cur .dot { border-color: var(--accent); color: var(--fg); background: var(--bg); box-shadow: 0 0 0 4px rgba(236,227,205,.12); }
.step.cur { color: var(--fg); font-weight: 600; }
.step small { font-size: 10.5px; color: var(--faint); font-weight: 500; }
.step small.due { color: var(--warn); }
.step button.dot { cursor: pointer; padding: 0; }
.step button.dot:hover { border-color: var(--fg); }
.mini-track { display: flex; gap: 4px; }
.mini-track span { flex: 1; height: 5px; border-radius: 3px; background: var(--line); }
.mini-track span.on { background: var(--accent); }

/* table */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th { text-align: left; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 0 8px 10px 0; border-bottom: 1px solid var(--line); }
td { padding: 10px 8px 10px 0; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
td.r, th.r { text-align: right; padding-right: 0; }
tfoot td { border-bottom: 0; font-weight: 700; padding-top: 12px; }

/* timeline */
.tl { display: flex; flex-direction: column; gap: 4px; }
.tl-axis, .tl-row { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 14px; align-items: center; }
.tl-ticks { position: relative; height: 20px; font-size: 11px; color: var(--faint); }
.tl-ticks span { position: absolute; transform: translateX(-1px); padding-left: 5px; border-left: 1px solid var(--line); line-height: 20px; white-space: nowrap; }
.tl-label { min-width: 0; padding: 6px 0; cursor: pointer; background: none; border: 0; text-align: left; }
.tl-label b { display: block; font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-label span { font-size: 11.5px; color: var(--muted); }
.tl-track { position: relative; height: 30px; background: repeating-linear-gradient(90deg, transparent 0 calc(var(--wk) - 1px), var(--line-soft) calc(var(--wk) - 1px) var(--wk)); border-radius: 6px; }
.tl-bar { position: absolute; top: 9px; height: 12px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.tl-bar i { position: absolute; inset: 0 auto 0 0; background: var(--accent); opacity: .85; }
.tl-bar.late { border-color: var(--bad); }
.tl-mk { position: absolute; top: 6px; width: 10px; height: 10px; transform: translateX(-5px) rotate(45deg); border: 2px solid var(--bg); }
.tl-mk.approval { background: var(--muted); }
.tl-mk.deposit { background: var(--warn); }
.tl-mk.payment { background: var(--bad); }
.tl-mk.delivery { background: var(--ok); top: 19px; }
.tl-today { position: absolute; top: -4px; bottom: -4px; width: 0; border-left: 1.5px dashed var(--accent); z-index: 2; }
.tl-legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 12px; color: var(--muted); margin-top: 10px; }
.tl-legend span { display: inline-flex; align-items: center; gap: 6px; }
.tl-legend i { width: 9px; height: 9px; transform: rotate(45deg); display: inline-block; }

/* misc */
.search { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; max-width: 360px; flex: 1 1 240px; }
.search input { flex: 1; background: none; border: 0; padding: 9px 0; outline: none; min-width: 0; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: none; color: var(--muted); cursor: pointer; font-size: 12.5px; font-weight: 500; }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.client-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.ccard { display: flex; flex-direction: column; gap: 12px; cursor: pointer; text-align: left; color: inherit; }
.ccard:hover { border-color: var(--line); }
.ccard .top { display: flex; gap: 12px; align-items: center; }
.ccard .top b { font-family: var(--font-display); font-size: 17px; display: block; }
.ccard .meta { font-size: 12.5px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; overflow-wrap: anywhere; }
.ccard .meta span { display: flex; gap: 7px; align-items: center; }
.ccard .foot { border-top: 1px solid var(--line-soft); padding-top: 10px; display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); }
.empty { padding: 28px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--r); display: flex; flex-direction: column; gap: 10px; align-items: center; }
.empty b { color: var(--fg); font-family: var(--font-display); font-size: 16px; }
.note-body { white-space: pre-wrap; color: var(--fg); margin: 0; }
.note-int { margin-top: 14px; padding: 12px 14px; background: var(--surface-2); border-radius: 9px; font-size: 13px; }
.note-int .lbl { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--warn); font-weight: 700; margin-bottom: 4px; }
.banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 16px; border-radius: 10px; background: var(--warn-bg); border: 1px solid rgba(219,168,68,.35); color: var(--fg); font-size: 13px; }
.banner.info { background: var(--info-bg); border-color: rgba(107,147,240,.35); }
.banner.bad { background: var(--bad-bg); border-color: rgba(236,82,87,.4); }
.track-link { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.track-link:hover { text-decoration: underline; }
.split { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.paylist { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-soft); font-size: 13px; }

/* portal */
.portal-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding-block: 18px; padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); border-bottom: 1px solid var(--line-soft); }
.portal-top .brand { border: 0; padding: 0; }
.portal-hero h1 { font-size: 36px; }
.order { display: flex; flex-direction: column; gap: 16px; }
.order-h { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.order-h h3 { font-size: 19px; font-weight: 700; }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line-soft); border-radius: 10px; overflow: hidden; border: 1px solid var(--line-soft); }
.facts > div { background: var(--surface); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.facts .lbl { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.facts .v { font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
details.more summary { cursor: pointer; color: var(--muted); font-weight: 600; font-size: 13px; list-style: none; display: inline-flex; gap: 6px; align-items: center; }
details.more summary::-webkit-details-marker { display: none; }
details.more[open] summary svg { transform: rotate(90deg); }
details.more .inner { margin-top: 16px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

/* modal */
.scrim { position: fixed; inset: 0; background: rgba(10,7,11,.7); z-index: 50; display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding-block: max(40px, env(safe-area-inset-top, 0px)) 40px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.modal { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; width: 100%; max-width: 760px; display: flex; flex-direction: column; }
.modal.narrow { max-width: 440px; }
.modal-h { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line-soft); }
.modal-h h2 { font-size: 18px; }
.modal-b { padding: 20px 22px; display: flex; flex-direction: column; gap: 22px; }
.modal-f { padding: 14px 22px; border-top: 1px solid var(--line-soft); display: flex; justify-content: flex-end; gap: 8px; }
fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
legend { font-family: var(--font-display); font-weight: 700; font-size: 14px; margin-bottom: 10px; padding: 0; }
.fgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.fgrid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12px; color: var(--muted); font-weight: 500; }
.hint { font-size: 11.5px; color: var(--faint); }
input[type=text], input[type=email], input[type=tel], input[type=url], input[type=number], input[type=date], select, textarea { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; width: 100%; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { resize: vertical; min-height: 72px; }
.prow { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 2fr) 80px 100px 32px; gap: 8px; align-items: center; }
.prow-h { font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .08em; }
.icon-btn { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; border: 0; background: none; color: var(--muted); cursor: pointer; }
.icon-btn:hover { color: var(--bad); background: var(--surface-2); }
.toast { position: fixed; bottom: max(24px, calc(env(safe-area-inset-bottom, 0px) + 16px)); left: 50%; transform: translateX(-50%); background: var(--accent); color: var(--accent-fg); padding: 10px 18px; border-radius: 10px; font-weight: 600; z-index: 60; box-shadow: 0 10px 30px rgba(0,0,0,.4); max-width: calc(100vw - 32px); }
.toast.err { background: var(--bad); color: #fff; }
.loading { display: grid; place-items: center; min-height: 50vh; color: var(--muted); }

/* Today's date, client logos, US holidays */
.today { display: inline-flex; gap: 10px; align-items: baseline; flex-wrap: wrap; align-self: flex-start; margin-top: 12px; padding: 7px 14px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.today b { color: var(--fg); font-weight: 600; }
.avatar.logo { background: #f1ebe0; padding: 4px; overflow: hidden; }
.avatar.logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.logo-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.logo-preview { width: 56px; height: 56px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); font-family: var(--font-display); font-weight: 800; color: var(--muted); overflow: hidden; flex: none; }
.logo-preview img { width: 100%; height: 100%; object-fit: contain; padding: 4px; background: #f1ebe0; }
.tl-us { position: absolute; top: 0; bottom: 0; border-left: 1px dotted var(--muted); opacity: .6; pointer-events: none; }
.hol-group + .hol-group { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.hol-group > .card-h { margin-bottom: 10px; }

/* China holidays + backward planner */
.tl-hol { position: absolute; top: 0; bottom: 0; background: var(--warn-bg); border-inline: 1px solid rgba(219,168,68,.35); }
.tl-mk.event { background: var(--event); border-radius: 50%; border-color: var(--bg); top: 9px; transform: translateX(-5px); }
.tl-seg { position: absolute; top: 9px; height: 12px; border-radius: 3px; }
.tl-seg.prod { background: var(--warn); opacity: .75; }
.tl-seg.ship { background: var(--info); opacity: .8; }
.tl-bar.quiet { background: transparent; border-color: var(--line); opacity: .6; }
.hol-list { display: flex; flex-direction: column; }
.hol-row { display: flex; gap: 16px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.hol-row:first-child { border-top: 0; padding-top: 0; }
.hol-row .grow { flex: 1 1 260px; min-width: 0; }
.hol-row .t { font-weight: 600; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hol-row .s { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.hol-row .when { display: flex; flex-direction: column; font-size: 12.5px; text-align: right; font-variant-numeric: tabular-nums; }
.hol-row .when span { color: var(--muted); }
.hol-row .when span.faint { color: var(--faint); }
.plan-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.plan-opt { display: flex; flex-direction: column; gap: 8px; padding: 14px; background: var(--bg); border: 1px solid var(--line-soft); border-radius: 10px; min-width: 0; align-items: stretch; }
.plan-opt .kv { gap: 6px; font-size: 13px; margin-top: 4px; }
.plan-opt .btn { align-self: flex-start; margin-top: auto; }
.plan-notes { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }

@media (max-width: 1000px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: sticky; top: env(safe-area-inset-top, 0px); height: auto; flex-direction: row; align-items: center; border-right: 0; border-bottom: 1px solid var(--line-soft); z-index: 20; padding-left: max(8px, env(safe-area-inset-left, 0px)); padding-right: max(8px, env(safe-area-inset-right, 0px)); }
  body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg); }
  .brand { border: 0; padding: 10px 8px; }
  .brand > div, .side-foot { display: none; }
  .brand img { width: 34px; height: 34px; }
  .nav { flex-direction: row; padding: 8px 0; overflow-x: auto; }
  .main { padding-block: 22px 48px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .grid2, .grid-notes, details.more .inner, .plan-grid { grid-template-columns: minmax(0, 1fr); }
  .hol-row .when { text-align: left; }
  .tl-axis, .tl-row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .tl-axis > div:first-child { display: none; }
  .tl-row { margin-bottom: 6px; }
  .tracker .step span.lbl { font-size: 9.5px; }
  .fgrid, .fgrid.three { grid-template-columns: minmax(0, 1fr); }
  .prow { grid-template-columns: minmax(0, 1fr) 70px 90px 32px; }
  .prow .pd { display: none; }
  h1 { font-size: 25px; }
  .portal-hero h1 { font-size: 28px; }
}
@media (max-width: 480px) {
  .kpis { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .kpi { padding: 14px; }
  .kpi .val { font-size: 22px; }
  .row { flex-wrap: wrap; }
  .row .right { width: 100%; justify-content: flex-start; padding-left: 48px; }
  .step small { display: none; }
  .dot { width: 22px; height: 22px; font-size: 10px; }
  .tracker::before, .tracker .fill { top: 14px; }
}
@media (prefers-reduced-motion: no-preference) {
  .row, .btn, .chip, .nav button { transition: background-color .15s, border-color .15s, color .15s; }
  .scrim .modal { animation: pop .18s ease-out; }
  @keyframes pop { from { transform: translateY(8px); opacity: .6; } }
}
