/* Forecast - app-specific styles on top of kynship-ui */

/* Accent override: off-white bone. Status colors (negatives, warnings) stay
   red/amber - only the UI accent changes. */
:root {
  --grn: #EFEAE0;
  --grn-deep: #D8D0C0;
  --accent-ink: #14161b;   /* text that sits ON the accent */
  --grid-line: #262a33;
  --amber-ink: #e0a11e;    /* amber text: changed/unsaved markers, warnings */
}
html:not([data-theme="light"]) { --grid-line: rgba(255, 255, 255, .06); }

/* ── Light mode theme ───────────────────────────────────────────────────
   Gray-brown palette with depth and hierarchy (cooler than beige/tan).
   Applied via data-theme="light" attribute on html element. */
[data-theme="light"] {
  --bg: #f2f0ed;           /* cool gray-beige background */
  --panel: #fdfcfa;         /* soft cream white panels */
  --panel-2: #f0ede7;       /* cool light gray-tan for secondary surfaces */
  --panel-3: #e3ddd5;       /* cool medium gray-brown for tertiary surfaces */
  --line: #cdc5ba;          /* gray-taupe borders */
  --grid-line: #e3dfd9;     /* lighter grid lines */
  --fg: #1a1815;            /* cool near-black text */
  --fg-dim: #5a534c;        /* cool gray-brown dim text */
  --fg-faint: #9a9188;      /* gray-brown faint text */
  --grn: #E3DDD5;           /* cooler bone accent */
  --grn-deep: #C8BFB3;      /* deeper gray-brown accent */
  --accent-ink: #1a1815;
  --amber-ink: #b45309;     /* #e0a11e and amber-300 wash out on cream */
}

/* Update Tailwind colors for light mode */
[data-theme="light"] body {
  background: #f2f0ed;
  color: #1a1815;
}

/* Tailwind color overrides for light mode (these need to be applied globally) */
html[data-theme="light"] {
  /* This ensures Tailwind utilities also update */
  color-scheme: light;
}

