/* ==========================================================================
   JSONHell 🔥⚡ — Cyber-Pro Command Center Design System
   Inspired by Raycast, Cursor & Linear.
   Deep obsidian, ambient neon glow, frosted glass, and electric accents.
   ========================================================================== */

/* ── 1. Fonts & Custom Properties ────────────────────────────────────────── */
:root, [data-theme="dark-obsidian"] {
  /* Surface Layers */
  --bg-0: #07080b;              /* Canvas Deep Space */
  --bg-1: #0d1017;              /* Elevated Panels & Cards */
  --bg-2: #141923;              /* Hover states & Containers */
  --bg-3: #1c2331;              /* Active states & Borders */
  --bg-elevated: rgba(255, 255, 255, 0.04);
  --bg-glass: rgba(13, 16, 23, 0.78);
  --bg-glass-strong: rgba(10, 13, 19, 0.92);

  /* Borders */
  --border: rgba(255, 255, 255, 0.09);
  --border-subtle: rgba(255, 255, 255, 0.05);
  --border-focus: rgba(0, 229, 255, 0.5);
  --border-hover: rgba(255, 255, 255, 0.16);

  /* Typography */
  --text-0: #f8fafc;            /* Bright White Primary */
  --text-1: #94a3b8;            /* Slate Secondary */
  --text-2: #64748b;            /* Muted Slate */
  --text-3: #334155;            /* Deep Inactive */

  /* Brand Accents */
  --accent: #ff3366;            /* Electric Coral Heart */
  --accent-soft: rgba(255, 51, 102, 0.12);
  --accent-hover: #ff4d79;
  --accent-text: #fda4af;
  --accent-glow: 0 0 24px rgba(255, 51, 102, 0.35);

  --cyan: #00e5ff;              /* Neon Cyan Lightning/WASM */
  --cyan-soft: rgba(0, 229, 255, 0.12);
  --cyan-hover: #38bdf8;
  --cyan-glow: 0 0 20px rgba(0, 229, 255, 0.35);

  /* Status Colors */
  --green: #10b981;
  --green-soft: rgba(16, 185, 129, 0.12);
  --success-color: #10b981;

  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.14);
  --warning-color: #f59e0b;

  --blue: #38bdf8;
  --blue-soft: rgba(56, 189, 248, 0.12);

  --red: #ef4444;
  --red-soft: rgba(239, 68, 68, 0.12);

  /* Syntax Highlighting */
  --syn-key: #38bdf8;           /* Vivid Electric Sky */
  --syn-string: #4ade80;        /* Vivid Emerald Mint */
  --syn-number: #fbbf24;        /* Warm Radiant Amber */
  --syn-boolean: #f43f5e;       /* Hot Coral Pink */
  --syn-null: #c084fc;          /* Neon Lavender Purple */
  --syn-punct: #64748b;         /* Muted Slate Braces */

  /* Search & Line Numbers */
  --search-match-bg: rgba(250, 204, 21, 0.28);
  --search-match-active: #facc15;
  --line-num-color: #475569;
  --line-num-bg: #090b10;
  --line-num-border: rgba(255, 255, 255, 0.05);

  /* Radii & Shadows */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 0 0 1px var(--border), 0 8px 32px rgba(0, 0, 0, 0.6);

  --transition-fast: 140ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 240ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── 2. Light Studio Theme (Clean Apple / macOS Pro Light) ─────────────────── */
[data-theme="light-studio"] {
  --bg-0: #f8fafc;
  --bg-1: #ffffff;
  --bg-2: #f1f5f9;
  --bg-3: #e2e8f0;
  --bg-elevated: rgba(0, 0, 0, 0.03);
  --bg-glass: rgba(255, 255, 255, 0.85);
  --bg-glass-strong: rgba(255, 255, 255, 0.95);

  --border: rgba(15, 23, 42, 0.1);
  --border-subtle: rgba(15, 23, 42, 0.06);
  --border-focus: rgba(2, 132, 199, 0.6);
  --border-hover: rgba(15, 23, 42, 0.2);

  --text-0: #0f172a;
  --text-1: #475569;
  --text-2: #64748b;
  --text-3: #94a3b8;

  --accent: #e11d48;
  --accent-soft: rgba(225, 29, 72, 0.08);
  --accent-hover: #be123c;
  --accent-text: #e11d48;
  --accent-glow: 0 0 16px rgba(225, 29, 72, 0.2);

  --cyan: #0284c7;
  --cyan-soft: rgba(2, 132, 199, 0.08);
  --cyan-hover: #0369a1;
  --cyan-glow: 0 0 16px rgba(2, 132, 199, 0.2);

  --green: #15803d;
  --green-soft: rgba(21, 128, 61, 0.08);
  --success-color: #15803d;

  --amber: #d97706;
  --amber-soft: rgba(217, 119, 6, 0.08);
  --warning-color: #d97706;

  --blue: #2563eb;
  --blue-soft: rgba(37, 99, 235, 0.08);

  --red: #e11d48;
  --red-soft: rgba(225, 29, 72, 0.08);

  --syn-key: #0369a1;
  --syn-string: #15803d;
  --syn-number: #b45309;
  --syn-boolean: #c026d3;
  --syn-null: #64748b;
  --syn-punct: #94a3b8;

  --search-match-bg: rgba(250, 204, 21, 0.35);
  --search-match-active: #eab308;
  --line-num-color: #94a3b8;
  --line-num-bg: #f8fafc;
  --line-num-border: rgba(15, 23, 42, 0.08);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 36px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 0 1px var(--border), 0 4px 20px rgba(0, 0, 0, 0.06);
}

