/* ==========================================================================
   Brookfield Portfolio Intelligence
   --------------------------------------------------------------------------
   Built on static/brand/brand.css, shared with the Knowledge Hub, so the two
   halves of the platform are one product: one palette, one type scale, one
   radius, one focus ring.

   The app keeps its editorial character — serif headlines, thin rules, a
   coloured basis tag on every number — but the chrome is no longer an admin
   panel: the top bar carries four things, and workspace switching, roles and
   status live behind one menu instead of five inline controls.
   ========================================================================== */

:root {
  /* Names this file and its siblings already use, bridged to the foundation.
     No raw hex values below this block. */
  --accent-2: var(--c-teal-600);
  --accent-3: var(--c-blue-700);
  --teal: var(--c-teal-600);
  --good: var(--c-good-700);   --good-soft: var(--c-good-50);
  --bad: var(--c-bad-700);     --bad-soft: var(--c-bad-50);
  --warn: var(--c-warn-700);   --warn-soft: var(--c-warn-50);
  --f-serif: var(--font-display);
  --f-sans: var(--font-sans);
  --radius: var(--rad-sm);
  --on-dark: #FFFFFF;

  --fs-2xs: var(--t-3xs); --fs-xs: var(--t-2xs); --fs-sm: var(--t-xs); --fs-base: var(--t-sm);
  --fs-md: var(--t-md); --fs-lg: var(--t-base); --fs-xl: var(--t-lg);

  --r-sm: var(--rad-sm); --r-md: var(--rad); --r-lg: var(--rad-lg); --r-pill: var(--rad-pill);
  --shadow-sm: var(--el-1); --shadow-md: var(--el-2); --shadow-lg: var(--el-3);
  --t-fast: .13s;
  --nav-w: 228px;
  --top-h: var(--shell-top);
}

body { background: var(--canvas); font-size: var(--t-sm); }
h1 { font-size: var(--t-2xl); }
h2 { font-size: var(--t-lg); }
h3 { font-size: var(--t-base); font-family: var(--font-sans); font-weight: var(--w-semi); }
h4 { font-size: var(--t-sm); font-family: var(--font-sans); font-weight: var(--w-semi); }

/* ---------- chrome ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  height: var(--top-h);
  display: flex; align-items: center; gap: var(--s-4);
  padding: 0 var(--s-5);
  background: var(--canvas);
  border-bottom: 1px solid var(--rule);
}
.brand { display: flex; align-items: center; gap: var(--s-3); color: var(--ink); min-width: 0; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px; flex: none; display: grid; place-items: center;
  background: var(--ink); color: var(--on-ink);
  font: var(--w-reg) var(--t-lg)/1 var(--font-display);
  border-radius: var(--rad-sm);
}
.brand-mark.co { background: var(--c-teal-600); }
.brand-mark.ind { background: var(--c-plum-600); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-text strong { font-size: var(--t-sm); font-weight: var(--w-semi); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { font-size: var(--t-3xs); color: var(--muted); white-space: nowrap; }
.topbar-right { display: flex; align-items: center; gap: var(--s-2); margin-left: auto; }

.pill {
  display: inline-flex; align-items: center; gap: var(--s-1);
  padding: 2px var(--s-2); border: 1px solid var(--rule); border-radius: var(--rad-xs);
  font-size: var(--t-3xs); color: var(--muted); background: var(--canvas); white-space: nowrap;
}
.pill-ok { color: var(--good); border-color: var(--good-soft); background: var(--good-soft); }
.pill-muted { color: var(--muted); }

/* One menu replaces the row of selects, pills and forms that used to sit here. */
.ws { position: relative; }
.ws-btn {
  display: inline-flex; align-items: center; gap: var(--s-2);
  height: 32px; padding: 0 var(--s-3);
  border: 1px solid var(--rule); border-radius: var(--rad-sm);
  background: var(--canvas); color: var(--text); font-size: var(--t-xs); white-space: nowrap;
}
.ws-btn:hover { background: var(--panel); border-color: var(--c-n-300); }
.ws-btn i:first-child { color: var(--muted); }
.ws-btn .bi-chevron-down { font-size: .6rem; color: var(--muted); }
.ws-menu {
  position: absolute; right: 0; top: 38px; width: 320px; z-index: 40;
  background: var(--canvas); border: 1px solid var(--rule); border-radius: var(--rad);
  box-shadow: var(--el-3); padding: var(--s-2);
}
.ws-menu h5 {
  font-size: var(--t-3xs); text-transform: uppercase; letter-spacing: var(--track-label);
  color: var(--muted); padding: var(--s-2) var(--s-2) var(--s-1); margin: 0;
}
.ws-menu form { margin: 0 0 var(--s-2); }
.ws-menu select { width: 100%; min-width: 0; font-size: var(--t-xs); }
.ws-menu .ws-row { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-2); font-size: var(--t-2xs); color: var(--muted); }
.ws-menu .ws-sep { height: 1px; background: var(--rule-soft); margin: var(--s-2) var(--s-1); }
.ws-menu a, .ws-menu button.ws-item {
  display: flex; align-items: center; gap: var(--s-2); width: 100%;
  padding: var(--s-2); border: 0; background: none; border-radius: var(--rad-sm);
  font-size: var(--t-xs); color: var(--text); text-align: left;
}
.ws-menu a:hover, .ws-menu button.ws-item:hover { background: var(--panel); text-decoration: none; }
.ws-menu a i, .ws-menu button.ws-item i { color: var(--muted); width: 16px; text-align: center; }

.viewas-banner {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
  padding: var(--s-2) var(--s-5); background: var(--warn-soft); color: var(--warn);
  font-size: var(--t-2xs); border-bottom: 1px solid var(--rule);
}

