*{margin:0;padding:0;box-sizing:border-box}
:root{
  /* Minimal, near-monochrome surfaces with one accent — Linear/Vercel restraint
     plus a lean-ctx terminal signature (mono numerals, hairline rules). */
  --bg:#09090b;--surface:#101012;--surface-2:#17171a;--surface-3:#212126;
  --border:rgba(255,255,255,0.06);--border-light:rgba(255,255,255,0.11);
  --text:#e4e4e7;--text-bright:#fafafa;--muted:#8a8a93;
  --green:#34d399;--green-dim:rgba(52,211,153,0.10);--green-glow:rgba(52,211,153,0.16);
  --purple:#a78bfa;--purple-dim:rgba(167,139,250,0.10);
  --blue:#38bdf8;--blue-dim:rgba(56,189,248,0.10);
  --pink:#f472b6;--pink-dim:rgba(244,114,182,0.10);
  --yellow:#fbbf24;--yellow-dim:rgba(251,191,36,0.10);
  --red:#f87171;--red-dim:rgba(248,113,113,0.10);
  --orange:#fb923c;--orange-dim:rgba(251,146,60,0.10);
  --accent:var(--green);--accent-dim:var(--green-dim);--accent-glow:var(--green-glow);
  --grid:rgba(255,255,255,0.022);
  --font:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;
  --font-display:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
  --mono:'JetBrains Mono',ui-monospace,'SF Mono','Cascadia Mono',monospace;
  --r:9px;--rs:6px;
  --sidebar-w:56px;--sidebar-exp:240px;
  --support-bar-h:46px;
  --sp-xs:4px;--sp-sm:8px;--sp-md:16px;--sp-lg:24px;--sp-xl:32px;--sp-2xl:48px;
  --fs-xs:10px;--fs-sm:11px;--fs-md:13px;--fs-lg:16px;--fs-xl:22px;--fs-2xl:32px;--fs-hero:clamp(28px,5vw,64px);
  --ease-out:cubic-bezier(.22,1,.36,1);--ease-bounce:cubic-bezier(.34,1.56,.64,1);
  --t-fast:0.15s;--t-normal:0.25s;--t-slow:0.4s;
  --shadow-sm:none;
  --shadow-md:0 8px 30px rgba(0,0,0,0.45);
  --shadow-lg:0 18px 50px rgba(0,0,0,0.6);
  --shadow-glow-green:0 0 16px rgba(52,211,153,0.16);
  --z-base:0;--z-dropdown:100;--z-sticky:200;--z-overlay:300;--z-modal:400;--z-tooltip:500;
}
[data-theme="light"]{
  --bg:#fbfbfc;--surface:#ffffff;--surface-2:#f4f4f6;--surface-3:#ececef;
  --border:rgba(9,9,11,0.08);--border-light:rgba(9,9,11,0.14);
  --text:#27272a;--text-bright:#09090b;--muted:#71717a;
  --green:#059669;--green-dim:rgba(5,150,105,0.08);--green-glow:rgba(5,150,105,0.14);
  --purple:#7c3aed;--purple-dim:rgba(124,58,237,0.08);
  --blue:#0284c7;--blue-dim:rgba(2,132,199,0.08);
  --pink:#db2777;--pink-dim:rgba(219,39,119,0.08);
  --yellow:#d97706;--yellow-dim:rgba(217,119,6,0.08);
  --red:#dc2626;--red-dim:rgba(220,38,38,0.08);
  --orange:#ea580c;--orange-dim:rgba(234,88,12,0.08);
  --grid:rgba(9,9,11,0.03);
  --shadow-sm:none;
  --shadow-md:0 8px 30px rgba(9,9,11,0.10);--shadow-lg:0 18px 50px rgba(9,9,11,0.16);
  --shadow-glow-green:0 0 12px rgba(5,150,105,0.18);
}
[data-theme="light"] ::-webkit-scrollbar-thumb{background:rgba(0,0,0,0.12)}
[data-theme="light"] ::-webkit-scrollbar-thumb:hover{background:rgba(0,0,0,0.2)}
[data-theme="light"] *::selection{background:var(--green);color:var(--surface)}
[data-theme="light"] .buddy-card{background:var(--surface);border-color:var(--border)}
[data-theme="light"] .buddy-card::before{opacity:0.5}
[data-theme="light"] .info-tip-bubble{background:var(--surface);border-color:var(--border);box-shadow:var(--shadow-md)}
[data-theme="light"] .fullscreen-backdrop{background:rgba(255,255,255,0.85)}
[data-theme="light"] .card-fullscreen{background:var(--bg)}
[data-theme="light"] .buddy-speech{background:var(--surface-2);border-color:var(--border)}
[data-theme="light"] .ascii-global-bg pre{opacity:0.03}
[data-theme="light"] .buddy-speech::before{background:var(--surface-2);border-color:var(--border)}
body{
  background-color:var(--bg);color:var(--text);font-family:var(--font);min-height:100vh;
  font-weight:400;font-size:13px;line-height:1.5;-webkit-font-smoothing:antialiased;overflow-x:hidden;
  /* Signature: a whisper-faint dot matrix — terminal texture, never noise. */
  background-image:radial-gradient(var(--grid) 1px,transparent 1px);
  background-size:26px 26px;background-position:-1px -1px;background-attachment:fixed;
}
::selection{background:var(--green);color:var(--bg)}
::-webkit-scrollbar{width:6px;height:6px}
::-webkit-scrollbar-track{background:transparent}
::-webkit-scrollbar-thumb{background:rgba(255,255,255,0.08);border-radius:3px}
::-webkit-scrollbar-thumb:hover{background:rgba(255,255,255,0.14)}

.app-layout{display:flex;min-height:100vh;padding-top:var(--support-bar-h,0px)}

/* ── Support banner ───────────────────────────────────────────────────────
   A fixed bar pinned to the very top. It reserves vertical space via
   --support-bar-h (consumed by .sidebar `top` and .app-layout `padding-top`),
   so showing/hiding it cleanly pushes the whole cockpit down or back up.
   `html.support-bar-off` zeroes the variable and removes the bar. */
.support-bar{
  position:fixed;top:0;left:0;right:0;height:var(--support-bar-h);
  z-index:var(--z-overlay);
  display:flex;align-items:center;gap:12px;padding:0 12px 0 18px;
  background:linear-gradient(90deg,var(--accent-dim),rgba(0,0,0,0) 46%),var(--surface);
  border-bottom:1px solid var(--border);
  box-shadow:0 6px 18px rgba(0,0,0,0.16);
  font-size:13px;
}
.support-bar-heart{
  flex:0 0 auto;color:var(--accent);font-size:15px;line-height:1;
  text-shadow:0 0 10px var(--accent-glow);
  animation:supportHeart 1.9s var(--ease-out) infinite;
}
@keyframes supportHeart{0%,100%{transform:scale(1)}45%{transform:scale(1.22)}}
.support-bar-msg{
  display:flex;align-items:baseline;gap:8px;min-width:0;flex:1 1 auto;
  overflow:hidden;white-space:nowrap;
}
.support-bar-msg b{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;color:var(--text-bright);font-weight:600}
.support-bar-sub{flex:1 1 auto;min-width:0;color:var(--muted);overflow:hidden;text-overflow:ellipsis}
.support-bar-cta{
  flex:0 0 auto;font-weight:600;font-size:12px;letter-spacing:.01em;
  color:var(--accent);background:var(--accent-dim);
  border:1px solid var(--accent);border-radius:var(--rs);
  padding:5px 13px;text-decoration:none;
  transition:transform var(--t-fast) var(--ease-out),background var(--t-fast),color var(--t-fast),box-shadow var(--t-fast);
}
.support-bar-cta:hover{
  background:var(--accent);color:var(--bg);
  transform:translateY(-1px);box-shadow:var(--shadow-glow-green);
}
.support-bar-x{
  flex:0 0 auto;background:none;border:none;color:var(--muted);
  font-size:18px;line-height:1;cursor:pointer;padding:4px 8px;border-radius:var(--rs);
  transition:color var(--t-fast),background var(--t-fast);
}
.support-bar-x:hover{color:var(--text-bright);background:var(--surface-2)}
html.support-bar-off{--support-bar-h:0px}
html.support-bar-off .support-bar{display:none}
@media(max-width:640px){.support-bar-sub{display:none}}
/* Supporter thank-you state (GL #393): calm, no hover-lift, heart accent. */
.support-bar-thanks .support-bar-cta{
  pointer-events:none;background:transparent;
  color:var(--accent);border-color:var(--accent-dim);
}
.support-bar-thanks .support-bar-heart{color:var(--accent)}

.sidebar{
  position:fixed;top:var(--support-bar-h,0px);left:0;bottom:0;width:var(--sidebar-w);
  background:var(--surface);border-right:1px solid var(--border);
  display:flex;flex-direction:column;z-index:200;
  transition:width .25s cubic-bezier(.22,1,.36,1);overflow:hidden;
  box-shadow:1px 0 8px rgba(0,0,0,0.1);
}
.sidebar:hover,.sidebar.pinned{width:var(--sidebar-exp)}
.sidebar-logo{
  height:56px;display:flex;align-items:center;padding:0 16px;gap:8px;
  border-bottom:1px solid var(--border);flex-shrink:0;cursor:default;
}
.sidebar-logo svg,.sidebar-logo>span:first-child{flex-shrink:0}
.sidebar-logo-text{
  font-size:15px;font-weight:400;letter-spacing:-0.02em;white-space:nowrap;opacity:0;font-family:var(--font-display);
  transition:opacity .2s .05s;
}
.sidebar:hover .sidebar-logo-text,.sidebar.pinned .sidebar-logo-text{opacity:1}
.sidebar-logo-text span{
  color:var(--accent);-webkit-text-fill-color:currentColor;font-weight:600;font-family:var(--mono);
}

.sidebar-nav{flex:1;padding:8px;overflow-y:auto;overflow-x:hidden}
.nav-section{margin-top:8px}
.nav-section:first-child{margin-top:0}
.nav-section-label{
  font-size:9px;font-weight:700;text-transform:uppercase;letter-spacing:.14em;font-family:var(--mono);
  color:var(--muted);padding:8px 12px 4px;white-space:nowrap;
  opacity:0;transition:opacity .2s .05s;
}
.sidebar:hover .nav-section-label,.sidebar.pinned .nav-section-label{opacity:0.6}
.nav-section-job{
  display:block;font-size:8px;font-weight:500;letter-spacing:.06em;text-transform:none;
  color:var(--muted);opacity:.75;margin-top:1px;
}
.nav-divider{height:1px;background:var(--border);margin:6px 8px}
.nav-item{
  display:flex;align-items:center;gap:12px;padding:8px 12px;border-radius:var(--rs);
  cursor:pointer;color:var(--muted);transition:all .15s;white-space:nowrap;
  font-size:12px;font-weight:450;position:relative;
}
.nav-item:hover{color:var(--text);background:var(--surface-2)}
.nav-item.active{color:var(--green);background:var(--green-dim)}
.nav-item.active::before{
  content:'';position:absolute;left:0;top:50%;transform:translateY(-50%);
  width:3px;height:20px;background:var(--green);border-radius:0 3px 3px 0;
}
.nav-item:focus{outline:none;color:var(--text);background:var(--surface-2);box-shadow:0 0 0 2px rgba(52,211,153,0.2) inset}
.nav-item svg{flex-shrink:0;width:18px;height:18px}
.nav-ascii{font-family:var(--mono);font-size:10px;font-weight:700;flex-shrink:0;width:18px;text-align:center;opacity:0.7}
.nav-icon{flex-shrink:0;width:18px;height:18px;display:flex;align-items:center;justify-content:center;opacity:0.6;transition:opacity .15s}
.nav-item:hover .nav-icon,.nav-item.active .nav-icon{opacity:1}
.nav-icon svg{width:18px;height:18px}
.nav-label{opacity:0;transition:opacity .2s .05s}
.sidebar:hover .nav-label,.sidebar.pinned .nav-label{opacity:1}

.sidebar-footer{
  padding:14px 16px;border-top:1px solid var(--border);font-size:10px;
  color:var(--muted);font-family:var(--mono);white-space:nowrap;
  opacity:0;transition:opacity .2s .05s;
}
.sidebar:hover .sidebar-footer,.sidebar.pinned .sidebar-footer{opacity:0.6}

.main{
  flex:1;margin-left:var(--sidebar-w);padding:24px 32px 80px;
  transition:all .25s cubic-bezier(.22,1,.36,1);
  min-width: 0;
}
.content-container{
  max-width:1720px;
  margin:0 auto;
  width:100%;
}

