/* Tokens. Wispr Flow's palette, read from the variables in wisprflow.ai's stylesheet on 2026-10-12:
   lumen #ffffeb, lumen-dark #e4e4d0, vast #1a1a1a, fathom #034f46, dawn #f0d7ff, flare #ff6c4c,
   glow #ffa946, pulse #7f1c34, signal #ffbcf2. Shades not in that list are derived from them.
   Light and dark are composed separately, not inverted. */
:root {
  color-scheme: light;
  --font-sans: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --font-serif: "EB Garamond", "Iowan Old Style", Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --hero: #034f46; --ink: #1a1a1a; --cream: #ffffeb; --dawn: #f0d7ff;
  --page: #ffffeb; --surface: #f8f8e0; --raised: #fffff7; --border: #e4e4d0; --border-strong: #c9c9b3;
  --text-1: #1a1a1a; --text-2: #3a3a36; --text-3: #5c5c54; --text-4: #a8a898;
  --brand: #034f46; --mark: #034f46; --accent: #1a1a1a; --accent-soft: #eeeed6; --on-accent: #ffffeb; --focus: #034f46;
  --praise: #1f7a6c; --good: #8fc0a9; --request: #8a5fc2; --bad: #d977b8; --nonsense: #8a8a7c; --complaint: #c2364f;
  --stars: #d98314; --sentiment: #4d65ff; --android: #2a9d8f; --ios: #ff6c4c; --volume: #444444; --neutral: #c9c9b3;
  --ramp-1: #c2364f; --ramp-2: #e3a3b0; --ramp-3: #d6d6c2; --ramp-4: #8fc0a9; --ramp-5: #1f7a6c;
  --seq-1: #4a2a73; --seq-2: #6d45a3; --seq-3: #8a5fc2; --seq-4: #ab87d8; --seq-5: #cbb0e8; --seq-6: #e6d7f5;
  --shadow: 0 16px 40px -18px rgba(26, 26, 26, 0.28);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #1a1a1a; --surface: #222220; --raised: #2b2b28; --border: #3a3a35; --border-strong: #55554d;
    --text-1: #ffffeb; --text-2: #d6d6c2; --text-3: #a3a394; --text-4: #66665c;
    --brand: #dcbcf7; --mark: #f0d7ff; --accent: #ffffeb; --accent-soft: #33332f; --on-accent: #1a1a1a; --focus: #f0d7ff;
    --praise: #4fb5a3; --good: #8fc0a9; --request: #b48fe6; --bad: #e895cc; --nonsense: #a3a394; --complaint: #f0738a;
    --stars: #ffa946; --sentiment: #8f9eff; --android: #4fb5a3; --ios: #ff6c4c; --volume: #d6d6c2; --neutral: #55554d;
    --ramp-1: #f0738a; --ramp-2: #96505c; --ramp-3: #55554d; --ramp-4: #3d7d70; --ramp-5: #4fb5a3;
    --seq-1: #e6d7f5; --seq-2: #cbb0e8; --seq-3: #ab87d8; --seq-4: #8a5fc2; --seq-5: #6d45a3; --seq-6: #55357f;
    --shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.6);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #1a1a1a; --surface: #222220; --raised: #2b2b28; --border: #3a3a35; --border-strong: #55554d;
  --text-1: #ffffeb; --text-2: #d6d6c2; --text-3: #a3a394; --text-4: #66665c;
  --brand: #dcbcf7; --mark: #f0d7ff; --accent: #ffffeb; --accent-soft: #33332f; --on-accent: #1a1a1a; --focus: #f0d7ff;
  --praise: #4fb5a3; --good: #8fc0a9; --request: #b48fe6; --bad: #e895cc; --nonsense: #a3a394; --complaint: #f0738a;
  --stars: #ffa946; --sentiment: #8f9eff; --android: #4fb5a3; --ios: #ff6c4c; --volume: #d6d6c2; --neutral: #55554d;
  --ramp-1: #f0738a; --ramp-2: #96505c; --ramp-3: #55554d; --ramp-4: #3d7d70; --ramp-5: #4fb5a3;
  --seq-1: #e6d7f5; --seq-2: #cbb0e8; --seq-3: #ab87d8; --seq-4: #8a5fc2; --seq-5: #6d45a3; --seq-6: #55357f;
  --shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.6);
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-color: var(--border-strong) transparent; }
body { margin: 0; background: var(--page); color: var(--text-2); font: 400 14px/22px var(--font-sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
::selection { background: var(--dawn); color: var(--ink); }
h1, h2, h3, h4, p, ul, ol { margin: 0; }
h1, h2, h3, h4 { color: var(--text-1); font-weight: 600; text-wrap: balance; }
h1 { font: 500 52px/54px var(--font-serif); letter-spacing: -0.02em; }
h2 { font: 500 28px/32px var(--font-serif); letter-spacing: -0.01em; }
h3 { font-size: 14px; line-height: 20px; }
h4 { font-size: 13px; line-height: 20px; }
ul, ol { padding: 0; list-style: none; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.num { font-family: var(--font-mono); font-weight: 500; font-variant-numeric: tabular-nums; }
.muted { color: var(--text-3); }
.note { color: var(--text-3); font-size: 12px; line-height: 16px; }
.error { color: var(--text-1); padding: 24px; border: 1px solid var(--complaint); border-radius: 12px; background: var(--surface); }
.icon { width: 16px; height: 16px; flex: none; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }
.with-dot { display: inline-flex; align-items: center; gap: 8px; }
.shell { width: min(1280px, 100% - 48px); margin-inline: auto; }
.skip { position: absolute; left: 16px; top: -60px; background: var(--ink); color: var(--cream); padding: 8px 14px; border-radius: 8px; z-index: 50; }
.skip:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }

/* Controls */
button, .button, select, input { font: 500 13px/18px var(--font-sans); color: var(--text-1); }
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; padding: 8px 14px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--raised); cursor: pointer; text-decoration: none; transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 160ms var(--ease-out); }
button:active:not(:disabled), .button:active { transform: scale(0.97); }
.button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
button:disabled { color: var(--text-4); cursor: not-allowed; background: transparent; border-color: var(--border); }
select, input[type="search"], input[type="date"] { min-height: 40px; width: 100%; padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--raised); caret-color: var(--mark); transition: border-color 150ms ease; }
input::placeholder { color: var(--text-3); }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); }
.field { display: grid; gap: 6px; }
.field > span { color: var(--text-3); font-size: 12px; line-height: 16px; font-weight: 500; }
@media (hover: hover) and (pointer: fine) {
  button:hover:not(:disabled), .button:hover { background: var(--accent-soft); border-color: var(--text-3); }
  .button.primary:hover { background: color-mix(in srgb, var(--accent) 86%, var(--page)); border-color: transparent; }
  select:hover, input[type="search"]:hover, input[type="date"]:hover { border-color: var(--text-3); }
}

