:root {
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;
  --radius: 16px;
  --radius-sm: 10px;
  --gutter: clamp(16px, 4vw, 80px);
  --page-max: clamp(1480px, 96vw, 2560px);
  --accent: #8b7bff;
  --accent-2: #22d3ee;
  --accent-grad: linear-gradient(120deg, #8b7bff 0%, #5b8cff 45%, #22d3ee 100%);
  --good: #34d399;
  --bad: #fb7185;
  --warn: #fbbf24;
}

:root,
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #070b18;
  --bg-2: #0b1124;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --surface-solid: #10172e;
  --border: rgba(148, 163, 255, 0.12);
  --border-strong: rgba(148, 163, 255, 0.26);
  --text-1: #eef1ff;
  --text-2: #a3abc8;
  --text-3: #8a93b3;
  --grid: rgba(148, 163, 255, 0.10);
  --hover: rgba(139, 123, 255, 0.10);
  --tooltip-bg: rgba(16, 23, 46, 0.92);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 20px 50px -20px rgba(0, 0, 0, 0.6);
  --good-bg: rgba(52, 211, 153, 0.12);
  --bad-bg: rgba(251, 113, 133, 0.12);
  --neutral-bg: rgba(163, 171, 200, 0.12);
  --glow-1: rgba(139, 123, 255, 0.22);
  --glow-2: rgba(34, 211, 238, 0.14);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f6fb;
  --bg-2: #eef1f8;
  --surface: #ffffff;
  --surface-2: #f6f7fc;
  --surface-solid: #ffffff;
  --border: #e2e6f0;
  --border-strong: #c9cfe0;
  --text-1: #0d1330;
  --text-2: #4b5575;
  --text-3: #5d6684;
  --grid: #e8ebf3;
  --hover: rgba(91, 71, 224, 0.07);
  --tooltip-bg: rgba(255, 255, 255, 0.96);
  --shadow: 0 1px 2px rgba(13, 19, 48, 0.04), 0 12px 32px -16px rgba(13, 19, 48, 0.18);
  --accent: #5b47e0;
  --accent-2: #0e7490;
  --accent-grad: linear-gradient(120deg, #5b47e0 0%, #3b6cf0 45%, #0e7490 100%);
  --good: #047857;
  --bad: #be123c;
  --warn: #b45309;
  --good-bg: rgba(4, 120, 87, 0.10);
  --bad-bg: rgba(190, 18, 60, 0.08);
  --neutral-bg: rgba(75, 85, 117, 0.08);
  --glow-1: rgba(91, 71, 224, 0.10);
  --glow-2: rgba(8, 145, 178, 0.08);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-1);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 500px at 10% -10%, var(--glow-1), transparent 60%),
    radial-gradient(800px 500px at 100% 0%, var(--glow-2), transparent 60%),
    linear-gradient(var(--bg), var(--bg-2));
}

.backdrop::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 70%);
  opacity: 0.5;
}

svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

a { color: var(--accent); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0;
}

.skip-link {
  position: absolute; left: 16px; top: -48px; z-index: 100; padding: 8px 14px; border-radius: 8px;
  background: var(--surface-solid); color: var(--text-1); border: 1px solid var(--border-strong);
}
.skip-link:focus { top: 12px; }

:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; border-radius: 6px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px;
  border-radius: 10px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text-1); font: 500 13px/1 var(--font); cursor: pointer; text-decoration: none;
  transition: background .15s, border-color .15s, transform .1s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.btn-sm svg { width: 15px; height: 15px; }
.btn-icon { width: 36px; padding: 0; justify-content: center; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { color: var(--text-1); background: var(--surface-2); }
.btn-soft { background: var(--hover); border-color: transparent; color: var(--accent); }
.btn-primary {
  border: 0; color: #fff; background: var(--accent-grad);
  box-shadow: 0 8px 24px -10px rgba(91, 108, 255, .8), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.btn-primary:hover { filter: brightness(1.08); background: var(--accent-grad); }

.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px;
  font-size: 12px; font-weight: 500; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border);
  white-space: nowrap;
}
.pill svg { width: 14px; height: 14px; }
.pill-preview { height: 20px; padding: 0 8px; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); background: var(--hover); border-color: transparent; }
.pill-bad { color: var(--bad); background: var(--bad-bg); border-color: transparent; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  backdrop-filter: saturate(160%) blur(16px);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: var(--page-max); margin: 0 auto; padding: 10px var(--gutter);
  display: flex; align-items: center; gap: 20px;
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text-1); flex: none; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 8px; background: var(--accent-grad);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .15) inset, 0 6px 18px -6px var(--accent);
  position: relative;
}
.brand-mark::after {
  content: ''; position: absolute; inset: 7px; border-radius: 3px;
  border: 2px solid rgba(255, 255, 255, .9); border-right-color: transparent; transform: rotate(45deg);
}
.brand-name { font-weight: 700; letter-spacing: -.01em; }
.brand-tag { color: var(--text-2); font-weight: 500; }

.topbar-actions { display: flex; align-items: center; gap: 8px; flex: none; margin-left: auto; }
.icon-sun { display: none; }
:root[data-theme="dark"] .icon-moon { display: none; }
:root[data-theme="dark"] .icon-sun { display: block; }
:root[data-theme="light"] .icon-moon { display: block; }

.page { max-width: var(--page-max); margin: 0 auto; padding: 28px var(--gutter) 64px; outline: none; }

.hero { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; margin-bottom: 20px; }
.eyebrow { margin: 0 0 6px; color: var(--accent-2); font: 600 12px/1.2 var(--font); letter-spacing: .08em; text-transform: uppercase; }
.hero h1 { margin: 0; font-size: clamp(26px, 3.2vw, 36px); font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.tagline { margin: 8px 0 0; color: var(--text-2); max-width: 720px; }
.hero-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.parity { position: relative; display: inline-flex; }
.parity-badge { cursor: pointer; font: inherit; color: var(--text-1); }
.parity-badge:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.parity-icon { font-weight: 700; }
.parity[data-state="matches"] .parity-badge { border-color: var(--good); background: var(--good-bg); }
.parity[data-state="differences"] .parity-badge { border-color: #d97706; background: rgba(245, 158, 11, 0.14); }
.parity[data-state="stale"] .parity-badge,
.parity[data-state="pending"] .parity-badge { border-color: var(--border-strong); background: var(--neutral-bg); }
.parity-panel {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 40; width: min(440px, calc(100vw - 32px));
  max-height: 70vh; overflow: auto; padding: 14px 16px; border-radius: var(--radius-sm);
  background: var(--surface-solid); border: 1px solid var(--border-strong); box-shadow: var(--shadow);
  color: var(--text-1); font: 400 13px/1.5 var(--font); text-align: left;
}
.parity-panel p { margin: 0 0 10px; }
.parity-title { margin: 0 0 6px; font-size: 14px; font-weight: 700; }
.parity-facts { display: grid; grid-template-columns: max-content 1fr; gap: 3px 12px; margin: 0 0 12px; }
.parity-facts dt { color: var(--text-3); }
.parity-facts dd { margin: 0; }
.parity-sub { margin: 10px 0 4px; font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.parity-panel ul { margin: 0 0 6px; padding-left: 18px; }
.parity-panel li { margin: 0 0 4px; }
.parity-note { margin: 0 0 4px !important; color: var(--text-3); font-size: 12px; }
.parity-method { margin-top: 10px !important; padding-top: 10px; border-top: 1px solid var(--border); color: var(--text-3); font-size: 12px; }
.parity-views { display: inline-flex; gap: 2px; margin: 2px 0 10px; padding: 2px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); }
.parity-views button { min-height: 26px; padding: 2px 10px; border: 0; border-radius: 6px; background: none; color: var(--text-2); font: 600 12px/1.2 inherit; cursor: pointer; }
.parity-views button[aria-pressed="true"] { background: var(--surface-solid); color: var(--text-1); box-shadow: 0 1px 2px rgba(15, 23, 42, .12); }
.parity-views button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.parity-status { font-weight: 600; }
.parity-panel ul.parity-open li { margin-bottom: 6px; }
.parity-tag { display: inline-block; margin-left: 2px; padding: 0 7px; border-radius: 999px; font-size: 11.5px; font-weight: 600; line-height: 18px; white-space: nowrap; color: var(--text-1); }
.parity-tag-bi { background: rgba(245, 158, 11, .18); }
.parity-tag-onereport { background: rgba(91, 140, 255, .16); }
.parity-tag-retest { background: rgba(52, 211, 153, .18); }
.parity-accepted { margin-top: 8px; }
.parity-accepted summary { cursor: pointer; color: var(--text-2); font-size: 12.5px; font-weight: 600; }
.parity-accepted ul { margin-top: 4px; color: var(--text-2); }
.parity-brief[hidden], .parity-full[hidden] { display: none; }

.filterbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px; margin-bottom: 20px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
}
.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 9px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2);
  font: 500 13px/1 var(--font); cursor: pointer; white-space: nowrap; max-width: 320px; overflow: hidden;
}
.chip:hover { border-color: var(--border-strong); color: var(--text-1); }
.chip .chip-label { color: var(--text-3); min-width: 0; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; line-height: 1.3; }
.chip .chip-value { color: var(--text-1); overflow: hidden; text-overflow: ellipsis; flex: none; max-width: 200px; line-height: 1.3; }
.chip svg { width: 14px; height: 14px; color: var(--text-3); flex: none; }
.chip.is-active { border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: var(--hover); }
.chip.is-active .chip-value { color: var(--accent); }
.chip.is-locked { cursor: not-allowed; opacity: .7; }
.chip.is-idle { opacity: .55; border-style: dashed; }
.chip.is-idle:hover, .chip.is-idle:focus-visible { opacity: .9; }
.chip.is-flash { animation: flash 1.6s ease; }
@keyframes flash { 0%, 100% { box-shadow: none; } 30% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-2) 60%, transparent); } }