/* ── 2b. System Theme (Auto dark / light preference) ───────────────────────── */
@media (prefers-color-scheme: light) {
  [data-theme="system"] {
    --bg-0: #f8fafc;
    --bg-1: #ffffff;
    --bg-2: #f1f5f9;
    --bg-3: #e2e8f0;
    --bg-elevated: rgba(0, 0, 0, 0.03);
    --bg-glass: rgba(255, 255, 255, 0.85);
    --bg-glass-strong: rgba(255, 255, 255, 0.95);

    --border: rgba(15, 23, 42, 0.1);
    --border-subtle: rgba(15, 23, 42, 0.06);
    --border-focus: rgba(2, 132, 199, 0.6);
    --border-hover: rgba(15, 23, 42, 0.2);

    --text-0: #0f172a;
    --text-1: #475569;
    --text-2: #64748b;
    --text-3: #94a3b8;

    --accent: #e11d48;
    --accent-soft: rgba(225, 29, 72, 0.08);
    --accent-hover: #be123c;
    --accent-text: #e11d48;
    --accent-glow: 0 0 16px rgba(225, 29, 72, 0.2);

    --cyan: #0284c7;
    --cyan-soft: rgba(2, 132, 199, 0.08);
    --cyan-hover: #0369a1;
    --cyan-glow: 0 0 16px rgba(2, 132, 199, 0.2);

    --green: #15803d;
    --green-soft: rgba(21, 128, 61, 0.08);
    --success-color: #15803d;

    --amber: #d97706;
    --amber-soft: rgba(217, 119, 6, 0.08);
    --warning-color: #d97706;

    --blue: #2563eb;
    --blue-soft: rgba(37, 99, 235, 0.08);

    --red: #e11d48;
    --red-soft: rgba(225, 29, 72, 0.08);

    --syn-key: #0369a1;
    --syn-string: #15803d;
    --syn-number: #b45309;
    --syn-boolean: #c026d3;
    --syn-null: #64748b;
    --syn-punct: #94a3b8;

    --search-match-bg: rgba(250, 204, 21, 0.35);
    --search-match-active: #eab308;
    --line-num-color: #94a3b8;
    --line-num-bg: #f8fafc;
    --line-num-border: rgba(15, 23, 42, 0.08);

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 36px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 0 1px var(--border), 0 4px 20px rgba(0, 0, 0, 0.06);
  }
}

@media (prefers-color-scheme: dark) {
  [data-theme="system"] {
    --bg-0: #07080b;
    --bg-1: #0d1017;
    --bg-2: #141923;
    --bg-3: #1c2331;
    --bg-elevated: rgba(255, 255, 255, 0.04);
    --bg-glass: rgba(13, 16, 23, 0.78);
    --bg-glass-strong: rgba(10, 13, 19, 0.92);

    --border: rgba(255, 255, 255, 0.09);
    --border-subtle: rgba(255, 255, 255, 0.05);
    --border-focus: rgba(0, 229, 255, 0.5);
    --border-hover: rgba(255, 255, 255, 0.16);

    --text-0: #f8fafc;
    --text-1: #94a3b8;
    --text-2: #64748b;
    --text-3: #334155;

    --accent: #ff3366;
    --accent-soft: rgba(255, 51, 102, 0.12);
    --accent-hover: #ff4d79;
    --accent-text: #fda4af;
    --accent-glow: 0 0 24px rgba(255, 51, 102, 0.35);

    --cyan: #00e5ff;
    --cyan-soft: rgba(0, 229, 255, 0.12);
    --cyan-hover: #38bdf8;
    --cyan-glow: 0 0 20px rgba(0, 229, 255, 0.35);

    --green: #10b981;
    --green-soft: rgba(16, 185, 129, 0.12);
    --success-color: #10b981;

    --amber: #f59e0b;
    --amber-soft: rgba(245, 158, 11, 0.14);
    --warning-color: #f59e0b;

    --blue: #38bdf8;
    --blue-soft: rgba(56, 189, 248, 0.12);

    --red: #ef4444;
    --red-soft: rgba(239, 68, 68, 0.12);

    --syn-key: #38bdf8;
    --syn-string: #4ade80;
    --syn-number: #fbbf24;
    --syn-boolean: #f43f5e;
    --syn-null: #c084fc;
    --syn-punct: #64748b;

    --search-match-bg: rgba(250, 204, 21, 0.28);
    --search-match-active: #facc15;
    --line-num-color: #475569;
    --line-num-bg: #090b10;
    --line-num-border: rgba(255, 255, 255, 0.05);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.7);
    --shadow-glow: 0 0 0 1px var(--border), 0 8px 32px rgba(0, 0, 0, 0.6);
  }
}

