@charset "UTF-8";

/* GEO Lab workbench — shared design tokens and page chrome. */

:root {
  --bg: #faf8f1;
  --paper: #ffffff;
  --ink: #22201c;
  --ink-2: #49433b;
  --muted: #675f54;
  --line: #e1dcd2;
  --line-strong: #cbc2b3;
  --track: #f1eee8;
  --teal: #78502b;
  --teal-ink: #5e3c1c;
  --teal-soft: #f6eee0;
  --mint: #b1773d;
  --data-1: #98602d;
  --data-2: #596d85;
  --data-3: #c8baaa;
  --warn: #92400e;
  --warn-soft: #fdf3e4;
  --danger: #923a2d;
  --side: #22201c;
  --sidebar: #eae6de;
  --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
  --radius: 4px;
  --shadow: 0 1px 2px rgba(41, 34, 22, .05), 0 10px 24px -20px rgba(41, 34, 22, .37);
  --glass-surface: #faf9f5;
  --glass-hover: #fffdf8;
  --glass-selected: #f0ece4;
  --glass-ink: #433c34;
  --glass-rim: #6e5f4727;
}

@supports (backdrop-filter: blur(2px)) or (-webkit-backdrop-filter: blur(2px)) {
  :root {
    --glass-surface: #faf9f59c;
    --glass-hover: #fffdf8d4;
    --glass-selected: #efeae0b8;
    --glass-blur: blur(1.5px);
    --glass-light:
      radial-gradient(ellipse 62% 72% at 18% 0%, #ffffff94, transparent 82%),
      linear-gradient(180deg, #ffffff47, #ffffff00 55%, #ab99800c);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    linear-gradient(90deg, var(--grid-line, #88775b12) 1px, transparent 1px),
    linear-gradient(var(--grid-line, #88775b12) 1px, transparent 1px),
    radial-gradient(ellipse at 60% 0, #fffdf6 0, #f6efdf00 75%);
  background-size: 28px 28px, 28px 28px, 100% 100%;
  font: 1rem/1.6 "Inter", "Segoe UI", "PingFang SC", "Microsoft YaHei UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body.page { padding-left: 224px; }
@media (max-width: 1080px) { body.page { padding-left: 196px; } }
@media (max-width: 820px) { body.page { padding-left: 0; } }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .6; }
h1, h2, h3, h4, p { margin: 0; }
[hidden] { display: none !important; }
.workspace-logout { background: transparent; border: 0; text-align: left; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

/* ---------- shell ---------- */

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 224px;
  display: flex;
  flex-direction: column;
  padding: 26px 18px 20px;
  overflow-y: auto;
  background: var(--sidebar);
  border-right: 1px solid var(--line-strong);
  color: var(--ink);
  z-index: 3;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 6px 26px; color: var(--ink); }
.brand-text { font-weight: 700; font-size: 1.16rem; letter-spacing: -.02em; line-height: 1.1; }
.brand-dot { color: var(--mint); }
.brand-text small { display: block; margin-top: 5px; font-size: .72rem; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.nav-group { margin: 18px 10px 6px; font-size: .75rem; letter-spacing: .1em; font-weight: 650; color: var(--muted); }
.side-nav .nav-group:first-child { margin-top: 0; }
.nav {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border-left: 2px solid transparent;
  border-radius: 2px;
  color: var(--ink-2);
  font-size: .9rem;
}
.nav-index { font: .7rem var(--mono); color: var(--muted); }
.nav:hover { background: #f3f0e9; color: var(--ink); }
.nav.is-active { background: #faf5eb; color: var(--ink); border-left-color: var(--mint); }
.nav.is-active .nav-index { color: var(--teal); }
.side-note {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--line-strong);
  font-size: .78rem;
  color: var(--ink-2);
}
.side-note small { display: block; font: .68rem var(--mono); color: var(--muted); margin-top: 2px; }
.dot { width: 6px; height: 6px; background: var(--mint); flex: none; }
.version { margin-left: auto; font: .72rem var(--mono); color: var(--muted); }

.shell { margin-left: 224px; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 54px;
  padding: 0 32px;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  font-size: .8rem;
  color: var(--muted);
}
.crumb b { color: var(--ink); font-weight: 650; }
.crumb span { margin: 0 7px; color: var(--line-strong); }
.topbar-status { display: flex; align-items: center; gap: 7px; font-size: .76rem; }
.topbar-status i { display: none; }

.content { max-width: 1180px; margin: 0 auto; padding: 38px 32px 64px; }

h1 {
  margin-top: 12px;
  font-size: clamp(2rem, 3.4vw, 2.65rem);
  line-height: 1.12;
  letter-spacing: -.025em;
  font-weight: 680;
}

/* ---------- buttons and chips ---------- */

.button, .primary, .chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 999px;
  font-weight: 500;
  font-size: .9rem;
  border: 1px solid transparent;
  padding: 10px 15px;
  white-space: nowrap;
}
:is(.button, .primary, .ghost, .chip, :where(.workspace-nav a[aria-current], .tools-menu > summary)) {
  color: var(--glass-ink);
  border: 1px solid #ffffffe0;
  border-radius: 16px;
  background-color: var(--glass-fill, var(--glass-surface));
  background-image: var(--glass-light, none);
  -webkit-backdrop-filter: var(--glass-blur, none);
  backdrop-filter: var(--glass-blur, none);
  box-shadow: inset 0 1px 1px #ffffffcf, inset 0 -1px 2px #8d7b6316,
              0 0 0 1px var(--glass-rim), 0 2px 5px #51452f0d;
}
.primary { --glass-rim: #6e5f4745; }
.primary span { color: inherit; font-size: .95rem; }
.chip[aria-pressed="true"], .workspace-nav a[aria-current], .tools-menu[open] > summary {
  --glass-fill: var(--glass-selected);
  --glass-rim: #6e5f4752;
}
:is(.button, .primary, .ghost, .chip, :where(.workspace-nav a[aria-current], .tools-menu > summary)):focus-visible {
  outline: 2px solid #78664c;
  outline-offset: 3px;
}
@media (hover: hover) {
  :is(.button, .primary, .ghost, .chip, :where(.workspace-nav a[aria-current], .tools-menu > summary)):hover:not(:disabled) {
    background-color: var(--glass-hover);
    box-shadow: inset 0 1px 2px #fffffff5, inset 0 -1px 2px #8d7b631c,
                0 0 0 1px var(--glass-rim), 0 3px 8px #51452f15;
  }
}
:is(.button, .primary, .ghost, .chip, :where(.workspace-nav a[aria-current], .tools-menu > summary)):active:not(:disabled) {
  background-color: var(--glass-selected);
  box-shadow: inset 0 1px 3px #7d6e5328, 0 0 0 1px var(--glass-rim);
}

@media (prefers-reduced-motion: no-preference) {
  :is(.button, .primary, .ghost, .chip, :where(.workspace-nav a[aria-current], .tools-menu > summary)) {
    transition: transform 200ms ease, background-color 200ms ease, box-shadow 200ms ease;
  }
  @media (hover: hover) {
    :is(.button, .primary, .ghost, .chip, :where(.workspace-nav a[aria-current], .tools-menu > summary)):hover:not(:disabled) {
      transform: translateY(-1px);
    }
  }
  :is(.button, .primary, .ghost, .chip, :where(.workspace-nav a[aria-current], .tools-menu > summary)):active:not(:disabled) {
    transform: scale(.985);
    transition-duration: 110ms;
  }
}
.chip {
  border-radius: 999px;
  padding: 5px 11px;
  font-size: .78rem;
  font-weight: 500;
}
@media (forced-colors: active) {
  :is(.button, .primary, .ghost, .chip, :where(.workspace-nav a[aria-current], .tools-menu > summary)) {
    color: ButtonText;
    border-color: ButtonText;
    background: ButtonFace;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .chip[aria-pressed="true"], .workspace-nav a[aria-current], .tools-menu[open] > summary { border-color: Highlight; }
  :is(.button, .primary, .ghost, .chip, :where(.workspace-nav a[aria-current], .tools-menu > summary)):focus-visible {
    outline-color: Highlight;
  }
}

/* ---------- panels ---------- */

.workbench { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(250px, .78fr); gap: 22px; align-items: start; }
.panel {
  min-width: 0;
  padding: 26px 28px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  scroll-margin-top: 74px;
}
.content > .panel { margin-top: 22px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.panel-kicker { font-size: .68rem; letter-spacing: .16em; font-weight: 700; color: var(--muted); margin-bottom: 7px; }
.panel h2 { font-size: 1.3rem; letter-spacing: -.015em; font-weight: 660; }
.panel-lede { margin-top: 10px; font-size: .92rem; line-height: 1.65; color: var(--ink-2); max-width: 68ch; }
.tag { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 2px; font-size: .78rem; font-weight: 650; white-space: nowrap; }
.tag.teal { background: var(--teal-soft); color: var(--teal); }

.panel-aside { background: #f8f6f1; box-shadow: none; }
.panel-aside .panel-kicker { font-family: var(--mono); }
.panel-aside h2 { font-size: 1.02rem; }
.plain-list { list-style: none; margin: 16px 0; padding: 0; display: grid; gap: 13px; }
.plain-list li { display: grid; gap: 2px; padding-left: 14px; border-left: 2px solid var(--line-strong); }
.plain-list b { font-size: .86rem; font-weight: 650; }
.plain-list span { font-size: .78rem; color: var(--muted); line-height: 1.55; }
.aside-note { font-size: .78rem; line-height: 1.6; color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; }
.text-link { color: var(--teal); text-decoration: underline; text-underline-offset: 3px; }
.panel-aside .text-link { display: inline-block; font-size: .88rem; margin-top: 9px; }
.archive-filter { max-width: 480px; margin-top: 14px; }
.archive-filter > div { position: relative; }
.archive-filter input { width: 100%; padding-right: 42px; }
.archive-filter kbd { position: absolute; right: 12px; top: 10px; padding: 3px 6px; border: 1px solid var(--line-strong); border-radius: 3px; font: .76rem var(--mono); color: var(--muted); pointer-events: none; }

/* ---------- form ---------- */

.field-label { display: block; font-size: .72rem; font-weight: 700; letter-spacing: .04em; color: var(--muted); margin-bottom: 8px; }
input, select, textarea {
  color: var(--ink);
  background: #fdfcf8;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 9px 11px;
  min-height: 40px;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--teal);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(153, 105, 56, .14);
}
textarea { display: block; width: 100%; min-height: 82px; resize: vertical; line-height: 1.6; font-size: 1rem; }
form { margin: 0; }
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr) 118px; gap: 10px; margin-top: 14px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field { min-width: 0; }
.field label { display: block; font-size: .72rem; font-weight: 700; letter-spacing: .04em; color: var(--muted); margin-bottom: 6px; }
.field input, .field select { width: 100%; }
.field small { display: block; margin-top: 7px; font-size: .74rem; line-height: 1.5; color: var(--muted); }
.key-field { margin-top: 16px; }
.examples { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; font-size: .72rem; color: var(--muted); }
.examples > div { display: flex; flex-wrap: wrap; gap: 6px; }
.targets { margin-top: 14px; }
.targets > summary { font-size: .8rem; color: var(--ink-2); }
.targets > summary span { color: var(--muted); margin-left: 6px; font-size: .74rem; }
.live-button { width: 100%; margin-top: 18px; padding: 13px 16px; font-size: .94rem; }
.run-actions { display: flex; align-items: stretch; gap: 10px; margin-top: 18px; }
.run-actions .live-button { flex: 1; margin-top: 0; }
.clear-button { flex: none; padding: 0 18px; }

.feedback { margin-top: 16px; padding: 11px 13px; border-radius: 4px; background: var(--track); color: var(--ink-2); font-size: .8rem; line-height: 1.6; overflow-wrap: anywhere; }
.feedback.error { background: #fbeeeb; color: var(--danger); }

/* ---------- live results ---------- */

.live-results { margin-top: 18px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; }
.stat { padding: 10px 12px; border-radius: 9px; background: var(--teal-soft); }
.stat b { display: block; font-size: 1.3rem; line-height: 1.2; color: var(--teal); font-variant-numeric: tabular-nums; }
.stat span { font-size: .72rem; color: var(--ink-2); }
.history-link { display: inline-block; margin-top: 14px; font-size: .84rem; font-weight: 650; color: var(--teal); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- answer cards ---------- */

.answer-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-top: 10px; background: #fff; }
.answer-card > summary { font-size: .85rem; font-weight: 600; color: var(--ink-2); line-height: 1.5; cursor: pointer; overflow-wrap: anywhere; }
.answer-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .88rem; line-height: 1.78; margin: 12px 0; }
.answer-note { font-size: .78rem; line-height: 1.6; color: var(--muted); margin: 8px 0 0; }
.source-list { margin: 0; padding-left: 20px; font-size: .8rem; line-height: 1.55; color: var(--muted); }
.source-list li { padding: 3px 0; }
.source-list a { color: var(--teal); text-decoration: underline; overflow-wrap: anywhere; }
.source-list small { color: var(--muted); margin-left: 5px; }

.source-url-line { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; margin-top: 3px; }
.source-url {
  max-width: 100%;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--track);
  color: var(--ink-2);
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: .7rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  user-select: all;
}
.copy-button {
  flex: none;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #fff;
  color: var(--muted);
  font-size: .7rem;
  line-height: 1.5;
  padding: 1px 7px;
  white-space: nowrap;
}
.copy-button:hover { border-color: var(--teal); color: var(--teal); background: var(--teal-soft); }
.source-cell { display: grid; gap: 4px; }

/* ---------- report panel ---------- */

.report-controls { display: grid; grid-template-columns: minmax(0, 1.4fr) 130px minmax(0, 1fr) auto; gap: 10px; align-items: end; margin-top: 18px; }
.report-controls .field { display: grid; gap: 6px; min-width: 0; }
.report-controls .field > span { font-size: .72rem; font-weight: 700; letter-spacing: .04em; color: var(--muted); }
.report-controls .field select, .report-controls .field input { width: 100%; }
.report-controls .primary { min-height: 42px; }

.report-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 18px; margin-top: 18px; align-items: start; }
.report-side { border: 1px solid var(--line); border-radius: 10px; padding: 14px; background: #f9fbfa; }
@media (min-width: 1081px) {
  .report-side { position: sticky; top: 82px; max-height: calc(100vh - 104px); overflow: auto; }
}
.report-side h3 { margin-bottom: 10px; font-size: .8rem; font-weight: 650; color: var(--muted); }
.report-item { display: grid; gap: 2px; width: 100%; padding: 8px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.report-item:hover { background: #fff; border-color: var(--line); }
.report-item.is-current { background: #fff; border-color: var(--line); box-shadow: inset 2px 0 0 var(--teal); }
.report-item b { font-size: .78rem; font-weight: 600; }
.report-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .7rem; color: var(--muted); }
.report-body { min-height: 220px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.report-empty { font-size: .84rem; color: var(--muted); }
.report-doc-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); font-size: .76rem; color: var(--muted); }

.md { max-width: 76ch; font-size: .88rem; line-height: 1.8; color: var(--ink); }
.md h1, .md h2, .md h3, .md h4 { margin: 18px 0 6px; line-height: 1.35; letter-spacing: -.01em; }
.md > :first-child { margin-top: 0; }
.md h2 { font-size: 1.08rem; }
.md h3, .md h4 { font-size: .95rem; }
.md p { margin: 6px 0; }
.md ul, .md ol { margin: 6px 0; padding-left: 22px; }
.md li { margin: 3px 0; }
.md code { padding: 1px 5px; border-radius: 4px; background: var(--track); font-size: .8rem; }
.md blockquote { margin: 8px 0; padding: 4px 12px; border-left: 2px solid #8fc0b1; color: var(--ink-2); }
.md hr { margin: 14px 0; border: 0; border-top: 1px solid var(--line); }
.md-table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: .8rem; }
.md-table th, .md-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; }

.reverse-panel { margin-top: 20px; padding: 4px 16px 16px; border: 1px solid var(--line); border-radius: 10px; }
.reverse-panel > summary { padding: 12px 0; font-size: .88rem; font-weight: 650; color: var(--ink); }
.reverse-body { display: grid; gap: 12px; padding-top: 4px; }
.platform-picks { display: flex; flex-wrap: wrap; gap: 10px; }
.platform-pick { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: .8rem; cursor: pointer; }
.platform-pick:has(input:checked) { border-color: var(--teal); background: var(--teal-soft); color: var(--teal); }
.platform-pick input { width: 14px; height: 14px; min-height: 0; accent-color: var(--teal); }
.draft-list { display: grid; gap: 14px; margin-top: 6px; }
.draft-card { padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: #fbfdfc; }
.draft-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line); font-size: .78rem; color: var(--muted); }
.draft-head b { font-size: .9rem; color: var(--ink); }

/* ---------- footer ---------- */
.page-foot { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 34px; padding-top: 18px; border-top: 1px solid var(--line); font-size: .72rem; color: var(--muted); }
.page-foot b { color: var(--teal); }

/* ---------- charts ---------- */

.kpi-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #f9fbfa; }
.kpi b { display: block; font-size: 1.45rem; line-height: 1.2; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi span { display: block; margin-top: 2px; font-size: .74rem; color: var(--muted); }
.kpi small { display: block; margin-top: 3px; font-size: .72rem; color: var(--ink-2); }

.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.chart-card { min-width: 0; padding: 16px 16px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.chart-card.wide { grid-column: 1 / -1; }
.chart-card-head h4 { font-size: .95rem; font-weight: 650; letter-spacing: -.01em; }
.hint { margin: 5px 0 12px; font-size: .75rem; line-height: 1.55; color: var(--muted); }

.chart-bars { display: grid; gap: 1px; }
.bar-row {
  display: grid;
  grid-template-columns: minmax(84px, 164px) minmax(70px, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 6px 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
}
button.bar-row, a.bar-row { cursor: pointer; }
button.bar-row:hover, a.bar-row:hover { background: #f4f8f7; }
.bar-row.is-selected { background: var(--teal-soft); }
.bar-row.is-selected .bar-label b { color: var(--teal); font-weight: 700; }
.bar-label { min-width: 0; display: grid; }
.bar-label b { display: block; font-size: .84rem; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-label small { display: block; font-size: .7rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wide-labels .bar-row { grid-template-columns: minmax(110px, 240px) minmax(70px, 1fr) auto; }

.bar-track { position: relative; display: block; height: 10px; border-radius: 99px; background: var(--track); overflow: hidden; }
.bar-ghost { position: absolute; inset: 0 auto 0 0; height: 100%; border-radius: 99px; background: rgba(75, 143, 163, .32); }
.bar-fill { position: relative; display: block; height: 100%; border-radius: 99px; background: var(--data-1); transition: width .35s ease; }
.bar-value { display: flex; align-items: baseline; gap: 4px; font-variant-numeric: tabular-nums; }
.bar-value b { font-size: .86rem; font-weight: 650; min-width: 2ch; text-align: right; }
.bar-value small { font-size: .7rem; color: var(--muted); }
.chart-empty { font-size: .8rem; color: var(--muted); padding: 10px 8px; }

.chart-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.chart-picker { display: flex; align-items: center; gap: 6px; margin-left: auto; font-size: .74rem; color: var(--muted); }
.chart-picker select { min-height: 30px; padding: 3px 8px; font-size: .76rem; }
.chart-toolbar-note { font-size: .72rem; color: var(--muted); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 14px; margin: 0 0 10px; padding: 0; list-style: none; font-size: .74rem; color: var(--muted); }
.chart-legend li { display: flex; align-items: center; gap: 6px; }
.chart-legend li::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--data-1); }
.chart-legend li.peer::before { background: var(--data-2); }

.matrix-scroll { overflow-x: auto; }
.matrix { width: 100%; border-collapse: separate; border-spacing: 2px; font-size: .8rem; }
.matrix thead th { padding: 4px 8px 8px; font-size: .72rem; font-weight: 650; color: var(--muted); text-align: center; white-space: nowrap; }
.matrix thead th.matrix-label { text-align: left; }
.matrix tbody th {
  max-width: 220px;
  padding: 7px 10px 7px 4px;
  font-weight: 500;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.matrix td { min-width: 42px; padding: 7px 8px; border-radius: 5px; text-align: center; font-variant-numeric: tabular-nums; }
.matrix td.matrix-total { background: #f4f8f7; font-weight: 650; }
.matrix th.is-selected { color: var(--teal); background: var(--teal-soft); border-radius: 5px 5px 0 0; }
.matrix td.is-selected { outline: 1.5px solid rgba(15, 107, 92, .35); outline-offset: -1.5px; }
.matrix-tag { margin-left: 6px; padding: 0 5px; border: 1px solid rgba(15, 107, 92, .28); border-radius: 99px; font-size: .62rem; color: var(--teal); }

/* ---------- responsive ---------- */

@media (max-width: 1080px) {
  .sidebar { width: 196px; }
  .shell { margin-left: 196px; }
  .content { padding: 30px 24px 56px; }
  .topbar { padding: 0 24px; }
  .workbench { grid-template-columns: minmax(0, 1fr); }
  .chart-grid { grid-template-columns: minmax(0, 1fr); }
  .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-controls { grid-template-columns: minmax(0, 1fr) 130px; }
  .report-layout { grid-template-columns: minmax(0, 1fr); }
  .report-side { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
  .report-side h3 { width: 100%; margin-bottom: 2px; }
  .report-item { width: auto; }
}

@media (max-width: 820px) {
  .sidebar { position: static; width: auto; padding: 12px 16px 4px; border-right: 0; border-bottom: 1px solid var(--line-strong); }
  .brand { padding: 0; }
  .brand img { width: 28px; height: 28px; }
  .brand-text small, .side-note, .nav-index, .nav-group { display: none; }
  .side-nav { flex-direction: row; gap: 4px; overflow-x: auto; padding-bottom: 4px; }
  .nav { flex: none; min-height: 44px; padding: 6px 9px; font-size: .86rem; border-left: 0; border-bottom: 2px solid transparent; }
  .nav.is-active { border-bottom-color: var(--mint); }
  .shell { margin-left: 0; }
  .topbar { padding: 0 16px; }
  .content { padding: 24px 16px 48px; }
  .panel { padding: 20px 18px; }
}

@media (max-width: 680px) {
  .archive-filter kbd { display: none; }
  .archive-filter input { padding-right: 11px; }
}

@media (max-width: 560px) {
  .form-grid, .form-grid.two { grid-template-columns: minmax(0, 1fr); }
  .kpi-row { grid-template-columns: minmax(0, 1fr); }
  .bar-row { grid-template-columns: minmax(64px, 104px) minmax(50px, 1fr) auto; gap: 8px; }
  .wide-labels .bar-row { grid-template-columns: minmax(72px, 120px) minmax(50px, 1fr) auto; }
  .report-controls { grid-template-columns: minmax(0, 1fr); }
  .run-actions { flex-wrap: wrap; }
}

@media print {
  .sidebar, .topbar, .run-actions, .nav-group { display: none !important; }
  .shell { margin-left: 0; }
  .content, body.page { padding-left: 0; margin-left: 0; }
}
