:root{
  --accentGlow: .16;
  --bg:#07070a;
  --panel:#0e0f14;
  --panel2:#11131a;
  --ink:#e9eefb;
  --muted:#a8b2c7;
  --accent:#ffb300; /* haunted gold */
  --accent2:#7cff8a; /* eerie green */
  --danger:#ff4d6d;
  --shadow: 0 16px 40px rgba(0,0,0,.55);
  --radius: 14px;
  --font: system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:var(--font);
  background:
    radial-gradient(1200px 800px at 10% 0%, rgba(255,179,0,.08), transparent 60%),
    radial-gradient(900px 700px at 90% 20%, rgba(124,255,138,.06), transparent 55%),
    radial-gradient(800px 600px at 50% 100%, rgba(255,77,109,.05), transparent 60%),
    linear-gradient(180deg, #050509 0%, var(--bg) 100%);
  color:var(--ink);
}
a{color:inherit;text-decoration:none}

/* Keep native dropdown menus readable on the dark HCO theme.
   color-scheme asks Chromium/Safari to render the opened popup in dark mode,
   while option colors cover browsers that honor explicit option styling. */
select{color-scheme:dark}
select option,select optgroup{background:#0b1710!important;color:#effff4!important}
select option:disabled{color:#8fa398!important}
.hco-wrap{max-width:1100px;margin:0 auto;padding:26px 18px 40px}
.hco-header{
  display:flex;align-items:center;justify-content:space-between;gap:14px;
  padding:14px 16px;border-radius:var(--radius);
  background:linear-gradient(180deg, rgba(17,19,26,.9), rgba(14,15,20,.85));
  box-shadow:var(--shadow);
  border:1px solid rgba(255,255,255,.06);
  position:sticky; top:10px; z-index:10;
  backdrop-filter: blur(8px);
}
.hco-auth{display:flex;align-items:center;gap:10px;flex-wrap:wrap;justify-content:flex-end}
.hco-brand{display:flex;align-items:center;gap:12px}
.hco-brand img{width:38px;height:38px}
.hco-title{font-size:18px;font-weight:800;letter-spacing:.3px}
.hco-sub{font-size:12px;color:var(--muted);margin-top:2px}
.hco-grid{
  margin-top:18px;
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap:14px;
}
.hco-card{
  background:linear-gradient(180deg, rgba(17,19,26,.92), rgba(10,10,14,.85));
  border:1px solid rgba(255,255,255,.07);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:14px;
  position:relative;
  overflow:hidden;
}
.hco-card:before{
  content:"";
  position:absolute; inset:-2px;
  background: radial-gradient(600px 240px at 10% 10%, rgba(255,179,0,.18), transparent 55%),
              radial-gradient(500px 240px at 90% 20%, rgba(124,255,138,.12), transparent 55%);
  opacity:.35;
  pointer-events:none;
}
.hco-card > *{position:relative}
.hco-card h3{margin:0 0 6px;font-size:16px}
.hco-card p{margin:0 0 12px;color:var(--muted);font-size:13px;line-height:1.35}
.hco-actions{display:flex;gap:10px;flex-wrap:wrap}
.hco-btn{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  padding:9px 12px;border-radius:12px;
  /* A11y: ensure readable text on dark UI */
  color:#fff;
  background: rgba(15,18,24,.72);
  border: 1px solid rgba(124,255,138,.38);
  box-shadow:
    inset 0 0 0 1px rgba(124,255,138,.12),
    0 10px 26px rgba(0,0,0,.40),
    0 0 18px rgba(124,255,138,.10);
  font-weight:800;font-size:13px;
  letter-spacing:.15px;
  transition: transform .12s ease, background .12s ease, border-color .12s ease, box-shadow .12s ease, filter .12s ease;
}
.hco-btn:hover{
  transform: translateY(-1px);
  background: rgba(18,22,30,.82);
  border-color: rgba(124,255,138,.55);
  box-shadow:
    inset 0 0 0 1px rgba(124,255,138,.18),
    0 12px 30px rgba(0,0,0,.45),
    0 0 22px rgba(124,255,138,.14);
}
.hco-btn:active{ transform: translateY(0px); filter: brightness(.98); }
.hco-btn:focus-visible{ outline: 2px solid rgba(124,255,138,.65); outline-offset: 2px; }
.hco-btn[disabled], .hco-btn.disabled{ opacity:.55; cursor:not-allowed; filter:saturate(.7); }

/* Semantic variants (drop-in, optional) */
.hco-btn.primary{
  background: rgba(124,255,138,.12);
  border-color: rgba(124,255,138,.62);
  box-shadow:
    inset 0 0 0 1px rgba(124,255,138,.22),
    0 12px 32px rgba(0,0,0,.42),
    0 0 26px rgba(124,255,138,.16);
}
.hco-btn.primary:hover{ background: rgba(124,255,138,.16); }

.hco-btn.warn{
  background: rgba(255,179,0,.12);
  border-color: rgba(255,179,0,.52);
  box-shadow:
    inset 0 0 0 1px rgba(255,179,0,.18),
    0 12px 32px rgba(0,0,0,.42),
    0 0 22px rgba(255,179,0,.12);
}
.hco-btn.warn:hover{ background: rgba(255,179,0,.16); border-color: rgba(255,179,0,.62); }

.hco-btn.danger{
  background: rgba(255,77,109,.12);
  border-color: rgba(255,77,109,.55);
  box-shadow:
    inset 0 0 0 1px rgba(255,77,109,.18),
    0 12px 32px rgba(0,0,0,.42),
    0 0 22px rgba(255,77,109,.12);
}
.hco-btn.danger:hover{ background: rgba(255,77,109,.16); border-color: rgba(255,77,109,.66); }

.hco-btn.ghost{
  background: transparent;
  border-color: rgba(124,255,138,.30);
  box-shadow: inset 0 0 0 1px rgba(124,255,138,.10);
}
.hco-btn.ghost:hover{ background: rgba(124,255,138,.08); border-color: rgba(124,255,138,.45); }

/* Auto-fix for "legacy" dark-on-dark buttons inside HCO layouts.
   Scoped to .hco-wrap to avoid touching BodyDragger/other standalone UIs. */
.hco-wrap :where(button, input[type="button"], input[type="submit"], a.button)
  :not(.hco-btn):not(.hco-pill):not(.hco-node):not(.btn):not(.tab-btn){
  color:#fff;
  background: rgba(15,18,24,.68);
  border: 1px solid rgba(124,255,138,.34);
  border-radius:12px;
  padding:9px 12px;
  font-weight:800;
  letter-spacing:.15px;
}
.hco-wrap :where(button, input[type="button"], input[type="submit"], a.button)
  :not(.hco-btn):not(.hco-pill):not(.hco-node):not(.btn):not(.tab-btn):hover{
  background: rgba(18,22,30,.80);
  border-color: rgba(124,255,138,.52);
}
.hco-pill{
  font-size:11px;font-weight:800;letter-spacing:.25px;
  padding:4px 8px;border-radius:999px;
  background:rgba(255,179,0,.14);
  border:1px solid rgba(255,179,0,.30);
  color:#ffd37a;
}
.hco-pill-link{ text-decoration:none; cursor:pointer; }
.hco-pill-link:hover{ border-color: rgba(124,255,138,.45); color:#d7ffe0; background:rgba(124,255,138,.10); }
.hco-pill-icononly{ padding:4px; width:28px; display:inline-flex; align-items:center; justify-content:center; }
.hco-pill-icononly .hco-pill-icon{ margin-right:0 !important; transform: translateX(0.5px); }
.hco-navpills{ display:flex; gap:10px; align-items:center; }
.hco-nav-haunt-switch{display:block;min-width:170px;max-width:300px}
.hco-nav-haunt-select{width:100%;height:30px;padding:0 30px 0 10px;border:1px solid rgba(80,255,160,.32);border-radius:999px;background:#0b1710;color:#effff4;font:800 11px/1 system-ui,-apple-system,Segoe UI,sans-serif}
.hco-nav-haunt-select:focus{outline:2px solid rgba(80,255,160,.35);outline-offset:2px}
.hco-visually-hidden{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
.hco-auth{ display:flex; gap:10px; align-items:center; }
.hco-footer{
  margin-top:18px;
  color:var(--muted);
  font-size:12px;
  text-align:center;
  opacity:.9;
}
.hco-kbd{
  font-family: ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;
  font-size:11px;
  padding:2px 6px;
  border-radius:8px;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.10);
}


/* =========================
   Brain Theme Main Menu
   ========================= */
.hco-hero{
  margin-top:18px;
  position:relative;
  min-height:540px;
  display:flex;
  gap:14px;
  align-items:stretch;
  justify-content:space-between;
}

.hco-nav{
  position:relative;
  overflow:hidden;
  padding:14px;
  border-radius:var(--radius);
  background:linear-gradient(180deg, rgba(17,19,26,.92), rgba(10,10,14,.85));
  border:1px solid rgba(255,255,255,.07);
  box-shadow:var(--shadow);
}

.hco-nav-title{
  font-size:14px;
  font-weight:900;
  letter-spacing:.35px;
  margin-bottom:4px;
}
.hco-nav-sub{
  font-size:12px;
  color:var(--muted);
  margin-bottom:12px;
}

.hco-ekg{
  position:absolute;
  left:8px;
  top:54px;
  width: 330px;
  height: calc(100% - 66px);
  opacity:.55;
  pointer-events:none;
}
.hco-ekg-path{
  fill: none;
  stroke: rgba(124,255,138,.55);
  stroke-width: 2.2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.hco-node{
  position:relative;
  display:flex;
  align-items:center;
  gap:12px;
  padding:10px 10px 10px 12px;
  border-radius:14px;
  background: rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.09);
  margin-bottom:10px;
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
}
.hco-node:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,.06);
  border-color: rgba(124,255,138,.35);
}
.hco-node:focus-visible{
  outline: 2px solid rgba(124,255,138,.55);
  outline-offset: 2px;
}

.hco-node-dot{
  width:14px;height:14px;border-radius:999px;
  background: rgba(124,255,138,.45);
  border:1px solid rgba(124,255,138,.75);
  box-shadow:
    0 0 0 6px rgba(124,255,138,.06),
    0 0 18px rgba(124,255,138, calc(.30 + var(--accentGlow, .16)));
  flex: 0 0 14px;
  animation: hcoPulse 1.9s ease-in-out infinite;
}
@keyframes hcoPulse{
  0%,100%{ transform: scale(1); filter: brightness(1); }
  50%{ transform: scale(1.12); filter: brightness(1.25); }
}

.hco-node-body{display:flex;flex-direction:column;min-width:0}
.hco-node-name{
  font-weight:900;
  font-size:13px;
  letter-spacing:.15px;
  line-height:1.1;
}
.hco-node-desc{
  margin-top:3px;
  color:var(--muted);
  font-size:12px;
  line-height:1.2;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.hco-node-chip{
  margin-left:auto;
  font-size:11px;
  font-weight:900;
  letter-spacing:.25px;
  padding:5px 9px;
  border-radius:999px;
  background: rgba(255,179,0,.10);
  border:1px solid rgba(255,179,0,.28);
  color:#ffd37a;
}

.hco-brain{
  position:relative;
  overflow:hidden;
  border-radius:var(--radius);
  border:1px solid rgba(255,255,255,.07);
  box-shadow:var(--shadow);
  background:
    radial-gradient(900px 540px at 10% 10%, rgba(124,255,138,.09), transparent 55%),
    radial-gradient(900px 540px at 90% 20%, rgba(255,179,0,.10), transparent 55%),
    url("../media/brain_nerve_center.png");
  background-size: cover;
  background-position: center;
  min-height: 420px;
}
.hco-brain-overlay{
  position:absolute; inset:0;
  background: radial-gradient(900px 540px at 50% 15%, rgba(0,0,0,.15), rgba(0,0,0,.62));
}
.hco-brain-caption{
  position:absolute;
  left:18px;
  bottom:16px;
  right:18px;
  z-index:2;
}
.hco-brain-title{
  font-weight:950;
  letter-spacing:.4px;
  font-size:28px;
  text-shadow: 0 10px 26px rgba(0,0,0,.55);
}
.hco-brain-sub{
  margin-top:2px;
  color: rgba(233,238,251,.85);
  font-weight:700;
  font-size:13px;
}
.hco-brain-note{
  margin-top:10px;
  color: rgba(233,238,251,.75);
  font-size:12px;
}

@media (max-width: 900px){
  .hco-hero{ grid-template-columns: 1fr; }
  .hco-ekg{ width: 100%; left:0; }
  .hco-brain{ min-height: 340px; }
}


/* ===== Hero: brain in background, menus left/right ===== */
.hco-hero-bg{
  position:absolute;
  inset:0;
  border-radius:var(--radius);
  overflow:hidden;
  border:1px solid rgba(255,255,255,.07);
  box-shadow:var(--shadow);
  background:
    radial-gradient(900px 540px at 10% 10%, rgba(124,255,138,.10), transparent 55%),
    radial-gradient(900px 540px at 90% 20%, rgba(255,179,0,.10), transparent 55%),
    url("../media/brain_nerve_center.png");
  background-size: cover;
  background-position: center;
  z-index: 0;
}

.hco-hero-bg-overlay{
  position:absolute;
  inset:0;
  background: radial-gradient(1200px 800px at 50% 60%, rgba(0,0,0,.10), rgba(0,0,0,.55));
}

.hco-nav{
  width: 360px;
  min-width: 320px;
  z-index: 2;
}

.hco-hero-caption{
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  display:flex;
  align-items:flex-end;
  justify-content:center;
  padding: 18px;
  z-index: 1;
  pointer-events:none;
}

.hco-hero-caption .hco-brain-caption{
  position: static;
  left:auto;
  bottom:auto;
  right:auto;
  max-width: 720px;
}

/* Squish the brain background before stacking columns */
@media (max-width: 1100px){
  .hco-hero{
    flex-direction: column;
    min-height: 0;
  }
  .hco-nav{
    width: auto;
    min-width: 0;
  }
  .hco-hero-caption{
    justify-content:flex-start;
  }
}

/* EKG: keep it at the bottom of panels only (never through text) */
.hco-ekg{
  left:8px;
  right:8px;
  top:auto !important;
  bottom:10px;
  width:auto;
  height:90px;
  opacity:.45;
  z-index: 1;
}

.hco-ekg-mirror{
  transform: scaleX(-1);
  transform-origin: center;
}

/* Ensure nodes render above the EKG */
.hco-node,
.hco-nav-title,
.hco-nav-sub{
  position:relative;
  z-index: 2;
}

/* Coming soon chip */
.hco-node-chip.chip-soon{
  border-color: rgba(255,179,0,.35);
  color:#ffd37a;
}



.hco-pill-icon{
  width:16px !important;
  height:16px !important;
  display:inline-block !important;
  object-fit:contain !important;
  /* Used inside inline-flex pills; keeps baselines from nudging icons */
  vertical-align:middle !important;
  margin-right:6px !important;
}

/* Slightly larger icons when the pill is icon-only (home button) */
.hco-pill-icononly .hco-pill-icon{
  width:18px !important;
  height:18px !important;
}
.hco-pill-emoji{display:inline-block; width:14px; text-align:center; margin-right:6px; vertical-align:-2px;}
@media(max-width:1050px){.hco-nav-haunt-switch{min-width:135px;max-width:180px}}

/* Account identification belongs on the main page only. */
html:not(.hco-home-page) #hcoUserPill{display:none!important}

.hco-navpills{flex-wrap:wrap;min-width:0}.hco-nav-haunt-switch{flex:0 1 220px;width:auto}
.till-back-button ~ .hco-navpills #hcoHomeLink{display:none!important}
