/* Portfolio Platform — design system v1.
   A working desk for portfolio managers: dense, calm, exact. One typeface (IBM Plex Sans, vendored, OFL),
   tabular figures for every number, one memorable element: the drift bar. */

@font-face { font-family: "Plex"; src: url("/static/fonts/plex-sans-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex"; src: url("/static/fonts/plex-sans-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex"; src: url("/static/fonts/plex-sans-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --ground: #f3f5f2;      /* ledger paper */
  --surface: #ffffff;
  --ink: #18231f;         /* green-black */
  --ink-2: #4d5a55;       /* secondary text */
  --ink-3: #7c8883;       /* tertiary / hints */
  --rule: #dce2de;
  --rule-strong: #c4ccc7;
  --row-hover: #eef2ef;
  --accent: #1d5a48;      /* bottle green: actions, focus */
  --accent-ink: #ffffff;
  --accent-soft: #e2eee9;
  --over: #b06a12;        /* drift: overweight / attention */
  --under: #2f5f86;       /* drift: underweight */
  --breach: #a83232;
  --breach-soft: #f8e7e5;
  --ok: #2c7a4b;
  --warn-soft: #fbf1e1;
  --radius: 4px;
  --shadow: 0 1px 0 rgba(24, 35, 31, .04);
  --mono-nums: "tnum" 1, "lnum" 1;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #121816; --surface: #19211e; --ink: #e5ebe8; --ink-2: #aab5b0; --ink-3: #7f8a85; --rule: #2a3430;
    --rule-strong: #3a4641; --row-hover: #1f2925; --accent: #5fb394; --accent-ink: #0d1411; --accent-soft: #1f3a31;
    --over: #e09a45; --under: #74a6cf; --breach: #e2726b; --breach-soft: #3a2220; --ok: #6cc08d; --warn-soft: #3a2f1e;
  }
}
:root[data-theme="dark"] {
  --ground: #121816; --surface: #19211e; --ink: #e5ebe8; --ink-2: #aab5b0; --ink-3: #7f8a85; --rule: #2a3430;
  --rule-strong: #3a4641; --row-hover: #1f2925; --accent: #5fb394; --accent-ink: #0d1411; --accent-soft: #1f3a31;
  --over: #e09a45; --under: #74a6cf; --breach: #e2726b; --breach-soft: #3a2220; --ok: #6cc08d; --warn-soft: #3a2f1e;
}

* { box-sizing: border-box; }
html { font-size: 14px; }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font-family: "Plex", system-ui, sans-serif; line-height: 1.45; -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.num, td.n, th.n { font-feature-settings: var(--mono-nums); text-align: right; white-space: nowrap; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 208px 1fr; min-height: 100vh; }
.rail {
  background: var(--surface); border-right: 1px solid var(--rule); padding: 18px 0; position: sticky; top: 0;
  height: 100vh; display: flex; flex-direction: column;
}
.firm { padding: 0 18px 18px; border-bottom: 1px solid var(--rule); margin-bottom: 10px; }
.firm strong { display: block; font-weight: 600; font-size: 15px; letter-spacing: -.01em; }
.firm span { color: var(--ink-3); font-size: 12px; }
.rail nav a {
  display: flex; justify-content: space-between; padding: 7px 18px; color: var(--ink-2); font-weight: 500;
  border-left: 3px solid transparent;
}
.rail nav a:hover { background: var(--row-hover); text-decoration: none; color: var(--ink); }
.rail nav a[aria-current="page"] { color: var(--ink); border-left-color: var(--accent); background: var(--accent-soft); }
.rail nav a .count { color: var(--ink-3); font-feature-settings: var(--mono-nums); font-weight: 400; }
.rail nav a .count.alert { color: var(--breach); font-weight: 600; }
.rail .who { margin-top: auto; padding: 14px 18px 0; border-top: 1px solid var(--rule); font-size: 12px; color: var(--ink-3); }
.rail .who b { color: var(--ink-2); font-weight: 500; display: block; font-size: 13px; }
.rail .who form { margin-top: 6px; }

main { padding: 22px 28px 48px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.page-head > div:last-child:not(:first-child) { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; flex-shrink: 0; }   /* header buttons side by side (10-29) */
h1 { font-size: 22px; font-weight: 600; letter-spacing: -.015em; margin: 0; }
h2 { font-size: 15px; font-weight: 600; margin: 26px 0 10px; }
.sub { color: var(--ink-2); margin-top: 3px; }
.crumbs { color: var(--ink-3); font-size: 12px; margin-bottom: 4px; }
.crumbs a { color: var(--ink-3); }

/* ---------- key figures: one quiet line, not cards ---------- */
.figures {
  display: flex; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
  margin-bottom: 16px;
}
.figures div { padding: 12px 20px; border-right: 1px solid var(--rule); min-width: 140px; }
.figures div:last-child { border-right: 0; }
.figures dt { color: var(--ink-3); font-size: 12px; }
.figures dd { margin: 2px 0 0; font-size: 19px; font-weight: 500; font-feature-settings: var(--mono-nums); letter-spacing: -.01em; }
.figures dd.alert { color: var(--breach); }
.figures dd.attn { color: var(--over); }

/* ---------- toolbar ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.toolbar input[type=search] { width: 260px; }
.seg { display: inline-flex; border: 1px solid var(--rule-strong); border-radius: var(--radius); overflow: hidden; }
.seg a, .seg button { padding: 5px 11px; color: var(--ink-2); border-right: 1px solid var(--rule-strong); background: var(--surface); font: inherit; border-top: 0; border-bottom: 0; border-left: 0; cursor: pointer; }
.seg a:last-child, .seg button:last-child { border-right: 0; }
.seg a[aria-pressed="true"], .seg button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.seg a:hover { text-decoration: none; }
.spacer { flex: 1; }

/* ---------- forms ---------- */
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--rule-strong);
  border-radius: var(--radius); padding: 6px 9px;
  max-width: 100%; box-sizing: border-box;   /* F8: a size="60" box ran past its card on a phone (the breach page) */
}
textarea { width: 100%; min-height: 80px; }
label { display: block; color: var(--ink-2); font-size: 12px; margin-bottom: 4px; font-weight: 500; }
.field { margin-bottom: 14px; max-width: 100%; min-width: 0; }   /* F8: never wider than its row or card */
.btn {
  display: inline-block; font: inherit; font-weight: 500; padding: 6px 14px; border-radius: var(--radius);
  border: 1px solid var(--rule-strong); background: var(--surface); color: var(--ink); cursor: pointer;
}
.btn:hover { background: var(--row-hover); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--breach); border-color: var(--breach); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.linkbtn { background: none; border: 0; color: var(--accent); font: inherit; padding: 0; cursor: pointer; }

/* ---------- the data grid ---------- */
.grid-wrap { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); overflow: auto; max-height: calc(100vh - 230px); }
table.grid { border-collapse: separate; border-spacing: 0; width: 100%; }
.grid th {
  position: sticky; top: 0; z-index: 1; background: var(--surface); text-align: left; font-weight: 500; color: var(--ink-2);
  font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--rule-strong); white-space: nowrap; user-select: none;
}
.grid th[data-sort] { cursor: pointer; }
.grid th[aria-sort="ascending"]::after { content: " ▲"; font-size: 9px; }
.grid th[aria-sort="descending"]::after { content: " ▼"; font-size: 9px; }
.grid td { padding: 6px 10px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.grid tbody tr:hover td { background: var(--row-hover); }
.grid tbody tr:last-child td { border-bottom: 0; }
.grid td.name { max-width: 340px; white-space: normal; overflow-wrap: anywhere; }   /* names wrap, never cut off (10-29) */
.grid td .muted, .muted { color: var(--ink-3); }
.grid tfoot td { font-weight: 600; border-top: 1px solid var(--rule-strong); border-bottom: 0; background: var(--surface); position: sticky; bottom: 0; }
.grid tr.is-breach td:first-child { box-shadow: inset 3px 0 0 var(--breach); }
.grid tr.is-drift td:first-child { box-shadow: inset 3px 0 0 var(--over); }

/* ---------- the drift bar: centred on zero, over to the right (amber), under to the left (blue) ----------
   width scale: the bar spans ±10 % drift; the tick marks the model tolerance. */
.drift { display: inline-grid; grid-template-columns: 54px 52px; align-items: center; gap: 8px; }
.drift svg .axis { stroke: var(--rule-strong); stroke-width: 1; }
.drift svg .tick { stroke: var(--ink-3); stroke-width: 1; opacity: .6; }
.drift svg rect.o { fill: var(--over); }
.drift svg rect.u { fill: var(--under); }
.drift .v { font-feature-settings: var(--mono-nums); text-align: right; }
.drift.breach .v { color: var(--breach); font-weight: 600; }
.drift.breach svg rect { fill: var(--breach); }

/* ---------- tags ---------- */
.tag { display: inline-block; font-size: 11.5px; padding: 1px 7px; border-radius: 10px; background: var(--row-hover); color: var(--ink-2); margin-right: 3px; }
.tag.breach { background: var(--breach-soft); color: var(--breach); font-weight: 500; }
.tag.warn { background: var(--warn-soft); color: var(--over); font-weight: 500; }
.tag.ok { background: var(--accent-soft); color: var(--ok); }

/* ---------- panels, notices ---------- */
.panel { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 16px 18px; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
dl.facts dt { color: var(--ink-3); }
dl.facts dd { margin: 0; }
/* the batch page's per-account figures (bug 63) had no style and read as a stacked list (CT27) */
dl.stats { display: flex; flex-wrap: wrap; gap: 6px 32px; margin: 0 0 12px; }
dl.stats div { min-width: 120px; }
dl.stats dt { color: var(--ink-3); font-size: 12px; }
dl.stats dd { margin: 2px 0 0; font-weight: 500; font-feature-settings: var(--mono-nums); }
.notice { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 14px; border: 1px solid var(--rule); background: var(--surface); }
.notice.error { border-color: var(--breach); background: var(--breach-soft); color: var(--breach); }
.notice.warn { border-color: var(--over); background: var(--warn-soft); }
.notice.ok { border-color: var(--ok); background: var(--accent-soft); }
.notice ul { margin: 6px 0 0; padding-left: 18px; }
.empty { padding: 36px; text-align: center; color: var(--ink-2); }

/* ---------- sign-in ---------- */
.signin { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.signin form { width: 100%; max-width: 360px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 28px; }
.signin h1 { margin-bottom: 4px; }
.signin p { color: var(--ink-2); margin: 0 0 20px; }
.signin input { width: 100%; }
.signin .btn { width: 100%; padding: 8px; margin-top: 6px; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; }
  main { padding: 16px; }
  .toolbar input[type=search] { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
h2.flush { margin: 0; }
.gap-top { margin-top: 16px; }
.inline { display: inline; }
.form-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.form-row .field { margin-bottom: 0; }
.grid th.n { text-align: right; }

/* ---------- allocation bars: one hue (ink) for held, a tick for the model ---------- */
.alloc { margin: 0; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 14px 16px; }
.alloc figcaption { font-weight: 600; margin-bottom: 8px; }
.alloc figcaption .muted { font-weight: 400; font-size: 12px; }
.alloc-t { border-collapse: collapse; width: 100%; }
.alloc-t th { text-align: left; font-weight: 400; color: var(--ink-2); padding: 4px 12px 4px 0; white-space: nowrap; width: 1%; }
.alloc-t td { padding: 4px 0 4px 10px; }
.alloc-t td.track { width: 230px; padding-left: 0; }
.alloc svg .trk { fill: var(--row-hover); }
.alloc svg .act { fill: var(--accent); }
.alloc svg .tgt { stroke: var(--ink); stroke-width: 2; }
.alloc-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; margin-bottom: 16px; }

/* ---------- data freshness ---------- */
.fresh { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12px; color: var(--ink-3); margin: -6px 0 14px; }
.fresh b { color: var(--ink-2); font-weight: 500; }
.fresh .stale { color: var(--over); }

/* ---------- command palette ---------- */
.kbd { font-size: 11px; border: 1px solid var(--rule-strong); border-bottom-width: 2px; border-radius: 3px; padding: 0 5px; color: var(--ink-3); }
.searchbtn { display: flex; justify-content: space-between; align-items: center; margin: 0 14px 12px; padding: 6px 10px; width: calc(100% - 28px); text-align: left; color: var(--ink-3); }
dialog.palette { border: 1px solid var(--rule-strong); border-radius: 6px; padding: 0; width: min(640px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); box-shadow: 0 18px 50px rgba(0,0,0,.18); margin-top: 12vh; }
dialog.palette::backdrop { background: rgba(18, 26, 23, .35); }
.palette input { width: 100%; border: 0; border-bottom: 1px solid var(--rule); border-radius: 0; padding: 14px 16px; font-size: 16px; outline: none; }
.palette ul { list-style: none; margin: 0; padding: 6px 0; max-height: 50vh; overflow: auto; }
.palette li a { display: flex; justify-content: space-between; gap: 12px; padding: 8px 16px; color: var(--ink); }
.palette li a .k { color: var(--ink-3); font-size: 12px; }
.palette li[aria-selected="true"] a { background: var(--accent-soft); text-decoration: none; }
.palette .hint { padding: 8px 16px; border-top: 1px solid var(--rule); font-size: 12px; color: var(--ink-3); }
.searchbtn { white-space: nowrap; }
.rail .bell { display: flex; justify-content: space-between; align-items: center; margin: 0 14px 10px; padding: 4px 10px; font-size: 13px; color: var(--ink-2); text-decoration: none; border-radius: var(--radius); }
.rail .bell:hover, .rail .bell[aria-current] { background: var(--row-hover); }
.alloc-t { width: auto; }
.alloc-t td.n { min-width: 56px; }
.tnum { font-feature-settings: var(--mono-nums); white-space: nowrap; }
.grid th.sel, .grid td.sel { width: 28px; padding-right: 0; }
.rb-acct { margin-bottom: 22px; }
.rb-acct h2 { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.rb-acct h2 .muted { font-weight: 400; font-size: 13px; }
.rb-sum { display: flex; flex-wrap: wrap; gap: 4px 20px; color: var(--ink-2); font-size: 13px; margin: -4px 0 8px; }
.sticky-actions { position: sticky; bottom: 0; background: var(--ground); padding: 12px 0; border-top: 1px solid var(--rule); display: flex; gap: 12px; align-items: center; }
.grid td.why { white-space: normal; min-width: 320px; }
.grid td.why .tag { display: block; width: fit-content; margin-top: 3px; white-space: normal; }

/* ---------- performance ---------- */
.perf-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(440px, 1fr); gap: 16px; }
@media (max-width: 1500px) { .perf-grid { grid-template-columns: 1fr; } }   /* the period table never squeezed into a scroll box (10-29) */
svg.chart { width: 100%; height: auto; display: block; }
svg.chart .grid { stroke: var(--rule); stroke-width: 1; }
svg.chart .zero { stroke: var(--rule-strong); stroke-width: 1; }
svg.chart .ax { fill: var(--ink-3); font-size: 11px; font-feature-settings: var(--mono-nums); }
svg.chart .ln { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
svg.chart .ln.p { stroke: var(--accent); }
svg.chart .ln.b { stroke: var(--ink-3); stroke-dasharray: 5 4; }
svg.chart .end { font-size: 11.5px; fill: var(--ink-2); font-feature-settings: var(--mono-nums); }
svg.chart .hit { fill: transparent; }
svg.chart .hit:hover { fill: var(--accent); fill-opacity: .25; }
.legend { font-size: 12px; color: var(--ink-2); margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.legend .key { display: inline-block; width: 18px; height: 0; border-top: 2px solid var(--accent); }
.legend .key.b { border-top: 2px dashed var(--ink-3); }
.legend .sp { width: 14px; }
.perf-t td.pos { color: var(--ok); }
.perf-t td.neg { color: var(--breach); }
.small { font-size: 12px; }
.perf-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 26px 0 10px; }
.perf-head h2 { margin: 0; }
.chart-wrap { position: relative; }
svg.chart .ln.d { stroke: var(--breach); stroke-width: 1.5; }
.legend .key.d { border-top: 2px solid var(--breach); }
.legend .key.bar { height: 10px; width: 10px; border: 0; border-radius: 2px; background: var(--accent); }
.legend .key.b.bar { background: var(--ink-3); }
.legend .spacer { flex: 1; }
svg.chart .bar.p { fill: var(--accent); }
svg.chart .bar.b { fill: var(--ink-3); }
svg.chart .xhair { stroke: var(--ink-3); stroke-width: 1; }
svg.chart .dot.p { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
svg.chart .dot.b { fill: var(--surface); stroke: var(--ink-3); stroke-width: 2; }
svg.chart .lbl { font-size: 11.5px; fill: var(--ink-2); }
.legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.legend .dot.b { background: var(--surface); border: 2px solid var(--ink-3); }
.tip { position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--rule-strong); border-radius: 4px; padding: 6px 9px; font-size: 12px; box-shadow: 0 4px 14px rgba(0,0,0,.08); white-space: nowrap; font-feature-settings: var(--mono-nums); }
.tip b { font-weight: 600; }
.tip .r { display: flex; justify-content: space-between; gap: 14px; }
.grid.months td, .grid.months th { padding: 5px 8px; }
.grid.months td.neg { color: var(--breach); }
svg.chart.fixed { width: auto; max-width: 100%; height: auto; }
svg [hidden] { display: none; }
.perf-t td.track svg .axis { stroke: var(--rule-strong); }
.perf-t td.track svg rect.pos { fill: var(--accent); }
.perf-t td.track svg rect.neg { fill: var(--breach); }
.brand { font-weight: 600; font-size: 13px; letter-spacing: .02em; color: var(--accent); margin-bottom: 8px; display: flex; align-items: center; gap: 7px; }
.brand::before { content: ""; width: 14px; height: 14px; border-radius: 3px; background: var(--accent); box-shadow: inset 0 -5px 0 rgba(255,255,255,.35); }
.brand.big { font-size: 15px; margin-bottom: 14px; }
.firm .tag { margin-top: 6px; }
.signin .by { margin: 18px 0 0; text-align: center; }

/* ---------- brand: serif for brand moments only (IBM Plex Serif, vendored, OFL) ---------- */
@font-face { font-family: "PlexSerif"; src: url("/static/fonts/plex-serif-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "PlexSerif"; src: url("/static/fonts/plex-serif-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
.serif { font-family: "PlexSerif", Georgia, serif; font-weight: 500; letter-spacing: -.01em; }
.qmark .qm-bg { fill: var(--accent); }
.qmark .qm-post { fill: #f3efe4; }
.qmark .qm-line { fill: none; stroke: #f3efe4; stroke-width: 2; stroke-linecap: round; }
.qmark .qm-tide { stroke: #c9a45c; }
.qmark .qm-faint { opacity: .55; }
.wordmark { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; }
.wordmark .wm-text { font-size: 16px; letter-spacing: -.01em; }
.wordmark .wm-text b { font-weight: 600; }
.wordmark .wm-text span { font-weight: 400; color: var(--ink-2); }
.wordmark.light { color: #f3efe4; }
.wordmark.light .wm-text span { color: rgba(243, 239, 228, .7); }
.wordmark.light .qm-bg { fill: rgba(243, 239, 228, .12); }
.firm .wordmark { margin-bottom: 14px; }
.brand { display: none; }

/* ---------- sign-in ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(380px, 1fr); }
.auth-brand { position: relative; overflow: hidden; background: #133a30; color: #f3efe4; padding: 44px 56px; display: flex; flex-direction: column; }
.auth-copy { margin: auto 0; max-width: 30rem; padding: 48px 0 140px; }
.auth-copy h1 { font-size: 44px; line-height: 1.12; margin: 0 0 18px; color: #f8f5ec; }
.auth-copy p { font-size: 17px; line-height: 1.55; color: rgba(243, 239, 228, .78); margin: 0; }
.auth-points { position: relative; z-index: 1; list-style: none; padding: 0; margin: 0; font-size: 13.5px; color: rgba(243, 239, 228, .72); }
.auth-points li { padding-left: 18px; position: relative; margin-top: 6px; }
.auth-points li::before { content: ""; position: absolute; left: 0; top: .55em; width: 8px; height: 2px; background: #c9a45c; }
.tide { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 150px; }
.tide path { fill: none; stroke: rgba(243, 239, 228, .10); stroke-width: 1.5; }
.tide path:first-child { stroke: rgba(201, 164, 92, .45); }
.auth-form { background: var(--surface); display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 360px; }
.auth-card .eyebrow { color: var(--ink-2); font-size: 13px; margin: 0 0 6px; display: flex; gap: 8px; align-items: center; }
.auth-card h2 { font-size: 30px; margin: 0 0 26px; }
.auth-card input { width: 100%; padding: 9px 11px; }
.btn.block { width: 100%; padding: 10px; margin-top: 6px; font-size: 14.5px; }
.auth-card .fine { color: var(--ink-3); font-size: 12.5px; margin-top: 18px; line-height: 1.5; }
.auth-foot { color: var(--ink-3); font-size: 12px; margin-top: 48px; }
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand { padding: 28px 20px; }
  .auth-copy { padding: 28px 0 110px; }
  .auth-copy h1 { font-size: 32px; }
}
html, body { height: 100%; }
.auth { min-height: 100%; }
.auth-copy { padding-bottom: 40px; }
.auth-points { margin-bottom: 150px; }
body:has(.auth) { background: var(--surface); }
.auth > * { min-width: 0; }
@media (max-width: 860px) {
  .auth-copy { padding: 22px 0 70px; }
  .auth-copy p, .auth-points { display: none; }
  .auth-copy h1 { font-size: 28px; margin: 0; }
  .tide { height: 70px; }
  .auth-form { justify-content: flex-start; padding-top: 32px; }
  .auth-foot { margin-top: 32px; }
}
.inline-label { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 13px; color: var(--ink-2); font-weight: 400; }
.grid tr.subtotal td { background: var(--row-hover); border-top: 1px solid var(--rule-strong); }
.grid tbody.grp tr.subtotal:hover td { background: var(--row-hover); }
.today-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 16px; }
.today-grid .panel h2 { margin: 0 0 4px; display: flex; justify-content: space-between; align-items: baseline; }
.today-grid .panel h2 .count { font-feature-settings: var(--mono-nums); color: var(--ink-3); font-weight: 400; font-size: 13px; }
.today-grid ul { list-style: none; margin: 8px 0 0; padding: 0; }
.today-grid li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid var(--rule); }
.today-grid li .what { color: var(--ink-2); text-align: right; }
.today-grid .clear { color: var(--ok); padding: 8px 0 0; }
.firm .wordmark .wm-text b { color: var(--ink); font-size: 16px; }
.firm .wordmark .wm-text span { color: var(--ink-2); font-size: 16px; }
p.flush { margin: 0; }
code.key { display: inline-block; margin-top: 6px; padding: 6px 8px; background: var(--surface); border: 1px solid var(--rule-strong); border-radius: 4px; user-select: all; word-break: break-all; }
pre.sample { background: var(--row-hover); padding: 10px 12px; border-radius: 4px; font-size: 12px; overflow: auto; }
[data-total].bad { color: var(--breach); }
input.wide { width: 100%; }
.perf-grid > .panel { min-width: 0; overflow-x: auto; }
.perf-t { width: 100%; }

/* x-ray exposure: two wide panels a row */
.cols.wide-cols { grid-template-columns: repeat(auto-fit, minmax(480px, 1fr)); }
.stacked .form-row { margin-bottom: 14px; }
/* ---- your security, two-step sign-in ---- */
.rail .who .who-link { display: block; margin-top: 6px; color: var(--accent); text-decoration: none; }
.rail .who .who-link[aria-current] { font-weight: 500; }
.sec-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; align-items: start; }
.sec-grid .panel h2 { margin-top: 0; }
.sec-grid .panel h3 { margin: 16px 0 4px; font-size: 15px; }
.fine { color: var(--ink-3); font-size: 12.5px; line-height: 1.5; }
.secret { margin: 8px 0; }
.secret code, .backup-codes code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 17px;
  letter-spacing: .06em; background: var(--row-hover); padding: 6px 10px; border-radius: var(--radius); display: inline-block; }
.backup-codes { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, max-content); gap: 8px 18px; }
.steps-list { padding-left: 20px; margin: 0 0 12px; line-height: 1.55; }
.steps-list li { margin-bottom: 8px; }
.code-input { font-size: 20px; letter-spacing: .25em; font-family: ui-monospace, Menlo, Consolas, monospace; max-width: 12ch; }
.auth-card .lead-in { color: var(--ink-2); margin: -12px 0 18px; line-height: 1.5; }
.auth-card .code-input { max-width: none; }
td.actions form + form, td.actions form + a { margin-left: 12px; }

/* ---- client report pack (web/report_pack.py) ---- */
.report { max-width: 900px; }
.report-tools { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 16px; }
.report-head { border-bottom: 2px solid var(--line, #ccc); margin-bottom: 12px; padding-bottom: 8px; }
.report-firm { font-weight: 600; letter-spacing: .02em; }
.report-who { margin: 4px 0 0; }
.report-account { break-inside: avoid-page; margin-top: 24px; }
.report table.grid tr.total td { font-weight: 600; }
@media print {
  .no-print, nav, aside, .sidebar, header.top, .side, .palette { display: none !important; }
  body { background: #fff; color: #000; }
  main { margin: 0 !important; padding: 0 !important; }
  .report { max-width: none; }
  .report-account { break-before: page; }
}

/* ---- a field list inside a card (Import your book): the description wraps inside the card, never past its edge ---- */
.panel table.grid { width: 100%; }
.grid td.spec-help { white-space: normal; overflow-wrap: anywhere; }
.grid td.tags { white-space: normal; min-width: 140px; max-width: 320px; }   /* restriction / breach tags wrap (bug 36) */
.grid td.tags .tag { white-space: normal; margin-bottom: 2px; }

/* database feed (18i): query hint turns amber when the query would be refused; the path field takes the spare width */
.muted.attn { color: var(--over); }
.field.grow { flex: 1 1 18rem; min-width: 0; }
.field.grow input { width: 100%; box-sizing: border-box; }
textarea[data-sqlcheck] { width: 100%; box-sizing: border-box; font-family: var(--mono, monospace); }

/* sign-in page, 10-30: the same identity as the website (harbour band, Plex Sans, the product shown) */
.auth-brand { background: radial-gradient(900px 420px at 90% -10%, #24525A 0%, rgba(36,82,90,0) 60%), #0E2A2F; color: #DCE8E5; padding: 44px 56px 36px; color-scheme: dark; }
.auth-copy { margin: auto 0; padding: 0; max-width: 34rem; }
.auth-copy h1 { font-family: inherit; font-weight: 600; letter-spacing: -0.02em; font-size: 44px; line-height: 1.08; color: #fff; }
.auth-copy p { color: #C7D8D4; font-size: 17px; }
.auth-points { margin: 26px 0 0; font-size: 15px; color: #DCE8E5; }
.auth-points li { margin-top: 10px; padding-left: 20px; }
.auth-points li::before { background: #B8913A; height: 8px; width: 8px; border-radius: 2px; top: .5em; }
.auth-legal { position: relative; z-index: 1; margin-top: auto; padding-top: 24px; font-size: 13px; color: #8FAAA5; }
.auth-brand .tide { display: none; }
.auth-card h2 { font-family: inherit; font-weight: 600; letter-spacing: -0.01em; }
@media (max-width: 900px) { .auth-brand { padding-bottom: 28px; } .auth-copy { margin-top: 24px; } .auth-legal { display: none; } }
@media (min-width: 901px) { .auth { height: 100vh; min-height: 640px; grid-template-rows: minmax(0, 1fr); } .auth-brand { overflow: hidden; } .auth-form { overflow-y: auto; } }

/* sign-in: the product shown deliberately — a complete browser window, contained in the brand panel (10-30) */
.auth-frame { position: relative; z-index: 1; margin: 40px 0 0; max-width: 600px; border-radius: 10px; overflow: hidden; background: #fff;
  box-shadow: 0 24px 60px rgba(3, 14, 17, .55), 0 0 0 1px rgba(255, 255, 255, .08); }
.auth-frame-bar { height: 24px; background: #E7ECEB; display: flex; align-items: center; gap: 6px; padding: 0 10px; }
.auth-frame-bar i { width: 8px; height: 8px; border-radius: 50%; background: #C3CCCA; display: block; }
.auth-frame img { display: block; width: 100%; height: auto; }
.auth-copy { margin: auto 0 0; }
.auth-legal { margin-top: auto; }
@media (max-height: 820px), (max-width: 900px) { .auth-frame { display: none; } .auth-copy { margin: auto 0; } .auth-legal { margin-top: auto; } }
.auth-copy { padding-top: 40px; }
@media (max-height: 1000px) { .auth-frame { max-width: 500px; margin-top: 32px; } .auth-copy h1 { font-size: 38px; } }
.auth-copy h1 { text-wrap: balance; }

/* ---------- the menu, grouped by the job (10-30 flow redesign): web/navigation.py ---------- */
.rail nav { flex: 1; overflow-y: auto; min-height: 0; padding-bottom: 8px; }
.navgroup { padding: 0 0 4px; }
.navgroup + .navgroup { border-top: 1px solid var(--rule); padding-top: 4px; }
.navlabel { padding: 3px 18px 1px; color: var(--ink-3); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.rail nav a { padding: 4px 18px; line-height: 1.35; }
@media (max-width: 860px) {
  .rail { padding: 12px 0 0; }
  .rail nav { display: flex; flex-wrap: wrap; gap: 4px 2px; padding: 0 10px 10px; }
  .navgroup { display: contents; }
  .navlabel { display: none; }
  .rail nav a { padding: 4px 10px; border-left: 0; border-radius: var(--radius); }
  .rail .who { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; padding: 8px 18px 10px; }
  .rail .who b { display: inline; }
  .rail .who form { margin: 0; }
  .rail nav a .count { margin-left: 4px; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .page-head > div:last-child:not(:first-child) { justify-content: flex-start; flex-shrink: 1; }
  .figures div { min-width: 0; flex: 1 1 45%; }
}

/* ---------- tabs on long pages (client hub, account): real links (?tab=), switched in place by app.js ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--rule-strong); margin: 4px 0 18px; }
.tabs a { padding: 8px 14px; color: var(--ink-2); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); text-decoration: none; background: var(--row-hover); }
.tabs a[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.tabs a .count { margin-left: 6px; color: var(--ink-3); font-weight: 400; font-feature-settings: var(--mono-nums); }
.tabs a .count.alert { color: var(--breach); font-weight: 600; }
.tabpanel[hidden] { display: none; }
.tabpanel > h2:first-child, .tabpanel > .toolbar:first-child h2 { margin-top: 0; }
.panel > h2:first-child { margin-top: 0; }
@media (max-width: 860px) { .tabs { flex-wrap: nowrap; overflow-x: auto; } }

/* the client hub: who the client is and the attention flags, then the tabs; actions sit beside what they act on */
.hub-flags { display: flex; flex-wrap: wrap; gap: 6px; margin: -6px 0 14px; }
.grid td.acts { white-space: nowrap; text-align: right; }
.grid td.acts a + a { margin-left: 12px; }
.panel h3 { font-size: 13px; font-weight: 600; margin: 16px 0 8px; }
.panel h3:first-child { margin-top: 0; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 16px; }
ul.plain { list-style: none; margin: 0; padding: 0; }
ul.plain li { padding: 6px 0; border-top: 1px solid var(--rule); }
.acct-block { margin-top: 22px; }
.acct-block:first-child { margin-top: 0; }
.acct-block .toolbar h2 { margin: 0; }
.subnav { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--rule); margin: -4px 0 16px; }
.subnav a { padding: 6px 12px; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subnav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.subnav a:hover { text-decoration: none; color: var(--ink); }
/* server-paged tables (web/paging.py, speed fix 10-30) */
.pager { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; margin: 8px 0; }
.pager .btn[aria-disabled="true"] { opacity: .45; cursor: default; }
.grid th a.sort { color: inherit; text-decoration: none; }
.grid th a.sort:hover { text-decoration: underline; }
/* a field the last attempt needs filled (F25): the reason compliance asked for */
input.invalid { border-color: var(--breach); box-shadow: 0 0 0 2px var(--breach-soft); }
.inline-label.attn { color: var(--breach); font-weight: 600; }
.rb-cashsum { margin: 4px 0 8px; }

/* ---- the simulated firm's watch pages (web/sim_routes.py; only on a simulation copy; Tom/lead spec 10-31) ----
   >= 1024 px: the live feed on the left (~65 %), a sticky sidebar of key figures on the right (~35 %).
   < 1024 px: one column; on a phone the clock and figures first, then the feed, then coverage. Nothing scrolls sideways. */
.sim-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 8px; }
.sim-head h1 { margin: 0; }
.sim-tabs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 12px; }
.sim-version { font-size: .8rem; color: var(--ink-2); margin: 0 0 8px; }
.sim-version.sim-stale { color: var(--breach); background: var(--breach-soft); border: 1px solid var(--breach);
  border-radius: var(--radius); padding: 8px 12px; font-weight: 700; font-size: 1rem; }
.sim-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px;
  grid-template-areas: "top" "main" "bottom"; }
.sim-side { display: contents; }
.sim-side-top { grid-area: top; }
.sim-side-bottom { grid-area: bottom; }
.sim-main { grid-area: main; min-width: 0; }
@media (min-width: 1024px) {
  .sim-layout { grid-template-columns: minmax(0, 65fr) minmax(0, 35fr); grid-template-areas: "main top" "main bottom";
    grid-template-rows: auto 1fr; align-items: start; }
  .sim-side-top { position: sticky; top: 12px; }
}
.sim-side-top, .sim-side-bottom { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 12px; min-width: 0; }
.sim-clock { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.sim-clock-d { color: var(--ink-2); font-size: .9rem; }
.sim-clock-t { font-size: 1.6rem; font-weight: 700; font-feature-settings: var(--mono-nums); }
.sim-daybar { margin: 6px 0 4px; }
.sim-figs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.sim-fig { border: 1px solid var(--rule); border-radius: var(--radius); padding: 8px 10px; min-width: 0;
  display: grid; grid-template-rows: 2.4em auto 1.2em; }
.sim-fig-l { font-size: .74rem; color: var(--ink-2); line-height: 1.2; overflow-wrap: anywhere; }
.sim-fig-v { font-size: 1.25rem; font-weight: 650; font-feature-settings: var(--mono-nums); line-height: 1.3;
  overflow-wrap: anywhere; }
.sim-fig-n { font-size: .72rem; color: var(--ink-3); line-height: 1.3; overflow-wrap: anywhere; }
.sim-fig.sim-bad .sim-fig-v, td.sim-bad { color: var(--breach); }
.sim-fig.sim-good .sim-fig-v { color: var(--ok); }
.sim-health { margin: 0 0 12px; }
.sim-health-t { width: 100%; border-collapse: collapse; font-size: .76rem; margin-top: 4px; }
.sim-health-t th, .sim-health-t td { padding: 3px 4px; border-bottom: 1px solid var(--rule); text-align: left;
  font-weight: 400; color: var(--ink-2); }
.sim-health-t td { color: var(--ink); overflow-wrap: anywhere; }
.sim-health-t .n { text-align: right; font-feature-settings: var(--mono-nums); white-space: nowrap; }
.sim-health-t tr.sim-bad td, span.sim-bad { color: var(--breach); font-weight: 600; }
.sim-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); gap: 12px;
  margin-bottom: 16px; }
.sim-meter { margin: 0 0 10px; }
.sim-meter-l { font-size: .78rem; color: var(--ink-2); display: flex; justify-content: space-between; gap: 8px; }
.sim-meter-n { font-feature-settings: var(--mono-nums); }
.sim-bar { width: 100%; height: 8px; display: block; }
.sim-bar-bg { fill: var(--rule); }
.sim-bar-fg { fill: var(--accent); }
.sim-spark { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 12px; }
.sim-spark svg { max-width: 60%; height: auto; }
.sim-spark-line { fill: none; stroke: var(--accent); stroke-width: 1.6; }
.sim-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 8px; }
.sim-filters select { max-width: 100%; min-width: 0; flex: 1 1 140px; }
.sim-live { margin-left: auto; }
.sim-feed { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.sim-ev { padding: 8px 4px; border-bottom: 1px solid var(--rule); min-width: 0; }
.sim-ev-top { font-size: .8rem; color: var(--ink-2); overflow-wrap: anywhere; }
.sim-ev-when { font-feature-settings: var(--mono-nums); color: var(--ink-3); }
.sim-ev-who { color: var(--ink); }
.sim-ev-what { margin-top: 2px; overflow-wrap: anywhere; }
.sim-ev-why { margin-top: 2px; font-size: .85rem; color: var(--ink-2); font-style: italic; overflow-wrap: anywhere; }
.sim-ev.sim-new { animation: sim-in 2.5s ease-out; }
@keyframes sim-in { from { background: var(--accent-soft); } to { background: transparent; } }
.sim-jobs { width: 100%; margin-bottom: 16px; }
.sim-list { margin: 4px 0; padding-left: 18px; }
.sim-list code { overflow-wrap: anywhere; word-break: break-all; }
.sim-steps { overflow-wrap: anywhere; }
.sim-bugs { table-layout: fixed; width: 100%; }
.sim-bugs td, .sim-bugs th { overflow-wrap: anywhere; white-space: normal; }
.sim-bugs tr.sim-new { animation: sim-in 3s ease-out; }
.sim-big { font-size: 1rem; font-weight: 600; }
.sim-dl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; margin: 8px 0; }
.sim-dl dt { color: var(--ink-2); }
.sim-dl dd { margin: 0; text-align: right; font-feature-settings: var(--mono-nums); }
/* on a phone the watch pages open on the firm, not on the product's ~20-link menu (lead 10-31): the menu is folded
   away on these pages only (their own tabs lead everywhere a watcher goes; "Full menu" opens Today with the menu) */
@media (max-width: 700px) {
  body:has(.sim-tabs) .rail nav, body:has(.sim-tabs) .rail .searchbtn, body:has(.sim-tabs) .rail .bell { display: none; }
}
.sim-tabs .sim-fullmenu { display: none; }
@media (max-width: 700px) { .sim-tabs .sim-fullmenu { display: inline-flex; } }