.popover {
  position: fixed; z-index: 60; width: min(340px, calc(100vw - 32px)); max-height: min(440px, 70vh);
  display: flex; flex-direction: column; border-radius: 14px; overflow: hidden;
  background: var(--surface-solid); border: 1px solid var(--border-strong);
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, .45);
}
.popover-head { position: relative; padding: 12px 12px 8px; border-bottom: 1px solid var(--border); }
.popover-title { margin: 0 0 8px; padding-right: 32px; font-weight: 600; }
.popover-close {
  position: absolute; top: 6px; right: 6px; display: grid; place-items: center; width: 28px; height: 28px;
  padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--text-2); cursor: pointer;
}
.popover-close:hover { background: var(--hover); color: var(--text-1); }
.popover-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.popover-close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.popover-status { align-self: center; min-width: 0; color: var(--text-3); font-size: 12px; text-align: right; }
.popover-status.is-problem { color: var(--bad); }
.popover input[type="search"], .popover input[type="date"], .popover input[type="text"] {
  width: 100%; height: 34px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text-1); font: 13px var(--font);
}
.popover-list { overflow: auto; padding: 6px; flex: 1; }
.popover-option {
  display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; cursor: pointer; color: var(--text-1);
}
.popover-option:hover { background: var(--hover); }
.popover-option input { accent-color: var(--accent); width: 16px; height: 16px; }
.popover-empty { padding: 16px; color: var(--text-3); text-align: center; }
.popover-foot { display: flex; justify-content: space-between; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border); }
.popover-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px; }
.popover-dates label { display: grid; gap: 4px; font-size: 12px; color: var(--text-2); }