/* Masthead: the deep-green field that says whose product this is about */
.masthead { background: var(--hero); color: var(--cream); }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 52px 0 36px; flex-wrap: wrap; }
.masthead h1 { color: var(--cream); }
.subtitle { color: var(--cream); margin-top: 12px; font-size: 15px; line-height: 22px; font-weight: 500; }
.byline { color: color-mix(in srgb, var(--cream) 82%, var(--hero)); margin-top: 4px; font-size: 13px; line-height: 20px; }
.byline strong { color: var(--cream); font-weight: 600; }
.byline a { color: var(--cream); font-weight: 500; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--cream) 45%, transparent); text-underline-offset: 3px; transition: text-decoration-color 150ms ease; }
.header-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.masthead .button { background: var(--cream); border-color: var(--cream); color: var(--ink); }
.masthead #theme { background: transparent; border-color: color-mix(in srgb, var(--cream) 55%, transparent); color: var(--cream); }
.masthead :focus-visible { outline-color: var(--dawn); }
.masthead ::selection { background: var(--cream); color: var(--ink); }
@media (hover: hover) and (pointer: fine) {
  .byline a:hover { text-decoration-color: var(--cream); }
  .masthead .button:hover { background: var(--dawn); border-color: var(--dawn); }
  .masthead #theme:hover { background: color-mix(in srgb, var(--cream) 14%, transparent); border-color: var(--cream); }
}

