/* ============================================================
   TAA interface, version 2 (the design approved 19 Nov 2026)
   ============================================================

   WHO LOADS THIS. Every page that draws the site header: <html data-ui="2">,
   linked AFTER cambria-shared.css (common/test_ui.py fails on a page with
   the header mount and no data-ui="2"). The old header and look in
   cambria-shared.css and cambria-nav.js are no longer drawn by any page and
   can be removed in a later change.

   WHY IT SITS ON TOP OF cambria-shared.css RATHER THAN REPLACING IT. The
   tool pages' own <style> blocks and their chart code read the shared
   tokens by name: --text, --muted, --border, --surface, --accent and the
   --sleeve-* / --cat-* colours. Re-pointing those names at the new palette
   (the LEGACY NAMES block below) means a page moves over without every
   rule in it being rewritten first, and the asset-class colours, the
   export buttons and the print layout keep working unchanged.

   SPECIFICITY. cambria-shared.css sets the light palette on
   html:not([data-theme="dark"]) (0,1,1). html[data-ui="2"] is also (0,1,1)
   and this file loads later, so it wins; the dark block adds a second
   attribute and wins there too. No !important anywhere.

   THEME. Same rule as the rest of the site (cambria-nav.js): light unless
   the visitor chose dark, stored in localStorage 'taa_theme', applied as
   html[data-theme="dark"]. The OS preference is deliberately not read.

   TYPE. One family, Host Grotesk (SIL OFL 1.1, beside the files in
   /static/fonts/). Every size is a step of the shared scale
   (scripts/check_type.py); the prototype's in-between sizes were snapped
   to the nearest step.

   LAYERING. There is no site-wide Simple/Advanced switch. A page opens on
   its answer and layers the rest the way that tool needs: a row that opens
   to show what is behind a number (details.ui-disc), deeper studies as
   named tabs (.ui-tabs), or the tool's own options panel. Some tools need
   none of it. Every tool page ends with "Where to next" (.ui-next).

   Classes are prefixed ui- so they cannot collide with a tool page's own
   (.panel, .stat, .chip and .tabs all exist in tool pages already).
============================================================ */

@font-face{
  font-family:'Host Grotesk';
  src:url('/static/fonts/host-grotesk-vf-roman.woff2') format('woff2-variations');
  font-weight:300 800; font-style:normal; font-display:swap;
}
@font-face{
  font-family:'Host Grotesk';
  src:url('/static/fonts/host-grotesk-vf-italic.woff2') format('woff2-variations');
  font-weight:300 800; font-style:italic; font-display:swap;
}

/* ── Palette, light ───────────────────────────────────────────────────── */
html[data-ui="2"] {
  --ui-bg: #f5f7fa; --ui-surface: #ffffff; --ui-surface-2: #f7f9fb; --ui-soft: #eef2f6;
  --ui-line: #e1e7ee; --ui-line-strong: #cbd4df;
  --ui-ink: #0b1b2f; --ui-ink-2: #26364b; --ui-muted: #4a586c; --ui-faint: #6b788b;
  --ui-brand: #0f2c52; --ui-brand-hover: #173b6b; --ui-on-brand: #ffffff; --ui-brand-2: #2e57a0;
  --ui-research: #2a5fcf; --ui-research-tint: #eaf0fc; --ui-research-ink: #1f4fb3;
  --ui-test: #c27a08; --ui-test-tint: #fcf2df; --ui-test-ink: #8a5300;
  --ui-build: #6f49d4; --ui-build-tint: #f0ebfd; --ui-build-ink: #5634bd;
  --ui-up: #0e7743; --ui-up-tint: #e4f3ea; --ui-down: #c0392f; --ui-down-tint: #fbeae8;
  --ui-grid: #e9eef3; --ui-focus: #2a5fcf;
  --ui-tt-bg: #0b1b2f; --ui-tt-ink: #ffffff;
  --ui-shadow: 0 1px 2px rgba(11,27,47,.06), 0 16px 40px -16px rgba(11,27,47,.28);
  --ui-shadow-sm: 0 1px 2px rgba(11,27,47,.06), 0 4px 12px -6px rgba(11,27,47,.14);
  --ui-r-sm: 6px; --ui-r-md: 10px; --ui-r-lg: 14px;
  --ui-ease: cubic-bezier(.22,1,.36,1);
  --ui-wrap: 1240px;
  --ui-font: 'Host Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;

  /* LEGACY NAMES, re-pointed so a tool page's own rules follow the new look. */
  --bg: var(--ui-bg); --surface: var(--ui-surface); --surface2: var(--ui-surface-2);
  --border: var(--ui-line); --text: var(--ui-ink); --muted: var(--ui-muted); --muted2: var(--ui-ink-2);
  --accent: var(--ui-brand-2); --accent2: var(--ui-brand-2);
  --display: var(--ui-font); --ui: var(--ui-font); --sans: var(--ui-font);
  --serif: var(--ui-font); --mono: var(--ui-font);
  color-scheme: light;
}
/* ── Palette, dark ────────────────────────────────────────────────────── */
html[data-ui="2"][data-theme="dark"] {
  --ui-bg: #0a111c; --ui-surface: #0f1825; --ui-surface-2: #131e2d; --ui-soft: #142033;
  --ui-line: #1f2c3e; --ui-line-strong: #2c3c52;
  --ui-ink: #e8eef6; --ui-ink-2: #c5d0de; --ui-muted: #a8b4c5; --ui-faint: #8a98ac;
  --ui-brand: #e8eef6; --ui-brand-hover: #ffffff; --ui-on-brand: #0a111c; --ui-brand-2: #7fa6ea;
  --ui-research: #6f9bff; --ui-research-tint: #15233d; --ui-research-ink: #9dbbff;
  --ui-test: #f2b13c; --ui-test-tint: #2a2112; --ui-test-ink: #f6c56b;
  --ui-build: #a689ff; --ui-build-tint: #221a3d; --ui-build-ink: #c2adff;
  --ui-up: #4cc38a; --ui-up-tint: #12291f; --ui-down: #ff7d6e; --ui-down-tint: #33181a;
  --ui-grid: #1a2636; --ui-focus: #6f9bff;
  --ui-tt-bg: #e8eef6; --ui-tt-ink: #0a111c;
  --ui-shadow: 0 1px 2px rgba(0,0,0,.4), 0 16px 40px -16px rgba(0,0,0,.7);
  --ui-shadow-sm: 0 1px 2px rgba(0,0,0,.4), 0 4px 12px -6px rgba(0,0,0,.5);
  color-scheme: dark;
}

