:root {
  color-scheme: light;
  --ink: #20383f;
  --muted: #556d74;
  --line: #dfe9e9;
  --canvas: #f3f7f7;
  --accent: #246775;
  --accent-dark: #1c535e;
  --accent-soft: #e8f4f5;
  --brand-light: #79c6d1;
  --sidebar: #23444d;
  font: 14px/1.5 system-ui, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button { color: inherit; }
a { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px;
}
.sidebar :focus-visible { outline-color: var(--brand-light); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 236px; display: flex; flex-direction: column;
  padding: 29px 16px 17px; background: var(--sidebar); color: #e0eff0; overflow: auto;
}
.wordmark { margin: 0 4px 28px; }
.wordmark img { display: block; width: 100%; height: auto; }
.project { display: flex; align-items: center; gap: 10px; background: #2b515b; border: 1px solid #416773; border-radius: 10px; padding: 10px; margin-bottom: 29px; }
.project-letter, .brand-avatar { display: inline-grid; place-items: center; width: 33px; height: 33px; border-radius: 9px; flex: none; background: var(--accent-soft); color: var(--accent-dark); font-weight: 740; }
.project strong, .project small, .device strong, .device small { display: block; }
.project strong { color: #f4fbfc; font-size: 12px; font-weight: 650; }
.project small, .device small { color: #b4d0d5; font-size: 11px; }
.nav-label { margin: 0 10px 9px; color: #a7c8ce; font-size: 10px; font-weight: 700; letter-spacing: .13em; }
.secondary-label { margin-top: 28px; }
.nav-link { display: flex; align-items: center; gap: 11px; min-height: 42px; padding: 0 10px; margin: 3px 0; border-radius: 7px; color: #d1e5e8; text-decoration: none; font-size: 13px; }
.nav-link span { flex: 1; }
.nav-link:hover, .demo-control:hover { color: #fff; background: #2e5660; }
.nav-link.active { color: #153d46; background: var(--brand-light); font-weight: 650; }
.sidebar-footer { margin-top: auto; padding-top: 29px; }
.demo-control { display: flex; align-items: center; gap: 10px; width: 100%; background: transparent; border: none; border-radius: 7px; color: #d1e5e8; padding: 9px 10px; text-align: left; font-size: 12px; }
.device { display: flex; align-items: center; gap: 10px; padding: 16px 8px 3px; margin-top: 11px; border-top: 1px solid #416773; color: #d1e5e8; }
.device strong { font-size: 12px; }
.device i, .chart-label i { width: 7px; height: 7px; border-radius: 100%; background: #5dcc9d; margin-left: auto; flex: none; }

.shell { margin-left: 236px; min-width: 0; }
.topbar { height: 66px; padding: 0 30px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); background: #fff; }
.breadcrumbs { display: flex; align-items: center; gap: 9px; font-size: 12px; color: var(--muted); }
.breadcrumbs strong { color: var(--accent); font-weight: 650; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px;
  padding: 0 12px; border-radius: 7px; border: 1px solid #d9e5e7; background: #fff; color: #3f626c; font-size: 12px; font-weight: 670; white-space: nowrap;
}
.button:hover { background: var(--canvas); border-color: #bdd5d9; }
.button.primary { color: #fff; background: var(--accent); border-color: var(--accent); }
.button.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }

main { width: min(100%, 1530px); margin: 0 auto; padding: 26px 30px 40px; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 0 0 20px; }
h1 { margin: 0; color: var(--ink); font-size: 36px; font-weight: 760; letter-spacing: -.047em; line-height: 1.1; }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.period-tag { color: var(--muted); font-size: 12px; font-weight: 650; white-space: nowrap; padding: 4px 0; }
.filters { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin: 0 0 19px; }
.control { display: inline-flex; align-items: center; gap: 7px; padding: 0 9px; min-height: 36px; border-radius: 7px; border: 1px solid var(--line); color: var(--accent); background: #fff; }
.control select, .control input { color: var(--ink); border: 0; background: transparent; min-height: 32px; font-size: 12px; font-weight: 650; }
.control input { min-width: 122px; width: 143px; }
.control input::-webkit-calendar-picker-indicator { cursor: pointer; }
.control select { padding: 0 6px 0 2px; max-width: 190px; }
.clear { border: 0; background: none; color: var(--accent-dark); font-size: 12px; font-weight: 650; }
.clear:hover { text-decoration: underline; }
.banner { background: var(--accent-soft); border: 1px solid #c8e0e3; color: var(--accent-dark); padding: 10px 12px; border-radius: 8px; margin-bottom: 16px; font-size: 13px; font-weight: 600; }

.card { background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 1px 2px #19243a05; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 15px; }
.metrics.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metric { padding: 15px 15px 13px; min-height: 117px; }
.metric-top { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 680; }
.metric-icon { display: inline-grid; place-items: center; width: 31px; height: 31px; border-radius: 8px; flex: none; }
.accent { color: var(--accent-dark); background: var(--accent-soft); }
.negative { color: #963d47; background: #fbeef0; }
.purple { color: #6547a4; background: #f1edfc; }
.green { color: #25664f; background: #eaf7f0; }
.blue { color: #325eaa; background: #eaf1fe; }
.metric > strong { display: block; margin-top: 6px; font-size: 30px; font-weight: 740; letter-spacing: -.04em; line-height: 1.08; }
.metric > small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(250px, 1fr); gap: 14px; }
.panel { overflow: hidden; margin-bottom: 15px; min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; padding: 17px 17px 13px; }
.panel-head h2 { margin: 0; font-size: 16px; font-weight: 725; letter-spacing: -.017em; line-height: 1.25; }
.panel-head p { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.panel-head > .button { flex: none; }
.chart-label { display: flex; align-items: center; gap: 6px; white-space: nowrap; color: var(--muted); font-size: 11px; padding-top: 3px; }
.chart-label i { background: var(--accent); }
.chart { position: relative; margin: 6px 13px 12px 4px; min-height: 178px; }
.trend { width: 100%; height: 196px; display: block; overflow: visible; }
.trend .grid-line { stroke: var(--line); stroke-width: 1px; }
.trend .trend-line { stroke: var(--accent); stroke-width: 3px; stroke-linecap: round; }
.trend-point { fill: var(--accent); }
.trend text { fill: var(--muted); font-size: 11px; font-weight: 550; }
.chart-empty { position: absolute; inset: 11% 7% 16% 13%; display: grid; place-content: center; justify-items: center; gap: 4px; pointer-events: none; text-align: center; }
.chart-empty span, .empty-icon { display: grid; place-items: center; border-radius: 10px; width: 34px; height: 34px; background: var(--accent-soft); color: var(--accent-dark); }
.chart-empty strong { background: #fff; font-size: 12px; padding: 1px 6px; }
.chart-empty small { background: #fff; font-size: 11px; color: var(--muted); padding: 0 6px; }
.coverage-list { display: grid; gap: 7px; padding: 0 17px 16px; }
.coverage-row { min-height: 22px; display: grid; grid-template-columns: 21px minmax(105px, 1.7fr) minmax(25px, 1fr) 40px; align-items: center; gap: 7px; font-size: 11.5px; }
.coverage-row > strong { text-align: right; white-space: nowrap; }
.coverage-row > strong small { font-size: inherit; color: var(--muted); font-weight: 500; }
.engine-mark { display: inline-grid; place-items: center; width: 21px; height: 21px; border-radius: 6px; color: var(--engine); background: color-mix(in srgb, var(--engine) 10%, white); font-size: 11px; font-weight: 760; }
progress { width: 100%; height: 5px; appearance: none; border: 0; border-radius: 99px; overflow: hidden; color: var(--accent); background: var(--accent-soft); }
progress::-webkit-progress-bar { background: var(--accent-soft); }
progress::-webkit-progress-value { background: var(--accent); border-radius: 99px; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 99px; }

.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 12px; }
th { padding: 10px 17px; background: var(--canvas); color: var(--muted); font-size: 11px; font-weight: 700; white-space: nowrap; }
td { padding: 11px 17px; border-top: 1px solid var(--line); color: var(--ink); }
tbody tr:hover { background: #f8fbfb; }
.prompt-text { display: inline-block; max-width: 56ch; min-width: 15ch; color: var(--ink); font-weight: 650; }
.badge { display: inline-block; border-radius: 5px; padding: 3px 7px; background: #f0f2f7; color: #5b6579; font-size: 10px; font-weight: 700; white-space: nowrap; }
.badge.accent { background: var(--accent-soft); color: var(--accent-dark); }
.badge.purple { background: #f1edfc; color: #6547a4; }
.badge.green { background: #eaf7f0; color: #25664f; }
.brand-cell { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.brand-avatar { width: 27px; height: 27px; border-radius: 7px; font-size: 12px; }
.numeric { white-space: nowrap; font-variant-numeric: tabular-nums; }
.text-button { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; padding: 2px 0; border: 0; background: transparent; color: var(--accent-dark); font-size: 11px; font-weight: 700; }
.text-button:hover, .source-link:hover { text-decoration: underline; }
.row-actions { display: flex; flex-wrap: wrap; gap: 5px 12px; }
.inline-citation { color: var(--accent-dark); font-weight: 650; text-underline-offset: 2px; }
.connection-note { color: var(--muted); font-size: 12px; margin: 0; }
.discovery-profile { display: grid; justify-items: start; gap: 10px; padding: 0 17px 17px; }
.discovery-profile p { margin: 0; }
.discovery-profile .row-actions { justify-content: start; }
.discovery-views { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 15px; }
.discovery-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0; }
.discovery-toolbar .discovery-views { margin: 0; }
.discovery-method { margin-bottom: 12px; }
.discovery-sources { padding: 13px 17px; font-size: 12px; }
.discovery-sources summary { cursor: pointer; font-weight: 650; }
.discovery-sources ul { margin: 8px 0 0; padding-left: 20px; }
.discovery-sources li + li { margin-top: 5px; }
a.button { text-decoration: none; }
.source-link { color: var(--accent-dark); font-weight: 650; text-decoration: none; overflow-wrap: anywhere; }
.source-link svg { vertical-align: middle; }
.source-link small { display: block; color: var(--muted); font-weight: 400; }
.empty { padding: 39px 14px 44px; display: grid; justify-items: center; gap: 7px; text-align: center; }
.empty strong { font-size: 14px; }
.empty p { margin: 0 0 4px; font-size: 12px; color: var(--muted); }
.topic-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 15px; }
.topic-card { position: relative; display: grid; gap: 5px; text-align: left; padding: 15px; color: var(--ink); }
.topic-card:hover, .topic-card.chosen { border-color: var(--accent); }
.topic-card > small { color: var(--muted); }
.topic-card > svg { position: absolute; right: 15px; top: 21px; color: var(--accent); }

dialog { width: min(620px, calc(100% - 26px)); max-height: min(90vh, 860px); padding: 0; border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 16px 65px #1d22323e; color: var(--ink); }
dialog::backdrop { background: #23444d92; }
.dialog-head { padding: 18px 20px 15px; display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin: 0; font-size: 22px; letter-spacing: -.028em; }
.dialog-head p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.dialog-body { padding: 16px 20px 20px; }
.icon-button { display: inline-grid; place-items: center; width: 31px; height: 31px; flex: none; color: var(--muted); background: #fff; border: 1px solid var(--line); border-radius: 7px; }
.icon-button:hover { background: var(--canvas); }
.form, .form label { display: grid; min-width: 0; gap: 10px; }
.form label { gap: 4px; font-size: 12px; font-weight: 670; }
.form label small { color: var(--muted); font-size: 11px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.form input:not([type="checkbox"]), .form select, .form textarea { width: 100%; min-width: 0; border-radius: 7px; padding: 7px 9px; border: 1px solid #dce1ec; color: #333b50; background: #fff; font-weight: 450; }
.form textarea { resize: vertical; }
.form textarea[readonly] { background: var(--canvas); }
.form .checkbox { display: flex; align-items: center; gap: 7px; }
input[type="checkbox"] { accent-color: var(--accent); width: 15px; height: 15px; }
.prompt-preview { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0; border-radius: 7px; padding: 8px 10px; background: var(--canvas); color: #464f66; font-size: 12px; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 7px; justify-content: end; margin-top: 10px; }
.response-list { display: grid; margin: 10px 0; }
.response-row { display: flex; align-items: center; gap: 8px; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 10px 6px; text-align: left; }
.response-row:hover { background: var(--canvas); }
.response-row > span:nth-of-type(2) { margin-left: auto; color: var(--muted); font-size: 11px; }
.response-badges { margin-top: 12px; }
.answer-text { white-space: pre-wrap; overflow-wrap: anywhere; }
#toast { position: fixed; z-index: 2; bottom: 16px; right: 18px; max-width: min(420px, calc(100vw - 36px)); padding: 10px 14px; border-radius: 8px; background: var(--sidebar); color: white; box-shadow: 0 3px 14px #141a3533; opacity: 0; visibility: hidden; pointer-events: none; }
#toast.visible { opacity: 1; visibility: visible; }

@media (max-width: 1100px) {
  .sidebar { width: 200px; }
  .shell { margin-left: 200px; }
  main, .topbar { padding-left: 19px; padding-right: 19px; }
  .overview-grid { grid-template-columns: minmax(0, 1.35fr) minmax(245px, 1fr); }
}
@media (max-width: 850px) {
  .sidebar { width: 61px; padding: 17px 7px; }
  .shell { margin-left: 61px; }
  .wordmark { margin: 0 auto 20px; width: 42px; height: 18px; overflow: hidden; }
  .wordmark img { width: 82px; max-width: none; }
  .project, .nav-link > svg:nth-of-type(2), .nav-label, .device div, .device i { display: none; }
  .nav-link { justify-content: center; position: relative; padding: 0; }
  .nav-link span, .demo-control span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .demo-control, .device { justify-content: center; }
}
@media (max-width: 640px) {
  .topbar { height: 56px; padding: 0 11px; }
  main { padding: 20px 11px 24px; }
  .breadcrumbs { font-size: 10px; }
  .top-actions .button { min-height: 32px; padding: 0 8px; font-size: 11px; }
  h1 { font-size: 28px; }
  .page-head { align-items: start; }
  .period-tag { display: none; }
  .metrics, .metrics.three { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .metric { padding: 10px; min-height: 104px; }
  .metric-icon { width: 25px; height: 25px; }
  .metric-top { gap: 5px; font-size: 11px; }
  .overview-grid, .topic-grid { grid-template-columns: 1fr; gap: 0; }
  .topic-card { margin-bottom: 6px; }
  .panel-head { padding: 13px 10px 10px; }
  .discovery-profile { padding: 0 10px 13px; }
  .chart-label { display: none; }
  td, th { padding-right: 10px; padding-left: 10px; }
  .form-grid { grid-template-columns: 1fr; }
}
