/*
 * Design system — the entire visual language of the pi-tps lookalike.
 *
 * ONE stylesheet, no preprocessor. The theme is CSS variables on :root (light)
 * and .dark; every component references those variables, so re-skinning the whole
 * app is a two-line override (see THEME.md). Fonts (Geist/Geist Mono) and the
 * semantic tokens (accent/moss/amber/ember/violet) are declared at the top.
 *
 * LOAD-BEARING INVARIANT — never set overflow-x on html/body to hide a right-edge
 * overflow: it turns the body into a scroll container, breaks position:sticky on
 * the topbar, and collapses the layout sideways (hit + reverted live, screenshots
 * Unisic_*). Fix overflow by making grid children compress (min-width:0) and by
 * wrapping column tracks in minmax(0, 1fr) — see the responsive-grids section.
 *
 * Sections below, in order: tokens/theme, fonts+base, component recipes, layout,
 * pills, buttons, tables/badges/progress/deltas, forms, tooltips, scrollbars,
 * chart (axes + stacked bars), animation.
 */
/* ---- fonts ---- */
@font-face {
  font-family: 'Geist';
  src: url('/vendor/fonts/Geist-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'Geist Mono';
  src: url('/vendor/fonts/GeistMono-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

/* ---- theme (CSS variables + .dark class) ---- */
:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --border: rgba(228, 228, 231, 0.5);
  --text-primary: #09090b;
  --text-secondary: #71717a;
  --text-tertiary: #a1a1aa;
  --accent: #0891b2;
  --accent-light: #06b6d4;
}
.dark {
  --bg: #18181b;
  --surface: #1e1e22;
  --border: rgba(255, 255, 255, 0.06);
  --text-primary: #d4d4d8;
  --text-secondary: #a1a1aa;
  --text-tertiary: #71717a;
  --accent: #06b6d4;
  --accent-light: #22d3ee;
}

* { box-sizing: border-box; }
html { font-family: 'Geist', system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100dvh;
  transition: background .2s, color .2s;
}

/* ---- component recipes (the whole look) ---- */
.card-surface {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  box-shadow: 0 20px 40px -15px rgba(0,0,0,0.05);
  padding: 1.25rem;
}
.dark .card-surface { box-shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -8px rgba(0,0,0,.4); }
.glass {
  position: relative;
  background: rgba(255,255,255,.38);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid rgba(255,255,255,.5);
}
.dark .glass { background: rgba(30,30,34,.42); }

.metric-mono {
  font-family: 'Geist Mono', monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.text-gradient {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ---- layout ---- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  transition: background .2s;
}
.topbar-inner {
  max-width: 1600px; margin: 0 auto; padding: 12px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-icon {
  padding: 8px; border-radius: 12px;
  background: rgba(8,145,178,.10); color: var(--accent); font-size: 22px;
}
h1 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -.02em; line-height: 1; }
.eyebrow { margin: 3px 0 0; font-size: 11px; color: var(--text-tertiary); font-weight: 500; letter-spacing: .08em; }

/* segmented control (header pills) */
.seg-control {
  display: flex; gap: 2px; padding: 2px;
  background: rgba(255,255,255,.6); border: 1px solid var(--border);
  border-radius: 8px;
}
.dark .seg-control { background: rgba(39,39,42,.4); }
.seg-btn {
  border: 0; background: transparent; cursor: pointer;
  padding: 6px 10px; border-radius: 6px;
  font-size: 11px; font-weight: 500; font-family: inherit;
  color: var(--text-tertiary);
}
.seg-btn:hover { color: var(--text-secondary); }
.seg-btn.is-active { background: rgba(8,145,178,.10); color: var(--accent); }
.dark .seg-btn.is-active { background: rgba(6,182,212,.15); }

.icon-btn {
  border: 0; background: transparent; cursor: pointer;
  color: var(--text-tertiary); font-size: 18px; padding: 6px;
}
.icon-btn:hover { color: var(--text-secondary); }

.wrap { max-width: 1600px; margin: 0 auto; padding: 24px; }

/* metric pills */
.pill-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.pill {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 16px; border: 1px solid;
  min-width: 180px;
}
.pill-icon {
  padding: 6px; border-radius: 8px;
  font-size: 14px; display: grid; place-items: center;
}
.pill-label {
  margin: 0 0 2px; font-size: 9px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .06em; color: var(--text-tertiary);
}
.pill-value {
  margin: 0; font-size: 16px; font-weight: 600; color: var(--text-primary);
}
.pill-value span { font-size: 11px; color: var(--text-tertiary); }

/* semantic color schemes (tokens) */
.pill-moss      { background: rgba(5,150,105,.05);  border-color: rgba(5,150,105,.15); }
.pill-moss .pill-icon  { background: rgba(5,150,105,.10);  color: #059669; }
.pill-accent    { background: rgba(8,145,178,.05); border-color: rgba(8,145,178,.15); }
.pill-accent .pill-icon { background: rgba(8,145,178,.10);  color: #0891b2; }
.pill-amber     { background: rgba(217,119,6,.05); border-color: rgba(217,119,6,.15); }
.pill-amber .pill-icon { background: rgba(217,119,6,.10);  color: #d97706; }

/* ---------- responsive grids (prevent right-edge cut-off) ----------
   Root cause of the cut-off: '1fr' columns with default min-width:auto mean a
   card cannot shrink below its content width, so wide content (tables, big
   cards) overflows the right edge of the frame.
   Fix: auto-fit + minmax(min(...)) so columns wrap to fit the container, and
   min-width:0 ONLY on grid children so they compress (their inner tables then
   scroll horizontally instead of pushing the page wider).
   IMPORTANT: never set overflow-x on html/body for this — it turns them into a
   scroll container, breaks position:sticky and collapses the layout sideways. */
.grid, .doc-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr));
  gap: 16px;
}
.grid > *, .doc-card-grid > * { min-width: 0; }

/* media never forces a column wider than the viewport */
canvas, img { max-width: 100%; }
canvas { height: 180px; }
.section-title { margin: 0 0 12px; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
canvas { width: 100%; height: 180px; display: block; }

/* ---- extra tokens (ember/moss/amber) ---- */
:root {
  --moss: #059669; --moss-light: #10b981;
  --amber: #d97706; --amber-light: #f59e0b;
  --ember: #dc2626; --ember-light: #ef4444;
}

/* ---- primary button ---- */
.btn-primary {
  border: 0; cursor: pointer; font-family: inherit;
  background: var(--accent); color: #fff;
  padding: 8px 14px; border-radius: 10px;
  font-size: 12px; font-weight: 600; letter-spacing: .01em;
  transition: filter .15s;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:active { transform: translateY(1px); }

/* ---- ghost button ---- */
.btn-ghost {
  border: 1px solid var(--border); cursor: pointer; font-family: inherit;
  background: transparent; color: var(--text-secondary);
  padding: 7px 12px; border-radius: 10px; font-size: 12px; font-weight: 500;
}
.btn-ghost:hover { color: var(--text-primary); background: rgba(127,127,127,.06); }

/* ---- rest of the pill colors ---- */
.pill-default { background: rgba(255,255,255,.6); border-color: var(--border); }
.dark .pill-default { background: rgba(39,39,42,.4); }
.pill-default .pill-icon { background: rgba(127,127,127,.08); color: var(--text-secondary); }
.pill-ember { background: rgba(220,38,38,.05); border-color: rgba(220,38,38,.15); }
.pill-ember .pill-icon { background: rgba(220,38,38,.10); color: #dc2626; }

/* ---- shimmer loading state ---- */
.shimmer {
  background: linear-gradient(90deg, transparent 0%, rgba(127,127,127,.12) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}
.dark .shimmer { background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.06) 50%, transparent 100%); background-size: 200% 100%; }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

/* ---- thin scrollbars ---- */
.scrollbar-thin { scrollbar-width: thin; scrollbar-color: rgba(161,161,170,.3) transparent; }
.scrollbar-thin::-webkit-scrollbar { width: 5px; height: 5px; }
.scrollbar-thin::-webkit-scrollbar-track { background: transparent; }
.scrollbar-thin::-webkit-scrollbar-thumb { background-color: rgba(161,161,170,.3); border-radius: 999px; }
.dark .scrollbar-thin { scrollbar-color: rgba(113,113,122,.3) transparent; }

/* ---- form controls ---- */
.field {
  border: 1px solid var(--border); background: transparent;
  border-radius: 10px; padding: 8px 10px; font-family: inherit;
  font-size: 12px; color: var(--text-primary);
}
.field:focus { outline: 2px solid rgba(8,145,178,.3); outline-offset: 0; }
select.field { min-width: 140px; }
select.field option { background: var(--surface); color: var(--text-primary); }

/* ---- code snippet ---- */
.code {
  font-family: 'Geist Mono', monospace; font-size: 12px;
  background: rgba(127,127,127,.07); color: var(--text-secondary);
  padding: 2px 6px; border-radius: 6px;
}
.dark .code { background: rgba(255,255,255,.06); }

/* ---- lightweight hover tooltip ----
   Add data-tooltip="text" to any element. Placed in body, positioned
   with fixed so it never clips inside overflow:hidden ancestors. */
.tooltip {
  position: fixed; z-index: 999;
  background: #1e1e22; color: #d4d4d8;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  padding: 6px 10px;
  font-family: 'Geist', system-ui, sans-serif;
  font-size: 11px; line-height: 1.4;
  max-width: 260px;
  box-shadow: 0 4px 12px -2px rgba(0,0,0,.3), 0 8px 24px -8px rgba(0,0,0,.5);
  opacity: 0; pointer-events: none;
  transform: translateY(4px);
  transition: opacity .15s ease, transform .15s ease;
}
.tooltip.visible { opacity: 1; transform: translateY(0); }
.tooltip .tt-title {
  font-weight: 600; color: #fff; font-size: 11px; margin-bottom: 2px;
}
.tooltip .tt-mono { font-family: 'Geist Mono', monospace; color: #22d3ee; }

/* ---- links (replace browser-default blue) ---- */
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover { color: var(--accent-light); text-decoration: underline; text-underline-offset: 2px; }
a:focus-visible { outline: 2px solid rgba(8,145,178,.4); outline-offset: 2px; border-radius: 2px; }

/* ---- data table ---- */
.table {
  width: 100%; border-collapse: collapse; font-size: 11px; text-align: left;
}
.table thead tr {
  font-size: 9px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-tertiary); font-weight: 500;
  border-bottom: 1px solid var(--border);
}
.table th { padding: 8px 12px; font-weight: 500; }
.table thead th.right, .table td.right { text-align: right; }
.table tbody tr { border-bottom: 1px solid rgba(127,127,127,.1); }
.dark .table tbody tr { border-bottom: 1px solid rgba(255,255,255,.03); }
.table tbody tr:hover { background: rgba(127,127,127,.04); }
.table td { padding: 10px 12px; color: var(--text-secondary); }
.table td.strong { font-weight: 500; color: var(--text-primary); }
.table td.num { font-family: 'Geist Mono', monospace; font-variant-numeric: tabular-nums; color: var(--text-primary); }

/* ---- status badge / chip ---- */
.badge {
  display: inline-block; font-size: 8px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
  padding: 2px 6px; border-radius: 4px;
}
.badge-accent { background: rgba(8,145,178,.12); color: #0e7490; }
.dark .badge-accent { background: rgba(6,182,212,.15); color: #22d3ee; }
.badge-moss   { background: rgba(5,150,105,.12); color: #047857; }
.dark .badge-moss { background: rgba(16,185,129,.15); color: #34d399; }
.badge-amber  { background: rgba(217,119,6,.12); color: #b45309; }
.dark .badge-amber { background: rgba(251,191,36,.15); color: #fbbf24; }

/* ---- session strip ---- */
.session-strip {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  max-width: 1600px; margin: 0 auto; padding: 8px 24px;
  display: flex; gap: 8px; align-items: center; overflow-x: auto; scrollbar-width: none;
}
.session-strip::-webkit-scrollbar { display: none; }
.session {
  color: inherit;
  text-decoration: none;
  flex-shrink: 0; padding: 6px 10px; border-radius: 8px;
  font-size: 11px; font-weight: 500; cursor: pointer;
  border: 1px solid transparent;
}
.session:hover { background: rgba(127,127,127,.06); }
.session.is-active {
  background: rgba(8,145,178,.10); color: var(--accent);
}
.session .count { color: var(--text-tertiary); font-family: 'Geist Mono', monospace; font-size: 9px; }

/* ---- section card header w/ meta ---- */
.card-head {
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
}
.card-head h3 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -.01em; color: var(--text-primary); }
.card-head .meta { margin-left: auto; font-size: 10px; font-family: 'Geist Mono', monospace; color: var(--text-tertiary); }

/* ---- empty / dropzone state ---- */
.empty {
  border: 1.5px dashed var(--border); border-radius: 1.5rem;
  padding: 48px 24px; text-align: center; color: var(--text-tertiary);
  background: rgba(127,127,127,.02);
}
.empty .empty-icon {
  font-size: 28px; color: var(--accent); opacity: .6; margin-bottom: 8px;
}
.empty h4 { margin: 0 0 4px; font-size: 14px; font-weight: 600; color: var(--text-secondary); }
.empty p { margin: 0; font-size: 12px; }

/* ---- custom overlay scrollbar (respects rounded corners) ----
   Native scrollbars never follow a container's border-radius (they pin to the
   box edge as a square). Fix: hide native, draw a rounded inset thumb overlay.
   Structure:  <div class="scrollable-wrap">
                 <div class="scrollable">…content…</div>
                 <div class="scrollable-track"><div class="scrollable-thumb"></div></div>
               </div>
   Requires the small JS block (see reference.html) that sizes/positions the thumb. */
.scrollable-wrap { position: relative; }
.scrollable {
  overflow-y: auto;
  scrollbar-width: none;         /* hide native (Firefox) */
  -ms-overflow-style: none;      /* hide native (old Edge/IE) */
}
.scrollable::-webkit-scrollbar { width: 0; height: 0; }   /* hide native (WebKit) */

.scrollable-track {
  position: absolute; top: 10px; right: 6px; bottom: 10px; width: 6px;
  background: rgba(127,127,127,.12);
  border-radius: 999px;
  opacity: 0; transition: opacity .2s;
}
.scrollable:hover ~ .scrollable-track,
.scrollable-wrap:hover .scrollable-track { opacity: 1; }
.dark .scrollable-track { background: rgba(255,255,255,.08); }

.scrollable-thumb {
  position: absolute; left: 0; right: 0; border-radius: 999px;
  background: rgba(161,161,170,.45);
}
.dark .scrollable-thumb { background: rgba(113,113,122,.5); }

/* ---- fade-in on load (pure CSS) ---- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.fade-in { animation: fadeUp .5s ease both; }

/* ---- hand-rolled bar chart (interactive, no library) ----
   Bars are sized by JS as px, aligned to the bottom; hover tooltip is reused
   via data-tooltip. Structure: .barchart > .bar-col > (.bar + .bar-label) */
.barchart { display: flex; gap: 10px; height: 150px; }
.bar-col {
  flex: 1; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px;
}
.bar {
  width: 60%; max-width: 44px; min-height: 2px;
  border-radius: 6px 6px 2px 2px; cursor: pointer;
  transition: filter .12s, transform .12s;
}
.bar:hover { filter: brightness(1.2); transform: translateY(-2px); }
.bar-label { font-size: 9px; color: var(--text-tertiary); white-space: nowrap; }
.bar-accent { background: var(--accent); }
.bar-moss   { background: var(--moss); }
.bar-amber  { background: var(--amber); }
.bar-ember  { background: var(--ember); }

/* ---- progress bars (from ThresholdAnalysis) ---- */
.progress { appearance: none; -webkit-appearance: none; border: none; display: block; width: 100%; height: 6px; border-radius: 999px; overflow: hidden; background: rgba(127,127,127,.12); }
.dark .progress { background: rgba(255,255,255,.06); }
.progress::-webkit-progress-bar { background: transparent; }
.progress::-webkit-progress-value { background: var(--accent); }
.progress::-moz-progress-bar { background: var(--accent); }
.progress.moss::-webkit-progress-value, .progress.moss::-moz-progress-bar { background: var(--moss); }
.progress.amber::-webkit-progress-value, .progress.amber::-moz-progress-bar { background: var(--amber); }
.progress.ember::-webkit-progress-value, .progress.ember::-moz-progress-bar { background: var(--ember); }

/* ---- delta pills (trend up/down/flat) ---- */
.delta { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 500; padding: 2px 8px; border-radius: 999px; }
.delta i { font-size: 10px; }
.delta-up   { background: rgba(220,38,38,.10); color: #dc2626; }
.dark .delta-up   { color: #f87171; }
.delta-down { background: rgba(5,150,105,.10); color: #059669; }
.dark .delta-down { color: #34d399; }
.delta-flat { background: rgba(127,127,127,.10); color: var(--text-secondary); }

/* ---- mini stat group (Below / Delta / Above) ---- */
.mini-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.mini-stat { text-align: center; }
.mini-stat .num { font-family: 'Geist Mono', monospace; font-variant-numeric: tabular-nums; font-weight: 700; font-size: 14px; color: var(--text-primary); }
.mini-stat .lbl { font-size: 10px; color: var(--text-tertiary); margin-top: 2px; }

/* ---- chart legend ---- */
.legend { display: flex; gap: 14px; margin: 2px 0 12px; font-size: 10px; color: var(--text-secondary); }
.legend .swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.swatch.moss  { background: var(--moss); }
.swatch.accent{ background: var(--accent); }


/* ---- chart (pure CSS, list-based — per the HTML spec, simple bar charts are
   best done with CSS, not SVG/canvas: accessible, no renderer, no script).
   Bars are <li> list items; heights come from calc() on --a/--b (segments) and
   --max (global scale). No JS required to size the chart. ---- */
.chart-wrap { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 8px; }
.chart-y { grid-column: 1; grid-row: 1; list-style: none; margin: 0; padding: 0; width: 36px; height: 140px; display: flex; flex-direction: column; justify-content: space-between; text-align: right; font-family: 'Geist Mono', monospace; font-size: 9px; color: var(--text-tertiary); }
.chart-plot { grid-column: 2; grid-row: 1; position: relative; height: 140px; margin: 0; }
.chart-grid { position: absolute; inset: 0; list-style: none; margin: 0; padding: 0; pointer-events: none; }
.chart-grid .gl { position: absolute; top: var(--t); left: 0; right: 0; border-top: 1px dashed var(--border); }
.chart-bars { position: absolute; inset: 0; list-style: none; margin: 0; padding: 0 1%; display: flex; align-items: flex-end; justify-content: space-evenly; }
.bar { position: relative; flex: none; width: 12%; height: calc((var(--a) + var(--b)) * 100% / var(--max)); display: flex; flex-direction: column-reverse; }
.bar-seg { display: block; width: 100%; min-height: 1px; }
.bar-seg.cached { height: calc(var(--a) * 100% / (var(--a) + var(--b))); }
.bar-seg.new { height: calc(var(--b) * 100% / (var(--a) + var(--b))); border-radius: 6px 6px 0 0; }
.bar-seg:hover { filter: brightness(1.15); }
.bar-seg.moss  { background: var(--moss); }
.bar-seg.accent{ background: var(--accent); }
.bar-seg.amber { background: var(--amber); }
.bar-seg.ember { background: var(--ember); }
.bar-seg.violet{ background: var(--violet); }
.chart-labels { grid-column: 2; grid-row: 2; list-style: none; margin: 6px 0 0; padding: 0; display: flex; gap: 10px; }
.chart-labels li { flex: 1; text-align: center; font-size: 9px; color: var(--text-tertiary); white-space: nowrap; }

/* extra semantic token: violet (for multi-color chart bars) */
:root { --violet: #7c3aed; --violet-light: #8b5cf6; }

/* legend swatches (multi-color) */
.swatch.accent{ background: var(--accent); }
.swatch.moss  { background: var(--moss); }
.swatch.amber { background: var(--amber); }
.swatch.ember { background: var(--ember); }
.swatch.violet{ background: var(--violet); }

/* ---- body text ---- */
.body { font-size: 12px; color: var(--text-secondary); line-height: 1.5; margin: 0 0 0.75rem; }
.legend-item { display: inline-flex; align-items: center; }

/* ---- semantic element resets (div -> semantic) ---- */
a.brand { color: inherit; text-decoration: none; }
figure { margin: 0; }
dl.mini-stat { margin: 0; }
.mini-stat dt, .mini-stat dd { margin: 0; padding: 0; }
section.card-surface { display: block; }

/* ---- legend as ul/li ---- */
ul.legend { list-style: none; margin: 2px 0 12px; padding: 0; }
.pill-row { list-style: none; margin: 0 0 16px; padding: 0; }
.pill-row .pill { padding: 10px 14px; }
.pill-text { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.pill-label, .pill-value { line-height: 1.25; }

/* ---- screen-reader-only text ---- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---- brand + icon boxes (spans kept inline-grid so they box) ---- */
.brand-icon, .pill-icon, .empty-icon { display: inline-grid; place-items: center; }
.brand-text { display: inline-flex; flex-direction: column; justify-content: center; }
.brand-name { margin: 0; }

/* ---- glassmorphism demo: colored blobs behind the translucent glass so the
   backdrop-filter has something to blur (a flat background shows nothing) ---- */
.glass-stage { position: relative; }
.glass-blobs { position: absolute; inset: -12px; z-index: 0; pointer-events: none; }
.glass-blobs .blob { position: absolute; border-radius: 50%; filter: blur(24px); opacity: .8; }
.blob.b1 { width: 130px; height: 130px; background: var(--accent); top: -24px; left: -16px; }
.blob.b2 { width: 110px; height: 110px; background: var(--moss); bottom: -30px; right: 8px; }
.blob.b3 { width: 90px; height: 90px; background: var(--violet); top: 42%; left: 58%; opacity: .65; }
.glass-stage .glass { position: relative; z-index: 1; }

/* ---- generic flex row ---- */
.row { display: flex; gap: 12px; flex-wrap: wrap; margin: 8px 0; }

/* ---- dropzone (pi-tps empty-state port) ---- */
.dropzone { width: 100%; text-align: center; padding: 1rem 1rem .9rem; border-radius: 1rem; border: 2px dashed var(--border); cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone.dragover, .dropzone:hover { border-color: var(--accent); background: rgba(8,145,178,.05); }
.dropzone-icon { width: 2.25rem; height: 2.25rem; margin: 0 auto .5rem; display: grid; place-items: center; border-radius: .75rem; background: rgba(127,127,127,.06); color: var(--text-tertiary); font-size: 18px; }
.dropzone-copy { margin: 0 0 .5rem; font-size: .75rem; line-height: 1.4; color: var(--text-secondary); }
.dropzone-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .75rem; }
.btn-secondary { display: inline-flex; align-items: center; gap: .5rem; padding: .625rem 1.25rem; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text-primary); font: inherit; font-size: .875rem; font-weight: 500; cursor: pointer; }
.btn-secondary:hover { background: rgba(127,127,127,.06); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---- compact text (tracker-wide) ---- */
html { font-size: 15px; }
.body { font-size: 11.5px; }
.section-title { font-size: 13.5px; }
.hint { font-size: 11.5px; }
.field { font-size: 11.5px; }
.btn-primary, .btn-secondary, .btn-ghost { font-size: 11.5px; }
.seg-btn { font-size: 10.5px; }
.pill-label { font-size: 9px; }
.pill-value { font-size: 14.5px; }
.meta { font-size: 9.5px; }
.h1, h1.brand-name { font-size: 17px; }

/* ---- center the All/Ideas/Bugs switcher in the header ----
   Space-between centers it between the sides only when they're equal width; a
   1fr|auto|1fr grid puts the middle column dead-center regardless. */
.topbar-inner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.topbar-inner .brand { grid-column: 1; justify-self: start; }
.topbar-inner #filterSeg { grid-column: 2; justify-self: center; }
.topbar-inner #themeBtn { grid-column: 3; justify-self: end; }
@media (max-width: 560px) {
  .topbar-inner { grid-template-columns: 1fr auto; grid-template-rows: auto auto; }
  .topbar-inner .brand { grid-column: 1 / 3; grid-row: 1; }
  .topbar-inner #filterSeg { grid-column: 1; grid-row: 2; justify-self: start; }
  .topbar-inner #themeBtn { grid-column: 2; grid-row: 2; justify-self: end; }
}