.summary {
  position: relative; overflow: hidden; margin-bottom: 20px; padding: 20px 22px 16px; border-radius: 20px;
  background: linear-gradient(var(--surface-solid), var(--surface-solid)) padding-box, var(--accent-grad) border-box;
  border: 1px solid transparent; box-shadow: var(--shadow);
}
.summary-glow {
  position: absolute; inset: -40% -10% auto auto; width: 520px; height: 320px; pointer-events: none;
  background: radial-gradient(closest-side, var(--glow-1), transparent);
}
.summary:is(.is-pending, .is-idle) { padding-top: 12px; padding-bottom: 12px; }
.summary:is(.is-pending, .is-idle) :is(.summary-headline, .summary-list, .summary-foot) { display: none; }
.summary:is(.is-pending, .is-idle) .summary-glow { display: none; }
.summary:not(.is-idle) #summary-generate, .summary.is-idle #summary-refresh { display: none; }
.summary.is-revealed :is(.summary-headline, .summary-list, .summary-foot) { animation: summary-open .45s ease-out both; }
@keyframes summary-open { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .summary.is-revealed :is(.summary-headline, .summary-list, .summary-foot) { animation: none; } }
.summary-head { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.summary-badge { display: flex; align-items: center; gap: 8px; }
.summary-badge svg { color: var(--accent-2); }
.summary-badge h2 {
  margin: 0; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.summary-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.summary-status { font-size: 12px; color: var(--text-3); display: inline-flex; align-items: center; gap: 8px; }
.summary-fallback { padding: 3px 9px; border-radius: 999px; font-weight: 600; color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.summary-headline { position: relative; margin: 12px 0 10px; font-size: clamp(17px, 1.8vw, 21px); font-weight: 600; letter-spacing: -.01em; line-height: 1.35; }
.summary-headline.is-long { font-size: 15.5px; font-weight: 500; line-height: 1.65; letter-spacing: 0; color: var(--text-1); }
.summary-headline.is-long mark { background: none; -webkit-background-clip: border-box; background-clip: border-box; color: inherit; font-weight: 700; }
.summary-list { position: relative; list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.summary-list li {
  display: grid; grid-template-columns: 10px 1fr auto; gap: 12px; align-items: start; padding: 10px 12px;
  border-radius: 12px; background: var(--surface); border: 1px solid var(--border);
  animation: rise .4s ease both;
}
.summary-list li:nth-child(2) { animation-delay: .05s; }
.summary-list li:nth-child(3) { animation-delay: .1s; }
.summary-list li:nth-child(4) { animation-delay: .15s; }
.summary-list li:nth-child(5) { animation-delay: .2s; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.tone-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; background: var(--text-3); }
.tone-good .tone-dot { background: var(--good); box-shadow: 0 0 0 4px var(--good-bg); }
.tone-bad .tone-dot { background: var(--bad); box-shadow: 0 0 0 4px var(--bad-bg); }
.bullet-text { color: var(--text-1); }
.summary mark { background: none; color: inherit; font-weight: 700; font-variant-numeric: tabular-nums; }
.slow-note { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; gap: 10px; height: 100%; padding: 16px; color: var(--text-2); font-size: 13px; text-align: center; }
.popover-hint { padding: 8px 10px; color: var(--text-3); font-size: 12px; }
.bullet-type {
  display: inline-block; margin-right: 8px; padding: 1px 7px; border-radius: 6px; vertical-align: 1px;
  font-size: 11px; font-weight: 600; letter-spacing: .02em; color: var(--text-2); background: var(--neutral-bg);
}
.type-risk .bullet-type { color: var(--bad); background: var(--bad-bg); }
.type-bright_spot .bullet-type { color: var(--good); background: var(--good-bg); }
.type-trend .bullet-type { color: var(--accent); background: var(--hover); }
.type-concentration .bullet-type { color: var(--accent-2); background: color-mix(in srgb, var(--accent-2) 12%, transparent); }
.bullet-follow {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 8px; padding-top: 8px;
  border-top: 1px dashed var(--border); color: var(--text-2); font-size: 12.5px;
}
.follow-grid { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 0; width: 100%; }
.follow-grid dd { margin: 0; line-height: 1.5; }
.follow-label { padding-top: 2px; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.follow-action { color: var(--text-1); font-weight: 500; }
@media (max-width: 720px) { .follow-grid { grid-template-columns: 1fr; gap: 2px; } .follow-grid dd { margin-bottom: 6px; } }
.bullet-ask {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--hover); color: var(--accent); font: 500 12px var(--font);
  cursor: pointer; text-align: left;
}
.bullet-ask:hover { border-color: var(--accent); }
.bullet-ask:focus-visible, .bullet-link:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.bullet-ask svg { flex: none; width: 13px; height: 13px; }
.summary-headline mark { background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.bullet-text .unverified { border-bottom: 1px dashed var(--warn); color: var(--warn); }
.bullet-link {
  display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 9px; border-radius: 7px;
  border: 1px solid var(--border); background: transparent; color: var(--text-2); font: 500 12px var(--font); cursor: pointer;
}
.bullet-link:hover { color: var(--accent); border-color: var(--accent); }
.bullet-link svg { width: 13px; height: 13px; }
.summary-foot { position: relative; display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-top: 12px; color: var(--text-3); font-size: 12px; }
.summary-foot > span { display: inline-flex; align-items: center; gap: 5px; line-height: 1.4; }
.summary-foot > span > svg { width: 13px; height: 13px; flex: none; }
.summary-foot .ok { color: var(--good); }
.summary-foot .warn { color: var(--warn); }
.summary-notice { color: var(--warn); }

.skeleton { position: relative; overflow: hidden; background: var(--surface-2); border-radius: 8px; }
:root[data-theme="light"] .skeleton { background: #dfe3ee; }
.skeleton::after {
  content: ''; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .06), transparent);
  animation: shimmer 1.4s infinite;
}
:root[data-theme="light"] .skeleton::after { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .7), transparent); }
@keyframes shimmer { to { transform: translateX(100%); } }
.skeleton-line { height: 14px; margin: 10px 0; }
.page.is-loading #report-title:empty { width: min(460px, 70%); height: 40px; }
.page.is-loading #report-title:empty, .page.is-loading #report-tagline:empty {
  position: relative; overflow: hidden; border-radius: 10px; background: var(--surface-2);
}
:root[data-theme="light"] .page.is-loading :is(#report-title, #report-tagline):empty { background: #dfe3ee; }
.page.is-loading #report-tagline:empty { width: min(560px, 85%); height: 16px; margin-top: 12px; }
.page.is-loading :is(#report-title, #report-tagline):empty::after {
  content: ''; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .5), transparent); animation: shimmer 1.4s infinite;
}
.chip-bone { display: inline-block; height: 32px; border-radius: 9px; }
.tab-bone { display: inline-block; flex: none; height: 36px; border-radius: 10px; }
.kpi-bone { display: block; min-height: 132px; border-radius: var(--radius); }
.grid-bone { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.card-bone { display: block; height: 300px; border-radius: var(--radius); }
@media (prefers-reduced-motion: reduce) {
  .skeleton::after, .page.is-loading :is(#report-title, #report-tagline):empty::after { animation: none; }
}
.thinking { display: inline-flex; gap: 4px; }
.thinking i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-2); animation: bounce 1s infinite ease-in-out; }
.thinking i:nth-child(2) { animation-delay: .15s; }
.thinking i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 80%, 100% { opacity: .3; transform: scale(.8); } 40% { opacity: 1; transform: scale(1); } }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-bottom: 24px; }
.kpis:empty { display: none; }
.kpis-tools { grid-column: 1 / -1; display: flex; justify-content: flex-end; margin-bottom: -6px; }
.kpi {
  position: relative; display: flex; flex-direction: column; gap: 6px; padding: 14px 14px 10px; text-align: left;
  border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow);
  color: inherit; font: inherit; cursor: pointer; min-height: 150px; transition: border-color .15s, transform .15s, background .15s;
}
.kpi:hover { border-color: var(--border-strong); background: var(--surface-2); transform: translateY(-2px); }
.kpi.is-compact { min-height: 0; }
.kpi.is-hero {
  grid-column: span 2; grid-row: span 2; padding: 20px 20px 14px;
  border-color: color-mix(in srgb, var(--accent) 38%, var(--border));
  background: radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 62%), var(--surface);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent), var(--shadow);
}
.kpi.is-hero:hover { border-color: var(--accent); }
.kpi.is-hero.is-compact .kpi-value { margin-block: auto; }
.kpi.is-hero.is-compact .kpi-spark { display: none; }
.kpi.is-hero .kpi-label > span:first-child { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.kpi.is-hero .kpi-sub { font-size: 13px; }
.glance { margin: 0 0 16px; }
.glance-title { margin: 0 0 8px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.glance-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 8px; }
.glance-head .glance-title { margin: 0; }
.glance-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.glance-card {
  display: flex; flex-direction: column; gap: 4px; padding: 10px 14px; text-align: left; color: inherit; font: inherit;
  border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow);
  border-left: 3px solid var(--accent-2);
}
.glance-card.is-link { cursor: pointer; transition: border-color .15s, transform .15s; }
.glance-card.is-link:hover { border-color: var(--border-strong); border-left-color: var(--accent-2); transform: translateY(-2px); }
.glance-card:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.glance-label { color: var(--text-2); font-size: 12.5px; font-weight: 500; }
.glance-value { font-size: 19px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.kpi.is-highlight { animation: highlight 1.8s ease; }
@keyframes highlight { 0%, 100% { box-shadow: var(--shadow); } 25% { box-shadow: 0 0 0 3px var(--accent-2), var(--shadow); } }
.kpi-label { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; color: var(--text-2); font-size: 12.5px; font-weight: 500; min-height: 38px; line-height: 1.5; }
.kpi-label > span:first-child { padding-top: 2px; }
.kpi-delta { flex: none; }
.kpi-value { font-size: 28px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi.is-hero .kpi-value { font-size: clamp(48px, 5vw, 68px); margin-top: 6px; }
.kpi-target { display: inline-flex; align-items: center; gap: 4px; width: fit-content; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; color: var(--text-2); background: var(--neutral-bg); font-variant-numeric: tabular-nums; }
.kpi-target svg { width: 12px; height: 12px; stroke-width: 2.6; }
.kpi-target.is-met { color: var(--good); background: var(--good-bg); }
.kpi-target.is-missed { color: var(--bad); background: var(--bad-bg); }
.kpi-sub { display: flex; gap: 10px; flex-wrap: wrap; color: var(--text-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.kpi-sub b { color: var(--text-2); font-weight: 600; }
.kpi-period { color: var(--text-2); font-size: 12px; font-variant-numeric: tabular-nums; }
.kpi-spark { height: 38px; margin-top: auto; }
.kpi.is-hero .kpi-spark { height: 120px; }
.delta { white-space: nowrap; display: inline-flex; align-items: center; gap: 3px; height: 22px; padding: 0 7px; border-radius: 6px; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; background: var(--neutral-bg); color: var(--text-2); }
.delta.good { background: var(--good-bg); color: var(--good); }
.delta.bad { background: var(--bad-bg); color: var(--bad); }
.delta svg { width: 12px; height: 12px; stroke-width: 2.4; }
.kpi .skeleton { height: 28px; width: 60%; }

.spotlight { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); min-height: 120px; }
.spotlight-label { color: var(--text-2); font-size: 12.5px; font-weight: 500; }
.spotlight-name { font-size: 17px; font-weight: 600; line-height: 1.3; }
.spotlight-value { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.spotlight-sub { color: var(--text-3); font-size: 12px; }

.tabs {
  position: sticky; top: 57px; z-index: 20; display: flex; gap: 4px; margin: 0 calc(var(--gutter) * -1) 18px;
  padding: 8px var(--gutter); overflow-x: auto; scrollbar-width: none;
  background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.tab {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 10px;
  border: 1px solid transparent; background: transparent; color: var(--text-2); font: 500 13.5px var(--font);
  cursor: pointer; white-space: nowrap;
}
.tab:hover { color: var(--text-1); background: var(--surface-2); }
.tab[aria-selected="true"] { color: var(--text-1); background: var(--surface-2); border-color: var(--border-strong); }
.tab[aria-selected="true"] svg { color: var(--accent-2); }
.tabs-arrow {
  display: none; position: sticky; z-index: 2; flex: none; align-self: center; width: 30px; height: 30px; padding: 0;
  border: 1px solid var(--border); border-radius: 50%; background: var(--surface); color: var(--text-2); cursor: pointer;
  box-shadow: 0 1px 4px rgba(16, 24, 40, .12);
}
.tabs-arrow-left { box-shadow: 0 1px 4px rgba(16, 24, 40, .12), 22px 0 18px 6px var(--bg); }
.tabs-arrow-right { box-shadow: 0 1px 4px rgba(16, 24, 40, .12), -22px 0 18px 6px var(--bg); }
.tabs-arrow svg { width: 16px; height: 16px; }
.tabs-arrow-left { left: calc(var(--gutter) * -1 + 6px); order: -1; margin-right: -26px; }
.tabs-arrow-left svg { transform: rotate(90deg); }
.tabs-arrow-right { right: calc(var(--gutter) * -1 + 6px); order: 99; margin-left: auto; }
.tabs-arrow-right svg { transform: rotate(-90deg); }
.tabs-arrow:hover { color: var(--text-1); background: var(--surface-2); }
.tabs.more-left .tabs-arrow-left, .tabs.more-right .tabs-arrow-right { display: inline-grid; place-items: center; }
.tab svg { width: 16px; height: 16px; }

.section { margin-bottom: 28px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 2px 12px; }
.section-head h3 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.section-head p { margin: 2px 0 0; color: var(--text-3); font-size: 12.5px; }
.grid { display: grid; gap: 14px; }
.section > .grid + .grid { margin-top: 14px; }
.window-strip {
  display: flex; flex-wrap: wrap; align-items: stretch; gap: 6px; margin: 0; padding: 4px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
}
.window { display: flex; flex-direction: column; justify-content: center; min-width: 64px; padding: 6px 12px; border-radius: 8px; }
.window dt { color: var(--text-3); font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.window dd { margin: 2px 0 0; font-size: 17px; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--text-1); }
.window.primary { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.window.primary dd { font-size: 20px; }
.window-delta { display: flex; flex-direction: column; justify-content: center; padding: 6px 12px; border-radius: 8px; font-size: 11.5px; color: var(--text-3); }
.window-delta b { font-size: 14px; font-variant-numeric: tabular-nums; color: var(--text-2); }
.window-delta.good { background: color-mix(in srgb, var(--good) 12%, transparent); }
.window-delta.good b { color: var(--good); }
.window-delta.bad { background: color-mix(in srgb, var(--bad) 12%, transparent); }
.window-delta.bad b { color: var(--bad); }
.section-head:has(.window-strip) { align-items: center; flex-wrap: wrap; }
@media (max-width: 760px) {
  .section-head:has(.window-strip) { flex-direction: column; align-items: stretch; }
}
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-full { grid-template-columns: minmax(0, 1fr); }
.grid-stats { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }

.card {
  display: flex; flex-direction: column; min-width: 0; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow);
}
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 14px 0; }
.card-title { margin: 0; font-size: 13.5px; font-weight: 600; color: var(--text-1); }
.card-meta { color: var(--text-3); font-size: 12px; }
.card-tools { display: flex; align-items: center; gap: 2px; flex: none; }
.card-tools > * { opacity: .65; transition: opacity .15s; }
.card:hover .card-tools > *, .card:focus-within .card-tools > * { opacity: 1; }
.card-tools .btn { height: 28px; width: 28px; padding: 0; justify-content: center; border-radius: 7px; }
.card-tools svg { width: 15px; height: 15px; }
.card-tools > .btn[data-export] { opacity: 1; width: auto; gap: 4px; padding: 0 9px; height: 26px; font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid var(--border-strong, var(--border)); color: var(--text-1); }
.card-tools > .btn[data-export] svg { width: 13px; height: 13px; }
.card-body { position: relative; padding: 10px 14px 14px; min-height: 80px; }
.chart { width: 100%; height: 280px; }
.chart .insight-basemap { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.chart .insight-basemap-labels { z-index: 1; }
.chart .insight-basemap-credit { position: absolute; right: 2px; bottom: 1px; z-index: 2; padding: 0 3px; font-size: 9px; line-height: 12px; color: #555; background: rgb(255 255 255 / 70%); }
.chart .insight-basemap-credit a { color: inherit; text-decoration: none; }
.card-body:has(> .chart-fill) { display: flex; flex-direction: column; flex: 1; }
.chart.chart-fill { flex: 1; height: auto; }
.card-state { display: grid; place-items: center; min-height: 140px; color: var(--text-3); text-align: center; padding: 16px; }
.card-state.error { color: var(--bad); }

.stat { padding: 16px; }
.stat-label { color: var(--text-2); font-size: 12.5px; font-weight: 500; }
.stat-value { margin-top: 6px; font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat-value-text { font-size: 18px; letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-top: 5px; }
.stat-sub { margin-top: 4px; color: var(--text-3); font-size: 12px; }
.stat.compare { display: flex; flex-direction: column; }
.compare-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; margin-top: auto; padding-top: 10px; }
.compare-other { color: var(--text-3); font-size: 12px; }
.compare-other b { color: var(--text-2); font-variant-numeric: tabular-nums; }
.compare-delta { padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text-2); background: var(--surface-2); }
.compare-delta.good { color: var(--good); background: color-mix(in srgb, var(--good) 12%, transparent); }
.compare-delta.bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); }

.table-tools { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-bottom: 8px; }
.table-search {
  height: 30px; width: min(260px, 100%); padding: 0 10px 0 30px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a93b5' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") 9px center / 14px no-repeat;
  color: var(--text-1); font: 12.5px var(--font);
}
.table-count { color: var(--text-3); font-size: 12px; }
.table-frame { position: relative; }
.table-frame::before, .table-frame::after {
  content: ''; position: absolute; top: 1px; bottom: 11px; width: 48px; z-index: 3; pointer-events: none;
  opacity: 0; transition: opacity .15s ease;
}
.table-frame::before { left: 1px; border-radius: 10px 0 0 10px; background: linear-gradient(to right, var(--surface-solid), transparent); }
.table-frame::after { right: 1px; border-radius: 0 10px 10px 0; background: linear-gradient(to left, var(--surface-solid), transparent); }
.table-frame.overflow-left::before, .table-frame.overflow-right::after { opacity: 1; }
.table-scroll-hint { display: none; align-items: center; gap: 4px; color: var(--text-3); font-size: 12px; }
.table-tools .table-scroll-hint.show { display: inline-flex; }
.table-wrap { overflow-x: auto; overflow-y: hidden; border-radius: 10px; border: 1px solid var(--border); }
.table-wrap::-webkit-scrollbar { width: 10px; height: 10px; }
.table-wrap::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
.table-wrap::-webkit-scrollbar-thumb:hover { background-color: var(--text-3); }
.table-wrap::-webkit-scrollbar-track { background: transparent; }
table.data { width: 100%; border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; font-size: 12.5px; }
table.data th {
  position: sticky; top: 0; z-index: 1; text-align: left; padding: 9px 10px; font-weight: 600; vertical-align: bottom;
  white-space: normal; min-width: 56px; max-width: 120px; line-height: 1.3;
  color: var(--text-2); background: var(--surface-solid); border-bottom: 1px solid var(--border-strong);
}
table.data th button { all: unset; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
table.data th button:focus-visible { outline: 2px solid var(--accent-2); border-radius: 4px; }
table.data th.num, table.data td.num { text-align: right; }
table.data th.num button { flex-direction: row-reverse; }
table.data td { padding: 8px 8px; border-bottom: 1px solid var(--border); color: var(--text-1); white-space: nowrap; max-width: 420px; overflow: hidden; text-overflow: ellipsis; }
table.data td.wrap { white-space: nowrap; min-width: 220px; max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
table.data tbody tr:hover td { background: var(--hover); }
table.data tr.total td { font-weight: 700; background: var(--surface-2); }
.sort-ind { color: var(--text-3); font-size: 10px; }
.bar-cell { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 3px; min-width: 44px; }
.bar-cell::after {
  content: ''; display: block; width: 100%; height: 3px; border-radius: 2px;
  background: linear-gradient(to right, var(--accent-2) var(--w, 0%), var(--grid) var(--w, 0%));
}
.table-more { display: flex; justify-content: center; margin-top: 10px; }
.wo-link { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-weight: 500; text-decoration: none; }
.wo-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.wo-link svg { width: 12px; height: 12px; opacity: .7; }
td.tone-met .bar-cell::after { background: linear-gradient(to right, var(--good) var(--w, 0%), var(--grid) var(--w, 0%)); }
td.tone-missed { color: var(--bad); font-weight: 600; background: color-mix(in srgb, var(--bad) 7%, transparent); }
td.tone-missed .bar-cell::after { background: linear-gradient(to right, var(--bad) var(--w, 0%), var(--grid) var(--w, 0%)); }
table.data td.tone-na { color: var(--text-3); }
.tone-legend { display: inline-flex; gap: 12px; flex-wrap: wrap; margin-left: auto; margin-right: 12px; color: var(--text-3); font-size: 12px; }
.tone-legend > span { display: inline-flex; align-items: center; gap: 5px; }
.tone-swatch { width: 10px; height: 10px; border-radius: 3px; background: var(--grid); }
.tone-swatch.tone-met { background: var(--good); }
.tone-swatch.tone-missed { background: var(--bad); }
.tone-swatch.tone-na { background: var(--text-3); opacity: .45; }
.tone-swatch.heat-good { background: color-mix(in srgb, var(--chart-good, var(--good)) 30%, transparent); }
.tone-swatch.heat-bad { background: color-mix(in srgb, var(--chart-bad, var(--bad)) 30%, transparent); }
table.data.matrix { font-variant-numeric: tabular-nums; }
table.data.matrix tbody th[scope="row"] {
  position: sticky; left: 0; z-index: 1; padding: 7px 12px; text-align: left; font-weight: 600;
  color: var(--text-1); background: var(--surface-solid); border-bottom: 1px solid var(--border);
}
table.data.matrix { width: auto; }
.matrix-split { display: grid; grid-template-columns: auto minmax(300px, 1fr); gap: 28px; align-items: start; }
.matrix-main { min-width: 0; }
.matrix-split.is-single { grid-template-columns: minmax(0, 1fr); }
.matrix-split.is-single table.matrix { width: 100%; }
.matrix-side { min-width: 0; padding-left: 24px; border-left: 1px solid var(--border); }
.matrix-side-title { margin: 6px 0 0; color: var(--text-2); font-size: 12.5px; font-weight: 600; }
@media (max-width: 1100px) {
  .matrix-split { grid-template-columns: minmax(0, 1fr); }
  .matrix-side { padding-left: 0; border-left: 0; }
}
table.data.matrix td, table.data.matrix thead th.num { padding: 7px 12px; width: 108px; min-width: 96px; max-width: 120px; }
table.data.matrix thead th:first-child { width: 180px; min-width: 140px; }
table.data.matrix td.missing { color: var(--text-3); }
table.data.matrix tr.total th[scope="row"], table.data.matrix tr.total td { font-weight: 700; border-bottom: 2px solid var(--border-strong); }
.chart-note { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0 0; color: var(--text-3); font-size: 12px; }
.chart-note .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--chart-flat, var(--text-3)); margin-left: 6px; }
.chart-note .map-scale { display: inline-block; width: 96px; height: 8px; border-radius: 4px; }
.chart-note .dot.good { background: var(--chart-good, var(--good)); }
.chart-note .dot.bad { background: var(--chart-bad, var(--bad)); }
.chart-note .key { display: inline-flex; align-items: center; white-space: nowrap; }
.chart-note .key + .key { margin-left: 4px; }
.chart-note .key .dot { margin: 0 4px 0 0; }

.chat {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 50; width: min(440px, 100vw);
  display: flex; flex-direction: column; background: var(--surface-solid); border-left: 1px solid var(--border-strong);
  box-shadow: -30px 0 60px -20px rgba(0, 0, 0, .5); animation: slide .25s ease;
}
@keyframes slide { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.chat-head { display: flex; justify-content: space-between; gap: 12px; padding: 18px 18px 12px; border-bottom: 1px solid var(--border); }
.chat-head h2 { margin: 0; font-size: 16px; }
.chat-sub { margin: 2px 0 0; color: var(--text-3); font-size: 12px; }
.chat-log { flex: 1; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.msg { max-width: 92%; display: flex; flex-direction: column; gap: 8px; animation: rise .25s ease both; }
.msg-user { align-self: flex-end; }
.msg-user .msg-bubble { background: var(--accent-grad); color: #fff; border-radius: 14px 14px 4px 14px; }
.msg-ai .msg-bubble { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px 14px 14px 4px; }
.msg-bubble { padding: 10px 13px; line-height: 1.55; }
.msg-bubble p { margin: 0 0 6px; }
.msg-bubble p:last-child { margin: 0; }
.msg-bubble ul, .msg-bubble ol { margin: 2px 0 8px; padding-left: 18px; }
.msg-bubble ul:last-child, .msg-bubble ol:last-child { margin-bottom: 0; }
.msg-bubble li { margin: 3px 0; }
.msg-bubble li::marker { color: var(--text-3); }
.msg-bubble b { font-variant-numeric: tabular-nums; }
.msg-ai .msg-bubble .msg-lead { margin-bottom: 10px; font-size: 14.5px; line-height: 1.5; }
.msg-ai .msg-bubble .msg-h { margin: 12px 0 2px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.msg-ai .msg-bubble .msg-lead + .msg-h { margin-top: 0; }
.msg-tag { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 999px; font-size: 10.5px; font-weight: 600; line-height: 16px; vertical-align: 1px; color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.msg-steps, .msg-evidence { max-width: 100%; }
.msg-steps > summary, .msg-evidence > summary {
  display: inline-flex; align-items: center; gap: 7px; max-width: 100%; height: 24px; padding: 0 10px; border-radius: 999px;
  list-style: none; cursor: pointer; color: var(--text-3); background: var(--hover); font-size: 12px; line-height: 1; user-select: none;
}
.msg-steps > summary::-webkit-details-marker, .msg-evidence > summary::-webkit-details-marker { display: none; }
.msg-steps > summary::after, .msg-evidence > summary::after { content: ''; flex: none; width: 6px; height: 6px; margin-left: 2px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg) translateY(-2px); transition: transform .15s; }
.msg-steps[open] > summary::after, .msg-evidence[open] > summary::after { transform: rotate(-135deg) translateY(-1px); }
.msg-steps > summary:hover, .msg-evidence > summary:hover { color: var(--text-2); }
.msg-steps > summary:focus-visible, .msg-evidence > summary:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.lane-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--good); }
.lane-dot.is-explore { background: var(--warn); }
.steps-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.steps-icon { flex: none; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--accent-2); border-right-color: transparent; animation: spin .8s linear infinite; }
.msg-steps.is-done .steps-icon { animation: none; border: 0; width: 12px; height: 12px; background: no-repeat center / 12px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2310b981' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E"); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .steps-icon { animation: none; } }
.msg-steps-list, .msg-evidence-body { max-height: 220px; overflow-y: auto; margin-top: 6px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); }
.msg-steps-list { display: flex; flex-direction: column; gap: 4px; }
.msg-evidence-body { max-height: 320px; font-size: 12px; color: var(--text-3); }
.msg-step { display: flex; align-items: center; gap: 8px; color: var(--text-3); font: 500 11.5px var(--mono); }
.msg-step svg { width: 13px; height: 13px; color: var(--good); }
.msg-cite { display: flex; gap: 6px; flex-wrap: wrap; }
.msg-cite button { all: unset; cursor: pointer; font-size: 11.5px; color: var(--text-2); padding: 2px 8px; border-radius: 6px; border: 1px solid var(--border); }
.msg-cite button:hover { color: var(--accent); border-color: var(--accent); }
.msg-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.chat-suggest { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 18px 10px; }
.suggestion {
  all: unset; cursor: pointer; font-size: 12.5px; padding: 6px 10px; border-radius: 999px; color: var(--text-2);
  border: 1px solid var(--border); background: var(--surface);
}
.suggestion:hover { color: var(--text-1); border-color: var(--accent); }
.suggestion:focus-visible { outline: 2px solid var(--accent-2); }
.chat-input { position: relative; display: flex; padding: 12px 18px 18px; border-top: 1px solid var(--border); }
.chat-input textarea {
  flex: 1; resize: none; max-height: 140px; min-height: 62px; padding: 10px 52px 10px 12px; border-radius: 14px; overflow-y: auto;
  border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text-1); font: 13.5px/1.4 var(--font);
}
.chat-input textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--hover); }
.chat-input .btn {
  position: absolute; right: 26px; bottom: 26px; height: 32px; width: 32px; padding: 0;
  justify-content: center; border-radius: 10px;
}
.chat-input .btn svg { width: 16px; height: 16px; }
.chat-input:has(textarea:placeholder-shown) .btn { opacity: .45; }
.chat-preview-note { margin: 0 18px 8px; padding: 8px 10px; border-radius: 10px; font-size: 12px; color: var(--text-2); background: var(--hover); }
.msg-bubble { overflow-wrap: anywhere; }
.msg-step { align-items: flex-start; }
.msg-step svg { flex: none; margin-top: 1px; }
.msg-step em { font-style: normal; color: var(--text-3); margin-left: 6px; }
.msg-step.pending svg { color: var(--text-3); animation: pulse 1s infinite ease-in-out; }
.msg-step.warn svg { color: var(--warn); }
@keyframes pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .msg-step.pending svg { animation: none; } }
.msg-note { align-self: center; }
.msg-bubble code { font: 12px var(--mono); padding: 1px 4px; border-radius: 4px; background: var(--hover); }
.msg-extra { display: flex; flex-direction: column; gap: 8px; }
.msg-extra:empty { display: none; }
.msg-warn { margin: 0; padding: 6px 10px; border-radius: 8px; font-size: 12px; color: var(--text-1); background: var(--bad-bg); border-left: 3px solid var(--warn); }
.msg-box { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font-size: 12.5px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.msg-box p { margin: 0; color: var(--text-2); }
.msg-box-title { font-weight: 600; font-size: 11.5px; letter-spacing: .02em; text-transform: uppercase; color: var(--text-3); }
.msg-boundary { border-left: 3px solid var(--warn); }
.msg-request { padding: 6px 8px; border-radius: 6px; background: var(--surface-2); color: var(--text-1) !important; white-space: pre-wrap; }
.msg-checklist label { display: flex; gap: 8px; align-items: flex-start; color: var(--text-1); cursor: pointer; }
.msg-checklist input { margin-top: 2px; accent-color: var(--accent); }
.msg-evidence dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; margin: 0; }
.msg-evidence dt { color: var(--text-3); }
.msg-evidence dd { margin: 0; color: var(--text-2); overflow-wrap: anywhere; }
.lane-note { margin: 0 0 8px; color: var(--text-2); }
.msg-sql { margin: 0; max-height: 180px; overflow: auto; padding: 6px 8px; border-radius: 6px; background: var(--surface-2); font: 11px/1.45 var(--mono); white-space: pre-wrap; color: var(--text-1); }

