/* ══════════════════════════════════════════════════════════════
   FocusDive Dev Tool — Styles
   Design tokens inherited from symbiont.audio
   ══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500&family=Manrope:wght@200;300;400;500;600;700&display=swap');

/* ── Tokens ────────────────────────────────────────────────── */
:root {
  --bg: #000000;
  --surface: #000000;
  --surface2: #080808;
  --surface3: #0F0F0F;
  --border: #272727;
  --text: #ffffff;
  --text-dim: #808080;

  /* ═══ SYMBIONT COLOR — 4 hues × 3 S/L = 12 tones ═══ */
  /* All derived from --olo-hue via offset. Updated by ColorOrb. */
  --olo-hue: 171;

  /* ── olo (+0°) ── */
  --olo:       hsl(calc(var(--olo-hue) + 0), 95%, 50%);
  --olo-deep:  hsl(calc(var(--olo-hue) + 0), 95%, 30%);
  --olo-light: hsl(calc(var(--olo-hue) + 0), 50%, 62%);
  --olo-rgb: 1, 254, 215;
  --olo-dim: rgba(var(--olo-rgb), 0.4);
  --olo-glow: rgba(var(--olo-rgb), 0.25);
  --amber-rgb: 255, 191, 0;

  /* ── null (+60°, C++ getNull) ── */
  --null:       hsl(calc(var(--olo-hue) + 60), 90%, 55%);
  --null-deep:  hsl(calc(var(--olo-hue) + 60), 90%, 35%);
  --null-light: hsl(calc(var(--olo-hue) + 60), 50%, 65%);

  /* ── sig → flux alias (+270°, M6 in E612) ── */
  --sig:       hsl(calc(var(--olo-hue) + 270), 87%, 57%);
  --sig-deep:  hsl(calc(var(--olo-hue) + 270), 87%, 35%);
  --sig-light: hsl(calc(var(--olo-hue) + 270), 60%, 65%);
  --sig-rgb: 180, 225, 30;

  /* ── flux (+270°, C++ getFlux — oloHue − 90°) ── */
  --flux:       hsl(calc(var(--olo-hue) + 270), 95%, 55%);
  --flux-deep:  hsl(calc(var(--olo-hue) + 270), 95%, 35%);
  --flux-light: hsl(calc(var(--olo-hue) + 270), 60%, 65%);
  --flux-rgb: 163, 240, 18;

  /* ── rose (+159°, Web専用) ── */
  --rose:       hsl(calc(var(--olo-hue) + 159), 85%, 58%);
  --rose-deep:  hsl(calc(var(--olo-hue) + 159), 85%, 35%);
  --rose-light: hsl(calc(var(--olo-hue) + 159), 55%, 70%);

  /* ── Alpha Hierarchy — C++ VizConstants::Alpha aligned ── */
  --a-full:    1.0;   /* solid */
  --a-bright:  0.963; /* Web hover primary */
  --a-mid:     0.85;  /* Web hover secondary */
  --a-vivid:   0.80;  /* high-emphasis labels */
  --a-active:  0.75;  /* active elements */
  --a-muted:   0.70;  /* text resting (C++ muted) */
  --a-deep:    0.58;  /* subtle structural (C++ deep) */
  --a-passive: 0.55;  /* inactive elements */
  --a-ghost:   0.50;  /* ghost traces (C++ ghost) */
  --a-abyss:   0.45;  /* category labels (C++ abyss) */
  --a-grid:    0.35;  /* grid lines */
  --a-trail:   0.30;  /* ghost trail */
  --a-bleed:   0.25;  /* structural borders (C++ lowest/bleed) */
  --a-lowest:  0.12;  /* atmospheric only */
  --a-wash:    0.04;  /* ultra-light wash */
  --a-glow:    0.45;  /* text-shadow, drop-shadow */

  /* ── Category Colors (overridden by JS) ── */
  --gen:   hsl(calc(var(--olo-hue) + 0), 95%, 50%);
  --drum:  var(--rose);
  --flt:   hsl(calc(var(--olo-hue) + 60), 90%, 55%);
  --fft:   hsl(calc(var(--olo-hue) + 210), 80%, 52%);
  --spc:   hsl(calc(var(--olo-hue) + 40), 80%, 52%);
  --env:   var(--flux);
  --cv:    hsl(calc(var(--olo-hue) + 30), 72%, 50%);
  --seq:   hsl(calc(var(--olo-hue) + 60), 82%, 45%);
  --util:  hsl(calc(var(--olo-hue) + 45), 65%, 50%);
  --con:   hsl(calc(var(--olo-hue) + 0), 95%, 34%);

  --gen-rgb:   1,254,215;
  --drum-rgb:  4,165,142;
  --flt-rgb:   46,79,255;
  --fft-rgb:   25,178,196;
  --spc-rgb:   25,178,196;
  --env-rgb:   8,196,168;
  --cv-rgb:    32,170,186;
  --seq-rgb:   17,128,176;
  --util-rgb:  24,152,166;
  --con-rgb:   4,165,142;

  /* Silver Ratio */
  --silver: 1.41421;
  --silver-pct: 70.7%;
  --silver-inv: 0.707;

  /* Fibonacci Spacing */
  --space-2: 2px;
  --space-3: 3px;
  --space-5: 5px;
  --space-8: 8px;
  --space-13: 13px;
  --space-21: 21px;
  --space-34: 34px;
  --space-55: 55px;
  --space-89: 89px;

  /* Typography */
  --font-display: "Manrope", system-ui, sans-serif;
  --font-mono: "Manrope", system-ui, sans-serif;

  --fs-2xs: 0.6875rem;
  --fs-xs:  0.8125rem;
  --fs-sm:  0.8125rem;
  --fs-base: 0.875rem;
  --fs-body: 0.9375rem;
  --fs-md:  1rem;
  --fs-lg:  1.125rem;
  --fs-xl:  1.3125rem;
  --fs-2xl: 1.5rem;

  /* Letter Spacing */
  /* Adaptive Kerning — smaller text → wider spacing (φ-derived) */
  --ls-tight: -0.01618em;
  --ls-normal: 0.0em;
  --ls-phi-xl: 0.02618em;  /* ≥1.125rem  — subtle */
  --ls-phi-lg: 0.0382em;   /* ~1rem      — gentle */
  --ls-phi:    0.0500em;    /* ~0.875rem  — golden */
  --ls-phi-sm: 0.0764em;   /* ~0.8125rem — body items (φ²×0.0291) */
  --ls-phi-xs: 0.0927em;   /* ~0.6875rem — labels, tabs */
  --ls-mono:   0.05em;
  --ls-wide:   0.0764em;
  --ls-label:  0.118em;     /* uppercase labels — most open */
  --ls-title:  0.1618em;

  /* Transitions */
  --ease-phi: cubic-bezier(0.19, 1, 0.22, 1);
  --ease-surgical: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 150ms;
  --t-base: 300ms;

  /* Glass */
  --bg-rgb: 0, 0, 0;
  --glass-bg: rgba(var(--bg-rgb), 0.92);
  --glass-blur: blur(24px) saturate(98%);
  --glass-border: rgba(255, 255, 255, 0.063);

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.35);

  /* Ink */
  --ink-bright: 1.0;
  --ink-normal: 0.85;
  --ink-muted: 0.55;
  --ink-faint: 0.25;

  /* Surface Elevation */
  --surface-raised: 0.03;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-display);
  font-size: var(--fs-base);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