/* Light mode specific overrides for dark tailwind config */
[data-theme="light"] .bg-bg { background-color: #f2f0ed !important; }
[data-theme="light"] .bg-panel { background-color: #fdfcfa !important; }
[data-theme="light"] .bg-panel2 { background-color: #f0ede7 !important; }
[data-theme="light"] .bg-panel3 { background-color: #e3ddd5 !important; }
[data-theme="light"] .border-line { border-color: #cdc5ba !important; }
[data-theme="light"] .text-fg { color: #1a1815 !important; }
[data-theme="light"] .text-fg-dim { color: #5a534c !important; }
[data-theme="light"] .text-fg-faint { color: #9a9188 !important; }

/* Light mode table hover and emphasis */
[data-theme="light"] .sheet tbody tr:hover td {
  background: rgba(90, 83, 76, .08);
}
[data-theme="light"] .sheet tbody tr:hover th.sticky-col {
  background: linear-gradient(rgba(90, 83, 76, .08), rgba(90, 83, 76, .08)), var(--fx-sticky);
}
[data-theme="light"] .sheet tr.row-emphasis td,
[data-theme="light"] .sheet tr.row-emphasis th {
  background: rgba(90, 83, 76, .08);
  background-clip: padding-box;
}
[data-theme="light"] .sheet tr.row-emphasis th.sticky-col {
  background: linear-gradient(rgba(90, 83, 76, .08), rgba(90, 83, 76, .08)), var(--fx-sticky);
  background-clip: padding-box;
}
[data-theme="light"] .sheet tbody tr.row-emphasis:hover th.sticky-col {
  background: linear-gradient(rgba(90, 83, 76, .14), rgba(90, 83, 76, .14)), var(--fx-sticky);
}
[data-theme="light"] .sheet .neg {
  color: #b91c1c;
}

/* Light mode cell inputs */
[data-theme="light"] .cell-in-grid:hover {
  background: rgba(90, 83, 76, .08);
}

/* Light mode buttons and UI elements */
[data-theme="light"] .btn-accent {
  background: var(--grn);
  color: var(--accent-ink);
  box-shadow: 0 2px 12px rgba(227, 221, 213, .24);
}
[data-theme="light"] .btn-accent:hover {
  background: #D5CEC5;
  color: var(--accent-ink);
}

/* Light mode stepper buttons */
[data-theme="light"] .stepper:hover {
  color: var(--fg);
  border-color: #C8BFB3;
}

/* Light mode tabbar */
[data-theme="light"] .tabbar-item:hover {
  color: var(--fg);
  background: rgba(90, 83, 76, .06);
}

/* Light mode progress fill */
[data-theme="light"] .progress-fill {
  background: #C8BFB3;
}

/* Light mode theme toggle button */
#theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.375rem;
  border-radius: 0.5rem;
  transition: background-color 0.15s, color 0.15s;
  cursor: pointer;
  color: var(--fg-dim);
}
#theme-toggle:hover {
  color: var(--fg);
  background: var(--panel);
}
[data-theme="light"] #theme-toggle:hover {
  background: rgba(90, 83, 76, .08);
}

/* ── Header (light and dark) ────────────────────────────────────────────
   Solid background, proper logo visibility, readable nav pills. */

/* Header background */
.header-bg {
  background: var(--bg);
}

/* Logo visibility fix: invert logo in light mode so it's visible */
[data-theme="light"] .logo-wrapper svg {
  filter: invert(1) hue-rotate(180deg) brightness(0.3);
}

/* Nav pill states */
.nav-pill-active {
  background: var(--panel-3) !important;
  color: var(--fg) !important;
  font-weight: 500;
}

.nav-pill-inactive {
  color: var(--fg-dim) !important;
}

.nav-pill-inactive:hover {
  color: var(--fg) !important;
  background: var(--panel-2) !important;
}

/* The Forecast lockup (base.html): the K mark and an italic wordmark on a
   small glass plate. On hover the plate lifts, the K tips and springs back,
   and the wordmark leans after it. */
.hdr-logo {
  --hdr-logo-ink: #efeae0;
  --hdr-logo-bg: rgba(255, 255, 255, .06);
  --hdr-logo-edge: rgba(255, 255, 255, .08);
  --hdr-logo-shadow: 0 1px 2px rgba(0, 0, 0, .25), 0 6px 18px -8px rgba(0, 0, 0, .45);
  --hdr-logo-shadow-up: 0 2px 4px rgba(0, 0, 0, .25), 0 12px 26px -10px rgba(0, 0, 0, .55);
  display: inline-flex; align-items: center; gap: 8px;
  margin-right: 20px; padding: 4px 11px 4px 12px;
  border: 1px solid var(--hdr-logo-edge); border-radius: 10px;
  background: var(--hdr-logo-bg); color: var(--hdr-logo-ink);
  box-shadow: var(--hdr-logo-shadow);
  transition: transform .35s cubic-bezier(.2, .9, .3, 1.3), box-shadow .35s ease;
}
[data-theme="light"] .hdr-logo {
  --hdr-logo-ink: #141a26;
  --hdr-logo-bg: rgba(255, 255, 255, .72);
  --hdr-logo-edge: rgba(40, 34, 24, .06);
  --hdr-logo-shadow: 0 1px 2px rgba(40, 34, 24, .06), 0 6px 18px -8px rgba(40, 34, 24, .22);
  --hdr-logo-shadow-up: 0 2px 4px rgba(40, 34, 24, .07), 0 12px 26px -10px rgba(40, 34, 24, .32);
}
.hdr-logo-k {
  width: 15.6px; height: 17px; flex: none;
  transform-origin: 30% 60%;
  transition: transform .55s cubic-bezier(.2, .9, .3, 1.5);
}
.hdr-logo-word {
  font-family: "Instrument Serif", Georgia, "Times New Roman", serif;
  font-style: italic; font-size: 20px; line-height: 1;
  transform: translateY(1px);
  transition: transform .45s cubic-bezier(.2, .9, .3, 1.3), letter-spacing .45s ease;
}
.hdr-logo:hover { transform: translateY(-1px); box-shadow: var(--hdr-logo-shadow-up); }
.hdr-logo:hover .hdr-logo-k { transform: rotate(-12deg) scale(1.12); }
.hdr-logo:hover .hdr-logo-word { transform: translate(2px, 1px); letter-spacing: .01em; }
.hdr-logo:active { transform: translateY(0) scale(.98); transition-duration: .1s; }
.hdr-logo:focus-visible { outline: 2px solid var(--fg-faint); outline-offset: 2px; }
/* A brand's uploaded logo (_brand_logo.html). .is-mask paints it in
   --logo-color through the file as a mask; the hidden <img> sizes the box. */
.brand-logo { display: inline-flex; flex: none; }
.brand-logo img { display: block; width: auto; object-fit: contain; }
.brand-logo.is-mask { background-color: var(--logo-color);
  -webkit-mask: var(--logo) center / contain no-repeat; mask: var(--logo) center / contain no-repeat; }
.brand-logo.is-mask img { visibility: hidden; }
html:not([data-theme="light"]) .brand-logo.is-mask { background-color: var(--logo-color-dark, var(--logo-color)); }
/* A PNG coloured on one theme only (per_theme): as is on the other. */
html[data-theme="light"] .brand-logo.is-mask-light,
html:not([data-theme="light"]) .brand-logo.is-mask-dark {
  -webkit-mask: var(--logo) center / contain no-repeat; mask: var(--logo) center / contain no-repeat; }
html[data-theme="light"] .brand-logo.is-mask-light { background-color: var(--logo-color); }
html:not([data-theme="light"]) .brand-logo.is-mask-dark { background-color: var(--logo-color-dark); }
html[data-theme="light"] .brand-logo.is-mask-light img,
html:not([data-theme="light"]) .brand-logo.is-mask-dark img { visibility: hidden; }
/* Beside the Forecast lockup, after a thin rule. White on the dark header;
   the light header takes the lockup's ink so the logo stays visible.
   14px each side of the rule: -14px undoes the lockup's 20px margin plus
   the header's 8px gap down to 14px; 6px plus that gap gives 14px after. */
.hdr-brand-logo-div { width: 1px; height: 22px; margin: 0 6px 0 -14px; background: var(--line); }
.hdr-brand-logo { margin-right: 20px; }
.hdr-test-brand { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); opacity: .8; white-space: nowrap; }
/* Width follows the 20px height (the Forecast lockup's); the cap (16:1) only
   stops a runaway wordmark, so real logos are never shrunk below 20px. */
.hdr-brand-logo img { height: 20px; max-width: 320px; }
[data-theme="light"] .hdr-brand-logo.is-mask { background-color: #141a26; }
/* Settings > Brand logo */
.st-logo-pick { display: flex; align-items: center; gap: 14px; flex: none; }
.st-logo-pick .st-file { width: 260px; }
/* The file input as a theme button, not the browser's grey one. */
.st-input.st-file { padding: 4px; font-size: 12px; color: var(--fg-faint); cursor: pointer; }
.st-file::file-selector-button { margin-right: 10px; padding: 6px 14px; border: 1px solid var(--line);
  border-radius: 6px; background: var(--panel-2); color: var(--fg); font: inherit; font-size: 12.5px;
  font-weight: 500; cursor: pointer; transition: border-color .2s ease-in-out, background-color .2s ease-in-out; }
.st-file:hover::file-selector-button { border-color: #e0a11e; }
.st-file:focus-visible { outline: 2px solid var(--st-blue); outline-offset: 2px; }
.st-logo-preview { flex: none; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; }
.st-logo-preview.is-light { background: #f4f1ea; }
.st-logo-preview.is-dark { background: #141a26; }
.st-logo-img img { height: 28px; max-width: 280px; }
.st-logo-swatch { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--fg-dim); }
.st-logo-color { width: 56px; height: 32px; padding: 2px; border: 1px solid var(--line); border-radius: 8px;
  background: transparent; cursor: pointer; }
.st-logo-actions { justify-content: flex-end; }
@media (prefers-reduced-motion: reduce) {
  .hdr-logo, .hdr-logo-k, .hdr-logo-word { transition: none; }
  .hdr-logo:hover, .hdr-logo:hover .hdr-logo-k, .hdr-logo:hover .hdr-logo-word { transform: none; }
}

/* Model · Reports · Chat: 22px between the words, on a 26px pill. Every
   link takes the same room for its padding, active or not, so the words stay
   put as the active pill moves from one to the next. */
.hdr-nav { display: flex; align-items: center; gap: 2px; font-size: 14px; }
.hdr-nav a { padding: 3px 10px; border-radius: 7px; line-height: 20px; }

/* The header's icon buttons (theme, settings, log out): one 18px glyph on a
   30px square each, so the three line up at the same height. */
.hdr-icon { display: flex; align-items: center; justify-content: center; }
.hdr-icon svg { width: 18px; height: 18px; flex: none; }

/* The menu bar's right cluster (_brand_tools.html): Refresh source data,
   data as of | brand | then the icons. */
.hdr-tools { display: flex; align-items: center; gap: 16px; }
.hdr-tools:empty { display: none; }
.hdr-tools #reload-btn { padding: 7px 12px; font-size: 13px; font-weight: 600; line-height: 16px; gap: 7px; }
.hdr-tools #reload-btn svg { width: 15px; height: 15px; }
.hdr-state, .hdr-asof { font-size: 12px; white-space: nowrap; }
.hdr-state:has(> :empty) { display: none; }
.hdr-asof { color: var(--fg-faint); }
[data-theme="light"] .hdr-asof { color: #78766f; }
/* The pale dark-mode amber tint ("Unsaved Scenario", "N unsaved changes",
   warnings) washes out on light backgrounds anywhere, not just the header. */
[data-theme="light"] .text-amber-300 { color: var(--amber-ink); }
[data-theme="light"] .hdr-state .text-rose-300,
[data-theme="light"] .hdr-state .text-red-400 { color: #be123c; }
.hdr-div { width: 1px; height: 22px; flex: none; background: rgba(255, 255, 255, .12); }
[data-theme="light"] .hdr-div { background: rgba(40, 34, 24, .14); }
.hdr-div--end { margin-right: 6px; }
.hdr-brand { position: relative; display: inline-flex; align-items: center; }
.hdr-brand select {
  -webkit-appearance: none; appearance: none;
  padding: 5px 30px 5px 10px;
  font-size: 13px; font-weight: 500; line-height: 16px;
  /* As wide as the chosen brand, not the longest one (where supported). */
  field-sizing: content;
  border-radius: 8px; cursor: pointer;
}
.hdr-brand svg {
  position: absolute; right: 9px; width: 14px; height: 14px;
  color: var(--fg-dim); pointer-events: none;
}

::selection { background: rgba(227, 221, 213, .28); }
/* The bone wash is invisible on the light page: select in the light
   theme's revenue blue instead. */
[data-theme="light"] ::selection { background: rgba(47, 99, 201, .24); }
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 3px rgba(227, 221, 213, .16); }
#progress { box-shadow: 0 0 8px rgba(227, 221, 213, .5); }

/* kynship-ui's accent button is a green gradient with dark ink; off-white
   needs the same dark ink but a solid fill (a gradient→solid hover flashes). */
.btn-accent {
  background: var(--grn);
  color: var(--accent-ink);
  box-shadow: 0 2px 12px rgba(239, 234, 224, .18);
}
.btn-accent:hover { filter: none; background: #fff; color: var(--accent-ink); }

/* ── Spreadsheet grid ───────────────────────────────────────────────────
   Months run across as columns and metrics down as rows, matching the sheet
   these replace. The wrapper scrolls horizontally on its own so the page body
   never does, and the metric column stays pinned while you scan across. */
.sheet-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}
.sheet {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.sheet thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--panel-2);
  color: var(--fg-faint);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  text-align: right;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
}
.sheet tbody th,
.sheet thead th.sticky-col {
  position: sticky;
  left: 0;
  z-index: 3;
  text-align: left;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  font-size: 12.5px;
  color: var(--fg-dim);
  background: var(--panel-2);
  padding: 7px 14px;
  border-right: 1px solid var(--line);
  min-width: 190px;
}
.sheet thead th.sticky-col { z-index: 4; color: var(--fg-faint); font-size: 11px; }
/* The 190px label column suits metric names ("Customer File (start)"); a table
   whose first column is just a month needs far less. */
.sheet--month-labels tbody th,
.sheet--month-labels thead th.sticky-col { min-width: 104px; }
.sheet tbody td {
  padding: 7px 12px;
  text-align: right;
  border-top: 1px solid var(--grid-line);
  min-width: 104px;
}
.sheet tbody tr:hover td { background: rgba(255, 255, 255, .025); }
.sheet tbody tr:hover th.sticky-col { background: var(--panel-3); }
.sheet .r { text-align: right; }
.sheet .neg { color: #f87171; }

/* Totals-style rows get a heavier rule and brighter ink, like a sheet's
   subtotal bands. */
.sheet tr.row-emphasis td,
.sheet tr.row-emphasis th {
  border-top: 1px solid var(--line);
  color: var(--fg);
  font-weight: 600;
  background: rgba(239, 234, 224, .035);
  background-clip: padding-box;
}
/* The pinned label cell must stay opaque: a see-through tint let the cells
   scrolling or highlighting beneath it bleed into the summary band. The tint
   is layered over the solid panel instead. */
.sheet tr.row-emphasis th.sticky-col {
  background: linear-gradient(rgba(239, 234, 224, .035), rgba(239, 234, 224, .035)), var(--panel-2);
  background-clip: padding-box;
}
.sheet tbody tr.row-emphasis:hover th.sticky-col { background: var(--panel-3); }

/* Forecast table: columns size to their content instead of a fixed minimum,
   and long metric names wrap in the header rather than widening the column. */
.sheet--fit tbody td { min-width: 0; padding: 7px 10px; }
.sheet--fit thead th { white-space: normal; vertical-align: bottom; padding: 9px 10px; }
.sheet--fit thead th:not(.sticky-col) { min-width: 64px; }
.sheet--fit .col-emphasis { color: var(--fg); font-weight: 600; }
.sheet--fit thead th.col-child { color: var(--fg-dim); font-weight: 500; }
.sheet--fit tbody td.col-child { color: var(--fg-dim); }
.sheet--fit tr.row-total td { border-top: 1px solid var(--line); }
/* Section row above the column headers, with a thin rule where each section
   starts. */
.sheet--fit thead tr.col-groups th.col-group {
  text-align: center; padding: 7px 10px; border-bottom: 1px solid var(--grid-line);
  font-size: 10.5px; letter-spacing: .08em; }
.sheet--fit thead tr.col-groups th.sticky-col { vertical-align: bottom; }
.sheet--fit .sec-start { border-left: 1px solid var(--line); }
/* A headline that folds detail away is one button: the caret sits left of
   the label and the whole header is the hit area. Open, the caret turns
   down and the label brightens; detail opens to its right. */
.col-toggle {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  margin: -4px -6px;
  padding: 4px 6px;
  border-radius: 6px;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  text-align: left;
  cursor: pointer;
  transition: color .3s ease-in-out, background-color .3s ease-in-out;
}
.col-toggle:hover { background: rgba(255, 255, 255, .05); color: var(--fg); }
.col-caret {
  display: inline-block;
  flex: none;
  font-size: 14px;
  line-height: 1;
  color: var(--fg-faint);
  transition: transform .3s ease-in-out, color .3s ease-in-out;
}
.col-toggle:hover .col-caret { color: var(--fg); }
.col-toggle[aria-expanded="true"] { color: var(--fg); font-weight: 600; }
.col-toggle[aria-expanded="true"] .col-caret { color: var(--fg); transform: rotate(90deg); }
@media (prefers-reduced-motion: reduce) {
  .col-toggle, .col-caret { transition: none; }
}
/* Detail columns sit on a darker band with smaller, sentence-case headers. */
.sheet--fit thead th.col-child {
  text-transform: none; letter-spacing: 0; font-size: 10.5px;
  background: linear-gradient(rgba(0, 0, 0, .14), rgba(0, 0, 0, .14)), var(--panel-2); }
.sheet--fit tbody td.col-child { background: rgba(0, 0, 0, .14); }

/* Detail columns ease open and closed like the Scorecard's. The cell's own
   box stays static (no padding or minimum width) and everything that moves
   lives on the inner block (.cw), so every row of a column shrinks as one.
   The text fades through colour rather than opacity, which would promote
   each cell to its own compositor layer. While animating, labels hold one
   line so the header row does not rewrap at every step. */
.sheet--fit thead th.col-child, .sheet--fit tbody td.col-child {
  padding-left: 0; padding-right: 0; min-width: 0; }
.sheet--fit .col-child .cw { display: block; box-sizing: border-box; padding: 0 10px;
  overflow: hidden;
  transition: max-width .3s ease-in-out, min-width .3s ease-in-out,
              padding .3s ease-in-out, color .3s ease-in-out; }
.sheet--fit thead th.col-child .cw { min-width: 64px; }
.sheet--fit .col-child.col-anim .cw { white-space: nowrap; }
.sheet--fit .col-child.collapsing .cw, .sheet--fit .col-child.pre-open .cw {
  min-width: 0; padding-left: 0; padding-right: 0; color: transparent; }
@media (prefers-reduced-motion: reduce) {
  .sheet--fit .col-child .cw { transition: none; }
}

/* ── Forecast table (Eli's redesign) ──────────────────────────────────
   Left-aligned headers and values on tabular figures. Total Revenue and
   Profit $ lead in bright bold with a fill bar (share of the column's
   largest month) and a change-on-prior-month chip; flat inputs recede.
   Zebra rows, a heavier rule at each quarter, and a tinted Totals band. */
:root {
  --fc-rev: #5b8def;
  --fc-profit: #4ade80;
  --fc-down: #f87171;
  --fc-track: rgba(255, 255, 255, .08);
  --fc-zebra: rgba(255, 255, 255, .018);
  --fc-actual: rgba(255, 255, 255, .035);
}
[data-theme="light"] {
  --fc-rev: #2f63c9;
  --fc-profit: #15803d;
  --fc-down: #b91c1c;
  --fc-track: rgba(90, 83, 76, .14);
  --fc-zebra: rgba(90, 83, 76, .04);
  --fc-actual: rgba(255, 255, 255, .55);
}
.sheet--forecast thead th:not(.col-group),
.sheet--forecast tbody td { text-align: left; font-variant-numeric: tabular-nums; }
.sheet--forecast tbody tr.zebra td {
  background-image: linear-gradient(var(--fc-zebra), var(--fc-zebra)); }
.sheet--forecast tbody tr.q-start td,
.sheet--forecast tbody tr.q-start th { border-top: 1px solid var(--line); }
.sheet--forecast tbody td.col-dim { color: var(--fg-dim); font-weight: 400; }
.sheet--forecast tbody td.pos { color: var(--fc-profit); }
.sheet--forecast tbody td.neg { color: var(--fc-down); }
.fc-cell { display: inline-flex; align-items: center; gap: 8px; }
.fc-bar { flex: none; width: 44px; height: 4px; border-radius: 2px;
  background: var(--fc-track); overflow: hidden; }
.fc-bar.is-empty { visibility: hidden; }
.fc-bar i { display: block; height: 100%; border-radius: 2px;
  transition: width .3s ease-in-out; }
.fc-cell--total_rev .fc-bar i { background: var(--fc-rev); }
.fc-cell--profit .fc-bar i { background: var(--fc-profit); }
.fc-mom { min-width: 30px; font-size: 10.5px; font-weight: 500; color: var(--fg-faint); }
.fc-up, .fc-mom.fc-up { color: var(--fc-profit); }
.fc-down, .fc-mom.fc-down { color: var(--fc-down); }
/* Change on the prior period beside each summary card's total. */
.fc-headline-change { font-size: 12px; font-weight: 600; }
.fc-headline-change.fc-flat { color: var(--fg-faint); }
.fc-headline-change.fc-neutral { color: var(--fg-dim); }
@media (prefers-reduced-motion: reduce) {
  .fc-bar i { transition: none; }
}
.sheet--forecast tr.row-total td,
.sheet--forecast tr.row-total th { border-top: 2px solid var(--line);
  padding-top: 10px; padding-bottom: 10px; }
.sheet--forecast tr.row-total td { background: rgba(91, 141, 239, .06); }
[data-theme="light"] .sheet--forecast tr.row-total td { background: rgba(90, 83, 76, .06); }
.sheet--forecast tr.row-total td.tot-rev { color: var(--fc-rev); }
.sheet--forecast tr.row-total td.tot-profit { color: var(--fc-profit); }
.sheet--forecast tr.row-total td.tot-profit.neg { color: var(--fc-down); }
.fc-legend { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center;
  gap: 4px 16px; margin-bottom: 8px; font-size: 11px; color: var(--fg-faint); }
.fc-legend span { display: inline-flex; align-items: center; gap: 6px; }
.fc-legend b { font-weight: 500; }
.fc-swatch { display: inline-block; width: 9px; height: 9px; border-radius: 2px; }
.fc-swatch--rev { background: var(--fc-rev); }
.fc-swatch--profit { background: var(--fc-profit); }
.fc-swatch--child { background: rgba(0, 0, 0, .14); border: 1px solid var(--line); }
.fc-swatch--actual { background: var(--fc-actual); border: 1px solid var(--line); }
.fc-tablebar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
  margin-bottom: 8px; }
.fc-tablebar .fc-legend { flex: 1; margin-bottom: 0; }

/* Actuals above the forecast: the toggle, then the measured months on a
   lighter band with an ACTUAL tag and gray bars, and a divider where the
   forecast begins. They are their own row group, laid out in place: the
   forecast rows slide down to make room and each actual row fades in as it
   is uncovered (forecast.js). */
.fc-actuals-toggle { display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel); font-size: 12px; color: var(--fg-faint);
  transition: border-color .3s ease-in-out; }
.fc-actuals-toggle:hover { border-color: var(--fg-faint); }
.fc-actuals-label { color: var(--fg); font-weight: 600; }
.fc-chev { width: 12px; height: 12px; color: var(--fg);
  transition: transform .3s ease-in-out; }
.fc-actuals-toggle[aria-expanded="true"] .fc-chev { transform: rotate(180deg); }
.sheet--forecast tbody tr.act-row td,
.sheet--forecast tbody tr.act-row th { padding-top: 0; padding-bottom: 0;
  background-image: linear-gradient(var(--fc-actual), var(--fc-actual));
  transition: border-color .3s ease-in-out; }
.sheet--forecast tr.act-row .rh { display: block; box-sizing: border-box; padding: 7px 0;
  overflow: hidden;
  transition: max-height .3s ease-in-out, padding .3s ease-in-out, color .3s ease-in-out; }
.sheet--forecast tr.act-row.row-pre .rh,
.sheet--forecast tr.act-row.row-closing .rh { padding-top: 0; padding-bottom: 0;
  color: transparent; }
.sheet--forecast tr.act-row.row-pre td, .sheet--forecast tr.act-row.row-pre th,
.sheet--forecast tr.act-row.row-closing td,
.sheet--forecast tr.act-row.row-closing th { border-color: transparent; }
.sheet--forecast tr.act-row.row-anim .rh { white-space: nowrap; }
.sheet--forecast tr.act-row .fc-bar i { background: var(--fg-faint); }
.act-tag { display: inline-block; margin-left: 8px; padding: 0 4px;
  border: 1px solid var(--line); border-radius: 3px; font-size: 9px;
  font-weight: 500; letter-spacing: .08em; text-transform: uppercase;
  line-height: 14px; color: var(--fg-faint); vertical-align: 1px; }
.sheet--forecast tr.act-row.row-pre .act-tag,
.sheet--forecast tr.act-row.row-closing .act-tag { border-color: transparent; color: transparent; }
.act-tag { transition: color .3s ease-in-out, border-color .3s ease-in-out; }
.sheet--forecast tr.act-divider th .rh { font-size: 10px; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase; color: var(--fg-faint);
  white-space: nowrap; padding: 5px 0; }
.sheet--forecast tr.act-divider td,
.sheet--forecast tr.act-divider th { border-top: 1px solid var(--line);
  background-image: none; }
.sheet--forecast tbody.fc-act + tbody > tr:first-child td,
.sheet--forecast tbody.fc-act + tbody > tr:first-child th { border-top: 1px solid var(--line); }
/* While the actuals slide (forecast.js): the panel's height eases over a
   table laid out at its final size, so the table keeps its own height
   rather than stretching with the panel, and the panel clips. */
.sheet-wrap.act-moving { overflow-y: hidden; }
.sheet-wrap.act-moving > .sheet { align-self: flex-start; }
/* The divider is one band across the table, not a row of cells: no column
   rules, and its label is lifted out of the month column's width (a strut
   keeps the row's height) so opening the actuals never widens that column. */
.sheet--forecast tbody tr.act-row.act-divider th { border-right-color: transparent; }
.sheet--forecast tbody tr.act-divider td.sec-start { border-left-color: transparent; }
.sheet--forecast tr.act-divider th .rh::before { content: "\200b"; }
.act-divider-label { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); }
/* The month column is as wide with the actuals folded as open, so the
   ACTUAL tag never pushes it wider (the table jumped on open). */
.sheet--forecast.has-actuals tbody th,
.sheet--forecast.has-actuals thead th.sticky-col { min-width: 148px; }
@media (prefers-reduced-motion: reduce) {
  .fc-actuals-toggle, .fc-chev, .act-tag,
  .sheet--forecast tr.act-row td, .sheet--forecast tr.act-row th,
  .sheet--forecast tr.act-row .rh { transition: none; }
}

/* Every page's width, set first on the Forecast page: the old 96rem column
   (1536px) and 20px padding, its side margin halved. That margin was
   (100vw - 1536px) / 2 + 20px either side; half of it leaves
   calc(50vw + 768px) of width, with 10px padding inside (base.html).
   Past a 1728px window (a zoomed-out page, a wide monitor) the side margin
   stops growing at 48px, so tables take the extra width (Nov 12 2026). */
.page-width { max-width: max(calc(50vw / var(--zf, 1) + 768px), calc(100vw / var(--zf, 1) - 96px)); }
/* Always keep the scrollbar's room. Where scrollbars take space (a mouse
   on macOS, Windows), a page short enough to have none (Chat) was wider by
   the scrollbar, so the centred header and page sat half its width to the
   right of where they are on the other pages. */
html { overflow-y: scroll; }

/* Header titles hold one line, so the header band stays two short rows
   and opening a column scrolls the table sideways rather than squeezing
   the other titles onto more lines. */
.sheet--forecast thead th { white-space: nowrap; padding: 8px 10px; font-size: 10.5px;
  letter-spacing: .06em; }
.sheet--forecast thead tr.col-groups th.col-group { padding: 6px 10px; }
.sheet--forecast thead th.sticky-col { text-transform: uppercase; letter-spacing: .06em;
  font-size: 10.5px; font-weight: 600; }
.sheet--forecast .col-caret { font-size: 11px; }
.fc-bar { width: 52px; }
.fc-bar.is-neg i { background: var(--fc-down) !important; }

/* Dark theme: Eli's mockup palette. The table sits on the page background
   with a slightly raised header, month column and Totals band, rather than
   on the lighter panel the other sheets use. */
html:not([data-theme="light"]) {
  --fc-rev: #4f7be8;
  --fc-profit: #5fcf8a;
  --fc-track: #262a33;
  --fc-zebra: rgba(255, 255, 255, .015);
}
html:not([data-theme="light"]) .sheet--forecast { color: #cfd2d8; }
html:not([data-theme="light"]) .sheet--forecast thead th {
  background: rgba(255, 255, 255, .035); color: #8b8f99; border-bottom-color: rgba(255, 255, 255, .06); }
html:not([data-theme="light"]) .sheet--forecast thead tr.col-groups th {
  background: rgba(255, 255, 255, .035); color: #c2c5cc; border-bottom-color: rgba(255, 255, 255, .06); }
html:not([data-theme="light"]) .sheet--forecast thead tr.col-groups th.sticky-col { color: #8b8f99; }
html:not([data-theme="light"]) .sheet--forecast thead th.col-child {
  background: rgba(0, 0, 0, .14); color: #6f737c; }
html:not([data-theme="light"]) .sheet--forecast .col-emphasis,
html:not([data-theme="light"]) .sheet--forecast .col-toggle[aria-expanded="true"] { color: #fff; }
html:not([data-theme="light"]) .sheet--forecast .col-caret { color: #6b6f78; }
html:not([data-theme="light"]) .sheet--forecast .col-toggle[aria-expanded="true"] .col-caret { color: #fff; }
html:not([data-theme="light"]) .sheet--forecast thead tr th.sticky-col {
  background: linear-gradient(rgba(255, 255, 255, .035), rgba(255, 255, 255, .035)), var(--fx-sticky); }
html:not([data-theme="light"]) .sheet--forecast tbody th {
  background: var(--fx-sticky); color: #9a9ea8; border-right-color: rgba(255, 255, 255, .10); }
html:not([data-theme="light"]) .sheet--forecast tbody tr.zebra th {
  background: linear-gradient(rgba(255, 255, 255, .015), rgba(255, 255, 255, .015)), var(--fx-sticky); }
html:not([data-theme="light"]) .sheet--forecast tbody td { border-top-color: rgba(255, 255, 255, .06); }
html:not([data-theme="light"]) .sheet--forecast tbody td.col-dim,
html:not([data-theme="light"]) .sheet--forecast tbody td.col-child { color: #8b8f99; }
html:not([data-theme="light"]) .sheet--forecast tbody td.col-child { background: rgba(0, 0, 0, .14); }
html:not([data-theme="light"]) .sheet--forecast tbody td.neg { color: var(--fc-down); }
html:not([data-theme="light"]) .sheet--forecast tbody td.pos { color: var(--fc-profit); }
html:not([data-theme="light"]) .sheet--forecast .sec-start { border-left-color: rgba(255, 255, 255, .10); }
html:not([data-theme="light"]) .sheet--forecast tbody tr.q-start td,
html:not([data-theme="light"]) .sheet--forecast tbody tr.q-start th { border-top-color: rgba(255, 255, 255, .10); }
/* Year divider: a heavier line above month 13 wherever 24 months show (the
   Forecast table at 24 mo, and the aMER and Monthly Numbers tables with
   months 13-24 open). Visual only. Placed after the q-start rules it
   overrides, important so the theme border colors do not soften it. */
.sheet--forecast tbody tr.y2-start td,
.sheet--forecast tbody tr.y2-start th { border-top: 2px solid var(--fg-faint) !important; }
html:not([data-theme="light"]) .sheet--forecast .fc-cell--profit .fc-bar i { background: #4fb57a; }
html:not([data-theme="light"]) .sheet--forecast tr.row-total td,
html:not([data-theme="light"]) .sheet--forecast tr.row-total th {
  background: rgba(255, 255, 255, .05); color: #fff; border-top-color: rgba(255, 255, 255, .14); }
html:not([data-theme="light"]) .sheet--forecast tr.row-total th {
  background: linear-gradient(rgba(255, 255, 255, .05), rgba(255, 255, 255, .05)), var(--fx-sticky); }
html:not([data-theme="light"]) .sheet--forecast tr.row-total td.tot-rev { color: #7fa3f0; }
html:not([data-theme="light"]) .sheet--forecast tr.row-total td.tot-profit { color: var(--fc-profit); }
html:not([data-theme="light"]) .sheet--forecast tr.row-total td.tot-profit.neg { color: var(--fc-down); }
html:not([data-theme="light"]) .fc-legend { color: #8b8f99; }
html:not([data-theme="light"]) .fc-actuals-toggle { background: rgba(255, 255, 255, .05); border-color: rgba(255, 255, 255, .12); }
/* Actual rows, from the actuals-expanded mockup: a raised band with grey
   bars, set off from the forecast by a "Forecast begins" strip. */
html:not([data-theme="light"]) { --fc-actual: rgba(255, 255, 255, .03); }
html:not([data-theme="light"]) .sheet--forecast tbody tr.act-row th {
  background-image: linear-gradient(rgba(255, 255, 255, .035), rgba(255, 255, 255, .035)); }
html:not([data-theme="light"]) .sheet--forecast tbody tr.act-row td { border-top-color: rgba(255, 255, 255, .06); }
html:not([data-theme="light"]) .sheet--forecast tbody tr.act-row td.col-dim { color: #a4a8b1; }
html:not([data-theme="light"]) .sheet--forecast tr.act-row .fc-bar { background: #292e39; }
html:not([data-theme="light"]) .sheet--forecast tr.act-row .fc-bar i { background: #6b7283; }
html:not([data-theme="light"]) .act-tag { border-color: #3a3f4a; color: #838f99; }
html:not([data-theme="light"]) .sheet--forecast tr.act-divider td,
html:not([data-theme="light"]) .sheet--forecast tr.act-divider th {
  background: rgba(255, 255, 255, .05); border-top: 2px solid #3a3f4a; }
html:not([data-theme="light"]) .sheet--forecast tr.act-divider th .rh { color: #c2c5cc; }
html:not([data-theme="light"]) .sheet--forecast tbody tr.act-divider + tr td,
html:not([data-theme="light"]) .sheet--forecast tbody tr.act-divider + tr th { border-top-color: #3a3f4a; }
html:not([data-theme="light"]) .sheet--forecast tbody tr.act-row th { color: #8b8f99; }
html:not([data-theme="light"]) .sheet--forecast tbody tr.act-row:not(.act-divider) td.col-child {
  background-image: linear-gradient(rgba(0, 0, 0, .14), rgba(0, 0, 0, .14)); }
html:not([data-theme="light"]) .sheet--forecast tbody tr.act-row.q-start td,
html:not([data-theme="light"]) .sheet--forecast tbody tr.act-row.q-start th { border-top-color: #3a3f4a; }
html:not([data-theme="light"]) .sheet--forecast tbody tr.act-divider td { background: rgba(255, 255, 255, .05); }

/* Light theme counterpart: the same band, a slightly darker shade of the
   warm forecast panel (no blue tint), with warm grey bars, rules and divider. */
[data-theme="light"] { --fc-actual: rgba(90, 83, 76, .06); }
[data-theme="light"] .sheet--forecast tbody tr.act-row th {
  background-image: linear-gradient(rgba(90, 83, 76, .075), rgba(90, 83, 76, .075)); }
[data-theme="light"] .sheet--forecast tbody tr.act-row:not(.act-divider) td.col-child {
  background-image: linear-gradient(rgba(90, 83, 76, .09), rgba(90, 83, 76, .09)); }
[data-theme="light"] .sheet--forecast tbody tr.act-row td { border-top-color: #e3dfd9; }
[data-theme="light"] .sheet--forecast tr.act-row .fc-bar { background: rgba(90, 83, 76, .12); }
[data-theme="light"] .sheet--forecast tr.act-row .fc-bar i { background: #8a827a; }
[data-theme="light"] .act-tag { border-color: #cdc5ba; color: #78706a; }
[data-theme="light"] .sheet--forecast tbody tr.act-divider td,
[data-theme="light"] .sheet--forecast tbody tr.act-divider th {
  background: rgba(90, 83, 76, .08); border-top: 2px solid #c4bbaf; }
[data-theme="light"] .sheet--forecast tr.act-divider th .rh { color: #57504a; }
[data-theme="light"] .sheet--forecast tbody tr.act-divider + tr td,
[data-theme="light"] .sheet--forecast tbody tr.act-divider + tr th { border-top-color: #c4bbaf; }

/* Cell that just changed value after a recompute - brief accent wash so an
   edit's downstream effect is visible rather than silent. */
@keyframes cell-flash {
  from { background: rgba(239, 234, 224, .16); }
  to   { background: transparent; }
}
.sheet td.flash { animation: cell-flash .5s ease-out; }

/* ── Editable cells ─────────────────────────────────────────────────── */
.cell-input {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 5px 8px;
  color: var(--fg);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.cell-input:focus { outline: none; border-color: var(--grn); }
/* Inside the grid the input fills the cell so the row still reads as a row. */
.cell-in-grid {
  width: 100%;
  min-width: 122px;   /* fits a 6-figure plan value without clipping */
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 7px 12px;
}
.cell-in-grid:hover { background: rgba(255, 255, 255, .04); }
.cell-in-grid:focus { background: var(--panel-2); box-shadow: inset 0 0 0 2px var(--grn); }
/* Strip the spinners - they steal width in a dense grid. */
.cell-input::-webkit-outer-spin-button,
.cell-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cell-input[type=number] { -moz-appearance: textfield; }

.cell-input.saving { opacity: .55; }
.cell-input.saved { box-shadow: inset 0 0 0 2px var(--grn); }
.cell-input.error { box-shadow: inset 0 0 0 2px #f87171; }

/* ── +/- steppers ───────────────────────────────────────────────────────
   Nudging an assumption is the common move; typing an exact figure is the
   rare one. Buttons stay quiet until the card is hovered so a screen of ten
   inputs does not read as twenty buttons. */
.stepper {
  flex: 0 0 auto;
  width: 22px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-2);
  color: var(--fg-faint);
  font-size: 13px; line-height: 1; font-weight: 600;
  cursor: pointer;
  opacity: .45;
  transition: opacity .12s ease, color .12s ease, border-color .12s ease;
  user-select: none;
}
.rounded-xl:hover > .flex > .stepper { opacity: 1; }
.stepper:hover { color: var(--fg); border-color: var(--grn); }
.stepper:active { transform: scale(.94); }
.stepper:focus-visible { opacity: 1; outline: 1px solid var(--grn); }
/* Assumption tiles are packed about twice as dense as the headline cards, so
   the inputs and steppers shrink with them. */
.assume-grid .cell-input { padding: 3px 5px; font-size: 12px; }
.assume-grid .stepper { width: 18px; height: 22px; font-size: 12px; }

/* ── Modeling panels (forecast page) ───────────────────────────────────
   Four panels with an accent top edge, each input a row of label and base,
   slider and stepper, beside the outcome panel. A changed input reads
   amber: its base line, slider fill and thumb, and the stepper box. */
.sc-layout {
  display: grid; gap: 16px; align-items: start;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 1280px) {
  .sc-layout { grid-template-columns: minmax(0, 1fr) 380px; }
}
.sc-panels {
  display: grid; gap: 16px; align-items: stretch;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 1024px) {
  .sc-panels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.sc-panel {
  border: 1px solid var(--line);
  border-top: 3px solid var(--sc-accent);
  border-radius: 10px;
  background: var(--panel);
  overflow: hidden;
}
.sc-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--grid-line);
}
.sc-panel-title {
  font-size: 11.5px; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--fg);
}
.sc-panel-count { font-size: 11px; color: var(--fg-faint); }
.sc-panel-count.is-changed { color: var(--amber-ink); }

.sc-row {
  display: grid; align-items: center; gap: 14px;
  grid-template-columns: minmax(120px, 170px) minmax(60px, 1fr) auto auto;
  padding: 9px 16px;
  border-bottom: 1px solid var(--grid-line);
}
.sc-row:last-child { border-bottom: none; }
.sc-label { display: flex; flex-direction: column; min-width: 0; }
.sc-name { font-size: 13.5px; color: var(--fg); line-height: 1.3; width: fit-content; }
.sc-name.tip { margin-left: 0; }
.sc-base { font-size: 11px; color: var(--fg-faint); line-height: 1.4; }
.sc-row.modified .sc-base { color: var(--amber-ink); }
/* Fixed Costs and Agency Fee: the change-per-month toggle sits to the right
   of both label lines, centred on the row so it is level with the slider. */
.sc-label--mode {
  display: grid; grid-template-columns: minmax(0, auto) auto;
  justify-content: start; align-items: center; column-gap: 8px;
}
.sc-label--mode .sc-name, .sc-label--mode .sc-base { grid-column: 1; }
.sc-label--mode .sc-mode { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.sc-mode {
  font-size: 10.5px; line-height: 1; padding: 3px 6px; border-radius: 999px;
  border: 1px solid var(--grid-line); color: var(--fg-faint); background: transparent;
  cursor: pointer; white-space: nowrap;
}
.sc-mode:hover { color: var(--fg); }
.sc-mode[aria-pressed="true"] { color: var(--amber-ink); border-color: rgba(224, 161, 30, .6); background: rgba(224, 161, 30, .12); }

.sc-slider { position: relative; height: 20px; }
.sc-track {
  position: absolute; left: 0; right: 0; top: 50%;
  height: 4px; margin-top: -2px; border-radius: 2px;
  background: var(--fc-track);
}
.sc-fill {
  position: absolute; top: 0; bottom: 0;
  background: rgba(224, 161, 30, .35);
}
.sc-tick {
  position: absolute; top: -5px; width: 2px; height: 14px; margin-left: -1px;
  border-radius: 1px; background: #8b8f99;
}
.sc-fill[hidden], .sc-tick[hidden] { display: none; }
.sc-range {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0;
  -webkit-appearance: none; appearance: none;
  padding: 0; border: none; border-radius: 0; box-shadow: none;
  background: transparent; cursor: pointer;
}
.sc-range:focus { border: none; box-shadow: none; }
.sc-range:disabled { cursor: default; opacity: .4; }
.sc-range::-webkit-slider-runnable-track { background: transparent; height: 20px; }
.sc-range::-moz-range-track { background: transparent; }
.sc-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 14px; margin-top: 3px; border-radius: 50%;
  background: #fff; border: none; box-shadow: 0 1px 3px rgba(0, 0, 0, .45);
}
.sc-range::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; border: none; box-shadow: 0 1px 3px rgba(0, 0, 0, .45);
}
.sc-row.modified .sc-range::-webkit-slider-thumb { background: #e0a11e; }
.sc-row.modified .sc-range::-moz-range-thumb { background: #e0a11e; }
.sc-range:focus-visible { outline: none; }
.sc-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px rgba(224, 161, 30, .35); }

.sc-stepper {
  display: inline-flex; align-items: stretch;
  border: 1px solid var(--line); border-radius: 7px;
  background: var(--bg); overflow: hidden;
}
.sc-stepper .stepper {
  width: 26px; height: auto; opacity: 1;
  border: none; border-radius: 0; background: transparent;
}
.sc-stepper .stepper:first-child { border-right: 1px solid var(--line); }
.sc-stepper .stepper:last-child { border-left: 1px solid var(--line); }
.sc-stepper .stepper:hover { background: var(--panel-2); }
.sc-stepper .cell-input {
  width: 108px; border: none; border-radius: 0; background: transparent;
  padding: 6px 10px; font-size: 14px; font-weight: 500;
}
.sc-row.modified .sc-stepper {
  border-color: #e0a11e; background: rgba(224, 161, 30, .06);
}
.sc-row.modified .sc-stepper .stepper { border-color: rgba(224, 161, 30, .5); }
.sc-row.modified .sc-stepper .cell-input { color: var(--amber-ink); }

/* Scenario dropdown: its own chevron, inset from the right edge by the same
   12px as the name is from the left (the native arrow hugs the edge). */
.sc-select {
  -webkit-appearance: none; appearance: none;
  height: 34px; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%238a8279' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5.5 8 4.5 4.5L14.5 8'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 14px 14px;
}
/* "Reset scenario to live metrics": as tall as the dropdown, with a slight
   red tint so it reads as discarding changes. */
.sc-reset {
  display: inline-flex; align-items: center; height: 34px; padding: 0 14px;
  border-radius: 8px; font-size: 14px; font-weight: 500; cursor: pointer;
  color: #f3a5a0; background: rgba(220, 38, 38, .1);
  border: 1px solid rgba(220, 38, 38, .4);
}
.sc-reset:hover { background: rgba(220, 38, 38, .17); }
[data-theme="light"] .sc-reset { color: #b42318; background: rgba(220, 38, 38, .06); }
[data-theme="light"] .sc-reset:hover { background: rgba(220, 38, 38, .12); }
.sc-chip {
  font-size: 12px; line-height: 1; padding: 6px 10px; border-radius: 999px;
  color: var(--amber-ink); background: rgba(224, 161, 30, .1);
  border: 1px solid rgba(224, 161, 30, .45);
}
/* Per-input reset, between the slider and the stepper. Dim and inert until
   the input moves off its base. */
.sc-tile-reset {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; margin: 0 -6px; border-radius: 6px;
  color: var(--amber-ink); background: transparent; border: none; cursor: pointer;
}
.sc-tile-reset:hover { background: rgba(224, 161, 30, .12); }
.sc-tile-reset:disabled { color: var(--fg-faint); opacity: .35; cursor: default; background: transparent; }

.sc-outcome {
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel); padding: 18px 18px 16px;
}
.sc-outcome-title { font-size: 14px; font-weight: 600; color: var(--fg); }
.sc-outcome-sub { font-size: 11.5px; color: var(--fg-faint); margin-bottom: 10px; }
.sc-metrics { border-top: 1px solid var(--grid-line); }
.sc-metric {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 8px 0; font-size: 13.5px;
}
.sc-metric dt { color: var(--fg-dim); }
.sc-metric dd { display: flex; align-items: baseline; gap: 10px; }
.sc-metric-val { font-weight: 600; color: var(--fg); }
.sc-delta { min-width: 52px; text-align: right; font-size: 12px; }
.sc-delta.sc-up { color: #50cf8a; }
.sc-delta.sc-down { color: #e8573d; }
.sc-delta.sc-flat { color: var(--fg-faint); }
.sc-changes-head {
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--grid-line);
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--fg-faint);
}
.sc-changes { margin: 8px 0 0; padding: 0; list-style: none; }
.sc-changes li {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 4px 0; font-size: 12.5px; color: var(--fg-dim);
}
.sc-change-val { color: var(--amber-ink); white-space: nowrap; }
.sc-no-changes { margin-top: 8px; font-size: 12.5px; color: var(--fg-faint); }
.sc-save {
  display: block; width: 100%; margin-top: 16px; padding: 9px 12px;
  border-radius: 7px; text-align: center;
  font-size: 14px; font-weight: 600;
  background: var(--grn); color: var(--accent-ink);
}
.sc-save:hover { background: #fff; }
.sc-save:disabled { opacity: .4; cursor: default; }
.sc-save:disabled:hover { background: var(--grn); }
.sc-save-alt {
  display: block; margin-top: 10px; text-align: center;
  font-size: 12.5px; color: var(--fg-dim);
}
.sc-save-alt:hover { color: var(--fg); }
.sc-save-new summary::-webkit-details-marker { display: none; }

/* ── Hover explanations ─────────────────────────────────────────────────
   No visible "?" marker: the term itself is the target. A faint underline
   that only appears on hover keeps the grid clean while still hinting that
   there is something to read. The pointer stays as it is (no help cursor). */
.tip:hover { text-decoration: underline dotted var(--fg-faint); text-underline-offset: 3px; }

/* Hover hints off (Settings > Display; base.html sets data-hints="off"):
   no bubble, formula or highlight on hover. The scripts that draw them
   check the flag too; this covers the hovers drawn by CSS alone. */
html[data-hints="off"] .tip:hover { text-decoration: none; }
html[data-hints="off"] :is(#tooltip, #tip-portal, .rr-tip, .rr-pop, .rr-hl, .anr-hl, .ch-cell-hl) { display: none !important; }

/* The bubble is appended to <body>, not the cell: a tooltip inside
   .sheet-wrap would be clipped by its horizontal scroll. Drawn like the
   Recent Customer Repeat Rate page's bubbles (repeat_rate.css .rr-tip): a
   dark warm card in both themes, an arrow at the hovered term (left set by
   forecast.js as --tip-arrow; .below when it opens under the term). */
#tooltip {
  position: fixed;
  z-index: 200;
  max-width: 310px;
  padding: 10px 13px;
  border-radius: 10px;
  background: #24221f;
  color: #e9e5de;
  font-size: 12.5px;
  line-height: 1.55;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  white-space: normal;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .35);
  pointer-events: none;
  opacity: 0;
  transform: translateY(3px);
  transition: opacity .12s ease, transform .12s ease;
}
#tooltip::after {
  content: ""; position: absolute; bottom: -5px; left: var(--tip-arrow, 50%);
  width: 10px; height: 10px; margin-left: -5px; background: #24221f;
  transform: rotate(45deg);
}
#tooltip.below::after { bottom: auto; top: -5px; }
#tooltip.visible { opacity: 1; transform: translateY(0); }
#tooltip.tip-lines { white-space: pre-line; max-width: 420px; }
/* A metric with a formula: the plain-English definition first, then the
   formula in an inset box below it, in a wider bubble. A formula longer
   than the box wraps at its operators. */
#tooltip.has-tex { max-width: 560px; padding: 14px 16px; }
#tooltip.has-tex p { color: #d4cfc6; }
#tooltip .tip-math {
  margin-top: 12px; padding: 8px 14px; border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 8px; background: rgba(0, 0, 0, .22);
}
#tooltip .tip-tex { font-size: 13px; line-height: 1.6; color: #fff; }
#tooltip p { margin: 0; }

/* ── Detailed Hover Hints (static/inspect.js) ───────────────────────────
   The card a forecast number opens after a moment's hover: its exact
   value, where it comes from with a Show me button per source, and the
   calculation. Same dark warm card as the hover hints, but it takes the
   pointer so Show me can be clicked. Settings > Display turns it off. */
.inspect-card {
  position: fixed; z-index: 210; width: max-content; max-width: min(520px, calc(100vw / var(--zf, 1) - 16px));
  padding: 12px 14px; border-radius: 10px; background: #24221f; color: #e9e5de;
  font-size: 12.5px; line-height: 1.5; text-align: left; white-space: normal;
  box-shadow: 0 14px 36px rgba(0, 0, 0, .4); border: 1px solid rgba(255, 255, 255, .08);
  opacity: 0; transform: translateY(3px); transition: opacity .14s ease, transform .14s ease;
}
.inspect-card.visible { opacity: 1; transform: translateY(0); }
html[data-inspect="off"] .inspect-card { display: none !important; }
.inspect-head { font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase; color: #a8a196; }
.inspect-value { display: flex; align-items: baseline; gap: 10px; margin-top: 2px; }
.inspect-precise { font-size: 17px; font-weight: 600; color: #fff; font-variant-numeric: tabular-nums; }
.inspect-shown { font-size: 11.5px; color: #a8a196; }
.inspect-origin, .inspect-note { margin: 8px 0 0; color: #d4cfc6; }
.inspect-note { font-size: 11.5px; color: #a8a196; }
.inspect-parts { list-style: none; margin: 6px 0 0; padding: 0; }
.inspect-parts li {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 5px 0; border-top: 1px solid rgba(255, 255, 255, .07);
}
.inspect-parts li:first-child { border-top: 0; }
.inspect-part { min-width: 0; }
.inspect-part-top { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.inspect-part-label { color: #e9e5de; }
.inspect-part-value { color: #fff; font-weight: 600; font-variant-numeric: tabular-nums; }
.inspect-part-where { font-size: 11px; color: #a8a196; }
.inspect-show {
  flex: none; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 600;
  color: #24221f; background: #e9e5de; border: 0; cursor: pointer;
}
.inspect-show:hover { background: #fff; }
.inspect-math {
  margin-top: 10px; padding: 8px 12px; border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 8px; background: rgba(0, 0, 0, .22); overflow-x: auto;
}
/* A formula keeps to one line (the card widens for it, inspect.js open);
   the figures under it are a line of their own, with room between. */
.inspect-tex { font-size: 13px; line-height: 1.7; color: #fff; white-space: nowrap; }
.inspect-tex + .inspect-tex { margin-top: 8px; }
.inspect-tex + .inspect-tex { color: #d4cfc6; }
/* The cell Show me points at, on arrival: a pulsing ring that fades. Gold,
   or on this page the colour the card gave that reference (--ref-c). */
.inspect-hl { position: relative; animation: inspect-hl 1.3s ease-in-out 4; outline: 2px solid var(--ref-c, #f5b83d); outline-offset: -2px; }
@keyframes inspect-hl {
  0%, 100% { box-shadow: inset 0 0 0 0 transparent; }
  50% { box-shadow: inset 0 0 0 999px color-mix(in srgb, var(--ref-c, #f5b83d) 22%, transparent); }
}
@media (prefers-reduced-motion: reduce) { .inspect-hl { animation: none; background: color-mix(in srgb, var(--ref-c, #f5b83d) 22%, transparent); } }
/* The cells an open card names on this page (Sheets' formula references):
   each in its own colour (--ref-c), the colour of its name and number in
   the card's formula, steady for as long as the card is open. */
.inspect-ref { outline: 2px solid var(--ref-c, #f5b83d); outline-offset: -2px;
  background-image: linear-gradient(color-mix(in srgb, var(--ref-c, #f5b83d) 20%, transparent), color-mix(in srgb, var(--ref-c, #f5b83d) 20%, transparent)); }
.inspect-parts li.is-ref .inspect-part-label::before { content: ""; display: inline-block; width: 8px; height: 8px;
  margin-right: 6px; border-radius: 2px; background: var(--ref-c); vertical-align: 1px; }

/* ── Provenance badges ──────────────────────────────────────────────────
   Every setting says where it came from, so a placeholder is never mistaken
   for evidence. */
.src {
  font-size: 9.5px;
  letter-spacing: .04em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 999px;
  white-space: nowrap;
}
.src-measured { background: rgba(52,211,153,.12); color: #34d399; border: 1px solid rgba(52,211,153,.3); }
.src-manual   { background: rgba(34,211,238,.12); color: #22d3ee; border: 1px solid rgba(34,211,238,.3); }
.src-default  { background: rgba(251,191,36,.12); color: #fbbf24; border: 1px solid rgba(251,191,36,.3); }
.src-neutral  { background: rgba(120,113,108,.10); color: var(--fg-dim); border: 1px solid var(--line); }
.src-error    { background: rgba(229,72,77,.10); color: var(--red, #e5484d); border: 1px solid rgba(229,72,77,.35); }
/* An error said on a card (integrations.html), readable on the light theme. */
.card-error   { color: var(--red, #e5484d); background: rgba(229,72,77,.06); border: 1px solid rgba(229,72,77,.35); }

textarea.cell-input { text-align: left; width: 100%; min-height: 90px; resize: vertical; }

/* ── Section tabs ───────────────────────────────────────────────────────
   Every part of a forecast workbook is a tab here. The bar never scrolls
   sideways (a trackpad swipe across it also scrolled the page): tabs are
   sized to fit one row on a laptop, and wrap on narrower windows. */
.tabbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-bottom: 1px solid var(--line);
}
.tabbar-item {
  flex: 0 0 auto;
  padding: 7px 7px;
  font-size: 11px;
  color: var(--fg-faint);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: color .12s ease, border-color .12s ease, background .12s ease;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}
.tabbar-item:hover { color: var(--fg); background: rgba(255,255,255,.03); }
.tabbar-item--off { position: relative; cursor: not-allowed; }
/* Dimmed by colour, not opacity, so its popup below stays solid. */
.tabbar-groups .tabbar-item.tabbar-item--off,
.tabbar-groups .tabbar-item.tabbar-item--off:hover { color: color-mix(in srgb, var(--fg-dim) 45%, transparent); background: none; }
/* Why it is off (an order-driven segment on Spend & aMER), on hover or focus. */
.tabbar-item--off::after {
  content: attr(data-off); position: absolute; top: calc(100% + 6px); left: 0; z-index: 200;
  width: max-content; max-width: 300px; padding: 9px 12px; border-radius: 10px;
  background: #24221f; color: #f3efe8; font-size: 12px; font-weight: 400; line-height: 1.45;
  white-space: normal; text-align: left; box-shadow: 0 12px 28px -14px rgba(0,0,0,.6);
  opacity: 0; pointer-events: none; transition: opacity .12s;
}
.tabbar-item--off:is(:hover, :focus-visible)::after { opacity: 1; }
/* The open page: clicking it does nothing (base.html). */
:is(.tabbar-item, .viewbar-item).active { cursor: default; }
.tabbar-item.active {
  color: var(--fg);
  border-bottom-color: var(--grn);
  font-weight: 600;
}
/* The grouped menu: Outputs / Inputs / Reference. Group color shows only on
   the dot beside the label and a 2px top edge on the active tab. */
.tabbar-groups {
  --grp-outputs: #e6e4df;
  --grp-inputs: #1f9e93;
  --grp-reference: #c7781f;
  align-items: flex-end;
  gap: 0;
}
[data-theme="light"] .tabbar-groups { --grp-outputs: #3a4150; }
.tabgroup { display: flex; flex-direction: column; padding: 0 12px; }
.tabgroup:first-child { padding-left: 0; }
.tabgroup + .tabgroup { border-left: 1px solid var(--line); margin-bottom: 8px; padding-bottom: 0; }
.tabgroup + .tabgroup .tabgroup-items { margin-bottom: -8px; }
.tabgroup-label {
  display: flex; align-items: center; gap: 6px;
  padding: 0 14px 6px;
  font-size: 10px; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--fg-dim);
}
.tabgroup-label i { width: 6px; height: 6px; border-radius: 50%; background: var(--grp); }
.tabgroup--outputs { --grp: var(--grp-outputs); }
.tabgroup--inputs { --grp: var(--grp-inputs); }
.tabgroup--reference { --grp: var(--grp-reference); }
.tabgroup--inputs .tabgroup-label,
.tabgroup--reference .tabgroup-label { color: var(--grp); }
.tabgroup-items { display: flex; flex-wrap: wrap; align-items: flex-end; }
.tabbar-groups .tabbar-item {
  padding: 8px 14px;
  font-size: 13px;
  color: var(--fg-dim);
  border: 1px solid transparent;
  border-top-width: 2px;
  border-bottom: 0;
  margin-bottom: -1px;
  border-radius: 6px 6px 0 0;
}
.tabbar-groups .tabbar-item:hover { color: var(--fg); }
.tabbar-groups .tabbar-item.active {
  color: var(--fg);
  font-weight: 600;
  background: var(--panel);
  border-color: var(--line);
  border-top-color: var(--grp);
  padding-bottom: 9px;
}
/* The menu leads the page: 30px under the menu bar (main's 24px top
   padding plus this) and 34px above the content under it. */
.fade-in > .tabbar-groups:first-child { margin-top: 6px; }
/* Multi-country selector (_nav.html, static/country_switch.js): at the
   menu's right end, on the tabs' row, the same place on every page. Glass
   like the Forecast's header tiles; the chosen country is one rounded
   square (.ctry-thumb) that slides between options on the Compare metric
   switch's ease, on transforms only, so it stays smooth while the page's
   numbers are swapped under it. Its fill is the sliding pills' (--fx-seg-on):
   a tint of the text colour, never a solid panel, so it reads the same on
   dark and light glass. */
.ctry-select {
  --ctry-ease: .4s cubic-bezier(.65, 0, .35, 1);
  position: relative; margin-left: auto; align-self: center; display: inline-flex; gap: 2px; padding: 2px;
  border: 1px solid var(--fx-glass-edge, var(--line)); border-radius: 9px;
  background: var(--fx-glass, rgba(255,255,255,.04)); box-shadow: var(--fx-halo, none);
  backdrop-filter: var(--fx-blur-ctl, blur(16px)); -webkit-backdrop-filter: var(--fx-blur-ctl, blur(16px));
}
.ctry-thumb {
  position: absolute; top: 2px; bottom: 2px; left: 0; width: 0; border-radius: 7px; pointer-events: none;
  background: var(--fx-seg-on, rgba(255,255,255,.12));
  box-shadow: inset 0 0 0 1px var(--fx-ctl-line, rgba(255,255,255,.12));
  will-change: transform; transition: transform var(--ctry-ease), width var(--ctry-ease), opacity .2s;
}
.ctry-select.is-still .ctry-thumb { transition: none; }
.ctry-opt, .ctry-more {
  position: relative; z-index: 1; min-width: 34px; padding: 3px 10px; border-radius: 7px;
  font-size: 12.5px; line-height: 18px; color: var(--fg-dim); background: transparent; border: 0;
  cursor: pointer; transition: color .2s ease-in-out;
}
/* Each label reserves its bold width, so choosing does not shift the rest. */
.ctry-opt::after { content: attr(data-label); display: block; height: 0; overflow: hidden;
  visibility: hidden; font-weight: 600; }
.ctry-opt:hover, .ctry-more:hover { color: var(--fg); }
.ctry-opt:disabled { opacity: .35; cursor: not-allowed; color: var(--fg-dim); }
.ctry-opt.active, .ctry-more.active { color: var(--fg); font-weight: 600; }
.ctry-select:not(.has-thumb) .ctry-opt.active,
.ctry-select:not(.has-thumb) .ctry-more.active { background: var(--fx-seg-on, rgba(255,255,255,.12)); }
.ctry-opt:focus-visible, .ctry-more:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--st-blue-fill, rgba(79,123,232,.3)); }
.ctry-more { appearance: none; -webkit-appearance: none; padding-right: 22px;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 12px) 52%, calc(100% - 8px) 52%;
  background-size: 4px 4px; background-repeat: no-repeat; }
.ctry-hint { position: fixed; z-index: 60; max-width: 280px; padding: 7px 11px; border-radius: 8px;
  border: 1px solid var(--fx-glass-edge, var(--line)); background: var(--fx-glass-solid, var(--panel));
  box-shadow: 0 12px 28px -14px rgba(0,0,0,.5); font-size: 12px; color: var(--fg); }
/* "All" on an inputs page: cells still select and copy, they just do not open. */
html.ctry-ro .mn-input { cursor: default; }
/* They look calculated, not typed: no input fill or border (the selection
   ring and block wash still show). */
html.ctry-ro .mn-input:not(:focus) { background-color: transparent; border-color: transparent;
  border-style: solid; color: inherit; font-weight: inherit; }
@media (prefers-reduced-motion: reduce) { .ctry-thumb { transition: none; } }
.tabbar-groups + .mt-5 { margin-top: 34px; }

/* Under the menu: the page's views on the left, its tools and Export on
   the right (_nav.html). The same row on every page, views or not. */
.navrow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 14px;
  min-height: 34px; }
.navrow-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end;
  gap: 12px; margin-left: auto; }
.navrow + .mt-5 { margin-top: 22px; }
/* The Forecast's horizon switch and its "months from" label. */
.fc-horizon { display: inline-flex; align-items: center; gap: 10px; }
/* The other horizon on its way in place (forecast.js showHorizon) */
.fc-horizon-busy #projection-table { opacity: .6; transition: opacity .15s; }

/* A page's views: rounded buttons under the menu. */
.viewbar { display: flex; flex-wrap: wrap; gap: 6px; }

/* Export (_export.html, static/export.js): a button and its menu. */
.xp { position: relative; }
.xp-btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px 6px 12px;
  font-size: 13px; font-weight: 600; line-height: 20px; color: var(--fg);
  border: 1px solid var(--line); border-radius: 8px; background: var(--panel);
  transition: background .12s ease, border-color .12s ease;
}
.xp-btn:hover, .xp.is-open .xp-btn { border-color: var(--fg-faint); }
.xp-btn svg { width: 15px; height: 15px; }
.xp-btn .xp-chev { width: 13px; height: 13px; color: var(--fg-dim); transition: transform .15s ease; }
.xp.is-open .xp-chev { transform: rotate(180deg); }
.xp-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; width: 400px;
  max-width: calc(100vw / var(--zf, 1) - 24px); padding: 14px 10px 12px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--panel-3);
  box-shadow: 0 18px 44px -14px rgba(0, 0, 0, .45);
}
.xp-head { padding: 0 10px 8px; font-size: 10.5px; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: var(--fg-dim); }
.xp-item { display: flex; align-items: center; gap: 13px; padding: 8px 10px; border-radius: 8px; }
.xp-item:hover, .xp-item:focus-visible { background: rgba(127, 127, 127, .1); outline: none; }
.xp.is-busy [data-export-to="excel"] { opacity: .55; pointer-events: none; }
.xp-ico { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px;
  color: #1f9e5c; background: rgba(31, 158, 92, .13); border: 1px solid rgba(31, 158, 92, .22); }
.xp-ico--excel { color: #1d7a46; }
.xp-ico svg { width: 17px; height: 17px; }
.xp-text { display: flex; flex-direction: column; min-width: 0; }
.xp-text b { font-size: 14px; font-weight: 600; color: var(--fg); line-height: 19px; }
.xp-text small { font-size: 12px; color: var(--fg-dim); line-height: 17px; }
.xp-scope { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 8px 10px 0; padding-top: 12px;
  border-top: 1px solid var(--line); font-size: 13px; color: var(--fg-dim); }
.xp-scope label { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
/* Drawn by hand: a native radio with accent-color var(--fg) put a white dot
   on a white fill in dark mode. Ring and dot both take --fg. */
.xp-scope input { -webkit-appearance: none; appearance: none; flex: none; width: 15px; height: 15px;
  margin: 0; border: 1.5px solid var(--fg-dim); border-radius: 50%; background: transparent;
  cursor: pointer; }
.xp-scope input:checked { border-color: var(--fg);
  background: radial-gradient(circle, var(--fg) 0 3.5px, transparent 4px); }
.xp-scope input:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
.xp-here { margin-left: -3px; color: var(--fg-dim); }
.xp-status { margin: 10px 10px 0; font-size: 12px; color: var(--fg-dim); }
.xp-status--bad { color: var(--red, #e5484d); }
.viewbar-item {
  padding: 5px 12px;
  font-size: 12px;
  color: var(--fg-dim);
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  transition: color .12s ease, background .12s ease, border-color .12s ease;
}
.viewbar-item:hover { color: var(--fg); background: rgba(127,127,127,.08); }
.viewbar-item.active {
  color: var(--fg);
  font-weight: 600;
  background: var(--panel);
  border-color: var(--fg-faint);
}

/* A planned page that is not built yet. */
.placeholder-page {
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  padding: 40px 24px;
  text-align: center;
  color: var(--fg-dim);
}
.placeholder-page .ph-badge {
  display: inline-block; padding: 3px 10px; margin-bottom: 10px;
  border-radius: 999px; border: 1px solid var(--line);
  font-size: 10px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
}

/* Second row under a tab that has views of its own (Campaigns). */
.tabbar-sub { margin-top: 10px; }
.tabbar-sub .tabbar-item { padding: 6px 7px; font-size: 11px; }
.tabbar-group {
  margin-right: 6px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--fg-faint);
}

/* ── Reload takeover ────────────────────────────────────────────────────
   A modal, not an inline spinner: while the re-ingest runs the figures
   underneath are being rewritten, so editing them would be misleading. */
.overlay {
  position: fixed; inset: 0; z-index: 150;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(9, 11, 14, .78);
  backdrop-filter: blur(3px);
  animation: overlay-in .16s ease-out;
}
@keyframes overlay-in { from { opacity: 0 } to { opacity: 1 } }
.overlay[hidden] { display: none; }
.overlay-card {
  width: 100%; max-width: 520px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
}

.progress-track {
  height: 6px; border-radius: 999px;
  background: var(--panel-3);
  overflow: hidden;
}
.progress-fill {
  height: 100%; border-radius: 999px;
  background: var(--grn);
  transition: width .35s ease;
}
/* Steps that report no internal progress get a moving stripe rather than a bar
   frozen at one value, so "slow" never reads as "stuck". */
.progress-fill.indeterminate {
  background-image: linear-gradient(90deg,
    rgba(0,0,0,0) 0%, rgba(0,0,0,.28) 50%, rgba(0,0,0,0) 100%);
  background-size: 200% 100%;
  animation: stripe 1.1s linear infinite;
}
@keyframes stripe { from { background-position: 200% 0 } to { background-position: -200% 0 } }

.reload-steps { list-style: none; margin: 0; padding: 0; font-size: 12.5px; }
.reload-steps li {
  display: flex; align-items: center; gap: 9px;
  padding: 5px 0;
  color: var(--fg-faint);
  transition: color .15s ease;
}
.reload-steps li .dot {
  flex: 0 0 auto;
  width: 15px; height: 15px; border-radius: 50%;
  border: 1.5px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 9px; line-height: 1;
}
.reload-steps li.active { color: var(--fg); }
.reload-steps li.active .dot { border-color: var(--grn); }
.reload-steps li.done { color: var(--fg-dim); }
.reload-steps li.done .dot {
  border-color: var(--grn); background: var(--grn); color: var(--accent-ink);
}
.reload-steps li.failed .dot { border-color: #f87171; color: #f87171; }
.reload-steps li.failed { color: #f87171; }

/* ── Report preview theming ─────────────────────────────────────────────
   The composer preview mirrors the published page's theme. The sheet styles
   read CSS variables, so scoping new values under the preview retints the
   tables; the Tailwind token utilities are fixed colors, so the handful the
   preview uses are overridden here (the #id keeps specificity above the
   CDN-generated classes). The app's light mode forces those utilities with
   !important, so the preview repoints them at its own variables the same
   way; otherwise a dark report theme keeps the app's light surfaces. */
#rep-preview .bg-panel { background-color: var(--panel) !important; }
#rep-preview .bg-panel2 { background-color: var(--panel-2) !important; }
#rep-preview .bg-panel3 { background-color: var(--panel-3) !important; }
#rep-preview .border-line { border-color: var(--line) !important; }
#rep-preview .text-fg { color: var(--fg) !important; }
#rep-preview .text-fg-dim { color: var(--fg-dim) !important; }
#rep-preview .text-fg-faint { color: var(--fg-faint) !important; }
#rep-preview .sheet tbody tr:hover th.sticky-col { background: var(--panel-3); }

#rep-preview.preview-light {
  --panel: #fdfcfa; --panel-2: #f0ede7; --panel-3: #e3ddd5;
  --line: #cdc5ba; --grid-line: #e3dfd9;
  --fg: #1a1815; --fg-dim: #5a534c; --fg-faint: #9a9188;
  background: #f2f0ed;
  color: #1a1815;
}
#rep-preview.preview-light .text-emerald-400 { color: #047857; }
#rep-preview.preview-light .text-red-400 { color: #b91c1c; }
#rep-preview.preview-light .sheet .neg { color: #b91c1c; }
#rep-preview.preview-light .sheet tbody tr:hover td { background: rgba(90, 83, 76, .08); }
#rep-preview.preview-light .sheet tr.row-emphasis td,
#rep-preview.preview-light .sheet tr.row-emphasis th { background: rgba(90, 83, 76, .08); }

/* Dark preview: set explicitly so it holds when the app is in light mode. */
#rep-preview.preview-dark {
  --panel: #1a1d24; --panel-2: #22262f; --panel-3: #2a2f3a;
  --line: #2d3139; --grid-line: #262a33;
  --fg: #f3f4f6; --fg-dim: #9aa1ac; --fg-faint: #5f6672;
  background: #0f1115;
  color: #f3f4f6;
}
#rep-preview.preview-dark .sheet .neg { color: #f87171; }
#rep-preview.preview-dark .sheet tbody tr:hover td,
#rep-preview.preview-mdq-sunrise .sheet tbody tr:hover td { background: rgba(255, 255, 255, .025); }
#rep-preview.preview-dark .sheet tr.row-emphasis td,
#rep-preview.preview-dark .sheet tr.row-emphasis th,
#rep-preview.preview-mdq-sunrise .sheet tr.row-emphasis td,
#rep-preview.preview-mdq-sunrise .sheet tr.row-emphasis th { background: rgba(239, 234, 224, .035); }

/* The active theme button in the composer */
.rep-theme-btn.active { background: var(--grn); color: var(--accent-ink); }

/* Chart containers and the per-chart format switcher */
.kchart { position: relative; }
.kchart-alt {
  position: absolute; top: 6px; right: 6px; z-index: 5;
  font-size: 11px; padding: 2px 6px; border-radius: 8px;
  background: var(--panel-2); color: var(--fg-dim);
  border: 1px solid var(--line); cursor: pointer; opacity: .55;
  transition: opacity .15s;
}
.kchart:hover .kchart-alt, .kchart-alt:focus { opacity: 1; }
@media print { .kchart-alt { display: none; } }

/* CA Sunset preview: warm light page, brand browns plus black on white. */
#rep-preview.preview-ca-sunset {
  --panel: #ffffff; --panel-2: #FCF1DC; --panel-3: #F5E3C2;
  --line: #EBD3A9; --grid-line: #F0DDB9;
  --fg: #000000; --fg-dim: #884A39; --fg-faint: #C38154;
  background: #F9E0BB;
  color: #000000;
}
#rep-preview.preview-ca-sunset .text-emerald-400 { color: #5C7A39; }
#rep-preview.preview-ca-sunset .text-red-400 { color: #8B2500; }
#rep-preview.preview-ca-sunset .sheet .neg { color: #8B2500; }
#rep-preview.preview-ca-sunset .sheet tbody tr:hover td { background: rgba(0, 0, 0, .03); }
#rep-preview.preview-ca-sunset .sheet tr.row-emphasis td,
#rep-preview.preview-ca-sunset .sheet tr.row-emphasis th { background: rgba(136, 74, 57, .07); }

/* MDQ Sunrise preview: cool slate page, sand and sea on deep blue-grey. */
#rep-preview.preview-mdq-sunrise {
  --panel: #2C3947; --panel-2: #34455A; --panel-3: #3D506A;
  --line: #3A4C5F; --grid-line: #384B5E;
  --fg: #E8EDF2; --fg-dim: #C2A56D; --fg-faint: #547A95;
  background: #1F2935;
  color: #E8EDF2;
}
#rep-preview.preview-mdq-sunrise .text-emerald-400 { color: #C2A56D; }
#rep-preview.preview-mdq-sunrise .text-red-400 { color: #D98E73; }
#rep-preview.preview-mdq-sunrise .sheet .neg { color: #D98E73; }

/* Chat thinking indicator: three dots breathing while the answer is fetched */
.chat-wait { display: inline-flex; align-items: center; gap: 8px; }
.chat-wait .dots { display: inline-flex; gap: 4px; }
.chat-wait .dots span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--fg-faint);
  animation: chat-dot 1.2s infinite ease-in-out;
}
.chat-wait .dots span:nth-child(2) { animation-delay: .15s; }
.chat-wait .dots span:nth-child(3) { animation-delay: .3s; }
@keyframes chat-dot {
  0%, 60%, 100% { transform: translateY(0); opacity: .35; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* Example-question pills under the chat input */
.chat-pill {
  font-size: 11px; line-height: 1.3; text-align: left;
  padding: 4px 10px; border-radius: 9999px;
  background: var(--panel); color: var(--fg-faint);
  border: 1px solid var(--line);
  cursor: pointer; transition: color .15s, border-color .15s;
}
.chat-pill:hover { color: var(--fg); border-color: var(--fg-faint); }

/* Drop placeholder while dragging a report block: a colored slot that makes
   room at the target position instead of shuffling items under the cursor. */
.rep-drop-slot {
  border: 1.5px dashed var(--grn);
  border-radius: 10px;
  background: color-mix(in srgb, var(--grn) 12%, transparent);
  list-style: none;
}

/* Composer lazy loading: a section's skeleton (the shared .sk-bone), its
   title, a chart-sized block and the line saying what is loading. */
.rep-placeholder { display: grid; gap: 12px; min-height: 140px; }
.rep-placeholder .sk-chart { height: 180px; border-radius: 10px; }
.rep-placeholder-msg { color: var(--fg-faint); font-size: 12px; }

/* ── Date picker (flatpickr) customization ──────────────────────────────
   Minimal overrides - use flatpickr's default colors for better contrast */
.flatpickr-calendar {
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
}

/* ── Settings overlay (static/settings_overlay.js) ──────────────────────
   The gear opens the settings panel over the page. Its header, with Save
   on the right, stays pinned while the panel scrolls. */
.settings-overlay { align-items: flex-start; padding: calc(4vh / var(--zf, 1)) 20px; }
.settings-card {
  width: 100%; max-width: 1180px; max-height: calc(92vh / var(--zf, 1)); overflow-y: auto;
  /* At the top or bottom, keep the bounce here instead of scrolling the page behind. */
  overscroll-behavior: contain;
  border: 1px solid var(--line); border-radius: 14px;
  padding: 0 24px 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
}
.settings-head {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 0 12px; border-bottom: 1px solid var(--line);
}
.settings-close {
  font-size: 22px; line-height: 1; padding: 2px 8px; border-radius: 8px;
  color: var(--fg-dim);
}
.settings-close:hover { color: var(--fg); background: var(--panel-2); }
body.settings-open { overflow: hidden; }

/* ── Settings panel (_settings_panel.html) ──────────────────────────────
   The language of the Inputs and Outputs pages (monthly_numbers.css,
   product_targets.css): an 18px title and dim blurb, glass cards each
   opened by a coloured dot and an uppercase label, rows of label and help
   with the control on the right, blue for the active control, the amber
   Save. Here rather than in its own file because the panel also opens as
   an overlay on every page. */
.st { --st-blue: #4f7be8; --st-blue-fill: rgba(79, 123, 232, .2);
  --st-line: rgba(255, 255, 255, .07); --st-inset: rgba(255, 255, 255, .025);
  --st-ctl: rgba(255, 255, 255, .04); }
[data-theme="light"] .st { --st-blue: #2f63c9; --st-blue-fill: rgba(47, 99, 201, .14);
  --st-line: rgba(40, 34, 24, .12); --st-inset: rgba(246, 244, 241, .75);
  --st-ctl: rgba(251, 250, 248, .95); }
/* The header with Save stays pinned: a frosted bar like the nav on the
   page. In the overlay it runs edge to edge in the glass of the Scorecard's
   pinned first column (--fx-sticky over a blur), so the panel scrolling
   under it is diffused instead of showing through. */
.st-head { margin-top: 4px; padding: 12px 16px; border: 1px solid var(--fx-nav-line, var(--line));
  border-radius: 12px; background: var(--fx-nav, var(--bg));
  backdrop-filter: var(--fx-blur-ctl); -webkit-backdrop-filter: var(--fx-blur-ctl); }
.settings-card .st-head { margin: 0 -24px; padding: 14px 24px 12px; border-width: 0 0 1px; border-radius: 0;
  background: var(--fx-sticky); backdrop-filter: var(--fx-blur, blur(24px));
  -webkit-backdrop-filter: var(--fx-blur, blur(24px)); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .settings-card .st-head { background: var(--fx-sticky-frost, var(--fx-sticky)); }
}
/* In the overlay the header keeps its glass; what flickered was every
   other blur around it. The overlay blurred the whole page behind, and
   each glass card (and control) blurred its own backdrop, which there is
   the card's flat fill, so it looked the same unblurred. A dozen nested
   full-size blur layers re-rendered on every scroll frame, choked
   scrolling and blanked the screen when the GPU ran out of room (Nov 14
   2026). Only the header blurs now. */
.settings-overlay { backdrop-filter: none; -webkit-backdrop-filter: none; }
html[data-theme] .settings-overlay .settings-card :is(.glass, input, select, textarea, button, .btn) {
  backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
.st-title { font-size: 18px; font-weight: 600; color: var(--fg); }
.st-brand { margin-left: 10px; font-size: 12px; font-weight: 400; color: var(--fg-faint); }
.st-edited { font-size: 11.5px; color: var(--fg-faint); }
.st-blurb { max-width: 52rem; margin: 14px 0 4px; font-size: 13px; line-height: 1.55; color: var(--fg-dim); }
.st-btn { padding: 7px 14px; border-radius: 8px; border: 1px solid var(--line);
  background: transparent; color: var(--fg-dim); font-size: 13px; font-weight: 500;
  transition: border-color .3s ease-in-out, color .3s ease-in-out; }
.st-btn:hover { border-color: var(--fg-faint); color: var(--fg); }
.st-save { padding: 7px 16px; border-radius: 8px; border: 1px solid #e0a11e;
  background: #e0a11e; color: #1a1408; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background-color .3s ease-in-out; }
.st-save:hover:not(:disabled) { background: #eab23a; }
.st-save:disabled:not(.mn-save--busy, .mn-save--ok, .mn-save--err) { opacity: .45; cursor: default; }

/* Save feedback, on Monthly Numbers, Spend & aMER and Settings: while a
   save runs the button spins and reads "Saving..."; a stored save turns it
   green with a tick and a ring that spreads out; one that failed turns it
   red and shakes it. Each holds full opacity though the button is disabled
   meanwhile. */
:root { --save-ok: #3fb67f; --save-err: #e05d5d; }
[data-theme="light"] { --save-ok: #1f8a57; --save-err: #c43d3d; }
.mn-save svg, .st-save svg { display: inline-block; width: 13px; height: 13px; margin: -2px 5px 0 0;
  vertical-align: middle; }
.save-spin { display: inline-block; width: 11px; height: 11px; margin: -2px 6px 0 0; vertical-align: middle;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: save-spin .7s linear infinite; }
@keyframes save-spin { to { transform: rotate(360deg); } }
.mn-save--busy, .mn-save--busy:disabled { opacity: .85; cursor: progress; pointer-events: none; }
.mn-save--ok, .mn-save--ok:disabled { opacity: 1; border-color: var(--save-ok); background: var(--save-ok);
  color: #fff; animation: mn-save-ok .9s ease-out; }
.mn-save--err, .mn-save--err:disabled { opacity: 1; border-color: var(--save-err); background: var(--save-err);
  color: #fff; animation: mn-save-err .5s ease-in-out; }
.mn-save--ok svg path { stroke-dasharray: 20; stroke-dashoffset: 20;
  animation: mn-save-tick .4s .1s ease-out forwards; }
@keyframes mn-save-ok {
  0% { transform: scale(.94); box-shadow: 0 0 0 0 color-mix(in srgb, var(--save-ok) 60%, transparent); }
  35% { transform: scale(1.04); }
  100% { transform: scale(1); box-shadow: 0 0 0 12px transparent; }
}
@keyframes mn-save-tick { to { stroke-dashoffset: 0; } }
@keyframes mn-save-err {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}
/* A flashed "Settings saved." after the page comes back: the same tick. */
.flash-saved > svg { display: inline-block; width: 13px; height: 13px; margin: -2px 6px 0 0;
  vertical-align: middle; color: var(--save-ok); }
.flash-saved > svg path { stroke-dasharray: 20; stroke-dashoffset: 20;
  animation: mn-save-tick .4s .1s ease-out forwards; }
@media (prefers-reduced-motion: reduce) {
  .save-spin, .mn-save--ok, .mn-save--err, .mn-save--ok svg path, .flash-saved > svg path { animation: none; }
  .mn-save--ok svg path, .flash-saved > svg path { stroke-dashoffset: 0; }
}

/* Notifications (base.html FC_NOTE): a flashed message, a page script's
   toast. An x at the right, and a click anywhere on the box dismisses it:
   it fades and lifts, then its space closes so the page below slides up. */
.fc-note { position: relative; padding-right: 38px !important; cursor: pointer; overflow: hidden;
  transition: opacity .2s ease, translate .2s ease, scale .2s ease,
    height .26s cubic-bezier(.4, 0, .2, 1) .14s, margin .26s cubic-bezier(.4, 0, .2, 1) .14s,
    padding .26s cubic-bezier(.4, 0, .2, 1) .14s, border-width .26s ease .14s; }
.fc-note.is-leaving { opacity: 0; translate: 0 -6px; scale: .985; height: 0 !important;
  margin-top: 0 !important; margin-bottom: 0 !important; padding-top: 0 !important;
  padding-bottom: 0 !important; border-width: 0 !important; pointer-events: none; }
.fc-note-x { position: absolute; top: 50%; right: 8px; translate: 0 -50%; display: grid; place-items: center;
  width: 22px; height: 22px; padding: 0; border: 0; border-radius: 6px; background: none;
  color: inherit; opacity: .55; cursor: pointer; transition: opacity .15s ease, background-color .15s ease; }
.fc-note-x svg { width: 12px; height: 12px; }
.fc-note:hover .fc-note-x { opacity: .85; }
.fc-note-x:hover, .fc-note-x:focus-visible { opacity: 1; background: color-mix(in srgb, currentColor 12%, transparent); }
/* FC_NOTE.show: toasts stacked at the top of the window, under the header. */
.fc-notes-top { position: fixed; z-index: 1400; top: 64px; left: 50%; translate: -50% 0;
  display: grid; gap: 8px; width: max-content; max-width: min(calc(92vw / var(--zf, 1)), 520px); }
.fc-note--toast { padding: 10px 14px; border-radius: 10px; font-size: 13px; color: var(--fg);
  background: var(--panel); border: 1px solid var(--line); box-shadow: 0 12px 32px -12px rgba(0, 0, 0, .45);
  animation: fc-note-in .24s ease-out; }
@keyframes fc-note-in { from { opacity: 0; translate: 0 -8px; } }
@media (prefers-reduced-motion: reduce) {
  .fc-note, .fc-note-x { transition: none; }
  .fc-note--toast { animation: none; }
}

/* Cards and their eyebrows */
.st-card { margin-top: 14px; padding: 16px 22px 18px; border: 1px solid var(--line); border-radius: 12px; }
.st-eyebrow { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.st-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--fg-faint); }
.st-dot--display { background: #d6448a; }
.st-dot--views { background: #8e5bd8; }
.st-dot--forecast { background: #4f7be8; }
.st-dot--fields { background: #8e5bd8; }
.st-dot--retargeting { background: #e0672a; }
.st-dot--bfcm { background: #e8b84b; }
.st-bfcm-last { margin-top: 10px; }
.st-bfcm-tz { margin-top: 6px; }
.st-bfcm-tz b { font-weight: 600; color: var(--fg-dim); }
.st-bfcm-dates { display: grid; gap: 8px; flex: none; }
.st-bfcm-when { display: flex; align-items: center; gap: 8px; }
.st-bfcm-cap { width: 44px; font-size: 12px; color: var(--fg-dim); }
.st-bfcm-at { font-size: 12px; color: var(--fg-faint); }
.st-bfcm-day { width: 168px; }
.st-bfcm-time { width: 96px; }
.st-bfcm-time input { font-variant-numeric: tabular-nums; }
/* The native date field and its calendar follow the theme (not white on dark). */
.st-bfcm-day input { color-scheme: dark; font: inherit; font-size: 14px; }
[data-theme="light"] .st-bfcm-day input { color-scheme: light; }
.st-bfcm-day input::-webkit-calendar-picker-indicator { opacity: .6; cursor: pointer; }
.st-bfcm-day input::-webkit-calendar-picker-indicator:hover { opacity: 1; }
.st-dot--logo { background: #19a7d6; }
.st-dot--connections { background: #2bb5a4; }
.st-dot--rules { background: #c98a0e; }
.st-dot--comments { background: rgb(232, 184, 75); }
.st-dot--shortcuts { background: rgb(56, 189, 248); }
.st-cmt-name { width: 240px; flex: none; }
.st-cmt-msg:empty { display: none; }
.st-dot--notes { background: #1f9d57; }

/* Settings > Retargeting spend (static/retargeting.js): the channel block
   opens and closes on its height (grid rows 0fr <-> 1fr). */
.rt-status { margin: -2px 0 6px; }
.rt-status b { font-weight: 600; color: var(--fg-dim); }
.rt-body { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .2s ease-in-out; }
.rt-body.is-closed { grid-template-rows: 0fr; }
.rt-body-in { min-height: 0; overflow: hidden; }
.rt-channel { padding: 12px 0; border-top: 1px solid var(--st-line); }
.rt-head { display: grid; grid-template-columns: 140px 220px 1fr auto; align-items: center; gap: 12px; }
.rt-name { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 500; color: var(--fg); }
.rt-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--fg-faint); }
.rt-dot--meta { background: #4f7be8; }
.rt-dot--google { background: #e0a11e; }
.rt-spend { font-size: 11.5px; color: var(--fg-faint); font-variant-numeric: tabular-nums; }
.rt-check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--fg); cursor: pointer; }
.rt-check input { width: 15px; height: 15px; accent-color: var(--st-blue); cursor: pointer; }
.rt-add, .rt-remove { display: inline-grid; place-items: center; border: 1px solid var(--line);
  border-radius: 6px; background: transparent; color: var(--fg-dim); cursor: pointer;
  transition: border-color .2s ease-in-out, color .2s ease-in-out; }
.rt-add { width: 26px; height: 26px; font-size: 15px; line-height: 1; }
.rt-remove { width: 22px; height: 22px; border-color: transparent; font-size: 14px; }
.rt-add:hover, .rt-remove:hover { border-color: var(--fg-faint); color: var(--fg); }
.rt [hidden] { display: none !important; }
.rt-rules { margin: 8px 0 0 calc(140px + 12px); }
.rt-rule { display: grid; grid-template-columns: minmax(0, 1fr) 210px 170px 22px; align-items: center;
  gap: 10px; margin-bottom: 8px; }
.rt-text { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.rt-rule .st-select { min-width: 0; width: 100%; font-weight: 500; }
.rt-count { font-size: 11.5px; color: var(--fg-faint); white-space: nowrap; }
.rt-count b { font-weight: 600; color: var(--fg); }
.rt-count.is-zero b { color: var(--fg-faint); }
.rt-warn { font-size: 11.5px; }
.rt-targets { border-top: 1px solid var(--st-line); }
.rt-effect { margin-top: 6px; padding: 10px 14px; border: 1px solid rgba(79, 123, 232, .35);
  border-radius: 8px; background: var(--st-blue-fill); font-size: 12.5px; line-height: 1.55; color: var(--fg-dim); }
.rt-effect:empty { display: none; }
.rt-effect b { color: var(--fg); font-weight: 600; }
.rt-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.rt-preview-link { background: none; border: 0; padding: 0; cursor: pointer; }
.rt-drawer { margin-top: 12px; padding: 10px 14px; border: 1px solid var(--st-line); border-radius: 10px;
  background: var(--st-inset); font-size: 12px; }
.rt-drawer h4 { margin: 8px 0 4px; font-size: 10.5px; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: var(--fg-dim); }
.rt-drawer table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.rt-drawer th { padding: 4px 6px; font-size: 11px; font-weight: 500; text-align: left; color: var(--fg-faint);
  border-bottom: 1px solid var(--st-line); }
.rt-drawer td { padding: 5px 6px; border-bottom: 1px solid var(--st-line); color: var(--fg-dim); }
.rt-drawer td:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg); }
.rt-drawer td:last-child, .rt-drawer th:last-child { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 860px) {
  .rt-head { grid-template-columns: 1fr auto; }
  .rt-rules { margin-left: 0; }
  .rt-rule { grid-template-columns: minmax(0, 1fr) 22px; }
}
.st-eb-label { font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--fg-dim); white-space: nowrap; }
.st-eb-note { margin-left: auto; font-size: 11px; color: var(--fg-faint); white-space: nowrap; }

/* Rows: label and help on the left, the control on the right */
.st-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 12px 0; }
.st-row + .st-row { border-top: 1px solid var(--st-line); }
.st-rows { margin-top: 10px; border-top: 1px solid var(--st-line); }
.st-row-label { display: block; font-size: 13px; font-weight: 500; color: var(--fg); cursor: pointer; }
.st-row-help { margin-top: 2px; max-width: 46rem; font-size: 11.5px; line-height: 1.5; color: var(--fg-faint); }
.st-row-warn { display: block; margin-top: 4px; color: var(--amber-ink); }
/* Settings > Display: a sketch of the formula widget under its switch
   (_settings_panel.html .st-fxw-demo), one cell and several selected. */
.st-fxw-demo { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.st-fxw-pane { position: relative; width: 268px; height: 98px; box-sizing: border-box; padding: 9px 9px 0;
  border: 1px solid var(--st-line); border-radius: 8px; background: var(--st-inset); }
.st-fxw-cap { display: block; margin-bottom: 7px; font-size: 8.5px; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: var(--fg-faint); }
.st-fxw-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.st-fxw-grid i { height: 9px; border-radius: 2px; background: color-mix(in srgb, var(--fg-faint) 22%, transparent); }
.st-fxw-grid i.on { background: color-mix(in srgb, var(--st-blue) 35%, transparent); box-shadow: 0 0 0 1px var(--st-blue); }
.st-fxw-sq, .st-fxw-pill { position: absolute; right: 8px; bottom: 7px; display: inline-flex; align-items: center;
  border: 1px solid var(--st-line); background: color-mix(in srgb, var(--st-blue) 14%, var(--bg, #15171c));
  color: var(--fg); font-size: 9px; white-space: nowrap; }
.st-fxw-sq { justify-content: center; width: 22px; height: 22px; border-radius: 6px;
  font: italic 600 11px Georgia, serif; color: var(--st-blue); }
.st-fxw-pill { gap: 5px; height: 20px; padding: 0 4px 0 3px; border-radius: 999px; }
.st-fxw-pill small { font-size: 7.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-faint); }
.st-fxw-pill b { font-weight: 700; }
.st-fxw-sig { display: grid; place-items: center; width: 13px; height: 13px; border-radius: 50%;
  background: #3f6fe0; color: #fff; font-size: 8px; }
.st-fxw-fx { font: italic 600 9px Georgia, serif; color: var(--st-blue); }
.st-fxw-chev { display: grid; place-items: center; width: 13px; height: 13px; border-radius: 50%;
  border: 1px solid var(--st-line); font-size: 8px; line-height: 1; }
.st-fxw-keys { display: grid; gap: 6px; margin: 12px 0 0; padding: 0; list-style: none; font-size: 11.5px; color: var(--fg-faint); }
.st-fxw-keys li { display: flex; align-items: center; gap: 8px; }
.st-fxw-keys span { display: inline-flex; gap: 3px; min-width: 44px; }
.st-fxw-keys kbd, .ks-keys kbd { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; box-sizing: border-box;
  border: 1px solid var(--st-line); border-bottom-width: 2px; border-radius: 4px; background: var(--st-inset);
  font: 600 11px/1 -apple-system, BlinkMacSystemFont, sans-serif; color: var(--fg); }
html[data-fxw="off"] .st-fxw-demo, html[data-fxw="off"] .st-fxw-keys { opacity: .45; }
.st-fxw-keys li[hidden] { display: none; }
/* Settings > Keyboard shortcuts (static/shortcut_settings.js): two columns
   of groups, each row its keys right-aligned in a slot four caps wide, the
   name, a note and Revert. Key caps are Display's (.st-fxw-keys kbd). */
.ks { container-type: inline-size; }
.ks-intro { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 4px 0 12px; }
.ks-intro .st-row-help { margin: 0; }
.ks-reset { display: inline-flex; align-items: center; gap: 8px; flex: none; }
.ks-ask { font-size: 11.5px; color: var(--fg-dim); }
.ks-btn { padding: 5px 12px; font-size: 12px; }
.ks-btn:disabled { opacity: .45; cursor: default; }
.ks-btn:disabled:hover { border-color: var(--line); color: var(--fg-dim); }
.ks-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 28px;
  padding-top: 4px; border-top: 1px solid var(--st-line); }
@container (max-width: 900px) { .ks-cols { grid-template-columns: minmax(0, 1fr); } }
.ks-group { margin: 12px 0 6px; font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--fg-faint); }
.ks-row { display: grid; grid-template-columns: 112px auto minmax(0, 1fr) auto; align-items: center; column-gap: 12px;
  padding: 6px 0; border-top: 1px solid var(--st-line); }
.ks-slot { display: flex; justify-content: flex-end; }
.ks-keys { display: inline-flex; align-items: center; gap: 3px; min-height: 26px; padding: 3px; box-sizing: border-box;
  border: 1px solid transparent; border-radius: 6px; background: none; color: inherit; font: inherit; cursor: pointer; }
.ks-keys > * { animation: sc-in .1s ease-out; }
@keyframes sc-in { from { opacity: 0; } }
.ks-keys:hover { border-color: color-mix(in srgb, var(--fg-faint) 55%, transparent); }
.ks-keys:focus-visible { outline: none; border-color: var(--st-blue); box-shadow: 0 0 0 2px var(--st-blue-fill); }
.ks-name { font-size: 13px; font-weight: 500; color: var(--fg); }
.ks-after { display: inline-flex; align-items: center; gap: 8px; min-width: 0; font-size: 11.5px; color: var(--fg-faint); }
.ks-pill { padding: 1px 7px; border: 1px solid var(--st-line); border-radius: 999px; font-size: 10.5px; white-space: nowrap; }
.ks-pill.is-off { border-color: var(--st-blue); background: var(--st-blue-fill); color: var(--st-blue); }
.ks-esc { color: var(--st-blue); white-space: nowrap; }
.ks-note { white-space: nowrap; }
.ks-revert { padding: 3px 10px; font-size: 12px; }
.ks-msg { grid-column: 2 / -1; margin: 3px 0 0; font-size: 11.5px; color: var(--st-blue); }
.ks-msg.is-bad { color: var(--red, #e5484d); }
.ks-row.is-changed .ks-keys kbd { border-color: var(--st-blue); background: var(--st-blue-fill); color: var(--fg); }
[data-theme="light"] .ks-row.is-changed .ks-keys kbd { color: var(--st-blue); }
.ks-add, .ks-field { padding: 3px 8px; font-size: 11.5px; white-space: nowrap; }
.ks-add { border: 1px dashed color-mix(in srgb, var(--fg-faint) 60%, transparent); color: var(--fg-faint); }
.ks-field, .ks-field:hover { min-width: 88px; justify-content: center; border-color: var(--st-blue);
  box-shadow: 0 0 0 3px var(--st-blue-fill); color: var(--st-blue); }
.ks-field.is-bad, .ks-field.is-bad:hover { border-color: var(--red, #e5484d); box-shadow: 0 0 0 3px rgba(229, 72, 77, .18); }
.ks-field.is-bad kbd { border-color: rgba(229, 72, 77, .6); background: rgba(229, 72, 77, .1); color: var(--red, #e5484d); }
/* Go to page: slots in two columns under the groups, keys then "opens", the page and x. */
.ks-pages { margin-top: 10px; border-top: 1px solid var(--st-line); }
.ks-pages-help { margin: 0 0 6px; }
.ks-pages-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 28px; }
@container (max-width: 900px) { .ks-pages-grid { grid-template-columns: minmax(0, 1fr); } }
.ks-target { display: inline-flex; align-items: center; gap: 12px; min-width: 0; }
.ks-opens { font-size: 12px; color: var(--fg-faint); }
.ks .ks-select { min-width: 200px; padding-top: 5px; padding-bottom: 5px; font-size: 13px; font-weight: 500; }
.ks-del { padding: 2px 6px; border: 0; background: none; color: var(--fg-faint); font-size: 15px; cursor: pointer; border-radius: 6px; }
.ks-del:hover { color: var(--fg); }
.ks-del:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--st-blue-fill); }
.ks .ks-page-add { display: block; margin: 8px auto 0; padding: 5px 14px; border: 1px dashed color-mix(in srgb, var(--fg-faint) 60%, transparent); border-radius: 6px; background: none; font: inherit; font-size: 12px; cursor: pointer; }
.ks-page-add:hover { color: var(--fg); }
.st-intro { margin: 6px 0 14px; }
.st-link { flex: none; font-size: 12px; color: var(--st-blue); text-decoration: underline;
  text-underline-offset: 2px; white-space: nowrap; }
.st-link:hover { color: var(--fg); }
/* Settings > Start of forecast: a month calendar in the share dialog's
   style (share.css .share-cal) and the Targets popup (prior_targets.js). */
.st-fstart { flex: none; width: 210px; }
.st-pt-open { display: block; width: 100%; margin-top: 8px; }
/* Forecast Setup: the currency rows above, Start of forecast below. */
.st-divider { margin: 6px 0; border: 0; border-top: 1px solid var(--line); }
.st-fstart .share-date:disabled { cursor: not-allowed; opacity: .7; }
.share-cal.st-mcal { z-index: 200; width: 272px; }
.share-cal-mgrid { grid-template-columns: repeat(3, 1fr); gap: 4px; }
.share-cal-mgrid .share-cal-day { height: 40px; }
.share-dialog.pt-dialog { width: 1140px; max-height: calc(100vh / var(--zf, 1) - 24px); }
.pt-dlg-head { position: relative; padding: 22px 26px 4px; }
.pt-dlg-head h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; padding-right: 28px; font-size: 18px; font-weight: 600; }
.pt-dlg-tag { padding: 2px 7px; border: 1px solid var(--line); border-radius: 5px; font-size: 10.5px; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; color: var(--fg-dim); }
.pt-dlg-head p { max-width: 720px; margin: 0; font-size: 13.5px; line-height: 20px; color: var(--fg-dim); }
.pt-dlg-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 18px 26px 0; overflow-y: auto; min-height: 0; }
.pt-card { padding: 12px 14px 6px; border: 1px solid var(--line); border-radius: 10px; }
.pt-dot--spend { background: #e0672a; }
.pt-dot--nc { background: #4f7be8; }
.pt-dot--rc { background: #8e5bd8; }
.pt-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; }
.pt-row + .pt-row { border-top: .5px solid var(--line); }
.pt-row--sub .pt-label { padding-left: 14px; }
.pt-label { font-size: 14px; color: var(--fg); }
.pt-label small { display: block; font-size: 11.5px; color: var(--fg-dim); }
.share-field.pt-field { flex: none; width: 170px; height: 36px; }
.pt-field b { font-size: 14px; font-weight: 400; color: var(--fg-dim); }
.pt-field input { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.pt-field input::placeholder { font-weight: 400; color: var(--fg-faint); }
.pt-dialog .share-err { padding: 0 26px; }
.pt-dlg-foot { display: flex; align-items: center; gap: 12px; padding: 16px 26px 22px; }
.pt-dlg-foot .share-btn2, .pt-dlg-foot .st-save { height: 38px; padding: 0 18px; font-size: 14px; }
.pt-clear { margin-right: auto; padding: 0; border: 0; background: none; color: var(--fg); font-size: 13.5px;
  text-decoration: underline; cursor: pointer; }
@media (max-width: 900px) { .pt-dlg-cards { grid-template-columns: 1fr; } }

/* Switches: real checkboxes, so forms and the hints toggle read them as before.
   The knob is centred by auto margins between top and bottom 0, and its
   checked side is measured from the right edge, so it sits in the middle
   of the track whatever box sizing or padding the browser gives a
   checkbox (Safari drew a fixed 2px offset off-centre). */
.st-switch { -webkit-appearance: none; appearance: none; flex: none; position: relative;
  box-sizing: border-box; width: 34px; height: 20px; margin: 0; padding: 0;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--st-ctl); cursor: pointer;
  transition: background-color .2s ease-in-out, border-color .2s ease-in-out; }
.st-switch::after { content: ""; position: absolute; top: 0; bottom: 0; left: 2px; width: 14px; height: 14px;
  margin: auto 0; border-radius: 50%; background: var(--fg-faint);
  transition: left .2s ease-in-out, background-color .2s ease-in-out; }
.st-switch:checked { background: var(--st-blue); border-color: var(--st-blue); }
.st-switch:checked::after { left: calc(100% - 16px); background: #fff; }
.st-switch:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--st-blue-fill); }

/* Fields: uppercase label, input, help underneath */
.st-label { display: block; margin-bottom: 6px; font-size: 10px; font-weight: 500; letter-spacing: .1em;
  text-transform: uppercase; color: var(--fg-faint); }
.st-fields { display: grid; gap: 14px 24px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 720px) { .st-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Settings > Link Password: current on the left, new and again on the right
   past a divider, each field with an eye that shows what was typed. */
.st-pc-intro { margin: 2px 0 18px; }
.st-pc-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
@media (min-width: 720px) {
  .st-pc-grid { grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr); gap: 0 28px; }
  .st-pc-grid::before { content: ""; grid-column: 2; grid-row: 1; background: var(--st-line); }
  .st-pc-grid > .st-pc-col:last-child { grid-column: 3; grid-row: 1; }
  .st-pc-grid--one { grid-template-columns: minmax(0, 1fr); max-width: 460px; }
  .st-pc-grid--one::before { content: none; }
  .st-pc-grid--one > .st-pc-col:last-child { grid-column: 1; }
}
.st-pc-col .st-label { margin-bottom: 8px; }
.st-pc-field { position: relative; }
.st-pc-field .st-input { padding: 9px 40px 9px 12px; }
.st-pc-eye { position: absolute; top: 0; right: 4px; bottom: 0; display: grid; place-items: center;
  width: 32px; margin: auto 0; height: 28px; border-radius: 6px; color: var(--fg-faint); cursor: pointer; }
.st-pc-eye:hover, .st-pc-eye[aria-pressed="true"] { color: var(--fg); }
.st-pc-eye:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--st-blue-fill); }
.st-pc-eye svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; }
.st-pc-eye .st-pc-slash { display: none; }
.st-pc-eye[aria-pressed="true"] .st-pc-slash { display: inline; }
.st-pc-rule { margin: 8px 0 16px; }
.st-pc-actions { display: flex; align-items: center; justify-content: flex-end; gap: 16px; margin-top: 18px; }
.st-pc-actions .st-row-help { margin: 0 auto 0 0; }
.st-input { width: 100%; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--st-ctl); color: var(--fg); font-size: 13px;
  transition: border-color .2s ease-in-out, box-shadow .2s ease-in-out; }
.st-input::placeholder { color: var(--fg-faint); }
.st-input:focus { outline: none; border-color: var(--st-blue); box-shadow: 0 0 0 2px var(--st-blue-fill); }
.st-input[type=number] { -moz-appearance: textfield; }
.st-input::-webkit-outer-spin-button,
.st-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.st-select { flex: none; width: auto; min-width: 220px; padding-right: 36px; font-weight: 600; cursor: pointer;
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%238a8279' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5.5 8 4.5 4.5L14.5 8'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 14px 14px; }
/* Settings > Forecast, Currency conversion: one row per currency converted
   into the core currency. A hand-set rate reads blue, as a typed input does
   on Monthly Numbers. */
.st-row--stack { flex-direction: column; align-items: stretch; gap: 10px; }
.st-fx { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.st-fx th { padding: 6px 8px; font-size: 11px; font-weight: 500; text-align: left; color: var(--fg-faint);
  border-bottom: 1px solid var(--st-line); }
.st-fx td { padding: 8px; vertical-align: middle; border-bottom: 1px solid var(--st-line); }
.st-fx tr.is-off td { opacity: .6; }
.st-fx-cur { font-weight: 600; font-variant-numeric: tabular-nums; }
.st-fx-what { color: var(--fg-faint); }
.st-fx-what .st-fx-by { display: block; margin-top: 2px; color: var(--st-blue); }
.st-fx-input { width: 130px; }
.st-fx-input.is-manual { background: var(--st-blue-fill); border-color: var(--st-blue); color: var(--fg); }
[data-theme="light"] .st-fx-input.is-manual { color: var(--st-blue); }
.st-fx-reset { background: none; border: 0; padding: 0; cursor: pointer; }
.st-textarea { margin-top: 6px; min-height: 92px; resize: vertical; line-height: 1.5; }
.st-hint { margin-top: 5px; font-size: 11px; line-height: 1.45; color: var(--fg-faint); }
.st-tiles { display: grid; gap: 10px; margin-top: 8px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.st-tile { padding: 12px 14px; border: 1px solid var(--st-line); border-radius: 8px; background: var(--st-inset); }
.st-tile:hover .stepper { opacity: 1; }

/* The built-in rules and brand values, in an inset panel */
.st-inset { display: grid; gap: 14px 24px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  margin-top: 14px; padding: 12px 16px; border: 1px solid var(--st-line); border-radius: 10px;
  background: var(--st-inset); }
.st-list { padding-left: 16px; list-style: disc; font-size: 11.5px; line-height: 1.55; color: var(--fg-faint); }
.st-values { display: grid; grid-template-columns: auto 1fr; gap: 3px 14px; font-size: 11.5px;
  line-height: 1.5; color: var(--fg-faint); }
.st-values dt { color: var(--fg-dim); }
.st-warn { margin-top: 12px; max-width: 48rem; padding: 8px 12px; border: 1px solid rgba(224, 161, 30, .35);
  border-radius: 8px; background: rgba(224, 161, 30, .1); font-size: 11.5px; line-height: 1.5; color: var(--amber-ink); }

/* Skeleton shown while the panel loads: the same layout in placeholder
   bars. A light sweep runs across every bar in step, and the sections
   settle in top to bottom. */
.sk-bone {
  display: block; height: 10px; border-radius: 6px;
  background-color: var(--panel-3);
  background-image: linear-gradient(100deg,
    transparent 30%, color-mix(in srgb, var(--fg) 9%, transparent) 50%, transparent 70%);
  background-size: 300% 100%;
  background-repeat: no-repeat;
  animation: sk-sweep 1.6s ease-in-out infinite;
}
.sk-title { height: 14px; }
.sk-btn { height: 30px; border-radius: 8px; }
.sk-label { height: 9px; }
.sk-pill { height: 16px; border-radius: 999px; }
.sk-input { height: 28px; border-radius: 8px; }
.sk-note { height: 8px; opacity: .7; }
.sk-text { height: 12px; }
.sk-dot { height: 7px; border-radius: 50%; flex: none; }
.sk-figure { height: 22px; }
.sk-textarea { height: 92px; border-radius: 8px; }
.sk-bar { height: 72px; margin-top: 12px; border-radius: 4px; }
/* Page skeletons (_skeleton.html): KPI tiles, the table toolbar and rows. */
.sk-kpi { display: grid; gap: 10px; }
.sk-toolbar { min-height: 30px; }
.sk-table th, .sk-table td { padding-top: 11px; padding-bottom: 11px; }
.sk-section {
  opacity: 0;
  animation: sk-rise .4s ease-out forwards;
  animation-delay: calc(var(--sk-i, 0) * 60ms);
}
@keyframes sk-sweep { from { background-position: 100% 0 } to { background-position: 0 0 } }
@keyframes sk-rise { from { opacity: 0; transform: translateY(6px) } to { opacity: 1; transform: none } }
@media (prefers-reduced-motion: reduce) {
  .sk-bone { background-image: none; animation: sk-pulse 1.6s ease-in-out infinite; }
  .sk-section { opacity: 1; animation: none; }
  @keyframes sk-pulse { 50% { opacity: .55 } }
}

/* ── Scenario comparison controls (forecast page) ──────────────────────
   The metric switch is the Scorecard's .perf-mode (performance.css); a
   metric picked from the "Other" menu leaves no button pressed, so the
   pill hides. Overlay chips carry their line's colour as a dot. */
.cmp-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.cmp-label { font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--fg-faint); }
.cmp-mode { --perf-ease: .4s cubic-bezier(.65, 0, .35, 1); margin-left: 0; }
.cmp-mode.no-pick .perf-mode-pill { opacity: 0; }
.cmp-select {
  display: inline-flex; align-items: center; gap: 6px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2);
  font-size: 13px;
}
.cmp-select select { background: transparent; border: 0; padding: 6px 2px; font-size: 13px; color: var(--fg); max-width: 22rem; }
.cmp-select select:focus { outline: none; }
.cmp-select-pre { color: var(--fg-faint); }
.cmp-chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2);
  font-size: 13px; color: var(--fg);
}
.cmp-chip i { width: 9px; height: 9px; border-radius: 999px; background: var(--chip-color); }
.cmp-chip button { color: var(--fg-faint); line-height: 1; }
.cmp-chip button:hover { color: var(--fg); }

/* ── Soft glass (dark and light themes) ─────────────────────────────────
   Cosmetic only: surface fills, border colours, shadows and the page
   background. No size, spacing, radius or layout changes. One set of rules
   serves both themes through the --fx-* tokens below. Large panels get
   their material from .glass (and .sheet-wrap, the table panel on every
   page); smaller controls only swap fill and border colour. The report
   previews and the standalone report pages (no data-theme) keep their own
   surfaces. */
:root {
  /* Opaque stand-in under pinned cells, for the dark table rules above
     when they render outside the app (report pages). */
  --fx-sticky: #14171e;
  /* The frosted glass shared by the top bar (.header-bg below) and the
     selection widget (cell_summary.css .csum): one blur radius, and one
     near-opaque fill where the blur is unsupported or less transparency
     is asked for. */
  --glass-blur: 22px;
  --glass-solid: rgba(28, 31, 42, .97);
}
html[data-theme] {
  --fx-bg-base: #0b0d12;
  --fx-grads:
    radial-gradient(1100px 700px at 6% -4%,   rgba(79,123,232,.32), transparent 62%),
    radial-gradient(900px 600px  at 102% 8%,  rgba(43,181,164,.22), transparent 62%),
    radial-gradient(900px 600px  at 40% 42%,  rgba(142,91,216,.13), transparent 62%),
    radial-gradient(1000px 650px at 72% 104%, rgba(142,91,216,.20), transparent 62%),
    radial-gradient(800px 500px  at -2% 100%, rgba(43,181,164,.13), transparent 62%),
    linear-gradient(180deg, #0e1118 0%, #0b0d12 100%);
  --fx-bg-filter: brightness(.92);
  /* Colour grain: the same gradient, re-tinted and masked by noise, never a
     white or black overlay. Dark brightens it, light darkens it (bright
     speckles on a near-white page are invisible). */
  --fx-grain-filter: brightness(2.2) saturate(1.5);
  --fx-grain-opacity: .575;
  --fx-noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1 0 0 0 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  /* Parallax: the background drifts up --fx-rate of a pixel for each pixel
     scrolled, at most --fx-drift of the window's height (base.html works
     out --fx-shift, the page's drift, and the layer is that much taller
     than the window). */
  --fx-rate: .06;
  --fx-drift: .3;

  --fx-glass: rgba(255, 255, 255, .045);
  --fx-glass-solid: rgba(19, 22, 28, .92);
  --fx-glass-line: rgba(255, 255, 255, .085);
  /* The material behind every surface: how far the page behind is blurred
     and how much of its colour is let through. */
  --fx-blur: blur(24px) saturate(110%);
  --fx-blur-ctl: blur(14px) saturate(110%);
  /* The edge, the same three 1px lines in both themes, from the surface
     out: a lit rim (brightest along the top), the border itself as a
     darker buffer, then a fainter light ring outside it. Then the shadow. */
  --fx-glass-edge: rgba(0, 0, 0, .5);
  --fx-ring: rgba(255, 255, 255, .07);
  --fx-rim-lit: rgba(255, 255, 255, .16);
  --fx-rim: rgba(255, 255, 255, .09);
  --fx-drop: 0 20px 50px -30px rgba(0, 0, 0, .8);
  --fx-halo:
    0 0 0 1px var(--fx-ring),
    inset 0 1px 0 var(--fx-rim-lit),
    inset 0 0 0 1px var(--fx-rim),
    var(--fx-drop);
  --fx-nav: rgba(11, 13, 18, .55);
  --fx-nav-line: rgba(255, 255, 255, .07);
  /* Fill of the first (header) column of every table, pinned or not: a
     touch lighter than the row. A pinned cell is glass as well (it blurs
     what scrolls under it, "Pinned first column" below), so it reads the
     same at rest and scrolled. The frost is the stand-in where the browser
     has no backdrop blur. */
  --fx-sticky: rgba(255, 255, 255, .04);
  --fx-sticky-frost: rgba(26, 29, 40, .98);
  --fx-head: rgba(255, 255, 255, .035);
  --fx-head-line: rgba(255, 255, 255, .06);
  --fx-rule: rgba(255, 255, 255, .10);
  --fx-emph: rgba(255, 255, 255, .07);
  --fx-hover: rgba(255, 255, 255, .025);
  --fx-ctl: rgba(255, 255, 255, .05);
  --fx-ctl-hover: rgba(255, 255, 255, .09);
  --fx-ctl-line: rgba(255, 255, 255, .12);
  --fx-ctl-on: rgba(255, 255, 255, .12);
  --fx-ctl-on-shadow: none;
  --fx-seg-on: rgba(255, 255, 255, .12);
  --fx-tab-on: rgba(255, 255, 255, .12);
  --fx-nav-on: rgba(255, 255, 255, .12);
  --fx-nav-hover: rgba(255, 255, 255, .06);
  --fx-well: rgba(0, 0, 0, .25);
  --fx-track: rgba(255, 255, 255, .12);
}
html[data-theme="light"] {
  --fx-bg-base: #ece9e5;
  --fx-grads:
    radial-gradient(1100px 700px at 6% -4%,   rgba(100,126,224,.36), transparent 62%),
    radial-gradient(900px 600px  at 102% 8%,  rgba(64,170,146,.26), transparent 62%),
    radial-gradient(900px 600px  at 40% 42%,  rgba(150,112,196,.12), transparent 62%),
    radial-gradient(1000px 650px at 72% 104%, rgba(158,112,190,.16), transparent 62%),
    radial-gradient(900px 600px  at -2% 100%, rgba(64,170,146,.26), transparent 62%),
    linear-gradient(180deg, #efece8 0%, #ece9e5 100%);
  --fx-bg-filter: none;
  --fx-grain-filter: brightness(.72) saturate(1.5);
  --fx-grain-opacity: .575;

  /* Liquid glass: a thinner fill over a heavier blur, so the blooms
     behind come through as soft colour while the grain is blurred away. */
  --fx-glass: rgba(255, 255, 255, .44);
  --fx-glass-solid: rgba(248, 247, 244, .95);
  --fx-glass-line: rgba(60, 50, 40, .10);
  --fx-glass-edge: var(--fx-glass-line);
  --fx-blur: blur(28px) saturate(160%);
  --fx-blur-ctl: blur(16px) saturate(150%);
  --fx-ring: rgba(255, 255, 255, .6);
  --fx-rim-lit: rgba(255, 255, 255, .95);
  --fx-rim: rgba(255, 255, 255, .4);
  --fx-drop: 0 14px 34px -22px rgba(60, 50, 40, .30);
  --fx-sticky: rgba(255, 255, 255, .28);
  --fx-sticky-frost: rgba(244, 242, 239, .98);
  --fx-nav: rgba(243, 241, 238, .62);
  --fx-nav-line: rgba(60, 50, 40, .08);
  --glass-solid: rgba(252, 251, 249, .97);
  --fx-head: rgba(60, 50, 40, .045);
  --fx-head-line: rgba(60, 50, 40, .08);
  --fx-rule: rgba(60, 50, 40, .12);
  --fx-emph: rgba(90, 83, 76, .08);
  --fx-hover: rgba(90, 83, 76, .08);
  --fx-ctl: rgba(255, 255, 255, .5);
  --fx-ctl-hover: rgba(255, 255, 255, .75);
  --fx-ctl-line: rgba(60, 50, 40, .12);
  --fx-ctl-on: rgba(255, 255, 255, .92);
  --fx-ctl-on-shadow: 0 1px 2px rgba(60, 50, 40, .10);
  --fx-seg-on: rgba(60, 50, 40, .075);
  --fx-tab-on: rgba(255, 255, 255, .55);
  --fx-nav-on: rgba(60, 50, 40, .08);
  --fx-nav-hover: rgba(60, 50, 40, .04);
  --fx-well: rgba(255, 255, 255, .78);
  --fx-track: rgba(60, 50, 40, .12);
  --grid-line: rgba(60, 50, 40, .08);
}
@media (prefers-reduced-motion: reduce) { html[data-theme] { --fx-drift: 0; } }
html[data-theme] body { background: var(--fx-bg-base); }

/* Page background (base.html): fixed to the window, under all content
   (z-index -1 in the root stacking context, over the body fill). Its layer
   is a little taller than the window and drifts up by the extra as the page
   scrolls (--fx-shift, at a steady --fx-rate), so the top blooms lead the
   page and the bottom ones close it. It used to be absolute and the full page height, moved against
   the scroll: on a long page that is a very tall composited layer the
   browser only keeps partly drawn, and after a pause it dropped the rest, so
   the first small scroll had to redraw it and every glass panel blurring it
   blinked out for a frame. A window-sized layer stays drawn. */
/* min-height: on a page shorter than the window the content area still runs
   to the bottom of the screen. */
body { position: relative; min-height: calc(100vh / var(--zf, 1)); }
/* Tailwind's min-h-screen is a plain 100vh: page_zoom.js shrinks it with the page. */
main.min-h-screen { min-height: calc(100vh / var(--zf, 1)); }
.fx-bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.fx-bg-layer {
  position: absolute; left: 0; right: 0; top: 0;
  height: calc(100% + var(--fx-shift, 0px));
  /* --fx-prog (0 to 1, the share of the page scrolled) is set by base.html
     where the scroll-driven animation below is not supported. The shift is
     the rate times the page's scroll range, so either way the layer moves
     the same distance per pixel scrolled. */
  transform: translate3d(0, calc(var(--fx-prog, 0) * var(--fx-shift, 0px) * -1), 0);
  will-change: transform;
  background: var(--fx-grads);
  filter: var(--fx-bg-filter);
}
/* Where the browser can tie an animation to the scroll position, the drift
   runs there instead: the compositor moves the layer in step with each
   scrolled frame, where the scroll event lands a frame or more behind. */
@supports (animation-timeline: scroll()) {
  .fx-bg-layer {
    animation: fx-drift linear both;
    animation-timeline: scroll(root block);
  }
  @keyframes fx-drift {
    from { transform: translate3d(0, 0, 0); }
    to { transform: translate3d(0, calc(var(--fx-shift, 0px) * -1), 0); }
  }
}
.fx-bg-layer::after {
  content: ""; position: absolute; inset: 0;
  background: var(--fx-grads);
  filter: var(--fx-grain-filter);
  opacity: var(--fx-grain-opacity);
  mask-image: var(--fx-noise); -webkit-mask-image: var(--fx-noise);
  mask-size: 300px 300px; -webkit-mask-size: 300px 300px;
}

/* kynship-ui's entrance animation (fadeUp, fill-mode both) keeps opacity
   and a transform on every page section after it ends. That makes each
   section a backdrop root, so the panels inside blurred only the section
   (transparent), not the page: the grain showed straight through the glass.
   Dropping the fill after the 0.18s entrance leaves the same end state
   (opacity 1, no transform) without the effect layer. */
main > *, .fade-in { animation-fill-mode: backwards; }

/* Glass surface: existing border width and radius are kept. */
html[data-theme] .glass:where(:not(#rep-preview *)),
html[data-theme] .sheet-wrap:where(:not(#rep-preview *)) {
  background: var(--fx-glass);
  backdrop-filter: var(--fx-blur);
  -webkit-backdrop-filter: var(--fx-blur);
  border-color: var(--fx-glass-edge);
  box-shadow: var(--fx-halo);
}
/* Light mode's surface utilities are !important (top of this file). */
html[data-theme="light"] .glass.bg-panel:where(:not(#rep-preview *)) { background-color: var(--fx-glass) !important; }
html[data-theme="light"] .glass.border-line:where(:not(#rep-preview *)) { border-color: var(--fx-glass-edge) !important; }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  html[data-theme] .glass:where(:not(#rep-preview *)),
  html[data-theme] .sheet-wrap:where(:not(#rep-preview *)) { background: var(--fx-glass-solid); }
  html[data-theme="light"] .glass.bg-panel:where(:not(#rep-preview *)) { background-color: var(--fx-glass-solid) !important; }
}
/* The scenario panels keep their coloured 3px top edge. */
html[data-theme] .sc-panel.glass { border-top-color: var(--sc-accent); --fx-cap: var(--sc-accent); }
html[data-theme="light"] .sc-panel.glass {
  border-top-color: color-mix(in srgb, var(--sc-accent) 70%, transparent);
  --fx-cap: color-mix(in srgb, var(--sc-accent) 70%, transparent); }

/* Nav bar: pinned to the top of the window (the window is what scrolls;
   the bar is a direct child of <body>), the page blurring behind it in
   the selection widget's glass (cell_summary.css), with a lighter tint and
   the rim and shadow on the bottom edge only. base.html sets --top-menu-h
   (its height, for anything that pins or scrolls to a spot below it) and
   --hdr-lift (0 to 1 over the first 8px of scroll: the drop shadow).
   z-index 10: over the page's sticky table heads (2-4) and chart chips (5),
   under every popover (20 up), the selection widget (80) and modals. */
.header-bg { position: sticky; top: 0; z-index: 10; }
html { scroll-padding-top: var(--top-menu-h, 0px); }
html[data-theme] .header-bg {
  background: rgba(28, 31, 42, .55);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.5) brightness(1.15);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.5) brightness(1.15);
  border-bottom-color: rgba(255, 255, 255, .14);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .35);
  /* The controls on the glass: see-through fills, borders as they were. */
  --fx-ctl: rgba(255, 255, 255, .06);
  --fx-nav-on: rgba(255, 255, 255, .10);
}
html[data-theme="light"] .header-bg {
  background: rgba(250, 250, 252, .50);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
  box-shadow: 0 1px 0 rgba(15, 23, 42, .12);
  --fx-ctl: rgba(255, 255, 255, .60);
  --fx-nav-on: rgba(15, 23, 42, .07);
}
html[data-theme="light"] .header-bg.border-line { border-color: rgba(255, 255, 255, .75) !important; }
/* The soft drop onto the page, faded in as the page starts to scroll. */
.header-bg::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  box-shadow: 0 10px 32px rgba(0, 0, 0, .34); opacity: var(--hdr-lift, 0); }
html[data-theme="light"] .header-bg::after { box-shadow: 0 8px 28px rgba(15, 23, 42, .10); }
.header-bg .share-btn:not(:hover, [aria-expanded="true"]) { background: var(--fx-ctl); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  html[data-theme] .header-bg { background: var(--glass-solid); }
}
@media (prefers-reduced-transparency: reduce) {
  html[data-theme] .header-bg { background: var(--glass-solid);
    -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media print {
  .header-bg { position: static; background: var(--glass-solid) !important;
    -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
  .header-bg::after { content: none; }
}
html[data-theme] .nav-pill-active { background: var(--fx-nav-on) !important; }
/* Hover: a gray lighter than the active pill's. */
html[data-theme] .nav-pill-inactive:hover { background: var(--fx-nav-hover) !important; }

/* Surfaces inside panels. :where() keeps these at the original rules'
   specificity, so hover and active states still win as before. */
:where(html[data-theme]) .sheet:where(:not(#rep-preview *)) thead th {
  background: var(--fx-head); border-bottom-color: var(--fx-head-line); }
:where(html[data-theme]) .sheet:where(:not(#rep-preview *)) thead th.sticky-col {
  background: linear-gradient(var(--fx-head), var(--fx-head)), var(--fx-sticky);
  border-right-color: var(--fx-rule); }
:where(html[data-theme]) .sheet:where(:not(#rep-preview *)) tbody th {
  background: var(--fx-sticky); border-right-color: var(--fx-rule); }
:where(html[data-theme]) .sheet:where(:not(#rep-preview *)) tr.row-emphasis td,
:where(html[data-theme]) .sheet:where(:not(#rep-preview *)) tr.row-emphasis th {
  background: var(--fx-emph); background-clip: padding-box; }
:where(html[data-theme]) .sheet:where(:not(#rep-preview *)) tr.row-emphasis th.sticky-col {
  background: linear-gradient(var(--fx-emph), var(--fx-emph)), var(--fx-sticky);
  background-clip: padding-box; }
:where(html[data-theme]) .sheet--fit:where(:not(#rep-preview *)) thead th.col-child {
  background: linear-gradient(rgba(0, 0, 0, .14), rgba(0, 0, 0, .14)), var(--fx-head); }
html[data-theme="light"] .sheet--fit:where(:not(#rep-preview *)) thead th.col-child {
  background: rgba(60, 50, 40, .075); }
html[data-theme="light"] .sheet--forecast tr.row-total th {
  background: linear-gradient(rgba(90, 83, 76, .06), rgba(90, 83, 76, .06)), var(--fx-sticky); }
:where(html[data-theme="light"]) .sheet tbody tr.zebra th {
  background-image: linear-gradient(var(--fc-zebra), var(--fc-zebra)); }
html[data-theme] .sheet-wrap:where(:not(#rep-preview *)) .sheet tbody tr:hover th.sticky-col {
  background: linear-gradient(var(--fx-hover), var(--fx-hover)), var(--fx-sticky); }
:where(html[data-theme]) .sc-panel-head { border-bottom-color: var(--fx-head-line); }

/* Tab bar lines */
:where(html[data-theme]) .tabbar { border-bottom-color: var(--fx-rule); }
:where(html[data-theme]) .tabgroup + .tabgroup { border-left-color: var(--fx-rule); }
:where(html[data-theme]) .tabbar-groups .tabbar-item.active {
  background: var(--fx-tab-on);
  border-left-color: var(--fx-glass-line); border-right-color: var(--fx-glass-line); }

/* Controls: fill and border colour only. Selects set background-color so
   their arrow images stay. */
:where(html[data-theme]) :is(input, select, textarea):where(:not([type="checkbox"], [type="radio"], [type="range"], #rep-preview *)) {
  background-color: var(--fx-ctl); border-color: var(--fx-ctl-line); }
:where(html[data-theme]) .cell-input,
:where(html[data-theme]) .stepper { background-color: var(--fx-ctl); border-color: var(--fx-ctl-line); }
:where(html[data-theme]) .btn {
  background: var(--fx-ctl); border-color: var(--fx-ctl-line); }
:where(html[data-theme]) .btn:where(:not(.btn-accent, .btn-ghost)):hover { background: var(--fx-ctl-hover); }
:where(html[data-theme]) .btn-accent {
  background: var(--grn); border-color: transparent; }
:where(html[data-theme]) .btn-ghost {
  background: transparent; border-color: transparent; }
:where(html[data-theme]) .viewbar-item {
  background: var(--fx-ctl); border-color: var(--fx-ctl-line); }
:where(html[data-theme]) .viewbar-item.active { background: var(--fx-ctl-on); box-shadow: var(--fx-ctl-on-shadow); }
:where(html[data-theme="light"]) .viewbar-item.active { border-color: rgba(60, 50, 40, .16); }
:where(html[data-theme]) .cmp-select,
:where(html[data-theme]) .cmp-chip,
:where(html[data-theme]) .fc-actuals-toggle,
:where(html[data-theme]) .kchart-alt:where(:not(#rep-preview *)),
:where(html[data-theme]) .chat-pill {
  background: var(--fx-ctl); border-color: var(--fx-ctl-line); }
html[data-theme] select.bg-panel2 { background-color: var(--fx-ctl); border-color: var(--fx-ctl-line); }
html[data-theme="light"] select.bg-panel2 {
  background-color: var(--fx-ctl) !important; border-color: var(--fx-ctl-line) !important; }
html[data-theme] [data-view-swap="horizons"] { background: var(--fx-ctl); border-color: var(--fx-ctl-line); }
html[data-theme="light"] [data-view-swap="horizons"].border-line { border-color: var(--fx-ctl-line) !important; }
html[data-theme] [data-view-swap="horizons"] .bg-panel2 { background: var(--fx-seg-on); }
html[data-theme="light"] [data-view-swap="horizons"] .bg-panel2 { background-color: var(--fx-seg-on) !important; }
:where(html[data-theme]) .sc-stepper {
  background: var(--fx-well); border-color: var(--fx-ctl-line); }
:where(html[data-theme]) .sc-stepper .stepper { background: transparent; }
:where(html[data-theme]) .sc-stepper .stepper:first-child,
:where(html[data-theme]) .sc-stepper .stepper:last-child { border-color: var(--fx-ctl-line); }
:where(html[data-theme]) .sc-stepper .stepper:hover { background: var(--fx-hover); }
:where(html[data-theme]) .sc-track { background: var(--fx-track); }
/* performance.css loads after this file, hence the extra weight. */
html[data-theme] .perf-btn,
html[data-theme] .perf-mode { background: var(--fx-ctl); border-color: var(--fx-ctl-line); }
html[data-theme] .perf-btn:active,
html[data-theme] .perf-btn.is-pressed { background: var(--fx-ctl-hover); }
html[data-theme] .perf-mode button[aria-pressed="true"],
html[data-theme] .perf-mode-pill > i { background: var(--fx-seg-on); }
html[data-theme] .perf-mode.has-pill button[aria-pressed="true"] { background: transparent; }

/* Light mode: the primary action is near-black ink, and the slider thumb
   sits on the page with a hairline instead of a dark drop shadow. */
html[data-theme="light"] .sc-save { background: #24221f; color: #fff; }
html[data-theme="light"] .sc-save:hover { background: #000; }
html[data-theme="light"] .sc-save:disabled:hover { background: #24221f; }
html[data-theme="light"] .sc-range::-webkit-slider-thumb {
  box-shadow: 0 1px 3px rgba(60, 50, 40, .28), 0 0 0 1px rgba(60, 50, 40, .08); }
html[data-theme="light"] .sc-range::-moz-range-thumb {
  box-shadow: 0 1px 3px rgba(60, 50, 40, .28), 0 0 0 1px rgba(60, 50, 40, .08); }

/* ── Glass everywhere ───────────────────────────────────────────────────
   Every surface is glass unless a mockup or an instruction says otherwise
   (README, "Visual rules"). Panels and cards get the panel material; a
   control gets its own lighter blur only where it sits straight on the
   page, since inside a panel its backdrop is already diffused (and a blur
   per table input would be costly). That includes a control inside the
   header or inside another control (.cmp-select): blurring that flat fill
   again only re-saturated it into a visible box. Text alone stays on top,
   unblurred. */
html[data-theme] .mn {
  --mn-tile: var(--fx-glass);
  --mn-tile-line: var(--fx-rule);
}
html[data-theme] :is(.mn-tile, .mn-panel, .rr-kpi, .rr-curve, .rr-table-wrap,
  .rr-about, .cf-card, .sc-outcome, .overlay-card,
  main .rounded-xl.bg-panel, main div.rounded-lg.bg-panel2):where(:not(#rep-preview *)) {
  background: var(--fx-glass);
  backdrop-filter: var(--fx-blur);
  -webkit-backdrop-filter: var(--fx-blur);
  border-color: var(--fx-glass-edge);
  box-shadow: var(--fx-halo);
}
html[data-theme="light"] :is(main .rounded-xl.bg-panel, main div.rounded-lg.bg-panel2):where(:not(#rep-preview *)) {
  background-color: var(--fx-glass) !important; border-color: var(--fx-glass-edge) !important; }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  html[data-theme] :is(.mn-tile, .mn-panel, .rr-kpi, .rr-curve, .rr-table-wrap,
    .rr-about, .cf-card, .sc-outcome, .overlay-card) { background: var(--fx-glass-solid); }
}
/* Coloured top edges stay. !important because the panel rule above is
   more specific (its :is() list includes "main .rounded-xl.bg-panel"):
   without it the 3px top edge took the faint glass edge colour and read as
   a wider gap above the card. */
html[data-theme] .mn-panel { border-top-color: var(--mn-accent) !important; --fx-cap: var(--mn-accent); }
html[data-theme] .cf-hero { border-top-color: var(--cf-teal) !important; --fx-cap: var(--cf-teal); }
html[data-theme="light"] .mn-panel { border-top-color: color-mix(in srgb, var(--mn-accent) 70%, transparent) !important;
  --fx-cap: color-mix(in srgb, var(--mn-accent) 70%, transparent); }
html[data-theme="light"] .cf-hero { border-top-color: color-mix(in srgb, var(--cf-teal) 70%, transparent) !important;
  --fx-cap: color-mix(in srgb, var(--cf-teal) 70%, transparent); }
/* The coloured top edge runs to the panel's outer edge: the halo's outer
   ring and inner rim are drawn on the sides and bottom only and stop at the
   colour, which takes the ring's place along the top (--fx-cap, set above). */
html[data-theme] :is(.mn-panel, .cf-hero, .sc-panel.glass):where(:not(#rep-preview *)) {
  box-shadow:
    0 -1px 0 0 var(--fx-cap),
    1px 0 0 0 var(--fx-ring), -1px 0 0 0 var(--fx-ring), 0 1px 0 0 var(--fx-ring),
    inset 1px 0 0 var(--fx-rim), inset -1px 0 0 var(--fx-rim), inset 0 -1px 0 var(--fx-rim),
    var(--fx-drop) !important;
}

/* Controls that had no fill of their own take the control glass. */
:where(html[data-theme]) :is(.mn-discard, .mn-chip, .rr-toggle, .cf-pill, .cf-chip) {
  background: var(--fx-ctl); border-color: var(--fx-ctl-line); }
:where(html[data-theme]) .mn-discard:hover:not(:disabled),
:where(html[data-theme]) .rr-toggle:hover { background: var(--fx-ctl-hover); }
html[data-theme] :is(.btn, .viewbar-item, .tabbar-groups .tabbar-item.active, .nav-pill-active,
  select, textarea, input:not([type="checkbox"], [type="radio"], [type="range"]),
  .perf-btn, .perf-mode, .mn-discard, .mn-save, .mn-chip, .rr-toggle, .cf-pill, .cf-chip,
  .fc-actuals-toggle, .cmp-select, .cmp-chip, .chat-pill,
  [data-view-swap="horizons"], .sc-stepper):not(:is(.glass, .sheet-wrap, .mn-tile, .mn-panel,
  .rr-kpi, .rr-curve, .rr-table-wrap, .rr-about, .cf-card, .sc-outcome, .overlay-card,
  .cfx-pop, #rep-preview, main .rounded-xl.bg-panel, main div.rounded-lg.bg-panel2,
  .header-bg, .cmp-select) *) {
  backdrop-filter: var(--fx-blur-ctl);
  -webkit-backdrop-filter: var(--fx-blur-ctl);
}

/* Export: the button is a control, its menu a solid glass card. */
:where(html[data-theme]) .xp-btn { background: var(--fx-ctl); border-color: var(--fx-ctl-line);
  backdrop-filter: var(--fx-blur-ctl); -webkit-backdrop-filter: var(--fx-blur-ctl); }
:where(html[data-theme]) .xp-btn:hover,
:where(html[data-theme]) .xp.is-open .xp-btn { background: var(--fx-ctl-hover); }
:where(html[data-theme]) .xp-menu { background: var(--fx-glass-solid); border-color: var(--fx-glass-edge);
  box-shadow: var(--fx-halo), 0 22px 50px -18px rgba(0, 0, 0, .45);
  backdrop-filter: var(--fx-blur); -webkit-backdrop-filter: var(--fx-blur); }
:where(html[data-theme]) .xp-scope { border-top-color: var(--fx-rule); }

/* ── First column ───────────────────────────────────────────────────────
   Every table's first column is its header column (usually the month), a
   touch lighter than the rest (--fx-sticky). The .sheet tables already lay
   it under their label cells; the Reference tables (.rr-table) get it as an
   image layer here, so it sits over whatever row tint the cell has (zebra,
   maturing, override). Cells spanning several columns are left out. */
html[data-theme] .rr-table :is(thead th, tbody td, tfoot td):first-child:not([colspan], .rr-gh) {
  background-image: linear-gradient(var(--fx-sticky), var(--fx-sticky)) !important; }
/* AOV's and COD's pinned Month column take the row's own tint under it
   (the pinned glass below does the rest), not a solid panel fill. */
html[data-theme] :is(.aov-table td.aov-month, .cod-table td.cod-month) { background-color: transparent; }
html[data-theme] :is(.aov-table, .cod-table) tbody tr:nth-child(even) td:is(.aov-month, .cod-month) {
  background-color: var(--rr-row); }

/* Pinned first column: glass, so the columns scrolling under it are
   diffused instead of showing through or meeting a solid block. The pinned
   cells paint only see-through tints (zebra, hover, bands); the blur is one
   shared layer per table (::before below), as wide as the first column
   (--pin-w) and as tall as the table. A blur per row redrew each row's patch
   out of step, which flickered and showed seams while scrolling sideways.
   At rest there is nothing beneath but the panel, so the layer only exists
   once the table is scrolled sideways (base.html sets .is-xscrolled and
   measures --pin-w for .sheet tables). It sits just under the pinned cells:
   the same z-index as them (3 for .sheet, 1 for AOV/COD) and first in tree
   order, so it paints over every scrolling cell, header row included.
   AOV's lower table (.aov-down) pins nothing, hence :has() on the cells. */
html[data-theme] :is(.sheet-wrap, .rr-table-wrap:has(.aov-month, .cod-month)).is-xscrolled:not(#rep-preview *)::before {
  content: ""; flex: none; position: sticky; left: 0; z-index: var(--pin-z, 3);
  width: var(--pin-w, 0px); margin-right: calc(-1 * var(--pin-w, 0px));
  backdrop-filter: var(--fx-blur); -webkit-backdrop-filter: var(--fx-blur);
}
.rr-table-wrap:has(.aov-month) { --pin-w: 150px; --pin-z: 1; }
.rr-table-wrap:has(.cod-month) { --pin-w: 196px; --pin-z: 1; }
/* For that, the table panel's own glass is drawn one layer down: a layer
   (::after, laid out first by order) pinned to the panel's visible part,
   under the table. A panel that scrolls and is its own backdrop root hands
   the pinned column a stale, unscrolled backdrop (Chrome), so the columns
   under it stayed sharp. The layer takes no room (its negative margin) and
   runs the table's height (flex stretch); the table keeps its width. */
html[data-theme] :is(.sheet-wrap, .rr-table-wrap):not(#rep-preview *) {
  display: flex; isolation: isolate; background: transparent;
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
html[data-theme] :is(.sheet-wrap, .rr-table-wrap):not(#rep-preview *)::after {
  content: ""; flex: none; order: -1; position: sticky; left: 0; z-index: -1;
  width: 100%; margin-right: -100%; border-radius: inherit;
  background: var(--fx-glass);
  backdrop-filter: var(--fx-blur); -webkit-backdrop-filter: var(--fx-blur);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  html[data-theme] :is(.sheet-wrap, .rr-table-wrap) { --fx-sticky: var(--fx-sticky-frost); }
  html[data-theme] :is(.sheet-wrap, .rr-table-wrap):not(#rep-preview *)::after { background: var(--fx-glass-solid); }
}

/* Sliding switch pill (.perf-mode): its three pieces overlap by half a
   pixel, and a see-through fill doubled up there, drawing a line at each
   end of the chosen word. The pieces are now solid and the pill as a whole
   is faded, so the overlaps merge into one even fill. */
html[data-theme] { --fx-seg-ink: #fff; --fx-seg-alpha: .12; }
html[data-theme="light"] { --fx-seg-ink: rgb(60, 50, 40); --fx-seg-alpha: .075; }
html[data-theme] .perf-mode-pill { opacity: var(--fx-seg-alpha); }
html[data-theme] .perf-mode .perf-mode-pill > i { background: var(--fx-seg-ink); }

/* ── Page transition veil (base.html) ──────────────────────────────────
   While the next page loads, a light blur veil fades in over the page,
   under the progress line (#progress, z-index 100). The next page opens
   under the same veil and fades it out once loaded. Opacity only, so the
   page is never swapped for an empty or flashing frame. The page's own
   veil also holds clicks until the new page arrives. */
.pv-veil, html.pv-in body::after, html.pv-out body::after {
  content: ""; position: fixed; inset: 0; z-index: 90;
  background: color-mix(in srgb, var(--bg) 22%, transparent);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  opacity: 0; transition: opacity .25s ease; pointer-events: none; }
.pv-veil { pointer-events: auto; }
.pv-veil.is-on, html.pv-in body::after { opacity: 1; }
html.pv-out body::after { opacity: 0; transition-duration: .35s; }
/* The veil is the entrance: the sections skip kynship-ui's fade up, which
   started them see-through and blinked the page empty. */
html.pv-nav main > * { animation: none; }
/* The veiled old page cross-fades into the veiled new one (browsers with
   cross-document view transitions; others just swap). */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .22s; }
/* Theme crossfade: the light/dark toggle eases between the two themes
   (theme-switcher.js sets .theme-fade for its view transition). */
html.theme-fade::view-transition-old(root), html.theme-fade::view-transition-new(root) {
  animation-duration: .6s; animation-timing-function: ease-in-out; }
@media (prefers-reduced-motion: reduce) {
  .pv-veil, html.pv-in body::after, html.pv-out body::after { transition: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* Settings > Integrations: a darker, near-opaque area behind the page so
   its text keeps contrast over the gradient blooms (both themes). */
html[data-theme] .int-backdrop {
  background: var(--fx-glass-solid);
  border-color: var(--fx-glass-edge);
  box-shadow: var(--fx-halo);
}

/* Source tag: a value taken from the monthly input typed or uploaded on
   Settings > Integrations (forecast/cohort_inputs.py), not from order rows. */
.src-tag {
  display: inline-block; margin-left: 4px; padding: 0 5px; border-radius: 4px;
  font-size: 9.5px; line-height: 15px; letter-spacing: .04em; text-transform: uppercase;
  font-weight: 600; vertical-align: 1px; white-space: nowrap;
  color: var(--fg-dim); border: 1px solid currentColor; opacity: .85;
}
.src-tag.tip:hover { text-decoration: none; }

/* The header's "Switching to X" chip: a core currency switch running in the
   background (_brand_tools.html, static/currency_switch.js). */
.fxs-chip {
  position: relative; display: inline-flex; align-items: center; gap: 7px;
  height: 26px; padding: 0 10px; border-radius: 999px; cursor: default;
  font-size: 12px; font-weight: 600; white-space: nowrap; outline: none;
  color: #fcd34d; background: rgba(245, 158, 11, .12);
  border: 1px solid rgba(245, 158, 11, .45);
}
[data-theme="light"] .fxs-chip { color: #b45309; }
/* The same chip for every other background calculation (base.html,
   static/bg_jobs.js), hidden while nothing runs. */
.bg-chip { margin-right: 6px; }
.bg-chip[hidden] { display: none; }
.fxs-spin {
  width: 11px; height: 11px; border-radius: 50%; flex: none;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: fxs-spin .9s linear infinite;
}
@keyframes fxs-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .fxs-spin { animation: none; } }
.fxs-chip--done { color: #86efac; background: rgba(34, 197, 94, .12); border-color: rgba(34, 197, 94, .45); cursor: pointer; }
.fxs-chip--failed { color: #fca5a5; background: rgba(239, 68, 68, .12); border-color: rgba(239, 68, 68, .45); cursor: pointer; }
[data-theme="light"] .fxs-chip--done { color: #15803d; }
[data-theme="light"] .fxs-chip--failed { color: #b91c1c; }
.fxs-chip--done .fxs-spin, .fxs-chip--failed .fxs-spin { animation: none; border-right-color: currentColor; border-radius: 50%; background: currentColor; width: 7px; height: 7px; border-width: 0; }
.fxs-pop {
  display: none; position: fixed; z-index: 1000;
  width: 320px; padding: 12px 14px; border-radius: 10px; white-space: normal;
  font-size: 12.5px; font-weight: 400; line-height: 1.45; text-align: left;
  color: #f4f4f5; background: #1f1f23; border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}
.fxs-pop--open { display: block; }
.fxs-pop:empty { display: none !important; }
.fxs-pop-title { font-weight: 700; margin-bottom: 4px; }
.fxs-pop-eta { margin-top: 6px; font-weight: 600; color: #fcd34d; }
.fxs-pop-note { margin-top: 6px; color: #a1a1aa; }

/* The background job chip's count and menu (base.html, static/bg_jobs.js):
   per job its name, when and why it started, its progress (steps, a count
   or a spinner) and whether the page in view is current. */
.bg-chip { cursor: pointer; }
.bg-chip.bgj-pinned, .bg-chip:focus-visible { box-shadow: 0 0 0 2px rgba(245, 158, 11, .35); }
.bgj-chip-n { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; opacity: .9; }
.bgj-minibar { width: 34px; height: 4px; border-radius: 2px; background: rgba(245, 158, 11, .25); overflow: hidden; }
.bgj-minibar i { display: block; height: 100%; background: currentColor; border-radius: 2px; }
.bgj-more { opacity: .75; }
.bgj-menu {
  position: fixed; z-index: 1000; width: 410px; max-height: calc(100vh / var(--zf, 1) - 90px); overflow-y: auto;
  border-radius: 12px; background: var(--panel); color: var(--fg); border: 1px solid var(--line);
  box-shadow: 0 18px 48px rgba(0, 0, 0, .32), 0 2px 6px rgba(0, 0, 0, .12);
  font-size: 12.5px; line-height: 1.45; text-align: left; white-space: normal;
}
[data-theme="light"] .bgj-menu { background: #fcfbf9; box-shadow: 0 18px 48px rgba(40, 34, 24, .16), 0 2px 6px rgba(40, 34, 24, .08); }
.bgj-job { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.bgj-head { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.bgj-pct { font-weight: 700; color: var(--amber-ink); }
.bgj-job--failed .bgj-pct { color: #ef4444; }
.bgj-why { margin-top: 2px; color: var(--fg-dim); }
.bgj-bar { margin-top: 10px; height: 5px; border-radius: 3px; background: var(--panel-3); overflow: hidden; }
.bgj-bar i { display: block; height: 100%; border-radius: 3px; background: #f5b014; transition: width .4s ease; }
.bgj-bar--failed i { background: #ef4444; }
.bgj-line { display: flex; justify-content: space-between; gap: 10px; margin-top: 6px; color: var(--fg-dim); }
.bgj-line b { color: var(--fg); }
.bgj-spinline { display: inline-flex; align-items: center; gap: 7px; }
.bgj-spinline .fxs-spin { color: var(--amber-ink); }
.bgj-faint { color: var(--fg-faint); white-space: nowrap; }
.bgj-steps { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 14px; margin: 10px 0 0; padding: 0; list-style: none; }
.bgj-step { display: flex; align-items: center; gap: 6px; color: var(--fg-dim); min-width: 0; }
.bgj-step > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bgj-step--done { color: var(--fg); }
.bgj-step--run { color: var(--amber-ink); font-weight: 600; }
.bgj-step--failed { color: #ef4444; font-weight: 600; }
.bgj-ico { flex: none; width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--fg-faint); }
.bgj-ico--done { border: 0; background: no-repeat center/12px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2322c55e' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E"); }
.bgj-ico--run { border-color: currentColor; border-right-color: transparent; animation: fxs-spin .9s linear infinite; }
.bgj-ico--failed { border: 0; background: no-repeat center/12px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ef4444' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E"); }
@media (prefers-reduced-motion: reduce) { .bgj-ico--run { animation: none; } }
.bgj-tag { flex: none; padding: 0 5px; border-radius: 4px; font-size: 10px; font-weight: 600; line-height: 15px;
  color: #6d8ff0; border: 1px solid rgba(79, 123, 232, .55); }
.bgj-note { margin-top: 12px; padding: 9px 11px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); color: var(--fg-dim); }
.bgj-note b { color: var(--fg); }
.bgj-note--failed { border-color: rgba(239, 68, 68, .5); background: rgba(239, 68, 68, .08); }
.bgj-note--done { border-color: rgba(34, 197, 94, .45); background: rgba(34, 197, 94, .08); }
.bgj-err { margin-top: 6px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px;
  color: var(--fg-dim); word-break: break-word; }
.bgj-acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.bgj-btn { height: 28px; padding: 0 12px; border-radius: 7px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--fg); font-size: 12px; font-weight: 600; cursor: pointer; }
.bgj-btn:hover { background: var(--panel-3); }
.bgj-btn--go { border-color: #f5b014; background: #f5b014; color: #1a1408; }
.bgj-btn--go:hover { background: #fbbf24; }
.bgj-btn:disabled { opacity: .6; cursor: default; }
.bgj-link { border: 0; background: none; padding: 0; color: #6d8ff0; font: inherit; cursor: pointer; text-decoration: underline; }
.bgj-foot { display: flex; justify-content: space-between; gap: 12px; padding: 9px 16px; color: var(--fg-faint); font-size: 11.5px; }

/* The brand's clock in the header (base.html, static/account_time.js):
   the same size and weight as "Last edit"; its card on hover or focus. */
.acct-time { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 9px;
  font-size: 12.5px; color: var(--fg-dim); white-space: nowrap; cursor: default; border-radius: 8px; outline: none; }
.acct-time:focus-visible { box-shadow: 0 0 0 2px rgba(79, 123, 232, .55); }
.acct-time svg { width: 14px; height: 14px; flex: none; }
.acct-time b { color: var(--fg); font-weight: 700; font-variant-numeric: tabular-nums; }
[data-theme="light"] .acct-time { color: #55534e; }
[data-theme="light"] .acct-time b { color: #1a1a1a; }
/* Room in the top bar, set by account_time.js when the row would overflow. */
.hdr-fit-1 .acct-city, .hdr-fit-2 .bg-chip .fxs-label, .hdr-fit-2 .bgj-minibar,
.hdr-fit-2 .bgj-more-word { display: none; }
.hdr-fit-3 .hdr-tools .hdr-asof { display: none; }
.acct-card { position: fixed; z-index: 1000; width: 390px; padding: 14px 16px 12px; border-radius: 12px;
  background: var(--panel); color: var(--fg); border: 1px solid var(--line); font-size: 12.5px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .32), 0 2px 6px rgba(0, 0, 0, .12); }
[data-theme="light"] .acct-card { background: #fcfbf9; box-shadow: 0 18px 48px rgba(40, 34, 24, .16), 0 2px 6px rgba(40, 34, 24, .08); }
.acct-title { font-weight: 600; font-size: 13.5px; }
.acct-big { margin: 4px 0 10px; font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
.acct-big small { font-size: 12px; font-weight: 600; color: var(--fg-dim); }
.acct-row { display: flex; justify-content: space-between; gap: 12px; white-space: nowrap; padding: 6px 0; border-top: 1px solid var(--line); color: var(--fg-dim); }
.acct-row span:last-child { color: var(--fg); text-align: right; }
.acct-foot { margin-top: 4px; padding-top: 9px; border-top: 1px solid var(--line); color: #6d8ff0; font-size: 12px; }
.acct-foot a { color: inherit; text-decoration: underline; }

/* Settings > Forecast setup's searchable timezone list (settings_overlay.js). */
.tz-pick { position: relative; flex: none; width: 300px; }
.tz-pick-input { font-weight: 600; }
.tz-pick-list { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; right: 0; max-height: 300px;
  overflow-y: auto; margin: 0; padding: 4px; list-style: none; border-radius: 10px; background: var(--panel);
  border: 1px solid var(--line); box-shadow: 0 12px 32px rgba(0, 0, 0, .28); }
.tz-pick-list[hidden] { display: none; }
.tz-pick-list li { display: flex; align-items: baseline; gap: 7px; padding: 6px 8px; border-radius: 6px;
  font-size: 12.5px; cursor: pointer; white-space: nowrap; }
.tz-pick-list li[hidden] { display: none; }
.tz-pick-list li.is-active { background: var(--panel-3); }
.tz-pick-list li[aria-selected="true"] b { color: var(--st-blue, #4f7be8); }
.tz-pick-abbr { font-size: 11px; font-weight: 700; color: var(--fg-dim); }
.tz-pick-zone { margin-left: auto; font-size: 11px; color: var(--fg-faint); overflow: hidden; text-overflow: ellipsis; }
.tz-pick-none { color: var(--fg-faint); cursor: default; }

/* The segment selector preview under the order flow diagram (static/order_views.js). */
.ctry-select--preview { margin-left: 0; pointer-events: none; }
.ctry-select--preview .ctry-opt { cursor: default; }
.ctry-select--preview .ctry-opt.active { background: var(--fx-seg-on, rgba(255,255,255,.12));
  box-shadow: inset 0 0 0 1px var(--fx-ctl-line, rgba(255,255,255,.12)); }

/* Product costs changed in Shopify (forecast/cogs_changes.py): the
   one-time notice under the header, its amber marks and buttons (shared
   with the Cost of Delivery alert and dialog, cod.css), and the toast a
   decision leaves. */
.cogs-bang { display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 22px; height: 22px; border-radius: 50%; background: #e8b84a; color: #1a1408;
  font-weight: 800; font-size: 13px; }
.cogs-btn { padding: 7px 14px; border-radius: 8px; border: 0; background: #e8b84a; color: #1a1408;
  font-weight: 600; font-size: 13px; white-space: nowrap; cursor: pointer; }
.cogs-btn:hover { background: #f0c662; }
.cogs-btn:disabled { opacity: .6; cursor: default; }
.cogs-x { background: transparent; border: 0; color: var(--fg-dim); font-size: 20px; line-height: 1;
  padding: 2px 6px; cursor: pointer; }
.cogs-x:hover { color: var(--fg); }
.cogs-notice { border-bottom: 1px solid rgba(232, 184, 74, .45);
  background: linear-gradient(90deg, rgba(232, 184, 74, .16), rgba(232, 184, 74, .08)); }
.cogs-notice-in { display: flex; align-items: center; gap: 12px; padding-top: 9px; padding-bottom: 9px; }
.cogs-notice-in p { flex: 1; margin: 0; font-size: 13.5px; color: var(--fg); }
.cogs-toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 90;
  padding: 10px 16px; border-radius: 10px; background: var(--panel-3, #2a2f3a); color: var(--fg);
  border: 1px solid var(--line); box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .5); font-size: 13px; }

/* ── Phone layout (767px wide and below; Tailwind's md starts at 768) ───
   Scorecard mobile spec, Nov 19 2026. Nothing here applies on a wider
   window: every rule is inside the media query, or hides an element that
   only the phone layout uses. The header keeps the Forecast chip, the brand
   select and a menu button (base.html #m-menu, static/mobile.js); the rest
   of its controls move into that menu. The page tabs are one swipeable row.
   The Scorecard's own rules are in performance.css. */
.m-menu-btn, .m-menu, .m-menu-scrim, .m-only { display: none; }
@media (max-width: 767px) {
  .m-only { display: revert; }
  .d-only { display: none !important; }
  /* only tables scroll sideways, never the page; less room above the tabs
     (main[class] outranks Tailwind's py-6) */
  main[class] { overflow-x: clip; padding-top: 12px; }

  .header-bg :is(.hdr-nav, .hdr-brand-logo-div, .hdr-brand-logo, .hdr-test-brand, #bg-chip, #acct-time, .hdr-icons),
  .hdr-tools > :not(.hdr-brand) { display: none !important; }
  .hdr-logo { margin-right: 4px; }
  .hdr-tools { order: 1; min-width: 0; }
  .header-bg .flex-1 { order: 2; }
  .hdr-brand { min-width: 0; }
  .hdr-brand select { min-height: 44px; max-width: 100%; text-overflow: ellipsis; font-size: 14px;
    background: transparent; border-color: transparent; }
  .m-menu-btn { order: 3; display: flex; align-items: center; justify-content: center; flex: none;
    width: 44px; height: 44px; border-radius: 12px; color: var(--fg);
    background: var(--fx-ctl, var(--panel)); border: 1px solid var(--fx-ctl-line, var(--line));
    transition: background-color .15s, color .15s; }
  .m-menu-btn svg { width: 22px; height: 22px; }
  .m-menu-btn[aria-expanded="true"] { background: #1f2533; border-color: transparent; color: #fff; }
  html:not([data-theme="light"]) .m-menu-btn[aria-expanded="true"] { background: #050608; }
  .m-menu-btn:focus-visible { outline: 2px solid var(--fg-faint); outline-offset: 2px; }

  /* the open menu: the page dimmed and held still behind it */
  html.m-menu-open, html.m-menu-open body { overflow: hidden; }
  html.m-menu-open .header-bg > div > :not(.m-menu-btn) { opacity: .45; }
  .m-menu-scrim:not([hidden]) { display: block; position: fixed; inset: var(--top-menu-h, 56px) 0 0; z-index: 40;
    background: rgba(15, 20, 30, .38); }
  .m-menu:not([hidden]) { display: block; position: fixed; z-index: 41; top: calc(var(--top-menu-h, 56px) - 4px);
    right: 10px; width: min(300px, calc(100vw / var(--zf, 1) - 20px)); max-height: calc(100svh / var(--zf, 1) - var(--top-menu-h, 56px) - 16px);
    overflow-y: auto; overscroll-behavior: contain; padding: 4px 0; border-radius: 16px;
    border: 1px solid var(--fx-glass-edge, var(--line)); background: var(--fx-glass-solid, var(--panel)); color: var(--fg);
    box-shadow: var(--fx-halo, none), 0 22px 50px -18px rgba(0, 0, 0, .45);
    backdrop-filter: var(--fx-blur); -webkit-backdrop-filter: var(--fx-blur); }
  .m-menu [hidden] { display: none !important; }
  .m-menu-group { padding: 4px 0; }
  .m-menu-group.has-rule { border-top: 1px solid var(--line); }
  .m-menu-item { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 52px; padding: 8px 16px;
    text-align: left; font-size: 15px; line-height: 20px; color: var(--fg); background: none; border: 0; }
  button.m-menu-item { cursor: pointer; }
  button.m-menu-item:active, button.m-menu-item:focus-visible { background: rgba(127, 127, 127, .14); outline: none; }
  .m-menu-item > svg { width: 20px; height: 20px; flex: none; }
  .m-menu-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
  .m-menu-text small { margin-top: 1px; font-size: 12px; line-height: 16px; color: var(--fg-dim); }
  .m-menu-val { font-size: 13.5px; color: var(--fg-dim); white-space: nowrap; }
  .m-menu-item > .m-menu-chev { width: 16px; height: 16px; color: var(--fg-dim); }
  .m-menu-badge { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; display: inline-flex;
    align-items: center; justify-content: center; font-size: 12px; font-weight: 600; color: #fff;
    background: var(--sh-blue, #4f7be8); }
  .m-switch { position: relative; flex: none; width: 42px; height: 24px; border-radius: 999px;
    background: rgba(127, 127, 127, .35); transition: background-color .2s; }
  .m-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .2s; }
  .m-menu-item[aria-checked="true"] .m-switch { background: #4f7be8; }
  .m-menu-item[aria-checked="true"] .m-switch::after { transform: translateX(18px); }

  /* the menus the rows open, whose own buttons are hidden here: under the header, full width */
  .share-menu { top: calc(var(--top-menu-h, 56px) + 6px) !important; left: 10px !important; right: 10px !important;
    width: auto !important; }
  .xp-menu { position: fixed; top: calc(var(--top-menu-h, 56px) + 6px); left: 10px; right: 10px; width: auto; }

  /* Page tabs: one row that swipes, cut off at the right with a fade
     (static/mobile.js scrolls the open page into view). The rule under the
     row is a shadow, which the open tab paints over, as its border did. */
  .tabbar-groups { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
    border-bottom: 0; box-shadow: inset 0 -1px 0 var(--line);
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); }
  .tabbar-groups.is-xend { -webkit-mask-image: none; mask-image: none; }
  .tabbar-groups::-webkit-scrollbar { display: none; }
  .tabgroup { flex: none; }
  .tabgroup-items { flex-wrap: nowrap; }
  .tabbar-groups .tabbar-item { margin-bottom: 0; padding-top: 12px; padding-bottom: 12px; }
  .tabbar-groups .tabbar-item.active { padding-bottom: 12px; }
}
@media (max-width: 767px) and (prefers-reduced-motion: reduce) {
  .m-menu-btn, .m-switch, .m-switch::after { transition: none; }
}
