:root {
  color-scheme: light;
  --page: #f4f7fc;
  --panel: #ffffff;
  --panel-deep: #f7faff;
  --lift: #eef4ff;
  --line: #dde6f4;
  --line-strong: #d2dff1;
  --text: #101c32;
  --muted: #4a5e7b;
  --soft: #576b88;
  --accent: #1454cc;
  --blue: #2567ef;
  --accent-tint: #eaf2ff;
  --accent-line: #cbdfff;
  --accent-strong: #0a46b8;
  --surface-soft: #f7faff;
  --primary: #1659df;
  --primary-text: #ffffff;
  --primary-hover: #124bc2;
  --blue-shadow: #236aea22;
  --demo-bg: #eff5ff;
  --demo-text: #2459a6;
  --demo-line: #d1e0f7;
  --green: #106846;
  --green-bg: #e8f8ef;
  --green-line: #bee6d3;
  --orange: #8e4800;
  --orange-bg: #fff5e7;
  --orange-line: #f3d3a7;
  --warning-fill: #c9762b;
  --red: #a3273a;
  --red-bg: #fff1f2;
  --red-line: #efc9d0;
  --cyan: #05668b;
  --cyan-bg: #e8f8ff;
  --cyan-line: #c4e5f1;
  --cyan-fill: #179bca;
  --green-fill: #11a884;
  --track: #e5edfa;
  --callout: #eff5ff;
  --focus-border: #89b4f7;
  --overlap-shadow: #15365e25;
  --modal-overlay: #19305472;
  --selection: #1659df;
  --chart-text: #536b90;
  --chart-grid: #dce7f6;
  --chart-gradient: #2779fa4a;
  --chart-guide: #73a1e5;
  --chart-point: #0d56d1;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #080c14;
  --panel: #101827;
  --panel-deep: #0d1522;
  --lift: #17253c;
  --line: #23324a;
  --line-strong: #304462;
  --text: #edf4ff;
  --muted: #afbed5;
  --soft: #889ab8;
  --accent: #7fbaff;
  --blue: #459cff;
  --accent-tint: #132947;
  --accent-line: #244871;
  --accent-strong: #a7d0ff;
  --surface-soft: #131d30;
  --primary: #66aaff;
  --primary-text: #081c37;
  --primary-hover: #87bdff;
  --blue-shadow: #267ff133;
  --demo-bg: #14243c;
  --demo-text: #b4d3fb;
  --demo-line: #304b6e;
  --green: #6be0af;
  --green-bg: #112b27;
  --green-line: #245648;
  --orange: #ffc679;
  --orange-bg: #30251a;
  --orange-line: #55412c;
  --warning-fill: #eab472;
  --red: #ffa2af;
  --red-bg: #2d1d25;
  --red-line: #66444a;
  --cyan: #87d7f5;
  --cyan-bg: #122a3a;
  --cyan-line: #284a5e;
  --cyan-fill: #56c0e8;
  --green-fill: #5ecea8;
  --track: #25364e;
  --callout: #112642;
  --focus-border: #486f9f;
  --overlap-shadow: #040810a8;
  --modal-overlay: #040912bc;
  --selection: #286fd9;
  --chart-text: #92a9c9;
  --chart-grid: #253752;
  --chart-gradient: #389bff70;
  --chart-guide: #5285c2;
  --chart-point: #d4e9ff;
}
:root {
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font: 16px/1.5 var(--sans);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--text); }
button, select, input { font: inherit; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
::selection { background: var(--selection); color: white; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
.skip-link { position: fixed; top: .5rem; left: .5rem; z-index: 10; transform: translateY(-150%); }
.skip-link:focus { transform: none; padding: .5rem; background: var(--panel); }
.icon, i[data-icon] { width: 18px; height: 18px; display: inline-flex; flex: 0 0 auto; vertical-align: middle; }
.icon svg, i[data-icon] svg { width: 100%; height: 100%; }
.mode-badge, .file-tag, .category, .status { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.mode-badge { border-radius: 999px; border: 1px solid var(--demo-line); color: var(--demo-text); background: var(--demo-bg); padding: 5px 10px; font-size: .78rem; }
.mode-badge > span, .status > span { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.mode-badge.live { color: var(--green); background: var(--green-bg); border-color: var(--green-line); }
#content:focus { outline: none; }
.eyebrow { margin: 0 0 6px; color: var(--accent); font: 650 .72rem/1.4 var(--mono); letter-spacing: .13em; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.85rem, 2.55vw, 2.5rem); line-height: 1.2; font-weight: 770; letter-spacing: -.045em; }
h2 { font-size: 1.1rem; line-height: 1.4; letter-spacing: -.02em; }
h3 { font-size: 1rem; }
.description { color: var(--muted); margin-top: 8px; font-size: .92rem; }
.actions { display: flex; flex-wrap: wrap; gap: 9px; }
.button { min-height: 39px; padding: 7px 13px; border: 1px solid transparent; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; width: fit-content; white-space: nowrap; font-size: .875rem; line-height: 1.4; font-weight: 650; }
.button.compact { min-height: 34px; padding: 5px 10px; }
.button.primary { color: var(--primary-text); background: var(--primary); border-color: var(--primary); box-shadow: 0 2px 10px var(--blue-shadow); }
.button.primary:hover { background: var(--primary-hover); }
.button.secondary { background: var(--surface-soft); border-color: var(--line-strong); color: var(--text); }
.button.secondary:hover { background: var(--lift); border-color: var(--line-strong); }
.button.text { color: var(--accent); background: transparent; padding-inline: 7px; }
.button.text:hover { background: var(--accent-tint); }
.button.icon-only { padding-inline: 9px; }
.button svg { width: 16px; height: 16px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
.panel-heading { display: flex; gap: 12px; align-items: start; justify-content: space-between; flex-wrap: wrap; }
.panel-intro { color: var(--muted); font-size: .84rem; margin-top: 4px; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.metric { padding: 13px 15px 12px; background: linear-gradient(135deg, var(--surface-soft), var(--panel) 72%); }
.metric-label { display: flex; justify-content: space-between; align-items: center; gap: 4px; color: var(--muted); font-size: .86rem; }
.metric-label .icon { color: var(--accent); width: 30px; height: 30px; background: var(--accent-tint); border: 1px solid var(--accent-line); border-radius: 8px; padding: 6px; }
.metric-value { font: 750 clamp(1.25rem, 2.2vw, 1.9rem)/1.21 var(--mono); margin: 3px 0 5px; overflow-wrap: anywhere; letter-spacing: -.06em; }
.metric-value small { font-size: .55em; letter-spacing: 0; color: var(--muted); margin-left: 5px; }
.metric-meta { color: var(--soft); font-size: .78rem; }
.overview-grid { display: grid; grid-template-columns: minmax(0, 2.3fr) minmax(230px, 1fr); gap: 14px; margin-bottom: 14px; }
.chart-panel { padding: 16px 17px 14px; }
.segmented { display: inline-flex; flex-wrap: nowrap; background: var(--page); border: 1px solid var(--line); padding: 3px; border-radius: 7px; }
.segmented button { border: 0; border-radius: 5px; color: var(--muted); font-size: .79rem; background: transparent; font-weight: 600; padding: 4px 8px; }
.segmented button:hover { color: var(--text); }
.segmented button[aria-pressed="true"] { background: var(--accent-tint); color: var(--accent-strong); }
.chart { display: grid; height: 168px; position: relative; margin-top: 9px; }
.chart canvas { display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; }
.chart-footer { display: flex; align-items: center; gap: 9px; justify-content: space-between; flex-wrap: wrap; font-size: .77rem; color: var(--soft); }
.legend { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.legend span { width: 15px; height: 3px; border-radius: 3px; background: var(--blue); }
.chart-tooltip { position: absolute; pointer-events: none; top: 0; right: 0; padding: 5px 10px; border: 1px solid var(--accent-line); color: var(--text); background: var(--callout); font: .78rem/1.5 var(--mono); border-radius: 7px; }
.source-panel { padding: 16px; display: flex; flex-direction: column; }
.category-stack { display: flex; min-height: 8px; gap: 3px; margin: 14px 0 9px; border-radius: 6px; overflow: hidden; background: var(--page); }
.category-stack span { height: 8px; flex-grow: 1; }
.category-legend { display: grid; gap: 6px; font-size: .83rem; }
.category-legend > div { display: flex; justify-content: space-between; gap: 4px; color: var(--muted); }
.category-legend strong { font: 600 .8rem var(--mono); color: var(--text); }
.source-tail { margin-top: auto; padding-top: 12px; }
.source-tail .button { margin-left: -6px; min-height: 28px; }
.file-tag, .category, .status { font-weight: 600; font-size: .78rem; line-height: 1.25; }
.category { padding: 4px 7px; border: 1px solid; border-radius: 5px; }
.color-politics { color: var(--accent-strong); background: var(--accent-tint); border-color: var(--accent-line); }
.color-crypto { color: var(--cyan); background: var(--cyan-bg); border-color: var(--cyan-line); }
.color-sports { color: var(--green); background: var(--green-bg); border-color: var(--green-line); }
.color-other { color: var(--orange); background: var(--orange-bg); border-color: var(--orange-line); }
.dot { width: 8px; height: 8px; display: inline-block; margin-right: 7px; border-radius: 50%; }
.dot-politics { background: var(--blue); }
.dot-crypto { background: var(--cyan-fill); }
.dot-sports { background: var(--green-fill); }
.dot-other { background: var(--orange); }
.table-panel { overflow: hidden; }
.table-panel .panel-heading, .table-filter, .table-bottom { padding: 13px 16px; }
.table-panel .panel-heading { align-items: center; }
.table-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; border-top: 1px solid var(--line); }
.field, select, input:not([type="checkbox"]) { background: var(--panel-deep); color: var(--text); border: 1px solid var(--line-strong); border-radius: 7px; min-height: 37px; padding: 6px 10px; min-width: 0; font-size: .88rem; }
.field { display: flex; gap: 7px; align-items: center; flex: 1 1 190px; color: var(--soft); }
.field:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.field input:not([type="checkbox"]) { border: 0; background: transparent; padding: 0; min-height: 22px; flex: 1; width: 100%; outline: 0; }
input::placeholder { color: var(--soft); }
.select { position: relative; display: inline-flex; }
.select select { appearance: none; padding-right: 31px; width: 100%; }
.select .icon { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--muted); width: 14px; height: 14px; }
.table-scroll { overflow: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; white-space: nowrap; font-size: .875rem; }
th { color: var(--muted); background: var(--panel-deep); font-weight: 550; }
td, th { padding: 10px 13px; border-top: 1px solid var(--line); }
td:first-child, th:first-child { padding-left: 16px; }
td:last-child, th:last-child { padding-right: 16px; }
tbody tr:hover { background: var(--lift); }
.table-title { color: var(--text); font-weight: 620; }
.table-sub { display: block; font-size: .755rem; color: var(--soft); margin-top: 2px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.file-tag { color: var(--accent-strong); font-family: var(--mono); }
.status.ready { color: var(--green); }
.status.partial, .status.queued { color: var(--orange); }
.status.failed { color: var(--red); }
.status.running { color: var(--accent); }
.status.cancelled { color: var(--muted); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.row-actions .button { height: 30px; min-height: auto; }
.table-bottom { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; }
.pagination { display: flex; gap: 7px; align-items: center; }
.pagination button { min-height: 30px; }
.notice { border: 1px solid var(--accent-line); background: var(--callout); color: var(--accent-strong); padding: 10px 13px; border-radius: 7px; font-size: .88rem; display: flex; align-items: center; gap: 9px; }
.notice a { text-decoration: underline; }
.notice.warn { border-color: var(--red-line); background: var(--red-bg); color: var(--red); }
.coverage .chart { height: 240px; }
.coverage .overview-grid { margin-bottom: 16px; }
.progress-track { height: 6px; background: var(--track); border-radius: 6px; overflow: hidden; min-width: 80px; }
.progress-track span { display: block; height: 100%; background: var(--blue); border-radius: inherit; }
.progress-track span.partial { background: var(--warning-fill); }
.analysis-grid { display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); gap: 14px; margin-top: 14px; align-items: start; }
.analysis-panel, .docs-panel { padding: 17px; }
.form { display: grid; gap: 14px; margin-top: 14px; }
.form label { display: grid; gap: 6px; min-width: 0; font-size: .875rem; color: var(--muted); }
.form .select { width: 100%; }
.form-split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-note, .small { color: var(--muted); font-size: .82rem; }
.job-list { display: grid; margin-top: 13px; gap: 8px; }
.job-list button { background: var(--panel-deep); border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; display: flex; justify-content: space-between; align-items: center; gap: 8px; text-align: left; color: var(--text); }
.job-list button:hover, .job-list button[aria-pressed="true"] { border-color: var(--focus-border); }
.job-detail { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.job-detail .table-scroll { margin: 10px -16px 0; }
.job-summary { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.empty { padding: 27px 16px; color: var(--muted); text-align: center; }
.docs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.docs-panel > * + * { margin-top: 10px; }
.docs-panel p { color: var(--muted); }
.docs-panel a { color: var(--accent); text-decoration: underline; }
pre, code { font-family: var(--mono); }
pre { color: var(--accent-strong); white-space: pre; overflow: auto; padding: 13px; background: var(--panel-deep); border: 1px solid var(--line); border-radius: 7px; font-size: .82rem; margin-bottom: 0; }
.separator { width: 3px; height: 3px; margin: 0 5px 3px; border-radius: 50%; background: var(--soft); display: inline-block; }
dialog { padding: 0; width: min(94vw, 580px); max-height: 88dvh; color: var(--text); background: var(--panel); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: 0 20px 95px var(--overlap-shadow); }
dialog::backdrop { background: var(--modal-overlay); backdrop-filter: blur(3px); }
.dialog-inner { padding: 19px; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.manifest { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 12px; margin: 16px 0; font-size: .88rem; }
.manifest dt { color: var(--muted); }
.manifest dd { margin: 0; overflow-wrap: anywhere; }
.toast { position: fixed; bottom: 22px; right: 28px; z-index: 5; background: var(--callout); border: 1px solid var(--focus-border); color: var(--accent-strong); padding: 10px 15px; border-radius: 7px; box-shadow: 0 5px 24px var(--overlap-shadow); }
.loading { display: flex; justify-content: center; align-items: center; gap: 9px; color: var(--muted); padding: 65px 10px; }
.loader { width: 17px; height: 17px; border-radius: 50%; border: 2px solid var(--track); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 640px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .metric { padding: 10px; }
  .metric-value { font-size: 1.42rem; }
  .overview-grid, .analysis-grid, .docs-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .table-filter, .table-panel .panel-heading, .table-bottom { padding-inline: 10px; }
  .field { flex-basis: 100%; }
  .chart-panel { padding-inline: 11px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; } }
svg.category-stack { width: 100%; height: 9px; display: block; }
.stack-politics { fill: var(--blue); }
.stack-crypto { fill: var(--cyan-fill); }
.stack-sports { fill: var(--green-fill); }
.stack-other { fill: var(--orange); }
.coverage-table { margin-top: 14px; }
.progress-cell { display: flex; align-items: center; gap: 8px; }
.progress-cell progress { width: min(90px, 16vw); height: 7px; appearance: none; border: 0; border-radius: 5px; background: var(--track); }
.progress-cell progress::-webkit-progress-bar { background: var(--track); border-radius: 5px; }
.progress-cell progress::-webkit-progress-value { background: var(--blue); border-radius: 5px; }
.progress-cell progress::-moz-progress-bar { background: var(--blue); border-radius: 5px; }
.progress-cell progress.partial::-webkit-progress-value { background: var(--warning-fill); }
.progress-cell progress.partial::-moz-progress-bar { background: var(--warning-fill); }
.dialog-actions { margin-top: 14px; }
.result-chart-heading { display: flex; justify-content: space-between; gap: 8px; margin: 12px 0 2px; font-size: .85rem; }
.result-chart-heading span { color: var(--muted); font-size: .77rem; }
.result-chart { height: 130px; margin-top: 1px; }
.table-scroll { position: relative; }
@media (max-width: 640px) {
  .partition-table th, .partition-table td, .coverage-table th, .coverage-table td { padding-inline: 8px; }
  .partition-table th:nth-child(3), .partition-table td:nth-child(3),
  .partition-table th:nth-child(5), .partition-table td:nth-child(5),
  .partition-table th:nth-child(6), .partition-table td:nth-child(6),
  .coverage-table th:nth-child(4), .coverage-table td:nth-child(4), .progress-cell progress { display: none; }
  .partition-table .table-title { font-size: .8rem; }
  .row-actions { gap: 4px; }
  .row-actions .button { padding-inline: 7px; }
}
.mobile-size { display: none; }
@media (max-width: 430px) {
  .partition-table th:nth-child(4), .partition-table td:nth-child(4) { display: none; }
  .mobile-size { display: inline; }
}
.brand-symbol {
  display: inline-block;
  height: 36px;
  width: 36px;
  flex: 0 0 auto;
  background: var(--accent);
  mask: url("./icon.svg?v=stream") center / contain no-repeat;
}
.brand-symbol-small { height: 28px; width: 28px; }