input, textarea, button { font-family: inherit; }

::selection {
  background: var(--olo-dim);
  color: var(--text);
}

/* ── Control Bar (unified with symbiont.audio style.css) ───── */
.control-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 48px;
  z-index: 2100;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 0.5px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-21);
}
@media(min-width: 901px) {
  .control-bar { justify-content: center; }
}

.cb-brand {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: var(--ls-title);
  text-transform: uppercase;
  color: rgba(var(--olo-rgb), var(--a-deep));
  white-space: nowrap;
  text-decoration: none;
  transition: color var(--t-fast) var(--ease-phi);
  position: relative;
  z-index: 10001;
}
.cb-brand:hover { color: var(--olo); }

.cb-sep {
  width: 0.5px;
  height: 16px;
  background: rgba(var(--ink-rgb), 0.08);
  margin: 0 var(--space-13);
  flex-shrink: 0;
}

.cb-links {
  display: none;
  align-items: center;
  gap: var(--space-3);
}
@media(max-width: 900px) {
    .control-bar {
        flex-direction: row !important;
        justify-content: flex-start !important;
        align-items: center !important;
        transform: none !important;
        width: 100% !important;
        left: 0 !important;
        padding: 0 var(--space-21);
    }
    .cb-sep { display: none !important; }
    .cb-links { display: none !important; }
    .cb-lang-btn {
        display: flex !important;
        margin-left: var(--space-13) !important;
        position: relative !important;
        left: auto !important;
        transform: none !important;
    }
    #orbMount {
        margin-left: auto;
        margin-right: 5px;
    }
    .cb-hamburger {
        margin-left: 0;
    }
    .cb-links.open {
        display: flex !important;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100vw;
        height: 100vh;
        z-index: 10000;
        background: var(--bg);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .cb-links.open .cb-link {
        font-family: var(--font-display);
        font-size: var(--fs-base);
        font-weight: 400;
        letter-spacing: var(--ls-title);
        text-transform: uppercase;
        color: var(--text-dim);
        padding: var(--space-34) 0;
        min-height: 56px;
        border: none;
        border-bottom: 0.5px solid rgba(255, 255, 255, 0.04);
        text-align: center;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 80%;
        opacity: 0;
        animation: menuItemIn 0.6s cubic-bezier(0.23, 1, 0.32, 1) both;
    }
    .cb-links.open .cb-link:last-child { border-bottom: none; }
    .cb-links.open .cb-link:nth-child(1) { animation-delay: 0.04s; }
    .cb-links.open .cb-link:nth-child(2) { animation-delay: 0.08s; }
    .cb-links.open .cb-link:nth-child(3) { animation-delay: 0.12s; }
    .cb-links.open .cb-link:nth-child(4) { animation-delay: 0.16s; }
    .cb-links.open .cb-link:nth-child(5) { animation-delay: 0.20s; }
    .cb-links.open .cb-link:nth-child(6) { animation-delay: 0.24s; }
    .cb-links.open .cb-link:nth-child(7) { animation-delay: 0.28s; }
    .cb-links.open .cb-link:nth-child(8) { animation-delay: 0.32s; }

    /* Brand link in mobile menu — accent color, top position */
    .cb-links.open .cb-link.cb-link-brand {
        display: flex !important;
        color: var(--olo-light) !important;
        font-family: var(--font-display);
        font-weight: 600;
        font-size: var(--fs-base);
        letter-spacing: var(--ls-title);
        border-bottom: 0.5px solid rgba(var(--olo-rgb), 0.1) !important;
        padding-bottom: var(--space-34);
        margin-bottom: var(--space-21);
    }
}

