/* GI Incentive Portal — one stylesheet, light + dark from the same tokens.
   Brand: GenXAI (genxai.com) — blue #194BAF, green #4C9E5C, navy #00073D, Sora for display, Roboto for text. */
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 100 900; font-stretch: 100%; font-display: swap; src: url(fonts/roboto-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 100 900; font-stretch: 100%; font-display: swap; src: url(fonts/roboto-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Sora"; font-style: normal; font-weight: 100 800; font-display: swap; src: url(fonts/sora-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Sora"; font-style: normal; font-weight: 100 800; font-display: swap; src: url(fonts/sora-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
:root {
  color-scheme: light;
  --brand-blue: #194baf;
  --brand-green: #4c9e5c;
  --brand-navy: #00073d;
  --gradient-cta: linear-gradient(135deg, #4c9e5c, #194baf);
  --font-display: "Sora", system-ui, -apple-system, sans-serif;
  --font-body: "Roboto", system-ui, -apple-system, sans-serif;
  --plane: #f7f8fc;
  --surface: #ffffff;
  --surface-2: #f2f5fb;
  --ink: #00073d;
  --ink-2: #3d5278;
  --muted: #5a607a;
  --line: #e2e8f2;
  --line-strong: #cbd5e4;
  --accent: #194baf;
  --accent-ink: #ffffff;
  --accent-wash: #eef2ff;
  --series-1: #194baf;   /* new business */
  --series-2: #4c9e5c;   /* renewal */
  --series-3: #00073d;   /* incentive */
  --track: #e7ecf6;
  --good: #4c9e5c;  --good-ink: #2e7a3e;  --good-wash: #e7f6ea;
  --warn: #fab219;  --warn-ink: #7a4a00;  --warn-wash: #fdf2d8;
  --crit: #d03b3b;  --crit-ink: #a32222;  --crit-wash: #fbe7e7;
  --info-ink: #194baf; --info-wash: #eef2ff;
  --shadow: 0 1px 2px rgba(0,7,61,.05);
}
/* The theme is written onto <html> by the server (data-theme), so a page never paints in the wrong one. */
:root[data-theme="dark"] {
    color-scheme: dark;
    --plane: #00073d;          /* Deep Navy */
    --surface: #06114a;
    --surface-2: #0c1b57;
    --ink: #ffffff;
    --ink-2: #c5d0ea;
    --muted: #8f9cc4;
    --line: #152868;
    --line-strong: #1f397e;    /* navy tint 2 */
    --accent: #5c9eff;         /* blue tint 4 */
    --accent-ink: #00073d;
    --accent-wash: #13286b;
    --series-1: #5c9eff;
    --series-2: #83df92;       /* green tint 3 */
    --series-3: #a6a8ab;       /* black tint 4 */
    --track: #152868;
    --good-ink: #83df92; --good-wash: #0f3a34;
    --warn-ink: #fab219; --warn-wash: #3a2e10;
    --crit-ink: #ee7b7b; --crit-wash: #3b1919;
    --info-ink: #5c9eff; --info-wash: #13286b;
    --shadow: none;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    color-scheme: dark;
    --plane: #00073d;          /* Deep Navy */
    --surface: #06114a;
    --surface-2: #0c1b57;
    --ink: #ffffff;
    --ink-2: #c5d0ea;
    --muted: #8f9cc4;
    --line: #152868;
    --line-strong: #1f397e;    /* navy tint 2 */
    --accent: #5c9eff;         /* blue tint 4 */
    --accent-ink: #00073d;
    --accent-wash: #13286b;
    --series-1: #5c9eff;
    --series-2: #83df92;       /* green tint 3 */
    --series-3: #a6a8ab;       /* black tint 4 */
    --track: #152868;
    --good-ink: #83df92; --good-wash: #0f3a34;
    --warn-ink: #fab219; --warn-wash: #3a2e10;
    --crit-ink: #ee7b7b; --crit-wash: #3b1919;
    --info-ink: #5c9eff; --info-wash: #13286b;
    --shadow: none;
  }
}
/* accents: brand colours only (blue is the default; an older saved choice falls back to it) */
:root[data-accent="green"] { --accent: #4c9e5c; --accent-wash: #e7f6ea; }
:root[data-theme="dark"][data-accent="green"] { --accent: #83df92; --accent-wash: #0f3a34; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"])[data-accent="green"] { --accent: #83df92; --accent-wash: #0f3a34; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--plane); color: var(--ink);
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; line-height: 1.25; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 15px; margin: 0; }
.sub { color: var(--ink-2); margin: 2px 0 0; font-size: 13px; }
.muted { color: var(--muted); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mono { font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); }

/* shell: rail + top bar */
.shell { display: flex; min-height: 100vh; }
.rail { --w: 58px; width: var(--w); flex: none; background: var(--surface); border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; z-index: 30; overflow: hidden; transition: width .14s ease; }
.rail-pinned .rail, .rail:hover, .rail:focus-within, .rail.open { --w: 232px; }
.shell:not(.rail-pinned) .rail { position: fixed; left: 0; }             /* peeking: lies over the page instead of pushing it */
.shell:not(.rail-pinned) .rail:hover, .shell:not(.rail-pinned) .rail:focus-within { box-shadow: 8px 0 28px rgba(0,0,0,.16); }
.shell:not(.rail-pinned) .main { margin-left: 58px; }
.rail .brand { height: 56px; padding: 0 16px; flex: none; border-bottom: 1px solid var(--line); }
.rail-t { opacity: 0; white-space: nowrap; transition: opacity .1s; }
.rail-pinned .rail-t, .rail:hover .rail-t, .rail:focus-within .rail-t, .rail.open .rail-t { opacity: 1; }
.rail-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 8px; display: flex; flex-direction: column; gap: 1px; }
.rail-nav a, .rail-pin { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 8px; color: var(--ink-2); font-weight: 500; white-space: nowrap; }
.rail-nav a:hover, .rail-pin:hover { background: var(--surface-2); text-decoration: none; }
.rail-nav a.on { background: var(--accent-wash); color: var(--accent); }
.rail-g { font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); padding: 12px 12px 4px; height: 30px; }
.rail-pin { margin: 8px; border: 0; background: none; font: inherit; cursor: pointer; flex: none; }
.rail-pin[aria-pressed="true"] { color: var(--accent); }
.ic { flex: none; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; height: 56px; display: flex; align-items: center; gap: 14px; padding: 0 20px; }
.topbar-title { font-weight: 650; font-size: 15px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand { font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 15px; flex: none; }
.who { display: flex; align-items: center; gap: 6px; }
.who-text { text-align: left; line-height: 1.25; }
.who-text strong { display: block; font-size: 13px; }
.who-text span { font-size: 12px; color: var(--muted); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--accent-wash); color: var(--accent); display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.icon-btn { border: 0; background: none; color: var(--ink-2); width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); }
.menu { position: relative; }
.menu summary { list-style: none; display: flex; align-items: center; gap: 9px; cursor: pointer; padding: 4px 8px; border-radius: 9px; }
.menu summary::-webkit-details-marker { display: none; }
.menu summary:hover { background: var(--surface-2); }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.16);
  min-width: 190px; padding: 6px; display: grid; z-index: 40; }
