/* PACE Bonus Optimizer styles, in PACE Consulting's look (paceconsulting.com): Arial / Helvetica type, teal #008198,
   orange #ff9143 highlights, charcoal #2b2b2b ink, light gray and light blue fills, pill buttons, flat 8px cards.
   Chart colours are PACE's teal and orange stepped to pass the dataviz checks on these surfaces (light #ffffff,
   dark #1b2022). Light is the default; dark follows the OS setting (and a data-theme="dark" stamp, if one is ever added).
   League Spartan (PACE's logo face; SIL Open Font License, static/fonts/LeagueSpartan-LICENSE.txt) is served locally
   for the brand name only: no outside requests. */
@font-face {
  font-family: "League Spartan";
  src: url("/static/fonts/league-spartan-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #f7f7f7;            /* page plane (PACE gray) */
  --panel: #ffffff;         /* card and chart surface */
  --panel-2: #f2f8fa;       /* table headers, quiet fills (PACE light blue) */
  --panel-3: #e9f1f3;
  --hover: #f2f8fa;
  --ink: #2b2b2b;           /* PACE black */
  --ink-2: #444444;
  --muted: #6d6d6d;         /* PACE dark gray */
  --tick: #6d6d6d;
  --line: #e4e8e9;
  --line-strong: #cdd6d9;
  --accent: #008198;        /* PACE teal: links and text accents (4.6:1 on white) */
  --accent-solid: #008198;  /* buttons, active states */
  --accent-hover: #006b7e;
  --accent-soft: #e0f2f5;   /* PACE other light blue */
  --orange: #ff9143;        /* PACE orange: highlights and accent bars, never small text */
  --orange-deep: #e0691c;
  --ok: #0b6b2f;
  --ok-bg: #e5f5ea;
  --ok-line: #bfe3cb;
  --warn: #8a4b00;
  --warn-bg: #fff3e6;
  --warn-line: #ffd2ad;
  --bad: #b8390a;
  --bad-bg: #fdede6;
  --bad-line: #f6c8b5;
  --pending: #6d6d6d;
  --pending-bg: #f0f2f3;
  --gain: #0b7a3b;
  --on-brand: #ffffff;
  --on-brand-2: rgba(255, 255, 255, 0.84);
  --shadow: 0 1px 2px rgba(43, 43, 43, 0.04);
  --shadow-lg: 0 2px 4px rgba(43, 43, 43, 0.05), 0 10px 28px rgba(43, 43, 43, 0.10);
  /* charts */
  --series-1: #00879f;
  --series-2: #e0691c;
  --series-3: #6b5bc4;
  --viz-gain: #00879f;
  --viz-loss: #d4420c;
  --viz-total: #b0b8bb;
  --viz-deemph: #d8dfe1;
  --viz-deemph-strong: #899396;
  --grid: #eceff0;
  --axis: #c6cdd0;
  --status-good: #0ca30c;
  --status-warning: #fab219;
  --status-critical: #d03b3b;
  --radius: 8px;
  --radius-sm: 6px;
  --font: Arial, "Helvetica Neue", Helvetica, sans-serif;
  --font-logo: "League Spartan", Arial, "Helvetica Neue", Helvetica, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --bg: #121617; --panel: #1b2022; --panel-2: #212729; --panel-3: #283033; --hover: #232b2e;
    --ink: #eef1f2; --ink-2: #c8cfd2; --muted: #9ba6aa; --tick: #959fa3; --line: #2c3437; --line-strong: #3a4549;
    --accent: #5cc8dc; --accent-solid: #00879f; --accent-hover: #0096b0; --accent-soft: #123a42;
    --orange: #ff9143; --orange-deep: #f07f35;
    --ok: #5fd38a; --ok-bg: #12301f; --ok-line: #1f4d32; --warn: #ffb27a; --warn-bg: #36230f; --warn-line: #5e3b19;
    --bad: #ff9c80; --bad-bg: #3a1a12; --bad-line: #5f2a1c; --pending: #b3bcc0; --pending-bg: #262d30; --gain: #5fd38a;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.45), 0 12px 32px rgba(0, 0, 0, 0.4);
    --series-1: #1aa0bb; --series-2: #d9661a; --series-3: #8a7ae0;
    --viz-gain: #1aa0bb; --viz-loss: #e5623a; --viz-total: #6b7578; --viz-deemph: #2f383b; --viz-deemph-strong: #7d888b;
    --grid: #252d30; --axis: #3d484c;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121617; --panel: #1b2022; --panel-2: #212729; --panel-3: #283033; --hover: #232b2e;
  --ink: #eef1f2; --ink-2: #c8cfd2; --muted: #9ba6aa; --tick: #959fa3; --line: #2c3437; --line-strong: #3a4549;
  --accent: #5cc8dc; --accent-solid: #00879f; --accent-hover: #0096b0; --accent-soft: #123a42;
  --orange: #ff9143; --orange-deep: #f07f35;
  --ok: #5fd38a; --ok-bg: #12301f; --ok-line: #1f4d32; --warn: #ffb27a; --warn-bg: #36230f; --warn-line: #5e3b19;
  --bad: #ff9c80; --bad-bg: #3a1a12; --bad-line: #5f2a1c; --pending: #b3bcc0; --pending-bg: #262d30; --gain: #5fd38a;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.45), 0 12px 32px rgba(0, 0, 0, 0.4);
  --series-1: #1aa0bb; --series-2: #d9661a; --series-3: #8a7ae0;
  --viz-gain: #1aa0bb; --viz-loss: #e5623a; --viz-total: #6b7578; --viz-deemph: #2f383b; --viz-deemph-strong: #7d888b;
  --grid: #252d30; --axis: #3d484c;
}

/* ---------------------------------------------------------------- base */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--ink); font: 14px/1.55 var(--font);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
a { color: var(--accent); text-decoration: none; text-underline-offset: 2px; }
a:hover { text-decoration: underline; }
h1 { font-size: 30px; line-height: 1.2; margin: 0 0 6px; font-weight: 700; }
h2 { font-size: 20px; line-height: 1.3; margin: 34px 0 8px; font-weight: 700; }
h3 { font-size: 15px; margin: 16px 0 6px; font-weight: 700; }
p { margin: 4px 0 8px; }
small, .muted { color: var(--muted); }
strong, b { font-weight: 700; }
code, pre { font-family: var(--mono); font-size: 12px; }
code { background: var(--panel-3); padding: 1px 5px; border-radius: 4px; }
:focus-visible { outline: 2px solid var(--accent-solid); outline-offset: 2px; border-radius: 4px; }
::selection { background: color-mix(in srgb, var(--accent-solid) 22%, transparent); }