/* Navigation */
.control-wrap { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--page) 90%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.controls { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0; min-height: 56px; flex-wrap: wrap; }
#tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; align-self: stretch; }
#tabs button { border: 0; border-radius: 0; background: transparent; color: var(--text-3); white-space: nowrap; min-height: 56px; padding: 8px 14px; box-shadow: inset 0 -2px 0 transparent; transition: color 150ms ease, box-shadow 150ms ease; }
#tabs button:active { transform: none; }
#tabs button[aria-selected="true"] { color: var(--text-1); font-weight: 600; box-shadow: inset 0 -2px 0 var(--mark); }
.segmented { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--raised); }
.segmented button { min-height: 30px; padding: 5px 12px; border: 0; border-radius: 7px; background: transparent; color: var(--text-3); }
.segmented button .num { font-size: 12px; color: var(--text-3); }
.segmented button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.segmented button[aria-pressed="true"] .num { color: var(--on-accent); opacity: 0.75; }
@media (hover: hover) and (pointer: fine) {
  #tabs button:hover { color: var(--text-1); background: transparent; }
  #tabs button:not([aria-selected="true"]):hover { box-shadow: inset 0 -2px 0 var(--border-strong); }
  .segmented button:not([aria-pressed="true"]):hover { color: var(--text-1); background: var(--accent-soft); }
  .segmented button[aria-pressed="true"]:hover { background: var(--accent); }
}
main { padding: 32px 0 80px; min-height: 60vh; }

/* Footer: near-black, the other bracket around the cream working area */
.footer-wrap { background: var(--ink); }
footer { padding: 40px 0 56px; color: #a8a898; font-size: 12px; line-height: 19px; display: grid; gap: 8px; }
footer p { max-width: 90ch; }
footer ::selection { background: var(--dawn); color: var(--ink); }

/* Layout */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; } .span-6 { grid-column: span 6; } .span-7 { grid-column: span 7; } .span-12 { grid-column: span 12; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 56px 0 16px; flex-wrap: wrap; }
.section-heading p { color: var(--text-3); font-size: 12px; }
.card, .chart-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; min-width: 0; }

/* Stat band: one surface, not six cards */
.stat-band { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 16px; }
.stat { padding: 20px; border-left: 1px solid var(--border); min-width: 0; }
.stat:first-child { border-left: 0; }
.stat > p:first-child { display: flex; align-items: center; color: var(--text-3); font-size: 12px; line-height: 16px; font-weight: 500; }
.stat-value { color: var(--text-1); font: 500 36px/40px var(--font-serif); letter-spacing: -0.02em; margin-top: 10px; font-variant-numeric: lining-nums; }
.stat-note { color: var(--text-3); font-size: 12px; line-height: 17px; margin-top: 8px; }