/* ── Base ─────────────────────────────────────────────────────────────── */
html[data-ui="2"] body {
  background: var(--ui-bg); color: var(--ui-ink);
  font-family: var(--ui-font); font-size: var(--fs-16); line-height: 1.5;
  -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums;
}
/* NO AD-RAIL GUTTER. cambria-shared.css gives body 224px of right padding at
   1700px and wider for a sponsored rail (.cambria-rail), and the old header
   undid it for itself with a negative margin. No page places a rail, and the
   new header and every full-width band (sections, the sign-up band) stopped
   224px short of the right edge on a wide monitor. If a rail comes back, the
   page that carries it restores the padding. */
@media (min-width: 1700px) { html[data-ui="2"] body { padding-right: 0; } }
html[data-ui="2"] h1, html[data-ui="2"] h2, html[data-ui="2"] h3, html[data-ui="2"] h4 {
  font-family: var(--ui-font); font-weight: 500; letter-spacing: -.015em; text-wrap: balance;
}
/* READING SIZE (23 Nov 2026). Headings read small and small grey text was
   hard to read, so: grey is darker (above); a heading inside a card or panel
   is one step up; the label size every tool shares (chart titles, field and
   group labels) is 14, not 12; and text that is a sentence -- a note, a
   source line, a hint -- is 14. Chips, table heads and the month grid's
   cells keep 12, where the space is the constraint. */
html[data-ui="2"] { --label-size: var(--fs-14); }
html[data-ui="2"] .card h2, html[data-ui="2"] .panel h2, html[data-ui="2"] .module-panel .card h2 { font-size: var(--fs-20); }
html[data-ui="2"] .cat-hd .cn { font-family: var(--ui-font); font-size: var(--fs-16); font-weight: 600; letter-spacing: 0; text-transform: none; }
html[data-ui="2"] .cat-hd .cs { font-family: var(--ui-font); font-size: var(--fs-16); }
/* ALLOCATION CARDS (24 Nov 2026). The group colour on the name is what marks
   a card's heading, so the square beside it is gone (the composition legend
   keeps its squares: there they key the bar). The slider track was the page
   background, invisible on the card, so nothing said "drag me"; it is now a
   mid grey that Backtester and Stress also paint behind the filled part
   (var(--sl-track) in their slider gradients). The "from 1926" note was the
   warn colour at the dimmed row's half opacity, which read as the
   Alternatives orange; it is now a deeper red at full strength, and only the
   name, slider and box dim. */
