/* GEO Studio · Signal Lattice Design System v4 */
:root {
  --surface-0: #080a0f;
  --surface-1: #0f1219;
  --surface-2: #161b26;
  --surface-3: #1e2533;
  --ink: #f0f2f5;
  --muted: #8b939e;
  --faint: #5c6370;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --signal: #d4e157;
  --signal-dim: #a8b830;
  --signal-fg: #141808;
  --pulse: #7c6cf0;
  --pulse-dim: #5a4dc4;
  --ok: #5dd39e;
  --danger: #f07178;
  --warn: #e8b86d;
  /* legacy aliases */
  --bg0: var(--surface-0);
  --bg1: var(--surface-1);
  --bg2: var(--surface-2);
  --accent: var(--signal);
  --accent-dim: var(--signal-dim);
  --font-display: "Syne", "Noto Sans SC", sans-serif;
  --font-body: "DM Sans", "Noto Sans SC", sans-serif;
  --font-mono: "JetBrains Mono", "Noto Sans SC", ui-monospace, monospace;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow-panel: 0 1px 0 rgba(255,255,255,0.04) inset, 0 8px 32px rgba(0,0,0,0.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--surface-0);
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--signal); text-decoration: none; }
a:hover { color: #e8ef7a; }

/* ── Typography ── */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
}
h1 { font-size: 1.75rem; }
h2 { font-size: 1.15rem; font-weight: 600; }
.page-kicker {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--pulse);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 0.35rem;
}

/* ── Buttons ── */
.geo-btn, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 0;
  padding: 0.55rem 1.1rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--signal);
  color: var(--signal-fg);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.geo-btn:hover, .btn:hover {
  background: #e0ea6a;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(212, 225, 87, 0.25);
  text-decoration: none;
  color: var(--signal-fg);
}
.geo-btn--ghost, .btn.secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  box-shadow: none;
}
.geo-btn--ghost:hover, .btn.secondary:hover {
  background: rgba(255,255,255,0.04);
  border-color: var(--muted);
  transform: none;
  color: var(--ink);
}
.geo-btn--block, .btn-block { width: 100%; }

/* ── Chips ── */
.geo-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 500;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
}
.geo-chip-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--faint);
}
.geo-chip--ok { color: var(--ok); border-color: rgba(93,211,158,0.35); }
.geo-chip--ok .geo-chip-dot { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.geo-chip--warn { color: var(--warn); border-color: rgba(232,184,109,0.35); }
.geo-chip--warn .geo-chip-dot { background: var(--warn); }

/* ── Panels ── */
.geo-panel {
  padding: 1.15rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  box-shadow: var(--shadow-panel);
}
.geo-panel-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--pulse);
  margin-bottom: 0.5rem;
}
.geo-panel h2, .geo-panel h3 {
  font-size: 1.05rem;
  margin-bottom: 0.45rem;
}
.geo-panel p {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.55;
}
.geo-panel--hero {
  background: linear-gradient(135deg, rgba(124,108,240,0.08) 0%, var(--surface-2) 45%);
  border-color: rgba(124,108,240,0.2);
}
.geo-panel--highlight {
  border-color: rgba(212,225,87,0.35);
  box-shadow: var(--shadow-panel), 0 0 24px rgba(212,225,87,0.08);
}
.geo-panel--link {
  display: flex;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
  position: relative;
  padding-bottom: 2rem;
}
.geo-panel--link:hover {
  border-color: rgba(212,225,87,0.3);
  transform: translateY(-2px);
  text-decoration: none;
  color: inherit;
}
.geo-panel-icon {
  font-size: 1.1rem;
  color: var(--pulse);
  margin-bottom: 0.35rem;
  opacity: 0.85;
}
.geo-panel-arrow {
  position: absolute;
  right: 1.1rem;
  bottom: 1rem;
  color: var(--signal);
  font-size: 1.1rem;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.15s, transform 0.15s;
}
.geo-panel--link:hover .geo-panel-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* ── Dashboard ── */
.dash {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-height: 0;
  overflow: auto;
  padding-bottom: 0.5rem;
}
.dash-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}
.dash-title {
  font-size: 1.65rem;
  margin: 0 0 0.35rem;
  letter-spacing: -0.03em;
}
.dash-lede {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.dash-header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

/* Pipeline */
.geo-pipeline {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  padding: 0.25rem 0;
  flex-shrink: 0;
}
.geo-pipeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.12s;
}
.geo-pipeline-step:hover {
  background: rgba(255,255,255,0.04);
  text-decoration: none;
  color: inherit;
}
.geo-pipeline-num {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--pulse);
  letter-spacing: 0.05em;
}
.geo-pipeline-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ink);
}
.geo-pipeline-line {
  flex: 0 0 24px;
  height: 1px;
  background: linear-gradient(90deg, var(--line-strong), var(--pulse), var(--line-strong));
  opacity: 0.6;
}

