/* ============================================================================
   RailCompliant — design system  (railcompliant.com)
   FRA locomotive inspection, maintenance & compliance for heritage railroads.

   Direction: "builder's plate + signal cabin." A precise, official steel-and-
   brass identity that stays approachable. Three deliberate signatures:
     1. Signal-aspect status  — status pills borrow the railroad's own regulated
        colour vocabulary (green = clear, amber = approach/due, red = danger/
        overdue). The colour IS the meaning, not decoration.
     2. Monospaced regulatory data — locomotive marks, CFR citations, part
        numbers and audit hashes are set in a mono "data" face, like a stencilled
        number plate or a typewritten compliance form.
     3. Stencilled eyebrows — tracked uppercase labels evoke equipment lettering.
   System fonts only (strict CSP; no remote fonts, no CDN assets).
   ============================================================================ */

:root {
  /* ---- Neutrals: cool rolled-steel, not cream ---- */
  --paper:      #eef1f5;   /* app background — steel mist        */
  --surface:    #ffffff;   /* cards / data surfaces              */
  --surface-2:  #f4f6f9;   /* zebra, insets, foot bars           */
  --ink:        #15212e;   /* deep steel blue-black              */
  --ink-soft:   #42505e;
  --ink-faint:  #6c7a88;
  --line:       #d8dee6;
  --line-soft:  #e8ecf1;

  /* ---- Brand steel (primary) ---- */
  --steel:      #1f3a54;   /* primary — builder's-plate blue     */
  --steel-700:  #16293d;   /* hover / pressed                    */
  --steel-900:  #0f1e2c;   /* sidebar deep                       */
  --steel-800:  #13253a;   /* sidebar gradient stop              */
  --steel-50:   #e6ecf2;   /* faint steel tint                   */

  /* ---- Brass (signature heritage accent, used with restraint) ---- */
  --brass:      #b07a2b;
  --brass-600:  #96661f;
  --brass-ink:  #2c1e08;   /* text on brass                      */
  --brass-50:   #f6ecd9;

  /* ---- Signal aspects — the status colour language ---- */
  --ok:    #1c7a46; --ok-bg:  #e3f0e7;   /* clear / compliant  */
  --due:   #a66300; --due-bg: #fbeed4;   /* approach / due     */
  --over:  #b02a22; --over-bg:#f8e2e0;   /* danger / overdue   */
  --info:  #2c5578; --info-bg:#e4ecf4;   /* advisory           */

  /* ---- Shape & depth ---- */
  --radius:     10px;
  --radius-sm:  7px;
  --radius-pill:999px;
  --shadow-sm:  0 1px 2px rgba(16,32,48,.06), 0 1px 3px rgba(16,32,48,.07);
  --shadow:     0 1px 3px rgba(16,32,48,.07), 0 8px 20px -10px rgba(16,32,48,.22);
  --shadow-lg:  0 24px 60px -20px rgba(15,30,44,.45);
  --ring:       0 0 0 3px rgba(31,58,84,.28);

  /* ---- Type ---- */
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --tracking-caps: .09em;   /* stencilled eyebrow tracking */

  /* ---- Legacy aliases (keep every token templates + old rules reference) ---- */
  --green:      var(--steel);      --green-700: var(--steel-700);   --green-50: var(--steel-50);
  --background: var(--paper);      --foreground: var(--ink);
  --card: var(--surface);          --card-foreground: var(--ink);
  --primary: var(--steel);         --primary-foreground: #ffffff;
  --secondary: #cdd5de;            --secondary-foreground: var(--ink);
  --muted: var(--surface-2);       --muted-foreground: var(--ink-faint);
  --accent: var(--steel-50);       --accent-foreground: var(--ink);
  --destructive: var(--over);      --destructive-foreground: #ffffff;
  --border: var(--line);           --input: var(--line);
  --sidebar: var(--steel-900);     --sidebar-foreground: #c6d2df;
  --sidebar-primary: var(--brass); --sidebar-primary-foreground: var(--brass-ink);
  --sidebar-accent: rgba(255,255,255,.08); --sidebar-accent-foreground: #ffffff;
  --sidebar-border: rgba(255,255,255,.09); --sidebar-ring: var(--brass);
  --tracking-normal: 0;
}

/* ============================================================================
   DARK MODE — token overrides only; components keep reading the same vars.
   The theme toggle sets data-theme="dark" on <html>; an inline head script
   applies the stored choice (or the OS preference) before first paint.
   ============================================================================ */
[data-theme=dark] {
  color-scheme: dark;
  --paper:      #0f151c;
  --surface:    #161e27;
  --surface-2:  #1c2632;
  --ink:        #e2e9f0;
  --ink-soft:   #a9b6c3;
  --ink-faint:  #7d8a96;
  --line:       #2b3745;
  --line-soft:  #222d39;

  --steel:      #7ca6cb;   /* links + active text, lightened for dark paper */
  --steel-700:  #94b9d9;
  --steel-900:  #0b141d;
  --steel-800:  #101c29;
  --steel-50:   #1b2836;

  --brass:      #c08b3d;
  --brass-600:  #d3a35a;
  --brass-50:   #2a2214;

  --ok:   #62c48d; --ok-bg:  #14261c;
  --due:  #dfa353; --due-bg: #2b2210;
  --over: #e88379; --over-bg:#2e1917;
  --info: #82aed3; --info-bg:#18242f;

  --secondary:  #2a3644;
  --shadow-sm:  0 1px 2px rgba(0,0,0,.4), 0 1px 3px rgba(0,0,0,.35);
  --shadow:     0 1px 3px rgba(0,0,0,.4), 0 8px 20px -10px rgba(0,0,0,.6);
  --shadow-lg:  0 24px 60px -20px rgba(0,0,0,.7);
  --ring:       0 0 0 3px rgba(124,166,203,.3);
}
/* Solid steel stays a fill colour in dark mode (light --steel would wash out
   white button text); everything else follows the tokens. */