html[data-ui="2"] { --sl-track: #bcc6d2; --alloc-from: #c0262d; }
html[data-ui="2"][data-theme="dark"] { --sl-track: #3a4b62; --alloc-from: #ff8a8a; }
html[data-ui="2"] .cat-hd .cd { display: none; }
html[data-ui="2"] .arow-sl { background: var(--sl-track); }
html[data-ui="2"] .arow.unavail { opacity: 1; }
html[data-ui="2"] .arow.unavail > :not(.av) { opacity: .45; }
html[data-ui="2"] .arow .av { color: var(--alloc-from); font-weight: 600; }
/* The card's total sits over the column of number boxes: the header's last
   column is the box's 50px (.arow's third column, at the card's right edge),
   and the figure is centred in it the way the box centres its value. The
   left padding offsets the "%" so the digits, not digits-plus-sign, are
   what centre over the boxes' digits. */
html[data-ui="2"] .cat-hd { display: grid; grid-template-columns: minmax(0, 1fr) 50px; column-gap: 12px; }
html[data-ui="2"] .cat-hd .cs { margin-left: 0; text-align: center; padding-left: .7em; white-space: nowrap; }
html[data-ui="2"] .stage-note, html[data-ui="2"] .ex-src, html[data-ui="2"] .source-note,
html[data-ui="2"] p.note, html[data-ui="2"] .hint, html[data-ui="2"] .custom-note,
html[data-ui="2"] .cas-ft, html[data-ui="2"] .cas-hd p, html[data-ui="2"] .cbx-sess-from,
html[data-ui="2"] .sc-period, html[data-ui="2"] .try-tactical, html[data-ui="2"] #chartStateLabel {
  font-size: var(--fs-14); line-height: 1.5;
}
/* SECOND READING PASS (23 Nov 2026), from a measured audit of every page:
   12px was carrying the labels people need (Factor's stats, Stress's asset
   names, the latest value on each Macro chart, preset tiles, Monitor's
   figures) and 14px was carrying the explanations people are meant to read
   in full. Two moves, by judgement rather than by blanket:
     explanations a visitor reads start to finish  -> 16 (the body size)
     labels, captions and controls worth reading    -> 14
   Kept small on purpose: the legal disclosures, table heads in dense tables,
   status chips and badges, the spec JSON, and source credits. */
html[data-ui="2"] .cas-i .a, html[data-ui="2"] .cas-sec .lead,
html[data-ui="2"] .howto-body, html[data-ui="2"] .edu-note, html[data-ui="2"] .implied-cap, html[data-ui="2"] .cons-body,
html[data-ui="2"] .es-note, html[data-ui="2"] .mx-intro p, html[data-ui="2"] .placeholder,
html[data-ui="2"] .detail p, html[data-ui="2"] p.how, html[data-ui="2"] .wrap > .lede,
html[data-ui="2"] .h-data p, html[data-ui="2"] .fig .empty {
  font-size: var(--fs-16); line-height: 1.6;
}
html[data-ui="2"] .cas-i .q { font-size: var(--fs-16); }
html[data-ui="2"] .mini-latest, html[data-ui="2"] .cal-dow, html[data-ui="2"] .cal-day,
html[data-ui="2"] .fc-stat .l, html[data-ui="2"] .fc-stat .s, html[data-ui="2"] .fcard .fc-foot, html[data-ui="2"] .fcard .fc-cat,
html[data-ui="2"] .module-tab .mt-sub, html[data-ui="2"] .fc-head .lbl,
html[data-ui="2"] .custom-field label, html[data-ui="2"] .intensity-labels, html[data-ui="2"] .scenario-category,
html[data-ui="2"] .preset-tile b, html[data-ui="2"] .preset-tile span:not(.g), html[data-ui="2"] .preset-btn .pd, html[data-ui="2"] .preset-src,
html[data-ui="2"] .wt-total, html[data-ui="2"] .field label, html[data-ui="2"] .add-menu, html[data-ui="2"] .chip:not(.mini),
html[data-ui="2"] .qs, html[data-ui="2"] .cons-state, html[data-ui="2"] .chart-title span, html[data-ui="2"] .note-bar,
html[data-ui="2"] .h-live-foot, html[data-ui="2"] .h-asof, html[data-ui="2"] .h-gauge-lab,
html[data-ui="2"] .row .meta, html[data-ui="2"] .card .meta, html[data-ui="2"] .row .tool, html[data-ui="2"] .fig span,
html[data-ui="2"] .rchip, html[data-ui="2"] .topic > span, html[data-ui="2"] .door > span, html[data-ui="2"] label.f,
html[data-ui="2"] .crow .cov, html[data-ui="2"] .cbx-pill, html[data-ui="2"] .ui-tip::after {
  font-size: var(--fs-14);
}
html[data-ui="2"] .preset-tile .g, html[data-ui="2"] .topic .c { font-size: var(--fs-12); }
/* Modeling Assumptions (cambria-assumptions.js injects its own rules; these
   win on specificity): a heading the size of the other panels', and section
   buttons sized to be hit, not squinted at. */
html[data-ui="2"] .cas-hd h2 { font-family: var(--ui-font); font-size: var(--fs-20); font-weight: 600; }
html[data-ui="2"] .cas-nav { gap: 8px; padding: 14px 20px; }
html[data-ui="2"] .cas-nav button { min-height: 36px; padding: 0 14px; border-radius: 8px; font-family: var(--ui-font);
  font-size: var(--fs-14); font-weight: 500; color: var(--ui-ink-2); background: var(--ui-surface); border-color: var(--ui-line-strong); }
html[data-ui="2"] .cas-nav button:hover { background: var(--ui-soft); color: var(--ui-ink); }
html[data-ui="2"] .cas-nav button.on { background: var(--ui-brand-2); border-color: var(--ui-brand-2); color: #fff; font-weight: 600; }
html[data-ui="2"] :focus-visible { outline: 2px solid var(--ui-focus); outline-offset: 2px; border-radius: 4px; }
html[data-ui="2"] ::selection { background: var(--ui-research-tint); color: var(--ui-ink); }
[data-ui="2"] [hidden] { display: none !important; }
/* WIDER ON BIG SCREENS (Dec 2026). One 1240px column left a 27-inch monitor
   (2560px) with more empty margin than content. Every page frame (the header,
   each tool's column, the session strip, the footer) reads --ui-wrap, so
   stepping it here widens them together and keeps their edges lined up.
   Prose keeps its own measure (max-width in ch), so lines do not get longer. */
@media (min-width: 1600px) { html[data-ui="2"] { --ui-wrap: 1440px; } }
@media (min-width: 1920px) { html[data-ui="2"] { --ui-wrap: 1640px; } }
@media (min-width: 2400px) { html[data-ui="2"] { --ui-wrap: 1880px; } }
/* ...and a reading measure, so the wider column does not make paragraphs
   run 300 characters a line (the footer disclosures did, on every page).
   :where() keeps this at zero specificity: any page's own max-width wins. */
:where(html[data-ui="2"]) :where(p, li, dd) { max-width: 120ch; }
.ui-wrap { max-width: var(--ui-wrap); margin: 0 auto;
  padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); }
@media (max-width: 640px) { .ui-wrap { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); } }
.ui-page { padding-block: 32px 64px; display: flex; flex-direction: column; gap: 24px; }
.ui-muted { color: var(--ui-muted); }
.ui-up { color: var(--ui-up); } .ui-down { color: var(--ui-down); }