/* Bento grid */
.dash-bento {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: auto auto;
  gap: 0.75rem;
  min-height: 0;
}
.dash-bento .geo-panel--hero { grid-column: span 2; }
.dash-bento .geo-panel:not(.geo-panel--link):not(.geo-panel--hero):first-of-type + .geo-panel,
.dash-bento > .geo-panel:nth-child(2) { grid-column: span 2; }

/* Homepage instruments */
.dash-gauges {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
}
.dash-meter {
  min-width: 0;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  box-shadow: var(--shadow-panel);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.dash-meter-kicker {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}
.dash-meter-readout {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 3.25rem;
}
.dash-meter-num {
  font-family: var(--font-mono);
  font-size: 1.45rem;
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1.1;
}
.dash-meter-unit {
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--muted);
}
.dash-meter-empty { color: var(--faint); }
.dash-meter-empty-hint,
.dash-meter-sub {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.4;
}
.dash-meter-sub a,
.dash-meter-empty-hint a { color: var(--ink); }
.dash-ring {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
}
.dash-ring-track,
.dash-ring-value {
  fill: none;
  stroke-width: 5;
}
.dash-ring-track { stroke: var(--line-strong); }
.dash-ring-value {
  stroke: var(--ok);
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 32px 32px;
}
.dash-ring--ok .dash-ring-value { stroke: var(--ok); }
.dash-ring--warn .dash-ring-value { stroke: var(--warn); }
.dash-ring--danger .dash-ring-value { stroke: var(--danger); }
.dash-ring--empty .dash-ring-value { stroke: transparent; }
.dash-bar {
  height: 5px;
  border-radius: 999px;
  background: var(--surface-0);
  border: 1px solid var(--line);
  overflow: hidden;
}
.dash-bar > span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--ok);
}
.dash-bar--warn > span { background: var(--warn); }
.dash-bar--danger > span { background: var(--danger); }
.dash-bar--empty > span { width: 0; background: transparent; }
.dash-spark {
  width: 100%;
  height: 36px;
  margin-top: 0.15rem;
}
.dash-gauges .trend-line {
  stroke: var(--signal);
  stroke-width: 1.75;
}
.dash-work {
  grid-column: 1 / -1;
}
.dash-work-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}
.dash-work-all {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted);
}
.dash-work-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem 1.1rem;
}
.dash-work-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.45rem;
  align-items: baseline;
  min-width: 0;
  padding: 0.28rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.82rem;
}
.dash-work-item a {
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-work-kind {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  color: var(--pulse);
  flex-shrink: 0;
}
.dash-work-time {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--faint);
  white-space: nowrap;
}
.dash-provider-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.dash-provider-chips .geo-chip { padding: 0.25rem 0.55rem; font-size: 0.72rem; }