/* Key takeaways */
.key-points { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.key-point { display: flex; flex-direction: column; gap: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; min-width: 0; scroll-margin-top: 90px; transition: border-color 200ms ease, box-shadow 200ms ease; }
.key-point.highlight { border-color: var(--mark); box-shadow: 0 0 0 3px color-mix(in srgb, var(--mark) 28%, transparent); }
.key-point-index { color: var(--brand); font: 500 12px/16px var(--font-mono); font-variant-numeric: tabular-nums; }
.key-point h3 { font: 600 17px/23px var(--font-serif); letter-spacing: -0.005em; }
.key-point h3:focus { outline: none; }
.key-point > p:not(.key-point-index) { color: var(--text-2); font-size: 13px; line-height: 19px; }
.key-point > p.key-point-evidence { font-size: 12.5px; line-height: 19px; }
.key-point-link { margin-top: auto; padding-top: 8px; display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; color: var(--brand); font-size: 12.5px; font-weight: 500; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--brand) 40%, transparent); text-underline-offset: 3px; transition: text-decoration-color 150ms ease, color 150ms ease; }
.key-point-link .icon { width: 14px; height: 14px; }
.key-point-link.secondary { color: var(--text-2); font-weight: 400; text-decoration-color: color-mix(in srgb, var(--text-3) 50%, transparent); }
/* Next step disclosure, shared by takeaway cards and opportunity cards */
.next-step { background: var(--accent-soft); border-radius: 8px; padding: 8px 12px; margin-top: 4px; }
.next-step summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; color: var(--text-1); font-size: 12.5px; line-height: 18px; font-weight: 600; }
.next-step summary::-webkit-details-marker { display: none; }
.next-step summary .icon { width: 12px; height: 12px; color: var(--brand); transition: transform 180ms var(--ease-out); }
.next-step[open] summary .icon { transform: rotate(90deg); }
.next-step summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.next-step > p { color: var(--text-2); font-size: 12.5px; line-height: 19px; margin-top: 4px; }
.next-step > .key-point-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; }
.next-step > .key-point-link .icon { width: 13px; height: 13px; }
.opportunity .next-step > p { font-size: 13px; line-height: 19px; }
/* Start here, under the priority matrix */
.start-here { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin-top: 16px; }
.start-here h2 { font-size: 20px; line-height: 26px; }
.start-here > .muted { font-size: 12px; margin: 4px 0 12px; }
.start-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.start-head { color: var(--text-3); font-size: 12px; line-height: 16px; }
.start-head strong { color: var(--text-1); font-weight: 600; font-size: 13px; }
.start-items { color: var(--text-3); font-size: 13px; line-height: 20px; margin-top: 2px; }
.start-items a { color: var(--brand); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--brand) 40%, transparent); text-underline-offset: 3px; transition: text-decoration-color 150ms ease; }
.chart-takeaways { list-style: none; margin: 12px 0 0; padding: 10px 0 0; border-top: 1px solid var(--border); display: grid; gap: 4px; }
.chart-takeaway { color: var(--text-2); font-size: 12px; line-height: 17px; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--text-3) 50%, transparent); text-underline-offset: 3px; transition: text-decoration-color 150ms ease, color 150ms ease; }
.chart-takeaway::before { content: "↑ "; color: var(--text-3); text-decoration: none; }
@media (hover: hover) and (pointer: fine) {
  .key-point-link:hover, .start-items a:hover { text-decoration-color: var(--brand); }
  .key-point-link.secondary:hover, .chart-takeaway:hover { color: var(--brand); text-decoration-color: var(--brand); }
}

/* Charts */
.chart-card { display: flex; flex-direction: column; scroll-margin-top: 90px; transition: border-color 200ms ease, box-shadow 200ms ease; }
.chart-card.highlight { border-color: var(--mark); box-shadow: 0 0 0 3px color-mix(in srgb, var(--mark) 28%, transparent); }
.chart-card h3 { font-size: 15px; line-height: 21px; }
.chart-card h3:focus { outline: none; }
.chart-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.chart-header p { color: var(--text-3); font-size: 12px; line-height: 18px; margin-top: 4px; max-width: 72ch; }
.table-toggle { min-height: 28px; padding: 4px 10px; font-size: 12px; color: var(--text-2); border-radius: 7px; white-space: nowrap; flex: none; }
.chart-body { min-width: 0; flex: 1; display: grid; align-content: center; }
.chart-body.split.stacked { grid-template-columns: 1fr; gap: 18px; }
.chart-wrap { position: relative; min-width: 0; }
.chart-body.split { grid-template-columns: minmax(150px, 0.8fr) minmax(0, 1fr); gap: 20px; align-items: center; }
.legend-list { display: grid; gap: 2px; font-size: 12px; line-height: 16px; }
.legend-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto 38px; gap: 10px; align-items: center; padding: 6px 0; border-top: 1px solid var(--border); }
.legend-list li:first-child { border-top: 0; }
.legend-name { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); min-width: 0; }
.legend-list .num { color: var(--text-1); text-align: right; }
.legend-list .share { color: var(--text-3); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--text-3); font-size: 12px; font-weight: 500; padding: 8px 10px 8px 0; border-bottom: 1px solid var(--border-strong); white-space: nowrap; }
td { padding: 9px 10px 9px 0; border-bottom: 1px solid var(--border); color: var(--text-2); vertical-align: middle; }
td.num { color: var(--text-1); text-align: right; white-space: nowrap; }
th:not(:first-child) { text-align: right; }
tr:last-child td { border-bottom: 0; }
.meter-table td.muted { color: var(--text-3); }
.meter-table td:nth-child(2) { width: 42%; }
.meter { display: block; height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; min-width: 60px; flex: 1; }
.meter-fill { display: block; height: 100%; border-radius: 3px; background: var(--complaint); }
.meter-row { display: flex; align-items: center; gap: 10px; color: var(--text-3); font-size: 12px; }
.meter-row .num { color: var(--text-1); }