/* ---------------------------------------------------------------- header (PACE's white nav bar) */
header.top {
  position: sticky; top: 0; z-index: 20;
  background: var(--panel); color: var(--ink); border-bottom: 1px solid var(--line);
  padding: 10px 28px; min-height: 64px;
  display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; justify-content: space-between;
}
header.top .brand {
  font-family: var(--font-logo); font-weight: 700; font-size: 20px; letter-spacing: -0.03em; line-height: 1;
  display: inline-flex; align-items: baseline; color: var(--ink); padding-top: 3px;
}
header.top .brand::after {  /* the dot that ends PACE's wordmark, in PACE orange */
  content: ""; width: 7px; height: 7px; border-radius: 50%; margin-left: 3px; background: var(--orange); flex: 0 0 auto;
}
header.top nav { display: flex; flex-wrap: wrap; gap: 2px; }
header.top nav a { color: var(--ink); padding: 6px 13px; border-radius: 999px; font-size: 14.5px;
  transition: background 0.15s ease, color 0.15s ease; }
header.top nav a:hover { color: var(--accent); text-decoration: none; }
header.top nav a.active { color: var(--accent); font-weight: 700; background: var(--accent-soft); }
header.top .snap { color: var(--muted); font-size: 12.5px; }
header.top .snap a { font-weight: 700; }
header.top .snap-wrap { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
header.top .refresh-btn {  /* PACE's "Contact us" pill */
  font-size: 13px; font-weight: 700; padding: 8px 18px; border-radius: 999px; white-space: nowrap;
  background: var(--accent-solid); color: #ffffff; border: 0; box-shadow: none;
}
header.top .refresh-btn:hover:not(:disabled) { background: var(--accent-hover); }
header.top .who { display: inline-flex; align-items: center; gap: 8px; }  /* name and Sign out wrap together */
header.top .user { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
header.top .signout-btn { font-size: 12.5px; padding: 5px 12px; }

/* ---------------------------------------------------------------- login page */
main.login { max-width: 420px; padding-top: 56px; }
.login-card { display: flex; flex-direction: column; gap: 6px; padding: 28px; }
.login-card h1 { margin: 0 0 2px; font-size: 24px; }
.login-card p.muted { margin: 0 0 12px; font-size: 14px; }
.login-card label { font-size: 13px; font-weight: 700; margin-top: 6px; }
.login-card input { width: 100%; height: 40px; }
.login-card button { margin-top: 14px; height: 40px; }
.login-error { margin: 8px 0 0; color: var(--bad); font-size: 14px; }

main { max-width: 1280px; margin: 0 auto; padding: 32px 28px 72px; }
main > h1:first-child, .page-head h1 { margin-top: 2px; }
.page-head { margin-bottom: 18px; }
.page-head p { max-width: 980px; font-size: 15px; color: var(--ink-2); }
.section-block { margin-top: 48px; }
.section-head { margin-bottom: 14px; }
.section-head h2 { margin: 0 0 6px; display: flex; align-items: center; gap: 10px; }
.section-head h2::before, main > h2::before {  /* PACE orange highlight */
  content: ""; width: 5px; height: 20px; border-radius: 3px; flex: 0 0 auto; background: var(--orange);
}
main > h2 { display: flex; align-items: center; gap: 10px; }
.section-head p { max-width: 920px; margin: 0; }
/* The dashboard's sections fold: each starts closed, and its heading is the bar that opens it */
details.fold { margin: 12px 0 0; }
main > details.fold:first-of-type { margin-top: 32px; }
details.fold[open] + details.fold { margin-top: 32px; }
details.fold > summary {
  display: flex; align-items: center; gap: 16px; padding: 14px 18px; color: var(--ink); font-size: inherit; font-weight: inherit;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
details.fold > summary::before { content: none; }  /* the plain details chevron; the Show/Hide label has its own */
details.fold > summary:hover { text-decoration: none; background: var(--hover); border-color: var(--line-strong); }
details.fold[open] > summary { margin-bottom: 14px; }
details.fold > summary h2 { flex: 1 1 auto; margin: 0; display: flex; align-items: center; gap: 10px; }
details.fold > summary h2::before {
  content: ""; width: 5px; height: 20px; border-radius: 3px; flex: 0 0 auto; background: var(--orange);
}
.fold-state { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; color: var(--accent); font-weight: 700; font-size: 13px; }
.fold-state::before { content: "Show"; }
details.fold[open] > summary .fold-state::before { content: "Hide"; }
.fold-state::after {
  content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg); transition: transform 0.15s ease;
}
details.fold[open] > summary .fold-state::after { transform: translateY(2px) rotate(-135deg); }
@media (max-width: 640px) {
  details.fold > summary { padding: 12px 14px; gap: 10px; }
  details.fold > summary h2 { font-size: 17px; }
}

.num, td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.big { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- cards (flat, like PACE's) */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 18px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px;
  box-shadow: var(--shadow);
}
.card h3 { margin: 0; font-size: 15px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.card .total { font-size: 30px; font-weight: 700; margin: 8px 0 4px; font-variant-numeric: tabular-nums; }
.card ul { list-style: none; padding: 0; margin: 10px 0 0; }
.card li { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; }
.card .section { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 12px; }
.card .cliff { font-size: 13px; margin-top: 8px; }
.card li .qval { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.card > ul:first-child, .card .section > ul { margin-top: 0; }  /* the card's padding or the section rule is the gap */
.card .card-sub { font-size: 12.5px; line-height: 1.45; margin: 0 0 6px; }  /* what the list below it is */
/* A carrier card's bonus parts: on hover, focus or tap, a panel lists the deals each is calculated on */
.carrier-card li.has-deals { cursor: pointer; margin: 0 -8px; padding: 4px 8px; border-radius: var(--radius-sm); }
.carrier-card li.has-deals:hover, .carrier-card li.has-deals.open { background: var(--hover); }
.deal-hint { margin-left: 3px; font-size: 12px; color: var(--accent); white-space: nowrap; border-bottom: 1px dotted currentColor; }
.deal-pop {
  position: fixed; z-index: 60; max-height: min(460px, calc(100vh - 16px));  /* width: set to fit beside the part */
  overflow-y: auto; overscroll-behavior: contain; padding: 0 14px 12px; font-size: 13px; line-height: 1.45;
  background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-top: 3px solid var(--accent-solid);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent;
}
.deal-pop[hidden] { display: none; }
.deal-pop:focus { outline: none; }
.deal-pop-head {
  position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; gap: 12px; padding: 10px 0 8px;
  font-weight: 700; background: var(--panel); border-bottom: 1px solid var(--line);
}
.deal-pop-intro { font-size: 12px; margin: 8px 0; }
.deal-group { margin-top: 12px; }
.deal-group-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 12.5px; margin-bottom: 4px; }
.deal-group-head span { flex: 0 0 auto; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.deal-group p { margin: 0; font-size: 12.5px; }
.deal-pop table { background: transparent; }
.deal-pop th, .deal-pop td { padding: 4px 6px; vertical-align: top; }
.deal-pop th { position: static; font-size: 10.5px; }
.deal-pop th:first-child, .deal-pop td:first-child { padding-left: 0; }
.deal-pop th:last-child, .deal-pop td:last-child { padding-right: 0; }
.deal-pop td .sub { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; }
/* The dashboard's glossary: closed by default, under the page heading */
details.glossary { margin-top: 12px; max-width: 980px; }
details.glossary > summary { cursor: pointer; font-weight: 700; color: var(--accent); font-size: 14px; }
details.glossary dl { margin: 10px 0 0; display: grid; grid-template-columns: minmax(150px, 220px) minmax(0, 1fr); gap: 8px 18px;
  font-size: 13.5px; line-height: 1.5; }
details.glossary dt { font-weight: 700; }
details.glossary dd { margin: 0; color: var(--ink-2); }
@media (max-width: 640px) { details.glossary dl { grid-template-columns: minmax(0, 1fr); gap: 2px; } details.glossary dd { margin-bottom: 8px; } }
a.setting-ref { white-space: nowrap; }
.card .card-sub + ul { margin-top: 0; }
.card ul.quals li { flex-direction: column; align-items: stretch; gap: 4px; padding: 8px 0; }
.card ul.quals li:first-child { padding-top: 0; }
.card ul.quals li:last-child { padding-bottom: 0; }
.card ul.quals li + li { border-top: 1px dashed var(--line); }
.card ul.quals li > span:first-child { min-width: 0; }
.card ul.quals li .qval { justify-content: flex-start; }
.card ul.quals li .qval .num { margin-left: auto; font-weight: 700; }
.card ul.quals li { scroll-margin-top: 80px; border-radius: 4px; }
.card ul.quals li:focus { outline: none; }
.card ul.quals li.flash { animation: qual-flash 2.4s ease-out; }
@keyframes qual-flash {
  0%, 40% { background: var(--accent-soft); box-shadow: 0 0 0 6px var(--accent-soft); }
  100% { background: transparent; box-shadow: 0 0 0 6px transparent; }
}
@media (prefers-reduced-motion: reduce) {
  .card ul.quals li.flash { animation: none; background: var(--accent-soft); box-shadow: 0 0 0 6px var(--accent-soft); }
}
.meter-slot { display: inline-flex; align-items: center; border-radius: 4px; }
.meter-slot:empty { display: none; }

/* carrier cards on the dashboard */
.card.carrier-card { position: relative; overflow: hidden; transition: box-shadow 0.18s ease, border-color 0.18s ease; }
.card.carrier-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--accent-solid); }
.card.carrier-card:hover { box-shadow: var(--shadow-lg); border-color: var(--line-strong); }
.card.carrier-card h3 a { font-size: 17px; font-weight: 700; }
.card.carrier-card h3 .muted { font-size: 12.5px; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- suggested moves */
.card.move { margin-bottom: 14px; padding: 20px 22px; }
.move-head { display: flex; gap: 16px; align-items: flex-start; }
.move-head .step {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%; color: #fff; font-size: 16px;
  background: var(--accent-solid); display: flex; align-items: center; justify-content: center; font-weight: 700;
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.move-head .move-what { flex: 1 1 auto; min-width: 0; }
.move-head .move-what strong:first-child { font-size: 16px; }
.move-head .move-gain { flex: 0 0 auto; text-align: right; }
.move-gain .big { color: var(--gain); font-variant-numeric: normal; font-size: 30px; }
.move-route { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0; }
.move-route .arrow { color: var(--muted); }
.chip { display: inline-block; padding: 2px 11px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; line-height: 18px; }
.chip.to { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent-solid) 30%, var(--line)); }
.chip.warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }
.chip.ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
ul.changes { margin: 12px 0 8px; padding-left: 20px; list-style: disc; }
ul.changes li { display: list-item; margin: 3px 0; padding: 0; }  /* not the card's flex rows */
ul.changes li::marker { color: var(--muted); }
.card.move > div.changes-head { font-size: 12.5px; margin-top: 12px; }
.changes-head + ul.changes { margin-top: 4px; }
.card.move > div.muted { font-size: 13px; margin-top: 3px; }
.card.move > .notice + div.muted, .card.move > ul.changes + div.muted { margin-top: 10px; }
/* "Can't do this move" and its test twin: quiet buttons under the gain. A marked card keeps the move's place, compact,
   with "Can do this move" to put it back; it stays clear while the other cards dim during a recompute. */
.move-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; margin-top: 10px; }
button.cant-do, button.can-do { padding: 4px 12px; font-size: 12.5px; white-space: nowrap; }
.card.move.marked { border-color: var(--warn-line); padding: 14px 22px; }
.card.move.marked .step { background: var(--warn-bg); color: var(--warn); box-shadow: 0 0 0 4px var(--warn-line); font-size: 22px; }
.card.move.marked .move-what strong:first-child { font-size: 15px; }
.card.move.marked .move-deals { margin-top: 2px; }
.card.move.restoring { font-size: 13px; font-weight: 700; color: var(--warn); }
.card.recomputing { margin-bottom: 14px; }
.recomputing .elapsed { font-variant-numeric: tabular-nums; }
.marked-list { margin-bottom: 14px; }
.marked-list > .muted { display: block; font-size: 13px; margin-top: 2px; }
.marked-list li { align-items: center; padding: 8px 0; }
.marked-list li + li { border-top: 1px solid var(--line); }
.marked-list li > span { min-width: 0; }
.marked-list .move-deals { display: block; }
.marked-list button.undo-mark { flex: 0 0 auto; padding: 4px 14px; font-size: 12.5px; }
@media (max-width: 640px) {
  .move-head { flex-wrap: wrap; } .move-head .move-gain { text-align: left; } .move-actions { align-items: flex-start; }
}

/* ---------------------------------------------------------------- summary: hero + tiles */
.summary { display: flex; flex-wrap: wrap; gap: 18px; align-items: stretch; margin-bottom: 10px; }
.summary .card { flex: 1 1 260px; }
.summary .card.hero {  /* PACE's teal band, with its rounded top corners */
  flex: 1 1 320px; display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden;
  color: #ffffff; border: 0; padding: 28px 30px; border-radius: 28px 28px var(--radius) var(--radius);
  background: #008198; box-shadow: none;
}
.summary .card.hero::before {  /* orange highlight, as on PACE's "easier way" */
  content: ""; position: absolute; left: 30px; top: 0; width: 56px; height: 5px; border-radius: 0 0 3px 3px; background: var(--orange);
}
.summary .card.hero .muted, .summary .card.hero small { color: var(--on-brand); }  /* white: 4.6:1 on PACE teal */
.summary .card.hero a { color: #ffffff; text-decoration: underline; }
.hero-figure { font-size: 54px; line-height: 1.05; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; margin: 8px 0 6px; }
.hero-periods { font-size: 12.5px; line-height: 1.45; margin-top: 6px; }
/* Two tiles a row, paired by label length (the two move totals, then qualifications and largest carrier), so a
   short label never sits above the empty space a long label in its row needs. */
.tiles { flex: 3 1 600px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.tile { display: flex; flex-direction: column; gap: 5px; position: relative; }
.tile-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; color: var(--muted); }
.tile-value { font-size: 27px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tile-sub { font-size: 12.5px; line-height: 1.45; }
#tile-quals .tile-sub { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-start; }
#tile-quals .tile-hint { flex-basis: 100%; }
/* At risk / not met pills that go to those qualifications in the carrier cards */
button.jump { padding: 0; border: 0; border-radius: 999px; background: none; font-weight: inherit; }
button.jump:hover:not(:disabled) { background: none; }
button.jump:hover .pill { box-shadow: 0 0 0 2px currentColor; }
.tile.pending .tile-value { color: var(--muted); }
.tile[data-tone="gain"] .tile-value { color: var(--gain); }
.nowrap { white-space: nowrap; }  /* keeps an info button on the line of the word before it */
/* Tiles in a row share label, value and note rows, so values line up under labels of different lengths. */
@supports (grid-template-rows: subgrid) {
  .tile { display: grid; grid-row: span 3; grid-template-rows: subgrid; row-gap: 5px; align-content: start; }
}

/* ---------------------------------------------------------------- info tooltips (format.js infoTip) */
.info-btn {
  display: inline-flex; align-items: center; justify-content: center; position: relative; vertical-align: 1px;
  width: 16px; height: 16px; margin-left: 6px; padding: 0; border-radius: 50%; cursor: help;
  font-size: 10.5px; font-weight: 700; line-height: 1; text-transform: none; letter-spacing: 0;
  background: var(--panel-2); color: var(--accent); border: 1px solid var(--line-strong); box-shadow: none;
}
.info-btn::after { content: ""; position: absolute; inset: -8px; }  /* a hit area larger than the icon */
.info-btn:hover:not(:disabled), .info.open .info-btn { background: var(--accent-solid); color: #ffffff; border-color: var(--accent-solid); }
.info-tip {
  display: none; position: fixed; z-index: 60; width: max-content; max-width: min(320px, calc(100vw - 32px));
  background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-top: 3px solid var(--accent-solid);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 10px 12px; font-size: 13px; font-weight: 400; line-height: 1.5; text-transform: none; letter-spacing: 0; white-space: normal;
}
.info.open .info-tip { display: block; }

/* ---------------------------------------------------------------- pills, flags, notices */
.pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700;
  white-space: nowrap; line-height: 19px; border: 1px solid transparent;
}
.pill-icon { font-size: 10.5px; line-height: 1; }
.pill.met, .pill.pass, .pill.ok { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-line); }
.pill.at_risk, .pill.warn { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-line); }
.pill.not_met, .pill.fail, .pill.error { color: var(--bad); background: var(--bad-bg); border-color: var(--bad-line); }
.pill.pending, .pill.rules_pending, .pill.info { color: var(--pending); background: var(--pending-bg); border-color: var(--line); }

table { border-collapse: separate; border-spacing: 0; width: 100%; background: var(--panel); }
th, td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; text-align: left; }
th.c, td.c { text-align: center; }  /* short values: dates, counts, pills, codes */
th {  /* like the header row of PACE's comparison table */
  font-size: 11px; color: var(--ink); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  background: var(--panel-2); position: sticky; top: 0; z-index: 1; border-bottom-color: color-mix(in srgb, var(--accent-solid) 35%, var(--line));
}
tbody tr:last-child td { border-bottom: 0; }
tr:hover td { background: var(--hover); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow);
  scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.card .table-wrap, .viz-table .table-wrap { box-shadow: none; border-radius: var(--radius-sm); }