/* Area colours: set on any container, read by everything inside it. */
.ui-research { --area-c: var(--ui-research); --area-tint: var(--ui-research-tint); --area-ink: var(--ui-research-ink); }
.ui-test     { --area-c: var(--ui-test);     --area-tint: var(--ui-test-tint);     --area-ink: var(--ui-test-ink); }
.ui-build    { --area-c: var(--ui-build);    --area-tint: var(--ui-build-tint);    --area-ink: var(--ui-build-ink); }
.ui-neutral  { --area-c: var(--ui-ink-2);    --area-tint: var(--ui-soft);          --area-ink: var(--ui-ink-2); }
.ui-glyph { width: 20px; height: 20px; flex: none; color: var(--area-c, var(--ui-ink-2)); }

/* ── Header: one sticky bar, Research / Test / Build always in view ───── */
.ui-bar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50; background: var(--ui-surface); border-bottom: 1px solid var(--ui-line); }
.ui-bar-in { display: flex; align-items: center; gap: 12px; height: 64px; }
.ui-logo { display: inline-flex; align-items: center; height: 40px; margin-right: 8px; flex: none; }
.ui-logo img { height: 24px; width: auto; display: block; }
.ui-logo .on-dark { display: none; }
html[data-theme="dark"] .ui-logo .on-light { display: none; }
html[data-theme="dark"] .ui-logo .on-dark { display: block; }
.ui-areas { display: flex; align-items: center; gap: 2px; }
.ui-area { position: relative; }
.ui-area-tab { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px 0 8px; border-radius: var(--ui-r-md);
  font: 500 var(--fs-16)/1 var(--ui-font); color: var(--ui-ink-2); background: none; border: 0; cursor: pointer;
  transition: background-color .15s var(--ui-ease), color .15s var(--ui-ease); }
.ui-area-tab:hover, .ui-area.open .ui-area-tab { background: var(--ui-soft); color: var(--ui-ink); }
.ui-area-tab i { width: 10px; height: 10px; border-radius: 3px; background: var(--area-c); display: inline-block; }
.ui-area-tab svg { width: 14px; height: 14px; color: var(--ui-faint); transition: transform .2s var(--ui-ease); }
.ui-area.open .ui-area-tab svg { transform: rotate(180deg); }
.ui-area-tab[aria-current="true"] { color: var(--ui-ink); box-shadow: inset 0 -2px 0 var(--area-c); border-radius: var(--ui-r-md) var(--ui-r-md) 0 0; }
.ui-bar-sp { flex: 1; }
.ui-bar-link { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px; border-radius: var(--ui-r-md);
  color: var(--ui-ink-2); font-size: var(--fs-14); font-weight: 500; background: none; border: 0; cursor: pointer; font-family: var(--ui-font); }