@keyframes menuItemIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media(min-width: 901px) {
  .cb-links { display: flex; }
}

.cb-link {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: var(--ls-title);
  text-transform: uppercase;
  color: rgba(var(--ink-rgb), var(--a-abyss));
  padding: var(--space-8) var(--space-8);
  text-decoration: none;
  border-bottom: 1.5px solid transparent;
  transition: color var(--t-fast) var(--ease-phi), border-color var(--t-fast) var(--ease-phi);
  white-space: nowrap;
}
.cb-link:hover {
  color: rgba(var(--ink-rgb), 0.85);
  background-color: rgba(var(--ink-rgb), 0.03);
}
.cb-link.active {
  color: var(--text);
  border-bottom: 2px solid var(--olo);
}
.cb-link-brand { display: none; }

/* ── Lang Toggle (matched to main site) ───────────────────── */
.cb-lang-btn,
.cb-lang-mobile {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  color: rgba(var(--ink-rgb), 0.22);
  background: none;
  border: none;
  cursor: pointer;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.cb-lang-btn { padding: 0; margin-left: 28px; transition: color 0.6s var(--ease-phi); }
.cb-lang-btn:hover { color: rgba(var(--ink-rgb), 0.55); }
.cb-lang-btn .lang-sep,
.cb-lang-mobile .lang-sep { color: rgba(var(--ink-rgb), 0.12); }
.cb-lang-btn .lang-active,
.cb-lang-mobile .lang-active { color: rgba(var(--amber-rgb), 0.8); }
.cb-lang-mobile { display: none; }

/* ── Hamburger Menu ────────────────────────────────────────── */
.cb-hamburger {
  display: none;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  z-index: 10001;
  padding: 0;
  margin-left: var(--space-5);
}
@media(max-width: 900px) {
  .cb-hamburger { display: flex; align-items: center; justify-content: center; }
}
.cb-hamburger span {
  display: block;
  position: absolute;
  width: 16px;
  height: 0.5px;
  background: var(--text);
  transition: transform 0.3s var(--ease-phi), opacity 0.3s var(--ease-phi), top 0.3s var(--ease-phi);
}
.cb-hamburger span:nth-child(1) { transform: translateY(-3px); }
.cb-hamburger span:nth-child(2) { width: 10px; }
.cb-hamburger span:nth-child(3) { transform: translateY(3px); }

.cb-hamburger.open span:nth-child(1) { transform: rotate(45deg); width: 14px; }
.cb-hamburger.open span:nth-child(2) { opacity: 0; width: 0; }
.cb-hamburger.open span:nth-child(3) { transform: rotate(-45deg); width: 14px; }

/* Orb positioning on mobile */
#orbMount { display: flex; align-items: center; }
@media(max-width: 900px) {
  #orbMount { margin-left: auto !important; }
}
@media(min-width: 901px) {
  #orbMount { margin-left: 21px; }
}

/* ── FocusDive Subheader ──────────────────────────────────── */
.fd-subheader {
  position: fixed;
  top: 48px;
  left: 0;
  right: 0;
  z-index: 2000;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-21);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 0.5px solid var(--glass-border);
}

.fd-subheader-left {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin-right: var(--space-13);
}

.fd-subheader-right {
  display: flex;
  align-items: center;
  gap: var(--space-13);
  flex-shrink: 0;
}

.breadcrumb {
  font-size: var(--fs-xs);
  color: var(--text-dim);
  letter-spacing: var(--ls-wide);
}

.breadcrumb a {
  color: var(--text-dim);
  transition: color var(--t-fast);
}
.breadcrumb a:hover { color: var(--text); }
.breadcrumb .bc-current { color: var(--text); }

/* Search */
.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: var(--space-8);
  color: var(--text-dim);
  pointer-events: none;
}