.view{display:none;opacity:0;transition:opacity .25s ease;transform:translateY(4px);transition:opacity .25s ease,transform .25s ease}
.view.active{display:block;opacity:1;transform:translateY(0)}

.topbar{
  display:flex;align-items:center;justify-content:space-between;
  margin-bottom:24px;padding:16px 0;border-bottom:1px solid var(--border);
  /* Sticky offset must clear the fixed support bar (z300), otherwise the
     banner swallows clicks on the topbar controls once the page scrolls. */
  position:sticky;top:var(--support-bar-h,0px);background:var(--bg);z-index:100;
  backdrop-filter:blur(12px);
}
.topbar-title{font-size:22px;font-weight:400;letter-spacing:-0.03em;font-family:var(--font-display)}
.topbar-actions{display:flex;align-items:center;gap:8px}
.pulse{display:flex;align-items:center;gap:5px;font-size:10px;color:var(--muted)}
.dot{width:5px;height:5px;border-radius:50%;background:var(--green);animation:p 2s ease infinite}
@keyframes p{0%,100%{opacity:1}50%{opacity:.3}}
.dot.off{background:var(--muted);animation:none}
.btn{
  background:transparent;border:1px solid var(--border);color:var(--muted);padding:6px 14px;
  border-radius:var(--rs);font-size:11px;font-family:var(--font);cursor:pointer;
  transition:border-color .15s,color .15s,background .15s;
}
.btn:hover{border-color:var(--border-light);color:var(--text);background:var(--surface-2)}

.refresh-btn{
  display:flex;align-items:center;gap:6px;background:transparent;border:1px solid var(--border);
  color:var(--muted);padding:6px 14px;border-radius:var(--rs);font-size:11px;font-family:var(--font);
  cursor:pointer;transition:all .2s;position:relative;
}
.refresh-btn:hover{border-color:var(--border-light);color:var(--text)}
.refresh-btn.has-update{
  border-color:var(--green);color:var(--green);
  box-shadow:0 0 12px rgba(52,211,153,0.3),0 0 4px rgba(52,211,153,0.2);
  animation:refreshGlow 2s ease infinite;
}
.refresh-btn.spinning svg{animation:spin .6s linear}
@keyframes refreshGlow{
  0%,100%{box-shadow:0 0 12px rgba(52,211,153,0.3)}
  50%{box-shadow:0 0 20px rgba(52,211,153,0.5),0 0 8px rgba(52,211,153,0.3)}
}
@keyframes spin{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}
.ver-badge{
  color:var(--muted);font-size:10px;font-family:var(--mono);
  background:var(--surface-2);padding:3px 8px;border-radius:5px;border:1px solid var(--border);
}

.tf-bar{display:flex;gap:4px;margin-bottom:12px}
/* Slim-Home status strip (GL #486): one compact line instead of 4 cards */
.status-strip{display:flex;flex-wrap:wrap;gap:8px 28px;align-items:center;padding:12px 16px}
.status-strip .status-chip{display:inline-flex;align-items:baseline;gap:8px;min-width:0}
.status-strip .status-chip .sl{font-size:10px;text-transform:uppercase;letter-spacing:.08em;color:var(--muted);white-space:nowrap}
.status-strip .status-chip .sv{font-size:12px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:340px}
.status-strip .status-chip-sub{font-weight:400;color:var(--muted);font-size:11px}
.cko-cmd-toggle{
  display:block;width:100%;margin-top:10px;padding:7px 12px;border-radius:var(--rs);
  border:1px solid var(--border);background:transparent;color:var(--muted);
  font-family:var(--mono);font-size:11px;cursor:pointer;transition:all .15s;
}
.cko-cmd-toggle:hover{color:var(--text);border-color:var(--accent);background:var(--bg-hover,rgba(255,255,255,.03))}
.cks-open-lab{
  margin-left:auto;padding:3px 10px;border-radius:var(--rs);border:1px solid var(--border);
  background:transparent;color:var(--muted);font-family:var(--mono);font-size:10px;cursor:pointer;
}
.cks-open-lab:hover{color:var(--text);border-color:var(--accent)}
.tf-btn{
  padding:6px 14px;font-size:11px;font-weight:500;border-radius:var(--rs);
  border:1px solid var(--border);background:none;color:var(--muted);
  cursor:pointer;font-family:var(--font);transition:all .15s;
}
.tf-btn:hover{border-color:var(--border-light);color:var(--text)}
.tf-btn.active{border-color:var(--green-glow);background:var(--green-dim);color:var(--green)}
.hero{display:grid;grid-template-columns:repeat(auto-fit,minmax(168px,1fr));gap:12px;margin-bottom:24px}
.hero-main{
  position:relative;border-radius:var(--r);padding:28px 30px;overflow:hidden;
  background:var(--surface);border:1px solid var(--border);
  grid-column:1 / -1;
  display:flex;flex-direction:column;justify-content:center;
}
.hero-main::before{content:none}
.hero-main .hv{
  font-family:var(--mono);font-size:clamp(34px,6vw,60px);font-weight:600;letter-spacing:-0.035em;line-height:1;
  color:var(--accent);margin-bottom:6px;
}
.hero-main .hl{font-family:var(--mono);font-size:10px;color:var(--muted);text-transform:uppercase;letter-spacing:.18em;font-weight:600;margin-bottom:12px}
.hero-main .hs{font-size:12.5px;color:var(--muted);margin-top:12px;line-height:1.7}
.hero-main .hs b{color:var(--text);font-weight:500}

.hc{
  background:var(--surface);border:1px solid var(--border);border-radius:var(--r);
  padding:18px;display:flex;flex-direction:column;justify-content:flex-start;gap:9px;
  transition:border-color .2s var(--ease-out);min-height:106px;
}
.hc:hover{border-color:var(--border-light)}
.hc .hl{font-family:var(--mono);font-size:9px;color:var(--muted);text-transform:uppercase;letter-spacing:.15em;font-weight:600}
.hc .hv{font-family:var(--mono);font-size:25px;font-weight:600;letter-spacing:-0.03em;line-height:1;color:var(--text-bright)}
.hc .hs{font-size:10.5px;color:var(--muted);margin-top:auto;font-family:var(--mono);line-height:1.5}

/* Clickable Context Health hero card */
.hc--link{cursor:pointer}
.hc--link:hover{border-color:var(--accent)}
.hc--link:focus-visible{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-dim)}
.hc .hv.hc-health-v{display:flex;align-items:center;gap:8px;font-size:20px}
.hc-health-dot{width:9px;height:9px;border-radius:50%;flex-shrink:0}
.hc-health-go{color:var(--accent);opacity:.55;margin-left:7px;transition:opacity .15s;white-space:nowrap}
.hc--link:hover .hc-health-go{opacity:1}

.row{display:grid;gap:16px;margin-bottom:20px}
.r3{grid-template-columns:repeat(auto-fit, minmax(320px, 1fr))}
.r21{grid-template-columns:2.2fr 1fr}
.r12{grid-template-columns:1fr 2.2fr}
.r11{grid-template-columns:repeat(auto-fit, minmax(400px, 1fr))}
.r1{grid-template-columns:1fr}
.r4{grid-template-columns:repeat(auto-fit, minmax(280px, 1fr))}
.ctx-metric{display:flex;justify-content:space-between;align-items:center;padding:5px 0;border-bottom:1px solid var(--border)}
.ctx-metric:last-child{border-bottom:none}
.ctx-label{font-size:11px;color:var(--muted);text-transform:uppercase;letter-spacing:0.4px;font-weight:500}
.ctx-val{font-size:12px;font-weight:600;font-family:var(--mono);color:var(--text)}

.card{
  background:var(--surface);border:1px solid var(--border);border-radius:var(--r);
  padding:22px;transition:border-color .2s var(--ease-out),background .2s var(--ease-out);
}
.card:hover{border-color:var(--border-light)}
.card h3{
  font-size:10px;color:var(--muted);margin-bottom:18px;font-weight:600;font-family:var(--mono);
  text-transform:uppercase;letter-spacing:.16em;display:flex;align-items:center;gap:8px;
}
.badge{
  font-size:10px;background:var(--green-dim);color:var(--green);padding:3px 10px;
  border-radius:5px;letter-spacing:.05em;font-family:var(--mono);font-weight:600;
}
.card canvas{max-height:220px}

.card-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px}
.card-header h3{margin-bottom:0}
.expand-btn{
  background:var(--surface-2);border:1px solid var(--border);color:var(--muted);
  width:28px;height:28px;border-radius:4px;cursor:pointer;display:flex;
  align-items:center;justify-content:center;transition:all .2s cubic-bezier(.22,1,.36,1);flex-shrink:0;
}
.expand-btn:hover{border-color:var(--accent);color:var(--accent);background:var(--accent-dim)}
.fullscreen-backdrop{
  position:fixed;inset:0;z-index:998;background:rgba(0,0,0,0.9);
  backdrop-filter:blur(12px);animation:fadeIn .25s ease;
}
.card-fullscreen{
  position:fixed;inset:20px;z-index:999;border-radius:var(--r);border:1px solid var(--border-light);
  padding:40px;overflow:auto;animation:scaleIn .3s cubic-bezier(.22,1,.36,1);
  background:radial-gradient(ellipse at 20% 20%,rgba(52,211,153,0.03),transparent 50%),
             radial-gradient(ellipse at 80% 80%,rgba(129,140,248,0.03),transparent 50%),
             var(--bg);
  box-shadow:var(--shadow-lg);
}
@keyframes scaleIn{from{opacity:0;transform:scale(0.96)}to{opacity:1;transform:scale(1)}}
.card-fullscreen canvas{max-height:none!important;height:calc(100vh - 160px)!important}
.card-fullscreen svg.d3-graph{width:100%!important;height:calc(100vh - 160px)!important}
.card-fullscreen .close-fs{
  position:absolute;top:20px;right:20px;background:var(--surface);backdrop-filter:blur(16px);
  border:1px solid var(--border-light);color:var(--text);width:36px;height:36px;border-radius:4px;
  cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:16px;z-index:1000;
  transition:all .2s;box-shadow:var(--shadow-md);
}
.card-fullscreen .close-fs:hover{border-color:var(--green);color:var(--green);transform:scale(1.1)}
@keyframes fadeIn{from{opacity:0}to{opacity:1}}

.cost-row{display:flex;align-items:stretch;gap:0}
.cost-box{flex:1;padding:20px 16px;text-align:center;border-radius:var(--rs)}
.cost-box.bad{background:var(--red-dim);border:1px solid rgba(248,113,113,0.1)}
.cost-box.good{background:var(--green-dim);border:1px solid rgba(52,211,153,0.1)}
.cost-box .amt{font-size:28px;font-weight:700;letter-spacing:-.03em}
.cost-box .lb{font-size:10px;color:var(--muted);text-transform:uppercase;letter-spacing:.12em;font-weight:600;margin-top:6px}
.cost-arrow{display:flex;align-items:center;padding:0 14px;color:var(--green);font-size:18px;opacity:.6}
.cost-detail{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:16px}
.cd-item{background:var(--surface-2);border-radius:8px;padding:12px;text-align:center}
.cd-item .v{font-size:18px;font-weight:700;letter-spacing:-.02em}
.cd-item .l{font-size:10px;color:var(--muted);text-transform:uppercase;letter-spacing:.1em;margin-top:4px}

.src-grid{display:grid;grid-template-columns:1fr 1fr;gap:0;border:1px solid var(--border);border-radius:var(--rs);overflow:hidden}
.src-item{padding:16px 18px;background:var(--surface)}
.src-item:first-child{border-right:1px solid var(--border)}
.src-item h4{font-size:10px;color:var(--muted);text-transform:uppercase;letter-spacing:.12em;font-weight:600;margin-bottom:10px;display:flex;align-items:center;gap:6px}
.src-item h4 .d{width:7px;height:7px;border-radius:50%}
.sr{display:flex;justify-content:space-between;padding:6px 0;font-size:11px}
.sr .sl{color:var(--muted)}.sr .sv{font-family:var(--mono);font-weight:500;color:var(--text-bright)}
.sl{font-size:11px;color:var(--muted);font-weight:500}
.sv{font-size:11px;font-family:var(--mono);font-weight:500;color:var(--text-bright)}

table{width:100%;border-collapse:collapse}
th{text-align:left;font-size:10px;color:var(--muted);text-transform:uppercase;letter-spacing:.1em;
  padding:12px 14px;border-bottom:1px solid var(--border);font-weight:600}