.menu-pop a { padding: 8px 11px; border-radius: 7px; color: var(--ink); }
.menu-pop a:hover { background: var(--surface-2); text-decoration: none; }
.only-narrow { display: none; }
.page { width: 100%; max-width: 1480px; margin: 0 auto; padding: 20px 20px 60px; }
@media (max-width: 860px) {
  .shell .rail, .shell.rail-pinned .rail { position: fixed; left: 0; --w: 0px; border: 0; }
  .shell .rail.open { --w: 240px; box-shadow: 8px 0 28px rgba(0,0,0,.2); }
  .shell .main, .shell:not(.rail-pinned) .main { margin-left: 0; }
  .only-narrow { display: grid; } .hide-narrow { display: none; }
}

/* controls */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 8px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent); filter: brightness(1.08); }
.btn-ghost { border-color: transparent; color: var(--ink-2); }
.btn-sm { padding: 3px 9px; font-size: 12px; border-radius: 6px; }
.btn:focus-visible, select:focus-visible, input:focus-visible, .seg button:focus-visible, .rowlink:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
select, textarea, input[type=text], input[type=password], input[type=number], input[type=search], input[type=email], input[type=date], input[type=month], input[type=file] {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; padding: 7px 10px; min-width: 0; }
input[type=number] { width: 84px; text-align: right; font-variant-numeric: tabular-nums; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin: 16px 0; }
.field { display: flex; flex-direction: column; gap: 3px; }
.field > span { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg button { font: inherit; border: 0; background: none; color: var(--ink-2); padding: 7px 12px; cursor: pointer; border-left: 1px solid var(--line); }
.seg button:first-child { border-left: 0; }
.seg button.on { background: var(--accent-wash); color: var(--accent); font-weight: 600; }

/* page heading + breadcrumb */
.head { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: end; }
.crumbs { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 13px; color: var(--muted); margin-bottom: 4px; min-height: 20px; }
.crumbs button { font: inherit; background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; }
.crumbs button:hover { text-decoration: underline; }
.note { font-size: 12.5px; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 11px; margin: 0 0 14px; }

/* cards + tiles */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); min-width: 0; }
.card-h { padding: 14px 18px 12px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; align-items: start; flex-wrap: wrap; }
.card-b { padding: 16px 18px; }
.grid { display: grid; gap: 14px; }
.tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 14px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 14px; }
.cols-21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); margin-bottom: 14px; }
.stack { margin-bottom: 14px; }
@media (max-width: 1100px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cols-21 { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .cols-2 { grid-template-columns: 1fr; } .who-text { display: none; } .topbar { gap: 8px; padding: 0 12px; } .page { padding: 16px 12px 48px; } }
@media (max-width: 520px) { .tiles { grid-template-columns: 1fr; } }
.tile { padding: 15px 18px 14px; display: flex; flex-direction: column; gap: 4px; }
.tile.attn { border-color: color-mix(in srgb, var(--warn) 55%, var(--line)); }
.tile-l { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.tile-row { display: flex; justify-content: space-between; align-items: end; gap: 10px; }
.tile-v { font-size: 26px; font-weight: 650; line-height: 1.15; letter-spacing: -.02em; }
.tile.attn .tile-v { color: var(--warn-ink); }
.tile-s { font-size: 12.5px; color: var(--ink-2); }
.delta { font-size: 12px; font-weight: 600; }
.delta.up { color: var(--good-ink); } .delta.down { color: var(--crit-ink); } .delta.flat { color: var(--muted); }
.spark { width: 96px; height: 30px; flex: none; }
.meter { height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; margin-top: 4px; }
.meter > i { display: block; height: 100%; border-radius: 3px; background: var(--series-1); }
.meter.good > i { background: var(--good); } .meter.low > i { background: var(--crit); } .meter.mid > i { background: var(--warn); }

/* charts */
.chart { position: relative; height: 280px; }
.chart.sm { height: 220px; }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--ink-2); align-items: center; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.empty { color: var(--muted); padding: 28px 0; text-align: center; }

/* slab list */
.slab { display: grid; grid-template-columns: 230px 1fr auto; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.slab:last-child { border-bottom: 0; }
.slab-n { font-weight: 600; } .slab-n span { display: block; font-weight: 400; font-size: 12px; color: var(--muted); }
.slab-bar { height: 10px; border-radius: 0 4px 4px 0; background: var(--series-1); min-width: 2px; }
.slab-bar.none { background: var(--line-strong); }
.slab-v { font-size: 13px; color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 520px) { .slab { grid-template-columns: 96px 1fr; } .slab-v { grid-column: 1 / -1; text-align: left; } }

/* tables */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-2); text-align: left;
  padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface); }