.search-box input {
  background: rgba(var(--ink-rgb, 255,255,255), var(--surface-raised));
  border: 0.5px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  font-size: var(--fs-xs);
  font-family: var(--font-display);
  letter-spacing: var(--ls-wide);
  padding: var(--space-5) var(--space-13) var(--space-5) 30px;
  width: 220px;
  outline: none;
  transition: border-color var(--t-fast), width var(--t-base) var(--ease-phi);
}

.search-box input:focus {
  border-color: var(--olo-dim);
  width: 280px;
}

.search-box input::placeholder {
  color: var(--text-dim);
  opacity: 0.5;
}

/* Progress Pill */
.progress-pill {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  font-size: var(--fs-2xs);
  font-family: var(--font-mono);
  letter-spacing: var(--ls-mono);
  color: var(--text-dim);
}

.progress-pill .pp-bar {
  width: 89px;
  height: 3px;
  border-radius: 2px;
  background: rgba(var(--ink-rgb, 255,255,255), 0.06);
  overflow: hidden;
  display: flex;
}

.progress-pill .pp-full  { background: var(--olo); }
.progress-pill .pp-basic { background: var(--seq); }

/* ── Main container offset for fixed headers/footer ────────── */
#app {
  padding-top: 48px;   /* control-bar(48) */
}

/* Badge */
.badge {
  font-size: 0.625rem;
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: var(--ls-mono);
  padding: 1px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge-full {
  color: var(--olo);
  border: 0.5px solid var(--olo-dim);
  background: var(--olo-glow);
}

.badge-basic {
  color: var(--olo-light);
  border: 0.5px solid rgba(var(--src-rgb, 1,254,215), 0.3);
  background: rgba(var(--src-rgb, 1,254,215), 0.06);
}

.badge-none {
  color: var(--text-dim);
  border: 0.5px solid var(--border);
  background: transparent;
}

/* ── Detail View ───────────────────────────────────────────── */
.detail {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-34);
}

.detail-header {
  display: flex;
  align-items: center;
  gap: var(--space-13);
  margin-bottom: var(--space-34);
}

.detail-name {
  font-size: var(--fs-2xl);
  font-weight: 700;
  letter-spacing: var(--ls-tight);
}

.detail-renderer {
  font-size: var(--fs-xs);
  font-family: var(--font-mono);
  color: var(--text-dim);
  letter-spacing: var(--ls-mono);
}

/* Sidebar 260px (Fibonacci近似: 233–280間) — Vercel比率準拠
   Height: 70.7vh (白銀比), header(88px)+footer(40px)込みで上下中央 */
.detail-layout {
  display: grid;
  grid-template-columns: 260px 1fr 260px;
  gap: 0;
  /* Break out of parent container to span full viewport */
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  align-items: start;
  /* 70.7vh height, vertically centered within header(88px)+palette-bar(40px)-excluded space */
  height: 70.7vh;
  margin-top: calc((100vh - 70.7vh - 48px) / 2);
  margin-bottom: 0;
}

/* Canvas — C++ FocusDive: fills center, height locked to layout */
.focus-canvas {
  width: 100%;
  height: 100%;
  background: transparent;
  border: 0.5px solid var(--border);
  border-radius: 0;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease-phi);
}

.focus-canvas:hover {
  border-color: rgba(var(--ink-rgb, 255,255,255),0.08);
}

.focus-canvas-empty {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.fce-hint {
  font-size: var(--fs-xs);
  color: var(--text-dim);
  opacity: 0.3;
  letter-spacing: var(--ls-wide);
}

/* Fullscreen Canvas — hide sidebars, width 100%, keep vertical layout */
.detail-layout.canvas-fullwidth {
  grid-template-columns: 1fr !important;
}
.detail-layout.canvas-fullwidth .side-panel {
  display: none !important;
}
.detail-layout.canvas-fullwidth .focus-canvas {
  width: 100% !important;
  border: none;
  border-radius: 0;
}

.fullscreen-hint {
  position: fixed;
  bottom: var(--space-21);
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  color: var(--text-dim);
  opacity: 0;
  z-index: 10000;
  pointer-events: none;
  transition: opacity 0.5s;
}

.fullscreen-hint.visible {
  opacity: 0.5;
}

/* Side Panels — SidebarPanel style (glass + strand + scroll) */
.side-panel {
  padding: var(--space-13);
  display: flex;
  flex-direction: column;
  gap: var(--space-13);
  height: 70.7vh;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 0.5px solid var(--glass-border);
  position: relative;
}

/* Data Strand — 1px accent line on panel edge */
.side-panel::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    var(--olo-dim) 15%,
    var(--olo) 50%,
    var(--olo-dim) 85%,
    transparent 100%
  );
  opacity: 0.4;
  pointer-events: none;
}

.side-panel-left {
  border-radius: 0;
  border-right: none;
}

.side-panel-left::after {
  right: 0;
}

.side-panel-right {
  border-radius: 0;
  border-left: none;
}

.side-panel-right::after {
  left: 0;
}