/* ── 3. Cyberpunk Theme (High-Voltage Neon Purple & Cyan) ─────────────────── */
[data-theme="cyberpunk"] {
  --bg-0: #04020a;
  --bg-1: #0d061c;
  --bg-2: #170b2e;
  --bg-3: #261247;
  --bg-elevated: rgba(192, 132, 252, 0.06);
  --bg-glass: rgba(13, 6, 28, 0.82);
  --bg-glass-strong: rgba(9, 4, 20, 0.94);

  --border: rgba(192, 132, 252, 0.2);
  --border-subtle: rgba(192, 132, 252, 0.1);
  --border-focus: #00e5ff;
  --border-hover: rgba(0, 229, 255, 0.4);

  --text-0: #f5f3ff;
  --text-1: #d8b4fe;
  --text-2: #a855f7;
  --text-3: #7e22ce;

  --accent: #ff007f;
  --accent-soft: rgba(255, 0, 127, 0.16);
  --accent-hover: #ff2a96;
  --accent-text: #ff77bc;
  --accent-glow: 0 0 24px rgba(255, 0, 127, 0.5);

  --cyan: #00f0ff;
  --cyan-soft: rgba(0, 240, 255, 0.16);
  --cyan-hover: #38bdf8;
  --cyan-glow: 0 0 24px rgba(0, 240, 255, 0.5);

  --green: #00ff88;
  --green-soft: rgba(0, 255, 136, 0.15);
  --success-color: #00ff88;

  --amber: #ffe600;
  --amber-soft: rgba(255, 230, 0, 0.15);
  --warning-color: #ffe600;

  --blue: #00f0ff;
  --blue-soft: rgba(0, 240, 255, 0.15);

  --red: #ff0055;
  --red-soft: rgba(255, 0, 85, 0.15);

  --syn-key: #00f0ff;
  --syn-string: #00ff88;
  --syn-number: #ffe600;
  --syn-boolean: #ff007f;
  --syn-null: #a855f7;
  --syn-punct: #6d28d9;

  --search-match-bg: rgba(255, 230, 0, 0.35);
  --search-match-active: #ffe600;
  --line-num-color: #7e22ce;
  --line-num-bg: #070311;
  --line-num-border: rgba(192, 132, 252, 0.15);

  --shadow-glow: 0 0 0 1px var(--border), 0 0 30px rgba(168, 85, 247, 0.3);
}

/* ── 4. Monokai Pro Theme ─────────────────────────────────────────────────── */
[data-theme="monokai-pro"] {
  --bg-0: #19181a;
  --bg-1: #221f22;
  --bg-2: #2d2a2e;
  --bg-3: #403e41;
  --bg-elevated: rgba(255, 255, 255, 0.04);
  --bg-glass: rgba(34, 31, 34, 0.82);
  --bg-glass-strong: rgba(25, 24, 26, 0.94);

  --border: rgba(255, 255, 255, 0.1);
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-focus: #78dce8;
  --border-hover: rgba(255, 255, 255, 0.18);

  --text-0: #fcfcfa;
  --text-1: #c1c0c0;
  --text-2: #939293;
  --text-3: #5b595c;

  --accent: #ff6188;
  --accent-soft: rgba(255, 97, 136, 0.15);
  --accent-hover: #ff7599;
  --accent-text: #ff8ca8;
  --accent-glow: 0 0 20px rgba(255, 97, 136, 0.3);

  --cyan: #78dce8;
  --cyan-soft: rgba(120, 220, 232, 0.15);
  --cyan-hover: #8ee3ec;
  --cyan-glow: 0 0 20px rgba(120, 220, 232, 0.3);

  --green: #a9dc76;
  --green-soft: rgba(169, 220, 118, 0.15);
  --success-color: #a9dc76;

  --amber: #ffd866;
  --amber-soft: rgba(255, 216, 102, 0.15);
  --warning-color: #ffd866;

  --blue: #78dce8;
  --blue-soft: rgba(120, 220, 232, 0.15);

  --red: #ff6188;
  --red-soft: rgba(255, 97, 136, 0.15);

  --syn-key: #78dce8;
  --syn-string: #a9dc76;
  --syn-number: #ab9df2;
  --syn-boolean: #fc9867;
  --syn-null: #727072;
  --syn-punct: #939293;

  --search-match-bg: rgba(255, 216, 102, 0.3);
  --search-match-active: #ffd866;
  --line-num-color: #5b595c;
  --line-num-bg: #19181a;
  --line-num-border: rgba(255, 255, 255, 0.06);
}

/* ── 5. Solarized Dark Theme ──────────────────────────────────────────────── */
[data-theme="solarized-dark"] {
  --bg-0: #00212b;
  --bg-1: #002b36;
  --bg-2: #073642;
  --bg-3: #0a4655;
  --bg-elevated: rgba(42, 161, 152, 0.05);
  --bg-glass: rgba(0, 43, 54, 0.85);
  --bg-glass-strong: rgba(0, 33, 43, 0.95);

  --border: rgba(42, 161, 152, 0.15);
  --border-subtle: rgba(42, 161, 152, 0.08);
  --border-focus: #268bd2;
  --border-hover: rgba(42, 161, 152, 0.3);

  --text-0: #fdf6e3;
  --text-1: #93a1a1;
  --text-2: #657b83;
  --text-3: #586e75;

  --accent: #dc322f;
  --accent-soft: rgba(220, 50, 47, 0.15);
  --accent-hover: #e04a47;
  --accent-text: #ec7674;
  --accent-glow: 0 0 20px rgba(220, 50, 47, 0.3);

  --cyan: #2aa198;
  --cyan-soft: rgba(42, 161, 152, 0.15);
  --cyan-hover: #35b3aa;
  --cyan-glow: 0 0 20px rgba(42, 161, 152, 0.3);

  --green: #859900;
  --green-soft: rgba(133, 153, 0, 0.15);
  --success-color: #859900;

  --amber: #b58900;
  --amber-soft: rgba(181, 137, 0, 0.15);
  --warning-color: #b58900;

  --blue: #268bd2;
  --blue-soft: rgba(38, 139, 210, 0.15);

  --red: #dc322f;
  --red-soft: rgba(220, 50, 47, 0.15);

  --syn-key: #268bd2;
  --syn-string: #2aa198;
  --syn-number: #d33682;
  --syn-boolean: #cb4b16;
  --syn-null: #586e75;
  --syn-punct: #657b83;

  --search-match-bg: rgba(181, 137, 0, 0.35);
  --search-match-active: #b58900;
  --line-num-color: #586e75;
  --line-num-bg: #00212b;
  --line-num-border: rgba(42, 161, 152, 0.1);
}