th.r{text-align:right}
td{padding:10px 14px;font-size:12px;border-bottom:1px solid var(--border);font-family:var(--mono)}
td.r{text-align:right}
tr:last-child td{border-bottom:none}
tr:hover td{background:var(--surface-2)}
.tag{display:inline-block;padding:3px 9px;border-radius:5px;font-size:10px;font-weight:600;font-family:var(--mono)}
.tg{background:var(--green-dim);color:var(--green)}
.tp{background:var(--purple-dim);color:var(--purple)}
.tb{background:var(--blue-dim);color:var(--blue)}
.ty{background:var(--yellow-dim);color:var(--yellow)}
.td{background:var(--red-dim);color:var(--red)}
.tpk{background:var(--pink-dim);color:var(--pink)}
.tw{background:var(--orange-dim);color:var(--orange)}
.tn{background:var(--surface-2);color:var(--muted);border:1px solid var(--border)}
.to{background:var(--orange-dim);color:var(--orange)}
.bar-bg{background:var(--surface-2);border-radius:3px;height:4px;overflow:hidden;margin-top:2px}
.bar-f{height:100%;border-radius:3px;transition:width .6s cubic-bezier(.22,1,.36,1)}

.empty-state{
  text-align:center;padding:48px 24px;color:var(--muted);
  background:var(--surface);border:1px dashed var(--border-light);border-radius:var(--r);
}
.empty-state h2{font-size:18px;font-weight:400;color:var(--text);margin-bottom:12px}
.empty-state p{font-size:13px;line-height:1.7;max-width:440px;margin:0 auto}
.hs{font-size:11px;color:var(--muted);line-height:1.55}

.info-tip{
  position:relative;display:inline-flex;align-items:center;justify-content:center;
  width:14px;height:14px;color:var(--muted);cursor:help;
  margin-left:5px;vertical-align:middle;flex-shrink:0;
  opacity:0.5;transition:opacity .15s,color .15s;
}
.info-tip:hover,.info-tip:focus{opacity:1;color:var(--green);outline:none}
/* Tooltip bubble is portaled to <body> by lib/shared.js (showInfoTip), so an
   ancestor's overflow:hidden (.hero-main/.buddy-card) can no longer clip it
   (#357). JS positions it: prefers above the icon, flips below when there isn't
   room, and clamps inside the viewport. .info-tip keeps only the icon. */
.info-tip-bubble{
  position:fixed;top:0;left:0;z-index:var(--z-tooltip);
  padding:10px 14px;
  background:var(--surface);border:1px solid var(--border-light);border-radius:10px;
  color:var(--text);font-size:11px;font-weight:400;font-family:var(--font);
  line-height:1.55;letter-spacing:0;text-transform:none;
  white-space:normal;width:max-content;max-width:280px;
  box-shadow:var(--shadow-lg);pointer-events:none;
  opacity:0;transition:opacity .15s;
}
.info-tip-bubble.show{opacity:1}
.info-tip-bubble::after{
  content:'';position:absolute;left:var(--arrow-x,50%);
  border:6px solid transparent;transform:translateX(-50%);
}
.info-tip-bubble.above::after{top:100%;margin-top:-1px;border-top-color:var(--surface)}
.info-tip-bubble.below::after{bottom:100%;margin-bottom:-1px;border-bottom-color:var(--surface)}
.loading-state{
  text-align:center;padding:60px 24px;color:var(--muted);font-size:13px;
}
.loading-state::before{
  content:'';display:block;width:28px;height:28px;margin:0 auto 14px;
  border:2px solid var(--border);border-top-color:var(--green);border-radius:50%;
  animation:spin .8s linear infinite;
}

.how-it-works{
  margin-top:20px;border:1px solid var(--border);border-radius:var(--rs);overflow:hidden;
}
.how-toggle{
  display:flex;align-items:center;gap:8px;padding:12px 16px;cursor:pointer;
  font-size:11px;color:var(--muted);background:var(--surface);transition:.15s;
  border:none;width:100%;text-align:left;font-family:var(--font);
}
.how-toggle:hover{color:var(--text);background:var(--surface-2)}
.how-toggle svg{transition:transform .2s;flex-shrink:0}
.how-toggle.open svg{transform:rotate(90deg)}
.how-content{
  display:none;padding:16px;font-size:12px;line-height:1.8;color:var(--muted);
  background:var(--surface);border-top:1px solid var(--border);
}
.how-content.open{display:block}
.how-content strong{color:var(--text);font-weight:500}
.how-content code{
  background:var(--surface-3);border:1px solid var(--border);border-radius:4px;
  padding:1px 5px;font-family:var(--mono);font-size:11px;
}

.buddy-card{
  position:relative;background:var(--surface);backdrop-filter:blur(24px);
  border:1px solid var(--border-light);border-radius:var(--r);padding:28px;overflow:hidden;
  display:flex;gap:28px;align-items:center;flex-wrap:wrap;transition:all .3s ease;
}
.buddy-card::before{
  content:'';position:absolute;top:-40%;right:-20%;width:300px;height:300px;
  border-radius:50%;pointer-events:none;transition:opacity .3s;
}
.buddy-sprite.lvl-t1 pre{animation:buddyFloat 3.2s ease-in-out infinite}
.buddy-sprite.lvl-t2 pre{animation:buddyFloat 2.6s ease-in-out infinite}
.buddy-sprite.lvl-t3 pre{animation:buddyFloat 2.1s ease-in-out infinite}
.buddy-sprite.lvl-t4 pre{animation:buddyFloat 1.8s ease-in-out infinite}
@keyframes buddyFloat{0%,100%{transform:translateY(0)}50%{transform:translateY(-3px)}}
@keyframes glow-pulse{0%,100%{opacity:0.7}50%{opacity:1}}
@keyframes shimmer{0%{transform:translate(0,0) scale(1);opacity:0.7}50%{transform:translate(5%,-5%) scale(1.1);opacity:1}100%{transform:translate(0,0) scale(1);opacity:0.7}}
.buddy-sprite{position:relative;z-index:1}
.buddy-sprite pre{font-family:var(--mono);font-size:14px;line-height:1.35;margin:0;white-space:pre;letter-spacing:0.05em;color:var(--text)}
/* Theme-coloured buddy: the creature always wears the active accent, and its
   aura intensifies with each (endless) ascension tier via the --buddyGlow var
   set inline — so it keeps visibly changing forever without needing new hues. */
.buddy-card--theme::before{background:radial-gradient(circle,var(--accent-glow),transparent 60%);animation:glow-pulse 4s ease infinite}
.buddy-sprite--theme pre{
  color:var(--accent);
  text-shadow:0 0 var(--buddyGlow,14px) color-mix(in srgb,var(--accent) 55%,transparent),
              0 0 5px color-mix(in srgb,var(--accent) 80%,transparent);
}
.buddy-sprite--ascend pre{animation:buddyFloat 1.8s ease-in-out infinite,buddyAura 3.6s ease-in-out infinite}
@keyframes buddyAura{0%,100%{filter:brightness(1) saturate(1)}50%{filter:brightness(1.35) saturate(1.25)}}
.buddy-form{
  color:var(--accent);font-weight:700;font-family:var(--mono);font-size:10px;
  text-transform:uppercase;letter-spacing:.08em;padding:2px 7px;border-radius:5px;
  background:var(--accent-dim);border:1px solid color-mix(in srgb,var(--accent) 28%,transparent);
}
.buddy-info{flex:1;min-width:240px;position:relative;z-index:1}
.buddy-name{font-size:20px;font-weight:700;letter-spacing:-0.02em;margin-bottom:2px;display:flex;align-items:center;gap:8px}
.buddy-meta{font-size:11px;color:var(--muted);margin-bottom:14px;display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.rarity-badge{font-size:10px;padding:3px 8px;border-radius:5px;font-weight:700;font-family:var(--mono);letter-spacing:.05em;text-transform:uppercase}
.rarity-badge.r-Uncommon{background:var(--green-dim);color:var(--green);border:1px solid rgba(52,211,153,0.2)}
.rarity-badge.r-Rare{background:var(--blue-dim);color:var(--blue);border:1px solid rgba(56,189,248,0.2)}
.rarity-badge.r-Epic{background:var(--purple-dim);color:var(--purple);border:1px solid rgba(192,132,252,0.2)}
.rarity-badge.r-Legendary{background:var(--yellow-dim);color:var(--yellow);border:1px solid rgba(251,191,36,0.2);animation:glow-pulse 2s ease infinite}
.mood-dot{width:6px;height:6px;border-radius:50%;display:inline-block}
.mood-Ecstatic{background:var(--yellow);box-shadow:0 0 6px var(--yellow)}
.mood-Happy{background:var(--green);box-shadow:0 0 6px var(--green)}
.mood-Content{background:var(--blue)}
.mood-Worried{background:var(--red);box-shadow:0 0 6px var(--red)}
.mood-Sleeping{background:var(--muted)}
.buddy-stats-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:6px;margin-bottom:14px}
.stat-cell{text-align:center;background:var(--surface-2);border-radius:8px;padding:8px 4px;border:1px solid var(--border);transition:border-color .2s}
.stat-cell:hover{border-color:var(--border-light)}
.stat-label{font-size:9px;color:var(--muted);text-transform:uppercase;letter-spacing:.1em;font-weight:600;margin-bottom:4px}
.stat-gauge{position:relative;width:36px;height:36px;margin:0 auto 4px}
.stat-gauge svg{transform:rotate(-90deg)}
.stat-gauge circle{fill:none;stroke-width:3}
.stat-gauge .bg{stroke:var(--surface-3)}
.stat-gauge .fg{stroke-linecap:round;transition:stroke-dashoffset 1s ease}
.stat-val{font-size:13px;font-weight:700;letter-spacing:-0.02em}
.buddy-speech{font-size:11px;color:var(--muted);font-style:italic;padding:10px 14px;background:var(--surface-2);border-radius:8px;border:1px solid var(--border);position:relative;margin-top:2px}
.buddy-speech::before{content:'';position:absolute;left:16px;top:-5px;width:10px;height:10px;background:var(--surface-2);border-left:1px solid var(--border);border-top:1px solid var(--border);transform:rotate(45deg)}

.event-card{
  background:var(--surface);border:1px solid var(--border);border-radius:var(--r);
  padding:16px 20px;display:flex;align-items:center;gap:16px;transition:all .25s cubic-bezier(.22,1,.36,1);
  animation:fadeUp .35s ease both;position:relative;overflow:hidden;
  box-shadow:var(--shadow-sm);
}
.event-card::before{
  content:'';position:absolute;left:0;top:0;bottom:0;width:3px;border-radius:3px 0 0 3px;
  background:var(--event-accent,var(--muted));opacity:0;transition:opacity .2s;
}
.event-card:hover{border-color:var(--border-light);transform:translateX(6px);box-shadow:var(--shadow-md)}
.event-card:hover::before{opacity:1}
.event-icon{
  width:40px;height:40px;border-radius:4px;display:flex;align-items:center;justify-content:center;
  font-size:15px;flex-shrink:0;backdrop-filter:blur(8px);
}
.event-body{flex:1;min-width:0}
.event-tool{font-size:13px;font-weight:600;color:var(--text-bright);letter-spacing:-0.01em}
.event-detail{font-size:11px;color:var(--muted);font-family:var(--mono);margin-top:6px;line-height:1.6}
.event-time{font-size:10px;color:var(--muted);font-family:var(--mono);flex-shrink:0;opacity:0.6;font-weight:500}

.filter-row{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:20px}
.filter-btn{
  background:var(--surface);border:1px solid var(--border);color:var(--muted);
  padding:7px 18px;border-radius:4px;font-size:11px;font-family:var(--mono);
  cursor:pointer;transition:all .2s cubic-bezier(.22,1,.36,1);font-weight:600;
  letter-spacing:.03em;
}
.filter-btn:hover{color:var(--text);border-color:var(--border-light);background:var(--surface-2);transform:translateY(-1px)}
.filter-btn.active{color:var(--accent);border-color:var(--accent);background:var(--accent-dim)}