/* ── Node Browser ─────────────────────────────────────────── */
.node-browser {
  padding: var(--space-8);
  gap: 0;
}

/* ── Browser Tabs (NODES | MODS | FILES) ─────────────────── */
.browser-tabs {
  display: flex;
  gap: 0;
  border-bottom: 0.5px solid var(--border);
  flex-shrink: 0;
  margin: calc(-1 * var(--space-8));
  margin-bottom: var(--space-5);
  padding: 0;
}

.browser-tab {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 1.5px solid transparent;
  color: rgba(var(--olo-rgb), var(--a-muted));
  font-size: var(--fs-2xs);
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  padding: var(--space-8) var(--space-5);
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-surgical);
}

.browser-tab:hover {
  color: rgba(var(--olo-rgb), var(--a-bright));
}

.browser-tab.active {
  color: rgba(var(--olo-rgb), var(--a-full));
  border-bottom-color: rgba(var(--olo-rgb), var(--a-bright));
}

.browser-tab-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  gap: var(--space-5);
}

.browser-tab-content.hidden {
  display: none;
}

.browser-cat {
  margin-bottom: var(--space-3);
}

.browser-cat-header {
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  padding: var(--space-5) var(--space-8);
  display: flex;
  align-items: center;
  gap: var(--space-5);
  color: rgba(var(--olo-rgb), var(--a-abyss));
  transition: color var(--t-fast) var(--ease-surgical);
}

.browser-cat-header:hover {
  color: rgba(var(--olo-rgb), var(--a-mid));
}

.browser-cat-count {
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  opacity: 0.45;
  margin-left: auto;
}

/* ── Browser Item — Vercel-inspired clean interaction ───────── */
.browser-item {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  height: 32px;
  padding: 0 var(--space-13);
  font-size: var(--fs-xs);
  color: rgba(var(--olo-rgb), var(--a-muted));
  text-decoration: none;
  cursor: pointer;
  position: relative;
  border-radius: 5px;
  margin: 0 var(--space-3);
  /* Vercel: GPU-accelerated transitions */
  transition: color 200ms ease, background 200ms ease;
}

/* Hover: Vercel Color-2 style bg */
.browser-item:hover {
  color: rgba(var(--olo-rgb), var(--a-bright));
  background: rgba(var(--olo-rgb), 0.06);
}

/* Click: Vercel Color-3 (press feedback) */
.browser-item:active {
  color: rgba(var(--olo-rgb), var(--a-full));
  background: rgba(var(--olo-rgb), 0.12);
  transition: none;
}

/* Selected: elevated contrast + left accent */
.browser-item.active {
  color: rgba(var(--olo-rgb), var(--a-full));
  background: rgba(var(--olo-rgb), 0.08);
  font-weight: 600;
}

/* Selected: left-edge accent (2px, rounded) */
.browser-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 2px;
  border-radius: 1px;
  background: var(--olo);
}

/* Browser Icon (SymbiontIcons SVG) */
.browser-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: rgba(var(--olo-rgb), var(--a-deep));
  transition: color 200ms ease;
}

.browser-item:hover .browser-icon {
  color: rgba(var(--olo-rgb), var(--a-bright));
}

.browser-item.active .browser-icon {
  color: var(--olo);
}

/* Node name */
.browser-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: var(--ls-phi-sm);
}

.browser-item.active .browser-name {
  font-weight: 600;
}

/* Abbreviation — right-aligned, muted */
.browser-abbrev {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  letter-spacing: var(--ls-mono);
  color: rgba(var(--olo-rgb), 0.15);
  transition: color 200ms ease;
}

.browser-item:hover .browser-abbrev {
  color: rgba(var(--olo-rgb), 0.28);
}

.browser-item.active .browser-abbrev {
  color: rgba(var(--olo-rgb), 0.35);
}

.focus-canvas-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(var(--ink-rgb, 255,255,255),0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--ink-rgb, 255,255,255),0.02) 1px, transparent 1px);
  background-size: 34px 34px;
  pointer-events: none;
}

.focus-canvas-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}

.focus-canvas-label .fcl-name {
  font-size: var(--fs-lg);
  font-weight: 600;
  letter-spacing: var(--ls-wide);
  opacity: 0.15;
}

.focus-canvas-label .fcl-ratio {
  font-size: var(--fs-2xs);
  font-family: var(--font-mono);
  color: var(--text-dim);
  opacity: 0.2;
  margin-top: var(--space-3);
}

.focus-canvas-accent {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  opacity: 0.4;
}

/* Meta Panel (legacy selector — now split into side panels) */

.meta-section {
  padding: var(--space-13);
  background: rgba(var(--ink-rgb, 255,255,255), var(--surface-raised));
  border: 0.5px solid var(--border);
  border-radius: 5px;
}

.meta-title {
  font-size: var(--fs-2xs);
  font-weight: 600;
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: var(--space-8);
}

.meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) 0;
  font-size: var(--fs-xs);
  border-bottom: 0.5px solid rgba(var(--ink-rgb, 255,255,255), 0.03);
}

