/* "Ruta clara": light and operational, always (the approved design has no dark version). Geist (and Geist Mono for codes, containers and dates), white rounded cards, a pill menu on top. */
@font-face { font-family: "Geist"; src: url("/portal/fonts/Geist-Variable.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/portal/fonts/GeistMono-Variable.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
:root {
  --bg: #f5f6f8; --panel: #ffffff; --fg: #0e1b2c; --muted: #5a6575; --line: #e3e6eb; --soft: #eef0f4;
  --accent: #2f45d6; --accent-fg: #ffffff; --accent-soft: #e8ebfb; --ink: #0e1b2c; --ink-fg: #ffffff; --nav: #3d4757;
  --bad: #b3261e; --ok: #1e7b4f; --warn: #9a6200; --ok-on-tint: #1a6f47; --warn-on-tint: #8a5800; --alert: #d9581f; --alert-bg: #fff3ec; --alert-line: #f6d3bf; --alert-fg: #9a3b0e; --amber: #b8800a; --track: #c9d3dd;
  --s1: #2f45d6; --s2: #c2570c; --s3: #1e7b4f; --s4: #7a3fb0; --s5: #b3261e; --s6: #5a6575;
  --chart-surface: #ffffff; --chart-grid: #e6e8ec; --chart-axis: #c9ced6; --chart-muted: #6b7484;
  --series-1: #2f45d6; --series-2: #eb6834; --series-3: #1baf7a;
  --status-good: #0ca30c; --status-warning: #fab219; --status-critical: #d03b3b; --delta-good: #006300;
  --radius: 20px; --radius-sm: 12px;
  --font: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif; --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
h1 { font-size: 30px; line-height: 1.15; font-weight: 800; letter-spacing: -0.025em; margin: 0 0 16px; }
h2 { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; margin: 28px 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.bad { color: var(--bad); } .ok { color: var(--ok); } .warn { color: var(--warn); }

/* The top bar: brand, a pill per section, then customer, account and language; a section's pages as tabs below. */
.top { background: var(--panel); border-bottom: 1px solid var(--line); }
.top .bar { max-width: 1320px; margin: 0 auto; padding: 10px 24px; min-height: 64px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; font-size: 17px; letter-spacing: -0.02em; color: var(--fg); text-decoration: none; }
.brand-name { display: inline-flex; flex-direction: column; line-height: 1.1; }
.brand-name .rel { color: var(--accent); }
.brand-name small { font-size: 10.5px; font-weight: 500; letter-spacing: 0; color: var(--muted); white-space: nowrap; }
/* Signed in, at these widths the phrase alone would push the menu to a second row. */
@media (min-width: 1161px) and (max-width: 1319px) { .brand:has(~ nav:not([hidden])) small { display: none; } }
.brand svg circle { fill: var(--accent); }
.brand svg path { fill: none; stroke: var(--accent-fg); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
#nav { flex: 0 1 auto; display: flex; flex-wrap: nowrap; gap: 0; min-width: 0; overflow-x: auto; scrollbar-width: none; }
#nav a { display: inline-flex; align-items: center; white-space: nowrap; min-height: 40px; padding: 0 11px; border-radius: 999px; color: var(--nav); font-weight: 600; text-decoration: none; }
#nav a:hover { background: var(--soft); color: var(--fg); }
#nav a[aria-current="page"] { background: var(--ink); color: var(--ink-fg); }
.top .tools { display: flex; flex-wrap: nowrap; gap: 10px; align-items: center; margin-left: auto; }
#account { display: flex; gap: 10px; align-items: center; }
#account a[aria-current] { font-weight: 700; }
.avatar { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 13px; }
#tenant:empty { display: none; }
.card .spread h2, .card > div > h2:first-child { margin: 0; }
#tenant select { width: auto; border-radius: 999px; }
/* A section's pages, under the page title: a grey capsule with the current page raised in white. */
/* Pages that do not fit on one line go on to the next (Settings has ten): none is cut off, and nothing hides that there are more. */
.segmented { display: flex; flex-wrap: wrap; width: max-content; max-width: 100%; gap: 2px; padding: 4px; margin: -8px 0 24px; background: #eceef3; border-radius: 20px; }
img.qr { display: block; width: 220px; height: 220px; margin: 4px 0 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; image-rendering: pixelated; }
.segmented a { padding: 7px 16px; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap; }
.segmented a:hover { color: var(--fg); }
.segmented a[aria-current="page"] { background: var(--panel); color: var(--fg); box-shadow: 0 1px 2px rgb(14 27 44 / 0.12), 0 0 0 1px var(--line); }
@media (max-width: 760px) {
  .top .bar { padding: 8px 16px; gap: 8px 12px; }
  #nav { order: 3; flex-basis: 100%; flex-wrap: nowrap; overflow-x: auto; }
  #nav a { white-space: nowrap; }
  .top .tools { gap: 8px; }
}
.lang { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.lang button { border: 0; border-radius: 0; padding: 4px 10px; font-size: 12.5px; background: transparent; color: var(--muted); }
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--ink-fg); }
.learn-link { float: right; margin: 6px 0 0 12px; }
@media (max-width: 760px) { .learn-link { float: none; display: block; width: max-content; margin: 0 0 6px auto; } } /* the page head is a flex box: it does not wrap around a float, so text ran under the link */
/* Orders: the funnel of the period (each stage filters the table) and one order's timeline. */
.funnel { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; margin: 12px 0; }
.funnel .stage { position: relative; display: grid; align-content: start; gap: 2px; padding: 10px 14px 10px 22px; background: var(--panel); border: 1px solid var(--line); border-left: 0;
  color: var(--fg); text-decoration: none; clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%, 12px 50%); }
.funnel .stage.first { border-left: 1px solid var(--line); border-radius: 16px 0 0 16px; padding-left: 14px; clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%); }
.funnel.cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.funnel .stage b { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.funnel .stage span { font-size: 12.5px; color: var(--muted); }
.funnel a.stage:hover, .funnel a.stage[aria-current] { background: var(--soft); }
.funnel a.stage[aria-current] span { color: var(--fg); font-weight: 600; }
.funnel .stage.warn b { color: var(--warn); } .funnel .stage.bad b { color: var(--bad); }
@media (max-width: 760px) {
  .funnel, .funnel.cols-6 { grid-template-columns: 1fr; gap: 4px; }
  .funnel .stage, .funnel .stage.first { clip-path: none; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; grid-template-columns: 56px 1fr; align-items: baseline; }
}
ol.steps.life li.bad { border-color: var(--bad); }
ol.steps.life li.bad .mark { background: var(--bad); border-color: var(--bad); color: var(--panel); }
ol.steps.life li.wait .mark { border-color: var(--warn); color: var(--warn); }
ol.steps.life li.todo { opacity: .7; }
blockquote.note { margin: 12px 0; padding: 8px 12px; border-left: 3px solid var(--line, currentColor); overflow-wrap: anywhere; white-space: pre-wrap; }
blockquote.note footer { margin-top: 4px; white-space: normal; }
/* Learn: a process as lanes (one per actor, a column per step), then each step in words (views/flow.ts). */
.flow { margin: 16px 0 24px; }
.flow .a1 { --c: var(--series-2); } .flow .a2 { --c: var(--muted); } .flow .a3 { --c: var(--accent); } .flow .a4 { --c: var(--series-3); }
.flow .lanes { display: grid; grid-template-columns: 74px repeat(7, minmax(0, 1fr)); grid-auto-rows: 64px; column-gap: 6px; padding: 8px 10px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.flow .lanes.cols-5 { grid-template-columns: 74px repeat(5, minmax(0, 1fr)); }
.flow .lanes.cols-6 { grid-template-columns: 74px repeat(6, minmax(0, 1fr)); }
.flow .lanes.cols-8 { grid-template-columns: 74px repeat(8, minmax(0, 1fr)); }
.flow .lanes.cols-9 { grid-template-columns: 74px repeat(9, minmax(0, 1fr)); }
.flow .c9 { grid-column: 10; }
.flow .r1 { grid-row: 1; } .flow .r2 { grid-row: 2; } .flow .r3 { grid-row: 3; } .flow .r4 { grid-row: 4; }
.flow .lane { grid-column: 1; align-self: center; font-size: 12.5px; font-weight: 700; color: var(--c); }
.flow .track { grid-column: 2 / -1; align-self: center; height: 0; border-top: 2px dashed var(--line); }
.flow .c1 { grid-column: 2; } .flow .c2 { grid-column: 3; } .flow .c3 { grid-column: 4; } .flow .c4 { grid-column: 5; } .flow .c5 { grid-column: 6; } .flow .c6 { grid-column: 7; } .flow .c7 { grid-column: 8; } .flow .c8 { grid-column: 9; }
.flow .cell { align-self: center; display: grid; justify-items: center; gap: 3px; padding: 6px 4px; text-align: center; font-size: 12px; line-height: 1.25; font-weight: 600;
  background: var(--panel); border: 2px solid var(--c); border-radius: 8px; color: var(--fg); position: relative; z-index: 1; }
.flow .n { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--c); color: var(--panel); font-size: 11.5px; font-weight: 700; }
.flow ol { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.flow ol li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; align-items: start; padding: 8px 10px; border-left: 4px solid var(--c); background: var(--panel); border-radius: 6px; }
.flow ol li .n { width: 22px; height: 22px; }
.flow .who { font-size: 12.5px; font-weight: 600; color: var(--c); }
.flow .how { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
@media (max-width: 640px) { .flow .lanes { display: none; } .flow ol { margin-top: 0; } }
.learn { max-width: 820px; }
.learn:has(.flow .lanes.cols-9) { max-width: 960px; } /* nine steps side by side: the reading column alone leaves each too narrow for its name */
.learn .lead { font-size: 16px; color: var(--muted); }
.learn h2 { margin-top: 24px; }
.learn li { margin: 4px 0; }
.learn .pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; padding-top: 12px; border-top: 1px solid var(--line); }
main { padding: 32px 24px 56px; max-width: 1320px; width: 100%; margin: 0 auto; display: block; }
main:focus { outline: none; } /* focused by the router so screen readers start at the page, not a control */
@media (max-width: 760px) { main { padding: 20px 16px 48px; } h1 { font-size: 24px; } }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; margin: 0 0 20px; }
@media (max-width: 560px) { .card { padding: 16px; } }
.narrow { max-width: 440px; margin: 40px auto; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row.end { justify-content: flex-end; }
form.search { flex-wrap: nowrap; margin-bottom: 16px; max-width: 720px; }
form.search input { flex: 1; min-width: 0; width: auto; }
ul.results { gap: 10px; max-width: 720px; }
ul.results li.card { padding: 14px 18px; margin: 0; }
ul.results li.card p { margin: 4px 0 0; }
.spread { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.grid2 > label { align-content: start; } /* a field with a hint next to one without: inputs keep their height */

form.stack, div.stack { display: grid; gap: 12px; }
label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
label > span { color: var(--fg); font-weight: 500; }
input, select, textarea { font: inherit; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--fg); width: 100%; min-width: 0; }
[aria-invalid='true'] { border-color: var(--bad); box-shadow: 0 0 0 1px var(--bad); } /* a field the hub refused */
.pw { position: relative; display: block; }
.pw input { padding-right: 5.5rem; }
.pw .pw-show { position: absolute; right: 12px; top: 8px; }
.pw > .warn { display: block; margin-top: 4px; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
button, .btn { font: inherit; font-weight: 600; min-height: 36px; padding: 6px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--fg); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
button:hover:not(:disabled), .btn:hover { border-color: var(--muted); }
.btn.dark { background: var(--ink); color: var(--ink-fg); border-color: var(--ink); }
button.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
button.danger { color: var(--bad); border-color: var(--bad); }
button:disabled { opacity: .55; cursor: default; }
button.link { border: 0; background: none; padding: 0; min-height: 0; font-weight: 500; color: var(--accent); text-align: left; }
.error { color: var(--bad); margin: 0; }

.table-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.table-tools input[type="search"] { max-width: 260px; }
.table-tools select { width: auto; max-width: 100%; }
.table-tools select.sort-pick { display: none; }
.list-pager { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; margin: 0 0 16px; }
.list-pager[hidden] { display: none; }
.list-pager select { width: auto; }
/* A finger, not a mouse: what is pressed in a list gets room. */
@media (pointer: coarse) { .list-pager button, .list-pager select, td button:not(.link), td .btn { min-height: 44px; } }
.dir-word { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.nowrap { white-space: nowrap; }
.audit-detail { display: inline-block; min-width: 18rem; overflow-wrap: anywhere; }
.invoice-total { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; margin: 0; }
.line-warnings { margin: 0; padding-left: 1.2rem; } .line-warnings:empty { display: none; }
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--soft); vertical-align: top; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
th { font-weight: 600; color: var(--muted); font-size: 12px; white-space: nowrap; background: var(--panel); border-bottom-color: var(--line); }
th button { all: unset; cursor: pointer; }
th button:focus-visible { outline: 2px solid var(--accent); }
/* A table that does not fit in its space is cut on the right, with nothing to say so on a touch screen: each row becomes a card, each value
   with its column's name. On a phone always; elsewhere when its columns need it, including beside a side panel (dataTable sets the class). */
.as-cards table.stacks thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.as-cards table.stacks tr { display: block; padding: 8px 0; border-bottom: 1px solid var(--line); }
.as-cards table.stacks tr:last-child { border-bottom: 0; }
.as-cards table.stacks td { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 8px; padding: 3px 14px; border: 0; text-align: left; overflow-wrap: anywhere; }
.as-cards table.stacks td::before { content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 600; padding-top: 2px; }
.as-cards table.stacks td:empty, .as-cards table.stacks td:has(> :only-child:empty) { display: none; }
.as-cards table.stacks .audit-detail { min-width: 0; }
.as-cards table.stacks td > * { justify-self: start; }
.as-cards .table-tools select.sort-pick { display: block; }
.as-cards .dir-word { position: static; width: auto; height: auto; clip-path: none; margin-left: 6px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--soft); }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--soft); color: var(--nav); white-space: nowrap; }
.pill.ok { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok-on-tint); }
.pill.warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn-on-tint); }
.pill.bad { background: var(--alert-bg); color: var(--alert-fg); }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 20px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; }
.tile b { display: block; font-size: 30px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tiles.actions { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
a.tile.action { display: grid; align-content: start; gap: 2px; color: var(--fg); text-decoration: none; border-left-width: 4px; }
a.tile.action:hover { border-color: var(--accent); background: var(--soft); }
a.tile.action.bad, a.tile.action.bad:hover { border-left-color: var(--alert); background: var(--alert-bg); border-color: var(--alert-line); } a.tile.action.warn, a.tile.action.warn:hover { border-left-color: var(--warn); } a.tile.action.ok, a.tile.action.ok:hover { border-left-color: var(--ok); }
a.tile.action[aria-current] { border-color: var(--accent); background: var(--soft); }
a.tile.action .label { font-weight: 600; }
a.tile.action .todo { color: var(--muted); font-size: 12.5px; }
h2.first { margin-top: 0; }
/* first steps of a new account */
.setup h2 { margin: 0; }
.setup h3 { font-size: 13px; margin: 16px 0 6px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
ol.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
ol.steps li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
ol.steps li p { margin: 2px 0 0; }
ol.steps li.next { border-color: var(--accent); }
ol.steps li.done b { color: var(--muted); }
ol.steps .mark { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); font-weight: 600; font-size: 13px; }
ol.steps li.done .mark { background: var(--ok); border-color: var(--ok); color: var(--panel); }
ol.steps li.next .mark { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
ol.steps .state { font-size: 12.5px; text-align: right; max-width: 220px; }
ol.steps.optional li { padding: 6px 12px; }
a.btn.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
@media (max-width: 560px) { ol.steps li { grid-template-columns: 28px minmax(0, 1fr); } ol.steps li > :last-child { grid-column: 2; justify-self: start; text-align: left; } }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 16px; margin: 0; align-items: baseline; }
.facts dt { color: var(--muted); font-size: 13px; }
.facts dd { margin: 0; }
@media (max-width: 560px) { .facts { grid-template-columns: minmax(0, 1fr); gap: 2px; } .facts dd { margin-bottom: 8px; } }
.span2 { grid-column: 1 / -1; margin: 0; }
.card.notice { border-color: var(--accent); }
.card.notice h2 { margin-top: 0; }
/* Savings: the Overview's "This month" and the month picker of the Savings page. */
.savings-summary h2 { margin: 0; }
.savings-summary .headline { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 4px 0 8px; }
.savings-summary { border-top: 4px solid var(--accent); }
.savings-summary .headline b { font-size: 40px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; color: var(--accent); font-variant-numeric: tabular-nums; }
.facts-list { margin: 0 0 8px; padding-left: 18px; display: grid; gap: 4px; }
.facts-list li.bad a { color: var(--bad); }
label.check { display: flex; align-items: center; gap: 8px; }
label.check input { width: auto; }
ul.checklist { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; }
ul.checklist label.check { align-items: flex-start; }
ul.checklist label.check input { margin-top: 3px; }
.card.inset { padding: 12px 14px; margin: 10px 0; box-shadow: none; }
/* Orders: what does not add up between an order and its ship notices and invoices. */
ul.exceptions { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
ul.exceptions > li { border-top: 1px solid var(--line); padding-top: 10px; min-width: 0; overflow-wrap: anywhere; }
ul.exceptions > li:first-child { border-top: 0; padding-top: 0; }
ul.exceptions ul { margin: 4px 0; padding-left: 18px; }
ul.exceptions select { flex: 1 1 18em; width: auto; min-width: 0; }
.month-nav { flex-wrap: nowrap; }
.month { min-width: 9em; text-align: center; white-space: nowrap; }
ul.plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.paths { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-bottom: 16px; }
.paths .card { margin: 0; }
.paths h3 { margin: 0 0 4px; font-size: 14px; }
.paths p { margin: 0 0 6px; }
details > summary { cursor: pointer; }
.only { display: inline-flex; gap: 10px; align-items: center; padding: 4px 10px; border-radius: 999px; background: var(--soft); border: 1px solid var(--line); font-size: 13px; }

#toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 10; max-width: calc(100vw - 32px); }
.toast { background: var(--ink); color: var(--ink-fg); padding: 10px 16px; border-radius: var(--radius-sm); box-shadow: 0 4px 16px rgb(0 0 0 / .2); }
.toast.bad { background: var(--bad); color: #fff; }
dialog { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--fg); padding: 18px; max-width: min(520px, calc(100vw - 32px)); }
dialog::backdrop { background: rgb(0 0 0 / .35); }
dialog.wide { width: min(900px, calc(100vw - 32px)); max-width: none; }
textarea.mono { white-space: pre; word-break: normal; overflow: auto; }
/* The text a Copy button puts on the clipboard when the clipboard API is missing: selected, never seen. */
.copy-buffer { position: fixed; top: 0; left: 0; width: 1px; height: 1px; opacity: 0; }
code, .mono, textarea.mono { font-family: var(--mono); font-size: 12.5px; word-break: break-all; }
a.mono, button.mono { word-break: normal; white-space: nowrap; } /* a control number that opens its message: one piece, never split */
.mono.whole { word-break: normal; } /* a date: breaks between its parts, never inside a number */
.card > h2:first-child { margin-top: 0; }
.table-wrap { margin-bottom: 16px; }
.ops { padding: 4px 16px; }
.op { padding: 10px 0; border-bottom: 1px solid var(--line); display: grid; gap: 2px; }
.op:last-child { border-bottom: 0; }

/* charts (Phase 13): reference palette, thin marks, recessive axes */
.chart { position: relative; background: var(--chart-surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px 12px; margin-bottom: 20px; }
.chart h3 { margin: 0 0 2px; font-size: 16px; font-weight: 700; padding-right: 4.5rem; } /* clear of the "Table" button in the corner */
.chart .sub { color: var(--muted); font-size: 12.5px; margin: 0 0 8px; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart svg:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.chart .grid { stroke: var(--chart-grid); stroke-width: 1; }
.chart .axis { stroke: var(--chart-axis); stroke-width: 1; }
.chart .tick { fill: var(--chart-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .endlabel { fill: var(--muted); font-size: 11.5px; }
.chart .cross { stroke: var(--chart-axis); stroke-width: 1; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--muted); margin: 6px 0 0; }
.legend .key { display: inline-block; width: 14px; height: 2px; border-radius: 1px; vertical-align: middle; margin-right: 6px; }
.legend .key.box { height: 10px; width: 10px; border-radius: 2px; }
.tooltip { position: absolute; pointer-events: none; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; font-size: 12.5px;
  box-shadow: 0 4px 14px rgb(0 0 0 / .15); min-width: 120px; z-index: 2; }
.tooltip .row { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.tooltip b { font-variant-numeric: tabular-nums; }
.chart-tools { position: absolute; top: 10px; right: 12px; }
.chart-footer { margin: 8px 0 0; font-size: 13px; }
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
@media (max-width: 760px) { .chart-grid { grid-template-columns: minmax(0, 1fr); } }

/* scorecards */
.scores { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-bottom: 16px; }
.score { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; display: grid; gap: 4px; }
.score .label { font-size: 13px; color: var(--muted); }
.score .value { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; }
.score .meta { font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.status { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--fg); }
.status i { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; font-style: normal; font-size: 11px; color: #fff; }
.status.ok i { background: var(--status-good); } .status.warn i { background: var(--status-warning); color: #0b0b0b; } .status.bad i { background: var(--status-critical); }
.status.none i { background: var(--chart-axis); color: var(--fg); }
.delta.good { color: var(--delta-good); } .delta.bad { color: var(--bad); }

/* Sea lanes (views/lanes.ts): a line per route, a mark per container placed along the voyage. */
.lanes .legend { align-items: center; gap: 6px 16px; margin: 0; }
.lanes .legend > span { display: inline-flex; align-items: center; gap: 6px; }
.lanes .legend .mark { position: static; transform: none; }
.lane-list { overflow-x: auto; margin: 4px 0 0; }
a.lane { display: grid; grid-template-columns: minmax(120px, 180px) minmax(260px, 1fr) minmax(120px, 180px) 56px; align-items: center; gap: 16px; padding: 14px 8px;
  border-top: 1px solid var(--soft); color: var(--fg); text-decoration: none; min-width: 680px; border-radius: 10px; }
a.lane:hover, a.lane[aria-current] { background: var(--soft); }
/* On a phone or an upright tablet: origin, destination and count on one line, the voyage under them, all without scrolling sideways. */
@media (max-width: 800px) {
  a.lane { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px 12px; min-width: 0; }
  a.lane .track { grid-column: 1 / -1; grid-row: 2; }
}
a.lane .port { display: flex; flex-direction: column; min-width: 0; }
a.lane .port b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.lane .port.to { text-align: right; }
a.lane .count { text-align: right; font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.lane .track { position: relative; height: 24px; }
.lane .track::before { content: ""; position: absolute; left: 0; right: 0; top: 11px; border-top: 2px dashed var(--track); }
.lane .track::after { content: ""; position: absolute; right: -2px; top: 7px; width: 10px; height: 10px; border-radius: 2px; background: var(--ink); }
.lane .track { background: radial-gradient(circle at 5px 12px, var(--ink) 4.5px, transparent 5px) no-repeat; } /* the port of origin */
.lane .track > .mark { top: 50%; }
.lanes .mark { position: absolute; width: 14px; height: 14px; border-radius: 50%; transform: translate(-50%, -50%); background: var(--accent); border: 2px solid var(--panel); display: inline-block; z-index: 1; }
.lanes .mark.warn { background: var(--panel); border: 3px solid var(--amber); }
.lanes .mark.bad { background: var(--alert); border-radius: 3px; }
.banner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 12px; padding: 12px 16px; border-radius: 14px; background: var(--alert-bg); color: var(--alert-fg); }
.banner > span { flex: 1 1 300px; }
/* With several customers the switch can be long: on a phone the tools wrap and it keeps to the screen. */
@media (max-width: 760px) { .top .tools { flex-wrap: wrap; max-width: 100%; } #tenant { max-width: 100%; } #tenant select { max-width: 100%; } }
/* A support visit, or a test customer: said on every page, so nobody takes it for the real thing. */
#notices { max-width: var(--page, 1280px); margin: 0 auto; padding: 0 24px; }
#notices:empty { display: none; }
.banner.calm { background: var(--accent-soft); color: var(--fg); }
.banner.calm a { color: var(--accent); }
@media (max-width: 760px) { #notices { padding: 0 16px; } }

/* Today (views/dashboard.ts): greeting and chips, the order cycle beside the savings card, lanes, compliance and activity. */
.hero { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 24px; }
.hero > div:first-child { flex: 1 1 420px; }
.hero p { margin: 0; }
.hero h1 { margin: 6px 0 0; font-size: 36px; }
.hero .chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line);
  color: var(--fg); font-weight: 600; font-size: 13px; text-decoration: none; }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.chip.alert { background: var(--alert-bg); border-color: var(--alert-line); color: var(--alert-fg); }
.chip.alert .dot { background: var(--alert); }
.today .card h2 { margin: 0; }
.today .card p { margin: 2px 0 0; }
.today #attention { margin-bottom: 8px; }
.today #attention h2 { margin-top: 0; }
a.strong { font-weight: 600; text-decoration: none; }
.grid-hero, .grid-two { display: grid; gap: 20px; margin-bottom: 20px; }
.grid-hero { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }
.grid-two { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.grid-hero > .card, .grid-two > .card { margin: 0; min-width: 0; }
@media (max-width: 900px) { .grid-hero { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 420px) { .grid-two { grid-template-columns: minmax(0, 1fr); } .hero h1 { font-size: 28px; } }
.cycle ol { list-style: none; margin: 20px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 16px 12px; }
.cycle li { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.cycle .rail { display: flex; align-items: center; gap: 6px; width: 100%; }
.cycle .rail .dot { flex: none; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); }
.cycle .s1 .dot { opacity: .82; } .cycle .s2 .dot { opacity: .66; } .cycle .s3 .dot { opacity: .5; }
.cycle .rail .line { flex: 1; height: 3px; border-radius: 2px; background: var(--accent-soft); }
.cycle .mono { font-size: 11.5px; }
.cycle .n { font-size: 34px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.cycle .label { font-weight: 600; }
.cycle .stuck { font-size: 12.5px; font-weight: 600; color: var(--alert-fg); background: var(--alert-bg); padding: 3px 10px; border-radius: 999px; text-decoration: none; }
.card.accent { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); display: flex; flex-direction: column; gap: 12px; }
.card.accent h2 { font-size: 15px; font-weight: 600; opacity: .85; }
.card.accent .big { font-size: 44px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.card.accent ul { margin: 0; padding: 0 0 0 18px; display: grid; gap: 4px; font-size: 13px; opacity: .92; }
.card.accent a { color: var(--accent-fg); font-weight: 700; margin-top: auto; }
.bars .bar { display: grid; grid-template-columns: minmax(80px, 140px) 1fr 48px; align-items: center; gap: 12px; margin: 14px 0 0; }
.bars .name { font-weight: 600; color: inherit; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars a.name:hover, .bars a.name:focus-visible { text-decoration: underline; }
.bars .track { height: 10px; border-radius: 5px; background: var(--soft); overflow: hidden; }
.bars .fill { display: block; height: 100%; border-radius: 5px; background: var(--accent); }
.bars .fill.mid { background: var(--muted); } .bars .fill.bad { background: var(--alert); }
.bars .mono { text-align: right; font-size: 13px; }
.bars > p:last-child { margin-top: 14px; }
.feed ul { list-style: none; margin: 10px 0 0; padding: 0; }
.feed li { border-top: 1px solid var(--soft); }
.feed li > a { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 0; color: inherit; text-decoration: none; }
.feed li > a:hover b, .feed li > a:focus-visible b { text-decoration: underline; }
.feed .code { justify-self: start; font-family: var(--mono); font-size: 11.5px; font-weight: 500; padding: 3px 8px; border-radius: 6px; background: var(--soft); color: var(--nav); }
.feed .code.in { background: var(--accent-soft); color: var(--accent); }
.feed .code.out { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.feed .code.bad { background: var(--alert-bg); color: var(--alert-fg); }

/* Page layout shared by every page: the head, big filter tabs, the list beside its detail. */
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 24px; }
.page-head > div:first-child { flex: 1 1 360px; }
.page-head p { margin: 0; }
.page-head h1 { margin: 4px 0 0; font-size: 34px; }
.page-head .tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.page-head .kpi { display: flex; flex-direction: column; padding: 10px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; min-width: 150px; }
.page-head .kpi span { font-size: 12.5px; color: var(--muted); }
.page-head .kpi b { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.funnel, .tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 0 0 20px; }
.funnel .stage, .funnel .stage.first, .tabs .tab { clip-path: none; display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 16px; color: var(--fg); text-decoration: none; }
.tabs .tab .mono { font-size: 11.5px; color: var(--muted); }
.tabs .tab b, .funnel .stage b { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tabs .tab > span:last-child, .funnel .stage span { font-size: 13px; color: var(--muted); font-weight: 600; }
.funnel a.stage:hover, .tabs a.tab:hover { border-color: var(--muted); background: var(--panel); }
.funnel a.stage[aria-current], .tabs a.tab[aria-current] { background: var(--ink); border-color: var(--ink); color: var(--ink-fg); }
.funnel a.stage[aria-current] span, .tabs a.tab[aria-current] span, .tabs a.tab[aria-current] .mono { color: var(--ink-fg); opacity: .85; }
.tabs .tab.bad b, .funnel .stage.bad b { color: var(--alert); } .tabs .tab.warn b, .funnel .stage.warn b { color: var(--warn); }
.funnel a.stage[aria-current] b, .tabs a.tab[aria-current] b { color: var(--ink-fg); }
@media (max-width: 760px) { .funnel, .funnel.cols-6, .tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); } .funnel .stage, .funnel .stage.first { padding: 10px 12px; } }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; margin-bottom: 20px; }
.split > .side { position: sticky; top: 16px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }
.split > .side > * { margin: 0; }
.split > .side .card h2 { margin: 0 0 6px; }
@media (max-width: 1100px) { .split { grid-template-columns: minmax(0, 1fr); } .split > .side { position: static; } }
.split .to-list { display: none; justify-self: start; }
@media (max-width: 1100px) { .split .to-list { display: inline-flex; } }
.split .side:has(.hint) .to-list, .split .side:has(> .to-list + :empty) .to-list { display: none !important; } /* nothing picked yet */
.card.hint { border-style: dashed; background: transparent; }
/* In the narrow detail panel a step wraps: mark and text on one line, its state or action below the text. */
.side ol.steps li { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px 12px; }
.side ol.steps li > .mark { flex: none; }
.side ol.steps li > div { flex: 1 1 0; min-width: 0; }
.side ol.steps li > :last-child:not(div) { flex-basis: 100%; margin-left: 40px; max-width: none; text-align: left; }
/* Customs: a declaration per card, with its steps to the release. */
.decls { display: grid; gap: 12px; }
.decl { margin: 0; display: grid; gap: 14px; border-left: 4px solid var(--line); }
.decl.bad { border-left-color: var(--alert); } .decl.warn { border-left-color: var(--amber); }
.decl .spread { margin: 0; }
.decl ol.track { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.decl ol.track li { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); font-weight: 600; padding-top: 10px; border-top: 3px solid var(--soft); }
.decl ol.track li .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line); flex: none; }
.decl ol.track li.done { color: var(--fg); border-top-color: var(--accent); } .decl ol.track li.done .dot { background: var(--accent); }
.decl ol.track li.now { color: var(--alert-fg); border-top-color: var(--alert); } .decl ol.track li.now .dot { background: var(--alert); }
.decl ol.track li.bad { color: var(--bad); border-top-color: var(--bad); } .decl ol.track li.bad .dot { background: var(--bad); }
@media (max-width: 560px) { .decl ol.track { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Partners: a card per partner. */
.chips.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip[aria-current] { background: var(--ink); color: var(--ink-fg); border-color: var(--ink); }
.partners { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-bottom: 20px; }
.partner { margin: 0; display: grid; gap: 12px; align-content: start; }
.partner .who { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.partner .who > span:nth-child(2) { display: flex; flex-direction: column; min-width: 0; }
.partner .avatar { width: 40px; height: 40px; font-size: 16px; }
.partner .bars .bar { margin: 0; grid-template-columns: minmax(80px, 150px) 1fr 44px; }
.pill.mono { font-family: var(--mono); font-weight: 500; }
/* Messages: direction arrows and the document in the side panel. */
.dir { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-weight: 700; }
.dir.in { background: var(--accent-soft); color: var(--accent); } .dir.out { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
pre.raw.code { word-break: normal; white-space: pre; font-variant-ligatures: none; font-feature-settings: "liga" 0, "calt" 0; } /* => and === as typed */
.row button[aria-pressed="true"] { background: var(--ink); color: var(--ink-fg); }
pre.raw { margin: 12px 0 0; max-height: 420px; overflow: auto; padding: 12px 14px; border-radius: 12px; background: var(--soft); white-space: pre-wrap; word-break: break-all; font-size: 12px; }
/* Savings: the month's numbers, then where they come from. */
.tiles.kpis { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.tiles.kpis .tile { display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; padding: 20px 22px; border-radius: var(--radius); }
.tiles.kpis .tile b { font-size: 40px; }
.tile.accent { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.tile.accent b.ok, .tile.accent span { color: var(--accent-fg); }
.sources { display: grid; gap: 16px; align-content: start; }
.source { display: grid; gap: 6px; }
.source .spread { margin: 0; }
.source .track { height: 8px; border-radius: 4px; background: var(--soft); overflow: hidden; }
.source .fill { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.source .fill.bad { background: var(--alert); }
.today .setup > p.muted { margin: 4px 0 14px; }

/* The pick list of an order (src/portal/app/views/send-doc.ts): on paper, nothing else of the page. */
.print-sheet { display: none; }
@media print {
  body.printing > :not(.print-sheet) { display: none !important; }
  body.printing { background: #fff; color: #000; }
  body.printing .print-sheet { display: block; font-size: 12pt; }
  .print-sheet table { width: 100%; border-collapse: collapse; margin-top: 12pt; }
  .print-sheet th, .print-sheet td { border: 1px solid #999; padding: 4pt 6pt; text-align: left; }
  .print-sheet .num { text-align: right; } .print-sheet .tick { text-align: center; font-size: 14pt; }
}

/* Asked of the system by someone for whom motion is a problem: nothing slides or fades. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* On a phone a partner's score keeps its whole name: two lines rather than "Avisos de envío a tie…". */
@media (max-width: 560px) {
  .bars .name { white-space: normal; overflow: visible; text-overflow: clip; }
}

/* Connection tests: a result lines up with the rest of its row. */
.link-result p { margin: 0; }

/* A field only a robot fills: out of sight, not display:none, which some of them skip. */
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
/* The sign-in: the form beside the technical sheet. The front page (landing.ts) says what it is worth; this says what it is made of. */
.entry { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 56px; align-items: start; }
.entry-side { position: sticky; top: 24px; }
.signin { margin: 0 0 14px; padding: 28px; }
.signin h2 { margin-top: 0; font-size: 22px; }
.sheet-head { padding: 32px; border-radius: var(--radius); color: #fff; background: radial-gradient(circle at 92% 8%, rgb(47 69 214 / 0.6), transparent 55%), #0b1524; }
.sheet-eyebrow { margin: 0 0 8px; font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #aebdff; }
.sheet h1 { font-size: clamp(30px, 3.6vw, 46px); letter-spacing: -0.04em; margin: 0 0 8px; color: #fff; }
.sheet-lead { margin: 0; font-size: 16px; color: #cfd8e8; }
.sheet-specs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 28px 0 0; padding-top: 20px; border-top: 1px solid rgb(255 255 255 / 0.18); }
.sheet-specs div { display: flex; flex-direction: column-reverse; justify-content: flex-end; }
.sheet-specs dd { margin: 0; font-size: clamp(30px, 3.4vw, 44px); line-height: 1; font-weight: 800; letter-spacing: -0.03em; }
.sheet-specs dt { margin-top: 6px; font-size: 12.5px; line-height: 1.3; color: #cfd8e8; }
.dataflow { list-style: none; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; margin: 16px 0 32px; padding: 0; }
.dataflow li { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 14px 18px 14px 14px; background: var(--panel); border: 1px solid var(--line); border-left-width: 0; }
.dataflow li:first-child { border-left-width: 1px; border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.dataflow li:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.dataflow li:not(:last-child)::after { content: ""; position: absolute; z-index: 1; top: 50%; right: -6px; width: 10px; height: 10px; border-top: 2px solid var(--accent); border-right: 2px solid var(--accent); background: var(--panel); transform: translateY(-50%) rotate(45deg); }
.dataflow strong { font-size: 13px; line-height: 1.25; }
.dataflow span { font-size: 11.5px; line-height: 1.3; color: var(--muted); }
.dataflow .us { color: #fff; background: var(--accent); border-color: var(--accent); }
.dataflow .us span { color: #dbe1ff; }
.dataflow .us::after { background: var(--accent); border-color: #fff; }
.sheet-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.sheet-grid article { padding: 24px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.sheet-grid .icon { display: block; width: 38px; height: 38px; padding: 8px; margin-bottom: 12px; border-radius: 11px; background: var(--accent-soft); }
.sheet-grid .icon path { fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sheet-grid h2 { margin: 0 0 4px; font-size: 17px; }
.sheet-grid p { margin: 0 0 14px; }
.sheet-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 5px; margin: 0 0 14px; padding: 0; }
.sheet-chips li { padding: 2px 8px; border-radius: 6px; font: 600 11.5px/1.5 var(--mono); color: var(--accent); background: var(--accent-soft); }
.sheet-facts { margin: 0; padding-left: 16px; font-size: 13.5px; }
.sheet-facts li { margin-top: 5px; }
.sheet-facts li::marker { color: var(--accent); }
@media (max-width: 960px) {
  .entry { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .entry-side { position: static; }
}
@media (max-width: 1180px) {
  .dataflow { grid-template-columns: minmax(0, 1fr); }
  .dataflow li, .dataflow li:first-child, .dataflow li:last-child { flex-direction: row; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; border-width: 1px; border-top-width: 0; border-radius: 0; }
  .dataflow li:first-child { border-top-width: 1px; border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
  .dataflow li:last-child { border-radius: 0 0 var(--radius-sm) var(--radius-sm); }
  .dataflow li:not(:last-child)::after { top: auto; bottom: -6px; right: 50%; transform: rotate(135deg); }
}
@media (max-width: 640px) {
  .sheet-grid { grid-template-columns: minmax(0, 1fr); }
  .sheet-head { padding: 24px; }
  .sheet-specs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Billing (views/billing.ts): what is due and the button that pays it, then what to transfer, every line on the same columns. */
.pay-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 320px); gap: 20px 32px; align-items: center; border-top: 4px solid var(--accent); }
.pay-hero.calm { grid-template-columns: minmax(0, 1fr); border-top-color: var(--ok); }
.pay-hero h2 { margin: 4px 0; }
.pay-summary, .pay-action { display: grid; gap: 6px; min-width: 0; }
.pay-summary p, .pay-action p { margin: 0; }
.pay-action { justify-items: stretch; text-align: center; }
.pay-eyebrow { font-size: 12.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.pay-amount { font-size: 44px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; font-variant-numeric: tabular-nums; }
button.pay-button { justify-content: center; width: 100%; min-height: 56px; padding: 12px 24px; font-size: 17px; font-weight: 700; box-shadow: 0 6px 18px rgb(47 69 214 / 0.3); }
button.pay-button:hover:not(:disabled) { filter: brightness(1.08); border-color: var(--accent); }
.pay-lines { list-style: none; margin: 4px 0 0; padding: 0; max-width: 420px; display: grid; gap: 2px; font-size: 13px; color: var(--muted); }
.pay-lines li { display: flex; justify-content: space-between; gap: 16px; }
.pay-lines b { font-weight: 600; color: var(--fg); font-variant-numeric: tabular-nums; }
.pay-panel, .pay-hero > .banner { grid-column: 1 / -1; margin: 0; }
.pay-panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 16px 32px; padding-top: 20px; border-top: 1px solid var(--line); }
.pay-transfer, .pay-where { display: grid; gap: 8px; align-content: start; min-width: 0; }
.pay-transfer p, .pay-instructions { margin: 0; }
.pay-value { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--accent-soft); }
.pay-value b { flex: 1 1 auto; font-size: 28px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; color: var(--accent); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.pay-instructions { white-space: pre-line; overflow-wrap: anywhere; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.pay-fields { display: grid; grid-template-columns: max-content minmax(0, 1fr) auto; margin: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.pay-fields > * { display: flex; align-items: center; min-height: 48px; margin: 0; padding: 6px 14px; border-top: 1px solid var(--soft); }
.pay-fields > :nth-child(-n+3) { border-top: 0; }
.pay-fields dt { color: var(--muted); font-size: 13px; }
.pay-fields dd { font-family: var(--mono); font-size: 14px; font-weight: 500; overflow-wrap: anywhere; min-width: 0; }
.pay-field-copy { justify-content: flex-end; padding-left: 0; }
button.pay-copy { min-height: 32px; padding: 3px 12px; font-size: 12.5px; }
.pay-notes { grid-column: 1 / -1; margin: 0; padding-left: 18px; display: grid; gap: 2px; font-size: 13px; color: var(--muted); }
.pay-detail summary { color: var(--accent); white-space: nowrap; }
.pay-detail .pay-lines { min-width: 200px; }
.collect-dialog { width: min(480px, calc(100vw - 32px)); }
.collect-dialog h2 { margin: 0; }
@media (max-width: 760px) {
  .pay-hero, .pay-panel { grid-template-columns: minmax(0, 1fr); }
  .pay-amount { font-size: 36px; }
}
@media (max-width: 560px) {
  .pay-fields { grid-template-columns: minmax(0, 1fr) auto; }
  .pay-fields dt { grid-column: 1 / -1; min-height: 0; padding-bottom: 0; border-top: 1px solid var(--soft); }
  .pay-fields > :nth-child(-n+3) { border-top: 0; }
  .pay-fields > :nth-child(n+4):nth-child(3n+1) { border-top: 1px solid var(--soft); }
  .pay-fields dd, .pay-field-copy { border-top: 0; min-height: 40px; padding-top: 0; }
}
/* On a phone a row's buttons get the whole width, side by side, so a long list stays short. */
.collect-list .as-cards table.stacks td:not([data-label]), .collect-list .as-cards table.stacks td[data-label=""] { grid-template-columns: minmax(0, 1fr); }
.collect-list .as-cards table.stacks td:not([data-label])::before, .collect-list .as-cards table.stacks td[data-label=""]::before { display: none; }
/* With Billing the menu has one more pill: at these widths they close up, so the account stays on the same row. */
@media (min-width: 761px) and (max-width: 1400px) { #nav a { padding: 0 7px; font-size: 13.5px; } .top .bar { column-gap: 12px; } }