.ui-bar-link:hover { background: var(--ui-soft); color: var(--ui-ink); }
.ui-bar-link[aria-current="true"] { color: var(--ui-ink); background: var(--ui-soft); }
.ui-btn-start { background: var(--ui-brand); color: var(--ui-on-brand); }
.ui-btn-start:hover { background: var(--ui-brand-hover); color: var(--ui-on-brand); }
.ui-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--ui-brand-2); color: #fff; font-weight: 600; font-size: var(--fs-14);
  display: grid; place-items: center; border: 0; cursor: pointer; font-family: var(--ui-font); }
.ui-menu-btn { display: none; }

.ui-mega { position: absolute; left: -8px; top: calc(100% + 10px); width: 640px; display: grid; grid-template-columns: 200px 1fr; gap: 8px;
  padding: 10px; background: var(--ui-surface); border: 1px solid var(--ui-line); border-radius: var(--ui-r-lg); box-shadow: var(--ui-shadow); z-index: 70; }
.ui-mega-intro { padding: 14px; border-radius: var(--ui-r-md); background: var(--area-tint); display: flex; flex-direction: column; gap: 8px; }
.ui-mega-intro b { font-size: var(--fs-18); font-weight: 600; color: var(--ui-ink); }
.ui-mega-intro p { margin: 0; font-size: var(--fs-14); color: var(--ui-ink-2); }
.ui-mega ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.ui-mega a { display: grid; grid-template-columns: 32px 1fr; gap: 12px; align-items: start; padding: 9px 10px; border-radius: var(--ui-r-md); color: var(--ui-ink); }
.ui-mega a:hover, .ui-mega a[aria-current="page"] { background: var(--ui-soft); }
.ui-mega a b { display: block; font-weight: 600; font-size: var(--fs-14); }
.ui-mega a small { display: block; font-size: var(--fs-14); color: var(--ui-muted); line-height: 1.35; margin-top: 1px; }
.ui-tool-ico { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; border: 1px solid var(--ui-line); background: var(--ui-surface); color: var(--area-c, var(--ui-ink-2)); }
.ui-tool-ico svg { width: 20px; height: 20px; }
.ui-menu { position: absolute; right: 0; top: calc(100% + 8px); width: 240px; z-index: 80; background: var(--ui-surface); color: var(--ui-ink);
  border: 1px solid var(--ui-line); border-radius: var(--ui-r-lg); box-shadow: var(--ui-shadow); padding: 8px; }
.ui-menu a, .ui-menu button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--ui-r-sm);
  font: 400 var(--fs-14)/1.3 var(--ui-font); color: var(--ui-ink); background: none; border: 0; cursor: pointer; text-align: left; }
.ui-menu a:hover, .ui-menu button:hover { background: var(--ui-soft); }
.ui-menu .ui-menu-h { font-size: var(--fs-12); color: var(--ui-muted); padding: 8px 10px 4px; }
.ui-menu hr { border: 0; border-top: 1px solid var(--ui-line); margin: 6px 0; }
.ui-acct { position: relative; display: inline-flex; align-items: center; gap: 4px; min-width: 34px; }

/* Where you are inside an area: the area name and its sibling tools. */
.ui-subnav { background: var(--ui-surface); border-bottom: 1px solid var(--ui-line); }
.ui-subnav-in { display: flex; align-items: center; gap: 16px; min-height: 48px; }
.ui-sub-area { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--area-ink); flex: none; font-size: var(--fs-14); }
.ui-sub-area i { width: 10px; height: 10px; border-radius: 3px; background: var(--area-c); display: inline-block; }
.ui-sub-tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.ui-sub-tabs::-webkit-scrollbar { display: none; }
.ui-sub-tabs a { white-space: nowrap; padding: 13px 10px 11px; font-size: var(--fs-14); color: var(--ui-muted); border-bottom: 2px solid transparent; }
.ui-sub-tabs a:hover { color: var(--ui-ink); }
.ui-sub-tabs a[aria-current="page"] { color: var(--ui-ink); border-bottom-color: var(--area-c); font-weight: 500; }

@media (max-width: 980px) {
  .ui-areas, .ui-bar .ui-hide-sm { display: none; }
  .ui-menu-btn { display: inline-flex; }
  .ui-areas.open { display: flex; flex-direction: column; align-items: stretch; position: absolute; left: 0; right: 0; top: 64px;
    background: var(--ui-surface); border-bottom: 1px solid var(--ui-line); padding: 8px max(16px, env(safe-area-inset-left, 0px)) 16px; box-shadow: var(--ui-shadow-sm); }
  .ui-areas.open .ui-mega { position: static; width: auto; grid-template-columns: 1fr; box-shadow: none; border: 0; padding: 4px 0 8px; }
  .ui-areas.open .ui-mega-intro { display: none; }
}