.table-wrap.tall { max-height: 70vh; overflow-y: auto; }
.table-wrap + p { margin-top: 10px; }
/* Carrier page: the total as a stat, in the dashboard hero's teal */
#head > .big {
  display: inline-flex; margin: 12px 0 6px; padding: 10px 22px; border-radius: 18px 18px var(--radius) var(--radius); font-size: 32px;
  color: #ffffff; background: #008198; box-shadow: inset 0 3px 0 var(--orange);
}
#clients td:nth-child(4), #clients td:nth-child(5) { white-space: nowrap; }  /* carrier page: effective and term dates */

.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin: 10px 0 16px; }
.filters label { display: flex; flex-direction: column; font-size: 11.5px; font-weight: 700; color: var(--muted); gap: 4px;
  text-transform: uppercase; letter-spacing: 0.04em; }
.filters label.toggle { flex-direction: row; align-items: center; gap: 10px; color: var(--ink); font-size: 13.5px; font-weight: 400;
  text-transform: none; letter-spacing: 0;
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; box-shadow: var(--shadow); }
/* Controls inside a label would inherit its small bold caption type; one height keeps inputs and selects in line. */
.filters input:not([type="checkbox"]), .filters select { height: 36px; font-size: 14px; font-weight: 400; color: var(--ink); }
.filters > span { line-height: 36px; }  /* a count or message beside the controls, centred on them */
input, select, button {
  font: inherit; padding: 7px 11px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--panel); color: var(--ink); transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