/* Opportunities */
.evidence { color: var(--text-2); font-size: 13px; line-height: 20px; padding: 12px 16px; border-radius: 10px; background: var(--accent-soft); margin-bottom: 16px; max-width: 92ch; }
.opportunity-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.opportunity { display: flex; flex-direction: column; gap: 12px; position: relative; scroll-margin-top: 90px; transition: border-color 200ms ease, box-shadow 200ms ease; }
.opportunity.fix { --tone: var(--complaint); } .opportunity.explore, .opportunity.request { --tone: var(--request); } .opportunity.strength { --tone: var(--praise); }
.opportunity.few { opacity: 0.6; }
.opportunity.highlight { border-color: var(--mark); box-shadow: 0 0 0 3px color-mix(in srgb, var(--mark) 28%, transparent); }
.opportunity h3 { font: 600 17px/23px var(--font-serif); }
.opp-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.tag { display: inline-flex; align-items: center; gap: 6px; color: var(--text-1); font-size: 12px; line-height: 16px; font-weight: 600; padding: 4px 10px 4px 8px; border-radius: 999px; background: color-mix(in srgb, var(--tone) 24%, transparent); }
.tag .icon { width: 14px; height: 14px; }
.opp-count { display: grid; justify-items: end; color: var(--text-3); font-size: 11px; line-height: 14px; }
.opp-count .num { color: var(--text-1); font: 500 30px/32px var(--font-serif); letter-spacing: -0.02em; font-variant-numeric: lining-nums; }
.opp-desc { color: var(--text-2); font-size: 13px; line-height: 20px; flex: 1; }
.few-note { color: var(--text-3); font-size: 12px; }
.opp-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 12px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.opp-foot .split { display: flex; gap: 14px; color: var(--text-3); font-size: 12px; font-family: var(--font-mono); }
.see { min-height: 30px; padding: 5px 10px; font-size: 12px; }
.rank-list { display: grid; gap: 14px; counter-reset: rank; }
.rank-list li { display: grid; gap: 6px; }
.rank-line { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.link { border: 0; background: none; padding: 0; min-height: 0; color: var(--text-1); text-align: left; justify-content: flex-start; text-decoration: underline; text-decoration-color: var(--text-4); text-underline-offset: 3px; transition: text-decoration-color 150ms ease; }
.link:active { transform: none; }
@media (hover: hover) and (pointer: fine) { .link:hover:not(:disabled) { background: none; text-decoration-color: var(--mark); } }

/* Deep dive */
.deep-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 24px; align-items: start; }
.sidebar { position: sticky; top: 76px; display: grid; gap: 12px; max-height: calc(100vh - 96px); overflow-y: auto; scrollbar-width: thin; padding-right: 4px; }
.sidebar .segmented { display: grid; grid-template-columns: 1fr 1fr; }
.sidebar .sidebar-select { display: none; }
.sidebar-list { display: grid; gap: 2px; }
.sidebar-list button { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; justify-content: stretch; text-align: left; border-color: transparent; background: transparent; color: var(--text-2); font-weight: 400; padding: 8px 10px; min-height: 0; }
.sidebar-list button:active { transform: none; }
.sidebar-list button[aria-pressed="true"] { background: var(--accent-soft); color: var(--text-1); font-weight: 600; }
.sidebar-list .num { color: var(--text-3); font-size: 12px; }
@media (hover: hover) and (pointer: fine) { .sidebar-list button:hover { background: var(--surface); border-color: transparent; } .sidebar-list button[aria-pressed="true"]:hover { background: var(--accent-soft); } }
.name-with-dot { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.segment-bar { display: flex; gap: 2px; height: 10px; border-radius: 5px; overflow: hidden; }
.segment-bar span { min-width: 2px; }
.segment-bar.mini { grid-column: 1 / -1; height: 3px; gap: 1px; margin-left: 16px; opacity: 0.9; }
.composition { display: grid; gap: 10px; margin: 16px 0 4px; }
.composition-key { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--text-3); font: 500 12px/16px var(--font-mono); }
.detail-header { display: grid; gap: 12px; margin-bottom: 16px; }
.detail-header h2 { font-size: 32px; line-height: 38px; letter-spacing: -0.015em; }
.detail-header h2:focus { outline: none; }
.detail-stats { display: flex; flex-wrap: wrap; gap: 6px 20px; color: var(--text-3); font: 500 12px/18px var(--font-mono); }
.takeaways { display: grid; gap: 8px; color: var(--text-2); max-width: 74ch; }
.takeaways li { padding-left: 16px; position: relative; }
.takeaways li::before { content: ""; position: absolute; left: 0; top: 10px; width: 6px; height: 1px; background: var(--mark); }
.related h3, .topics h3 { font-size: 12px; line-height: 16px; color: var(--text-3); font-weight: 500; margin-bottom: 8px; }
.topics { margin-bottom: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 3px 10px; border: 1px solid var(--border-strong); border-radius: 999px; background: transparent; color: var(--text-2); font-size: 12px; line-height: 16px; font-weight: 500; }
button.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
@media (hover: hover) and (pointer: fine) { button.chip:not([aria-pressed="true"]):hover { border-color: var(--text-3); background: var(--accent-soft); } button.chip[aria-pressed="true"]:hover { background: var(--accent); border-color: var(--accent); } }
.review-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin: 16px 0 12px; }
.review-toolbar .field { min-width: 150px; }