/* ── Tool header: the question first ──────────────────────────────────── */
.ui-crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: var(--fs-14); color: var(--ui-muted); }
.ui-crumbs a { color: var(--area-ink, var(--ui-ink-2)); }
.ui-crumbs a:hover { text-decoration: underline; text-underline-offset: 3px; }
.ui-crumbs .sep { color: var(--ui-faint); }
.ui-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ui-head-t { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ui-head h1 { font-size: var(--fs-32); line-height: 1.1; letter-spacing: -.025em; display: flex; align-items: center; gap: 12px; margin: 0; }
.ui-head h1 .ui-glyph { width: 28px; height: 28px; }
.ui-head p { margin: 0; color: var(--ui-muted); max-width: 70ch; font-size: var(--fs-18); }
.ui-head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
@media (max-width: 640px) { .ui-head h1 { font-size: var(--fs-24); } .ui-head p { font-size: var(--fs-16); } }

/* ── Building blocks ──────────────────────────────────────────────────── */
.ui-panel { background: var(--ui-surface); border: 1px solid var(--ui-line); border-radius: var(--ui-r-lg); padding: 24px; min-width: 0; }
.ui-panel-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.ui-panel-h h2 { font-size: var(--fs-20); line-height: 1.3; font-weight: 600; margin: 0; }
.ui-panel-h p { margin: 0; color: var(--ui-muted); font-size: var(--fs-14); }
@media (max-width: 640px) { .ui-panel { padding: 18px 16px; } }

.ui-answer { font-size: var(--fs-24); line-height: 1.35; letter-spacing: -.015em; margin: 0; }
.ui-answer b { font-weight: 600; }

.ui-stats { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); gap: 16px; }
.ui-stat { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; background: var(--ui-surface); border: 1px solid var(--ui-line); border-radius: var(--ui-r-lg); min-width: 0; }
.ui-stat-label { font-size: var(--fs-14); color: var(--ui-muted); display: flex; align-items: center; gap: 4px; }
.ui-stat-num { font-size: var(--fs-32); font-weight: 500; letter-spacing: -.025em; line-height: 1.1; }
.ui-stat-cmp { font-size: var(--fs-12); color: var(--ui-muted); }
@media (max-width: 860px) { .ui-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Deeper studies as named tabs, after the answer. */
.ui-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--ui-line); overflow-x: auto; scrollbar-width: none; }
.ui-tabs::-webkit-scrollbar { display: none; }
.ui-tabs a, .ui-tabs button { padding: 10px 14px; font: 500 var(--fs-14)/1.3 var(--ui-font); color: var(--ui-muted); background: none; border: 0;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; cursor: pointer; }
.ui-tabs a:hover, .ui-tabs button:hover { color: var(--ui-ink); }
.ui-tabs [aria-current="page"], .ui-tabs [aria-selected="true"] { color: var(--ui-ink); border-bottom-color: var(--area-c, var(--ui-ink)); }
.ui-subtabs { display: flex; gap: 6px; flex-wrap: wrap; }
.ui-subtabs a, .ui-subtabs button { height: 32px; padding: 0 12px; border-radius: 8px; display: inline-flex; align-items: center; font: 400 var(--fs-14)/1 var(--ui-font);
  color: var(--ui-muted); border: 1px solid transparent; background: none; cursor: pointer; }
.ui-subtabs a:hover, .ui-subtabs button:hover { color: var(--ui-ink); background: var(--ui-soft); }
.ui-subtabs [aria-current="page"], .ui-subtabs [aria-pressed="true"] { color: var(--area-ink, var(--ui-ink)); background: var(--area-tint, var(--ui-soft)); font-weight: 600; }

/* A row that opens to show what is behind a number. */
details.ui-disc { border: 1px solid var(--ui-line); border-radius: var(--ui-r-lg); background: var(--ui-surface); }
details.ui-disc + details.ui-disc { margin-top: 10px; }
details.ui-disc > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 18px; cursor: pointer; border-radius: var(--ui-r-lg); }
details.ui-disc > summary::-webkit-details-marker { display: none; }
details.ui-disc > summary:hover { background: var(--ui-surface-2); }
details.ui-disc[open] > summary { border-bottom: 1px solid var(--ui-line); border-radius: var(--ui-r-lg) var(--ui-r-lg) 0 0; }
.ui-disc-t { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ui-disc-t b { display: block; font-weight: 600; }
.ui-disc-t small { display: block; color: var(--ui-muted); font-size: var(--fs-14); }
.ui-disc-go { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-14); font-weight: 600; color: var(--area-ink, var(--ui-brand-2)); flex: none; }
.ui-disc-go svg { width: 16px; height: 16px; transition: transform .2s var(--ui-ease); }
details.ui-disc[open] .ui-disc-go svg { transform: rotate(180deg); }
details.ui-disc .when-open, details.ui-disc[open] .when-closed { display: none; }
details.ui-disc[open] .when-open { display: inline; }
.ui-disc-body { padding: 18px; display: flex; flex-direction: column; gap: 16px; }
details.ui-disc.ui-flat { border-style: dashed; background: transparent; }