/* ── Sidebar ── */
body.has-sidebar {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  height: 100vh;
  overflow: hidden;
}
.sidebar {
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 1.15rem 0.85rem 1rem;
  border-right: 1px solid var(--line);
  background: var(--surface-1);
}
.sidebar-nav { flex: 1; overflow: auto; min-height: 0; }
.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--ink);
  margin-bottom: 0.25rem;
}
.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-sm);
  background: var(--signal);
  color: var(--signal-fg);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
}
.brand-text {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.brand-text em {
  font-style: normal;
  color: var(--signal);
}
.sidebar-tag {
  margin: 0 0 1.25rem;
  padding-left: 2.55rem;
  color: var(--faint);
  font-size: 0.72rem;
}
.sidebar-foot {
  flex-shrink: 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
  margin-top: 0.5rem;
}
.sidebar-trust {
  margin: 0 0 0.65rem;
  font-size: 0.68rem;
  color: var(--faint);
  font-family: var(--font-mono);
}
.sidebar-user {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  color: var(--muted);
}
.nav-group { margin-bottom: 1.1rem; }
.nav-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 0.35rem;
  padding: 0 0.5rem;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.42rem 0.55rem;
  border-radius: var(--radius-sm);
  border-left: 2px solid transparent;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.12s, background 0.12s, border-color 0.12s;
}
.nav-link span { flex: 1; }
.nav-link:hover {
  color: var(--ink);
  background: rgba(255,255,255,0.04);
  text-decoration: none;
}
.nav-link.active {
  color: var(--signal);
  background: rgba(212,225,87,0.08);
  border-left-color: var(--signal);
}
.nav-link em {
  font-style: normal;
  font-size: 0.62rem;
  color: var(--faint);
  font-weight: 400;
}

/* ── Main shell ── */
.main-wrap {
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-width: 0;
  overflow: hidden;
  padding: 1rem 1.25rem 0.85rem;
}
body:not(.has-sidebar) .main-wrap {
  max-width: 1080px;
  margin: 0 auto;
  height: auto;
  min-height: 100vh;
  overflow: visible;
}

/* ── Module pages (workbench) ── */
.module-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-height: 0;
}
.module-page > .module-grid,
.module-page > form.module-grid,
.module-page > .settings-grid,
.module-page > section.mod:last-child { flex: 1; min-height: 0; }
.module-bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem 1.25rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.module-bar-title { display: flex; align-items: baseline; gap: 0.65rem; white-space: nowrap; }
.module-bar-title h1 { margin: 0; font-size: 1.25rem; }
.module-bar-desc {
  margin: 0; color: var(--muted); font-size: 0.82rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.module-grid {
  flex: 1; display: grid; gap: 0.6rem; min-height: 0;
}
.module-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.module-grid--3 { grid-template-columns: minmax(220px, 26%) minmax(0, 37%) minmax(0, 37%); }
.module-grid--dash { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); }
.mod {
  display: flex; flex-direction: column; min-height: 0; min-width: 0;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface-2); overflow: hidden; box-shadow: var(--shadow-panel);
}
.mod-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.5rem 0.8rem; border-bottom: 1px solid var(--line);
  flex-shrink: 0; background: rgba(0,0,0,0.15);
}
.mod-head h2 {
  margin: 0; font-family: var(--font-mono); font-size: 0.68rem;
  font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint);
}
.mod-body { flex: 1; min-height: 0; overflow: auto; padding: 0.7rem 0.8rem; }
.mod-body--fill { display: flex; flex-direction: column; padding: 0.55rem 0.65rem; }
.mod-body--fill textarea, .mod-body--fill pre { flex: 1; min-height: 0; height: 100%; margin: 0; }
.mod-body--fill textarea { resize: none; min-height: 8rem; }
.mod-foot { padding: 0.5rem 0.8rem; border-top: 1px solid var(--line); flex-shrink: 0; }
.mod-fill { flex: 1; min-height: 0; }
.mod-body pre { max-height: none; border: 0; background: transparent; padding: 0; font-size: 0.8rem; }

/* ── Forms ── */
label { display: block; font-size: 0.82rem; color: var(--muted); margin: 0.75rem 0 0.3rem; font-weight: 500; }
input[type="text"], input[type="password"], input[type="url"], textarea, select {
  width: 100%; padding: 0.55rem 0.7rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-0); color: var(--ink); font: inherit; font-size: 0.875rem;
  transition: border-color 0.12s, box-shadow 0.12s;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: rgba(212,225,87,0.45);
  box-shadow: 0 0 0 3px rgba(212,225,87,0.1);
}
textarea { min-height: 140px; font-family: var(--font-mono); font-size: 0.85rem; }
.form-compact label { margin-top: 0.55rem; font-size: 0.78rem; }
.form-compact label:first-child { margin-top: 0; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.55rem; }
.checkbox-row { display: flex; align-items: center; gap: 0.4rem; margin-top: 0.55rem; font-size: 0.82rem; color: var(--muted); }
.checkbox-row input { width: auto; margin: 0; }

