/* FinTopic -- one stylesheet for every page: the front page (app/home.js) and the server-rendered topic and
   theme pages (fintopic_scraper_lambda/topic_page.py, theme_page.py). Light by default, dark by preference or
   toggle. Sentiment is blue (bullish) / orange (bearish), always with a glyph -- never colour alone. */

@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
    src: url('/fintopic/fonts/inter-latin-wght-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: italic; font-weight: 100 900; font-display: swap;
    src: url('/fintopic/fonts/inter-latin-wght-italic.woff2') format('woff2'); }

:root {
    --bg: #fafaf7; --surface: #ffffff; --sunk: #f1f1ec;
    --ink: #15171c; --ink-2: #474d59; --ink-3: #737987; --line: #e4e4de; --line-2: #d3d3cc;
    --accent: #0b7a6f; --accent-ink: #075c54; --accent-soft: #e2f3f0;
    --bull: #1d5fc4; --bull-soft: #e5eefb; --bear: #c24309; --bear-soft: #fcebe1; --neu: #7c828e; --mix: #7a4fb8;
    --live: #0b7a6f; --spark: #9aa1ad; --spark-hot: #0b7a6f;
    --shadow: 0 1px 2px rgb(20 24 30 / 5%), 0 8px 24px rgb(20 24 30 / 6%);
    --radius: 10px; --wrap: 1280px;
    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
    --bg: #0e1116; --surface: #151a21; --sunk: #11151b;
    --ink: #e8ebf0; --ink-2: #aeb5c1; --ink-3: #8a93a1; --line: #2a2f36; --line-2: #3a424d;
    --accent: #4fc3b3; --accent-ink: #7fd8cb; --accent-soft: #15302d;
    --bull: #6ea8ff; --bull-soft: #16243a; --bear: #ff9152; --bear-soft: #3a2116; --neu: #8e97a4; --mix: #b491f0;
    --live: #4fc3b3; --spark: #5b6574; --spark-hot: #4fc3b3;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 25%);
    color-scheme: dark;
} }
:root[data-theme="dark"] {
    --bg: #0e1116; --surface: #151a21; --sunk: #11151b;
    --ink: #e8ebf0; --ink-2: #aeb5c1; --ink-3: #8a93a1; --line: #2a2f36; --line-2: #3a424d;
    --accent: #4fc3b3; --accent-ink: #7fd8cb; --accent-soft: #15302d;
    --bull: #6ea8ff; --bull-soft: #16243a; --bear: #ff9152; --bear-soft: #3a2116; --neu: #8e97a4; --mix: #b491f0;
    --live: #4fc3b3; --spark: #5b6574; --spark-hot: #4fc3b3;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 25%);
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 var(--font);
    font-feature-settings: 'cv11', 'ss01'; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, p { margin: 0; }
time, .rank, .slot-count, .tick { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -48px; background: var(--ink); color: var(--bg); padding: 8px 12px; border-radius: 6px; z-index: 50; }
.skip-link:focus { top: 12px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

/* ---- masthead ------------------------------------------------------------------------------------------ */
.masthead { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.masthead-row { display: flex; align-items: center; gap: 20px; height: 56px; }
.brand { font-weight: 750; font-size: 21px; letter-spacing: -0.03em; flex: none; }
.brand span { color: var(--accent); }
.brand i { font-style: normal; color: var(--accent); }
.theme-nav { flex: 1; min-width: 0; display: flex; gap: 4px; overflow: hidden; position: relative; }
.theme-nav a[hidden] { display: none; }
.theme-nav::-webkit-scrollbar { display: none; }
.theme-nav a { flex: none; font-size: 13px; font-weight: 500; color: var(--ink-2); padding: 6px 10px; border-radius: 999px; white-space: nowrap; }
.theme-nav a:hover { background: var(--sunk); color: var(--ink); }
.theme-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-ink); }
.theme-more { position: relative; flex: none; font-size: 13px; }
.theme-more summary { list-style: none; cursor: pointer; color: var(--ink-2); font-weight: 600; padding: 6px 10px; border-radius: 999px; white-space: nowrap; }
.theme-more summary::-webkit-details-marker { display: none; }
.theme-more[open] summary, .theme-more summary:hover { background: var(--sunk); color: var(--ink); }
.theme-menu { position: absolute; right: 0; top: calc(100% + 6px); width: 260px; max-height: 70vh; overflow: auto; background: var(--surface);
    border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px; display: grid; }
.theme-menu a { padding: 7px 10px; border-radius: 6px; color: var(--ink-2); }
.theme-menu a:hover, .theme-menu a[aria-current] { background: var(--sunk); color: var(--ink); }
.masthead-tools { display: flex; align-items: center; gap: 8px; flex: none; }
.search input { width: 180px; height: 34px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
    border-radius: 8px; padding: 0 10px; font: inherit; font-size: 14px; transition: width .2s ease, border-color .2s; }
.search input:focus { width: 240px; border-color: var(--accent); outline: none; }
.icon-button { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); cursor: pointer; font-size: 16px; }
.api-link { font-size: 13px; font-weight: 600; padding: 7px 12px; border-radius: 8px; background: var(--ink); color: var(--bg); }
.api-link:hover { color: var(--bg); opacity: .88; }