.ui-tbl { overflow-x: auto; max-width: 100%; }
.ui-tbl table { width: 100%; border-collapse: collapse; font-size: var(--fs-14); }
.ui-tbl th { text-align: left; font-weight: 500; color: var(--ui-muted); font-size: var(--fs-12); padding: 0 12px 8px 0; white-space: nowrap; }
.ui-tbl td { padding: 9px 12px 9px 0; border-top: 1px solid var(--ui-line); }
.ui-tbl .r { text-align: right; }

.ui-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: var(--ui-r-md);
  border: 1px solid var(--ui-line-strong); background: var(--ui-surface); color: var(--ui-ink); font: 500 var(--fs-14)/1 var(--ui-font); white-space: nowrap; cursor: pointer;
  transition: background-color .15s var(--ui-ease), border-color .15s var(--ui-ease); }
.ui-btn:hover { background: var(--ui-soft); }
.ui-btn.primary { background: var(--ui-brand); border-color: var(--ui-brand); color: var(--ui-on-brand); }
.ui-btn.primary:hover { background: var(--ui-brand-hover); border-color: var(--ui-brand-hover); }
.ui-btn.sm { height: 32px; padding: 0 12px; }
.ui-chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 7px; font-size: var(--fs-12); font-weight: 600; white-space: nowrap;
  color: var(--ui-ink-2); background: var(--ui-soft); }
.ui-chip.up { color: var(--ui-up); background: var(--ui-up-tint); }
.ui-chip.down { color: var(--ui-down); background: var(--ui-down-tint); }
.ui-chip.area { color: var(--area-ink); background: var(--area-tint); }
.ui-seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--ui-soft); border: 1px solid var(--ui-line); gap: 2px; flex-wrap: wrap; }
.ui-seg button { height: 30px; padding: 0 12px; border-radius: 7px; font: 400 var(--fs-14)/1 var(--ui-font); color: var(--ui-muted); background: none; border: 0; cursor: pointer; }
.ui-seg button[aria-pressed="true"] { background: var(--ui-surface); color: var(--ui-ink); font-weight: 600; box-shadow: var(--ui-shadow-sm); }
.ui-kv { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px 20px; }
.ui-kv dt { font-size: var(--fs-12); color: var(--ui-muted); }
.ui-kv dd { margin: 2px 0 0; font-weight: 600; }
.ui-note { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--ui-r-md); background: var(--ui-soft); color: var(--ui-ink-2); font-size: var(--fs-14); }
.ui-note b { font-weight: 600; color: var(--ui-ink); }
/* Where a preset comes from: shown wherever a preset is picked (counsel, 19 Nov 2026). */
.ui-src { display: block; font-size: var(--fs-12); color: var(--ui-muted); line-height: 1.45; }
.ui-src a { color: inherit; text-decoration: underline; }

/* An (i) beside a term. Hover or focus shows the plain-words definition. */
.ui-tip { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--ui-line-strong); color: var(--ui-muted);
  font: 700 var(--fs-12)/1 var(--ui-font); position: relative; vertical-align: 1px; margin-left: 4px; flex: none; cursor: help; background: none; padding: 0; }
.ui-tip::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); width: max-content; max-width: min(260px, 70vw);
  padding: 8px 10px; border-radius: 8px; background: var(--ui-tt-bg); color: var(--ui-tt-ink); font-size: var(--fs-12); font-weight: 400; line-height: 1.4; text-align: left;
  pointer-events: none; z-index: 90; display: none; }
.ui-tip:hover::after, .ui-tip:focus-visible::after, .ui-tip:focus::after { display: block; }
@media (max-width: 640px) {
  .ui-tip::after { position: fixed; left: 16px; right: 16px; top: auto; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); transform: none; width: auto; max-width: none; padding: 12px 14px; font-size: var(--fs-14); }
}

/* Where to next: the signs at the bottom of every tool. */
.ui-next-wrap { display: flex; flex-direction: column; gap: 12px; }
.ui-next-wrap h2 { font-size: var(--fs-18); font-weight: 600; margin: 0; }
.ui-next { display: flex; gap: 12px; flex-wrap: wrap; }
.ui-next a { flex: 1 1 260px; display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: var(--ui-r-lg); border: 1px solid var(--ui-line);
  background: var(--ui-surface); color: var(--ui-ink); transition: border-color .15s var(--ui-ease); min-width: 0; }