/* Reviews */
.filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; align-items: end; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin-bottom: 14px; }
.filters .field.search { grid-column: span 2; }
.filters > button { min-height: 40px; }
.checkbox { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; color: var(--text-2); font-size: 13px; }
.results-heading { margin: 24px 0 12px; font-size: 20px; line-height: 26px; }
.review-list { display: grid; gap: 10px; }
.review-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px 20px; display: grid; gap: 10px; }
.review-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; color: var(--text-3); font: 500 12px/16px var(--font-mono); }
.stars { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px 3px 6px; border-radius: 999px; color: var(--text-1); background: color-mix(in srgb, var(--band) 24%, transparent); }
.stars .icon { width: 12px; height: 12px; color: var(--band); }
.band-low { --band: var(--complaint); } .band-mid { --band: var(--text-3); } .band-high { --band: var(--praise); }
.badge { padding: 2px 8px; border: 1px solid var(--border-strong); border-radius: 6px; font-family: var(--font-sans); }
.review-language { font-family: var(--font-sans); }
.review-title { font: 600 16px/22px var(--font-serif); }
.review-text { color: var(--text-2); font-size: 14px; line-height: 23px; max-width: 74ch; overflow-wrap: anywhere; white-space: pre-line; }
.review-text.clamped { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.review-content { display: grid; gap: 8px; }
.review-actions { display: flex; gap: 6px; }
.review-actions:empty { display: none; }
.review-actions button, .review-content > button { min-height: 26px; padding: 3px 10px; font-size: 12px; color: var(--text-2); border-radius: 7px; justify-self: start; }
.flags { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--text-3); font-size: 12px; }
.flags span { display: inline-flex; align-items: center; gap: 6px; }
.flags span::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--text-4); }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; color: var(--text-3); font: 500 12px/16px var(--font-mono); flex-wrap: wrap; }
.pager .buttons { display: flex; gap: 6px; }
.empty { display: grid; gap: 12px; justify-items: start; padding: 28px; border: 1px dashed var(--border-strong); border-radius: 12px; color: var(--text-2); }

