/* ═══════════════════════════════════════════════════════════════════════════
   StrataNova — Institutional Refinement Layer
   Loaded AFTER stratanova.css. Every rule here is an override: delete the
   <link> in base.html and the app returns to its previous appearance exactly.

   Sections
     1. Tabular figures          — the numbers stop wobbling
     2. Semantic colour          — teal is interface, green/red is P&L
     3. De-boxing                — hairlines instead of floating cards
     4. Micro-typography         — the 10px labels become readable
     5. Table craft              — column rhythm, zebra-free density
     6. Print / PDF              — quarterly-review output
   ═══════════════════════════════════════════════════════════════════════════ */


/* ── 1. TABULAR FIGURES ──────────────────────────────────────────────────
   Instrument Sans sets digits proportionally by default: "1" is 391/1000 em
   and "0" is 666/1000 — a 41% spread. No numeric column can align under
   that, which is why the holdings table and the KPI strip look unsettled.

   The font does ship tabular glyphs (zero.tf … nine.tf, all exactly 600/1000)
   behind the OpenType `tnum` feature — they just have to be switched on.
   font-variant-numeric inherits, so declaring it on :root covers the whole
   app; form controls don't inherit font properties, so they're named too.

   This replaces the ~49 per-component `tabular-nums` declarations already
   scattered through stratanova.css — those stay harmless.                  */

:root,
input, select, textarea, button, table, svg text {
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
}

/* Running prose reads better with proportional figures. Narrative copy only —
   anything that is a measurement stays tabular. */
.sn-nb-say, .sl-herosay, .sl-scale-say, .sn-imp-sub,
.clf-tooltip-meta, .lt-info-pop, .sn-fm-strip + p, p.sn-note {
  font-variant-numeric: proportional-nums;
  font-feature-settings: 'pnum' 1;
}


/* ── 2. SEMANTIC COLOUR ──────────────────────────────────────────────────
   Today teal is the active tab, the chart line, every progress bar, every
   pill, AND the colour of a positive return. An accent that means six
   things signals none of them.

   After this block:
     teal   = interface (active state, the portfolio series, affordances)
     green  = a number went up
     red    = a number went down
   Both semantics are desaturated on purpose — this is a P&L convention,
   not a traffic light.                                                     */

:root {
  --sn-pos: #3f7d5e;
  --sn-pos-rgb: 63, 125, 94;
  --sn-neg: #b0574f;
  --sn-neg-rgb: 176, 87, 79;
  /* Caution, not direction: data caveats (no price series, duplicate rows).
     Was referenced as var(--sn-warning, #b45309) but never defined, so dark
     theme got the light-theme amber. */
  --sn-warning: #b45309;
}
[data-bs-theme="dark"] {
  --sn-pos: #62a684;
  --sn-pos-rgb: 98, 166, 132;
  --sn-neg: #d97b72;
  --sn-neg-rgb: 217, 123, 114;
  --sn-warning: #e0a458;
}
[data-bs-theme="grey"] {
  --sn-pos: #356b50;
  --sn-pos-rgb: 53, 107, 80;
  --sn-neg: #9e4a43;
  --sn-neg-rgb: 158, 74, 67;
  --sn-warning: #9a4a0b;
}

/* stratanova.css hardcodes var(--sn-teal) in several positive-value rules;
   route them through the token instead. */
.sn-pos,
.sn-table .sn-pos,
.sn-fm-value.sn-pos,
.sn-hpf-card-y1-val.sn-pos,
.sn-hqs-value.sn-pos,
[data-bs-theme="dark"] .sn-pos,
[data-bs-theme="dark"] .sn-fm-value.sn-pos,
[data-bs-theme="dark"] .sn-table .sn-pos,
[data-bs-theme="dark"] .sn-hpf-card-y1-val.sn-pos,
[data-bs-theme="dark"] .sn-hqs-value.sn-pos { color: var(--sn-pos) !important; }

.sn-neg,
.sn-table .sn-neg,
.sn-fm-value.sn-neg,
[data-bs-theme="dark"] .sn-neg,
[data-bs-theme="dark"] .sn-fm-value.sn-neg { color: var(--sn-neg) !important; }


/* ── 3. DE-BOXING ────────────────────────────────────────────────────────
   Rounded, shadowed cards floating on grey is the visual signature of a
   SaaS template. Terminal-grade tools use hairline rules and let alignment
   do the containing. Radius down, shadows gone, one honest border.        */

.sn-card {
  border-radius: 3px;
  border: 1px solid var(--sn-border-med);
  box-shadow: none;
}
.sn-card:hover { box-shadow: none; }

.sn-gauge-card,
.port-bar-wrap,
.lt-summary-wrap,
.sn-nb-card,
.etf-rate-note,
.etf-confidence-row {
  border-radius: 3px;
  box-shadow: none;
}

/* Controls keep a hair of softness so they still read as pressable. */
.btn, .sn-pill-btn, .sn-sub-tab, .form-control, .form-select,
.sn-te-select { border-radius: 3px; }

/* Pills that carry a value are chips, not lozenges. */
.clf-pct-pill, .sn-h-theme-pills span, .sn-nb-tag { border-radius: 2px; }

/* Drop the elevated-card treatment to a border instead of a drop shadow. */
.sn-card-elevated {
  box-shadow: none;
  border: 1px solid var(--sn-border-strong);
}


/* ── 4. MICRO-TYPOGRAPHY ─────────────────────────────────────────────────
   10px uppercase at --sn-text-label on white is roughly 2.9:1 against the
   card. People read this screen for hours. Nudge the size, cut the
   tracking, and take the labels to the muted token, which clears 4.5:1.   */

.sn-card-header {
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--sn-text-muted);
}

.sn-fm-label,
.clf-dim-label,
.port-bar-ret-label,
.sn-nb-meta,
.sl-eyebrow,
.etf-exposed-hdr {
  font-size: 0.655rem;
  letter-spacing: 0.055em;
  color: var(--sn-text-muted);
}

/* Headline figures: slightly tighter, one weight heavier than the label. */
.sn-fm-value { font-weight: 500; letter-spacing: -0.015em; }
.clf-dim-value { font-weight: 600; }
.port-bar-ret-val { font-weight: 600; }


/* ── 5. TABLE CRAFT ──────────────────────────────────────────────────────
   The holdings table is already right-aligned via .text-end. What it lacks
   is a header that reads as a header and a row rhythm that survives 60
   rows of scrolling.                                                       */

.sn-table thead th {
  background: var(--sn-card-bg);
  border-bottom: 1px solid var(--sn-border-strong);
  color: var(--sn-text-muted);
  letter-spacing: 0.05em;
  font-size: 0.655rem;
}
.sn-table thead th.text-end { text-align: right; }

.sn-table tbody td { border-color: var(--sn-row-border); }

/* Ticker column carries the identity — give it the weight. */
.sn-table tbody td:first-child,
#holdings-table .sn-h-col-name { font-weight: 500; }

/* Right-aligned numeric cells get a touch more air on the right so the
   last digit doesn't collide with the column edge. */
.sn-table tbody td.text-end,
.sn-co-table td.right { padding-right: 0.85rem; }
.sn-table thead th.text-end,
.sn-co-table th.right { padding-right: 0.85rem; }


/* ── 6. PRINT / PDF ──────────────────────────────────────────────────────
   Quarterly reviews get assembled from screenshots today. Ctrl-P should
   produce something a client can receive.                                  */

@media print {
  .sn-navbar, .sn-sidebar, .sn-sticky-nav, .sn-h-toolbar,
  .port-bar-actions, .sn-fm-more, #snapshot-wrap { display: none !important; }

  body { background: #fff; font-size: 9.5pt; }
  .sn-card {
    border: 1px solid #ccd3da;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .sn-card-header { color: #333; }
  a[href]::after { content: ""; }
}


/* ── 7. IMPACT ANALYSIS ──────────────────────────────────────────────────
   The stress module carried two encodings that fought their own data. Both
   are re-cut here; the JS in portfolio_dashboard.js emits the new elements. */

/* 7a. Ledger row graphic.
   The mild-to-severe range was an 8px grey bar behind the data bars, so each
   row read as four sequential segments — grey, salmon, red, red — in an order
   matching neither the legend nor the arithmetic, and two white "severity
   ticks" cut through the red like breaks in the data.

   A range is not a quantity. It is now a hairline whisker with end caps,
   riding above the bar: present when you look for it, silent when you don't. */
#tab-impact .sl-track { height: 26px; }

#tab-impact .sl-whisker {
  position: absolute; top: 3px; height: 5px;
  border-top: 1px solid var(--sl-ink-3);
  opacity: 0.5;
}
#tab-impact .sl-whisker-cap {
  position: absolute; top: 0; width: 1px; height: 5px;
  background: var(--sl-ink-3);
}
#tab-impact .sl-whisker-cap.lo { left: 0; }
#tab-impact .sl-whisker-cap.hi { right: 0; }
#tab-impact .sl-lrow:hover .sl-whisker { opacity: 0.85; }

/* An end that runs off the axis gets an open arrow instead of a cap, so a
   clamped Severe value is never read as landing exactly on the axis edge. */
#tab-impact .sl-whisker.clip-lo .sl-whisker-cap.lo,
#tab-impact .sl-whisker.clip-hi .sl-whisker-cap.hi { display: none; }
#tab-impact .sl-whisker.clip-lo::before,
#tab-impact .sl-whisker.clip-hi::after {
  content: ''; position: absolute; top: -3px;
  border: 3px solid transparent;
}
#tab-impact .sl-whisker.clip-lo::before { left: -4px; border-right-color: var(--sl-ink-3); }
#tab-impact .sl-whisker.clip-hi::after { right: -4px; border-left-color: var(--sl-ink-3); }

/* Bars drop below the whisker and lose the pill ends — a value anchored at
   zero should read as a measured length, not a lozenge. */
#tab-impact .sl-bar { top: 10px; height: 13px; }
#tab-impact .sl-bar.later.neg,
#tab-impact .sl-bar.later.pos,
#tab-impact .sl-bar.cap-neg,
#tab-impact .sl-bar.cap-pos { border-radius: 0; }
#tab-impact .sl-track-zero { top: 8px; bottom: 0; background: var(--sl-ink-3); opacity: .45; }

/* Legend: the range swatch becomes the mark it now describes. */
#tab-impact .sl-lg.band i {
  background: none; border-radius: 0; height: 5px;
  border-top: 1px solid var(--sl-ink-3);
  border-left: 1px solid var(--sl-ink-3);
  border-right: 1px solid var(--sl-ink-3);
  opacity: .6;
}

/* 7b. Scenario strip.
   The cluster pill is now a bracket, and two more scenarios get named.
   Sits below the tick labels so it annotates the axis rather than crowding it. */
#tab-impact .sl-strip-bracket {
  position: absolute; top: 126px; height: 6px;
  border-bottom: 1px solid var(--sl-line-2);
  border-left: 1px solid var(--sl-line-2);
  border-right: 1px solid var(--sl-line-2);
}
#tab-impact .sl-strip-cluster { display: none; }   /* superseded by the bracket */
#tab-impact .sl-pip-note.is-cluster { top: 136px; }

/* Second and third worst get a compact single-line label — enough to name
   them without building a second headline. */
#tab-impact .sl-pip-note.is-runner { font-size: 10.5px; color: var(--sl-ink-2); }
#tab-impact .sl-pip-note.is-runner b {
  display: inline; margin-right: 5px;
  font-size: 11px; color: var(--sl-ink-2); font-weight: 500;
}
/* JS positions each stem per tier. The old --sl-line-2 hairline was so close
   to the card background that the leader line didn't read as one. */
#tab-impact .sl-pip-stem { top: auto; background: var(--sl-ink-3); opacity: .45; }

/* 7c. Provenance and units. */
#tab-impact .sl-scale-foot { line-height: 1.5; }
#tab-impact .sl-scale-asof {
  display: block; margin-top: 4px;
  font-size: 10px; letter-spacing: .04em; text-transform: uppercase;
  color: var(--sl-ink-3);
}
#tab-impact .sl-unit {
  font-size: 9px; letter-spacing: .06em;
  color: var(--sl-ink-3); margin-left: 2px;
}
#tab-impact .sl-herosay em { font-style: normal; font-weight: 600; }

/* 7d. Ledger header.
   Title, a long subtitle, a legend, a view toggle, a severity switch and a
   primary button were all one wrapping flex row. The tools fell to a second
   line and stayed left-aligned, leaving a wide dead gap on the right and a
   cluster of unrelated controls jammed together on the left.

   Now: titles left and buttons right on the first line, legend on its own
   line beneath — beside the rows it describes. The severity switch has moved
   out entirely, to the stress-profile card (7e). */
#tab-impact .sl-head {
  display: flex; flex-wrap: wrap; align-items: center;
  row-gap: 6px; column-gap: 14px;
}
#tab-impact .sl-head-titles { flex: 1 1 340px; order: 1; }
#tab-impact .sl-head-tools { order: 2; margin-left: auto; flex: 0 0 auto; }
#tab-impact .sl-legend { order: 3; flex: 1 0 100%; margin: 0; }

/* 7e. Severity control, promoted.
   It restates every number in the module — hero, tiles, strip and ledger — so
   it belongs at the top of the module, not inside one table's toolbar where
   it reads as a filter on that table. */
#tab-impact .sl-scale-head { align-items: flex-start; justify-content: space-between; }
#tab-impact .sl-sevctl {
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0; margin-left: 16px;
}
#tab-impact .sl-sevctl-k {
  font-family: var(--sl-mono); font-size: 9px; letter-spacing: .11em;
  text-transform: uppercase; color: var(--sl-ink-3);
}

/* 7f. Column-header axis labels.
   The first tick sits at 0% of the plot area with translateX(-50%), so half of
   it hung left into the TOTAL column — "TOTAL PP −6" read as one string. The
   end labels now align inside their own edge instead of straddling it. */
#tab-impact .sl-axis-labels span.edge-lo { transform: translateX(0); }
#tab-impact .sl-axis-labels span.edge-hi { transform: translateX(-100%); }

/* Both are the same grid column, so identical padding keeps the labels aligned
   over the bars while opening a gutter between the figures and the plot. The
   rule makes the split deliberate instead of leaving "TOTAL pp" and the first
   tick to read as one run of grey mono. */
#tab-impact .sl-axis-labels,
#tab-impact .sl-track {
  border-left: 1px solid var(--sl-line);
  padding-left: 14px;
}

/* Units read as part of the label at the same size and tracking. Drop them a
   step and lose the caps so "pp" annotates rather than competes. */
#tab-impact .sl-unit {
  font-size: 8.5px; letter-spacing: .02em; text-transform: none;
  opacity: .7; margin-left: 3px;
}

/* ── §7 impact analysis · exposure, not drawdown ──────────────────────────
   The ledger's numbers are a SHARE of the book's revenue sitting in the
   shocked themes. They carry no shock magnitude, so they take neither the
   P&L green nor the P&L red — colouring them by direction is exactly the
   misreading the change was made to remove. Direction lives on a chip
   beside the scenario name instead. */
.sl-num.exp { color: var(--sn-text); font-variant-numeric: tabular-nums; }
.sl-num.total.exp { font-weight: 600; }

.sl-dir {
  display: inline-block; margin-left: 8px; padding: 1px 6px;
  border-radius: 2px; font-size: .58rem; letter-spacing: .06em;
  text-transform: uppercase; vertical-align: middle;
  border: 1px solid var(--sn-border-med); color: var(--sn-text-muted);
}
.sl-dir.adverse    { border-color: rgba(176, 87, 79, .45);  color: var(--sn-neg); }
.sl-dir.favourable { border-color: rgba(63, 125, 94, .45);  color: var(--sn-pos); }

/* The impact hero is now a SHARE OF REVENUE EXPOSED, not a modelled loss, so
   it loses the P&L red: colouring an exposure figure as a loss is the
   misreading the measure was changed to remove. The unit is a phrase rather
   than "pp", so it sets on its own line at label scale instead of riding the
   numeral at 21px. */
#tab-impact .sl-hero { color: var(--sn-text); }
#tab-impact .sl-hero-unit {
  display: block; margin-left: 0; margin-top: 2px;
  font-size: 10.5px; font-weight: 500; letter-spacing: .1em;
  text-transform: uppercase; color: var(--sn-text-muted);
}