/* ── Misc ── */
.flash-ok { color: var(--ok); margin: 0.75rem 0; }
.flash-err { color: var(--danger); margin: 0.75rem 0; }
.flash-inline { margin: 0; font-size: 0.82rem; }
.hint { font-size: 0.82rem; color: var(--muted); }
.badge {
  display: inline-block; font-size: 0.72rem; padding: 0.15rem 0.45rem;
  border-radius: 4px; border: 1px solid var(--line); color: var(--muted);
}
.badge.ok { color: var(--ok); border-color: rgba(93,211,158,0.35); }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.btn-row .btn, .btn-row .geo-btn { margin-top: 0; }
.platform-checks { display: flex; flex-wrap: wrap; gap: 0.45rem 0.85rem; margin-top: 0.25rem; }
.check-inline { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.82rem; color: var(--muted); }
.hint-list { margin: 0.35rem 0 0; padding-left: 1.1rem; color: var(--muted); font-size: 0.82rem; line-height: 1.55; }
.hint-list a { color: var(--ink); }
.empty-state {
  height: 100%; min-height: 6rem; padding: 1.5rem;
  display: flex; align-items: center; justify-content: center; text-align: center;
  color: var(--muted); font-size: 0.85rem;
  border: 1px dashed var(--line); border-radius: var(--radius-sm);
  background: rgba(0,0,0,0.2);
}
.empty-state p { margin: 0; max-width: 14rem; line-height: 1.45; }
pre, .mono {
  font-family: var(--font-mono); font-size: 0.82rem;
  white-space: pre-wrap; word-break: break-word;
  background: var(--surface-0); border: 1px solid var(--line);
  padding: 0.9rem; border-radius: var(--radius-sm); overflow: auto; max-height: 28rem;
}
.cli-prompt-box {
  width: 100%; min-height: 8rem; font-family: var(--font-mono); font-size: 0.75rem;
  background: var(--surface-0); border: 1px solid var(--line); border-radius: var(--radius-sm);
  color: var(--ink); padding: 0.65rem; resize: vertical;
}
.table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.table th, .table td { border-bottom: 1px solid var(--line); padding: 0.5rem 0.45rem; text-align: left; }
.table th { color: var(--faint); font-weight: 500; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; }
.table-scroll { overflow: auto; height: 100%; }
.stat-strip { display: flex; gap: 0.55rem; flex-shrink: 0; }
.stat-pill {
  padding: 0.35rem 0.7rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2); font-size: 0.78rem;
}
.stat-pill strong { color: var(--ink); margin-right: 0.35rem; }

/* Settings */
.provider-tabs { display: flex; flex-wrap: wrap; gap: 0.35rem; flex-shrink: 0; }
.provider-tab {
  padding: 0.35rem 0.65rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--muted); font: inherit; font-size: 0.8rem; cursor: pointer;
}
.provider-tab:hover { color: var(--ink); }
.provider-tab.active { color: var(--signal); border-color: rgba(212,225,87,0.4); background: rgba(212,225,87,0.08); }
.provider-tab .dot { display: inline-block; width: 5px; height: 5px; margin-left: 0.3rem; border-radius: 50%; background: var(--faint); vertical-align: middle; }
.provider-tab .dot.ok { background: var(--ok); }
.settings-grid { flex: 1; display: grid; grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); gap: 0.6rem; min-height: 0; }
.model-row { display: flex; gap: 0.65rem; align-items: flex-end; margin-top: 0.25rem; }
.model-field { flex: 1; min-width: 0; }
.model-row .btn { margin-top: 0; white-space: nowrap; }
.model-select { width: 100%; padding: 0.5rem 0.6rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-0); color: var(--ink); font: inherit; font-size: 0.88rem; }
.model-select.has-models { min-height: 6.5rem; max-height: 11rem; }
.model-manual-row { display: flex; align-items: center; gap: 0.45rem; margin-top: 0.45rem; font-size: 0.82rem; color: var(--muted); }
.model-manual-row input[type="checkbox"] { width: auto; margin: 0; }
.model-custom { margin-top: 0.45rem; display: none; }
.model-custom.show { display: block; }

