.phf-page-header { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; width: 100%; margin: 0 0 6px; padding: 2px 0 20px; border-bottom: 1px solid var(--line); color: var(--text); }
/* A wide chart or table must not widen the page's title track. */
.st-page:has(> .phf-page-header) { grid-template-columns: minmax(0, 1fr); min-width: 0; }
.st-page:has(> .phf-page-header) > * { min-width: 0; }
.st-page:has(> .phf-page-header) > .t-panel { grid-column: 1 / -1; }
.sp-page:has(> .phf-page-header) { max-width: none; }
.phf-page-header-main { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 16px 32px; min-width: 0; }
.phf-page-header-copy { flex: 1 1 380px; min-width: 0; }
.phf-page-header h1.phf-page-header-title { margin: 0; padding: 0; font: 500 1.75rem/1.2 var(--sans, 'Inter', system-ui, sans-serif); letter-spacing: -.035em; text-wrap: balance; overflow-wrap: anywhere; color: var(--text); }
.phf-page-header .phf-page-header-description { margin: 8px 0 0; max-width: 78ch; font: 400 .875rem/1.55 var(--sans, 'Inter', system-ui, sans-serif); letter-spacing: normal; color: var(--text-dim); overflow-wrap: anywhere; }
.phf-page-header-context { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; min-width: 0; font: 400 .75rem/1.5 var(--sans, 'Inter', system-ui, sans-serif); color: var(--text-mute); }
.phf-page-header .phf-page-header-back { color: var(--text-dim); text-decoration: none; }
.phf-page-header .phf-page-header-back:hover { color: var(--accent); }
.phf-page-header-aside { display: grid; gap: 10px; max-width: 100%; align-self: center; }
.phf-page-header-status, .phf-page-header-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px 12px; min-width: 0; font-size: .75rem; color: var(--text-mute); }
.phf-page-header-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; min-width: 0; max-width: 100%; }
.phf-page-header-toolbar .st-tabs { max-width: 100%; flex-wrap: wrap; }
.phf-page-header-toolbar .cw-nav { flex-wrap: wrap; }
.phf-page-header a:focus-visible, .phf-page-header button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (max-width: 640px) {
  .phf-page-header { padding-bottom: 16px; gap: 12px; }
  .phf-page-header h1.phf-page-header-title { font-size: 1.5rem; }
  .phf-page-header-copy { flex-basis: 100%; }
  .phf-page-header-status, .phf-page-header-actions { justify-content: flex-start; }
}
/* The desk: PHF's soft surfaces (docs/ui-style.md, brand/tokens.css, shared/surfaces.css)
   carrying the function learned from the Polymarket bot's dashboard. Soft look -- rounded
   cards with the card shadow, inset metric tiles, sans labels in sentence case, status as a
   dot plus text, gold only as the brand accent. Bot function -- dense tiles with explicit
   good/bad value colour, '--' for missing data, self-explaining metrics, collapsible and
   resizable panels, a status line that admits when the engine goes quiet, and long tables
   that scroll inside a bounded shell. Mono is reserved for data (the token file's own rule). */

:root {
  --t-mono: "IBM Plex Mono", "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --t-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --t-radius: 16px;       /* between the soft card's 22px and a terminal's 4px */
  --t-radius-tile: 10px;
}

/* ---------------------------------------------------------------- desk grid + panels */
.t-desk { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1200px) { .t-desk { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .t-desk { grid-template-columns: minmax(0, 1fr); } }

.t-panel { min-width: 0; grid-column: span 2; background: var(--surface); border: 1px solid var(--line); border-radius: var(--t-radius); box-shadow: var(--shadow-card); }
.t-panel[data-size="S"] { grid-column: span 1; }
.t-panel[data-size="L"] { grid-column: 1 / -1; }
@media (max-width: 1200px) { .t-panel[data-size="S"], .t-panel[data-size="M"] { grid-column: span 1; } .t-panel[data-size="L"] { grid-column: 1 / -1; } }
@media (max-width: 760px) { .t-panel, .t-panel[data-size] { grid-column: 1 / -1; } }

.t-panel-head { display: flex; align-items: center; gap: 8px; padding: 14px 18px 0; }
.t-panel[data-collapsed="true"] .t-panel-head { padding-bottom: 14px; }
.t-panel-title { margin: 0; font: 500 .95rem/1.35 var(--t-sans); letter-spacing: -.01em; color: var(--text); }
.t-panel-meta { margin-left: auto; font: .75rem/1.35 var(--t-sans); color: var(--text-mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-panel-meta[data-tone="bad"] { color: var(--bad); }
/* Resize and collapse are ghost controls: quiet until the panel is hovered or focused. */
.t-panel-btn { flex: none; width: 24px; height: 24px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--text-mute); font: 600 11px/1 var(--t-sans); cursor: pointer; opacity: .45; transition: opacity .15s, background .15s; }
.t-panel:hover .t-panel-btn, .t-panel-btn:focus-visible { opacity: 1; }
.t-panel-btn:hover { background: var(--surface-2); color: var(--text); }
.t-panel-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.t-panel-body { padding: 12px 18px 18px; }

/* ---------------------------------------------------------------- tiles */
.t-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.t-tile { position: relative; min-width: 0; padding: 12px 14px; background: var(--surface-2); border-radius: var(--t-radius-tile); }
.t-tile-label { display: flex; align-items: center; gap: 4px; font: .75rem/1.35 var(--t-sans); color: var(--text-mute); white-space: nowrap; }
.t-tile-label .phf-help-trigger { padding: 0; }
.t-tile-value { margin-top: 4px; font: 500 clamp(1.05rem, .9vw + .5rem, 1.35rem)/1.2 var(--t-mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-tile-sub { margin-top: 2px; font: .72rem/1.35 var(--t-sans); color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-tile[data-tone="ok"] .t-tile-value { color: var(--ok); }
.t-tile[data-tone="bad"] .t-tile-value { color: var(--bad); }
.t-tile[data-tone="warn"] .t-tile-value { color: var(--warn); }
.t-tile[data-tone="dim"] .t-tile-value { color: var(--text-mute); }

.t-note { margin: 10px 0 0; font: .75rem/1.5 var(--t-sans); color: var(--text-mute); }
.t-note strong { font: 500 .75rem var(--t-mono); color: var(--text-dim); }
.t-empty { padding: 6px 0; font: .8rem/1.5 var(--t-sans); color: var(--text-mute); }

/* ---------------------------------------------------------------- tables: the soft shell, bounded */
.t-scroll { max-height: 440px; overflow: auto; padding: 4px; background: var(--surface-2); border-radius: var(--radius-table, 16px); }
.t-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.t-table th { position: sticky; top: 0; z-index: 1; padding: 8px 10px; background: var(--surface-2); font: 500 .72rem/1.3 var(--t-sans); color: var(--text-mute); text-align: right; white-space: nowrap; }
.t-table td { padding: 7px 10px; background: var(--surface); border-bottom: 1px solid var(--line); font: 12.5px/1.4 var(--t-mono); font-variant-numeric: tabular-nums; color: var(--text-dim); text-align: right; white-space: nowrap; }
.t-table th:first-child, .t-table td:first-child { text-align: left; }
.t-table tbody tr:last-child td { border-bottom: 0; }
.t-scroll .t-table tbody tr:first-child td:first-child { border-top-left-radius: 12px; }
.t-scroll .t-table tbody tr:first-child td:last-child { border-top-right-radius: 12px; }
.t-scroll .t-table tbody tr:last-child td:first-child { border-bottom-left-radius: 12px; }
.t-scroll .t-table tbody tr:last-child td:last-child { border-bottom-right-radius: 12px; }
.t-table tbody tr:hover td { background: var(--surface-2); }
.t-table td[data-tone="ok"] { color: var(--ok); }
.t-table td[data-tone="bad"] { color: var(--bad); }
.t-table td[data-tone="warn"] { color: var(--warn); }
.t-table td strong { font-weight: 600; color: var(--text); }

/* Pills: status as a dot plus text, never a filled block. */
.t-pill { display: inline-flex; align-items: center; gap: 6px; font: 500 .72rem/1 var(--t-sans); color: var(--text-dim); }
.t-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.t-pill[data-tone="ok"] { color: var(--ok); }
.t-pill[data-tone="bad"] { color: var(--bad); }
.t-pill[data-tone="warn"] { color: var(--warn); }

.t-spark { display: block; width: 100%; height: 120px; }
.t-spark-line { fill: none; stroke: var(--accent); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.t-spark-base { stroke: var(--line-strong); stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.t-spark-area { fill: color-mix(in srgb, var(--accent) 10%, transparent); }

/* ---------------------------------------------------------------- status line (in the workspace bar) */
.t-modebar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; width: 100%; font: .8rem/1.4 var(--t-sans); color: var(--text-dim); }
.t-modebar-item { display: inline-flex; align-items: center; gap: 6px; }
.t-modebar-item:first-child { font-weight: 500; color: var(--text); }
.t-modebar-item b { font: 500 .78rem var(--t-mono); color: var(--text); }
.t-modebar-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: t-pulse 2s ease-in-out infinite; }
.t-modebar[data-mode="live"] .t-modebar-dot { background: var(--ok); }
.t-modebar[data-mode="halted"] .t-modebar-dot, .t-modebar[data-mode="unknown"] .t-modebar-dot, .t-modebar[data-stale="true"] .t-modebar-dot { background: var(--bad); }
.t-modebar[data-stale="true"] .t-modebar-dot { animation: none; }
.t-modebar-quiet { color: var(--bad); }
.t-modebar-right { margin-left: auto; font: 500 .78rem var(--t-mono); color: var(--text); }
@keyframes t-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .t-modebar-dot { animation: none; } }
/* The mode shows as a thin top edge on the floating bar -- never a filled bar. */
.phf-terminal .phf-workspace-bar:has(.t-modebar) { box-shadow: inset 0 2px 0 var(--accent), var(--shadow-float); }
.phf-terminal .phf-workspace-bar:has(.t-modebar[data-mode="live"]) { box-shadow: inset 0 2px 0 var(--ok), var(--shadow-float); }
.phf-terminal .phf-workspace-bar:has(.t-modebar[data-mode="halted"]),
.phf-terminal .phf-workspace-bar:has(.t-modebar[data-mode="unknown"]),
.phf-terminal .phf-workspace-bar:has(.t-modebar[data-stale="true"]) { box-shadow: inset 0 2px 0 var(--bad), var(--shadow-float); }

/* ---------------------------------------------------------------- existing pages: function only
   The Paper lab, Positions, Activity, Markets and Settings keep their native soft surfaces;
   the MVP only bounds long tables so no page stretches to thousands of pixels. */
.phf-terminal .plab-page { gap: 12px; }
.phf-terminal .plab-chart { height: 340px; }
.phf-terminal .plab-table-wrap { max-height: 440px; overflow: auto; }
.phf-terminal .plab-table th { position: sticky; top: 0; z-index: 1; background: var(--surface); }
.phf-terminal .phf-scroller { max-height: 480px; overflow: auto; }
.phf-terminal .phf-scroller .phf-table th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); }

/* Overview: page head with the venue tabs, and the Polymarket bot cards. */
.t-desk > .desk-head { grid-column: 1 / -1; }
.t-desk > .desk-bots { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 12px; align-items: start; }
.t-desk > .desk-bots .st-card-wide { grid-column: auto; }
.desk-cb-list { display: grid; gap: 2px; margin-top: 8px; font-size: .8rem; }
.desk-cb-list > div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 1px solid var(--line); }
.desk-cb-list > div > span:first-child { font-family: var(--mono); color: var(--text); }
.desk-cb-list > div > span:last-child { color: var(--text-dim); text-align: right; }

/* The MVP has no top banner (Julian, 2026-09-24): engine state lives in Overview's Engine panel and each
   bot shows its own mode. The bar remains only to hold the menu toggle on narrow screens. */
.phf-terminal .phf-workspace-bar-bare { display: none; }
@media (max-width: 760px) { .phf-terminal .phf-workspace-bar-bare { display: flex; background: none; box-shadow: none; border: 0; } }

/* Live money: its own colour, never paper gold. A pulsing dot says the account is trading for real. */
.t-tile[data-tone="live"] .t-tile-value, .t-pill[data-tone="live"], .t-table td[data-tone="live"] { color: var(--live); }
.t-live-dot { display: inline-block; width: 0.55em; height: 0.55em; border-radius: 50%; background: var(--live); margin-right: 0.4em; vertical-align: 0.1em; animation: t-live-pulse 1.6s ease-in-out infinite; }
@keyframes t-live-pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--live) 60%, transparent); } 50% { box-shadow: 0 0 0 0.35em transparent; } }
@media (prefers-reduced-motion: reduce) { .t-live-dot { animation: none; } }
:root { --live: #ff5a4f; }
:root[data-theme="light"] { --live: #d6352b; }
.t-pill[data-tone="live"]::before { animation: t-live-pulse 1.6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .t-pill[data-tone="live"]::before { animation: none; } }
/* Strategies page: soft surfaces (brand tokens), venue-coded, dense where it counts. */
.st-page { display: grid; gap: 14px; }
.st-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.st-head h1 { margin: 0; font: 500 1.35rem/1.2 var(--t-sans); letter-spacing: -.02em; color: var(--text); }
.st-head p { margin: 4px 0 0; font: .82rem/1.4 var(--t-sans); color: var(--text-mute); }

/* Venue tabs: a soft segmented control. */
.st-tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; }
.st-tab { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border: 0; border-radius: 9px; background: transparent; color: var(--text-dim); font: 500 .82rem/1 var(--t-sans); cursor: pointer; }
.st-tab:hover { color: var(--text); }
.st-tab[data-active="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-card); }
.st-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.st-tab-count { min-width: 18px; padding: 2px 6px; border-radius: 999px; background: var(--surface-2); font: 500 .7rem/1 var(--t-mono); color: var(--text-mute); text-align: center; }
.st-tab[data-active="true"] .st-tab-count { background: var(--surface-2); color: var(--text); }

/* Venue colour: a dot, never a fill. */
.st-venue-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-mute); flex: none; }
.st-venue-dot[data-venue="robinhood"] { background: #3fb950; }
.st-venue-dot[data-venue="coinbase"] { background: #4c8dff; }
.st-venue-dot[data-venue="polymarket"] { background: #8b7cff; }

.st-summary .t-panel-body { padding: 14px 18px; }

.st-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; align-items: start; }
.st-card { display: grid; gap: 10px; min-width: 0; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--t-radius, 16px); box-shadow: var(--shadow-card); }
.st-card[data-dim] { opacity: .72; }
.st-card-wide { grid-column: span 2; }
@media (max-width: 760px) { .st-card-wide { grid-column: auto; } }
.st-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.st-venue { display: inline-flex; align-items: center; gap: 6px; font: 500 .72rem/1 var(--t-sans); color: var(--text-mute); text-transform: capitalize; }
.st-card-title { margin: 0; font: 600 1rem/1.3 var(--t-mono); color: var(--text); letter-spacing: -.01em; }
.st-card-sub { margin: -6px 0 0; font: .75rem/1.4 var(--t-sans); color: var(--text-mute); }
.st-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }

.st-holdings { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.st-holdings li { display: inline-flex; }
.st-holdings button { display: inline-flex; gap: 8px; padding: 5px 10px; border: 0; border-radius: 999px; background: var(--surface-2); font: 12px/1.2 var(--t-mono); color: var(--text-dim); cursor: pointer; }
.st-holdings button:hover { box-shadow: inset 0 0 0 1px var(--line-strong, var(--line)); }
.st-holdings button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.st-holdings strong { color: var(--text); font-weight: 600; }
.st-holdings [data-tone="ok"] { color: var(--ok); }
.st-holdings [data-tone="bad"] { color: var(--bad); }

.st-card-foot { display: flex; align-items: center; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); font: .75rem/1.4 var(--t-sans); color: var(--text-mute); }
.st-card-foot .phf-help-trigger { padding: 0; }
.st-evidence { font-family: var(--t-mono); color: var(--text-dim); }
.st-evidence[data-tone="ok"] { color: var(--ok); }
.st-evidence[data-tone="bad"] { color: var(--bad); }
.st-foot-right { margin-left: auto; }

/* Polymarket: the 5-minute window and the recent W/L strip. */
.st-window { display: grid; gap: 6px; font: .75rem/1.3 var(--t-sans); color: var(--text-mute); }
.st-window-bar { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.st-window-bar span { display: block; height: 100%; border-radius: 999px; background: #8b7cff; }
.st-strip { display: flex; flex-wrap: wrap; gap: 3px; }
.st-strip span { width: 10px; height: 10px; border-radius: 3px; background: var(--surface-2); }
.st-strip span[data-r="W"] { background: color-mix(in srgb, var(--ok) 75%, transparent); }
.st-strip span[data-r="L"] { background: color-mix(in srgb, var(--bad) 75%, transparent); }
.st-card-foot { flex-wrap: wrap; }
.st-card-foot > span:first-child { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.st-evidence, .st-foot-right { white-space: nowrap; }
.st-link { color: var(--text); text-decoration: none; font-weight: 500; } .st-link:hover { text-decoration: underline; }
/* Grade tag for a single call (SignalGrades). */
.sg-tag { display: inline-block; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); font: 500 .74rem var(--t-mono); color: var(--text-mute); }
.sg-tag[data-tone=ok] { color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.sg-tag[data-tone=bad] { color: var(--bad); background: color-mix(in srgb, var(--bad) 14%, transparent); }

/* Bot configuration (components/BotConfig.tsx) */
.st-tab-live { margin-left: 6px; font-size: 0.68rem; font-weight: 600; letter-spacing: 0.04em; color: var(--live); }
.t-note[data-tone="warn"] { color: var(--warn); }

/* CPO page (pages/CpoPage.tsx) */
.cpo-formula { margin: 0 0 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); font-family: var(--mono); font-size: 0.85rem; color: var(--text-dim); }
.cpo-formula strong { color: var(--text); font-weight: 500; }
.cpo-examples td, .cpo-examples th { text-align: left; }
.cpo-rules { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: 0.88rem; color: var(--text-dim); }
.cpo-rules strong { color: var(--text); font-weight: 500; }
/* Regime at entry (regime study, display only; data from /oos-evidence.json) */
.st-regime { margin: 0 6px; padding: 1px 6px; border-radius: 6px; font-size: 0.68rem; color: var(--text-mute); background: var(--line); }
.st-regime[data-r="calm"] { color: var(--ok); }
.st-regime[data-r="elevated"] { color: var(--warn); }
.st-regime[data-r="stress"] { color: var(--bad); }
/* Strategy overview and drill-down. Shared venue/bot styles remain in strategies.css. */
.sw-page { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; min-width: 0; color: var(--text); }
/* Desk panels normally span two columns. Here that creates an implicit second
   page column, splitting the header and squeezing the detail panels. */
.sw-page > .t-panel { grid-column: 1 / -1; }
.sw-page h1 { margin: 0; font: 500 1.65rem/1.2 var(--t-sans); letter-spacing: -.03em; }
.sw-page h2 { margin: 0; font: 500 1.02rem/1.3 var(--t-sans); letter-spacing: -.01em; }
.sw-page p { margin: 0; }
.sw-muted { color: var(--text-mute); font: .8rem/1.55 var(--t-sans); }
.sw-id { color: var(--text-mute); font: .73rem/1.5 var(--t-mono); overflow-wrap: anywhere; }
.sw-list { display: grid; gap: 12px; }
.sw-strategy { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px 24px; padding: 22px 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--text); text-decoration: none; box-shadow: var(--shadow-card); transition: border-color .15s, background .15s; }
.sw-strategy:hover { border-color: var(--accent); background: var(--surface-2); }
.sw-strategy:focus-visible, .sw-page a:focus-visible, .sw-page button:focus-visible, .sw-page summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.sw-strategy-main { display: grid; gap: 5px; min-width: 0; }
.sw-overline { display: flex; align-items: center; gap: 10px; color: var(--text-mute); font: .75rem/1.4 var(--t-sans); margin-bottom: 6px; }
.sw-strategy h2 { font-size: 1.15rem; }
.sw-strategy-result { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.sw-strategy-result > strong { font: 500 1.25rem/1.35 var(--t-mono); margin-top: 8px; }
.sw-page [data-tone="ok"] { color: var(--ok); }
.sw-page [data-tone="bad"] { color: var(--bad); }
.sw-page [data-tone="warn"] { color: var(--warn); }
.sw-strategy footer { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 14px; color: var(--text-mute); font: .75rem/1.4 var(--t-sans); }
.sw-open { color: var(--text); font-weight: 500; }
.sw-section-title { margin-bottom: 6px !important; }
.sw-page section > .st-grid { margin-top: 12px; }
.sw-back, .sw-text-link { color: var(--text); text-decoration: none; font: 500 .82rem/1.5 var(--t-sans); width: fit-content; }
.sw-back { color: var(--text-mute); }
.sw-text-link { display: inline-block; margin-top: 18px; }
.sw-back:hover, .sw-text-link:hover { text-decoration: underline; }
.sw-detail-head { display: flex; justify-content: space-between; align-items: start; flex-wrap: wrap; gap: 18px; }
.sw-detail-head h1 { margin: 7px 0; }
.sw-header-state { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 9px; max-width: 420px; }
.sw-header-state > .sw-muted { flex-basis: 100%; text-align: right; }
.sw-tabs { display: flex; gap: 28px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.sw-tabs a { padding: 12px 0; border-bottom: 2px solid transparent; color: var(--text-mute); font: 500 .85rem/1.4 var(--t-sans); text-decoration: none; }
.sw-tabs a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }
.sw-columns { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.sw-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px; min-width: 0; }
.sw-panel h2 { margin-bottom: 12px; }
.sw-panel .t-tiles { margin: 18px 0; }
.sw-panel-head { display: grid; gap: 3px; }
.sw-panel-head h2 { margin-bottom: 0; }
.sw-holding { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; font: .86rem/1.5 var(--t-mono); }
.sw-holding:last-child { border-bottom: 0; padding-bottom: 0; }
.sw-holding strong { font-weight: 500; }
.sw-holding small { display: block; color: var(--text-mute); font: .74rem/1.55 var(--t-sans); margin-top: 3px; }
.sw-holding > span { min-width: 0; overflow-wrap: anywhere; }
.sw-holding > span:last-child { text-align: right; flex-shrink: 0; }
.sw-holding:hover strong { text-decoration: underline; }
.sw-facts { display: grid; grid-template-columns: minmax(100px, .85fr) minmax(0, 1.4fr); gap: 14px 18px; margin: 18px 0; font: .82rem/1.55 var(--t-sans); }
.sw-facts dt { color: var(--text-mute); }
.sw-facts dd { margin: 0; overflow-wrap: anywhere; }
.sw-fact-pair { display: contents; }
.sw-event { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 14px; }
.sw-event > summary { cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px; font: .84rem/1.5 var(--t-sans); min-height: 44px; }
.sw-event > summary > span:first-child { min-width: 0; }
.sw-event > summary strong { display: block; font-weight: 500; overflow-wrap: anywhere; }
.sw-event > summary time { color: var(--text-mute); font-size: .73rem; }
.sw-event[open] > summary { color: var(--accent); }
.sw-source { border-top: 1px solid var(--line); padding-top: 14px; color: var(--text-mute); font: .75rem/1.5 var(--t-sans); }
.sw-source summary { cursor: pointer; }
.sw-source code { display: block; margin-top: 12px; overflow-wrap: anywhere; }
.sw-description { max-width: 76ch; color: var(--text-dim); font: .94rem/1.7 var(--t-sans); }
.sw-notice { padding: 14px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); color: var(--text); font: .82rem/1.5 var(--t-sans); }
.sw-button, .sw-notice button { border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
@media (max-width: 1000px) { .sw-columns { grid-template-columns: 1fr; } }
@media (max-width: 650px) {
  .sw-strategy { grid-template-columns: 1fr; padding: 18px; gap: 12px; }
  .sw-strategy-result { align-items: flex-start; }
  .sw-strategy-result > strong { margin-top: 2px; }
  .sw-header-state { justify-content: flex-start; }
  .sw-header-state > .sw-muted { text-align: left; }
  .sw-tabs { gap: 18px; }
  .sw-tabs a { font-size: .8rem; }
  .sw-panel { padding: 18px; }
  .sw-facts { grid-template-columns: minmax(95px, .8fr) minmax(0, 1.3fr); gap: 12px; }
  .sw-holding { flex-wrap: wrap; }
  .sw-page .st-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .sw-strategy { transition: none; } }
.bt-record { border-top: 1px solid var(--line); padding-top: 20px; margin-top: 20px; min-width: 0; }
.bt-record:first-of-type { border-top: 0; padding-top: 4px; }
.bt-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.bt-head h3 { margin: 0 0 4px; font: 500 1rem/1.4 var(--t-sans); }
.bt-head code, .bt-sources code { font: .74rem var(--t-mono); color: var(--text-mute); overflow-wrap: anywhere; }
.bt-status { flex-shrink: 0; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; font: .74rem/1.5 var(--t-sans); color: var(--text-mute); }
.bt-status[data-tone="ok"] { color: var(--ok); border-color: currentColor; }
.bt-status[data-tone="bad"] { color: var(--bad); border-color: currentColor; }
.bt-status[data-tone="warn"] { color: var(--warn); border-color: currentColor; }
.bt-verdict { margin: 14px 0 6px; font: .9rem/1.55 var(--t-sans); color: var(--text); }
.bt-record h4 { margin: 18px 0 6px; font: 500 .82rem/1.4 var(--t-sans); color: var(--text); }
.bt-scroll { overflow-x: auto; margin-top: 8px; -webkit-overflow-scrolling: touch; }
.bt-scroll table { border-collapse: collapse; width: 100%; font: .78rem/1.45 var(--t-mono); }
.bt-scroll th { text-align: left; font: 500 .72rem/1.4 var(--t-sans); color: var(--text-mute); padding: 6px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.bt-scroll td { padding: 7px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.bt-scroll [data-num] { text-align: right; }
.bt-scroll tr:last-child td { border-bottom: 0; }
.bt-scroll td[data-tone="ok"] { color: var(--ok); }
.bt-scroll td[data-tone="bad"] { color: var(--bad); }
.bt-group-head td { padding: 12px 10px 6px; border-bottom: 0; white-space: normal; }
.bt-group-head button { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; width: 100%; padding: 0; border: 0; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.bt-group-head button:disabled { cursor: default; }
.bt-group-head button:focus-visible { outline: 2px solid var(--accent, currentColor); outline-offset: 3px; border-radius: 4px; }
.bt-group-head strong { font: 500 .82rem/1.4 var(--t-sans); }
.bt-group-sub { color: var(--text-mute); font: .74rem/1.4 var(--t-sans); }
.bt-chevron { width: 1em; color: var(--text-mute); }
.bt-group-details td { white-space: normal; padding: 4px 10px 12px 30px; }
.bt-members { margin: 8px 0; }
.bt-members ul { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; padding: 0; list-style: none; }
.bt-members li { padding: 2px 8px; border: 1px solid var(--line); border-radius: 6px; font: .74rem/1.5 var(--t-mono); }
.bt-group tr:not(.bt-group-head):not(.bt-group-details) td:first-child { padding-left: 30px; }
.bt-group:not(:last-of-type) tr:last-child td { border-bottom: 1px solid var(--line); }
.bt-notes { margin: 0; padding-left: 18px; list-style: disc; color: var(--text-mute); font: .8rem/1.6 var(--t-sans); }
.bt-sources { margin-top: 14px; }
@media (max-width: 640px) { .bt-head { flex-direction: column; gap: 8px; } }
/* Position detail drawer: a soft sheet from the right. */
.pd-scrim { position: fixed; inset: 0; z-index: 50; background: color-mix(in srgb, var(--ink) 55%, transparent); display: flex; justify-content: flex-end; }
.pd-drawer { width: min(520px, 100%); height: 100%; overflow-y: auto; display: grid; align-content: start; gap: 16px; padding: 22px 24px 28px;
  background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow-float); border-radius: 16px 0 0 16px; }
.pd-head { display: flex; justify-content: space-between; gap: 12px; }
.pd-head h2 { margin: 2px 0; font: 600 1.5rem/1.2 var(--t-mono); color: var(--text); }
.pd-eyebrow { margin: 0; font: 500 .72rem/1.3 var(--t-sans); color: var(--text-mute); text-transform: capitalize; }
.pd-sub { margin: 0; font: .82rem/1.4 var(--t-sans); color: var(--text-dim); }
.pd-sub strong { font: 600 .82rem var(--t-mono); color: var(--text); }
.pd-close { width: 32px; height: 32px; border: 0; border-radius: 10px; background: var(--surface-2); color: var(--text-dim); font: 1.2rem/1 var(--t-sans); cursor: pointer; }
.pd-close:hover { color: var(--text); }
.pd-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pd-section { display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.pd-section h3 { display: flex; align-items: center; gap: 6px; margin: 0; font: 500 .9rem/1.3 var(--t-sans); color: var(--text); }
.pd-rules { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.pd-rules li { display: grid; grid-template-columns: 110px 1fr; gap: 2px 10px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.pd-rules span { grid-row: span 2; font: .78rem/1.3 var(--t-sans); color: var(--text-mute); }
.pd-rules strong { font: 500 .9rem/1.3 var(--t-mono); color: var(--text); }
.pd-rules em { font: normal .75rem/1.35 var(--t-sans); color: var(--text-dim); }
.pd-kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 0; }
.pd-kv div { padding: 8px 12px; border-radius: 10px; background: var(--surface-2); }
.pd-kv dt { font: .72rem/1.3 var(--t-sans); color: var(--text-mute); }
.pd-kv dd { margin: 2px 0 0; font: 500 .85rem/1.3 var(--t-mono); color: var(--text); text-transform: none; }
.pd-muted { margin: 0; font: .8rem/1.4 var(--t-sans); color: var(--text-mute); }
.pd-raw { margin: 0; font: .7rem/1.4 var(--t-mono); color: var(--text-mute); overflow-wrap: anywhere; }
.t-table tr[data-click] { cursor: pointer; }
.t-table tr[data-click]:focus-visible td { outline: 2px solid var(--accent); outline-offset: -2px; }

/* Shared by the Positions and Activity pages: a small segmented filter in a panel header. */
.pos-filter { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.pos-filter button { padding: 4px 10px; border: 0; border-radius: 8px; background: var(--surface-2); color: var(--text-dim); font: 500 .75rem/1.2 var(--t-sans); cursor: pointer; }
.pos-filter button[data-active="true"] { background: var(--text); color: var(--surface); }
.act-days { display: grid; gap: 14px; }
.act-day { display: flex; gap: 8px; margin: 0 0 6px; font: 500 .8rem/1.3 var(--t-sans); color: var(--text-mute); }
.act-list { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.act-list li > * { display: grid; grid-template-columns: 52px 72px minmax(140px, 1.1fr) minmax(110px, .7fr) 2fr; align-items: center; gap: 10px; width: 100%; padding: 8px 12px; border: 0; border-radius: 10px; background: var(--surface-2); text-align: left; color: var(--text-dim); font: .8rem/1.35 var(--t-sans); }
.act-list li > button { cursor: pointer; }
.act-list li > button:hover { box-shadow: inset 0 0 0 1px var(--line); }
.act-list time { font: .78rem var(--t-mono); color: var(--text-mute); }
.act-title { color: var(--text); font-weight: 500; text-transform: capitalize; }
.act-strategy { font: .75rem var(--t-mono); color: var(--text-mute); }
.act-detail { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 760px) { .act-list li > * { grid-template-columns: 48px 1fr; } .act-strategy, .act-detail { grid-column: 2; } }
/* Calls & outcomes: a one-line summary (StrategyPredictions) and its page
   (CallsPage). Theme tokens only (light + dark). */
.sp-dim { color: var(--text-mute); }
.sp-line [data-tone=safe], .sp-page td[data-tone=safe], .sp-stat-sub [data-tone=safe] { color: var(--ok); }
.sp-line [data-tone=danger], .sp-page td[data-tone=danger], .sp-stat-sub [data-tone=danger] { color: var(--bad); }

/* The summary line */
.sp-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding: 14px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); text-decoration: none; font-size: .86rem; transition: border-color .15s; }
.sp-line:hover { border-color: var(--line-strong); }
.sp-line-title { font-weight: 600; }
.sp-line-body { display: flex; flex-wrap: wrap; gap: 4px 18px; color: var(--text-dim); flex: 1 1 auto; min-width: 0; }
.sp-line-h b { font-weight: 600; color: var(--text); margin-right: 4px; }
.sp-line-go { color: var(--accent); white-space: nowrap; }

/* The page */
.sp-page { display: grid; gap: 20px; max-width: 1100px; min-width: 0; }
.sp-page > * { min-width: 0; }
.sp-back { color: var(--text-mute); text-decoration: none; font-size: .84rem; width: fit-content; }
.sp-back:hover { color: var(--text); }
.sp-lede { margin: 6px 0 0; color: var(--text-dim); font-size: .9rem; line-height: 1.6; max-width: 70ch; }

.sp-filter { display: flex; flex-wrap: wrap; gap: 6px; }
.sp-filter button { font: inherit; font-size: .82rem; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text-dim); cursor: pointer; }
.sp-filter button span { color: var(--text-mute); margin-left: 4px; }
.sp-filter button[aria-pressed=true] { border-color: var(--accent); color: var(--text); }

.sp-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.sp-stat { display: grid; gap: 4px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.sp-stat-label { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-mute); }
.sp-stat-value { font-size: 1.6rem; font-weight: 600; color: var(--text); }
.sp-stat-sub { font-size: .84rem; color: var(--text-dim); }
.sp-stat-note { font-size: .75rem; color: var(--text-mute); margin-top: 4px; }

.sp-table-card { padding: 0; overflow: hidden; }
.sp-foot { margin: 0; font-size: .78rem; color: var(--text-mute); }

@media (max-width: 760px) {
  .sp-stats { grid-template-columns: 1fr; }
}
/* My calls (MyCallsPage). Theme tokens only (light + dark); reuses the Calls & outcomes
   page shell (.sp-page, .sp-filter) from strategy-predictions.css. */
.mc-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; }
@media (max-width: 900px) { .mc-layout { grid-template-columns: 1fr; } }
.mc-chart { padding: 0; overflow: hidden; }
.mc-form { display: grid; gap: 12px; padding: 16px; align-content: start; }
.mc-live { margin: 0; color: var(--text-dim); font-size: .86rem; }
.mc-live b { color: var(--text); font-weight: 600; }
.mc-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mc-field { display: grid; gap: 4px; font-size: .8rem; color: var(--text-dim); }
.mc-field input, .mc-field select { width: 100%; padding: 7px 9px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); font: inherit; font-size: .88rem; font-variant-numeric: tabular-nums; }
.mc-field input:focus, .mc-field select:focus { outline: none; border-color: var(--accent); }
.mc-field small { color: var(--text-mute); font-size: .74rem; }

.mc-numbers { padding: 16px; display: grid; gap: 14px; }
.mc-numbers dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px 20px; margin: 0; }
.mc-numbers dt { font-size: .74rem; color: var(--text-mute); }
.mc-numbers dd { margin: 2px 0 0; font-size: 1.05rem; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text); }
.mc-numbers dd small { display: block; font-size: .74rem; font-weight: 400; color: var(--text-dim); }
.mc-numbers dd[data-tone=safe] { color: var(--ok); }
.mc-numbers dd[data-tone=danger] { color: var(--bad); }
.mc-warnings { margin: 0; padding: 10px 12px 10px 28px; border: 1px solid var(--bad); border-radius: var(--radius); color: var(--text); font-size: .86rem; line-height: 1.5; }
.mc-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: .8rem; }
.mc-save { padding: 8px 14px; border: 1px solid var(--accent); border-radius: var(--radius); background: transparent; color: var(--accent); font: inherit; font-size: .86rem; cursor: pointer; }
.mc-save:hover { background: var(--accent); color: var(--surface); }

.mc-saved { padding: 16px; }
.mc-saved h2 { margin: 0 0 8px; font-size: .9rem; font-weight: 600; }
.mc-saved ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: .84rem; }
/* The brief, in PHF's own system (docs/ui-style.md, brand/tokens.css): Inter for prose, IBM Plex
   Mono for figures, the theme's ink and surface, gold for the brand and for a level to watch, and
   the data palette (--data-gain / --data-loss) for quantities. One frame, 9:16, scaled as a whole
   (sizes in cqw of the frame), so it reads the same on a phone, a desktop and, later, as video. */

.bf-stage {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; align-content: center; gap: var(--s-4, 16px);
  background: var(--ink); color: var(--text); font-family: var(--sans);
}
.bf-device {
  position: relative; touch-action: manipulation; -webkit-touch-callout: none; width: min(calc(88dvh * 9 / 16), 100vw); aspect-ratio: 9 / 16;
  container-type: size; overflow: hidden; cursor: pointer; user-select: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius, 22px); box-shadow: var(--shadow-card);
}
/* Held: the progress bar dims so the pause reads as deliberate. */
.bf-device[data-holding] .bf-progress { opacity: .45; transition: opacity .15s; }

/* The project card's thin accent at the top, as on PHF's panels. */
.bf-device::before { content: ''; position: absolute; inset: 0 0 auto; height: 2px; background: var(--accent); z-index: 3; }

.bf-progress { position: absolute; top: 4.4cqw; left: 6.4cqw; right: 6.4cqw; z-index: 2; display: flex; gap: 1.1cqw; }
.bf-progress span { flex: 1; height: 2px; border-radius: 2px; background: var(--line-strong); overflow: hidden; }
.bf-progress i { display: block; height: 100%; background: var(--accent); }

.bf-card { position: absolute; inset: 0; display: grid; grid-template-rows: auto auto auto 1fr auto; padding: 10cqw 6.4cqw 6.4cqw; }
.bf-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8cqw; color: var(--accent); }
.bf-head svg { height: 6.2cqw; width: auto; }
.bf-head time { font: 400 2.7cqw/1 var(--sans); color: var(--text-mute); font-variant-numeric: tabular-nums; }

.bf-kicker { margin: 0 0 2.2cqw; font: 500 3cqw/1.2 var(--sans); color: var(--accent); }
.bf-claim { margin: 0; font: 400 6.6cqw/1.16 var(--sans); letter-spacing: -0.022em; color: var(--text); text-wrap: balance; max-width: 24ch;
  animation: bf-rise 480ms cubic-bezier(.2, .7, .2, 1) both; }
.bf-figure { display: grid; gap: 1.6cqw; margin: 6.4cqw 0 5cqw; }
.bf-figure strong { font: 400 14.5cqw/0.92 var(--mono); letter-spacing: -0.07em; font-variant-numeric: tabular-nums; color: var(--text);
  animation: bf-rise 560ms 70ms cubic-bezier(.2, .7, .2, 1) both; }
.bf-figure strong[data-tone=up] { color: var(--data-gain); }
.bf-figure strong[data-tone=down] { color: var(--data-loss); }
.bf-figure span { font: 400 3cqw/1.3 var(--sans); color: var(--text-mute); }

.bf-visual { min-height: 0; display: flex; align-items: center; }
.bf-chart { width: 100%; max-height: 100%; overflow: visible; font-family: var(--sans); }
.bf-axis { stroke: var(--line-strong); stroke-width: 1.5; }
.bf-context { margin: 5cqw 0 0; padding-top: 3.4cqw; border-top: 1px solid var(--line); font: 400 3cqw/1.5 var(--sans); color: var(--text-dim); }

/* quantities: the data palette */
.bf-q[data-tone=up] { stroke: var(--data-gain); color: var(--data-gain); }
.bf-q[data-tone=down] { stroke: var(--data-loss); color: var(--data-loss); }
text.bf-q[data-tone=up] { fill: var(--data-gain); stroke: none; }
text.bf-q[data-tone=down] { fill: var(--data-loss); stroke: none; }

/* coin chart */
.bf-line { fill: none; stroke-width: 3.5; stroke-linejoin: round; stroke-linecap: round; stroke: var(--text); }
.bf-line[data-tone=up] { stroke: var(--data-gain); }
.bf-line[data-tone=down] { stroke: var(--data-loss); }
.bf-area { color: var(--text); }
.bf-area[data-tone=up] { color: var(--data-gain); }
.bf-area[data-tone=down] { color: var(--data-loss); }
.bf-fill-top { stop-color: currentColor; stop-opacity: .16; }
.bf-fill-bottom { stop-color: currentColor; stop-opacity: 0; }
.bf-dot { fill: var(--text); stroke: var(--surface); stroke-width: 5; }
.bf-dot[data-tone=up] { fill: var(--data-gain); }
.bf-dot[data-tone=down] { fill: var(--data-loss); }
/* The one moment: each level draws itself across the chart as the card arrives. */
.bf-level line { stroke: var(--accent); stroke-width: 2; stroke-dasharray: 1; stroke-dashoffset: 1; animation: bf-draw 900ms cubic-bezier(.6, 0, .2, 1) forwards; animation-delay: inherit; }
.bf-level text { fill: var(--accent); font: 500 25px var(--mono); opacity: 0; animation: bf-fade 400ms 800ms forwards; }

/* market chart */
.bf-bar rect { transform-box: fill-box; transform-origin: left center; animation: bf-grow 600ms cubic-bezier(.2, .7, .2, 1) both; animation-delay: inherit; }
.bf-bar[data-tone=down] rect { transform-origin: right center; fill: var(--data-loss); }
.bf-bar[data-tone=up] rect { fill: var(--data-gain); }
.bf-sym { fill: var(--text-dim); font: 500 25px var(--sans); }
.bf-val { fill: var(--text-mute); font: 400 23px var(--mono); }

/* group card: a table, because these are rows to compare */
.bf-rows { width: 100%; display: grid; }
.bf-rows > div { display: grid; grid-template-columns: 18cqw minmax(0, 1fr) 22cqw 15cqw; align-items: center; gap: 3cqw; padding: 2.6cqw 0; border-top: 1px solid var(--line); }
.bf-rows > div:last-child { border-bottom: 1px solid var(--line); }
.bf-rows b { font: 500 3.5cqw/1.1 var(--sans); color: var(--text); }
.bf-rows small { display: block; margin-top: .6cqw; font: 400 2.5cqw/1.1 var(--sans); color: var(--text-mute); }
.bf-rows svg { width: 100%; height: 7cqw; overflow: visible; }
.bf-rows path { fill: none; stroke-width: 2.2; stroke-linejoin: round; }
.bf-rows .bf-n { text-align: right; font: 400 3.3cqw/1 var(--mono); font-variant-numeric: tabular-nums; color: var(--text-dim); }
.bf-rows .bf-n.bf-q { font-weight: 500; }

/* Strategy card */
.bf-pair { display: grid; gap: 7cqw; width: 100%; }
.bf-btc { stroke: var(--text-mute); stroke-width: 2.5; fill: none; stroke-dasharray: 6 7; }
.bf-pair text { font: 500 24px var(--mono); }
.bf-pair .bf-tag-btc { fill: var(--text-mute); }
.bf-gauge-track { stroke: var(--line-strong); stroke-width: 3; stroke-linecap: round; }
.bf-gauge-stated { stroke: var(--accent); stroke-width: 3; }
.bf-gauge text { font: 400 22px var(--sans); fill: var(--text-mute); }
.bf-gauge .bf-gauge-gold { fill: var(--accent); font-family: var(--mono); font-weight: 500; }
.bf-gauge .bf-gauge-price { fill: var(--text); font-family: var(--mono); font-weight: 500; }
.bf-gauge circle { fill: var(--text); stroke: var(--surface); stroke-width: 4; }

/* mood chart: the index's own scale, the week as fading dots, today as the one marker */
.bf-zone rect { fill: var(--surface-2); stroke: var(--line); }
.bf-zone[data-on] rect { fill: var(--line-strong); }
.bf-zone text { fill: var(--text-mute); font: 400 22px var(--sans); }
.bf-zone[data-on] text { fill: var(--text); font-weight: 500; }
.bf-past { fill: var(--text-dim); }
.bf-today line { stroke: var(--text); stroke-width: 2; }
.bf-today circle { fill: var(--text); stroke: var(--surface); stroke-width: 5; }

.bf-call { grid-template-rows: auto auto auto 1fr; }
.bf-lede { margin: 5cqw 0 0; font: 400 3.5cqw/1.6 var(--sans); color: var(--text-dim); max-width: 34ch; }
.bf-cta { align-self: end; justify-self: start; min-height: 44px; display: inline-flex; align-items: center; padding: 0 6cqw; height: 11cqw;
  border-radius: var(--radius-sm, 12px); background: var(--accent); color: var(--surface); font: 500 3.6cqw/1 var(--sans); text-decoration: none; }
.bf-cta:focus-visible, .bf-controls :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.bf-wait { align-content: center; }

.bf-controls { display: flex; gap: var(--s-5, 24px); align-items: center; }
.bf-controls button, .bf-close { background: none; border: 0; padding: 4px 2px; min-height: 44px; color: var(--text-mute); font: 400 13px var(--sans); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }
.bf-controls button:hover:not(:disabled), .bf-close:hover { color: var(--text); }
.bf-controls button:disabled { opacity: .35; cursor: default; }

/* Phones: the frame is the screen; tapping the left or right of it moves between cards. Kept
   after the base rules so it wins. */
@media (max-width: 600px) {
  .bf-stage { gap: 0; }
  .bf-device { width: 100vw; height: 100dvh; aspect-ratio: auto; border-radius: 0; border: 0; box-shadow: none; }
  .bf-controls { display: none; }
}

@keyframes bf-rise { from { opacity: 0; transform: translateY(1.2cqw); } }
@keyframes bf-fade { to { opacity: 1; } }
@keyframes bf-draw { to { stroke-dashoffset: 0; } }
@keyframes bf-grow { from { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) {
  .bf-claim, .bf-figure strong, .bf-bar rect { animation: none; }
  .bf-level line { animation: none; stroke-dashoffset: 0; }
  .bf-level text { animation: none; opacity: 1; }
}

/* the house setup on its chart: target and stop in the data palette, entry in gold */
.bf-trade line { stroke-width: 2.5; stroke-dasharray: 1; stroke-dashoffset: 1; animation: bf-draw 900ms cubic-bezier(.6, 0, .2, 1) forwards; animation-delay: inherit; }
.bf-trade text { font: 500 25px var(--mono); opacity: 0; animation: bf-fade 400ms 800ms forwards; }
.bf-trade[data-tone=up] line { stroke: var(--data-gain); } .bf-trade[data-tone=up] text { fill: var(--data-gain); }
.bf-trade[data-tone=down] line { stroke: var(--data-loss); } .bf-trade[data-tone=down] text { fill: var(--data-loss); }
.bf-trade[data-tone=gold] line { stroke: var(--accent); } .bf-trade[data-tone=gold] text { fill: var(--accent); }

/* sessions: alternate bands under the day's line */
.bf-session rect { fill: transparent; }
.bf-session[data-alt] rect { fill: var(--surface-2); }
.bf-session-name { fill: var(--text-mute); font: 400 22px var(--sans); }
.bf-session text.bf-q { font: 500 26px var(--mono); }
.bf-setup-note { margin: 3cqw 0 0; font: 400 2.6cqw/1.4 var(--sans); color: var(--text-mute); }
.bf-card[data-kind=setup] { grid-template-rows: auto auto auto 1fr auto auto; }
.bf-card[data-kind=setup] .bf-cta { margin-top: 4cqw; }
@media (prefers-reduced-motion: reduce) { .bf-trade line { animation: none; stroke-dashoffset: 0; } .bf-trade text { animation: none; opacity: 1; } }
/* Decisions and Configuration panels on the Polymarket bot page. Tokens only: brand/tokens.css. */

/* ---- Decisions ---- */
.bd-status { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); font: .85rem/1.4 var(--t-sans); color: var(--text-dim); }
.bd-status strong { font-weight: 600; color: var(--text); }
.bd-status span { overflow-wrap: anywhere; }
.bd-status svg { flex: none; }
.bd-tripped { margin: 8px 0 0; padding: 0 0 0 38px; font: .78rem/1.5 var(--t-sans); color: var(--text-dim); }
.bd-tripped li::marker { color: var(--bad); }
.bd-status[data-tone="bad"] { border-color: color-mix(in srgb, var(--bad) 45%, transparent); background: color-mix(in srgb, var(--bad) 9%, var(--surface)); }
.bd-status[data-tone="bad"] svg, .bd-status[data-tone="bad"] strong { color: var(--bad); }
.bd-status[data-tone="ok"] svg, .bd-status[data-tone="ok"] strong { color: var(--ok); }
.bd-status[data-tone="warn"] svg, .bd-status[data-tone="warn"] strong { color: var(--warn); }

.bd-facts, .bcf-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 8px; margin: 12px 0; }
.bd-facts > div, .bcf-facts > div { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); min-width: 0; }
.bd-facts dt, .bcf-facts dt { font: .72rem/1.3 var(--t-sans); color: var(--text-mute); }
.bd-facts dd, .bcf-facts dd { margin: 4px 0 0; font: 500 1rem/1.25 var(--t-mono); font-variant-numeric: tabular-nums; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-facts dd small, .bcf-facts dd small { display: block; margin-top: 2px; font: .7rem/1.3 var(--t-sans); color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; }
.bd-facts dd[data-tone="ok"] { color: var(--ok); }
.bd-facts dd[data-tone="bad"] { color: var(--bad); }

.bd-bar { display: flex; justify-content: flex-end; margin: 4px 0 8px; }
.bd-seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--surface-2); }
.bd-seg button { padding: 5px 11px; border: 0; border-radius: 8px; background: transparent; color: var(--text-dim); font: 500 .78rem/1 var(--t-sans); cursor: pointer; }
.bd-seg button[data-active="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-card); }
.bd-seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.bd-feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.bd-feed li { display: grid; grid-template-columns: 70px 132px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 12px; border-radius: 10px; background: var(--surface-2); }
.bd-feed li[data-kind="skip"] { background: transparent; border: 1px dashed var(--line); }
.bd-feed time { font: .74rem/1 var(--t-mono); color: var(--text-mute); font-variant-numeric: tabular-nums; }
.bd-tag { display: inline-flex; align-items: center; gap: 5px; justify-self: start; padding: 4px 8px; border-radius: 6px; font: 600 .68rem/1 var(--t-mono); letter-spacing: .06em; color: var(--text-dim); background: color-mix(in srgb, var(--text-mute) 12%, transparent); white-space: nowrap; }
.bd-tag em { font-style: normal; font-weight: 500; opacity: .75; }
.bd-tag[data-tone="ok"] { color: var(--ok); background: color-mix(in srgb, var(--ok) 13%, transparent); }
.bd-tag[data-tone="bad"] { color: var(--bad); background: color-mix(in srgb, var(--bad) 13%, transparent); }
.bd-tag[data-tone="warn"] { color: var(--warn); background: color-mix(in srgb, var(--warn) 15%, transparent); }
.bd-text { display: grid; gap: 2px; min-width: 0; }
.bd-text span { font: .84rem/1.35 var(--t-sans); color: var(--text); overflow-wrap: anywhere; }
.bd-text small { font: .74rem/1.35 var(--t-sans); color: var(--text-mute); overflow-wrap: anywhere; }
.bd-feed li[data-kind="skip"] .bd-text span { color: var(--text-dim); }
.bd-pnl { font: 500 .84rem/1 var(--t-mono); font-variant-numeric: tabular-nums; }
.bd-pnl[data-tone="ok"] { color: var(--ok); }
.bd-pnl[data-tone="bad"] { color: var(--bad); }
.bd-more { margin-top: 8px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 9px; background: transparent; color: var(--text-dim); font: 500 .78rem/1 var(--t-sans); cursor: pointer; }
.bd-more:hover { color: var(--text); }

/* ---- Configuration ---- */
.bcf-facts { margin-top: 0; }
.bcf-guards h3 { margin: 4px 0 8px; font: 500 .8rem/1 var(--t-sans); color: var(--text-dim); }
.bcf-guards ul { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 6px 16px; }
.bcf-guards li { display: flex; flex-wrap: wrap; align-items: center; align-content: flex-start; gap: 6px 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font: .82rem/1.4 var(--t-sans); }
.bcf-guards li svg { flex: none; color: var(--ok); }
.bcf-guards li[data-on="false"] svg { color: var(--text-mute); }
.bcf-guard-name { color: var(--text); }
.bcf-guard-state { font: 500 .7rem/1 var(--t-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--ok); }
.bcf-guards li[data-on="false"] .bcf-guard-name, .bcf-guards li[data-on="false"] .bcf-guard-state { color: var(--text-mute); }
.bcf-guards li .bcf-value { flex: 1 1 100%; padding-left: 23px; }

.bcf-value { display: inline-flex; flex-wrap: wrap; gap: 4px; justify-content: flex-start; }
.bcf-kv { display: inline-flex; gap: 5px; padding: 2px 7px; border-radius: 6px; background: var(--surface-2); font: .74rem/1.5 var(--t-mono); color: var(--text); overflow-wrap: anywhere; }
.bcf-kv i { font: .72rem/1.5 var(--t-sans); font-style: normal; color: var(--text-mute); }
.bcf-flag { padding: 2px 7px; border-radius: 6px; font: 600 .68rem/1.6 var(--t-mono); letter-spacing: .05em; text-transform: uppercase; color: var(--ok); background: color-mix(in srgb, var(--ok) 13%, transparent); }
.bcf-flag[data-on="false"] { color: var(--text-mute); background: color-mix(in srgb, var(--text-mute) 12%, transparent); }
.bcf-env code { padding: 2px 6px; border-radius: 5px; background: var(--surface-2); font: .7rem/1.5 var(--t-mono); color: var(--text-dim); overflow-wrap: anywhere; }

.bcf-tools { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px 16px; margin: 4px 0 10px; }
.bcf-filter { flex: 1 1 260px; max-width: 380px; padding: 7px 11px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font: .82rem var(--t-sans); }
.bcf-filter:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.bcf-fold { border-bottom: 1px solid var(--line); }
.bcf-fold > summary { display: flex; align-items: center; gap: 6px; padding: 9px 2px; list-style: none; cursor: pointer; font: 500 .84rem/1.2 var(--t-sans); color: var(--text); }
.bcf-fold > summary::-webkit-details-marker { display: none; }
.bcf-fold > summary svg { color: var(--text-mute); transition: transform .15s; }
.bcf-fold[open] > summary svg { transform: rotate(90deg); }
.bcf-fold > summary span { margin-left: 2px; font: .74rem/1 var(--t-mono); color: var(--text-mute); }
.bcf-fold > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 6px; }
.bcf-prose { flex: 1 1 100%; border-bottom: 0; }
.bcf-prose > summary { font-weight: 400; color: var(--text-dim); padding: 4px 2px; }
.bcf-prose dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 6px 0 4px; font-size: .82rem; }
.bcf-prose dl > div { display: contents; }
.bcf-prose dt { color: var(--text-mute); }
.bcf-prose dd { margin: 0; color: var(--text-dim); }

.bcf-rows { margin: 0 0 10px; }
.bcf-rows > div { display: grid; grid-template-columns: minmax(150px, 30%) 1fr; gap: 12px; padding: 6px 2px 6px 22px; border-top: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.bcf-rows dt { font: .8rem/1.6 var(--t-sans); color: var(--text-dim); }
.bcf-rows dd { margin: 0; min-width: 0; }

@media (max-width: 760px) {
  .bd-feed li { grid-template-columns: 1fr auto; }
  .bd-feed time { grid-column: 1; }
  .bd-text { grid-column: 1 / -1; }
  .bcf-rows > div { grid-template-columns: 1fr; gap: 4px; padding-left: 2px; }
  .bcf-prose dl { grid-template-columns: 1fr; }
}
/* Regime page (pages/regime/RegimePage.tsx) */
.rg-flow { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.rg-layer { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); font-size: 0.85rem; color: var(--text-dim); }
.rg-layer p { margin: 6px 0 0; }
.rg-layer-head { display: flex; align-items: center; gap: 8px; color: var(--text); }
.rg-layer-head .t-pill { margin-left: auto; }
.rg-role { color: var(--text-mute); }
.rg-step { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 4px; border-radius: 6px; background: var(--surface-3, var(--line)); color: var(--text); font: 500 0.75rem/1 var(--mono); }
.rg-k { color: var(--text-mute); font-size: 0.75rem; margin-right: 4px; }
.rg-table td { text-align: left; white-space: normal; }
.rg-phases { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }
.rg-phase { padding: 14px; border-radius: 12px; background: var(--surface-2); }
.rg-phase header { display: flex; align-items: center; gap: 8px; }
.rg-phase h3 { margin: 0; font-size: 0.95rem; font-weight: 500; color: var(--text); }
.rg-progress { margin-left: auto; font: 0.8rem var(--mono); color: var(--text-mute); }
.rg-goal { margin: 8px 0 4px; font-size: 0.85rem; color: var(--text-dim); }
.rg-gate { margin: 0 0 10px; font-size: 0.8rem; color: var(--text-dim); }
.rg-tasks, .rg-decisions { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rg-tasks li, .rg-decisions li { display: grid; grid-template-columns: 64px 1fr; gap: 8px; align-items: start; font-size: 0.85rem; }
.rg-tasks p, .rg-decisions p { margin: 2px 0 0; color: var(--text-dim); font-size: 0.8rem; }
.rg-owner { margin-left: 6px; font-size: 0.72rem; color: var(--text-mute); }
@media (max-width: 760px) { .rg-flow, .rg-phases { grid-template-columns: 1fr; } }
.rg-result { color: var(--ok) !important; }
.rg-journal { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.rg-journal li { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-size: 0.85rem; color: var(--text-dim); }
.rg-journal li p { margin: 4px 0 0; }
.rg-journal-head { display: flex; align-items: center; gap: 8px; color: var(--text); }
.rg-strip { display: flex; gap: 1px; height: 18px; margin: 12px 0 4px; }
.rg-strip span { flex: 1; border-radius: 1px; background: var(--line); }
.rg-strip span[data-r="calm"] { background: var(--ok); opacity: 0.75; }
.rg-strip span[data-r="elevated"] { background: var(--warn); }
.rg-strip span[data-r="stress"] { background: var(--bad); }
.rg-oos { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); margin-bottom: 12px; }
.rg-bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin: 8px 0 4px; }
.rg-bar span { display: block; height: 100%; background: var(--ok); }
.rg-mini { width: 100%; margin: 6px 0; font-size: 0.78rem; border-collapse: collapse; table-layout: fixed; }
.rg-mini th { text-align: left; font-weight: 400; color: var(--text-mute); padding: 4px 4px; }
.rg-mini td { text-align: left; padding: 5px 4px; border-top: 1px solid var(--line); font-family: var(--mono); color: var(--text); vertical-align: top; }
.rg-mini td small { display: block; color: var(--text-mute); font-size: 0.7rem; }
.rg-mini th:first-child, .rg-mini td:first-child { width: 28%; font-family: inherit; }
.rg-oos .rg-phase header { align-items: baseline; }
.rg-oos .rg-progress { white-space: nowrap; }
.rg-last { margin: 10px 0 0; }
.rg-oos .rg-phase header { flex-wrap: wrap; row-gap: 2px; }
.mc-panel { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin: 0 0 16px; min-width: 0; color: var(--text); }
.mc-toggle { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; cursor: pointer; list-style: none; font-size: .76rem; min-height: 20px; }
.mc-toggle::-webkit-details-marker { display: none; }
.mc-toggle::before { content: '›'; font-size: 1.1rem; line-height: 1; color: var(--text-mute); }
.mc-disclosure[open] > .mc-toggle::before { transform: rotate(90deg); }
.mc-toggle > span:first-of-type { font-weight: 600; }
.mc-toggle-status { margin-left: auto; color: var(--text-dim); font-size: .7rem; }
.mc-toggle:focus-visible { outline: 2px solid var(--warn); outline-offset: 5px; border-radius: 3px; }
.mc-content { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 12px; }
.mc-eyebrow, .mc-reading, .mc-source, .mc-scale, .mc-stats, .mc-group { display: flex; justify-content: space-between; gap: 6px 12px; flex-wrap: wrap; }
.mc-eyebrow { font-size: .72rem; color: var(--text-dim); margin-bottom: 6px; }
.mc-eyebrow > span { color: var(--text-mute); }
.mc-reading { align-items: baseline; margin-bottom: 12px; }
.mc-reading > strong { font-size: 1.03rem; font-weight: 600; }
.mc-reading > span { color: var(--text-mute); font: .72rem var(--mono); }
.mc-reading .mc-score { font: 600 1.45rem var(--mono); color: var(--text); }
.mc-score small { font-size: .75rem; font-weight: 400; color: var(--text-mute); }
.mc-breadth, .mc-probabilities { display: flex; height: 8px; overflow: hidden; border-radius: 5px; background: var(--line); }
.mc-breadth [data-direction="down"], .mc-panel [data-state="stress"] { background: var(--bad); }
.mc-breadth [data-direction="flat"] { background: var(--text-mute); }
.mc-breadth [data-direction="up"], .mc-panel [data-state="calm"] { background: var(--ok); }
.mc-panel [data-state="elevated"] { background: var(--warn); }
.mc-scale { font-size: .65rem; color: var(--text-dim); margin-top: 6px; }
.mc-stats { font-size: .7rem; color: var(--text-dim); margin-top: 12px; }
.mc-stats b { color: var(--text); font: .75rem var(--mono); margin-left: 4px; }
.mc-source { margin-top: 9px; font-size: .65rem; line-height: 1.5; color: var(--text-mute); }
.mc-source a { color: var(--text-dim); text-underline-offset: 3px; }
.mc-context { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 10px; font: .7rem var(--mono); color: var(--text-dim); }
.mc-sentiment { border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 12px; }
.mc-sentiment-meter { position: relative; height: 8px; margin: 0 4px; border-radius: 5px; background: linear-gradient(to right, var(--bad), #d08a50 25%, var(--warn) 50%, #8cae72 75%, var(--ok)); }
.mc-sentiment-meter[data-unavailable] { opacity: .25; filter: grayscale(1); }
.mc-sentiment-meter > span { position: absolute; top: -4px; bottom: -4px; width: 3px; transform: translateX(-50%); border-radius: 3px; background: var(--text); box-shadow: 0 0 0 2px var(--surface-2); }
.mc-sentiment-history { display: flex; align-items: end; gap: 5px; height: 36px; margin-top: 8px; }
.mc-sentiment-history > span { flex: 1; display: flex; align-items: end; height: 100%; gap: 3px; }
.mc-sentiment-history i { flex: 1; border-radius: 2px; background: color-mix(in srgb, var(--text-mute) 30%, transparent); }
.mc-sentiment-history small { font: .58rem var(--mono); color: var(--text-mute); }
.mc-model { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; }
.mc-regime-history { display: flex; gap: 2px; height: 7px; margin-top: 10px; }
.mc-regime-history > span { flex: 1; min-width: 0; border-radius: 1px; }
.mc-model-date { display: block; color: var(--text-mute); font-size: .65rem; margin-top: 6px; }
.mc-details { font-size: .7rem; color: var(--text-dim); margin-top: 10px; }
.mc-details summary { cursor: pointer; width: fit-content; }
.mc-details p { line-height: 1.5; margin: 8px 0 0; }
.mc-group { margin-top: 8px; }
/* Allow a single card to shrink on phones; the original board minimum was 340px. */
@media (max-width: 600px) {
  .mb-grid { grid-template-columns: minmax(0, 1fr); }
  .mb-table { overflow-x: auto; }
  .mb-row { min-width: 300px; }
}
/* MarketBrief: the head of every market card. Every row is one line at a fixed height, so a
   row of cards lines up whatever each card says; long values truncate with the full text in a
   title. Theme tokens only (light + dark), terminal type (--t-sans, --t-mono). */
.mbf { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-bottom: 14px; min-width: 0; container-type: inline-size; }
.mbf-title { display: flex; align-items: center; gap: 8px; min-height: 24px; }
.mbf-title strong { font: 600 1rem/1.3 var(--t-sans); letter-spacing: -.01em; color: var(--text); }

.mbf-facts { display: grid; grid-template-columns: repeat(4, minmax(0, auto)); gap: 0; margin: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.mbf-facts > div { min-width: 0; padding: 7px 10px; }
.mbf-facts > div + div { border-left: 1px solid var(--line); }
.mbf-facts dt { font: .64rem/1.2 var(--t-sans); color: var(--text-mute); }
.mbf-facts dd { margin: 2px 0 0; font: 500 .76rem/1.3 var(--t-sans); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.mbf-line { display: flex; align-items: center; gap: 10px; height: 26px; min-width: 0; font: .76rem/1 var(--t-sans); color: var(--text-dim); white-space: nowrap; }
.mbf-label { flex: none; width: 64px; font-size: .68rem; color: var(--text-mute); }
.mbf-pills { display: flex; align-items: center; gap: 12px; min-width: 0; overflow: hidden; }
.mbf-pill-link { text-decoration: none; }
.mbf-pill-link:hover .t-pill { text-decoration: underline; text-underline-offset: 3px; }
.mbf-more, .mbf-none { color: var(--text-mute); overflow: hidden; text-overflow: ellipsis; }

.mbf-conditions { border-top: 1px solid var(--line); padding-top: 4px; }
.mbf-conditions > summary { cursor: pointer; list-style: none; border-radius: 6px; }
.mbf-conditions > summary::-webkit-details-marker { display: none; }
.mbf-conditions > summary::after { content: '›'; margin-left: auto; font-size: 1rem; color: var(--text-mute); transition: transform .15s; }
.mbf-conditions[open] > summary::after { transform: rotate(90deg); }
.mbf-conditions > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mbf-conditions > summary b { flex: none; font-weight: 600; color: var(--text); }
.mbf-conditions > summary b[data-tone=ok] { color: var(--ok); }
.mbf-conditions > summary b[data-tone=bad] { color: var(--bad); }
.mbf-num { flex: 0 1 auto; min-width: 0; font: .7rem/1 var(--t-mono); color: var(--text-mute); overflow: hidden; text-overflow: ellipsis; }

.mbf-bar { flex: none; display: flex; width: 56px; height: 6px; border-radius: 4px; overflow: hidden; background: var(--line); }
.mbf-bar-wide { width: auto; height: 8px; }
.mbf-bar i, .mbf-history i { display: block; height: 100%; }
.mbf [data-direction=down], .mbf [data-state=stress] { background: var(--bad); }
.mbf [data-direction=flat] { background: var(--text-mute); }
.mbf [data-direction=up], .mbf [data-state=calm] { background: var(--ok); }
.mbf [data-state=elevated] { background: var(--warn); }

.mbf-body { display: grid; gap: 14px; margin-top: 8px; padding: 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; }
.mbf-body section { display: grid; gap: 8px; min-width: 0; }
.mbf-body section + section { border-top: 1px solid var(--line); padding-top: 12px; }
.mbf-body h4 { margin: 0; font: 600 .72rem/1.3 var(--t-sans); color: var(--text-dim); }
.mbf-scale, .mbf-stats, .mbf-source, .mbf-group { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; font: .68rem/1.4 var(--t-sans); color: var(--text-dim); }
.mbf-stats b { margin-left: 4px; font: .74rem var(--t-mono); color: var(--text); }
.mbf-source { color: var(--text-mute); font-size: .64rem; }
.mbf-group b { font-weight: 500; color: var(--text); }
.mbf-context { display: flex; flex-wrap: wrap; gap: 4px 12px; font: .7rem var(--t-mono); color: var(--text-dim); }
.mbf-history { display: flex; gap: 2px; height: 7px; }
.mbf-history i { flex: 1; min-width: 0; border-radius: 1px; }
.mbf-why { font: .68rem/1.5 var(--t-sans); color: var(--text-dim); }
.mbf-why summary { cursor: pointer; width: fit-content; }
.mbf-why p { margin: 6px 0 0; }
/* The sentiment block brings its own panel styles; inside the brief it sits flat, under the
   brief's own heading, and its week reads as numbers: 70-74 drawn as bars is seven equal boxes. */
.mbf-body .mc-sentiment { border: 0; padding: 0; margin: 0; }
.mbf-body .mc-sentiment > .mc-eyebrow:first-child { display: none; }
.mbf-body .mc-sentiment-history { height: auto; justify-content: space-between; }
.mbf-body .mc-sentiment-history > span { flex: none; height: auto; }
.mbf-body .mc-sentiment-history i { display: none; }
.mbf-body .mc-sentiment-history small { font-size: .7rem; color: var(--text-dim); }

/* A narrow card (three across on a laptop, or a phone): facts go 2 by 2 and the strategies line
   reserves two lines. Every card in a row is the same width, so they all switch together and stay
   aligned; the query is on the brief's own width, not the window's. */
@container (max-width: 380px) {
  .mbf-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mbf-facts > div:nth-child(3) { border-left: 0; }
  .mbf-facts > div:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .mbf-strategies { height: 44px; align-items: flex-start; padding-top: 4px; white-space: normal; }
  .mbf-pills { flex-wrap: wrap; row-gap: 6px; }
  .mbf-label { width: 56px; }
}
/* Markets board (pages/MarketsBoard.tsx) */
/* Six cards in two rows of three, equal width and height, rows aligned across them: equities, crypto
   spot, perps; commodities, macro, the Polymarket window. Below ~1100px the cards stack. */
.mb-grid { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 12px; align-items: stretch; }
.mb-col { padding: 16px; display: flex; flex-direction: column; min-width: 0; }
@media (max-width: 1100px) { .mb-grid { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); } .mb-coins { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); } }
/* Same header height in every venue card so their rows line up even when one header carries a pill. */
.mb-col-head { display: flex; flex-wrap: wrap; align-items: baseline; align-content: flex-start; gap: 4px 8px; margin-bottom: 10px; min-height: 46px; }
.mb-col-head span { color: var(--text-mute); font-size: 0.78rem; }
.mb-table { display: grid; }
.mb-row { display: grid; grid-template-columns: 50px 78px 54px 48px minmax(0, 1fr); align-items: center; gap: 8px; height: 32px; box-sizing: border-box; border-top: 1px solid var(--line); font-size: 0.82rem; }
.mb-th { border-top: 0; color: var(--text-mute); font-size: 0.72rem; }
.mb-th span { white-space: nowrap; }
.mb-row[data-error] strong { color: var(--warn); }
.mb-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Hover a symbol or a column header for what it is: the shared Help popover, without its ? mark. */
.mb-row .phf-help-trigger { padding: 0; font-weight: inherit; text-decoration-color: var(--line-strong); }
.mb-th .phf-help-trigger { font-size: inherit; }
.mb-col-head .phf-help-trigger { align-self: center; }
.mb-held .mb-proxy { background: transparent; border: 1px dashed var(--line); color: var(--text-mute); }
.mb-num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
[data-tone="ok"].mb-num, .mb-held [data-tone="ok"] { color: var(--ok); }
[data-tone="bad"].mb-num, .mb-held [data-tone="bad"] { color: var(--bad); }
.mb-mini { width: 48px; height: 20px; }
.mb-mini path { fill: none; stroke-width: 1.5; vector-effect: non-scaling-stroke; stroke: var(--text-mute); }
.mb-mini path[data-tone="ok"] { stroke: var(--ok); }
.mb-mini path[data-tone="bad"] { stroke: var(--bad); }
.mb-held { display: flex; flex-wrap: nowrap; gap: 4px; min-width: 0; overflow: hidden; }
.mb-held small { white-space: nowrap; padding: 1px 5px; border-radius: 6px; background: var(--line); font-size: 0.7rem; font-family: var(--mono); flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.mb-coins { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mb-coin { padding: 10px; border-radius: 10px; background: var(--surface-2); display: grid; gap: 6px; font-size: 0.8rem; }
.mb-coin-head { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.mb-coin-head strong { margin-right: auto; }
.mb-odds { display: flex; justify-content: space-between; font: 0.72rem var(--mono); }
.mb-odds span:first-child { color: var(--ok); }
.mb-odds span:last-child { color: var(--bad); }
.mb-book { height: 6px; border-radius: 3px; overflow: hidden; background: color-mix(in srgb, var(--bad) 45%, transparent); }
.mb-book span { display: block; height: 100%; background: var(--ok); }
.mb-coin-foot { display: grid; gap: 2px; }
.mb-coin-foot small { font-size: 0.7rem; color: var(--text-dim); }
.mb-coin-foot small[data-live] { color: var(--bad); font-weight: 600; }
.mb-dim { color: var(--text-mute); }
.mb-foot { margin: auto 0 0; padding-top: 10px; font-size: 0.72rem; color: var(--text-mute); }
.mb-strip { height: 10px; margin: 0 0 10px; }
/* Coin window (pages/CoinWindow.tsx) */
.cw-nav { display: flex; gap: 6px; }
.cw-nav button { font: inherit; font-size: 0.8rem; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); cursor: pointer; }
.cw-nav button:disabled { opacity: 0.4; cursor: default; }
.cw-card { padding: 16px; margin-top: 12px; grid-template-columns: minmax(0, 1fr); }
.cw-card > * { min-width: 0; }
.cw-chart { width: 100%; height: 260px; display: block; }
.cw-up { height: 70px; margin-top: 12px; }
.cw-line { fill: none; stroke: var(--text); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.cw-upline { stroke: var(--ok); }
.cw-open { stroke: var(--text-mute); stroke-dasharray: 6 5; vector-effect: non-scaling-stroke; }
.cw-tick { stroke: var(--line); vector-effect: non-scaling-stroke; }
.cw-future { fill: var(--surface-2); opacity: 0.5; }
.cw-dot[data-r="hit"], .cw-arrow[data-r="hit"] { fill: var(--ok); stroke: var(--ok); }
.cw-dot[data-r="miss"], .cw-arrow[data-r="miss"] { fill: var(--bad); stroke: var(--bad); }
.cw-dot[data-r="wait"], .cw-arrow[data-r="wait"] { fill: var(--text-mute); stroke: var(--text-mute); }
.cw-arrow { stroke-width: 2; vector-effect: non-scaling-stroke; }
.cw-jev { font: 11px var(--mono); fill: var(--warn); }
.mb-coin-link { color: inherit; text-decoration: none; display: grid; gap: 6px; }
.mb-coin-link:hover .mb-coin-head strong { text-decoration: underline; }
.cw-dot[data-r="flat"] { fill: none; stroke: var(--text-mute); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.cw-arrow[data-r="flat"] { stroke: var(--text-mute); stroke-dasharray: 3 3; }
.cw-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.75rem; color: var(--text-dim); margin-bottom: 6px; }
.cw-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cw-sw { display: inline-block; width: 18px; height: 0; border-top: 2px solid var(--text); }
.cw-sw-open { border-top: 2px dashed var(--text-mute); }
.cw-sw-wait { border-top: 2px solid var(--text-mute); }
.cw-ok { color: var(--ok); } .cw-bad { color: var(--bad); } .cw-dim { color: var(--text-mute); } .cw-warn { color: var(--warn); }
.cw-plot { width: 100%; overflow: hidden; display: block; }
.cw-axis { font: 11px var(--mono); fill: var(--text-mute); }
.cw-axis-open { fill: var(--text-dim); }
.cw-now { stroke: var(--warn); stroke-width: 1; stroke-dasharray: 2 3; }
.cw-now-label { fill: var(--warn); }
.cw-fc circle { fill: var(--text-mute); stroke: none; }
.cw-fc line { stroke: var(--text-mute); stroke-width: 2; }
.cw-fc .cw-land { stroke-width: 1; stroke-dasharray: 2 2; }
.cw-fc[data-r="right"] circle, .cw-fc[data-r="right"] .cw-mark { fill: var(--ok); }
.cw-fc[data-r="right"] line { stroke: var(--ok); }
.cw-fc[data-r="wrong"] circle, .cw-fc[data-r="wrong"] .cw-mark { fill: var(--bad); }
.cw-fc[data-r="wrong"] line { stroke: var(--bad); }
.cw-fc[data-r="flat"] circle, .cw-fc[data-r="no call"] circle { fill: none; stroke: var(--text-mute); stroke-width: 1.5; }
.cw-mark { font: 600 13px var(--sans, sans-serif); fill: var(--text-mute); }
.cw-headpath { fill: context-stroke; }
/* Coin window log console */
.cw-log { margin-top: 14px; }
.cw-log summary { cursor: pointer; font-size: 0.8rem; color: var(--text-dim); }
.cw-log-lines { margin-top: 8px; max-height: 280px; overflow: auto; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); font: 0.72rem/1.55 var(--mono); }
.cw-log-lines div { display: grid; grid-template-columns: 70px 50px 1fr; gap: 8px; color: var(--text-dim); }
.cw-log-lines b { font-weight: 500; color: var(--text-mute); }
.cw-log-lines [data-kind="error"] { color: var(--bad); }
.cw-log-lines [data-kind="grade"] b { color: var(--ok); }
.cw-log-lines [data-kind="fetch"] b { color: var(--warn); }
/* Jev's calls on the window chart */
.cw-sw-jev { border-top: 3px solid var(--accent, #8b7cf6); }
.cw-sw-rule { border-top: 1px dashed var(--text-mute); }
.cw-rule circle { r: 2.5; } .cw-rule line { stroke-width: 1; stroke-dasharray: 3 3; opacity: 0.55; } .cw-rule .cw-mark { opacity: 0.5; font-size: 10px; }
.cw-jv circle { fill: var(--accent, #8b7cf6); }
.cw-jv line { stroke: var(--accent, #8b7cf6); stroke-width: 2.5; }
.cw-jv .cw-land { stroke-width: 1; stroke-dasharray: 2 2; }
.cw-jv .cw-mark { font: 600 12px var(--mono); fill: var(--accent, #8b7cf6); }
.cw-jv[data-r="right"] line, .cw-jv[data-r="right"] circle { stroke: var(--ok); fill: var(--ok); }
.cw-jv[data-r="right"] .cw-mark { fill: var(--ok); }
.cw-jv[data-r="wrong"] line, .cw-jv[data-r="wrong"] circle { stroke: var(--bad); fill: var(--bad); }
.cw-jv[data-r="wrong"] .cw-mark { fill: var(--bad); }
.cw-log-lines [data-kind="jev"] b { color: var(--accent, #8b7cf6); }
.cw-h3 { margin: 0 0 4px; font-size: 0.95rem; font-weight: 500; }
.cw-archive { max-height: 360px; overflow: auto; margin-top: 8px; }
.cw-archive tr[data-current] td { background: var(--surface-2); }
.cw-open-btn { font: inherit; font-size: 0.75rem; padding: 3px 8px; border-radius: 6px; border: 1px solid var(--line); background: transparent; color: var(--text); cursor: pointer; }
.cw-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; font-size: 0.78rem; }
.cw-tabs button { font: inherit; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--text-dim); cursor: pointer; }
.cw-tabs button[aria-selected="true"] { background: var(--surface-2); color: var(--text); border-color: var(--text-mute); }
.cw-calib-box { fill: none; stroke: var(--line); } .cw-calib-diag { stroke: var(--text-mute); stroke-dasharray: 2 2; }
.cw-calib-dot { fill: var(--accent, #c9a227); opacity: 0.8; }
tr.cw-first td { border-top: 1px solid var(--line); }
.mb-coin-foot small.mb-model { color: var(--text); font-family: var(--mono); }
/* The whole coin card is one link into its window; the CTA says so. */
.mb-coin { padding: 0; }
.mb-coin-link { padding: 10px; border-radius: 10px; cursor: pointer; transition: background 0.15s; }
.mb-coin-link:hover { background: color-mix(in srgb, var(--text) 5%, var(--surface-2)); }
.mb-coin-cta { justify-self: end; font-size: 0.74rem; font-weight: 600; color: var(--text-dim); }
.mb-coin-link:hover .mb-coin-cta { color: var(--text); }
/* Next-30s post-mortem (pages/Next30Postmortem.tsx) */
.pm-card { border-left: 3px solid var(--warn); }
.pm-status { font-size: 0.85rem; color: var(--text-dim); margin: 4px 0 8px; }
.pm-h4 { margin: 16px 0 6px; font-size: 0.85rem; font-weight: 600; }
.pm-list { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 0.85rem; line-height: 1.5; }
.pm-card .t-scroll + .t-scroll { margin-top: 10px; }
.pm-flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; counter-reset: pm; }
.pm-flow li { position: relative; padding: 10px; border-radius: 10px; background: var(--surface-2); display: grid; gap: 4px; align-content: start; font-size: 0.78rem; line-height: 1.45; color: var(--text-dim); }
.pm-flow li b { color: var(--text); font-size: 0.8rem; }
.pm-flow li b::before { counter-increment: pm; content: counter(pm) " · "; color: var(--text-mute); }
.pm-flow li:not(:last-child)::after { content: "→"; position: absolute; right: -8px; top: 10px; color: var(--text-mute); }
@media (max-width: 1100px) { .pm-flow { grid-template-columns: 1fr; } .pm-flow li:not(:last-child)::after { content: none; } }
.pm-card .t-table th, .pm-card .t-table td { text-align: left; }

/* Ticker page (/markets/:board/:symbol): every board row opens one. */
.mb-row[data-link] { cursor: pointer; }
.mb-row[data-link]:hover { background: color-mix(in srgb, var(--text) 4%, transparent); }
.mb-row strong a { color: inherit; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.mt-sib { font-size: 0.82rem; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; color: inherit; text-decoration: none; }
.mt-sib:hover { background: var(--surface-2); }
.mt-chart-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
/* The Polymarket window as one section of the coin's page. */
.cw-section { margin-top: 16px; scroll-margin-top: 16px; }
.cw-h2 { margin: 0; font-size: 1.05rem; font-weight: 600; }
.cw-inner { margin-top: 14px; }
.cw-fold { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.cw-fold > summary { cursor: pointer; font-size: 0.9rem; font-weight: 500; }

/* Instant ticker tooltip: what the instrument is and where its price comes from. */
.mb-row { position: relative; }
.mb-tip { display: none; position: absolute; left: 0; top: calc(100% - 2px); z-index: 30; width: min(340px, 90vw); padding: 8px 10px; border-radius: 8px; background: var(--surface, #fff); color: var(--text); border: 1px solid var(--line-strong); box-shadow: 0 6px 20px rgb(0 0 0 / 0.14); font-size: 0.76rem; line-height: 1.45; white-space: normal; pointer-events: none; }
.mb-tip b { display: block; margin-bottom: 3px; font-size: 0.8rem; }
.mb-tip em { display: block; margin-top: 4px; font-style: normal; color: var(--muted); }
.mb-row strong:hover ~ .mb-tip, .mb-row strong:focus-within ~ .mb-tip { display: block; }
/* Options section of a coin's ticker page (pages/OptionsPanel.tsx). */
.op-row { display: flex; flex-wrap: wrap; gap: 6px; }
.op-chip { font: inherit; font-size: 0.8rem; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text-mute); cursor: pointer; }
.op-chip:hover { color: var(--text); }
.op-chip[aria-pressed="true"] { color: var(--text); border-color: var(--text-mute); background: var(--surface); }
.op-structure { display: grid; gap: 2px; }
.op-structure strong { font: 600 1rem/1.3 var(--t-mono); color: var(--text); }
.op-structure .mb-foot { padding-top: 0; }
.op-table-wrap { overflow-x: auto; }
.op-table { width: 100%; border-collapse: collapse; font: .8rem/1.4 var(--t-mono); font-variant-numeric: tabular-nums; }
.op-table th { text-align: left; font: 500 .72rem/1.3 var(--t-sans); color: var(--text-mute); padding: 6px 10px 6px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
.op-table td { padding: 7px 10px 7px 0; border-bottom: 1px solid var(--line); color: var(--text); white-space: nowrap; }
.op-table td[data-tone="ok"] { color: var(--ok); }
.op-table td[data-tone="bad"] { color: var(--bad); }
.op-dim { color: var(--text-dim); font-size: .72rem; }
.op-payoff { width: 100%; min-width: 0; overflow: hidden; }
.op-payoff svg { display: block; }
.op-band { fill: var(--text); opacity: .05; }
.op-gain { fill: var(--ok); opacity: .16; }
.op-loss { fill: var(--bad); opacity: .16; }
.op-zero { stroke: var(--line); stroke-width: 1; }
.op-spot { stroke: var(--text-mute); stroke-width: 1; stroke-dasharray: 3 3; }
.op-line { fill: none; stroke: var(--text); stroke-width: 1.75; stroke-linejoin: round; }
.op-past { stroke: var(--text-mute); stroke-width: 1; opacity: .7; }
.op-be { fill: var(--surface); stroke: var(--text); stroke-width: 1.25; }
.op-tick { fill: var(--text-mute); font: 10px var(--t-mono); }
/* Paper scorecard (/paper). Series hue = categorical slot 1, validated by the dataviz palette
   validator on this app's surfaces (#2a78d6 on #ffffff, #3987e5 on #131319: all checks pass).
   The benchmark is a neutral dashed reference line, not a second hue. */
.ps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); gap: 16px; margin-top: 16px; }
.ps-card { --ps-series: #3987e5; padding: 16px; display: grid; gap: 10px; }
:root[data-theme="light"] .ps-card { --ps-series: #2a78d6; }
.ps-card[data-frozen] { opacity: .8; }
.ps-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ps-head strong { font-size: 1rem; }
.ps-sub { width: 100%; font-size: .8rem; color: var(--text-dim); }
.ps-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: .78rem; color: var(--text-dim); }
.ps-sw { display: inline-block; width: 16px; height: 0; vertical-align: middle; margin-right: 6px; border-top: 2px solid var(--ps-series); }
.ps-sw-bench { border-top: 2px dashed var(--text-dim); }
.ps-chart { position: relative; }
.ps-chart svg { width: 100%; height: auto; display: block; touch-action: none; }
.ps-line { fill: none; stroke: var(--ps-series); stroke-width: 2; stroke-linejoin: round; }
.ps-bench { fill: none; stroke: var(--text-dim); stroke-width: 2; stroke-dasharray: 5 4; }
.ps-rule { stroke: var(--line); stroke-width: 1; }
.ps-axis { fill: var(--text-dim); font-size: 11px; font-family: var(--font-mono, monospace); }
.ps-cross { stroke: var(--line-strong); stroke-width: 1; }
.ps-dot { fill: var(--ps-series); stroke: var(--surface-2); stroke-width: 2; }
.ps-dot-bench { fill: var(--text-dim); stroke: var(--surface-2); stroke-width: 2; }
.ps-tip { position: absolute; top: 4px; transform: translateX(-50%); display: grid; gap: 2px; padding: 6px 8px; font-size: .75rem;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--line-strong); border-radius: 6px; pointer-events: none; white-space: nowrap; }
.ps-empty { font-size: .85rem; color: var(--text-dim); margin: 8px 0; }
.ps-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px 12px; margin: 0; }
.ps-facts div { display: grid; gap: 2px; }
.ps-facts dt { font-size: .72rem; color: var(--text-dim); }
.ps-facts dd { margin: 0; font-family: var(--font-mono, monospace); font-size: .88rem; }
.ps-facts dd small { color: var(--text-dim); font-size: .72rem; }
.ps-note { margin: 0; font-size: .78rem; color: var(--text-dim); line-height: 1.5; }
.ps-notes { margin: 0; padding-left: 18px; font-size: .75rem; color: var(--text-dim); }
.ps-table summary { cursor: pointer; font-size: .78rem; color: var(--text-dim); }
.ps-table table { margin-top: 6px; }
.phf-console-main { gap:24px; }
.phf-console-main > .phf-build-nav { margin:0; padding:6px; border:1px solid var(--line); border-radius:14px; gap:4px; background:var(--surface); }
.phf-console-nav-item { display:inline-flex; align-items:center; gap:2px; border-radius:9px; }
.phf-console-nav-item[data-active=true] { background:var(--surface-2); }
.phf-console-main .phf-build-nav a { min-height:44px; padding:8px 14px; font-size:.8rem; border-radius:9px; }
.phf-console-main .phf-build-nav a[aria-current=page] { background:transparent; box-shadow:none; color:var(--accent); }
.phf-console-nav-item .phf-help-trigger { margin-right:8px; }
.phf-console-heading { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:16px; padding:4px 0 20px; margin:0; border-bottom:1px solid var(--line); }
.phf-console-eyebrow { margin:0 0 8px; color:var(--accent); font-size:.65rem; letter-spacing:.14em; text-transform:uppercase; }
.phf-console-title { display:flex; align-items:center; gap:12px; }
.phf-console-main .phf-console-title h1 { margin:0; color:var(--text); font-size:clamp(1.6rem,2.1vw,2rem); line-height:1.2; font-weight:500; letter-spacing:-.035em; }
.phf-console-heading-actions { display:flex; flex-wrap:wrap; align-items:center; justify-content:flex-end; gap:12px; font-size:.8rem; }
.phf-console-heading-status { display:flex; flex-wrap:wrap; align-items:center; gap:10px; color:var(--text-mute); font-size:.75rem; }
.phf-console-main > div, .phf-console-main > main { max-width:none; margin:0; }
.phf-console-main .phf-runtime-stack { gap:24px; }
.phf-console-main .phf-rule-saved { margin:0; padding:12px 0; }
.phf-console-main .phf-rule-saved select { min-height:44px; }
.phf-console-main > .phf-runtime-stack > .phf-view-nav { padding:4px; background:transparent; border-bottom:1px solid var(--line); border-radius:0; }
.phf-console-main .phf-help-card { border-radius:14px; }
@media(max-width:640px) { .phf-console-main { gap:20px; } .phf-console-main .phf-build-nav a { padding:8px 10px; font-size:.75rem; } .phf-console-heading-actions { justify-content:flex-start; } .phf-console-heading { padding-bottom:16px; } }
/* Instruments page additions; the base table and tabs are in shared/phf.css. */
.phf-universe-scopes .ins-count { margin-left: 8px; padding: 2px 7px; border-radius: 999px; background: var(--surface-2); font: 500 .72rem/1 var(--t-mono, monospace); color: var(--text-mute); }
.phf-universe-scopes button[aria-pressed=true] .ins-count { color: var(--accent); }
.ins-books { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.ins-book { padding: 3px 8px; border-radius: 6px; background: var(--surface-2); font-size: .75rem; color: var(--text); white-space: nowrap; }
.ins-book[data-on="false"] { color: var(--text-mute); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--text-mute) 60%, transparent); }
.ins-note { font-size: .78rem; color: var(--text-mute); }
.ins-held { display: block; width: fit-content; margin-top: 4px; padding: 2px 7px; border-radius: 6px; font-size: .7rem; font-weight: 600; letter-spacing: .03em; color: var(--ok); background: color-mix(in srgb, var(--ok) 13%, transparent); }
.phf-instruments-actions a { display: inline-flex; align-items: center; gap: 3px; }
.phf-halt-controls { min-width:0; }
.phf-halt-heading { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:16px; }
.phf-halt-account { color:var(--text-mute); font-size:.75rem; margin-bottom:6px; }
.phf-halt-heading h2 { display:flex; align-items:center; gap:10px; font-weight:500; font-size:1.05rem; color:var(--text); }
.phf-halt-description { margin:16px 0; color:var(--text-dim); font-size:.85rem; line-height:1.65; }
.phf-halt-actions, .phf-halt-confirm { display:flex; flex-wrap:wrap; align-items:center; gap:12px; }
.phf-halt-confirm { width:100%; border:1px solid var(--line-strong); border-radius:10px; padding:16px; }
.phf-halt-confirm > span { flex-basis:100%; font-size:.85rem; }
.phf-halt-note, .phf-halt-observed { color:var(--text-mute); font-size:.75rem; margin-top:12px; }
.phf-halt-message { color:var(--warn); font-size:.8rem; margin-top:12px; }
.phf-halt-error { color:var(--bad); font-size:.8rem; margin-top:12px; }
.phf-workspace-status { position:relative; }
.phf-status-panel { text-align:left; position:absolute; top:calc(100% + .75rem); right:0; z-index:50; width:min(400px,calc(100vw - 32px)); padding:1.25rem; background:var(--surface); color:var(--text); border:1px solid var(--line-strong); border-radius:16px; box-shadow:0 12px 36px #0003; }
.phf-status-panel h2 { font-size:1rem; margin:0 0 1rem; }
.phf-status-panel dl > div { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:.5rem; padding:.65rem 0; border-bottom:1px solid var(--line); font-size:.8rem; }
.phf-status-panel dd { margin:0; color:var(--text-dim); }
.phf-status-panel p { font-size:.75rem; line-height:1.6; color:var(--text-mute); margin:1rem 0; }
.phf-status-panel footer { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:.5rem; font-size:.7rem; color:var(--text-mute); }
.phf-status-panel footer button { color:var(--accent); min-height:44px; cursor:pointer; }
.phf-workspace-status button:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
@media(max-width:640px) { .phf-status-panel { position:fixed; top:100px; right:16px; max-height:calc(100dvh - 116px); overflow-y:auto; } }


.phf-workspace-bar .phf-bar-context { flex:0 1 180px; font-weight:500; }
.phf-workspace-bar .phf-header-right { flex:1 1 650px; min-width:0; margin-left:0; }
.phf-workspace-bar .phf-header-right > .phf-workspace-status { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); width:100%; min-width:0; padding:0; border:0; border-radius:0; background:transparent; gap:8px; }
.phf-workspace-status .phf-status-tile { display:flex; align-items:center; gap:10px; min-height:58px; padding:10px 12px; border:1px solid transparent; border-radius:12px; background:var(--surface-2); color:var(--text-dim); text-decoration:none; text-align:left; cursor:pointer; min-width:0; transition:background .15s,border-color .15s; }
.phf-status-tile:hover { border-color:var(--line-strong); background:var(--surface); }
.phf-status-tile > svg { flex-shrink:0; color:var(--text-mute); }
.phf-status-tile > span:not(.phf-status-tile-arrow) { min-width:0; flex:1; }
.phf-status-tile small { display:block; color:var(--text-mute); font-size:.62rem; line-height:1.5; }
.phf-status-tile strong { display:block; color:var(--text); font-size:.75rem; line-height:1.4; font-weight:500; }
.phf-status-tile[data-state=ok] > svg { color:var(--ok); }
.phf-status-tile[data-state=attention] > svg { color:var(--warn); }
.phf-status-tile-arrow { opacity:.55; flex-shrink:0; }
.phf-status-tile:hover .phf-status-tile-arrow { opacity:1; }
.phf-status-tile:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
.phf-status-manage-link { display:inline-flex; align-items:center; min-height:44px; color:var(--accent); font-size:.8rem; }
.phf-operation-settings { display:grid; gap:20px; }
.phf-operation-settings-nav { display:flex; flex-wrap:wrap; gap:8px; }
.phf-operation-settings-nav a { display:inline-flex; align-items:center; min-height:44px; padding:8px 14px; border:1px solid var(--line); border-radius:10px; text-decoration:none; font-size:.8rem; }
.phf-operation-settings-nav a[aria-current=page] { background:var(--accent-soft); border-color:var(--accent); }
.phf-operation-section { scroll-margin-top:24px; outline:none; }
.phf-operation-heading { display:flex; align-items:center; gap:10px; }
.phf-operation-heading h2 { margin:0; font-size:1.05rem; font-weight:500; }
.phf-operation-section > p { max-width:70ch; line-height:1.7; font-size:.85rem; color:var(--text-mute); margin:12px 0; }
.phf-operation-section > .phf-operation-value { color:var(--text); font-weight:500; }
.phf-operation-actions { display:flex; flex-wrap:wrap; gap:10px; margin-top:18px; }
.phf-operation-health { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; margin-top:20px; }
.phf-operation-health dt { font-size:.75rem; color:var(--text-mute); }
.phf-operation-health dd { margin:8px 0 0; font-size:.85rem; }
@media(max-width:1200px) { .phf-workspace-bar .phf-bar-context { flex:1 1 100%; } .phf-workspace-bar .phf-header-right { flex-basis:100%; } }
@media(max-width:640px) { .phf-workspace-bar .phf-header-right > .phf-workspace-status { grid-template-columns:repeat(2,minmax(0,1fr)); } .phf-workspace-status .phf-status-tile { padding:10px; gap:8px; } .phf-status-tile-arrow { display:none; } .phf-operation-health { grid-template-columns:1fr; } }
/* Sidebar icons (2026-10-01). Unlayered so it sits above the `components` layer rules in
   trading.css, which spread a nav link's children to both edges and hide its <span>s. */
.phf-sidebar .phf-navlink.phf-nav-icon,
.phf-sidebar-footer button.phf-nav-icon { justify-content: flex-start; gap: 0.7rem; }
.phf-nav-icon > svg { flex: none; width: 18px; height: 18px; opacity: 0.75; }
.phf-nav-icon.active > svg, .phf-nav-icon:hover > svg { opacity: 1; }
/* Nav links carry a 1px transparent border; match it so footer icons line up. */
.phf-sidebar-footer button.phf-nav-icon { border: 1px solid transparent; }

/* Nav labels are spans; trading.css fades every span in a nav link unless active. */
.phf-sidebar .phf-navlink span.phf-nav-text { opacity: 1; }

/* Collapsible sidebar (2026-10-02). Desktop only: below 761px the sidebar is the slide-out menu. */
.phf-workspace-shell { transition: grid-template-columns 0.18s ease; }
@media (max-width: 760px) { .phf-sidebar-collapse { display: none !important; } }
@media (min-width: 761px) {
  .phf-workspace-shell[data-sidebar="collapsed"] { grid-template-columns: 68px minmax(0, 1fr); }
  [data-sidebar="collapsed"] .phf-sidebar { padding-inline: 10px; overflow-x: hidden; }
  [data-sidebar="collapsed"] .phf-wordmark { display: none; }
  [data-sidebar="collapsed"] .phf-nav-text { display: none; }
  [data-sidebar="collapsed"] .phf-sidebar .phf-navlink.phf-nav-icon,
  [data-sidebar="collapsed"] .phf-sidebar-footer button.phf-nav-icon { justify-content: center; padding-inline: 0; gap: 0; }
  [data-sidebar="collapsed"] .phf-more-rail { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); display: grid; gap: 4px; }
}
/* Settings: one structure. Summary strip, sticky section menu, and sections whose
   rows share a single three-column anatomy. Theme tokens only (light + dark). */
.phf-sh { max-width: none; margin-inline: 0; padding-bottom: 48px; display: grid; gap: 24px; }
.phf-sh-head p { margin: 6px 0 0; color: var(--text-dim); font-size: .9rem; line-height: 1.6; }
.phf-sh code { font-family: var(--mono); font-size: .78rem; color: var(--text-dim); overflow-wrap: anywhere; }

/* Summary strip */
.phf-sh-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.phf-sh-tile { position: relative; overflow: hidden; display: grid; gap: 2px; padding: 18px 18px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); text-decoration: none; transition: border-color .15s; }
.phf-sh-tile::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--line-strong); }
.phf-sh-tile:hover { border-color: var(--line-strong); }
.phf-sh-tile small { font-size: var(--label-size, .7rem); letter-spacing: .1em; text-transform: uppercase; color: var(--text-mute); }
.phf-sh-tile strong { font-size: 1.15rem; font-weight: 600; margin-top: 4px; }
.phf-sh-tile span { font-size: .8rem; color: var(--text-dim); }
.phf-sh-tile[data-tone=ok]::before { background: var(--ok); }
.phf-sh-tile[data-tone=ok] strong { color: var(--ok); }
.phf-sh-tile[data-tone=warn]::before { background: var(--warn); }
.phf-sh-tile[data-tone=bad]::before { background: var(--bad); }
.phf-sh-tile[data-tone=bad] strong { color: var(--bad); }

/* Layout: section menu + content */
.phf-sh-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 32px; align-items: start; }
.phf-sh-nav { position: sticky; top: 96px; display: grid; gap: 2px; }
.phf-sh-nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-sm); color: var(--text-dim); text-decoration: none; font-size: .86rem; border-left: 2px solid transparent; }
.phf-sh-nav a:hover { color: var(--text); background: var(--surface-2); }
.phf-sh-nav a[aria-current=true] { color: var(--text); background: var(--surface-2); border-left-color: var(--accent); }
.phf-sh-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); flex-shrink: 0; }
.phf-sh-dot[data-tone=ok] { background: var(--ok); }
.phf-sh-dot[data-tone=warn] { background: var(--warn); }
.phf-sh-dot[data-tone=bad] { background: var(--bad); }
.phf-sh-main { display: grid; gap: 24px; min-width: 0; }

/* Section card */
.phf-sh-section { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-card); overflow: hidden; scroll-margin-top: 96px; }
.phf-sh-section-head { padding: 22px 28px; border-bottom: 1px solid var(--line); }
.phf-sh-section-head h2 { margin: 0; font-size: 1.05rem; font-weight: 600; color: var(--text); }
.phf-sh-section-head p { margin: 6px 0 0; font-size: .84rem; line-height: 1.6; color: var(--text-dim); max-width: 72ch; }

/* The one row anatomy */
.phf-sh-row { display: grid; grid-template-columns: minmax(200px, 1.1fr) minmax(220px, 1.35fr) minmax(190px, .95fr); gap: 10px 28px; padding: 20px 28px; border-left: 3px solid transparent; scroll-margin-top: 96px; }
.phf-sh-row + .phf-sh-row { border-top: 1px solid var(--line); }
.phf-sh-row:focus { outline: none; background: var(--surface-2); }
.phf-sh-row[data-tone=warn] { border-left-color: var(--warn); }
.phf-sh-row[data-tone=bad] { border-left-color: var(--bad); }
.phf-sh-what h3 { margin: 0; font-size: .95rem; font-weight: 600; color: var(--text); }
.phf-sh-what p { margin: 5px 0 0; font-size: .8rem; line-height: 1.55; color: var(--text-mute); }
.phf-sh-details { margin: 0; display: grid; gap: 6px; font-size: .82rem; align-content: start; }
.phf-sh-details div { display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 10px; }
.phf-sh-details dt { color: var(--text-mute); }
.phf-sh-details dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }
.phf-sh-state { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; font-size: .82rem; }
.phf-sh-pill { font-size: .72rem; font-weight: 600; letter-spacing: .02em; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--text-dim); }
.phf-sh-pill[data-tone=ok] { color: var(--ok); border-color: var(--ok); }
.phf-sh-pill[data-tone=warn] { color: var(--warn); border-color: var(--warn); }
.phf-sh-pill[data-tone=bad] { color: var(--bad); border-color: var(--bad); }
.phf-sh-text { color: var(--text); line-height: 1.45; }
.phf-sh-sub { color: var(--text-mute); line-height: 1.45; }
.phf-sh-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.phf-sh-notes { grid-column: 1 / -1; margin: 0; padding-left: 18px; font-size: .78rem; line-height: 1.55; color: var(--text-mute); }
.phf-sh-body { grid-column: 1 / -1; }
.phf-sh-foot { margin: 0; padding: 14px 28px; border-top: 1px solid var(--line); font-size: .8rem; color: var(--text-mute); }

/* Permissions, inside the Account section */
.phf-sh-perms { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 24px; margin-top: 8px; }
.phf-sh-perms h4 { margin: 0 0 6px; font-size: .7rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--text-mute); }
.phf-sh-perms ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.phf-sh-perms li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.phf-sh-perms li span { display: grid; gap: 2px; }
.phf-sh-perms strong { font-size: .82rem; font-weight: 500; color: var(--text); }
.phf-sh-perms small { font-size: .74rem; color: var(--text-mute); }
.phf-sh-perms em { font-style: normal; font-size: .74rem; color: var(--text-mute); white-space: nowrap; }
.phf-sh-perms li[data-allowed=true] em { color: var(--ok); }

@media (max-width: 1100px) {
  .phf-sh-layout { grid-template-columns: 1fr; }
  .phf-sh-nav { position: static; display: flex; flex-wrap: wrap; gap: 6px; }
  .phf-sh-nav a { border-left: 0; border: 1px solid var(--line); }
  .phf-sh-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); }
  .phf-sh-state { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
  .phf-sh-actions { margin-top: 0; }
  .phf-sh-perms { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .phf-sh-summary { grid-template-columns: 1fr 1fr; }
  .phf-sh-section-head, .phf-sh-row, .phf-sh-foot { padding-left: 16px; padding-right: 16px; }
  .phf-sh-row { grid-template-columns: 1fr; }
  .phf-sh-perms { grid-template-columns: 1fr; }
}

/* The theme picker sits in a row's state column, which can be as narrow as 190px. Its
   cards were a fixed 120px each and would not shrink, so the pair overflowed the column
   and the section's overflow:hidden clipped Dark off the card. Let them share the column
   (three-column layout only; below 760px the picker gets the whole row). */
@container (min-width: 761px) {
  .phf-sh-state:has(.phf-settings-themes) { min-width: 0; }
  .phf-sh-actions:has(.phf-settings-themes) { align-self: stretch; min-width: 0; }
  .phf-sh-actions .phf-settings-themes { width: 100%; min-width: 0; flex-shrink: 1; }
  .phf-sh-actions .phf-settings-themes button { flex: 1 1 0; width: auto; min-width: 0; max-width: 140px; }
}

/* The row grid's three columns need a card at least ~722px wide (200 + 220 + 190 minimums,
   gaps, padding). The breakpoints above follow the viewport, but beside the 200px nav the
   card is narrower than that on viewports a little over 1100px, so every row overflowed and
   the section clipped it: Dark in Appearance, the third permissions column. Follow the
   card's own width instead. */
.phf-sh-section { container-type: inline-size; }
@container (max-width: 760px) {
  .phf-sh-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); }
  .phf-sh-state { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
  .phf-sh-actions { margin-top: 0; }
  .phf-sh-perms { grid-template-columns: 1fr 1fr; }
}
@container (max-width: 520px) {
  .phf-sh-row { grid-template-columns: 1fr; }
  .phf-sh-perms { grid-template-columns: 1fr; }
}
.rq-page { display: grid; gap: 20px; color: var(--text); min-width: 0; }
.rq-page p, .rq-page h2, .rq-page h3 { margin: 0; }
.rq-context, .rq-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; color: var(--text-mute); font-size: .78rem; }
.rq-page a { color: var(--accent); }
.rq-controls { display: flex; gap: 16px; align-items: end; flex-wrap: wrap; }
.rq-page label { display: grid; gap: 8px; font-size: .8rem; }
.rq-search { flex: 1; min-width: 180px; }
.rq-page input, .rq-page select, .rq-page textarea { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); padding: 10px 12px; font: inherit; max-width: 100%; }
.rq-page textarea { min-height: 90px; resize: vertical; width: 100%; box-sizing: border-box; }
.rq-button { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; background: var(--surface); color: var(--text); cursor: pointer; font: inherit; font-size: .8rem; }
.rq-button:disabled { opacity: .5; cursor: default; }
.rq-layout { display: grid; grid-template-columns: minmax(240px, .85fr) minmax(0, 1.5fr); gap: 24px; align-items: start; }
.rq-list { display: grid; gap: 8px; max-height: 78vh; overflow-y: auto; padding: 3px; }
.rq-item { display: grid; gap: 12px; text-align: left; padding: 16px; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 12px; cursor: pointer; font: inherit; }
.rq-item[aria-pressed=true] { border-color: var(--accent); background: var(--surface-2); }
.rq-item-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: .9rem; line-height: 1.5; }
.rq-page small { display: block; color: var(--text-mute); font-size: .75rem; line-height: 1.5; }
.rq-detail { display: grid; gap: 18px; padding: 24px; border: 1px solid var(--line); background: var(--surface); border-radius: 16px; min-width: 0; }
.rq-detail h2 { font-size: 1.15rem; line-height: 1.5; font-weight: 500; }
.rq-detail h3 { font-size: .85rem; font-weight: 600; }
.rq-detail p, .rq-coverage p { font-size: .85rem; line-height: 1.65; overflow-wrap: anywhere; }
.rq-caution { color: var(--text-mute); font-size: .8rem; border-left: 2px solid var(--accent); padding-left: 12px; }
.rq-detail details, .rq-detail form { border-top: 1px solid var(--line); padding-top: 16px; }
.rq-page summary { cursor: pointer; font-size: .82rem; }
.rq-page details[open] > * + * { margin-top: 14px; }
.rq-detail form { display: grid; gap: 14px; }
.rq-detail form .rq-button { justify-self: start; }
.rq-sources { padding-left: 18px; display: grid; gap: 16px; font-size: .82rem; overflow-wrap: anywhere; }
.rq-page :is(button,a,input,textarea,select,summary):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (max-width: 800px) { .rq-layout { grid-template-columns: minmax(0, 1fr); } .rq-list { max-height: 300px; } .rq-detail { padding: 18px; } }
/* Correlations page. Brand tokens only; --data-gain / --data-loss are the
   validated blue/red diverging pair, mixed toward --surface-2 for the midpoint. */
.phf-corr h2 { margin: 0; font-size: 1rem; font-weight: 500; color: var(--text); }
.phf-corr h3 { margin: 20px 0 8px; font-size: .8rem; font-weight: 500; color: var(--text-dim); letter-spacing: .02em; }
.phf-corr-muted { color: var(--text-mute); font-size: .8rem; }
.phf-corr-bad { color: var(--bad); font-size: .85rem; }
.phf-corr-lede { margin: 0; max-width: 78ch; color: var(--text-dim); line-height: 1.55; }
.phf-corr-lede code, .phf-corr-list code, .phf-corr-table code, .phf-corr-dl code { font-family: var(--mono); font-size: .8em; }
.phf-corr-note { margin: 16px 0 0; padding: 12px 16px; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 0 12px 12px 0; font-size: .85rem; line-height: 1.5; }
.phf-corr-quote { margin: 0 0 16px; padding: 12px 16px; border-left: 3px solid var(--accent); font-style: italic; color: var(--text-dim); }
.phf-corr-columns { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); align-items: start; }
.phf-corr-card { min-width: 0; padding: var(--card-pad-y) var(--card-pad-x); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-card); }
.phf-corr-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.phf-corr-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.phf-corr-table th { text-align: left; padding: 6px 8px; font-weight: 500; font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text-mute); border-bottom: 1px solid var(--line); }
.phf-corr-table td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; line-height: 1.45; }
.phf-corr-table td.num, .phf-corr-table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.phf-corr-table tbody tr[class] { cursor: default; }
.phf-corr-table tbody tr.selected td { background: var(--surface-2); }
[data-testid="top-pairs"] tbody tr { cursor: pointer; }
[data-testid="top-pairs"] td:first-child { white-space: nowrap; }
[data-testid="top-pairs"] tbody tr:hover td { background: var(--surface-2); }
.phf-corr-flip { color: var(--data-loss); font-weight: 500; }
.phf-corr-bar { display: inline-block; width: 96px; height: 8px; border-radius: 4px; background: var(--surface-2); vertical-align: middle; overflow: hidden; }
.phf-corr-bar-fill { display: block; height: 100%; border-radius: 4px; background: var(--data-gain); }
.phf-corr-bar-fill[data-sign="neg"] { background: var(--data-loss); }
.phf-corr-heatmap { border-collapse: separate; border-spacing: 2px; font-size: .65rem; font-family: var(--mono); }
.phf-corr-heatmap th { font-weight: 500; color: var(--text-mute); padding: 2px; white-space: nowrap; }
.phf-corr-heatmap thead th { height: 64px; vertical-align: bottom; }
.phf-corr-heatmap thead th span { display: inline-block; transform: rotate(-60deg) translate(-4px, 12px); transform-origin: left bottom; width: 12px; }
.phf-corr-heatmap tbody th { text-align: right; padding-right: 6px; }
.phf-corr-heatmap td { width: 18px; height: 18px; min-width: 18px; border-radius: 3px; background: var(--surface-2); cursor: pointer; }
.phf-corr-heatmap td.diag { background: var(--line); cursor: default; }
.phf-corr-heatmap td.active { outline: 2px solid var(--accent); outline-offset: -1px; }
.phf-corr-heatmap td:hover { outline: 2px solid var(--text); outline-offset: -1px; }
.phf-corr-legend { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: .7rem; color: var(--text-mute); font-variant-numeric: tabular-nums; }
.phf-corr-legend-ramp { flex: 0 0 160px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--data-loss), var(--surface-2), var(--data-gain)); }
.phf-corr-chart { margin-top: 12px; }
.phf-corr-details { font-size: .8rem; color: var(--text-mute); }
.phf-corr-details pre { margin-top: 8px; max-width: 100%; overflow: auto; font-size: .7rem; }
.phf-corr-dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; margin: 0; font-size: .85rem; line-height: 1.5; }
.phf-corr-dl dt { color: var(--text-mute); font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; padding-top: 3px; }
.phf-corr-dl dd { margin: 0; }
.phf-corr-list { margin: 0; padding-left: 20px; font-size: .85rem; line-height: 1.55; }
.phf-corr-list li + li { margin-top: 8px; }
.phf-corr-findings { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.phf-corr-findings section { padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.phf-corr-findings h3 { margin: 0 0 6px; color: var(--text); }
.phf-corr-findings p { margin: 0; font-size: .82rem; line-height: 1.5; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 640px) { .phf-corr-card { padding: var(--card-pad-y-sm) var(--card-pad-x-sm); } .phf-corr-bar { width: 48px; } }
/* Market calendar. Category colour is an accent on a neutral row, never the
   only carrier: every row also names its category in text. */
.phf-cal h2 { margin: 0; font-size: 1rem; font-weight: 500; color: var(--text); }
.phf-cal-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.phf-cal-chips button { min-height: 36px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text-dim); font: inherit; font-size: .78rem; cursor: pointer; }
.phf-cal-chips button.active { background: var(--text); color: var(--surface); border-color: var(--text); }
.phf-cal-count { margin: 0; color: var(--text-mute); font-size: .78rem; }
.phf-cal-timeline { display: grid; gap: 24px; }
.phf-cal-month { display: grid; gap: 8px; }
.phf-cal-month h2 { position: sticky; top: 0; z-index: 1; padding: 8px 0; background: var(--ink); font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text-mute); border-bottom: 1px solid var(--line); }
.phf-cal-event { border: 1px solid var(--line); border-left-width: 4px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-card); overflow: hidden; }
.phf-cal-event.impact-3 { border-left-color: var(--text); }
.phf-cal-event.impact-2 { border-left-color: var(--accent); }
.phf-cal-event.impact-1 { border-left-color: var(--line-strong); }
.phf-cal-event[data-confidence="expected"] { border-style: dashed; border-left-style: solid; }
.phf-cal-event-head { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 16px; align-items: start; width: 100%; padding: 12px 16px; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.phf-cal-event-head:hover { background: var(--surface-2); }
.phf-cal-date { display: grid; line-height: 1.1; }
.phf-cal-date strong { font-size: 1.5rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.phf-cal-date span { font-size: .7rem; color: var(--text-mute); text-transform: uppercase; letter-spacing: .06em; }
.phf-cal-date small { font-size: .65rem; color: var(--text-mute); }
.phf-cal-body { display: grid; gap: 4px; min-width: 0; }
.phf-cal-title { font-size: .95rem; font-weight: 500; }
.phf-cal-title small { font-weight: 400; color: var(--text-mute); }
.phf-cal-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: .72rem; color: var(--text-mute); }
.phf-cal-cat { padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-dim); font-weight: 500; }
.phf-cal-assets { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 2px; align-items: center; font-size: .75rem; }
.phf-cal-assets small { color: var(--text-mute); }
.phf-cal-detail { padding: 0 16px 16px 96px; font-size: .88rem; line-height: 1.55; color: var(--text-dim); }
.phf-cal-detail p { margin: 0 0 8px; }
.phf-cal-detail strong { color: var(--text); font-weight: 500; }
.phf-cal-fine { font-size: .72rem; color: var(--text-mute); }
.phf-cal-about { font-size: .82rem; color: var(--text-dim); }
.phf-cal-about ul { margin: 8px 0 0; padding-left: 20px; line-height: 1.55; }
.phf-cal-about code { font-family: var(--mono); font-size: .8em; }
.phf-cal-grid-wrap { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-card); padding: var(--card-pad-y) var(--card-pad-x); }
.phf-cal-grid-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.phf-cal-grid-head button { min-width: 44px; min-height: 44px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); font-size: 1.2rem; cursor: pointer; }
.phf-cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.phf-cal-grid-day { padding: 4px; font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text-mute); text-align: center; }
.phf-cal-cell { min-height: 96px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); display: grid; align-content: start; gap: 3px; }
.phf-cal-cell.blank { background: transparent; border-color: transparent; }
.phf-cal-cell.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.phf-cal-cell-date { font-size: .72rem; color: var(--text-mute); font-variant-numeric: tabular-nums; }
.phf-cal-pill { display: block; width: 100%; padding: 2px 6px; border: 0; border-left: 3px solid var(--line-strong); border-radius: 4px; background: var(--surface-2); color: var(--text); font: inherit; font-size: .68rem; line-height: 1.3; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.phf-cal-pill.impact-3 { border-left-color: var(--text); font-weight: 500; }
.phf-cal-pill.impact-2 { border-left-color: var(--accent); }
.phf-cal-more { font-size: .65rem; color: var(--text-mute); }
@media (max-width: 720px) {
  .phf-cal-event-head { grid-template-columns: 48px minmax(0, 1fr); }
  .phf-cal-assets { grid-column: 2; justify-content: flex-start; }
  .phf-cal-detail { padding-left: 16px; }
  .phf-cal-grid { gap: 2px; }
  .phf-cal-cell { min-height: 56px; padding: 3px; }
  .phf-cal-pill { font-size: 0; padding: 0; height: 6px; }
  .phf-cal-more { display: none; }
}

/* Provenance: which process produced a row. Colour is an accent; the label always says it in words. */
.phf-cal-chips-label { align-self: center; font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text-mute); margin-right: 2px; }
.phf-cal-origins button small { margin-left: 4px; font-variant-numeric: tabular-nums; opacity: .6; }
.phf-cal-origin { padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text-dim); font-weight: 500; }
.phf-cal-origin[data-origin="curated"] { border-color: color-mix(in oklab, var(--text) 25%, var(--line)); }
.phf-cal-origin[data-origin="verified"] { border-color: color-mix(in oklab, var(--ok) 45%, var(--line)); }
.phf-cal-origin[data-origin="generated"] { border-style: dashed; }
.phf-cal-origin[data-origin="research"] { border-color: color-mix(in oklab, var(--accent) 55%, var(--line)); }
.phf-cal-how { color: var(--text-mute); font-size: .78rem; }
.phf-cal-provenance { padding: var(--card-pad-y) var(--card-pad-x); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-card); }
.phf-cal-provenance > p { margin: 8px 0 0; max-width: 78ch; }
.phf-cal-muted { color: var(--text-mute); font-size: .82rem; line-height: 1.55; }
.phf-cal-prov-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); margin-top: 16px; }
.phf-cal-prov-grid article { padding: 12px 14px; border: 1px solid var(--line); border-left-width: 3px; border-radius: var(--radius-sm); background: var(--surface-2); }
.phf-cal-prov-grid article[data-origin="curated"] { border-left-color: var(--text); }
.phf-cal-prov-grid article[data-origin="verified"] { border-left-color: var(--ok); }
.phf-cal-prov-grid article[data-origin="generated"] { border-left-color: var(--line-strong); }
.phf-cal-prov-grid article[data-origin="research"] { border-left-color: var(--accent); }
.phf-cal-prov-grid h3 { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0 0 6px; font-size: .82rem; font-weight: 500; color: var(--text); }
.phf-cal-prov-grid h3 span { font-variant-numeric: tabular-nums; color: var(--text-mute); font-size: .95rem; }
.phf-cal-prov-grid p { margin: 0; font-size: .78rem; line-height: 1.5; color: var(--text-dim); }
.phf-cal-note { margin-top: 16px; padding: 12px 16px; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 0 12px 12px 0; font-size: .82rem; line-height: 1.55; }
.phf-cal-note strong { color: var(--text); }
.phf-ticker-about { background:var(--surface); border:1px solid var(--line); border-radius:var(--radius-lg, 20px); }
.phf-ticker-about summary { display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:1.25rem 1.5rem; cursor:pointer; list-style:none; font-weight:600; }
.phf-ticker-about summary::-webkit-details-marker { display:none; }
.phf-ticker-about summary small { display:block; margin-top:.25rem; color:var(--text-mute); font-size:.8rem; font-weight:400; }
.phf-ticker-expand { color:var(--accent); font-size:1.5rem; transition:transform .15s; }
.phf-ticker-about[open] .phf-ticker-expand { transform:rotate(45deg); }
.phf-ticker-about-body { display:grid; grid-template-columns:1fr 1fr; gap:2rem; padding:1.5rem; border-top:1px solid var(--line); }
.phf-ticker-about-body h2 { font-size:.8rem; color:var(--text-mute); margin:0 0 .6rem; }
.phf-ticker-about-body p { font-size:.9rem; line-height:1.7; color:var(--text-dim); margin:0; }
.phf-ticker-about-body a { display:inline-block; color:var(--accent); font-size:.8rem; margin-top:1rem; }
.phf-ticker-source { margin-top:.5rem; max-width:26rem; font-size:.75rem; color:var(--text-mute); line-height:1.8; }
.phf-ticker-source summary { cursor:pointer; }
.phf-ticker-history-caption { font-size:.75rem; color:var(--text-mute); }
.phf-ticker-controls { display:flex; flex-wrap:wrap; justify-content:space-between; gap:1rem; margin-bottom:1.25rem; }
.phf-ticker-control-label { display:block; color:var(--text-mute); font-size:.7rem; margin-bottom:.5rem; }
.phf-ticker-segments { display:flex; flex-wrap:wrap; gap:.25rem; padding:.25rem; border:1px solid var(--line); border-radius:10px; background:var(--ink); }
.phf-ticker-segments button { min-height:40px; padding:.5rem .9rem; border:0; border-radius:7px; background:transparent; color:var(--text-dim); font-size:.8rem; cursor:pointer; }
.phf-ticker-segments button[aria-pressed=true] { background:var(--accent); color:var(--ink); }
.phf-ticker-segments button:focus-visible, .phf-ticker-about summary:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
.phf-ticker-history-status { display:flex; flex-wrap:wrap; justify-content:space-between; gap:.75rem; border-top:1px solid var(--line); padding-top:1rem; margin-bottom:1rem; color:var(--text-mute); font-size:.75rem; }
.phf-ticker-history-status details { max-width:32rem; }
.phf-ticker-history-status summary { cursor:pointer; color:var(--text-dim); }
.phf-ticker-history-status p { margin-top:.5rem; line-height:1.6; }
@media(max-width:640px) { .phf-ticker-about-body { grid-template-columns:1fr; gap:1.25rem; } .phf-ticker-segments button { padding:.5rem .65rem; } }
.phf-health { min-width:0; }
.phf-health-meta { color:var(--text-mute); font-size:.75rem; }
.phf-health-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; }
.phf-health-card { display:flex; flex-direction:column; align-items:flex-start; gap:16px; min-width:0; padding:20px; text-align:left; border:1px solid transparent; border-radius:12px; background:var(--surface-2); cursor:pointer; transition:border-color .15s, background .15s; }
.phf-health-card:hover { border-color:var(--line-strong); background:var(--surface); }
.phf-health-card:focus-visible, .phf-health summary:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
.phf-health-card-title { display:flex; justify-content:space-between; align-items:center; gap:12px; width:100%; font-size:.9rem; color:var(--text); overflow-wrap:anywhere; }
.phf-health-card-title svg { flex-shrink:0; color:var(--text-mute); }
.phf-health-card-hint { color:var(--text-mute); font-size:.7rem; }
.phf-health-card:hover .phf-health-card-hint, .phf-health-card:hover svg { color:var(--accent); }
.phf-health-expanded { min-width:0; min-height:360px; }
.phf-health-toolbar, .phf-health-title { display:flex; align-items:center; flex-wrap:wrap; gap:12px; }
.phf-health-toolbar { justify-content:space-between; padding-bottom:24px; }
.phf-health-title h3 { color:var(--text); font-size:1.5rem; letter-spacing:-.025em; font-weight:500; }
.phf-health-description { color:var(--text-dim); font-size:.9rem; margin:10px 0 20px; }
.phf-health-explainer { border-left:2px solid var(--accent); padding:4px 0 4px 16px; margin-bottom:24px; max-width:72ch; }
.phf-health-explainer h4 { font-size:.75rem; font-weight:500; margin-bottom:6px; color:var(--text); }
.phf-health-explainer p, .phf-health-empty { font-size:.85rem; line-height:1.65; color:var(--text-dim); }
.phf-health-values { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,200px),1fr)); gap:12px; margin:16px 0; }
.phf-health-values > div { min-width:0; background:var(--surface-2); border:1px solid var(--line); border-radius:10px; padding:16px; }
.phf-health-values dt { color:var(--text-mute); font-size:.75rem; overflow-wrap:anywhere; }
.phf-health-values dd { margin-top:8px; color:var(--text); font-size:1rem; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.phf-health-group, .phf-health-raw { border-top:1px solid var(--line); padding:16px 0; font-size:.85rem; }
.phf-health summary { cursor:pointer; color:var(--text-dim); overflow-wrap:anywhere; }
.phf-health-group summary > span { color:var(--text-mute); font-size:.7rem; margin-left:8px; }
.phf-health-group > p { margin-top:16px; color:var(--text-mute); }
.phf-health-items { display:grid; gap:12px; padding:16px 0 0; }
.phf-health-items > div { min-width:0; overflow-wrap:anywhere; border-bottom:1px solid var(--line); padding-bottom:8px; }
.phf-health-raw { margin-top:24px; }
.phf-health-raw pre { max-height:380px; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; margin-top:16px; padding:16px; background:var(--ink); border-radius:10px; color:var(--text-dim); font: .75rem/1.6 var(--mono); }
.phf-health-stale { color:var(--warn); margin-top:16px; font-size:.8rem; }
@media(max-width:1100px) { .phf-health-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:540px) { .phf-health-grid { grid-template-columns:1fr; } .phf-health-toolbar { align-items:flex-start; flex-direction:column; gap:16px; } }
@media(prefers-reduced-motion:reduce) { .phf-health-card { transition:none; } }
.phf-config { min-width:0; }
.phf-config-intro { display:flex; align-items:center; gap:8px; color:var(--text-dim); font-size:.85rem; margin-bottom:20px; }
.phf-config-toolbar { display:flex; align-items:center; flex-wrap:wrap; gap:12px; margin-bottom:20px; }
.phf-config-search { display:flex; align-items:center; gap:10px; flex:1; min-width:min(100%,220px); min-height:44px; padding:0 14px; border:1px solid var(--line-strong); border-radius:9px; background:var(--surface-2); color:var(--text-mute); }
.phf-config-search:focus-within { outline:2px solid var(--accent); outline-offset:2px; }
.phf-config-search input { width:100%; min-width:0; padding:10px 0; background:transparent; border:0; outline:0; color:var(--text); font-size:.85rem; }
.phf-config-search input:focus { outline:0; }
.phf-config-count, .phf-config-updated { color:var(--text-mute); font-size:.75rem; }
.phf-config-groups { display:grid; gap:10px; }
.phf-config-group { min-width:0; border:1px solid var(--line); border-radius:12px; overflow:hidden; }
.phf-config-group-toggle { display:flex; justify-content:space-between; align-items:center; gap:12px; width:100%; padding:16px 20px; color:var(--text); background:var(--surface-2); text-align:left; cursor:pointer; font-size:.9rem; }
.phf-config-group-toggle > span { display:flex; align-items:center; gap:12px; }
.phf-config-group-count { color:var(--text-mute); font-size:.75rem; font-variant-numeric:tabular-nums; }
.phf-config-group-toggle svg { color:var(--text-mute); }
.phf-config-group-toggle[aria-expanded=true] svg { transform:rotate(180deg); }
.phf-config-group-toggle:focus-visible { outline:2px solid var(--accent); outline-offset:-3px; }
.phf-config-row { display:grid; grid-template-columns:minmax(180px, .8fr) minmax(0,1.2fr); gap:24px; padding:16px 20px; border-top:1px solid var(--line); align-items:start; }
.phf-config-row dt, .phf-config-row dd { min-width:0; overflow-wrap:anywhere; }
.phf-config-label { display:flex; align-items:center; gap:6px; color:var(--text); font-size:.85rem; }
.phf-config-row code { display:block; margin-top:5px; color:var(--text-mute); font: .7rem/1.5 var(--mono); }
.phf-config-row dd { font-size:.85rem; color:var(--text-dim); font-variant-numeric:tabular-nums; line-height:1.7; }
.phf-config-list { display:flex; flex-wrap:wrap; gap:6px; }
.phf-config-list > span { max-width:100%; padding:2px 8px; border:1px solid var(--line); border-radius:5px; background:var(--surface-2); font: .75rem/1.6 var(--mono); overflow-wrap:anywhere; }
.phf-config-raw { border-top:1px solid var(--line); margin-top:20px; padding-top:16px; font-size:.8rem; color:var(--text-mute); }
.phf-config-raw summary { cursor:pointer; }
.phf-config-raw pre { padding:16px; margin-top:16px; max-height:400px; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; border-radius:10px; background:var(--ink); font: .75rem/1.6 var(--mono); }
.phf-config-updated { margin-top:16px; }
.phf-config-warning { color:var(--warn); font-size:.85rem; margin-bottom:16px; }
@media(max-width:640px) { .phf-config-row { grid-template-columns:1fr; gap:10px; padding:16px; } .phf-config-search { flex-basis:100%; } .phf-config-group-toggle { padding:16px; } }
/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
@layer properties {
  @supports (((-webkit-hyphens: none)) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color: rgb(from red r g b)))) {
    *, :before, :after, ::backdrop {
      --tw-translate-x: 0;
      --tw-translate-y: 0;
      --tw-translate-z: 0;
      --tw-rotate-x: initial;
      --tw-rotate-y: initial;
      --tw-rotate-z: initial;
      --tw-skew-x: initial;
      --tw-skew-y: initial;
      --tw-space-y-reverse: 0;
      --tw-divide-y-reverse: 0;
      --tw-border-style: solid;
      --tw-gradient-position: initial;
      --tw-gradient-from: #0000;
      --tw-gradient-via: #0000;
      --tw-gradient-to: #0000;
      --tw-gradient-stops: initial;
      --tw-gradient-via-stops: initial;
      --tw-gradient-from-position: 0%;
      --tw-gradient-via-position: 50%;
      --tw-gradient-to-position: 100%;
      --tw-leading: initial;
      --tw-font-weight: initial;
      --tw-tracking: initial;
      --tw-ordinal: initial;
      --tw-slashed-zero: initial;
      --tw-numeric-figure: initial;
      --tw-numeric-spacing: initial;
      --tw-numeric-fraction: initial;
      --tw-shadow: 0 0 #0000;
      --tw-shadow-color: initial;
      --tw-shadow-alpha: 100%;
      --tw-inset-shadow: 0 0 #0000;
      --tw-inset-shadow-color: initial;
      --tw-inset-shadow-alpha: 100%;
      --tw-ring-color: initial;
      --tw-ring-shadow: 0 0 #0000;
      --tw-inset-ring-color: initial;
      --tw-inset-ring-shadow: 0 0 #0000;
      --tw-ring-inset: initial;
      --tw-ring-offset-width: 0px;
      --tw-ring-offset-color: #fff;
      --tw-ring-offset-shadow: 0 0 #0000;
      --tw-outline-style: solid;
      --tw-blur: initial;
      --tw-brightness: initial;
      --tw-contrast: initial;
      --tw-grayscale: initial;
      --tw-hue-rotate: initial;
      --tw-invert: initial;
      --tw-opacity: initial;
      --tw-saturate: initial;
      --tw-sepia: initial;
      --tw-drop-shadow: initial;
      --tw-drop-shadow-color: initial;
      --tw-drop-shadow-alpha: 100%;
      --tw-drop-shadow-size: initial;
      --tw-backdrop-blur: initial;
      --tw-backdrop-brightness: initial;
      --tw-backdrop-contrast: initial;
      --tw-backdrop-grayscale: initial;
      --tw-backdrop-hue-rotate: initial;
      --tw-backdrop-invert: initial;
      --tw-backdrop-opacity: initial;
      --tw-backdrop-saturate: initial;
      --tw-backdrop-sepia: initial;
      --tw-duration: initial;
      --tw-ease: initial;
    }
  }
}

@layer theme {
  :root, :host {
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
      "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji",
      "Segoe UI Symbol", "Noto Color Emoji";
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
      "Courier New", monospace;
    --color-red-200: oklch(88.5% .062 18.334);
    --color-red-500: oklch(63.7% .237 25.331);
    --color-red-600: oklch(57.7% .245 27.325);
    --color-red-800: oklch(44.4% .177 26.899);
    --color-red-900: oklch(39.6% .141 25.723);
    --color-red-950: oklch(25.8% .092 26.042);
    --color-amber-100: oklch(96.2% .059 95.617);
    --color-amber-200: oklch(92.4% .12 95.746);
    --color-amber-400: oklch(82.8% .189 84.429);
    --color-amber-500: oklch(76.9% .188 70.08);
    --color-amber-700: oklch(55.5% .163 48.998);
    --color-amber-800: oklch(47.3% .137 46.201);
    --color-amber-950: oklch(27.9% .077 45.635);
    --color-emerald-200: oklch(90.5% .093 164.15);
    --color-emerald-600: oklch(59.6% .145 163.225);
    --color-emerald-700: oklch(50.8% .118 165.612);
    --color-emerald-800: oklch(43.2% .095 166.913);
    --color-emerald-950: oklch(26.2% .051 172.552);
    --color-cyan-100: oklch(95.6% .045 203.388);
    --color-cyan-200: oklch(91.7% .08 205.041);
    --color-cyan-300: oklch(86.5% .127 207.078);
    --color-cyan-400: oklch(78.9% .154 211.53);
    --color-cyan-500: oklch(71.5% .143 215.221);
    --color-cyan-600: oklch(60.9% .126 221.723);
    --color-cyan-700: oklch(52% .105 223.128);
    --color-cyan-950: oklch(30.2% .056 229.695);
    --color-blue-200: oklch(88.2% .059 254.128);
    --color-blue-300: oklch(80.9% .105 251.813);
    --color-blue-400: oklch(70.7% .165 254.624);
    --color-blue-500: oklch(62.3% .214 259.815);
    --color-blue-700: oklch(48.8% .243 264.376);
    --color-blue-800: oklch(42.4% .199 265.638);
    --color-white: #fff;
    --spacing: .25rem;
    --container-3xl: 48rem;
    --text-xs: .75rem;
    --text-xs--line-height: calc(1 / .75);
    --text-sm: .875rem;
    --text-sm--line-height: calc(1.25 / .875);
    --text-base: 1rem;
    --text-base--line-height: calc(1.5 / 1);
    --text-lg: 1.125rem;
    --text-lg--line-height: calc(1.75 / 1.125);
    --text-xl: 1.25rem;
    --text-xl--line-height: calc(1.75 / 1.25);
    --text-2xl: 1.5rem;
    --text-2xl--line-height: calc(2 / 1.5);
    --text-3xl: 1.875rem;
    --text-3xl--line-height: calc(2.25 / 1.875);
    --text-4xl: 2.25rem;
    --text-4xl--line-height: calc(2.5 / 2.25);
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --tracking-wide: .025em;
    --tracking-wider: .05em;
    --leading-relaxed: 1.625;
    --radius-sm: .25rem;
    --radius-lg: var(--radius-sm);
    --radius-2xl: 1rem;
    --animate-spin: spin 1s linear infinite;
    --animate-pulse: pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;
    --blur-sm: 8px;
    --default-transition-duration: .15s;
    --default-transition-timing-function: cubic-bezier(.4, 0, .2, 1);
    --default-font-family: var(--font-sans);
    --default-mono-font-family: var(--font-mono);
  }
}

@layer base {
  *, :after, :before, ::backdrop {
    box-sizing: border-box;
    border: 0 solid;
    margin: 0;
    padding: 0;
  }

  ::file-selector-button {
    box-sizing: border-box;
    border: 0 solid;
    margin: 0;
    padding: 0;
  }

  html, :host {
    -webkit-text-size-adjust: 100%;
    tab-size: 4;
    line-height: 1.5;
    font-family: var(--default-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");
    font-feature-settings: var(--default-font-feature-settings, normal);
    font-variation-settings: var(--default-font-variation-settings, normal);
    -webkit-tap-highlight-color: transparent;
  }

  hr {
    height: 0;
    color: inherit;
    border-top-width: 1px;
  }

  abbr:where([title]) {
    -webkit-text-decoration: underline dotted;
    text-decoration: underline dotted;
  }

  h1, h2, h3, h4, h5, h6 {
    font-size: inherit;
    font-weight: inherit;
  }

  a {
    color: inherit;
    -webkit-text-decoration: inherit;
    -webkit-text-decoration: inherit;
    -webkit-text-decoration: inherit;
    text-decoration: inherit;
  }

  b, strong {
    font-weight: bolder;
  }

  code, kbd, samp, pre {
    font-family: var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);
    font-feature-settings: var(--default-mono-font-feature-settings, normal);
    font-variation-settings: var(--default-mono-font-variation-settings, normal);
    font-size: 1em;
  }

  small {
    font-size: 80%;
  }

  sub, sup {
    vertical-align: baseline;
    font-size: 75%;
    line-height: 0;
    position: relative;
  }

  sub {
    bottom: -.25em;
  }

  sup {
    top: -.5em;
  }

  table {
    text-indent: 0;
    border-color: inherit;
    border-collapse: collapse;
  }

  :-moz-focusring:where(:not(iframe)) {
    outline: auto;
  }

  progress {
    vertical-align: baseline;
  }

  summary {
    display: list-item;
  }

  ol, ul, menu {
    list-style: none;
  }

  img, svg, video, canvas, audio, iframe, embed, object {
    vertical-align: middle;
    display: block;
  }

  img, video {
    max-width: 100%;
    height: auto;
  }

  button, input, select, optgroup, textarea {
    font: inherit;
    font-feature-settings: inherit;
    font-variation-settings: inherit;
    letter-spacing: inherit;
    color: inherit;
    opacity: 1;
    background-color: #0000;
    border-radius: 0;
  }

  ::file-selector-button {
    font: inherit;
    font-feature-settings: inherit;
    font-variation-settings: inherit;
    letter-spacing: inherit;
    color: inherit;
    opacity: 1;
    background-color: #0000;
    border-radius: 0;
  }

  :where(select:is([multiple], [size])) optgroup {
    font-weight: bolder;
  }

  :where(select:is([multiple], [size])) optgroup option {
    padding-inline-start: 20px;
  }

  ::file-selector-button {
    margin-inline-end: 4px;
  }

  ::placeholder {
    opacity: 1;
  }

  @supports (not ((-webkit-appearance: -apple-pay-button))) or (contain-intrinsic-size: 1px) {
    ::placeholder {
      color: currentColor;
    }

    @supports (color: color-mix(in lab, red, red)) {
      ::placeholder {
        color: color-mix(in oklab, currentcolor 50%, transparent);
      }
    }
  }

  textarea {
    resize: vertical;
  }

  ::-webkit-search-decoration {
    -webkit-appearance: none;
  }

  ::-webkit-date-and-time-value {
    min-height: 1lh;
    text-align: inherit;
  }

  ::-webkit-datetime-edit {
    display: inline-flex;
  }

  ::-webkit-datetime-edit-fields-wrapper {
    padding: 0;
  }

  ::-webkit-datetime-edit {
    padding-block: 0;
  }

  ::-webkit-datetime-edit-year-field {
    padding-block: 0;
  }

  ::-webkit-datetime-edit-month-field {
    padding-block: 0;
  }

  ::-webkit-datetime-edit-day-field {
    padding-block: 0;
  }

  ::-webkit-datetime-edit-hour-field {
    padding-block: 0;
  }

  ::-webkit-datetime-edit-minute-field {
    padding-block: 0;
  }

  ::-webkit-datetime-edit-second-field {
    padding-block: 0;
  }

  ::-webkit-datetime-edit-millisecond-field {
    padding-block: 0;
  }

  ::-webkit-datetime-edit-meridiem-field {
    padding-block: 0;
  }

  ::-webkit-calendar-picker-indicator {
    line-height: 1;
  }

  :-moz-ui-invalid {
    box-shadow: none;
  }

  button, input:where([type="button"], [type="reset"], [type="submit"]) {
    appearance: button;
  }

  ::file-selector-button {
    appearance: button;
  }

  ::-webkit-inner-spin-button {
    height: auto;
  }

  ::-webkit-outer-spin-button {
    height: auto;
  }

  [hidden]:where(:not([hidden="until-found"])) {
    display: none !important;
  }

  * {
    box-sizing: border-box;
  }

  html, body {
    margin: 0;
    padding: 0;
  }

  body {
    background-color: var(--ink);
    color: var(--text);
    font-family: var(--sans);
    -webkit-font-smoothing: antialiased;
  }
}

@layer components {
  .phf-connections-grid {
    gap: var(--s-5);
    grid-template-columns: repeat(auto-fit, minmax(min(29rem, 100%), 1fr));
    align-items: start;
    display: grid;
  }

  .phf-connection-heading, .phf-connection-actions {
    align-items: center;
    gap: var(--s-3);
    margin-block: var(--s-3);
    flex-wrap: wrap;
    display: flex;
  }

  .phf-connection-status {
    align-items: center;
    gap: var(--s-2);
    color: var(--text-dim);
    border: 1px solid var(--line);
    padding: var(--s-2) var(--s-3);
    border-radius: var(--radius-sm);
    font-size: .82rem;
    display: inline-flex;
  }

  .phf-connection-status:before {
    content: "";
    background: currentColor;
    border-radius: 50%;
    width: .45rem;
    height: .45rem;
  }

  .phf-connection-status[data-state="connected"], .phf-connection-status[data-state="idle"], .phf-connection-status[data-state="ready"] {
    color: var(--ok);
  }

  .phf-connection-status[data-state="error"] {
    color: var(--bad);
  }

  .phf-connection-status[data-state="stale"], .phf-connection-status[data-state="unavailable"], .phf-connection-status[data-state="connecting"] {
    color: var(--warn);
  }

  .phf-connection-credential, .phf-connection-hint {
    color: var(--text-mute);
    font-size: .78rem;
  }

  .phf-connection-fields {
    gap: var(--s-4);
    min-width: 0;
    margin: var(--s-5) 0 var(--s-2);
    border: 0;
    padding: 0;
    display: grid;
  }

  .phf-connection-fields input {
    width: 100%;
  }

  .phf-connection-fields .phf-field span {
    font-size: .78rem;
  }

  .phf-connection-fields:disabled {
    opacity: .65;
  }

  .phf-button-primary {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-soft);
  }

  .phf-connection-test {
    padding: var(--s-3);
    margin-block: var(--s-3);
    border-left: 2px solid var(--line-strong);
    background: var(--surface-2);
    color: var(--text-dim);
    font-size: .82rem;
  }

  .phf-connection-test p {
    margin-block: var(--s-2);
  }

  .phf-connection-test[data-result="error"] {
    border-color: var(--bad);
  }

  .phf-connection-test[data-result="ok"] {
    border-color: var(--ok);
  }

  .phf-connection-observations {
    gap: var(--s-4);
    margin-top: var(--s-5);
    padding-top: var(--s-3);
    border-top: 1px solid var(--line);
    flex-wrap: wrap;
    font-size: .78rem;
    display: flex;
  }

  .phf-connection-observations dt {
    color: var(--text-mute);
  }

  .phf-connection-observations dd {
    margin: var(--s-1) 0 0;
    color: var(--text-dim);
  }

  .phf-connection-forget {
    margin-top: var(--s-3);
    color: var(--text-dim);
    font-size: .82rem;
  }

  .phf-connection-summary > div {
    justify-content: space-between;
    gap: var(--s-3);
    padding-block: var(--s-3);
    border-bottom: 1px solid var(--line);
    flex-wrap: wrap;
    align-items: center;
    font-size: .9rem;
    display: flex;
  }

  .phf-inline-link {
    padding-block: var(--s-4);
    display: inline-block;
  }

  .phf-diagnostics > summary {
    cursor: pointer;
    color: var(--text-dim);
    padding-block: var(--s-4);
  }

  .phf-header, .phf-header-right, .phf-nav {
    flex-wrap: wrap;
  }

  .phf-form {
    align-items: flex-end;
    gap: var(--s-3);
    margin-block: var(--s-4);
    flex-wrap: wrap;
    display: flex;
  }

  .phf-field {
    gap: var(--s-2);
    color: var(--text-dim);
    flex-direction: column;
    min-width: 0;
    font-size: .8rem;
    display: flex;
  }

  .phf-field input, .phf-field select, .phf-field textarea {
    max-width: 100%;
    min-height: 44px;
    padding: var(--s-2) var(--s-3);
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font: inherit;
  }

  .phf-field textarea {
    width: min(28rem, 100%);
    font-family: var(--mono);
  }

  .phf-field input:focus-visible, .phf-field select:focus-visible, .phf-field textarea:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
  }

  .phf-button:disabled {
    opacity: .45;
    cursor: default;
  }

  .phf-main a {
    color: var(--accent);
    text-underline-offset: .2em;
  }

  .phf-access {
    margin-block: var(--s-3);
    padding: var(--s-3);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
  }

  .phf-access summary {
    cursor: pointer;
    color: var(--text-dim);
    padding-block: var(--s-2);
    font-size: .85rem;
  }

  .phf-access input {
    width: min(30rem, 100%);
  }

  .phf-list-row {
    gap: var(--s-3);
    margin-block: var(--s-2);
    color: var(--text-dim);
    flex-wrap: wrap;
    align-items: center;
    font-size: .8rem;
    display: flex;
  }

  .phf-watchlist {
    margin-top: var(--s-5);
    border-top: 1px solid var(--line);
  }

  .phf-actors {
    gap: var(--s-3);
    margin-top: var(--s-5);
    grid-template-columns: repeat(auto-fill, minmax(min(15rem, 100%), 1fr));
    display: grid;
  }

  .phf-actor {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    min-width: 0;
    padding: var(--s-4);
    background: var(--surface-2);
  }

  .phf-actor h3 {
    overflow-wrap: anywhere;
    font-size: .9rem;
    font-weight: 400;
  }

  .phf-actor p, .phf-actor .phf-mono {
    color: var(--text-mute);
    font-size: .78rem;
  }

  .phf-actor[data-busy="true"] {
    border-color: var(--warn);
  }

  .phf-sonar-map {
    width: 100%;
    max-height: 32rem;
    margin-block: var(--s-4);
  }

  .phf-sonar-map text {
    fill: var(--text-dim);
    font-family: var(--mono);
    font-size: 12px;
  }

  .phf-bid {
    fill: var(--ok);
    opacity: .7;
  }

  .phf-ask {
    fill: var(--accent);
    opacity: .7;
  }

  .phf-shell {
    flex-direction: column;
    min-width: 0;
    min-height: 100vh;
    display: flex;
  }

  .phf-header {
    justify-content: space-between;
    align-items: flex-end;
    gap: var(--s-4);
    padding: var(--s-6) var(--page-pad-x) var(--s-5);
    border-bottom: 1px solid var(--line);
    display: flex;
  }

  .phf-kicker {
    color: var(--accent);
    font-family: var(--mono);
    font-size: var(--label-size);
    font-weight: var(--label-weight);
    letter-spacing: var(--label-tracking);
    text-transform: uppercase;
  }

  .phf-title {
    margin: var(--s-1) 0 0;
    letter-spacing: var(--heading-tracking);
    font-size: 1.9rem;
    font-weight: 300;
  }

  .phf-header-right {
    align-items: center;
    gap: var(--s-3);
    display: flex;
  }

  .phf-driver-chip {
    font-family: var(--mono);
    font-size: var(--label-size);
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: var(--s-1) var(--s-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--text-mute);
  }

  .phf-driver-chip[data-driver="live"] {
    color: var(--ok);
    border-color: var(--ok);
  }

  .phf-driver-chip[data-driver="fixture"] {
    color: var(--warn);
    border-color: var(--warn);
  }

  .phf-button {
    vertical-align: middle;
    text-align: center;
    line-height: 1.35;
    font-family: var(--mono);
    font-size: var(--label-size);
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-dim);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    min-height: 44px;
    padding: var(--s-2) var(--s-3);
    cursor: pointer;
    background: none;
    justify-content: center;
    align-items: center;
    gap: .5rem;
    display: inline-flex;
  }

  .phf-button:hover {
    border-color: var(--line-strong);
    color: var(--text);
  }

  .phf-button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
  }

  .phf-main {
    gap: var(--section-gap);
    padding: var(--s-6) var(--page-pad-x);
    grid-template-columns: minmax(0, 1fr);
    min-width: 0;
    display: grid;
  }

  .phf-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    min-width: 0;
  }

  .phf-panel-head {
    padding: var(--card-pad-y) var(--card-pad-x) 0;
  }

  .phf-panel-title {
    font-size: 1.05rem;
    font-weight: var(--heading-weight);
    letter-spacing: var(--heading-tracking);
    margin: 0;
  }

  .phf-panel-sub {
    margin: var(--s-1) 0 0;
    max-width: var(--measure);
    color: var(--text-dim);
    font-size: .85rem;
  }

  .phf-panel-body {
    padding: var(--s-4) var(--card-pad-x) var(--card-pad-y);
    min-width: 0;
  }

  .phf-source {
    align-items: center;
    gap: var(--s-3);
    padding: var(--card-pad-y-xs) var(--card-pad-x);
    border-top: 1px solid var(--line);
    font-family: var(--mono);
    font-size: var(--label-size);
    color: var(--text-mute);
    flex-wrap: wrap;
    display: flex;
  }

  .phf-source-driver {
    letter-spacing: .12em;
    text-transform: uppercase;
  }

  .phf-source[data-driver="live"] .phf-source-driver {
    color: var(--ok);
  }

  .phf-source[data-driver="fixture"] .phf-source-driver {
    color: var(--warn);
  }

  .phf-source-stale {
    color: var(--bad);
    text-transform: uppercase;
    letter-spacing: .12em;
  }

  .phf-status-line {
    align-items: baseline;
    gap: var(--s-3);
    margin-bottom: var(--s-5);
    display: flex;
  }

  .phf-status-word {
    letter-spacing: var(--heading-tracking);
    font-size: 1.5rem;
    font-weight: 300;
  }

  .phf-status-note {
    color: var(--text-mute);
    font-size: .8rem;
  }

  .phf-dot {
    background: var(--text-mute);
    border-radius: 50%;
    align-self: center;
    width: .6rem;
    height: .6rem;
  }

  .phf-dot[data-status="healthy"] {
    background: var(--ok);
  }

  .phf-dot[data-status="degraded"] {
    background: var(--warn);
  }

  .phf-dot[data-status="critical"] {
    background: var(--bad);
  }

  .phf-stats {
    gap: var(--card-gap);
    grid-template-columns: repeat(auto-fit, minmax(min(9rem, 100%), 1fr));
    min-width: 0;
    display: grid;
  }

  .phf-stat {
    min-width: 0;
    padding: var(--card-pad-y-sm) var(--card-pad-x-sm);
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
  }

  .phf-stat-label {
    font-family: var(--mono);
    font-size: var(--label-size);
    font-weight: var(--label-weight);
    letter-spacing: var(--label-tracking);
    text-transform: uppercase;
    color: var(--text-mute);
  }

  .phf-stat-value {
    margin-top: var(--s-2);
    letter-spacing: var(--heading-tracking);
    font-size: 1.35rem;
    font-weight: 300;
  }

  .phf-stat-sub {
    margin-top: var(--s-1);
    color: var(--text-dim);
    font-size: .78rem;
  }

  .phf-nav {
    gap: var(--s-1);
    display: flex;
  }

  .phf-navlink {
    font-family: var(--mono);
    font-size: var(--label-size);
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-mute);
    padding: var(--s-2) var(--s-3);
    border-radius: var(--radius-sm);
    align-items: center;
    min-height: 44px;
    text-decoration: none;
    display: inline-flex;
  }

  .phf-navlink:hover {
    color: var(--text);
  }

  .phf-navlink.active {
    color: var(--accent);
    background: var(--accent-soft);
  }

  .phf-navlink:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
  }

  .phf-scroller {
    min-width: 0;
    overflow-x: auto;
  }

  .phf-table {
    border-collapse: collapse;
    width: 100%;
    font-size: .83rem;
  }

  .phf-table th {
    text-align: left;
    padding: var(--s-2) var(--s-3);
    border-bottom: 1px solid var(--line);
    font-family: var(--mono);
    font-size: var(--label-size);
    font-weight: var(--label-weight);
    letter-spacing: var(--label-tracking);
    text-transform: uppercase;
    color: var(--text-mute);
    white-space: nowrap;
  }

  .phf-table td {
    padding: var(--s-2) var(--s-3);
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
  }

  .phf-table tbody tr:hover {
    background: var(--surface-2);
  }

  .phf-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
  }

  .phf-mono {
    font-family: var(--mono);
  }

  .phf-empty {
    max-width: var(--measure);
    color: var(--text-dim);
    margin: 0;
    font-size: .85rem;
  }

  .phf-empty code {
    font-family: var(--mono);
    color: var(--accent);
    font-size: .8rem;
  }

  .phf-error {
    color: var(--bad);
    font-family: var(--mono);
    margin: 0;
    font-size: .85rem;
  }

  .trade-template-grid + .phf-field {
    margin-top: var(--s-4);
  }

  .phf-workspace-shell {
    grid-template-columns: 225px minmax(0, 1fr);
    display: grid;
  }

  .phf-sidebar {
    border-right: 1px solid var(--line);
    background: var(--ink-2);
    height: 100vh;
    padding: var(--s-6) var(--s-4);
    gap: var(--s-6);
    flex-direction: column;
    display: flex;
    position: sticky;
    top: 0;
    overflow-y: auto;
  }

  .phf-wordmark {
    padding: var(--s-2) var(--s-3) 0;
    color: var(--accent);
    text-decoration: none;
    display: block;
  }

  .phf-wordmark svg {
    width: 100%;
    height: auto;
    display: block;
  }

  .phf-wordmark:hover, .phf-wordmark:focus-visible {
    color: var(--text);
  }

  .phf-home-link {
    align-items: center;
    gap: var(--s-2);
    margin-top: calc(var(--s-2) - var(--s-6));
    padding: 0 var(--s-3);
    font: .62rem var(--mono);
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--text-mute);
    text-decoration: none;
    display: inline-flex;
  }

  .phf-home-link:hover, .phf-home-link:focus-visible {
    color: var(--accent);
  }

  .phf-monogram {
    border: 1px solid var(--accent);
    color: var(--accent);
    font: .95rem var(--mono);
    letter-spacing: -.12em;
    padding: .5rem .25rem;
  }

  .phf-workspace-id {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: var(--s-4);
    font-size: .85rem;
  }

  .phf-workspace-id small {
    margin-top: var(--s-2);
    color: var(--text-mute);
    display: block;
  }

  .phf-nav-label {
    font: .65rem var(--mono);
    color: var(--text-mute);
    text-transform: uppercase;
    letter-spacing: .16em;
    margin: var(--s-5) var(--s-3) var(--s-3);
  }

  .phf-sidebar .phf-navlink, .phf-research-nav summary {
    padding: .85rem var(--s-3);
    font: .9rem var(--sans);
    text-transform: none;
    letter-spacing: 0;
    color: var(--text-dim);
    border-radius: var(--radius);
    border: 1px solid #0000;
    justify-content: space-between;
    align-items: center;
    min-height: 44px;
    text-decoration: none;
    display: flex;
  }

  .phf-sidebar .phf-navlink.active {
    color: var(--accent);
    border-color: var(--line-strong);
    background: var(--accent-soft);
  }

  .phf-sidebar .phf-navlink span {
    opacity: 0;
  }

  .phf-sidebar .phf-navlink.active span {
    opacity: 1;
  }

  .phf-research-nav summary {
    cursor: pointer;
    list-style: none;
  }

  .phf-research-nav[open] .phf-navlink {
    margin-left: var(--s-3);
    min-height: 40px;
    padding-block: var(--s-2);
    font-size: .8rem;
  }

  .phf-workspace-content {
    min-width: 0;
  }

  .phf-workspace-bar {
    justify-content: space-between;
    align-items: center;
    gap: var(--s-3);
    min-height: 75px;
    padding: var(--s-3) var(--page-pad-x);
    border-bottom: 1px solid var(--line);
    flex-wrap: wrap;
    display: flex;
  }

  .phf-breadcrumb {
    color: var(--text-mute);
    font-size: .8rem;
  }

  .phf-breadcrumb span {
    margin-inline: var(--s-4);
  }

  .phf-breadcrumb strong {
    color: var(--text-dim);
    font-weight: 400;
  }

  .phf-menu-toggle {
    display: none;
  }

  .phf-skip-link {
    top: -10rem;
    left: var(--s-4);
    z-index: 100;
    padding: var(--s-4);
    background: var(--surface);
    color: var(--accent);
    position: fixed;
  }

  .phf-skip-link:focus {
    top: 0;
  }

  .trade-page {
    gap: var(--s-6);
    flex-direction: column;
    width: 100%;
    min-width: 0;
    max-width: 1760px;
    margin-inline: auto;
    display: flex;
  }

  .trade-heading {
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--s-4);
    padding-block: var(--s-5);
    flex-wrap: wrap;
    display: flex;
  }

  .trade-heading h1 {
    margin: var(--s-3) 0;
    letter-spacing: -.045em;
    font-size: clamp(2rem, 3vw, 3.3rem);
    font-weight: 600;
    line-height: 1.1;
  }

  .trade-heading p {
    color: var(--text-mute);
    max-width: 65ch;
    margin: 0;
    font-size: .9rem;
    line-height: 1.6;
  }

  .trade-heading .phf-kicker {
    color: var(--text-mute);
    font-size: .6rem;
  }

  .trade-mode {
    font: .6rem var(--mono);
    text-transform: uppercase;
    color: var(--text-mute);
    padding-block: var(--s-2);
  }

  .trade-builder-layout {
    gap: var(--s-5);
    grid-template-columns: minmax(320px, .8fr) minmax(0, 1.45fr);
    align-items: start;
    display: grid;
  }

  .trade-compose, .trade-analysis-column {
    gap: var(--s-5);
    flex-direction: column;
    min-width: 0;
    display: flex;
  }

  .trade-two, .trade-three {
    gap: var(--s-4);
    margin-block: var(--s-3);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    display: grid;
  }

  .trade-three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .trade-page input, .trade-page select, .trade-page textarea {
    width: 100%;
  }

  .trade-page textarea {
    resize: vertical;
    font-family: var(--sans);
    line-height: 1.6;
  }

  .trade-template-grid {
    gap: var(--s-2);
    margin-top: var(--s-5);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    display: grid;
  }

  .trade-template-grid button {
    appearance: none;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: var(--s-3);
    text-align: left;
    color: var(--text-dim);
    cursor: pointer;
    background: none;
    min-height: 66px;
  }

  .trade-template-grid button strong {
    font-size: .8rem;
    font-weight: 500;
    display: block;
  }

  .trade-template-grid button span {
    color: var(--text-mute);
    margin-top: var(--s-2);
    font-size: .65rem;
    display: block;
  }

  .trade-template-grid button[aria-pressed="true"] {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
  }

  .trade-page button:focus-visible, .phf-sidebar a:focus-visible, .phf-sidebar summary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
  }

  .trade-legs {
    gap: var(--s-5);
    flex-direction: column;
    display: flex;
  }

  .trade-leg {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    min-width: 0;
    padding: var(--s-3);
    margin: 0;
  }

  .trade-leg legend {
    font: .65rem var(--mono);
    color: var(--text-mute);
    padding-inline: var(--s-2);
  }

  .trade-leg legend .trade-status {
    margin-left: var(--s-2);
    border: 0;
    padding: 0;
    font-size: .6rem;
  }

  .trade-leg-top {
    gap: var(--s-2);
    grid-template-columns: 1fr 1fr 1fr 30px;
    align-items: end;
    display: grid;
  }

  .trade-remove {
    color: var(--text-mute);
    cursor: pointer;
    background: none;
    border: 0;
    height: 44px;
    font-size: 1.4rem;
  }

  .trade-remove:disabled {
    opacity: .3;
    cursor: default;
  }

  .trade-leg-values {
    gap: var(--s-3);
    margin-top: var(--s-3);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    display: grid;
  }

  .trade-leg .phf-field {
    font-size: .65rem;
  }

  .trade-leg input, .trade-leg select {
    padding-inline: var(--s-2);
  }

  .trade-actions {
    align-items: center;
    gap: var(--s-3);
    margin-top: var(--s-4);
    flex-wrap: wrap;
    display: flex;
  }

  .trade-page .phf-button {
    letter-spacing: .025em;
    font-size: .62rem;
  }

  .trade-page .phf-button-primary {
    background: var(--accent);
    color: var(--ink);
    border-color: var(--accent);
    font-weight: 600;
  }

  .trade-caption {
    color: var(--text-mute);
    margin-block: var(--s-3);
    font-size: .75rem;
    line-height: 1.65;
  }

  .trade-stats {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    grid-template-columns: repeat(4, minmax(0, 1fr));
    display: grid;
    overflow: hidden;
  }

  .trade-stats .phf-stat {
    border: 0;
    border-right: 1px solid var(--line);
    min-width: 0;
    padding: var(--s-5);
    border-radius: 0;
  }

  .trade-stats .phf-stat:last-child {
    border-right: 0;
  }

  .trade-stats .phf-stat-value {
    overflow-wrap: anywhere;
    font-size: clamp(1.25rem, 1.7vw, 1.9rem);
  }

  .trade-stats .phf-stat-label {
    letter-spacing: .08em;
    font-size: .58rem;
  }

  .trade-stats .phf-stat-sub {
    font-size: .65rem;
    line-height: 1.5;
  }

  .trade-payoff-stats {
    margin-bottom: var(--s-4);
    background: none;
    border: 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .trade-payoff-stats .phf-stat {
    padding: var(--s-3);
    background: none;
  }

  .trade-payoff-stats .phf-stat:first-child {
    padding-left: 0;
  }

  .trade-chart-toolbar {
    justify-content: space-between;
    align-items: center;
    gap: var(--s-3);
    flex-wrap: wrap;
    display: flex;
  }

  .trade-tabs {
    gap: var(--s-2);
    flex-wrap: wrap;
    display: flex;
  }

  .trade-tabs button[aria-pressed="true"] {
    color: var(--accent);
    background: var(--accent-soft);
    border-color: var(--line-strong);
  }

  .trade-chart {
    margin-top: var(--s-4);
  }

  .trade-chart svg {
    touch-action: pan-y;
    width: 100%;
    display: block;
  }

  .trade-chart svg text {
    fill: var(--text-mute);
    font: 11px var(--mono);
  }

  .trade-chart-grid {
    stroke: var(--line);
    stroke-width: 1px;
  }

  .trade-zero {
    stroke: var(--text-mute);
    stroke-width: 1px;
  }

  .trade-expiry-line {
    stroke: var(--accent);
    stroke-width: 2px;
    fill: none;
  }

  .trade-scenario-line {
    stroke: var(--text-dim);
    stroke-width: 1.5px;
    stroke-dasharray: 5 4;
    fill: none;
  }

  .trade-area-profit {
    fill: var(--ok);
    opacity: .09;
  }

  .trade-area-loss {
    fill: var(--bad);
    opacity: .09;
  }

  .trade-strike {
    stroke: var(--line-strong);
    stroke-dasharray: 2 5;
  }

  .trade-strike-handle {
    fill: var(--accent);
    stroke: var(--ink);
    stroke-width: 2px;
    cursor: ew-resize;
    touch-action: none;
  }

  .trade-reference {
    stroke: var(--text-mute);
    stroke-dasharray: 2 6;
    opacity: .5;
  }

  .trade-crosshair {
    stroke: var(--text-mute);
  }

  .trade-point {
    fill: var(--text);
  }

  .trade-chart-legend {
    justify-content: center;
    gap: var(--s-4);
    font: .6rem var(--mono);
    color: var(--text-mute);
    flex-wrap: wrap;
    display: flex;
  }

  .trade-chart-legend i {
    width: 16px;
    margin-right: var(--s-2);
    vertical-align: middle;
    border-top: 2px solid var(--accent);
    display: inline-block;
  }

  .trade-chart-legend .trade-legend-scenario {
    border-top: 1px dashed var(--text-dim);
  }

  .trade-chart-readout {
    text-align: center;
    min-height: 40px;
    font: .65rem var(--mono);
    padding-block: var(--s-4);
    color: var(--text-mute);
  }

  .trade-chart-readout strong {
    color: var(--text-dim);
    font-weight: 400;
  }

  .trade-chart-pending {
    opacity: .45;
  }

  .trade-result-status {
    font: .6rem var(--mono);
    color: var(--text-mute);
    min-height: 24px;
  }

  .trade-scenario-controls {
    gap: var(--s-4);
    padding: var(--s-4) 0;
    border-top: 1px solid var(--line);
    grid-template-columns: repeat(3, minmax(0, 1fr));
    display: grid;
  }

  .trade-scenario-controls .phf-field {
    font-size: .65rem;
  }

  .trade-page input[type="range"] {
    accent-color: var(--accent);
    background: none;
    border: 0;
    padding: 0;
  }

  .trade-greeks {
    gap: var(--s-3);
    padding: var(--s-4) 0;
    border-top: 1px solid var(--line);
    grid-template-columns: repeat(4, minmax(0, 1fr));
    display: grid;
  }

  .trade-greeks > div > span:last-child {
    color: var(--text-mute);
    margin-top: var(--s-1);
    font-size: .55rem;
    display: block;
  }

  .trade-greeks strong {
    font: .95rem var(--mono);
  }

  .trade-label {
    color: var(--text-mute);
    font: .58rem var(--mono);
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: var(--s-2);
    display: block;
  }

  .trade-warning {
    border-left: 2px solid var(--warn);
    background: var(--accent-soft);
    padding: var(--s-3);
    color: var(--text-dim);
    font-size: .8rem;
    line-height: 1.6;
  }

  .trade-loss {
    color: var(--bad);
  }

  .trade-details {
    margin-top: var(--s-3);
    border-top: 1px solid var(--line);
    padding-top: var(--s-3);
  }

  .trade-details summary {
    color: var(--text-mute);
    cursor: pointer;
    font-size: .75rem;
  }

  .trade-grid caption {
    text-align: left;
    color: var(--text-mute);
    padding: var(--s-4) 0;
    font-size: .7rem;
  }

  .trade-grid td[data-sign="profit"], .trade-stress [data-sign="profit"] strong {
    color: var(--ok);
  }

  .trade-grid td[data-sign="loss"], .trade-stress [data-sign="loss"] strong {
    color: var(--bad);
  }

  .trade-empty {
    padding: var(--s-7) var(--s-3);
    text-align: center;
  }

  .trade-empty h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 400;
  }

  .trade-empty p {
    color: var(--text-mute);
    font-size: .85rem;
  }

  .trade-empty a {
    font-size: .8rem;
  }

  .trade-plan {
    border-top: 1px solid var(--line);
    margin-top: var(--s-4);
  }

  .trade-plan-summary {
    gap: var(--s-5);
    padding-block: var(--s-4);
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    align-items: center;
    font-size: .75rem;
    display: grid;
  }

  .trade-plan-title {
    text-align: left;
    color: var(--text);
    cursor: pointer;
    overflow-wrap: anywhere;
    background: none;
    border: 0;
    padding: 0;
  }

  .trade-plan-title strong {
    font-size: .9rem;
    font-weight: 500;
  }

  .trade-plan-title > span {
    color: var(--text-mute);
    margin-top: var(--s-2);
    font-size: .7rem;
    display: block;
  }

  .trade-status {
    width: fit-content;
    color: var(--text-mute);
    font: .6rem var(--mono);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: var(--s-2);
    display: inline-block;
  }

  .trade-status[data-status="reserved"] {
    color: var(--accent);
    border-color: var(--line-strong);
  }

  .trade-plan-detail {
    padding-bottom: var(--s-4);
  }

  .trade-plan-detail p {
    color: var(--text-dim);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: .8rem;
    line-height: 1.6;
  }

  .trade-director-layout {
    gap: var(--s-5);
    grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr);
    align-items: start;
    display: grid;
  }

  .trade-director-layout > div {
    min-width: 0;
  }

  .trade-mandate {
    padding-block: var(--s-4);
    border-bottom: 1px solid var(--line);
  }

  .trade-mandate > div {
    justify-content: space-between;
    gap: var(--s-3);
    font-size: .8rem;
    display: flex;
  }

  .trade-mandate span, .trade-mandate p {
    color: var(--text-mute);
    font-size: .7rem;
  }

  .trade-mandate meter {
    width: 100%;
    height: 14px;
    margin-block: var(--s-3);
    display: block;
  }

  .trade-mandate meter::-webkit-meter-bar {
    background: var(--surface-2);
    border: 0;
    border-radius: 1px;
  }

  .trade-mandate meter::-webkit-meter-optimum-value {
    background: var(--accent);
  }

  .trade-stack {
    gap: var(--s-4);
    margin-block: var(--s-4);
    flex-direction: column;
    display: flex;
  }

  .trade-oversight-columns {
    align-items: start;
    margin-block: 0;
  }

  .trade-stress {
    gap: var(--s-3);
    grid-template-columns: repeat(7, minmax(0, 1fr));
    display: grid;
  }

  .trade-stress > div {
    border: 1px solid var(--line);
    padding: var(--s-4) var(--s-2);
    text-align: center;
    border-radius: var(--radius);
  }

  .trade-stress span {
    font: .7rem var(--mono);
    margin-bottom: var(--s-3);
    color: var(--text-mute);
    display: block;
  }

  .trade-stress strong {
    font: .8rem var(--mono);
    overflow-wrap: anywhere;
  }

  .trade-check {
    gap: var(--s-4);
    padding-block: var(--s-5);
    border-bottom: 1px solid var(--line);
    grid-template-columns: 80px minmax(0, 1fr);
    align-items: start;
    display: grid;
  }

  .trade-check > span {
    font: .6rem var(--mono);
    text-transform: uppercase;
    color: var(--text-mute);
    border: 1px solid var(--line);
    padding: var(--s-2);
    text-align: center;
    border-radius: var(--radius-sm);
  }

  .trade-check[data-state="pass"] > span {
    color: var(--ok);
  }

  .trade-check[data-state="manual"] > span {
    color: var(--accent);
  }

  .trade-check strong {
    font-size: .85rem;
    font-weight: 500;
  }

  .trade-check p {
    color: var(--text-mute);
    margin: var(--s-2) 0 0;
    font-size: .8rem;
    line-height: 1.65;
  }

  .trade-evidence-banner {
    border: 1px solid var(--line-strong);
    background: var(--accent-soft);
    padding: var(--s-5);
    border-radius: var(--radius);
    justify-content: space-between;
    align-items: center;
    gap: var(--s-4);
    flex-wrap: wrap;
    display: flex;
  }

  .trade-evidence-banner h2 {
    font-size: 1.1rem;
    font-weight: 500;
  }

  .trade-evidence-banner p {
    color: var(--text-mute);
    font-size: .8rem;
  }

  .trade-journal details {
    border-bottom: 1px solid var(--line);
    padding-block: var(--s-4);
  }

  .trade-journal summary {
    align-items: center;
    gap: var(--s-4);
    cursor: pointer;
    flex-wrap: wrap;
    font-size: .8rem;
    display: flex;
  }

  .trade-journal time {
    font: .65rem var(--mono);
    color: var(--text-mute);
    margin-left: auto;
  }

  .trade-journal-rev {
    color: var(--accent);
    font: .65rem var(--mono);
  }

  .floor-head {
    gap: var(--s-2);
    display: grid;
  }

  .floor-pulse {
    align-items: center;
    gap: var(--s-4) var(--s-6);
    padding: var(--s-4) var(--s-5);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    flex-wrap: wrap;
    display: flex;
  }

  .floor-pulse-engine {
    align-items: center;
    gap: var(--s-3);
    min-width: 0;
    display: flex;
  }

  .floor-pulse-engine strong {
    letter-spacing: var(--heading-tracking);
    text-transform: capitalize;
    font-size: 1.25rem;
    font-weight: 300;
  }

  .floor-pulse-engine span {
    color: var(--text-mute);
    font-size: .8rem;
  }

  .floor-pulse-sources {
    gap: var(--s-3);
    flex-wrap: wrap;
    margin: 0 0 0 auto;
    padding: 0;
    list-style: none;
    display: flex;
  }

  .floor-pulse-sources li {
    align-items: center;
    gap: var(--s-2);
    font-size: .85rem;
    display: flex;
  }

  .floor-pulse-sources a {
    color: var(--text-dim);
    text-decoration: none;
  }

  .floor-pulse-sources a:hover, .floor-pulse-sources a:focus-visible {
    color: var(--accent);
  }

  .floor-grid {
    gap: var(--section-gap);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    min-width: 0;
    display: grid;
  }

  .floor-grid > .floor-span {
    grid-column: 1 / -1;
    min-width: 0;
  }

  .floor-signal {
    text-transform: capitalize;
  }

  .floor-signal[data-direction="up"] {
    color: var(--ok);
  }

  .floor-signal[data-direction="down"] {
    color: var(--bad);
  }

  .floor-links {
    gap: var(--s-4);
    margin-top: var(--s-4);
    flex-wrap: wrap;
    font-size: .85rem;
    display: flex;
  }

  @media (max-width: 1000px) {
    .floor-grid {
      grid-template-columns: minmax(0, 1fr);
    }

    .floor-pulse-sources {
      margin-left: 0;
    }
  }

  @media (min-width: 1700px) {
    .trade-leg-values {
      grid-template-columns: repeat(4, minmax(0, 1fr));
    }
  }

  @media (max-width: 1250px) {
    .phf-workspace-shell {
      grid-template-columns: 190px minmax(0, 1fr);
    }

    .phf-sidebar {
      padding-inline: var(--s-2);
    }

    .trade-builder-layout {
      grid-template-columns: minmax(280px, .8fr) minmax(0, 1.2fr);
    }

    .trade-payoff-stats .phf-stat-value {
      font-size: 1.2rem;
    }

    .trade-stats .phf-stat {
      padding: var(--s-3);
    }

    .trade-director-layout {
      grid-template-columns: minmax(0, 1fr);
    }

    .trade-plan-summary {
      gap: var(--s-3);
    }
  }

  @media (max-width: 1000px) {
    .trade-builder-layout {
      grid-template-columns: minmax(0, 1fr);
    }

    .trade-compose {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      align-items: start;
      display: grid;
    }

    .trade-oversight-columns {
      grid-template-columns: minmax(0, 1fr);
    }

    .trade-stress {
      grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .trade-stats {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .trade-payoff-stats {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }
  }

  @media (max-width: 760px) {
    .phf-workspace-shell {
      display: block;
    }

    .phf-sidebar {
      height: auto;
      display: none;
      position: static;
    }

    .phf-sidebar[data-open="true"] {
      display: flex;
    }

    .phf-menu-toggle {
      display: inline-block;
    }

    .phf-workspace-bar {
      padding-inline: var(--s-4);
    }

    .phf-breadcrumb {
      display: none;
    }

    .phf-main {
      padding: var(--s-4);
    }

    .trade-heading {
      padding-block: var(--s-4);
    }

    .trade-compose {
      display: flex;
    }

    .trade-page {
      gap: var(--s-5);
    }

    .trade-page .phf-panel-head, .trade-page .phf-panel-body {
      padding-inline: var(--s-4);
    }

    .trade-plan-summary {
      grid-template-columns: minmax(0, 1fr) auto;
    }

    .trade-scenario-controls {
      gap: var(--s-1);
      grid-template-columns: minmax(0, 1fr);
    }

    .trade-greeks {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .trade-three {
      grid-template-columns: minmax(0, 1fr);
    }

    .trade-payoff-stats .phf-stat {
      padding: var(--s-2);
    }

    .trade-payoff-stats .phf-stat-value {
      font-size: 1rem;
    }

    .trade-payoff-stats .phf-stat-sub {
      font-size: .55rem;
    }

    .trade-chart svg text {
      font-size: 13px;
    }

    .trade-chart-legend {
      justify-content: start;
    }

    .trade-check {
      gap: var(--s-3);
      grid-template-columns: 70px minmax(0, 1fr);
    }
  }

  @media (prefers-reduced-motion: no-preference) {
    .trade-template-grid button, .phf-navlink {
      transition: background-color .15s, border-color .15s;
    }
  }

  .phf-view-nav {
    gap: var(--s-2);
    padding: var(--s-2);
    background: var(--surface-2);
    border-radius: var(--radius);
    flex-wrap: wrap;
    display: flex;
  }

  .phf-view-nav a {
    min-height: 44px;
    padding: var(--s-2) var(--s-4);
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    align-items: center;
    font-size: .85rem;
    text-decoration: none;
    display: inline-flex;
  }

  .phf-view-nav a[aria-current="page"] {
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-card);
  }

  .phf-view-nav a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
  }

  .phf-card {
    min-width: 0;
    padding: var(--card-pad-y) var(--card-pad-x);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-card);
  }

  .phf-card-header {
    justify-content: space-between;
    align-items: center;
    gap: var(--s-3);
    margin-bottom: var(--s-4);
    flex-wrap: wrap;
    display: flex;
  }

  .phf-card-heading {
    color: var(--text);
    font-size: 1rem;
    font-weight: var(--heading-weight);
    letter-spacing: -.02em;
    margin: 0;
  }

  .phf-badge {
    align-items: center;
    gap: var(--s-2);
    padding: var(--s-2) var(--s-3);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--text-dim);
    font-size: .75rem;
    display: inline-flex;
  }

  .phf-badge:before {
    content: "";
    background: currentColor;
    border-radius: 50%;
    flex: none;
    width: .4rem;
    height: .4rem;
  }

  .phf-badge[data-tone="safe"] {
    color: var(--ok);
  }

  .phf-badge[data-tone="warn"] {
    color: var(--warn);
  }

  .phf-badge[data-tone="danger"] {
    color: var(--bad);
  }

  .phf-ui-button {
    vertical-align: middle;
    text-align: center;
    min-height: 44px;
    padding: var(--s-2) var(--s-3);
    border: 1px solid var(--text);
    border-radius: var(--radius-sm);
    background: var(--text);
    color: var(--surface);
    line-height: 1.35;
    font: .85rem var(--sans);
    cursor: pointer;
    justify-content: center;
    align-items: center;
    gap: .5rem;
    display: inline-flex;
  }

  .phf-ui-button[data-variant="outline"] {
    background: var(--surface);
    color: var(--text-dim);
    border-color: var(--line-strong);
  }

  .phf-ui-button[data-variant="danger"] {
    background: var(--bad);
    border-color: var(--bad);
  }

  .phf-ui-button:hover {
    opacity: .85;
  }

  .phf-ui-button:disabled {
    opacity: .45;
    cursor: default;
  }

  .phf-ui-button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
  }

  .phf-metric {
    min-width: 0;
    padding: var(--s-4);
    background: var(--surface-2);
    border-radius: var(--radius-sm);
  }

  .phf-metric-label {
    color: var(--text-mute);
    font-size: .75rem;
  }

  .phf-metric .phf-help-trigger {
    padding: 0;
  }

  .phf-metric-label {
    overflow-wrap: normal;
    line-height: 1.4;
  }

  .phf-metric-label .phf-help-trigger {
    white-space: nowrap;
  }

  .phf-metric-value {
    margin-top: var(--s-2);
    font-variant-numeric: tabular-nums;
    overflow-wrap: normal;
    word-break: keep-all;
    font-size: clamp(1.05rem, 1.6vw + .55rem, 1.5rem);
    font-weight: 400;
  }

  .phf-metric-detail {
    margin-top: var(--s-2);
    color: var(--text-dim);
    font-size: .75rem;
  }

  .phf-login {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-float);
    width: calc(100% - 2 * var(--s-4));
  }

  .phf-main > *, .phf-runtime-stack {
    width: 100%;
    max-width: none;
  }

  .phf-main h1 {
    letter-spacing: -.035em;
    font-weight: 400;
  }

  .phf-main {
    width: 100%;
    max-width: 1824px;
    margin-inline: auto;
  }

  .phf-panel {
    flex-direction: column;
    display: flex;
  }

  .phf-panel-body {
    flex: 1;
  }

  .phf-panel-sub {
    line-height: 1.6;
  }

  .phf-source {
    margin-top: auto;
  }

  .floor-grid {
    align-items: stretch;
    gap: var(--s-5);
  }

  .floor-head {
    gap: var(--s-3);
  }

  .floor-head .phf-title, .floor-head .phf-panel-sub {
    margin: 0;
  }

  .floor-pulse {
    gap: var(--s-5);
    padding: var(--card-pad-y) var(--card-pad-x);
    grid-template-columns: minmax(0, 1fr);
    display: grid;
  }

  .floor-pulse-sources {
    gap: var(--s-3);
    padding-top: var(--s-4);
    border-top: 1px solid var(--line);
    grid-template-columns: repeat(auto-fit, minmax(min(12rem, 100%), 1fr));
    margin: 0;
    display: grid;
  }

  .floor-pulse-sources li {
    align-items: flex-start;
    gap: var(--s-2);
    flex-direction: column;
  }

  .floor-pulse-sources .phf-connection-status {
    margin: 0;
  }

  .floor-pulse-engine {
    flex-wrap: wrap;
  }

  .phf-connections-grid {
    align-items: stretch;
    gap: var(--s-5);
  }

  .phf-connections-grid > div {
    grid-row: span 3;
    grid-template-rows: subgrid;
    row-gap: 0;
    min-width: 0;
    display: grid;
  }

  .phf-connections-grid > div > .phf-panel {
    grid-row: span 3;
    grid-template-rows: subgrid;
    row-gap: 0;
    display: grid;
  }

  .phf-connections-grid .phf-panel-body {
    flex-direction: column;
    display: flex;
  }

  .phf-connections-grid form {
    flex: 1;
    margin: 0;
    display: flex;
  }

  .phf-connections-grid .phf-connection-fields {
    gap: var(--s-4);
    width: 100%;
    margin: var(--s-5) 0 0;
    flex-direction: column;
    flex: 1;
    display: flex;
  }

  .phf-connections-grid .phf-connection-actions {
    padding-top: var(--s-5);
    gap: var(--s-3);
    margin: auto 0 0;
  }

  .phf-connections-grid .phf-connection-observations {
    gap: var(--s-4);
    margin: var(--s-5) 0 0;
    padding-top: var(--s-4);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    display: grid;
  }

  .phf-connection-observations dd {
    overflow-wrap: anywhere;
  }

  .phf-connection-heading {
    margin: 0 0 var(--s-3);
  }

  .phf-connection-status {
    margin: 0;
  }

  .phf-stat {
    flex-direction: column;
    display: flex;
  }

  .phf-stat-sub {
    padding-top: var(--s-2);
    margin-top: auto;
  }

  .phf-workspace-bar {
    margin: var(--s-4) var(--page-pad-x) 0;
    padding: var(--s-3) var(--s-4);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-float);
  }

  .phf-bar-context {
    align-items: center;
    gap: var(--s-4);
    flex-wrap: wrap;
    min-width: 0;
    display: flex;
  }

  .phf-bar-identity {
    align-items: center;
    gap: var(--s-3);
    color: var(--text);
    font-size: .85rem;
    display: flex;
  }

  .phf-bar-identity small {
    padding: var(--s-2) var(--s-3);
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    color: var(--text-mute);
    font-size: .75rem;
  }

  .phf-bar-context .phf-breadcrumb {
    padding-left: var(--s-4);
    border-left: 1px solid var(--line);
  }

  .phf-workspace-bar .phf-header-right {
    gap: var(--s-3);
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    margin-left: auto;
    display: grid;
  }

  .phf-workspace-bar .phf-header-right > * {
    width: 10rem;
    min-height: 44px;
    padding: var(--s-2) var(--s-3);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font: .8rem var(--sans);
    text-align: center;
    letter-spacing: 0;
    text-transform: none;
    justify-content: center;
    align-items: center;
    margin: 0;
    display: flex;
  }

  @media (max-width: 760px) {
    .phf-workspace-bar .phf-header-right, .phf-workspace-bar .phf-header-right > * {
      width: 100%;
    }

    .phf-bar-context {
      flex: 1;
    }

    .phf-bar-context .phf-breadcrumb {
      border-left: 0;
      padding-left: 0;
    }
  }

  .phf-sidebar {
    background: var(--ink);
  }

  .phf-workspace-id {
    background: var(--surface);
    box-shadow: var(--shadow-card);
    position: relative;
  }

  .phf-workspace-id:before {
    content: "";
    top: 0;
    left: var(--s-5);
    right: var(--s-5);
    background: var(--accent);
    height: 2px;
    position: absolute;
  }

  .phf-workspace-id small {
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    padding: var(--s-2);
    font-size: .73rem;
  }

  .phf-sidebar .phf-navlink.active {
    color: var(--text);
    background: var(--surface);
    border-color: var(--line);
    box-shadow: var(--shadow-card);
  }

  .phf-navlink:hover, .phf-research-nav summary:hover {
    background: var(--surface-2);
  }

  .phf-panel {
    box-shadow: var(--shadow-card);
  }

  .phf-panel-title {
    letter-spacing: -.02em;
  }

  .phf-source {
    background: var(--surface-2);
    border-radius: 0 0 var(--radius) var(--radius);
    padding-block: var(--s-3);
    border-top: 0;
    font-size: .7rem;
  }

  .phf-driver-chip, .phf-connection-status {
    background: var(--surface-2);
    border-color: var(--line);
    font-family: var(--sans);
    letter-spacing: 0;
    text-transform: none;
  }

  .phf-driver-chip[data-driver] {
    border-color: var(--line);
  }

  .phf-button, .phf-navlink, .phf-kicker, .phf-stat-label, .phf-nav-label {
    font-family: var(--sans);
    letter-spacing: .01em;
    text-transform: none;
  }

  .phf-button {
    background: var(--surface);
    font-size: .8rem;
  }

  .phf-button-primary {
    background: var(--text);
    color: var(--surface);
    border-color: var(--text);
  }

  .phf-button-primary:hover {
    color: var(--surface);
    opacity: .85;
  }

  .phf-title, .phf-stat-value {
    font-weight: 400;
  }

  .phf-stat {
    border-color: #0000;
  }

  .phf-scroller {
    background: var(--surface-2);
    border-radius: var(--radius-table);
    padding: var(--s-1);
  }

  .phf-table {
    border-collapse: separate;
    border-spacing: 0;
  }

  .phf-table th {
    font-family: var(--sans);
    letter-spacing: 0;
    text-transform: none;
    padding-block: var(--s-3);
    border-bottom: 0;
    font-size: .75rem;
  }

  .phf-table td {
    background: var(--surface);
    padding-block: var(--s-3);
  }

  .phf-table tbody tr:first-child td:first-child {
    border-top-left-radius: var(--radius-table);
  }

  .phf-table tbody tr:first-child td:last-child {
    border-top-right-radius: var(--radius-table);
  }

  .phf-table tbody tr:last-child td {
    border-bottom: 0;
  }

  .phf-table tbody tr:last-child td:first-child {
    border-bottom-left-radius: var(--radius-table);
  }

  .phf-table tbody tr:last-child td:last-child {
    border-bottom-right-radius: var(--radius-table);
  }

  .phf-table tbody tr:hover td {
    background: var(--surface-2);
  }

  .library-intro, .library-guide {
    background: var(--surface);
    box-shadow: var(--shadow-card);
  }

  .library-guide-foot {
    background: var(--surface-2);
    border-radius: 0 0 var(--radius) var(--radius);
  }

  @media (max-width: 760px) {
    .phf-workspace-bar {
      margin-inline: var(--s-3);
    }
  }

  @media (max-width: 640px) {
    .phf-metric {
      padding: var(--s-3);
    }

    .phf-metric-value {
      font-size: 1.1rem;
    }
  }

  .director-view {
    gap: var(--s-4);
    min-width: 0;
    display: grid;
  }

  .director-heading, .director-actions, .director-tabs, .director-toolbar, .director-row-actions {
    align-items: center;
    gap: var(--s-3);
    flex-wrap: wrap;
    display: flex;
  }

  .director-heading {
    justify-content: space-between;
  }

  .director-heading h1 {
    margin: 0;
    font-size: 2rem;
  }

  .director-heading p {
    color: var(--text-dim);
    margin-top: var(--s-2);
    font-size: .85rem;
  }

  .director-view .phf-ui-button, .director-dialog .phf-ui-button {
    justify-content: center;
    align-items: center;
    gap: var(--s-2);
    display: inline-flex;
  }

  .director-muted {
    color: var(--text-mute);
    font-size: .75rem;
  }

  .director-statusbar {
    gap: var(--s-3);
    padding: var(--s-3) var(--s-4);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    background: var(--surface);
    flex-wrap: wrap;
    align-items: center;
    font-size: .75rem;
    display: flex;
  }

  .director-statusbar > label {
    align-items: center;
    gap: var(--s-2);
    margin-left: auto;
    display: inline-flex;
  }

  .director-tabs {
    border-bottom: 1px solid var(--line);
    gap: var(--s-5);
  }

  .director-tabs button, .director-tabs a {
    min-height: 44px;
    color: var(--text-dim);
    padding: var(--s-2) 0;
    cursor: pointer;
    border-bottom: 2px solid #0000;
    align-items: center;
    font-size: .85rem;
    display: inline-flex;
  }

  .director-tabs button[aria-pressed="true"], .director-tabs a[aria-current="page"] {
    color: var(--text);
    border-color: var(--accent);
  }

  .director-metrics {
    gap: var(--s-4);
    grid-template-columns: repeat(4, minmax(0, 1fr));
    display: grid;
  }

  .director-metrics .phf-metric {
    border: 1px solid var(--line);
    background: var(--surface);
    padding: var(--s-4);
  }

  .director-metrics .phf-metric-value {
    margin-block: var(--s-2);
    font-size: 1.9rem;
  }

  .director-charts {
    gap: var(--s-5);
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    display: grid;
  }

  .director-charts > .phf-card {
    flex-direction: column;
    min-width: 0;
    display: flex;
  }

  .director-view select, .director-view input:not([type="checkbox"]) {
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    min-height: 44px;
    color: var(--text);
    padding: var(--s-2) var(--s-3);
    font-size: .8rem;
  }

  .director-view select {
    max-width: 100%;
  }

  .director-chart-empty {
    justify-content: center;
    align-items: center;
    gap: var(--s-3);
    min-height: 160px;
    padding: var(--s-5);
    text-align: center;
    color: var(--text-mute);
    background: var(--surface-2);
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-sm);
    flex-direction: column;
    flex: 1;
    display: flex;
  }

  .director-chart-empty h3 {
    color: var(--text);
    font-size: 1rem;
    font-weight: 500;
  }

  .director-chart-empty p {
    max-width: 26rem;
    font-size: .8rem;
    line-height: 1.6;
  }

  .director-chart-scroll {
    min-height: 140px;
    max-height: 180px;
    overflow-y: auto;
  }

  .director-chart-row {
    gap: var(--s-3);
    width: 100%;
    min-height: 44px;
    padding: var(--s-2) 0;
    text-align: left;
    cursor: pointer;
    border-bottom: 1px solid var(--line);
    grid-template-columns: minmax(0, 1.15fr) minmax(50px, 1fr) 6rem;
    align-items: center;
    font-size: .75rem;
    display: grid;
  }

  .director-chart-row strong {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
  }

  .director-chart-label {
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
  }

  .director-diverging {
    background: var(--surface-2);
    border-radius: var(--s-1);
    height: 22px;
    position: relative;
  }

  .director-diverging:after {
    content: "";
    background: var(--line-strong);
    width: 1px;
    height: 100%;
    position: absolute;
    left: 50%;
  }

  .director-diverging > span {
    border-radius: var(--s-1);
    background: var(--ok);
    height: 12px;
    position: absolute;
    top: 5px;
  }

  .director-diverging > span.is-loss {
    background: var(--bad);
  }

  .director-positive {
    color: var(--ok);
  }

  .director-negative {
    color: var(--bad);
  }

  .director-caption {
    color: var(--text-mute);
    padding-top: var(--s-4);
    margin-top: auto;
    font-size: .7rem;
    line-height: 1.6;
  }

  .director-allocation-summary {
    gap: var(--s-1) var(--s-3);
    padding-bottom: var(--s-3);
    margin-bottom: var(--s-2);
    border-bottom: 1px solid var(--line);
    grid-template-columns: 1fr auto;
    display: grid;
  }

  .director-allocation-summary > strong {
    font-size: 1.4rem;
    font-weight: 400;
  }

  .director-allocation-summary > span {
    color: var(--text-mute);
    grid-row: 2;
    font-size: .7rem;
  }

  .director-allocation-summary > button {
    grid-area: 1 / 2 / 3;
  }

  .director-text-button {
    align-items: center;
    gap: var(--s-2);
    min-height: 44px;
    color: var(--accent);
    cursor: pointer;
    font-size: .8rem;
    display: inline-flex;
  }

  .director-allocation-row {
    text-align: left;
    gap: var(--s-2);
    width: 100%;
    padding: var(--s-2) 0;
    cursor: pointer;
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 44px;
    font-size: .75rem;
    display: grid;
  }

  .director-allocation-row > span:first-child {
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
  }

  .director-allocation-row strong {
    font-variant-numeric: tabular-nums;
    font-weight: 400;
  }

  .director-track {
    background: var(--surface-2);
    border-radius: var(--s-1);
    grid-column: 1 / -1;
    height: 4px;
    display: block;
    overflow: hidden;
  }

  .director-track > span {
    background: var(--accent);
    border-radius: inherit;
    height: 100%;
    display: block;
  }

  .director-attention {
    align-items: center;
    gap: var(--s-3);
    padding: var(--s-3) var(--s-4);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--accent-soft);
    display: flex;
  }

  .director-attention > svg {
    color: var(--accent);
    flex: none;
  }

  .director-attention > span {
    flex: 1;
    min-width: 0;
    font-size: .8rem;
  }

  .director-attention strong {
    font-weight: 500;
    display: block;
  }

  .director-attention > span > span {
    color: var(--text-dim);
    margin-top: var(--s-1);
    font-size: .75rem;
    display: block;
  }

  .director-toolbar {
    margin-bottom: var(--s-4);
  }

  .director-search {
    flex: 1;
    align-items: center;
    min-width: min(16rem, 100%);
    display: flex;
    position: relative;
  }

  .director-search > svg {
    left: var(--s-3);
    color: var(--text-mute);
    pointer-events: none;
    position: absolute;
  }

  .director-search > input {
    width: 100%;
    padding-left: var(--s-6) !important;
  }

  .director-table {
    border-collapse: collapse;
    width: 100%;
    min-width: 920px;
    font-size: .8rem;
  }

  .director-table th {
    text-align: left;
    color: var(--text-mute);
    padding: var(--s-3);
    background: var(--surface-2);
    white-space: nowrap;
    font-size: .7rem;
    font-weight: 400;
  }

  .director-table td {
    padding: var(--s-3);
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
  }

  .director-table tbody tr:hover {
    background: var(--surface-2);
  }

  .director-table .director-number {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }

  .director-strategy {
    font-weight: 500;
  }

  .director-instance {
    max-width: 240px;
    color: var(--text-mute);
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .65rem;
    display: block;
    overflow: hidden;
  }

  .director-runtime {
    align-items: center;
    gap: var(--s-1);
    color: var(--text-dim);
    margin-top: var(--s-2);
    text-transform: capitalize;
    font-size: .7rem;
    display: flex;
  }

  .director-runtime i {
    background: var(--text-mute);
    border-radius: 50%;
    width: 5px;
    height: 5px;
  }

  .director-runtime i[data-running="true"] {
    background: var(--ok);
  }

  .director-row-note {
    max-width: 210px;
    margin-top: var(--s-2);
    color: var(--text-mute);
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .65rem;
    display: block;
    overflow: hidden;
  }

  .director-row-actions {
    gap: var(--s-2);
    flex-wrap: nowrap;
  }

  .director-row-actions .phf-ui-button {
    font-size: .75rem;
  }

  .director-view button:focus-visible, .director-view select:focus-visible, .director-view input:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
  }

  .director-dialog {
    width: min(650px, 100%);
    max-width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    padding: var(--s-5);
    border: 0;
    border-left: 1px solid var(--line);
    background: var(--ink);
    color: var(--text);
    box-shadow: var(--shadow-float);
    margin: 0;
    position: fixed;
    inset: 0 0 0 auto;
    overflow-y: auto;
  }

  .director-dialog::backdrop {
    background: var(--backdrop);
  }

  .director-dialog-head {
    top: calc(-1 * var(--s-5));
    z-index: 1;
    background: var(--ink);
    padding-block: var(--s-3);
    justify-content: space-between;
    align-items: center;
    gap: var(--s-3);
    margin-bottom: var(--s-4);
    display: flex;
    position: sticky;
  }

  .director-dialog-head h2 {
    font-size: 1.1rem;
  }

  .director-dialog form input, .director-dialog form textarea, .director-dialog form select {
    max-width: 100%;
  }

  .director-alert {
    border: 1px solid var(--warn);
    color: var(--text);
    background: var(--surface);
    border-radius: var(--radius-sm);
    padding: var(--s-4);
    font-size: .8rem;
  }

  .director-alert button {
    margin: var(--s-2) var(--s-2) 0 0;
  }

  @media (max-width: 1100px) {
    .director-charts {
      grid-template-columns: minmax(0, 1fr);
    }

    .director-metrics .phf-metric {
      padding: var(--s-4);
    }

    .director-metrics .phf-metric-value {
      font-size: 1.5rem;
    }
  }

  @media (max-width: 640px) {
    .director-search {
      flex-basis: 100%;
    }

    .director-roster .phf-scroller {
      overflow: visible;
    }

    .director-table {
      min-width: 0;
      display: block;
    }

    .director-table thead {
      clip-path: inset(50%);
      width: 1px;
      height: 1px;
      position: absolute;
      overflow: hidden;
    }

    .director-table tbody {
      gap: var(--s-3);
      display: grid;
    }

    .director-table tr {
      padding: var(--s-3);
      border: 1px solid var(--line);
      border-radius: var(--radius-sm);
      background: var(--surface-2);
      grid-template-columns: repeat(2, minmax(0, 1fr));
      display: grid;
    }

    .director-table td {
      padding: var(--s-2);
      border: 0;
      display: block;
    }

    .director-table .director-number {
      text-align: left;
    }

    .director-table td[data-label]:before {
      content: attr(data-label);
      color: var(--text-mute);
      margin-bottom: var(--s-1);
      font-size: .7rem;
      display: block;
    }

    .director-identity-cell, .director-status-cell, .director-action-cell {
      grid-column: 1 / -1;
    }

    .director-row-actions > button:first-child {
      flex: 1;
    }

    .director-table .director-row-note {
      white-space: normal;
    }

    .director-dialog-head {
      top: calc(-1 * var(--s-4));
    }

    .director-metrics {
      gap: var(--s-3);
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .director-metrics .phf-metric {
      padding: var(--s-3);
    }

    .director-metrics .phf-metric-value {
      font-size: 1.35rem;
    }

    .director-toolbar > select {
      flex: 1;
      min-width: 0;
    }

    .director-attention {
      flex-wrap: wrap;
    }

    .director-attention > .phf-ui-button {
      width: 100%;
      margin-left: 0;
    }

    .director-heading > .director-actions {
      width: 100%;
    }

    .director-heading > .director-actions > button {
      flex: 1;
    }

    .director-dialog, .director-roster {
      padding: var(--s-4);
    }

    .director-statusbar > label {
      margin-left: 0;
    }
  }

  .cr-workspace {
    gap: var(--s-5);
    min-width: 0;
    display: grid;
  }

  .cr-workspace h2 {
    font-size: 1.3rem;
    font-weight: var(--heading-weight);
    letter-spacing: var(--heading-tracking);
  }

  .cr-workspace h3 {
    font-size: 1.05rem;
    font-weight: var(--heading-weight);
  }

  .cr-heading, .cr-section-head, .cr-detail-head {
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--s-5);
    display: flex;
  }

  .cr-heading p {
    color: var(--text-dim);
    margin-top: var(--s-2);
  }

  .cr-eyebrow {
    align-items: center;
    gap: var(--s-2);
    color: var(--text-dim);
    margin-bottom: var(--s-3);
    font-size: .8rem;
    display: flex;
  }

  .cr-actions, .cr-editor-actions {
    align-items: center;
    gap: var(--s-3);
    flex-wrap: wrap;
    display: flex;
  }

  .cr-workspace .phf-ui-button {
    justify-content: center;
    align-items: center;
    gap: var(--s-2);
    display: inline-flex;
  }

  .cr-metrics {
    gap: var(--card-gap);
    grid-template-columns: repeat(4, minmax(0, 1fr));
    display: grid;
  }

  .cr-tabs {
    gap: var(--s-2);
    border-bottom: 1px solid var(--line-strong);
    padding-bottom: var(--s-3);
    flex-wrap: wrap;
    display: flex;
  }

  .cr-tabs button, .cr-detail-nav button {
    align-items: center;
    gap: var(--s-2);
    padding: var(--s-3) var(--s-4);
    min-height: 44px;
    color: var(--text-dim);
    border-radius: var(--radius-sm);
    border: 1px solid #0000;
    display: inline-flex;
  }

  .cr-tabs [aria-current], .cr-detail-nav [aria-pressed="true"] {
    background: var(--surface);
    border-color: var(--line-strong);
    color: var(--text);
    box-shadow: var(--shadow-card);
  }

  .cr-notice {
    justify-content: space-between;
    align-items: center;
    gap: var(--s-3);
    color: var(--text-mute);
    flex-wrap: wrap;
    font-size: .78rem;
    display: flex;
  }

  .cr-notice button {
    min-height: 44px;
    padding: 0 var(--s-3);
    color: var(--text-dim);
    text-decoration: underline;
  }

  .cr-filters {
    gap: var(--s-3);
    flex-wrap: wrap;
    display: flex;
  }

  .cr-workspace input, .cr-workspace select, .cr-workspace textarea {
    background: var(--surface-2);
    width: 100%;
    min-width: 0;
    color: var(--text);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    padding: var(--s-3);
    min-height: 44px;
    font: inherit;
    font-size: .86rem;
  }

  .cr-workspace textarea {
    resize: vertical;
    line-height: 1.6;
  }

  .cr-workspace input:focus-visible, .cr-workspace select:focus-visible, .cr-workspace textarea:focus-visible, .cr-workspace button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
  }

  .cr-filters > select {
    flex: 140px;
    width: auto;
  }

  .cr-search {
    flex: 3 250px;
    align-items: center;
    display: flex;
    position: relative;
  }

  .cr-search svg {
    left: var(--s-3);
    color: var(--text-mute);
    position: absolute;
  }

  .cr-search input {
    padding-left: var(--s-6);
  }

  .cr-universe {
    gap: var(--card-gap);
    align-items: start;
    display: grid;
  }

  .cr-with-detail {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  }

  .cr-list, .cr-detail {
    min-width: 0;
  }

  .cr-company-list {
    display: grid;
  }

  .cr-company-row {
    gap: var(--s-4);
    padding: var(--s-5) var(--s-3);
    border-top: 1px solid var(--line);
    text-align: left;
    grid-template-columns: 78px minmax(0, 1fr) 130px 18px;
    align-items: center;
    width: 100%;
    min-width: 0;
    display: grid;
  }

  .cr-company-row:hover {
    background: var(--surface-2);
  }

  .cr-company-row[aria-pressed="true"] {
    background: var(--accent-soft);
  }

  .cr-ticker {
    font-family: var(--mono);
    overflow-wrap: anywhere;
    font-size: .85rem;
    font-weight: 500;
  }

  .cr-company-info {
    gap: var(--s-1);
    min-width: 0;
    display: grid;
  }

  .cr-company-info strong {
    font-weight: 500;
  }

  .cr-company-info small, .cr-muted, .cr-footnote, .cr-table-note, .cr-block {
    color: var(--text-dim);
    font-size: .8rem;
    line-height: 1.6;
  }

  .cr-thesis-preview {
    color: var(--text-dim);
    margin-top: var(--s-2);
    max-width: var(--measure);
    font-size: .85rem;
    line-height: 1.6;
  }

  .cr-score {
    gap: var(--s-1);
    min-width: 0;
    display: grid;
  }

  .cr-score strong {
    font-variant-numeric: tabular-nums;
    font-size: 1.3rem;
    font-weight: 400;
  }

  .cr-score small {
    color: var(--text-dim);
    font-size: .7rem;
  }

  .cr-score-track {
    background: var(--line);
    border-radius: var(--radius-sm);
    height: 4px;
    display: block;
    overflow: hidden;
  }

  .cr-score-track > span {
    background: var(--accent);
    height: 100%;
    display: block;
  }

  .cr-footnote {
    padding-top: var(--s-4);
    margin-top: var(--s-4);
    border-top: 1px solid var(--line);
  }

  .cr-detail-head button {
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    min-width: 44px;
    min-height: 44px;
    font-size: 1.3rem;
  }

  .cr-detail-nav {
    gap: var(--s-1);
    margin: var(--s-4) 0;
    flex-wrap: wrap;
    display: flex;
  }

  .cr-form-stack {
    gap: var(--s-5);
    min-width: 0;
    display: grid;
  }

  .cr-form-grid {
    gap: var(--s-4);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    display: grid;
  }

  .cr-workspace fieldset {
    border: 0;
    min-width: 0;
    margin: 0;
    padding: 0;
  }

  .cr-workspace fieldset:disabled {
    opacity: .7;
  }

  .cr-field {
    align-content: start;
    gap: var(--s-2);
    min-width: 0;
    font-size: .85rem;
    display: grid;
  }

  .cr-field small {
    color: var(--text-dim);
    font-size: .75rem;
    line-height: 1.6;
  }

  .cr-editor-actions {
    margin-top: var(--s-5);
  }

  .cr-editor-actions small {
    color: var(--warn);
  }

  .cr-supply-grid {
    gap: var(--card-gap);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    display: grid;
  }

  .cr-network {
    gap: var(--s-4);
    margin-top: var(--s-5);
    display: grid;
  }

  .cr-network-center {
    align-items: center;
    gap: var(--s-2);
    padding: var(--s-5);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--accent-soft);
    flex-direction: column;
    display: flex;
  }

  .cr-network-center svg {
    color: var(--accent);
  }

  .cr-network-center span {
    font-family: var(--mono);
    font-size: .8rem;
  }

  .cr-network-edge {
    align-items: center;
    gap: var(--s-3);
    grid-template-columns: 72px minmax(0, 1fr) auto;
    display: grid;
  }

  .cr-network-edge > div {
    color: var(--text-mute);
    font-size: .75rem;
  }

  .cr-network-edge > button {
    gap: var(--s-1);
    text-align: left;
    padding: var(--s-3);
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    min-height: 44px;
    display: grid;
  }

  .cr-network-edge small {
    color: var(--text-dim);
    font-size: .78rem;
  }

  .cr-scenario-result {
    gap: var(--s-3);
    margin-top: var(--s-5);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    display: grid;
  }

  .cr-workspace td {
    padding: var(--s-3);
    vertical-align: top;
    white-space: normal;
    font-size: .83rem;
  }

  .cr-workspace .phf-table {
    min-width: 600px;
  }

  .cr-table-note {
    max-width: 36ch;
    margin-top: var(--s-2);
  }

  .cr-block {
    max-width: 20ch;
    display: block;
  }

  .cr-workspace details {
    margin: var(--s-3) 0;
  }

  .cr-workspace summary {
    cursor: pointer;
    min-height: 44px;
    padding: var(--s-3) 0;
    color: var(--text-dim);
    font-size: .85rem;
  }

  .cr-workspace pre {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    padding: var(--s-3);
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    font-size: .75rem;
  }

  .cr-workspace a {
    color: var(--accent);
    text-decoration: underline;
  }

  .cr-forecast-meta {
    gap: var(--s-4);
    margin: var(--s-4) 0;
    color: var(--text-dim);
    flex-wrap: wrap;
    font-size: .82rem;
    display: flex;
  }

  .cr-outcome {
    gap: var(--s-2);
    padding: var(--s-4);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    display: grid;
  }

  .cr-outcome small {
    color: var(--text-dim);
  }

  .cr-saved {
    color: var(--ok);
    font-size: .85rem;
  }

  .cr-warning {
    color: var(--warn);
    padding: var(--s-3) 0;
  }

  .cr-empty-icon {
    margin: 0 auto var(--s-3);
    color: var(--text-mute);
  }

  @media (max-width: 1150px) {
    .cr-with-detail {
      grid-template-columns: minmax(0, 1fr);
    }

    .cr-heading {
      flex-wrap: wrap;
    }
  }

  @media (max-width: 760px) {
    .cr-metrics, .cr-supply-grid, .cr-form-grid {
      grid-template-columns: minmax(0, 1fr);
    }

    .cr-metrics {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cr-company-row {
      gap: var(--s-2);
      padding: var(--s-4) 0;
      grid-template-columns: 60px minmax(0, 1fr) 78px;
    }

    .cr-company-row > svg {
      display: none;
    }

    .cr-company-info strong {
      font-size: .87rem;
    }

    .cr-company-info small {
      font-size: .7rem;
    }

    .cr-thesis-preview {
      display: none;
    }

    .cr-network-edge {
      grid-template-columns: 55px minmax(0, 1fr);
    }

    .cr-network-edge > .phf-badge {
      grid-column: 2;
      justify-self: start;
    }

    .cr-section-head {
      flex-wrap: wrap;
    }

    .cr-tabs button {
      padding: var(--s-2);
      font-size: .8rem;
    }

    .cr-scenario-result {
      grid-template-columns: minmax(0, 1fr);
    }
  }

  .ri-workspace {
    gap: var(--s-5);
    min-width: 0;
    display: grid;
  }

  .ri-heading, .ri-heading-actions, .ri-section-heading, .ri-detail-top {
    justify-content: space-between;
    align-items: center;
    gap: var(--s-4);
    flex-wrap: wrap;
    display: flex;
  }

  .ri-heading p {
    color: var(--text-dim);
    margin-top: var(--s-3);
  }

  .ri-eyebrow {
    align-items: center;
    gap: var(--s-2);
    color: var(--text-dim);
    letter-spacing: .04em;
    margin-bottom: var(--s-3);
    font-size: .72rem;
    display: flex;
  }

  .ri-workspace h2 {
    letter-spacing: var(--heading-tracking);
    font-size: 1.2rem;
    font-weight: var(--heading-weight);
  }

  .ri-workspace h3 {
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.5;
  }

  .ri-workspace p, .ri-workspace dd {
    overflow-wrap: anywhere;
    font-size: .88rem;
    line-height: 1.75;
  }

  .ri-metrics {
    gap: var(--card-gap);
    grid-template-columns: repeat(4, minmax(0, 1fr));
    display: grid;
  }

  .ri-workspace .phf-ui-button, .ri-text-link, .ri-workspace a {
    align-items: center;
    gap: var(--s-2);
    display: inline-flex;
  }

  .ri-text-link {
    text-underline-offset: 4px;
    font-size: .82rem;
    text-decoration: underline;
  }

  .ri-tabs {
    gap: var(--s-2);
    border-bottom: 1px solid var(--line-strong);
    padding-bottom: var(--s-3);
    flex-wrap: wrap;
    display: flex;
  }

  .ri-tabs button {
    align-items: center;
    gap: var(--s-2);
    padding: var(--s-3) var(--s-4);
    border-radius: var(--radius-sm);
    min-height: 44px;
    color: var(--text-dim);
    border: 1px solid #0000;
    display: flex;
  }

  .ri-tabs [aria-current] {
    color: var(--text);
    background: var(--surface);
    border-color: var(--line-strong);
    box-shadow: var(--shadow-card);
  }

  .ri-count {
    background: var(--accent-soft);
    border-radius: 12px;
    padding: 2px 6px;
    font-size: .7rem;
  }

  .ri-sync {
    justify-content: space-between;
    gap: var(--s-3);
    color: var(--text-mute);
    flex-wrap: wrap;
    font-size: .75rem;
    display: flex;
  }

  .ri-dot {
    background: currentColor;
    border-radius: 50%;
    width: 6px;
    height: 6px;
    margin-right: 7px;
    display: inline-block;
  }

  .ri-filters {
    gap: var(--s-3);
    display: flex;
  }

  .ri-workspace input, .ri-workspace select, .ri-workspace textarea {
    background: var(--surface-2);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    padding: var(--s-3);
    color: var(--text);
    font: inherit;
    min-width: 0;
    max-width: 100%;
    min-height: 44px;
    font-size: .85rem;
  }

  .ri-workspace input:not([type="checkbox"]), .ri-workspace textarea {
    width: 100%;
  }

  .ri-workspace textarea {
    resize: vertical;
  }

  .ri-workspace button:focus-visible, .ri-workspace a:focus-visible, .ri-workspace input:focus-visible, .ri-workspace textarea:focus-visible, .ri-workspace select:focus-visible, .ri-workspace summary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
  }

  .ri-search {
    flex: 1;
    position: relative;
  }

  .ri-search svg {
    color: var(--text-mute);
    position: absolute;
    top: 14px;
    left: 14px;
  }

  .ri-search input {
    padding-left: 40px !important;
  }

  .ri-reading-layout {
    gap: var(--s-5);
    grid-template-columns: 260px minmax(0, 1fr);
    align-items: start;
    display: grid;
  }

  .ri-brief-list {
    top: var(--s-5);
    gap: var(--s-3);
    display: grid;
    position: sticky;
  }

  .ri-workspace .ri-brief-row {
    padding: var(--s-5);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    gap: var(--s-3);
    text-align: left;
    display: grid;
    position: relative;
  }

  .ri-brief-row.selected {
    border-color: var(--accent);
    box-shadow: inset 3px 0 var(--accent);
  }

  .ri-brief-row strong {
    font-size: .92rem;
    font-weight: 500;
    line-height: 1.5;
  }

  .ri-brief-row small {
    color: var(--text-dim);
    font-size: .7rem;
  }

  .ri-brief-row > svg {
    color: var(--text-mute);
    position: absolute;
    top: 18px;
    right: 10px;
  }

  .ri-brief-symbols {
    font: .7rem var(--mono);
    color: var(--text-dim);
    line-height: 1.7;
  }

  .ri-detail, .ri-section {
    gap: var(--s-5);
    min-width: 0;
    display: grid;
  }

  .ri-detail > *, .ri-section > * {
    min-width: 0;
  }

  .ri-detail-top a, .ri-citations a {
    color: var(--text-dim);
    font-size: .72rem;
  }

  .ri-tags {
    gap: var(--s-2);
    margin: var(--s-3) 0;
    flex-wrap: wrap;
    display: flex;
  }

  .ri-tags a {
    font: .7rem var(--mono);
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    padding: 4px 8px;
  }

  .ri-conclusion {
    margin-top: var(--s-5);
    max-width: 76ch;
  }

  .ri-caption, .ri-muted {
    color: var(--text-dim);
    line-height: 1.7;
    font-size: .78rem !important;
  }

  .ri-caption {
    margin-top: var(--s-4);
  }

  .ri-section-heading > span {
    color: var(--text-dim);
    font-size: .75rem;
  }

  .ri-signal-title {
    align-items: flex-start;
    gap: var(--s-3);
    margin-bottom: var(--s-5);
    display: flex;
  }

  .ri-signal-title h3 {
    flex: 1;
  }

  .ri-number {
    font: .75rem var(--mono);
    color: var(--text-mute);
    padding-top: 3px;
  }

  .ri-citations {
    gap: var(--s-1);
    flex-wrap: wrap;
    display: flex;
  }

  .ri-analysis {
    gap: var(--s-4);
    margin-top: var(--s-4);
    display: grid;
  }

  .ri-analysis > div {
    gap: var(--s-4);
    grid-template-columns: 110px minmax(0, 1fr);
    display: grid;
  }

  .ri-analysis dt {
    color: var(--text-dim);
    padding-top: 4px;
    font-size: .73rem;
  }

  .ri-analysis dd {
    margin: 0;
  }

  .ri-uncertainty {
    background: var(--surface-2);
    padding: var(--s-4);
    border-radius: var(--radius-sm);
  }

  .ri-next, .ri-alert-row {
    gap: var(--s-4);
    padding: var(--s-5) 0;
    border-top: 1px solid var(--line);
    margin-top: var(--s-4);
    justify-content: space-between;
    align-items: flex-start;
    display: flex;
  }

  .ri-next > div, .ri-alert-row > div {
    flex: 1;
    min-width: 0;
  }

  .ri-next small {
    color: var(--text-mute);
    font-size: .75rem;
  }

  .ri-belief, .ri-source, .ri-test {
    border-top: 1px solid var(--line);
    padding: var(--s-4) 0;
  }

  .ri-belief summary {
    align-items: baseline;
    gap: var(--s-3);
    cursor: pointer;
    font-size: .85rem;
    line-height: 1.6;
    display: flex;
  }

  .ri-source summary {
    cursor: pointer;
    font-size: .85rem;
    line-height: 1.6;
  }

  .ri-source summary small {
    color: var(--text-mute);
    margin-top: 4px;
    font-size: .7rem;
    display: block;
  }

  .ri-source > small {
    color: var(--text-mute);
    margin-top: var(--s-2);
    display: block;
  }

  .ri-source a {
    font-size: .78rem;
    text-decoration: underline;
  }

  .ri-test {
    margin-top: var(--s-4);
  }

  .ri-test summary {
    cursor: pointer;
    color: var(--text-dim);
    font-size: .8rem;
  }

  .ri-action-footer {
    align-items: center;
    gap: var(--s-4);
    color: var(--text-dim);
    margin-top: var(--s-4);
    flex-wrap: wrap;
    font-size: .77rem;
    display: flex;
  }

  .ri-action-footer .phf-ui-button {
    margin-left: auto;
  }

  .ri-form-grid {
    gap: var(--s-4);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    display: grid;
  }

  .ri-field {
    gap: var(--s-2);
    color: var(--text-dim);
    margin-bottom: var(--s-4);
    min-width: 0;
    font-size: .78rem;
    display: grid;
  }

  .ri-edit {
    margin-top: var(--s-5);
    border-top: 1px solid var(--line);
    padding-top: var(--s-5);
  }

  .ri-workspace fieldset {
    border: 0;
    min-width: 0;
    margin: 0;
    padding: 0;
  }

  .ri-workspace fieldset:disabled {
    opacity: .6;
  }

  .ri-note {
    background: var(--surface-2);
    border-left: 2px solid var(--accent);
    padding: var(--s-4);
    margin: var(--s-4) 0 0;
    white-space: pre-wrap;
    font-size: .85rem;
  }

  .ri-date-row {
    gap: var(--s-5);
    padding: var(--s-5) 0;
    border-bottom: 1px solid var(--line);
    grid-template-columns: 65px minmax(0, 1fr) auto;
    display: grid;
  }

  .ri-date-row:last-child {
    border: 0;
  }

  .ri-date-stamp {
    align-content: start;
    gap: var(--s-1);
    text-align: center;
    border-right: 1px solid var(--line);
    padding-right: var(--s-3);
    display: grid;
  }

  .ri-date-stamp strong {
    font-size: 1.7rem;
    font-weight: 400;
  }

  .ri-date-stamp span {
    color: var(--text-dim);
    font-size: .7rem;
  }

  .ri-date-label {
    gap: var(--s-3);
    margin-bottom: var(--s-3);
    color: var(--text-dim);
    flex-wrap: wrap;
    align-items: center;
    font-size: .72rem;
    display: flex;
  }

  .ri-date-links {
    gap: var(--s-4);
    flex-wrap: wrap;
    font-size: .75rem;
    display: flex;
  }

  .ri-check {
    align-items: center;
    gap: var(--s-3);
    font-size: .82rem;
    display: flex;
  }

  .ri-check input {
    width: 17px;
    height: 17px;
    min-height: 0;
    accent-color: var(--accent);
  }

  .ri-alert-options {
    gap: var(--s-4);
    margin: var(--s-5) 0;
    grid-template-columns: 1fr 1fr;
    display: grid;
  }

  .ri-alert-row.read {
    opacity: .65;
  }

  .ri-warning {
    color: var(--warn);
    font-size: .8rem;
  }

  .ri-saved {
    color: var(--text-dim);
    font-size: .8rem;
  }

  @media (max-width: 1100px) {
    .ri-reading-layout {
      grid-template-columns: 210px minmax(0, 1fr);
    }

    .ri-analysis > div {
      gap: var(--s-1);
      grid-template-columns: 1fr;
    }
  }

  @media (max-width: 760px) {
    .ri-metrics {
      grid-template-columns: 1fr 1fr;
    }

    .ri-reading-layout {
      grid-template-columns: 1fr;
    }

    .ri-brief-list {
      position: static;
    }

    .ri-tabs {
      gap: 0;
    }

    .ri-tabs button {
      padding: 10px;
    }

    .ri-filters {
      flex-direction: column;
    }

    .ri-form-grid, .ri-alert-options {
      grid-template-columns: 1fr;
    }

    .ri-date-row {
      gap: var(--s-3);
      grid-template-columns: 48px minmax(0, 1fr);
    }

    .ri-date-row > select {
      grid-column: 2;
    }

    .ri-alert-row {
      flex-wrap: wrap;
    }

    .ri-alert-row > .phf-ui-button {
      margin-left: 32px;
    }

    .ri-signal-title {
      flex-wrap: wrap;
    }

    .ri-next {
      flex-direction: column;
    }
  }

  .mc-workspace {
    min-width: 0;
    color: var(--text);
    flex-direction: column;
    gap: 24px;
    padding-bottom: 40px;
    display: flex;
  }

  .mc-header {
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    display: flex;
  }

  .mc-eyebrow {
    letter-spacing: .16em;
    color: var(--text-mute);
    font-size: 10px;
    font-weight: 650;
  }

  .mc-header h1 {
    letter-spacing: -1.4px;
    margin: 8px 0;
    font-size: 38px;
    font-weight: 550;
    line-height: 1.2;
  }

  .mc-header p {
    color: var(--text-dim);
    margin: 0;
    font-size: 14px;
  }

  .mc-gold {
    color: var(--accent);
  }

  .mc-header-actions {
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    display: flex;
  }

  .mc-workspace a {
    color: var(--text-dim);
    align-items: center;
    gap: 4px;
    font-size: 12px;
    display: inline-flex;
  }

  .mc-workspace a:hover {
    color: var(--accent);
  }

  .mc-metrics {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    grid-template-columns: repeat(3, 1fr) 1.6fr;
    padding: 22px 0;
    display: grid;
  }

  .mc-metrics > div {
    border-right: 1px solid var(--line);
    flex-direction: column;
    gap: 7px;
    padding: 0 24px;
    display: flex;
  }

  .mc-metrics > div:last-child {
    border: 0;
  }

  .mc-metrics span {
    letter-spacing: .12em;
    color: var(--text-mute);
    font-size: 10px;
  }

  .mc-metrics strong {
    font-variant-numeric: tabular-nums;
    font-size: 28px;
    font-weight: 500;
    line-height: 1.1;
  }

  .mc-metrics small {
    color: var(--text-dim);
    font-size: 11px;
  }

  .mc-metrics em {
    color: var(--text-dim);
    font-size: 14px;
    font-style: normal;
    font-weight: 400;
  }

  .mc-bar {
    border-bottom: 1px solid var(--line);
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    display: flex;
  }

  .mc-bar nav {
    flex-wrap: wrap;
    gap: 22px;
    display: flex;
  }

  .mc-bar nav button {
    color: var(--text-dim);
    border-bottom: 2px solid #0000;
    align-items: center;
    gap: 7px;
    padding: 0 0 15px;
    font-size: 12px;
    display: flex;
  }

  .mc-bar nav button.active {
    color: var(--text);
    border-color: var(--accent);
  }

  .mc-bar nav b {
    background: var(--accent);
    color: var(--ink);
    border-radius: 20px;
    padding: 1px 6px;
    font-size: 10px;
  }

  .mc-bar > select {
    max-width: 200px;
    margin-bottom: 12px;
  }

  .mc-filters {
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    display: flex;
  }

  .mc-search {
    background: var(--surface);
    border: 1px solid var(--line);
    min-width: 230px;
    color: var(--text-mute);
    border-radius: 8px;
    flex: 1;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    display: flex;
  }

  .mc-search input {
    width: 100%;
    background: none !important;
    border: 0 !important;
    padding-left: 0 !important;
  }

  .mc-workspace input:not([type="checkbox"]), .mc-workspace select, .mc-workspace textarea {
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    border-radius: 8px;
    min-width: 0;
    max-width: 100%;
    padding: 9px 10px;
    font-size: 12px;
  }

  .mc-workspace input:focus, .mc-workspace select:focus, .mc-workspace textarea:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
  }

  .mc-workspace textarea {
    resize: vertical;
    width: 100%;
    line-height: 1.6;
  }

  .mc-workspace button:disabled {
    opacity: .45;
    cursor: not-allowed;
  }

  .mc-workspace button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
  }

  .mc-check {
    color: var(--text-dim);
    align-items: center;
    gap: 8px;
    font-size: 12px;
    line-height: 1.5;
    display: flex;
  }

  .mc-check input {
    accent-color: var(--accent);
    flex-shrink: 0;
    width: 15px;
    height: 15px;
  }

  .mc-text-button {
    color: var(--text-dim);
    text-align: left;
    align-items: center;
    gap: 5px;
    padding: 5px 0;
    font-size: 12px;
    display: inline-flex;
  }

  .mc-text-button:hover {
    color: var(--accent);
  }

  .mc-layout {
    grid-template-columns: minmax(0, 1fr) 360px;
    align-items: start;
    gap: 24px;
    display: grid;
  }

  .mc-main {
    min-width: 0;
  }

  .mc-side {
    flex-direction: column;
    gap: 18px;
    min-width: 0;
    display: flex;
  }

  .mc-side > .phf-card {
    padding: 24px;
  }

  .mc-workspace h2 {
    letter-spacing: -.35px;
    font-size: 18px;
    font-weight: 550;
    line-height: 1.35;
  }

  .mc-workspace h3 {
    font-size: 14px;
    font-weight: 550;
    line-height: 1.5;
  }

  .mc-side h2 {
    margin-top: 12px;
    margin-bottom: 12px;
    font-size: 23px;
  }

  .mc-workspace p {
    color: var(--text-dim);
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.7;
  }

  .mc-side h3 {
    margin-top: 10px;
  }

  .mc-steps {
    flex-direction: column;
    gap: 20px;
    margin: 0;
    padding: 24px 0 0;
    list-style: none;
    display: flex;
  }

  .mc-steps li {
    gap: 15px;
    display: flex;
  }

  .mc-steps > li > span {
    color: var(--accent);
    padding-top: 2px;
    font-size: 11px;
  }

  .mc-steps strong {
    font-size: 12px;
    font-weight: 550;
  }

  .mc-steps p {
    margin-top: 5px;
  }

  .mc-range {
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
    display: flex;
  }

  .mc-presets {
    flex-wrap: wrap;
    gap: 4px;
    display: flex;
  }

  .mc-presets button {
    color: var(--text-dim);
    border-radius: 6px;
    padding: 7px 9px;
    font-size: 11px;
  }

  .mc-presets button.active {
    background: var(--surface-2);
    color: var(--text);
  }

  .mc-date-range {
    color: var(--text-mute);
    align-items: center;
    gap: 6px;
    display: flex;
  }

  .mc-date-range input {
    width: 132px;
    font-size: 11px !important;
  }

  .mc-list-heading {
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: 0 0 15px;
    display: flex;
  }

  .mc-list-heading span {
    color: var(--text-mute);
    font-size: 11px;
  }

  .mc-list-heading p {
    margin-top: 5px;
  }

  .mc-agenda + .mc-list-heading {
    margin-top: 28px;
  }

  .mc-agenda {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    overflow: hidden;
  }

  .mc-event-row {
    text-align: left;
    border-bottom: 1px solid var(--line);
    align-items: center;
    gap: 15px;
    width: 100%;
    padding: 18px 20px;
    transition: background .15s;
    display: flex;
  }

  .mc-event-row:last-child {
    border-bottom: 0;
  }

  .mc-event-row:hover {
    background: var(--surface-2);
  }

  .mc-event-row.selected {
    background: var(--accent);
  }

  @supports (color: color-mix(in lab, red, red)) {
    .mc-event-row.selected {
      background: color-mix(in srgb,var(--accent) 7%,var(--surface));
    }
  }

  .mc-event-row.selected {
    box-shadow: inset 3px 0 var(--accent);
  }

  .mc-event-row.cancelled {
    opacity: .55;
  }

  .mc-date-block {
    border-right: 1px solid var(--line);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 3px;
    min-width: 43px;
    padding-right: 14px;
    display: flex;
  }

  .mc-date-block strong {
    font-size: 23px;
    font-weight: 500;
    line-height: 1.1;
  }

  .mc-date-block small {
    color: var(--text-mute);
    white-space: nowrap;
    font-size: 10px;
  }

  .mc-event-content {
    flex-direction: column;
    flex: 1;
    gap: 7px;
    min-width: 0;
    display: flex;
  }

  .mc-event-content > strong {
    font-size: 13px;
    font-weight: 550;
    line-height: 1.4;
  }

  .mc-event-row > svg {
    color: var(--text-mute);
    flex-shrink: 0;
  }

  .mc-row-meta {
    color: var(--text-mute);
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
    font-size: 10px;
    display: flex;
  }

  .mc-priority {
    align-items: center;
    gap: 5px;
    display: inline-flex;
  }

  .mc-priority:before {
    content: "";
    background: var(--text-mute);
    border-radius: 50%;
    width: 5px;
    height: 5px;
  }

  .mc-priority.high {
    color: var(--accent);
  }

  .mc-priority.high:before {
    background: var(--accent);
  }

  .mc-row-bottom {
    color: var(--text-dim);
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    font-size: 10px;
    line-height: 1.5;
    display: flex;
  }

  .mc-detail-top {
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    display: flex;
  }

  .mc-detail-top > button {
    color: var(--text-mute);
    padding: 4px;
  }

  .mc-detail-top > span {
    color: var(--text-mute);
    font-size: 11px;
  }

  .mc-detail .mc-detail-date {
    margin-bottom: 15px;
    font-size: 12px;
  }

  .mc-symbols {
    flex-wrap: wrap;
    gap: 6px;
    margin: 12px 0 20px;
    display: flex;
  }

  .mc-symbols a {
    background: var(--surface-2);
    border-radius: 5px;
    padding: 4px 7px;
    font-size: 10px;
  }

  .mc-detail dl {
    flex-direction: column;
    gap: 9px;
    display: flex;
  }

  .mc-detail dt {
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-top: 12px;
    font-size: 10px;
    font-weight: 600;
  }

  .mc-detail dd {
    color: var(--text-dim);
    overflow-wrap: anywhere;
    font-size: 12px;
    line-height: 1.7;
  }

  .mc-detail dd small {
    color: var(--text-mute);
    margin-top: 6px;
    font-size: 10px;
    display: block;
  }

  .mc-history {
    border-top: 1px solid var(--line);
    margin-top: 16px;
    padding: 16px 0;
  }

  .mc-history summary {
    cursor: pointer;
    font-size: 12px;
  }

  .mc-history p {
    font-size: 11px;
  }

  .mc-detail form {
    border-top: 1px solid var(--line);
    margin-top: 8px;
    padding-top: 20px;
  }

  .mc-detail form h3 {
    margin: 0 0 15px;
  }

  .mc-field {
    flex-direction: column;
    gap: 7px;
    margin: 15px 0;
    display: flex;
  }

  .mc-field > label {
    color: var(--text-dim);
    font-size: 11px;
    font-weight: 500;
  }

  .mc-checklist {
    flex-direction: column;
    gap: 9px;
    margin: 17px 0;
    display: flex;
  }

  .mc-detail fieldset > .mc-text-button {
    margin-top: 10px;
  }

  .mc-workspace fieldset {
    min-width: 0;
  }

  .mc-detail > button:last-child {
    margin-top: 18px;
  }

  .mc-month-head {
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    display: flex;
  }

  .mc-month-head > div {
    gap: 7px;
    display: flex;
  }

  .mc-grid {
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: 10px;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    margin-bottom: 24px;
    display: grid;
    overflow: hidden;
  }

  .mc-weekday {
    text-align: center;
    color: var(--text-mute);
    border-bottom: 1px solid var(--line);
    padding: 12px 0;
    font-size: 10px;
  }

  .mc-day {
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    min-width: 0;
    min-height: 110px;
    padding: 7px;
  }

  .mc-day:nth-child(7n) {
    border-right: 0;
  }

  .mc-day.outside {
    opacity: .4;
  }

  .mc-day.selected {
    background: var(--accent);
  }

  @supports (color: color-mix(in lab, red, red)) {
    .mc-day.selected {
      background: color-mix(in srgb,var(--accent) 8%,var(--surface));
    }
  }

  .mc-day-number {
    justify-content: space-between;
    align-items: center;
    gap: 2px;
    width: 100%;
    margin-bottom: 5px;
    padding: 3px;
    font-size: 11px;
    display: flex;
  }

  .mc-day-number small {
    color: var(--text-mute);
    font-size: 9px;
  }

  .mc-day.today .mc-day-number {
    color: var(--accent);
    font-weight: 700;
  }

  .mc-cell-event {
    text-align: left;
    width: 100%;
    color: var(--text-dim);
    border-left: 2px solid var(--line);
    white-space: nowrap;
    text-overflow: ellipsis;
    margin: 3px 0;
    padding: 3px 4px;
    font-size: 9px;
    display: block;
    overflow: hidden;
  }

  .mc-cell-event.high {
    border-color: var(--accent);
  }

  .mc-more {
    color: var(--text-mute);
    padding: 3px;
    font-size: 9px;
  }

  .mc-notice {
    border: 1px solid var(--warn);
    padding: 13px 16px;
  }

  @supports (color: color-mix(in lab, red, red)) {
    .mc-notice {
      border: 1px solid color-mix(in srgb,var(--warn) 35%,var(--line));
    }
  }

  .mc-notice {
    color: var(--text-dim);
    background: var(--warn);
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.6;
  }

  @supports (color: color-mix(in lab, red, red)) {
    .mc-notice {
      background: color-mix(in srgb,var(--warn) 4%,var(--surface));
    }
  }

  .mc-saved {
    color: var(--ok);
    align-items: center;
    gap: 7px;
    font-size: 12px;
    display: flex;
  }

  .mc-warning {
    overflow-wrap: anywhere;
    font-size: 11px;
    color: var(--warn) !important;
  }

  .mc-source-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 20px;
    display: grid;
  }

  .mc-source-grid .phf-card {
    min-width: 0;
  }

  .mc-source-grid h3 {
    margin: 14px 0 8px;
  }

  .mc-layout > main > .phf-card {
    margin-bottom: 12px;
  }

  .mc-layout > .phf-card form p {
    margin: 14px 0;
  }

  .mc-layout > .phf-card .mc-check {
    margin: 15px 0;
  }

  .mc-modal-backdrop {
    z-index: 1000;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    background: #0008;
    justify-content: center;
    align-items: center;
    padding: 24px;
    display: flex;
    position: fixed;
    inset: 0;
  }

  .mc-modal {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    width: min(650px, 100%);
    max-height: 90vh;
    padding: 28px;
    overflow: auto;
    box-shadow: 0 24px 80px #0003;
  }

  .mc-form-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0 18px;
    display: grid;
  }

  .mc-modal .mc-header-actions {
    margin-top: 20px;
  }

  @media (min-width: 1600px) {
    .mc-layout {
      grid-template-columns: minmax(0, 1fr) 410px;
    }
  }

  @media (max-width: 1100px) {
    .mc-layout {
      grid-template-columns: minmax(0, 1fr) 310px;
      gap: 16px;
    }

    .mc-metrics > div {
      padding: 0 16px;
    }

    .mc-source-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mc-range, .mc-header {
      align-items: flex-start;
    }

    .mc-header-actions {
      gap: 8px;
    }

    .mc-filters select {
      flex: 1;
    }

    .mc-event-row {
      gap: 12px;
      padding: 16px 12px;
    }
  }

  @media (max-width: 850px) {
    .mc-layout {
      grid-template-columns: 1fr;
    }

    .mc-side {
      order: -1;
    }

    .mc-side:not(:has(.mc-detail)) {
      display: none;
    }

    .mc-side .mc-detail {
      max-height: none;
    }

    .mc-header {
      flex-direction: column;
      gap: 18px;
    }

    .mc-metrics {
      grid-template-columns: 1fr 1fr;
      gap: 24px 0;
    }

    .mc-metrics > div:nth-child(2) {
      border: 0;
    }

    .mc-bar {
      flex-wrap: wrap;
      gap: 8px;
    }

    .mc-bar nav {
      gap: 20px;
    }

    .mc-bar > select {
      margin-bottom: 10px;
    }

    .mc-source-grid {
      grid-template-columns: 1fr 1fr;
    }
  }

  @media (max-width: 520px) {
    .mc-workspace {
      gap: 20px;
    }

    .mc-header h1 {
      font-size: 32px;
    }

    .mc-header-actions > a, .mc-header-actions button {
      font-size: 11px;
    }

    .mc-metrics {
      padding: 18px 0;
    }

    .mc-metrics > div {
      padding: 0 14px;
    }

    .mc-metrics strong {
      font-size: 25px;
    }

    .mc-metrics em {
      margin-top: 5px;
      font-size: 11px;
      display: block;
    }

    .mc-metrics small {
      font-size: 10px;
    }

    .mc-bar nav {
      gap: 12px;
    }

    .mc-bar nav button {
      gap: 5px;
      font-size: 11px;
    }

    .mc-bar nav button svg {
      display: none;
    }

    .mc-filters {
      gap: 8px;
    }

    .mc-search {
      min-width: 100%;
    }

    .mc-filters select {
      width: 140px;
      max-width: 100%;
    }

    .mc-range {
      gap: 10px;
    }

    .mc-list-heading {
      align-items: flex-start;
    }

    .mc-list-heading h2 {
      font-size: 17px;
    }

    .mc-list-heading > span {
      text-align: right;
      max-width: 130px;
      line-height: 1.5;
    }

    .mc-date-block {
      min-width: 35px;
      padding-right: 9px;
    }

    .mc-date-block strong {
      font-size: 21px;
    }

    .mc-event-content > strong {
      font-size: 12px;
    }

    .mc-row-bottom {
      flex-direction: column;
      gap: 4px;
    }

    .mc-row-meta {
      gap: 6px;
      font-size: 9px;
    }

    .mc-source-grid {
      grid-template-columns: 1fr;
    }

    .mc-month-head h2 {
      font-size: 17px;
    }

    .mc-month-head > div {
      gap: 4px;
    }

    .mc-day {
      min-height: 72px;
      padding: 3px;
    }

    .mc-cell-event {
      display: none;
    }

    .mc-more {
      font-size: 8px;
    }

    .mc-day:has(.mc-cell-event):after {
      content: "•";
      color: var(--accent);
      text-align: center;
      display: block;
    }

    .mc-modal-backdrop {
      padding: 12px;
    }

    .mc-modal {
      max-height: 94vh;
      padding: 20px;
    }

    .mc-form-grid {
      grid-template-columns: 1fr 1fr;
      gap: 0 10px;
    }
  }
}

@layer utilities {
  .pointer-events-none {
    pointer-events: none;
  }

  .collapse {
    visibility: collapse;
  }

  .visible {
    visibility: visible;
  }

  .sr-only {
    clip-path: inset(50%);
    white-space: nowrap;
    border-width: 0;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    position: absolute;
    overflow: hidden;
  }

  .absolute {
    position: absolute;
  }

  .fixed {
    position: fixed;
  }

  .relative {
    position: relative;
  }

  .static {
    position: static;
  }

  .inset-0 {
    inset: 0;
  }

  .inset-x-0 {
    inset-inline: 0;
  }

  .inset-x-3 {
    inset-inline: calc(var(--spacing) * 3);
  }

  .-inset-y-1 {
    inset-block: calc(var(--spacing) * -1);
  }

  .inset-y-0 {
    inset-block: 0;
  }

  .end-2025 {
    inset-inline-end: calc(var(--spacing) * 2025);
  }

  .top-1 {
    top: var(--spacing);
  }

  .top-3\.5 {
    top: calc(var(--spacing) * 3.5);
  }

  .top-100 {
    top: calc(var(--spacing) * 100);
  }

  .right-0 {
    right: 0;
  }

  .bottom-0 {
    bottom: 0;
  }

  .bottom-20 {
    bottom: calc(var(--spacing) * 20);
  }

  .left-0 {
    left: 0;
  }

  .left-1 {
    left: var(--spacing);
  }

  .left-3 {
    left: calc(var(--spacing) * 3);
  }

  .left-6 {
    left: calc(var(--spacing) * 6);
  }

  .isolate {
    isolation: isolate;
  }

  .z-2 {
    z-index: 2;
  }

  .z-4 {
    z-index: 4;
  }

  .z-10 {
    z-index: 10;
  }

  .z-30 {
    z-index: 30;
  }

  .z-40 {
    z-index: 40;
  }

  .order-1 {
    order: 1;
  }

  .container {
    width: 100%;
  }

  @media (min-width: 40rem) {
    .container {
      max-width: 40rem;
    }
  }

  @media (min-width: 48rem) {
    .container {
      max-width: 48rem;
    }
  }

  @media (min-width: 64rem) {
    .container {
      max-width: 64rem;
    }
  }

  @media (min-width: 80rem) {
    .container {
      max-width: 80rem;
    }
  }

  @media (min-width: 96rem) {
    .container {
      max-width: 96rem;
    }
  }

  .mx-auto {
    margin-inline: auto;
  }

  .my-2 {
    margin-block: calc(var(--spacing) * 2);
  }

  .my-3 {
    margin-block: calc(var(--spacing) * 3);
  }

  .my-4 {
    margin-block: calc(var(--spacing) * 4);
  }

  .mt-0\.5 {
    margin-top: calc(var(--spacing) * .5);
  }

  .mt-1 {
    margin-top: var(--spacing);
  }

  .mt-2 {
    margin-top: calc(var(--spacing) * 2);
  }

  .mt-3 {
    margin-top: calc(var(--spacing) * 3);
  }

  .mt-4 {
    margin-top: calc(var(--spacing) * 4);
  }

  .mt-5 {
    margin-top: calc(var(--spacing) * 5);
  }

  .mt-6 {
    margin-top: calc(var(--spacing) * 6);
  }

  .mt-auto {
    margin-top: auto;
  }

  .mr-2 {
    margin-right: calc(var(--spacing) * 2);
  }

  .mr-5 {
    margin-right: calc(var(--spacing) * 5);
  }

  .mr-auto {
    margin-right: auto;
  }

  .mb-1 {
    margin-bottom: var(--spacing);
  }

  .mb-2 {
    margin-bottom: calc(var(--spacing) * 2);
  }

  .mb-3 {
    margin-bottom: calc(var(--spacing) * 3);
  }

  .mb-4 {
    margin-bottom: calc(var(--spacing) * 4);
  }

  .mb-5 {
    margin-bottom: calc(var(--spacing) * 5);
  }

  .ml-3 {
    margin-left: calc(var(--spacing) * 3);
  }

  .ml-auto {
    margin-left: auto;
  }

  .block {
    display: block;
  }

  .contents {
    display: contents;
  }

  .flex {
    display: flex;
  }

  .grid {
    display: grid;
  }

  .hidden {
    display: none;
  }

  .inline {
    display: inline;
  }

  .inline-block {
    display: inline-block;
  }

  .inline-flex {
    display: inline-flex;
  }

  .table {
    display: table;
  }

  .h-1\.5 {
    height: calc(var(--spacing) * 1.5);
  }

  .h-2 {
    height: calc(var(--spacing) * 2);
  }

  .h-2\.5 {
    height: calc(var(--spacing) * 2.5);
  }

  .h-3 {
    height: calc(var(--spacing) * 3);
  }

  .h-3\.5 {
    height: calc(var(--spacing) * 3.5);
  }

  .h-4 {
    height: calc(var(--spacing) * 4);
  }

  .h-5 {
    height: calc(var(--spacing) * 5);
  }

  .h-6 {
    height: calc(var(--spacing) * 6);
  }

  .h-10 {
    height: calc(var(--spacing) * 10);
  }

  .h-11 {
    height: calc(var(--spacing) * 11);
  }

  .h-12 {
    height: calc(var(--spacing) * 12);
  }

  .h-16 {
    height: calc(var(--spacing) * 16);
  }

  .h-20 {
    height: calc(var(--spacing) * 20);
  }

  .h-64 {
    height: calc(var(--spacing) * 64);
  }

  .h-\[60vh\] {
    height: 60vh;
  }

  .h-\[200px\] {
    height: 200px;
  }

  .h-\[300px\] {
    height: 300px;
  }

  .h-\[520px\] {
    height: 520px;
  }

  .h-auto {
    height: auto;
  }

  .h-fit {
    height: fit-content;
  }

  .h-full {
    height: 100%;
  }

  .max-h-60 {
    max-height: calc(var(--spacing) * 60);
  }

  .max-h-72 {
    max-height: calc(var(--spacing) * 72);
  }

  .max-h-80 {
    max-height: calc(var(--spacing) * 80);
  }

  .max-h-96 {
    max-height: calc(var(--spacing) * 96);
  }

  .min-h-11 {
    min-height: calc(var(--spacing) * 11);
  }

  .min-h-12 {
    min-height: calc(var(--spacing) * 12);
  }

  .min-h-16 {
    min-height: calc(var(--spacing) * 16);
  }

  .min-h-20 {
    min-height: calc(var(--spacing) * 20);
  }

  .min-h-32 {
    min-height: calc(var(--spacing) * 32);
  }

  .min-h-80 {
    min-height: calc(var(--spacing) * 80);
  }

  .min-h-screen {
    min-height: 100vh;
  }

  .w-0\.5 {
    width: calc(var(--spacing) * .5);
  }

  .w-1\/3 {
    width: 33.3333%;
  }

  .w-2\.5 {
    width: calc(var(--spacing) * 2.5);
  }

  .w-2\/3 {
    width: 66.6667%;
  }

  .w-3\.5 {
    width: calc(var(--spacing) * 3.5);
  }

  .w-4 {
    width: calc(var(--spacing) * 4);
  }

  .w-5 {
    width: calc(var(--spacing) * 5);
  }

  .w-6 {
    width: calc(var(--spacing) * 6);
  }

  .w-11 {
    width: calc(var(--spacing) * 11);
  }

  .w-12 {
    width: calc(var(--spacing) * 12);
  }

  .w-28 {
    width: calc(var(--spacing) * 28);
  }

  .w-64 {
    width: calc(var(--spacing) * 64);
  }

  .w-\[460px\] {
    width: 460px;
  }

  .w-\[2460px\] {
    width: 2460px;
  }

  .w-fit {
    width: fit-content;
  }

  .w-full {
    width: 100%;
  }

  .max-w-3xl {
    max-width: var(--container-3xl);
  }

  .max-w-\[1600px\] {
    max-width: 1600px;
  }

  .max-w-\[1700px\] {
    max-width: 1700px;
  }

  .max-w-\[1800px\] {
    max-width: 1800px;
  }

  .max-w-full {
    max-width: 100%;
  }

  .max-w-none {
    max-width: none;
  }

  .min-w-0 {
    min-width: 0;
  }

  .min-w-11 {
    min-width: calc(var(--spacing) * 11);
  }

  .min-w-16 {
    min-width: calc(var(--spacing) * 16);
  }

  .min-w-\[60px\] {
    min-width: 60px;
  }

  .min-w-\[620px\] {
    min-width: 620px;
  }

  .min-w-\[980px\] {
    min-width: 980px;
  }

  .min-w-\[1010px\] {
    min-width: 1010px;
  }

  .min-w-max {
    min-width: max-content;
  }

  .flex-1 {
    flex: 1;
  }

  .shrink {
    flex-shrink: 1;
  }

  .shrink-0 {
    flex-shrink: 0;
  }

  .grow {
    flex-grow: 1;
  }

  .basis-full {
    flex-basis: 100%;
  }

  .-translate-x-1\/2 {
    --tw-translate-x: calc(calc(1 / 2 * 100%) * -1);
    translate: var(--tw-translate-x) var(--tw-translate-y);
  }

  .transform {
    transform: var(--tw-rotate-x, ) var(--tw-rotate-y, ) var(--tw-rotate-z, ) var(--tw-skew-x, ) var(--tw-skew-y, );
  }

  .animate-pulse {
    animation: var(--animate-pulse);
  }

  .animate-spin {
    animation: var(--animate-spin);
  }

  .cursor-pointer {
    cursor: pointer;
  }

  .touch-none {
    touch-action: none;
  }

  .resize {
    resize: both;
  }

  .scroll-mt-4 {
    scroll-margin-top: calc(var(--spacing) * 4);
  }

  .grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }

  .grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .grid-cols-\[76px_52px_90px_1fr\] {
    grid-template-columns: 76px 52px 90px 1fr;
  }

  .grid-cols-\[88px_96px_72px_88px_80px_88px_80px_96px_80px_minmax\(128px\,1fr\)\] {
    grid-template-columns: 88px 96px 72px 88px 80px 88px 80px 96px 80px minmax(128px, 1fr);
  }

  .flex-col {
    flex-direction: column;
  }

  .flex-wrap {
    flex-wrap: wrap;
  }

  .items-baseline {
    align-items: baseline;
  }

  .items-center {
    align-items: center;
  }

  .items-end {
    align-items: flex-end;
  }

  .items-start {
    align-items: flex-start;
  }

  .items-stretch {
    align-items: stretch;
  }

  .justify-around {
    justify-content: space-around;
  }

  .justify-between {
    justify-content: space-between;
  }

  .justify-center {
    justify-content: center;
  }

  .justify-start {
    justify-content: flex-start;
  }

  .gap-1 {
    gap: var(--spacing);
  }

  .gap-2 {
    gap: calc(var(--spacing) * 2);
  }

  .gap-3 {
    gap: calc(var(--spacing) * 3);
  }

  .gap-4 {
    gap: calc(var(--spacing) * 4);
  }

  .gap-5 {
    gap: calc(var(--spacing) * 5);
  }

  .gap-6 {
    gap: calc(var(--spacing) * 6);
  }

  .gap-8 {
    gap: calc(var(--spacing) * 8);
  }

  :where(.space-y-1 > :not(:last-child)) {
    --tw-space-y-reverse: 0;
    margin-block-start: calc(var(--spacing) * var(--tw-space-y-reverse));
    margin-block-end: calc(var(--spacing) * calc(1 - var(--tw-space-y-reverse)));
  }

  :where(.space-y-2 > :not(:last-child)) {
    --tw-space-y-reverse: 0;
    margin-block-start: calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));
    margin-block-end: calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)));
  }

  :where(.space-y-3 > :not(:last-child)) {
    --tw-space-y-reverse: 0;
    margin-block-start: calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));
    margin-block-end: calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)));
  }

  :where(.space-y-4 > :not(:last-child)) {
    --tw-space-y-reverse: 0;
    margin-block-start: calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));
    margin-block-end: calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)));
  }

  :where(.space-y-5 > :not(:last-child)) {
    --tw-space-y-reverse: 0;
    margin-block-start: calc(calc(var(--spacing) * 5) * var(--tw-space-y-reverse));
    margin-block-end: calc(calc(var(--spacing) * 5) * calc(1 - var(--tw-space-y-reverse)));
  }

  :where(.space-y-6 > :not(:last-child)) {
    --tw-space-y-reverse: 0;
    margin-block-start: calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));
    margin-block-end: calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)));
  }

  .gap-x-3 {
    column-gap: calc(var(--spacing) * 3);
  }

  .gap-x-5 {
    column-gap: calc(var(--spacing) * 5);
  }

  .gap-x-6 {
    column-gap: calc(var(--spacing) * 6);
  }

  .gap-y-2 {
    row-gap: calc(var(--spacing) * 2);
  }

  .gap-y-5 {
    row-gap: calc(var(--spacing) * 5);
  }

  :where(.divide-y > :not(:last-child)) {
    --tw-divide-y-reverse: 0;
    border-bottom-style: var(--tw-border-style);
    border-top-style: var(--tw-border-style);
    border-top-width: calc(1px * var(--tw-divide-y-reverse));
    border-bottom-width: calc(1px * calc(1 - var(--tw-divide-y-reverse)));
  }

  :where(.divide-gray-800 > :not(:last-child)) {
    border-color: var(--surface-2);
  }

  .truncate {
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
  }

  .overflow-auto {
    overflow: auto;
  }

  .overflow-hidden {
    overflow: hidden;
  }

  .overflow-x-auto {
    overflow-x: auto;
  }

  .overflow-x-hidden {
    overflow-x: hidden;
  }

  .overflow-y-auto {
    overflow-y: auto;
  }

  .rounded {
    border-radius: .25rem;
  }

  .rounded-2xl {
    border-radius: var(--radius-2xl);
  }

  .rounded-full {
    border-radius: 3.40282e38px;
  }

  .rounded-lg, .rounded-md, .rounded-sm {
    border-radius: var(--radius-sm);
  }

  .rounded-xl {
    border-radius: var(--radius);
  }

  .rounded-t {
    border-top-left-radius: .25rem;
    border-top-right-radius: .25rem;
  }

  .border {
    border-style: var(--tw-border-style);
    border-width: 1px;
  }

  .border-t {
    border-top-style: var(--tw-border-style);
    border-top-width: 1px;
  }

  .border-b {
    border-bottom-style: var(--tw-border-style);
    border-bottom-width: 1px;
  }

  .border-dashed {
    --tw-border-style: dashed;
    border-style: dashed;
  }

  .border-amber-500\/30 {
    border-color: #f99c004d;
  }

  @supports (color: color-mix(in lab, red, red)) {
    .border-amber-500\/30 {
      border-color: color-mix(in oklab, var(--color-amber-500) 30%, transparent);
    }
  }

  .border-amber-700\/60 {
    border-color: #b7500099;
  }

  @supports (color: color-mix(in lab, red, red)) {
    .border-amber-700\/60 {
      border-color: color-mix(in oklab, var(--color-amber-700) 60%, transparent);
    }
  }

  .border-amber-800 {
    border-color: var(--color-amber-800);
  }

  .border-blue-500\/30 {
    border-color: #3080ff4d;
  }

  @supports (color: color-mix(in lab, red, red)) {
    .border-blue-500\/30 {
      border-color: color-mix(in oklab, var(--color-blue-500) 30%, transparent);
    }
  }

  .border-blue-700 {
    border-color: var(--color-blue-700);
  }

  .border-blue-800 {
    border-color: var(--color-blue-800);
  }

  .border-current {
    border-color: currentColor;
  }

  .border-cyan-400 {
    border-color: var(--color-cyan-400);
  }

  .border-cyan-700 {
    border-color: var(--color-cyan-700);
  }

  .border-emerald-500\/70 {
    border-color: var(--accent);
  }

  @supports (color: color-mix(in lab, red, red)) {
    .border-emerald-500\/70 {
      border-color: color-mix(in oklab, var(--accent) 70%, transparent);
    }
  }

  .border-emerald-700 {
    border-color: var(--color-emerald-700);
  }

  .border-emerald-800 {
    border-color: var(--color-emerald-800);
  }

  .border-gray-700 {
    border-color: var(--line-strong);
  }

  .border-gray-800, .border-gray-800\/70 {
    border-color: var(--surface-2);
  }

  @supports (color: color-mix(in lab, red, red)) {
    .border-gray-800\/70 {
      border-color: color-mix(in oklab, var(--surface-2) 70%, transparent);
    }
  }

  .border-red-500\/20 {
    border-color: #fb2c3633;
  }

  @supports (color: color-mix(in lab, red, red)) {
    .border-red-500\/20 {
      border-color: color-mix(in oklab, var(--color-red-500) 20%, transparent);
    }
  }

  .border-red-500\/30 {
    border-color: #fb2c364d;
  }

  @supports (color: color-mix(in lab, red, red)) {
    .border-red-500\/30 {
      border-color: color-mix(in oklab, var(--color-red-500) 30%, transparent);
    }
  }

  .border-red-800 {
    border-color: var(--color-red-800);
  }

  .border-red-900 {
    border-color: var(--color-red-900);
  }

  .border-red-900\/60 {
    border-color: #82181a99;
  }

  @supports (color: color-mix(in lab, red, red)) {
    .border-red-900\/60 {
      border-color: color-mix(in oklab, var(--color-red-900) 60%, transparent);
    }
  }

  .border-slate-700 {
    border-color: var(--line-strong);
  }

  .border-slate-800 {
    border-color: var(--surface-2);
  }

  .bg-amber-400 {
    background-color: var(--color-amber-400);
  }

  .bg-amber-500 {
    background-color: var(--color-amber-500);
  }

  .bg-amber-500\/10 {
    background-color: #f99c001a;
  }

  @supports (color: color-mix(in lab, red, red)) {
    .bg-amber-500\/10 {
      background-color: color-mix(in oklab, var(--color-amber-500) 10%, transparent);
    }
  }

  .bg-amber-500\/15 {
    background-color: #f99c0026;
  }

  @supports (color: color-mix(in lab, red, red)) {
    .bg-amber-500\/15 {
      background-color: color-mix(in oklab, var(--color-amber-500) 15%, transparent);
    }
  }

  .bg-amber-950\/30 {
    background-color: #4619014d;
  }

  @supports (color: color-mix(in lab, red, red)) {
    .bg-amber-950\/30 {
      background-color: color-mix(in oklab, var(--color-amber-950) 30%, transparent);
    }
  }

  .bg-blue-500 {
    background-color: var(--color-blue-500);
  }

  .bg-blue-500\/10 {
    background-color: #3080ff1a;
  }

  @supports (color: color-mix(in lab, red, red)) {
    .bg-blue-500\/10 {
      background-color: color-mix(in oklab, var(--color-blue-500) 10%, transparent);
    }
  }

  .bg-blue-500\/15 {
    background-color: #3080ff26;
  }

  @supports (color: color-mix(in lab, red, red)) {
    .bg-blue-500\/15 {
      background-color: color-mix(in oklab, var(--color-blue-500) 15%, transparent);
    }
  }

  .bg-cyan-400 {
    background-color: var(--color-cyan-400);
  }

  .bg-cyan-950\/60 {
    background-color: #05334599;
  }

  @supports (color: color-mix(in lab, red, red)) {
    .bg-cyan-950\/60 {
      background-color: color-mix(in oklab, var(--color-cyan-950) 60%, transparent);
    }
  }

  .bg-emerald-400, .bg-emerald-500, .bg-emerald-500\/15 {
    background-color: var(--accent);
  }

  @supports (color: color-mix(in lab, red, red)) {
    .bg-emerald-500\/15 {
      background-color: color-mix(in oklab, var(--accent) 15%, transparent);
    }
  }

  .bg-emerald-500\/70 {
    background-color: var(--accent);
  }

  @supports (color: color-mix(in lab, red, red)) {
    .bg-emerald-500\/70 {
      background-color: color-mix(in oklab, var(--accent) 70%, transparent);
    }
  }

  .bg-emerald-500\/80 {
    background-color: var(--accent);
  }

  @supports (color: color-mix(in lab, red, red)) {
    .bg-emerald-500\/80 {
      background-color: color-mix(in oklab, var(--accent) 80%, transparent);
    }
  }

  .bg-emerald-600 {
    background-color: var(--color-emerald-600);
  }

  .bg-emerald-700 {
    background-color: var(--color-emerald-700);
  }

  .bg-emerald-950\/20 {
    background-color: #002c2233;
  }

  @supports (color: color-mix(in lab, red, red)) {
    .bg-emerald-950\/20 {
      background-color: color-mix(in oklab, var(--color-emerald-950) 20%, transparent);
    }
  }

  .bg-gray-600 {
    background-color: var(--text-mute);
  }

  .bg-gray-700 {
    background-color: var(--line-strong);
  }

  .bg-gray-800, .bg-gray-800\/60 {
    background-color: var(--surface-2);
  }

  @supports (color: color-mix(in lab, red, red)) {
    .bg-gray-800\/60 {
      background-color: color-mix(in oklab, var(--surface-2) 60%, transparent);
    }
  }

  .bg-gray-900, .bg-gray-900\/60 {
    background-color: var(--surface);
  }

  @supports (color: color-mix(in lab, red, red)) {
    .bg-gray-900\/60 {
      background-color: color-mix(in oklab, var(--surface) 60%, transparent);
    }
  }

  .bg-gray-900\/95 {
    background-color: var(--surface);
  }

  @supports (color: color-mix(in lab, red, red)) {
    .bg-gray-900\/95 {
      background-color: color-mix(in oklab, var(--surface) 95%, transparent);
    }
  }

  .bg-gray-950, .bg-gray-950\/40 {
    background-color: var(--ink);
  }

  @supports (color: color-mix(in lab, red, red)) {
    .bg-gray-950\/40 {
      background-color: color-mix(in oklab, var(--ink) 40%, transparent);
    }
  }

  .bg-gray-950\/50 {
    background-color: var(--ink);
  }

  @supports (color: color-mix(in lab, red, red)) {
    .bg-gray-950\/50 {
      background-color: color-mix(in oklab, var(--ink) 50%, transparent);
    }
  }

  .bg-gray-950\/80 {
    background-color: var(--ink);
  }

  @supports (color: color-mix(in lab, red, red)) {
    .bg-gray-950\/80 {
      background-color: color-mix(in oklab, var(--ink) 80%, transparent);
    }
  }

  .bg-gray-950\/95 {
    background-color: var(--ink);
  }

  @supports (color: color-mix(in lab, red, red)) {
    .bg-gray-950\/95 {
      background-color: color-mix(in oklab, var(--ink) 95%, transparent);
    }
  }

  .bg-red-400 {
    background-color: var(--bad);
  }

  .bg-red-500 {
    background-color: var(--color-red-500);
  }

  .bg-red-500\/5 {
    background-color: #fb2c360d;
  }

  @supports (color: color-mix(in lab, red, red)) {
    .bg-red-500\/5 {
      background-color: color-mix(in oklab, var(--color-red-500) 5%, transparent);
    }
  }

  .bg-red-500\/10 {
    background-color: #fb2c361a;
  }

  @supports (color: color-mix(in lab, red, red)) {
    .bg-red-500\/10 {
      background-color: color-mix(in oklab, var(--color-red-500) 10%, transparent);
    }
  }

  .bg-red-500\/15 {
    background-color: #fb2c3626;
  }

  @supports (color: color-mix(in lab, red, red)) {
    .bg-red-500\/15 {
      background-color: color-mix(in oklab, var(--color-red-500) 15%, transparent);
    }
  }

  .bg-red-500\/20 {
    background-color: #fb2c3633;
  }

  @supports (color: color-mix(in lab, red, red)) {
    .bg-red-500\/20 {
      background-color: color-mix(in oklab, var(--color-red-500) 20%, transparent);
    }
  }

  .bg-red-500\/80 {
    background-color: #fb2c36cc;
  }

  @supports (color: color-mix(in lab, red, red)) {
    .bg-red-500\/80 {
      background-color: color-mix(in oklab, var(--color-red-500) 80%, transparent);
    }
  }

  .bg-red-600 {
    background-color: var(--color-red-600);
  }

  .bg-red-950 {
    background-color: var(--color-red-950);
  }

  .bg-red-950\/20 {
    background-color: #46080933;
  }

  @supports (color: color-mix(in lab, red, red)) {
    .bg-red-950\/20 {
      background-color: color-mix(in oklab, var(--color-red-950) 20%, transparent);
    }
  }

  .bg-slate-700 {
    background-color: var(--line-strong);
  }

  .bg-slate-800 {
    background-color: var(--surface-2);
  }

  .bg-slate-900 {
    background-color: var(--surface);
  }

  .bg-slate-950 {
    background-color: var(--ink);
  }

  .bg-white {
    background-color: var(--color-white);
  }

  .bg-gradient-to-r {
    --tw-gradient-position: to right in oklab;
    background-image: linear-gradient(var(--tw-gradient-stops));
  }

  .bg-\[linear-gradient\(150deg\,transparent_42\%\,\#f59e0b_45\%_55\%\,transparent_58\%\)\] {
    background-image: linear-gradient(150deg, #0000 42%, #f59e0b 45% 55%, #0000 58%);
  }

  .bg-\[radial-gradient\(circle\,\#f8fafc_0_25\%\,\#22d3ee_30\%\,transparent_60\%\)\] {
    background-image: radial-gradient(circle, #f8fafc 0 25%, #22d3ee 30%, #0000 60%);
  }

  .bg-\[radial-gradient\(circle\,\#fff_0_15\%\,\#a78bfa_20\%\,\#030712_60\%\)\] {
    background-image: radial-gradient(circle, #fff 0 15%, #a78bfa 20%, #030712 60%);
  }

  .bg-\[repeating-linear-gradient\(135deg\,\#111827_0_2px\,\#f59e0b_2px_3px\)\] {
    background-image: repeating-linear-gradient(135deg, #111827 0 2px, #f59e0b 2px 3px);
  }

  .from-cyan-950 {
    --tw-gradient-from: var(--color-cyan-950);
    --tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));
  }

  .from-gray-900 {
    --tw-gradient-from: var(--surface);
    --tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));
  }

  .from-gray-950 {
    --tw-gradient-from: var(--ink);
    --tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));
  }

  .from-transparent {
    --tw-gradient-from: transparent;
    --tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));
  }

  .via-cyan-500 {
    --tw-gradient-via: var(--color-cyan-500);
    --tw-gradient-via-stops: var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);
    --tw-gradient-stops: var(--tw-gradient-via-stops);
  }

  .via-cyan-600 {
    --tw-gradient-via: var(--color-cyan-600);
    --tw-gradient-via-stops: var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);
    --tw-gradient-stops: var(--tw-gradient-via-stops);
  }

  .via-emerald-700 {
    --tw-gradient-via: var(--color-emerald-700);
    --tw-gradient-via-stops: var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);
    --tw-gradient-stops: var(--tw-gradient-via-stops);
  }

  .to-cyan-100 {
    --tw-gradient-to: var(--color-cyan-100);
    --tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));
  }

  .to-emerald-200 {
    --tw-gradient-to: var(--color-emerald-200);
    --tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));
  }

  .to-gray-300 {
    --tw-gradient-to: var(--text-dim);
    --tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));
  }

  .p-1 {
    padding: var(--spacing);
  }

  .p-2 {
    padding: calc(var(--spacing) * 2);
  }

  .p-3 {
    padding: calc(var(--spacing) * 3);
  }

  .p-4 {
    padding: calc(var(--spacing) * 4);
  }

  .p-5 {
    padding: calc(var(--spacing) * 5);
  }

  .px-1 {
    padding-inline: var(--spacing);
  }

  .px-2 {
    padding-inline: calc(var(--spacing) * 2);
  }

  .px-2\.5 {
    padding-inline: calc(var(--spacing) * 2.5);
  }

  .px-3 {
    padding-inline: calc(var(--spacing) * 3);
  }

  .px-4 {
    padding-inline: calc(var(--spacing) * 4);
  }

  .px-5 {
    padding-inline: calc(var(--spacing) * 5);
  }

  .px-6 {
    padding-inline: calc(var(--spacing) * 6);
  }

  .py-0\.5 {
    padding-block: calc(var(--spacing) * .5);
  }

  .py-1 {
    padding-block: var(--spacing);
  }

  .py-1\.5 {
    padding-block: calc(var(--spacing) * 1.5);
  }

  .py-2 {
    padding-block: calc(var(--spacing) * 2);
  }

  .py-2\.5 {
    padding-block: calc(var(--spacing) * 2.5);
  }

  .py-3 {
    padding-block: calc(var(--spacing) * 3);
  }

  .py-4 {
    padding-block: calc(var(--spacing) * 4);
  }

  .py-5 {
    padding-block: calc(var(--spacing) * 5);
  }

  .py-8 {
    padding-block: calc(var(--spacing) * 8);
  }

  .py-10 {
    padding-block: calc(var(--spacing) * 10);
  }

  .py-12 {
    padding-block: calc(var(--spacing) * 12);
  }

  .py-16 {
    padding-block: calc(var(--spacing) * 16);
  }

  .pt-2 {
    padding-top: calc(var(--spacing) * 2);
  }

  .pt-3 {
    padding-top: calc(var(--spacing) * 3);
  }

  .pt-4 {
    padding-top: calc(var(--spacing) * 4);
  }

  .pr-3 {
    padding-right: calc(var(--spacing) * 3);
  }

  .pr-4 {
    padding-right: calc(var(--spacing) * 4);
  }

  .pb-1 {
    padding-bottom: var(--spacing);
  }

  .pb-5 {
    padding-bottom: calc(var(--spacing) * 5);
  }

  .pb-20 {
    padding-bottom: calc(var(--spacing) * 20);
  }

  .pb-\[env\(safe-area-inset-bottom\)\] {
    padding-bottom: env(safe-area-inset-bottom);
  }

  .pl-3 {
    padding-left: calc(var(--spacing) * 3);
  }

  .pl-9 {
    padding-left: calc(var(--spacing) * 9);
  }

  .pl-10 {
    padding-left: calc(var(--spacing) * 10);
  }

  .text-center {
    text-align: center;
  }

  .text-left {
    text-align: left;
  }

  .text-right {
    text-align: right;
  }

  .align-baseline {
    vertical-align: baseline;
  }

  .font-mono {
    font-family: var(--font-mono);
  }

  .text-2xl {
    font-size: var(--text-2xl);
    line-height: var(--tw-leading, var(--text-2xl--line-height));
  }

  .text-3xl {
    font-size: var(--text-3xl);
    line-height: var(--tw-leading, var(--text-3xl--line-height));
  }

  .text-4xl {
    font-size: var(--text-4xl);
    line-height: var(--tw-leading, var(--text-4xl--line-height));
  }

  .text-base {
    font-size: var(--text-base);
    line-height: var(--tw-leading, var(--text-base--line-height));
  }

  .text-lg {
    font-size: var(--text-lg);
    line-height: var(--tw-leading, var(--text-lg--line-height));
  }

  .text-sm {
    font-size: var(--text-sm);
    line-height: var(--tw-leading, var(--text-sm--line-height));
  }

  .text-xl {
    font-size: var(--text-xl);
    line-height: var(--tw-leading, var(--text-xl--line-height));
  }

  .text-xs {
    font-size: var(--text-xs);
    line-height: var(--tw-leading, var(--text-xs--line-height));
  }

  .text-\[10px\] {
    font-size: 10px;
  }

  .text-\[11px\] {
    font-size: 11px;
  }

  .leading-5 {
    --tw-leading: calc(var(--spacing) * 5);
    line-height: calc(var(--spacing) * 5);
  }

  .leading-6 {
    --tw-leading: calc(var(--spacing) * 6);
    line-height: calc(var(--spacing) * 6);
  }

  .leading-relaxed {
    --tw-leading: var(--leading-relaxed);
    line-height: var(--leading-relaxed);
  }

  .font-bold {
    --tw-font-weight: var(--font-weight-bold);
    font-weight: var(--font-weight-bold);
  }

  .font-medium {
    --tw-font-weight: var(--font-weight-medium);
    font-weight: var(--font-weight-medium);
  }

  .font-normal {
    --tw-font-weight: var(--font-weight-normal);
    font-weight: var(--font-weight-normal);
  }

  .font-semibold {
    --tw-font-weight: var(--font-weight-semibold);
    font-weight: var(--font-weight-semibold);
  }

  .tracking-\[0\.2em\] {
    --tw-tracking: .2em;
    letter-spacing: .2em;
  }

  .tracking-\[0\.16em\] {
    --tw-tracking: .16em;
    letter-spacing: .16em;
  }

  .tracking-\[0\.22em\] {
    --tw-tracking: .22em;
    letter-spacing: .22em;
  }

  .tracking-wide {
    --tw-tracking: var(--tracking-wide);
    letter-spacing: var(--tracking-wide);
  }

  .tracking-wider {
    --tw-tracking: var(--tracking-wider);
    letter-spacing: var(--tracking-wider);
  }

  .break-words {
    overflow-wrap: break-word;
  }

  .break-all {
    word-break: break-all;
  }

  .whitespace-pre-wrap {
    white-space: pre-wrap;
  }

  .text-amber-100\/80 {
    color: #fef3c6cc;
  }

  @supports (color: color-mix(in lab, red, red)) {
    .text-amber-100\/80 {
      color: color-mix(in oklab, var(--color-amber-100) 80%, transparent);
    }
  }

  .text-amber-200 {
    color: var(--color-amber-200);
  }

  .text-amber-300 {
    color: var(--warn);
  }

  .text-amber-400 {
    color: var(--color-amber-400);
  }

  .text-blue-200 {
    color: var(--color-blue-200);
  }

  .text-blue-300 {
    color: var(--color-blue-300);
  }

  .text-blue-400 {
    color: var(--color-blue-400);
  }

  .text-cyan-200 {
    color: var(--color-cyan-200);
  }

  .text-cyan-300 {
    color: var(--color-cyan-300);
  }

  .text-cyan-400 {
    color: var(--color-cyan-400);
  }

  .text-emerald-200 {
    color: var(--color-emerald-200);
  }

  .text-emerald-300, .text-emerald-400 {
    color: var(--accent);
  }

  .text-gray-100, .text-gray-200 {
    color: var(--text);
  }

  .text-gray-300, .text-gray-400 {
    color: var(--text-dim);
  }

  .text-gray-500, .text-gray-600 {
    color: var(--text-mute);
  }

  .text-gray-950 {
    color: var(--ink);
  }

  .text-red-200 {
    color: var(--color-red-200);
  }

  .text-red-300, .text-red-400 {
    color: var(--bad);
  }

  .text-slate-300, .text-slate-400 {
    color: var(--text-dim);
  }

  .text-white {
    color: var(--color-white);
  }

  .capitalize {
    text-transform: capitalize;
  }

  .lowercase {
    text-transform: lowercase;
  }

  .normal-case {
    text-transform: none;
  }

  .uppercase {
    text-transform: uppercase;
  }

  .tabular-nums {
    --tw-numeric-spacing: tabular-nums;
    font-variant-numeric: var(--tw-ordinal, ) var(--tw-slashed-zero, ) var(--tw-numeric-figure, ) var(--tw-numeric-spacing, ) var(--tw-numeric-fraction, );
  }

  .underline {
    text-decoration-line: underline;
  }

  .shadow {
    --tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, #0000001a), 0 1px 2px -1px var(--tw-shadow-color, #0000001a);
    box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
  }

  .shadow-2xl {
    --tw-shadow: 0 25px 50px -12px var(--tw-shadow-color, #00000040);
    box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
  }

  .shadow-\[0_0_8px_rgba\(255\,255\,255\,0\.9\)\] {
    --tw-shadow: 0 0 8px var(--tw-shadow-color, #ffffffe6);
    box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
  }

  .shadow-xl {
    --tw-shadow: 0 20px 25px -5px var(--tw-shadow-color, #0000001a), 0 8px 10px -6px var(--tw-shadow-color, #0000001a);
    box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
  }

  .ring {
    --tw-ring-shadow: var(--tw-ring-inset, ) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
    box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
  }

  .outline {
    outline-style: var(--tw-outline-style);
    outline-width: 1px;
  }

  .filter {
    filter: var(--tw-blur, ) var(--tw-brightness, ) var(--tw-contrast, ) var(--tw-grayscale, ) var(--tw-hue-rotate, ) var(--tw-invert, ) var(--tw-saturate, ) var(--tw-sepia, ) var(--tw-drop-shadow, );
  }

  .backdrop-blur {
    --tw-backdrop-blur: blur(8px);
    -webkit-backdrop-filter: var(--tw-backdrop-blur, ) var(--tw-backdrop-brightness, ) var(--tw-backdrop-contrast, ) var(--tw-backdrop-grayscale, ) var(--tw-backdrop-hue-rotate, ) var(--tw-backdrop-invert, ) var(--tw-backdrop-opacity, ) var(--tw-backdrop-saturate, ) var(--tw-backdrop-sepia, );
    backdrop-filter: var(--tw-backdrop-blur, ) var(--tw-backdrop-brightness, ) var(--tw-backdrop-contrast, ) var(--tw-backdrop-grayscale, ) var(--tw-backdrop-hue-rotate, ) var(--tw-backdrop-invert, ) var(--tw-backdrop-opacity, ) var(--tw-backdrop-saturate, ) var(--tw-backdrop-sepia, );
  }

  .backdrop-blur-sm {
    --tw-backdrop-blur: blur(var(--blur-sm));
    -webkit-backdrop-filter: var(--tw-backdrop-blur, ) var(--tw-backdrop-brightness, ) var(--tw-backdrop-contrast, ) var(--tw-backdrop-grayscale, ) var(--tw-backdrop-hue-rotate, ) var(--tw-backdrop-invert, ) var(--tw-backdrop-opacity, ) var(--tw-backdrop-saturate, ) var(--tw-backdrop-sepia, );
    backdrop-filter: var(--tw-backdrop-blur, ) var(--tw-backdrop-brightness, ) var(--tw-backdrop-contrast, ) var(--tw-backdrop-grayscale, ) var(--tw-backdrop-hue-rotate, ) var(--tw-backdrop-invert, ) var(--tw-backdrop-opacity, ) var(--tw-backdrop-saturate, ) var(--tw-backdrop-sepia, );
  }

  .transition {
    transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to, opacity, box-shadow, transform, translate, scale, rotate, filter, -webkit-backdrop-filter, backdrop-filter, display, content-visibility, overlay, pointer-events;
    transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
    transition-duration: var(--tw-duration, var(--default-transition-duration));
  }

  .transition-\[left\] {
    transition-property: left;
    transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
    transition-duration: var(--tw-duration, var(--default-transition-duration));
  }

  .transition-all {
    transition-property: all;
    transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
    transition-duration: var(--tw-duration, var(--default-transition-duration));
  }

  .transition-colors {
    transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to;
    transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
    transition-duration: var(--tw-duration, var(--default-transition-duration));
  }

  .duration-1000 {
    --tw-duration: 1s;
    transition-duration: 1s;
  }

  .ease-linear {
    --tw-ease: linear;
    transition-timing-function: linear;
  }

  .outline-none {
    --tw-outline-style: none;
    outline-style: none;
  }

  .last\:border-0:last-child {
    border-style: var(--tw-border-style);
    border-width: 0;
  }

  .last\:border-b-0:last-child {
    border-bottom-style: var(--tw-border-style);
    border-bottom-width: 0;
  }

  @media (hover: hover) {
    .hover\:border-gray-500:hover {
      border-color: var(--text-mute);
    }

    .hover\:bg-cyan-300:hover {
      background-color: var(--color-cyan-300);
    }

    .hover\:bg-emerald-500:hover {
      background-color: var(--accent);
    }

    .hover\:bg-gray-600:hover {
      background-color: var(--text-mute);
    }

    .hover\:bg-gray-700:hover {
      background-color: var(--line-strong);
    }

    .hover\:bg-gray-800:hover, .hover\:bg-gray-800\/70:hover {
      background-color: var(--surface-2);
    }

    @supports (color: color-mix(in lab, red, red)) {
      .hover\:bg-gray-800\/70:hover {
        background-color: color-mix(in oklab, var(--surface-2) 70%, transparent);
      }
    }

    .hover\:bg-red-500:hover {
      background-color: var(--color-red-500);
    }

    .hover\:bg-slate-800:hover {
      background-color: var(--surface-2);
    }

    .hover\:text-cyan-300:hover {
      color: var(--color-cyan-300);
    }

    .hover\:text-emerald-300:hover {
      color: var(--accent);
    }

    .hover\:text-gray-100:hover {
      color: var(--text);
    }
  }

  .focus\:border-cyan-500:focus {
    border-color: var(--color-cyan-500);
  }

  .focus\:border-emerald-500:focus {
    border-color: var(--accent);
  }

  .focus\:border-red-500:focus {
    border-color: var(--color-red-500);
  }

  .focus\:ring-2:focus {
    --tw-ring-shadow: var(--tw-ring-inset, ) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
    box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
  }

  .focus\:ring-emerald-500:focus {
    --tw-ring-color: var(--accent);
  }

  .focus\:outline-none:focus {
    --tw-outline-style: none;
    outline-style: none;
  }

  .focus-visible\:ring-2:focus-visible {
    --tw-ring-shadow: var(--tw-ring-inset, ) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
    box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
  }

  .focus-visible\:ring-blue-500:focus-visible {
    --tw-ring-color: var(--color-blue-500);
  }

  .focus-visible\:outline-none:focus-visible {
    --tw-outline-style: none;
    outline-style: none;
  }

  .focus-visible\:ring-inset:focus-visible {
    --tw-ring-inset: inset;
  }

  .disabled\:cursor-not-allowed:disabled {
    cursor: not-allowed;
  }

  .disabled\:text-gray-600:disabled {
    color: var(--text-mute);
  }

  .disabled\:opacity-40:disabled {
    opacity: .4;
  }

  .disabled\:opacity-50:disabled {
    opacity: .5;
  }

  @media (min-width: 40rem) {
    .sm\:col-span-1 {
      grid-column: span 1 / span 1;
    }

    .sm\:col-span-2 {
      grid-column: span 2 / span 2;
    }

    .sm\:inline {
      display: inline;
    }

    .sm\:table-cell {
      display: table-cell;
    }

    .sm\:h-\[360px\] {
      height: 360px;
    }

    .sm\:basis-0 {
      flex-basis: 0;
    }

    .sm\:grid-cols-2 {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sm\:grid-cols-3 {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .sm\:grid-cols-4 {
      grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .sm\:grid-cols-5 {
      grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .sm\:flex-row {
      flex-direction: row;
    }

    .sm\:items-end {
      align-items: flex-end;
    }

    .sm\:gap-4 {
      gap: calc(var(--spacing) * 4);
    }

    .sm\:p-4 {
      padding: calc(var(--spacing) * 4);
    }

    .sm\:p-5 {
      padding: calc(var(--spacing) * 5);
    }

    .sm\:p-6 {
      padding: calc(var(--spacing) * 6);
    }

    .sm\:px-6 {
      padding-inline: calc(var(--spacing) * 6);
    }

    .sm\:pb-20 {
      padding-bottom: calc(var(--spacing) * 20);
    }

    .sm\:text-right {
      text-align: right;
    }

    .sm\:text-3xl {
      font-size: var(--text-3xl);
      line-height: var(--tw-leading, var(--text-3xl--line-height));
    }

    .sm\:text-4xl {
      font-size: var(--text-4xl);
      line-height: var(--tw-leading, var(--text-4xl--line-height));
    }

    .sm\:text-sm {
      font-size: var(--text-sm);
      line-height: var(--tw-leading, var(--text-sm--line-height));
    }
  }

  @media (min-width: 48rem) {
    .md\:grid-cols-2 {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
  }

  @media (min-width: 64rem) {
    .lg\:col-span-2 {
      grid-column: span 2 / span 2;
    }

    .lg\:col-span-3 {
      grid-column: span 3 / span 3;
    }

    .lg\:col-span-4 {
      grid-column: span 4 / span 4;
    }

    .lg\:block {
      display: block;
    }

    .lg\:flex {
      display: flex;
    }

    .lg\:hidden {
      display: none;
    }

    .lg\:grid-cols-2 {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .lg\:grid-cols-3 {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .lg\:grid-cols-4 {
      grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .lg\:grid-cols-\[1\.4fr_1fr\] {
      grid-template-columns: 1.4fr 1fr;
    }

    .lg\:grid-cols-\[1\.4fr_1fr_1fr_1fr\] {
      grid-template-columns: 1.4fr 1fr 1fr 1fr;
    }

    .lg\:grid-cols-\[minmax\(180px\,0\.7fr\)_minmax\(280px\,2fr\)_minmax\(100px\,0\.4fr\)_auto_auto\] {
      grid-template-columns: minmax(180px, .7fr) minmax(280px, 2fr) minmax(100px, .4fr) auto auto;
    }

    .lg\:pb-6 {
      padding-bottom: calc(var(--spacing) * 6);
    }

    .lg\:shadow-sm {
      --tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, #0000001a), 0 1px 2px -1px var(--tw-shadow-color, #0000001a);
      box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
    }
  }

  @media (min-width: 80rem) {
    .xl\:sticky {
      position: sticky;
    }

    .xl\:top-4 {
      top: calc(var(--spacing) * 4);
    }

    .xl\:grid-cols-1 {
      grid-template-columns: repeat(1, minmax(0, 1fr));
    }

    .xl\:grid-cols-2 {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .xl\:grid-cols-3 {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .xl\:grid-cols-4 {
      grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .xl\:grid-cols-5 {
      grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .xl\:grid-cols-10 {
      grid-template-columns: repeat(10, minmax(0, 1fr));
    }

    .xl\:grid-cols-\[minmax\(0\,0\.9fr\)_minmax\(0\,1\.1fr\)\] {
      grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    }

    .xl\:grid-cols-\[minmax\(220px\,0\.8fr\)_minmax\(0\,1\.6fr\)_minmax\(320px\,1fr\)\] {
      grid-template-columns: minmax(220px, .8fr) minmax(0, 1.6fr) minmax(320px, 1fr);
    }

    .xl\:grid-cols-\[minmax\(280px\,1fr\)_minmax\(0\,2fr\)\] {
      grid-template-columns: minmax(280px, 1fr) minmax(0, 2fr);
    }

    .xl\:flex-row {
      flex-direction: row;
    }

    .xl\:items-end {
      align-items: flex-end;
    }

    .xl\:justify-between {
      justify-content: space-between;
    }
  }

  @media (min-width: 96rem) {
    .\32 xl\:grid-cols-2 {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
  }
}

:root {
  --ink: #07070a;
  --ink-2: #0b0b0f;
  --surface: #0d0d12;
  --surface-2: #131319;
  --text: #f2f2f4;
  --text-dim: #b8b8c2;
  --text-mute: #7b7b87;
  --accent: #c9a84c;
  --accent-soft: #c9a84c24;
  --line: #ffffff17;
  --line-strong: #ffffff29;
  --ok: #4ea87b;
  --warn: #c9a84c;
  --bad: #c45e52;
  --data-gain: #3987e5;
  --data-loss: #e66767;
  --universe-data: #73b8e5;
  --universe-research: #b39beb;
  --universe-trade: #72bfa8;
  --universe-decision: var(--accent);
  --universe-risk: #e7a08c;
  --sans: "Inter", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --heading-weight: 500;
  --heading-tracking: -.035em;
  --label-size: .69rem;
  --label-weight: 500;
  --label-tracking: .01em;
  --radius: 22px;
  --radius-sm: 12px;
  --s-1: .25rem;
  --s-2: .5rem;
  --s-3: .75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4rem;
  --card-pad-x: 1.5rem;
  --card-pad-y: 1.25rem;
  --card-pad-x-sm: 1.25rem;
  --card-pad-y-sm: 1rem;
  --card-pad-x-xs: .75rem;
  --card-pad-y-xs: .5rem;
  --card-gap: 1rem;
  --page-pad-x: 2rem;
  --section-gap: 2.75rem;
  --measure: 68ch;
  color-scheme: dark;
  --shadow-card: 0 2px 6px #0000001f;
  --shadow-float: 0 4px 20px #00000029;
  --backdrop: #0000007a;
  --radius-table: 16px;
}

:root[data-theme="light"] {
  color-scheme: light;
  --ink: #f7f7f7;
  --ink-2: #f2f2f2;
  --surface: #fff;
  --surface-2: #f5f5f5;
  --text: #242424;
  --text-dim: #555;
  --text-mute: #737373;
  --accent: #80651e;
  --accent-soft: #80651e12;
  --line: #0001;
  --line-strong: #0000001f;
  --universe-data: #286f9b;
  --universe-research: #7655ab;
  --universe-trade: #287a61;
  --universe-risk: #a45c46;
  --ok: #287e4b;
  --warn: #80651e;
  --bad: #ad493e;
  --data-gain: #2a78d6;
  --data-loss: #e34948;
  --shadow-card: 0 2px 6px #00000009;
  --shadow-float: 0 4px 20px #00000009;
}

.phf-instruments {
  max-width: 1600px;
  margin-inline: auto;
}

.phf-instruments-heading {
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
  display: flex;
}

.phf-instruments-heading h1 {
  letter-spacing: -.04em;
  margin: 0 0 6px;
  font-size: clamp(1.7rem, 2.5vw, 2rem);
  font-weight: 600;
}

.phf-instruments-heading p, .phf-instruments-count {
  color: var(--text-mute);
  font-size: .85rem;
}

.phf-instruments-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.phf-instruments-toolbar {
  gap: 12px;
  padding: 20px 24px 12px;
  display: flex;
}

.phf-instruments-search {
  border: 1px solid var(--line);
  background: var(--surface-2);
  min-width: 0;
  color: var(--text-mute);
  border-radius: 12px;
  flex: 1;
  align-items: center;
  gap: 10px;
  padding-inline: 12px;
  display: flex;
}

.phf-instruments-search input {
  width: 100%;
  min-width: 0;
  height: 44px;
  color: var(--text);
  background: none;
  border: 0;
  outline: none;
  font-size: .85rem;
}

.phf-instruments-search:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.phf-instruments-toolbar select {
  border: 1px solid var(--line);
  background: var(--surface);
  max-width: 100%;
  min-height: 44px;
  color: var(--text-dim);
  border-radius: 12px;
  padding: 0 12px;
  font-size: .85rem;
}

.phf-instruments-results {
  min-height: 40px;
  color: var(--text-mute);
  justify-content: space-between;
  align-items: center;
  padding: 0 24px 12px;
  font-size: .78rem;
  display: flex;
}

.phf-instruments-results button, .phf-instruments-empty button {
  color: var(--accent);
  min-height: 44px;
}

.phf-instruments-table {
  border-collapse: collapse;
  text-align: left;
  width: 100%;
  font-size: .85rem;
}

.phf-instruments-table th {
  background: var(--surface-2);
  color: var(--text-mute);
  padding: 8px 24px;
  font-weight: 400;
}

.phf-instruments-table th button {
  align-items: center;
  gap: 8px;
  min-height: 36px;
  display: flex;
}

.phf-instruments-table td {
  border-top: 1px solid var(--line);
  height: 64px;
  padding: 8px 24px;
}

.phf-instruments-table tbody tr:hover {
  background: var(--surface-2);
}

.phf-instruments-symbol {
  min-height: 44px;
  color: var(--text);
  align-items: center;
  font-weight: 600;
  display: inline-flex;
}

.phf-instruments-name {
  color: var(--text-mute);
  font-size: .75rem;
  display: block;
}

.phf-instruments-venue {
  min-height: 44px;
  color: var(--text-dim);
  text-transform: capitalize;
  align-items: center;
  display: inline-flex;
}

.phf-instruments-tag {
  background: var(--surface-2);
  color: var(--text-mute);
  text-transform: capitalize;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: .75rem;
  display: inline-block;
}

.phf-instruments-actions {
  text-align: right;
}

.phf-instruments-actions div {
  justify-content: flex-end;
  gap: 16px;
  display: flex;
}

.phf-instruments-actions a {
  min-height: 44px;
  color: var(--accent);
  white-space: nowrap;
  align-items: center;
  display: inline-flex;
}

.phf-instruments-footer {
  background: var(--surface-2);
  color: var(--text-mute);
  border-top: 1px solid var(--line);
  padding: 16px 24px;
  font-size: .75rem;
}

.phf-instruments-empty {
  text-align: center;
  color: var(--text-mute);
  padding: 48px 24px;
}

.phf-instruments-empty h2 {
  color: var(--text);
  margin-bottom: 8px;
  font-size: 1rem;
}

.phf-instruments-mobile-type {
  display: none;
}

@media (max-width: 700px) {
  .phf-instruments-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .phf-instruments-toolbar {
    flex-wrap: wrap;
    padding: 16px 16px 8px;
  }

  .phf-instruments-search {
    flex-basis: 100%;
  }

  .phf-instruments-toolbar select {
    flex: 1;
    min-width: 0;
  }

  .phf-instruments-results {
    padding-inline: 16px;
  }

  .phf-instruments-table th, .phf-instruments-table td {
    padding-inline: 12px;
  }

  .phf-instruments-type {
    display: none;
  }

  .phf-instruments-mobile-type {
    color: var(--text-mute);
    text-transform: capitalize;
    font-size: .7rem;
    display: block;
  }

  .phf-instruments-actions div {
    flex-direction: column;
    align-items: flex-end;
    gap: 0;
  }

  .phf-instruments-actions a {
    min-height: 32px;
    font-size: .75rem;
  }

  .phf-instruments-table td {
    padding-block: 8px;
  }
}

.phf-automation-editor {
  max-width: 1500px;
  margin-inline: auto;
}

.phf-rule-page-heading, .phf-rule-section-heading, .phf-rule-stage-heading {
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  display: flex;
}

.phf-rule-page-heading p, .phf-rule-section-heading p, .phf-rule-explanation {
  color: var(--text-dim);
  margin: 8px 0 18px;
  font-size: .88rem;
  line-height: 1.65;
}

.phf-rule-section-heading h2 {
  font-size: 1.1rem;
  font-weight: 600;
}

.phf-rule-saved {
  color: var(--text-dim);
  align-items: center;
  gap: 16px;
  font-size: .85rem;
  display: flex;
}

.phf-rule-saved select {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  max-width: 480px;
  min-height: 44px;
  color: var(--text);
  flex: 1;
  padding: 8px 12px;
}

.phf-rule-fields {
  border: 0;
  min-width: 0;
  margin: 0;
  padding: 0;
}

.phf-rule-fields:disabled {
  opacity: .65;
}

.phf-rule-fields label {
  color: var(--text-dim);
  font-size: .85rem;
}

.phf-rule-symbols {
  margin-top: 20px;
  display: block;
}

.phf-rule-picker {
  color: var(--text-dim);
  margin-top: 16px;
  font-size: .85rem;
}

.phf-rule-picker summary {
  cursor: pointer;
  min-height: 36px;
}

.phf-rule-picker > div {
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  display: flex;
}

.phf-rule-picker button {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 40px;
  padding: 8px 12px;
}

.phf-rule-picker button[aria-pressed="true"] {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.phf-rule-stage-heading > div:first-child {
  align-items: center;
  gap: 12px;
  display: flex;
}

.phf-rule-stage-heading h2 {
  font-size: 1.1rem;
  font-weight: 600;
}

.phf-rule-number {
  background: var(--surface-2);
  width: 32px;
  height: 32px;
  color: var(--accent);
  border-radius: 50%;
  place-items: center;
  font-size: .85rem;
  display: grid;
}

.phf-rule-stage-tools {
  align-items: center;
  gap: 8px;
  display: flex;
}

.phf-rule-stage-tools .phf-ui-button {
  min-width: 44px;
  padding-inline: 12px;
}

.phf-rule-selectors {
  grid-template-columns: 1fr 2fr;
  gap: 20px;
  display: grid;
}

.phf-rule-selectors select {
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  width: 100%;
  min-height: 44px;
  color: var(--text);
  margin-top: 8px;
  padding: 0 12px;
  font-size: .9rem;
}

.phf-rule-strategy-description {
  color: var(--text-dim);
  margin: 16px 0;
  font-size: .85rem;
  line-height: 1.6;
}

.phf-rule-defaults {
  border-top: 1px solid var(--line);
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin: 20px 0;
  padding-top: 16px;
  display: flex;
}

.phf-rule-defaults p {
  color: var(--text-mute);
  max-width: 600px;
  font-size: .78rem;
  line-height: 1.6;
}

.phf-rule-defaults .phf-ui-button {
  white-space: nowrap;
}

.phf-rule-parameters {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px 24px;
  display: grid;
}

.phf-rule-field {
  min-width: 0;
}

.phf-rule-label {
  align-items: center;
  gap: 6px;
  min-height: 30px;
  margin-bottom: 6px;
  display: flex;
}

.phf-rule-control {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  align-items: center;
  min-height: 46px;
  display: flex;
}

.phf-rule-control:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.phf-rule-control input, .phf-rule-control select {
  border-radius: var(--radius-sm);
  width: 100%;
  min-width: 0;
  height: 44px;
  color: var(--text);
  font: inherit;
  background: none;
  border: 0;
  outline: 0;
  padding: 0 12px;
  font-size: .9rem;
}

.phf-rule-control > span {
  color: var(--text-mute);
  white-space: nowrap;
  padding-right: 12px;
  font-size: .78rem;
}

.phf-rule-suggestion {
  color: var(--text-mute);
  text-align: left;
  min-height: 32px;
  margin-top: 4px;
  font-size: .73rem;
  line-height: 1.5;
  display: block;
}

.phf-rule-suggestion:hover {
  color: var(--accent);
}

.phf-rule-error {
  color: var(--bad);
  margin-top: 8px;
  font-size: .78rem;
}

.phf-rule-execution {
  border-top: 1px solid var(--line);
  margin-top: 20px;
  padding-top: 20px;
}

.phf-rule-execution h3 {
  color: var(--text-dim);
  margin: 0 0 16px;
  font-size: .82rem;
  font-weight: 600;
}

.phf-rule-technical {
  color: var(--text-mute);
  margin-top: 20px;
  font-size: .75rem;
}

.phf-rule-technical summary {
  cursor: pointer;
  min-height: 32px;
}

.phf-rule-technical pre {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  max-height: 240px;
  margin-top: 12px;
  padding: 16px;
  overflow: auto;
}

.phf-rule-review-list {
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}

.phf-rule-review-list li {
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
}

.phf-rule-review-list strong {
  font-size: .88rem;
  font-weight: 500;
}

.phf-rule-review-list span {
  color: var(--text-dim);
  margin-top: 6px;
  font-size: .8rem;
  line-height: 1.8;
  display: block;
}

.phf-rule-notice {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  margin-block: 12px;
  padding: 12px 16px;
  font-size: .82rem;
  line-height: 1.65;
}

.phf-rule-validation {
  border-left: 2px solid var(--warn);
  color: var(--text-dim);
  margin: 16px 0;
  padding: 8px 16px;
  font-size: .82rem;
}

.phf-rule-validation h3 {
  margin-bottom: 8px;
  font-weight: 600;
}

.phf-rule-validation ul {
  padding-left: 18px;
  line-height: 1.7;
  list-style: outside;
}

@media (max-width: 1050px) {
  .phf-rule-parameters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 650px) {
  .phf-rule-parameters, .phf-rule-selectors {
    grid-template-columns: 1fr;
  }

  .phf-rule-page-heading, .phf-rule-section-heading, .phf-rule-defaults, .phf-rule-saved {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .phf-rule-stage-heading {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 12px;
  }

  .phf-rule-stage-heading h2 {
    font-size: 1rem;
  }

  .phf-rule-saved select {
    width: 100%;
    min-width: 0;
  }

  .phf-rule-review-list span, .phf-rule-notice {
    overflow-wrap: anywhere;
  }
}

.phf-rule-outcome {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0 24px;
  display: grid;
}

.phf-rule-outcome > div {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.phf-rule-outcome dt {
  color: var(--text-mute);
  margin-bottom: 8px;
  font-size: .75rem;
}

.phf-rule-outcome dd {
  color: var(--text);
  margin: 0;
  font-size: .9rem;
  line-height: 1.5;
}

.phf-rule-outcome p {
  color: var(--text-dim);
  margin-top: 8px;
  font-size: .75rem;
  line-height: 1.6;
}

.phf-rule-summary-details > summary {
  cursor: pointer;
  color: var(--text-dim);
  min-height: 32px;
  font-size: .85rem;
}

@media (max-width: 700px) {
  .phf-rule-outcome {
    grid-template-columns: 1fr;
  }
}

.phf-settings {
  gap: 24px;
  max-width: 960px;
  margin-inline: auto;
  padding-bottom: 32px;
  display: grid;
}

.phf-settings-heading {
  margin-bottom: 8px;
}

.phf-settings p {
  color: var(--text-dim);
  margin: 5px 0 0;
  font-size: .84rem;
  line-height: 1.6;
}

.phf-settings .phf-settings-section {
  padding: 0;
  overflow: hidden;
}

.phf-settings-section-heading {
  border-bottom: 1px solid var(--line);
  padding: 24px 28px;
}

.phf-settings-section-heading h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.phf-settings-row {
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 24px 28px;
  display: flex;
}

.phf-settings-row + .phf-settings-row {
  border-top: 1px solid var(--line);
}

.phf-settings h3, .phf-settings h4 {
  margin: 0;
  font-size: .88rem;
  font-weight: 500;
}

.phf-settings-themes {
  flex-shrink: 0;
  gap: 12px;
  display: flex;
}

.phf-settings-themes button {
  border: 1px solid var(--line-strong);
  text-align: left;
  background: var(--surface);
  width: 120px;
  color: var(--text);
  cursor: pointer;
  border-radius: 10px;
  padding: 8px;
}

.phf-settings-themes button[aria-pressed="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.phf-settings-themes button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.phf-settings-themes button > span:last-child {
  justify-content: space-between;
  padding: 8px 3px 2px;
  font-size: .8rem;
  display: flex;
}

.phf-settings-choice {
  color: var(--text-dim);
}

.phf-settings-theme-preview {
  border: 1px solid var(--line);
  background: #ededed;
  border-radius: 5px;
  grid-template-rows: 12px 1fr;
  grid-template-columns: 18px 1fr;
  gap: 5px;
  height: 62px;
  padding: 7px;
  display: grid;
}

.phf-settings-theme-preview span {
  background: #fff;
  border: 1px solid #d5d5d5;
  border-radius: 2px;
}

.phf-settings-theme-preview span:first-child {
  grid-row: span 2;
}

.phf-settings-theme-preview[data-preview="dark"] {
  background: #151515;
}

.phf-settings-theme-preview[data-preview="dark"] span {
  background: #292929;
  border-color: #444;
}

.phf-settings-identity {
  overflow-wrap: anywhere;
  align-items: center;
  gap: 14px;
  min-width: 0;
  display: flex;
}

.phf-settings-avatar {
  border: 1px solid var(--line);
  background: var(--surface-2);
  width: 42px;
  height: 42px;
  color: var(--text-dim);
  border-radius: 50%;
  flex-shrink: 0;
  place-items: center;
  font-size: .9rem;
  display: grid;
}

.phf-settings-roles {
  flex-wrap: wrap;
  gap: 6px;
  display: flex;
}

.phf-settings-roles .phf-badge {
  text-transform: capitalize;
}

.phf-settings-permissions {
  padding: 22px 28px 6px;
}

.phf-settings-permissions + .phf-settings-permissions {
  border-top: 1px solid var(--line);
}

.phf-settings-permissions > h3 {
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-mute);
  margin-bottom: 8px;
  font-size: .72rem;
  font-weight: 600;
}

.phf-settings-permissions ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.phf-settings-permissions li {
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 14px 0;
  display: flex;
}

.phf-settings-permissions li + li {
  border-top: 1px solid var(--line);
}

.phf-settings-access {
  color: var(--text-mute);
  flex-shrink: 0;
  font-size: .75rem;
}

.phf-settings-access[data-allowed="true"] {
  color: var(--accent);
}

@media (max-width: 600px) {
  .phf-settings {
    gap: 16px;
  }

  .phf-settings-section-heading, .phf-settings-row {
    padding: 20px;
  }

  .phf-settings-row {
    flex-wrap: wrap;
    gap: 16px;
  }

  .phf-settings-permissions {
    padding: 20px 20px 4px;
  }

  .phf-settings-themes {
    width: 100%;
  }

  .phf-settings-themes button {
    flex: 1;
  }
}

.phf-universe-scopes {
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1.25rem;
  display: flex;
}

.phf-universe-scopes button {
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--surface);
  min-height: 44px;
  color: var(--text-dim);
  border-radius: 10px;
  padding: .6rem 1rem;
}

.phf-universe-scopes button[aria-pressed="true"] {
  color: var(--accent);
  border-color: var(--accent);
}

.phf-universe-scopes button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.phf-universe-heading {
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  display: flex;
}

.phf-universe-eyebrow {
  color: var(--accent);
  letter-spacing: .06em;
  font-size: 12px;
}

.phf-universe-filters {
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  margin: 20px 0;
  display: flex;
}

.phf-universe-filters label {
  flex: 220px;
  gap: 8px;
  font-size: 12px;
  display: grid;
}

.phf-universe-filters input, .phf-universe-filters select {
  border: 1px solid var(--line);
  background: var(--surface);
  width: 100%;
  min-height: 44px;
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
}

.phf-universe-legend {
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  display: flex;
}

.phf-universe-legend button {
  border: 1px solid var(--line);
  border-radius: 12px;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 12px;
  font-size: 12px;
  display: flex;
}

.phf-universe-legend span {
  border-radius: 50%;
  width: 8px;
  height: 8px;
}

.phf-universe-legend button[aria-pressed="true"], .phf-universe-inventory button[aria-pressed="true"] {
  border-color: var(--accent);
}

.phf-universe-inventory {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 8px;
  max-height: 360px;
  margin-top: 12px;
  display: grid;
  overflow: auto;
}

.phf-universe-inventory button {
  text-align: left;
  border: 1px solid var(--line);
  overflow-wrap: anywhere;
  border-radius: 12px;
  gap: 4px;
  min-height: 52px;
  padding: 10px;
  display: grid;
}

.phf-universe-inventory small {
  color: var(--text-dim);
}

.phf-universe .phf-table td {
  white-space: normal;
  overflow-wrap: anywhere;
  max-width: 420px;
}

.phf-universe > .phf-runtime-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.phf-universe-map canvas {
  background: radial-gradient(#142036 0%, #080e1b 65%, #050811 100%);
}

@media (max-width: 960px) {
  .phf-universe > .phf-runtime-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.phf-strategy-label {
  align-items: center;
  gap: 8px;
  display: inline-flex;
}

.phf-workspace-bar .phf-header-right {
  flex-shrink: 0;
  width: auto;
  display: flex;
}

.phf-workspace-bar .phf-header-right > * {
  width: auto;
  min-height: 34px;
  padding: 6px 12px;
  font-size: .73rem;
}

.phf-workspace-bar {
  border-radius: 16px;
  gap: 16px;
}

.phf-sidebar {
  gap: 28px;
  height: 100dvh;
}

.phf-sidebar-footer {
  border-top: 1px solid var(--line);
  gap: 4px;
  margin-top: auto;
  padding-top: 12px;
  display: grid;
}

.phf-sidebar-footer button {
  min-height: 44px;
  color: var(--text-dim);
  text-align: left;
  cursor: pointer;
  border-radius: 8px;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  font-size: .82rem;
  display: flex;
}

.phf-sidebar-footer button:hover {
  color: var(--text);
  background: var(--surface-2);
}

.phf-sidebar-footer button:focus-visible, .phf-sidebar-close:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.phf-sidebar-close, .phf-sidebar-backdrop {
  display: none;
}

@media (max-width: 1000px) {
  .phf-bar-context {
    gap: 10px;
  }

  .phf-bar-identity {
    gap: 8px;
  }

  .phf-bar-context .phf-breadcrumb {
    padding-left: 10px;
  }
}

@media (max-width: 760px) {
  .phf-sidebar {
    z-index: 50;
    width: min(300px, 85vw);
    height: 100dvh;
    box-shadow: var(--shadow-float);
    padding: 24px 16px;
    position: fixed;
    inset: 0 auto 0 0;
  }

  .phf-sidebar-close {
    width: 36px;
    height: 36px;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 1.5rem;
    display: block;
    position: absolute;
    top: 12px;
    right: 12px;
  }

  .phf-sidebar-backdrop {
    background: var(--backdrop);
    z-index: 49;
    display: block;
    position: fixed;
    inset: 0;
  }

  .phf-workspace-bar {
    border-radius: 12px;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px;
  }

  .phf-bar-context {
    flex: 1;
  }

  .phf-bar-identity {
    flex-wrap: wrap;
    font-size: .76rem;
  }

  .phf-bar-identity small {
    padding: 4px 8px;
    font-size: .68rem;
  }

  .phf-workspace-bar .phf-header-right {
    margin-left: 0;
  }

  .phf-workspace-bar .phf-header-right > * {
    min-height: 30px;
    font-size: .68rem;
  }
}

.phf-more-nav {
  margin-top: 16px;
}

.phf-more-nav > summary {
  color: var(--text-dim);
  cursor: pointer;
  padding: 12px;
  font-size: .85rem;
}

.phf-more-nav > summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.phf-more-nav .phf-navlink {
  min-height: 40px;
  padding-block: 8px;
  font-size: .8rem;
}

.phf-build-nav {
  margin-bottom: 24px;
}

.phf-workspace-bar .phf-bar-context {
  color: var(--text-dim);
  font-size: .8rem;
}

.phf-activity-event {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 12px;
  min-width: 0;
}

.phf-activity-event > summary {
  cursor: pointer;
  align-items: flex-start;
  gap: 20px;
  padding: 18px;
  font-size: .82rem;
  display: flex;
}

.phf-activity-time {
  color: var(--text-mute);
  font-family: var(--mono);
  padding-top: 3px;
  font-size: .72rem;
}

.phf-activity-description {
  overflow-wrap: anywhere;
  flex: 1;
  gap: 5px;
  min-width: 0;
  display: grid;
}

.phf-activity-description strong {
  color: var(--text);
  font-weight: 500;
}

.phf-activity-description > span {
  color: var(--text-dim);
  font-size: .76rem;
}

.phf-activity-description .phf-activity-reason {
  color: var(--text-mute);
}

.phf-activity-outcome {
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  display: flex;
}

.phf-activity-outcome small {
  color: var(--text-dim);
  font-size: .75rem;
}

.phf-activity-detail {
  border-top: 1px solid var(--line);
  color: var(--text-dim);
  overflow-wrap: anywhere;
  padding: 16px 18px;
  font-size: .76rem;
}

.phf-activity-detail p, .phf-activity-detail li {
  margin-bottom: 8px;
}

.phf-activity-detail summary {
  cursor: pointer;
  align-content: center;
  min-height: 36px;
}

.phf-activity-detail pre {
  max-width: 100%;
  font-size: .7rem;
  overflow: auto;
}

.phf-activity-event summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .phf-activity-event > summary {
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px;
  }

  .phf-activity-time {
    flex-basis: 100%;
  }

  .phf-activity-outcome {
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
  }
}

.director-policy {
  width: 100%;
  max-width: 1100px;
  margin-inline: auto;
}

.director-policy-intro {
  color: var(--text-dim);
  margin: -8px 0 24px;
  font-size: .84rem;
}

.director-policy-switches {
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 24px;
  overflow: hidden;
}

.director-policy-switches label {
  cursor: pointer;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 16px 20px;
  display: flex;
}

.director-policy-switches label + label {
  border-top: 1px solid var(--line);
}

.director-policy-switches strong {
  font-size: .86rem;
  font-weight: 500;
  display: block;
}

.director-policy-switches span {
  color: var(--text-dim);
  margin-top: 4px;
  font-size: .76rem;
  line-height: 1.6;
  display: block;
}

.director-policy-switches input {
  appearance: none;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  cursor: pointer;
  border-radius: 20px;
  flex-shrink: 0;
  width: 36px;
  height: 22px;
  position: relative;
}

.director-policy-switches input:after {
  content: "";
  background: var(--text-dim);
  border-radius: 50%;
  width: 14px;
  height: 14px;
  transition: transform .15s;
  position: absolute;
  top: 3px;
  left: 3px;
}

.director-policy-switches input:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.director-policy-switches input:checked:after {
  background: var(--ink);
  transform: translateX(14px);
}

.director-policy-group {
  border-top: 1px solid var(--line);
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 24px;
  padding: 24px 0;
  display: grid;
}

.director-policy-group h3 {
  margin: 0;
  font-size: .88rem;
  font-weight: 500;
}

.director-policy-group header p {
  color: var(--text-dim);
  margin: 6px 0 0;
  font-size: .76rem;
  line-height: 1.6;
}

.director-policy-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 24px;
  display: grid;
}

.director-policy-fields .phf-field-head {
  color: var(--text-dim);
  min-height: 28px;
  margin-bottom: 6px;
  font-size: .76rem;
}

.director-policy-input {
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  border-radius: 8px;
  align-items: center;
  display: flex;
}

.director-view .director-policy-input input {
  font-variant-numeric: tabular-nums;
  background: none;
  border: 0;
  width: 100%;
  min-width: 0;
  min-height: 42px;
  font-size: .88rem;
}

.director-policy-input:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.director-policy-input input:focus-visible {
  outline: none;
}

.director-policy-input > span {
  color: var(--text-mute);
  padding-right: 12px;
  font-size: .72rem;
}

.director-policy-explanation {
  border-top: 1px solid var(--line);
  padding: 14px 0;
}

.director-policy-explanation summary {
  cursor: pointer;
  color: var(--text-dim);
  align-content: center;
  min-height: 36px;
  font-size: .8rem;
}

.director-policy-explanation p {
  color: var(--text-dim);
  margin-top: 12px;
  font-size: .76rem;
  line-height: 1.7;
}

.director-policy-footer {
  border-top: 1px solid var(--line);
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-top: 8px;
  padding-top: 20px;
  display: flex;
}

.director-policy-footer > span {
  color: var(--text-mute);
  font-size: .75rem;
}

@media (max-width: 800px) {
  .director-policy-group {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

@media (max-width: 500px) {
  .director-policy-fields {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .director-policy-switches label {
    padding: 14px;
  }

  .director-policy-footer {
    align-items: flex-start;
  }
}

.director-execution-notice {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--warn);
  border-radius: 10px;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 16px 20px;
  display: flex;
}

.director-execution-notice strong {
  font-size: .84rem;
  font-weight: 500;
}

.director-execution-notice p {
  color: var(--text-dim);
  max-width: 650px;
  margin-top: 6px;
  font-size: .76rem;
  line-height: 1.65;
}

.director-execution-notice a {
  color: var(--accent);
  white-space: nowrap;
  align-items: center;
  min-height: 44px;
  font-size: .78rem;
  display: flex;
}

.director-number .director-row-note {
  white-space: normal;
}

@media (max-width: 760px) {
  .director-execution-notice {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .director-heading h1 {
    font-size: 1.6rem;
  }

  .director-statusbar {
    gap: 10px;
  }

  .director-tabs {
    gap: 20px;
  }
}

.director-management {
  justify-content: space-between;
}

.director-management strong {
  color: var(--text);
  font-weight: 500;
}

.director-management .director-row-note {
  white-space: normal;
  max-width: none;
  margin-top: 4px;
  font-size: .75rem;
}

.director-disclosure {
  border-top: 1px solid var(--line);
}

.director-disclosure > summary {
  color: var(--text-dim);
  cursor: pointer;
  padding: 16px 0;
  font-size: .8rem;
}

.director-disclosure > summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.director-disclosure .director-charts {
  margin-bottom: 16px;
}

.director-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.director-table {
  min-width: 760px;
}

@media (max-width: 640px) {
  .director-metrics {
    grid-template-columns: 1fr;
  }

  .director-table {
    min-width: 0;
  }
}

.phf-mc {
  gap: 24px;
  min-width: 0;
  display: grid;
}

.phf-mc-heading {
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  display: flex;
}

.phf-mc-eyebrow {
  color: var(--accent);
  letter-spacing: .15em;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: .65rem;
  display: flex;
}

.phf-mc-heading .phf-page-title {
  margin: 0 0 10px;
  font-size: 2rem;
  line-height: 1.15;
}

.phf-mc-run-state {
  flex-shrink: 0;
  justify-items: end;
  gap: 10px;
  display: grid;
}

.phf-mc-status {
  color: var(--text-mute);
  font-variant-numeric: tabular-nums;
  font-size: .7rem;
}

.phf-mc-sub {
  max-width: 70ch;
  color: var(--text-dim);
  margin-top: 6px;
  font-size: .8rem;
  line-height: 1.65;
}

.phf-mc-body {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 24px;
  display: grid;
}

.phf-mc-results {
  gap: 20px;
  min-width: 0;
  transition: opacity .15s;
  display: grid;
}

.phf-mc-results[data-settled="false"] {
  opacity: .6;
}

.phf-mc-form {
  order: -1;
  min-width: 0;
}

@media (min-width: 1100px) {
  .phf-mc-body {
    grid-template-columns: minmax(0, 1fr) 310px;
  }

  .phf-mc-form {
    scrollbar-width: thin;
    border-radius: 16px;
    order: 0;
    max-height: calc(100dvh - 32px);
    position: sticky;
    top: 16px;
    overflow: auto;
  }
}

.phf-mc-headline {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  display: grid;
}

.phf-mc-headline > div {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 14px;
  min-width: 0;
  padding: 16px 18px;
}

.phf-mc-headline > .wide {
  border-color: var(--line-strong);
  background: linear-gradient(120deg,var(--accent-soft),transparent 70%),var(--surface);
  grid-column: 1 / -1;
  padding: 22px 24px;
}

.phf-mc-headline dt {
  color: var(--text-dim);
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: .74rem;
  line-height: 1.3;
  display: flex;
}

.phf-mc-headline dd {
  font-variant-numeric: tabular-nums;
  margin: 0;
}

.phf-mc-headline .phf-mc-lead {
  letter-spacing: -.05em;
  margin: 12px 0 8px;
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  font-weight: 500;
  line-height: 1;
}

.phf-mc-lead[data-positive="true"] {
  color: var(--accent);
}

.phf-mc-headline .phf-mc-figure {
  letter-spacing: -.025em;
  overflow-wrap: anywhere;
  margin: 10px 0 6px;
  font-size: clamp(1.05rem, 1.5vw, 1.45rem);
  font-weight: 500;
}

.phf-mc-headline .phf-mc-note {
  color: var(--text-mute);
  font-size: .71rem;
  line-height: 1.55;
}

.phf-mc-model-label {
  color: var(--text-mute);
  margin-top: 6px;
  font-size: .67rem;
  display: block;
}

.phf-mc .phf-help-trigger[data-icon] {
  vertical-align: middle;
  width: 22px;
  min-width: 22px;
  height: 24px;
  min-height: 24px;
}

.phf-mc .phf-help-mark {
  width: 14px;
  height: 14px;
  font-size: .66rem;
}

.phf-mc-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  min-width: 0;
  margin: 0;
  padding: 22px;
}

.phf-mc-section h2 {
  letter-spacing: -.015em;
  align-items: center;
  gap: 8px;
  font-size: .96rem;
  font-weight: 500;
  line-height: 1.4;
  display: flex;
}

.phf-mc-caption {
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  display: flex;
}

.phf-mc-caption > div {
  flex: 1;
  min-width: 180px;
}

.phf-mc-legend {
  color: var(--text-mute);
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 16px 0 0;
  padding: 0;
  font-size: .67rem;
  list-style: none;
  display: flex;
}

.phf-mc-legend li {
  align-items: center;
  gap: 6px;
  display: flex;
}

.phf-mc-key {
  border-radius: 2px;
  width: 12px;
  height: 8px;
  display: inline-block;
}

.phf-mc-key.dot {
  width: 8px;
}

.phf-mc-key.rule {
  height: 2px;
}

.phf-mc-key.hair {
  height: 1px;
}

.phf-mc-plot {
  width: 100%;
  height: 260px;
  margin-top: 16px;
}

.phf-mc-plot.tall {
  height: 320px;
}

.phf-mc-plot.short {
  height: 240px;
}

.phf-mc-pair {
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  display: grid;
}

.phf-mc-pair figure {
  min-width: 0;
  margin: 0;
}

.phf-mc-pair figure + figure {
  border-top: 1px solid var(--line);
  padding-top: 24px;
}

@media (min-width: 1700px) {
  .phf-mc-pair {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .phf-mc-pair figure + figure {
    border: 0;
    padding: 0;
  }
}

.phf-mc-details {
  border-top: 1px solid var(--line);
  margin-top: 12px;
  padding-top: 12px;
  font-size: .73rem;
}

.phf-mc-details summary {
  color: var(--text-dim);
  cursor: pointer;
  align-content: center;
  min-height: 30px;
}

.phf-mc-scroller {
  max-height: 320px;
  margin-top: 12px;
  overflow: auto;
}

.phf-mc-scroller table, .phf-mc-stats {
  border-collapse: collapse;
  text-align: left;
  font-variant-numeric: tabular-nums;
  width: 100%;
  font-size: .73rem;
}

.phf-mc-stats {
  min-width: 440px;
}

.phf-mc-stats th[scope="col"] {
  background: var(--surface-2);
  color: var(--text-mute);
  border-bottom: 1px solid var(--line);
  padding: 12px 8px;
  font-size: .66rem;
  font-weight: 400;
}

.phf-mc-stats th[scope="col"]:not(:first-child) {
  text-align: right;
}

.phf-mc-stats th[scope="colgroup"] {
  color: var(--text);
  padding: 20px 8px 10px;
  font-size: .75rem;
  font-weight: 500;
}

.phf-mc-stats th[scope="row"] {
  color: var(--text-dim);
  border-bottom: 1px solid var(--line);
  padding: 8px;
  font-weight: 400;
}

.phf-mc-stats td {
  text-align: right;
  color: var(--text-dim);
  border-bottom: 1px solid var(--line);
  padding: 8px;
}

.phf-mc-stats td.lead {
  color: var(--text);
}

.phf-mc-stats td.quiet {
  color: var(--text-mute);
}

.phf-mc-prose, .phf-mc-method {
  color: var(--text-dim);
  gap: 16px;
  margin-top: 16px;
  font-size: .78rem;
  line-height: 1.7;
  display: grid;
}

.phf-mc-prose h3 {
  color: var(--text);
  margin-bottom: 8px;
  font-size: .8rem;
  font-weight: 500;
}

.phf-mc-prose p + p {
  margin-top: 8px;
}

.phf-mc-section > summary {
  cursor: pointer;
  font-size: .85rem !important;
  font-weight: 500 !important;
}

.phf-mc-footer {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.phf-mc-footer .phf-mc-sub {
  max-width: 100ch;
  color: var(--text-mute);
  font-size: .7rem;
}

.phf-mc-controls {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 16px;
}

.phf-mc-controls > summary {
  cursor: pointer;
  align-items: center;
  gap: 10px;
  padding: 16px;
  font-size: .84rem;
  display: flex;
}

.phf-mc-controls > summary > svg:last-child {
  margin-left: auto;
}

.phf-mc-controls form {
  padding: 20px;
}

@media (min-width: 1100px) {
  .phf-mc-controls > summary {
    display: none;
  }
}

.phf-mc-form-head {
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  display: flex;
}

.phf-mc-form-head h2 {
  align-items: center;
  gap: 8px;
  font-size: .9rem;
  font-weight: 500;
  display: flex;
}

.phf-mc-reset {
  border: 1px solid var(--line);
  min-height: 32px;
  color: var(--text-dim);
  cursor: pointer;
  border-radius: 7px;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  font-size: .7rem;
  display: inline-flex;
}

.phf-mc-reset:hover {
  color: var(--text);
}

.phf-mc-scenario-label {
  color: var(--text-dim);
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  font-size: .75rem;
  display: flex;
}

.phf-mc-presets {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  grid-template-columns: 1fr;
  gap: 4px;
  margin-top: 8px;
  padding: 4px;
  display: grid;
}

.phf-mc-presets .phf-mc-preset {
  min-height: 36px;
  color: var(--text-dim);
  background: none;
  border: 1px solid #0000;
  border-radius: 7px;
  flex: 1;
  padding: 6px;
  font-size: .75rem;
}

.phf-mc-preset[aria-pressed="true"] {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow-card);
}

.phf-mc-preset-note {
  color: var(--text-mute);
  margin: 12px 0 20px;
  font-size: .71rem;
  line-height: 1.6;
}

.phf-mc-assumption {
  border-top: 1px solid var(--line);
}

.phf-mc-assumption > summary {
  cursor: pointer;
  min-height: 52px;
  color: var(--text-dim);
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: .79rem;
  display: flex;
}

.phf-mc-assumption > summary::-webkit-details-marker {
  display: none;
}

.phf-mc-controls > summary::-webkit-details-marker {
  display: none;
}

.phf-mc-assumption > summary svg {
  color: var(--text-mute);
  transition: transform .15s;
}

.phf-mc-assumption[open] > summary {
  color: var(--text);
}

.phf-mc-assumption[open] > summary svg {
  transform: rotate(180deg);
}

.phf-mc-group {
  border: 0;
  min-width: 0;
  margin: 0;
  padding: 4px 0 20px;
}

.phf-mc-fields {
  gap: 16px;
  min-width: 0;
  display: grid;
}

.phf-mc-field {
  min-width: 0;
}

.phf-mc-label {
  color: var(--text-dim);
  align-items: center;
  gap: 6px;
  font-size: .74rem;
  line-height: 1.4;
  display: flex;
}

.phf-mc-field label {
  cursor: pointer;
}

.phf-mc-range-head {
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  display: flex;
}

.phf-mc-range-head output {
  color: var(--accent);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-size: .7rem;
}

.phf-mc-field input[type="number"], .phf-mc-field select, .phf-mc-pairing input {
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  width: 100%;
  min-width: 0;
  min-height: 42px;
  color: var(--text);
  font: .8rem var(--sans);
  font-variant-numeric: tabular-nums;
  border-radius: 8px;
  margin-top: 8px;
  padding: 8px 10px;
}

.phf-mc-field input[type="range"] {
  width: 100%;
  height: 22px;
  accent-color: var(--accent);
  cursor: pointer;
  margin-top: 8px;
}

.phf-mc-field input:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.phf-mc-pairing {
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  display: grid;
}

.phf-mc-pairing.triple {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto minmax(0, 1fr);
}

.phf-mc-pairing > span {
  color: var(--text-mute);
  font-size: .7rem;
}

.phf-mc-check {
  color: var(--text-dim);
  align-items: flex-start;
  gap: 8px;
  font-size: .73rem;
  line-height: 1.6;
  display: flex;
}

.phf-mc-check input {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
  flex-shrink: 0;
  margin-top: 3px;
}

.phf-mc-hint {
  color: var(--text-mute);
  background: var(--surface-2);
  border-radius: 8px;
  padding: 10px;
  font-size: .69rem;
  line-height: 1.65;
}

.phf-mc-auto-note {
  color: var(--text-mute);
  border-top: 1px solid var(--line);
  padding-top: 16px;
  font-size: .68rem;
  line-height: 1.6;
}

.phf-mc-seed {
  gap: 12px;
  display: grid;
}

.phf-mc-seed .phf-ui-button {
  font-size: .75rem;
}

.phf-mc-errors {
  border: 1px solid var(--warn);
  border-radius: 8px;
  margin: 12px 0;
  padding: 12px;
  font-size: .75rem;
  line-height: 1.6;
}

.phf-mc input:focus-visible, .phf-mc select:focus-visible, .phf-mc summary:focus-visible, .phf-mc button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.phf-mc-sr {
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  position: absolute;
  overflow: hidden;
}

@media (max-width: 640px) {
  .phf-mc-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .phf-mc-run-state {
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    display: flex;
  }

  .phf-mc-heading .phf-page-title {
    font-size: 1.7rem;
  }

  .phf-mc-headline {
    gap: 10px;
  }

  .phf-mc-headline > div {
    padding: 12px;
  }

  .phf-mc-headline > .wide {
    padding: 20px;
  }

  .phf-mc-headline dt {
    font-size: .68rem;
  }

  .phf-mc-headline .phf-mc-note {
    font-size: .67rem;
  }

  .phf-mc-section {
    padding: 16px;
  }

  .phf-mc-plot {
    height: 240px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .phf-mc-results, .phf-mc-assumption > summary svg {
    transition: none;
  }
}

.phf-main:has( > .phf-mc) {
  row-gap: 24px;
}

.phf-main:has( > .phf-mc) > .phf-build-nav {
  margin-bottom: 0;
}

@media (min-width: 1500px) {
  .phf-mc-headline {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.phf-login {
  max-width: 28rem;
  padding: var(--s-6);
  margin: 12vh auto;
}

.phf-login svg {
  width: 11rem;
  color: var(--accent);
  margin-bottom: var(--s-6);
}

.phf-login form {
  gap: var(--s-4);
  display: grid;
}

.phf-login h1 {
  margin-bottom: var(--s-4);
  font-size: 1.6rem;
}

.phf-page-title {
  margin-bottom: var(--s-5);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 450;
}

.phf-runtime-stack {
  gap: var(--s-5);
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  display: grid;
}

.phf-runtime-stack > * {
  width: 100%;
  min-width: 0;
}

.phf-runtime-stats {
  gap: var(--s-5);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr));
  display: grid;
}

.phf-run-controls {
  align-items: center;
  gap: var(--s-3);
  margin-block: var(--s-4);
  flex-wrap: wrap;
  display: flex;
}

.phf-run-id {
  font-family: var(--mono);
  overflow-wrap: anywhere;
  color: var(--text-mute);
  font-size: .75rem;
}

.phf-record-id {
  white-space: normal;
  overflow-wrap: anywhere;
  max-width: 14rem;
  font: .65rem var(--mono);
  color: var(--text-mute);
  margin-top: .3rem;
  display: block;
}

.phf-runtime-stack pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: .8rem;
}

.phf-status-line {
  color: var(--text-dim);
  margin-block: var(--s-3);
  font-size: .8rem;
}

.phf-status-line[data-error="true"] {
  color: var(--bad);
}

.phf-help-trigger {
  font: inherit;
  color: inherit;
  cursor: help;
  -webkit-text-decoration: underline dotted var(--text-mute);
  -webkit-text-decoration: underline dotted var(--text-mute);
  text-decoration: underline dotted var(--text-mute);
  text-underline-offset: .3em;
  background: none;
  border: 0;
  padding: .35rem 0;
}

.phf-help-trigger:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.phf-help-mark {
  opacity: .65;
  margin-left: .4rem;
  font-size: .65rem;
}

.phf-help-card {
  z-index: 100;
  background: var(--surface-2);
  width: min(320px, 100vw - 24px);
  color: var(--text-dim);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem;
  font-size: .85rem;
  line-height: 1.55;
  position: fixed;
  box-shadow: 0 12px 35px #0005;
}

.phf-help-card strong {
  color: var(--text);
  margin-bottom: .35rem;
  font-weight: 500;
  display: block;
}

.phf-help-card p {
  margin: 0;
}

.phf-field-head {
  align-items: baseline;
  gap: .1rem;
  display: flex;
}

.phf-field-head label {
  cursor: pointer;
}

.phf-help-trigger[data-icon] {
  padding: 0 .2rem;
  line-height: 1;
  text-decoration: none;
}

.phf-help-trigger[data-icon] .phf-help-mark {
  opacity: .5;
  border: 1px solid;
  border-radius: 50%;
  justify-content: center;
  align-items: center;
  width: 1.15em;
  height: 1.15em;
  margin-left: 0;
  font-size: .8rem;
  display: inline-flex;
}

.phf-help-trigger[data-icon]:hover .phf-help-mark, .phf-help-trigger[data-icon]:focus-visible .phf-help-mark {
  opacity: 1;
  color: var(--accent);
}

.phf-compose-row {
  gap: var(--s-5);
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  display: grid;
}

.phf-compose-input {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  width: 100%;
  min-height: 2.75rem;
  color: var(--text);
  font: inherit;
  margin-top: .4rem;
  padding: 0 .75rem;
  font-size: .9rem;
}

.phf-compose-input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.phf-stage-params {
  gap: var(--s-5);
  margin-top: var(--s-5);
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  display: grid;
}

.phf-field-hint {
  color: var(--text-mute);
  margin: .35rem 0 0;
  font-size: .78rem;
  line-height: 1.45;
}

.phf-compose-actions {
  gap: var(--s-4, .75rem);
  flex-wrap: wrap;
  display: flex;
}

.phf-research-assumptions {
  color: var(--text-dim);
  padding-left: 1.4rem;
  font-size: .85rem;
  list-style: outside;
}

.phf-research-assumptions li {
  margin-block: .5rem;
}

.phf-review-check {
  align-items: start;
  gap: .75rem;
  font-size: .85rem;
  display: flex;
}

.phf-review-check input {
  accent-color: var(--accent);
  margin-top: .3rem;
}

.phf-planning-columns {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  align-items: start;
  gap: 20px;
  display: grid;
}

.phf-planning-columns > *, .phf-planning section {
  min-width: 0;
}

.phf-plan-fields {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
  gap: 14px;
  margin: 14px 0;
  display: grid;
}

.phf-plan-fields > .phf-field:has(textarea) {
  grid-column: 1 / -1;
}

.phf-plan-fields select, .phf-plan-fields input, .phf-plan-fields textarea {
  width: 100%;
  min-width: 0;
}

.phf-planning textarea {
  border: 1px solid var(--line);
  background: var(--surface);
  width: 100%;
  min-height: 80px;
  color: inherit;
  font: inherit;
  border-radius: 6px;
  padding: 10px;
}

.phf-leg {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
  margin: 16px 0;
  padding: 12px;
}

.phf-leg legend {
  padding: 0 8px;
  font-size: 12px;
}

.phf-plan-identity, .phf-page-heading {
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  display: flex;
}

.phf-plan-header {
  flex-wrap: wrap;
  align-items: baseline;
  gap: .5rem 1rem;
  display: flex;
}

.phf-plan-header .phf-page-title {
  margin: 0;
}

.phf-plan-header .phf-plan-identity {
  align-items: center;
  gap: .5rem;
  display: inline-flex;
}

.phf-plan-identity {
  font-size: 12px;
}

.phf-payoff svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.phf-payoff text {
  fill: currentColor;
  font-size: 12px;
}

.phf-payoff-axis {
  stroke: currentColor;
  opacity: .2;
}

.phf-payoff-expiry {
  stroke: var(--accent, #997400);
  stroke-width: 2.5px;
  fill: none;
}

.phf-payoff-scenario {
  stroke: var(--universe-data);
  stroke-width: 2px;
  stroke-dasharray: 7 4;
  fill: none;
}

.phf-payoff figcaption {
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  display: flex;
}

.phf-payoff-key {
  color: var(--accent, #997400);
}

.phf-planning details {
  margin-top: 16px;
}

.phf-planning summary {
  cursor: pointer;
}

.phf-planning td {
  padding: 10px 12px;
}

.phf-plan-description {
  gap: 12px;
  margin: 16px 0;
  display: grid;
}

.phf-plan-description dt {
  opacity: .65;
  font-size: 12px;
}

.phf-plan-description dd {
  white-space: pre-wrap;
  margin: 4px 0 0;
}

.phf-plan-hash {
  overflow-wrap: anywhere;
  margin-top: 12px;
  display: block;
}

@media (max-width: 1100px) {
  .phf-planning-columns {
    grid-template-columns: minmax(0, 1fr);
  }
}

@property --tw-translate-x {
  syntax: "*";
  inherits: false;
  initial-value: 0;
}

@property --tw-translate-y {
  syntax: "*";
  inherits: false;
  initial-value: 0;
}

@property --tw-translate-z {
  syntax: "*";
  inherits: false;
  initial-value: 0;
}

@property --tw-rotate-x {
  syntax: "*";
  inherits: false
}

@property --tw-rotate-y {
  syntax: "*";
  inherits: false
}

@property --tw-rotate-z {
  syntax: "*";
  inherits: false
}

@property --tw-skew-x {
  syntax: "*";
  inherits: false
}

@property --tw-skew-y {
  syntax: "*";
  inherits: false
}

@property --tw-space-y-reverse {
  syntax: "*";
  inherits: false;
  initial-value: 0;
}

@property --tw-divide-y-reverse {
  syntax: "*";
  inherits: false;
  initial-value: 0;
}

@property --tw-border-style {
  syntax: "*";
  inherits: false;
  initial-value: solid;
}

@property --tw-gradient-position {
  syntax: "*";
  inherits: false
}

@property --tw-gradient-from {
  syntax: "<color>";
  inherits: false;
  initial-value: #0000;
}

@property --tw-gradient-via {
  syntax: "<color>";
  inherits: false;
  initial-value: #0000;
}

@property --tw-gradient-to {
  syntax: "<color>";
  inherits: false;
  initial-value: #0000;
}

@property --tw-gradient-stops {
  syntax: "*";
  inherits: false
}

@property --tw-gradient-via-stops {
  syntax: "*";
  inherits: false
}

@property --tw-gradient-from-position {
  syntax: "<length-percentage>";
  inherits: false;
  initial-value: 0%;
}

@property --tw-gradient-via-position {
  syntax: "<length-percentage>";
  inherits: false;
  initial-value: 50%;
}

@property --tw-gradient-to-position {
  syntax: "<length-percentage>";
  inherits: false;
  initial-value: 100%;
}

@property --tw-leading {
  syntax: "*";
  inherits: false
}

@property --tw-font-weight {
  syntax: "*";
  inherits: false
}

@property --tw-tracking {
  syntax: "*";
  inherits: false
}

@property --tw-ordinal {
  syntax: "*";
  inherits: false
}

@property --tw-slashed-zero {
  syntax: "*";
  inherits: false
}

@property --tw-numeric-figure {
  syntax: "*";
  inherits: false
}

@property --tw-numeric-spacing {
  syntax: "*";
  inherits: false
}

@property --tw-numeric-fraction {
  syntax: "*";
  inherits: false
}

@property --tw-shadow {
  syntax: "*";
  inherits: false;
  initial-value: 0 0 #0000;
}

@property --tw-shadow-color {
  syntax: "*";
  inherits: false
}

@property --tw-shadow-alpha {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 100%;
}

@property --tw-inset-shadow {
  syntax: "*";
  inherits: false;
  initial-value: 0 0 #0000;
}

@property --tw-inset-shadow-color {
  syntax: "*";
  inherits: false
}

@property --tw-inset-shadow-alpha {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 100%;
}

@property --tw-ring-color {
  syntax: "*";
  inherits: false
}

@property --tw-ring-shadow {
  syntax: "*";
  inherits: false;
  initial-value: 0 0 #0000;
}

@property --tw-inset-ring-color {
  syntax: "*";
  inherits: false
}

@property --tw-inset-ring-shadow {
  syntax: "*";
  inherits: false;
  initial-value: 0 0 #0000;
}

@property --tw-ring-inset {
  syntax: "*";
  inherits: false
}

@property --tw-ring-offset-width {
  syntax: "<length>";
  inherits: false;
  initial-value: 0;
}

@property --tw-ring-offset-color {
  syntax: "*";
  inherits: false;
  initial-value: #fff;
}

@property --tw-ring-offset-shadow {
  syntax: "*";
  inherits: false;
  initial-value: 0 0 #0000;
}

@property --tw-outline-style {
  syntax: "*";
  inherits: false;
  initial-value: solid;
}

@property --tw-blur {
  syntax: "*";
  inherits: false
}

@property --tw-brightness {
  syntax: "*";
  inherits: false
}

@property --tw-contrast {
  syntax: "*";
  inherits: false
}

@property --tw-grayscale {
  syntax: "*";
  inherits: false
}

@property --tw-hue-rotate {
  syntax: "*";
  inherits: false
}

@property --tw-invert {
  syntax: "*";
  inherits: false
}

@property --tw-opacity {
  syntax: "*";
  inherits: false
}

@property --tw-saturate {
  syntax: "*";
  inherits: false
}

@property --tw-sepia {
  syntax: "*";
  inherits: false
}

@property --tw-drop-shadow {
  syntax: "*";
  inherits: false
}

@property --tw-drop-shadow-color {
  syntax: "*";
  inherits: false
}

@property --tw-drop-shadow-alpha {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 100%;
}

@property --tw-drop-shadow-size {
  syntax: "*";
  inherits: false
}

@property --tw-backdrop-blur {
  syntax: "*";
  inherits: false
}

@property --tw-backdrop-brightness {
  syntax: "*";
  inherits: false
}

@property --tw-backdrop-contrast {
  syntax: "*";
  inherits: false
}

@property --tw-backdrop-grayscale {
  syntax: "*";
  inherits: false
}

@property --tw-backdrop-hue-rotate {
  syntax: "*";
  inherits: false
}

@property --tw-backdrop-invert {
  syntax: "*";
  inherits: false
}

@property --tw-backdrop-opacity {
  syntax: "*";
  inherits: false
}

@property --tw-backdrop-saturate {
  syntax: "*";
  inherits: false
}

@property --tw-backdrop-sepia {
  syntax: "*";
  inherits: false
}

@property --tw-duration {
  syntax: "*";
  inherits: false
}

@property --tw-ease {
  syntax: "*";
  inherits: false
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  50% {
    opacity: .5;
  }
}