body.chat-open .page { margin-right: max(0px, calc((100vw - var(--page-max)) / 2)); }
@media (min-width: 1280px) {
  body.chat-open .page { padding-right: calc(440px + var(--gutter)); }
  body.chat-open .tabs { margin-right: calc((440px + var(--gutter)) * -1); padding-right: calc(440px + var(--gutter)); }
}

.modal { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; background: rgba(3, 6, 18, .55); backdrop-filter: blur(4px); }
.modal[hidden] { display: none; }
.modal-card { width: min(860px, 100%); max-height: calc(100vh - 32px); overflow: auto; border-radius: 20px; background: var(--surface-solid); border: 1px solid var(--border-strong); box-shadow: 0 40px 80px -20px rgba(0, 0, 0, .6); }
.modal-head { display: flex; justify-content: space-between; gap: 12px; padding: 20px 22px 8px; }
.modal-head h2 { margin: 0; font-size: 22px; }
.modal-body { padding: 8px 22px 22px; }
.modal-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.modal-stat { padding: 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.modal-stat span { display: block; color: var(--text-3); font-size: 12px; }
.modal-stat b { font-size: 22px; font-variant-numeric: tabular-nums; }
.modal-desc { color: var(--text-2); margin: 0 0 12px; }

.page-foot { margin-top: 32px; color: var(--text-3); font-size: 12px; }

.crumbs { display: flex; align-items: center; gap: 8px; margin-right: auto; padding-left: 12px; border-left: 1px solid var(--border); min-width: 0; }
.crumbs a { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); text-decoration: none; font-weight: 500; white-space: nowrap; padding: 6px 8px; border-radius: 8px; }
.crumbs a:hover { color: var(--text-1); background: var(--surface-2); }
.crumbs svg { width: 16px; height: 16px; }
.crumb-sep { color: var(--text-3); }
#crumb-current { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.app { display: grid; grid-template-columns: var(--side-width, 248px) minmax(0, 1fr); min-height: calc(100vh - 57px); }
body.side-collapsed { --side-width: 64px; }
.app > .page { width: 100%; }
.menu-toggle { display: none; }
.sidebar {
  position: sticky; top: 57px; height: calc(100vh - 57px); display: flex; flex-direction: column; gap: 4px;
  padding: 12px 10px; border-right: 1px solid var(--border); overflow-y: auto; overflow-x: hidden; z-index: 25;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px);
}
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-link {
  display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px; border-radius: 10px; border: 0;
  background: transparent; color: var(--text-2); font: 500 14px var(--font); text-decoration: none; cursor: pointer;
  white-space: nowrap; width: 100%; text-align: left;
}
.side-link svg { width: 19px; height: 19px; }
.side-link:hover { color: var(--text-1); background: var(--surface-2); }
.side-link.is-active { color: var(--text-1); background: var(--hover); box-shadow: inset 3px 0 0 var(--accent); }
.side-link.is-active svg { color: var(--accent); }
.side-label { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.side-count { min-width: 20px; padding: 0 6px; border-radius: 999px; font-size: 11px; font-weight: 600; text-align: center; color: var(--text-2); background: var(--surface-2); }
.side-count:empty { display: none; }
.side-section { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.side-section:empty { display: none; }
.side-heading { margin: 0 12px 6px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.side-sub {
  display: flex; align-items: center; gap: 10px; padding: 6px 12px; border-radius: 8px; color: var(--text-2);
  font-size: 13px; text-decoration: none; white-space: nowrap;
}
.side-sub svg { width: 15px; height: 15px; color: var(--text-3); }
.side-sub span { overflow: hidden; text-overflow: ellipsis; }
.side-sub:hover { color: var(--text-1); background: var(--surface-2); }
.side-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; }
body.side-collapsed .side-label, body.side-collapsed .side-count, body.side-collapsed .side-section { display: none; }
body.side-collapsed .side-link { justify-content: center; padding: 0; }
.side-scrim { display: none; }

.global-search { position: relative; flex: 1; max-width: 520px; margin: 0 auto; }
.global-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-3); }
.global-search input {
  width: 100%; height: 38px; padding: 0 12px 0 38px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-1); font: 14px var(--font);
}
.global-search input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--hover); }