/* ---- front page ---------------------------------------------------------------------------------------- */
.status-line { color: var(--ink-3); font-size: 13px; padding: 14px 0 6px; }
.status-line .sent { font-weight: 600; }
.api-band { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 28px; margin: 4px 0 6px; padding: 10px 14px;
    border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); font-size: 13px; color: var(--ink-2); }
.api-band b { color: var(--ink); font-weight: 650; font-variant-numeric: tabular-nums; }
.api-band-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-right: 8px; }
.api-band p:nth-child(2) .api-band-label { color: var(--accent-ink); }
.api-band-link { margin-left: auto; font-weight: 600; color: var(--accent-ink); white-space: nowrap; }
.block { padding: 18px 0 8px; }
.block + .block { border-top: 1px solid var(--line); margin-top: 18px; }
.block-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.block-head h2 { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; display: flex; align-items: center; gap: 8px; }
.block-head p { color: var(--ink-3); font-size: 13px; }

.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--live); display: inline-block; box-shadow: 0 0 0 0 color-mix(in srgb, var(--live) 50%, transparent); animation: pulse 2.4s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--live) 45%, transparent); } 70%, 100% { box-shadow: 0 0 0 8px transparent; } }

.live-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.lead { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.lead-image { margin: 0; aspect-ratio: 21 / 9; background: var(--sunk); overflow: hidden; }
.lead-image img, .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity .35s ease; }
.lead-image.loaded img, .thumb.loaded img { opacity: 1; }
.lead-body { padding: 18px 20px 18px; }
.lead-chart { padding: 16px 16px 4px; border-bottom: 1px solid var(--line); background: var(--sunk); min-height: 170px; }
.lead-chart .growth figcaption { display: none; }
.lead:has(.lead-chart) .lead-foot .spark { display: none; }
.kicker { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-ink); display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.kicker .theme-tag { text-transform: none; letter-spacing: 0; font-weight: 600; }
.lead h2 { font-size: 28px; line-height: 1.15; letter-spacing: -0.02em; font-weight: 720; margin-bottom: 10px; text-wrap: balance; }
.lead .quotes { margin-top: 14px; }
.lead-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.open { font-size: 13px; font-weight: 600; color: var(--accent-ink); }