.meta-row:last-child { border-bottom: none; }

.meta-key {
  color: rgba(var(--ink-rgb), 0.6);
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  letter-spacing: var(--ls-mono);
}

.meta-val {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  letter-spacing: var(--ls-mono);
}

.meta-val-true  { color: var(--olo); }
.meta-val-false { color: var(--text-dim); opacity: 0.3; }

/* Focus Methods */
.method-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.method-tag {
  font-size: var(--fs-2xs);
  font-family: var(--font-mono);
  letter-spacing: var(--ls-mono);
  color: var(--olo);
  opacity: 0.8;
}

/* ── Animations ────────────────────────────────────────────── */
.view-enter {
  animation: fadeSlideIn var(--t-base) var(--ease-phi) both;
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Empty State ───────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: var(--space-89) var(--space-34);
  color: var(--text-dim);
  opacity: 0.4;
  font-size: var(--fs-body);
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .detail { 
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .detail-layout {
    display: flex !important;
    flex-direction: column !important;
    margin: 0 !important;
    width: 100% !important;
    height: calc(100vh - 48px);
    position: fixed;
    top: 48px;
    left: 0;
  }
  .side-panel {
    border-radius: 0;
    border: none;
    height: 100%;
    max-height: none;
    background: var(--surface);
    width: 100% !important;
  }
  .side-panel::after { display: none; }
  
  /* Top 70%: Focus Canvas */
  .focus-canvas {
    order: 0;
    height: 58% !important;
    width: 100% !important;
    flex-shrink: 0;
    border-radius: 0;
    border-top: none;
    border-left: none;
    border-right: none;
    border-bottom: 0.5px solid var(--border);
  }
  
  /* Bottom 42%: Node Browser */
  .node-browser {
    order: 1;
    height: 42% !important;
    width: 100% !important;
    background: var(--surface2);
    padding: var(--space-8);
    overflow-y: auto;
  }
  
  /* Hide Inspector Panel on mobile */
  .side-panel-right { 
    display: none !important; 
  }
  
  .search-box input { width: 140px; }
  .search-box input:focus { width: 180px; }
}

/* ── Browser Search (1A) ──────────────────────────────────── */
.browser-search {
  position: relative;
  display: flex;
  align-items: center;
  padding: var(--space-3) var(--space-5);
  flex-shrink: 0;
}

.browser-search-icon {
  position: absolute;
  left: 10px;
  color: var(--text-dim);
  pointer-events: none;
  opacity: 0.5;
}

.browser-search-input {
  width: 100%;
  background: rgba(var(--ink-rgb, 255,255,255), var(--surface-raised));
  border: 0.5px solid var(--border);
  border-radius: 3px;
  color: var(--text);
  font-size: var(--fs-2xs);
  font-family: var(--font-display);
  letter-spacing: var(--ls-wide);
  padding: var(--space-3) var(--space-8) var(--space-3) 26px;
  outline: none;
  transition: border-color var(--t-fast);
}

.browser-search-input:focus {
  border-color: var(--olo-dim);
}

.browser-search-input::placeholder {
  color: var(--text-dim);
  opacity: 0.4;
}

.browser-search-clear {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: var(--fs-sm);
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  transition: color var(--t-fast);
}

.browser-search-clear:hover {
  color: var(--text);
}

/* ── Browser Category Collapse (1B) ──────────────────────── */
.browser-list {
  flex: 1;
  overflow-y: auto;
}

.browser-cat-header {
  cursor: pointer;
  user-select: none;
}

.browser-cat-chevron {
  font-size: 0.625rem;
  margin-right: var(--space-3);
  display: inline-block;
  width: 10px;
  text-align: center;
}

.browser-cat-items {
  overflow: hidden;
  transition: max-height var(--t-base) var(--ease-phi), opacity var(--t-fast);
}

.browser-cat-items.hidden {
  max-height: 0 !important;
  opacity: 0;
  overflow: hidden;
}

/* ── Subcategory Grouping ── */
.browser-subcat {
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  padding: 16px 16px 6px 16px;
  line-height: 1;
  opacity: 0.35;
  pointer-events: none;
  user-select: none;
  border-top: 0.5px solid rgba(255, 255, 255, 0.04);
  margin-top: 8px;
  margin-bottom: 2px;
}

.browser-cat-items > .browser-subcat:first-child {
  padding-top: 8px;
}

/* ── Inspector — C++ InspectorPanel reproduction ─────────── */

/* Header (30px, overlay-style) */
.insp-header {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  height: 30px;
  padding: 0 16px;
  flex-shrink: 0;
  border-bottom: 0.5px solid var(--border);
  margin: calc(-1 * var(--space-13));
  margin-bottom: 0;
}

.insp-header-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.insp-header-name {
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: var(--ls-phi);
  color: rgba(var(--olo-rgb), var(--a-full));
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.insp-header-abbrev {
  font-size: 0.5625rem;
  font-family: var(--font-mono);
  letter-spacing: var(--ls-mono);
  color: rgba(var(--olo-rgb), 0.25);
  flex-shrink: 0;
}

.insp-pin-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.insp-pin-led {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(var(--olo-rgb), 0.15);
  transition: all 200ms ease;
}

.insp-pin-btn:hover .insp-pin-led {
  background: rgba(var(--olo-rgb), 0.4);
  box-shadow: 0 0 4px rgba(var(--olo-rgb), 0.2);
}

/* Scrollable content area */
.insp-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 0;
  display: flex;
  flex-direction: column;
  gap: 24px; /* PanelSectionGap */
}

/* Section */
.insp-section {
  padding: 0 16px; /* PanelContentMarginH */
}

.insp-section-header {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  height: 20px; /* PanelSectionHeaderHeight */
  font-size: 0.6875rem; /* 11px caption */
  font-weight: 600;
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: rgba(var(--olo-rgb), var(--a-abyss));
}

.insp-section-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  flex-shrink: 0;
}