.ui-next a:hover { border-color: var(--area-c, var(--ui-line-strong)); }
.ui-next b { display: block; font-weight: 600; }
.ui-next small { color: var(--ui-muted); font-size: var(--fs-14); }
.ui-next .go { margin-left: auto; color: var(--area-c, var(--ui-faint)); flex: none; }
.ui-next .go svg { width: 18px; height: 18px; transition: transform .15s var(--ui-ease); }
.ui-next a:hover .go svg { transform: translateX(3px); }

/* ── The shared footer, restyled: sentence case, no uppercase labels. The
   wording is cambria-nav.js's and is not changed here. ────────────────── */
html[data-ui="2"] .cambria-footer-disclosures { max-width: var(--ui-wrap); font-family: var(--ui-font); font-size: var(--fs-12); color: var(--ui-muted); border-top-color: var(--ui-line); }
html[data-ui="2"] .cambria-footer-disclosures strong { color: var(--ui-ink); font-weight: 600; }
html[data-ui="2"] .cambria-footer-legal { font-family: var(--ui-font); font-size: var(--fs-14); letter-spacing: 0; text-transform: none; border-top-color: var(--ui-line); }
html[data-ui="2"] .cambria-footer-legal a { color: var(--ui-muted); }
html[data-ui="2"] .cambria-footer-legal a:hover { color: var(--ui-ink); }
html[data-ui="2"] .cambria-site-footer .cambria-footer-disclosures { color: rgba(255,255,255,.78); }
html[data-ui="2"] .cambria-site-footer .cambria-footer-disclosures strong { color: #fff; }
html[data-ui="2"] .cambria-site-footer .cambria-footer-legal a { color: rgba(255,255,255,.85); }
html[data-ui="2"] .cambria-site-footer .cambria-footer-legal a:hover { color: #fff; }

@media (prefers-reduced-motion: reduce) {
  [data-ui="2"] *, [data-ui="2"] *::before, [data-ui="2"] *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
}
@media print { .ui-bar, .ui-subnav, .ui-next-wrap { display: none; } }

/* The working-portfolio strip (cambria-nav.js CambriaSession) sits under the
   tool row on new pages, as a quiet band in the page's column. */
html[data-ui="2"] #cambria-session-bar { background: var(--ui-surface-2); border-bottom: 1px solid var(--ui-line); font-family: var(--ui-font);
  padding-left: max(24px, calc((100% - var(--ui-wrap)) / 2 + 24px)); padding-right: max(24px, calc((100% - var(--ui-wrap)) / 2 + 24px)); }

/* ── The Weekly Report ──────────────────────────────────
   A static file written by macro/pipeline/weekly_report.py, which marks it
   data-ui-page="weekly" (dated copies inline this sheet when published).
   Its own rules stay; these restyle it on top. */
html[data-ui-page="weekly"] .layout { max-width: var(--ui-wrap); padding: 8px max(24px, env(safe-area-inset-left, 0px)) 64px; }
html[data-ui-page="weekly"] .layout, html[data-ui-page="weekly"] .layout * { letter-spacing: normal; }
html[data-ui-page="weekly"] .view-tabs { gap: 2px; border-bottom-color: var(--ui-line); overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; }
html[data-ui-page="weekly"] .view-tab { font-family: var(--ui-font); font-size: var(--fs-14); text-transform: none; padding: 12px 14px; color: var(--ui-muted); white-space: nowrap; }
html[data-ui-page="weekly"] .view-tab.active { color: var(--ui-ink); border-bottom-color: var(--ui-research); }
html[data-ui-page="weekly"] .rep-head { border-bottom: 1px solid var(--ui-line); }
html[data-ui-page="weekly"] .rep-head h1 { font-family: var(--ui-font); font-size: var(--fs-32); font-weight: 500; letter-spacing: -.025em; }
html[data-ui-page="weekly"] .brief { border-left: 0; padding: 18px 20px; border-radius: var(--ui-r-md); background: var(--ui-research-tint); }
html[data-ui-page="weekly"] .brief h2, html[data-ui-page="weekly"] .rep-foot h4 { text-transform: none; font-size: var(--fs-14); font-weight: 600; color: var(--ui-ink); }
html[data-ui-page="weekly"] .data-table th { text-transform: none; }
html[data-ui-page="weekly"] table.rep thead th { font-size: var(--fs-12); }
html[data-ui-page="weekly"] .series, html[data-ui-page="weekly"] .asof, html[data-ui-page="weekly"] details.sources { font-size: var(--fs-14); }
html[data-ui-page="weekly"] .card { border-color: var(--ui-line); border-radius: var(--ui-r-lg); }
html[data-ui-page="weekly"] .sec { text-transform: none; font-size: var(--fs-18); font-weight: 600; color: var(--ui-ink); letter-spacing: normal; }
html[data-ui-page="weekly"] .prose p, html[data-ui-page="weekly"] .brief p { max-width: 75ch; }