.hero-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; width: 100%; flex-wrap: wrap; }
.hero-actions { display: flex; gap: 6px; flex-wrap: wrap; padding-top: 18px; }
.star-btn.is-on, .icon-toggle.star.is-on { color: #d97706; }
.star-btn.is-on svg, .icon-toggle.star.is-on svg { fill: currentColor; }
:root[data-theme="light"] .star-btn.is-on, :root[data-theme="light"] .icon-toggle.star.is-on { color: #b45309; }
.crumb-path { display: inline-flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; }
.crumb-path a { display: inline-block; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }

.library .lib-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin: 8px 0 22px; flex-wrap: wrap; }
.library .lib-head h1 { margin: 0; font-size: clamp(24px, 3vw, 32px); letter-spacing: -.02em; }
.library .lib-head .tagline { margin-top: 6px; }
.lib-actions { display: flex; align-items: center; gap: 6px; }
.lib-section { margin-bottom: 28px; }
.section-head { display: flex; align-items: baseline; gap: 12px; }
.section-link { margin-left: auto; font-size: 13px; font-weight: 500; text-decoration: none; }
.lib-meta-text { color: var(--text-3); font-size: 12.5px; }
.muted-note { color: var(--text-3); margin: 0; }
.crumb-trail { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: var(--text-3); }
.crumb-trail a { color: var(--text-2); text-decoration: none; }
.crumb-trail a:hover { color: var(--accent); text-decoration: underline; }
.crumb-trail [aria-current] { color: var(--text-1); font-weight: 600; }
.lib-toolbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 18px; flex-wrap: wrap; }
.lib-sort { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 13px; }
.lib-sort select, .field-label input, .field-label textarea, .tree-search {
  height: 34px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface-2);
  color: var(--text-1); font: 13.5px var(--font);
}
.lib-tabs { position: static; margin: 0 0 16px; padding: 0; border: 0; background: none; backdrop-filter: none; }
.lib-tabs .tab { text-decoration: none; }