.shell { display: flex; min-height: calc(100vh - var(--top-h)); }
.sidenav {
  width: var(--nav-w); flex-shrink: 0;
  border-right: 1px solid var(--rule);
  padding: var(--s-3) var(--s-3) var(--s-6);
  position: sticky; top: var(--top-h); height: calc(100vh - var(--top-h));
  overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column;
}
.sidenav a {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-2) var(--s-3); color: var(--text-2); font-size: var(--t-xs);
  border-radius: var(--rad-sm); line-height: 1.35;
}
.sidenav a i { color: var(--muted); font-size: var(--t-sm); width: 16px; text-align: center; flex: none; }
.sidenav a:hover { background: var(--panel); color: var(--ink); text-decoration: none; }
.sidenav a.active { color: var(--accent-ink); font-weight: var(--w-semi); background: var(--accent-soft); }
.sidenav a.active i { color: var(--accent); }
.nav-h {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  border: 0; background: none; padding: var(--s-4) var(--s-3) var(--s-2);
  font-size: var(--t-3xs); font-weight: var(--w-semi); letter-spacing: var(--track-label);
  text-transform: uppercase; color: var(--muted-2); text-align: left;
}
.nav-h i { font-size: .6rem; transition: transform var(--t-mid) var(--ease); }
.nav-group.closed .nav-items { display: none; }
.nav-group.closed .nav-h i { transform: rotate(-90deg); }
.nav-sub { padding: 0 0 var(--s-2) var(--s-7); display: grid; gap: 1px; }
.nav-sub a { padding: var(--s-1) var(--s-3); font-size: var(--t-2xs); }
.sidenav-foot {
  margin-top: auto; padding: var(--s-4) var(--s-3) 0; font-size: var(--t-3xs); color: var(--muted);
  display: grid; grid-template-columns: 10px 1fr; gap: var(--s-1) var(--s-2); align-items: center;
  border-top: 1px solid var(--rule-soft);
}
.content { flex: 1; min-width: 0; padding: var(--s-7) var(--s-8) var(--s-10); max-width: var(--page-max); }

/* ---------- page header ---------- */
.kicker {
  font-size: var(--t-3xs); letter-spacing: var(--track-label); text-transform: uppercase;
  color: var(--muted); font-weight: var(--w-semi); margin-bottom: var(--s-2);
}
.page-head {
  display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s-6);
  padding-bottom: var(--s-4); margin-bottom: var(--s-6); border-bottom: 1px solid var(--rule);
}
.page-head p.lede { margin: var(--s-3) 0 0; color: var(--text-2); max-width: 64ch; font-size: var(--t-base); line-height: var(--lh-snug); }
.page-actions { display: flex; gap: var(--s-2); flex-wrap: wrap; }

.headline {
  font-family: var(--font-display); font-size: var(--t-lg); line-height: 1.45;
  padding: var(--s-3) 0 var(--s-3) var(--s-4); border-left: 2px solid var(--accent);
  margin: 0 0 var(--s-6); max-width: 70ch; color: var(--ink);
}
.headline strong { color: var(--accent-ink); font-weight: var(--w-reg); }

/* ---------- buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  height: 32px; padding: 0 var(--s-4);
  font-size: var(--t-xs); font-weight: var(--w-semi);
  border: 1px solid var(--rule); background: var(--canvas); color: var(--text);
  border-radius: var(--rad-sm); white-space: nowrap;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.btn:hover { background: var(--panel); border-color: var(--c-n-300); text-decoration: none; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.btn-primary:hover { background: var(--c-ink-700); border-color: var(--c-ink-700); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-accent:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn[disabled] { opacity: .5; cursor: progress; }
.btn-sm { height: 26px; padding: 0 var(--s-3); font-size: var(--t-3xs); }

.filters {
  display: flex; gap: var(--s-3); flex-wrap: wrap; align-items: flex-end; margin-bottom: var(--s-6);
  padding: var(--s-3) var(--s-4); background: var(--panel);
  border: 1px solid var(--rule-soft); border-radius: var(--rad);
}
.filters label {
  display: flex; flex-direction: column; gap: var(--s-1);
  font-size: var(--t-3xs); color: var(--muted); text-transform: uppercase; letter-spacing: var(--track-label);
}
select, input[type=text], input[type=search], textarea {
  font-family: var(--font-sans); font-size: var(--t-xs); color: var(--text);
  padding: var(--s-2) var(--s-3); border: 1px solid var(--rule); border-radius: var(--rad-sm);
  background: var(--canvas); min-width: 150px;
}
textarea { width: 100%; min-height: 72px; resize: vertical; line-height: var(--lh-ui); }
select:focus, input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }

/* ---------- grid & cards ---------- */
.grid { display: grid; gap: var(--s-5); }
.grid > * { min-width: 0; }   /* grid columns may shrink below their content (charts, long labels) */
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: 2fr 1fr; }
.span-2 { grid-column: span 2; }
.mt { margin-top: var(--s-7); }
.mt-s { margin-top: var(--s-3); }

/* The card keeps its editorial top rule, but hairline and radius now match the hub. */
.card { border-top: 1px solid var(--ink); padding: var(--s-4) 0 0; }
.card.boxed { border: 1px solid var(--rule); border-top: 1px solid var(--ink); border-radius: 0 0 var(--rad) var(--rad); padding: var(--s-4) var(--s-5) var(--s-5); }
.card-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: var(--s-3); gap: var(--s-3); }
.card-head h2, .card-head h3 { font-family: var(--font-sans); font-size: var(--t-sm); font-weight: var(--w-semi); }
.card-head .sub { font-size: var(--t-2xs); color: var(--muted); }
.panel { background: var(--panel); padding: var(--s-4) var(--s-5); border-radius: var(--rad); }

.stat { padding: var(--s-4) var(--s-4) var(--s-3); border-top: 1px solid var(--ink); background: var(--canvas); }
.stat .label { font-size: var(--t-3xs); text-transform: uppercase; letter-spacing: var(--track-label); color: var(--muted); }
.stat .value { font-family: var(--font-display); font-size: var(--t-2xl); line-height: 1.15; margin-top: var(--s-1); color: var(--ink); }
.stat .foot { font-size: var(--t-2xs); color: var(--muted); margin-top: var(--s-1); line-height: 1.45; }
.stat.accent { border-top-color: var(--accent); }
.stat.accent .value { color: var(--accent-ink); }
.stat.good { border-top-color: var(--good); }
.stat.good .value { color: var(--good); }