/* ── Theme axis change, Thematic Analysis (§2 semantic colour) ───────────────
   The move since the previous THEME_FACTS_HISTORY snapshot, beside the 1-5 dots rather
   than instead of them: the level and the change answer different questions.

   A move caused by OTHER themes re-ranking is dimmed and italic. These scores are
   quintiles across the 49 themes, so a theme can lose a point without changing at all —
   measured on 2026-08-30 -> 2026-09-02, Media & Digital Content and Oil Gas each dropped
   a point with their own figures flat. Drawing that identically to a genuine decline is
   exactly the misreading this annotation exists to prevent. */
.sn-dot5-chg { margin-left:6px; font-size:10.5px; font-weight:600;
  font-variant-numeric:tabular-nums; }
.sn-dot5-chg.up { color:var(--sn-pos); }
.sn-dot5-chg.dn { color:var(--sn-neg); }
.sn-dot5-chg.field { opacity:.5; font-weight:500; font-style:italic; }

/* ── Theme scorecard: axis change since the previous snapshot ────────────────
   Sits beside the 1-5 dots. A move caused by the OTHER 48 themes re-ranking is dimmed and
   tagged "field", because these scores are quintiles across the 49: a theme can lose a
   band with none of its own figures changing. Measured 2026-08-30 -> 09-02, 12 of 63 axis
   changes were the field moving, not the theme. */
.sn-sc-chg { margin-left:8px; font-size:11px; font-weight:600;
  font-variant-numeric:tabular-nums; }
.sn-sc-chg.up { color:var(--sn-pos); }
.sn-sc-chg.dn { color:var(--sn-neg); }
.sn-sc-chg.field { opacity:.55; font-weight:500; }
.sn-sc-chg em { font-style:normal; font-size:8.5px; letter-spacing:.08em;
  text-transform:uppercase; margin-left:3px; opacity:.8; }


/* ─────────────────────────────────────────────────────────────────────────
   8 · TABULAR TOOLTIPS
   A tooltip whose body is a grid of figures rather than a sentence. Newlines
   are preserved and the type is monospace so the columns align; scoped to
   .sn-tip-table so every prose tooltip keeps wrapping in Instrument Sans.
   ───────────────────────────────────────────────────────────────────────── */
.sn-info-tip.sn-tip-table::after {
  width: auto;
  max-width: none;
  white-space: pre;
  font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10.5px;
  line-height: 1.6;
  letter-spacing: 0;
}


/* ─────────────────────────────────────────────────────────────────────────
   9 · VALUATION-LEVEL BANDS
   A third colour role, kept separate from the two in §2: --sn-pos/--sn-neg
   mean a number went up or down, and nothing about this went up. Rich = dear
   against the theme's own history, cheap = the reverse. Aliased onto the same
   desaturated hues, which are already defined for all three themes, so the
   palette does not grow.                                                    */
:root { --sn-val-rich: var(--sn-neg); --sn-val-cheap: var(--sn-pos); }

.sn-sc-band { font-weight: 600; letter-spacing: .01em; }
.sn-sc-band-rich  { color: var(--sn-val-rich); }
.sn-sc-band-cheap { color: var(--sn-val-cheap); }


/* ─────────────────────────────────────────────────────────────────────────
   10 · THEME SCORECARD — RANK STRIP
   Five dots beside a "5" said the same thing twice, and a row of dots is the
   visual grammar of an app-store rating rather than a peer-relative measure.
   The strip carries what the number cannot: position in the 49. #2 fills the
   track, #41 barely starts it, and the two are now distinguishable across the
   card instead of only in the 10px rank text.

   Quintile boundaries are ruled onto the track so the fill still reads as the
   1-5 score, not as a continuous percentage.                                */
.sn-sc-bar {
  position: relative;
  display: block;
  width: 116px;
  height: 5px;
  border-radius: 1px;
  background: var(--sn-row-border);
  overflow: hidden;
}
.sn-sc-bar-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: var(--sn-text-muted);
}
.sn-sc-bar.hi  .sn-sc-bar-fill { background: var(--sn-pos); }
.sn-sc-bar.lo  .sn-sc-bar-fill { background: var(--sn-neg); }
.sn-sc-bar.mid .sn-sc-bar-fill { background: var(--sn-text-muted); }
.sn-sc-bar::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0; bottom: 0;
  background: repeating-linear-gradient(90deg,
    transparent 0 calc(20% - 1px), var(--sn-card-bg) calc(20% - 1px) 20%);
}

/* The tooltip affordance was on all 17 labels at once, which reads as a carpet
   of spelling errors. Definitions stay one hover away everywhere; the dotted
   rule now appears on the label under the cursor, and the four axis NAMES keep
   theirs so the card still advertises that it explains itself. */
.sn-sc-k.sn-info-tip { border-bottom-color: transparent; }
.sn-sc-k.sn-info-tip:hover,
.sn-sc-k.sn-info-tip:focus-visible { border-bottom-color: var(--sn-row-border); }

/* Per-figure standing among the 49 themes. Kept to 22x3px and uncoloured: it is a
   reference mark, not a second reading of the number, and the three colour roles in §2
   are already spoken for. */
.sn-sc-vw  { display: flex; align-items: center; gap: 8px; }
/* Fixed figure column so every track starts on the same x. Ragged tracks, each hanging off
   the end of a different-width number, read as decoration; aligned ones read as a scale. */
.sn-sc-vw .sn-sc-v { min-width: 56px; text-align: right; }
.sn-sc-pct {
  position: relative;
  flex: 0 0 auto;
  width: 24px; height: 4px;
  border-radius: 1px;
  background: var(--sn-row-border);
  cursor: help;
}
.sn-sc-pct i {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: var(--sn-text-muted);
  border-radius: 1px;
}
/* Midpoint rule. Without it the eye has to estimate the fraction; with it, above or below
   the median of the 49 is legible without measuring. */
.sn-sc-pct::after {
  content: "";
  position: absolute;
  left: 50%; top: -1px; bottom: -1px;
  width: 1px;
  background: var(--sn-card-bg);
}

/* The card's own read. Spans both columns above the grid so the eye lands on the two
   axes worth knowing about before it starts scanning sixteen figures. */
.sn-sc-lead {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  gap: 18px;
  padding: 9px 16px 10px;
  border-bottom: 1px solid var(--sn-row-border);
  font-size: 11.5px;
  color: var(--sn-text);
}
.sn-sc-lead em {
  font-style: normal;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--sn-text-label);
  margin-right: 3px;
}
.sn-sc-lead b { font-weight: 600; font-variant-numeric: tabular-nums; }
.sn-sc-lead b.up { color: var(--sn-pos); }
.sn-sc-lead b.dn { color: var(--sn-neg); }
.sn-sc-lead-of { margin-left: auto; font-size: 10px; color: var(--sn-text-label); }

/* The one worded value in a column of figures reads as a stray unless it is built as a
   chip. Tinted from the same two tokens, so it stays legible in all three themes. */
