/* SPDX-FileCopyrightText: 2026 HNY Labs LLC */
/* SPDX-License-Identifier: FSL-1.1-ALv2 */

/* BurrowScope. System fonts only: no external requests, works air-gapped. */

:root {
  /* Colors are light-dark(light, dark). The theme follows the OS unless the
     user picks one in the footer, which sets data-theme on <html>. */
  color-scheme: light dark;
  --ground: light-dark(#F3F4F1, #111513);
  --surface: light-dark(#FFFFFF, #1A201D);
  --surface-2: light-dark(#F8F9F7, #1F2622);
  --ink: light-dark(#1B1F1D, #E3E8E5);
  --muted: light-dark(#555D59, #9AA59F);
  --line: light-dark(#DCE0DC, #2E3732);
  --line-soft: light-dark(#ECEEEB, #252D29);
  --control-line: light-dark(#C6CDC8, #3C4741);
  --hover: light-dark(#F3F8F6, #1F2A25);
  --hover-line: light-dark(#B9C9C3, #3E5249);
  --field-bg: light-dark(#FAFBF9, #161B18);
  --accent: light-dark(#0F766E, #0F766E);
  --accent-ink: light-dark(#0B5F58, #0B5F58);
  --accent-soft: light-dark(#E3F2EE, #173530);
  --accent-line: light-dark(#B9D8D1, #2C5A51);
  --link: light-dark(#0F766E, #5CCFBE);
  --on-accent: #FFFFFF;
  --side: light-dark(#17201C, #0C100E);
  --side-ink: #C9D2CD;
  --side-muted: light-dark(#93A09A, #8F9C96);
  --side-hover: light-dark(#25312B, #1C2621);
  --side-field: light-dark(#222C27, #19221E);
  --side-strong: #FFFFFF;
  --side-tab-active: #D7F1ED;
  --ok-bg: light-dark(#E2F1EE, #173530); --ok-ink: light-dark(#0B5F58, #6FD3C2);
  --warn-bg: light-dark(#FCEDD9, #3A2A12); --warn-ink: light-dark(#874200, #F2B566);
  --crit-bg: light-dark(#FBE6E3, #3D1C19); --crit-ink: light-dark(#A1251A, #F49A90);
  --muted-bg: light-dark(#ECEEEB, #262D29); --muted-ink: light-dark(#4C5450, #B4BDB8);
  /* Chart status colors. Validated for colour-blind separation (dataviz
     palette check) in each theme; warn is always shown with a label. */
  --st-ok: light-dark(#078A7A, #2FA594);
  --st-warn: light-dark(#E08E0B, #C0882A);
  --st-crit: light-dark(#B42318, #BF2F2A);
  --seq: light-dark(#0F766E, #2FA594); /* one-hue magnitude */
  --on-seq: light-dark(#FFFFFF, #0E1210);
  --dot-crit: var(--st-crit);
  --dot-warn: var(--st-warn);
  --dot-info: light-dark(#64748B, #7D8BA0);
  --scrim: light-dark(rgba(23, 32, 28, 0.35), rgba(0, 0, 0, 0.6));
  --shadow: light-dark(rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.5));
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --radius: 8px;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--ground); color: var(--ink); font: 14px/1.45 var(--sans); }
#app { min-height: 100%; display: flex; flex-direction: column; }
h1 { margin: 0; font-size: 24px; font-weight: 600; letter-spacing: -0.01em; }
h2 { margin: 0; font-size: 15px; font-weight: 600; }
h3 { margin: 0; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
p { margin: 0; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.mono { font-family: var(--mono); font-size: 0.93em; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.right { text-align: right; }
.grow { flex: 1; min-width: 0; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 50; background: var(--surface); padding: 8px 12px; border-radius: 6px; }
.skip-link:focus { left: 8px; }
.stack-2, .stack-4, .stack-6, .stack-8, .stack-12, .stack-16 { display: flex; flex-direction: column; }
.stack-2 { gap: 2px; } .stack-4 { gap: 4px; } .stack-6 { gap: 6px; } .stack-8 { gap: 8px; } .stack-12 { gap: 12px; } .stack-16 { gap: 16px; }

/* ---- controls ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 36px; padding: 0 14px; border: 1px solid var(--control-line); border-radius: 6px; background: var(--surface); font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--ground); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-ink); }
.btn-lg { min-height: 44px; font-size: 15px; }
.btn-block { width: 100%; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex: none; border: 0; border-radius: 6px; background: transparent; cursor: pointer; color: var(--muted-ink); }
.icon-btn:hover { background: var(--ground); }
.link-btn { border: 0; background: none; padding: 2px 0; color: var(--link); font-weight: 500; cursor: pointer; text-align: left; }
.link-btn:hover { text-decoration: underline; }
.pill { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.pro-tag { display: inline-flex; align-items: center; margin-left: 6px; padding: 0 6px; border: 1px solid var(--accent-line); border-radius: 4px; background: var(--accent-soft); color: var(--link); font-size: 11px; font-weight: 600; letter-spacing: .02em; line-height: 16px; }
.t-ok { background: var(--ok-bg); color: var(--ok-ink); }
.t-warn { background: var(--warn-bg); color: var(--warn-ink); }
.t-crit { background: var(--crit-bg); color: var(--crit-ink); }
.t-muted { background: var(--muted-bg); color: var(--muted-ink); }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; display: inline-block; }
.d-ok { background: var(--accent); } .d-crit { background: var(--dot-crit); } .d-warn { background: var(--dot-warn); } .d-info { background: var(--dot-info); }
.spinner { width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; flex: none; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }

/* ---- connect / locked ---- */
.center-screen { flex: 1; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 32px; padding: 48px 16px; }
.card { flex: 0 1 440px; min-width: 0; display: flex; flex-direction: column; gap: 24px; padding: 32px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.card.narrow { flex-basis: 520px; }
.brand { display: flex; align-items: center; gap: 7px; font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }
.brand-mark { display: inline-flex; }
/* Gopher logo (dom.js logo()). Dark theme: lighter mound, softer white. */
.logo-body { fill: light-dark(#FFFFFF, #EEF3F1); stroke: #10282E; stroke-width: 0.45; stroke-linejoin: round; }
.logo-ear { fill: #A9DCD3; }
.logo-mound { fill: light-dark(#0A5650, #2FA594); }
.logo-hole { fill: #062E2F; }
.logo-ink { fill: #10282E; }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 500; font-size: 13.5px; }
.field input { min-height: 40px; padding: 0 12px; border: 1px solid var(--control-line); border-radius: 6px; background: var(--surface); font-weight: 400; font-size: 14px; }
.trust { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--muted-bg); }
.trust h2 { margin: 0; font-size: 15px; }
.trust p { margin: 0; }
.trust-changed { border-color: var(--warn-ink); background: var(--warn-bg); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12.5px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.recents { flex: 0 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.recent { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); cursor: pointer; text-align: left; }
.recent:hover { border-color: var(--hover-line); background: var(--hover); }

/* ---- overlays ---- */
.overlay { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; background: var(--scrim); padding: 16px; }
.overlay-card { display: flex; align-items: center; gap: 10px; max-width: 460px; padding: 20px 24px; background: var(--surface); border-radius: 10px; box-shadow: 0 10px 30px var(--shadow); }
.confirm { width: min(420px, calc(100vw - 32px)); padding: 22px 24px 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); box-shadow: 0 10px 30px var(--shadow); }
.confirm::backdrop { background: var(--scrim); }
.confirm h2 { font-size: 16px; }
.confirm p { margin: 8px 0 20px; color: var(--muted); }
.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; }
.toast { position: fixed; right: 16px; bottom: 56px; z-index: 45; display: flex; align-items: flex-start; gap: 8px; max-width: min(520px, calc(100vw - 32px)); padding: 12px 8px 12px 16px; background: var(--side); color: var(--side-strong); border-radius: 8px; box-shadow: 0 8px 24px var(--shadow); }
.toast span { padding-top: 7px; overflow-wrap: anywhere; }
.toast .icon-btn { color: var(--side-strong); }
.toast .icon-btn:hover { background: var(--side-hover); }

/* ---- app shell ---- */
.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 10px 20px; background: var(--surface); border-bottom: 1px solid var(--line); }
/* The app is a fixed frame: top bar and footer stay, sidebar and main
   scroll on their own, so the sidebar's foot is always in view. */
.shell { height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
.shell .body { flex: 1; min-height: 0; flex-wrap: nowrap; }
.shell .sidebar { flex: 0 0 250px; overflow-y: auto; padding-bottom: 0; }
.shell .main { overflow-y: auto; }
.side-foot { position: sticky; bottom: 0; margin: auto -10px 0; padding: 10px 10px 14px; display: flex; flex-direction: column; gap: 8px; background: var(--side); border-top: 1px solid var(--side-field); }
.source { display: flex; flex-direction: column; gap: 3px; padding: 9px 12px; border: 1px solid var(--side-field); border-radius: 6px; font-size: 12.5px; color: var(--side-ink); min-width: 0; }
.source-server { display: flex; align-items: center; gap: 7px; min-width: 0; overflow-wrap: anywhere; color: var(--side-strong); }
.source-meta { color: var(--side-muted); padding-left: 17px; }
.pending-chip { display: flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 6px; background: var(--side-field); color: var(--side-strong); font-size: 12.5px; }
.pending-chip .spinner { width: 14px; height: 14px; border-color: var(--side-hover); border-top-color: var(--accent); }
.to-top { position: fixed; right: 24px; bottom: 56px; z-index: 30; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 1px solid var(--control-line); border-radius: 50%; background: var(--surface); color: var(--ink); box-shadow: 0 4px 14px var(--shadow); cursor: pointer; }
.to-top:hover { background: var(--hover); }
.to-top[hidden] { display: none; }
.search { flex: 1 1 280px; display: flex; align-items: center; gap: 5px; min-height: 38px; padding: 0 12px; border: 1px solid var(--control-line); border-radius: 6px; background: var(--field-bg); color: var(--muted); }
.search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: var(--ink); font-size: 14px; }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.search.is-disabled { opacity: 0.65; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.topbar .actions { flex-wrap: nowrap; align-items: center; margin-left: auto; }
.topbar .search { max-width: 640px; }
.more-btn { padding: 0 9px; }

/* Menus (Export, "⋯") */
.menu-wrap { position: relative; display: inline-flex; }
.menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 30; min-width: 300px; padding: 6px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 10px 30px var(--shadow); display: flex; flex-direction: column; }
.menu[hidden] { display: none; }
.mi { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 36px; padding: 6px 10px; border: 0; border-radius: 6px; background: transparent; text-align: left; cursor: pointer; color: var(--ink); font: inherit; }
.mi:hover, .mi:focus-visible { background: var(--hover); outline: none; }
.mi svg { color: var(--muted); flex: none; }
.mi-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.mi-sub { font-size: 12px; color: var(--muted); }
.mi.is-pro { color: var(--muted-ink); }
.menu-sep { height: 1px; margin: 5px 4px; background: var(--line-soft); }
.menu-h { padding: 8px 10px 4px; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.btn-split { display: inline-flex; }
.btn-split > .btn { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.btn-split > .menu-wrap > .btn { border-top-left-radius: 0; border-bottom-left-radius: 0; padding: 0 9px; border-left: 1px solid color-mix(in srgb, var(--on-accent) 35%, transparent); }
.body { flex: 1; display: flex; flex-wrap: wrap; align-items: stretch; }
.footer { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 20px; background: var(--surface); border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.footer-actions { display: flex; align-items: center; gap: 10px; }
.quit-btn { display: inline-flex; align-items: center; gap: 5px; min-height: 24px; padding: 0 10px; border: 1px solid var(--control-line); border-radius: 6px; background: transparent; color: var(--muted); font-size: 12px; cursor: pointer; }
.quit-btn:hover { color: var(--ink); background: var(--hover); }
.seg { display: inline-flex; border: 1px solid var(--control-line); border-radius: 6px; overflow: hidden; }
.seg button { min-height: 34px; padding: 0 12px; border: 0; background: var(--surface); color: var(--muted); font-weight: 500; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--control-line); }
.seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--ink); }
.theme-switch { display: inline-flex; border: 1px solid var(--control-line); border-radius: 6px; overflow: hidden; }
.theme-switch button { min-height: 24px; padding: 0 10px; border: 0; background: transparent; color: var(--muted); font-size: 12px; cursor: pointer; }
.theme-switch button + button { border-left: 1px solid var(--control-line); }
.theme-switch button[aria-pressed="true"] { background: var(--accent-soft); color: var(--ink); font-weight: 500; }

/* ---- sidebar ---- */
.sidebar { flex: 1 1 250px; max-width: 100%; background: var(--side); padding: 14px 10px 24px; display: flex; flex-direction: column; gap: 10px; }
.nav-search { display: flex; align-items: center; gap: 5px; min-height: 36px; padding: 0 10px; border-radius: 6px; background: var(--side-field); color: var(--side-muted); }
.nav-search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: var(--side-strong); font-size: 13.5px; }
.nav-search input::placeholder { color: var(--side-muted); }
.nav-search:focus-within { box-shadow: 0 0 0 2px var(--accent); }
.nav-groups { display: flex; flex-direction: column; gap: 4px; }
.nav-group { display: flex; flex-direction: column; }
.nav-group-btn { display: flex; align-items: center; gap: 5px; width: 100%; min-height: 38px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: var(--side-muted); font-size: 11.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; text-align: left; cursor: pointer; }
.nav-group-btn:hover { background: var(--side-hover); color: var(--side-strong); }
.chev { display: inline-flex; transition: transform 0.15s; }
.chev.is-open { transform: rotate(90deg); }
.nav-count { font-family: var(--mono); font-size: 11px; letter-spacing: 0; padding: 0 6px; border-radius: 999px; background: var(--side-field); }
.nav-items { display: flex; flex-direction: column; gap: 1px; padding: 2px 0 8px 14px; }
.nav-items[hidden] { display: none; }
.nav-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 36px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: var(--side-ink); font-size: 13.5px; text-align: left; cursor: pointer; }
.nav-item:hover { background: var(--side-hover); color: var(--side-strong); }
.nav-item.is-active { background: var(--accent); color: var(--on-accent); }
.nav-label { display: inline-flex; align-items: center; gap: 5px; }
.nav-home { font-weight: 600; }
.nav-tab { font-family: var(--mono); font-size: 11px; color: var(--side-muted); white-space: nowrap; }
.nav-item.is-active .nav-tab { color: var(--side-tab-active); }
.nav-empty { color: var(--side-muted); padding: 8px 10px; font-size: 13px; }

/* ---- main ---- */
.main { flex: 999 1 560px; min-width: 0; padding: 24px 28px 40px; display: flex; flex-direction: column; gap: 20px; outline: none; }
.page-head { display: flex; flex-direction: column; gap: 4px; }
.loading { display: flex; align-items: center; gap: 6px; }
.empty { padding: 24px 16px; text-align: center; color: var(--muted); }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.kpi { display: flex; flex-direction: column; gap: 4px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-align: left; cursor: pointer; }
.kpi:hover { border-color: var(--hover-line); }
.kpi-label, .kpi-sub { font-size: 13px; color: var(--muted); }
.kpi-value { font: 600 32px/1.15 var(--sans); letter-spacing: -0.02em; }

.split { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.panel.pad { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 16px; }
.split > .panel { flex: 1 1 360px; }
.split > .grow-3 { flex: 3 1 420px; } .split > .grow-2 { flex: 2 1 300px; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.panel-head.flat { padding: 0; border: 0; }
.attn { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 16px; border: 0; border-bottom: 1px solid var(--line-soft); background: var(--surface); text-align: left; cursor: pointer; }
.attn:last-child { border-bottom: 0; }
.attn:hover { background: var(--hover); }
.attn-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.attn-title { font-weight: 500; }
.attn-sub { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attn-link { font-size: 12.5px; font-weight: 500; color: var(--link); white-space: nowrap; }
.tasks { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.task { display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }

/* ---- overview dashboard ---- */
.section-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 32px; padding: 0 12px; border: 1px solid var(--control-line); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 500; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--link); color: var(--ink); }
.st-ok { --c: var(--st-ok); } .st-warn { --c: var(--st-warn); } .st-crit { --c: var(--st-crit); } .st-info { --c: var(--dot-info); } .st-seq { --c: var(--seq); }
.kpi .split-bar { margin-top: 6px; }
.split-bar { display: flex; gap: 2px; height: 6px; }
.split-bar.is-tall { height: 40px; }
.split-part { flex: 1 1 0; min-width: 4px; border-radius: 2px; background: var(--c); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; color: var(--surface); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--muted); }
.legend > span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 10px; height: 10px; border-radius: 2px; flex: none; background: var(--c); }
.gauge-row { display: grid; grid-template-columns: minmax(80px, 120px) repeat(3, minmax(0, 1fr)); align-items: center; gap: 8px; }
.gauge { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.gauge svg { max-width: 100%; height: auto; }
.g-track { stroke: var(--line-soft); }
.g-tick { stroke: var(--muted); }
.g-arc { stroke: var(--c); }
.g-value { fill: var(--ink); font: 600 20px var(--sans); }
.gauge figcaption { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.g-state { padding: 0 6px; border: 1px solid var(--c); border-radius: 999px; font-size: 11px; font-weight: 600; color: var(--ink); }
.heat { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 6px 4px; }
.heat-host { display: flex; flex-direction: column; gap: 2px; padding: 0; border: 0; background: none; cursor: pointer; min-width: 0; }
.heat-v { display: flex; align-items: center; justify-content: center; height: 24px; border-radius: 3px; background: var(--line-soft); color: var(--ink); font: 500 11px var(--mono); }
.heat-v.is-dark { color: var(--on-seq); }
.heat-name { font: 10.5px var(--mono); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }
.heat-host:hover .heat-name { color: var(--ink); }
.heat-key { display: flex; align-items: center; gap: 10px; }
.heat-scale { flex: 0 1 160px; height: 8px; border-radius: 2px; background: linear-gradient(90deg, color-mix(in oklab, var(--seq) 8%, var(--surface)), color-mix(in oklab, var(--seq) 62%, var(--surface)) 75%, color-mix(in oklab, var(--seq) 92%, var(--surface)) 75%, var(--seq)); }
.hbars { display: flex; flex-direction: column; gap: 4px; }
.hbar { display: grid; grid-template-columns: minmax(110px, 38%) minmax(0, 1fr) 64px; align-items: center; gap: 10px; width: 100%; min-height: 28px; padding: 0 4px; border: 0; border-radius: 4px; background: none; font-size: 12.5px; text-align: left; }
button.hbar { cursor: pointer; }
button.hbar:hover { background: var(--hover); }
.hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { display: block; height: 12px; }
.hbar-fill { display: block; height: 12px; border-radius: 0 4px 4px 0; background: var(--c); }
.hbar-value { text-align: right; color: var(--muted); white-space: nowrap; }
.columns { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.column { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0; border: 0; background: none; cursor: pointer; }
.column-plot { display: flex; align-items: flex-end; justify-content: center; width: 100%; height: 120px; border-bottom: 1px solid var(--line); }
.column-bar { display: block; width: 24px; min-height: 2px; border-radius: 4px 4px 0 0; background: var(--c); }
.column-value { font-weight: 600; font-size: 12.5px; }
.column-label { font-size: 12px; color: var(--muted); }
.column:hover .column-label { color: var(--ink); }

/* ---- table views ---- */
.banner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 14px 16px; border: 1px solid var(--accent-line); border-radius: var(--radius); background: var(--accent-soft); }
.pill-row { display: flex; flex-wrap: wrap; gap: 6px; }

.view-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; }
.title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tab-badge { padding: 2px 8px; border-radius: 4px; background: var(--muted-bg); font-size: 12px; color: var(--muted-ink); }
.desc { max-width: 720px; }
.notice { display: flex; align-items: flex-start; gap: 6px; padding: 12px 14px; border-radius: var(--radius); background: var(--warn-bg); color: var(--warn-ink); }
.notice[hidden] { display: none; }
.notice svg { flex: none; margin-top: 1px; }
.view-body { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.table-panel { flex: 999 1 480px; }
.table-scroll { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.grid th { position: sticky; top: 0; background: var(--surface-2); border-bottom: 1px solid var(--line); text-align: left; font-size: 12px; font-weight: 600; color: var(--muted-ink); white-space: nowrap; padding: 0; }
.th-btn { display: inline-flex; align-items: center; gap: 3px; width: 100%; padding: 10px 14px; border: 0; background: transparent; font-weight: 600; color: inherit; cursor: pointer; text-align: left; }
.th-btn:hover { color: var(--ink); }
table.grid td { padding: 10px 14px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; max-width: 420px; overflow: hidden; text-overflow: ellipsis; }
tr.row { cursor: pointer; }
tr.row:hover td { background: var(--hover); }
tr.row.is-sel td { background: var(--accent-soft); }
tr.row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.table-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line); background: var(--surface-2); font-size: 12.5px; color: var(--muted); }

/* ---- detail panel ---- */
.detail { flex: 1 1 360px; min-width: 0; max-height: calc(100vh - 120px); overflow: auto; position: sticky; top: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.detail[hidden] { display: none; }
.detail-head { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 10px 12px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.detail-head h2 { overflow-wrap: anywhere; }
.detail-body { display: flex; flex-direction: column; gap: 18px; padding: 14px 16px 20px; }
.detail-section { display: flex; flex-direction: column; gap: 8px; }
.kv { margin: 0; }
.kv-row { display: grid; grid-template-columns: minmax(110px, 40%) minmax(0, 1fr); gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line-soft); font-size: 13.5px; }
.kv-row dt { color: var(--muted); }
.kv-row dd { margin: 0; overflow-wrap: anywhere; }
.table-scroll.mini { border: 1px solid var(--line-soft); border-radius: 6px; }
table.grid.mini { font-size: 12.5px; }
table.grid.mini th { padding: 7px 10px; position: static; }
table.grid.mini td { padding: 7px 10px; max-width: 260px; }

/* ---- live log ---- */
/* The log panel takes the main area's remaining height, so its last line is
   never below the fold (the main area itself doesn't scroll on this page). */
.log-panel { flex: 1 1 0; min-height: 240px; display: flex; flex-direction: column; }
.log { flex: 1; min-height: 0; overflow: auto; font-size: 12.5px; }
.log-row { display: grid; grid-template-columns: 96px 64px minmax(0, 1fr); gap: 10px; align-items: baseline; padding: 5px 14px; border-bottom: 1px solid var(--line-soft); }
.log-row .pill { justify-self: start; }
.log-time { color: var(--muted); }
.log-text { display: flex; flex-wrap: wrap; gap: 4px 10px; min-width: 0; overflow-wrap: anywhere; }
.log-msg { font-weight: 500; }
.log-attrs { color: var(--muted); }

@media (max-width: 720px) {
  .shell { height: auto; }
  .shell .body { flex-wrap: wrap; }
  .shell .sidebar { flex: 1 1 100%; overflow: visible; }
  .shell .main { overflow: visible; }
  .side-foot { position: static; margin: 8px 0 0; }
  .log { max-height: 70vh; }
  .main { padding: 16px; }
  .topbar { padding: 10px 16px; flex-wrap: wrap; gap: 10px; }
  .topbar .brand > span:last-child { display: none; }
  .topbar .actions { gap: 6px; }
  .topbar .lbl { display: none; }
  .topbar .actions .btn { padding: 0 10px; }
  .topbar .search { order: 3; flex-basis: 100%; max-width: none; }
  .topbar .search.is-disabled { display: none; } /* nothing to filter on the Overview */
  .menu { min-width: min(300px, calc(100vw - 32px)); }
  .detail { position: static; max-height: none; }
}