.badge { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px; font-size: 11.5px; font-weight: 500; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); white-space: nowrap; }
.badge-accent { color: var(--accent); background: var(--hover); border-color: transparent; }

.lib-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.lib-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 14px; border-bottom: 1px solid var(--border); }
.lib-row:last-child { border-bottom: 0; }
.lib-row:hover { background: var(--hover); }
.lib-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; flex: none; color: var(--accent); background: var(--hover); }
.lib-icon svg { width: 18px; height: 18px; }
.lib-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.lib-title { color: var(--text-1); font-weight: 600; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-title:hover { color: var(--accent); text-decoration: underline; }
.lib-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.lib-path { color: var(--text-3); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-views { color: var(--text-3); font-size: 12.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.share-note { margin: 4px 0 0; color: var(--text-2); font-size: 13px; font-style: italic; }

.icon-toggle {
  display: inline-grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 8px; border: 0;
  background: transparent; color: var(--text-3); cursor: pointer; position: relative; z-index: 2;
}
.icon-toggle:hover { color: var(--text-1); background: var(--surface-2); }
.icon-toggle svg { width: 17px; height: 17px; }

.folder-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.folder-tile {
  position: relative; display: flex; align-items: flex-start; border-radius: 14px; border: 1px solid var(--border);
  background: var(--surface); box-shadow: var(--shadow); transition: border-color .15s, transform .15s;
}
.folder-tile:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); transform: translateY(-2px); }
.folder-link { flex: 1; min-width: 0; display: grid; grid-template-columns: 38px 1fr; column-gap: 12px; padding: 14px; color: inherit; text-decoration: none; }
.folder-icon { grid-row: span 2; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; color: #b45309; background: rgba(245, 158, 11, .14); }
:root[data-theme="dark"] .folder-icon { color: #fbbf24; }
.folder-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-count { color: var(--text-3); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-actions { display: flex; padding: 10px 8px 0 0; }

.report-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.report-card {
  position: relative; display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: 16px;
  border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow);
  transition: transform .2s, border-color .2s;
}
.report-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.report-card:focus-within { border-color: var(--accent-2); }
.report-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.report-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; color: #fff; background: var(--accent-grad); }
.report-icon svg { width: 19px; height: 19px; }
.report-card h3 { margin: 2px 0 0; font-size: 15.5px; letter-spacing: -.01em; line-height: 1.35; }
.report-link { color: var(--text-1); text-decoration: none; }
.report-link::after { content: ''; position: absolute; inset: 0; border-radius: 16px; }
.report-link:focus-visible { outline: none; }
.report-path { margin: 0; color: var(--text-3); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.report-card-foot { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border); }

.empty-state { display: grid; justify-items: center; gap: 6px; padding: 48px 16px; text-align: center; color: var(--text-3); border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.empty-state svg { width: 32px; height: 32px; }
.empty-state h3 { margin: 4px 0 0; color: var(--text-1); }
.empty-state p { margin: 0; }

.menu {
  position: fixed; z-index: 80; min-width: 210px; padding: 6px; border-radius: 12px; background: var(--surface-solid);
  border: 1px solid var(--border-strong); box-shadow: 0 20px 50px -12px rgba(0, 0, 0, .35);
}
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px;
  background: transparent; color: var(--text-1); font: 13.5px var(--font); text-align: left; cursor: pointer;
}
.menu-item svg { width: 16px; height: 16px; color: var(--text-3); }
.menu-item:hover, .menu-item:focus-visible { background: var(--hover); outline: none; }
.menu-item.danger { color: var(--bad); }
.menu-item.danger svg { color: var(--bad); }
.dialog-card { width: min(480px, 100%); }
.dialog-card .modal-body { display: grid; gap: 14px; }
.dialog-text { margin: 0; color: var(--text-2); }
.dialog-hint { margin: 0; color: var(--text-3); font-size: 12.5px; }
.dialog-error { margin: 0; color: var(--bad); font-size: 13px; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 0 22px 20px; }
.field-label { display: grid; gap: 6px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.field-label input { height: 38px; }
.field-label textarea { height: auto; padding: 8px 10px; resize: vertical; }
.field-label input:focus, .field-label textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--hover); }
.btn-danger { border: 0; color: #fff; background: var(--bad); }
.btn-danger:hover { filter: brightness(1.08); background: var(--bad); }
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree { max-height: 340px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; padding: 4px; }
.tree-search { width: 100%; }
.tree-option { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.tree-option:hover { background: var(--hover); }
.tree-option input { accent-color: var(--accent); }
.tree-option svg { width: 16px; height: 16px; color: #d97706; }
.tree-count { margin-left: auto; color: var(--text-3); font-size: 12px; }
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 90; transform: translateX(-50%); padding: 10px 16px; border-radius: 10px;
  color: #fff; background: #1e2440; box-shadow: 0 12px 32px -8px rgba(0, 0, 0, .45); font-weight: 500; transition: opacity .3s, transform .3s;
}
.toast.is-error { background: var(--bad); }
.toast.is-action { border: 0; font: 500 14px var(--font); cursor: pointer; }
.toast.is-action:hover { background: #2a3260; }
.toast.is-action:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.toast.is-leaving { opacity: 0; transform: translate(-50%, 8px); }

.table-wrap.is-paged { max-height: 640px; overflow-y: auto; }
.or-pager {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px;
  margin-top: 10px; font-size: 12px; color: var(--text-2);
}
.or-pager-range { font-variant-numeric: tabular-nums; }
.or-pager-buttons { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.or-pager-button {
  height: 28px; min-width: 28px; padding: 0 9px; border-radius: 7px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-1); font: inherit; font-size: 12px; font-weight: 500;
  font-variant-numeric: tabular-nums; cursor: pointer;
}
.or-pager-button:hover:not(:disabled) { background: var(--surface-2); border-color: var(--border-strong); }
.or-pager-button:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 1px; }
.or-pager-button:disabled { cursor: default; color: var(--text-3); opacity: .7; }
.or-pager-button.is-current { background: var(--accent); border-color: var(--accent); color: #fff; opacity: 1; }
.or-pager-gap { padding: 0 2px; color: var(--text-3); }
.or-truncated {
  margin: 10px 0 0; padding: 8px 12px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border);
  font-size: 12px; color: var(--text-2);
}
.or-truncated-export {
  all: unset; cursor: pointer; color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 2px;
}
.or-truncated-export:focus-visible { outline: 2px solid var(--accent-2); border-radius: 3px; }
[data-export][aria-busy="true"], .card-tools > .btn[data-export][aria-busy="true"] { cursor: progress; opacity: .6; }
dialog.or-export-dialog {
  width: min(440px, calc(100vw - 32px)); max-width: calc(100vw - 32px); padding: 22px 24px;
  border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface-solid);
  color: var(--text-1); font-family: var(--font); box-shadow: 0 40px 80px -20px rgba(0, 0, 0, .45);
}
dialog.or-export-dialog::backdrop { background: rgba(3, 6, 18, .55); backdrop-filter: blur(4px); }
.or-export-title { margin: 0 0 14px; font-size: 18px; font-weight: 600; }
.or-export-label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 500; color: var(--text-1); }
.or-export-input {
  width: 100%; height: 40px; padding: 0 12px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text-1); font: 400 14px/1 var(--font);
}
.or-export-input[aria-invalid="true"] { border-color: var(--bad); }
.or-export-error { margin: 6px 0 0; font-size: 12px; line-height: 1.4; color: var(--bad); }
.or-export-error:empty { display: none; }
.or-export-note { margin: 10px 0 0; font-size: 12px; line-height: 1.5; color: var(--text-2); }
.or-export-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.or-export-actions button {
  display: inline-flex; align-items: center; height: 36px; padding: 0 16px; border-radius: 10px;
  font: 500 13px/1 var(--font); cursor: pointer;
}
.or-export-cancel { border: 1px solid var(--border); background: var(--surface); color: var(--text-1); }
.or-export-cancel:hover { background: var(--surface-2); border-color: var(--border-strong); }
.or-export-submit { border: 0; color: #fff; background: var(--accent-grad); }
.or-export-submit:hover { filter: brightness(1.08); }
.table-wrap.is-loading { opacity: .45; pointer-events: none; transition: opacity .12s; }
.table-loading {
  position: absolute; left: 50%; top: 48px; transform: translateX(-50%); z-index: 3;
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface-solid); color: var(--text-1); font-size: 12px; font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .18); white-space: nowrap;
}
@media (prefers-reduced-motion: reduce) { .table-wrap.is-loading { transition: none; } }
table.data td.table-none { padding: 24px 12px; color: var(--text-3); text-align: left; white-space: normal; }
.card-tools .btn[data-export]:disabled { cursor: progress; opacity: .6; }
.toast { max-width: min(560px, calc(100vw - 32px)); line-height: 1.45; }