.d3-container{
  width:100%;height:calc(100vh - 200px);min-height:500px;border-radius:var(--r);overflow:hidden;
  background:var(--surface);border:1px solid var(--border);position:relative;
  transition:all .4s cubic-bezier(.22,1,.36,1);
}
.d3-container svg{width:100%;height:100%;transition:all .3s ease}
.d3-container.graph-fullscreen{
  position:fixed;inset:0;z-index:1000;border-radius:0;border:none;
  height:100vh!important;min-height:100vh;width:100vw;
  background:radial-gradient(ellipse at 20% 50%, rgba(52,211,153,0.03) 0%, transparent 50%),
             radial-gradient(ellipse at 80% 20%, rgba(129,140,248,0.03) 0%, transparent 50%),
             radial-gradient(ellipse at 50% 80%, rgba(56,189,248,0.02) 0%, transparent 50%),
             var(--bg);
}
.d3-container.graph-fullscreen::before{
  content:'';position:absolute;inset:0;z-index:0;pointer-events:none;
  background-image:radial-gradient(circle,var(--border) 1px,transparent 1px);
  background-size:28px 28px;
}
.d3-container.graph-fullscreen svg{width:100vw!important;height:100vh!important;position:relative;z-index:1}
.graph-toolbar{
  position:absolute;top:12px;right:12px;z-index:10;display:flex;gap:4px;
  background:color-mix(in srgb, var(--bg) 90%, transparent);backdrop-filter:blur(16px);
  border:1px solid var(--border);border-radius:10px;padding:4px;
  box-shadow:var(--shadow-lg);
}
.graph-toolbar button{
  background:transparent;border:1px solid transparent;color:var(--muted);
  width:30px;height:30px;border-radius:4px;cursor:pointer;display:flex;
  align-items:center;justify-content:center;transition:all .2s;font-size:13px;
}
.graph-toolbar button:hover{color:var(--green);border-color:var(--border-light);background:var(--surface-2)}
.graph-toolbar button.active{color:var(--green);background:var(--green-dim);border-color:var(--green-glow)}
.graph-toolbar .tb-sep{width:1px;background:var(--border);margin:4px 2px}
.graph-legend{
  position:absolute;bottom:16px;left:16px;z-index:10;display:flex;flex-direction:column;gap:3px;
  min-width:150px;max-width:210px;max-height:46%;overflow:auto;
  background:color-mix(in srgb, var(--bg) 90%, transparent);backdrop-filter:blur(16px);
  border:1px solid var(--border);border-radius:10px;padding:9px 11px;
  box-shadow:var(--shadow-lg);transition:opacity .3s;
}
.graph-legend-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:4px}
.graph-legend-head .gl-title{font-size:10px;font-weight:700;color:var(--text-bright);text-transform:uppercase;letter-spacing:.04em}
.gl-reset{
  font-size:9px;color:var(--muted);background:transparent;border:1px solid var(--border);
  border-radius:5px;padding:1px 7px;cursor:pointer;font-family:var(--mono);text-transform:uppercase;letter-spacing:.03em
}
.gl-reset:hover{color:var(--green);border-color:var(--green-glow)}
.graph-legend-item{
  display:flex;align-items:center;gap:7px;font-size:11px;color:var(--text);cursor:pointer;
  padding:2px 6px;border-radius:6px;border:1px solid transparent;transition:all .12s;user-select:none
}
.graph-legend-item:hover{background:color-mix(in srgb, var(--bg) 60%, transparent);border-color:var(--border)}
.graph-legend-item .gl-name{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.graph-legend-item .gl-count{color:var(--muted);font-family:var(--mono);font-size:10px;flex-shrink:0}
.graph-legend-item.gl-off{opacity:.4}
.graph-legend-item.gl-off .gl-name{text-decoration:line-through}
.graph-legend-dot{width:9px;height:9px;border-radius:50%;flex-shrink:0;box-shadow:0 0 6px currentColor}
.graph-insights{
  position:absolute;top:58px;right:12px;z-index:10;width:244px;max-height:62%;overflow:auto;
  background:color-mix(in srgb, var(--bg) 92%, transparent);backdrop-filter:blur(16px);
  border:1px solid var(--border);border-radius:10px;padding:10px 12px;
  box-shadow:var(--shadow-lg);font-family:var(--mono)
}
.graph-insights .gi-head{font-size:11px;font-weight:700;color:var(--text-bright);margin-bottom:8px;letter-spacing:.04em;text-transform:uppercase}
.gi-sec{margin-bottom:10px}
.gi-sec:last-child{margin-bottom:0}
.gi-sec-title{font-size:10px;color:var(--muted);text-transform:uppercase;letter-spacing:.04em;margin-bottom:5px;display:flex;justify-content:space-between}
.gi-sec-title span{color:var(--text-bright);font-weight:700}
.gi-list{display:flex;flex-direction:column;gap:3px}
.gi-item{
  display:flex;justify-content:space-between;align-items:center;gap:8px;width:100%;
  background:color-mix(in srgb, var(--text-bright) 4%, transparent);border:1px solid transparent;border-radius:7px;
  padding:4px 8px;cursor:pointer;color:var(--text);font-family:var(--mono);font-size:11px;text-align:left
}
.gi-item:hover{border-color:var(--border);background:color-mix(in srgb, var(--bg) 60%, transparent)}
.gi-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.gi-deg{color:var(--text-bright);font-weight:700;flex-shrink:0}
.gi-io{color:var(--muted);font-weight:400;font-size:10px}
.gi-cycle .gi-deg{color:var(--orange,#e0a050)}
.gi-bw{color:var(--blue,#5b9cff)}
.gi-surp-score{color:var(--pink,#e06a9c)}
.gi-empty{font-size:10px;color:var(--muted)}
/* #270 suggested questions */
.gi-ask .gi-qlist{display:flex;flex-direction:column;gap:4px}
.gi-q{display:block;width:100%;text-align:left;font-family:var(--mono);font-size:11px;line-height:1.3;color:var(--text);background:color-mix(in srgb, var(--green,#3fb950) 8%, transparent);border:1px solid color-mix(in srgb, var(--green,#3fb950) 22%, transparent);border-radius:7px;padding:5px 8px;cursor:pointer}
.gi-q:hover{background:color-mix(in srgb, var(--green,#3fb950) 16%, transparent);border-color:color-mix(in srgb, var(--green,#3fb950) 40%, transparent)}
.gi-q b{color:var(--text-bright);font-weight:700}
/* #260 node search */
.graph-search{position:absolute;top:12px;left:50%;transform:translateX(-50%);z-index:12;width:280px;max-width:60%}
.graph-search .gs-input{
  width:100%;box-sizing:border-box;background:color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter:blur(16px);border:1px solid var(--border);border-radius:9px;padding:7px 12px;
  color:var(--text);font-family:var(--mono);font-size:12px;box-shadow:var(--shadow-lg);outline:none
}
.graph-search .gs-input:focus{border-color:var(--green-glow)}
.graph-search .gs-results{
  margin-top:5px;background:color-mix(in srgb, var(--bg) 95%, transparent);backdrop-filter:blur(16px);
  border:1px solid var(--border);border-radius:9px;box-shadow:var(--shadow-lg);
  max-height:260px;overflow:auto;padding:4px
}
.gs-item{display:flex;flex-direction:column;gap:1px;padding:5px 8px;border-radius:6px;cursor:pointer}
.gs-item:hover{background:color-mix(in srgb, var(--bg) 55%, transparent)}
.gs-item .gs-base{font-size:12px;color:var(--text);font-family:var(--mono)}
.gs-item .gs-dir{font-size:10px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.gs-empty{padding:6px 8px;font-size:11px;color:var(--muted);font-family:var(--mono)}
/* #261 inspector */
.graph-inspector{
  position:absolute;top:58px;left:12px;z-index:11;width:250px;max-height:70%;overflow:auto;
  background:color-mix(in srgb, var(--bg) 94%, transparent);backdrop-filter:blur(18px);
  border:1px solid var(--border);border-radius:11px;padding:11px 13px;
  box-shadow:var(--shadow-lg);font-family:var(--mono)
}
.graph-inspector[hidden]{display:none}
.ins-head{display:flex;align-items:center;justify-content:space-between;gap:8px}
.ins-title{font-size:13px;font-weight:700;color:var(--text-bright);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ins-close{background:transparent;border:none;color:var(--muted);font-size:18px;line-height:1;cursor:pointer;padding:0 2px}
.ins-close:hover{color:var(--text-bright)}
.ins-path{font-size:10px;color:var(--muted);margin:3px 0 8px;word-break:break-all}
.ins-meta{display:flex;flex-wrap:wrap;gap:5px;margin-bottom:6px}
.ins-chip{font-size:10px;color:var(--text);background:color-mix(in srgb, var(--text-bright) 6%, transparent);border:1px solid var(--border);border-radius:6px;padding:2px 7px}
.ins-neighbors{margin-top:4px}
.ins-sec-title{font-size:10px;color:var(--muted);text-transform:uppercase;letter-spacing:.04em;margin:8px 0 4px}
.ins-sec-title .ins-count{color:var(--text-bright);font-weight:700}
.ins-neighbor{display:flex;align-items:center;gap:6px;padding:3px 7px;border-radius:6px;cursor:pointer;font-size:11px;color:var(--text);border:1px solid transparent}
.ins-neighbor:hover{background:color-mix(in srgb, var(--bg) 55%, transparent);border-color:var(--border)}
.ins-neighbor .ins-arrow{color:var(--muted);flex-shrink:0}
.ins-actions{display:flex;align-items:center;gap:8px;margin:2px 0 4px}
.ins-btn{font-size:11px;font-family:var(--mono);color:var(--text);background:color-mix(in srgb, var(--orange,#f5a623) 14%, transparent);border:1px solid color-mix(in srgb, var(--orange,#f5a623) 40%, transparent);border-radius:7px;padding:4px 10px;cursor:pointer}
.ins-btn:hover{background:color-mix(in srgb, var(--orange,#f5a623) 24%, transparent)}
.ins-impact-out{font-size:10px;color:var(--muted);font-family:var(--mono)}
/* #274 community hulls */
.community-hull{fill-opacity:.07;stroke-opacity:.45;stroke-width:1.5;stroke-dasharray:5,4;pointer-events:none}
/* #264 meta-graph empty hint */
.meta-empty{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);z-index:5;font-family:var(--mono);font-size:12px;color:var(--muted)}
/* #268 architecture report */
.arch-wrap{padding:18px 26px;max-width:1000px;margin:0 auto;height:100%;overflow:auto;box-sizing:border-box}
.arch-loading,.arch-error{font-family:var(--mono);font-size:13px;color:var(--muted);padding:24px}
.arch-error{color:var(--red,#e0556b)}
.arch-toolbar{display:flex;align-items:center;gap:10px;margin-bottom:16px;position:sticky;top:0;background:color-mix(in srgb,var(--bg) 92%,transparent);backdrop-filter:blur(8px);padding:6px 0;z-index:2}
.arch-btn{font-family:var(--mono);font-size:11px;color:var(--text);background:color-mix(in srgb,var(--green,#3fb950) 10%,transparent);border:1px solid color-mix(in srgb,var(--green,#3fb950) 28%,transparent);border-radius:7px;padding:5px 11px;cursor:pointer}
.arch-btn:hover{background:color-mix(in srgb,var(--green,#3fb950) 20%,transparent)}
.arch-meta{font-family:var(--mono);font-size:11px;color:var(--muted);margin-left:auto}
.markdown-body{font-size:14px;line-height:1.6;color:var(--text)}
.markdown-body h1{font-size:24px;margin:.2em 0 .5em;color:var(--text-bright)}
.markdown-body h2{font-size:18px;margin:1.4em 0 .5em;color:var(--text-bright);border-bottom:1px solid var(--border);padding-bottom:6px}
.markdown-body h3{font-size:14px;margin:1.2em 0 .4em;color:var(--text-bright);text-transform:uppercase;letter-spacing:.03em}
.markdown-body p{margin:.5em 0}
.markdown-body .md-meta{color:var(--muted);font-size:12px}
.markdown-body ul,.markdown-body ol{margin:.4em 0;padding-left:1.4em}
.markdown-body li{margin:.2em 0}
.markdown-body code{font-family:var(--mono);font-size:12px;background:color-mix(in srgb,var(--text-bright) 8%,transparent);padding:1px 5px;border-radius:4px}
.markdown-body hr{border:none;border-top:1px solid var(--border);margin:1.2em 0}
.markdown-body .md-table{border-collapse:collapse;width:100%;margin:.6em 0;font-size:13px}
.markdown-body .md-table th,.markdown-body .md-table td{border:1px solid var(--border);padding:5px 10px;text-align:left}
.markdown-body .md-table th{background:color-mix(in srgb,var(--bg) 55%,transparent);color:var(--text-bright);font-weight:600}
.markdown-body .md-table tr:hover td{background:color-mix(in srgb,var(--bg) 40%,transparent)}
/* #269 explorer tree */
.exp-wrap{display:flex;flex-direction:column;height:100%;box-sizing:border-box}
.exp-loading,.exp-error{font-family:var(--mono);font-size:13px;color:var(--muted);padding:24px}
.exp-error{color:var(--red,#e0556b)}
.exp-toolbar{display:flex;align-items:center;gap:12px;padding:12px 18px;border-bottom:1px solid var(--border)}
.exp-filter{flex:0 0 320px;max-width:50%;background:color-mix(in srgb,var(--bg) 92%,transparent);border:1px solid var(--border);border-radius:8px;padding:7px 12px;color:var(--text);font-family:var(--mono);font-size:12px;outline:none}
.exp-filter:focus{border-color:var(--green-glow)}
.exp-stats{font-family:var(--mono);font-size:11px;color:var(--muted)}
.exp-tree{flex:1;overflow:auto;padding:10px 14px;font-family:var(--mono);font-size:12.5px}
.exp-list{list-style:none;margin:0;padding:0 0 0 14px}
.exp-tree>.exp-list{padding-left:0}
.exp-row{display:flex;align-items:center;gap:6px;padding:3px 6px;border-radius:6px;cursor:pointer;user-select:none}
.exp-row:hover{background:color-mix(in srgb,var(--bg) 55%,transparent)}
/* Keyboard tree navigation (GL #478): the roving-tabindex row needs a visible focus ring. */
.exp-row:focus-visible{outline:2px solid var(--accent);outline-offset:-2px;background:color-mix(in srgb,var(--bg) 55%,transparent)}
.exp-row[data-leaf="1"]{cursor:default}
.exp-caret{display:inline-block;width:12px;color:var(--muted);transition:transform .12s;font-size:10px}
.exp-node:not(.collapsed)>.exp-row>.exp-caret{transform:rotate(90deg)}
.exp-icon{flex-shrink:0;font-size:11px}
.exp-file-icon{font-family:var(--mono);font-size:10px;color:var(--muted);min-width:20px;text-align:center;border:1px solid var(--border);border-radius:4px;padding:0 3px}
.exp-name{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--text)}
.exp-dir>.exp-row>.exp-name{color:var(--text-bright);font-weight:600}
.exp-count{color:var(--muted);font-size:10px;flex-shrink:0}
.exp-node.collapsed>.exp-children{display:none}
.exp-syms{list-style:none;margin:0;padding:0 0 0 26px}
.exp-sym{display:flex;align-items:center;gap:8px;padding:2px 6px;border-radius:5px}
.exp-sym:hover{background:color-mix(in srgb,var(--bg) 45%,transparent)}
.exp-sym-kind{font-size:9px;text-transform:uppercase;letter-spacing:.03em;color:var(--bg);background:var(--muted);border-radius:3px;padding:1px 5px;flex-shrink:0;min-width:38px;text-align:center}
.exp-sym.sym-fn .exp-sym-kind{background:var(--green,#3fb950)}
.exp-sym.sym-type .exp-sym-kind{background:var(--blue,#5b9cff)}
.exp-sym.sym-const .exp-sym-kind{background:var(--orange,#f5a623)}
.exp-sym.sym-trait .exp-sym-kind{background:var(--pink,#e06a9c)}
.exp-sym-name{color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.exp-sym-exp{font-size:9px;color:var(--green,#3fb950);border:1px solid color-mix(in srgb,var(--green,#3fb950) 40%,transparent);border-radius:3px;padding:0 4px;margin-left:4px}
.exp-sym-line{color:var(--muted);font-size:10px;margin-left:auto;flex-shrink:0}
.exp-empty{color:var(--muted);font-size:11px;padding:4px 8px}
.exp-matches .exp-match-file{display:flex;align-items:center;gap:6px;padding:5px 6px;margin-top:6px;border-top:1px solid var(--border);color:var(--text-bright)}
.graph-stats{
  position:absolute;top:12px;left:12px;z-index:10;
  background:color-mix(in srgb, var(--bg) 90%, transparent);backdrop-filter:blur(16px);
  border:1px solid var(--border);border-radius:10px;padding:8px 16px;
  font-size:10px;color:var(--muted);font-family:var(--mono);display:flex;gap:14px;
  box-shadow:var(--shadow-lg);
}
.graph-stats span{color:var(--text-bright);font-weight:600}
.cg-ext-toggle{display:inline-flex;align-items:center;gap:5px;cursor:pointer;color:var(--muted);user-select:none}
.cg-ext-toggle input{cursor:pointer;margin:0}
.graph-minimap{
  position:absolute;bottom:16px;right:16px;z-index:10;
  width:160px;height:100px;border-radius:8px;overflow:hidden;
  background:color-mix(in srgb, var(--bg) 90%, transparent);backdrop-filter:blur(16px);
  border:1px solid var(--border);box-shadow:var(--shadow-lg);
  opacity:0;transition:opacity .3s;pointer-events:none;
}
.d3-container.graph-fullscreen .graph-minimap{opacity:1;pointer-events:auto}
.graph-minimap canvas{width:100%;height:100%}
.graph-minimap-viewport{
  position:absolute;border:1.5px solid var(--green);border-radius:2px;
  background:rgba(52,211,153,0.06);pointer-events:none;transition:all .1s;
}
.graph-zoom-hint{
  position:absolute;bottom:50%;left:50%;transform:translate(-50%,50%);
  color:var(--muted);font-size:13px;pointer-events:none;
  opacity:0.4;transition:opacity 1s;
}
.graph-breadcrumb{
  position:absolute;top:12px;left:50%;transform:translateX(-50%);z-index:10;
  background:color-mix(in srgb, var(--bg) 90%, transparent);backdrop-filter:blur(16px);
  border:1px solid var(--border);border-radius:10px;padding:6px 16px;
  font-size:11px;color:var(--muted);display:none;
  box-shadow:var(--shadow-lg);
}
.d3-container.graph-fullscreen .graph-breadcrumb{display:block}
.node-tooltip{
  position:fixed;z-index:1001;background:var(--surface);border:1px solid var(--border-light);
  border-radius:10px;padding:12px 16px;font-size:11px;color:var(--text);pointer-events:none;
  box-shadow:var(--shadow-lg);max-width:320px;
  backdrop-filter:blur(20px);animation:tooltipIn .2s cubic-bezier(.22,1,.36,1);
}
@keyframes tooltipIn{from{opacity:0;transform:translateY(4px) scale(0.97)}to{opacity:1;transform:translateY(0) scale(1)}}
.node-tooltip .nt-title{font-weight:700;color:var(--text-bright);margin-bottom:4px;font-size:12px}
.node-tooltip .nt-row{display:flex;justify-content:space-between;gap:12px;font-size:10px;padding:1px 0}
.node-tooltip .nt-label{color:var(--muted)}
.node-tooltip .nt-value{font-family:var(--mono);color:var(--green)}
.cg-node-count,.deps-node-val,.kg-node-val{
  font-family:var(--mono);
  font-weight:800;
  fill:var(--text-bright);
  paint-order:stroke;
  stroke:var(--bg);
  stroke-width:3px;
  pointer-events:none;
}
.cg-edge-label,.deps-edge-label,.kg-edge-label{
  font-family:var(--mono);
  font-size:10px;
  fill:var(--muted);
  paint-order:stroke;
  stroke:var(--bg);
  stroke-width:3px;
  pointer-events:none;
}
.deps-edge-line,.cg-edge-line{stroke:var(--border);stroke-width:1}
.graph-node-stroke{stroke:var(--border-light);stroke-width:1}
.cg-arrow-fill{fill:var(--muted);opacity:0.4}

.cg-progress-track{
  width:100%;height:8px;background:var(--surface-2);border-radius:4px;overflow:hidden
}
.cg-progress-fill{
  height:100%;background:var(--purple);border-radius:4px;
  transition:width 0.3s ease
}

.detail-panel{
  position:fixed;top:0;right:-400px;width:400px;height:100vh;
  background:var(--surface);backdrop-filter:blur(24px);
  border-left:1px solid var(--border-light);
  z-index:300;transition:right .3s cubic-bezier(.22,1,.36,1);
  overflow-y:auto;padding:28px;box-shadow:var(--shadow-lg);
}
.detail-panel.open{right:0}
.detail-panel-close{
  position:absolute;top:14px;right:14px;background:var(--surface-2);border:1px solid var(--border);
  color:var(--muted);cursor:pointer;font-size:14px;padding:6px;transition:.15s;
  border-radius:6px;width:28px;height:28px;display:flex;align-items:center;justify-content:center;
}
.detail-panel-close:hover{color:var(--green);border-color:var(--green)}
.detail-panel h3{font-size:15px;font-weight:400;margin-bottom:24px;padding-right:40px;letter-spacing:-0.02em}
.detail-row{display:flex;justify-content:space-between;padding:10px 0;border-bottom:1px solid var(--border);font-size:11px;gap:14px}
.detail-row .dl{color:var(--muted);flex-shrink:0}
.detail-row .dv{font-family:var(--mono);color:var(--text-bright);text-align:right}

.split-pane{display:grid;grid-template-columns:1fr 1fr;gap:1px;background:var(--border);border-radius:var(--r);overflow:hidden}
.split-side{background:var(--surface);padding:24px;overflow:auto;max-height:600px}
.split-side pre{font-family:var(--mono);font-size:11px;line-height:1.7;white-space:pre-wrap;word-break:break-all;background:var(--surface-2);border-radius:8px;padding:18px;border:1px solid var(--border)}
.split-side h4{font-size:10px;color:var(--muted);text-transform:uppercase;letter-spacing:.12em;font-weight:600;margin-bottom:14px;display:flex;align-items:center;gap:8px}

.mode-tabs{display:flex;gap:0;background:var(--surface);border:1px solid var(--border);border-radius:4px;padding:4px;margin-bottom:20px}
.mode-tab{
  flex:1;padding:10px 16px;text-align:center;border-radius:4px;
  font-size:12px;font-weight:500;color:var(--muted);cursor:pointer;transition:all .2s;border:1px solid transparent;
}
.mode-tab:hover{color:var(--text);background:var(--surface-2)}
.mode-tab.active{background:var(--green-dim);color:var(--green);border-color:var(--green-glow);box-shadow:0 0 8px rgba(52,211,153,0.1);font-weight:600}

.ckc-layout{display:grid;grid-template-columns:minmax(260px,1fr) 2.2fr;gap:var(--gap);min-height:calc(100vh - 180px)}
.ckc-sidebar{display:flex;flex-direction:column;min-height:0}
.ckc-sidebar .card{display:flex;flex-direction:column;flex:1;padding:0;overflow:hidden;min-height:0}
.ckc-sidebar .card h3{padding:16px 16px 8px;margin:0}
.file-list{
  overflow-y:auto;border-top:1px solid var(--border);
  background:var(--surface);flex:1;min-height:0;
}
.file-item{
  padding:8px 16px;font-size:11px;font-family:var(--mono);cursor:pointer;
  border-bottom:1px solid var(--border);transition:all .15s;color:var(--muted);
  display:flex;align-items:center;gap:8px;
}
.file-item:last-child{border-bottom:none}
.file-item:hover{background:var(--surface-2);color:var(--text);padding-left:20px}
.file-item.selected{background:var(--green-dim);color:var(--green);border-left:3px solid var(--green)}
.file-item .file-tokens{font-size:10px;color:var(--muted);white-space:nowrap}
.ckc-file-count{font-size:10px;color:var(--muted);font-weight:400;margin-left:4px}
.ckc-tabs{display:flex;border-bottom:1px solid var(--border)}
.ckc-tab{flex:1;text-align:center;padding:10px 8px;font-size:11px;font-weight:600;
  color:var(--muted);cursor:pointer;transition:all .15s;border-bottom:2px solid transparent;
  text-transform:uppercase;letter-spacing:0.3px}
.ckc-tab:hover{color:var(--text);background:var(--surface-2)}
.ckc-tab.active{color:var(--green);border-bottom-color:var(--green)}
.ckc-search{padding:8px;border-bottom:1px solid var(--border)}
.ckc-search input{width:100%;padding:6px 10px;border:1px solid var(--border);border-radius:var(--rs);
  background:var(--surface);color:var(--text);font-size:11px;font-family:var(--mono);outline:none;box-sizing:border-box}
.ckc-search input:focus{border-color:var(--green);box-shadow:0 0 0 2px rgba(74,222,128,0.15)}
.ckc-search input::placeholder{color:var(--muted)}
.ckc-note{padding:10px 14px;margin-bottom:16px;border-radius:var(--rs);font-size:11px;line-height:1.5;
  background:rgba(250,204,21,0.08);border:1px solid rgba(250,204,21,0.25);color:var(--yellow)}
@media(max-width:900px){.ckc-layout{grid-template-columns:1fr}}

.swimlane{
  background:var(--surface);border:1px solid var(--border);border-radius:var(--r);
  padding:20px 24px;margin-bottom:10px;display:flex;flex-direction:column;gap:12px;
  transition:all .2s;box-shadow:var(--shadow-sm);cursor:pointer;
}
.swimlane:hover{border-color:var(--border-light);box-shadow:var(--shadow-md);transform:translateY(-1px)}
.swimlane-header{display:flex;align-items:center;gap:12px}
.swimlane-body{padding-left:24px}
.cka-swimlane-grid{display:flex;flex-direction:column;gap:10px}
.cka-events-feed{display:flex;flex-direction:column;gap:6px}
.cka-event-item{
  display:flex;gap:14px;padding:10px 14px;font-size:12px;border-radius:8px;
  background:var(--surface-2);transition:background .15s;
}
.cka-event-item:hover{background:var(--surface-3)}
.cka-event-time{font-size:10px;color:var(--muted);font-family:var(--mono);flex-shrink:0;min-width:120px}
.cka-event-body{flex:1;color:var(--text);min-width:0}
.agent-dot{width:12px;height:12px;border-radius:50%;flex-shrink:0;transition:all .3s}
.agent-dot.active{background:var(--green);box-shadow:0 0 12px rgba(52,211,153,0.5);animation:p 2s ease infinite}
.agent-dot.idle{background:var(--yellow);box-shadow:0 0 8px rgba(251,191,36,0.3)}
.agent-dot.offline{background:var(--muted)}
.agent-info{flex:1;min-width:0}
.agent-name{font-size:13px;font-weight:600;color:var(--text-bright);letter-spacing:-0.01em}
.agent-meta{font-size:10px;color:var(--muted);font-family:var(--mono);margin-top:5px;line-height:1.6}

.search-input{
  width:100%;padding:12px 16px;background:var(--surface-2);border:1px solid var(--border);
  border-radius:var(--rs);color:var(--text);font-family:var(--mono);font-size:12px;
  outline:none;transition:all .2s;
}
.search-input:focus{border-color:var(--green);box-shadow:0 0 0 3px rgba(52,211,153,0.1);background:var(--surface)}
.search-input::placeholder{color:var(--muted)}

.cks-search-row{display:flex;gap:12px;align-items:center;margin-bottom:16px}
.cks-search-row .search-input{flex:1}
.cks-search-row .btn{padding:12px 24px;font-size:12px;font-weight:600;white-space:nowrap}
.cks-stats-row{display:flex;gap:28px;flex-wrap:wrap;margin-bottom:16px}
.cks-stat{display:flex;flex-direction:column;gap:4px}
.cks-results-list{display:flex;flex-direction:column;gap:10px}
.cks-result-item{padding:14px 16px;background:var(--surface-2);border-radius:var(--rs);border:1px solid var(--border);transition:border-color .15s}
.cks-result-item:hover{border-color:var(--green)}
.cks-result-header{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:4px}
.cks-result-path{font-size:12px;color:var(--green);word-break:break-all}
.cks-result-line{font-size:11px;color:var(--muted);font-family:var(--mono)}
.cks-result-score{margin-left:auto;flex-shrink:0}
.cks-result-content{margin:10px 0 0;padding:10px;background:var(--bg);border-radius:6px;font-size:11px;line-height:1.6;color:var(--text);overflow-x:auto;max-height:120px;white-space:pre-wrap;word-break:break-word}
/* Inline file preview on result click (GL #478) */
.cks-result-header[role="button"]{cursor:pointer;border-radius:6px}
.cks-result-header[role="button"]:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.cks-result-chevron{flex-shrink:0;color:var(--muted);font-size:10px;transition:transform .12s}
.cks-open .cks-result-chevron{transform:rotate(90deg)}
.cks-result-preview{margin-top:10px;border:1px solid var(--border);border-radius:6px;background:var(--bg);overflow:hidden}
.cks-preview-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:6px 10px;border-bottom:1px solid var(--border);background:var(--surface)}
.cks-preview-head code{font-size:11px;color:var(--green);word-break:break-all}
.cks-preview-table{width:100%;border-collapse:collapse;font-family:var(--mono);font-size:11px;line-height:1.55}
.cks-ln{width:1%;padding:0 10px;text-align:right;color:var(--muted);user-select:none;border-right:1px solid var(--border);vertical-align:top}
.cks-code{padding:0 12px;white-space:pre-wrap;word-break:break-word;color:var(--text)}
.cks-hitline .cks-code,.cks-hitline .cks-ln{background:color-mix(in srgb,var(--accent) 14%,transparent);color:var(--text-bright)}

.ckm-tab-bar{display:flex;gap:4px;padding:4px;background:var(--surface-2);border-radius:var(--rs);margin-bottom:20px}
.ckm-tab{flex:1;padding:10px 16px;background:transparent;border:none;color:var(--muted);font-family:var(--font);font-size:12px;font-weight:500;cursor:pointer;border-radius:6px;transition:all .15s;text-align:center}
.ckm-tab:hover{color:var(--text);background:var(--surface-2)}
.ckm-tab--active{background:var(--surface);color:var(--text-bright);font-weight:600;box-shadow:0 1px 3px rgba(0,0,0,0.2)}
.ckm-procedure-card{padding:18px;background:var(--surface-2);border-radius:var(--rs);border:1px solid var(--border);margin-bottom:14px}
.ckm-procedure-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}
.ckm-procedure-bars{display:flex;flex-direction:column;gap:8px}
.ckm-bar-row{display:flex;align-items:center;gap:10px}
.ckm-bar-row .sl{width:90px;flex-shrink:0}
.ckm-bar{flex:1;height:6px;background:var(--border);border-radius:3px;overflow:hidden}
.ckm-bar-fill{height:100%;border-radius:3px;transition:width .3s}
.ckm-bar-row .sv{width:40px;text-align:right;flex-shrink:0}

.token-counter{
  font-size:clamp(34px,5.5vw,52px);font-weight:600;letter-spacing:-0.03em;color:var(--accent);
  font-family:var(--mono);font-variant-numeric:tabular-nums;line-height:1;
}

[data-live]{transition:opacity .15s}[data-live].flash{opacity:.6}
@keyframes fadeUp{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:none}}
.hero>*,.card{animation:fadeUp .4s ease both}
.hero>:nth-child(1){animation-delay:.03s}.hero>:nth-child(2){animation-delay:.06s}
.hero>:nth-child(3){animation-delay:.09s}.hero>:nth-child(4){animation-delay:.12s}

.update-banner{
  display:none;background:linear-gradient(135deg,#f59e0b22,#f59e0b11);
  border:1px solid #f59e0b44;border-radius:10px;padding:10px 20px;margin-bottom:16px;
  text-align:center;font-size:12px;color:#f59e0b;
}

.severity-critical{color:var(--red)}
.severity-warning{color:var(--yellow)}
.severity-info{color:var(--blue)}

@media(max-width:1024px){
  .hero{grid-template-columns:1fr 1fr}
  .r21,.r12,.r11,.r3{grid-template-columns:1fr}
  .r4{grid-template-columns:1fr 1fr}
  .buddy-card{flex-direction:column;text-align:center}
  .buddy-stats-grid{grid-template-columns:repeat(5,1fr)}
  .split-pane{grid-template-columns:1fr}
}
@media(max-width:768px){
  .sidebar{width:0;border:none}
  .sidebar:hover,.sidebar.pinned{width:var(--sidebar-exp)}
  .main{margin-left:0}
  .hero{grid-template-columns:1fr}
  .r4{grid-template-columns:1fr}
  .buddy-stats-grid{grid-template-columns:repeat(3,1fr)}
}
@media(max-width:480px){
  .main{padding:var(--sp-md) var(--sp-sm) 72px}
  .topbar{margin-bottom:var(--sp-md);padding:var(--sp-sm) 0}
  .topbar-title{font-size:var(--fs-lg)}
  .hero-main{padding:var(--sp-lg) var(--sp-md)}
  .hero-main .hl,.hero-main .hs{font-size:var(--fs-sm)}
  .hero-main .hv{font-size:var(--fs-hero)}
  .card{padding:var(--sp-md)}
  .card h3{font-size:var(--fs-xs)}
  th,td{padding-left:var(--sp-sm);padding-right:var(--sp-sm);font-size:var(--fs-sm)}
  .table-scroll{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain}
  .table-scroll table{min-width:max-content;width:100%}
}

.container-fluid{width:100%;max-width:none;margin:0 auto;padding-left:var(--sp-md);padding-right:var(--sp-md);box-sizing:border-box}
.container-narrow{max-width:720px;margin:0 auto;width:100%;padding-left:var(--sp-md);padding-right:var(--sp-md);box-sizing:border-box}

@keyframes slideRight{from{opacity:0;transform:translateX(-12px)}to{opacity:1;transform:none}}
@keyframes pulse{0%,100%{opacity:1}50%{opacity:0.3}}
@keyframes skeleton-shimmer{0%{background-position:-200% 0}100%{background-position:200% 0}}
@keyframes slideUp{from{opacity:0;transform:translateY(16px)}to{opacity:1;transform:none}}
@keyframes fadeOut{from{opacity:1}to{opacity:0}}

.animate-fade-up{animation:fadeUp var(--t-slow) var(--ease-out) both}
.animate-fade-in{animation:fadeIn var(--t-normal) ease both}
.animate-scale-in{animation:scaleIn var(--t-normal) var(--ease-out) both}
.animate-slide-right{animation:slideRight var(--t-normal) var(--ease-out) both}

.stagger>:nth-child(1){animation-delay:0.03s}
.stagger>:nth-child(2){animation-delay:0.06s}
.stagger>:nth-child(3){animation-delay:0.09s}
.stagger>:nth-child(4){animation-delay:0.12s}
.stagger>:nth-child(5){animation-delay:0.15s}
.stagger>:nth-child(6){animation-delay:0.18s}

.skeleton{
  background:linear-gradient(90deg,var(--surface-2) 25%,var(--surface-3) 50%,var(--surface-2) 75%);
  background-size:200% 100%;
  animation:skeleton-shimmer 1.5s infinite;
  border-radius:var(--rs);
}

.status-dot{width:8px;height:8px;border-radius:50%;display:inline-block}
.status-dot.active{background:var(--green);box-shadow:0 0 8px var(--green);animation:pulse 2s ease infinite}
.status-dot.warning{background:var(--yellow);box-shadow:0 0 6px var(--yellow)}
.status-dot.error{background:var(--red);box-shadow:0 0 6px var(--red)}
.status-dot.offline{background:var(--muted)}
.status-ascii{font-family:var(--mono);font-size:10px;font-weight:700;display:inline-block}

.gauge-ring{position:relative;display:inline-flex;align-items:center;justify-content:center}
.gauge-ring svg{transform:rotate(-90deg)}
.gauge-ring circle{fill:none;stroke-width:3}
.gauge-ring .bg{stroke:var(--surface-3)}
.gauge-ring .fg{stroke-linecap:round;transition:stroke-dashoffset 1s var(--ease-out)}
.gauge-value{position:absolute;font-weight:700;font-family:var(--mono)}

.pressure-bar{background:var(--surface-2);border-radius:8px;height:20px;overflow:hidden;border:1px solid var(--border)}
.pressure-fill{height:100%;border-radius:8px;transition:width 0.5s var(--ease-out)}

.action-btn{
  background:transparent;border:1px solid var(--border);color:var(--muted);
  padding:5px 12px;border-radius:6px;font-size:10px;cursor:pointer;
  transition:all var(--t-fast);font-family:var(--font);
}
.action-btn:hover{border-color:var(--green);color:var(--green);background:var(--green-dim)}
.action-btn.danger:hover{border-color:var(--red);color:var(--red);background:var(--red-dim)}

.toast{
  position:fixed;bottom:24px;right:24px;z-index:var(--z-tooltip);
  background:var(--surface);border:1px solid var(--border-light);border-radius:var(--r);
  padding:12px 20px;font-size:12px;box-shadow:var(--shadow-lg);
  animation:slideUp 0.3s var(--ease-out),fadeOut 0.3s ease 2.7s;
}

@keyframes ctxSparkle{
  0%,100%{filter:drop-shadow(0 0 2px rgba(52,211,153,0.35));transform:scale(1)}
  50%{filter:drop-shadow(0 0 12px rgba(52,211,153,0.55));transform:scale(1.02)}
}
.cockpit-ctx-sparkle{animation:ctxSparkle 2.2s ease-in-out infinite}

.ctx-hero-grid{
  display:grid;grid-template-columns:auto 1fr;gap:20px;margin-bottom:24px;align-items:stretch
}
.ctx-gauge-card{
  display:flex;flex-direction:column;align-items:center;justify-content:center;padding:28px 24px !important;min-width:190px
}
.ctx-gauge-card .gauge-value{font-size:20px !important}
.ctx-gauge-card .hl{margin-top:12px}
.ctx-gauge-card .hs{margin-top:6px}
.ctx-metrics-stack{display:flex;flex-direction:column;gap:0}
.ctx-metrics-stack .hero{margin-bottom:0}
.ctx-path-cell{
  font-family:var(--mono);font-size:11px;max-width:340px;overflow:hidden;
  text-overflow:ellipsis;white-space:nowrap
}
.cockpit-ctx-target-pill{
  display:inline-block;font-family:var(--mono);font-size:10px;
  padding:4px 10px;margin:3px 6px 3px 0;border-radius:6px;
  background:var(--surface-2);border:1px solid var(--border);color:var(--blue);
  word-break:break-all
}
@media(max-width:700px){
  .ctx-hero-grid{grid-template-columns:1fr}
  .ctx-gauge-card{flex-direction:row;gap:16px}
}

.cockpit-ctx-force-warn{
  margin-top:12px;padding:10px 12px;border-radius:var(--rs);
  background:var(--red-dim);border:1px solid rgba(248,113,113,0.25);
  font-size:11px;line-height:1.5;color:var(--text)
}
.cockpit-ctx-force-warn strong{color:var(--red)}

.cockpit-ctx-plan{
  white-space:pre-wrap;font-family:var(--mono);font-size:11px;line-height:1.55;
  color:var(--text);background:var(--surface-2);border-radius:var(--rs);
  padding:14px;border:1px solid var(--border);max-height:min(420px,50vh);overflow:auto
}

.cockpit-ctx-overlay-grid{
  display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:12px
}
.cockpit-ctx-overlay-card{
  background:var(--surface-2);border:1px solid var(--border);border-radius:var(--rs);
  padding:16px 18px;font-size:11px
}
.cockpit-ctx-oc-path{font-family:var(--mono);font-weight:600;color:var(--text-bright);
  word-break:break-all;margin-bottom:8px}
.cockpit-ctx-oc-meta{color:var(--muted);line-height:1.55;font-size:10px}

.cockpit-ctx-timeline{
  position:relative;padding-left:24px;margin-top:12px
}
.cockpit-ctx-tl-item{
  position:relative;padding-bottom:20px;padding-left:8px
}
.cockpit-ctx-tl-item:last-child{padding-bottom:0}
.cockpit-ctx-tl-dot{
  position:absolute;left:-18px;top:4px;width:8px;height:8px;border-radius:50%;
  background:var(--green);box-shadow:0 0 0 3px var(--green-dim)
}
.cockpit-ctx-tl-item:not(:last-child)::before{
  content:'';position:absolute;left:-14px;top:14px;width:2px;bottom:0;
  background:var(--border)
}
.cockpit-ctx-tl-time{font-size:9px;color:var(--muted);font-family:var(--mono)}
.cockpit-ctx-tl-title{font-weight:600;color:var(--text);margin-top:4px}
.cockpit-ctx-tl-path{font-family:var(--mono);font-size:10px;color:var(--blue);margin-top:4px;word-break:break-all}
.cockpit-ctx-tl-author{font-size:10px;color:var(--muted);margin-top:4px}

.cockpit-ctx-dd{position:relative;display:inline-block;vertical-align:middle}
.cockpit-ctx-dd-panel{
  display:none;position:absolute;right:0;top:100%;z-index:var(--z-dropdown);
  margin-top:4px;padding:6px;background:var(--surface);border:1px solid var(--border);
  border-radius:8px;box-shadow:var(--shadow-md)
}
.cockpit-ctx-dd-panel.open{display:block}
.cockpit-ctx-mode-sel{
  background:var(--surface-2);color:var(--text);border:1px solid var(--border);
  border-radius:6px;padding:4px 8px;font-size:10px;font-family:var(--font);min-width:120px
}

/* ─── Context Cockpit v2 ─────────────────────────────────────── */

.ctx-tabs{
  display:flex;gap:4px;margin-bottom:20px;border-bottom:2px solid var(--border);padding-bottom:0
}
.ctx-tab{
  background:none;border:none;color:var(--muted);font:inherit;font-size:13px;
  padding:10px 16px;cursor:pointer;border-bottom:2px solid transparent;
  margin-bottom:-2px;transition:all .15s;display:flex;align-items:center;gap:6px
}
.ctx-tab:hover{color:var(--text);background:var(--surface-2);border-radius:6px 6px 0 0}
.ctx-tab-active{color:var(--green);border-bottom-color:var(--green);font-weight:600}
.ctx-tab-icon{font-size:14px}

.ctx-overview-grid{
  display:grid;grid-template-columns:auto 1fr;gap:20px;margin-bottom:0;align-items:stretch
}
.ctx-gauge-card{
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  padding:28px 24px !important;min-width:200px
}
.ctx-gauge-card .gauge-value{font-size:22px !important}
.ctx-gauge-label{font-size:14px;font-weight:600;margin-top:12px;color:var(--text-bright)}
.ctx-gauge-sub{font-size:11px;color:var(--muted);margin-top:4px}
.ctx-status-pill{
  display:flex;align-items:center;gap:8px;margin-top:12px;
  font-size:11px;color:var(--text);padding:6px 12px;font-family:var(--mono);
  background:var(--surface-2);border-radius:4px;border:1px solid var(--border)
}
.ctx-dot{
  width:8px;height:8px;border-radius:50%;background:var(--dot);flex-shrink:0
}

.ctx-kpi-grid{
  display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:12px
}
.ctx-kpi{
  text-align:center;padding:16px 12px !important
}
.ctx-kpi-value{font-size:22px;font-weight:700;color:var(--text-bright);line-height:1.2}
.ctx-kpi-label{font-size:11px;color:var(--muted);margin-top:6px;text-transform:uppercase;letter-spacing:.5px}
.ctx-kpi-detail{font-size:10px;color:var(--muted);margin-top:4px}

.ctx-explain{
  font-size:12px;color:var(--muted);line-height:1.5;margin-bottom:14px;
}
.ctx-explain strong{color:var(--text)}

.ctx-stacked-bar{
  display:flex;height:24px;border-radius:6px;overflow:hidden;
  background:var(--bg-3);margin-bottom:16px
}
.ctx-bar-seg{min-width:2px;transition:width .3s}
.ctx-bar-avail{background:var(--bg-3) !important}

.ctx-legend{
  display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:8px 16px
}
.ctx-legend-item{
  display:flex;align-items:center;gap:8px;font-size:12px;line-height:1.4
}
.ctx-legend-sep{border-top:1px solid var(--border);padding-top:8px;margin-top:4px;grid-column:1/-1}
.ctx-legend-dot{width:10px;height:10px;border-radius:3px;flex-shrink:0}
.ctx-legend-label{flex:1;color:var(--text)}
.ctx-legend-value{color:var(--text-bright);font-weight:500;font-family:var(--mono);font-size:11px;white-space:nowrap}
.ctx-legend-pct{color:var(--muted);font-weight:400}

.ctx-session-note{
  margin-top:16px;padding:10px 14px;font-size:11px;color:var(--muted);
  background:var(--surface-2);border-radius:6px;border:1px dashed var(--border)
}
.ctx-session-note strong{color:var(--text)}

.ctx-info-note{
  margin-top:12px;font-size:11px;color:var(--muted);padding:6px 0
}

.ctx-budget-table{width:100%}
.ctx-budget-table th{text-align:left;font-size:11px;text-transform:uppercase;letter-spacing:.3px;color:var(--muted)}
.ctx-budget-table td{padding:8px 6px;font-size:12px}
.ctx-budget-table .ctx-desc{font-size:10px;color:var(--muted);max-width:300px}
.ctx-budget-total td{border-top:2px solid var(--border);font-weight:600}

.ctx-event-log{
  max-height:300px;overflow-y:auto;font-family:var(--mono);font-size:11px
}
.ctx-event-row{
  display:flex;gap:8px;padding:4px 0;border-bottom:1px solid var(--bg-3,#2a2a3a);align-items:baseline
}
.ctx-event-tok{color:var(--muted);min-width:42px;text-align:right}
.ctx-event-type{min-width:60px;font-weight:500}
.ctx-event-detail{color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

@media (max-width: 900px){
  .hero.r4{grid-template-columns:1fr 1fr}
  .row.r12{grid-template-columns:1fr}
  .ctx-overview-grid{grid-template-columns:1fr}
  .ctx-budget-table .ctx-desc{display:none}
}
@media (max-width: 520px){
  .hero.r4{grid-template-columns:1fr}
  .ctx-kpi-grid{grid-template-columns:1fr 1fr}
  .ctx-legend{grid-template-columns:1fr}
}

/* ── ASCII Global Background ── */
.ascii-global-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
}
.ascii-global-bg pre {
  font-family: var(--mono);
  font-size: clamp(6px, 1.5vw, 14px);
  line-height: 1.3;
  white-space: pre;
  text-align: left;
  margin: 0;
  padding: 0;
  user-select: none;
  opacity: 0.06;
  color: #34d399;
  animation: ascii-color-pulse 10s ease-in-out infinite;
  transform: translateZ(0);
  min-height: 100vh;
}
.ascii-global-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, var(--bg) 95%);
  pointer-events: none;
}
@keyframes ascii-color-pulse {
  0%, 100% { color: #34d399; }
  50% { color: #818cf8; }
}
@media (max-width: 768px) {
  .ascii-global-bg pre {
    font-size: 7px;
    opacity: 0.04;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ascii-global-bg pre {
    animation: none;
  }
}

/* ─── Context Commander ─────────────────────────────────── */

.cmdr-budget-hero{
  padding:24px;border-radius:var(--r);margin-bottom:20px;
  background:var(--surface);border:1px solid var(--border);
  display:flex;flex-direction:column;gap:20px;
}
.cmdr-gauge-wrap{
  display:flex;align-items:center;gap:24px;
}
.cmdr-gauge-ring{position:relative;width:120px;height:120px;flex-shrink:0}
.cmdr-gauge-ring svg{transform:rotate(-90deg)}
.cmdr-gauge-bg{
  fill:none;stroke:var(--surface-2);stroke-width:3;
}
.cmdr-gauge-fg{
  fill:none;stroke-width:3;stroke-linecap:round;
  transition:stroke-dasharray .6s var(--ease-out);
}
.band-green .cmdr-gauge-fg{stroke:var(--green)}
.band-yellow .cmdr-gauge-fg{stroke:var(--yellow)}
.band-orange .cmdr-gauge-fg{stroke:var(--orange)}
.band-red .cmdr-gauge-fg{stroke:var(--red)}
.cmdr-gauge-label{
  position:absolute;inset:0;display:flex;align-items:center;justify-content:center;
  font-size:28px;font-weight:700;font-family:var(--mono);color:var(--text-bright);
}
.cmdr-gauge-info{display:flex;flex-direction:column;gap:6px}
.cmdr-band-badge{
  font-size:18px;font-weight:700;display:flex;align-items:center;gap:8px;
}
.band-green .cmdr-band-badge{color:var(--green)}
.band-yellow .cmdr-band-badge{color:var(--yellow)}
.band-orange .cmdr-band-badge{color:var(--orange)}
.band-red .cmdr-band-badge{color:var(--red)}
.cmdr-band-desc{font-size:13px;color:var(--muted);max-width:400px;line-height:1.5}

.cmdr-stats-row{
  display:grid;grid-template-columns:repeat(6,1fr);gap:1px;
  background:var(--border);border-radius:8px;overflow:hidden;
}
.cmdr-stat-cell{
  background:var(--surface);padding:12px 8px;text-align:center;
}
.cmdr-stat-label{font-size:10px;color:var(--muted);text-transform:uppercase;letter-spacing:.5px;margin-bottom:3px}
.cmdr-stat-value{font-size:16px;font-weight:600;color:var(--text-bright)}
.cmdr-stat-sub{font-size:10px;color:var(--muted);margin-top:2px}

.cmdr-section{margin-bottom:20px}
.cmdr-section-header{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  margin-bottom:12px;
}
.cmdr-section-header h3{font-size:15px;font-weight:600;color:var(--text-bright)}

/* Action Cards */
.cmdr-actions-grid{display:flex;flex-direction:column;gap:8px}
.cmdr-action-card{
  display:flex;align-items:center;gap:16px;padding:14px 16px;
  background:var(--surface);border:1px solid var(--border);border-radius:var(--r);
  cursor:default;transition:border-color .15s,box-shadow .15s;
}
.cmdr-action-card:hover{
  border-color:var(--border-light);box-shadow:var(--shadow-sm);
}
.cmdr-action-icon{font-size:22px;flex-shrink:0;width:36px;text-align:center}
.cmdr-action-body{flex:1;min-width:0}
.cmdr-action-type{font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.5px;color:var(--text-bright)}
.cmdr-action-path{font-size:12px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--mono)}
.cmdr-action-reason{font-size:11px;color:var(--muted);margin-top:2px}
.cmdr-action-savings{font-size:11px;color:var(--green);font-weight:600;margin-top:2px}
.cmdr-action-btn{
  padding:6px 14px;border-radius:var(--r);border:1px solid var(--border);
  background:var(--surface-2);color:var(--text-bright);font-size:11px;font-weight:600;
  cursor:pointer;transition:all .15s;flex-shrink:0;
}
.cmdr-action-btn:hover{
  background:var(--green-dim);border-color:var(--green);color:var(--green);
}

/* Risk Banners */
.cmdr-risk-banner{
  display:flex;align-items:center;gap:14px;padding:12px 16px;
  border-radius:var(--r);margin-bottom:8px;
}
.cmdr-risk-high{
  background:var(--yellow-dim);border:1px solid rgba(251,191,36,0.3);
}
.cmdr-risk-medium{
  background:var(--blue-dim);border:1px solid rgba(56,189,248,0.3);
}
.cmdr-risk-icon{font-size:20px;flex-shrink:0}
.cmdr-risk-body{flex:1;min-width:0}
.cmdr-risk-path{font-size:12px;font-weight:600;color:var(--text-bright);font-family:var(--mono)}
.cmdr-risk-msg{font-size:12px;color:var(--text);margin-top:2px}
.cmdr-risk-suggest{font-size:11px;color:var(--muted);margin-top:2px}

/* Pressure Table */
.cmdr-power-toggle{font-size:11px!important;padding:4px 10px!important}
.cmdr-table-row{}
.cmdr-row-risk{background:rgba(251,191,36,0.04)}
.cmdr-row-pinned{background:rgba(129,140,248,0.04)}
.cmdr-pin-badge{font-size:12px}
.cmdr-risk-dot{color:var(--yellow);font-size:14px}

/* Trail */
.cmdr-trail-toggle td{
  background:var(--surface);font-family:var(--mono);
}
.cmdr-trail-toggle:hover td{background:var(--surface-2)}
.cmdr-trail-content td{background:var(--surface);padding:0 12px 8px!important}
.cmdr-trail-items{
  display:flex;flex-direction:column;gap:4px;padding:8px 12px;
  background:var(--bg);border-radius:var(--r);border:1px solid var(--border);
}
.cmdr-trail-item{font-size:11px;color:var(--muted);display:flex;align-items:center;gap:6px}
.cmdr-trail-type{
  font-weight:600;font-size:10px;text-transform:uppercase;letter-spacing:.3px;
  padding:1px 6px;border-radius:3px;background:var(--surface-2);color:var(--text);
}
.cmdr-trail-time{font-size:10px;color:var(--muted);margin-left:auto}

@media(max-width:768px){
  .cmdr-stats-row{grid-template-columns:repeat(3,1fr)}
  .cmdr-gauge-wrap{flex-direction:column;align-items:flex-start}
}

/* ─── User-friendly shell: view segmented toggle, hints, onboarding ──────── */
.seg-toggle{
  display:inline-flex;align-items:center;gap:2px;height:32px;padding:3px;
  border-radius:var(--rs);border:1px solid var(--border);background:var(--bg);
}
.seg-toggle-label{
  font-family:var(--mono);font-size:9px;letter-spacing:.16em;text-transform:uppercase;
  color:var(--muted);padding:0 9px 0 7px;user-select:none;
}
.seg{
  display:inline-flex;align-items:center;gap:6px;height:24px;padding:0 11px;
  border:none;background:transparent;color:var(--muted);cursor:pointer;
  font-family:var(--font);font-size:12px;font-weight:600;white-space:nowrap;
  border-radius:calc(var(--rs) - 2px);transition:background .15s,color .15s;
}
.seg svg{width:13px;height:13px;opacity:.65;transition:opacity .15s}
.seg:hover{color:var(--text)}
.seg:hover svg{opacity:.9}
.seg[aria-pressed="true"]{background:var(--accent-dim);color:var(--accent)}
.seg[aria-pressed="true"] svg{opacity:1}
.seg:focus-visible{outline:none;box-shadow:0 0 0 2px var(--accent-dim)}

.view-hint{
  display:flex;align-items:center;gap:9px;
  margin:-8px 0 22px;padding:10px 14px;
  background:var(--surface);border:1px solid var(--border);
  border-left:2px solid var(--accent);border-radius:var(--rs);
  color:var(--muted);font-size:12.5px;line-height:1.4;
}
.view-hint svg{color:var(--accent);flex-shrink:0;opacity:.8}
.view-hint[hidden]{display:none}

.onboard-overlay{
  position:fixed;inset:0;z-index:var(--z-modal,1000);
  display:flex;align-items:center;justify-content:center;padding:24px;
  background:rgba(8,12,16,0.72);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);
  opacity:0;transition:opacity .3s var(--ease-out);
}
.onboard-overlay.show{opacity:1}
.onboard-overlay[hidden]{display:none}
[data-theme="light"] .onboard-overlay{background:rgba(255,255,255,0.7)}
.onboard-card{
  width:min(520px,100%);background:var(--surface);
  border:1px solid var(--border);border-radius:14px;padding:32px;
  box-shadow:var(--shadow-lg,0 24px 60px rgba(0,0,0,0.4));
  transform:translateY(12px) scale(0.98);transition:transform .3s var(--ease-out);
}
.onboard-overlay.show .onboard-card{transform:translateY(0) scale(1)}
.onboard-logo{font-family:var(--font-display);font-size:15px;color:var(--muted);margin-bottom:18px;letter-spacing:-0.01em}
.onboard-logo span{font-family:var(--mono);color:var(--green);font-weight:700;margin-right:4px}
.onboard-logo b{font-weight:300;color:var(--text-bright)}
.onboard-title{font-size:24px;font-weight:500;font-family:var(--font-display);letter-spacing:-0.02em;margin:0 0 8px;color:var(--text-bright)}
.onboard-sub{font-size:13.5px;color:var(--muted);line-height:1.5;margin:0 0 22px}
.onboard-stats{display:flex;gap:12px;margin-bottom:22px}
.onboard-stat{flex:1;background:var(--bg);border:1px solid var(--border);border-radius:var(--rs);padding:16px;text-align:center}
.onboard-stat-v{font-size:26px;font-weight:600;font-family:var(--mono);letter-spacing:-0.02em;color:var(--accent);line-height:1.1}
.onboard-stat-l{font-size:11px;color:var(--muted);text-transform:uppercase;letter-spacing:.08em;margin-top:6px}
.onboard-points{list-style:none;margin:0 0 24px;padding:0;display:flex;flex-direction:column;gap:10px}
.onboard-points li{position:relative;padding-left:22px;font-size:13px;color:var(--text);line-height:1.45}
.onboard-points li::before{content:'';position:absolute;left:4px;top:7px;width:6px;height:6px;border-radius:50%;background:var(--green)}
.onboard-points b{color:var(--text-bright);font-weight:600}
.onboard-i{display:inline-flex;align-items:center;justify-content:center;width:15px;height:15px;border:1px solid var(--muted);border-radius:50%;font-size:10px;font-style:italic;font-family:serif;color:var(--muted);vertical-align:middle}
.onboard-btn{
  width:100%;padding:12px;border:none;border-radius:8px;
  background:var(--green);color:var(--bg);font-size:14px;font-weight:600;
  font-family:var(--font);cursor:pointer;transition:.15s;
}
.onboard-btn:hover{filter:brightness(1.08)}

/* Background ASCII art was visual noise behind the data — keep it off. */
.ascii-global-bg{display:none}

/* ---- #295 Layers panel ---- */
.graph-layers{display:flex;flex-wrap:wrap;gap:6px 12px;padding:6px 10px;font-size:11px;border:1px solid var(--border);border-radius:6px;margin:4px 8px}
.graph-layers-title{font-weight:600;color:var(--muted);margin-right:6px}
.cg-layer-item{display:inline-flex;align-items:center;gap:3px;cursor:pointer;color:var(--text)}
.cg-layer-item input{accent-color:var(--green)}

/* ---- #295 Tour overlay ---- */
.tour-overlay{position:fixed;inset:0;z-index:9999}
.tour-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.55)}
.tour-box{position:absolute;z-index:10000;background:var(--bg);border:1px solid var(--green);border-radius:10px;padding:16px 20px;max-width:340px;box-shadow:0 8px 32px rgba(0,0,0,.6)}
.tour-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:6px}
.tour-step-num{font-size:11px;color:var(--muted)}
.tour-close{background:none;border:none;color:var(--text);font-size:18px;cursor:pointer}
.tour-title{margin:0 0 6px;font-size:14px;color:var(--text-bright)}
.tour-body{margin:0 0 12px;font-size:12px;color:var(--text);line-height:1.5}
.tour-nav{display:flex;gap:8px;justify-content:flex-end}
.tour-nav button{padding:5px 14px;border:1px solid var(--border);border-radius:6px;background:var(--bg);color:var(--text);font-size:12px;cursor:pointer}
.tour-nav button:hover:not(:disabled){background:var(--green);color:var(--bg);border-color:var(--green)}
.tour-nav button:disabled{opacity:.4;cursor:default}
.tour-highlight{outline:2px solid var(--green);outline-offset:2px;border-radius:4px;transition:outline .3s}

/* ---- #487 area tab strip (one page per job area, views as tabs) ---- */
cockpit-area-tabs{display:block}
cockpit-area-tabs[hidden]{display:none}
.area-tabs{
  display:flex;gap:2px;margin:0 0 14px;border-bottom:1px solid var(--border);
  overflow-x:auto;scrollbar-width:none;
}
.area-tabs::-webkit-scrollbar{display:none}
.area-tab{
  padding:8px 14px;font-size:12px;font-weight:500;color:var(--muted);
  text-decoration:none;border-bottom:2px solid transparent;white-space:nowrap;
  transition:color .15s,border-color .15s;
}
.area-tab:hover{color:var(--text)}
.area-tab.active{color:var(--green);border-bottom-color:var(--green)}
.area-tab:focus-visible{outline:none;box-shadow:0 0 0 2px rgba(52,211,153,0.25) inset;border-radius:4px 4px 0 0}

/* Area nav entries carry the job promise as a second line */
.nav-item-area .nav-label{display:flex;flex-direction:column;line-height:1.25;overflow:hidden}
.nav-label-job{
  font-size:9px;font-weight:400;color:var(--muted);opacity:.7;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.nav-item-area.active .nav-label-job{color:var(--green);opacity:.65}

/* ---- #487 Protection / Risk & Policies ---- */
.prot-kpis{display:flex;flex-wrap:wrap;gap:10px}
.prot-kpi{
  flex:1 1 140px;min-width:120px;padding:10px 14px;border:1px solid var(--border);
  border-radius:var(--rs);background:var(--surface-2);
}
.prot-kpi-v{font-family:var(--mono);font-size:20px;font-weight:700;color:var(--text-bright)}
.prot-kpi-l{font-size:10px;color:var(--muted);margin-top:2px}
.prot-kpi.ok .prot-kpi-v{color:var(--green)}
.prot-kpi.warn .prot-kpi-v{color:var(--yellow)}
.prot-warning{
  padding:10px 12px;border:1px solid var(--border);border-left:3px solid var(--yellow);
  border-radius:var(--rs);margin-bottom:8px;
}
.prot-warning.sev-high{border-left-color:var(--red)}
.prot-warning-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.prot-warning-head code{font-size:11px;color:var(--text-bright)}
.prot-warning-msg{font-size:12px;color:var(--text);margin-top:5px}
.prot-warning-fix{font-size:11px;color:var(--muted);margin-top:3px;font-style:italic}
.prot-owasp-grid{
  display:grid;grid-template-columns:repeat(auto-fill,minmax(290px,1fr));gap:12px;
}
.prot-owasp-card{
  padding:12px 14px;border:1px solid var(--border);border-radius:var(--rs);
  background:var(--surface-2);display:flex;flex-direction:column;gap:6px;
}
.prot-owasp-head{display:flex;justify-content:space-between;align-items:center}
.prot-owasp-id{font-family:var(--mono);font-size:10px;color:var(--muted);letter-spacing:.05em}
.prot-coverage{
  font-family:var(--mono);font-size:10px;font-weight:700;padding:2px 8px;border-radius:10px;
}
.prot-coverage.ok{color:var(--green);background:var(--green-dim)}
.prot-coverage.warn{color:var(--yellow);background:var(--yellow-dim)}
.prot-coverage.dim{color:var(--muted);background:var(--surface)}
.prot-owasp-title{font-size:13px;font-weight:600;color:var(--text-bright)}
.prot-owasp-risk{font-size:11px;color:var(--muted);line-height:1.5}
.prot-mitigations{display:flex;flex-wrap:wrap;gap:5px;margin-top:2px}
.prot-mitigation{
  font-family:var(--mono);font-size:10px;padding:2px 8px;border-radius:10px;
  border:1px solid var(--border);color:var(--text);cursor:help;
}
.prot-mitigation:hover{border-color:var(--green);color:var(--green)}