.tbl th.num { text-align: right; }
.tbl th button { all: unset; cursor: pointer; }
.tbl th button:hover { color: var(--accent); }
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--surface-2); }
.tbl tfoot td { font-weight: 650; border-top: 1px solid var(--line-strong); border-bottom: 0; }
.tbl .name { font-weight: 600; min-width: 210px; }
.tbl .name small { display: block; font-weight: 400; }
.rowlink { font: inherit; font-weight: 600; background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; text-align: left; }
.rowlink:hover { text-decoration: underline; }
.ach { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.ach .meter { width: 70px; margin: 0; flex: none; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.pill-good { background: var(--good-wash); color: var(--good-ink); }
.pill-warn { background: var(--warn-wash); color: var(--warn-ink); }
.pill-info { background: var(--info-wash); color: var(--info-ink); }
.pill-crit { background: var(--crit-wash); color: var(--crit-ink); }
.pill-muted { background: var(--surface-2); color: var(--ink-2); border-color: var(--line); }
.pill-slab { background: var(--accent-wash); color: var(--accent); }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; border-top: 1px solid var(--line); gap: 10px; flex-wrap: wrap; }

/* statement */
.stmt { display: grid; grid-template-columns: 1fr auto; gap: 8px 24px; font-size: 14px; }
.stmt dt { color: var(--ink-2); } .stmt dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.stmt .tot { font-weight: 700; border-top: 1px solid var(--line-strong); padding-top: 8px; color: var(--ink); }

/* flash + login */
.flash { padding: 10px 14px; border-radius: 9px; margin-bottom: 14px; font-weight: 500; display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.flash-x { border: 0; background: none; color: inherit; font-size: 18px; line-height: 1; cursor: pointer; opacity: .7; }
.flash-ok { background: var(--good-wash); color: var(--good-ink); }
.flash-err { background: var(--crit-wash); color: var(--crit-ink); }
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-box { width: 100%; max-width: 860px; display: grid; grid-template-columns: 1fr 1fr; }
.login-box > div { padding: 28px; }
.login-box > div + div { border-left: 1px solid var(--line); background: var(--surface-2); border-radius: 0 12px 12px 0; }
.login form { display: grid; gap: 12px; margin-top: 18px; }
.login label { display: grid; gap: 4px; font-weight: 500; font-size: 13px; }
.demo-list { display: grid; gap: 8px; margin-top: 12px; }
.demo-list button { all: unset; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; padding: 9px 12px; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--line); }
.demo-list button:hover { border-color: var(--accent); }
@media (max-width: 700px) { .login-box { grid-template-columns: 1fr; } .login-box > div + div { border-left: 0; border-top: 1px solid var(--line); border-radius: 0 0 12px 12px; } }

/* chart tooltip */
#tip { position: fixed; pointer-events: none; z-index: 50; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 9px;
  padding: 8px 11px; font-size: 12.5px; box-shadow: 0 6px 20px rgba(0,0,0,.14); opacity: 0; transition: opacity .08s; min-width: 150px; }
#tip b { display: block; margin-bottom: 4px; }
#tip div { display: flex; justify-content: space-between; gap: 16px; color: var(--ink-2); }
#tip div span:last-child { color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 600; }
#tip i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; }
.loading { opacity: .5; transition: opacity .15s; }

/* ---------- density ---------- */
:root[data-density="compact"] body { font-size: 13px; }
:root[data-density="compact"] .tbl td, :root[data-density="compact"] .tbl th { padding: 6px 10px; }
:root[data-density="compact"] .card-b { padding: 12px 14px; }
:root[data-density="compact"] .tile { padding: 11px 14px 10px; }
:root[data-density="compact"] .tile-v { font-size: 22px; }