input:hover, select:hover { border-color: color-mix(in srgb, var(--accent-solid) 45%, var(--line-strong)); }
input:focus, select:focus { outline: none; border-color: var(--accent-solid);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-solid) 20%, transparent); }
select { padding-right: 30px; }
input[type="checkbox"] { accent-color: var(--accent-solid); width: 16px; height: 16px; padding: 0; }
button {  /* PACE's pill buttons */
  cursor: pointer; background: var(--accent-solid); color: #fff; border-color: var(--accent-solid); font-weight: 700;
  border-radius: 999px; padding: 7px 16px; box-shadow: none;
}
button:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
button.secondary { background: var(--panel); color: var(--accent); border-color: var(--accent-solid); }  /* PACE's "Learn more" */
button.secondary:hover:not(:disabled) { background: var(--accent-soft); border-color: var(--accent-solid); }
button:disabled { opacity: 0.55; cursor: default; }

.flag { display: inline-block; font-size: 11px; font-weight: 700; padding: 0 7px; margin: 1px 3px 1px 0; border-radius: 4px; line-height: 18px;
        background: var(--warn-bg); color: var(--warn); white-space: nowrap; border: 1px solid var(--warn-line); }
.flag.info { background: var(--pending-bg); color: var(--pending); border-color: var(--line); }
.notice {
  position: relative; background: color-mix(in srgb, var(--warn-bg) 75%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--warn-line) 75%, var(--panel)); border-left: 3px solid var(--orange);
  padding: 7px 12px 7px 36px; border-radius: var(--radius-sm); margin: 6px 0; color: var(--ink); font-size: 13px;
}
.notice::before {
  content: "!"; position: absolute; left: 11px; top: 8px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--orange-deep); color: #ffffff; font-size: 11px; font-weight: 700; line-height: 16px; text-align: center;
}
.card.move .notice + .notice { margin-top: 4px; }
.card.move .notice { white-space: pre-line; line-height: 1.6; }  /* a check-first note's lines: finding, why, check, do */
.card.move .notice.stay { margin-top: 12px; }  /* the clawback window, under the bonus change it puts at risk */
.list-windows, .list-statements, .list-together, .list-open { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 13px; }
/* "All 10 moves together" strip at the top of each move list */
#suggestions > .card:not(.move), #small-suggestions > .card:not(.move) {
  margin-bottom: 14px; border-left: 4px solid var(--gain);
  background: linear-gradient(90deg, color-mix(in srgb, var(--gain) 7%, var(--panel)) 0, var(--panel) 55%);
}
.notice.error { background: var(--bad-bg); border-color: var(--bad-line); border-left-color: var(--bad); }
.notice.error::before { content: "\00d7"; background: var(--bad); }
.card.muted { color: var(--muted); }