/* ── 6. High Contrast Theme ──────────────────────────────────────────────── */
[data-theme="high-contrast"] {
  --bg-0: #000000;
  --bg-1: #0a0a0a;
  --bg-2: #141414;
  --bg-3: #222222;
  --bg-elevated: rgba(255, 255, 255, 0.08);
  --bg-glass: #000000;
  --bg-glass-strong: #000000;

  --border: #ffffff;
  --border-subtle: #888888;
  --border-focus: #00ffff;
  --border-hover: #ffffff;

  --text-0: #ffffff;
  --text-1: #dddddd;
  --text-2: #aaaaaa;
  --text-3: #777777;

  --accent: #ff0055;
  --accent-soft: rgba(255, 0, 85, 0.25);
  --accent-hover: #ff3377;
  --accent-text: #ffffff;
  --accent-glow: 0 0 20px #ff0055;

  --cyan: #00ffff;
  --cyan-soft: rgba(0, 255, 255, 0.25);
  --cyan-hover: #55ffff;
  --cyan-glow: 0 0 20px #00ffff;

  --green: #00ff66;
  --green-soft: rgba(0, 255, 102, 0.25);
  --success-color: #00ff66;

  --amber: #ffff00;
  --amber-soft: rgba(255, 255, 0, 0.25);
  --warning-color: #ffff00;

  --blue: #00ffff;
  --blue-soft: rgba(0, 255, 255, 0.25);

  --red: #ff0033;
  --red-soft: rgba(255, 0, 51, 0.25);

  --syn-key: #00ffff;
  --syn-string: #00ff66;
  --syn-number: #ffff00;
  --syn-boolean: #ff00ff;
  --syn-null: #ffffff;
  --syn-punct: #aaaaaa;

  --search-match-bg: #ffff00;
  --search-match-active: #ffffff;
  --line-num-color: #ffffff;
  --line-num-bg: #000000;
  --line-num-border: #ffffff;
}

/* ── 7. Reset & Ambient Foundation ────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  background-color: var(--bg-0);
  color: var(--text-0);
  font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Cyber Ambient Background Grid & Radial Glow */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: 
    radial-gradient(ellipse 90% 50% at 50% -10%, rgba(255, 51, 102, 0.12), transparent 60%),
    radial-gradient(ellipse 60% 40% at 90% 10%, rgba(0, 229, 255, 0.08), transparent 55%),
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 36px 36px, 36px 36px;
  pointer-events: none;
  z-index: 0;
}

[data-theme="light-studio"] body::before {
  background-image: 
    radial-gradient(ellipse 90% 50% at 50% -10%, rgba(225, 29, 72, 0.05), transparent 60%),
    radial-gradient(ellipse 60% 40% at 90% 10%, rgba(2, 132, 199, 0.05), transparent 55%),
    linear-gradient(rgba(15, 23, 42, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.02) 1px, transparent 1px);
}

.app-container {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  z-index: 1;
}

/* ── 8. Header Bar (Cyber-Pro Command Header) ────────────────────────────── */
.top-header {
  height: 60px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  z-index: 50;
  gap: 16px;
}

/* Branding */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  user-select: none;
}

.brand-icon-box {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(255, 51, 102, 0.2), rgba(0, 229, 255, 0.1));
  border: 1px solid rgba(255, 51, 102, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 0 16px rgba(255, 51, 102, 0.25);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.brand-icon-box:hover {
  transform: scale(1.05);
  box-shadow: 0 0 24px rgba(255, 51, 102, 0.45);
}

.brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.brand-name {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-0);
  display: flex;
  align-items: center;
  gap: 2px;
}

.brand-name span {
  background: linear-gradient(135deg, var(--accent) 0%, #ff6b8b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 20px rgba(255, 51, 102, 0.3);
}

.brand-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--cyan-soft);
  color: var(--cyan);
  border: 1px solid rgba(0, 229, 255, 0.3);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.15);
}

.brand-tag::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: var(--cyan);
  box-shadow: 0 0 6px var(--cyan);
  animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

/* ── 9. Segmented Tool Dock (Raycast Style) ───────────────────────────────── */
.header-tools-segmented {
  display: flex;
  align-items: center;
  background: var(--bg-1);
  border: 1px solid var(--border);
  padding: 3px;
  border-radius: var(--radius-md);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
  gap: 2px;
}

.tool-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.tool-pill:hover {
  color: var(--text-0);
  background: var(--bg-2);
}

.tool-pill.active {
  color: #ffffff;
  background: linear-gradient(180deg, rgba(255, 51, 102, 0.24) 0%, rgba(255, 51, 102, 0.1) 100%);
  border: 1px solid rgba(255, 51, 102, 0.4);
  box-shadow: 0 0 16px rgba(255, 51, 102, 0.25);
}

[data-theme="light-studio"] .tool-pill.active {
  color: var(--accent);
  background: rgba(225, 29, 72, 0.08);
  border: 1px solid rgba(225, 29, 72, 0.3);
}

/* ── 10. Header Controls (Right Section) ─────────────────────────────────── */
.header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.control-group {
  display: flex;
  align-items: center;
}

.divider {
  width: 1px;
  height: 22px;
  background: var(--border);
  margin: 0 4px;
}

/* Dropdown Selects */
.select-dropdown {
  height: 32px;
  padding: 0 28px 0 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-1);
  color: var(--text-0);
  border: 1px solid var(--border);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  transition: all var(--transition-fast);
}

.select-dropdown:hover {
  border-color: var(--border-hover);
  background-color: var(--bg-2);
}