.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; color: var(--ink-3); font-size: 12.5px; }
.pile { display: inline-flex; align-items: center; gap: 6px; }
.pile.strong { color: var(--ink); font-weight: 600; }
.dots { display: inline-flex; }
.dot { width: 18px; height: 18px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 10px; font-weight: 700;
    color: #fff; background: hsl(var(--h) 45% 42%); border: 2px solid var(--surface); margin-left: -6px; }
.dot:first-child { margin-left: 0; }
.row .dot { border-color: var(--bg); }
.sent { font-weight: 600; white-space: nowrap; }
.sent.bullish { color: var(--bull); } .sent.bearish { color: var(--bear); } .sent.neutral { color: var(--neu); font-weight: 500; } .sent.mixed { color: var(--mix); }
.theme-tag { color: var(--ink-2); }
.theme-tag:hover { color: var(--accent-ink); }
.surge { font-size: 11.5px; font-weight: 700; color: var(--accent-ink); background: var(--accent-soft); padding: 1px 7px; border-radius: 999px; }

.quotes { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.quotes li { display: grid; grid-template-columns: 16px 1fr; column-gap: 8px; }
.quotes .q-glyph { font-size: 11px; line-height: 21px; color: var(--neu); }
.quotes li.bullish .q-glyph { color: var(--bull); } .quotes li.bearish .q-glyph { color: var(--bear); }
.quotes p { font-size: 14.5px; font-weight: 400; color: var(--ink); }
.quotes .q-src { grid-column: 2; font-size: 12px; color: var(--ink-3); }
.imp { color: var(--ink-2); font-weight: 600; }

.row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0 12px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: start; }
.row:last-child { border-bottom: 0; }
.rank { font-size: 12px; font-weight: 700; color: var(--ink-3); width: 18px; padding-top: 2px; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.rank .live-dot { width: 6px; height: 6px; }
.block-head p .live-dot { width: 6px; height: 6px; margin: 0 2px 1px 4px; vertical-align: middle; }
.row h3 { font-size: 15.5px; line-height: 1.3; font-weight: 600; letter-spacing: -0.005em; margin-bottom: 4px; text-wrap: pretty; }
.row-side { display: flex; align-items: center; gap: 8px; padding-top: 2px; }
.toggle { width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--line-2); background: transparent; color: var(--ink-2); cursor: pointer; font-size: 14px; line-height: 1; }
.toggle:hover { border-color: var(--accent); color: var(--accent-ink); }
.row.open { background: linear-gradient(90deg, transparent, var(--sunk) 8%, var(--sunk) 92%, transparent); }
.expand { padding: 10px 0 4px; display: grid; gap: 10px; }
.expand[hidden] { display: none; }   /* display: grid above would otherwise override the hidden attribute */
.expand:not([hidden]) { animation: reveal .18s ease-out; }
@keyframes reveal { from { opacity: 0; transform: translateY(-4px); } }
.thumb { margin: 2px 0 0; width: 64px; height: 64px; border-radius: 8px; overflow: hidden; background: var(--sunk); }

.spark { display: block; overflow: visible; }
.spark rect { fill: var(--spark); }
.spark rect:last-of-type { fill: var(--spark-hot); }
.spark-base { stroke: var(--line-2); stroke-width: 1; }

/* slots */
.day { margin-top: 6px; }
.day-head { font-size: 16px; font-weight: 700; display: flex; align-items: baseline; gap: 10px; padding: 10px 0; cursor: default; }
.day-head span { font-size: 12.5px; font-weight: 500; color: var(--ink-3); }
details.day > summary { cursor: pointer; list-style: none; border-top: 1px solid var(--line); }
details.day > summary::-webkit-details-marker { display: none; }
details.day > summary::before { content: '▸'; color: var(--ink-3); font-size: 12px; transition: transform .15s; }
details.day[open] > summary::before { transform: rotate(90deg); }
.slot-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 32px; align-items: start; }
.slot-col { display: flex; flex-direction: column; }
.in-progress { font-style: normal; font-weight: 600; font-size: 11px; color: var(--accent-ink); margin-left: 8px; margin-right: auto; }
.slot { break-inside: avoid; margin-bottom: 18px; }
.slot-head { font-size: 13px; font-weight: 700; display: flex; justify-content: space-between; align-items: baseline; padding: 8px 0 6px; border-bottom: 2px solid var(--ink); }
.slot-head small { color: var(--ink-3); font-weight: 500; font-size: 11px; }
.slot-count { font-size: 12px; }
.slot .row { grid-template-columns: auto minmax(0, 1fr) auto; }
.slot .row-side { grid-column: 3; }
.slot .row .spark { display: none; }
.slot .row { padding: 9px 0; }
.slot .row .meta { gap: 2px 10px; }
/* biztoc-style: a small thumbnail beside the slot's #1, never a banner. */
.row.has-thumb { grid-template-columns: auto minmax(0, 1fr) auto auto; }
.row .thumb { width: 72px; height: 48px; margin: 3px 0 0; border-radius: 6px; }
.slot .row.has-thumb { grid-template-columns: auto minmax(0, 1fr) auto auto; }
.slot .row.has-thumb .row-side { grid-column: 4; }
.slot .row h3 { font-size: 14.5px; }