/* Scope: Group Benefits only, with the Canada Life GRS exception spelled out */
header.top .scope-tag { font-size: 11.5px; font-weight: 700; padding: 3px 11px; border-radius: 999px; white-space: nowrap;
  color: var(--accent); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent-solid) 30%, transparent); }
.card.scope { margin: 18px 0; border-left: 4px solid var(--accent-solid);
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent-solid) 5%, var(--panel)) 0, var(--panel) 240px); }
.scope .scope-head { font-size: 15px; }
.scope .scope-exception { margin-top: 10px; padding: 10px 14px; border-radius: var(--radius-sm); color: var(--ink);
  background: var(--warn-bg); border: 1px solid var(--warn-line); }
.scope .scope-why ol { margin: 10px 0 0; padding-left: 22px; list-style: decimal; }
.scope .scope-why li { display: list-item; margin: 7px 0; padding: 0 0 0 2px; color: var(--ink-2); }  /* not the card's flex rows */
.scope .scope-why li::marker { color: var(--accent); font-weight: 700; }
.scope .scope-why li strong { color: var(--ink); }
.scope .scope-why ul { margin: 6px 0 0; padding-left: 18px; list-style: disc; }
.scope-note { color: var(--ink-2); }

details { margin: 8px 0; }
details summary {
  cursor: pointer; color: var(--accent); font-weight: 700; font-size: 13px; list-style: none;
  display: inline-flex; align-items: center; gap: 7px; padding: 3px 0; user-select: none;
}
details summary::-webkit-details-marker { display: none; }
details summary::before {
  content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(-45deg); transition: transform 0.15s ease; margin-right: 1px;
}
details[open] > summary::before { transform: rotate(45deg) translate(-1px, -1px); }
details summary:hover { text-decoration: underline; }
/* Deals as "Deal 296 · title" links to Pipedrive; a list shows the first and "+ N more" */
a.deal-link { overflow-wrap: anywhere; }
.more-list details.more { margin: 2px 0 0; }
.more-list details.more > summary { font-size: 12.5px; padding: 1px 0; }
.more-list details.more > div { margin-top: 3px; }
.move-deals { font-size: 13px; }
.move-deals .more-list { display: inline-block; }
pre.trace { max-height: 420px; overflow: auto; background: #2b2b2b; color: #e6e6e6; padding: 14px; border-radius: var(--radius-sm);
  border: 1px solid #3a3a3a; line-height: 1.6; }
.ladder td.here { background: var(--accent-soft); font-weight: 700; color: var(--ink); box-shadow: inset 3px 0 0 var(--accent-solid); }

/* ---------------------------------------------------------------- charts */
.chart-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 18px; margin-bottom: 18px; }
.chart-card { margin: 0; min-width: 0; }
.chart-card figcaption { display: flex; flex-direction: column; gap: 3px; margin-bottom: 12px; }
.chart-card figcaption strong { font-size: 15px; }
.chart-card figcaption .muted { font-size: 12.5px; }
#mix .chart-card, #risk-map .chart-card { margin-bottom: 4px; }
#nobonus-chart .chart-card { margin-bottom: 18px; }  /* the table follows */
.card table.ladder { margin-top: 12px; }
.viz-chart { position: relative; }
.viz-host { width: 100%; min-width: 0; }
.viz-svg { display: block; overflow: visible; font-family: var(--font); }
.viz-svg text { font-size: 11px; }
.viz-tick { fill: var(--tick); font-variant-numeric: tabular-nums; }
.viz-cat { fill: var(--ink); font-size: 12px !important; }
.viz-link { fill: var(--accent); }
.viz-value { fill: var(--ink-2); font-weight: 700; font-variant-numeric: tabular-nums; }
.viz-annot { fill: var(--ink-2); font-weight: 700; }
.viz-axis-title { fill: var(--muted); }
.viz-grid line { stroke: var(--grid); stroke-width: 1; }
.viz-baseline { stroke: var(--axis); stroke-width: 1; }
.viz-connector { stroke: var(--axis); stroke-width: 1; }
.viz-guide { stroke: var(--ink-2); stroke-width: 1; opacity: 0.55; }
.viz-crosshair { stroke: var(--ink-2); stroke-width: 1; opacity: 0.6; pointer-events: none; }
.viz-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.viz-area { opacity: 0.1; }
.viz-dot { stroke: var(--panel); stroke-width: 2; }
.viz-hit-area { fill: transparent; }
.viz-hit { cursor: default; outline: none; transition: opacity 0.12s ease, filter 0.12s ease; }
.viz-hit:hover, .viz-hit:focus-visible { filter: brightness(1.12) saturate(1.1); }
g.viz-hit:focus-visible circle.viz-dot, path.viz-hit:focus-visible { stroke: var(--ink); stroke-width: 2; }
.viz-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 10px; font-size: 12px; color: var(--ink-2); }
.viz-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.viz-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.viz-swatch.dot { border-radius: 50%; }
.viz-table { margin: 10px 0 0; font-size: 13px; }
.viz-table summary { font-size: 12.5px; }
.viz-table .table-wrap { margin-top: 8px; max-height: 320px; overflow-y: auto; }
.viz-tip {
  position: absolute; z-index: 50; pointer-events: none; max-width: 320px;
  background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 9px 11px; font-size: 12px;
}
.viz-tip-title { font-weight: 700; margin-bottom: 4px; color: var(--ink); }
.viz-tip-row { display: flex; align-items: baseline; gap: 6px; }
.viz-tip-row strong { font-variant-numeric: tabular-nums; }
.viz-tip-key { display: inline-block; width: 12px; height: 2px; border-radius: 1px; align-self: center; flex: 0 0 auto; }
.viz-tip-label { color: var(--muted); }
.viz-meter { display: block; }
.viz-muted { opacity: 0.45; }
.viz-muted-label { fill: var(--muted) !important; font-style: italic; }
.viz-strong { font-weight: 700 !important; fill: var(--ink) !important; }
.viz-compact .viz-legend { margin-bottom: 4px; font-size: 11px; }
.move-impact { margin: 14px 0 4px; padding: 12px 14px 6px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.move-impact-title { font-size: 11.5px; font-weight: 700; color: var(--muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.05em; }
.next-period { color: var(--bad); font-weight: 700; }
.viz-meter-track { fill: var(--grid); }
.viz-meter-tick { stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
.viz-multiples { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px 20px; }
.viz-multiple { min-width: 0; }
.viz-multiple-head { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; margin-bottom: 2px; flex-wrap: wrap; }
.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; margin: 2px 0 14px; background: var(--panel-3); flex-wrap: wrap; }
.segmented button { background: transparent; color: var(--ink-2); border: 0; border-radius: 999px; padding: 5px 14px; font-size: 13px;
  font-weight: 400; box-shadow: none; }
.segmented button:hover:not(:disabled) { background: color-mix(in srgb, var(--panel) 60%, transparent); }
.segmented button[aria-pressed="true"] { background: var(--accent-solid); color: #ffffff; font-weight: 700; }
.refreshing { opacity: 0.5; transition: opacity 0.2s ease; }

/* ---------------------------------------------------------------- list pages: Client book, Data status, Settings, Validation */
main.wide { max-width: 1600px; }  /* the client book's eleven columns */
td .sub { display: block; margin-top: 2px; font-size: 12px; line-height: 1.4; color: var(--muted); }
.mcompare-clients td.client { min-width: 200px; }
.mcompare-clients td.status { white-space: nowrap; }
.mcompare-clients td .sub.why { color: var(--warn, var(--muted)); }
.dash { color: var(--muted); }
.tag { display: inline-block; padding: 1px 8px; border-radius: 4px; font-size: 12px; font-weight: 700; line-height: 18px; white-space: nowrap;
  color: var(--ink-2); background: var(--panel-3); border: 1px solid var(--line); }
.tag.accent { color: var(--accent); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent-solid) 30%, var(--line)); }
td code { white-space: nowrap; }
td.empty { padding: 36px 14px; text-align: center; color: var(--muted); }
.section-block > .table-wrap + .table-wrap, .section-block > .card + .card { margin-top: 16px; }

/* Stat tiles under a page's title (the dashboard's tiles, four a row) */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 22px 0 4px; }
.stats .tile { padding: 16px 18px; }
.stats .tile.span-2 { grid-column: span 2; }
.stats .tile-value { font-size: 26px; line-height: 1.15; }
.stats .tile-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.stats .tile.ok { box-shadow: inset 0 3px 0 var(--ok), var(--shadow); }
.stats .tile.bad { box-shadow: inset 0 3px 0 var(--bad), var(--shadow); }
.stats .tile.brand { box-shadow: inset 0 3px 0 var(--accent-solid), var(--shadow); }