.select-dropdown:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px var(--cyan-soft);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-sm {
  height: 32px;
  padding: 0 12px;
  font-size: 12.5px;
}

.btn-md {
  height: 38px;
  padding: 0 16px;
  font-size: 13.5px;
}

.btn-lg {
  height: 44px;
  padding: 0 20px;
  font-size: 14px;
}

/* Button Variants */
.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, #e11d48 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 2px 10px rgba(255, 51, 102, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-hover) 0%, #be123c 100%);
  box-shadow: 0 4px 18px rgba(255, 51, 102, 0.5);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-outline {
  background: var(--bg-1);
  color: var(--text-0);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  background: var(--bg-2);
  border-color: var(--border-hover);
  color: var(--text-0);
}

.btn-accent {
  background: var(--cyan-soft);
  color: var(--cyan);
  border: 1px solid rgba(0, 229, 255, 0.3);
}

.btn-accent:hover {
  background: rgba(0, 229, 255, 0.2);
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.35);
  transform: translateY(-1px);
}

.btn-success {
  background: var(--green-soft);
  color: var(--green);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
  background: rgba(16, 185, 129, 0.22);
}

.btn-warning {
  background: var(--amber-soft);
  color: var(--amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.btn-warning:hover {
  background: rgba(245, 158, 11, 0.22);
}

.btn-icon-only {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: var(--radius-sm);
  background: var(--bg-1);
  border: 1px solid var(--border);
  color: var(--text-1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-icon-only:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

/* ── 11. Search Toolbar & Command Dock ─────────────────────────────────────── */
.toolbar {
  height: 48px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: var(--bg-1);
  border-bottom: 1px solid var(--border);
  gap: 16px;
  z-index: 40;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  max-width: 600px;
}

.search-icon {
  font-size: 14px;
  color: var(--text-2);
  user-select: none;
}

.search-box input[type="text"] {
  flex: 1;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-0);
  border: 1px solid var(--border);
  color: var(--text-0);
  font-family: inherit;
  font-size: 13px;
  transition: all var(--transition-fast);
}

.search-box input[type="text"]:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px var(--cyan-soft), 0 0 12px rgba(0, 229, 255, 0.15);
}

.search-box input[type="text"]::placeholder {
  color: var(--text-2);
}

/* Toggles & Checkboxes */
.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  border: 1px solid var(--border);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-1);
  cursor: pointer;
  user-select: none;
  transition: all var(--transition-fast);
}

.checkbox-label:hover {
  border-color: var(--border-hover);
  color: var(--text-0);
}

.checkbox-label input[type="checkbox"] {
  cursor: pointer;
  accent-color: var(--cyan);
}

.search-stats {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  padding: 0 8px;
  white-space: nowrap;
  font-family: 'JetBrains Mono', monospace;
}

.nav-buttons {
  display: flex;
  gap: 4px;
}

.btn-nav {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text-1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-nav:hover:not(:disabled) {
  background: var(--bg-3);
  color: var(--text-0);
  border-color: var(--border-hover);
}

.btn-nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Fold Controls */
.fold-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-fold {
  height: 28px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text-1);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-fold:hover {
  background: var(--bg-3);
  color: var(--text-0);
  border-color: var(--border-hover);
}

[data-theme="light-studio"] .btn-fold {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #475569;
}

[data-theme="light-studio"] .btn-fold:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* Stats Bar */
.stats-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.stat-item {
  font-size: 12px;
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.stat-item strong {
  color: var(--text-0);
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
}

.wasm-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  background: var(--green-soft);
  color: var(--green);
  border: 1px solid rgba(16, 185, 129, 0.25);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.12);
}

.wasm-status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--green);
  box-shadow: 0 0 6px var(--green);
}

/* ── 12. Main Workspace ───────────────────────────────────────────────────── */
.workspace {
  position: relative;
  flex: 1;
  display: flex;
  overflow: hidden;
  background: var(--bg-0);
}

/* ── 13. Paste / Drop Overlay (Cyber-Pro Command Center Hero) ─────────────── */
.paste-overlay {
  position: absolute;
  inset: 0;
  background: rgba(7, 8, 11, 0.88);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 30;
  overflow-y: auto;
  transition: opacity var(--transition-smooth), visibility var(--transition-smooth);
}

.paste-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.drop-zone {
  width: 100%;
  max-width: 860px;
  background: linear-gradient(180deg, rgba(16, 20, 29, 0.95) 0%, rgba(10, 13, 19, 0.98) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 36px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 
    0 25px 60px -15px rgba(0, 0, 0, 0.8),
    0 0 40px -10px rgba(255, 51, 102, 0.12),
    0 0 60px -15px rgba(0, 229, 255, 0.08);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-smooth);
}

/* Subtle top edge glowing highlight */
.drop-zone::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 51, 102, 0.6), rgba(0, 229, 255, 0.6), transparent);
}

.drop-zone.dragover {
  border-color: var(--cyan);
  box-shadow: 
    0 0 0 2px var(--cyan),
    0 30px 80px rgba(0, 229, 255, 0.25);
  transform: scale(1.01);
}

/* Command Window Top Bar */
.drop-window-bar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.window-dots {
  display: flex;
  gap: 6px;
}

.window-dots .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot-red { background-color: #ff5f56; }
.dot-yellow { background-color: #ffbd2e; }
.dot-green { background-color: #27c93f; }

.window-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.04em;
}

.window-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--cyan);
  background: var(--cyan-soft);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(0, 229, 255, 0.25);
}