.sn-sc-band {
  padding: 1px 5px;
  border-radius: 2px;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.sn-sc-band       { color: var(--sn-text-muted); background: var(--sn-row-border); }
.sn-sc-band-rich  { color: var(--sn-val-rich);  background: rgba(var(--sn-neg-rgb), .11); }
.sn-sc-band-cheap { color: var(--sn-val-cheap); background: rgba(var(--sn-pos-rgb), .11); }

/* ─────────────────────────────────────────────────────────────────────────
   10 · NATIVE CHROME, FOCUS, AND THE IDENTITY STRIP
   Three corrections found in the 9/2026 product audit. All three are the same
   class of defect: the app styles what it draws itself and leaves what the
   BROWSER draws to chance.                                                  */

/* 10a. color-scheme — the browser's own surfaces follow the theme.
   Without this, dark mode kept light scrollbars (Firefox/Edge), light <select>
   option popups, light date/number spinners, light autofill and a dark caret.
   Everything hand-styled was right and everything native was wrong, which is
   more jarring than a uniformly light app, not less. Grey is a LIGHT theme. */
:root                     { color-scheme: light; }
[data-bs-theme="dark"]    { color-scheme: dark; }
[data-bs-theme="grey"]    { color-scheme: light; }

/* Firefox/standards scrollbars, to match the ::-webkit- ones already styled. */
:root { scrollbar-width: thin; scrollbar-color: var(--sn-scrollbar) transparent; }

/* The context bar sits on navy in ALL themes, so its <select> text is light —
   but the OPTION list renders on its own surface, where light-on-light was
   invisible. That was fixed by forcing white; with color-scheme now correct,
   force the app's own surface tokens instead so the popup is light in light
   and dark in dark rather than a white rectangle in a dark app. */
.sn-ctxbar .sn-ctx-select option,
.sn-ctxbar .sn-ctx-bm-select option { color: var(--sn-text); background: var(--sn-card-bg); }

/* An <optgroup> LABEL is a separate element from the <option>s inside it, so the
   rule above never reached it and it kept inheriting the SELECT's near-white —
   "Broad Market" and "Style & Size" rendered white on the popup's own surface and
   the benchmark list looked like it had two unexplained gaps in it. Same tokens,
   so the labels follow the theme rather than being pinned to one. */
.sn-ctxbar .sn-ctx-select optgroup,
.sn-ctxbar .sn-ctx-bm-select optgroup {
  color: var(--sn-text);
  background: var(--sn-card-bg);
  font-weight: 600;
}

/* 10b. A visible keyboard focus ring, once, for everything.
   :focus-visible appeared 7 times in 11k lines while `outline: none` appeared
   39, and 186 of the 191 pointer-cursor classes had no focus style at all.
   !important is deliberate and load-bearing: the existing suppressions are
   mostly `.some-class:focus { outline: none }` at (0,2,0), which outranks any
   element-level :focus-visible rule this layer could write. :focus-visible
   (not :focus) means mouse users never see a ring. */
:where(a[href], button, select, input, textarea, summary,
       [tabindex]:not([tabindex="-1"]), [role="button"], [role="tab"],
       [onclick]):focus-visible {
  outline: 2px solid var(--sn-teal) !important;
  outline-offset: 1px;
}

/* 10c. One disabled treatment. Ten ad-hoc rules used opacity .35/.4/.5/.6 and
   cursor default/not-allowed; this is the baseline for the ~180 controls that
   declared nothing. Low specificity on purpose — the explicit rules still win. */
:where(button, select, input, textarea, fieldset, [role="button"]):disabled,
:where(button, select, input, textarea, fieldset)[disabled],
.is-disabled { opacity: .45; cursor: not-allowed; }

/* 10d. The identity strip has to fit the screen.
   .port-bar / .etf-bar are flex rows whose every segment was flex-shrink:0
   with nowrap text, so their intrinsic width (1793px measured on /portfolio)
   exceeded every laptop viewport: 88px off-screen at 1710, 359px at 1440,
   519px at 1280 — a page-level horizontal scrollbar with the YTD return
   clipped off the right edge. The descriptive stats give up space first
   (their values ellipsis); the returns, which are the numbers the strip
   exists to show, keep theirs.

   NOTE: the bar must NOT get `overflow: hidden`. An earlier version of this rule put it
   on .port-bar, which clipped the portfolio picker's dropdown: #port-dropdown is
   positioned absolutely inside .port-picker-wrap, so a clip on the bar cut it off at the
   bar's own bottom edge (176px) while the menu ran to 590px, and it read as the menu
   hiding behind the page. Nor can it be split by axis: per the overflow spec, when one
   axis is `visible` and the other is not, the visible one computes to `auto` and clips
   anyway. The fitting is done entirely by the child rules below, which is where the
   ellipsis actually comes from. */
/* Import lives in the context bar beside Search, and borrows that control's shape so
   the two read as one pair of chrome actions rather than two unrelated widgets. */
.sn-ctx-import {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: 1px solid var(--sn-border);
  border-radius: 3px; padding: 3px 8px; margin-right: 10px;
  color: var(--sn-text-muted); font-size: .72rem; line-height: 1.6;
  cursor: pointer; white-space: nowrap;
}
.sn-ctx-import:hover { color: var(--sn-text); border-color: var(--sn-teal); }
@media (max-width: 700px) {
  /* Same trade the bar already makes for .sn-ctx-open: keep the icon, drop the word. */
  .sn-ctx-import-t { display: none; }
}

.port-clf-dims { flex-shrink: 1; min-width: 0; }
.port-bar-stats { flex-shrink: 1; min-width: 0; }
.port-bar-stat  { min-width: 0; }
.port-bar-stat-val { overflow: hidden; text-overflow: ellipsis; }

/* The fund page's header bar: drop, don't crush (2026-11-19). The shrink rule above used
   to cover .etf-bar-stats too, and at a 1440px screen the bar's parts want 1,371px of a
   1,158px row, so the six stat cells were squeezed to ~47px each: labels ran into each
   other ("HOLDINGS" over "NER") and values cut to "4.." and "0.". Same answer as the
   portfolio bar's classification block below: tighter padding, then the least-needed
   items leave whole, widest screens keeping everything. Order: the bps change (it
   repeats the % beside it) and the peer-holding YoY first, then 6M, Beta, Sharpe, the
   expense ratio, 1M and peer %; Holdings, 1Y and YTD always stay. The steps key off the
   BAR's own width (a container query), not the screen's: the sidebar collapses below
   ~1280px, so a 1200px screen gives the bar more room than a 1280px one. Thresholds are
   the measured natural widths (2026-11-19, ARKK): everything 1,241px; each step frees
   61+82, 70, 56, 71, 65, 76, 67px. Under 993px the bar stacks (stratanova.css "ETF Bar
   responsive") and shows everything again. */
.etf-bar-identity { min-width: 0; }
.etf-bar-price-block { padding: 0 14px; }
.etf-bar-stats { flex-shrink: 0; }
.etf-bar-stat { padding: 0 12px; }
.etf-bar-ret { padding: 0 10px; }
.etf-bar-stat-label, .etf-bar-ret-label { white-space: nowrap; }
@media (min-width: 993px) {
  .sn-header-bar.etf-bar { container: etfbar / inline-size; }
}
@container etfbar (max-width: 1244px) { #ehc-change-bps, #ehc-stat-prev-chg-wrap { display: none !important; } }
@container etfbar (max-width: 1101px) { .etf-bar-ret:has(#ehc-ret-6m) { display: none; } }
@container etfbar (max-width: 1031px) { .etf-bar-stat:has(#ehc-stat-beta) { display: none; } }
@container etfbar (max-width: 975px)  { .etf-bar-stat:has(#ehc-stat-sharpe) { display: none; } }
@container etfbar (max-width: 904px)  { .etf-bar-stat:has(#ehc-stat-ner) { display: none; } }
@container etfbar (max-width: 839px)  { .etf-bar-ret:has(#ehc-ret-1m) { display: none; } }
@container etfbar (max-width: 763px)  { #ehc-stat-prev-wrap { display: none !important; } }
.port-bar-sub { flex-shrink: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* The classification block is the wide segment — 797px of the portfolio bar's
   1424px intrinsic width, five dimensions at ~160px each. Letting all five
   shrink together produced the worse defect: two-line labels, values crushed
   to "Conce…", and sub-labels colliding into "P/E20 effective themes".
   So they DROP instead of crushing, least-identifying first (Concentration,
   then Style, then Market Cap). A floor stops the survivors from crushing;
   SNCS, the strategy, and the returns are never hidden, and the dropped
   dimensions all appear in full on the Divergence and classification panels
   further down the page. */
.clf-dim { min-width: 104px; }
@media (max-width: 1699px) { .port-clf-dims .clf-dim:nth-child(5) { display: none; } }
@media (max-width: 1499px) { .port-clf-dims .clf-dim:nth-child(4) { display: none; } }
@media (max-width: 1319px) { .port-clf-dims .clf-dim:nth-child(3) { display: none; } }

/* The ETF page's classification strip is a 4-column grid. `1fr` is
   minmax(AUTO,1fr), and an auto minimum is min-content, so a long strategy
   name pushed the grid past the viewport (99px at 1440). minmax(0,1fr) lets
   the columns actually divide the space they are given. */
.etf-clf-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.etf-clf-dim { min-width: 0; }

/* ─────────────────────────────────────────────────────────────────────────
   11 · LOADING, EMPTY AND FAILED ARE THREE DIFFERENT STATES
   The metrics strip shipped every value as a literal "—", so one glyph meant
   "still loading", "genuinely not available" and "the request failed". After
   the five-attempt retry chain gave up there was no else-branch at all, so
   the dashes simply stayed forever. Now: a shimmer while in flight, an
   explained dash when the number honestly does not exist, and a stated
   failure with a way to retry.

   The shimmer itself is the one already in stratanova.css:8020 (with its
   dark-theme variant) — it had zero usages. This only sizes it, so the
   placeholder occupies exactly the space the number will, and nothing on the
   page moves when the value lands.                                          */
/* No explicit height: the placeholder carries a non-breaking space, so its box
   is a REAL line box in the same font and line-height as the value that will
   replace it. A fixed height (1.2em) was 4px short of the rendered line and
   shifted the strip on every load — the exact defect this is meant to remove. */
.sn-fm-value.is-skel {
  display: block;
  width: 58px;
  border-radius: 3px;
  color: transparent;
}
/* A dash the user can interrogate, rather than a bare glyph. */
.sn-fm-value.is-na { color: var(--sn-text-label); cursor: help; }

.sn-fm-msg {
  grid-column: 1 / -1;
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--sn-text-muted);
  display: flex; align-items: center; gap: 8px;
}
.sn-fm-retry {
  border: 1px solid var(--sn-border); border-radius: 3px;
  background: transparent; color: var(--sn-teal);
  font: inherit; font-weight: 600; padding: 2px 9px; cursor: pointer;
}
.sn-fm-retry:hover { border-color: var(--sn-teal); }

/* ─────────────────────────────────────────────────────────────────────────
   12 · TAB BARS ARE BUTTONS
   The ETF, Company and Theme dashboards built their primary navigation from
   <div onclick>, so those 16 tabs were unreachable by keyboard — the same
   navigation is already a <button> on /portfolio. They are now buttons too.
   .sn-sub-tab already carried the reset (it was written for a button); these
   two were only ever divs, so they need the browser's button chrome removed
   or they render as grey system-styled boxes. Appearance is unchanged from
   the div version; only the element and its keyboard behaviour differ.      */
.co-nav-tab,
.sn-theme-subnav-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-family: inherit;
  text-align: inherit;
  appearance: none;
  -webkit-appearance: none;
}

/* ── 8. PHONE LAYOUT ─────────────────────────────────────────────────────
   The app has a mobile SHELL already — the sidebar goes off-canvas at 768px
   and .sn-mobile-topbar provides the hamburger — but the chrome and the card
   headers between that shell and the content were never reflowed. Measured on
   /portfolio at a 380px viewport: the context bar allots its first item 73px
   for 217px of content, so the portfolio name paints across the benchmark and
   the search button; and the document reports scrollWidth 826 against
   clientWidth 380, so every page also scrolls sideways by 446px.

   Both are layout-only. No colour, type scale or spacing token is touched, so
   the surfaces keep the design system they already have.                    */

@media (max-width: 700px) {
  /* 8a. Context bar — stop children painting over one another.
     A flex child's automatic minimum size is its content, but these carry
     white-space: nowrap and no min-width override, so they shrink below their
     text and the overflow paints across the neighbour rather than clipping.
     Give each one a real minimum of zero and an ellipsis to end on. */
  .sn-ctxbar { gap: 10px; }
  .sn-ctx-item { min-width: 0; overflow: hidden; }
  .sn-ctx-item > * { min-width: 0; }
  .sn-ctx-select,
  .sn-ctx-bm-select,
  .sn-ctx-v {
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  /* The key labels go. At 380px they truncate to "PORTFO" and "BENCHM" and
     spend a third of the bar restating what the values already say: a
     portfolio name and a benchmark ticker are not mistakable for each other.
     The bar is meant to be quiet chrome, and on a phone the quietest version
     of it is the two values alone. */
  .sn-ctxbar .sn-ctx-k { display: none; }

  /* The book is the context that matters most on a phone, so it keeps the
     slack; the benchmark truncates first. */
  /* Roughly 270px is left for both values once the two 40px actions and the
     gaps are taken, and the pair want ~320px, so one of them has to give.
     It is the benchmark: the book's name is the identity of the screen, and
     "VOO – S&P 5…" still reads as VOO where "Ag…" does not read as anything.
     The benchmark takes its natural width up to a third of the bar and only
     shrinks when it would otherwise push the portfolio out. */
  .sn-ctxbar > .sn-ctx-item:first-of-type { flex: 1 1 auto; min-width: 0; }
  /* flex-shrink:0, not 1: shrink is shared in proportion to natural width, and the
     portfolio <select>'s natural width is its longest option, so a 21px "VOO" was
     still being squeezed to "V…" beside it. The 34% cap alone bounds long ones. */
  .sn-ctxbar > .sn-ctx-item:nth-of-type(2) { flex: 0 0 auto; max-width: 34%; }

  /* A keyboard hint on a device with no keyboard is noise, and "Search" beside
     a magnifier is redundant at this width. Icon only, at a finger-sized
     target rather than the 28px pointer target. */
  .sn-ctx-search-t,
  .sn-ctx-search-k,
  .sn-ctx-import-t { display: none; }
  .sn-ctx-search,
  .sn-ctx-import {
    flex: 0 0 auto;
    min-width: 40px;
    min-height: 40px;
    justify-content: center;
    padding: 0 10px;
  }
}

@media (max-width: 900px) {
  /* 8b. Card headers — the source of the sideways scroll.
     Each is a title plus a control cluster (period pills, icon actions) on one
     nowrap row. At phone width the cluster cannot sit beside the title, and
     because nothing wraps it widens the document instead of moving down. */
  .sn-card-header { flex-wrap: wrap; row-gap: 8px; }
  .sn-card-header > .d-flex { flex-wrap: wrap; }

  /* The holdings toolbar is the measured source of the sideways scroll: it
     carries an inline-styled control row 473px wide inside a 330px card. The
     inline style sets display:flex but not flex-wrap, so this still applies. */
  .sn-h-toolbar,
  .sn-h-toolbar > div { flex-wrap: wrap; row-gap: 6px; }

  /* Once the controls wrap they should start at the left edge with their
     siblings rather than keeping the margin-left:auto that pushed them out. */
  .sn-h-toolbar > div { margin-left: 0 !important; }
}


/* ── §9 method notes · what a number is, beside the number ────────────────────
   DESIGN.md §2.6 asks every panel with a vintage to carry an as-of stamp. Some
   panels need the stronger statement: not when the data is from, but what it
   measures. The ETF risk block is the first — it is computed on price returns,
   because ETF_RETURNS_VW is CLOSE/LAG(CLOSE)-1 over a table with no adjusted
   close, so it silently excludes distributions. A reader cannot infer that from
   the numbers, so the surface has to say it.

   Reusable: any surface whose method is not self-evident from its labels. */
.sn-method-note {
  margin-top: 14px;
  padding: 10px 12px;
  border-left: 2px solid var(--sn-border-strong);
  background: var(--sn-hover-bg);
  border-radius: 0 3px 3px 0;
  font-family: 'Instrument Sans', system-ui, sans-serif;
  font-size: 11px;
  line-height: 1.55;
  color: var(--sn-text-muted);
  font-variant-numeric: proportional-nums;   /* prose, not measurements */
}
.sn-method-note strong { font-weight: 600; color: var(--sn-text); }

/* ── §10 demo nav cards · what is behind each rail entry ──────────────────────
   Demo users only (base.html sets data-tip and the sn-has-navtips class). The
   card is rail chrome, not page content, so it takes the sidebar's navy in all
   three themes via --sn-nav-from rather than the page surface tokens. The
   collapsed rail's name-only ::after label is suppressed wherever a card exists,
   or both would show at once. */
:root {
  --sn-navtip-bg: var(--sn-nav-from);
  --sn-navtip-border: rgba(255,255,255,0.12);
  --sn-navtip-title: #ffffff;
  --sn-navtip-body: rgba(255,255,255,0.72);
  --sn-navtip-rule: var(--sn-teal);
}
html.sn-has-navtips .sn-snav-link[data-tip]::after { display: none !important; }
.sn-navtip {
  position: fixed;
  z-index: 2000;
  width: 284px;
  padding: 10px 13px 11px;
  background: var(--sn-navtip-bg);
  border: 1px solid var(--sn-navtip-border);
  border-left: 2px solid var(--sn-navtip-rule);
  border-radius: 3px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.28);
  pointer-events: none;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity .14s ease, transform .14s ease;
  font-family: 'Instrument Sans', system-ui, sans-serif;
}
.sn-navtip.show { opacity: 1; transform: translateX(0); }
.sn-navtip-title {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .01em;
  color: var(--sn-navtip-title);
  margin-bottom: 3px;
}
.sn-navtip-body {
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--sn-navtip-body);
  font-variant-numeric: proportional-nums;   /* prose, not measurements */
}
.sn-navtip-tabs {
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid var(--sn-navtip-border);
}
.sn-navtip-tabs-label {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 9px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.42);
  margin-bottom: 5px;
}
.sn-navtip-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.sn-navtip-chip {
  font-size: 10.5px;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 2px;
  color: rgba(255,255,255,0.86);
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.08);
  white-space: nowrap;
}

/* ── §11 demo guided tour (static/js/sn_tour.js) ──────────────────────────────
   Same chrome as the §10 nav cards: sidebar navy, teal accent, in all three
   themes. No page dimming: the page stays live and readable behind the card,
   and a teal ring marks the element the step is about. Above the demo banner
   (z-index 2000). */
:root {
  --sn-tour-bg: var(--sn-nav-from);
  --sn-tour-border: rgba(255,255,255,0.12);
  --sn-tour-text: #ffffff;
  --sn-tour-muted: rgba(255,255,255,0.72);
  --sn-tour-faint: rgba(255,255,255,0.42);
  --sn-tour-accent: var(--sn-teal);
}
.sn-tour-card {
  position: fixed;
  z-index: 3000;
  width: 340px;
  max-width: calc(100vw - 32px);
  padding: 13px 15px 12px;
  background: var(--sn-tour-bg);
  border: 1px solid var(--sn-tour-border);
  border-top: 2px solid var(--sn-tour-accent);
  border-radius: 3px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.32);
  font-family: 'Instrument Sans', system-ui, sans-serif;
  color: var(--sn-tour-text);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .18s ease, transform .18s ease;
}
.sn-tour-card.show { opacity: 1; transform: translateY(0); }
.sn-tour-card.centered {
  left: 50% !important;
  top: 50% !important;
  transform: translate(-50%, calc(-50% + 4px));
  width: 380px;
}
.sn-tour-card.centered.show { transform: translate(-50%, -50%); }
.sn-tour-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.sn-tour-kicker {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 9.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--sn-tour-faint);
}
.sn-tour-x {
  background: none; border: 0; padding: 0 2px;
  font-size: 17px; line-height: 1;
  color: var(--sn-tour-faint); cursor: pointer;
}
.sn-tour-x:hover { color: var(--sn-tour-text); }
.sn-tour-title { font-size: 15px; font-weight: 600; letter-spacing: .005em; margin-bottom: 5px; }
.sn-tour-body {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--sn-tour-muted);
  font-variant-numeric: proportional-nums;   /* prose, not measurements */
}
.sn-tour-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.sn-tour-dots { display: flex; gap: 5px; }
.sn-tour-dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,0.18); }
.sn-tour-dot.past { background: rgba(255,255,255,0.45); }
.sn-tour-dot.on { background: var(--sn-tour-accent); }
.sn-tour-btns { display: flex; gap: 6px; }
.sn-tour-btn {
  font: 600 12px 'Instrument Sans', system-ui, sans-serif;
  padding: 5px 12px;
  border-radius: 3px;
  border: 1px solid rgba(255,255,255,0.18);
  background: transparent;
  color: var(--sn-tour-muted);
  cursor: pointer;
}
.sn-tour-btn:hover { color: var(--sn-tour-text); border-color: rgba(255,255,255,0.32); }
.sn-tour-btn.primary { background: var(--sn-tour-accent); border-color: var(--sn-tour-accent); color: #fff; }
.sn-tour-btn.primary:hover { filter: brightness(1.08); }
.sn-tour-ring {
  position: fixed;
  z-index: 2999;
  pointer-events: none;
  border: 2px solid var(--sn-tour-accent);
  border-radius: 4px;
  box-shadow: 0 0 0 4px rgba(27,154,170,0.18);
  transition: top .15s ease, left .15s ease, width .15s ease, height .15s ease;
}
.sn-tour-pill {
  position: fixed;
  z-index: 3000;
  right: 24px;
  bottom: 24px;
  display: flex;
  align-items: stretch;
  background: var(--sn-tour-bg);
  border: 1px solid var(--sn-tour-border);
  border-left: 2px solid var(--sn-tour-accent);
  border-radius: 3px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.28);
}
.sn-tour-pill button {
  background: none; border: 0; cursor: pointer;
  font: 600 12px 'Instrument Sans', system-ui, sans-serif;
  color: var(--sn-tour-muted);
}
.sn-tour-pill-go { padding: 8px 12px; }
.sn-tour-pill-x { padding: 8px 10px; border-left: 1px solid var(--sn-tour-border) !important; }
.sn-tour-pill button:hover { color: var(--sn-tour-text); }
@media (max-width: 768px) {
  .sn-tour-card, .sn-tour-card.centered { width: calc(100vw - 32px); }
  .sn-tour-pill { right: 16px; bottom: 16px; }
}

/* ── §12 app tooltip (base.html) ──────────────────────────────────────────────
   One tooltip for the whole app: [data-sn-tip], plus title="" inside any
   .sn-tip-scope. Same chrome as the §10 nav cards so every hover explanation
   reads as one system. Fixed on <body> above everything (the demo banner is
   2000, the tour 3000), so no sticky header or scrolling table can bury it. */
:root {
  --sn-tip-bg: var(--sn-nav-from);
  --sn-tip-text: rgba(255,255,255,0.9);
  --sn-tip-border: rgba(255,255,255,0.12);
}
.sn-tip {
  position: fixed;
  z-index: 4000;
  top: 0; left: 0;
  max-width: 280px;
  padding: 7px 10px 8px;
  background: var(--sn-tip-bg);
  color: var(--sn-tip-text);
  border: 1px solid var(--sn-tip-border);
  border-radius: 3px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.22);
  font-family: 'Instrument Sans', system-ui, sans-serif;
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0;
  text-transform: none;
  text-align: left;
  white-space: normal;
  font-variant-numeric: proportional-nums;
  pointer-events: none;
  opacity: 0;
  transition: opacity .12s ease;
}
.sn-tip.show { opacity: 1; }
/* headers that explain themselves on hover say so, quietly */
[data-sn-tip].sn-tip-hint, .sn-tip-scope th[title], .sn-tip-scope th[data-sn-tip] { cursor: help; }

/* ── Tablet widths (28 Sep 2026: "it looks terrible on iPad") ───────────────
   iPads get the desktop site (they send a Mac user agent, and have the room). At
   iPad widths the context bar ran its labels into each other: the picker's arrow
   sat on the benchmark name and the search button wrapped its shortcut hint.
   The sidebar starts as the icon rail below 1280px (base.html head script). */
@media (hover: none) {
  .sn-ctx-search-k { display: none; }          /* no keyboard shortcut on a touch screen */
}
@media (max-width: 1024px) {
  .sn-ctxbar .sn-ctx-k,
  .sn-ctxbar .sn-ctx-open,
  .sn-ctx-search-k { display: none; }
  .sn-ctxbar .sn-ctx-bm-select { max-width: 150px; }
  .sn-ctxbar .sn-ctx-select { max-width: 170px; }
}

/* ── Wide tables (static/js/sn_tables.js) ──────────────────────────────────
   Sized to their content instead of squashed into the box; when wider than the box
   they scroll sideways inside it, header row and first column frozen (a leading "#"
   column freezes with the one after it). Frozen cells need an opaque background. */
table.sn-tfrozen { width: max-content !important; min-width: 100%; table-layout: auto !important; }
table.sn-tfrozen > thead th { white-space: nowrap; }
.sn-tscroll { overflow: auto; max-height: calc(100vh - 200px); }
.sn-tscroll-box { -webkit-overflow-scrolling: touch;
  /* Its width comes from its container, never from the table inside: without this a
     grid/flex ancestor grew to the table's width and pushed the page sideways instead of
     letting the box scroll (Peer Benchmark flows, fund profile peers). */
  contain: inline-size; max-width: 100%; }
/* !important: sortable headers carry an inline position:relative for their arrow */
table.sn-tfrozen > thead th { position: sticky !important; top: 0; z-index: 2; background: var(--sn-card-bg); }
table.sn-tfrozen .sn-tf-c0,
table.sn-tfrozen .sn-tf-c1 { position: sticky !important; left: 0; z-index: 1; background: var(--sn-card-bg); }
table.sn-tfrozen > thead .sn-tf-c0,
table.sn-tfrozen > thead .sn-tf-c1 { z-index: 3; }
table.sn-tfrozen:not(.sn-tfrozen-2) .sn-tf-c0,
table.sn-tfrozen.sn-tfrozen-2 .sn-tf-c1 { box-shadow: inset -1px 0 0 var(--sn-border); }
table.sn-tfrozen > tbody > tr:hover > .sn-tf-c0,
table.sn-tfrozen > tbody > tr:hover > .sn-tf-c1 { background: var(--sn-hover-bg); }   /* solid in all three themes */

/* ── Portfolio header strip between tablet and wide desktop ────────────────
   The strip is one fixed 72px row down to 993px (below that it stacks). From ~1,440px
   down, picker + holdings + score + strategy + returns no longer fit on one line and
   ran into each other (28 Sep review). In that band it wraps: the book and its stats
   on the first line, the period returns on a second. */
@media (min-width: 993px) and (max-width: 1440px) {
  .port-bar { height: auto; flex-wrap: wrap; row-gap: 0; padding: 10px 0 0; }
  .port-bar-stat-label { white-space: nowrap; }
  .port-bar-stat-val { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
  .port-bar-returns { order: 10; flex: 1 1 100%; justify-content: flex-start;
                      margin-top: 10px; padding: 8px 20px; border-top: 1px solid var(--sn-border); }
  .port-bar-ret:first-child { padding-left: 0; }
}

/* Theme header bar: the same mid-width wrap as the portfolio strip (it pushed its
   bookmark/details buttons ~290px off-screen at iPad widths). */
@media (min-width: 993px) and (max-width: 1440px) {
  .sn-thb.theme-bar { height: auto; flex-wrap: wrap; padding: 10px 0 0; }
  .theme-bar-returns { order: 10; flex: 1 1 100%; justify-content: flex-start;
                       margin-top: 10px; padding: 8px 20px; border-top: 1px solid var(--sn-border); }
  .theme-bar-actions { margin-left: auto; }
}
/* Page tab rows scroll sideways instead of spilling past the card (portfolio: 8 tabs). */
.sn-sub-tabs { overflow-x: auto; scrollbar-width: none; }
.sn-sub-tabs::-webkit-scrollbar { display: none; }
.sn-sub-tab { flex-shrink: 0; }

/* Theme page Scores card: its 2x2 axis grid does not fit the side column below
   ~1,440px (Quality and Valuation ran off the card at iPad/laptop widths). Stack it. */
.sn-sc-grid > * { min-width: 0; }
@media (max-width: 1440px) {
  .sn-sc-grid { grid-template-columns: minmax(0, 1fr); }
  .sn-sc-grid .sn-sc-axis { border-right: 0; }
  .sn-sc-lead { flex-wrap: wrap; }
}

.sn-tscroll-cap { max-height: calc(100dvh - 150px); overflow: auto; }

/* ── Tablet audit, 28 Sep 2026 (stratanova-tablet-audit.md) ─────────────────
   Page-level reflow for iPad and small-laptop widths. Each rule names its page. */

/* Stock screener header bar: the portfolio/theme strip treatment (272px off-screen at
   1024 landscape). */
@media (min-width: 993px) and (max-width: 1440px) {
  .co-header-bar { height: auto !important; flex-wrap: wrap; padding: 10px 0 0 !important; }
  .co-bar-returns { order: 10; flex: 1 1 100% !important; justify-content: flex-start !important;
                    margin-top: 10px; padding: 8px 20px !important; border-top: 1px solid var(--sn-border); }
  .co-bar-actions { margin-left: auto; }
}
/* Company Profile: one column until the two-panel grid has room (chart period buttons,
   peer table and revenue labels were cut in the right panel). */
@media (max-width: 1180px) {
  .co-row-7-5 { grid-template-columns: minmax(0, 1fr) !important; }
  .co-row-7-5:first-of-type { height: auto !important; }
  .co-row-7-5 > * { min-height: 320px; }
}
/* Strata Score pillar cards (stock and fund): 2x2 below 1180px, not four squeezed. */
@media (max-width: 1180px) {
  .sncs-pillars.four, .etfsncs-pillars.four { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
/* Portfolio Compare: side-by-side columns keep a readable width and scroll sideways
   (the second portfolio was clipped off the page). */
@media (max-width: 1180px) {
  .sn-cmp-grid-2, .sn-cmp-grid-3, .sn-cmp-grid-4 {
    grid-template-columns: none !important; grid-auto-flow: column;
    grid-auto-columns: minmax(320px, 1fr); overflow-x: auto; scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch; padding-bottom: 6px;
  }
  .sn-cmp-grid-2 > *, .sn-cmp-grid-3 > *, .sn-cmp-grid-4 > * { scroll-snap-align: start; min-width: 0; }
  /* The column title cards are sticky on desktop; inside a sideways-scrolling row they
     would pin to the row, not the page, and sat on top of the KPI cards. */
  .sn-cmp-grid .sn-cmp-col-header { position: static !important; top: auto !important; }
}
/* Divergence heat map: the theme column gets room for its name (it overprinted the
   heat cells); the table then scrolls inside its box (sn_tables.js). */
.sn-cmp-heat-theme-cell { min-width: 230px; }
table:has(.sn-cmp-heat-theme-cell) { table-layout: auto !important; }
/* Peer Benchmark: over/underweight cards one per row below 1024px; the percentile label
   stays on one line inside its card. */
@media (max-width: 1024px) {
  .pb-three-col { grid-template-columns: minmax(0, 1fr) !important; }
}
.pb-ow-pct-label { white-space: nowrap; }
/* Peer Intelligence KPI strip: as many per row as fit (5 up clipped "Diversified"). */
@media (max-width: 1180px) {
  .pi-kpi-strip-5 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important; }
}
/* Thematic Brief: page gutters (the title sat against the sidebar, the date against the
   screen edge) and a masthead that wraps. */
@media (max-width: 1480px) {
  .tb-wrap { padding-left: 24px !important; padding-right: 24px !important; }
  .tb-masthead { flex-wrap: wrap; row-gap: 6px; }
}
/* Portfolio > Lookthrough: the filter toolbar wraps instead of running off the card. */
.sn-te-toolbar { flex-wrap: wrap; row-gap: 8px; }

/* Touch screens: controls at least 40px tall (the audit found 14-23px targets). */
@media (pointer: coarse) {
  .sn-ctx-select, .sn-ctx-bm-select, .sn-ctx-search, .sn-ctx-open,
  .sn-sub-tab, .co-nav-tab, .sn-time-btn, .sn-te-select { min-height: 40px; }
  .sn-ctx-select, .sn-ctx-bm-select { font-size: 13px; }
}

/* A card holding a scrolling table may shrink below the table's width (as a grid or flex
   item its min-width is its content by default, which pushed Peer Benchmark's Most
   Adopted / Most Exited cards 390px past the screen instead of letting them scroll). */
:where(.card, .sn-card):has(> .sn-tscroll-box, > div > .sn-tscroll-box) { min-width: 0; }
.pb-two-col > *, .pb-three-col > * { min-width: 0; }
@media (max-width: 1024px) {
  .pb-two-col { grid-template-columns: minmax(0, 1fr) !important; }
}

/* Chart period pill rows (1M 6M 1Y 2Y 3Y YTD) scroll sideways when their card is narrow
   instead of clipping the last buttons (fund profile at 1024 landscape). */
.sn-pill-group { overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.sn-pill-group::-webkit-scrollbar { display: none; }
.sn-pill-group > * { flex-shrink: 0; }

/* ── §13 theme axis scores are positions, not grades (17 Oct 2026) ──────────────
   The four 1-5 theme scores (momentum, quality, sentiment, valuation) are quintiles across
   the themes: where a theme SITS, not whether it is good. They were painted green at 4-5
   and red at 1-2, which graded them, borrowed --sn-pos/--sn-neg (P&L direction only,
   DESIGN.md §2.3), and called a cheap valuation "good". The 17 Oct backtest
   (Snowflake Feed/ThemeAxisBacktest) found no forward-return signal in valuation or
   quality, so there is nothing to grade them with. One neutral fill on every axis; moves
   keep their +/- sign and lose the colour. The valuation band chips keep their own
   --sn-val-cheap / --sn-val-rich tokens: those say which END of its own range a theme is
   at, which the word alone does not. JS still emits hi/mid/lo/up/dn; this layer owns how
   they look, so removing this block restores the old colours. */
.sn-dot5.on.hi, .sn-dot5.on.mid, .sn-dot5.on.lo,
[data-bs-theme] .sn-dot5.on.hi, [data-bs-theme] .sn-dot5.on.mid,
[data-bs-theme] .sn-dot5.on.lo { background: var(--sn-text-muted); }
.sn-sc-bar.hi .sn-sc-bar-fill, .sn-sc-bar.mid .sn-sc-bar-fill,
.sn-sc-bar.lo .sn-sc-bar-fill { background: var(--sn-text-muted); }
.sn-dot5-chg.up, .sn-dot5-chg.dn,
.sn-sc-chg.up, .sn-sc-chg.dn,
.sn-sc-lead b.up, .sn-sc-lead b.dn { color: var(--sn-text); }

/* Lite plan (routes/billing.py): lock on full-platform rail entries. Muted, not teal —
   it marks state, not an affordance. Hidden on the collapsed rail like the NEW badge. */
.sn-snav-lock { margin-left: auto; font-size: 10px; color: var(--sn-text-muted); opacity: .7; }
html.sn-sidebar-collapsed .sn-snav-lock { display: none; }

/* ── §14 Impact, by business line (19 Nov 2026) ──────────────────────────────
   Built on the house components: sn-table (headers, rows, signed colours, tabular
   figures), the sn-ta-theme-cell name + sub-label from the theme table, and the sn-fm
   metrics strip. These rules only add what those lack: the group rows, the drill, the
   cells that may wrap, and the strip's four-item grid. #impu, portfolio_dashboard.js _impU*. */
/* Headers and row hover as on the theme table (#theme-table, stratanova.css): the grey
   header band, 9.5px semibold, sticky. The generic .sn-table header is card-white. */
#impu .sn-table thead th {
  font-size: 9.5px; font-weight: 600; letter-spacing: 0.07em; background: var(--sn-hover-bg);
  box-shadow: 0 1px 0 var(--sn-border-med); border-bottom: none;
}
#impu #impu-tbl thead th { position: sticky; top: 0; z-index: 2; }
#impu #impu-tbl tbody tr.impu-tr:hover > td { background: rgba(90,154,171,0.07); }
[data-bs-theme="dark"] #impu #impu-tbl tbody tr.impu-tr:hover > td { background: rgba(90,154,171,0.12); }
[data-bs-theme="grey"] #impu #impu-tbl tbody tr.impu-tr:hover > td { background: rgba(90,154,171,0.09); }
#impu .impu-say { font-size: 13px; line-height: 1.55; color: var(--sn-text); margin: 0; padding: 10px 14px 10px; max-width: 120ch; }
#impu .impu-say b { font-weight: 600; }
#impu .impu-strip { margin-top: 0; }
#impu .impu-strip .sn-fm-strip-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
#impu .impu-strip .sn-fm-label { font-size: 9px; }
#impu .impu-strip .sn-fm-value { font-size: 15px; }
#impu .sn-table tbody td.impu-wrap { white-space: normal; }
#impu .sn-table tbody td.impu-hold { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#impu .impu-nm { font-weight: 500; color: var(--sn-text); }
#impu .impu-rep { color: var(--sn-text-muted); }
#impu .impu-tr { cursor: pointer; }
#impu .impu-tr.open > td { background: var(--sn-hover-bg); }
#impu .impu-tr:focus-visible { outline: 2px solid var(--sn-teal); outline-offset: -2px; }
#impu .impu-chev { font-size: 10px; color: var(--sn-text-label); }
/* Section rows: a shaded band so they read as breaks, not as data rows. The page ground
   (--sn-bg) is a step deeper than the column header's --sn-hover-bg, so the two never merge. */
#impu .impu-grp-tr > td {
  padding: 0.45rem 0.6rem; font-size: 0.655rem; font-weight: 600; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--sn-text); background: var(--sn-bg);
  border-top: 1px solid var(--sn-border-med); border-bottom: 1px solid var(--sn-border-med);
}
#impu .impu-grp-tr:hover > td { background: var(--sn-bg); }
#impu .impu-grp-tr > td span { margin-left: 10px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--sn-text-label); font-size: 0.72rem; }
#impu .impu-more-tr > td { padding: 0.35rem 0.6rem; }
#impu .impu-drill-tr > td { background: var(--sn-hover-bg); padding: 0 0.6rem 0.8rem; white-space: normal; }
#impu .impu-why { font-size: 12px; line-height: 1.55; color: var(--sn-text); margin: 8px 0 8px; max-width: 120ch; }
#impu .impu-drill-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
#impu .impu-sub-tbl { table-layout: fixed; width: 100%; background: var(--sn-card-bg); }
#impu .impu-sub-tbl td { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#impu .impu-sub-tbl td.impu-wrap { white-space: normal; }
#impu .impu-how { color: var(--sn-text-muted); }
#impu .impu-tk { font-weight: 500; }
#impu .impu-dnote { font-size: 11px; color: var(--sn-text-label); padding: 6px 0.6rem; }
#impu .impu-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 10px 14px; border-top: 1px solid var(--sn-row-border); }
#impu .impu-tools-k { font-size: 0.655rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--sn-text-muted); }
#impu .impu-how { border-top: 1px solid var(--sn-row-border); }
/* Scenario builder (#impu-builder): house form controls and a house sub-table. */
#impu .impu-builder { border-bottom: 1px solid var(--sn-border-med); background: var(--sn-hover-bg); padding: 10px 14px 12px; }
#impu .impu-b-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 8px; }
#impu .impu-b-name { max-width: 360px; }
#impu .impu-b-actions { margin-left: auto; display: flex; gap: 6px; }
#impu .impu-b-add { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-bottom: 8px; }
#impu .impu-b-search { position: relative; flex: 1 1 340px; max-width: 460px; }
#impu .impu-b-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 2px); z-index: 20; max-height: 300px; overflow-y: auto;
  background: var(--sn-card-bg); border: 1px solid var(--sn-border-med); border-radius: 3px;
}
#impu .impu-b-hit {
  display: flex; width: 100%; align-items: baseline; gap: 6px; text-align: left; background: none; border: none;
  padding: 5px 10px; font-size: 12px; color: var(--sn-text); cursor: pointer;
}
#impu .impu-b-hit:hover { background: var(--sn-hover-bg); }
#impu .impu-b-hit-s { margin-left: auto; font-size: 10.5px; color: var(--sn-text-label); }
#impu .impu-b-at { font-size: 11.5px; color: var(--sn-text-muted); }
#impu .impu-b-in { width: 72px; text-align: right; display: inline-block; padding: 1px 6px; height: auto; font-size: 12px; }
#impu .impu-b-tbl td { vertical-align: middle; overflow: visible; text-overflow: clip; }
#impu .impu-mut2 { color: var(--sn-text-muted); }
#impu .impu-b-tbl td.impu-mut2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#impu .impu-b-x { background: none; border: none; color: var(--sn-text-label); font-size: 15px; line-height: 1; padding: 0 4px; cursor: pointer; }
#impu .impu-b-x:hover { color: var(--sn-neg); }
#impu .impu-b-start { width: auto; max-width: 280px; }
#impu .impu-b-grid { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.6fr); gap: 16px; align-items: start; }
#impu .impu-bb { max-height: 360px; overflow-y: auto; border: 1px solid var(--sn-border-med); border-radius: 3px; background: var(--sn-card-bg); }
#impu .impu-bb thead th { position: sticky; top: 0; z-index: 1; }
#impu .impu-bb-th > td { font-weight: 500; }
#impu .impu-bb-tog { background: none; border: none; padding: 0; color: var(--sn-text); font-weight: 500; font-size: 12px; cursor: pointer; }
#impu .impu-bb-tog i { font-size: 9px; color: var(--sn-text-label); margin-right: 2px; }
#impu .impu-bb-n { margin-left: 6px; font-size: 10.5px; color: var(--sn-text-label); font-weight: 400; }
#impu .impu-bb-ln > td:first-child { padding-left: 1.6rem; color: var(--sn-text-muted); }
#impu .impu-bb-add { padding: 0 8px; font-size: 11px; }
#impu .impu-b-empty { font-size: 12px; color: var(--sn-text-muted); line-height: 1.55; padding: 10px 12px; border: 1px dashed var(--sn-border-med); border-radius: 3px; background: var(--sn-card-bg); }
#impu .impu-b-total { display: flex; flex-wrap: wrap; gap: 6px 22px; padding: 8px 2px 0; font-size: 12px; color: var(--sn-text-muted); }
#impu .impu-b-total b { font-weight: 600; color: var(--sn-text); margin-left: 4px; }
#impu .impu-b-total b.sn-neg { color: var(--sn-neg); }
#impu .impu-b-total b.sn-pos { color: var(--sn-pos); }
#impu .impu-b-most { color: var(--sn-text); }
@media (max-width: 720px) {
  #impu .impu-b-grid { grid-template-columns: minmax(0, 1fr); }
  #impu .impu-strip .sn-fm-strip-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #impu .impu-drill-grid { grid-template-columns: minmax(0, 1fr); }
}
/* The holdings note under a theme scenario states how concentrated the exposure is. It is a fact
   about the book, not a loss, so it loses the loss wash it carried in favourable scenarios too. */
#tab-impact .sl-note { background: var(--sl-surface-3); border-radius: 3px; }
/* Portfolio tab: revenue growth back to normal (#lg-card), moved off Impact 19 Nov 2026.
   Figures are growth rates, not P&L, so no pos/neg colour; the bars are a neutral quantity. */
.sn-lg-asof { font-size: 11px; color: var(--sn-text-muted); }
.sn-lg-body { padding: 4px 16px 10px; }
.sn-lg-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid var(--sn-row-border); margin-bottom: 4px; }
.sn-lg-tiles > div { padding: 10px 14px 10px 0; }
.sn-lg-tiles > div + div { padding-left: 14px; border-left: 1px solid var(--sn-row-border); }
.sn-lg-tiles .k { font-size: 11px; color: var(--sn-text-muted); }
.sn-lg-tiles .v { font-family: 'IBM Plex Mono', monospace; font-size: 22px; font-weight: 500; color: var(--sn-text); margin-top: 2px; }
.sn-lg-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 2fr) 44px; gap: 12px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--sn-row-border); font-size: 12.5px; color: var(--sn-text); }
.sn-lg-head { font-size: 11px; color: var(--sn-text-muted); }
.sn-lg-line { font-weight: 600; }
.sn-lg-num { font-family: 'IBM Plex Mono', monospace; text-align: right; }
.sn-lg-head .sn-lg-num { font-family: inherit; }
.sn-lg-bar { display: block; height: 7px; background: var(--sn-row-border); border-radius: 2px; }
.sn-lg-bar i { display: block; height: 7px; background: var(--sn-text-muted); border-radius: 2px; }
.sn-lg-say { font-size: 11.5px; color: var(--sn-text-muted); margin: 10px 0 2px; }
@media (max-width: 720px) {
  .sn-lg-tiles { grid-template-columns: minmax(0, 1fr); }
  .sn-lg-tiles > div + div { padding-left: 0; border-left: none; border-top: 1px solid var(--sn-row-border); }
  .sn-lg-row { grid-template-columns: minmax(0, 1fr) auto; }
  .sn-lg-row > span:nth-child(3), .sn-lg-row > span:nth-child(4) { display: none; }
}
/* ── §15 the public sample (routes/trial.py /try/sample, 19 Nov 2026) ─────────────────
   One strip above the app on every sample page: what this is and the way to a trial.
   Chrome, not data, so one colour in all three themes (the demo-banner teal of the trial
   spec). Taller than the old demo bar so its button meets the 44px target; the context
   bar's sticky offset follows. Bottom card on the portfolio page and the header actions
   are templates/portfolio/dashboard.html; the prompt they open is templates/try/_gate.html. */