/* ---------- shared components ---------- */
.tile-link { color: inherit; } .tile-link:hover { text-decoration: none; border-color: var(--accent); }
.tiles-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .tiles-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1100px) { .tiles-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .tiles-3 { grid-template-columns: 1fr; } }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 14px; }
.cols-12 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); margin-bottom: 14px; }
@media (max-width: 1100px) { .cols-3, .cols-12 { grid-template-columns: 1fr; } }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn-danger { color: var(--crit-ink); border-color: color-mix(in srgb, var(--crit) 45%, var(--line-strong)); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 14px 0; overflow-x: auto; }
.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; }
.tabs a.on { color: var(--accent); border-bottom-color: var(--accent); }
.tabs .count { font-size: 11px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 0 6px; margin-left: 5px; color: var(--ink-2); }
.form { display: grid; gap: 14px; max-width: 760px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .wide { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.form label, .form-grid label { display: grid; gap: 4px; font-weight: 500; font-size: 13px; }
.form label small, .form-grid label small, .hint { font-weight: 400; color: var(--muted); font-size: 12px; }
.form input:not([type=checkbox]):not([type=radio]), .form select, .form textarea, .form-grid input:not([type=checkbox]):not([type=radio]), .form-grid select, .form-grid textarea { width: 100%; text-align: left; }
textarea { min-height: 90px; resize: vertical; }
.err { color: var(--crit-ink); font-size: 12.5px; font-weight: 500; }
.check { display: flex !important; align-items: center; gap: 8px; font-weight: 400 !important; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; font-size: 13.5px; }
.kv dt { color: var(--ink-2); } .kv dd { margin: 0; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); font: inherit; font-size: 12.5px; cursor: pointer; }
.chip:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.banner { padding: 11px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); margin-bottom: 14px; font-size: 13.5px; }
.banner.warn { background: var(--warn-wash); color: var(--warn-ink); border-color: transparent; }
.banner.crit { background: var(--crit-wash); color: var(--crit-ink); border-color: transparent; }
.banner.info { background: var(--info-wash); color: var(--info-ink); border-color: transparent; }
.banner.good { background: var(--good-wash); color: var(--good-ink); border-color: transparent; }
.neg { color: var(--crit-ink); } .pos { color: var(--good-ink); }
.tbl td.wrap { white-space: normal; min-width: 240px; }
.tbl.dense td, .tbl.dense th { padding: 6px 10px; }
.tbl thead.sticky th { position: sticky; top: 56px; z-index: 5; }
.tbl th.grp { text-align: center; border-left: 1px solid var(--line); background: var(--surface-2); }
.tbl .lb { border-left: 1px solid var(--line); }
.tbl tr.off td { color: var(--muted); }
.tbl tr.off td:first-child { text-decoration: line-through; text-decoration-color: var(--line-strong); }
.bar-cell { display: flex; align-items: center; gap: 8px; } .bar-cell i { display: block; height: 8px; border-radius: 0 3px 3px 0; background: var(--series-1); min-width: 2px; }
.steps { display: flex; gap: 6px; flex-wrap: wrap; margin: 14px 0; padding: 0; list-style: none; counter-reset: st; }
.steps li { counter-increment: st; display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 13px; background: var(--surface); }
.steps li::before { content: counter(st); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-weight: 700; font-size: 12px; }
.steps li.done { color: var(--good-ink); } .steps li.done::before { content: "✓"; background: var(--good-wash); }
.steps li.on { color: var(--accent); border-color: var(--accent); font-weight: 600; } .steps li.on::before { background: var(--accent); color: var(--accent-ink); }
.trace { list-style: none; margin: 0; padding: 0; counter-reset: tr; }
.trace li { counter-increment: tr; display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.trace li:last-child { border-bottom: 0; }
.trace li::before { content: counter(tr); width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; font-size: 11.5px; font-weight: 700; color: var(--ink-2); }
.trace b { display: block; } .trace span { color: var(--ink-2); font-size: 13px; }
.trace li.stop::before { background: var(--crit-wash); color: var(--crit-ink); border-color: transparent; }
.trace li.shadow span { text-decoration: line-through; color: var(--muted); }
.diff-old { background: var(--crit-wash); color: var(--crit-ink); padding: 1px 6px; border-radius: 5px; text-decoration: line-through; }
.diff-new { background: var(--good-wash); color: var(--good-ink); padding: 1px 6px; border-radius: 5px; }

/* dialogs */
.dlg { border: 1px solid var(--line-strong); border-radius: 12px; padding: 20px; background: var(--surface); color: var(--ink); max-width: min(560px, 92vw); width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.dlg::backdrop { background: rgba(10,10,14,.45); }
.dlg h2 { margin-bottom: 12px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.dlg p { margin: 0; }

/* editable grid: a cell reads as text until touched; the dotted underline is the affordance */
.dg td[data-field] { cursor: text; }
.dg td[data-field] > span { border-bottom: 1px dotted var(--line-strong); padding-bottom: 1px; }
.dg td[data-field].dirty { background: var(--warn-wash); }
.dg td[data-field].bad { background: var(--crit-wash); }
.dg td[data-field].saved { background: var(--good-wash); transition: background 1.2s; }
.dg td[data-field] input, .dg td[data-field] select { width: 100%; min-width: 70px; padding: 3px 6px; border-radius: 5px; }
.dg td .cell-err { display: block; color: var(--crit-ink); font-size: 11.5px; }
.savebar { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); background: var(--ink); color: var(--plane); border-radius: 12px; padding: 9px 10px 9px 16px;
  display: flex; align-items: center; gap: 12px; z-index: 60; box-shadow: 0 10px 30px rgba(0,0,0,.3); font-weight: 500; }
.savebar .btn { border-color: transparent; }

/* Ask Advico drawer */
.nova { position: fixed; right: 0; top: 0; bottom: 0; width: min(430px, 100vw); background: var(--surface); border-left: 1px solid var(--line-strong); z-index: 70; display: flex; flex-direction: column;
  box-shadow: -12px 0 40px rgba(0,0,0,.18); }
.nova[hidden] { display: none; }
.nova-h { padding: 14px 16px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; align-items: center; }
.nova-h strong { display: flex; align-items: center; gap: 7px; } .nova-h .muted { grid-column: 1; font-size: 12px; } .nova-h .icon-btn { grid-row: 1 / span 2; grid-column: 2; }
.nova-log { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.nova-chips { padding: 8px 16px; display: flex; gap: 6px; flex-wrap: wrap; border-top: 1px solid var(--line); }
.nova-f { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); } .nova-f input { flex: 1; }
.msg-q { align-self: flex-end; background: var(--accent-wash); color: var(--accent); padding: 7px 12px; border-radius: 12px 12px 2px 12px; max-width: 88%; font-weight: 500; }
.msg-a { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px 12px 12px 2px; padding: 11px 13px; }
.msg-a h3 { margin: 0 0 6px; font-size: 14.5px; }
.msg-a ul { margin: 6px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 13px; }
.msg-a li { display: flex; justify-content: space-between; gap: 14px; border-bottom: 1px dashed var(--line); padding-bottom: 3px; }
.msg-a li span:last-child { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
.msg-a .links { margin-top: 8px; display: flex; gap: 10px; flex-wrap: wrap; font-size: 12.5px; }
.msg-a.refuse { border-style: dashed; color: var(--ink-2); }
@media print { .rail, .topbar, .nova, .filters, .pager, .actions, .savebar { display: none !important; } .shell .main { margin: 0 !important; } :root { color-scheme: light; --plane: #fff; --surface: #fff; --ink: #000; } }

/* ================= polish pass: type, controls, tables, spacing ================= */
:root { --radius: 10px; --ctl-h: 36px; --ring: color-mix(in srgb, var(--accent) 28%, transparent); }
:root:not([data-theme="dark"]) { --shadow: 0 1px 2px rgba(0,7,61,.04), 0 1px 3px rgba(0,7,61,.03); }
@media (prefers-color-scheme: dark) { :root[data-theme="system"] { --shadow: none; } }
body { font: 400 13.5px/1.5 var(--font-body); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
h1 { font-size: 21px; font-weight: 650; letter-spacing: -.015em; }
h2 { font-size: 14.5px; font-weight: 620; letter-spacing: -.005em; }
strong, b { font-weight: 620; }
.sub { font-size: 13px; line-height: 1.5; max-width: 110ch; }
::selection { background: var(--accent-wash); }

/* shell */
.topbar { height: 52px; backdrop-filter: saturate(1.4) blur(8px); background: color-mix(in srgb, var(--surface) 88%, transparent); }
.topbar-title { font-size: 13px; font-weight: 500; color: var(--muted); }
.rail .brand { height: 52px; font-size: 14px; }
.rail-nav { padding: 10px 8px; gap: 2px; }
.rail-nav a, .rail-pin { padding: 7px 11px; font-size: 13.5px; font-weight: 500; color: var(--ink-2); transition: background .12s, color .12s; }
.rail-nav a.on { font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
.rail-g { padding: 14px 12px 4px; height: auto; }
.page { padding: 22px 24px 64px; }
.page > .head:first-child, .page > .flash + .head { margin-bottom: 16px; }
.head { margin-bottom: 16px; align-items: flex-start; }
.head + .filters, .head + form.filters { margin-top: 0; }
.crumbs:empty { display: none; }
.crumbs { min-height: 0; margin-bottom: 6px; }
.crumbs a { color: var(--accent); }

/* controls: one height, one radius, one focus ring */
.btn { height: var(--ctl-h); padding: 0 14px; border-radius: 8px; font-weight: 550; font-size: 13.5px; line-height: 1; transition: background .12s, border-color .12s, box-shadow .12s, filter .12s; box-shadow: var(--shadow); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; box-shadow: none; }
.btn-ghost { box-shadow: none; }
.btn-primary { box-shadow: 0 1px 2px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn:active { transform: translateY(.5px); }
select, textarea, input[type=text], input[type=password], input[type=number], input[type=search], input[type=email], input[type=date], input[type=month], input[type=file] {
  height: var(--ctl-h); padding: 0 11px; border-radius: 8px; border-color: var(--line-strong); font-size: 13.5px; transition: border-color .12s, box-shadow .12s; }
textarea { height: auto; padding: 9px 11px; line-height: 1.5; }
input[type=file] { padding: 5px 8px; height: auto; }
input[type=file]::file-selector-button { font: inherit; font-weight: 550; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink); border-radius: 6px; padding: 4px 10px; margin-right: 10px; cursor: pointer; }
select { appearance: none; -webkit-appearance: none; padding-right: 30px; cursor: pointer; max-width: 100%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='%237a7f8a' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 4.5l3 3 3-3'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; }
select:hover, input:hover, textarea:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line-strong)); }
select:focus, input:focus, textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.btn:focus-visible, .seg button:focus-visible, .rowlink:focus-visible, .chip:focus-visible, a:focus-visible { outline: 0; box-shadow: 0 0 0 3px var(--ring); border-radius: 6px; }
::placeholder { color: var(--muted); opacity: .8; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; flex: none; cursor: pointer; }
input[type=number] { width: 96px; }
.seg { border-radius: 8px; height: var(--ctl-h); }
.seg button { padding: 0 13px; font-size: 13.5px; }
.filters { gap: 12px; margin: 0 0 16px; align-items: flex-end; }
.filters .btn { flex: none; }
.field > span { font-size: 10.5px; letter-spacing: .07em; }
.field .check, .filters .check { height: var(--ctl-h); }

/* forms: every control in a row sits on the same line, whatever hint text follows */
.form { gap: 16px; }
.form label, .form-grid label, .form-grid > div { align-content: start; grid-auto-rows: max-content; }
.form-grid { align-items: start; gap: 16px; }
.form label, .form-grid label { font-weight: 550; font-size: 12.5px; color: var(--ink-2); gap: 6px; }
.form label small, .form-grid label small, .hint { line-height: 1.45; }
.check { color: var(--ink) !important; font-size: 13.5px !important; align-items: flex-start !important; line-height: 1.45; padding: 3px 0; }
.check input { margin-top: 2px; }

/* cards + tiles */
.card { border-radius: 12px; }
.card-h { padding: 14px 18px; align-items: center; }
.card-h .sub { margin-top: 3px; }
.tiles { gap: 14px; }
.tile { padding: 16px 18px; gap: 6px; }
.tile-l { font-size: 10.5px; letter-spacing: .08em; color: var(--muted); }
.tile-v { font-size: 24px; font-weight: 650; white-space: nowrap; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tile-row { align-items: center; min-width: 0; }
.tile-row .tile-v { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.spark { width: 84px; flex: 0 1 84px; min-width: 40px; }
.tile-s { font-size: 12.5px; line-height: 1.45; color: var(--ink-2); }
.tile.attn { background: color-mix(in srgb, var(--warn-wash) 45%, var(--surface)); }
.tile-link { transition: border-color .12s, box-shadow .12s, transform .12s; }
.tile-link:hover { box-shadow: 0 4px 14px rgba(16,24,40,.08); transform: translateY(-1px); }
.banner { border-radius: 10px; padding: 10px 14px; line-height: 1.5; }
.head + .banner, .banner + .filters { margin-top: 0; }
.flash { border-radius: 10px; padding: 10px 14px; font-size: 13.5px; }
.note { border-radius: 10px; }

/* tables: a register is read across a row, so cells never wrap unless they are prose */
.tbl { font-size: 13px; }
.tbl th { font-size: 10.5px; letter-spacing: .07em; color: var(--muted); padding: 9px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.card > .tbl-wrap:first-child .tbl thead th:first-child { border-top-left-radius: 12px; }
.card > .tbl-wrap:first-child .tbl thead th:last-child { border-top-right-radius: 12px; }
.tbl td { padding: 9px 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl td.wrap, .tbl td.name small, .tbl td .cell-err { white-space: normal; }
.tbl td.wrap { min-width: 260px; max-width: 520px; line-height: 1.45; }
.tbl .name { min-width: 180px; font-weight: 550; }
.tbl .name small, .tbl td small { display: block; font-weight: 400; font-size: 11.5px; color: var(--muted); margin-top: 1px; white-space: nowrap; }
.tbl tbody tr:hover td { background: color-mix(in srgb, var(--accent-wash) 40%, var(--surface)); }
.tbl tfoot td { background: var(--surface-2); }
.tbl td form { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.tbl td .btn-sm + .btn-sm, .tbl td form + form, .tbl td .btn-sm + form { margin-left: 4px; }
.tbl-wrap { scrollbar-width: thin; }
.mono { font-size: 12px; }
.tbl td.mono, .tbl td .mono { color: var(--ink-2); }
.pager { padding: 10px 16px; font-size: 12.5px; }
.empty { padding: 36px 16px; }

/* pills, tabs, steps */
.pill { font-size: 11.5px; font-weight: 600; padding: 2px 9px; line-height: 1.5; }
.tabs { margin: 0 0 16px; gap: 4px; }
.tabs a { padding: 9px 12px; font-size: 13.5px; }
.tabs a.on { font-weight: 600; }
.steps { margin: 0 0 16px; }
.kv { gap: 8px 22px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.chip { height: 28px; }
.legend { font-size: 12px; }

/* dialogs */
.dlg { padding: 22px; border-radius: 14px; }
.dlg h2 { font-size: 16px; margin-bottom: 6px; }
.dlg .form, .dlg .form-grid { margin-top: 12px; }
.dlg-actions { margin-top: 20px; }
.menu-pop { border-radius: 12px; padding: 6px; }
.menu-pop a { font-size: 13.5px; }

/* sign-in */
.login { background: radial-gradient(1200px 500px at 50% -10%, var(--accent-wash), transparent 70%), var(--plane); }
.login .card { box-shadow: 0 20px 50px rgba(16,24,40,.10); border-radius: 16px; overflow: hidden; }
.login label { font-weight: 550; color: var(--ink-2); }
.login input { height: 40px; }
.login .btn { height: 40px; }
.demo-list button { border-radius: 10px; transition: border-color .12s, transform .12s; font-size: 13px; }
.demo-list button:hover { transform: translateX(2px); }
.tbl td.name small { white-space: nowrap; }
.rail-pin { margin: 0; padding: 12px 19px; border-top: 1px solid var(--line); border-radius: 0; width: 100%; font-size: 13px; }
.tbl td.name small { white-space: normal; }
.tbl .name { min-width: 230px; }
.tbl td .actions { flex-wrap: nowrap; gap: 6px; justify-content: flex-end; }
.tbl td .actions form { display: inline-flex; }
.cols-57 { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); margin-bottom: 14px; }
@media (max-width: 1100px) { .cols-57 { grid-template-columns: 1fr; } }
.tbl td.name small { white-space: nowrap; }
.tbl td.name.wrap { min-width: 200px; max-width: 300px; }
.tbl td.name.wrap small { white-space: normal; }
.tbl .name { min-width: 0; }
/* wide registers: the identity column stays put while you scroll sideways; row actions stay reachable on the right */
.tbl-wrap .tbl th:first-child, .tbl-wrap .tbl td:first-child { position: sticky; left: 0; z-index: 2; }
.tbl-wrap .tbl td:first-child { background: var(--surface); }
.tbl-wrap .tbl tbody tr:hover td:first-child { background: color-mix(in srgb, var(--accent-wash) 40%, var(--surface)); }
.tbl-wrap .tbl tfoot td:first-child { background: var(--surface-2); }
.tbl-wrap .tbl td:last-child:has(.actions), .tbl-wrap .tbl td:last-child:has(> form), .tbl-wrap .tbl td:last-child:has(> .btn) { position: sticky; right: 0; z-index: 2; background: var(--surface); box-shadow: -8px 0 8px -8px rgba(16,24,40,.12); }
.tbl-wrap .tbl tbody tr:hover td:last-child:has(.actions), .tbl-wrap .tbl tbody tr:hover td:last-child:has(> form), .tbl-wrap .tbl tbody tr:hover td:last-child:has(> .btn) { background: color-mix(in srgb, var(--accent-wash) 40%, var(--surface)); }
.dg td[data-field].dirty, .dg td[data-field].bad, .dg td[data-field].saved { position: static; }
.tbl td.actions { display: table-cell; text-align: right; white-space: nowrap; }
.tbl td.actions > * { display: inline-flex; vertical-align: middle; margin-left: 4px; }
.tbl-wrap .tbl td.actions:last-child { position: sticky; right: 0; z-index: 2; background: var(--surface); box-shadow: -8px 0 8px -8px rgba(16,24,40,.12); }
.tbl-wrap .tbl tbody tr:hover td.actions:last-child { background: color-mix(in srgb, var(--accent-wash) 40%, var(--surface)); }
.tbl td.wrap { min-width: 200px; }

/* ================= GenXAI brand ================= */
h1, h2, h3, .brand, .dlg h2 { font-family: var(--font-display); }
/* the brand gradient (green to blue) on every main action */
:root { --cta: var(--gradient-cta); --cta-ink: #ffffff; }
.btn-primary, .btn-primary:hover { background: var(--cta, var(--accent)); background-origin: border-box; border-color: transparent; color: var(--cta-ink, var(--accent-ink)); }
.brand-logo { height: 34px; width: auto; display: block; flex: none; }
.brand-x { height: 24px; width: 26px; display: block; flex: none; }
.rail .brand { padding: 0 16px; }
.rail .brand-logo { display: none; height: 32px; }
.rail-pinned .rail .brand-logo, .rail:hover .brand-logo, .rail:focus-within .brand-logo, .rail.open .brand-logo { display: block; }
.rail-pinned .rail .brand-x, .rail:hover .brand-x, .rail:focus-within .brand-x, .rail.open .brand-x { display: none; }
.login .brand-logo { height: 44px; }
.login .brand-name { font-family: var(--font-display); font-weight: 650; font-size: 15px; margin: 14px 0 0; }
/* brand guideline: white logo on a dark background */
:root[data-theme="dark"] .brand-logo { content: url(brand/genxai-logo-white.svg); }
:root[data-theme="dark"] .brand-x { content: url(brand/genxai-mark-white.svg); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) .brand-logo { content: url(brand/genxai-logo-white.svg); }
  :root:not([data-theme="light"]):not([data-theme="dark"]) .brand-x { content: url(brand/genxai-mark-white.svg); }
}
/* the X of the logo as a pale watermark behind the sign-in card, as on the guideline pages */
.login { position: relative; overflow: hidden; }
.login::before { content: ""; position: absolute; right: -6vw; bottom: -10vh; width: min(70vw, 900px); aspect-ratio: 238 / 218; background: url(brand/genxai-mark.svg) center / contain no-repeat; opacity: .06; pointer-events: none; }
.login > * { position: relative; }

/* ---- GenXAI components, as on genxai.com ---- */
/* buttons are pills in the display face: gradient for the main action, outlined (filling on hover) for the rest */
.btn { border-radius: 999px; font-family: var(--font-display); font-weight: 600; padding: 0 16px; border: 1.5px solid var(--ink); color: var(--ink); background: var(--surface); box-shadow: none; }
.btn-sm { border-radius: 999px; padding: 0 12px; }
.btn:focus-visible { border-radius: 999px; }
.btn:not([disabled]):hover { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-ghost:not([disabled]):hover { background: var(--accent-wash); border-color: transparent; color: var(--accent); }
.btn-danger { color: var(--crit-ink); border-color: var(--crit-ink); }
.btn-danger:not([disabled]):hover { background: var(--crit); border-color: var(--crit); color: #fff; }
.btn-primary { background: var(--cta, var(--accent)); background-origin: border-box; color: var(--cta-ink, var(--accent-ink)); border-color: transparent; box-shadow: 0 2px 8px color-mix(in srgb, var(--brand-blue) 28%, transparent); }
.btn-primary:not([disabled]):hover { background: var(--cta, var(--accent)); background-origin: border-box; border-color: transparent; color: var(--cta-ink, var(--accent-ink)); filter: brightness(1.08); box-shadow: 0 4px 14px color-mix(in srgb, var(--brand-blue) 34%, transparent); }
.savebar .btn:not(.btn-primary) { border-color: transparent; }
input[type=file]::file-selector-button { border-radius: 999px; font-family: var(--font-display); font-weight: 600; border: 1.5px solid var(--ink); background: var(--surface); padding: 4px 12px; }
.icon-btn { border-radius: 50%; transition: background .15s, color .15s; }
.icon-btn:hover { background: var(--accent); color: var(--accent-ink); }
.seg { border-radius: 999px; }
.seg button.on { background: var(--accent); color: var(--accent-ink); }
/* small uppercase labels are brand blue */
.rail-g, .field > span, .tile-l, .tbl th { color: var(--accent); }
.tile.attn .tile-l { color: var(--warn-ink); }
/* headings, navigation, links */
h1 { font-weight: 700; }
h2 { font-weight: 650; }
.rail-nav a, .rail-pin { color: var(--ink); }
.rail-nav a:hover, .rail-pin:hover { color: var(--accent); background: var(--accent-wash); }
.rail-nav a.on { color: var(--accent); }
.menu-pop a:hover, .tabs a:hover { color: var(--accent); }
a { font-weight: 500; }
/* cards */
.card { border-radius: 16px; }
.card > .tbl-wrap:first-child .tbl thead th:first-child { border-top-left-radius: 15px; }
.card > .tbl-wrap:first-child .tbl thead th:last-child { border-top-right-radius: 15px; }
.dlg { border-radius: 16px; }

/* ---- agent guidance: what would raise the bonus ---- */
.next-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.next-step { border: 1px solid var(--line); border-left: 4px solid var(--brand-blue); border-radius: 10px; padding: 11px 14px; background: var(--surface); }
.next-step b { display: block; font-family: var(--font-display); font-weight: 650; margin-bottom: 3px; }
.next-step span { color: var(--ink-2); font-size: 13px; line-height: 1.5; }
.next-step.persistency, .next-step.top { border-left-color: var(--brand-green); }
.next-step.gate { border-left-color: var(--warn); background: color-mix(in srgb, var(--warn-wash) 45%, var(--surface)); }
/* a table that must fit its card instead of scrolling: text wraps, figures do not */
.tbl.fit td, .tbl.fit th { padding-left: 10px; padding-right: 10px; }
.tbl.fit td.name, .tbl.fit td.name small { white-space: normal; min-width: 0; }
.tbl.fit td:first-child, .tbl.fit th:first-child { padding-left: 18px; }
@media print { .next-steps { display: block; } .next-step { margin-bottom: 8px; break-inside: avoid; } }
.answer { margin-top: 8px; padding: 8px 11px; border-left: 3px solid var(--brand-green); background: var(--surface-2); border-radius: 0 8px 8px 0; font-size: 12.5px; }
.tbl.tight td, .tbl.tight th { padding-left: 9px; padding-right: 9px; }
.tbl.tight td:first-child, .tbl.tight th:first-child { padding-left: 18px; }
.tbl.tight td.pay small { white-space: normal; max-width: 150px; }
.tbl td small.neg { color: var(--crit-ink); } .tbl td small.pos { color: var(--good-ink); }
/* inline editor of a draft grid: sits inside the cell without changing the row height or the column width */
.dg td[data-field] input, .dg td[data-field] select { height: 26px; min-width: 0; margin: -4px 0; padding: 0 6px; border-radius: 6px; vertical-align: middle; box-sizing: border-box; font: inherit; line-height: 1; }
.dg td[data-field].num input { text-align: right; }
.dg td[data-field] input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.dg td[data-field] input[type=number]::-webkit-inner-spin-button, .dg td[data-field] input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* ---- rail: main menus that open one at a time ---- */
.rail-grp { display: flex; flex-direction: column; gap: 2px; flex: none; }
.rail-gh { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 11px; border: 0; border-radius: 8px; background: none; cursor: pointer; white-space: nowrap; text-align: left;
  font: 600 13.5px var(--font-body); color: var(--ink); transition: background .12s, color .12s; }
.rail-gh:hover { background: var(--accent-wash); color: var(--accent); }
.rail-gh:focus-visible { outline: 0; box-shadow: 0 0 0 3px var(--ring); }
.rail-grp.open > .rail-gh { color: var(--accent); }
.rail-chev { margin-left: auto; display: grid; color: var(--muted); transition: transform .15s, opacity .1s; }
.rail-grp.open .rail-chev { transform: rotate(180deg); color: var(--accent); }
.rail-items { display: none; flex-direction: column; gap: 2px; }
.rail-grp.open > .rail-items { display: flex; }
.rail-items a { font-weight: 450; color: var(--ink-2); }
.rail-items a .rail-t { padding-left: 2px; }
.rail-items a.on { font-weight: 600; }

/* ---- cards, as on genxai.com: white, 16px corners, a hairline edge, a soft shadow that deepens on hover,
        and the brand gradient as a bar down the left edge (green to blue, the direction of the guideline) ---- */
:root { --card-line: rgba(0, 7, 61, .07); --card-bar: linear-gradient(180deg, #4c9e5c, #194baf);
  --shadow: 0 1px 2px rgba(0, 7, 61, .05), 0 1px 3px rgba(0, 7, 61, .04);
  --shadow-lift: 0 10px 15px -3px rgba(0, 7, 61, .10), 0 4px 6px -4px rgba(0, 7, 61, .08);
  --shadow-float: 0 20px 25px -5px rgba(0, 7, 61, .12), 0 8px 10px -6px rgba(0, 7, 61, .08); }
:root[data-theme="dark"] { --card-line: var(--line); --card-bar: linear-gradient(180deg, #83df92, #5c9eff); --shadow: none;
  --shadow-lift: 0 10px 24px rgba(0, 0, 0, .40); --shadow-float: 0 24px 48px rgba(0, 0, 0, .50); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) { --card-line: var(--line); --card-bar: linear-gradient(180deg, #83df92, #5c9eff); --shadow: none;
    --shadow-lift: 0 10px 24px rgba(0, 0, 0, .40); --shadow-float: 0 24px 48px rgba(0, 0, 0, .50); }
}
.card { border-radius: 16px; border-color: var(--card-line); box-shadow: var(--shadow); }
/* section cards: the gradient shows as a tab on the left edge, level with the title */
.card-h { position: relative; padding: 16px 20px 14px; border-bottom-color: var(--card-line); }
.card-h::before { content: ""; position: absolute; left: -1px; top: 15px; width: 4px; height: 22px; border-radius: 0 4px 4px 0; background: var(--card-bar); }
.card-h h2 { font-size: 15px; font-weight: 600; color: var(--ink); }
.card-h .sub { color: var(--muted); }
.card-b { padding: 18px 20px; }
/* figure tiles: full-height gradient bar, figure in the display face, lift on hover */
.tile { position: relative; overflow: hidden; padding: 16px 18px 16px 22px; transition: box-shadow .15s, transform .15s, border-color .15s; }
.tile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--card-bar); }
.tile.attn::before { background: var(--warn); }
.tile:hover { box-shadow: var(--shadow-lift); }
.tile-link:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); border-color: var(--card-line); }
.tile-v { font-family: var(--font-display); font-weight: 600; letter-spacing: -.025em; }
.tile-l { font-family: var(--font-display); font-weight: 700; letter-spacing: .06em; }
.tile-s { color: var(--muted); }
/* guidance cards on a statement */
.next-step { position: relative; overflow: hidden; border: 1px solid var(--card-line); border-radius: 16px; padding: 14px 16px 14px 20px; box-shadow: var(--shadow); transition: box-shadow .15s; }
.next-step::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--card-bar); }
.next-step:hover { box-shadow: var(--shadow-lift); }
.next-step.persistency::before, .next-step.top::before { background: var(--brand-green); }
.next-step.gate::before { background: var(--warn); }
.next-step b { font-weight: 600; font-size: 14px; }
.next-step span { color: var(--muted); }
/* large cards: sign-in and dialogs use the bigger 24px corner and the deep shadow */
.login .card { border-radius: 24px; box-shadow: var(--shadow-float); }
.dlg { border-radius: 24px; border: 1px solid var(--card-line); box-shadow: var(--shadow-float); }
.menu-pop { border-radius: 16px; border-color: var(--card-line); box-shadow: var(--shadow-lift); }
.note, .banner, .flash { border-radius: 12px; }
:root[data-density="compact"] .card-h { padding: 12px 16px 10px; }
:root[data-density="compact"] .card-h::before { top: 10px; }
:root[data-density="compact"] .card-b { padding: 12px 16px; }
:root[data-density="compact"] .tile { padding: 11px 14px 10px 18px; }
@media print { .card, .tile, .next-step { box-shadow: none; } }
/* the figure keeps its full width; the sparkline takes whatever room is left */
.tile-v { font-size: 22px; }
.tile-row .tile-v { flex: 0 0 auto; max-width: 100%; }
.tile-row .spark { flex: 1 1 0; min-width: 0; max-width: 84px; }