/* Hero Badge */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: var(--accent-soft);
  border: 1px solid rgba(255, 51, 102, 0.3);
  color: var(--accent-text);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.drop-icon {
  font-size: 42px;
  margin-bottom: 8px;
  filter: drop-shadow(0 0 16px rgba(255, 51, 102, 0.4));
  animation: floatHeart 3s ease-in-out infinite;
}

@keyframes floatHeart {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.drop-zone h2 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-0);
  margin-bottom: 8px;
}

.drop-zone h2 span {
  background: linear-gradient(135deg, var(--accent) 0%, #ff6b8b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.drop-zone p {
  color: var(--text-1);
  font-size: 14px;
  max-width: 580px;
  margin-bottom: 18px;
  line-height: 1.6;
}

.drop-zone p strong {
  color: var(--text-0);
}

/* Feature Tag Badges */
.feature-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 22px;
}

.feature-pill {
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text-1);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Code Textarea Wrapper */
.paste-textarea-wrapper {
  width: 100%;
  position: relative;
  margin-bottom: 20px;
}

.paste-textarea {
  width: 100%;
  height: 150px;
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  color: var(--text-0);
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
  transition: all var(--transition-fast);
}

.paste-textarea:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px var(--cyan-soft), 0 0 16px rgba(0, 229, 255, 0.15);
}

.paste-textarea::placeholder {
  color: var(--text-2);
}

.paste-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  flex-wrap: wrap;
}

kbd {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text-1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* ── 14. Code Viewer & Line Numbers ───────────────────────────────────────── */
.editor-container {
  display: flex;
  flex: 1;
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
  background: var(--bg-0);
}

.line-numbers {
  min-width: 64px;
  width: auto;
  flex-shrink: 0;
  padding: 16px 8px 16px 4px;
  background: var(--line-num-bg);
  border-right: 1px solid var(--line-num-border);
  color: var(--line-num-color);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 22px;
  user-select: none;
  overflow: hidden;
}

.line-num {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 22px;
  line-height: 22px;
  box-sizing: border-box;
  user-select: none;
}

.line-num .ln-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--line-num-color);
  min-width: 28px;
  text-align: right;
}

.line-num .fold-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-right: 4px;
  font-size: 8px;
  color: var(--text-2);
  cursor: pointer;
  border-radius: 3px;
  transition: transform 0.15s ease, color 0.15s ease, background 0.15s ease;
  flex-shrink: 0;
}

.line-num .fold-btn:hover {
  color: var(--cyan);
  background: var(--bg-2);
}

.line-num .fold-btn.collapsed {
  transform: rotate(-90deg);
  color: var(--amber);
}

.line-num .fold-spacer {
  width: 16px;
  margin-right: 4px;
  flex-shrink: 0;
}

.code-viewport {
  flex: 1;
  height: 100%;
  overflow: auto;
  padding: 16px 20px;
}

.code-output {
  margin: 0;
  font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
  font-size: 13px;
  line-height: 22px;
  color: var(--text-0);
  white-space: pre;
  tab-size: 2;
}

.code-line {
  display: block;
  height: 22px;
  line-height: 22px;
  white-space: pre;
  box-sizing: border-box;
}

.fold-pill-container {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}

.fold-pill {
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  margin: 0 4px;
  height: 18px;
  line-height: 18px;
  font-size: 11px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--cyan);
  cursor: pointer;
  user-select: none;
  transition: all var(--transition-fast);
}

.fold-pill:hover {
  background: var(--cyan-soft);
  border-color: var(--cyan);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
}

.fold-suffix {
  color: var(--syn-punct);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 500;
}

/* ── Color Grading for Collapsible Depth Levels ─────────────────────────── */
/* Depth 0 (Root Level) - Electric Coral */
.depth-0 {
  --depth-color: #ff3366;
  --depth-soft: rgba(255, 51, 102, 0.12);
  --depth-border: rgba(255, 51, 102, 0.35);
  --depth-glow: 0 0 10px rgba(255, 51, 102, 0.3);
}

/* Depth 1 (Top-Level Subproperties) - Neon Sky / Cyan */
.depth-1 {
  --depth-color: #38bdf8;
  --depth-soft: rgba(56, 189, 248, 0.12);
  --depth-border: rgba(56, 189, 248, 0.35);
  --depth-glow: 0 0 10px rgba(56, 189, 248, 0.3);
}

/* Depth 2 (Sub-sub properties / Array items) - Emerald Green */
.depth-2 {
  --depth-color: #34d399;
  --depth-soft: rgba(52, 211, 153, 0.12);
  --depth-border: rgba(52, 211, 153, 0.35);
  --depth-glow: 0 0 10px rgba(52, 211, 153, 0.3);
}

/* Depth 3 (Nested Object/Array level 3) - Radiant Amber */
.depth-3 {
  --depth-color: #fbbf24;
  --depth-soft: rgba(251, 191, 36, 0.12);
  --depth-border: rgba(251, 191, 36, 0.35);
  --depth-glow: 0 0 10px rgba(251, 191, 36, 0.3);
}

/* Depth 4 (Deep nesting level 4) - Electric Violet */
.depth-4 {
  --depth-color: #c084fc;
  --depth-soft: rgba(192, 132, 252, 0.12);
  --depth-border: rgba(192, 132, 252, 0.35);
  --depth-glow: 0 0 10px rgba(192, 132, 252, 0.3);
}

/* Depth 5 (Deep nesting level 5+) - Hot Pink */
.depth-5 {
  --depth-color: #f472b6;
  --depth-soft: rgba(244, 114, 182, 0.12);
  --depth-border: rgba(244, 114, 182, 0.35);
  --depth-glow: 0 0 10px rgba(244, 114, 182, 0.3);
}