.lib-exports { padding: 6px 4px; }
.lib-exports-body { overflow-x: auto; }
.lib-exports-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.lib-exports-table th {
  text-align: left; padding: 10px 12px; font-size: 12px; font-weight: 600; color: var(--text-3);
  border-bottom: 1px solid var(--border-strong);
}
.lib-exports-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); color: var(--text-1); vertical-align: top; }
.lib-exports-table tr:last-child td { border-bottom: 0; }
.lib-exports-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.lib-exports-optional { white-space: nowrap; color: var(--text-2); }
.lib-exports-name { font-weight: 500; overflow-wrap: anywhere; }
.lib-exports-error { display: block; margin-top: 2px; font-size: 12px; color: var(--bad); }
.lib-exports-table th:first-child { width: 30%; }
.lib-exports-table th.lib-exports-email-col { width: 28%; }
.lib-exports-email { display: block; font-size: 12px; line-height: 1.4; color: var(--text-1); overflow-wrap: anywhere; }
.lib-exports-email.is-muted { color: var(--text-2); }
.lib-exports-email.is-failed { color: var(--bad); }
.lib-exports-email-inline { display: none; margin-top: 4px; }
.lib-exports-status {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 500;
  color: var(--text-2); background: var(--neutral-bg); white-space: nowrap;
}
.lib-exports-status.is-ready { color: var(--good); background: var(--good-bg); }
.lib-exports-status.is-failed { color: var(--bad); background: var(--bad-bg); }
.lib-exports-empty { margin: 12px; color: var(--text-2); font-size: 13px; }
.lib-exports-download {
  display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--accent); font-size: 12px; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.lib-exports-download:hover { background: var(--surface-2); border-color: var(--border-strong); }