/* Filters and actions in one panel */
.filters.toolbar { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 18px; margin: 22px 0 16px; gap: 12px 16px; }
.toolbar label.grow { flex: 1 1 260px; max-width: 420px; }
.toolbar label.grow input { width: 100%; }
.toolbar select { min-width: 150px; }
.toolbar .toolbar-meta { margin-left: auto; align-self: center; text-align: right; font-size: 13px; color: var(--muted); line-height: 1.45; }
.toolbar .toolbar-meta strong { color: var(--ink); font-variant-numeric: tabular-nums; }

/* Data status: time, calling hours and the refresh buttons */
.status-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 32px; margin: 22px 0 0; padding: 14px 18px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
#hours { display: contents; }  /* its items sit in the bar beside the buttons */
.status-item { display: flex; flex-direction: column; gap: 3px; }
.status-item .k { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.status-item .v { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.status-actions { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; }
.status-actions .msg { font-size: 13px; color: var(--muted); }
.status-actions .msg:empty { display: none; }

/* Data status warnings: one card each, two a row, a coloured edge for gaps to fix and things to check */
.warn-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(520px, 100%), 1fr)); gap: 16px; }
.warn-list > * { min-width: 0; }
.card.warn { padding: 18px 20px; }
.card.warn.fix { box-shadow: inset 4px 0 0 var(--warn), var(--shadow); }
.card.warn.check { box-shadow: inset 4px 0 0 var(--accent-solid), var(--shadow); }
.warn-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; }
.warn-count { font-size: 12.5px; color: var(--muted); }
.warn-count strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.card.warn h3 { margin: 10px 0 0; font-size: 16px; line-height: 1.35; }
.warn-body { margin-top: 8px; font-size: 13.5px; line-height: 1.6; color: var(--ink-2); }
.warn-body p { margin: 0; }
.warn-body p + p { margin-top: 8px; }
.warn-body strong { color: var(--ink); }
.warn-examples { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13px; }
.warn-examples + .warn-examples { margin-top: 10px; }
.warn-examples .k { display: block; margin-bottom: 4px; font-size: 11.5px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.04em; }
.tag.fix { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-line); }
.tag.check { color: var(--accent); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent-solid) 30%, var(--line)); }