.delta { font-size: var(--t-2xs); font-weight: var(--w-semi); }
.delta.up { color: var(--good); }
.delta.down { color: var(--bad); }
.tgt { font-size: var(--t-3xs); padding: 1px var(--s-2); border-radius: var(--rad-xs); }
.tgt.hit { background: var(--good-soft); color: var(--good); }
.tgt.miss { background: var(--warn-soft); color: var(--warn); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: var(--t-xs); }
table.t th {
  text-align: left; font-weight: var(--w-semi); font-size: var(--t-3xs);
  letter-spacing: var(--track-label); text-transform: uppercase;
  color: var(--muted); padding: var(--s-2) var(--s-3); border-bottom: 1px solid var(--rule); white-space: nowrap;
}
table.t td { padding: var(--s-2) var(--s-3); border-bottom: 1px solid var(--rule-soft); vertical-align: top; }
table.t tbody tr:hover td { background: var(--panel); }
table.t .n, table.t th.n { text-align: right; white-space: nowrap; }
table.t tfoot td { font-weight: var(--w-semi); border-top: 1px solid var(--ink); border-bottom: none; }
table.t .muted { color: var(--muted); }
.t-compact td, .t-compact th { padding: var(--s-1) var(--s-2) !important; }

.tag {
  display: inline-block; padding: 1px var(--s-2); font-size: var(--t-3xs);
  border: 1px solid var(--rule); border-radius: var(--rad-xs);
  color: var(--text-2); background: var(--canvas); white-space: nowrap;
}
.tag-accent { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-ink); }
.basis {
  display: inline-block; font-size: var(--t-3xs); padding: 0 var(--s-2);
  border-radius: var(--rad-xs); letter-spacing: .02em; white-space: nowrap;
}
.basis-Reported { background: var(--good-soft); color: var(--good); }
.basis-Web { background: var(--c-teal-50); color: var(--c-teal-600); }
.basis-Estimate { background: var(--warn-soft); color: var(--warn); }
.basis-Modeled { background: var(--panel-2); color: var(--muted); }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.legend-dot.basis-Reported { background: var(--good); }
.legend-dot.basis-Web { background: var(--c-teal-600); }
.legend-dot.basis-Estimate { background: var(--warn); }
.legend-dot.basis-Modeled { background: var(--muted-2); }

/* ---------- bars (width set by JS from data-w) ---------- */
.bar { height: 8px; background: var(--rule-soft); position: relative; min-width: 80px; }
.bar > span { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); width: 0; }
.bar > span.bench { background: transparent; border-right: 2px solid var(--ink); }
.bar.good > span { background: var(--good); }
.bar.ink > span:first-child { background: var(--ink); }

/* ---------- funnel ---------- */
.funnel { display: flex; flex-direction: column; gap: 4px; }
/* minmax(0, …) on the flexible column, because a grid track defaults to min-content and a long
   label or a wide conversion figure then pushes the whole row past the viewport. */
.funnel-row { display: grid; grid-template-columns: minmax(0, 210px) minmax(0, 1fr) minmax(0, 110px) minmax(0, 90px);
  gap: 12px; align-items: center; }
.funnel-row > * { min-width: 0; }
.funnel-row .lbl { font-size: var(--fs-base); }
.funnel-row .lbl small { display: block; color: var(--muted); font-size: var(--fs-xs); }
.funnel-row .track { height: 22px; background: var(--rule-soft); position: relative; }
.funnel-row .track > span { position: absolute; left: 0; top: 0; bottom: 0; background: var(--ink); width: 0; }
.funnel-row.top .track > span { background: var(--accent-2); }
.funnel-row.mid .track > span { background: var(--accent); }
.funnel-row.bottom .track > span { background: var(--ink); }
.funnel-row .val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.funnel-row .conv { text-align: right; font-size: var(--fs-sm); color: var(--muted); }
.phase-label { font-size: var(--fs-2xs); letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent);
  font-weight: 700; margin: 10px 0 2px; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--rule); margin-bottom: 20px; flex-wrap: wrap; }
.tabs button { background: none; border: none; padding: 10px 16px; font-size: var(--fs-base); color: var(--muted);
  border-bottom: 2px solid transparent; cursor: pointer; font-family: var(--f-sans); }