/* Drawer: enters from the edge it lives on, on the iOS-style drawer curve */
.backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(20, 20, 19, 0.5); display: flex; justify-content: flex-end; animation: fade-in 200ms ease; }
#drawer { width: min(720px, 100%); height: 100%; overflow-y: auto; background: var(--page); border-left: 1px solid var(--border); box-shadow: var(--shadow); padding: 0 24px 32px; animation: slide-in 280ms var(--ease-drawer); scrollbar-width: thin; }
@keyframes slide-in { from { transform: translateX(100%); } }
@keyframes fade-in { from { opacity: 0; } }
.drawer-header { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 0 14px; background: var(--page); border-bottom: 1px solid var(--border); margin-bottom: 16px; }
#drawer-content { display: grid; gap: 12px; }
#drawer-content > .segmented { justify-self: start; }
body.drawer-open { overflow: hidden; }

/* Loading */
.skeleton { height: 320px; border-radius: 12px; border: 1px solid var(--border); background: linear-gradient(100deg, var(--surface) 30%, var(--raised) 50%, var(--surface) 70%) 0 0 / 200% 100%; animation: shimmer 1.1s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Responsive */
@media (max-width: 1100px) {
  .span-4, .span-5, .span-6, .span-7 { grid-column: span 12; }
  .key-points { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-band { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat:nth-child(4) { border-left: 0; }
  .stat:nth-child(n+4) { border-top: 1px solid var(--border); }
}
@media (max-width: 639px) {
  .shell { width: calc(100% - 32px); }
  h1 { font-size: 32px; line-height: 36px; }
  h2 { font-size: 21px; line-height: 27px; }
  .page-header { padding: 32px 0 24px; }
  .section-heading { margin-top: 40px; }
  .stat-band { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { border-left: 0; border-top: 1px solid var(--border); padding: 14px 16px; }
  .stat:nth-child(-n+2) { border-top: 0; }
  .stat:nth-child(even) { border-left: 1px solid var(--border); }
  .stat-value { font-size: 28px; line-height: 32px; }
  .card, .chart-card, .key-point { padding: 16px; }
  .key-points { grid-template-columns: minmax(0, 1fr); }
  .chart-body.split { grid-template-columns: 1fr; }
  .chart-header { flex-wrap: wrap; }
  .deep-layout { grid-template-columns: 1fr; }
  .detail-header h2 { font-size: 26px; line-height: 32px; }
  .sidebar { position: static; max-height: none; }
  .sidebar .sidebar-select { display: grid; }
  .sidebar-list { display: none; }
  .filters .field.search { grid-column: 1 / -1; }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 14px; }
  #drawer { padding: 0 16px 24px; border-left: 0; }
  .controls { gap: 0 8px; padding-bottom: 8px; }
  #tabs button { min-height: 48px; padding: 8px 10px; }
  .segmented button { padding: 5px 9px; }
  .opportunity-grid { grid-template-columns: 1fr; }
}
/* Reduced motion keeps the fades that explain a change and drops movement. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  #drawer { animation: fade-in 200ms ease; }
  .skeleton { animation: none; }
  button:active:not(:disabled), .button:active { transform: none; }
  .next-step summary .icon { transition: none; }
}

/* Category links on charts: a real link over each row label, and linked names in the table view. */
.row-link { position: absolute; left: 0; display: block; border-radius: 6px; transition: background-color 150ms ease; }
.row-link:focus-visible { background: color-mix(in srgb, var(--mark) 18%, transparent); }
.table-wrap td a { color: var(--brand); font-weight: 500; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--brand) 40%, transparent); text-underline-offset: 3px; transition: text-decoration-color 150ms ease; }
@media (hover: hover) and (pointer: fine) {
  .row-link:hover { background: color-mix(in srgb, var(--mark) 18%, transparent); }
  .table-wrap td a:hover { text-decoration-color: var(--brand); }
}