.insp-section-divider {
  height: 0.5px;
  background: rgba(var(--olo-rgb), 0.08);
  margin: 4px 0;
  width: 35%;
}

/* Parameter Row (44px content) */
.insp-param-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  min-height: 44px;
  padding: 3px 0;
  gap: 0;
  border-bottom: 0.5px solid rgba(var(--olo-rgb), 0.03);
  transition: background 200ms ease;
}

.insp-param-row:hover {
  background: rgba(var(--olo-rgb), 0.04);
  margin: 0 -16px;
  padding-left: 16px;
  padding-right: 16px;
}

.insp-param-row:last-child {
  border-bottom: none;
}

.insp-param-label {
  font-size: 0.8125rem; /* 13px label */
  font-weight: 500;
  letter-spacing: var(--ls-phi-sm);
  color: rgba(var(--olo-rgb), 0.55);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.insp-param-value {
  font-size: 0.8125rem; /* 13px value */
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: var(--ls-mono);
  color: rgba(var(--olo-rgb), var(--a-muted));
  text-align: right;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

/* Slider track */
.insp-param-slider {
  width: 100%;
  height: 12px;
  display: flex;
  align-items: center;
}

.insp-param-slider-track {
  width: 100%;
  height: 3px;
  background: rgba(var(--olo-rgb), 0.08);
  border-radius: 1.5px;
  overflow: hidden;
  position: relative;
}

.insp-param-slider-fill {
  height: 100%;
  background: rgba(var(--olo-rgb), 0.5);
  border-radius: 1.5px;
  position: relative;
  transition: width 200ms ease;
}

.insp-param-slider-fill::after {
  content: '';
  position: absolute;
  right: 0;
  top: -1.5px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--olo);
  opacity: 0;
  transition: opacity 200ms ease;
}

.insp-param-row:hover .insp-param-slider-fill::after {
  opacity: 0.7;
}

/* Toggle */
.insp-toggle {
  width: 28px;
  height: 14px;
  border-radius: 7px;
  background: rgba(var(--olo-rgb), 0.12);
  cursor: pointer;
  position: relative;
  transition: background 200ms ease;
  flex-shrink: 0;
}

.insp-toggle.on {
  background: rgba(var(--olo-rgb), 0.4);
}

.insp-toggle-thumb {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(var(--olo-rgb), 0.5);
  position: absolute;
  top: 2px;
  left: 2px;
  transition: all 200ms ease;
}

.insp-toggle.on .insp-toggle-thumb {
  left: 16px;
  background: var(--olo);
}

.insp-param-toggle {
  justify-content: space-between;
  min-height: 32px;
}

/* Dropdown */
.insp-dropdown-val {
  font-size: 0.8125rem;
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: var(--ls-mono);
  color: rgba(var(--olo-rgb), var(--a-muted));
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 3px;
  background: rgba(var(--olo-rgb), 0.04);
  border: 0.5px solid rgba(var(--olo-rgb), 0.08);
  transition: all 200ms ease;
  flex-shrink: 0;
}

.insp-dropdown-val:hover {
  background: rgba(var(--olo-rgb), 0.08);
  border-color: rgba(var(--olo-rgb), 0.15);
}

.insp-dropdown-arrow {
  font-size: 0.625rem;
  opacity: 0.4;
  margin-left: 4px;
}

.insp-param-dropdown {
  justify-content: space-between;
  min-height: 32px;
}

/* Segmented */
.insp-segmented {
  display: flex;
  gap: 0;
  border-radius: 3px;
  overflow: hidden;
  border: 0.5px solid rgba(var(--olo-rgb), 0.12);
  flex-shrink: 0;
}

.insp-seg-btn {
  background: transparent;
  border: none;
  border-right: 0.5px solid rgba(var(--olo-rgb), 0.08);
  color: rgba(var(--olo-rgb), 0.45);
  font-size: 0.625rem;
  font-family: var(--font-mono);
  letter-spacing: var(--ls-mono);
  padding: 3px 6px;
  cursor: pointer;
  transition: all 150ms ease;
}

.insp-seg-btn:last-child { border-right: none; }

.insp-seg-btn:hover {
  color: rgba(var(--olo-rgb), 0.7);
  background: rgba(var(--olo-rgb), 0.04);
}

.insp-seg-btn.active {
  color: rgba(var(--olo-rgb), var(--a-full));
  background: rgba(var(--olo-rgb), 0.12);
}

.insp-param-segmented {
  justify-content: space-between;
  min-height: 32px;
}

/* Ports */
.insp-port-group {
  margin-bottom: var(--space-8);
}

.insp-port-group-label {
  font-size: 0.5625rem;
  font-weight: 600;
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: rgba(var(--olo-rgb), 0.25);
  padding: 4px 0 2px;
}

.insp-port-row {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  height: 20px;
  font-size: 0.8125rem; /* 13px */
  color: rgba(var(--olo-rgb), 0.55);
  transition: color 200ms ease;
}

.insp-port-row:hover {
  color: rgba(var(--olo-rgb), var(--a-muted));
}

.insp-port-arrow {
  font-size: 0.625rem;
  opacity: 0.35;
  width: 12px;
  text-align: center;
  flex-shrink: 0;
}

.insp-port-led {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  flex-shrink: 0;
}

.insp-port-name {
  flex: 1;
  font-weight: 500;
  letter-spacing: var(--ls-phi-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.insp-port-type {
  font-size: 0.5625rem;
  font-family: var(--font-mono);
  letter-spacing: var(--ls-mono);
  opacity: 0.3;
  flex-shrink: 0;
}

/* Empty hint */
.insp-empty-hint {
  font-size: 0.6875rem;
  font-family: var(--font-mono);
  letter-spacing: var(--ls-mono);
  color: rgba(var(--olo-rgb), 0.15);
  text-align: center;
  padding: var(--space-13) 0;
}

/* Info footer (compact) */
.insp-info-footer {
  padding-top: var(--space-8);
  border-top: 0.5px solid rgba(var(--olo-rgb), 0.05);
}

.insp-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 0;
  font-size: 0.6875rem; /* 11px */
}

.insp-info-key {
  font-family: var(--font-mono);
  letter-spacing: var(--ls-mono);
  color: rgba(var(--olo-rgb), 0.3);
}

.insp-info-val {
  font-family: var(--font-mono);
  letter-spacing: var(--ls-mono);
  color: rgba(var(--olo-rgb), 0.5);
}

/* ── Browser Files Tab ─────────────────────────────────────── */
.browser-files-section {
  margin-bottom: var(--space-13);
}

.browser-files-actions {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-8);
}

.browser-file-btn {
  flex: 1;
  background: rgba(var(--olo-rgb), 0.04);
  border: 0.5px solid rgba(var(--olo-rgb), 0.12);
  border-radius: 3px;
  color: rgba(var(--olo-rgb), var(--a-muted));
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  letter-spacing: var(--ls-label);
  padding: var(--space-5) var(--space-8);
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-surgical);
}

