@font-face {
  font-family: Switzer;
  src: url('/fonts/Switzer-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --canvas: #ffffff;
  --surface: #ffffff;
  --ink: #18232f;
  --muted: #64717d;
  --line: #e1e5e9;
  --sidebar: #f6f7f9;
  --accent: #315cad;
  --accent-strong: #244d95;
  --accent-soft: #edf2fb;
  --green: #276341;
  --green-soft: #edf6f0;
  --amber: #805018;
  --amber-soft: #fff6e7;
  --red: #963f3f;
  --red-soft: #fcefee;
  --radius: 5px;
  --mono: 'SFMono-Regular', Consolas, monospace;
  font-family: Switzer, 'Helvetica Neue', sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
  font-optical-sizing: auto;
}

* { box-sizing: border-box; }
body { margin: 0; font-size: 14px; line-height: 1.5; }
button, input, select, textarea { font: inherit; color: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button:disabled { cursor: default; opacity: .55; }
button, a, input, select, summary { scroll-margin: 24px; }
:where(button, a, input, select, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: Switzer, sans-serif; }
h1 { font-size: 28px; line-height: 1.2; font-weight: 600; letter-spacing: -.7px; }
h2 { font-size: 18px; line-height: 1.35; font-weight: 600; letter-spacing: -.25px; }
h3 { font-size: 15px; line-height: 1.4; font-weight: 600; }
strong { font-weight: 600; }
svg { display: block; }
.icon {
  width: 18px; height: 18px; flex-shrink: 0;
  stroke: currentColor; stroke-width: 1.7; fill: none;
  stroke-linecap: round; stroke-linejoin: round;
}
.skip-link {
  position: fixed; top: -80px; left: 16px; z-index: 100;
  padding: 12px 16px; background: white; border: 1px solid var(--accent);
}
.skip-link:focus { top: 12px; }

/* Shared navigation and shell. */
.app-shell { display: grid; grid-template-columns: 184px minmax(0, 1fr); min-height: 100dvh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 40;
  width: 184px; display: flex; flex-direction: column;
  overflow-y: auto; padding: 24px 12px 20px;
  background: var(--sidebar); border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; padding: 0 4px 26px; }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 30px; height: 32px; color: var(--ink); background: transparent;
  font-size: 27px; line-height: 1; font-weight: 650; letter-spacing: -2px;
}
.brand-mark span { color: var(--accent); margin-left: 1px; }
.brand-name { font-size: 18px; font-weight: 600; letter-spacing: -.45px; white-space: nowrap; }
.brand-sub { color: var(--muted); font-size: 12px; letter-spacing: .25px; }
.nav-label { margin: 0 8px 12px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav button {
  display: flex; align-items: center; gap: 9px; width: 100%; min-height: 44px;
  padding: 10px 8px; border: 0; border-radius: var(--radius);
  text-align: left; background: transparent; color: var(--muted); font-size: 14px;
}
.nav button .icon { width: 17px; height: 17px; }
.nav button:hover { color: var(--ink); background: #eceff3; }
.nav button.active, .nav button[aria-current='page'] {
  color: var(--accent); background: #e8eef9; font-weight: 600;
}
.nav-count { margin-left: auto; padding: 1px 5px; border-radius: 3px; color: var(--accent); background: #e3eafa; font-size: 12px; }
.nav-separator { margin: 12px 8px; height: 1px; background: var(--line); }
.sidebar-bottom { margin-top: auto; padding: 32px 4px 0; }
.local-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; background: var(--green); }
.status-dot.warn { background: var(--amber); }
.status-dot.bad { background: var(--red); }
.sidebar-note { margin-top: 8px; font-size: 12px; line-height: 1.6; color: var(--muted); }
.partners { display: flex; align-items: center; gap: 8px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.avatar {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 30px; height: 30px; border-radius: 50%; background: #e8eef6;
  color: #355573; font-size: 12px; font-weight: 600;
}
.avatar.dm { background: #eeece5; color: #65583e; }
.avatar.rf { background: #e9efed; color: #48635a; }
.avatar.al { background: #f6eae3; color: #79513a; }
.partners .avatar + .avatar { margin-left: -17px; outline: 2px solid var(--sidebar); }
.partner-text { font-size: 12px; line-height: 1.45; }
.workarea { grid-column: 2; min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 56px; padding: 8px 32px; border-bottom: 1px solid var(--line); background: white;
}
.breadcrumb { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; min-width: 0; }
.breadcrumb strong { color: var(--ink); font-weight: 500; }
.breadcrumb .slash { color: var(--muted); }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.snapshot-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; max-width: 420px; }
.page { padding: 24px 32px 32px; max-width: 1600px; margin: 0 auto; min-width: 0; }
.page:focus { outline: none; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 16px; }
.eyebrow { color: var(--muted); font-size: 12px; font-weight: 500; letter-spacing: .35px; margin-bottom: 4px; }
.page-heading p { color: var(--muted); margin-top: 4px; max-width: 740px; font-size: 14px; }
.heading-aside { padding-top: 3px; }
.date-label { color: var(--muted); font-size: 12px; white-space: nowrap; }
.page-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px; margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.menu-toggle, .mobile-scrim { display: none; }

/* Controls share one restrained visual hierarchy. */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 36px; padding: 7px 12px; border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--ink); background: white; font-size: 13px; font-weight: 500;
  text-align: center; white-space: nowrap;
}
.button .icon { width: 16px; height: 16px; }
.button:hover { background: var(--sidebar); text-decoration: none; }
.button.primary { background: var(--accent-strong); border-color: var(--accent-strong); color: white; }
.button.primary:hover { background: #1c3f7c; }
.button.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.button.ghost:hover { background: var(--sidebar); color: var(--ink); }
.text-button { display: inline-flex; align-items: center; justify-content: flex-start; gap: 5px; padding: 2px 0; border: 0; background: transparent; color: var(--accent); font-size: 13px; font-weight: 500; }
.text-button:hover { text-decoration: underline; text-underline-offset: 3px; }
.small-link { display: inline-flex; align-items: center; gap: 5px; color: var(--accent); font-size: 13px; font-weight: 500; }
.small-link .icon { width: 14px; height: 14px; }
.filters, .board-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.filter-left { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; min-width: 0; }
.filter-caption { color: var(--muted); font-size: 12px; max-width: 530px; }
.segmented { display: inline-flex; flex-shrink: 0; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--sidebar); }
.segmented button { min-height: 30px; padding: 5px 12px; border: 0; border-radius: 3px; background: transparent; color: var(--muted); font-size: 13px; white-space: nowrap; }
.segmented button.active, .segmented button[aria-pressed='true'] { color: var(--accent); background: white; font-weight: 600; }
.segmented button:hover { color: var(--ink); }
.select { min-height: 36px; max-width: 100%; padding: 6px 28px 6px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: white; font-size: 13px; cursor: pointer; }
.search { display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 280px; min-height: 36px; padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: white; }
.search .icon { width: 16px; height: 16px; color: var(--muted); }
.search input { width: 100%; min-width: 0; border: 0; background: transparent; font-size: 13px; }
.search:focus-within { outline: 3px solid var(--accent); outline-offset: 3px; }
.search input:focus-visible { outline-offset: 4px; }
.sort-button { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: transparent; color: inherit; font-size: inherit; text-align: inherit; }
.sort-button:hover { color: var(--accent); }
.view-toggle { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 7px; border-radius: 3px; color: var(--green); background: var(--green-soft); font-size: 12px; font-weight: 500; line-height: 1.4; white-space: nowrap; }
.pill.warning { color: var(--amber); background: var(--amber-soft); }
.pill.error { color: var(--red); background: var(--red-soft); }
.pill.neutral { color: var(--muted); background: var(--sidebar); }

/* Overview: result first, then trend and ranking in the first screen. */
.overview-result { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 32px; align-items: center; padding: 4px 0 16px; margin-bottom: 16px; border-bottom: 1px solid var(--line); min-width: 0; }
.overview-result > * { min-width: 0; }
.overview-result .source-status-line { margin-bottom: 0; }
.overview-result--summary { padding-bottom: 12px; }
.result-title-line { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; }
.result-title-line h2 { margin: 0; }
.overview-result--summary .result-support { row-gap: 12px; }
.overview-result--summary .result-support .kpi-value { line-height: 1.15; }
.overview-result--summary .result-support .source-status-line { grid-column: 1 / -1; display: grid; gap: 4px; margin-top: 0; }
.result-value { display: block; margin-top: 8px; font-size: 44px; line-height: 1.1; font-weight: 600; letter-spacing: -1.2px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.result-value .unit { font-size: 16px; font-weight: 400; letter-spacing: 0; color: var(--muted); margin-left: 6px; }
.result-support { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; padding-left: 32px; border-left: 1px solid var(--line); min-width: 0; }
.result-support .kpi { padding: 0; border: 0; }
.result-support > article { min-width: 0; }
.result-support > article .metric-name { color: var(--muted); margin-bottom: 8px; font-size: 14px; }
.result-support > article > p { color: var(--muted); margin-top: 8px; font-size: 14px; }
.result-support .kpi-top { margin-bottom: 10px; }
.result-support .kpi-value { font-size: 30px; }
.result-support .kpi-source { border: 0; margin-top: 6px; padding: 0; }
.comparison { margin-top: 8px; font-size: 14px; color: var(--green); }
.comparison-unavailable { margin-top: 8px; font-size: 14px; color: var(--muted); }
.comparison small, .comparison-unavailable small { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.overview-split { display: grid; grid-template-columns: minmax(0, 60fr) minmax(0, 36fr); column-gap: 4%; align-items: start; margin-bottom: 32px; }
.overview-split > * { min-width: 0; }
.overview-split .panel { border-top: 0; }
.overview-split .panel-header { padding-top: 0; align-items: flex-start; }
.overview-split .panel-sub { max-width: 440px; }
.overview-split table { font-size: 13px; white-space: normal; }
.overview-split th, .overview-split td { padding: 12px 8px; }
.overview-split th:first-child, .overview-split td:first-child { padding-left: 0; }
.overview-split th:last-child, .overview-split td:last-child { padding-right: 0; }
.overview-split .num { white-space: nowrap; }
.overview-split .table-person .avatar { display: none; }
.overview-split .table-person small { overflow-wrap: anywhere; }
.overview-split .share-track { width: 32px; }
.top-refs .matter-row { grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 12px 0; }
.top-refs .post-title { font-size: 14px; max-width: 100%; width: fit-content; }
.top-refs .table-code { width: fit-content; max-width: 100%; font-size: 12px; overflow-wrap: anywhere; }
.top-refs .num { align-self: start; padding-top: 2px; font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.overview-lower { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; align-items: start; }

/* Reusable metrics and sections, grouped by lines and whitespace. */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; margin-bottom: 24px; }
.kpi { min-width: 0; padding: 16px 0 0; border-top: 1px solid var(--line); background: white; }
.kpi.featured { border-top-color: var(--accent); }
.kpi-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; color: var(--muted); font-size: 14px; }
.kpi-top .icon { width: 16px; height: 16px; color: var(--muted); }
.kpi-value { font-size: 30px; font-weight: 600; line-height: 1.15; letter-spacing: -.6px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kpi-value.missing { font-size: 24px; letter-spacing: -.3px; }
.kpi-value .unit { font-size: 13px; font-weight: 400; color: var(--muted); letter-spacing: 0; margin-left: 5px; white-space: nowrap; }
.kpi-foot { color: var(--muted); margin-top: 8px; font-size: 12px; line-height: 1.5; min-height: 18px; }
.kpi-source { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 8px; margin-top: 12px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.kpi-foot .positive { color: var(--green); font-weight: 600; }
.layout-main { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 32px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 32px; min-width: 0; }
.panel { min-width: 0; border-top: 1px solid var(--line); background: var(--surface); }
.panel-header, .signal-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; min-width: 0; }
.panel-header > div { min-width: 0; }
.panel-sub { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.panel-body { padding: 0 0 16px; }
.panel-body > p + p { margin-top: 12px; }
.panel-footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 16px; padding: 12px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.5; }
.panel-footer > span { min-width: 0; overflow-wrap: anywhere; }
.section-gap { margin-bottom: 24px; }
.section-title p { color: var(--muted); font-size: 14px; margin-top: 4px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 28px 0 16px; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
.data-section { margin-top: 32px; min-width: 0; }
.data-section > h2 { margin-bottom: 12px; }
.data-section > p + p { margin-top: 8px; }
.inline-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; margin: 0 0 24px; }
.inline-metrics > div { min-width: 0; padding-top: 12px; border-top: 1px solid var(--line); }
.inline-metrics span { display: block; font-size: 14px; color: var(--muted); }
.inline-metrics strong { display: block; margin-top: 6px; font-size: 28px; line-height: 1.2; font-variant-numeric: tabular-nums; letter-spacing: -.5px; overflow-wrap: anywhere; }
.inline-metrics small { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; }
.notice { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; margin-bottom: 24px; border-left: 3px solid var(--amber); border-radius: 0 4px 4px 0; background: var(--amber-soft); color: var(--amber); font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.notice .icon { margin-top: 3px; }
.notice p + p { margin-top: 8px; }
.notice .button { margin: 8px 0 0; }
.details { border-top: 1px solid var(--line); padding: 16px 0; }
.details summary { width: fit-content; max-width: 100%; cursor: pointer; color: var(--muted); font-size: 13px; }
.details summary:hover { color: var(--ink); }
.details summary:active { color: var(--accent); }
.details p, .details li { font-size: 14px; line-height: 1.7; color: var(--muted); overflow-wrap: anywhere; }
.details p { margin-top: 12px; }
.details ul { padding-left: 20px; margin: 12px 0 0; }
.details li + li { margin-top: 8px; }
.details code { font-family: var(--mono); font-size: 12px; padding: 2px 4px; background: var(--sidebar); }
.method { font-size: 14px; line-height: 1.7; color: var(--muted); overflow-wrap: anywhere; }
.method strong { color: var(--ink); }
.note-panel { padding: 20px 0; border-top: 1px solid var(--line); }
.note-panel p { color: var(--muted); font-size: 14px; line-height: 1.7; margin-top: 8px; }
.note-panel .small-link { margin-top: 12px; }
.empty { padding: 32px 16px; text-align: center; }
.empty h3 { margin-bottom: 8px; font-size: 16px; }
.empty p { max-width: 460px; margin: auto; color: var(--muted); font-size: 14px; line-height: 1.7; }
.empty .icon { width: 24px; height: 24px; margin: 0 auto 12px; color: var(--muted); }
.empty .button { margin-top: 16px; }

/* Charts and tables retain their own scroll boundaries. */
.chart-meta { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.chart-value { font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.chart-description { font-size: 12px; color: var(--muted); }
.chart-wrap { padding: 12px 0 0; position: relative; min-width: 0; overflow-x: auto; overscroll-behavior-inline: contain; }
.chart-svg { width: 100%; height: auto; overflow: visible; }
.chart-svg text { font-family: Switzer, sans-serif; font-size: 15px; fill: var(--muted); }
.chart-point { cursor: crosshair; }
.chart-point rect { fill: var(--accent); vector-effect: non-scaling-stroke; }
.chart-point circle { vector-effect: non-scaling-stroke; }
.chart-point:last-child rect { fill: var(--accent-strong); }
.chart-point:focus { outline: none; }
.chart-point:focus rect, .chart-point:focus circle { stroke: var(--ink); stroke-width: 3px; }
.chart-point:focus-visible rect, .chart-point:focus-visible circle { stroke: var(--ink); stroke-width: 3px; }
.chart-tooltip { padding: 8px 0 16px; min-height: 34px; font-size: 12px; color: var(--muted); }
.chart-legend { display: flex; justify-content: center; flex-wrap: wrap; gap: 16px; padding: 8px 0 16px; color: var(--muted); font-size: 12px; }
.legend-dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 2px; background: var(--accent); }
.chart-tabs button { padding: 5px 8px; font-size: 12px; }
.table-wrap { width: 100%; max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; }
table { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; font-size: 14px; }
th { padding: 10px 12px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fafbfc; color: var(--muted); font-size: 12px; font-weight: 500; }
td { padding: 14px 12px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f7f9fc; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.table-person strong { font-size: 14px; font-weight: 500; }
.table-person small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.table-person a { color: var(--accent); }
.table-code { color: var(--ink); font-family: var(--mono); font-size: 12px; background: #f1f3f6; padding: 2px 4px; border-radius: 3px; }
.share-bar { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.share-track { width: 40px; height: 4px; border-radius: 2px; background: #e6ebf4; overflow: hidden; }
.share-track > span { display: block; height: 100%; background: var(--accent); }
.metric-list { display: flex; flex-direction: column; }
.metric-row { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.metric-row:last-child { border-bottom: 0; }
.metric-row strong { font-size: 24px; line-height: 1.2; font-weight: 600; letter-spacing: -.4px; font-variant-numeric: tabular-nums; text-align: right; }
.metric-row small { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); }
.metric-row .metric-name { font-size: 14px; }
.network-icon { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 30px; height: 30px; border-radius: 4px; background: var(--sidebar); font-size: 12px; font-weight: 600; }
.post-title { display: block; max-width: 360px; overflow: hidden; text-overflow: ellipsis; color: var(--accent); font-size: 14px; }
.post-sub { color: var(--muted); font-size: 12px; margin-top: 4px; }
.funnel-row { margin-bottom: 20px; }
.funnel-row-top { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 8px; font-size: 14px; }
.funnel-row-top strong { font-variant-numeric: tabular-nums; }
.progress-track { width: 100%; height: 6px; border-radius: 2px; background: #e6ebf4; overflow: hidden; }
.progress-track span { display: block; height: 100%; background: var(--accent); }
progress.share-track, progress.progress-track { appearance: none; border: 0; color: var(--accent); }
progress.share-track::-webkit-progress-bar, progress.progress-track::-webkit-progress-bar { background: #e6ebf4; border-radius: 2px; }
progress.share-track::-webkit-progress-value, progress.progress-track::-webkit-progress-value { background: var(--accent); border-radius: 2px; }
progress.share-track::-moz-progress-bar, progress.progress-track::-moz-progress-bar { background: var(--accent); border-radius: 2px; }

/* Shared matters, tasks, and contextual details. */
.board-tabs { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); }
.board-tabs button { min-height: 40px; padding: 8px 12px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-size: 14px; }
.board-tabs button.active, .board-tabs button[aria-selected='true'], .board-tabs button[aria-pressed='true'] { border-bottom-color: var(--accent); color: var(--accent); font-weight: 600; }
.matter-list, .task-list { min-width: 0; }
.matter-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, .6fr) auto; align-items: start; gap: 24px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.matter-row:last-child, .task-row:last-child { border-bottom: 0; }
.matter-main, .task-row > div { min-width: 0; }
.matter-main h3, .task-row h3 { font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.matter-main h3 a, .task-row h3 a { display: block; color: var(--ink); }
.matter-main h3 a:hover, .task-row h3 a:hover { color: var(--accent); }
.matter-main p, .task-row p { margin-top: 8px; color: var(--muted); font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.matter-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.matter-properties { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 6px 12px; margin: 0; font-size: 12px; line-height: 1.5; }
.matter-properties > div { display: contents; }
.matter-properties dt { color: var(--muted); }
.matter-properties dd { margin: 0; overflow-wrap: anywhere; }
.matter-row > .small-link { min-height: 32px; }
.task-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, .6fr) auto; align-items: start; gap: 24px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.overview-lower .matter-row, .overview-lower .task-row { grid-template-columns: minmax(0, 1fr) auto; gap: 12px; }
.overview-lower :is(.matter-row, .task-row) .matter-properties { grid-column: 1; grid-row: 2; }
.overview-lower :is(.matter-row, .task-row) > .small-link { grid-column: 2; grid-row: 1 / 3; }
.detail-back { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; color: var(--accent); border: 0; background: transparent; padding: 4px 0; margin-bottom: 16px; font-size: 14px; }
.detail-back .icon { width: 16px; height: 16px; }
.detail-title { margin-bottom: 24px; overflow-wrap: anywhere; }
.detail-title h1 { margin-top: 4px; }
.detail-title p { margin-top: 8px; color: var(--muted); }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; align-items: start; gap: 32px; min-width: 0; }
.detail-grid > * { min-width: 0; }
.detail-grid > div > .data-section:first-child, .detail-grid > aside.data-section { margin-top: 0; }
.detail-grid p { overflow-wrap: anywhere; }
.data-section .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.detail-grid .matter-properties { padding: 16px 0; border-top: 1px solid var(--line); }
.matter-status-panel .matter-properties { grid-template-columns: 130px minmax(0, 1fr); font-size: 14px; gap: 12px 16px; }
.matter-timeline { list-style: none; padding: 0; margin: 0; }
.matter-timeline > li { border-left: 2px solid var(--line); padding: 0 0 20px 16px; overflow-wrap: anywhere; }
.matter-timeline .matter-meta { margin-top: 0; }
.matter-timeline blockquote { margin: 12px 0 0; font-size: 14px; line-height: 1.65; color: var(--ink); white-space: pre-line; }
.case-jumps { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.case-now { background: var(--sidebar); border: 1px solid var(--line); padding: 24px; margin: 0 0 24px; }
.case-now .panel-header { margin-bottom: 12px; padding: 0; }
.case-now > .details { margin-top: 16px; padding: 12px 0 0; }
.case-next { margin: 0 0 12px; font-size: 18px; line-height: 1.4; font-weight: 600; overflow-wrap: anywhere; }
.case-now .matter-properties { grid-template-columns: 112px minmax(0, 1fr) 112px minmax(0, 1fr); gap: 8px 16px; font-size: 14px; }
.case-now .method { margin-top: 12px; margin-bottom: 0; font-size: 12px; line-height: 1.5; }
.case-layout { grid-template-columns: minmax(0, 1fr) 320px; }
.case-layout > div, .case-layout > aside { display: flex; flex-direction: column; gap: 24px; }
.case-layout > aside { gap: 12px; }
.case-layout .data-section { margin-top: 0; }
.case-layout .panel-header { padding: 0 0 12px; align-items: flex-start; flex-wrap: wrap; gap: 8px; }
.case-layout .panel-header > .dim { font-size: 12px; }
.case-layout .data-section > p { max-width: 72ch; }
.case-layout .details { margin-top: 12px; padding: 12px 0 0; }
.case-layout .details + .details { margin-top: 12px; }
.case-layout aside > .data-section + .data-section { padding-top: 12px; border-top: 1px solid var(--line); }
.case-layout aside > .data-section:last-child > .details:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.case-layout .case-help { margin-top: 12px; }
.case-description { margin-top: 16px; }
.case-document { color: var(--ink); line-height: 1.6; overflow-wrap: anywhere; }
.case-document h3 { font-size: 15px; margin: 24px 0 8px; }
.case-document p, .case-document ul { margin: 12px 0; color: var(--ink); line-height: 1.6; }
.case-document li { color: var(--ink); line-height: 1.6; }
.case-document > :last-child { margin-bottom: 0; }
.case-document pre { max-width: 100%; overflow-x: auto; padding: 12px; background: var(--sidebar); white-space: pre-wrap; overflow-wrap: anywhere; }
.case-summary { font-size: 14px; line-height: 1.6; }
.case-timeline .case-event { position: relative; padding: 0 0 24px 24px; }
.case-timeline .case-event:last-child { padding-bottom: 0; }
.case-timeline .case-event::before { content: ''; position: absolute; left: -6px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); border: 2px solid var(--canvas); }
.case-timeline .case-event-completed::before { background: var(--green); }
.case-event h3 { margin: 8px 0; font-size: 15px; }
.case-event-text { font-size: 14px; line-height: 1.65; }
.case-event-text p { margin: 8px 0; }
.case-event .details { margin-top: 12px; }
.case-task { padding: 16px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.case-task h3 { margin: 0 0 10px; font-size: 15px; line-height: 1.5; }
.case-task p { margin: 8px 0; font-size: 14px; }
.case-task p.method { font-size: 12px; line-height: 1.5; }
.case-materials { padding-left: 18px; overflow-wrap: anywhere; }
.case-materials li { margin: 8px 0; }
.case-materials .method { display: block; margin-top: 4px; }
.case-layout aside code { overflow-wrap: anywhere; white-space: normal; }
@media (max-width: 700px) {
  .case-now { padding: 16px; }
  .case-now .matter-properties { grid-template-columns: 100px minmax(0, 1fr); gap: 8px 12px; }
  .case-next { font-size: 16px; }
  .case-jumps .button { flex: 1 1 auto; }
}
.board-card { display: flex; align-items: flex-start; gap: 16px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.board-number { font-family: var(--mono); font-size: 12px; color: var(--muted); flex-shrink: 0; padding-top: 3px; }
.board-content { min-width: 0; flex: 1; }
.board-content p { color: var(--muted); margin-top: 8px; font-size: 14px; }
.board-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; color: var(--muted); margin-top: 8px; font-size: 12px; }

/* Data quality has a distinct place from business matters. */
.signal-item { padding: 16px 0; border-top: 1px solid var(--line); }
.signal-label { margin-bottom: 6px; color: var(--amber); font-size: 12px; font-weight: 500; }
.signal-item h3 { font-size: 15px; }
.signal-item p { color: var(--muted); font-size: 14px; line-height: 1.6; margin-top: 8px; }
.signal-item .small-link { margin-top: 12px; }
.source-list { padding-bottom: 4px; }
.source-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.source-row:last-child { border-bottom: 0; }
.source-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.source-time { margin-top: 2px; font-size: 12px; color: var(--muted); }
.source-status-line { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 16px; margin: 8px 0 16px; color: var(--muted); font-size: 12px; }
.source-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
.source-card { padding-top: 16px; }
.source-card-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; }
.source-definition { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 8px 16px; margin: 0; font-size: 14px; }
.source-definition dt { color: var(--muted); }
.source-definition dd { margin: 0; overflow-wrap: anywhere; }
.source-warnings { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--amber); font-size: 14px; line-height: 1.6; }
.source-warnings p + p { margin-top: 12px; }
.mini-title { font-size: 14px; font-weight: 600; }

/* Initial load, feedback, and small utilities. */
.boot { max-width: 420px; margin: 20vh auto; padding: 24px; text-align: center; }
.boot .brand-mark { margin: 0 auto 20px; }
.boot p { margin-top: 12px; color: var(--muted); }
.skeleton { height: 4px; background: #e6ebf4; margin: 24px auto; overflow: hidden; }
.skeleton::after { content: ''; display: block; width: 40%; height: 100%; background: var(--accent); animation: loading 1.2s infinite alternate; }
@keyframes loading { to { transform: translateX(150%); } }
.refreshing .refresh-icon { animation: rotate 1.5s linear infinite; }
@keyframes rotate { to { transform: rotate(360deg); } }
#toast { position: fixed; right: 24px; bottom: 24px; z-index: 70; max-width: min(440px, calc(100vw - 32px)); padding: 12px 16px; border-radius: var(--radius); color: white; background: var(--ink); font-size: 14px; opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .15s, transform .15s; }
#toast.visible { opacity: 1; transform: translateY(0); }
.import-zone { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center; padding: 24px 0; }
.import-zone p { margin-top: 8px; font-size: 14px; color: var(--muted); }
.import-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.import-status { margin-top: 8px; color: var(--green); font-size: 14px; }
.file-input { display: none; }
.no-wrap { white-space: nowrap; }
.dim { color: var(--muted); }
.stat-change, .positive { color: var(--green); }
.negative { color: var(--red); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 1200px) {
  .page { padding-left: 24px; padding-right: 24px; }
  .topbar { padding-left: 24px; padding-right: 24px; }
  .heading-aside { display: none; }
  .kpis { gap: 20px; }
  .overview-result { gap: 24px; }
  .result-support { padding-left: 24px; gap: 16px; }
  .snapshot-label { max-width: 320px; }
}
@media (max-width: 1100px) {
  .overview-split, .overview-lower, .layout-main, .two-col, .detail-grid, .data-section .detail-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .overview-split .panel + .panel { border-top: 1px solid var(--line); }
  .overview-split .panel + .panel .panel-header { padding-top: 16px; }
  .overview-split .chart-svg text { font-size: 13px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-result { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
  .result-support { grid-template-columns: minmax(0, 1fr); }
  .result-support .kpi + .kpi, .result-support > article + article { padding-top: 16px; border-top: 1px solid var(--line); }
  .source-grid { grid-template-columns: minmax(0, 1fr); }
  .matter-row, .task-row { grid-template-columns: minmax(0, 1fr) minmax(210px, .7fr); gap: 16px 24px; }
  .matter-row > .small-link, .task-row > .small-link { grid-column: 1 / -1; }
}
@media (max-width: 800px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .workarea { grid-column: 1; }
  .sidebar { width: 264px; padding: 24px 16px; visibility: hidden; transform: translateX(-100%); transition: transform .18s; }
  .sidebar .brand { padding-bottom: 28px; }
  .menu-open .sidebar { visibility: visible; transform: translateX(0); }
  .menu-open .mobile-scrim { display: block; position: fixed; inset: 0; z-index: 39; padding: 0; border: 0; background: #18232f66; }
  .menu-toggle { display: inline-flex; align-items: center; justify-content: center; width: 44px; min-width: 44px; height: 44px; padding: 0; border: 0; border-radius: var(--radius); color: var(--ink); background: transparent; }
  .menu-toggle:hover { background: var(--sidebar); }
  .nav button { padding: 12px; font-size: 14px; }
  .topbar { flex-wrap: wrap; gap: 8px 12px; padding: 8px 16px 12px; }
  .breadcrumb { gap: 8px; order: 1; flex: 1; min-width: 0; }
  .breadcrumb > span { display: none; }
  .breadcrumb strong { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar-right { display: contents; }
  .topbar-right > .button { order: 2; }
  .topbar-right > .avatar { display: none; }
  .snapshot-label { order: 3; flex: 1 0 100%; max-width: none; font-size: 12px; line-height: 1.5; align-items: baseline; }
  .page { padding: 24px 16px; }
  .page-heading { gap: 12px; margin-bottom: 20px; }
  h1 { font-size: 27px; }
  .page-heading p { margin-top: 8px; }
  .button, .select, .segmented button, .chart-tabs button, .board-tabs button, .detail-back { min-height: 44px; }
  .button { font-size: 13px; padding: 10px 12px; }
  .text-button, .small-link { min-height: 44px; align-items: center; }
  .matter-main h3 a, .task-row h3 a { min-height: 44px; }
  .sort-button { min-height: 44px; }
  .search { min-height: 44px; width: 100%; max-width: 300px; }
  .search input { min-height: 30px; }
  .details summary { min-height: 44px; padding-top: 10px; padding-bottom: 10px; }
  .filters { align-items: flex-start; gap: 12px; margin-bottom: 24px; }
  .filter-left { flex: 1 1 100%; align-items: flex-start; gap: 12px; }
  .filter-caption { flex: 1 0 100%; font-size: 12px; }
  .filters > .button { margin-left: auto; }
  .overview-result { grid-template-columns: minmax(0, 1fr); padding: 0 0 24px; gap: 24px; }
  .result-support { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding-left: 0; border-left: 0; }
  .result-support .kpi, .result-support .kpi + .kpi, .result-support > article, .result-support > article + article { padding-top: 16px; border-top: 1px solid var(--line); }
  .result-value { font-size: 40px; }
  .result-support .kpi-value, .kpi-value { font-size: 28px; }
  .kpi-value.missing { font-size: 22px; }
  .kpi-value .unit { display: block; margin: 6px 0 0; font-size: 12px; }
  .kpi-top { align-items: flex-start; }
  .kpi-source { display: block; }
  .kpi-source span { display: block; }
  .kpi-source span + span { margin-top: 2px; }
  .kpis { gap: 24px 16px; }
  .panel-header { flex-wrap: wrap; gap: 8px 16px; }
  .panel-header .segmented { margin-left: 0; }
  .panel-header > .small-link { min-height: 44px; }
  .overview-split .chart-svg text, .chart-svg text { font-size: clamp(13px, calc(49px - 5vw), 32px); }
  .overview-split { margin-bottom: 32px; }
  .chart-meta { gap: 4px 8px; }
  .chart-description { font-size: 12px; }
  .chart-tooltip { padding-bottom: 16px; }
  .chart-tabs button { padding-left: 12px; padding-right: 12px; }
  .overview-split table { white-space: nowrap; }
  .overview-split .table-person small { white-space: normal; }
  .overview-split th, .overview-split td { padding: 12px 8px; }
  .section-title { align-items: flex-start; flex-wrap: wrap; gap: 12px; }
  .section-title .search { max-width: none; }
  .source-row { gap: 12px; align-items: flex-start; }
  .source-row .pill { white-space: normal; max-width: 45%; }
  .source-definition { grid-template-columns: 80px minmax(0, 1fr); gap: 8px 12px; }
  .source-card-header { align-items: flex-start; flex-wrap: wrap; gap: 8px; }
  .matter-row, .task-row { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 20px 0; }
  .matter-row > .small-link, .task-row > .small-link { grid-column: auto; }
  .overview-lower .matter-row, .overview-lower .task-row { grid-template-columns: minmax(0, 1fr); }
  .overview-lower :is(.matter-row, .task-row) .matter-properties, .overview-lower :is(.matter-row, .task-row) > .small-link { grid-column: auto; grid-row: auto; }
  .matter-properties { grid-template-columns: 100px minmax(0, 1fr); }
  .board-toolbar { align-items: flex-start; }
  .board-tabs { width: 100%; }
  .board-tabs button { flex: 1 1 auto; padding-left: 8px; padding-right: 8px; }
  .board-card { flex-wrap: wrap; }
  .board-card > .small-link { margin-left: 0; }
  .metric-row { gap: 16px; }
  .metric-row strong { font-size: 24px; overflow-wrap: anywhere; }
  .post-title { max-width: 260px; min-height: 44px; padding-top: 10px; padding-bottom: 10px; }
  .table-person a { display: inline-flex; min-height: 44px; align-items: center; }
  .notice { padding: 12px; }
  .notice .icon { width: 16px; height: 16px; }
  .detail-title { margin-bottom: 24px; }
  .inline-metrics { gap: 20px 16px; }
  .inline-metrics strong { font-size: 26px; }
  .page-footer { flex-direction: column; }
  .import-zone { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  #toast { right: 16px; bottom: 16px; }
}
@media (max-width: 700px) {
  .filters.export-filters {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    align-items: start;
    gap: 12px;
  }
  .export-filters > .filter-left {
    grid-column: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;
    min-width: 0;
  }
  .export-filters .filter-left > label {
    flex: 1 1 0;
    min-width: 0;
  }
  .export-filters .filter-left .select {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding-left: 8px;
    padding-right: 20px;
    text-overflow: ellipsis;
  }
  .export-filters .filter-caption {
    flex: 1 0 100%;
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .export-filters > .button {
    grid-column: 2;
    grid-row: 1;
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    margin: 0;
    padding: 0;
  }
  .export-filters > .button .button-label { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

.login-page { display: flex; flex-direction: column; gap: 24px; width: min(360px, 100%); margin: 0 auto; padding: 16vh 16px 32px; }
.login-page .brand { padding: 0; }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-form h1 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -.45px; }
.login-form label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 13px; }
.login-form label[hidden], .login-form p[hidden] { display: none; }
.login-form input { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); font-size: 16px; }
.login-form .button { justify-content: center; }
.login-note { margin: 0; color: var(--muted); font-size: 13px; }
.login-error { margin: 0; color: var(--red); font-size: 13px; }
.session-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; color: var(--muted); font-size: 12px; }
.session-row button { padding: 2px 6px; border: 1px solid var(--line); border-radius: var(--radius); background: transparent; color: var(--ink); font-size: 12px; }