.tabs button.active { color: var(--ink); border-bottom-color: var(--accent); font-weight: 700; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ---------- segment cards ---------- */
.seg-card { border: 1px solid var(--rule); border-top: 3px solid var(--ink); padding: 14px 16px; background: var(--canvas); }
.seg-card h3 { font-size: var(--fs-lg); margin-bottom: 8px; }
.seg-card .kv { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; font-size: var(--fs-sm); }
.seg-card .kv span:nth-child(odd) { color: var(--muted); }
.seg-card .members { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 4px; }
.seg-card .ai { margin-top: 12px; font-size: var(--fs-base); border-top: 1px solid var(--rule-soft); padding-top: 10px; }
.seg-card .ai ul { margin: 4px 0 0 16px; padding: 0; }

/* ---------- entity tree ---------- */
.tree, .tree ul { list-style: none; margin: 0; padding-left: 18px; }
.tree { padding-left: 0; }
.tree li { position: relative; padding: 4px 0 4px 14px; font-size: var(--fs-base); }
.tree li::before { content: ''; position: absolute; left: 0; top: 13px; width: 9px; border-top: 1px solid var(--rule); }
.tree ul { border-left: 1px solid var(--rule); margin-left: 4px; }

/* ---------- AI blocks ---------- */
.ai-block { border: 1px solid var(--rule); border-left: 3px solid var(--accent); padding: 16px 18px; background: var(--canvas); }
.ai-block h4 { margin: 14px 0 6px; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.ai-block .ai-head { font-family: var(--f-serif); font-size: var(--fs-xl); }
.ai-block ul, .ai-block ol { margin: 0; padding-left: 18px; }
.ai-block li { margin: 3px 0; }
.ai-empty { color: var(--muted); font-size: var(--fs-base); }
.spinner { display: inline-block; width: 12px; height: 12px; border: 2px solid var(--rule); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.chart-box { position: relative; height: 280px; }
.chart-box.tall { height: 360px; }
.chart-box.short { height: 200px; }

.note { font-size: var(--fs-xs); color: var(--muted); margin-top: 8px; }
.callout { background: var(--accent-soft); border-left: 3px solid var(--accent); padding: 10px 14px; font-size: var(--fs-base); }
.list-plain { list-style: none; padding: 0; margin: 0; }
.list-plain li { padding: 7px 0; border-bottom: 1px solid var(--rule-soft); font-size: var(--fs-base); }

.toast { position: fixed; right: 24px; bottom: 24px; background: var(--ink); color: var(--on-dark); padding: 10px 16px;
  font-size: var(--fs-base); max-width: 420px; z-index: 50; }
.toast.error { background: var(--bad); }

pre.json { background: var(--panel); padding: 12px; font-size: var(--fs-sm); overflow: auto; max-height: 520px; }

@media (max-width: 1100px) {
  .g-4, .g-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-3, .g-2-1 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .content { padding: 18px 16px 40px; }
  .g-2, .g-4, .g-6 { grid-template-columns: 1fr; }
  .funnel-row { grid-template-columns: 1fr auto; row-gap: 4px; }
  .funnel-row .track { grid-column: 1 / -1; grid-row: 2; height: 10px; }
  .funnel-row .conv { display: none; }
}

details { border-top: 1px solid var(--rule); padding-top: 10px; }
details > summary { cursor: pointer; list-style: none; padding: 4px 0 10px; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: '+ '; color: var(--accent); }
details[open] > summary::before { content: '\2212  '; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.stage-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0; border: 1px solid var(--rule); }
.stage-grid > div { padding: 12px 14px; border-right: 1px solid var(--rule); position: relative; }
.stage-grid > div:last-child { border-right: none; }
.stage-grid .n-idx { font-family: var(--f-serif); color: var(--accent); font-size: var(--t-xl); }
.stage-grid h4 { margin: 4px 0 6px; }
.stage-grid p { margin: 0; font-size: var(--fs-sm); color: var(--muted); }
.arch-card { border: 1px solid var(--rule); padding: 14px 16px; }
.arch-card .sys { margin-top: 8px; }

/* ---------- workspaces & login ---------- */
.brand-sub { color: var(--muted); font-size: var(--fs-sm); margin-left: 6px; }
.brand-mark.co { background: var(--accent); font-family: var(--f-sans); font-size: var(--fs-base); font-weight: 700; }
.brand-mark.ind { background: var(--accent-2); font-family: var(--f-sans); font-size: var(--fs-base); font-weight: 700; }
.topbar-right { align-items: center; }
.topbar-right form { margin: 0; }
.view-as select { min-width: 0; width: 100%; font-size: var(--t-xs); }
.viewas-banner { display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 6px 24px; background: var(--accent-soft); border-bottom: 1px solid var(--accent-line); font-size: var(--fs-base); }
.viewas-banner form { margin: 0; }
.login-body { min-height: 100vh; display: grid; place-items: center; background: var(--panel); }
.login-card { width: min(420px, calc(100vw - 32px)); background: var(--canvas); border-top: 3px solid var(--ink);
  padding: 32px 32px 24px; box-shadow: 0 1px 2px rgba(5, 28, 44, 0.06); }
.login-card h1 { margin: 22px 0 6px; }
.login-card form { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.login-card label { display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-xs); text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--muted); }
.login-card input { width: 100%; }
.login-error { background: var(--bad-soft); border-left-color: var(--bad); margin-top: 12px; }

.role-switch { display: flex; gap: 4px; flex-wrap: wrap; margin: 0; }
.login-card .back { display: inline-block; margin-top: 14px; font-size: var(--fs-base); }

/* grouped side navigation: 360 views · journeys · value · intelligence */
.sidenav { padding: 10px 0; overflow-y: auto; }
.nav-group { padding: 4px 0 6px; }
.nav-group + .nav-group { border-top: 1px solid var(--rule-soft); }
.nav-h { display: flex; justify-content: space-between; align-items: center; width: 100%; background: none; border: 0; cursor: pointer;
  padding: 8px 22px 4px 25px; font-family: var(--f-sans); font-size: var(--fs-2xs); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.nav-h i { font-size: var(--fs-xs); transition: transform .15s; }
.nav-h:hover { color: var(--ink); }
.nav-group.closed .nav-items { display: none; }
.nav-group.closed .nav-h i { transform: rotate(-90deg); }
.sidenav .nav-items a { padding: 7px 22px; font-size: var(--fs-base); }
.nav-sub { margin: 0 0 4px 44px; border-left: 1px solid var(--rule); }
.sidenav .nav-sub a { padding: 4px 12px; font-size: var(--fs-sm); color: var(--muted); border-left: 2px solid transparent; margin-left: -1px; }
.sidenav .nav-sub a.active { color: var(--ink); font-weight: 700; background: none; border-left-color: var(--accent); }

/* ---------- motion (shared): .rv fades up on scroll; bars inside grow from zero ---------- */
.rv { opacity: 0; transform: translateY(14px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
.rv.in { opacity: 1; transform: none; }
.rv [data-w] { transition: width 1.1s cubic-bezier(.2,.7,.2,1); transition-delay: calc(var(--i, 0) * 60ms + 150ms); }
.rv:not(.in) [data-w] { width: 0 !important; }
.g-6 > .rv:nth-child(2) { transition-delay: .06s; } .g-6 > .rv:nth-child(3) { transition-delay: .12s; }
.g-6 > .rv:nth-child(4) { transition-delay: .18s; } .g-6 > .rv:nth-child(5) { transition-delay: .24s; }
.g-6 > .rv:nth-child(6) { transition-delay: .3s; }
@media (prefers-reduced-motion: reduce) {
  .rv, .rv [data-w] { transition: none !important; opacity: 1; transform: none; }
  .rv:not(.in) [data-w] { width: auto; }
}

/* ---------- overview ---------- */
.ov-hero { display: grid; grid-template-columns: 1fr 220px; gap: 32px; align-items: center; padding: 22px 26px;
  background: linear-gradient(120deg, var(--ink) 0%, color-mix(in srgb, var(--ink) 55%, var(--accent)) 60%, var(--accent) 100%); color: var(--on-dark); position: relative; overflow: hidden; }
.ov-hero::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 85% 50%, rgba(143,176,255,.18), transparent 55%); }
.ov-hero .kicker { color: rgba(255, 255, 255, .72); }
.ov-big { font-family: var(--f-serif); font-size: var(--t-4xl); line-height: 1.05; margin: 4px 0 8px; font-variant-numeric: tabular-nums; }
.ov-answer { margin: 0; max-width: 760px; color: rgba(255, 255, 255, .84); font-size: var(--fs-lg); line-height: 1.55; }
.ov-answer strong { color: var(--on-dark); font-weight: 700; }
.ov-ring { position: relative; width: 190px; height: 190px; justify-self: end; z-index: 1; }
.ov-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ov-ring circle { fill: none; stroke-width: 11; }
.ov-ring .trk { stroke: rgba(255,255,255,.12); }
.ov-ring .arc { stroke-dasharray: 0 100; transition: stroke-dasharray 1.6s cubic-bezier(.2,.7,.2,1); }
.ov-ring .tgt { stroke: var(--accent-hi); opacity: .55; transition-delay: .5s; }
.ov-ring .now { stroke: var(--canvas); }
.ov-ring-lbl { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.ov-ring-lbl span { font-family: var(--f-serif); font-size: var(--t-2xl); }
.ov-ring-lbl small { font-size: var(--fs-xs); color: rgba(255, 255, 255, .72); line-height: 1.3; margin-top: 2px; }

.sw { display: inline-block; width: 9px; height: 9px; vertical-align: -1px; margin: 0 3px 0 8px; }
.sw-ev { background: var(--ink); } .sw-cash { background: var(--c-teal-600); }
.ov-rank { list-style: none; margin: 0 0 10px; padding: 0; }
.ov-rank li { display: grid; grid-template-columns: minmax(170px, 34%) 1fr 70px; gap: 12px; align-items: center;
  padding: 7px 0; border-bottom: 1px solid var(--rule-soft); }
.ov-rank li a { display: flex; gap: 10px; align-items: center; color: var(--ink); min-width: 0; }
.ov-rank li a:hover { text-decoration: none; color: var(--accent); }
.ov-rank .n { font-family: var(--f-serif); color: var(--muted-2); width: 18px; text-align: right; flex: none; }
.ov-rank .nm { font-size: var(--fs-base); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-rank .nm small { display: block; font-weight: 400; color: var(--muted); font-size: var(--fs-xs); }
.ov-rank .v { text-align: right; font-variant-numeric: tabular-nums; font-size: var(--fs-base); }
.ov-stack { display: flex; height: 12px; background: var(--rule-soft); }
.ov-stack span { display: block; height: 100%; width: 0; }
.ov-stack .ev { background: var(--ink); } .ov-stack .cash { background: var(--c-teal-600); }
.ov-rank li:hover .ov-stack .ev { background: var(--accent); }

.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; vertical-align: -1px; margin: 0 3px 0 8px; }
.dot-now { background: var(--ink); } .dot-tq { background: var(--canvas); border: 2px solid var(--c-good-700); }
.ov-dumb { display: flex; flex-direction: column; margin-bottom: 10px; }
.ov-dumb .row { display: grid; grid-template-columns: minmax(150px, 30%) 1fr 70px; gap: 12px; align-items: center;
  padding: 8px 0; border-bottom: 1px solid var(--rule-soft); }
.ov-dumb .lbl { font-size: var(--fs-base); font-weight: 600; }
.ov-dumb .lbl small { display: block; font-weight: 400; color: var(--muted); font-size: var(--fs-xs); }
.ov-dumb .trk { position: relative; height: 16px; background: linear-gradient(var(--rule-soft), var(--rule-soft)) center / 100% 2px no-repeat; }
.ov-dumb .seg { position: absolute; top: 6px; height: 4px; background: color-mix(in srgb, var(--bad) 45%, var(--canvas)); opacity: .8;
  left: min(var(--a), var(--b)); width: 0; transition: width 1s cubic-bezier(.2,.7,.2,1) calc(var(--i) * 70ms + 300ms); }
.ov-dumb .row:has(.v.pos) .seg { background: color-mix(in srgb, var(--c-good-700) 45%, var(--canvas)); }
.rv.in .ov-dumb .seg { width: max(calc(var(--b) - var(--a)), calc(var(--a) - var(--b))); }
.ov-dumb i { position: absolute; top: 2px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; left: 0;
  transition: left 1s cubic-bezier(.2,.7,.2,1) calc(var(--i) * 70ms + 150ms); }
.ov-dumb i.now { background: var(--ink); z-index: 1; }
.ov-dumb i.tq { background: var(--canvas); border: 2px solid var(--c-good-700); }
.rv.in .ov-dumb i { left: var(--x); }
.ov-dumb .v { text-align: right; font-size: var(--fs-base); font-variant-numeric: tabular-nums; font-weight: 700; }
.ov-dumb .v.neg { color: var(--bad); } .ov-dumb .v.pos { color: var(--c-good-700); }

@media (max-width: 1100px) { .ov-hero { grid-template-columns: 1fr; } .ov-ring { justify-self: start; } }
@media (max-width: 760px) {
  .ov-big { font-size: var(--t-3xl); }
  .ov-rank li, .ov-dumb .row { grid-template-columns: 1fr 70px; }
  .ov-stack, .ov-dumb .trk { grid-column: 1 / -1; grid-row: 2; }
}
@media (prefers-reduced-motion: reduce) { .ov-ring .arc, .ov-dumb i, .ov-dumb .seg { transition: none; } }

/* ==========================================================================
   Phones & small tablets: slide-in menu, compact top bar, nothing wider than the screen.
   ========================================================================== */
.nav-toggle, .sidenav-tools, .nav-backdrop { display: none; }
@media (max-width: 900px) {
  .topbar { padding: 0 12px; gap: 8px; justify-content: flex-start; }
  .nav-toggle {
    display: grid; place-items: center; width: 38px; height: 38px; flex-shrink: 0;
    border: 1px solid var(--rule); border-radius: var(--rad); background: var(--canvas); color: var(--ink);
    font-size: var(--t-xl); cursor: pointer;
  }
  .brand { min-width: 0; }
  .brand-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .brand-sub { display: none; }

  .sidenav {
    position: fixed; z-index: 45; top: var(--top-h); left: 0; bottom: 0; height: auto;
    width: min(320px, 86vw); overflow-y: auto; background: var(--canvas);
    transform: translateX(-105%); transition: transform 0.22s ease; box-shadow: 6px 0 24px rgba(5, 28, 44, 0.16);
    padding-top: 8px;
  }
  body.nav-open .sidenav { transform: none; }
  body.nav-open { overflow: hidden; }
  .nav-backdrop { display: block; position: fixed; inset: var(--top-h) 0 0 0; z-index: 44; background: var(--scrim); }
  .nav-backdrop[hidden] { display: none; }

  .sidenav-tools { display: block; padding: 6px 16px 12px; border-bottom: 1px solid var(--rule-soft); margin-bottom: 6px; }
  .sidenav-tools .topbar-right { flex-direction: column; align-items: stretch; gap: 8px; }
  .sidenav-tools .topbar-right form, .sidenav-tools .view-as select { width: 100%; min-width: 0; }
  .sidenav-tools .topbar-right .pill { justify-content: flex-start; }
  .sidenav-tools .topbar-right .btn { width: 100%; justify-content: center; }
  .sidenav a { padding: 11px 22px; }                          /* bigger tap targets */
  .sidenav .nav-items a { padding: 10px 22px; }

  .content { padding: 18px 16px 40px; }
  .viewas-banner { flex-direction: column; align-items: flex-start; }
  .page-head { flex-direction: column; align-items: stretch; gap: 12px; }
  .page-head h1 { font-size: var(--t-2xl); }

  /* Wide content scrolls inside its own box instead of widening the page. */
  table.t { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  pre, code { white-space: pre-wrap; overflow-wrap: anywhere; }
  img, svg, canvas, video { max-width: 100%; }
  select, input[type=text], input[type=search] { min-width: 0; max-width: 100%; }
  .filters { gap: 8px; }
  .filters > label, .filters > select, .filters > input { flex: 1 1 140px; min-width: 0; }
  .filters label select, .filters label input { flex: none; height: auto; }
  .filters label select, .filters label input { width: 100%; }
  .card-head { flex-wrap: wrap; row-gap: 4px; }
  .toast { left: 12px; right: 12px; bottom: 12px; max-width: none; }
  .chart-box.tall { height: 420px; }   /* room for a bottom legend on narrow screens */
  html, body { overflow-x: clip; }      /* safety net: a stray wide element never makes the page scroll sideways */
  h1 { overflow-wrap: anywhere; }
}

/* Phones: wide tables become one card per row (see BF.initStackTables). */
@media (max-width: 640px) {
  table.t.t-stack { display: block; overflow: visible; border: 0; }
  table.t.t-stack thead { display: none; }
  table.t.t-stack tbody, table.t.t-stack tfoot { display: flex; flex-direction: column; gap: 10px; }
  table.t.t-stack tfoot { margin-top: 10px; }
  table.t.t-stack tfoot tr { background: var(--panel); }
  table.t.t-stack tr { display: block; padding: 10px 12px; border: 1px solid var(--rule); background: var(--canvas); }
  table.t.t-stack tr:hover td { background: none; }
  table.t.t-stack :is(td, tfoot th) {
    display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
    padding: 5px 0; border: 0; border-bottom: 1px solid var(--rule-soft); text-align: right; white-space: normal;
    overflow-wrap: anywhere; min-width: 0;
  }
  table.t.t-stack :is(td, tfoot th):last-child { border-bottom: 0; }
  table.t.t-stack :is(td, tfoot th)::before {
    content: attr(data-label); flex: 0 0 42%; text-align: left; color: var(--muted);
    font-size: var(--fs-xs); font-weight: 400; text-transform: none; letter-spacing: 0;
  }
  table.t.t-stack :is(td, tfoot th):not([data-label])::before { display: none; }
  table.t.t-stack :is(td, tfoot th):not([data-label]) { justify-content: flex-end; }
  /* the first column is usually the row's name: show it as the card title */
  table.t.t-stack :is(td, tfoot th):first-child { display: block; text-align: left; font-weight: 700; font-size: var(--fs-md); padding-top: 0; }
  table.t.t-stack :is(td, tfoot th):first-child::before { display: none; }
  table.t.t-stack :is(td, tfoot th):empty { display: none; }
  table.t.t-stack .td-v { min-width: 0; }
  table.t.t-stack .td-v > * + * { margin-left: 4px; }
  table.t.t-stack :is(td, tfoot th):first-child .td-v > * { display: block; margin-left: 0; }
  table.t.t-stack :is(td, tfoot th):has(> .td-v:empty) { display: none; }

  /* long tags (e.g. archetype names) wrap inside their card instead of running past it */
  .tag, .pill { white-space: normal; max-width: 100%; overflow-wrap: anywhere; }

  /* tiny annotation text is hard to read on a phone */
  .basis, .kpi-track, .lvl, .sidenav-foot, .nav-h { font-size: var(--fs-xs); }
  .t th { font-size: var(--fs-xs); }
}

/* ---------- Find a company (top bar) ---------- */
.co-find { position: relative; display: flex; align-items: center; }
.co-find > .bi { position: absolute; left: 10px; color: var(--muted-2); font-size: var(--fs-base); pointer-events: none; }
.co-find input { width: 210px; min-width: 0; height: 32px; padding: 0 var(--s-3) 0 30px; border-radius: var(--rad-sm); font-size: var(--t-xs); background: var(--panel); }
.co-find input:focus { background: var(--canvas); }
.co-find-list {
  position: absolute; z-index: 60; top: calc(100% + 6px); right: 0; width: 320px; max-height: 60vh; overflow-y: auto;
  margin: 0; padding: 4px; list-style: none; background: var(--canvas);
  border: 1px solid var(--rule); border-radius: var(--rad); box-shadow: var(--el-3);
}
.co-find-list[hidden], .co-find-list li[hidden] { display: none; }
.co-find-list a { display: flex; flex-direction: column; padding: var(--s-2) var(--s-3); border-radius: var(--rad-sm); color: var(--text); font-size: var(--t-xs); }
.co-find-list a span { font-size: var(--fs-xs); color: var(--muted); }
.co-find-list a:hover, .co-find-list a.active { background: var(--accent-soft); text-decoration: none; }
.pill-btn { cursor: pointer; font: inherit; font-size: var(--fs-xs); }
.pill-btn:hover { color: var(--accent); border-color: var(--accent); }
@media (max-width: 900px) {
  .co-find input { width: 100%; font-size: 16px; padding: 9px 12px 9px 30px; }   /* 16px: stops iOS zooming in */
  .co-find-list { position: static; width: auto; margin-top: 6px; box-shadow: none; max-height: 45vh; }
}

/* ---------- guided tour: quiet card, soft spotlight ---------- */
.tour-layer { position: fixed; inset: 0; z-index: 70; }
.tour-layer.dim { background: var(--scrim); backdrop-filter: blur(1.5px); }
.tour-spot {
  position: fixed; z-index: 71; pointer-events: none; border-radius: var(--rad-lg);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.95), 0 0 0 6px rgba(34, 81, 255, 0.28), 0 0 0 9999px var(--scrim);
  transition: left .28s cubic-bezier(.2,.8,.2,1), top .28s cubic-bezier(.2,.8,.2,1), width .28s cubic-bezier(.2,.8,.2,1), height .28s cubic-bezier(.2,.8,.2,1);
}
.tour-spot[hidden] { display: none; }
.tour-card {
  position: fixed; z-index: 72; width: min(340px, calc(100vw - 24px)); padding: 16px 18px 14px;
  background: var(--canvas); border-radius: var(--rad-lg); border: 1px solid rgba(5, 28, 44, 0.06);
  box-shadow: 0 1px 2px rgba(5, 28, 44, 0.06), 0 18px 48px -12px rgba(5, 28, 44, 0.28);
  font-family: var(--f-sans); color: var(--ink);
}
.tour-card.in { animation: tour-in .22s ease-out; }
@keyframes tour-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.tour-card.center { left: 50% !important; top: 50% !important; transform: translate(-50%, -50%); animation: none; }
.tour-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.tour-dots { display: flex; gap: 5px; }
.tour-dots i { width: 6px; height: 6px; border-radius: var(--rad-xs); background: var(--rule); transition: width .2s, background .2s; }
.tour-dots i.done { background: var(--accent-line); }
.tour-dots i.on { width: 18px; background: var(--accent); }
.tour-x {
  width: 26px; height: 26px; display: grid; place-items: center; margin: -4px -6px 0 0;
  border: 0; border-radius: 50%; background: none; color: var(--muted-2); cursor: pointer; font-size: var(--fs-base);
}
.tour-x:hover { background: var(--rule-soft); color: var(--ink); }
.tour-card h3 { font-family: var(--f-sans); font-size: var(--fs-lg); font-weight: 600; letter-spacing: -0.01em; margin: 0 0 6px; }
.tour-card p { margin: 0 0 16px; font-size: var(--fs-md); line-height: 1.55; color: var(--muted); }
.tour-actions { display: flex; align-items: center; gap: 6px; }
.tour-gap { flex: 1; }
.tour-link, .tour-back {
  border: 0; background: none; padding: 7px 10px; border-radius: var(--rad); cursor: pointer;
  font: inherit; font-size: var(--fs-base); color: var(--muted);
}
.tour-link { padding-left: 0; color: var(--muted-2); }
.tour-link:hover, .tour-back:hover { color: var(--ink); }
.tour-back:hover { background: var(--rule-soft); }
.tour-next {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border: 0; border-radius: var(--rad-pill);
  background: var(--ink); color: var(--on-dark); font: inherit; font-size: var(--fs-base); font-weight: 600; cursor: pointer;
  transition: background .15s, transform .15s;
}
.tour-next:hover { background: var(--accent); }
.tour-next:active { transform: scale(.97); }
.tour-next .bi { font-size: var(--fs-sm); }
.tour-card button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tour-card:focus { outline: none; }
.tour-card [hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { .tour-spot { transition: none; } .tour-card.in { animation: none; } }

/* ---------- Help (replays the tour): always in the top bar, on phones too ---------- */
.help-btn {
  display: inline-flex; align-items: center; gap: var(--s-2); flex-shrink: 0;
  height: 32px; padding: 0 var(--s-3);
  border: 1px solid var(--rule); border-radius: var(--rad-sm); background: var(--canvas);
  color: var(--text); font: inherit; font-size: var(--t-xs);
}
.help-btn i { color: var(--muted); font-size: var(--t-sm); }
.help-btn:hover { background: var(--panel); border-color: var(--c-n-300); }
.help-btn:hover i { color: var(--accent); }
@media (max-width: 900px) {
  .help-btn { padding: 0 var(--s-2); }
  .help-btn span { display: none; }
}
/* Laptop widths: keep the top bar on one line (brand, help, finder, switchers, sign out). */
.brand-text, .topbar-right .pill, .topbar-right .btn { white-space: nowrap; }
@media (min-width: 901px) and (max-width: 1500px) {
  .topbar { gap: 10px; padding: 0 16px; }
  .brand-sub { display: none; }
  .help-btn span, .ws-l { display: none; }
  .help-btn { padding: 0 var(--s-2); }
  .co-find input { width: 160px; }
  .topbar-right { gap: 6px; }
  .topbar-right .pill-muted:has(.bi-person-circle) { display: none; }   /* username is on the sign-out button's page anyway */
}

/* ==========================================================================
   Polish that applies everywhere: keyboard focus, numerals, text wrapping,
   selection, scrollbars and hover motion. No layout or colour changes.
   ========================================================================== */
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; overflow-x: clip; }
::selection { background: var(--accent-soft); color: var(--ink); }

/* a clear ring for keyboard users only (mouse clicks stay clean) */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn:focus-visible, .pill:focus-visible, .sidenav a:focus-visible { outline-offset: 1px; }

/* figures line up in tables, stat tiles and KPI cards */
table, .n, .stat .value, .value, .count, [class*="kpi"] b, [class*="kpi"] strong { font-variant-numeric: tabular-nums; }

/* balanced headings, no single-word last lines in prose */
h2, h3, h4 { text-wrap: balance; }   /* page titles and prose keep their natural wrapping */

/* consistent, quick hover transitions on interactive chrome */
a, .btn, .pill, .tag, .sidenav a, .nav-h, button {
  transition: color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}

/* thin, quiet scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--rule) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--rule); border-radius: var(--r-pill); border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background-color: var(--muted-2); }
*::-webkit-scrollbar-track { background: transparent; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ==================================================================================
   Investment thesis strip (.ts-*) — portfolio/_thesis_strip.html, above the 360.
   ----------------------------------------------------------------------------------
   The 360 answers "how is this business doing". This strip answers "is it doing what
   we bought it to do", which is the question a partner opens the page with — so it
   sits above the operating detail rather than inside a tab.

   It shares the tone scale with the Knowledge Hub's tower.css: standing is the only
   thing this product colour-codes, and a pillar has to look the same here as it does
   there. Both read --tone, which is set by the five .c-* classes the Python side
   returns, so neither stylesheet picks a colour of its own.
   ================================================================================== */
.ts {
  --tone: var(--ink-2); --tone-soft: var(--panel-2);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-6);
  padding: var(--s-5) var(--s-6); margin-bottom: var(--s-6);
  background: var(--canvas); border: 1px solid var(--rule);
  border-left: 3px solid var(--tone); border-radius: var(--rad-lg); box-shadow: var(--el-1);
}
.ts.c-good  { --tone: var(--c-good-700); --tone-soft: var(--c-good-50); }
.ts.c-warn  { --tone: var(--c-warn-700); --tone-soft: var(--c-warn-50); }
.ts.c-bad   { --tone: var(--c-bad-700);  --tone-soft: var(--c-bad-50); }
.ts .c-good { --tone: var(--c-good-700); --tone-soft: var(--c-good-50); }
.ts .c-warn { --tone: var(--c-warn-700); --tone-soft: var(--c-warn-50); }
.ts .c-bad  { --tone: var(--c-bad-700);  --tone-soft: var(--c-bad-50); }
.ts .c-muted { --tone: var(--muted); --tone-soft: var(--panel); }
.ts .c-ink  { --tone: var(--ink-2); --tone-soft: var(--panel-2); }

.ts-l { min-width: 0; }
.ts-k {
  display: block; margin-bottom: var(--s-2);
  font-size: var(--t-3xs); font-weight: var(--w-semi); text-transform: uppercase;
  letter-spacing: var(--track-label); color: var(--muted);
}
.ts-h h2 {
  margin: 0 0 var(--s-4); max-width: 82ch;
  font: var(--w-reg) var(--t-base)/var(--lh-read) var(--font-sans); color: var(--text);
}
.ts-e { display: flex; gap: var(--s-5); flex-wrap: wrap; }
.ts-e > span { font-size: var(--t-3xs); color: var(--muted); }
.ts-e b {
  display: block; font: var(--w-semi) var(--t-base)/1 var(--font-display);
  color: var(--ink); margin-bottom: 2px; font-variant-numeric: tabular-nums;
}

.ts-r { display: grid; gap: var(--s-3); justify-items: start; align-content: start; min-width: 200px; }
.ts-score { display: flex; align-items: baseline; gap: var(--s-2); }
.ts-score b {
  font: var(--w-reg) var(--t-3xl)/1 var(--font-display); letter-spacing: -0.03em; color: var(--tone);
}
.ts-score span {
  font-size: var(--t-2xs); font-weight: var(--w-semi); text-transform: uppercase;
  letter-spacing: var(--track-label); color: var(--tone);
}
.ts-p { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-1); }
.ts-p li {
  display: flex; align-items: baseline; gap: var(--s-3); justify-content: space-between;
  padding-left: var(--s-3); border-left: 2px solid var(--tone); min-width: 190px;
}
.ts-p-k { font-size: var(--t-2xs); color: var(--text-2); }
.ts-p-s {
  font-size: var(--t-3xs); font-weight: var(--w-semi); text-transform: uppercase;
  letter-spacing: var(--track-label); color: var(--tone);
}
.ts-a { display: flex; gap: var(--s-2); flex-wrap: wrap; margin-top: var(--s-2); }

.ts-ch {
  grid-column: 1 / -1; list-style: none; margin: 0; padding: var(--s-4) 0 0;
  border-top: 1px solid var(--rule-soft);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--s-4);
  align-items: start;
}
.ts-ch-k {
  grid-column: 1 / -1; font-size: var(--t-3xs); font-weight: var(--w-semi);
  text-transform: uppercase; letter-spacing: var(--track-label); color: var(--muted);
}
.ts-ch li:not(.ts-ch-k):not(.ts-ch-m) {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s-1) var(--s-2);
}
.ts-ch i { color: var(--tone); font-size: var(--t-2xs); }
.ts-ch b { font-size: var(--t-xs); font-weight: var(--w-med); line-height: var(--lh-snug); color: var(--ink); }
.ts-ch small { grid-column: 2; font-size: var(--t-3xs); line-height: var(--lh-snug); color: var(--muted); }
.ts-ch-m { align-self: end; font-size: var(--t-3xs); }

@media (max-width: 860px) {
  .ts { grid-template-columns: 1fr; gap: var(--s-5); padding: var(--s-5) var(--s-4); }
  .ts-r { min-width: 0; }
}