.lib-exports-download:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 1px; }
@media (max-width: 640px) {
  .lib-exports-optional { display: none; }
  .lib-exports-email-col { display: none; }
  .lib-exports-email-inline { display: block; }
}

@media (max-width: 1000px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .menu-toggle { display: inline-flex; }
  .sidebar {
    position: fixed; left: 0; top: 57px; bottom: 0; height: auto; width: 272px; z-index: 45;
    transform: translateX(-100%); transition: transform .2s ease; background: var(--surface-solid);
  }
  body.side-open .sidebar { transform: none; box-shadow: 20px 0 50px -20px rgba(0, 0, 0, .4); }
  body.side-open .side-scrim { display: block; position: fixed; inset: 57px 0 0 0; z-index: 44; background: rgba(3, 6, 18, .35); }
  body.side-collapsed .side-label, body.side-collapsed .side-count { display: inline; }
  body.side-collapsed .side-section { display: block; }
  body.side-collapsed .side-link { justify-content: flex-start; padding: 0 12px; }
  #side-collapse { display: none; }
  .global-search { order: 3; flex-basis: 100%; max-width: none; }
}
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar-inner { flex-wrap: wrap; row-gap: 8px; }

}
@media (max-width: 720px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .grid-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi.is-hero { grid-column: auto; grid-row: auto; }
  .kpi.is-hero .kpi-spark { height: 70px; }
  .kpis { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  #classic-link span, #open-chat span, .brand-tag, .pill-preview, .crumb-sep, #crumb-current { display: none; }
  .landing-points { grid-template-columns: minmax(0, 1fr); }
  .report-list { grid-template-columns: minmax(0, 1fr); }
  .topbar-inner { gap: 10px; }
  .topbar-actions { margin-left: auto; gap: 4px; }
  .filterbar { padding: 8px; }
  .filter-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; width: 100%; padding-bottom: 2px; }
  .filter-chips > * { flex: none; }
  .hero-meta { gap: 6px; }
  .hero-meta > *, .hero-meta .pill { max-width: 100%; }
  .hero-meta .pill { height: auto; min-height: 24px; padding-block: 3px; white-space: normal; text-align: left; line-height: 1.35; }
  .topbar { position: relative; }
  .crumbs { order: 3; flex: 1 0 100%; padding-left: 0; border-left: 0; overflow-x: auto; scrollbar-width: none; }
  .tabs { top: 0; }
  .summary-list li { grid-template-columns: 10px 1fr; }
  .summary-list li .bullet-link { grid-column: 2; justify-self: start; }
  .chart { height: 240px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

:root { --chart-good: var(--good); --chart-bad: var(--bad); --chart-flat: var(--text-3); }
:root[data-theme="light"] { --chart-good: #443DF6; --chart-flat: #0FA5A0; --chart-bad: #F5A524; }

table.data.pivot tbody th[scope="row"] {
  position: static; padding: 8px 10px; text-align: left; font-weight: 500; max-width: 260px;
  color: var(--text-1); background: transparent; border-bottom: 1px solid var(--border);
}
table.data.pivot .total-col { font-weight: 700; }
table.data.pivot td.missing { color: var(--text-3); }
table.data.pivot thead th:first-child { min-width: 150px; }
table.data.pivot thead th.num { white-space: normal; min-width: 72px; max-width: 112px; overflow-wrap: normal; hyphens: auto; }

.embedded .topbar,
.embedded .sidebar,
.embedded .side-scrim,
.embedded .hero-row { display: none; }

.embedded .app { grid-template-columns: minmax(0, 1fr); min-height: 0; }

.embedded body { background: transparent; }

.embedded .page { max-width: none; --gutter: 16px; padding: 12px var(--gutter) 28px; }
.embedded .hero { margin-bottom: 12px; }

.embedded .tabs { top: 0; }

.embedded body.chat-open .page { margin-right: 0; }

table.data.pivot td.is-clickable { cursor: pointer; }
table.data.pivot td.is-clickable:hover { background: var(--hover); }
table.data.pivot td.is-clickable:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
table.data.pivot td.is-selected { box-shadow: inset 0 0 0 2px var(--accent); font-weight: 700; }
table.data.matrix td.is-clickable { cursor: pointer; }
table.data.matrix td.is-clickable:hover { box-shadow: inset 0 0 0 1px var(--accent); }
table.data.matrix td.is-clickable:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
table.data.matrix td.is-selected { box-shadow: inset 0 0 0 2px var(--accent); font-weight: 700; }
.card-action-note { display: flex; align-items: center; gap: 8px; margin: -4px 0 8px; color: var(--text-2); font-size: 13px; }
.click-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 12px; color: var(--text-2); font-size: 13px; }
.click-strip-title { font-weight: 600; }
.legend-picks { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; color: var(--text-2); font-size: 12px; }
.legend-pick { display: inline-flex; align-items: center; gap: 6px; }
.legend-pick[aria-pressed="true"] { border-color: var(--accent, currentColor); color: var(--text-1, inherit); font-weight: 600; }
.legend-pick-swatch { width: 10px; height: 10px; border-radius: 2px; flex: none; }
.popover-presets { max-height: none; min-height: 0; flex: none; }
.card.is-compact table.data.pivot thead th:first-child { min-width: 0; }
.card.is-compact table.data.pivot thead th.num { min-width: 48px; max-width: 84px; }
.card.is-compact table.data th, .card.is-compact table.data td { padding-left: 5px; padding-right: 5px; }
.card.is-compact table.data.pivot tbody th[scope="row"] { padding-left: 6px; padding-right: 6px; }

.or-tip-sheet { border-collapse: collapse; width: auto; min-width: 0; margin-top: 6px; font-size: 12px; color: inherit; }
.or-tip-sheet th { font-weight: 600; text-align: left; padding: 2px 8px 2px 0; border-bottom: 1px solid var(--border-strong); }
.or-tip-sheet td { padding: 2px 8px 2px 0; border-bottom: 1px solid var(--border); white-space: nowrap; }
.or-tip-sheet td:not(.num) { white-space: normal; overflow-wrap: anywhere; min-width: 8em; }
.or-tip-sheet th, .or-tip-sheet td { padding-left: 6px; padding-right: 6px; }
.or-tip-sheet .num { text-align: right; font-variant-numeric: tabular-nums; }
.or-tip-sheet tr > :first-child { padding-left: 0; }
.or-tip-sheet tr > :last-child { padding-right: 0; }
.or-tip-more, .or-tip-note { font-size: 11px; opacity: 0.75; margin-top: 4px; }
.or-tip-box { position: absolute; z-index: 1000; width: max-content; max-width: calc(100vw - 32px); padding: 8px 10px;
  background: var(--tooltip-bg); color: var(--text-1); border: 1px solid var(--border-strong); border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25); font-size: 12px; line-height: 1.45; pointer-events: none; }
.or-tip-box[hidden] { display: none; }