[data-theme=dark] .btn.primary { background: #2c5578; border-color: #2c5578; }
[data-theme=dark] .btn.primary:hover { background: #356588; border-color: #356588; }
[data-theme=dark] .btn.danger { border-color: #5a322f; }
[data-theme=dark] .tabbar .tab.active .tabn { background: #2c5578; }
[data-theme=dark] .topbar { background: rgba(15,21,28,.85); }
[data-theme=dark] input:hover, [data-theme=dark] select:hover, [data-theme=dark] textarea:hover { border-color: #3c4a59; }
[data-theme=dark] .note { background: #251d0e; border-color: #4d3d1c; color: #d9b877; }
[data-theme=dark] .note.proto { background: #16222c; border-color: #2c4256; color: #9ec3e0; }
[data-theme=dark] .note.ok { background: var(--ok-bg); border-color: #2a4a37; color: var(--ok); }
[data-theme=dark] .badge.steam { color: #e0a37b; background: #2c1e12; border-color: #54371e; }
[data-theme=dark] .badge.diesel { color: #9ec3e0; background: var(--info-bg); border-color: #2c4256; }
[data-theme=dark] .badge.violet { color: #aeb9f5; background: #1d2138; border-color: #363e6b; }

.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 34px; height: 34px; border-radius: 8px; border: none; background: transparent;
  color: var(--ink-soft); font-size: 1.02rem; cursor: pointer; line-height: 1;
}
.theme-toggle:hover { background: var(--surface-2); color: var(--ink); }
.theme-toggle::before { content: "☾"; }
[data-theme=dark] .theme-toggle::before { content: "☀"; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--steel); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.18; font-weight: 700; letter-spacing: -.011em; color: var(--ink); }
h1 { font-size: 1.55rem; }
h2 { font-size: 1.18rem; }
h3 { font-size: 1.02rem; letter-spacing: -.005em; }
p { margin: 0 0 1em; }
small { font-size: .8rem; }
code, .mono, .loco-id { font-family: var(--mono); }
:focus-visible { outline: 2px solid var(--steel); outline-offset: 2px; border-radius: 3px; }

/* ---------- Logo mark ---------- */
/* Side-profile diesel road-switcher on a rail: low short hood + tall cab +
   long hood, two trucks, drawn in currentColor so it themes to any surface.
   The brass ".hub" is the headlight — the one warm point. Horizontal ~2:1
   viewBox (0 0 40 20); scales from favicon to hero. */
/* Brand mark = the circular locomotive icon (PNG). Square; sized per context. */
.rc-mark { display: block; object-fit: contain; }
.mark .rc-mark { width: 100%; height: 100%; }
.mk-brand .rc-mark { width: 34px; height: 34px; }

/* ============================================================================
   APP SHELL
   ============================================================================ */
.app { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }

/* ---------- Sidebar: deep steel cab panel ---------- */
.sidebar {
  background: linear-gradient(178deg, var(--steel-800), var(--steel-900) 62%);
  color: var(--sidebar-foreground);
  padding: 0 0 1.25rem;
  position: sticky; top: 0; align-self: start; height: 100vh;
  display: flex; flex-direction: column;
  border-right: 1px solid rgba(0,0,0,.35);
}
.brand {
  display: flex; align-items: center; gap: .7rem;
  padding: 1.15rem 1.25rem 1.1rem;
  border-bottom: 1px solid var(--sidebar-border);
}
.brand .mark {
  width: 42px; height: 42px; flex: none; /* square roundel icon */
  display: grid; place-items: center;
}
.brand b { color: #fff; font-size: 1.02rem; font-weight: 700; letter-spacing: -.01em; line-height: 1.1; }
.brand small { display: block; color: #8ea3b8; font-size: .64rem; letter-spacing: var(--tracking-caps); text-transform: uppercase; margin-top: 2px; }

.org-switch {
  margin: .9rem 1rem; padding: .6rem .75rem; border-radius: var(--radius-sm);
  background: rgba(255,255,255,.06); border: 1px solid var(--sidebar-border);
  font-size: .84rem; cursor: pointer; display: flex; align-items: center; justify-content: space-between;
  transition: background .12s;
}
.org-switch:hover { background: rgba(255,255,255,.1); }
.org-switch b { color: #fff; font-weight: 600; }
.org-switch span { color: #8ea3b8; }

.nav { padding: .35rem .6rem; overflow-y: auto; }
.nav .group {
  color: #7f95ab; font-size: .64rem; text-transform: uppercase;
  letter-spacing: var(--tracking-caps); font-weight: 700; margin: 1.15rem .7rem .4rem;
}
.nav a {
  display: flex; align-items: center; gap: .65rem;
  color: var(--sidebar-foreground); padding: .52rem .7rem; border-radius: var(--radius-sm);
  font-size: .9rem; margin-bottom: 2px; position: relative;
  transition: background .12s, color .12s;
}
.nav a:hover { background: var(--sidebar-accent); text-decoration: none; color: #fff; }
.nav a.active {
  background: rgba(176,122,43,.16); color: #fff; font-weight: 600;
  box-shadow: inset 3px 0 0 var(--brass);
}
.nav a .ic { width: 18px; text-align: center; opacity: .85; font-size: .95rem; }
.nav a.active .ic { opacity: 1; color: var(--brass); }
.nav a .count {
  margin-left: auto; font-size: .72rem; font-variant-numeric: tabular-nums;
  background: rgba(255,255,255,.14); color: #dfe8f1; padding: .05rem .45rem; border-radius: var(--radius-pill);
}
.nav a.active .count { background: rgba(0,0,0,.28); color: #fff; }
/* Standalone footer link (Platform console). Deliberately NOT class="nav": that
   class is the scroll container (overflow-y:auto), and as a compressed flex item
   it would sprout its own scrollbar. flex-shrink:0 keeps it a fixed row. */
.nav-admin {
  display: flex; align-items: center; gap: .55rem; flex-shrink: 0;
  margin: .35rem .6rem 0; padding: .5rem .65rem; border-radius: var(--radius-sm);
  color: #cfe0d7; font-size: .85rem; transition: background .12s, color .12s;
}
.nav-admin:hover { background: var(--sidebar-accent); color: #fff; text-decoration: none; }
.sidebar .spacer { flex: 1; }
.who {
  padding: .7rem 1.1rem 0; border-top: 1px solid var(--sidebar-border);
  margin: .7rem .6rem 0; font-size: .8rem; color: #97abbf;
}
.who b { color: #fff; display: block; margin-bottom: .05rem; }

/* ---------- Main column ---------- */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 1rem;
  padding: .7rem 1.6rem; background: rgba(255,255,255,.85);
  backdrop-filter: saturate(1.4) blur(6px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.crumbs { color: var(--ink-faint); font-size: .85rem; }
.crumbs a { color: var(--ink-soft); }
.topbar .search { margin-left: auto; min-width: 260px; max-width: 360px; flex: 1; }
.topbar .search input { padding-block: .42rem; }

.content { padding: 1.6rem 1.9rem 3rem; max-width: 1680px; width: 100%; animation: rc-rise .28s ease both; }
@keyframes rc-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.page-head { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 1.35rem; }
.page-head .titles { flex: 1; min-width: 0; }
.page-head h1 { margin-bottom: .2rem; }
.page-head .sub { color: var(--ink-soft); font-size: .9rem; max-width: 68ch; }
.page-head .actions { display: flex; gap: .55rem; flex: none; flex-wrap: wrap; }

/* Stencilled eyebrow — a section label that reads like equipment lettering */
.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .68rem; font-weight: 700; letter-spacing: var(--tracking-caps);
  text-transform: uppercase; color: var(--ink-faint);
}
.eyebrow::before { content: ""; width: 14px; height: 2px; background: var(--brass); border-radius: 2px; }

/* ============================================================================
   BUTTONS & INPUTS
   ============================================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem; cursor: pointer;
  font: inherit; font-size: .88rem; font-weight: 600; line-height: 1.1;
  padding: .52rem .95rem; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: background .12s, border-color .12s, box-shadow .12s, transform .04s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--steel); border-color: var(--steel); color: #fff; }
.btn.primary:hover { background: var(--steel-700); border-color: var(--steel-700); }
.btn.brass { background: var(--brass); border-color: var(--brass); color: var(--brass-ink); }
.btn.brass:hover { background: var(--brass-600); border-color: var(--brass-600); }
.btn.ghost { background: transparent; box-shadow: none; border-color: transparent; color: var(--ink-soft); }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn.sm { padding: .34rem .62rem; font-size: .8rem; }
.btn.danger { color: var(--over); border-color: #e6c6c3; }
.btn.danger:hover { background: var(--over-bg); border-color: var(--over); }

label.field { display: block; margin-bottom: 1rem; }
label.field > span { display: block; font-size: .8rem; font-weight: 600; color: var(--ink-soft); margin-bottom: .32rem; }
label.field .hint { font-weight: 400; color: var(--ink-faint); }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=date],
input[type=number], input[type=search], input[type=tel], select, textarea {
  width: 100%; font: inherit; font-size: .9rem; color: var(--ink);
  padding: .5rem .62rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface);
  transition: border-color .12s, box-shadow .12s;
}
input::placeholder, textarea::placeholder { color: var(--ink-faint); }
input:hover, select:hover, textarea:hover { border-color: #c2cbd5; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--steel); box-shadow: var(--ring);
}
textarea { min-height: 72px; resize: vertical; }
.inline-fields { display: flex; gap: .5rem; }
.inline-fields > * { flex: 1; }

/* inspection form item layout: checklist rows span the card; scalar fields flow
   in a compact two-up grid; long-text items take the full row */
.insp-items { display: flex; flex-wrap: wrap; gap: 0 1.4rem; }
.insp-items .checkrow { flex: 1 1 100%; }
.insp-items label.field { flex: 1 1 300px; max-width: 430px; margin: .7rem 0 .4rem; }
.insp-items label.field.wide { flex: 1 1 100%; max-width: none; }
.insp-items textarea { min-height: 58px; }

/* ============================================================================
   CARDS & GRID
   ============================================================================ */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card .card-head {
  display: flex; align-items: center; gap: .6rem;
  padding: .85rem 1.15rem; border-bottom: 1px solid var(--line-soft);
}
.card .card-head h3 { margin: 0; }
.card .card-head .actions { margin-left: auto; display: flex; gap: .4rem; }
.card .card-body { padding: 1.15rem; }
.card .card-foot {
  padding: .7rem 1.15rem; border-top: 1px solid var(--line-soft);
  background: var(--surface-2); font-size: .85rem; color: var(--ink-soft);
}
a.card { color: inherit; }
a.card:hover { text-decoration: none; border-color: #c2cbd5; box-shadow: var(--shadow); }

.grid { display: grid; gap: 1.15rem; }
.grid.cols-2 { grid-template-columns: 1fr 1fr; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.sidebar-right { grid-template-columns: 1fr 360px; align-items: start; }
@media (max-width: 980px) { .grid.cols-3, .grid.cols-4, .grid.cols-2, .grid.sidebar-right { grid-template-columns: 1fr; } }

.checkgrid { display: grid; grid-template-columns: 1fr; column-gap: 2rem; }
@media (min-width: 1100px) { .checkgrid { grid-template-columns: 1fr 1fr; } }

@media (min-width: 1600px) {
  .app { grid-template-columns: 268px 1fr; }
  .content { padding: 1.9rem 2.6rem 3.5rem; }
  .grid { gap: 1.4rem; }
  .grid.sidebar-right { grid-template-columns: 1fr 400px; }
}
@media (min-width: 2000px) { .content { max-width: 1880px; } }

/* ============================================================================
   STAT TILES
   ============================================================================ */
.stat { padding: 1.05rem 1.15rem; }
.stat .label { color: var(--ink-faint); font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: var(--tracking-caps); }
.stat .value { font-size: 2rem; font-weight: 700; line-height: 1.05; margin: .3rem 0 .15rem; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat .value.over { color: var(--over); }
.stat .value.due { color: var(--due); }
.stat .value.ok { color: var(--ok); }
.stat .foot { font-size: .8rem; color: var(--ink-faint); }

/* ============================================================================
   SIGNAL-ASPECT PILLS / BADGES
   The lamp dot glows a hair — this is the app's status vocabulary.
   ============================================================================ */
.badge {
  display: inline-flex; align-items: center; gap: .38rem;
  font-size: .72rem; font-weight: 650; padding: .16rem .55rem; border-radius: var(--radius-pill);
  border: 1px solid transparent; white-space: nowrap; line-height: 1.35;
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent); flex: none; }
.badge.ok   { color: var(--ok);   background: var(--ok-bg);   border-color: color-mix(in srgb, var(--ok) 22%, transparent); }
.badge.due  { color: var(--due);  background: var(--due-bg);  border-color: color-mix(in srgb, var(--due) 26%, transparent); }
.badge.over { color: var(--over); background: var(--over-bg); border-color: color-mix(in srgb, var(--over) 24%, transparent); }
.badge.info { color: var(--info); background: var(--info-bg); border-color: color-mix(in srgb, var(--info) 20%, transparent); }
.badge.muted{ color: var(--ink-soft); background: var(--surface-2); border-color: var(--line); }
.badge.steam { color: #8a3d12; background: #f6e6d6; border-color: #e6c6a8; }   /* steam = 49 CFR 230 */
.badge.diesel{ color: #2c5578; background: var(--info-bg); border-color: #c3d5e6; } /* diesel = 49 CFR 229 */

/* ============================================================================
   TABLES — dense, legible, tabular
   ============================================================================ */
table.tbl { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.tbl th {
  text-align: left; font-size: .66rem; text-transform: uppercase; letter-spacing: var(--tracking-caps);
  color: var(--ink-faint); font-weight: 700; padding: .6rem .85rem; border-bottom: 1px solid var(--line);
  background: var(--surface-2); position: sticky; top: 0;
}
.card table.tbl th { background: var(--surface-2); }
table.tbl td { padding: .62rem .85rem; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.tbl tr:last-child td { border-bottom: none; }
table.tbl tbody tr { transition: background .1s; }
table.tbl tbody tr:hover { background: var(--surface-2); }
table.tbl td.num, table.tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.loco-id { font-family: var(--mono); font-weight: 600; letter-spacing: -.01em; }
.muted { color: var(--ink-faint); }
.right { text-align: right; }

/* ============================================================================
   TIMELINE (inspection / maintenance history)
   ============================================================================ */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 1.1rem 1.45rem; border-left: 2px solid var(--line); }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: -7px; top: .2rem;
  width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--steel);
}
.timeline li.over::before { border-color: var(--over); }
.timeline li.alter::before { border-color: var(--brass); background: var(--brass); }
.timeline .when { font-size: .78rem; color: var(--ink-faint); }
.timeline .what { font-weight: 600; }

/* ---------- Spec sheet ---------- */
dl.spec { display: grid; grid-template-columns: max-content 1fr; gap: .55rem 1.3rem; margin: 0; }
dl.spec dt { color: var(--ink-faint); font-size: .82rem; }
dl.spec dd { margin: 0; font-weight: 550; font-variant-numeric: tabular-nums; }

/* ============================================================================
   RENDERED INSPECTION FORMS (from jsonb template)
   ============================================================================ */
.form-section { margin-bottom: 1.5rem; }
.form-section > h3 { padding-bottom: .45rem; border-bottom: 2px solid var(--line); display: flex; align-items: baseline; gap: .5rem; }
.form-section > h3 .cite { font-size: .7rem; font-weight: 600; color: var(--ink-faint); margin-left: auto; font-family: var(--mono); }
.checkrow { display: flex; align-items: center; gap: .8rem; padding: .55rem .25rem; border-bottom: 1px solid var(--line-soft); }
.checkrow .q { flex: 1; }
.checkrow .opts { display: flex; gap: .25rem; flex: none; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.seg label { padding: .3rem .62rem; font-size: .78rem; cursor: pointer; border-right: 1px solid var(--line); background: var(--surface); transition: background .1s; }
.seg label:last-child { border-right: none; }
.seg label:hover { background: var(--surface-2); }
.seg input { position: absolute; opacity: 0; width: 0; height: 0; }
.seg label:has(input:checked) { color: #fff; font-weight: 600; }
.seg label:has(input:focus-visible) { outline: 2px solid var(--steel); outline-offset: -2px; }
.seg label.g:has(input:checked) { background: var(--ok); }
.seg label.f:has(input:checked) { background: var(--due); }
.seg label.p:has(input:checked) { background: var(--over); }
.seg label.na:has(input:checked) { background: var(--ink-faint); }

/* ============================================================================
   REGULATION READER + HELP PROSE (ADR-002)
   ============================================================================ */
.reg-layout { display: grid; grid-template-columns: 280px 1fr; gap: 1.4rem; align-items: start; }
@media (max-width: 900px){ .reg-layout { grid-template-columns: 1fr; } }
.reg-toc { font-size: .85rem; position: sticky; top: 84px; }
.reg-toc a { display: block; padding: .32rem .55rem; border-radius: var(--radius-sm); color: var(--ink-soft); }
.reg-toc a:hover { background: var(--surface-2); text-decoration: none; }
.reg-toc a.active { background: var(--steel-50); color: var(--steel); font-weight: 600; box-shadow: inset 2px 0 0 var(--brass); }
.reg-toc .lvl2 { padding-left: 1.2rem; font-size: .82rem; }
.reg-body { font-size: .95rem; line-height: 1.7; max-width: 74ch; }
.reg-body h2 { margin-top: 0; }
.reg-body .cite-bar {
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
  font-size: .8rem; color: var(--ink-soft); margin-bottom: 1rem; font-family: var(--mono);
  padding-bottom: .8rem; border-bottom: 1px solid var(--line);
}
.reg-body p { margin-bottom: 1rem; }
.reg-body .para-num { font-weight: 700; color: var(--brass-600); font-family: var(--mono); }

.reg-prose { line-height: 1.65; }
.reg-prose p { margin: 0 0 .9rem; }
.reg-prose h3 { margin: 1.4rem 0 .5rem; font-size: 1.04rem; }
.reg-prose ul { margin: .35rem 0 .95rem; padding-left: 1.2rem; }
.reg-prose li { margin: .28rem 0; }
.reg-prose a { color: var(--steel); }
.reg-snippet mark, .reg-prose mark { background: var(--due-bg); color: var(--due); padding: 0 .18em; border-radius: 3px; }

/* ============================================================================
   LOGIN / AUTH  — steel cab wall, a single brass-lit card
   ============================================================================ */
.auth-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 1.5rem;
  background:
    radial-gradient(1100px 620px at 72% -12%, rgba(176,122,43,.16), transparent 58%),
    linear-gradient(168deg, var(--steel-800), var(--steel-900) 70%);
  position: relative;
}
/* faint blueprint tick line across the base — restraint: one atmospheric touch */
.auth-wrap::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: repeating-linear-gradient(90deg, rgba(255,255,255,.035) 0 1px, transparent 1px 40px);
}
.auth-card {
  position: relative; width: 100%; max-width: 408px; background: var(--surface);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden;
  border-top: 3px solid var(--brass);
}
.auth-card .head { padding: 1.7rem 1.75rem .4rem; }
.auth-card .head .brand { padding: 0; border: none; margin-bottom: 1.1rem; }
.auth-card .head .brand .mark { color: var(--steel); }
.auth-card .body { padding: .6rem 1.75rem 1.75rem; }
.auth-card .foot {
  padding: 1rem 1.75rem; background: var(--surface-2); border-top: 1px solid var(--line);
  font-size: .8rem; color: var(--ink-faint); text-align: center;
}
.auth-card .foot a { color: var(--ink-soft); }

/* ============================================================================
   MISC COMPONENTS
   ============================================================================ */
.note { background: var(--brass-50); border: 1px solid #ecd9b6; border-radius: var(--radius-sm); padding: .75rem .95rem; font-size: .85rem; color: #6b531f; }
.note.proto { background: var(--info-bg); border-color: #c5dcef; color: #214e72; }
.bridge { border: 1px dashed var(--brass); background: var(--brass-50); border-radius: var(--radius-sm); padding: .85rem 1rem; font-size: .87rem; }
.kv-inline { display: flex; gap: 1.4rem; flex-wrap: wrap; font-size: .85rem; }
.kv-inline div { display: flex; flex-direction: column; }
.kv-inline span { color: var(--ink-faint); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; }
.kv-inline b { font-variant-numeric: tabular-nums; }
.progress { height: 8px; background: var(--line-soft); border-radius: var(--radius-pill); overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--steel), var(--brass)); border-radius: inherit; }
hr.soft { border: none; border-top: 1px solid var(--line-soft); margin: 1.15rem 0; }
.tag-row { display: flex; gap: .4rem; flex-wrap: wrap; }
summary { cursor: pointer; }
summary::-webkit-details-marker { display: none; }
summary::marker { content: ""; }
.nav-pop:hover { background: var(--surface-2); text-decoration: none; }

/* Empty states — an empty screen is an invitation to act */
.empty { text-align: center; padding: 2.4rem 1.5rem; color: var(--ink-faint); }
.empty .empty-mark { width: 40px; height: 40px; margin: 0 auto .7rem; opacity: .5; color: var(--steel); }
.empty h3 { color: var(--ink-soft); }

/* ============================================================================
   PLATFORM (back-office) console — distinct slate/violet theme, unchanged intent
   ============================================================================ */
.sidebar.platform { background: #171c29; }
.sidebar.platform .brand { border-color: rgba(255,255,255,.08); }
.sidebar.platform .brand .mark { color: #aeb9f5; }
.sidebar.platform .brand b { color: #fff; }
.sidebar.platform .brand small { color: #8f9bd4; }
.sidebar.platform .nav a { color: #c3cae6; box-shadow: none; }
.sidebar.platform .nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar.platform .nav a.active { background: rgba(124,140,240,.2); color: #fff; box-shadow: inset 3px 0 0 #7c8cf0; }
.sidebar.platform .nav a.active .ic { color: #aeb9f5; }
.sidebar.platform .nav a.active .count { background: rgba(0,0,0,.28); }
.sidebar.platform .nav .group { color: #7e8ab8; }
.sidebar.platform .who { color: #aab2d6; border-color: rgba(255,255,255,.08); }
.sidebar.platform .who b { color: #fff; }
.console-tag {
  margin: .9rem 1rem; padding: .55rem .72rem; border-radius: var(--radius-sm);
  background: rgba(124,140,240,.16); border: 1px solid rgba(124,140,240,.32);
  color: #cdd4f2; font-size: .76rem; display: flex; align-items: center; gap: .4rem;
}
.exit-link { display: block; margin: .5rem 1rem 0; padding: .48rem .62rem; border-radius: var(--radius-sm); color: #8f9bd4; font-size: .82rem; }
.exit-link:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.badge.violet { color: #4a57b8; background: #e7e9fb; border-color: #c9cef4; }
.badge.plat { color: #fff; background: #6c7bd6; }
.switchy { display: inline-flex; align-items: center; gap: .35rem; font-size: .82rem; color: var(--ink-soft); cursor: pointer; }

/* ============================================================================
   EQUIPMENT PHOTOS & GALLERY
   ============================================================================ */
.equip-photo { width:100%; max-width:340px; aspect-ratio:4/3; object-fit:cover; border-radius:var(--radius); border:1px solid var(--line); display:block; }
.equip-ph { width:100%; max-width:340px; aspect-ratio:4/3; border-radius:var(--radius); border:1px dashed var(--line); display:grid; place-items:center; color:var(--ink-faint); background:var(--surface-2); font-size:.85rem; }
.equip-thumb { width:38px; height:38px; object-fit:cover; border-radius:var(--radius-sm); border:1px solid var(--line); vertical-align:middle; margin-right:.55rem; }
.equip-thumb-ph { width:38px; height:38px; border-radius:var(--radius-sm); background:var(--surface-2); color:var(--ink-faint); display:inline-grid; place-items:center; vertical-align:middle; margin-right:.55rem; }

.gallery { display:grid; grid-template-columns:repeat(auto-fill,minmax(180px,1fr)); gap:.9rem; }
.gtile { border:1px solid var(--line); border-radius:var(--radius); overflow:hidden; background:var(--surface); position:relative; display:flex; flex-direction:column; box-shadow:var(--shadow-sm); }
.gtile.cover { border-color:var(--brass); box-shadow:0 0 0 2px var(--brass-50); }
.gimg { width:100%; aspect-ratio:4/3; object-fit:cover; display:block; }
.gbadge { position:absolute; top:8px; left:8px; background:var(--brass); color:var(--brass-ink); font-size:.68rem; font-weight:700; padding:.1rem .5rem; border-radius:var(--radius-pill); }
.gmeta { padding:.55rem .65rem .35rem; }
.gcap { font-size:.82rem; font-weight:600; line-height:1.2; }
.gedit { padding:.2rem .65rem .65rem; margin-top:auto; }
.gedit > summary { list-style:none; cursor:pointer; width:100%; justify-content:center; }
.gedit > summary::-webkit-details-marker { display:none; }
.gedit input, .gedit select { width:100%; }

/* ============================================================================
   DETAIL-PAGE TABS
   ============================================================================ */
.tabbar { display:flex; gap:.15rem; border-bottom:1px solid var(--line); margin:0 0 1.3rem; flex-wrap:wrap; }
.tabbar .tab { background:none; border:none; border-bottom:2px solid transparent; margin-bottom:-1px; padding:.58rem .95rem; font:inherit; font-size:.9rem; color:var(--ink-soft); cursor:pointer; border-radius:var(--radius-sm) var(--radius-sm) 0 0; display:inline-flex; align-items:center; gap:.4rem; transition:background .1s,color .1s; }
.tabbar .tab:hover { background:var(--surface-2); color:var(--ink); }
.tabbar .tab.active { color:var(--steel); border-bottom-color:var(--brass); font-weight:600; }
.tabn { background:var(--surface-2); color:var(--ink-soft); font-size:.72rem; font-weight:600; padding:0 .42rem; border-radius:var(--radius-pill); font-variant-numeric:tabular-nums; }
.tabn.over { background:var(--over-bg); color:var(--over); }
.tabn.due { background:var(--due-bg); color:var(--due); }
.tabbar .tab.active .tabn { background:var(--steel); color:#fff; }
.tab-panel { display:none; }
.tab-panel.show { display:block; }

/* ============================================================================
   RESPONSIVE — collapse the shell to a stacked mobile layout
   ============================================================================ */
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: static; height: auto; flex-direction: column;
    border-right: none; border-bottom: 1px solid rgba(0,0,0,.35);
  }
  .sidebar .nav { display: flex; flex-wrap: wrap; gap: .2rem; }
  .sidebar .nav .group { width: 100%; margin: .6rem .7rem .2rem; }
  .sidebar .spacer { display: none; }
  .sidebar .who { order: 99; }
  .topbar { padding-inline: 1rem; flex-wrap: wrap; }
  .topbar .search { min-width: 0; order: 3; width: 100%; margin-left: 0; }
  .content { padding: 1.1rem 1rem 2.5rem; }
  .page-head { flex-direction: column; gap: .6rem; }
  table.tbl { font-size: .84rem; }
  table.tbl th, table.tbl td { padding: .5rem .55rem; }
}

/* ============================================================================
   MOTION PREFERENCES
   ============================================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .content { animation: none; }
}

/* ============================================================================
   MARKETING SITE (public landing + pricing). Prefix .mk-. Steel/brass identity.
   ============================================================================ */
.mk { background: var(--surface); color: var(--ink); }
.mk a { color: var(--steel); }
.mk-wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* --- open-beta banner + chip --- */
.mk-beta { background: var(--brass); color: var(--brass-ink); font-size: .88rem; font-weight: 600; }
.mk-beta .mk-wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 12px; padding: 9px 24px; text-align: center; }
.mk-beta a { color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.beta-chip { display: inline-flex; align-items: center; border: 1px solid currentColor; border-radius: 999px;
  padding: .12rem .55rem; font-size: .66rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; line-height: 1.4; white-space: nowrap; }
.mk-beta .beta-chip { background: rgba(0,0,0,.12); border-color: transparent; }
.brand .beta-chip { color: var(--brass); font-size: .56rem; padding: .06rem .4rem; margin-left: 6px; vertical-align: 1px; }
.auth-brand .beta-chip { color: var(--brass); margin-bottom: 1.15rem; }

/* --- top nav --- */
.mk-nav { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.9);
  backdrop-filter: saturate(1.2) blur(8px); border-bottom: 1px solid var(--line-soft); }
.mk-nav .mk-wrap { display: flex; align-items: center; gap: 20px; height: 64px; }
.mk-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--ink); letter-spacing: -.01em; }
.mk-brand .mark { width: 40px; height: 20px; color: var(--steel); }
.mk-brand .hub { fill: var(--brass); }
.mk-nav .links { display: flex; align-items: center; gap: 26px; margin-left: auto; }
.mk-nav .links a { color: var(--ink-soft); font-size: .92rem; font-weight: 600; text-decoration: none; }
.mk-nav .links a:hover { color: var(--steel); }
.mk-btn { display: inline-flex; align-items: center; gap: 8px; border-radius: 10px; padding: .62rem 1.05rem;
  font-weight: 700; font-size: .92rem; text-decoration: none; border: 1px solid transparent; transition: transform .08s, background .12s, box-shadow .12s; }
.mk-btn:active { transform: translateY(1px); }
.mk-btn.primary { background: var(--steel); color: #fff; box-shadow: 0 1px 0 rgba(0,0,0,.15); }
.mk-btn.primary:hover { background: var(--steel-700); }
.mk-btn.brass { background: var(--brass); color: var(--brass-ink); }
.mk-btn.brass:hover { background: var(--brass-600); }
.mk-btn.ghost { border-color: var(--line); color: var(--ink); background: #fff; }
.mk-btn.ghost:hover { border-color: var(--steel); color: var(--steel); }
.mk-btn.lg { padding: .8rem 1.4rem; font-size: 1rem; }

/* --- hero --- */
.mk-hero { position: relative; overflow: hidden;
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(176,122,43,.16), transparent 60%),
    linear-gradient(180deg, var(--steel-900), var(--steel-800) 60%, #12283d);
  color: #eaf0f6; border-bottom: 3px solid var(--brass); }
.mk-hero::before { /* faint blueprint grid */
  content: ""; position: absolute; inset: 0; opacity: .5;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 34px 34px; mask-image: radial-gradient(1000px 500px at 70% 0%, #000, transparent 75%); }
.mk-hero .mk-wrap { position: relative; padding: 70px 24px 88px; }
.mk-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: .74rem;
  letter-spacing: .14em; text-transform: uppercase; color: #d9b877; margin-bottom: 20px; }
.mk-eyebrow::before { content: ""; width: 22px; height: 2px; background: var(--brass); display: inline-block; }
.mk-hero h1 { font-size: clamp(2.1rem, 4.6vw, 3.5rem); line-height: 1.05; letter-spacing: -.02em; margin: 0 0 18px; max-width: 15ch; color: #fff; }
.mk-hero h1 .u { color: #e7c485; }
.mk-hero .lede { font-size: clamp(1.05rem, 1.8vw, 1.28rem); color: #b9c7d6; max-width: 54ch; margin: 0 0 30px; }
.mk-cta { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.mk-hero .fineprint { margin-top: 16px; font-size: .84rem; color: #8ea1b4; }
.mk-hero .fineprint b { color: #d9b877; font-weight: 700; }

/* --- browser-framed screenshot --- */
.mk-shot { border-radius: 12px; overflow: hidden; border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.55), 0 8px 20px -8px rgba(0,0,0,.4); background: #0d1b28; }
.mk-shot .bar { display: flex; align-items: center; gap: 6px; padding: 9px 12px; background: #101f2e; border-bottom: 1px solid rgba(255,255,255,.07); }
.mk-shot .bar i { width: 10px; height: 10px; border-radius: 50%; background: #33465a; }
.mk-shot img { display: block; width: 100%; height: auto; }
.mk-hero-shot { margin-top: 52px; }
.mk-hero-shot .mk-shot { border-color: rgba(255,255,255,.16); }

/* --- trust strip --- */
.mk-trust { background: var(--surface-2); border-bottom: 1px solid var(--line-soft); }
.mk-trust .mk-wrap { padding: 22px 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 26px; justify-content: center;
  font-size: .82rem; color: var(--ink-faint); font-family: var(--mono); letter-spacing: .04em; }
.mk-trust b { color: var(--ink-soft); }

/* --- section scaffolding --- */
.mk-section { padding: 84px 0; }
.mk-section.alt { background: var(--surface-2); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.mk-head { max-width: 62ch; margin: 0 0 44px; }
.mk-head .mk-eyebrow { color: var(--brass-600); }
.mk-head .mk-eyebrow::before { background: var(--brass); }
.mk-head h2 { font-size: clamp(1.7rem, 3vw, 2.35rem); line-height: 1.12; letter-spacing: -.02em; margin: 0 0 14px; }
.mk-head p { font-size: 1.08rem; color: var(--ink-soft); margin: 0; }

/* --- alternating feature rows --- */
.mk-feature { display: grid; grid-template-columns: 1fr 1fr; gap: 54px; align-items: center; }
.mk-feature + .mk-feature { margin-top: 92px; }
.mk-feature.flip .mk-copy { order: 2; }
.mk-feature .mk-shot { border-color: var(--line); box-shadow: 0 24px 50px -22px rgba(21,33,46,.5); }
.mk-feature .mk-shot .bar { background: #f0f3f7; border-bottom-color: var(--line-soft); }
.mk-feature .mk-shot .bar i { background: #cfd8e2; }
.mk-kicker { font-family: var(--mono); font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--brass-600); margin-bottom: 12px; }
.mk-feature h3 { font-size: 1.6rem; line-height: 1.15; letter-spacing: -.01em; margin: 0 0 14px; }
.mk-feature p { color: var(--ink-soft); font-size: 1.02rem; margin: 0 0 18px; }
.mk-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.mk-list li { display: flex; gap: 10px; align-items: flex-start; font-size: .98rem; color: var(--ink); }
.mk-list li::before { content: "✓"; color: var(--ok); font-weight: 800; }

/* --- feature cards grid --- */
.mk-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.mk-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 24px; }
.mk-section.alt .mk-card { background: #fff; }
.mk-card .ic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--steel-50); color: var(--steel); font-size: 1.2rem; margin-bottom: 14px; }
.mk-card h4 { margin: 0 0 8px; font-size: 1.08rem; }
.mk-card p { margin: 0; color: var(--ink-soft); font-size: .94rem; }

/* --- pricing --- */
.mk-price-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 28px; align-items: start; }
.mk-price-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 30px; box-shadow: 0 24px 50px -30px rgba(21,33,46,.4); }
.mk-price-card.feature { border-color: var(--brass); box-shadow: 0 24px 50px -24px rgba(176,122,43,.4); position: relative; }
.mk-price-card.feature::before { content: "14-day free trial"; position: absolute; top: -12px; left: 30px; background: var(--brass); color: var(--brass-ink);
  font-size: .72rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 4px 12px; border-radius: 999px; }
.mk-amount { display: flex; align-items: baseline; gap: 8px; margin: 8px 0 4px; }
.mk-amount .n { font-size: 2.6rem; font-weight: 800; letter-spacing: -.02em; color: var(--ink); }
.mk-amount .p { color: var(--ink-faint); font-size: .95rem; }
.mk-plus { font-family: var(--mono); color: var(--brass-600); font-weight: 700; margin: 14px 0; }
.mk-estimator { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: .92rem; }
.mk-estimator th, .mk-estimator td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line-soft); }
.mk-estimator th { font-family: var(--mono); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); }
.mk-estimator td.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }

/* --- final CTA band + footer --- */
.mk-band { background: linear-gradient(180deg, var(--steel-900), var(--steel-800)); color: #eaf0f6; text-align: center; padding: 74px 0; border-top: 3px solid var(--brass); }
.mk-band h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); margin: 0 0 12px; color: #fff; letter-spacing: -.02em; }
.mk-band p { color: #b9c7d6; margin: 0 0 26px; font-size: 1.05rem; }
.mk-foot { background: var(--steel-900); color: #93a6b8; padding: 40px 0; font-size: .88rem; }
.mk-foot .mk-wrap { display: flex; flex-wrap: wrap; gap: 16px 30px; align-items: center; }
.mk-foot a { color: #b9c7d6; text-decoration: none; }
.mk-foot a:hover { color: #fff; }
.mk-foot .sp { margin-left: auto; }

@media (max-width: 820px) {
  .mk-nav .links a:not(.mk-btn) { display: none; }
  .mk-feature, .mk-price-grid { grid-template-columns: 1fr; gap: 30px; }
  .mk-feature.flip .mk-copy { order: 0; }
  .mk-cards { grid-template-columns: 1fr; }
  .mk-section { padding: 60px 0; }
}

/* FAQ accordion on the marketing landing */
.mk-faq { max-width: 800px; margin: 0 auto; display: grid; gap: 10px; }
.mk-faq details { background: var(--surface); border: 1px solid var(--line-soft); border-radius: 10px; }
.mk-faq summary { cursor: pointer; font-weight: 600; padding: 16px 44px 16px 20px; color: var(--ink); list-style: none; position: relative; }
.mk-faq summary::-webkit-details-marker { display: none; }
.mk-faq summary::after { content: "+"; position: absolute; right: 18px; top: 14px; color: var(--brass-600); font-weight: 700; font-size: 1.1rem; }
.mk-faq details[open] summary::after { content: "\2013"; }
.mk-faq .a { padding: 0 20px 16px; color: var(--ink-soft); line-height: 1.6; font-size: .95rem; }

/* ============================================================================
   OPERATOR CONSOLE — platform back office. Same two-column shell as the tenant
   app; the .sidebar.platform slate/violet theme (above) marks the chrome as
   cross-tenant back office.
   ============================================================================ */
.op-badge { font-family: var(--mono); font-size: .62rem; letter-spacing: .12em; text-transform: uppercase;
  background: var(--brass); color: var(--brass-ink); padding: 2px 8px; border-radius: 999px; margin-left: 8px; font-weight: 800; }
.scroll { overflow-x: auto; }
/* Inline magnitude bar for metric tables: flat at the baseline, rounded at the
   data end; the value sits beside it in ink (never on the bar). */
.meter { display: flex; align-items: center; gap: .55rem; min-width: 120px; }
.meter i { display: block; height: 10px; flex: none; border-radius: 0 4px 4px 0; background: var(--steel);
  min-width: 0; max-width: calc(100% - 2.6em); /* the value must never be pushed out of the cell */ }
.meter i.brass { background: var(--brass); }
.meter b { flex: none; font-variant-numeric: tabular-nums; font-size: .85rem; }
.t-status { font-family: var(--mono); font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; font-weight: 700; }
.t-status.trialing { color: var(--brass-600); }
.t-status.active { color: var(--ok); }
.t-status.past_due { color: var(--due); }
.t-status.canceled, .t-status.incomplete { color: var(--ink-faint); }
.t-status.suspended { color: var(--over); }
.imperson-bar { background: var(--brass); color: var(--brass-ink); text-align: center; padding: .5rem 1rem; font-size: .88rem; font-weight: 600; }
.imperson-bar a, .imperson-bar button { color: var(--brass-ink); font-weight: 800; text-decoration: underline; background: none; border: none; cursor: pointer; font-size: inherit; }

/* ============================================================================
   SPLIT AUTH LAYOUT (login / signup): brand panel + form column
   ============================================================================ */
.auth-split { display: grid; grid-template-columns: 1.05fr .95fr; min-height: 100vh; }
.auth-brand {
  position: relative; overflow: hidden; color: #eaf0f6;
  background: linear-gradient(160deg, var(--steel-900), var(--steel-800) 60%, #12283d);
  border-right: 3px solid var(--brass);
  display: flex; align-items: center; justify-content: center; padding: 3rem;
}
.auth-brand::before {
  content: ""; position: absolute; inset: 0; opacity: .5;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 34px 34px; mask-image: radial-gradient(720px 520px at 38% 22%, #000, transparent 75%);
}
.auth-brand-inner { position: relative; max-width: 430px; }
.auth-logo { width: min(330px, 82%); height: auto; display: block; margin-bottom: 1.7rem; }
.auth-tag { font-size: 1.06rem; color: #b9c7d6; line-height: 1.5; margin: 0 0 1.7rem; }
.auth-points { list-style: none; margin: 0; padding: 0; display: grid; gap: .85rem; }
.auth-points li { display: flex; align-items: flex-start; gap: .65rem; font-size: .92rem; color: #cdd8e3; line-height: 1.4; }
.auth-points .dot { width: 9px; height: 9px; border-radius: 50%; margin-top: .32rem; flex: none; }
.auth-points .dot.ok { background: #4ecd8a; } .auth-points .dot.due { background: #e8b93d; } .auth-points .dot.info { background: #7fb2ff; }
.auth-brand-foot { margin: 2rem 0 0; font-family: var(--mono); font-size: .8rem; letter-spacing: .07em; color: #7f93a8; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 3rem 2rem; background: var(--surface); }
.auth-form { width: 100%; max-width: 384px; }
.auth-form h1 { font-size: 1.7rem; letter-spacing: -.02em; margin: 0 0 .2rem; }
.auth-form > .muted { margin: 0 0 1.5rem; font-size: .92rem; }
@media (max-width: 860px) {
  .auth-split { grid-template-columns: 1fr; }
  .auth-brand { padding: 2.4rem 1.5rem 2rem; border-right: none; border-bottom: 3px solid var(--brass); }
  .auth-brand-inner { max-width: 540px; text-align: center; margin: 0 auto; }
  .auth-logo { margin: 0 auto 1.1rem; }
  .auth-tag { font-size: .98rem; margin-bottom: 0; }
  .auth-points, .auth-brand-foot { display: none; }
  .auth-panel { padding: 2rem 1.4rem 2.6rem; }
}

/* ---- notifications: topbar bell, center, preferences (ADR-030) ---- */
.bell { position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 8px; color: var(--ink-soft); font-size: 1rem; flex: none; }
.bell:hover { background: var(--surface-2); }
.bell .bell-ic { filter: grayscale(1); opacity: .7; line-height: 1; }
.bell.has-unread .bell-ic { filter: none; opacity: 1; }
.bell .bell-badge { position: absolute; top: -2px; right: -3px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 9px; background: var(--over); color: #fff; font-size: .66rem; font-weight: 700;
  line-height: 16px; text-align: center; border: 2px solid var(--surface); }

.note.ok { background: var(--ok-bg); border-color: color-mix(in srgb, var(--ok) 26%, transparent); color: var(--ok); }
.note.over { background: var(--over-bg); border-color: color-mix(in srgb, var(--over) 26%, transparent); color: var(--over); }

.notif-list { list-style: none; margin: 0; padding: 0; }
.notif-item { display: flex; gap: .8rem; align-items: flex-start; padding: .85rem .4rem;
  border-bottom: 1px solid var(--line-soft); }
.notif-item:last-child { border-bottom: none; }
.notif-item.unread { background: color-mix(in srgb, var(--info-bg) 55%, transparent); }
.notif-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: .38rem; flex: none; background: var(--ink-faint); }
.notif-dot.ok { background: var(--ok); } .notif-dot.due { background: var(--due); }
.notif-dot.over { background: var(--over); } .notif-dot.info { background: var(--info); }
.notif-body { flex: 1; min-width: 0; }
.notif-title { font-weight: 600; color: var(--ink); }
.notif-text { color: var(--ink-soft); font-size: .9rem; margin-top: .12rem; }
.notif-meta { color: var(--ink-faint); font-size: .76rem; margin-top: .3rem; }
.notif-act { flex: none; }

.pref-group { margin: 1.1rem 0 .4rem; }
.pref-group-name { margin: 0 0 .3rem; font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); }
.pref-table { width: 100%; border-collapse: collapse; }
.pref-table th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--ink-faint); font-weight: 600; padding: .3rem .4rem; border-bottom: 1px solid var(--line); }
.pref-table th.pref-col, .pref-table td.pref-col { width: 74px; text-align: center; }
.pref-table td { padding: .6rem .4rem; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.pref-table tr:last-child td { border-bottom: none; }
.pref-label { font-weight: 600; color: var(--ink); }
.pref-desc { color: var(--ink-faint); font-size: .82rem; margin-top: .1rem; }
.pref-table input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--steel); }