.browser-file-btn:hover {
  background: rgba(var(--olo-rgb), 0.08);
  color: rgba(var(--olo-rgb), var(--a-bright));
  border-color: rgba(var(--olo-rgb), 0.25);
}

.browser-file-btn-rec {
  color: rgba(var(--sig-rgb), 0.7);
  border-color: rgba(var(--sig-rgb), 0.15);
  background: rgba(var(--sig-rgb), 0.04);
}

.browser-file-btn-rec:hover {
  color: rgba(var(--sig-rgb), 0.9);
  background: rgba(var(--sig-rgb), 0.08);
  border-color: rgba(var(--sig-rgb), 0.3);
}

.browser-preset-list {
  padding: var(--space-5) var(--space-8);
}

.browser-preset-empty {
  font-size: var(--fs-2xs);
  color: rgba(var(--olo-rgb), 0.2);
  font-family: var(--font-mono);
  letter-spacing: var(--ls-mono);
  text-align: center;
  padding: var(--space-13) 0;
}

.browser-mods-section {
  margin-bottom: var(--space-8);
}

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(var(--ink-rgb, 255,255,255), 0.08);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(var(--ink-rgb, 255,255,255), 0.15);
}

/* ── Interaction Hint Overlay ──────────────────────────────── */
.fd-hint-overlay {
  display: none;
  position: fixed;
  bottom: 52px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2500;
  flex-direction: column;
  gap: 0;
  padding: var(--space-13) var(--space-21);
  background: rgba(var(--bg-rgb, 0,0,0), 0.88);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 0.5px solid var(--glass-border);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: var(--ls-wide);
  color: var(--text);
  pointer-events: none;
}

/* ── ColorOrb Popup Overlay ────────────────────────────────── */
.ps-orb-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 3000;
  align-items: center;
  justify-content: center;
  background: rgba(var(--bg-rgb, 0,0,0), 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

@media (max-width: 768px) {
  #app { padding-bottom: 0; }
}