/* themes */
.theme-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.theme-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.theme-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.theme-card .meta { margin-bottom: 8px; }
.theme-card ol { margin: 0; padding: 0; list-style: none; counter-reset: t; }
.theme-card li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 13.5px; font-weight: 500; }
.theme-card li span { color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.more-link { display: inline-block; margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--accent-ink); }

.flat-list { max-width: 860px; }
.flat-list .row { grid-template-columns: minmax(0, 1fr) auto; }
mark { background: color-mix(in srgb, var(--accent) 22%, transparent); color: inherit; border-radius: 3px; padding: 0 2px; }
.note { font-style: italic; }
.spark-empty { width: 0; }
.link-button { border: 0; background: none; color: var(--accent-ink); font: inherit; font-size: 13px; cursor: pointer; padding: 0; }
.empty { color: var(--ink-3); padding: 20px 0; }
.update-pill { position: fixed; left: 50%; top: 68px; transform: translateX(-50%); z-index: 30; border: 0; border-radius: 999px; padding: 8px 16px;
    background: var(--ink); color: var(--bg); font: 600 13px var(--font); box-shadow: var(--shadow); cursor: pointer; animation: reveal .2s ease-out; }

/* ---- topic and theme pages (markup from topic_page.py / theme_page.py) --------------------------------- */
.detail-breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--ink-3); padding: 18px 0 4px; }
.detail-breadcrumb a { color: var(--ink-2); }
.detail-breadcrumb [aria-current] { color: var(--ink); }
.topic-detail { max-width: 860px; padding: 8px 0 32px; }
#detail-container.with-rail { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; align-items: start; }
#detail-container.with-rail .topic-detail { max-width: none; }
.topic-rail { position: sticky; top: 72px; padding-top: 8px; display: grid; gap: 8px; }
.source-list, .rail-list { list-style: none; margin: 0; padding: 0; }
.source-list li { display: grid; grid-template-columns: 18px 1fr auto; gap: 8px; align-items: center; padding: 5px 0; font-size: 13.5px; border-bottom: 1px solid var(--line); }
.source-list .dot { margin: 0; border-color: var(--bg); }
.source-list b { font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.rail-list li { padding: 8px 0; border-bottom: 1px solid var(--line); display: grid; gap: 2px; }
.rail-list a { font-weight: 600; font-size: 14px; line-height: 1.3; }
.rail-list span { font-size: 12px; color: var(--ink-3); }
.section-label a { color: var(--accent-ink); }
.rail-caption { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--ink-3); margin-top: 4px; }
.topic-rail .spark { width: 100%; height: auto; }
.theme-rows { max-width: none; }
.detail-header { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.detail-heading { font-size: 34px; line-height: 1.12; letter-spacing: -0.025em; font-weight: 740; margin: 6px 0 12px; text-wrap: balance; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--ink-3); font-size: 13.5px; align-items: center; }
.theme-link { color: var(--accent-ink); font-weight: 600; }
.source-type-badge { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 2px 7px; border-radius: 5px; background: var(--sunk); color: var(--ink-2); margin-right: 4px; }
.topic-symbols { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.symbol-badge { font: 600 12px/1 ui-monospace, 'SF Mono', Menlo, monospace; padding: 5px 7px; border-radius: 5px; border: 1px solid var(--line-2); color: var(--ink-2); }
.topic-detail .close-button { display: none; }   /* the breadcrumb already goes home */
.close-button { flex: none; font-size: 13px; font-weight: 600; color: var(--ink-2); border: 1px solid var(--line-2); border-radius: 8px; padding: 7px 12px; }
.section-label { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin: 22px 0 8px; }
.growth { margin: 0; }
.growth svg { display: block; overflow: visible; }
.growth-mount { min-height: 150px; }
.growth .end-label { font-size: 12px; font-weight: 600; font-family: var(--font); }
.growth .end-label.statements { fill: var(--accent-ink); }
.growth .end-label.sources { fill: var(--bull); }
.gap-band rect { fill: url(#hatch); }
.gap-band text { fill: var(--ink-3); font-size: 11px; text-anchor: middle; font-family: var(--font); }
.hatch { stroke: var(--line-2); stroke-width: 2; }
.key-trend::before { border-top: 2px dashed var(--accent); }
.growth .axis { stroke: var(--line-2); }
.growth .tick, .growth .trend-mark text, .growth .gap { fill: var(--ink-3); font-size: 11px; font-family: var(--font); }
.growth .trend-mark text { text-anchor: middle; font-weight: 700; fill: var(--accent-ink); font-size: 10.5px; }
.growth .trend-mark line { stroke: var(--accent); stroke-dasharray: 2 3; opacity: .6; }
.growth-area { fill: color-mix(in srgb, var(--accent) 12%, transparent); }
.growth-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
.sources-line { fill: none; stroke: var(--bull); stroke-width: 1.5; stroke-dasharray: 4 3; }
.growth figcaption { font-size: 12px; color: var(--ink-3); margin-top: 2px; display: flex; flex-wrap: wrap; gap: 2px 14px; }
.growth figcaption:empty { display: none; }
.day-tick line { stroke: var(--line-2); }
.day-tick text { fill: var(--ink-3); font-size: 10.5px; text-anchor: middle; font-family: var(--font); }
.key::before { content: ''; display: inline-block; width: 14px; height: 0; border-top: 2px solid var(--accent); vertical-align: middle; margin-right: 6px; }
.key-sources::before { border-top: 2px dashed var(--bull); }
@media (prefers-reduced-motion: no-preference) {
    .growth-line { stroke-dasharray: 3000; stroke-dashoffset: 3000; animation: draw 1.1s ease-out forwards; }
    @keyframes draw { to { stroke-dashoffset: 0; } }
}

.statement-list-heading, .theme-topics h2, .theme-latest h2, .theme-related h2 { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin: 26px 0 6px; }
.statement-list { list-style: none; margin: 0; padding: 0; }
.statement-item { position: relative; padding: 12px 0 12px 18px; border-bottom: 1px solid var(--line); }
.statement-item::before { content: ''; position: absolute; left: 0; top: 16px; bottom: 16px; width: 3px; border-radius: 2px; background: var(--neu); opacity: .5; }
.statement-item.bullish::before { background: var(--bull); opacity: 1; } .statement-item.bearish::before { background: var(--bear); opacity: 1; }
/* The coloured bar already says the sentiment; the label stays for screen readers and the glyph moves onto
   the meta line, so each statement is text + one line. */
.statement-sentiment { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.statement-text { font-size: 16px; line-height: 1.5; margin: 0 0 4px; }
.statement-item.bullish .statement-meta::before { content: '▲'; color: var(--bull); font-size: 11px; }
.statement-item.bearish .statement-meta::before { content: '▼'; color: var(--bear); font-size: 11px; }
.heading-note { font-weight: 500; letter-spacing: 0; text-transform: none; }
.statement-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--ink-3); align-items: center; }
.statement-source { color: var(--accent-ink); font-weight: 600; }
.statement-source::after { content: ' ↗'; font-weight: 400; }
.statement-importance { color: var(--ink-2); font-weight: 600; }
.statement-meta time + .statement-importance::before { content: '· '; color: var(--ink-3); font-weight: 400; }
.same-fact { margin-top: 6px; }
.same-fact summary { font-size: 12.5px; color: var(--ink-2); cursor: pointer; font-weight: 500; }
.statement-list.nested { margin-top: 6px; }
.statement-list.nested .statement-item { padding-top: 8px; padding-bottom: 8px; }
.statement-list.nested .statement-item:last-child { border-bottom: 0; }

.theme-topic-list { list-style: none; margin: 0; padding: 0; }
.theme-topic-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 90px auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.theme-topic-name { font-weight: 600; }
.theme-topic-meta, .theme-topic-date { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }
.sentiment-label { margin-left: 8px; font-size: 12.5px; }
.sentiment-bar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: var(--sunk); min-width: 60px; }
.sentiment-segment.bullish { background: var(--bull); } .sentiment-segment.bearish { background: var(--bear); } .sentiment-segment.neutral { background: var(--neu); opacity: .5; }
.theme-single-mentions { margin-top: 10px; font-size: 14px; }
.theme-single-mentions summary { cursor: pointer; color: var(--ink-2); }
.theme-single-mentions ul, .theme-related ul { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.theme-related li { display: flex; justify-content: space-between; gap: 12px; }
.theme-latest .statement-item { padding-left: 18px; }

/* ---- footer -------------------------------------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 24px 0 40px; color: var(--ink-3); font-size: 13px; }
.footer-row { display: grid; gap: 10px; }
.footer-row p:first-child { color: var(--ink-2); max-width: 70ch; }
.footer-row nav { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-row nav a { color: var(--ink-2); font-weight: 500; }
.fine { font-size: 12px; }

/* ---- responsive ---------------------------------------------------------------------------------------- */
@media (max-width: 1100px) {
    .theme-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .slot-grid { display: flex; flex-direction: column; }
    .slot-col { display: contents; }
}
@media (max-width: 1000px) {
    #detail-container.with-rail { grid-template-columns: 1fr; gap: 0; }
    .topic-rail { position: static; }
}
@media (max-width: 860px) {
    .live-grid { grid-template-columns: 1fr; gap: 8px; }
    .api-link { display: none; }
}
@media (max-width: 640px) {
    .wrap { padding: 0 16px; }
    .masthead-row { flex-wrap: wrap; height: auto; padding-top: 10px; gap: 8px 12px; }
    .theme-nav { order: 3; flex-basis: 100%; margin: 0 -16px; padding: 0 16px 8px; overflow-x: auto; scrollbar-width: none; }
    .masthead { position: static; }
    .st-word { display: none; }
    .masthead-tools { margin-left: auto; }
    .search input { width: 120px; }
    .search input:focus { width: 170px; }
    .theme-more { display: none; }
    .masthead-row { flex-wrap: wrap; }
    .brand { margin-right: auto; }
    .st-extra { display: none; }
    .theme-grid { grid-template-columns: 1fr; }
    .lead { border-radius: 0; margin: 0 -16px; border-left: 0; border-right: 0; }
    .lead h2 { font-size: 23px; }
    /* A phone's first screen is for headlines: a short lead, one quote, one meta line per row. */
    .lead-image { aspect-ratio: 3 / 1; }
    .lead .quotes li:nth-child(n+2) { display: none; }
    .lead-body { padding: 14px 16px; }
    .row { padding: 8px 0; }
    .row .meta .theme-tag, .row .meta time { display: none; }
    .row h3 { font-size: 15px; margin-bottom: 2px; }
    .theme-card li:nth-child(n+4) { display: none; }
    .block-head p { display: none; }
    .row { grid-template-columns: auto minmax(0, 1fr) auto; }
    .row .spark { display: none; }
    .detail-heading { font-size: 26px; }
    .detail-header { flex-direction: column; }
    .theme-topic-row { grid-template-columns: minmax(0, 1fr) auto; }
    .theme-topic-row .sentiment-bar, .theme-topic-row .theme-topic-date { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