/* Howto chip */
.howto-chip { position: relative; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); font-size: 0.78rem; flex-shrink: 0; }
.howto-chip summary { padding: 0.35rem 0.65rem; cursor: pointer; color: var(--muted); list-style: none; user-select: none; }
.howto-chip summary::-webkit-details-marker { display: none; }
.howto-chip[open] { z-index: 5; }
.howto-chip .howto-inner {
  position: absolute; right: 0; top: calc(100% + 4px); width: 260px;
  padding: 0.7rem 0.8rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-1); box-shadow: var(--shadow-panel);
  font-size: 0.78rem; color: var(--muted); line-height: 1.4;
}
.howto-inner p { margin: 0 0 0.45rem; }
.howto-inner strong { color: var(--ink); }
.howto-inner ol { margin: 0.2rem 0 0; padding-left: 1rem; }

/* Auth */
.auth-panel {
  max-width: 400px; margin: 4rem auto; padding: 2rem 1.75rem;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-panel);
}
.auth-panel .brand { display: block; margin-bottom: 0.35rem; font-size: 2rem; }
footer.note { margin-top: 2.5rem; color: var(--faint); font-size: 0.8rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.lede { color: var(--muted); max-width: 36rem; margin: 0 0 1.5rem; }
.panel { margin-top: 1rem; padding: 1.25rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }

/* Actionable reports */
.report-body { display: flex; flex-direction: column; gap: 0.85rem; }
.report-verdict { margin: 0; color: var(--ink); font-size: 0.95rem; line-height: 1.45; }
.report-kpis { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.report-kpi {
  min-width: 5.5rem; padding: 0.45rem 0.65rem; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--surface-2);
  display: flex; flex-direction: column; gap: 0.15rem;
}
.report-kpi-label { font-size: 0.7rem; color: var(--faint); text-transform: uppercase; letter-spacing: 0.04em; }
.report-kpi-value { font-size: 1.15rem; color: var(--ink); }
.report-section-title { margin: 0.2rem 0 0.35rem; font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.prio-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 0.55rem; }
.prio-item {
  padding: 0.55rem 0.65rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.prio-item p { margin: 0.25rem 0 0; font-size: 0.84rem; }
.prio-head { display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; }
.prio-p0 { border-color: rgba(220, 80, 80, 0.35); }
.prio-p1 { border-color: rgba(220, 160, 60, 0.35); }
.report-cta-row { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.btn-ghost {
  display: inline-block; padding: 0.35rem 0.7rem; border: 1px solid rgba(212,225,87,0.55);
  border-radius: var(--radius-sm); text-decoration: none; font-size: 0.8rem; font-weight: 600;
  background: var(--signal); color: var(--signal-fg);
}
.btn-ghost:hover {
  border-color: var(--signal);
  filter: brightness(1.05);
  color: var(--signal-fg);
}
.report-cta-row .btn,
.report-priorities .btn,
.report-priorities .btn-ghost {
  color: var(--signal-fg);
  background: var(--signal);
  border-color: transparent;
  font-weight: 600;
}
.badge.warn { background: rgba(220, 160, 60, 0.15); color: #d4a03c; }
.badge.err { background: rgba(220, 80, 80, 0.15); color: #e07070; }
.report-json { margin-top: 0.35rem; }
.report-json-pre { max-height: 8rem; margin-top: 0.4rem; font-size: 0.75rem; overflow: auto; }
.artifact-tabs { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.5rem; }
.artifact-panel pre { max-height: 16rem; overflow: auto; white-space: pre-wrap; word-break: break-word; font-size: 0.78rem; }
.deploy-box {
  margin-top: 0.5rem; padding: 0.65rem 0.75rem; border: 1px dashed var(--line);
  border-radius: var(--radius-sm); font-size: 0.82rem; color: var(--muted); line-height: 1.45;
}
.deploy-box strong { color: var(--ink); }
.probe-item {
  padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--line); font-size: 0.84rem;
}
.probe-item:last-child { border-bottom: 0; }
.usage-box {
  padding: 0.7rem 0.85rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2); font-size: 0.84rem; color: var(--muted); line-height: 1.45;
  margin-bottom: 0.6rem;
}
.usage-box ol { margin: 0.35rem 0 0; padding-left: 1.1rem; }
.delta-up { color: var(--ok); }
.delta-down { color: #e07070; }
.comp-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
@media (max-width: 720px) { .comp-cols { grid-template-columns: 1fr; } }

.chart-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}
@media (max-width: 960px) { .chart-grid { grid-template-columns: 1fr; } }
.chart-card .mod-body { padding-bottom: 0.55rem; }
.trend-chart {
  width: 100%;
  height: auto;
  display: block;
  background:
    linear-gradient(to top, color-mix(in srgb, var(--line) 55%, transparent) 1px, transparent 1px),
    linear-gradient(to right, color-mix(in srgb, var(--line) 40%, transparent) 1px, transparent 1px);
  background-size: 100% 25%, 20% 100%;
  border-radius: var(--radius-sm);
}
.trend-line { stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round; }
.trend-line--score { stroke: var(--accent, #3d7ea6); }
.trend-line--mention { stroke: var(--ok, #3d9a6a); }
.trend-line--citation { stroke: #c48a3a; }
.trend-dot { fill: var(--ink); opacity: 0.85; }
.chart-axis { margin: 0.35rem 0 0; font-size: 0.75rem; }

.matrix-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
}
@media (max-width: 960px) { .matrix-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .matrix-grid { grid-template-columns: 1fr; } }
.matrix-week {
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.matrix-item { margin-bottom: 0.35rem; font-size: 0.84rem; line-height: 1.35; }
.matrix-item:last-child { margin-bottom: 0; }

/* Busy / progress overlay */
.geo-busy {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10, 12, 16, 0.55); backdrop-filter: blur(2px);
}
.geo-busy[hidden] { display: none !important; }
.geo-busy-card {
  width: min(360px, 90vw); padding: 1.25rem 1.35rem;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface-1); box-shadow: var(--shadow-panel);
}
.geo-busy-title { font-size: 1rem; font-weight: 600; color: var(--ink); margin: 0 0 0.75rem; }
.geo-busy-bar {
  height: 6px; border-radius: 999px; background: var(--surface-0); overflow: hidden;
  border: 1px solid var(--line);
}
.geo-busy-bar span {
  display: block; height: 100%; width: 40%;
  background: linear-gradient(90deg, var(--signal), #9ad1c0);
  animation: geo-busy-slide 1.1s ease-in-out infinite;
}
@keyframes geo-busy-slide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}
.geo-busy-hint { margin: 0.75rem 0 0; font-size: 0.8rem; color: var(--muted); line-height: 1.4; }
body.is-busy { cursor: progress; }

/* Responsive */
@media (max-width: 1100px) {
  .dash-bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-bento .geo-panel--hero,
  .dash-bento > .geo-panel:nth-child(2) { grid-column: span 2; }
  .dash-gauges { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dash-work-list { grid-template-columns: 1fr 1fr; }
  .module-grid--3 { grid-template-columns: 1fr 1fr; }
  .module-grid--3 .mod-output { grid-column: span 2; }
}
@media (max-width: 960px) {
  body.has-sidebar { grid-template-columns: 1fr; height: auto; overflow: auto; }
  .sidebar { height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .main-wrap { height: auto; overflow: visible; }
  .dash-bento { grid-template-columns: 1fr; }
  .dash-bento .geo-panel--hero,
  .dash-bento > .geo-panel:nth-child(2) { grid-column: auto; }
  .dash-gauges { grid-template-columns: 1fr 1fr; }
  .dash-work-list { grid-template-columns: 1fr; }
  .module-bar { grid-template-columns: 1fr; }
  .module-bar-desc { white-space: normal; }
  .module-grid--2, .module-grid--3, .settings-grid { grid-template-columns: 1fr; }
  .module-grid--3 .mod-output { grid-column: auto; }
  .geo-pipeline { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .geo-btn, .btn, .geo-panel--link, .geo-pipeline-step, .geo-panel-arrow {
    transition: none;
  }
  .geo-btn:hover, .btn:hover, .geo-panel--link:hover {
    transform: none;
  }
}