:root { --sn-sample-bar: #2e6573; --sn-sample-bar-on: #ffffff; --sn-sample-bar-mute: #cfe3e8; }
.sn-sample-bar { position: sticky; top: 0; z-index: 2000; display: flex; align-items: center;
  justify-content: center; gap: 14px; min-height: 48px; padding: 2px 16px; flex-wrap: wrap;
  background: var(--sn-sample-bar); color: var(--sn-sample-bar-on); font-size: 14px; }
.sn-sample-bar-t { font-weight: 500; }
.sn-sample-bar a.sn-sample-bar-btn, .sn-sample-bar a.sn-sample-bar-btn:visited {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px;
  border: 1px solid rgba(255,255,255,.7); border-radius: 3px;
  /* !important: the app's themed link colour outranks this selector, and the strip is one
     colour in every theme by design */
  color: var(--sn-sample-bar-on) !important; font-weight: 600; text-decoration: none; }
.sn-sample-bar a.sn-sample-bar-btn:hover { background: rgba(255,255,255,.12); color: var(--sn-sample-bar-on) !important; }
.sn-sample-bar-n { color: var(--sn-sample-bar-mute); font-size: 13px; }
.sn-sample-narrow { display: none; }
.sn-has-sample .sn-ctxbar { top: var(--sn-sample-h, 48px); }   /* the tour sets the strip's real height */
@media (max-width: 640px) {
  .sn-sample-wide { display: none; }
  .sn-sample-narrow { display: inline; }
  .sn-sample-bar { gap: 10px; }
}
.sn-sample-tag { display: inline-block; font-size: 10.5px; font-weight: 600; letter-spacing: .08em;
  padding: 2px 6px; border-radius: 3px; background: #e8a020; color: #14223a; vertical-align: middle; }
.sn-sample-acts { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: space-between;
  margin-top: 14px; padding: 10px 14px; background: var(--sn-card-bg); border: 1px solid var(--sn-border); border-radius: 3px; }
.sn-sample-acts-t { font-size: 13px; color: var(--sn-text-muted); display: flex; align-items: center; gap: 10px; }
.sn-sample-acts-t b { color: var(--sn-text); font-size: 14px; font-weight: 600; }
.sn-sample-cta { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 20px 22px; background: var(--sn-card-bg); border: 1px solid var(--sn-teal); border-radius: 3px; }
.sn-sample-cta b { display: block; font-size: 16px; font-weight: 600; color: var(--sn-text); margin-bottom: 4px; }
.sn-sample-cta span { font-size: 14px; color: var(--sn-text-muted); }
.sn-sample-cta a.sn-sample-cta-btn, .sn-sample-cta a.sn-sample-cta-btn:visited { display: inline-flex; align-items: center;
  min-height: 44px; padding: 0 20px; border-radius: 3px; background: var(--sn-teal); color: #fff; font-weight: 600;
  font-size: 14px; text-decoration: none; }
.sn-sample-cta a.sn-sample-cta-btn:hover { color: #fff; filter: brightness(1.08); }
/* the guided tour in the sample strip (templates/try/_tour.html): step count, one sentence,
   one solid button so the next step is the obvious thing on the screen */
.sn-sample-bar.sn-tour-on { justify-content: space-between; gap: 16px; padding: 4px 20px; }
.sn-sample-bar.sn-tour-on .sn-sample-bar-t { flex: 1 1 420px; min-width: 0; line-height: 1.35; }
.sn-tour-n { display: inline-block; margin-right: 10px; padding: 2px 8px; border-radius: 3px;
  background: rgba(255,255,255,.16); font-size: 11.5px; font-weight: 600; letter-spacing: .04em; white-space: nowrap; }
/* during the tour "See yours" is the strip's outlined (secondary) button: the panel's Next is
   the only filled button on the screen (polish notes 2026-11-19) */
.sn-sample-bar.sn-tour-on a.sn-sample-bar-btn, .sn-sample-bar.sn-tour-on a.sn-sample-bar-btn:visited { white-space: nowrap; }
/* one layer of "sample" messaging during the tour: the strip says it; the sample's own label
   row and its bottom card's filled button step back (both are the sample's chrome, not the page) */
body.sn-touring .sn-sample-acts { display: none; }
body.sn-touring .sn-sample-cta a.sn-sample-cta-btn, body.sn-touring .sn-sample-cta a.sn-sample-cta-btn:visited {
  background: transparent; border: 1px solid var(--sn-teal); color: var(--sn-teal); }
body.sn-touring .sn-sample-cta a.sn-sample-cta-btn:hover { color: var(--sn-teal); background: var(--sn-hover-bg); filter: none; }
.sn-tour-skip { display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px; border: 0; background: none; color: var(--sn-sample-bar-mute);
  font-size: 13px; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.sn-tour-skip:hover { color: #ffffff; }
/* Exit tour is a link (it leaves at once): the site's link colours must not reach it, and it must read at a glance */
#sn-sample-bar a.sn-tour-skip, #sn-sample-bar a.sn-tour-skip:visited { color: rgba(255, 255, 255, 0.86); font-weight: 500; }
#sn-sample-bar a.sn-tour-skip:hover, #sn-sample-bar a.sn-tour-skip:focus-visible { color: #ffffff; }
#sn-sample-bar a.sn-tour-skip[hidden] { display: none; }
/* the tour's step panel (templates/try/_tour.html card): floats bottom right, over the page
   rather than in it, so the page stays as it is (Jack, 2026-11-19: the full-width teal card
   at the top was "really ugly" and repeated the strip). A light card with the tour's teal as
   its top edge and label, so it reads as the tour talking. It is an overlay, so unlike the
   app's cards it is lifted off the page with a shadow. Minimises to a pill. */
:root, [data-bs-theme="grey"] { --sn-tour-ink: #2e6573; }
[data-bs-theme="dark"] { --sn-tour-ink: #8cc5d2; }
.sn-tp { position: fixed; right: 20px; bottom: 20px; z-index: 1950; width: 360px; max-width: calc(100vw - 32px);
  background: var(--sn-card-bg); color: var(--sn-text); border: 1px solid rgba(46,101,115,.45);
  border-top: 4px solid var(--sn-sample-bar); border-radius: 4px;
  opacity: 0; transition: opacity .15s ease-out;
  /* white on a white page: a soft shadow vanished (Jack, 2026-11-19), so this one is deep */
  box-shadow: 0 22px 50px -6px rgba(15,23,42,.38), 0 6px 16px rgba(15,23,42,.18), 0 0 0 4px rgba(46,101,115,.08); }
[data-bs-theme="dark"] .sn-tp { border-color: rgba(140,197,210,.45); border-top-color: var(--sn-tour-ink);
  box-shadow: 0 22px 50px -6px rgba(0,0,0,.75), 0 6px 16px rgba(0,0,0,.5); }
.sn-tp.on { opacity: 1; }
.sn-tp-body { padding: 8px 16px 12px; max-height: calc(100vh - 140px); overflow-y: auto; }
.sn-tp-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: -2px -8px 2px 0; }
.sn-tp-k { font-size: 12px; font-weight: 600; color: var(--sn-tour-ink); }
/* "Hide ⌄": a word, so it reads as hiding the panel (polish notes: the bare dash didn't) */
.sn-tp-min { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 0 8px; border: 0;
  background: none; color: var(--sn-text-muted); font-size: 12.5px; border-radius: 3px; cursor: pointer; }
.sn-tp-min:hover { color: var(--sn-text); background: var(--sn-hover-bg); }
.sn-tp-prog { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; margin: 0 0 10px; }  /* one bar per step, however many */
/* the panel's way out, beside Hide (Jack, 2026-11-20: "no easy way to get out of it") */
.sn-tp-acts { display: inline-flex; align-items: center; gap: 2px; }
.sn-tp-exit { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; min-height: 36px; padding: 0 8px;
  color: var(--sn-text-muted); font-size: 12.5px; border-radius: 3px; text-decoration: none; }
.sn-tp-exit:hover, .sn-tp-exit:focus-visible { color: var(--sn-text); background: var(--sn-hover-bg); }
.sn-tp-prog i { display: block; height: 3px; border-radius: 2px; background: var(--sn-border); }
.sn-tp-prog i.on { background: var(--sn-sample-bar); }
[data-bs-theme="dark"] .sn-tp-prog i.on { background: var(--sn-tour-ink); }
.sn-tp-h { font-size: 16px; font-weight: 600; line-height: 1.3; color: var(--sn-text); margin: 0 0 8px; }
.sn-tp-l { margin: 0; padding: 0 0 0 18px; display: grid; gap: 6px; }
.sn-tp-l li { font-size: 14px; line-height: 1.5; color: var(--sn-text); }
.sn-tp-l li::marker { color: var(--sn-text-muted); }
/* a line about something in the spotlight: teal marker; a click brings it into view */
.sn-tp-l li.has-t { cursor: pointer; border-radius: 3px; margin-left: -4px; padding-left: 4px; }
.sn-tp-l li.has-t::marker { color: var(--sn-tour-ink); }
.sn-tp-l li.has-t:hover { background: var(--sn-hover-bg); }
/* while the step's figures load: grey bars where the lines will be */
.sn-tp-sk { display: grid; gap: 10px; padding: 4px 0 2px; }
.sn-tp-sk i { display: block; height: 12px; border-radius: 3px; background: var(--sn-border);
  animation: sn-tp-sk 1.2s ease-in-out infinite alternate; }
.sn-tp-sk i:nth-child(2) { width: 88%; }
.sn-tp-sk i:nth-child(3) { width: 64%; }
@keyframes sn-tp-sk { from { opacity: .45; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sn-tp-sk i { animation: none; } .sn-tp, .sn-spot { transition: none; } }
.sn-tp b { font-weight: 600; }
.sn-tp .sn-tx-neg { color: var(--sn-neg); }
.sn-tp .sn-tx-pos { color: var(--sn-pos); }
.sn-tp a.sn-tp-ptr, .sn-tp a.sn-tp-ptr:visited { display: inline-flex; align-items: center; min-height: 36px; margin-top: 2px;
  font-size: 13.5px; font-weight: 600; color: var(--sn-tour-ink) !important; text-decoration: underline; text-underline-offset: 2px; }
.sn-tp-f { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px;
  padding-top: 10px; border-top: 1px solid var(--sn-row-border, var(--sn-border)); }
.sn-tp-back { min-height: 44px; padding: 0 2px; border: 0; background: none; color: var(--sn-tour-ink);
  font-size: 13.5px; font-weight: 500; cursor: pointer; text-underline-offset: 2px; }
.sn-tp-back:hover { text-decoration: underline; }
.sn-tp-next { min-height: 44px; padding: 0 18px; border: 0; border-radius: 3px; background: var(--sn-sample-bar);
  color: #ffffff; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.sn-tp-next:hover { filter: brightness(1.1); }
/* minimised: only the pill */
.sn-tp-pill { display: none; }
.sn-tp.is-min { width: auto; border: 0; background: none; box-shadow: none; }
.sn-tp.is-min .sn-tp-body { display: none; }
.sn-tp.is-min .sn-tp-pill { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border: 0; border-radius: 22px; background: var(--sn-sample-bar); color: #ffffff; font-size: 13.5px; font-weight: 600;
  cursor: pointer; box-shadow: 0 6px 18px rgba(15,23,42,.22); }
@media (max-width: 640px) {
  .sn-tp { right: 12px; left: 12px; bottom: 12px; width: auto; max-width: none; }
  .sn-tp.is-min { left: auto; }
  .sn-tp-body { max-height: 55vh; }
}
/* step 3: while the tour sets the Allocator up, a veil covers it so the visitor sees the
   finished trade, not the set-up. Lifted as soon as the trade is in place. */
#tab-optimizer.sn-tour-setting { position: relative; min-height: 320px; }
.sn-tour-veil { position: absolute; inset: 0; z-index: 50; display: flex; align-items: flex-start; justify-content: center;
  gap: 10px; padding-top: 120px; background: var(--sn-card-bg); color: var(--sn-text-muted); font-size: 14px; }
.sn-tour-veil-msg { display: inline-flex; align-items: center; gap: 10px; opacity: 0; animation: snTourVeilIn .2s ease-out .8s forwards; }
@keyframes snTourVeilIn { to { opacity: 1; } }
/* the guided tour's spotlight (templates/try/_tour.html drawSpot): one fixed SVG over the
   page that dims it, with a hole and a 2px teal ring (6px radius) over each element the panel
   talks about. No text on the page (polish notes 2026-11-19: the old floating labels sat on
   the content and under the pinned strips). Under the strip (2000) and the panel (1950), over
   the app's bars (≤1040); it takes no clicks. Teal: it is interface (pointing), not a value. */
:root, [data-bs-theme="grey"] { --sn-spot-dim: rgba(15,23,42,.35); }
[data-bs-theme="dark"] { --sn-spot-dim: rgba(0,0,0,.5); }
.sn-spot { position: fixed; left: 0; top: 0; z-index: 1945; pointer-events: none; opacity: 0;
  transition: opacity .15s ease-out; }
.sn-spot.on { opacity: 1; }
.sn-spot-dim { fill: var(--sn-spot-dim); }
.sn-spot-ring { fill: none; stroke: var(--sn-tour-ink); stroke-width: 2; }
/* the end card and the trial prompt sit alone: no panel or spotlight behind them */
body:has(.sn-gate-back.open) .sn-tp, body:has(.sn-gate-back.open) .sn-spot { display: none; }
/* the trial link in the tour strip */
.sn-sample-bar a.sn-tour-trial, .sn-sample-bar a.sn-tour-trial:visited { color: var(--sn-sample-bar-on) !important;
  font-size: 13px; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; min-height: 44px;
  display: inline-flex; align-items: center; white-space: nowrap; }
@media (max-width: 900px) {
  .sn-sample-bar.sn-tour-on { padding: 4px 12px; gap: 8px; }
  .sn-sample-bar.sn-tour-on .sn-sample-bar-t { flex-basis: 100%; }
}

/* ── §16 polish pass 2026-11-19 ───────────────────────────────────────────────
   Jack's review: the app should read as institutional, calm and consistent. For
   every user, not a tour mode. Four rules, applied where they were broken:
   1. One accent system. Severity is not painted on a card's edge: one neutral
      border, and colour only on the signed number at the right of a row.
   2. Type roles. A small label inside a card is sentence case, sans, 12px, 500,
      --sn-text-muted. Not IBM Plex Mono in capitals (that stays for figures).
   3. No serif inside the app. The What's Notable headline was Newsreader.
   4. Numeric columns right-aligned (tabular figures are global, §1). */

/* 1 · What's notable: the lead band and the "Holding Strata Score moved" strip
   (the band collapsed) lose the 3px rust / teal spine. */
.sn-lead-band,
.sn-lead-band.is-standing { border-left: 1px solid var(--sn-border); }
/* Ledger rows: no severity stripe (it was rust / amber / teal by severity). The
   signed figure on the right keeps its colour (.sn-lrow-num.is-bad). */
.sn-lrow { grid-template-columns: minmax(0, 1fr) auto; padding: 8px 16px; }
.sn-lrow-stripe,
.sn-lrow.is-hi .sn-lrow-stripe,
.sn-lrow.is-md .sn-lrow-stripe,
.sn-lrow.is-lo .sn-lrow-stripe { display: none; }
/* "New" is a state, not a value: weight, not rust. */
.sn-lrow-tag .dot { background: var(--sn-text-muted); }
.sn-lrow-tag .is-unseen { color: var(--sn-text); }
.sn-ledger-new { color: var(--sn-text); }
/* The weight in front of each row is a value, so not teal (teal is interface). */
.sn-lrow-tx .exp { color: var(--sn-text); }
.sn-grp-h, .sn-ledger-foot { padding-left: 16px; padding-right: 16px; }

/* 2 · Labels: sentence case sans. The source strings are already sentence case
   (services/notable.py, portfolio_dashboard.js); only the CSS shouted them. */
.sn-lead-kind,
.sn-lead-band.is-standing .sn-lead-kind,
.sn-lead-kind .sn-lead-chip,
.sn-lead-viz-h,
.sn-grp-h,
.sn-lrow-tag,
.sn-nb-meta,
.sn-sm-hdr,
.sn-lt10-split,
.sn-fd-cat,
.sn-fd-n,
.sn-fd-chead,
.sn-fd-mrow .k,
.sn-st-jump,
.sn-fd-split {
  font-family: 'Instrument Sans', system-ui, -apple-system, sans-serif;
  text-transform: none; letter-spacing: 0;
  font-size: 12px; font-weight: 500;
}
.sn-lead-kind,
.sn-lead-band.is-standing .sn-lead-kind,
.sn-lead-kind .sn-lead-chip,
.sn-lead-viz-h,
.sn-grp-h,
.sn-lrow-tag,
.sn-nb-meta,
.sn-sm-hdr,
.sn-lt10-split,
.sn-fd-cat,
.sn-fd-n,
.sn-fd-chead,
.sn-fd-mrow .k { color: var(--sn-text-muted); }
/* The eyebrow's chip reads as a qualifier, not a badge. */
.sn-lead-kind .sn-lead-chip { padding: 0; border: 0; background: none; }
.sn-lead-kind .sn-lead-chip:not(:empty)::before { content: '\00b7'; margin-right: 8px; }
.sn-lead-kind { gap: 8px; }
/* Column heads in the 470px ledger's dense grids (62/50/46px columns): same role,
   one step smaller so a head never wraps over its figures. */
.sn-sm-hdr, .sn-fd-chead, .sn-fd-mrow .k, .sn-fd-cat, .sn-fd-n, .sn-lt10-split { font-size: 11px; }
/* Fund drift contributor table: the two figure columns align right, as their cells do. */
.sn-fd-chead > span:nth-child(3), .sn-fd-chead > span:nth-child(4) { text-align: right; }

/* 3 · No serif inside the app. The lead headline keeps its size and weight. */
.sn-lead-band h3 { font-family: 'Instrument Sans', system-ui, -apple-system, sans-serif; letter-spacing: -.01em; }
.sn-quiet-big { font-family: 'Instrument Sans', system-ui, -apple-system, sans-serif; font-weight: 500; }

/* Allocator · Reduce: the theme chips under each holding are neutral text
   (colour set inline in _tdRenderFundTheTrade: --sn-text-muted). */
.sn-td-fund-theme-tag { font-weight: 500; }

/* Fund comparison (/compare): tile and section labels, same label role. Scoped under
   .efc2.efc3 because templates/etf/_compare.html's own <style> loads after this file. */
.efc2.efc3 .efc3-tl, .efc2.efc3 .efc3-kicker {
  text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 500;
}
.efc2.efc3 .efc3-tile:not(.efc3-tile-dark) .efc3-tl, .efc2.efc3 .efc3-kicker { color: var(--sn-text-muted); }
/* Four funds on one row from 1280px (Jack: 3+1 at 1440 with a 4-of-4 placeholder).
   The placeholder is no longer drawn when the slots are full (_efc2Cards); here the
   cards share the row instead of each claiming a 300px basis. Below 1280 they wrap
   as before. */
@media (min-width: 1280px) {
  .efc2-cards { flex-wrap: nowrap; }
  .efc2-cards > .efc2-card { flex: 1 1 0; min-width: 0; }
}
/* A card whose content box is under 320px (four in a row: 240px cards at 1280, 280px at
   1440; three plus the add tile also qualify) re-flows
   inside rather than truncating: the ring moves down beside the fund name so the
   ticker line keeps its issuer, the four stats go 2 x 2, and the returns step down a
   size so a "-16.21%" cannot run into its neighbour. Keyed on the card's own width, so
   one to three wider cards keep the original layout. */
.efc2-cards > .efc2-card { container: efc2card / inline-size; }
@container efc2card (max-width: 320px) {
  .efc2-cards .efc2-card .efc2-card-h {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
    column-gap: 8px; row-gap: 4px; align-items: center;
  }
  .efc2-cards .efc2-card .efc2-id { display: contents; }
  .efc2-cards .efc2-card .efc2-dot { grid-area: 1 / 1; margin-top: 0; }
  .efc2-cards .efc2-card .efc2-tkline { grid-area: 1 / 2; }
  .efc2-cards .efc2-card .efc2-acts { grid-area: 1 / 3; margin: 0 -8px 0 0; }
  .efc2-cards .efc2-card .efc2-name { grid-area: 2 / 2; }
  .efc2-cards .efc2-card .efc2-score { grid-area: 2 / 3; justify-self: end; }
  .efc2-cards .efc2-card .efc2-tkline .efc2-pill { max-width: none; }
  .efc2-cards .efc2-card .efc2-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 8px; }
  .efc2-cards .efc2-card .efc2-rets > div { padding: 0 8px; }
  .efc2.efc3 .efc2-cards .efc2-card .efc2-rets > div > :last-child { font-size: 14px; }
}
@container efc2card (max-width: 215px) {
  .efc2.efc3 .efc2-cards .efc2-card .efc2-rets > div > :last-child { font-size: 13px; }
}

/* ── §17 /portfolio top row at ≤1280px (19 Nov 2026) ─────────────────────────────
   At ≤1280px the chart and What's Notable stack into one column and #notable-panel
   stops scrolling (stratanova.css ~5250, so the ledger can grow), but .sn-port-top kept
   its one definite height: both cards were squeezed into it, and the ledger's card
   (overflow hidden) cut its later findings off with no way to reach them. Stacked, the
   row sizes to its content; the chart keeps the height the row used to give it. */
@media (max-width: 1280px) {
  .sn-port-top { height: auto; grid-template-rows: none; }
  .sn-port-top-left { height: clamp(340px, calc(100vh - 540px), 480px); }
}

/* ── §18 Portfolio Builder: legibility pass (20 Nov 2026) ─────────────────────────
   Jack: "pretty good, it just needs some sprucing up to make it feel more high quality".
   Measured on /portfolio/build after a build: about 300 pieces of text at 9 to 10.5px,
   most of them in --sn-text-label (#8494a4, 3.1:1 on white), and link text in --sn-teal
   (3.2:1). Small pale type is what read as unfinished; the layout is left as it is.
   Everything is scoped to .sn-pb: the Allocator's theme view shares the sn-td-* classes
   and does not change. Floor 11px. Secondary text takes --sn-text-muted. Teal TEXT takes a
   darker teal (--sn-pb-link); teal marks and bars keep --sn-teal. */
.sn-pb { --sn-text-label: var(--sn-text-muted); --sn-pb-link: #3a7686; --sn-pb-bar-rest: #a9b7c4; }
[data-bs-theme="dark"] .sn-pb { --sn-pb-link: var(--sn-teal); --sn-pb-bar-rest: #4a5870; }
[data-bs-theme="grey"] .sn-pb { --sn-pb-link: #2f6573; --sn-pb-bar-rest: #95a3b0; }

.sn-pb .sn-pb-link, .sn-pb .sn-tl-addtheme, .sn-pb .sn-td-balance-toggle, .sn-pb .sn-td-save-new-btn,
.sn-pb .sn-pill-btn.active, .sn-pb .sn-td-category-badge, .sn-pb .sn-td-impact-theme-label,
.sn-pb .sn-td-sec-h.sn-td-sorted, .sn-pb .sn-td-sort-arrow, .sn-pb .sn-pb-tag-on,
.sn-pb .sn-td-impact-side .val.projected { color: var(--sn-pb-link); }
/* white on --sn-teal was 3.2:1 on the two buttons the page exists for */
.sn-pb .sn-td-apply-btn { background: var(--sn-pb-link); border-color: var(--sn-pb-link); }

/* column heads: sentence case at 11px. Nine-pixel capitals with letter-spacing were the
   smallest text on the page, on the row a reader uses to know what a figure is */
.sn-pb .sn-td-sec-h, .sn-pb .sn-td-risk-hdr span, .sn-pb .sn-td-balance-hdr,
.sn-pb .sn-pb-bar-row.sn-pb-bar-hdr > div {
  font-size: 11px; text-transform: none; letter-spacing: 0; font-weight: 500;
}
.sn-pb .sn-td-stat-label { font-size: 11px; letter-spacing: .06em; }

/* figures in the lists were 11px beside 13px names */
.sn-pb .sn-td-sec-cell.r, .sn-pb .sn-pb-bar-v, .sn-pb .sn-pb-bar-a, .sn-pb .sn-pb-bar-p,
.sn-pb .sn-td-risk-label, .sn-pb .sn-td-risk-val, .sn-pb .sn-td-risk-delta,
.sn-pb .sn-td-balance-name, .sn-pb .sn-pb-hedge-v, .sn-pb .sn-pb-hedge-name { font-size: 12px; }
.sn-pb .sn-td-sec-cell.sn-td-rank, .sn-pb .sn-td-sec-cell.sn-pb-type,
.sn-pb .sn-td-balance-val, .sn-pb .sn-td-balance-delta { font-size: 11.5px; }
.sn-pb .sn-td-risk-row { padding: 4px 0; }

/* the reason under each holding, and the notes and hints around the page */
.sn-pb .sn-pb-why { font-size: 11.5px; line-height: 1.35; }
.sn-pb .sn-pb-why b { font-size: 10px; letter-spacing: .04em; }
.sn-pb .sn-td-sec-note, .sn-pb .sn-pb-hint { font-size: 12px; line-height: 1.45; }
.sn-pb .sn-pb-asof, .sn-pb .sn-pb-also, .sn-pb .sn-pb-stress-figs span, .sn-pb .sn-pb-pi-sub,
.sn-pb .sn-pb-legend span, .sn-pb .sn-td-impact-bm-label, .sn-pb .sn-td-impact-theme-label,
.sn-pb .sn-pb-sugg, .sn-pb .sn-tl-chars-grp, .sn-pb .sn-pb-toolnote, .sn-pb #pb-asof { font-size: 11px; }
.sn-pb .sn-pill-btn { font-size: 11.5px; }

/* holdings: a row was 54px, so the 570px list showed ten of thirty. 48px shows twelve, and
   the list takes the height a taller window has */
.sn-pb .sn-td-sec-row.sn-pb-row { padding-top: 7px; padding-bottom: 7px; }
.sn-pb .sn-td-securities-scroll { max-height: max(570px, calc(100vh - 330px)); }

/* a tilt's name ran out at "AI chips & hardware bas…" in the 300px panel */
.sn-pb .sn-pb-tilt-name { white-space: normal; overflow: visible; }

/* net theme balance: below the securities the panel is 800px wide and its bars ran 620px
   for six rows, in a grey too light to read as bars. The inline background names
   --sn-border-med, so it is that token that changes, on the fill alone */
.sn-pb .sn-td-balance-grid { max-width: 640px; row-gap: 7px; }
.sn-pb .sn-td-balance-bar { height: 5px; border-radius: 1px; }
.sn-pb .sn-td-balance-bar-fill { --sn-border-med: var(--sn-pb-bar-rest); border-radius: 1px; }

/* corners: cards are 3px and chips 2px everywhere else (CLAUDE.md, CSS conventions) */
.sn-pb .sn-td-impact-card, .sn-pb .sn-td-type-toggle { border-radius: 3px; }
.sn-pb .sn-td-type-btn { border-radius: 2px; }

/* Column heads over their columns (Jack, 20 Nov 2026, circling Portfolio / Benchmark / Active).
   The header row sits OUTSIDE the scrolling list, so the list's scrollbar (15px) narrowed
   every row and each right-aligned heading stood 15px right of its figures. Both now
   reserve the same gutter, whatever the scrollbar's width and whether or not it shows.
   Rows also carry a 3px left edge (the open-row mark) the header lacked, which put every
   heading 2px left of its text; and "#" was right-aligned over a centred rank. */
.sn-pb .sn-td-securities-scroll { scrollbar-gutter: stable; }
.sn-pb .sn-td-sec-header:has(+ .sn-td-securities-scroll) { overflow-y: hidden; scrollbar-gutter: stable; }
.sn-pb .sn-td-sec-header { border-left: 3px solid transparent; }
.sn-pb .sn-td-sec-header > .sn-td-sec-h.r:first-child { text-align: center; padding-right: 6px; }

/* Build preview always on screen (Jack, 20 Nov 2026: "when I add a basket the build
   preview gets pushed and lost"). The settings card may be nearly a window tall
   (max-height 100vh - 24px), but it starts about 180px down the page, under the header
   card: once a basket's lines filled it, its foot, where the button is, was below the
   window until the page was scrolled. Three parts:
   1. the foot sticks to the bottom of the window, so the button shows in every state and
      in every browser;
   2. the card stops under the 44px context bar, not behind it (it stuck at 12px);
   3. where the browser can tie a style to scroll position, the card's height follows the
      room it has: 200px is where the card starts with the page at the top (182px, or
      200px when the header's figures wrap), and it reaches its place after 144px. */
.sn-pb .sn-pb-side-foot {
  position: sticky; bottom: 0; z-index: 2; background: var(--sn-card-bg); border-radius: 0 0 3px 3px;
}
@media (min-width: 1201px) {
  .sn-pb .sn-td-col-left .sn-pb-side { top: 56px; max-height: calc(100vh - 68px); }
  @supports (animation-timeline: scroll()) {
    .sn-pb .sn-td-col-left .sn-pb-side {
      animation: sn-pb-side-fit linear both; animation-timeline: scroll(root block);
      animation-range: 0px 144px;
    }
  }
}
@keyframes sn-pb-side-fit {
  from { max-height: calc(100vh - 212px); }
  to { max-height: calc(100vh - 68px); }
}

/* ── §19 Portfolio Builder: design pass (20 Nov 2026) ─────────────────────────────
   Jack: "What about the design? Can you make it look better". Measured on screen at 1440px. */
/* A group of the right panel (heading and rows, gathered by build.html _pbGroupPanel) is never split between the
   two columns the panel takes under the table at 1201-1559px: the Factors group's last row stood alone at the top of
   the second column. The containers filled later (risk, stress, hedges) keep together likewise. */
.sn-pb #pb-impact .sn-pb-grp,
.sn-pb #pb-impact #pb-risk-rows { break-inside: avoid; }
.sn-pb #pb-impact .sn-pb-grp { margin-bottom: 4px; }
/* "Bring to benchmark" sat on every row of the diagnosis, eight times a table, louder than the figures. Where a
   pointer can hover it is quiet until its row is: faint at rest, full on the row, on focus and on a touch screen. */
@media (hover: hover) {
  .sn-pb .sn-pb-bring { opacity: 0.38; transition: opacity .12s; }
  .sn-pb .sn-pb-row:hover .sn-pb-bring, .sn-pb .sn-pb-bring:focus-visible { opacity: 1; }
}
/* the start toggle's two choices on one line each */
.sn-pb #pb-start-pills .sn-pill-btn { white-space: nowrap; }
/* empty states: before anything is built the header carries no row of dashes (build.html), and the theme balance
   panel waits for a build rather than standing as a second "after a preview" box */
.sn-pb #pb-balance-card.sn-pb-empty { display: none; }

/* ── §20 Portfolio Builder: the build settings, designed for the page's width (20 Nov 2026) ──
   Jack: "the lean sidebar is really taking away from making this a fully functioning portfolio construction
   settings - so much will be missed", "DONT JUST MAKE IT WIDER! IT NEEDS TO BE REDESIGNED FOR THE NEW LAYOUT", and
   "factors and fundementals are hidden in some drop down ... so everything doesnt need to be hidden". The request
   reads top to bottom (templates/portfolio/build.html, #pb-settings):
     1. the request line: start from, the book, the benchmark, the count;
     2. WHAT SHOULD CHANGE: themes, lines and baskets (the long lists keep a picker, and See them all) beside every
        factor and fundamental as a table that is always on screen, a box to type the step on each row;
     3. HOW THE BUILD MAY GET THERE: the rules in four columns (Trading, Where the money goes, Limits, Holdings);
     4. the foot: the request in one sentence beside Build preview, sticky while the card is on screen (§18).
   Nothing is folded away. Two columns of rules under 1300px; one column of everything on a phone. */
.sn-pb .sn-pb-settings { padding: 0; margin-bottom: 16px; }

/* 1. the request line */
.sn-pb .sn-pb-req { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; padding: 16px 18px;
                    border-bottom: 1px solid var(--sn-border); }
.sn-pb .sn-pb-req-item { display: flex; align-items: center; gap: 10px; margin: 0; }
.sn-pb .sn-pb-req-k { font-size: 12px; color: var(--sn-text-muted); margin: 0; white-space: nowrap; }
.sn-pb .sn-pb-req-book { width: 280px; }
.sn-pb .sn-pb-req-bm .sn-pb-sel { width: 260px; }
.sn-pb .sn-pb-req-hint { margin: 0 0 0 auto; font-size: 12px; color: var(--sn-text-label); max-width: 360px; line-height: 1.45; }
.sn-pb .sn-pb-settings > .sn-pb-blend { margin: 12px 18px 0; max-width: 560px; }
.sn-pb .sn-pb-req-err:not(:empty) { margin: 8px 18px 0; }

/* zones */
.sn-pb .sn-pb-set-body { padding: 0 18px; }
.sn-pb .sn-pb-zone { padding: 16px 0 14px; }
.sn-pb .sn-pb-zone + .sn-pb-zone { border-top: 1px solid var(--sn-border); }
.sn-pb .sn-pb-zone-h { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.sn-pb .sn-pb-zone-t { font-size: 14px; font-weight: 600; letter-spacing: -0.005em; color: var(--sn-text); }
/* Design pass 1 (Jack, 20 Nov 2026: "3 really solid design passes"): the request is three steps, numbered, and the
   zone titles outrank the small-caps group labels under them (they read the other way round before). */
.sn-pb .sn-pb-step { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 20px; height: 20px;
                     border: 1px solid var(--sn-border-med, var(--sn-border)); border-radius: 50%; font-size: 11px; font-weight: 600;
                     color: var(--sn-text-muted); }
.sn-pb .sn-pb-req > .sn-pb-step { margin-right: -14px; }
.sn-pb .sn-pb-zone .sn-pb-subh { font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em; color: var(--sn-text-label); margin: 0 0 10px; }
.sn-pb .sn-pb-zone-h { margin-bottom: 14px; }
/* the start hint said again what the page's own line under its title says (kept in the page: the script sets it) */
.sn-pb .sn-pb-req-hint { display: none; }
/* "See them all" beside the heading it belongs to, not at the far edge (Jack, 2026-11-21: "in the wrong position") */
.sn-pb .sn-pb-zone-h .sn-pb-h-act { margin-left: 14px; }
/* the table of everything you can tilt, opened in place under the heading: a framed panel, its rows scrolling inside
   so the settings below stay a scroll away, not a page */
.sn-pb .sn-pb-tt-pop { border: 1px solid var(--sn-border); border-radius: 3px; padding: 12px 14px 8px; margin: -4px 0 16px;
  background: var(--sn-card-bg); }
.sn-pb .sn-pb-tt-pop[hidden] { display: none; }
.sn-pb .sn-pb-tt-pop #pb-tt-body { max-height: 62vh; overflow-y: auto; }
.sn-pb .sn-pb-zone .sn-pb-subh { margin-top: 0; }

/* 2. what should change: themes, lines and baskets | factors and fundamentals */
.sn-pb .sn-pb-zone-split { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.sn-pb .sn-pb-zone-main { min-width: 0; padding-right: 24px; }
.sn-pb .sn-pb-zone-side { min-width: 0; padding-left: 24px; border-left: 1px solid var(--sn-row-border); }
.sn-pb .sn-pb-zone-tools { margin-bottom: 10px; }
.sn-pb .sn-pb-zone-empty { font-size: 12px; color: var(--sn-text-label); padding: 10px 0; line-height: 1.5; }
.sn-pb .sn-pb-zone-rows:has(#pb-tilts > *, #pb-ltilts > *, #pb-baskets > *) .sn-pb-zone-empty { display: none; }
.sn-pb .sn-pb-zone-main .sn-pb-hint { margin-top: 10px; }

/* a basket folds to its one line (build.html pbBasketFold): the chevron before its name; folded, what it asks for is
   said under the name and the size, what it is made from and its lines are put away (Jack: "The baskets when I put
   them in should be collapsible") */
/* (a basket's line is the tilt row's three-column grid with the chevron in front: four columns) */
.sn-pb .sn-pb-basket > .sn-pb-tilt { grid-template-columns: 22px minmax(0, 1fr) auto 22px; }
.sn-pb .sn-pb-fold { margin: 0 0 0 -4px; align-self: start; }
.sn-pb .sn-pb-fold i { display: inline-block; transition: transform .15s; }
.sn-pb .sn-pb-folded .sn-pb-fold i { transform: rotate(-90deg); }
.sn-pb .sn-pb-folded .sn-pb-basket-body { display: none; }
.sn-pb .sn-pb-bk-shut { display: none; }
.sn-pb .sn-pb-folded .sn-pb-bk-shut { display: block; }
.sn-pb .sn-pb-folded .sn-pb-bk-open { display: none; }

/* Design pass 2 (data): the trade list's two halves read as sections, and their totals as totals. "Sell 7" and
   "Buy 2" sat in the same grey caption style as the column labels beside them. */
.sn-pb .sn-pb-tr-head { background: var(--sn-hover-bg); border-radius: 3px 3px 0 0; }
.sn-pb .sn-pb-tr-head > .sn-td-sec-h:first-child { color: var(--sn-text); font-weight: 600; font-size: 12px; }
.sn-pb .sn-td-sec-row.sn-pb-tr-total { border-top: 1px solid var(--sn-border-med, var(--sn-border)); border-bottom: 0; cursor: default; }
.sn-pb .sn-td-sec-row.sn-pb-tr-total:hover { background: none; }
.sn-pb .sn-td-sec-row.sn-pb-tr-total > .sn-td-sec-cell { font-weight: 600; color: var(--sn-text); }
.sn-pb .sn-td-sec-row.sn-pb-tr-total + .sn-pb-tr-head { margin-top: 18px; }

/* the factors and fundamentals table: name | today or benchmark | step | target */
.sn-pb .sn-pb-fgrid { font-size: 12.5px; }
.sn-pb .sn-pb-fg-hdr, .sn-pb .sn-pb-fg-row { display: grid; grid-template-columns: minmax(0, 1fr) 76px 70px 76px; gap: 10px; align-items: center; }
.sn-pb .sn-pb-fg-hdr { padding: 10px 0 5px; font-size: 11px; color: var(--sn-text-label); border-bottom: 1px solid var(--sn-row-border); }
.sn-pb .sn-pb-fg-hdr:first-child { padding-top: 0; }
.sn-pb .sn-pb-fg-hdr > span:first-child { font-weight: 600; color: var(--sn-text-muted); }
.sn-pb .sn-pb-fg-hdr small { font-weight: 400; color: var(--sn-text-label); margin-left: 4px; }
.sn-pb .sn-pb-fg-hdr > span:not(:first-child), .sn-pb .sn-pb-fg-base, .sn-pb .sn-pb-fg-tgt { text-align: right; }
.sn-pb .sn-pb-fg-row { padding: 4px 0 4px 8px; margin-left: -8px; border-left: 2px solid transparent; }
.sn-pb .sn-pb-fg-name { color: var(--sn-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sn-pb .sn-pb-fg-base { color: var(--sn-text-muted); }
.sn-pb .sn-pb-fg-in { width: 100%; text-align: right; }
.sn-pb .sn-pb-fg-tgt { font-weight: 600; color: var(--sn-text); }
/* a row with a step set is an active tilt: the interface's active mark, never a value's colour */
.sn-pb .sn-pb-fg-row.on { border-left-color: var(--sn-teal); }
.sn-pb .sn-pb-fg-row.on .sn-pb-fg-name { font-weight: 600; }

/* 3. how the build may get there: four columns of rules */
.sn-pb .sn-pb-groups { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.sn-pb .sn-pb-grp-box { min-width: 0; padding: 0 20px; }
.sn-pb .sn-pb-grp-box:first-child { padding-left: 0; }
.sn-pb .sn-pb-grp-box:last-child { padding-right: 0; }
.sn-pb .sn-pb-grp-box + .sn-pb-grp-box { border-left: 1px solid var(--sn-row-border); }
.sn-pb .sn-pb-grp-box .sn-pb-field { flex-wrap: wrap; row-gap: 6px; }
.sn-pb .sn-pb-grp-box .sn-pb-field > .sn-pill-group { margin-left: auto; }
.sn-pb .sn-pb-grp-box .sn-pb-unit { min-width: 30px; }
.sn-pb .sn-pb-grp-box #pb-fund-filters, .sn-pb .sn-pb-grp-box #pb-tax-wrap { margin-top: 12px; }

/* 4. the foot */
.sn-pb .sn-pb-set-foot { display: flex; align-items: center; gap: 16px; padding: 10px 18px; border-top: 1px solid var(--sn-border); }
.sn-pb .sn-pb-req-sum { flex: 1; min-width: 0; font-size: 12.5px; color: var(--sn-text-muted); line-height: 1.45; }
.sn-pb .sn-pb-req-sum b { color: var(--sn-text); font-weight: 600; }
.sn-pb .sn-pb-set-foot #pb-go { min-width: 220px; flex: none; }
.sn-pb .sn-pb-set-foot #pb-error { margin: 0; }
.sn-pb .sn-pb-set-foot #pb-error:empty { display: none; }
/* the foot outside the card (2026-11-21): pinned to the window's bottom down the whole Builder page, a bar of its own
   (hairline, no shadow) with the page's padding below it so nothing hides under its last position */
.sn-pb .sn-pb-page-foot { margin-top: 16px; z-index: 20; border: 1px solid var(--sn-border); border-radius: 3px; }
/* the settings card folded to one line after Build preview (2026-11-21): everything in it but #pb-fold hides */
.sn-pb .sn-pb-settings.is-folded > :not(.sn-pb-fold) { display: none !important; }
.sn-pb .sn-pb-fold { display: flex; align-items: center; gap: 14px; width: 100%; padding: 11px 18px; border: 0;
  background: transparent; color: var(--sn-text-muted); font: inherit; font-size: 12.5px; text-align: left; cursor: pointer; }
.sn-pb .sn-pb-fold[hidden] { display: none; }
.sn-pb .sn-pb-fold:hover .sn-pb-fold-act { text-decoration: underline; }
.sn-pb .sn-pb-fold-k { flex: none; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--sn-text); }
.sn-pb .sn-pb-fold-sum { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sn-pb .sn-pb-fold-sum b { color: var(--sn-text); font-weight: 600; }
.sn-pb .sn-pb-fold-act { flex: none; color: var(--sn-pb-link); font-weight: 500; }
.sn-pb .sn-pb-fold-act i { margin-left: 6px; font-size: 11px; }

@media (max-width: 1299px) {
  .sn-pb .sn-pb-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 16px; }
  /* (counting the groups on screen only: from a benchmark "Where the money goes" is hidden, and counting it put
     Holdings in the right-hand place with a divider while it sat in the left column; pass 3, grey at 1280) */
  .sn-pb .sn-pb-grp-box:nth-child(odd of .sn-pb-grp-box:not([style*="none"])) { padding-left: 0; border-left: 0; }
  .sn-pb .sn-pb-grp-box:nth-child(even of .sn-pb-grp-box:not([style*="none"])) { padding-right: 0; padding-left: 20px;
    border-left: 1px solid var(--sn-row-border); }
}
@media (max-width: 1023px) {
  .sn-pb .sn-pb-zone-split { grid-template-columns: minmax(0, 1fr); }
  .sn-pb .sn-pb-zone-main { padding-right: 0; }
  .sn-pb .sn-pb-zone-side { padding: 14px 0 0; margin-top: 14px; border-left: 0; border-top: 1px solid var(--sn-row-border); }
  .sn-pb .sn-pb-req-hint { margin-left: 0; max-width: none; flex-basis: 100%; }
}
@media (max-width: 760px) {
  .sn-pb .sn-pb-groups { grid-template-columns: minmax(0, 1fr); }
  .sn-pb .sn-pb-grp-box { padding: 0 !important; border-left: 0 !important; }
  .sn-pb .sn-pb-grp-box + .sn-pb-grp-box { padding-top: 14px !important; border-top: 1px solid var(--sn-row-border); }
  .sn-pb .sn-pb-req-book, .sn-pb .sn-pb-req-also, .sn-pb .sn-pb-req-bm .sn-pb-sel { width: 100%; }
  .sn-pb .sn-pb-req-item, .sn-pb .sn-pb-req-bm { flex: 1 1 100%; }
  .sn-pb .sn-pb-set-foot { flex-wrap: wrap; }
  .sn-pb .sn-pb-set-foot #pb-go { flex: 1 1 100%; min-width: 0; }
}

/* Design pass 3 (finish), measured in light, dark and grey at 1280, 1440 and 390px:
   1. the "Stay close" slider was the browser's default blue, the only blue on the page, and its track vanished in
      grey: it takes the interface colour and a hairline track from the theme's own tokens;
   2. the factor table's twelve step boxes were filled grey blocks, the loudest thing in the zone while most stay
      empty: hairline boxes on the card's own ground, the interface colour only when one is in use;
   3. the table's group headings wrapped at a laptop's width and its names were cut at a phone's. */
.sn-pb .sn-pb-range .form-range { accent-color: var(--sn-teal); }
.sn-pb .sn-pb-range .form-range::-webkit-slider-runnable-track { background: var(--sn-border); height: 4px; border-radius: 2px; }
.sn-pb .sn-pb-range .form-range::-moz-range-track { background: var(--sn-border); height: 4px; border-radius: 2px; }
.sn-pb .sn-pb-range .form-range::-webkit-slider-thumb { background: var(--sn-teal); margin-top: -6px; box-shadow: none; }
.sn-pb .sn-pb-range .form-range::-moz-range-thumb { background: var(--sn-teal); border: 0; box-shadow: none; }
.sn-pb .sn-pb-range .form-range:focus::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--sn-hover-bg); }
.sn-pb .sn-pb-fg-in { background: transparent; border: 1px solid var(--sn-border); border-radius: 3px; height: 26px; padding: 2px 6px; }
.sn-pb .sn-pb-fg-in::placeholder { color: var(--sn-text-label); opacity: 0.7; }
.sn-pb .sn-pb-fg-in:hover { border-color: var(--sn-border-med, var(--sn-text-label)); }
.sn-pb .sn-pb-fg-in:focus { border-color: var(--sn-teal); outline: none; box-shadow: 0 0 0 2px var(--sn-hover-bg); }
.sn-pb .sn-pb-fg-row.on .sn-pb-fg-in { border-color: var(--sn-teal); }
@media (max-width: 1499px) {
  .sn-pb .sn-pb-fg-hdr small { display: none; }       /* (the full wording is each row's tooltip) */
}
@media (max-width: 760px) {
  .sn-pb .sn-pb-fg-hdr, .sn-pb .sn-pb-fg-row { grid-template-columns: minmax(0, 1fr) 58px 56px 58px; gap: 6px; }
  .sn-pb .sn-pb-fg-name { white-space: normal; line-height: 1.25; }
}

/* Design pass 4 (the results' frame): the build's figures head the results card, where Build preview brings the
   page, instead of the page header a screen above (which keeps the book's own figures). A quiet strip: small labels,
   20px figures, a hairline under it, so the tabs and the table stay the page's main event. */
.sn-pb .sn-pb-res-kpis { display: flex; flex-wrap: wrap; gap: 10px 36px; padding: 2px 0 14px; margin-bottom: 14px;
                         border-bottom: 1px solid var(--sn-border); }
.sn-pb .sn-pb-res-kpis:empty { display: none; }
.sn-pb .sn-pb-res-kpis .sn-td-stat { min-width: 0; text-align: left; align-items: flex-start; }
.sn-pb .sn-pb-res-kpis .sn-td-stat-label { font-size: 10.5px; letter-spacing: 0.06em; color: var(--sn-text-label); margin-bottom: 2px; }
.sn-pb .sn-pb-res-kpis .sn-td-stat-value { font-size: 20px; font-weight: 600; line-height: 1.2; color: var(--sn-text); }
.sn-pb .sn-pb-res-kpis .sn-pb-stat-was { font-size: 11.5px; font-weight: 400; color: var(--sn-text-label); margin-left: 4px; }
/* the summary under the tabs reads as the build's one-paragraph story: a touch larger than the notes under it */
.sn-pb #pb-summary .sn-pb-summary { font-size: 13.5px; line-height: 1.55; }

/* Design pass 5 (the outcome panel): its heading carries the Today | Benchmark switch that governs every figure
   under it, and the save area is its own group, "Use this build", rather than trailing the diversifiers. */
.sn-pb .sn-pb-imp-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px 12px; margin-bottom: 12px; }
.sn-pb .sn-pb-imp-head > div:first-child { flex: 1 1 200px; min-width: 0; }   /* (the switch goes under the title in the 360px column) */
.sn-pb .sn-pb-imp-head .sn-td-panel-title { margin-bottom: 2px; }
.sn-pb .sn-pb-imp-head .sn-pb-vs { margin: 0; flex: none; }
.sn-pb #pb-impact > .sn-pb-imp-head { column-span: all; }

/* Design pass 6 (controls and their states), one rule set for every control on the page:
   1. number boxes: the factor table's hairline box everywhere (the settings mixed filled grey boxes with hairline
      ones), and no browser spinner arrows (small, fiddly, different in every browser; these boxes are typed into);
   2. a disabled box reads as disabled (a basket at Match greys its size box, which looked like any other);
   3. keyboard focus shows on every button, pill and box in the interface colour. */
.sn-pb input[type=number].sn-pb-num { background: transparent; border: 1px solid var(--sn-border); border-radius: 3px; height: 28px;
                                      padding: 2px 8px; text-align: right; color: var(--sn-text); -moz-appearance: textfield; appearance: textfield; }
.sn-pb input[type=number].sn-pb-num::-webkit-inner-spin-button,
.sn-pb input[type=number].sn-pb-num::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.sn-pb input[type=number].sn-pb-num::placeholder { color: var(--sn-text-label); opacity: 0.75; }
.sn-pb input[type=number].sn-pb-num:hover:not(:disabled) { border-color: var(--sn-border-med, var(--sn-text-label)); }
.sn-pb input[type=number].sn-pb-num:focus { border-color: var(--sn-teal); outline: none; box-shadow: 0 0 0 2px var(--sn-hover-bg); }
.sn-pb input[type=number].sn-pb-num:disabled { opacity: 0.45; border-style: dashed; cursor: not-allowed; }
.sn-pb .sn-pb-fg-in { height: 26px; }
.sn-pb .sn-pill-btn:focus-visible, .sn-pb .sn-tl-addtheme:focus-visible, .sn-pb .sn-pb-link:focus-visible,
.sn-pb .sn-pb-icon:focus-visible, .sn-pb .sn-td-type-btn:focus-visible, .sn-pb .sn-td-apply-btn:focus-visible,
.sn-pb .sn-td-save-new-btn:focus-visible, .sn-pb .sn-pb-selbtn:focus-visible, .sn-pb input[type=checkbox]:focus-visible {
  outline: 2px solid var(--sn-teal); outline-offset: 2px; }
.sn-pb .form-control:focus { border-color: var(--sn-teal); box-shadow: 0 0 0 2px var(--sn-hover-bg); }

/* Two decisions Jack left to judgement (20 Nov 2026, "Make the decisions that you think will improve"):
   1. a trade's reason is one line on its row: the sentence leads with its figure ("none of its revenue...",
      "64% of its revenue is in..."), so the line keeps the figure, and seven sales in a row no longer each take
      three lines saying the same thing. The whole sentence is the name's tooltip and opens with the row;
   2. the settings stay open after a build (nothing put away), and the results card has a way back to them
      (build.html, "Change settings"). */
.sn-pb .sn-pb-trade .sn-pb-why.sn-pb-why-wrap { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sn-pb .sn-pb-trade.open .sn-pb-why.sn-pb-why-wrap { white-space: normal; overflow: visible; }
.sn-pb .sn-pb-toolnote .sn-pb-back { margin-left: 14px; }

/* The results tables, compact and read at a glance (Jack 20 Nov 2026: "a lot of dull tables to try to make sense of").
   1. One line a row: the reason follows the name on the same line in the muted ink and gives way first when space runs
      short; the whole of it is the name's tooltip and wraps once the row is opened. Rows went from ~44px to ~30px.
   2. A position the build leaves alone is quiet: its figures in the muted ink, so the names that change lead.
   3. The trade is drawn: a bar from a centre line, sold to the left, bought to the right, its length the trade against
      the largest in the build. Neutral ink, never --sn-pos/--sn-neg: a trade is not a gain or a loss.
   4. What changes: a direction mark on a figure that moved; a change too small to matter in the faint ink. */
.sn-pb .sn-pb-line1 { padding-top: 5px; padding-bottom: 5px; }
.sn-pb .sn-pb-line1 > .name-cell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.sn-pb .sn-pb-line1 > .name-cell .sn-pb-why { display: inline; margin: 0 0 0 9px; font-size: 11.5px; }
.sn-pb .sn-pb-line1 > .name-cell .sn-pb-why b { margin-right: 4px; }
.sn-pb .sn-pb-line1.open > .name-cell { white-space: normal; overflow: visible; }
.sn-pb .sn-pb-line1.open > .name-cell .sn-pb-why { display: block; margin: 2px 0 0; white-space: normal; }
.sn-pb .sn-pb-line1.sn-pb-same > .sn-td-sec-cell:not(.sn-td-rank) { color: var(--sn-text-muted); }
.sn-pb .sn-pb-line1.sn-pb-same > .ticker { font-weight: 500; }
.sn-pb .sn-pb-line1.sn-pb-same .sn-td-theme-bar-fill { opacity: 0.45; }

.sn-pb .sn-pb-tcell { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.sn-pb .sn-pb-tcell > b { font-weight: inherit; min-width: 46px; text-align: right; }
.sn-pb .sn-pb-tbar { position: relative; flex: 0 0 76px; height: 9px; }
.sn-pb .sn-pb-tbar::before { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--sn-border); }
.sn-pb .sn-pb-tbar > i { position: absolute; top: 1px; bottom: 1px; border-radius: 1px; background: var(--sn-pb-tbar-b); }
.sn-pb .sn-pb-tbar > i.b { left: 50%; }
.sn-pb .sn-pb-tbar > i.s { right: 50%; background: var(--sn-pb-tbar-s); }
:root { --sn-pb-tbar-b: #4f5f7a; --sn-pb-tbar-s: #8592a8; }
[data-bs-theme="dark"] { --sn-pb-tbar-b: #9aa8c0; --sn-pb-tbar-s: #6c7890; }
[data-bs-theme="grey"] { --sn-pb-tbar-b: #46546c; --sn-pb-tbar-s: #7a879c; }

/* The firm's restricted list in the Holdings group: saved tickers as hairline chips, edited in place */
.sn-pb .sn-pb-firm-sum { font-size: 12px; line-height: 1.9; }
.sn-pb .sn-pb-firm-tk { display: inline-block; padding: 0 5px; border: 1px solid var(--sn-border); border-radius: 3px;
  font-size: 11px; line-height: 17px; font-weight: 600; letter-spacing: .02em; }
.sn-pb .sn-pb-firm textarea { font-size: 12px; font-variant-numeric: tabular-nums; resize: vertical; }
.sn-pb .sn-pb-firm-acts { display: flex; gap: 12px; align-items: center; margin-top: 5px; font-size: 12px; }

/* Cash in or out: the direction is the row's label, a quiet select */
.sn-pb .sn-pb-cash-dir { border: 0; border-bottom: 1px dashed var(--sn-border); background: transparent; color: inherit;
  font: inherit; padding: 0 2px 0 0; max-width: 170px; cursor: pointer; }
.sn-pb .sn-pb-cash-dir:focus-visible { outline: 2px solid var(--sn-teal); outline-offset: 2px; }
.sn-pb .sn-pb-cash-usd { flex-basis: 100%; font-size: 11.5px; text-align: right; }
.sn-pb .sn-pb-cash-usd:empty { display: none; }

/* Tax lots under the trades: each lot sold as a hairline chip; a loss in the P&L ink (it is a realized loss) */
.sn-pb .sn-pb-lots { white-space: normal; line-height: 1.9; }
.sn-pb .sn-pb-lot { display: inline-block; margin: 0 6px 0 0; padding: 0 6px; border: 1px solid var(--sn-border); border-radius: 3px;
  font-size: 11px; line-height: 18px; white-space: nowrap; }
.sn-pb .sn-pb-lot.k-st { border-style: dashed; }
.sn-pb .sn-pb-lot.loss { color: var(--sn-neg); }
.sn-pb .sn-pb-wash li { color: var(--sn-text); }

/* Build to a scenario: one row a limit in the settings (name, how it must hold, the figure), and a quiet add-select */
.sn-pb .sn-pb-subh.sn-pb-scn-h { margin-top: 20px; }
.sn-pb select.sn-pb-scn-add, .sn-pb select.sn-pb-scn-mode { width: auto; max-width: 100%; display: inline-block; }
.sn-pb .sn-pb-scn-row { display: grid; grid-template-columns: minmax(140px, 1fr) auto 86px 24px; gap: 8px; align-items: center;
  padding: 5px 0; border-bottom: 1px solid var(--sn-row-border); font-size: 12.5px; }
.sn-pb .sn-pb-scn-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sn-pb .sn-pb-scn-gloss { grid-column: 1 / -1; color: var(--sn-text-muted); font-size: 12px; line-height: 1.4; margin-top: -2px; }
.sn-pb .sn-pb-scn-gloss b { color: var(--sn-text); font-weight: 600; }
.sn-pb .sn-pb-scn-mode, .sn-pb .sn-pb-scn-add { border: 0; border-bottom: 1px dashed var(--sn-border); background: transparent;
  color: inherit; font: inherit; font-size: 12px; padding: 0 2px; cursor: pointer; }
.sn-pb .sn-pb-scn-add { margin-top: 6px; color: var(--sn-teal); border-bottom-color: transparent; }
.sn-pb .sn-pb-scn-mode:focus-visible, .sn-pb .sn-pb-scn-add:focus-visible { outline: 2px solid var(--sn-teal); outline-offset: 2px; }
.sn-pb .sn-pb-scn-card.short .sn-td-impact-bm-label b { color: var(--sn-text); }

/* A basket's place among the peers, under its card on the right */
.sn-pb .sn-pb-peerfoot { margin-top: 6px; font-size: 11.5px; color: var(--sn-text-muted); }

/* Each security's own 5-day, 1-month and 1-year return (2026-11-21): one column of three, figures right-aligned in
   tabular numerals, signed, in the P&L colours (a price move is a gain or a loss; the trade bar beside it stays ink) */
.sn-pb .sn-pb-rets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; text-align: right; font-size: 12px; }
.sn-pb .sn-td-sec-h.sn-pb-rets > span { text-align: right; }
.sn-pb .sn-pb-rets .pos { color: var(--sn-pos); }
.sn-pb .sn-pb-rets .neg { color: var(--sn-neg); }
/* Securities as a range, in Trading (2026-11-21): two small number fields with "to" between */
.sn-pb .sn-pb-nrange { gap: 6px; }
.sn-pb .sn-pb-nrange .sn-pb-num { width: 52px; }
/* Several accounts (2026-11-21): "Also apply to" in step 1, and the All accounts summary in the results */
.sn-pb .sn-pb-req-also { width: 210px; }
.sn-pb .sn-pb-req-also .sn-pb-selmenu { right: auto; min-width: 320px; }
.sn-pb .sn-pb-also-item { cursor: pointer; margin: 0; }
.sn-pb .sn-pb-also-item input { flex: none; margin: 0; }
.sn-pb .sn-pb-also-note { border-top: 1px solid var(--sn-row-border); padding: 8px 12px 9px; font-size: 11.5px; line-height: 1.45; color: var(--sn-text-muted); }
.sn-pb .sn-pb-many-acct { width: 96px; height: 24px; text-align: right; }
.sn-pb .sn-pb-many-tr { margin-right: 12px; white-space: nowrap; font-size: 12px; }
.sn-pb .sn-pb-many-tr b { font-weight: 600; }
.sn-pb .sn-pb-many-miss { color: var(--sn-text); font-weight: 600; }
.sn-pb .sn-pb-many-me { background: var(--sn-hover-bg); }
.sn-pb .sn-pb-many-foot { display: flex; justify-content: space-between; align-items: center; padding: 10px 0 4px; font-size: 12px; }
.sn-pb button.sn-pb-link:disabled { opacity: 0.45; cursor: not-allowed; text-decoration: none; }

.sn-pb .sn-pb-dir { font-style: normal; font-size: 8px; margin-right: 4px; vertical-align: 1px; opacity: 0.8; }
.sn-pb .sn-td-risk-row.sn-pb-still .sn-td-risk-label,
.sn-pb .sn-td-risk-row.sn-pb-still .sn-td-risk-val { color: var(--sn-text-muted); }

/* the results below: no settings column beside them any more */
@media (min-width: 1560px) {
  .sn-pb .sn-td-columns { grid-template-columns: minmax(0, 1fr) 360px; }
}
@media (max-width: 1559px) and (min-width: 1201px) {
  .sn-pb .sn-td-columns { grid-template-columns: minmax(0, 1fr); }
  .sn-pb .sn-td-col-right { grid-column: 1; }
}