/* Light Studio Theme Palette Adaptations */
[data-theme="light-studio"] .depth-0 {
  --depth-color: #e11d48;
  --depth-soft: rgba(225, 29, 72, 0.08);
  --depth-border: rgba(225, 29, 72, 0.3);
  --depth-glow: 0 0 8px rgba(225, 29, 72, 0.2);
}

[data-theme="light-studio"] .depth-1 {
  --depth-color: #0284c7;
  --depth-soft: rgba(2, 132, 199, 0.08);
  --depth-border: rgba(2, 132, 199, 0.3);
  --depth-glow: 0 0 8px rgba(2, 132, 199, 0.2);
}

[data-theme="light-studio"] .depth-2 {
  --depth-color: #15803d;
  --depth-soft: rgba(21, 128, 61, 0.08);
  --depth-border: rgba(21, 128, 61, 0.3);
  --depth-glow: 0 0 8px rgba(21, 128, 61, 0.2);
}

[data-theme="light-studio"] .depth-3 {
  --depth-color: #b45309;
  --depth-soft: rgba(180, 83, 9, 0.08);
  --depth-border: rgba(180, 83, 9, 0.3);
  --depth-glow: 0 0 8px rgba(180, 83, 9, 0.2);
}

[data-theme="light-studio"] .depth-4 {
  --depth-color: #7c3aed;
  --depth-soft: rgba(124, 58, 237, 0.08);
  --depth-border: rgba(124, 58, 237, 0.3);
  --depth-glow: 0 0 8px rgba(124, 58, 237, 0.2);
}

[data-theme="light-studio"] .depth-5 {
  --depth-color: #db2777;
  --depth-soft: rgba(219, 39, 119, 0.08);
  --depth-border: rgba(219, 39, 119, 0.3);
  --depth-glow: 0 0 8px rgba(219, 39, 119, 0.2);
}

/* Styled Fold Button with Depth Colors */
.fold-btn {
  color: var(--depth-color) !important;
}

.fold-btn:hover {
  background: var(--depth-soft) !important;
  color: var(--depth-color) !important;
  box-shadow: var(--depth-glow);
}

.fold-btn.collapsed {
  transform: rotate(-90deg);
  color: var(--depth-color) !important;
  box-shadow: var(--depth-glow);
}

/* Styled Fold Pill with Depth Colors */
.fold-pill {
  background: var(--depth-soft) !important;
  color: var(--depth-color) !important;
  border-color: var(--depth-border) !important;
  box-shadow: var(--depth-glow);
}

.fold-pill:hover {
  background: var(--depth-color) !important;
  color: #ffffff !important;
}

/* Collapsed Row Highlight with Color Grading */
.code-line.is-collapsed {
  background: linear-gradient(90deg, var(--depth-soft) 0%, transparent 80%);
  border-left: 3px solid var(--depth-color);
  padding-left: 2px;
}

.line-num.is-collapsed {
  background: var(--depth-soft);
}

/* Syntax Highlighting */
.json-key {
  color: var(--syn-key);
  font-weight: 600;
}

.json-string {
  color: var(--syn-string);
}

.json-number {
  color: var(--syn-number);
  font-weight: 500;
}

.json-boolean {
  color: var(--syn-boolean);
  font-weight: 600;
}

.json-null {
  color: var(--syn-null);
  font-weight: 500;
  font-style: italic;
}

/* Search Matches */
.search-match {
  background-color: var(--search-match-bg);
  border-radius: 3px;
  padding: 1px 2px;
  box-shadow: 0 0 6px var(--search-match-bg);
}

.search-match.match-active {
  background-color: var(--search-match-active);
  color: #000000;
  font-weight: 700;
  box-shadow: 0 0 16px var(--search-match-active);
}

/* ── 15. Modals (Diff, Snip, XML) ─────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 9, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-smooth);
}

.modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  width: 100%;
  max-width: 720px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: 
    0 25px 60px rgba(0, 0, 0, 0.7),
    0 0 35px rgba(0, 229, 255, 0.12);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  transform: scale(0.96);
  transition: transform var(--transition-smooth);
}

.modal-backdrop.open .modal-card {
  transform: scale(1);
}

.modal-header {
  height: 56px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: var(--bg-glass);
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-0);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-1);
  font-size: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--bg-2);
  color: var(--text-0);
  border-color: var(--border);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.snip-instruction {
  font-size: 13.5px;
  color: var(--text-1);
  line-height: 1.5;
}

/* Snip Form */
.snip-inputs {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  background: var(--bg-0);
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.input-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-field label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-1);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.input-field input[type="number"],
.input-field input[type="text"] {
  height: 34px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-1);
  border: 1px solid var(--border);
  color: var(--text-0);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  width: 120px;
}

.input-field input:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px var(--cyan-soft);
}

/* Snippet Preview Box */
.snippet-preview-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.preview-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-0);
}

.snip-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.badge-valid {
  background: var(--green-soft);
  color: var(--green);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-invalid {
  background: var(--red-soft);
  color: var(--red);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.preview-actions {
  display: flex;
  gap: 6px;
}

.snip-suggestion-note {
  font-size: 12.5px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--amber-soft);
  color: var(--amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.snip-suggestion-note.hidden {
  display: none;
}

.snippet-textarea {
  width: 100%;
  height: 180px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  color: var(--text-0);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  line-height: 1.5;
  resize: vertical;
}

.snippet-formatted-view {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  max-height: 200px;
  overflow: auto;
}

/* ── 16. Compare / Diff System ────────────────────────────────────────────── */
.diff-inputs-grid {
  display: flex;
  gap: 16px;
  width: 100%;
}

.diff-error-alert {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--red-soft);
  color: var(--red);
  border: 1px solid rgba(239, 68, 68, 0.3);
  font-size: 12.5px;
  line-height: 1.5;
}

.diff-error-alert.hidden {
  display: none;
}

.diff-actions-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.diff-actions-group .hidden {
  display: none;
}

.diff-split-container {
  display: flex;
  gap: 12px;
  width: 100%;
  height: 380px;
  overflow: hidden;
}

.diff-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-1);
  overflow: hidden;
}