/* Client book: compact rows, so at least six show in the table's box */
#book table { font-size: 13px; line-height: 1.45; }
#book th { white-space: nowrap; padding: 9px 10px; }
#book td { padding: 8px 10px; }
#book td .sub { margin-top: 1px; line-height: 1.35; }
#book .col-client { min-width: 180px; }
#book .col-carrier { min-width: 140px; }
#book .col-flags { min-width: 180px; }
#book .col-deal { min-width: 170px; }
#book .col-deal .deal-link {  /* a long Pipedrive title stops at two lines; the link's tooltip has all of it */
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
#book td.date, #book td.date .sub { white-space: nowrap; }
#book .flag { white-space: normal; margin: 1px 3px 1px 0; }
#book details.history { margin: 4px 0 0; }
#book details.history summary { font-size: 12px; }
#book td.num { position: relative; }
#book .history-list {  /* opens over the rows below, so the columns keep their widths */
  position: absolute; z-index: 5; right: 8px; top: calc(100% - 6px); width: 280px; padding: 10px 12px; text-align: left;
  white-space: normal; font-size: 12px; background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); }
#book .history-list > div + div { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line); }
#book .history-list .sub { white-space: pre-line; }  /* a product note's own line breaks */

/* The page fits the window and only the table's box scrolls, its header row kept in view. On a phone the page
   scrolls as usual. On a window too short for six rows (clients.js sets the box's min-height), the page scrolls. */
