/* Self-hosted variable fonts (latin, SIL OFL) — see fonts/README.md. */
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('/fonts/inter-latin-wght-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Instrument Sans'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url('/fonts/instrument-sans-latin-wght-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Sans'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('/fonts/dm-sans-latin-wght-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Space Grotesk'; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url('/fonts/space-grotesk-latin-wght-normal.woff2') format('woff2');
}

:root {
  --bg: #F1F4F6; --surface: #FFFFFF; --surface-2: #F8FAFB;
  --ink: #1A2530; --muted: #5E6C79; --faint: #8A97A3;
  --border: #E1E7EC; --border-strong: #CDD6DD;
  --accent: #235C73; --accent-strong: #1E4E62; --accent-ink: #FFFFFF; --accent-soft: #E2EDF0;
  --good: #2C7A56; --good-soft: #E2F0E8;
  --warn: #9C6B15; --warn-soft: #F6EAD5;
  --crit: #A83A38; --crit-soft: #F5E2E0;
  --track: #E9EEF1;
  --shadow: 0 1px 2px rgba(20,35,48,.05), 0 1px 3px rgba(20,35,48,.04);
  /* Chart fills. The status colours above are TEXT roles: a green tuned to be
     read at 12px turns oppressive as a big solid bar, which is why the charts
     used to look wrong. These say what a fill MEANS, not which hue it is -
     mark = raised/outstanding/still owed you, ink = settled/real/done,
     mute and dim = inert. Written once: each resolves through whichever brand
     preset is active, so no preset repeats them.
     --chart-ink is the full ink deliberately. The obvious pick, --muted, sits
     at almost exactly the accent's luminance (1.01:1), so a two-series chart
     would collapse to one flat tone in greyscale or for a colourblind reader;
     against the ink the accent is 1.88:1. */
  --chart-mark: var(--accent); --chart-ink: var(--ink);
  --chart-mute: var(--border-strong); --chart-dim: var(--faint);
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
  --display: var(--sans);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10151A; --surface: #19212A; --surface-2: #1F2831;
    --ink: #E6ECF1; --muted: #9EABB6; --faint: #6B7885;
    --border: #29333D; --border-strong: #384552;
    --accent: #64AAC1; --accent-strong: #73C4DE; --accent-ink: #0B1418; --accent-soft: #1C3641;
    --good: #5DBE8A; --good-soft: #16301F;
    --warn: #D19B44; --warn-soft: #3A2C12;
    --crit: #D77471; --crit-soft: #3A211F;
    --track: #263039; --shadow: 0 1px 2px rgba(0,0,0,.3);
  }
}
:root[data-theme="light"] {
  --bg: #F1F4F6; --surface: #FFFFFF; --surface-2: #F8FAFB;
  --ink: #1A2530; --muted: #5E6C79; --faint: #8A97A3;
  --border: #E1E7EC; --border-strong: #CDD6DD;
  --accent: #235C73; --accent-strong: #1E4E62; --accent-ink: #FFFFFF; --accent-soft: #E2EDF0;
  --good: #2C7A56; --good-soft: #E2F0E8; --warn: #9C6B15; --warn-soft: #F6EAD5;
  --crit: #A83A38; --crit-soft: #F5E2E0; --track: #E9EEF1;
  --shadow: 0 1px 2px rgba(20,35,48,.05), 0 1px 3px rgba(20,35,48,.04);
}
:root[data-theme="dark"] {
  --bg: #10151A; --surface: #19212A; --surface-2: #1F2831;
  --ink: #E6ECF1; --muted: #9EABB6; --faint: #6B7885;
  --border: #29333D; --border-strong: #384552;
  --accent: #64AAC1; --accent-strong: #73C4DE; --accent-ink: #0B1418; --accent-soft: #1C3641;
  --good: #5DBE8A; --good-soft: #16301F; --warn: #D19B44; --warn-soft: #3A2C12;
  --crit: #D77471; --crit-soft: #3A211F; --track: #263039; --shadow: 0 1px 2px rgba(0,0,0,.3);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* brand: the practice logo, or a name wordmark. The bundled black dzp mark is
   inverted on dark grounds; uploaded colour logos are left untouched. */
.brand { display: flex; align-items: center; gap: 11px; }
.logo { height: 24px; width: auto; display: block; max-width: 170px; object-fit: contain; }
.authcard .logo { height: 28px; }
.logotext { font-family: var(--display); font-weight: 600; font-size: 18px; letter-spacing: -.02em; color: var(--ink); }
.brand .ctx { color: var(--muted); font-size: 13px; font-weight: 600; font-family: var(--display);
  display: inline-flex; align-items: center; gap: 5px; letter-spacing: -.01em; }
@media (prefers-color-scheme: dark) { .logo--invert { filter: invert(1); } }
:root[data-theme="dark"] .logo--invert { filter: invert(1); }
:root[data-theme="light"] .logo--invert { filter: none; }

/* titleblock, the product's own identity. Pre-auth it is the only brand on the
   page, so it keeps its own Redline colours and its own dark ramp rather than
   borrowing the tenant's theme - a practice signing in should meet the product,
   not somebody else's palette. Beside a practice logo it drops to the mono mark
   at currentColor and recedes into --muted. */
.tb-lockup { height: 26px; width: auto; display: block; --tb-ink: #2F3E46; --tb-cell: #C8102E; }
.authcard .tb-lockup { height: 34px; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tb-lockup { --tb-ink: #E9EBE7; --tb-cell: #F25E67; }
}
:root[data-theme="dark"] .tb-lockup { --tb-ink: #E9EBE7; --tb-cell: #F25E67; }
:root[data-theme="light"] .tb-lockup { --tb-ink: #2F3E46; --tb-cell: #C8102E; }
.tb-mark { width: 13px; height: 13px; flex: none; display: block; }

h1, h2, h3, .tile .val { font-family: var(--display); }

/* ---------- auth (login / set-password) ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.authcard { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: var(--shadow); padding: 30px 28px; display: flex; flex-direction: column; gap: 18px; }
.authcard .brand { display: flex; align-items: center; gap: 12px; }
.authcard .mark { width: 40px; height: 40px; } .authcard .mark span { font-size: 17px; }
.authcard h1 { margin: 0; font-size: 18px; font-weight: 640; }
.authcard .brand p { margin: 1px 0 0; color: var(--muted); font-size: 12.5px; }
.authcard h2 { margin: 0; font-size: 16px; font-weight: 620; }
.authcard .lead { margin: -6px 0 0; color: var(--muted); font-size: 13.5px; }
form { display: flex; flex-direction: column; gap: 13px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
input { font: inherit; color: var(--ink); background: var(--surface-2); border: 1px solid var(--border-strong);
  border-radius: 9px; padding: 10px 12px; width: 100%; }
input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
button { font: inherit; font-weight: 600; cursor: pointer; border: 1px solid transparent; border-radius: 9px;
  padding: 10px 14px; background: var(--accent); color: var(--accent-ink); }
button:hover:not(:disabled) { background: var(--accent-strong); }
button:disabled { opacity: .6; cursor: default; }
button.ghost { background: transparent; color: var(--muted); border-color: var(--border-strong); }
button.ghost:hover { color: var(--ink); background: var(--surface-2); filter: none; }
.hint { color: var(--faint); font-size: 12px; }
.hint code { font-family: var(--mono); color: var(--muted); }
.msg { font-size: 13px; padding: 9px 11px; border-radius: 8px; display: none; }
.msg.err { display: block; color: var(--crit); background: var(--crit-soft); }
.msg.ok  { display: block; color: var(--good); background: var(--good-soft); }

/* ---------- dashboard ---------- */
.wrap { padding: clamp(16px, 3vw, 34px); }
.shell { max-width: 1080px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
header.top { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
  padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.top .brand { display: flex; align-items: center; gap: 13px; }
.top .mark { width: 40px; height: 40px; } .top .mark span { font-size: 17px; }
.top h1 { margin: 0; font-size: 20px; font-weight: 640; letter-spacing: -.2px; }
.top .brand p { margin: 1px 0 0; color: var(--muted); font-size: 13px; }
.top .right { display: flex; align-items: center; gap: 14px; }
.who { text-align: right; font-size: 13px; color: var(--muted); }
.who strong { display: block; color: var(--ink); font-size: 14px; font-weight: 600; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 15px 16px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 7px; position: relative; overflow: hidden; }
.tile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--edge, var(--border-strong)); }
.tile .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); font-weight: 600; }
.tile .val { font-size: 27px; font-weight: 650; letter-spacing: -.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tile .sub { font-size: 12.5px; color: var(--muted); }
.tile.warn { --edge: var(--warn); } .tile.good { --edge: var(--good); } .tile.acc { --edge: var(--accent); }
.tile.crit { --edge: var(--crit); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.card > .head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  padding: 15px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card h2 { margin: 0; font-size: 15px; font-weight: 620; letter-spacing: -.1px; }
.card .head .note { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cols { display: grid; grid-template-columns: 1.35fr 1fr; gap: 20px; align-items: start; }

.proj { padding: 15px 18px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.proj:last-child { border-bottom: 0; }
.proj .prow { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ref { font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--accent); }
.proj .client { color: var(--muted); font-size: 13px; }
.agreed { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--muted); }
.agreed b { color: var(--ink); font-weight: 640; }
.bar { display: flex; height: 10px; border-radius: 6px; overflow: hidden; background: var(--track); }
.bar i { display: block; height: 100%; }
.seg-paid { background: var(--chart-ink); } .seg-out { background: var(--chart-mark); } .seg-un { background: transparent; }
.figs { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12.5px; }
.figs div { font-variant-numeric: tabular-nums; }
.figs .k { color: var(--muted); }
.figs .k::before { content: ""; width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-right: 5px; vertical-align: -1px; background: var(--dot, var(--faint)); }
.figs b { font-weight: 640; }
.dot-paid { --dot: var(--chart-ink); } .dot-out { --dot: var(--chart-mark); } .dot-un { --dot: var(--chart-mute); }

.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 600; text-transform: capitalize; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.pill.active { color: var(--accent); background: var(--accent-soft); }
.pill.on_hold { color: var(--muted); background: var(--track); }
.pill.part_paid { color: var(--warn); background: var(--warn-soft); }
.pill.issued { color: var(--accent); background: var(--accent-soft); }
.pill.overdue { color: var(--crit); background: var(--crit-soft); }
.pill.paid { color: var(--good); background: var(--good-soft); }
/* Cancelled by a credit note: closed, but nothing was received and nothing is
   owed. Neither good (money in) nor critical (money late) - inert, like on_hold. */
.pill.credited { color: var(--muted); background: var(--track); }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.scroll { overflow-x: auto; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint);
  font-weight: 600; padding: 11px 18px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 12px 18px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
/* nowrap: a money cell must never break. Negative amounts are written -£300.00,
   and a hyphen is a legal break opportunity, so a narrow column would leave the
   minus sign stranded on its own line above the figure - which reads as a dash
   placeholder and hides the fact that the amount is a deduction. */
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--muted); } .strong { font-weight: 640; } .tiny { font-size: 12px; }
.empty { padding: 22px 18px; color: var(--muted); font-size: 13.5px; }

.vat .block { padding: 14px 18px; border-bottom: 1px solid var(--border); }
.vat .block:last-child { border-bottom: 0; }
.vat .cap { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); font-weight: 600; margin-bottom: 9px; }
.qrow { display: flex; justify-content: space-between; align-items: baseline; padding: 5px 0; font-variant-numeric: tabular-nums; font-size: 13.5px; }
.qrow .q { color: var(--muted); font-family: var(--mono); font-size: 12px; }
.qrow .amt b { font-weight: 640; } .qrow .amt span { color: var(--faint); font-size: 12px; margin-left: 7px; }

footer.foot { color: var(--faint); font-size: 12px; text-align: center; padding-top: 4px; }
footer.foot code { font-family: var(--mono); color: var(--muted); }

/* ---------- nav + workflow screens ---------- */
.nav { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-top: -4px; flex-wrap: wrap; }
.navlink { padding: 9px 14px; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; user-select: none; }
.navlink:hover { color: var(--ink); }
.navlink.on { color: var(--accent); border-bottom-color: var(--accent); }

.viewhead { display: flex; align-items: center; gap: 12px; }
.viewhead h2 { margin: 0; font-size: 18px; font-weight: 640; }
.viewhead .back { color: var(--muted); font-size: 13px; cursor: pointer; text-decoration: none; }
.viewhead .back:hover { color: var(--ink); }
.viewhead .spacer { flex: 1; }

.card.pad { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.card.pad h3 { margin: 0; font-size: 15px; font-weight: 620; }
.cardfoot { padding: 14px 18px; border-top: 1px solid var(--border); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }

button.btn-sm { padding: 6px 10px; font-size: 13px; }
/* a button that reads as a link — for an action offered inside a field's label,
   where a real button would outweigh the field it belongs to */
button.linkish { background: none; border: 0; padding: 0 0 0 6px; font-size: 12px;
  font-weight: 600; color: var(--accent); cursor: pointer; }
button.linkish:hover { text-decoration: underline; background: none; }
/* an inline mini-form nested inside another form (new client on the quote page).
   Tinted and ruled so it reads as a detour from the form around it, not as more
   of the same fields. */
.subform { background: var(--surface-2); border: 1px solid var(--border);
  border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0;
  padding: 13px 14px; display: grid; gap: 11px; margin: 2px 0 4px; }
/* `display: grid` above beats the browser's own [hidden] { display: none },
   which is why the panel stayed on screen while its .hidden property read true.
   Any display rule on a class needs this partner, or `hidden` silently does
   nothing. */
.subform[hidden] { display: none; }
/* label text on the left, an action on the right, sharing one line — without
   this the action becomes its own flex row (label is a column) and pushes the
   input down, so a field with an action no longer lines up with the one beside
   it. */
.labelrow { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }

/* field help: a "?" beside a label, and the bubble it opens */
button.help { width: 15px; height: 15px; padding: 0; margin-left: 5px; flex: none;
  border-radius: 50%; border: 1px solid var(--border-strong); background: var(--surface-2);
  color: var(--muted); font-size: 10px; font-weight: 700; line-height: 1; cursor: pointer;
  vertical-align: 1px; }
button.help:hover, button.help[aria-expanded="true"] { background: var(--accent); color: var(--accent-ink);
  border-color: var(--accent); }
button.help:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* fixed, not absolute: .card sets overflow:hidden and would crop it. Placed
   from the button's rect when opened. */
.helpbubble { position: fixed; z-index: 60; max-width: 270px; padding: 9px 11px;
  background: var(--ink); color: var(--surface); border-radius: 8px;
  font-size: 12.5px; font-weight: 400; line-height: 1.45; letter-spacing: 0;
  box-shadow: 0 6px 20px rgba(0,0,0,.22); }
/* the class sets display, so [hidden] needs saying explicitly or it does nothing */
.helpbubble[hidden] { display: none; }
button.danger { background: var(--crit); color: #fff; }
button.ghost.danger { background: transparent; color: var(--crit); border-color: var(--crit); }

select { font: inherit; color: var(--ink); background: var(--surface-2); border: 1px solid var(--border-strong);
  border-radius: 9px; padding: 10px 12px; width: 100%; }
select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }

.formrow { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.lines-hd, .lineitem { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 10px; align-items: center; }
.lines-hd { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); font-weight: 600; padding: 0 2px; }
.lineitem { margin-bottom: 8px; }

.kv { display: flex; gap: 30px; flex-wrap: wrap; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.kv > div { display: flex; flex-direction: column; gap: 3px; }
.kv span { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); font-weight: 600; }
.kv b { font-size: 15px; font-variant-numeric: tabular-nums; }
.kv b.big { font-size: 19px; font-weight: 650; }

/* timesheet grid */
.timebar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.timebar .wk { font-weight: 620; min-width: 150px; text-align: center; }
.timegrid td, .timegrid th { padding: 7px 8px; }
.timegrid input { width: 54px; text-align: right; padding: 6px 7px; }
.timegrid .rowlabel { max-width: 230px; }
.timegrid .rowlabel .tiny { color: var(--muted); }
.timegrid td.wkend { background: var(--surface-2); }
.timegrid .tot { font-variant-numeric: tabular-nums; font-weight: 640; text-align: right; }
.addrow { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; padding: 12px 18px; border-top: 1px solid var(--border); }
.addrow label { min-width: 170px; }

/* dashboard charts + reports */
.chartgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.chartcard { background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow); padding: 15px 18px; display: flex; flex-direction: column; gap: 8px; }
.chartcard h3 { margin: 0; font-size: 14px; font-weight: 620; }
.chartcard .sub { font-size: 12px; color: var(--muted); }
.chartcard svg { width: 100%; height: auto; display: block; }
.chartcard .legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--muted); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.filters label { min-width: 130px; flex: 1; }
.reporttabs { display: flex; gap: 8px; flex-wrap: wrap; }
.reporttabs button.ghost.on { border-color: var(--accent); color: var(--accent); }
@media (max-width: 760px) { .chartgrid { grid-template-columns: 1fr; } }

.avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex: none; }
span.avatar { display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 12px; }
.namecell { display: flex; align-items: center; gap: 10px; }
textarea { font: inherit; color: var(--ink); background: var(--surface-2); border: 1px solid var(--border-strong);
  border-radius: 9px; padding: 10px 12px; width: 100%; min-height: 64px; resize: vertical; }
textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.socialgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.photoctl { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.photoprev { width: 56px; height: 56px; border-radius: 12px; object-fit: cover;
  background: var(--surface-2); border: 1px solid var(--border); }
.cardprev { display: block; width: 100%; max-width: 320px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface-2); margin-bottom: 8px; }
.scanhalf { border: 1px solid var(--border); border-radius: 12px; padding: 14px; margin-top: 14px; }
.scanhalf h3 { margin: 0 0 10px; font-size: 15px; }

tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--surface-2); }
.section-h { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.section-h h3 { margin: 0; font-size: 14px; font-weight: 620; }
.newbtn { display: flex; justify-content: flex-end; }

@media (max-width: 760px) { .kpis { grid-template-columns: repeat(2, 1fr); } .cols { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .formrow, .socialgrid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ============================================================================
   Brand presets — per-practice design systems (accent + neutrals + fonts).
   Applied via data-brand on <html>. "slate" is the base defined above.
   ========================================================================= */

/* --- DZP Redline (the family theme: bone paper, slate ink, one crimson pen.
   Master: dzp-redline.css in the dzp-studio-website repo; mapping documented in
   dzp-website/docs/design-handoff/CSS.md. Status colours, light AND dark, are
   Redline's own since v2 (2026-08-25): Dandi's dark trio replaced the interim
   derived one, and her crit deliberately leans terracotta so it never reads
   as the brand crimson. Display font is DM Sans since v2; graphite still uses
   Space Grotesk - keep its woff2 when touching fonts.) */
:root[data-brand="dzp"] {
  --sans: 'Instrument Sans', system-ui, -apple-system, sans-serif; --display: 'DM Sans', var(--sans);
  --bg:#F0F0EB; --surface:#FCFCFA; --surface-2:#E7E6DF; --ink:#2F3E46; --muted:#57666D; --faint:#879094;
  --border:#D9D8D1; --border-strong:#AEB2AE; --track:#E0DFD8; --accent:#C8102E; --accent-strong:#A6192E; --accent-ink:#FFFFFF; --accent-soft:#FAE7E6;
  --good:#0E6B3D; --good-soft:#E2F0E7; --warn:#8A5800; --warn-soft:#F7EDDA; --crit:#B3341E; --crit-soft:#F9E6E1;
}
@media (prefers-color-scheme: dark) { :root[data-brand="dzp"] {
  --bg:#14191C; --surface:#1B2227; --surface-2:#222B31; --ink:#E9EBE7; --muted:#9CA9AD; --faint:#66737A;
  --border:#303B42; --border-strong:#48555D; --track:#29333A; --accent:#F25E67; --accent-strong:#FF848B; --accent-ink:#26090C; --accent-soft:#3D1B1F;
  --good:#45A876; --good-soft:#17332B; --warn:#C08A2E; --warn-soft:#332B14; --crit:#EC7A67; --crit-soft:#38201B;
} }
:root[data-brand="dzp"][data-theme="light"] {
  --bg:#F0F0EB; --surface:#FCFCFA; --surface-2:#E7E6DF; --ink:#2F3E46; --muted:#57666D; --faint:#879094;
  --border:#D9D8D1; --border-strong:#AEB2AE; --track:#E0DFD8; --accent:#C8102E; --accent-strong:#A6192E; --accent-ink:#FFFFFF; --accent-soft:#FAE7E6;
  --good:#0E6B3D; --good-soft:#E2F0E7; --warn:#8A5800; --warn-soft:#F7EDDA; --crit:#B3341E; --crit-soft:#F9E6E1;
}
:root[data-brand="dzp"][data-theme="dark"] {
  --bg:#14191C; --surface:#1B2227; --surface-2:#222B31; --ink:#E9EBE7; --muted:#9CA9AD; --faint:#66737A;
  --border:#303B42; --border-strong:#48555D; --track:#29333A; --accent:#F25E67; --accent-strong:#FF848B; --accent-ink:#26090C; --accent-soft:#3D1B1F;
  --good:#45A876; --good-soft:#17332B; --warn:#C08A2E; --warn-soft:#332B14; --crit:#EC7A67; --crit-soft:#38201B;
}

/* --- Graphite (neutral grey + emerald, Space Grotesk/Inter) */
:root[data-brand="graphite"] {
  --sans: 'Inter', system-ui, -apple-system, sans-serif; --display: 'Space Grotesk', var(--sans);
  --bg:#F4F4F5; --surface:#FFFFFF; --surface-2:#FAFAFA; --ink:#18181B; --muted:#5F5F68; --faint:#9A9AA2;
  --border:#E4E4E7; --border-strong:#D4D4D8; --track:#ECECEE; --accent:#0F766E; --accent-strong:#0D645E; --accent-ink:#FFFFFF; --accent-soft:#D8F0EC;
}
@media (prefers-color-scheme: dark) { :root[data-brand="graphite"] {
  --bg:#101012; --surface:#18181B; --surface-2:#1F1F23; --ink:#ECECEE; --muted:#A1A1AA; --faint:#71717A;
  --border:#28282C; --border-strong:#38383E; --track:#242428; --accent:#2DD4BF; --accent-strong:#34F4DC; --accent-ink:#04211D; --accent-soft:#123531;
} }
:root[data-brand="graphite"][data-theme="light"] {
  --bg:#F4F4F5; --surface:#FFFFFF; --surface-2:#FAFAFA; --ink:#18181B; --muted:#5F5F68; --faint:#9A9AA2;
  --border:#E4E4E7; --border-strong:#D4D4D8; --track:#ECECEE; --accent:#0F766E; --accent-strong:#0D645E; --accent-ink:#FFFFFF; --accent-soft:#D8F0EC;
}
:root[data-brand="graphite"][data-theme="dark"] {
  --bg:#101012; --surface:#18181B; --surface-2:#1F1F23; --ink:#ECECEE; --muted:#A1A1AA; --faint:#71717A;
  --border:#28282C; --border-strong:#38383E; --track:#242428; --accent:#2DD4BF; --accent-strong:#34F4DC; --accent-ink:#04211D; --accent-soft:#123531;
}

/* --- settings: theme picker + logo --- */
.themes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.themecard { display: flex; flex-direction: column; gap: 8px; padding: 14px; border: 1.5px solid var(--border);
  border-radius: 12px; cursor: pointer; position: relative; background: var(--surface); }
.themecard input { position: absolute; opacity: 0; pointer-events: none; }
.themecard.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.themecard .swatch { height: 34px; border-radius: 8px; }
.themecard .tname { font-weight: 600; font-size: 14px; }
.themecard .tfont { font-size: 12px; color: var(--muted); }
.logorow { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
/* the file picker inherits input's width:100%, which shoves "Remove logo" onto
   its own row and leaves the browse control towering over the preview */
.logorow .actions { align-items: center; }
.logorow input[type="file"] { width: auto; }
.logoprev { height: 48px; min-width: 130px; display: flex; align-items: center; padding: 8px 14px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; }
.logoprev img { height: 30px; width: auto; max-width: 160px; object-fit: contain; }
@media (max-width: 600px) { .themes { grid-template-columns: 1fr; } }

.buildline { font-size: 10.5px; color: var(--faint); text-align: center; letter-spacing: .02em;
  margin: 14px 0 0; padding-bottom: 4px; }

/* ---------- label chips + list toolbar ---------- */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 1px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 600; }
.chip .x { cursor: pointer; opacity: .55; font-size: 12px; }
.chip .x:hover { opacity: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.chips .chip { cursor: pointer; }
/* looks like an input, holds chips + the type-to-add field */
.chipbox { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; background: var(--surface-2);
  border: 1px solid var(--border-strong); border-radius: 9px; padding: 7px 10px; cursor: text; }
.chipbox:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.chipbox input { border: 0; background: transparent; flex: 1; min-width: 110px; width: auto; padding: 2px; }
.chipbox input:focus-visible { outline: 0; }
.listbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.listbar input[type=search] { flex: 1; min-width: 150px; width: auto; padding: 8px 11px; }
.listbar input[type=date] { width: auto; padding: 8px 11px; }
.listbar select { width: auto; padding: 8px 11px; }
