    /* ══════════════════════════════════════════════════════════════
       RESET + TOKENS
    ══════════════════════════════════════════════════════════════ */
    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

    /* Tokens inherited from tokens.css — no overrides needed */

    /* Screen reader only — visually hidden but accessible */
    .sr-only {
      position: absolute; width: 1px; height: 1px;
      padding: 0; margin: -1px; overflow: hidden;
      clip: rect(0,0,0,0); white-space: nowrap; border: 0;
    }


    html { scroll-behavior: smooth; }

    body {
      background: var(--bg);
      color: var(--text);
      font-family: var(--font-brand);
      overflow-x: hidden;
      min-height: 100vh;
      cursor: default;
    }

    body.app-mode {
      overflow: hidden;
      cursor: default;
    }

    /* ══════════════════════════════════════════════════════════════
       BACKGROUND ATMOSPHERE
    ══════════════════════════════════════════════════════════════ */
    body::before {
      content: '';
      position: fixed;
      inset: 0;
      background:
        radial-gradient(ellipse 80% 60% at 50% 30%,
          rgba(100, 50, 200, 0.07) 0%,
          transparent 70%),
        radial-gradient(ellipse 40% 30% at 50% 28%,
          rgba(123, 79, 255, 0.04) 0%,
          transparent 60%);
      pointer-events: none;
      z-index: 0;
    }

    /* ══════════════════════════════════════════════════════════════
       PAGE NAV
    ══════════════════════════════════════════════════════════════ */
    .page-nav {
      position: fixed;
      top: 0; left: 0; right: 0;
      z-index: 100;
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 22px 48px;
      transition: opacity 0.6s ease, transform 0.6s ease;
    }

    body.app-mode .page-nav {
      opacity: 0;
      pointer-events: none;
      transform: translateY(-20px);
    }

    .nav-brand {
      font-family: var(--font-mono);
      font-size: 13px;
      letter-spacing: 5px;
      color: rgba(255,255,255,0.7);
      text-transform: uppercase;
      text-decoration: none;
    }

    .nav-brand span {
      color: var(--accent);
    }

    .nav-links {
      display: flex;
      gap: 36px;
      list-style: none;
    }

    .nav-links a {
      font-family: var(--font-mono);
      font-size: 11px;
      letter-spacing: 2px;
      color: var(--text2);
      text-decoration: none;
      text-transform: uppercase;
      transition: color 0.2s;
    }

    .nav-links a:hover { color: var(--text); }

    .nav-auth {
      display: flex;
      align-items: center;
      gap: 12px;
      position: relative;
    }
    .nav-auth-btn {
      font-family: var(--font-mono);
      font-size: 10px;
      letter-spacing: 2px;
      text-transform: uppercase;
      padding: 6px 16px;
      border-radius: 3px;
      cursor: pointer;
      transition: all 0.2s;
      text-decoration: none;
      white-space: nowrap;
    }
    .nav-auth-btn.login {
      background: none;
      border: 1px solid var(--accent);
      color: var(--accent);
    }
    .nav-auth-btn.login:hover {
      background: var(--accent);
      color: #000;
    }
    .nav-auth-user {
      font-family: var(--font-mono);
      font-size: 10px;
      letter-spacing: 1px;
      color: var(--text2);
    }
    .nav-auth-user span {
      color: var(--accent);
    }
    .nav-auth-btn.logout {
      background: none;
      border: 1px solid #444;
      color: #666;
      font-size: 9px;
      padding: 4px 10px;
    }
    .nav-auth-btn.logout:hover {
      border-color: #888;
      color: #aaa;
    }

    /* Profile badge (logged-in nav) */
    .nav-profile-badge {
      width: 34px; height: 34px;
      border-radius: 50%;
      background: linear-gradient(135deg, var(--accent), #6a3de8);
      border: 2px solid rgba(139,92,246,0.4);
      display: flex; align-items: center; justify-content: center;
      cursor: pointer;
      transition: all 0.25s ease;
      padding: 0;
      position: relative;
    }
    .nav-profile-badge:hover {
      border-color: var(--accent);
      box-shadow: 0 0 12px rgba(139,92,246,0.4);
      transform: scale(1.08);
    }
    .nav-profile-initial {
      font-family: var(--font-mono);
      font-size: 13px;
      font-weight: 700;
      color: #fff;
      letter-spacing: 0;
      line-height: 1;
      text-transform: uppercase;
    }
    .nav-profile-dropdown {
      position: absolute;
      top: calc(100% + 8px);
      right: 0;
      min-width: 200px;
      background: #1a1a2e;
      border: 1px solid rgba(139,92,246,0.3);
      border-radius: 8px;
      padding: 12px 0;
      box-shadow: 0 8px 32px rgba(0,0,0,0.6);
      z-index: 9999;
      animation: dropIn 0.15s ease-out;
    }
    @keyframes dropIn {
      from { opacity: 0; transform: translateY(-6px); }
      to   { opacity: 1; transform: translateY(0); }
    }
    .nav-profile-name {
      font-family: var(--font-mono);
      font-size: 12px;
      font-weight: 600;
      color: #eee;
      padding: 4px 16px 0;
      letter-spacing: 0.5px;
    }
    .nav-profile-email {
      font-family: var(--font-mono);
      font-size: 10px;
      color: var(--text2);
      padding: 2px 16px 8px;
      letter-spacing: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .nav-profile-divider {
      height: 1px;
      background: rgba(139,92,246,0.15);
      margin: 4px 0;
    }
    .nav-profile-item {
      display: block;
      width: 100%;
      text-align: left;
      background: none;
      border: none;
      font-family: var(--font-mono);
      font-size: 11px;
      letter-spacing: 1px;
      color: #aaa;
      padding: 8px 16px;
      cursor: pointer;
      transition: all 0.15s;
    }
    .nav-profile-item:hover {
      background: rgba(139,92,246,0.1);
      color: var(--accent);
    }
    .nav-profile-logout {
      color: #e55;
    }
    .nav-profile-logout:hover {
      color: #f66;
      background: rgba(255,50,50,0.08);
    }

    /* ══════════════════════════════════════════════════════════════
       INTERACTIVE BUILDER MODE (inside CRT monitor)
    ══════════════════════════════════════════════════════════════ */
    .builder-mode {
      position: absolute;
      inset: 0;
      z-index: 15;
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }
    .builder-mode .pd-root {
      display: flex;
      flex-direction: column;
      width: 100%;
      height: 100%;
      background: transparent;
    }
    .builder-mode .pd-canvas-wrap {
      flex: 1;
      overflow: hidden;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .builder-mode .pd-palette {
      padding: 4px 8px;
      gap: 4px;
      flex-shrink: 0;
      background: rgba(7,5,15,0.85);
      border-bottom: 1px solid rgba(139,92,246,0.15);
    }
    .builder-mode .pd-palette-btn {
      font-size: 9px;
      padding: 3px 8px;
    }
    .builder-mode .pd-toolbar {
      padding: 3px 8px;
      gap: 4px;
      flex-shrink: 0;
      background: rgba(7,5,15,0.85);
      border-bottom: 1px solid rgba(139,92,246,0.1);
    }
    .builder-mode .pd-inspector { display: none; }
    .builder-mode .pd-chat-bar  { display: none; }
    .builder-mode .pd-status     { display: none; }

    /* ══════════════════════════════════════════════════════════════
       HELP TOOLKIT
    ══════════════════════════════════════════════════════════════ */
    .help-fab {
      position: fixed; bottom: 28px; right: 28px; z-index: 500;
      width: 52px; height: 52px; border-radius: 50%;
      background: linear-gradient(135deg, rgba(123,79,255,0.85), rgba(74,255,204,0.7));
      border: 1.5px solid rgba(180,138,255,0.4);
      color: #fff; font-size: 22px; cursor: pointer;
      display: flex; align-items: center; justify-content: center;
      box-shadow: 0 4px 20px rgba(123,79,255,0.25), 0 0 40px rgba(74,255,204,0.08);
      transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
      animation: help-breathe 4s ease-in-out infinite;
    }
    .help-fab:hover {
      transform: scale(1.1);
      box-shadow: 0 6px 28px rgba(123,79,255,0.45), 0 0 50px rgba(74,255,204,0.15);
    }
    .help-fab.open { background: rgba(60,60,60,0.9); animation: none; transform: rotate(45deg); }
    .help-fab.nudge {
      animation: help-nudge 0.6s ease-in-out 3;
      box-shadow: 0 4px 24px rgba(255,170,68,0.4), 0 0 40px rgba(255,170,68,0.12);
    }
    @keyframes help-nudge {
      0%, 100% { transform: scale(1); }
      25% { transform: scale(1.15) rotate(-5deg); }
      75% { transform: scale(1.15) rotate(5deg); }
    }
    @keyframes help-breathe {
      0%, 100% { box-shadow: 0 4px 20px rgba(123,79,255,0.25); }
      50%      { box-shadow: 0 4px 28px rgba(123,79,255,0.4), 0 0 50px rgba(74,255,204,0.12); }
    }

    .help-drawer {
      position: fixed; bottom: 92px; right: 28px; z-index: 499;
      width: 340px; max-height: 480px;
      background: rgba(18,14,28,0.97);
      border: 1px solid rgba(180,138,255,0.2);
      border-radius: 12px;
      box-shadow: 0 12px 48px rgba(0,0,0,0.6), 0 0 60px rgba(123,79,255,0.08);
      backdrop-filter: blur(20px);
      transform: translateY(16px) scale(0.95);
      opacity: 0; pointer-events: none;
      transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
      display: flex; flex-direction: column;
      overflow: hidden;
    }
    .help-drawer.open {
      transform: translateY(0) scale(1);
      opacity: 1; pointer-events: auto;
    }
    .help-drawer-header {
      padding: 16px 18px 12px;
      border-bottom: 1px solid rgba(180,138,255,0.1);
      font-size: 12px; letter-spacing: 2px;
      color: #b48aff; font-weight: bold;
    }
    .help-drawer-body {
      padding: 12px 18px 16px;
      overflow-y: auto; flex: 1;
      scrollbar-width: thin;
      scrollbar-color: rgba(180,138,255,0.2) transparent;
    }
    .help-section {
      margin-bottom: 14px;
    }
    .help-section-title {
      font-size: 10px; letter-spacing: 1.5px;
      color: #4affcc; margin-bottom: 6px;
      text-transform: uppercase;
    }
    .help-item {
      display: flex; align-items: flex-start; gap: 8px;
      padding: 8px 10px; margin-bottom: 4px;
      border-radius: 6px; cursor: pointer;
      transition: background 0.2s;
      font-size: 11px; color: rgba(224,214,200,0.85);
      line-height: 1.4;
    }
    .help-item:hover { background: rgba(180,138,255,0.08); }
    .help-item-icon { font-size: 14px; flex-shrink: 0; margin-top: 1px; }
    .help-item-text strong { color: #e0d6c8; display: block; margin-bottom: 1px; }
    .help-item-text span { color: rgba(224,214,200,0.5); font-size: 10px; }
    .help-context-badge {
      display: inline-block; padding: 2px 8px;
      background: rgba(74,255,204,0.08); border: 1px solid rgba(74,255,204,0.2);
      border-radius: 10px; font-size: 9px; color: #4affcc;
      letter-spacing: 0.5px; margin-left: 8px;
    }
    .help-shortcut {
      display: inline-block; padding: 1px 5px;
      background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12);
      border-radius: 3px; font-size: 9px; color: rgba(255,255,255,0.4);
      font-family: monospace; margin-left: auto;
    }
    @media (max-width: 480px) {
      .help-drawer { width: calc(100vw - 24px); right: 12px; bottom: 80px; }
      .help-fab { bottom: 20px; right: 16px; width: 46px; height: 46px; font-size: 18px; }
    }

    /* ══════════════════════════════════════════════════════════════
       LANDING HERO
    ══════════════════════════════════════════════════════════════ */
    .landing-hero {
      position: relative;
      z-index: 1;
      min-height: 100vh;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 120px 24px 80px;
      transition: opacity 0.8s ease;
    }

    body.app-mode .landing-hero {
      pointer-events: none;
    }

    .monitor-wrap {
      position: relative;
      width: min(560px, 90vw);
      transition:
        width 0.9s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.9s cubic-bezier(0.4, 0, 0.2, 1);
      cursor: pointer;
    }

    body.app-mode .monitor-wrap {
      width: min(900px, 95vw);
      transform: none;
    }

    .monitor-wrap::after {
      content: '';
      position: absolute;
      bottom: -24px;
      left: 50%;
      transform: translateX(-50%);
      width: 85%;
      height: 40px;
      background: radial-gradient(ellipse at center,
        rgba(100, 60, 200, 0.12) 0%,
        transparent 70%
      );
      filter: blur(8px);
      pointer-events: none;
      transition: opacity 0.6s ease;
    }

    body.app-mode .monitor-wrap::after { opacity: 0; }

    .hero-copy {
      text-align: left;
      margin-top: 40px;
      max-width: 680px;
      width: 100%;
      transition: opacity 0.5s ease, transform 0.5s ease;
      position: relative;
    }

    .hero-copy::before {
      content: '';
      position: absolute;
      top: -40px;
      left: 50%;
      transform: translateX(-50%);
      width: 1px;
      height: 36px;
      background: linear-gradient(to bottom,
        rgba(123, 79, 255, 0.4),
        rgba(123, 79, 255, 0.08)
      );
    }

    body.app-mode .hero-copy {
      opacity: 0;
      pointer-events: none;
      transform: translateY(16px);
      position: absolute;
    }

    .hero-line {
      display: flex;
      align-items: flex-start;
      gap: 12px;
      margin-bottom: 6px;
    }

    .hero-prompt {
      font-family: var(--font-terminal);
      font-size: clamp(18px, 3vw, 28px);
      color: var(--accent2);
      text-shadow: 0 0 8px rgba(74, 255, 204, 0.5);
      flex-shrink: 0;
      line-height: 1.2;
      user-select: none;
      opacity: 0.7;
    }

    .hero-tagline {
      font-family: var(--font-terminal);
      font-size: clamp(13px, 1.8vw, 16px);
      letter-spacing: 3px;
      text-transform: uppercase;
      color: var(--accent-dim-legacy);
      text-shadow: 0 0 6px rgba(90, 58, 153, 0.4);
      border-bottom: 1px solid rgba(90, 58, 153, 0.3);
      padding-bottom: 4px;
      display: inline-block;
    }

    .hero-h1 {
      font-family: var(--font-terminal);
      font-size: clamp(34px, 6vw, 62px);
      font-weight: 400;
      line-height: 1.12;
      color: var(--accent-hot-legacy);
      text-shadow: 0 0 30px rgba(232, 213, 255, 0.6);
      letter-spacing: 2px;
    }

    .hero-h1 em {
      font-style: normal;
      color: var(--accent);
      text-shadow: 0 0 30px rgba(123, 79, 255, 0.7);
    }

    .hero-sub {
      font-family: var(--font-terminal);
      font-size: clamp(16px, 2.2vw, 21px);
      line-height: 1.5;
      color: var(--accent);
      text-shadow: 0 0 6px rgba(180, 138, 255, 0.3);
      opacity: 0.6;
      margin-top: 4px;
      max-width: 620px;
    }

    .scope-bg {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      z-index: 0;
      width: 100vw;
      height: 60vh;
      pointer-events: none;
      opacity: 1;
    }

    .hero-spacer {
      height: 28px;
    }

    .hero-cta {
      display: inline-flex;
      align-items: center;
      gap: 10px;
      font-family: var(--font-terminal);
      font-size: clamp(18px, 2.5vw, 24px);
      letter-spacing: 3px;
      color: var(--accent2);
      text-shadow: 0 0 8px rgba(74, 255, 204, 0.5);
      border: 1px solid rgba(74, 255, 204, 0.2);
      padding: 12px 28px;
      border-radius: 2px;
      background: rgba(74, 255, 204, 0.04);
      cursor: pointer;
      transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s, text-shadow 0.2s;
      text-transform: uppercase;
    }

    .hero-cta:hover {
      background: rgba(74, 255, 204, 0.08);
      border-color: rgba(74, 255, 204, 0.5);
      color: var(--accent2);
      text-shadow: 0 0 14px rgba(74, 255, 204, 0.8);
      box-shadow: 0 0 24px rgba(74, 255, 204, 0.12);
    }

    .cta-enter-icon {
      display: inline-block;
      opacity: 0.6;
      font-size: 0.85em;
    }

    .scroll-hint {
      position: absolute;
      bottom: 32px;
      left: 50%;
      transform: translateX(-50%);
      font-family: var(--font-mono);
      font-size: 10px;
      letter-spacing: 3px;
      color: var(--text2);
      text-transform: uppercase;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 8px;
      transition: opacity 0.5s;
      animation: float-hint 2.5s ease-in-out infinite;
    }

    body.app-mode .scroll-hint { opacity: 0; pointer-events: none; }

    @keyframes float-hint {
      0%, 100% { transform: translateX(-50%) translateY(0); }
      50%       { transform: translateX(-50%) translateY(-6px); }
    }

    .scroll-hint-arrow {
      width: 1px;
      height: 24px;
      background: linear-gradient(to bottom, var(--text2), transparent);
    }

    /* ══════════════════════════════════════════════════════════════
       MONITOR SHELL
    ══════════════════════════════════════════════════════════════ */
    .monitor {
      position: relative;
      background: var(--bg3);
      border-radius: 16px 16px 20px 20px;
      padding: 24px 24px 50px 24px;
      box-shadow:
        0 0 0 1px rgba(255,255,255,0.04),
        0 0 0 2px #0a0914,
        0 0 60px rgba(100, 60, 200, 0.18),
        0 40px 100px rgba(0,0,0,0.95),
        inset 0 1px 0 rgba(255,255,255,0.06);
      transition: box-shadow 0.6s ease;
    }

    body.app-mode .monitor {
      box-shadow:
        0 0 0 1px rgba(255,255,255,0.04),
        0 0 0 2px #0a0914,
        0 0 80px rgba(100, 60, 200, 0.25),
        0 40px 120px rgba(0,0,0,0.98),
        inset 0 1px 0 rgba(255,255,255,0.06);
    }

    .monitor::before {
      content: '';
      position: absolute;
      inset: 18px 18px 42px 18px;
      border-radius: 6px;
      box-shadow: inset 0 0 0 2px rgba(0,0,0,0.6), inset 0 0 24px rgba(0,0,0,0.7);
      pointer-events: none;
      z-index: 10;
    }

    .monitor::after {
      content: 'WEIRDMAKER';
      position: absolute;
      bottom: 16px;
      left: 50%;
      transform: translateX(-50%);
      font-family: var(--font-mono);
      font-size: 10px;
      letter-spacing: 6px;
      color: #1e1c30;
      text-transform: uppercase;
    }

    .screen {
      position: relative;
      width: 100%;
      min-height: 320px;
      height: 60vh;
      max-height: 600px;
      background: var(--bg2);
      border-radius: 4px / 6px;
      overflow: hidden;
    }

    .scanlines {
      position: absolute; inset: 0;
      background: repeating-linear-gradient(
        to bottom,
        transparent 0px, transparent 2px,
        rgba(0,0,0,0.15) 2px, rgba(0,0,0,0.15) 4px
      );
      pointer-events: none;
      z-index: 20;
    }

    .vignette {
      position: absolute; inset: 0;
      background: radial-gradient(ellipse at center,
        transparent 50%, rgba(0,0,0,0.6) 100%
      );
      pointer-events: none;
      z-index: 21;
    }

    .bloom {
      position: absolute; inset: 0;
      background: radial-gradient(ellipse at 50% 40%,
        rgba(130, 70, 255, 0.05) 0%, transparent 65%
      );
      pointer-events: none;
      z-index: 19;
    }

    @keyframes flicker {
      0%, 91%, 95%, 100% { opacity: 1; }
      92%, 94%            { opacity: 0.75; }
      93%                 { opacity: 1; }
    }
    .screen {
      animation: flicker 10s ease-in-out infinite;
      will-change: opacity;
    }

    /* ══════════════════════════════════════════════════════════════
       MONITOR IDLE + TERMINAL
    ══════════════════════════════════════════════════════════════ */
    .monitor-idle {
      position: absolute;
      inset: 0;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      z-index: 15;
      font-family: var(--font-terminal);
      transition: opacity 0.5s ease;
      padding: 24px;
    }

    body.app-mode .monitor-idle {
      opacity: 0;
      pointer-events: none;
    }

    .idle-logo {
      font-size: clamp(20px, 3.5vw, 32px);
      color: var(--accent-hot-legacy);
      text-shadow: 0 0 20px rgba(232,213,255,0.8);
      letter-spacing: 4px;
      margin-bottom: 4px;
    }

    .idle-version {
      font-size: clamp(10px, 1.5vw, 14px);
      color: var(--accent-dim-legacy);
      letter-spacing: 2px;
      margin-bottom: 24px;
    }

    .idle-separator {
      font-size: clamp(10px, 1.6vw, 15px);
      color: var(--accent-dim-legacy);
      opacity: 0.4;
      margin-bottom: 20px;
      letter-spacing: 0;
    }

    .idle-demo-text {
      font-size: clamp(12px, 2vw, 18px);
      color: var(--accent);
      text-shadow: 0 0 8px rgba(180,138,255,0.6);
      text-align: center;
      max-width: 85%;
      line-height: 1.5;
      min-height: 3.5em;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .idle-press {
      margin-top: 28px;
      font-size: clamp(13px, 2.2vw, 20px);
      color: var(--accent-hot-legacy);
      text-shadow: 0 0 14px rgba(232,213,255,0.9);
      letter-spacing: 3px;
      animation: idle-pulse 1.4s ease-in-out infinite;
      cursor: pointer;
      padding: 10px 24px;
      border: 1px solid rgba(232,213,255,0.15);
      border-radius: 3px;
      background: rgba(232,213,255,0.03);
      transition: background 0.2s, border-color 0.2s;
    }
    .idle-press:hover {
      background: rgba(232,213,255,0.08);
      border-color: rgba(232,213,255,0.4);
      animation: none;
      opacity: 1;
    }

    @keyframes idle-pulse {
      0%, 100% { opacity: 1; }
      50%       { opacity: 0.2; }
    }

    .terminal {
      position: absolute;
      inset: 0;
      padding: 18px 22px 14px 22px;
      display: flex;
      flex-direction: column;
      z-index: 16;
      overflow: hidden;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.4s ease 0.3s;
    }

    body.app-mode .terminal {
      opacity: 1;
      pointer-events: all;
    }

    #output {
      flex: 1;
      min-height: 0;
      overflow-y: auto;
      overflow-x: hidden;
      scrollbar-width: thin;
      scrollbar-color: rgba(124, 92, 255, 0.4) transparent;
      display: flex;
      flex-direction: column;
      padding-bottom: 8px;
      scroll-behavior: smooth;
    }
    /* Push content to bottom when terminal isn't full, allow scroll when it overflows */
    #output::before {
      content: '';
      flex: 1 1 auto;
    }
    #output::-webkit-scrollbar {
      width: 4px;
    }
    #output::-webkit-scrollbar-track {
      background: transparent;
    }
    #output::-webkit-scrollbar-thumb {
      background: rgba(124, 92, 255, 0.4);
      border-radius: 2px;
    }
    #output::-webkit-scrollbar-thumb:hover {
      background: rgba(124, 92, 255, 0.7);
    }

    .line {
      font-family: var(--font-terminal);
      font-size: clamp(13px, 2vw, 19px);
      line-height: 1.45;
      white-space: pre-wrap;
      word-break: break-word;
    }
    .line.system     { color: var(--accent2);       text-shadow: 0 0 8px rgba(74,255,204,0.6); }
    .line.system-dim { color: var(--accent2-dim-legacy);   text-shadow: none; }
    .line.ai         { color: var(--accent);     text-shadow: 0 0 10px rgba(180,138,255,0.7); }
    .line.user-echo  { color: var(--user);         text-shadow: 0 0 6px rgba(136,255,153,0.5); }
    .line.dim        { color: var(--accent-dim-legacy); text-shadow: none; }
    .line.hot        { color: var(--accent-hot-legacy); text-shadow: 0 0 14px rgba(232,213,255,0.9); }
    .line.spacer     { height: 0.7em; }
    .line.separator  { color: var(--accent-dim-legacy); opacity: 0.4; }
    .line.locked     { color: var(--hot); text-shadow: 0 0 12px rgba(255,61,107,0.6); }
    .line.token      { color: var(--accent2); text-shadow: 0 0 14px rgba(74,255,204,0.8); }

    /* ── WeirdOS v5 Tabbed Dashboard ── */
    .wos-dashboard {
      margin: 4px 0 8px;
      font-family: var(--font-terminal);
    }
    .wos-tab-bar {
      display: flex;
      gap: 0;
      margin-bottom: 2px;
    }
    .wos-tab {
      padding: 4px 12px;
      font-size: clamp(11px, 1.6vw, 13px);
      letter-spacing: 2px;
      color: var(--accent-dim-legacy, #4a4570);
      cursor: pointer;
      border-bottom: 2px solid transparent;
      transition: color 0.15s, border-color 0.15s;
      user-select: none;
    }
    .wos-tab:hover {
      color: var(--accent, #7c5cff);
    }
    .wos-tab.active {
      color: var(--accent, #b48aff);
      border-bottom-color: var(--accent, #7c5cff);
      text-shadow: 0 0 8px rgba(180,138,255,0.4);
    }
    .wos-tab-line {
      height: 1px;
      background: rgba(124,92,255,0.15);
      margin-bottom: 10px;
    }
    .wos-panel {
      display: none;
    }
    .wos-panel.active {
      display: block;
    }
    .wos-app {
      font-size: clamp(13px, 1.8vw, 15px);
      line-height: 2;
      color: var(--accent2, #4affc8);
      text-shadow: 0 0 4px rgba(74,255,204,0.2);
      cursor: pointer;
      padding: 0 4px;
      border-radius: 2px;
      transition: background 0.1s;
    }
    .wos-app:hover {
      background: rgba(74,255,204,0.06);
    }
    .wos-app--coming {
      opacity: 0.4;
      cursor: default;
    }
    .wos-icon {
      color: var(--accent, #7c5cff);
      margin-right: 6px;
    }
    .wos-name {
      display: inline-block;
      min-width: 14ch;
    }
    .wos-desc {
      color: var(--accent-dim-legacy, #6a5a8e);
      font-size: clamp(11px, 1.5vw, 13px);
      margin-left: 4px;
    }
    .wos-core {
      display: inline-block;
      background: rgba(124,92,255,0.15);
      color: var(--accent, #b48aff);
      font-size: 9px;
      padding: 1px 5px;
      border-radius: 3px;
      margin-left: 6px;
      letter-spacing: 1px;
      vertical-align: middle;
    }
    .wos-coming {
      color: var(--accent-dim-legacy, #4a4570);
      font-size: 11px;
    }
    .wos-count {
      color: var(--accent-dim-legacy, #4a4570);
      font-size: clamp(10px, 1.4vw, 12px);
      margin-top: 6px;
      padding-top: 4px;
      border-top: 1px solid rgba(124,92,255,0.08);
    }

    .input-row {
      margin: 0;
      padding: 0;
      width: 100%;
      font-family: var(--font-terminal);
      font-size: clamp(13px, 2vw, 19px);
      line-height: 1.45;
      white-space: pre-wrap;
      word-break: break-word;
    }

    .prompt-glyph {
      font-family: var(--font-terminal);
      color: var(--accent2);
      text-shadow: 0 0 8px rgba(74,255,204,0.7);
      font-size: clamp(13px, 2vw, 19px);
      line-height: 1.45;
      padding: 0;
      white-space: nowrap;
    }

    #input-body {
      font-family: var(--font-terminal);
      font-size: clamp(13px, 2vw, 19px);
      line-height: 1.45;
      color: var(--user);
      text-shadow: 0 0 6px rgba(136,255,153,0.5);
      word-break: break-word;
      white-space: pre-wrap;
      padding: 0;
      margin: 0;
    }

    #user-input-display {
      color: var(--user);
      text-shadow: 0 0 6px rgba(136,255,153,0.5);
    }

    /* ── Cursor / Typing Indicator ── */
    .cursor {
      display: inline-block;
      width: 0.55em;
      height: 1em;
      background: var(--accent);
      box-shadow: 0 0 8px rgba(180,138,255,0.9);
      vertical-align: text-bottom;
      animation: cursor-blink 1.1s step-end infinite;
      transition: width 0.2s, background 0.2s;
    }
    /* Default blink for user typing */
    @keyframes cursor-blink {
      0%, 100% { opacity: 1; }
      50%       { opacity: 0; }
    }
    /* AI thinking state — smooth pulse instead of blink */
    .cursor.thinking {
      width: 0.8em;
      background: var(--accent);
      box-shadow: 0 0 12px rgba(180,138,255,1), 0 0 24px rgba(123,79,255,0.5);
      animation: cursor-think 0.8s ease-in-out infinite;
    }
    @keyframes cursor-think {
      0%, 100% {
        opacity: 0.4;
        box-shadow: 0 0 8px rgba(180,138,255,0.6);
      }
      50% {
        opacity: 1;
        box-shadow: 0 0 16px rgba(180,138,255,1), 0 0 30px rgba(123,79,255,0.6);
      }
    }

    /* Animated thinking dots after rotating text */
    .thinking-dots {
      transition: opacity 0.15s ease;
    }
    .thinking-dots::after {
      content: '';
      animation: dots 1.4s steps(4, end) infinite;
    }
    @keyframes dots {
      0%   { content: ''; }
      25%  { content: '.'; }
      50%  { content: '..'; }
      75%  { content: '...'; }
      100% { content: ''; }
    }

    #real-input {
      position: absolute;
      opacity: 0;
      width: 1px; height: 1px;
      /* pointer-events kept auto so programmatic .focus() works reliably */
    }

    .power-led {
      position: absolute;
      bottom: 18px; right: 42px;
      width: 7px; height: 7px;
      border-radius: 50%;
      background: #1a0a40;
      transition: background 0.4s, box-shadow 0.4s;
    }
    .power-led.on {
      background: #9d5fff;
      box-shadow: 0 0 6px rgba(157,95,255,0.9);
    }

    .monitor-wrap:hover .monitor {
      box-shadow:
        0 0 0 1px rgba(255,255,255,0.06),
        0 0 0 2px #0a0914,
        0 0 80px rgba(123,79,255,0.28),
        0 40px 100px rgba(0,0,0,0.95),
        inset 0 1px 0 rgba(255,255,255,0.06);
    }

    body.app-mode .monitor-wrap { cursor: default; }
    body.app-mode .monitor-wrap:hover .monitor {
      box-shadow:
        0 0 0 1px rgba(255,255,255,0.04),
        0 0 0 2px #0a0914,
        0 0 80px rgba(100, 60, 200, 0.25),
        0 40px 120px rgba(0,0,0,0.98),
        inset 0 1px 0 rgba(255,255,255,0.06);
    }

    /* ══════════════════════════════════════════════════════════════
       HOMEPAGE AUTH MODAL
    ══════════════════════════════════════════════════════════════ */
    .home-auth-overlay {
      position: fixed; inset: 0; z-index: 600;
      background: rgba(2, 1, 10, 0.88);
      backdrop-filter: blur(12px);
      display: flex; align-items: center; justify-content: center;
      opacity: 0; transition: opacity 0.3s ease;
      pointer-events: none;
    }
    .home-auth-overlay.visible { opacity: 1; pointer-events: auto; }
    .home-auth-card {
      background: #0e0d22;
      border: 1px solid rgba(123, 79, 255, 0.3);
      border-radius: 16px;
      padding: 36px 32px;
      max-width: 400px; width: 92vw;
      position: relative;
      box-shadow: 0 24px 80px rgba(0,0,0,0.7), 0 0 60px rgba(123, 79, 255, 0.12);
    }
    .home-auth-card .auth-gate-close { position: absolute; top: 14px; right: 18px; }
    .auth-gate-close {
      background: none;
      border: none;
      color: var(--text2);
      cursor: pointer;
      font-size: 28px;
      padding: 0;
      width: 40px;
      height: 40px;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: color 0.2s;
    }
    .auth-gate-close:hover { color: var(--accent); }
    .home-auth-tabs {
      display: flex; gap: 0; margin-bottom: 24px;
      border-bottom: 1px solid rgba(255,255,255,0.08);
    }
    .home-auth-tab {
      flex: 1; padding: 10px 0; text-align: center;
      font-family: var(--font-mono); font-size: 11px;
      letter-spacing: 2px; text-transform: uppercase;
      color: var(--text2); cursor: pointer;
      border-bottom: 2px solid transparent;
      transition: color 0.2s, border-color 0.2s;
      background: none; border-top: none; border-left: none; border-right: none;
    }
    .home-auth-tab.active {
      color: var(--accent);
      border-bottom-color: var(--accent);
    }
    .home-auth-tab:hover:not(.active) { color: var(--text); }
    .home-auth-form { display: flex; flex-direction: column; gap: 14px; }
    .home-auth-form[hidden] { display: none; }
    .home-auth-input {
      background: rgba(255,255,255,0.04);
      border: 1px solid rgba(255,255,255,0.1);
      border-radius: 8px; padding: 12px 14px;
      color: var(--text); font-family: var(--font-mono);
      font-size: 13px; outline: none;
      transition: border-color 0.2s;
    }
    .home-auth-input::placeholder { color: var(--text2); opacity: 0.6; }
    .home-auth-input:focus { border-color: var(--accent); }
    .home-auth-submit {
      background: var(--accent); color: #fff;
      border: none; border-radius: 8px; padding: 12px;
      font-family: var(--font-mono); font-size: 12px;
      letter-spacing: 1.5px; text-transform: uppercase;
      cursor: pointer; transition: background 0.2s, transform 0.1s;
    }
    .home-auth-submit:hover { background: #9366ff; }
    .home-auth-submit:active { transform: scale(0.97); }
    .home-auth-submit:disabled { opacity: 0.6; cursor: not-allowed; background: #333; color: #777; }
    .home-auth-divider {
      display: flex; align-items: center; gap: 12px;
      color: var(--text2); font-size: 11px;
      font-family: var(--font-mono); letter-spacing: 1px;
    }
    .home-auth-divider::before, .home-auth-divider::after {
      content: ''; flex: 1; height: 1px;
      background: rgba(255,255,255,0.08);
    }
    .home-auth-error {
      color: #ff6b6b; font-size: 12px;
      font-family: var(--font-mono);
      min-height: 16px; text-align: center;
    }
    .home-auth-google-wrap {
      display: flex; justify-content: center;
      min-height: 44px;
    }

    /* (mobile chat override removed) */

    /* ══════════════════════════════════════════════════════════════
       FILM GRAIN OVERLAY — Static (animated grain was 30%+ of paint cost)
    ══════════════════════════════════════════════════════════════ */
    body::after {
      content: '';
      position: fixed;
      inset: 0;
      pointer-events: none;
      z-index: 9998;
      opacity: 0.035;
      background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
      background-size: 200px 200px;
      /* animation removed — static grain looks identical, saves ~30% paint */
      mix-blend-mode: overlay;
    }

    /* ══════════════════════════════════════════════════════════════
       AMBIENT BACKGROUND — Static (animating `background` forces full-page repaint)
    ══════════════════════════════════════════════════════════════ */
    /* body::before background is set statically above — no animation needed */

    /* ══════════════════════════════════════════════════════════════
       EXPERIMENTAL: NAV BRAND GLITCH ON HOVER
    ══════════════════════════════════════════════════════════════ */
    .nav-brand {
      position: relative;
      transition: all 0.2s;
    }
    .nav-brand:hover {
      text-shadow:
        2px 0 0 rgba(255, 61, 107, 0.3),
       -2px 0 0 rgba(0, 255, 179, 0.3),
        0 0 8px rgba(123, 79, 255, 0.5);
    }

    /* ══════════════════════════════════════════════════════════════
       BREATHING GLOW ON MONITOR — Opacity-based (box-shadow animation
       forces full repaint; opacity is GPU-compositable)
    ══════════════════════════════════════════════════════════════ */
    .monitor {
      position: relative;
    }
    .monitor-wrap::after {
      /* Reuse the existing glow pseudo-element — just pulse its opacity */
      will-change: opacity;
      animation: monitor-breathe 6s ease-in-out infinite;
    }
    @keyframes monitor-breathe {
      0%, 100% { opacity: 0.5; }
      50%      { opacity: 0.85; }
    }

    /* ══════════════════════════════════════════════════════════════
       SCAN DISTORTION LINE — GPU-composited via transform (not top)
    ══════════════════════════════════════════════════════════════ */
    .screen::after {
      content: '';
      position: absolute;
      top: 0;
      left: 0; right: 0;
      height: 2px;
      background: linear-gradient(90deg,
        transparent 10%,
        rgba(180, 138, 255, 0.12) 30%,
        rgba(180, 138, 255, 0.25) 50%,
        rgba(180, 138, 255, 0.12) 70%,
        transparent 90%
      );
      z-index: 22;
      pointer-events: none;
      will-change: transform, opacity;
      animation: scanline-pass 7s linear infinite;
    }
    @keyframes scanline-pass {
      0%   { transform: translateY(-2px); opacity: 0; }
      5%   { opacity: 1; }
      95%  { opacity: 1; }
      100% { transform: translateY(calc(100vh)); opacity: 0; }
    }

    /* ══════════════════════════════════════════════════════════════
       EXPERIMENTAL: IDLE SCREEN TEXT — DECODE GLOW
    ══════════════════════════════════════════════════════════════ */
    .idle-demo-text {
      animation: text-decode-glow 5s ease-in-out infinite;
    }
    @keyframes text-decode-glow {
      0%, 100% {
        text-shadow: 0 0 8px rgba(180, 138, 255, 0.6);
        filter: none;
      }
      50% {
        text-shadow: 0 0 16px rgba(180, 138, 255, 0.9),
                     0 0 40px rgba(123, 79, 255, 0.3);
        filter: brightness(1.1);
      }
    }

    /* ══════════════════════════════════════════════════════════════
       EXPERIMENTAL: IDLE LOGO — CHROMATIC ABERRATION
    ══════════════════════════════════════════════════════════════ */
    .idle-logo {
      position: relative;
    }
    .idle-logo::before,
    .idle-logo::after {
      content: 'WEIRDMAKER';
      position: absolute;
      top: 0; left: 0;
      width: 100%;
      overflow: hidden;
      pointer-events: none;
    }
    .idle-logo::before {
      color: #ff3c78;
      clip-path: inset(0 0 65% 0);
      transform: translate(-2px, -1px);
      opacity: 0.2;
      animation: logo-glitch-top 6s step-end infinite;
    }
    .idle-logo::after {
      color: #4affcc;
      clip-path: inset(60% 0 0 0);
      transform: translate(2px, 1px);
      opacity: 0.2;
      animation: logo-glitch-bottom 6s step-end infinite;
    }
    @keyframes logo-glitch-top {
      0%, 82%, 88%, 100% { clip-path: inset(0 0 65% 0); transform: translate(-2px, -1px); }
      83% { clip-path: inset(10% 0 55% 0); transform: translate(-5px, 0); }
      85% { clip-path: inset(25% 0 40% 0); transform: translate(4px, -1px); }
      87% { clip-path: inset(5% 0 70% 0); transform: translate(-1px, 2px); }
    }
    @keyframes logo-glitch-bottom {
      0%, 82%, 88%, 100% { clip-path: inset(60% 0 0 0); transform: translate(2px, 1px); }
      83% { clip-path: inset(50% 0 10% 0); transform: translate(5px, 0); }
      85% { clip-path: inset(45% 0 20% 0); transform: translate(-4px, 1px); }
      87% { clip-path: inset(55% 0 5% 0); transform: translate(1px, -2px); }
    }

    /* ══════════════════════════════════════════════════════════════
       EXPERIMENTAL: TERMINAL OUTPUT — LINE MATERIALIZATION
       Lines fade-and-slide in when they appear in the terminal
    ══════════════════════════════════════════════════════════════ */
    .line {
      animation: line-materialize 0.35s ease-out both;
    }
    @keyframes line-materialize {
      0% {
        opacity: 0;
        transform: translateY(4px);
        /* filter: blur removed — forces repaint of every new line */
      }
      100% {
        opacity: 1;
        transform: translateY(0);
      }
    }

    /* ── Kill idle-only animations once app-mode starts ── */
    body.app-mode .idle-logo::before,
    body.app-mode .idle-logo::after,
    body.app-mode .idle-demo-text,
    body.app-mode .idle-press,
    body.app-mode .scroll-hint {
      animation: none !important;
    }

    /* ══════════════════════════════════════════════════════════════
       EXPERIMENTAL: PROMPT GLYPH — ELECTRIC PULSE
    ══════════════════════════════════════════════════════════════ */
    .prompt-glyph {
      animation: prompt-pulse 2.5s ease-in-out infinite;
    }
    @keyframes prompt-pulse {
      0%, 100% {
        text-shadow: 0 0 8px rgba(74, 255, 204, 0.7);
      }
      50% {
        text-shadow: 0 0 14px rgba(74, 255, 204, 1),
                     0 0 30px rgba(74, 255, 204, 0.4),
                     0 0 4px rgba(0, 255, 179, 0.8);
      }
    }

    /* ══════════════════════════════════════════════════════════════
       EXPERIMENTAL: CURSOR — PHOSPHOR BLOOM
    ══════════════════════════════════════════════════════════════ */
    .cursor {
      box-shadow: 0 0 8px rgba(180,138,255,0.9),
                  0 0 20px rgba(180,138,255,0.4);
    }

    /* ══════════════════════════════════════════════════════════════
       EXPERIMENTAL: POWER LED — HEARTBEAT PULSE
    ══════════════════════════════════════════════════════════════ */
    .power-led.on {
      animation: led-heartbeat 2s ease-in-out infinite;
    }
    @keyframes led-heartbeat {
      0%, 100% {
        background: #9d5fff;
        box-shadow: 0 0 6px rgba(157,95,255,0.9);
      }
      15% {
        background: #c18aff;
        box-shadow: 0 0 12px rgba(157,95,255,1), 0 0 20px rgba(123,79,255,0.5);
      }
      30% {
        background: #9d5fff;
        box-shadow: 0 0 6px rgba(157,95,255,0.9);
      }
      40% {
        background: #b070ff;
        box-shadow: 0 0 10px rgba(157,95,255,0.95), 0 0 16px rgba(123,79,255,0.3);
      }
      55% {
        background: #9d5fff;
        box-shadow: 0 0 6px rgba(157,95,255,0.9);
      }
    }

    /* (old chat bubble CSS removed — replaced by Help Toolkit) */

    /* ══════════════════════════════════════════════════════════════
       EXPERIMENTAL: AUTH MODAL — STATIC NOISE BG
    ══════════════════════════════════════════════════════════════ */
    .home-auth-overlay.visible::before {
      content: '';
      position: absolute;
      inset: 0;
      pointer-events: none;
      opacity: 0.015;
      background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 128 128' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.2' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
      background-size: 150px 150px;
      animation: grain-drift 0.5s steps(3) infinite;
    }

    /* ══════════════════════════════════════════════════════════════
       EXPERIMENTAL: AUTH CARD — VIOLET BORDER PULSE
    ══════════════════════════════════════════════════════════════ */
    .home-auth-overlay.visible .home-auth-card {
      animation: auth-card-glow 4s ease-in-out infinite;
    }
    @keyframes auth-card-glow {
      0%, 100% {
        border-color: rgba(123, 79, 255, 0.3);
        box-shadow: 0 24px 80px rgba(0,0,0,0.7), 0 0 60px rgba(123, 79, 255, 0.12);
      }
      50% {
        border-color: rgba(123, 79, 255, 0.5);
        box-shadow: 0 24px 80px rgba(0,0,0,0.7), 0 0 80px rgba(123, 79, 255, 0.22);
      }
    }

    /* ══════════════════════════════════════════════════════════════
       EXPERIMENTAL: MONITOR BEZEL TEXT — SUBTLE REVEAL
    ══════════════════════════════════════════════════════════════ */
    .monitor::after {
      transition: color 0.6s ease, text-shadow 0.6s ease;
    }
    .monitor:hover::after {
      color: #2a2850;
      text-shadow: 0 0 12px rgba(123, 79, 255, 0.15);
    }

    /* ══════════════════════════════════════════════════════════════
       SCREEN FLICKER — VOLTAGE SAG
       Uses opacity instead of filter:brightness (GPU-compositable)
    ══════════════════════════════════════════════════════════════ */
    body.app-mode .screen {
      height: 80vh;
      max-height: 880px;
      will-change: opacity;
      animation: voltage-sag 12s ease-in-out infinite;
    }
    @keyframes voltage-sag {
      0%, 100% { opacity: 1; }
      42%      { opacity: 1; }
      43%      { opacity: 0.92; }
      44%      { opacity: 0.97; }
      45%      { opacity: 1; }
      78%      { opacity: 1; }
      79%      { opacity: 0.88; }
      80%      { opacity: 0.95; }
      81%      { opacity: 1; }
    }


    /* ══════════════════════════════════════════════════════════════
       PROGRESS PIPELINE — Stage Awareness Bar
    ══════════════════════════════════════════════════════════════ */
    .progress-pipeline {
      display: none;
      position: absolute;
      top: 0; left: 0; right: 0;
      z-index: 25;
      background: linear-gradient(180deg, rgba(7,5,15,0.95) 0%, rgba(7,5,15,0.85) 100%);
      border-bottom: 1px solid rgba(180,138,255,0.12);
      padding: 6px 12px;
      font-family: var(--font-terminal);
      backdrop-filter: blur(4px);
      -webkit-backdrop-filter: blur(4px);
    }
    body.app-mode .progress-pipeline.pp-visible {
      display: block;
    }
    .pp-stages {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 4px;
    }
    .pp-stage {
      display: flex;
      align-items: center;
      gap: 4px;
      padding: 3px 8px;
      border-radius: 3px;
      font-size: 12px;
      letter-spacing: 1.5px;
      color: rgba(255,255,255,0.18);
      transition: all 0.4s ease;
      position: relative;
    }
    .pp-stage .pp-icon {
      font-size: 10px;
      transition: all 0.4s ease;
    }
    .pp-stage .pp-label {
      transition: all 0.4s ease;
    }
    .pp-arrow {
      font-size: 10px;
      color: rgba(255,255,255,0.08);
      margin: 0 2px;
      transition: color 0.4s ease;
    }

    /* Active stage */
    .pp-stage.pp-active {
      color: var(--accent);
      text-shadow: 0 0 8px rgba(180,138,255,0.5);
      background: rgba(180,138,255,0.08);
    }
    .pp-stage.pp-active .pp-icon {
      animation: pp-pulse 2s ease-in-out infinite;
    }
    @keyframes pp-pulse {
      0%, 100% { opacity: 1; }
      50% { opacity: 0.5; }
    }

    /* Completed stage */
    .pp-stage.pp-done {
      color: var(--accent2);
      text-shadow: 0 0 6px rgba(74,255,204,0.3);
    }
    .pp-stage.pp-done .pp-icon::after {
      content: ' \2713';
      font-size: 9px;
      margin-left: 1px;
    }
    .pp-arrow.pp-arrow-done {
      color: rgba(74,255,204,0.3);
    }

    /* Question counter */
    .pp-counter {
      font-size: 11px;
      color: var(--accent);
      margin-left: 2px;
      font-family: var(--font-mono);
      letter-spacing: 0;
      opacity: 0;
      transition: opacity 0.3s ease;
    }
    .pp-counter.pp-counter-visible {
      opacity: 1;
    }

    /* Responsive — smaller screens */
    @media (max-width: 600px) {
      .pp-stage { padding: 2px 5px; font-size: 10px; letter-spacing: 1px; }
      .pp-stage .pp-icon { font-size: 8px; }
      .pp-arrow { font-size: 8px; }
      .pp-counter { font-size: 9px; }
    }

    /* Adjust terminal padding to accommodate the pipeline bar */
    body.app-mode .progress-pipeline.pp-visible ~ .terminal {
      padding-top: 38px;
    }

    /* ══════════════════════════════════════════════════════════════
       LIVE MODULE PREVIEW — Floating Mini Panel
    ══════════════════════════════════════════════════════════════ */
    .live-preview {
      display: none;
      position: absolute;
      top: 36px;
      right: 8px;
      width: 80px;
      max-height: calc(100% - 52px);
      z-index: 24;
      opacity: 0;
      transform: translateX(10px);
      transition: opacity 0.5s ease, transform 0.5s ease;
      pointer-events: none;
    }
    .live-preview.lp-visible {
      display: block;
      opacity: 1;
      transform: translateX(0);
    }
    @keyframes lp-fadein {
      from { opacity: 0; transform: translateY(3px); }
      to   { opacity: 1; transform: translateY(0); }
    }
    @media (max-width: 500px) {
      .live-preview { display: none !important; }
    }
    @media (min-width: 501px) and (max-width: 700px) {
      .live-preview { width: 60px; top: 34px; right: 4px; }
    }

    /* ══════════════════════════════════════════════════════════════
       SMART QUICK-PICK — Answer Suggestion Chips
    ══════════════════════════════════════════════════════════════ */
    .qp-row {
      display: flex;
      align-items: center;
      gap: 6px;
      flex-wrap: wrap;
      margin: 2px 0 6px 0;
      animation: lp-fadein 0.3s ease both;
    }
    .qp-label {
      font-family: var(--font-terminal);
      font-size: 10px;
      letter-spacing: 1.5px;
      color: rgba(255,255,255,0.2);
      margin-right: 2px;
    }
    .qp-chip {
      background: rgba(180,138,255,0.06);
      border: 1px solid rgba(180,138,255,0.15);
      color: rgba(180,138,255,0.65);
      font-family: var(--font-mono);
      font-size: 11px;
      padding: 3px 10px;
      border-radius: 12px;
      cursor: pointer;
      transition: all 0.2s ease;
      white-space: nowrap;
    }
    .qp-chip:hover {
      background: rgba(180,138,255,0.14);
      border-color: rgba(180,138,255,0.35);
      color: var(--accent);
      text-shadow: 0 0 6px rgba(180,138,255,0.3);
    }
    .qp-chip:active {
      transform: scale(0.96);
    }

    /* ══════════════════════════════════════════════════════════════
       INTERACTIVE RECAP — Review Card
    ══════════════════════════════════════════════════════════════ */
    .recap-card {
      background: rgba(180,138,255,0.04);
      border: 1px solid rgba(180,138,255,0.12);
      border-radius: 6px;
      padding: 12px 14px;
      margin: 4px 0 8px 0;
      transition: opacity 0.4s ease;
    }
    .recap-field {
      display: flex;
      align-items: baseline;
      gap: 8px;
      margin: 4px 0;
      font-family: var(--font-mono);
      font-size: 12px;
    }
    .recap-label {
      color: rgba(255,255,255,0.25);
      font-size: 10px;
      letter-spacing: 1px;
      min-width: 80px;
      flex-shrink: 0;
      font-family: var(--font-terminal);
    }
    .recap-value {
      color: var(--accent);
      padding: 1px 6px;
      border-radius: 3px;
      border: 1px solid transparent;
      outline: none;
      transition: all 0.2s ease;
      max-width: 100%;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .recap-value:hover {
      border-color: rgba(180,138,255,0.2);
    }
    .recap-value:focus {
      border-color: rgba(180,138,255,0.4);
      background: rgba(180,138,255,0.06);
      white-space: normal;
    }
    .recap-notes-input {
      flex: 1;
      background: rgba(0,0,0,0.3);
      border: 1px solid rgba(180,138,255,0.15);
      border-radius: 3px;
      color: rgba(255,255,255,0.6);
      font-family: var(--font-mono);
      font-size: 11px;
      padding: 4px 8px;
      outline: none;
    }
    .recap-notes-input:focus {
      border-color: rgba(180,138,255,0.35);
      color: rgba(255,255,255,0.8);
    }
    .recap-notes-input::placeholder {
      color: rgba(255,255,255,0.15);
    }
    .recap-actions {
      margin: 6px 0 4px 0;
    }

    /* ══════════════════════════════════════════════════════════════
       DYNAMIC TERMINAL ELEMENTS — CRT-STYLED CLASSES
       Replaces inline JS styles with proper CRT phosphor glow,
       transitions, and design system tokens.
    ══════════════════════════════════════════════════════════════ */

    /* ── Layout helpers ── */
    .term-row          { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; margin: 4px 0 8px 0; }
    .term-row--tight   { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 8px 0; }
    .term-row--entry   { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 8px 0; }
    .term-row--inline  { display: flex; gap: 6px; align-items: center; margin: 4px 0; }
    .term-row--stats   { display: flex; gap: 16px; flex-wrap: wrap; margin: 12px 0; }
    .term-row--tier    { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0; }
    .term-row--export  { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0; }

    /* ── Description text ── */
    .term-desc {
      font-family: inherit;
      font-size: 10px;
      color: #666;
      letter-spacing: 0.5px;
      margin: 4px 0 0 0;
      transition: color 0.3s;
    }

    /* ── Base terminal button ── */
    .term-btn {
      background: transparent;
      color: #555;
      border: 1px solid #333;
      padding: 5px 14px;
      font-family: inherit;
      font-size: 11px;
      cursor: pointer;
      letter-spacing: 1.5px;
      transition: all 0.25s ease;
      position: relative;
      overflow: hidden;
    }
    .term-btn::after {
      content: '';
      position: absolute;
      inset: 0;
      background: radial-gradient(ellipse at center, currentColor, transparent 70%);
      opacity: 0;
      transition: opacity 0.3s;
      pointer-events: none;
    }
    .term-btn:hover {
      color: #888;
      border-color: #555;
      text-shadow: 0 0 6px rgba(255,255,255,0.1);
    }
    .term-btn:hover::after {
      opacity: 0.04;
    }
    .term-btn:active {
      transform: scale(0.97);
    }

    /* Active state — color set via CSS custom property --btn-color */
    .term-btn--active {
      color: var(--btn-color, var(--accent));
      border-color: var(--btn-color, var(--accent));
      background: color-mix(in srgb, var(--btn-color, var(--accent)) 12%, transparent);
      text-shadow: 0 0 8px color-mix(in srgb, var(--btn-color, var(--accent)) 40%, transparent);
      box-shadow: inset 0 0 12px color-mix(in srgb, var(--btn-color, var(--accent)) 6%, transparent),
                  0 0 8px color-mix(in srgb, var(--btn-color, var(--accent)) 10%, transparent);
    }
    .term-btn--active:hover {
      background: color-mix(in srgb, var(--btn-color, var(--accent)) 20%, transparent);
      box-shadow: inset 0 0 16px color-mix(in srgb, var(--btn-color, var(--accent)) 10%, transparent),
                  0 0 14px color-mix(in srgb, var(--btn-color, var(--accent)) 18%, transparent);
    }

    /* Size variants */
    .term-btn--sm {
      padding: 4px 10px;
      font-size: 9px;
      border-radius: 2px;
    }
    .term-btn--lg {
      padding: 6px 14px;
      font-size: 10px;
    }

    /* ── Entry point buttons (Upload Sound / Describe Sound) ── */
    .term-btn--entry {
      padding: 6px 14px;
      font-size: 10px;
      letter-spacing: 1.5px;
      border-radius: 0;
    }
    .term-btn--entry-pink {
      color: var(--hot, #ff3c78);
      border-color: rgba(255,107,157,0.3);
      background: rgba(255,107,157,0.06);
    }
    .term-btn--entry-pink:hover {
      border-color: var(--hot);
      background: rgba(255,107,157,0.15);
      box-shadow: 0 0 12px rgba(255,60,120,0.15), inset 0 0 8px rgba(255,60,120,0.06);
      text-shadow: 0 0 8px rgba(255,60,120,0.4);
    }
    .term-btn--entry-purple {
      color: var(--accent, #b48aff);
      border-color: rgba(180,138,255,0.3);
      background: rgba(180,138,255,0.06);
    }
    .term-btn--entry-purple:hover {
      border-color: var(--accent);
      background: rgba(180,138,255,0.15);
      box-shadow: 0 0 12px rgba(180,138,255,0.15), inset 0 0 8px rgba(180,138,255,0.06);
      text-shadow: 0 0 8px rgba(180,138,255,0.4);
    }
    .term-btn--entry-purple.is-disabled {
      opacity: 0.5;
      pointer-events: none;
    }
    .term-btn--entry-green {
      color: var(--accent2, #4affcc);
      border-color: rgba(74,255,204,0.3);
      background: rgba(74,255,204,0.06);
    }
    .term-btn--entry-green:hover {
      border-color: var(--accent2);
      background: rgba(74,255,204,0.15);
      box-shadow: 0 0 12px rgba(74,255,204,0.15), inset 0 0 8px rgba(74,255,204,0.06);
      text-shadow: 0 0 8px rgba(74,255,204,0.4);
    }
    .term-btn--entry-green.is-disabled {
      opacity: 0.5;
      pointer-events: none;
    }

    /* ── Selection group buttons ── */
    .term-sel-label {
      font-family: inherit;
      font-size: 10px;
      color: var(--accent2, #4affcc);
      letter-spacing: 1.5px;
      margin-bottom: 4px;
      text-shadow: 0 0 6px rgba(74,255,204,0.3);
    }
    .term-sel-label--pink {
      color: var(--hot, #ff3c78);
      text-shadow: 0 0 6px rgba(255,60,120,0.3);
    }
    .term-sel-desc {
      font-family: inherit;
      font-size: 10px;
      color: #555;
      letter-spacing: 0.5px;
      margin-bottom: 6px;
      min-height: 14px;
    }

    /* ── Context wrap ── */
    .term-context {
      background: rgba(180,138,255,0.04);
      border: 1px solid rgba(180,138,255,0.15);
      border-radius: 4px;
      padding: 10px 14px;
      margin: 4px 0 12px 0;
    }

    /* ── Hint text ── */
    .term-hint {
      color: var(--accent2, #4affcc);
      font-size: 10px;
      opacity: 0.6;
      letter-spacing: 1px;
      margin: 4px 0;
      cursor: pointer;
      transition: opacity 0.2s;
    }
    .term-hint:hover { opacity: 1; }

    /* ══════════════════════════════════════════════════════════════
       TIER SELECTION CARDS — Glow border, accent stripe, hover lift
    ══════════════════════════════════════════════════════════════ */
    .term-tier-card {
      background: var(--bg-card, #08061a);
      color: #e0d6c8;
      border: 1px solid rgba(180,138,255,0.25);
      padding: 12px 16px;
      font-family: inherit;
      font-size: 12px;
      cursor: pointer;
      letter-spacing: 1px;
      transition: all 0.3s cubic-bezier(0.25,0.46,0.45,0.94);
      text-align: left;
      min-width: 150px;
      max-width: 210px;
      position: relative;
      overflow: hidden;
      box-shadow: 0 2px 8px rgba(0,0,0,0.3),
                  inset 0 1px 0 rgba(255,255,255,0.03);
    }
    /* Accent stripe on the left edge */
    .term-tier-card::before {
      content: '';
      position: absolute;
      left: 0;
      top: 0;
      bottom: 0;
      width: 3px;
      background: var(--tier-color, var(--accent));
      opacity: 0.6;
      transition: opacity 0.3s, width 0.3s, box-shadow 0.3s;
    }
    /* Subtle inner glow */
    .term-tier-card::after {
      content: '';
      position: absolute;
      inset: 0;
      background: radial-gradient(ellipse at 20% 50%, var(--tier-color, var(--accent)), transparent 70%);
      opacity: 0;
      transition: opacity 0.35s;
      pointer-events: none;
    }
    .term-tier-card:hover {
      border-color: var(--tier-color, var(--accent));
      background: var(--bg-card-hover, #0c0a22);
      transform: translateY(-2px) scale(1.01);
      box-shadow: 0 6px 20px rgba(0,0,0,0.5),
                  0 0 15px color-mix(in srgb, var(--tier-color, var(--accent)) 12%, transparent),
                  inset 0 1px 0 rgba(255,255,255,0.05);
    }
    .term-tier-card:hover::before {
      opacity: 1;
      width: 4px;
      box-shadow: 0 0 8px var(--tier-color, var(--accent));
    }
    .term-tier-card:hover::after {
      opacity: 0.06;
    }
    .term-tier-card:active {
      transform: translateY(0) scale(0.99);
    }
    .term-tier-card .tier-name {
      font-weight: 700;
      letter-spacing: 2px;
    }
    .term-tier-card .tier-price {
      opacity: 0.7;
      margin-left: 4px;
    }
    .term-tier-card .tier-qs {
      font-size: 11px;
      color: var(--tier-color, var(--accent2));
      display: block;
      margin-top: 4px;
    }
    .term-tier-card .tier-desc {
      font-size: 10px;
      opacity: 0.45;
      display: block;
      margin-top: 2px;
    }

    /* ══════════════════════════════════════════════════════════════
       PROGRESS BAR — Pulsing phosphor glow during generation
    ══════════════════════════════════════════════════════════════ */
    .term-progress-wrap {
      margin: 8px 0 12px 0;
    }
    .term-progress-label {
      font-family: inherit;
      font-size: 10px;
      color: var(--accent2, #4affcc);
      letter-spacing: 2px;
      margin-bottom: 4px;
      text-shadow: 0 0 6px rgba(74,255,204,0.3);
    }
    .term-progress-outer {
      width: 100%;
      height: 6px;
      background: rgba(255,255,255,0.04);
      border: 1px solid rgba(255,255,255,0.06);
      overflow: hidden;
      position: relative;
      box-shadow: inset 0 1px 3px rgba(0,0,0,0.4);
    }
    .term-progress-inner {
      width: 0%;
      height: 100%;
      background: linear-gradient(90deg, var(--accent2, #4affcc), var(--accent, #b48aff));
      transition: width 1.5s cubic-bezier(0.4,0,0.2,1);
      box-shadow: 0 0 12px rgba(74,255,204,0.4),
                  0 0 4px rgba(74,255,204,0.6);
      position: relative;
    }
    /* Animated shimmer on the progress fill */
    .term-progress-inner::after {
      content: '';
      position: absolute;
      inset: 0;
      background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.15) 50%, transparent 100%);
      animation: progress-shimmer 2s ease-in-out infinite;
    }
    @keyframes progress-shimmer {
      0%   { transform: translateX(-100%); }
      100% { transform: translateX(200%); }
    }
    /* Pulsing glow while active */
    .term-progress-outer.is-active {
      animation: progress-glow 2s ease-in-out infinite;
    }
    @keyframes progress-glow {
      0%, 100% {
        box-shadow: inset 0 1px 3px rgba(0,0,0,0.4),
                    0 0 8px rgba(74,255,204,0.15);
      }
      50% {
        box-shadow: inset 0 1px 3px rgba(0,0,0,0.4),
                    0 0 16px rgba(74,255,204,0.3),
                    0 0 30px rgba(74,255,204,0.1);
      }
    }
    /* AI is thinking — deeper, slower pulse when progress plateaus */
    .term-progress-outer.is-thinking {
      animation: progress-thinking 3s ease-in-out infinite;
    }
    .term-progress-outer.is-thinking .term-progress-inner {
      animation: progress-inner-breathe 3s ease-in-out infinite;
    }
    @keyframes progress-thinking {
      0%, 100% {
        box-shadow: inset 0 1px 3px rgba(0,0,0,0.4),
                    0 0 10px rgba(180,138,255,0.2);
        border-color: rgba(180,138,255,0.15);
      }
      50% {
        box-shadow: inset 0 1px 3px rgba(0,0,0,0.4),
                    0 0 24px rgba(180,138,255,0.4),
                    0 0 50px rgba(180,138,255,0.12);
        border-color: rgba(180,138,255,0.3);
      }
    }
    @keyframes progress-inner-breathe {
      0%, 100% { opacity: 0.7; }
      50% { opacity: 1.0; }
    }

    .term-progress-pct {
      font-family: inherit;
      font-size: 9px;
      color: rgba(255,255,255,0.3);
      letter-spacing: 1px;
      margin-top: 3px;
      text-align: right;
    }

    /* ── Stage log container ── */
    .term-stage-log {
      margin: 8px 0;
      min-height: 120px;
    }

    /* ── Stage log line — staggered entrance ── */
    .term-stage-line {
      font-family: inherit;
      font-size: 11px;
      color: rgba(255,255,255,0.4);
      letter-spacing: 0.5px;
      opacity: 0;
      transform: translateY(4px);
      transition: opacity 0.4s ease-out, transform 0.4s ease-out;
      margin: 2px 0;
      padding-left: 2px;
    }
    .term-stage-line.is-visible {
      opacity: 1;
      transform: translateY(0);
    }
    /* Subtle left-border flash on new lines */
    .term-stage-line.is-new {
      border-left: 2px solid var(--accent2, #4affcc);
      padding-left: 8px;
      animation: stage-flash 0.8s ease-out forwards;
    }
    @keyframes stage-flash {
      0%   { border-left-color: var(--accent2, #4affcc); }
      100% { border-left-color: transparent; }
    }

    /* ══════════════════════════════════════════════════════════════
       BUILD COMPLETE THEATER — Glitch-in, counting stats, CTA glow
    ══════════════════════════════════════════════════════════════ */
    .term-reveal-name {
      font-family: var(--font-terminal, 'VT323', monospace);
      font-size: clamp(22px, 4vw, 36px);
      color: var(--accent2, #4affcc);
      letter-spacing: 4px;
      text-shadow: 0 0 20px rgba(74,255,204,0.6),
                   0 0 40px rgba(74,255,204,0.3),
                   0 0 60px rgba(74,255,204,0.1);
      margin: 12px 0;
      animation: reveal-glitch 0.6s steps(3) forwards;
    }
    @keyframes reveal-glitch {
      0%  { clip-path: inset(0 100% 0 0); filter: brightness(2) hue-rotate(20deg); }
      20% { clip-path: inset(0 60% 0 0); filter: brightness(1.5) hue-rotate(-10deg); }
      40% { clip-path: inset(0 30% 0 0); filter: brightness(1.2); }
      60% { clip-path: inset(0 10% 0 0); filter: brightness(1.1); }
      80% { clip-path: inset(0 2% 0 0); filter: brightness(1); }
      100%{ clip-path: inset(0 0 0 0); filter: brightness(1); }
    }

    .term-reveal-subtitle {
      font-family: inherit;
      font-size: 12px;
      color: var(--accent, #b48aff);
      letter-spacing: 1px;
      opacity: 0;
      transition: opacity 0.6s;
      margin-bottom: 8px;
      text-shadow: 0 0 8px rgba(180,138,255,0.3);
    }
    .term-reveal-subtitle.is-visible { opacity: 1; }

    .term-stat {
      text-align: center;
      opacity: 0;
      transition: opacity 0.4s, transform 0.4s;
      transform: translateY(6px);
    }
    .term-stat.is-visible {
      opacity: 1;
      transform: translateY(0);
    }
    .term-stat-value {
      font-family: var(--font-terminal, 'VT323', monospace);
      font-size: 22px;
      color: var(--accent2, #4affcc);
      text-shadow: 0 0 10px rgba(74,255,204,0.5);
    }
    .term-stat-label {
      font-size: 8px;
      color: rgba(255,255,255,0.3);
      letter-spacing: 2px;
      margin-top: 2px;
    }

    /* ── CTA button — breathing phosphor glow ── */
    .term-cta {
      background: linear-gradient(135deg, rgba(74,255,204,0.12), rgba(180,138,255,0.12));
      color: var(--accent2, #4affcc);
      border: 1px solid var(--accent2, #4affcc);
      padding: 14px 32px;
      font-family: var(--font-terminal, 'VT323', monospace);
      font-size: 18px;
      cursor: pointer;
      letter-spacing: 3px;
      transition: all 0.3s ease;
      text-shadow: 0 0 8px rgba(74,255,204,0.4);
      position: relative;
      overflow: hidden;
      animation: cta-breathe 3s ease-in-out infinite;
    }
    @keyframes cta-breathe {
      0%, 100% {
        box-shadow: 0 0 8px rgba(74,255,204,0.15),
                    inset 0 0 12px rgba(74,255,204,0.05);
      }
      50% {
        box-shadow: 0 0 20px rgba(74,255,204,0.3),
                    0 0 40px rgba(74,255,204,0.1),
                    inset 0 0 20px rgba(74,255,204,0.08);
      }
    }
    .term-cta::after {
      content: '';
      position: absolute;
      top: -50%;
      left: -50%;
      width: 200%;
      height: 200%;
      background: conic-gradient(from 0deg, transparent 0%, rgba(74,255,204,0.06) 25%, transparent 50%);
      animation: cta-sweep 4s linear infinite;
      pointer-events: none;
    }
    @keyframes cta-sweep {
      0% { transform: rotate(0deg); }
      100% { transform: rotate(360deg); }
    }
    .term-cta:hover {
      background: linear-gradient(135deg, rgba(74,255,204,0.25), rgba(180,138,255,0.25));
      box-shadow: 0 0 24px rgba(74,255,204,0.35),
                  0 0 48px rgba(74,255,204,0.12);
      transform: scale(1.02);
    }
    .term-cta:active {
      transform: scale(0.98);
    }

    /* ── Download link ── */
    .term-dl {
      margin-top: 8px;
      font-size: 10px;
    }
    .term-dl a {
      color: rgba(255,255,255,0.3);
      text-decoration: none;
      letter-spacing: 1px;
      transition: color 0.2s, text-shadow 0.2s;
    }
    .term-dl a:hover {
      color: rgba(255,255,255,0.6);
      text-shadow: 0 0 6px rgba(255,255,255,0.1);
    }

    /* ══════════════════════════════════════════════════════════════
       INPUTS — Text fields with CRT focus glow
    ══════════════════════════════════════════════════════════════ */
    .term-input {
      flex: 1;
      background: rgba(255,255,255,0.02);
      color: #ccc;
      border: 1px solid #333;
      padding: 8px 12px;
      font-family: inherit;
      font-size: 11px;
      letter-spacing: 0.5px;
      outline: none;
      border-radius: 3px;
      transition: border-color 0.25s, box-shadow 0.25s;
    }
    .term-input:focus {
      border-color: var(--accent2, #4affcc);
      box-shadow: 0 0 8px rgba(74,255,204,0.15),
                  inset 0 0 6px rgba(74,255,204,0.04);
    }
    .term-input--accent {
      border-color: rgba(180,138,255,0.3);
    }
    .term-input--accent:focus {
      border-color: var(--accent, #b48aff);
      box-shadow: 0 0 8px rgba(180,138,255,0.15),
                  inset 0 0 6px rgba(180,138,255,0.04);
    }

    /* ── Submit / action button (cyan theme) ── */
    .term-btn--submit {
      background: rgba(74,255,204,0.06);
      color: var(--accent2, #4affcc);
      border: 1px solid rgba(74,255,204,0.3);
      padding: 8px 16px;
      font-family: inherit;
      font-size: 10px;
      cursor: pointer;
      letter-spacing: 2px;
      transition: all 0.25s;
      border-radius: 3px;
    }
    .term-btn--submit:hover {
      background: rgba(74,255,204,0.15);
      box-shadow: 0 0 10px rgba(74,255,204,0.15);
      text-shadow: 0 0 6px rgba(74,255,204,0.3);
    }
    .term-btn--submit.is-busy {
      color: #ffaa44;
      pointer-events: none;
    }

    /* ── Match button (purple) ── */
    .term-btn--match {
      background: rgba(180,138,255,0.08);
      color: var(--accent, #b48aff);
      border: 1px solid rgba(180,138,255,0.3);
      padding: 8px 14px;
      font-family: inherit;
      font-size: 10px;
      cursor: pointer;
      letter-spacing: 2px;
      border-radius: 3px;
      transition: all 0.25s;
    }
    .term-btn--match:hover {
      background: rgba(180,138,255,0.18);
      box-shadow: 0 0 10px rgba(180,138,255,0.15);
    }

    /* ══════════════════════════════════════════════════════════════
       DIFF DISPLAY — Code diffs from refinement
    ══════════════════════════════════════════════════════════════ */
    .term-diff {
      background: rgba(0,0,0,0.35);
      border: 1px solid var(--border, #1a1535);
      border-radius: 3px;
      padding: 8px;
      margin: 4px 0;
      font-family: var(--font-mono, 'Share Tech Mono', monospace);
      font-size: 9px;
      white-space: pre-wrap;
      overflow-x: auto;
      color: #888;
    }
    .term-diff--ok { color: var(--accent2, #4affcc); }
    .term-diff .diff-add { color: var(--accent2, #4affcc); }
    .term-diff .diff-del { color: #ff6644; }

    /* ── Budget text ── */
    .term-budget {
      font-size: 9px;
      color: #666;
      letter-spacing: 1px;
      margin: 2px 0;
    }

    /* ── Error text ── */
    .term-error {
      color: #ff6644;
      font-size: 10px;
      margin: 4px 0;
      text-shadow: 0 0 4px rgba(255,102,68,0.2);
    }

    /* ── Result area ── */
    .term-result-area {
      margin: 6px 0;
      font-size: 10px;
      max-height: 200px;
      overflow-y: auto;
    }

    /* ── Export result ── */
    .term-export-result {
      background: rgba(0,0,0,0.3);
      border: 1px solid var(--border, #1a1535);
      border-radius: 3px;
      padding: 10px;
      margin: 6px 0;
      font-size: 10px;
      max-height: 300px;
      overflow-y: auto;
    }

    /* ── Export button — color set via --btn-color ── */
    .term-btn--export {
      background: transparent;
      color: var(--btn-color, var(--accent2));
      border: 1px solid color-mix(in srgb, var(--btn-color, var(--accent2)) 25%, transparent);
      padding: 6px 14px;
      font-family: inherit;
      font-size: 10px;
      cursor: pointer;
      letter-spacing: 1.5px;
      transition: all 0.25s;
      border-radius: 3px;
    }
    .term-btn--export:hover {
      border-color: var(--btn-color, var(--accent2));
      background: color-mix(in srgb, var(--btn-color, var(--accent2)) 8%, transparent);
      box-shadow: 0 0 8px color-mix(in srgb, var(--btn-color, var(--accent2)) 15%, transparent);
    }
    .term-btn--export.is-disabled {
      opacity: 0.5;
      pointer-events: none;
    }

    /* ══════════════════════════════════════════════════════════════
       AUTH BUTTONS — Login / Sign-in
    ══════════════════════════════════════════════════════════════ */
    .term-btn--login {
      background: rgba(123,79,255,0.12);
      color: var(--accent, #b48aff);
      border: 1px solid var(--accent, #b48aff);
      padding: 10px 24px;
      font-family: inherit;
      font-size: 13px;
      cursor: pointer;
      letter-spacing: 1.5px;
      transition: all 0.25s;
    }
    .term-btn--login:hover {
      background: rgba(123,79,255,0.25);
      box-shadow: 0 0 14px rgba(123,79,255,0.2);
      text-shadow: 0 0 8px rgba(180,138,255,0.4);
    }
    .term-btn--signin-link {
      background: none;
      color: var(--accent2, #4affcc);
      border: none;
      padding: 10px 8px;
      font-family: inherit;
      font-size: 11px;
      cursor: pointer;
      letter-spacing: 1px;
      opacity: 0.8;
      transition: opacity 0.2s, text-shadow 0.2s;
    }
    .term-btn--signin-link:hover {
      opacity: 1;
      text-shadow: 0 0 6px rgba(74,255,204,0.3);
    }
    .term-btn-row {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 4px;
    }

    /* ══════════════════════════════════════════════════════════════
       AUDIO PREVIEW
    ══════════════════════════════════════════════════════════════ */
    .term-preview-header {
      display: flex;
      align-items: center;
      gap: 8px;
      margin: 2px 0 6px 0;
    }
    .term-type-badge {
      font-size: 8px;
      letter-spacing: 2px;
      color: rgba(255,255,255,0.4);
      background: rgba(255,255,255,0.05);
      padding: 2px 6px;
      border-radius: 2px;
      border: 1px solid rgba(255,255,255,0.1);
    }
    .term-meta {
      font-size: 9px;
      color: rgba(255,255,255,0.25);
      letter-spacing: 1px;
    }
    .term-btn--preview {
      background: rgba(74,255,204,0.06);
      color: var(--accent2, #4affcc);
      border: 1px solid rgba(74,255,204,0.3);
      padding: 6px 16px;
      font-family: inherit;
      font-size: 11px;
      cursor: pointer;
      letter-spacing: 1.5px;
      transition: all 0.25s;
      margin: 4px 0 8px 0;
    }
    .term-btn--preview:hover {
      border-color: var(--accent2);
      background: rgba(74,255,204,0.15);
      box-shadow: 0 0 10px rgba(74,255,204,0.15);
    }
    .term-btn--preview.is-playing {
      color: #ffaa44;
      border-color: #ffaa44;
    }
    .term-preview-progress-wrap {
      width: 200px;
      height: 3px;
      background: rgba(255,255,255,0.06);
      border-radius: 2px;
      margin: 2px 0 4px 0;
      overflow: hidden;
    }
    .term-preview-progress-bar {
      width: 0%;
      height: 100%;
      background: linear-gradient(90deg, var(--accent2), var(--accent));
      border-radius: 2px;
      transition: width 0.1s linear;
    }

    /* ══════════════════════════════════════════════════════════════
       CANVAS PROGRESS BAR (retro pixel style)
    ══════════════════════════════════════════════════════════════ */
    .term-canvas-progress-wrap {
      display: flex;
      align-items: center;
      gap: 8px;
      margin: 6px 0 2px 0;
      height: 32px;
    }
    .term-canvas-label {
      color: rgba(74,255,204,0.33);
      font-size: 9px;
      letter-spacing: 2px;
      font-family: inherit;
      min-width: 70px;
    }
    .term-canvas-bar {
      background: #0a0a0a;
      border: 1px solid rgba(74,255,204,0.13);
      border-radius: 2px;
      image-rendering: pixelated;
    }
    .term-canvas-status {
      color: #ffaa44;
      font-size: 9px;
      letter-spacing: 1px;
      font-family: inherit;
      min-width: 24px;
    }
    .term-canvas-status--done {
      color: var(--accent2, #4affcc);
    }
    .term-canvas-status--idle {
      color: #666;
    }

    /* ── Sketch Player (enhanced with replay + variations) ──── */
    .sketch-player {
      margin: 8px 0 4px 0;
      padding: 8px 12px;
      background: rgba(10, 10, 10, 0.6);
      border: 1px solid rgba(74, 255, 204, 0.1);
      border-radius: 4px;
    }
    .sketch-player-top {
      display: flex;
      align-items: center;
      gap: 8px;
      height: 32px;
    }
    .sketch-label {
      color: rgba(74, 255, 204, 0.33);
      font-size: 9px;
      letter-spacing: 2px;
      font-family: inherit;
      min-width: 60px;
    }
    .sketch-waveform {
      background: #0a0a0a;
      border: 1px solid rgba(74, 255, 204, 0.13);
      border-radius: 2px;
      image-rendering: pixelated;
      flex-shrink: 0;
    }
    .sketch-status {
      color: #ffaa44;
      font-size: 9px;
      letter-spacing: 1px;
      font-family: inherit;
      min-width: 24px;
      white-space: nowrap;
    }
    .sketch-status--done { color: var(--accent2, #4affcc); }
    .sketch-status--playing { color: #ffaa44; animation: sketch-pulse 0.8s ease infinite; }
    .sketch-status--idle { color: #666; }

    @keyframes sketch-pulse {
      0%, 100% { opacity: 1; }
      50% { opacity: 0.4; }
    }

    /* Controls row */
    .sketch-controls {
      display: flex;
      align-items: center;
      gap: 6px;
      margin-top: 6px;
      padding-top: 6px;
      border-top: 1px solid rgba(74, 255, 204, 0.06);
      flex-wrap: wrap;
    }
    .sketch-sep {
      color: rgba(224, 216, 240, 0.3);
      font-size: 9px;
      font-family: inherit;
      letter-spacing: 1px;
    }
    .sketch-btn {
      font-family: inherit;
      font-size: 10px;
      letter-spacing: 1px;
      border: 1px solid rgba(74, 255, 204, 0.2);
      background: transparent;
      color: var(--accent2, #4affcc);
      padding: 3px 10px;
      border-radius: 3px;
      cursor: pointer;
      transition: all 0.15s ease;
      white-space: nowrap;
    }
    .sketch-btn:hover:not(:disabled) {
      background: rgba(74, 255, 204, 0.08);
      border-color: rgba(74, 255, 204, 0.4);
    }
    .sketch-btn:disabled {
      opacity: 0.3;
      cursor: default;
    }
    .sketch-btn.playing {
      border-color: #ffaa44;
      color: #ffaa44;
    }
    .sketch-btn--replay {
      border-color: rgba(74, 255, 204, 0.3);
      color: #4affcc;
    }
    .sketch-btn--replay:hover:not(:disabled) {
      background: rgba(74, 255, 204, 0.1);
    }
    .sketch-btn--var {
      border-color: color-mix(in srgb, var(--var-color, #b48aff) 30%, transparent);
      color: var(--var-color, #b48aff);
    }
    .sketch-btn--var:hover:not(:disabled) {
      background: color-mix(in srgb, var(--var-color, #b48aff) 10%, transparent);
      border-color: color-mix(in srgb, var(--var-color, #b48aff) 50%, transparent);
    }

    /* Body Control button */
    .sketch-btn--body {
      border-color: rgba(255, 68, 255, 0.3);
      color: #ff44ff;
      position: relative;
    }
    .sketch-btn--body:hover:not(:disabled) {
      background: rgba(255, 68, 255, 0.08);
      border-color: rgba(255, 68, 255, 0.5);
      text-shadow: 0 0 6px rgba(255, 68, 255, 0.4);
    }
    .sketch-btn--body.playing {
      animation: bodyPulse 1.5s ease-in-out infinite;
      border-color: rgba(255, 68, 255, 0.6);
      background: rgba(255, 68, 255, 0.06);
    }
    @keyframes bodyPulse {
      0%, 100% { box-shadow: 0 0 4px rgba(255, 68, 255, 0.2); }
      50%      { box-shadow: 0 0 12px rgba(255, 68, 255, 0.5); }
    }

    /* Wider waveform for visual impact */
    .sketch-waveform--wide {
      width: 100%;
      max-width: 480px;
      height: 48px;
      margin: 4px 0 2px 0;
      border-radius: 3px;
    }

    /* Controls row layout */
    .sketch-controls-row {
      display: flex;
      align-items: center;
      gap: 6px;
      flex-wrap: wrap;
    }

    /* Edit toggle button */
    .sketch-btn--edit {
      border-color: rgba(255, 204, 68, 0.3);
      color: #ffcc44;
    }
    .sketch-btn--edit:hover:not(:disabled) {
      background: rgba(255, 204, 68, 0.08);
      border-color: rgba(255, 204, 68, 0.5);
    }
    .sketch-btn--edit.active {
      background: rgba(255, 204, 68, 0.1);
      border-color: rgba(255, 204, 68, 0.5);
      color: #ffe066;
    }

    /* Lock direction button */
    .sketch-btn--lock {
      border-color: rgba(255, 170, 68, 0.3);
      color: #ffaa44;
    }
    .sketch-btn--lock:hover:not(:disabled) {
      background: rgba(255, 170, 68, 0.08);
      border-color: rgba(255, 170, 68, 0.5);
    }
    .sketch-btn--lock.active {
      background: rgba(255, 170, 68, 0.12);
      border-color: rgba(255, 170, 68, 0.6);
      color: #ffcc44;
      text-shadow: 0 0 6px rgba(255, 170, 68, 0.3);
    }

    /* Edit row — parameter knobs */
    .sketch-edit-row {
      display: flex;
      align-items: flex-start;
      gap: 10px;
      flex-wrap: wrap;
      padding: 8px 0 4px 0;
      border-top: 1px solid rgba(74, 255, 204, 0.06);
    }
    .sketch-knob-wrap {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 2px;
      min-width: 52px;
    }
    .sketch-knob-label {
      color: rgba(224, 216, 240, 0.45);
      font-size: 8px;
      letter-spacing: 1.5px;
      font-family: inherit;
    }
    .sketch-knob {
      -webkit-appearance: none;
      appearance: none;
      width: 52px;
      height: 4px;
      background: rgba(74, 255, 204, 0.12);
      border-radius: 2px;
      outline: none;
      cursor: pointer;
    }
    .sketch-knob::-webkit-slider-thumb {
      -webkit-appearance: none;
      appearance: none;
      width: 10px;
      height: 10px;
      border-radius: 50%;
      background: #4affcc;
      border: 1px solid rgba(0, 0, 0, 0.4);
      cursor: pointer;
      box-shadow: 0 0 4px rgba(74, 255, 204, 0.3);
    }
    .sketch-knob::-moz-range-thumb {
      width: 10px;
      height: 10px;
      border-radius: 50%;
      background: #4affcc;
      border: 1px solid rgba(0, 0, 0, 0.4);
      cursor: pointer;
    }
    .sketch-knob-val {
      color: rgba(74, 255, 204, 0.5);
      font-size: 8px;
      font-family: inherit;
      letter-spacing: 0.5px;
    }

    /* Play edited button */
    .sketch-btn--edit-play {
      border-color: rgba(74, 255, 204, 0.4);
      color: #4affcc;
      font-weight: bold;
      align-self: flex-end;
      margin-bottom: 2px;
    }
    .sketch-btn--edit-play:hover:not(:disabled) {
      background: rgba(74, 255, 204, 0.12);
      text-shadow: 0 0 6px rgba(74, 255, 204, 0.3);
    }

    /* ══════════════════════════════════════════════════════════════
       PACK SELECTION (marketplace packs)
    ══════════════════════════════════════════════════════════════ */
    .term-pack-header {
      font-family: inherit;
      font-size: 11px;
      color: var(--accent2, #4affcc);
      letter-spacing: 2px;
      margin-bottom: 6px;
    }
    .term-pack-row {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      margin-bottom: 12px;
    }
    .term-pack-btn {
      color: #e0d6c8;
      background: rgba(74,255,204,0.06);
      border: 1px solid rgba(74,255,204,0.25);
      padding: 10px 14px;
      font-family: inherit;
      font-size: 11px;
      cursor: pointer;
      letter-spacing: 0.5px;
      text-align: center;
      transition: all 0.25s;
      min-width: 110px;
    }
    .term-pack-btn:hover {
      border-color: var(--btn-color, var(--accent2));
      background: color-mix(in srgb, var(--btn-color, var(--accent2)) 12%, transparent);
      box-shadow: 0 0 10px color-mix(in srgb, var(--btn-color, var(--accent2)) 12%, transparent);
    }

    /* ══════════════════════════════════════════════════════════════
       RESUME BANNER
    ══════════════════════════════════════════════════════════════ */
    .term-resume-banner {
      position: absolute;
      bottom: 80px;
      left: 50%;
      transform: translateX(-50%);
      z-index: 20;
      text-align: center;
      width: 90%;
      max-width: 460px;
    }

    /* ══════════════════════════════════════════════════════════════
       MOBILE RESPONSIVE — Terminal content
    ══════════════════════════════════════════════════════════════ */
    @media (max-width: 640px) {
      .term-row,
      .term-row--tight,
      .term-row--entry,
      .term-row--tier,
      .term-row--export,
      .term-row--stats {
        gap: 6px;
      }

      .term-btn {
        padding: 6px 10px;
        font-size: 10px;
        letter-spacing: 1px;
      }
      .term-btn--sm {
        padding: 4px 8px;
        font-size: 8px;
      }
      .term-btn--lg,
      .term-btn--entry {
        padding: 6px 10px;
        font-size: 9px;
      }

      .term-tier-card {
        min-width: 120px;
        max-width: 100%;
        padding: 10px 12px;
        font-size: 11px;
      }

      .term-reveal-name {
        font-size: clamp(18px, 5vw, 28px);
        letter-spacing: 2px;
      }

      .term-cta {
        padding: 12px 20px;
        font-size: 15px;
        letter-spacing: 2px;
        width: 100%;
        text-align: center;
      }

      .term-row--stats {
        gap: 10px;
        justify-content: center;
      }
      .term-stat-value {
        font-size: 18px;
      }

      .term-input {
        font-size: 10px;
        padding: 7px 10px;
      }

      .term-btn--submit,
      .term-btn--match {
        padding: 7px 12px;
        font-size: 9px;
      }

      .term-row--inline {
        flex-direction: column;
        align-items: stretch;
      }
      .term-row--inline .term-btn--submit,
      .term-row--inline .term-btn--match {
        width: 100%;
      }

      .term-diff {
        font-size: 8px;
        padding: 6px;
      }

      .term-pack-btn {
        min-width: 90px;
        font-size: 10px;
        padding: 8px 10px;
      }
    }

    @media (max-width: 400px) {
      .term-tier-card {
        min-width: 100%;
      }
      .term-row--tier {
        flex-direction: column;
      }
      .term-btn {
        width: 100%;
        text-align: center;
      }
    }

/* ═══════════════════════════════════════════════════════════════
   FREE TIER CARD VARIANT
   ═══════════════════════════════════════════════════════════════ */
.term-tier-card--free {
  border-style: dashed;
}
.term-tier-card--free .tier-price {
  color: var(--ok, #88ff99);
  text-shadow: 0 0 6px rgba(136, 255, 153, 0.4);
}

/* ═══════════════════════════════════════════════════════════════
   TIER ROW — 5-column layout for new tier structure
   ═══════════════════════════════════════════════════════════════ */
.term-row--tier {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ═══════════════════════════════════════════════════════════════
   POST-BUILD UPSELL
   ═══════════════════════════════════════════════════════════════ */
.term-upsell {
  background: color-mix(in srgb, var(--upsell-color, #b48aff) 4%, transparent);
  border: 1px solid color-mix(in srgb, var(--upsell-color, #b48aff) 20%, transparent);
  border-radius: 6px;
  padding: 16px 20px;
  margin: 8px 0;
  text-align: center;
  transition: opacity 0.3s ease;
}
.term-upsell-headline {
  color: var(--upsell-color, #b48aff);
  font-family: 'Space Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  margin-bottom: 6px;
}
.term-upsell-pitch {
  color: #999;
  font-size: 11px;
  letter-spacing: 0.5px;
  margin-bottom: 14px;
  line-height: 1.5;
}
.term-upsell-btn {
  display: inline-block;
  background: color-mix(in srgb, var(--btn-color, #b48aff) 12%, transparent);
  color: var(--btn-color, #b48aff);
  border: 1px solid color-mix(in srgb, var(--btn-color, #b48aff) 30%, transparent);
  padding: 8px 24px;
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s ease;
}
.term-upsell-btn:hover {
  background: color-mix(in srgb, var(--btn-color, #b48aff) 20%, transparent);
  box-shadow: 0 0 12px color-mix(in srgb, var(--btn-color, #b48aff) 25%, transparent);
  transform: translateY(-1px);
}
.term-upsell-dismiss {
  color: #555;
  font-size: 9px;
  letter-spacing: 0.5px;
  cursor: pointer;
  margin-top: 10px;
  transition: color 0.2s;
}
.term-upsell-dismiss:hover {
  color: #888;
}

/* ══════════════════════════════════════════════════════════════
   GUIDED FIRST BUILD — new-user template picker
══════════════════════════════════════════════════════════════ */
.first-build-templates {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin: 16px 0 12px;
  padding: 0 4px;
}
.first-build-template-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: color-mix(in srgb, var(--tmpl-color, #b48aff) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--tmpl-color, #b48aff) 25%, transparent);
  color: var(--tmpl-color, #b48aff);
  padding: 10px 14px;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.25s ease;
  text-align: left;
  line-height: 1.3;
}
.first-build-template-btn:hover {
  background: color-mix(in srgb, var(--tmpl-color, #b48aff) 18%, transparent);
  box-shadow: 0 0 16px color-mix(in srgb, var(--tmpl-color, #b48aff) 20%, transparent),
              inset 0 0 20px color-mix(in srgb, var(--tmpl-color, #b48aff) 5%, transparent);
  border-color: color-mix(in srgb, var(--tmpl-color, #b48aff) 50%, transparent);
  transform: translateY(-2px);
}
.first-build-template-btn:active {
  transform: translateY(0);
  transition-duration: 0.05s;
}
.first-build-template-icon {
  font-size: 16px;
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.first-build-template-btn:hover .first-build-template-icon {
  opacity: 1;
}

/* Custom idea text input row */
.first-build-custom {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  padding: 0 4px;
}
.first-build-custom input {
  flex: 1;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(180,138,255,0.2);
  color: #ccc;
  padding: 9px 12px;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  border-radius: 4px;
  outline: none;
  transition: border-color 0.2s;
}
.first-build-custom input::placeholder {
  color: #555;
  font-style: italic;
}
.first-build-custom input:focus {
  border-color: rgba(180,138,255,0.5);
  box-shadow: 0 0 8px rgba(180,138,255,0.1);
}
.first-build-custom button {
  background: color-mix(in srgb, #b48aff 15%, transparent);
  border: 1px solid color-mix(in srgb, #b48aff 35%, transparent);
  color: #b48aff;
  padding: 9px 18px;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.first-build-custom button:hover {
  background: color-mix(in srgb, #b48aff 25%, transparent);
  box-shadow: 0 0 12px rgba(180,138,255,0.15);
}

/* Skip / escape hatch */
.first-build-skip {
  text-align: center;
  margin-top: 14px;
  padding-bottom: 4px;
}
.first-build-skip-btn {
  background: none;
  border: none;
  color: #444;
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.8px;
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.2s;
}
.first-build-skip-btn:hover {
  color: #777;
}

/* Responsive: stack templates on narrow screens */
@media (max-width: 600px) {
  .first-build-templates {
    grid-template-columns: 1fr;
  }
}


/* ══════════════════════════════════════════════════════════════
   CONTROL SURFACE — Unified Build Axis Selector
   ══════════════════════════════════════════════════════════════ */

.cs-surface {
  max-width: 860px;
  width: 100%;
  margin: 8px auto 12px auto;
}

.cs-panel {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 14px;
  margin-bottom: 10px;
  position: relative;
}
.cs-panel::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 4px;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(180,138,255,0.03), transparent 40%);
}

.cs-section-label {
  font-size: 9px;
  letter-spacing: 3px;
  color: var(--text2);
  text-transform: uppercase;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.cs-section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.cs-axis-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}
@media (max-width: 640px) {
  .cs-axis-grid { grid-template-columns: 1fr; }
}

.cs-btn-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.cs-btn {
  background: transparent;
  color: var(--text2);
  border: 1px solid var(--border);
  padding: 5px 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  position: relative;
}
.cs-btn:hover {
  border-color: var(--border2);
  color: var(--text);
}
.cs-btn.active {
  border-color: var(--btn-color, var(--accent));
  color: var(--btn-color, var(--accent));
  background: color-mix(in srgb, var(--btn-color, var(--accent)) 12%, transparent);
  box-shadow: 0 0 8px color-mix(in srgb, var(--btn-color, var(--accent)) 25%, transparent);
}
.cs-btn.multi-active {
  border-color: var(--btn-color, var(--accent));
  color: var(--btn-color, var(--accent));
  background: color-mix(in srgb, var(--btn-color, var(--accent)) 10%, transparent);
  box-shadow: 0 0 6px color-mix(in srgb, var(--btn-color, var(--accent)) 20%, transparent);
}

.cs-btn.compact {
  padding: 3px 7px;
  font-size: 9px;
  letter-spacing: 1px;
}

.cs-btn.value {
  border-color: var(--border);
  color: var(--text2);
  font-size: 9px;
  padding: 3px 8px;
}
.cs-btn.value.active {
  background: color-mix(in srgb, var(--btn-color, var(--accent)) 8%, transparent);
  color: color-mix(in srgb, var(--btn-color, var(--accent)) 70%, var(--text));
  border-color: color-mix(in srgb, var(--btn-color, var(--accent)) 45%, transparent);
  box-shadow: 0 0 6px color-mix(in srgb, var(--btn-color, var(--accent)) 15%, transparent);
}

.cs-desc {
  font-size: 10px;
  color: var(--text2);
  margin-top: 6px;
  min-height: 14px;
  letter-spacing: 0.3px;
  line-height: 1.4;
}

.cs-axis-col {
  min-width: 0;
}
.cs-axis-col .cs-section-label {
  font-size: 8px;
  margin-bottom: 6px;
}

.cs-top-bar {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 10px;
}
.cs-top-bar .cs-panel {
  margin-bottom: 0;
  flex: 1;
}

.cs-style-pill {
  background: transparent;
  color: var(--text2);
  border: 1px solid var(--border);
  padding: 2px 8px;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 1.5px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.cs-style-pill:hover { border-color: var(--border2); color: var(--text); }
.cs-style-pill.active {
  border-color: var(--btn-color, #ffd700);
  color: var(--btn-color, #ffd700);
  background: color-mix(in srgb, var(--btn-color, #ffd700) 10%, transparent);
  box-shadow: 0 0 5px color-mix(in srgb, var(--btn-color, #ffd700) 15%, transparent);
}

.cs-readout {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 6px 12px;
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 9px;
  letter-spacing: 1px;
}
.cs-readout-item { display: flex; gap: 4px; }
.cs-readout-key { color: var(--text2); }
.cs-readout-val { color: var(--accent); }

.cs-multi-count {
  display: inline-block;
  background: var(--accent);
  color: var(--bg);
  font-size: 8px;
  padding: 1px 4px;
  border-radius: 2px;
  margin-left: 6px;
  font-weight: bold;
  letter-spacing: 0;
}
.cs-multi-count.cs-shake {
  animation: csShake 0.4s ease;
}
@keyframes csShake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-3px); }
  40%      { transform: translateX(3px); }
  60%      { transform: translateX(-2px); }
  80%      { transform: translateX(2px); }
}

.cs-product-grid {
  max-height: 72px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
}
.cs-product-grid::-webkit-scrollbar { width: 3px; }
.cs-product-grid::-webkit-scrollbar-thumb { background: var(--border2); }

@media (max-width: 640px) {
  .cs-top-bar { flex-direction: column; }
  .cs-top-bar .cs-panel { flex: 1 !important; }
}