@media (min-width: 641px) {
  body.fit { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
  body.fit > header.top { flex: 0 0 auto; }
  body.fit > main { flex: 1 1 auto; min-height: 0; width: 100%; display: flex; flex-direction: column; padding: 16px 20px 14px; }
  body.fit .page-head { margin-bottom: 10px; }
  body.fit .page-head h1 { font-size: 26px; margin-bottom: 2px; }
  body.fit .page-head p { font-size: 14px; max-width: none; margin: 0; }
  body.fit .filters.toolbar { flex: 0 0 auto; margin: 0 0 10px; padding: 8px 14px; }
  body.fit #book { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
  body.fit #book > .table-wrap { flex: 1 1 auto; max-height: none; overflow: auto; }
}

/* Settings register */
#settings-table table { font-size: 13.5px; }
#settings-table tr[id] { scroll-margin-top: 84px; }
#settings-table tr:target td { background: var(--accent-soft); }
#settings-table td.id { white-space: nowrap; font-weight: 700; }
#settings-table ul { margin: 0; padding-left: 16px; }
#settings-table ul li + li { margin-top: 3px; }
#settings-table .col-rule { width: 28%; }
#settings-table .col-default { width: 22%; }
#settings-table .col-alt { width: 20%; }

/* Validation: checks grouped by case, G-2 side by side, one card per reconciled statement */
table.checks tr.group td { background: color-mix(in srgb, var(--accent-solid) 5%, var(--panel)); padding-top: 12px; padding-bottom: 12px;
  border-bottom-color: var(--line); }
table.checks tr.group:hover td { background: color-mix(in srgb, var(--accent-solid) 5%, var(--panel)); }
tbody tr.group:not(:first-child) td { border-top: 1px solid var(--line-strong); }
.group-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.group-row .group-title { font-weight: 700; color: var(--ink); }
table.checks .col-val { width: 17%; }
table.checks .col-result { width: 15%; }
table.checks td.item { font-family: var(--mono); font-size: 12px; color: var(--ink-2); padding-left: 28px; }
table.checks td.c { font-variant-numeric: tabular-nums; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: 18px; }
.grid-2 > * { min-width: 0; }  /* a wide table scrolls inside its card, not the page */
.card-title { font-size: 15px; font-weight: 700; margin: 0 0 2px; }
.card-sub { font-size: 12.5px; color: var(--muted); margin: 0 0 14px; }
.recon-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px 24px; }
.recon-head .card-sub { margin: 0; overflow-wrap: anywhere; }
.recon-score { text-align: right; }
.recon-score .big { font-size: 24px; line-height: 1.15; }
.recon-score .muted { font-size: 12.5px; }
.meter-bar { height: 6px; border-radius: 999px; background: var(--grid); margin: 14px 0 12px; overflow: hidden; }
.meter-bar > span { display: block; height: 100%; border-radius: inherit; background: var(--accent-solid); }
.recon-methods { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.recon details { margin: 0; padding: 10px 0; border-top: 1px solid var(--line); }
.recon .recon-methods + details { margin-top: 14px; }
.recon details:last-child { padding-bottom: 0; }
.recon details > p { margin: 8px 0 0; font-size: 13px; }
.recon details > .table-wrap { margin-top: 10px; }
.count-badge { display: inline-block; min-width: 24px; padding: 0 7px; border-radius: 999px; font-size: 11.5px; line-height: 19px;
  text-align: center; color: var(--ink-2); background: var(--panel-3); border: 1px solid var(--line); }
.count-badge.warn { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-line); }

@media (max-width: 640px) {  /* tables of sentences scroll sideways rather than squeeze their text to a word a line */
  .table-wrap > table.roomy { min-width: 760px; }
  .table-wrap > table.checks { min-width: 560px; }
  #settings-table .table-wrap > table.roomy { min-width: 980px; }
}
@media (max-width: 960px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .status-actions { margin-left: 0; justify-content: flex-start; }
}
@media (max-width: 480px) {
  .stats { gap: 10px; }
  .stats .tile { padding: 12px 14px; }
  .stats .tile-value { font-size: 21px; }
  .toolbar label, .toolbar label.grow { flex: 1 1 100%; max-width: none; }
  .toolbar select { width: 100%; }
  .toolbar .toolbar-meta { margin-left: 0; text-align: left; }
  .recon-score { text-align: left; }
}

/* ---------------------------------------------------------------- move simulator (simulator.html) */
.sim-pick, .sim-amount { margin-top: 0; }
.sim-pick select { min-width: 300px; }
.sim-arrow { color: var(--muted); font-size: 20px; line-height: 36px; }
.sim-actions { display: inline-flex; flex-wrap: wrap; gap: 8px; }
.sim-amount input[type="number"] { width: 180px; }
.sim-amount input#employees { width: 120px; }
.sim-amount label[hidden] { display: none; }
.sim-hint { font-size: 13.5px; margin: -4px 0 14px; max-width: 980px; }
.sim-panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(440px, 1fr)); gap: 18px; align-items: start; }
.sim-figures { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 10px 0 2px; }
.sim-figure { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sim-panel th, .sim-panel td { padding: 6px 8px; vertical-align: top; }
.sim-panel td .pill { margin-top: 3px; }
.sim-panel td .meter-slot { display: flex; margin-top: 4px; }
.sim-panel td.changed { background: var(--accent-soft); font-weight: 700; }
.card ul.sim-headroom { list-style: disc; padding-left: 20px; margin-top: 6px; font-size: 13px; }
.card ul.sim-headroom li { display: list-item; padding: 2px 0; }
.move-gain .big.loss { color: var(--bad); }
.card.move.sim-draft { border-color: color-mix(in srgb, var(--accent-solid) 45%, var(--line)); }
details.sim-notes { margin-top: 10px; }
details.sim-notes > summary { cursor: pointer; font-weight: 700; color: var(--accent); font-size: 13px; }
.card.sim-total { margin-bottom: 14px; border-left: 4px solid var(--gain); }
.sim-carriers { margin-bottom: 18px; }
@media (max-width: 640px) {
  .sim-panels { grid-template-columns: minmax(0, 1fr); }
  .sim-pick label, .sim-amount label { flex: 1 1 100%; }
  .sim-pick select, .sim-amount select, .sim-amount input[type="number"], .sim-amount input#employees { min-width: 0;
    width: 100%; }
  .sim-arrow { display: none; }
}

@media (max-width: 640px) {
  main { padding: 18px 16px 48px; }
  header.top { padding: 10px 16px; position: static; }  /* a wrapped header would take a quarter of the screen */
  h1 { font-size: 24px; }
  .grid { grid-template-columns: 1fr; }
  .chart-row { grid-template-columns: 1fr; }
  .hero-figure { font-size: 44px; }
  .tiles { grid-template-columns: 1fr 1fr; gap: 12px; }
  .card { padding: 15px 16px; }
  .summary .card.hero { padding: 24px 22px; border-radius: 22px 22px var(--radius) var(--radius); }
  .summary .card.hero::before { left: 22px; }
}
@media (max-width: 480px) { .tiles { grid-template-columns: 1fr; } }