.diff-pane-title {
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  color: var(--text-1);
}

.diff-code-viewport {
  flex: 1;
  overflow: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  line-height: 1.5;
}

.diff-row {
  display: flex;
  min-width: max-content;
  border-bottom: 1px solid transparent;
}

.diff-row .ln {
  width: 44px;
  padding: 2px 8px;
  text-align: right;
  color: var(--line-num-color);
  background: var(--bg-0);
  border-right: 1px solid var(--border-subtle);
  user-select: none;
  flex-shrink: 0;
}

.diff-row .txt {
  padding: 2px 8px;
  white-space: pre;
  flex: 1;
}

/* Diff Highlight States */
.diff-line-same {
  color: var(--text-1);
}

.diff-line-added {
  background-color: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.diff-line-added .ln {
  background-color: rgba(16, 185, 129, 0.22);
  color: #10b981;
}

.diff-line-removed {
  background-color: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.diff-line-removed .ln {
  background-color: rgba(239, 68, 68, 0.22);
  color: #ef4444;
}

.diff-line-modified {
  background-color: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

.diff-line-modified .ln {
  background-color: rgba(245, 158, 11, 0.22);
  color: #f59e0b;
}

/* ── 17. Toast Notifications ──────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-glass-strong);
  border: 1px solid rgba(0, 229, 255, 0.35);
  color: #ffffff;
  padding: 10px 22px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 
    0 10px 30px rgba(0, 0, 0, 0.6),
    0 0 20px rgba(0, 229, 255, 0.25);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition-smooth);
  z-index: 200;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ── 18. Scrollbar Polish ─────────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.22);
}

[data-theme="light-studio"] ::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
}

[data-theme="light-studio"] ::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.25);
}

/* ── 18b. Light Studio & Light System Component Refinements ───────────────── */
[data-theme="light-studio"] .paste-overlay {
  background: rgba(248, 250, 252, 0.92);
}

[data-theme="light-studio"] .drop-zone {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: 
    0 20px 45px -10px rgba(15, 23, 42, 0.08),
    0 0 0 1px rgba(15, 23, 42, 0.04);
}

[data-theme="light-studio"] .drop-zone::before {
  background: linear-gradient(90deg, transparent, rgba(225, 29, 72, 0.4), rgba(2, 132, 199, 0.4), transparent);
}

[data-theme="light-studio"] .drop-window-bar {
  border-bottom-color: rgba(15, 23, 42, 0.06);
}

[data-theme="light-studio"] .paste-textarea {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #0f172a;
}

[data-theme="light-studio"] .paste-textarea:focus {
  background: #ffffff;
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15);
}

[data-theme="light-studio"] .top-header {
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
}

[data-theme="light-studio"] .header-tools-segmented {
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

[data-theme="light-studio"] .modal-backdrop {
  background: rgba(15, 23, 42, 0.45);
}

[data-theme="light-studio"] .modal-card {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.12);
}

[data-theme="light-studio"] .modal-header {
  background: rgba(255, 255, 255, 0.9);
}

[data-theme="light-studio"] .snip-inputs,
[data-theme="light-studio"] .snippet-preview-container {
  background: #f8fafc;
  border-color: #e2e8f0;
}

[data-theme="light-studio"] .snippet-textarea,
[data-theme="light-studio"] .snippet-formatted-view {
  background: #ffffff;
  border-color: #e2e8f0;
}

[data-theme="light-studio"] .toast {
  background: #0f172a;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

[data-theme="light-studio"] .diff-row .ln {
  background: #f1f5f9;
  border-right-color: #e2e8f0;
  color: #64748b;
}

[data-theme="light-studio"] .diff-line-same {
  color: #334155;
}

[data-theme="light-studio"] .diff-line-added {
  background-color: rgba(21, 128, 61, 0.1);
  color: #15803d;
}

[data-theme="light-studio"] .diff-line-added .ln {
  background-color: rgba(21, 128, 61, 0.18);
  color: #15803d;
}

[data-theme="light-studio"] .diff-line-removed {
  background-color: rgba(225, 29, 72, 0.1);
  color: #be123c;
}

[data-theme="light-studio"] .diff-line-removed .ln {
  background-color: rgba(225, 29, 72, 0.18);
  color: #be123c;
}

[data-theme="light-studio"] .diff-line-modified {
  background-color: rgba(217, 119, 6, 0.1);
  color: #b45309;
}

[data-theme="light-studio"] .diff-line-modified .ln {
  background-color: rgba(217, 119, 6, 0.18);
  color: #b45309;
}

/* ── 19. Responsive Adjustments ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .top-header {
    height: auto;
    padding: 12px 16px;
    flex-wrap: wrap;
  }
  
  .header-tools-segmented {
    order: 3;
    width: 100%;
    justify-content: center;
    margin-top: 4px;
  }

  .toolbar {
    height: auto;
    padding: 10px 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .search-box {
    max-width: 100%;
  }

  .stats-bar {
    justify-content: space-between;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .diff-inputs-grid {
    flex-direction: column;
  }

  .diff-split-container {
    flex-direction: column;
    height: 500px;
  }
}
