    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
    html { font-size: 13px; }
    html, body { height: 100%; overflow: hidden; }
    body {
      font-family: 'Inter', system-ui, -apple-system, sans-serif;
      font-size: 1rem;
      background-color: #0d1121;
      background-image: radial-gradient(rgba(99, 130, 200, 0.14) 1px, transparent 1px);
      background-size: 28px 28px;
      color: var(--text);
      display: flex;
      flex-direction: column;
      transition: background 0.2s, color 0.2s;
      -webkit-font-smoothing: antialiased;
    }
    /* Enforce global typography across all industrial UI surfaces */
    input, button, textarea, select, #statusbar, #sim-timeline, .ins-head, .fn-title {
      font-family: 'Inter', system-ui, -apple-system, sans-serif !important;
    }

    /* ─── Color vars — Salesforce/Enterprise Dark ─────────────────── */
    :root {
      --bg:        #0f172a; /* Slate 900 */
      --bg1:       #1e293b; /* Slate 800 */
      --bg2:       #334155; /* Slate 700 */
      --bg3:       #475569; /* Slate 600 */
      --border:    #1e293b;
      --border2:   #334155;
      --cyan:      #38bdf8; /* Sky 400 */
      --blue:      #0176d3; /* Salesforce Blue */
      --green:     #10b981; /* Emerald 500 */
      --red:       #ef4444; /* Red 500 */
      --amber:     #f59e0b; /* Amber 500 */
      --text:      #f1f5f9; /* Slate 100 */
      --muted:     #cbd5e1; /* Slate 300 */
      --muted2:    #e2e8f0; /* Slate 200 */
      --active-file-bg: #0c4a6e; /* Sky 900 */
      --sidebar-w: 240px;
      --output-h:  220px;
      --radius:    12px;
      --shadow:    0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    }

    /* ─── Color vars — Salesforce Light ──────────────────────────── */
    html[data-theme="light"] {
      --bg:        #f8fafc; /* Slate 50 */
      --bg1:       #ffffff;
      --bg2:       #f1f5f9; /* Slate 100 */
      --bg3:       #e2e8f0; /* Slate 200 */
      --border:    #e2e8f0;
      --border2:   #cbd5e1;
      --cyan:      #0284c7; /* Sky 600 */
      --blue:      #0176d3;
      --green:     #059669;
      --red:       #dc2626;
      --amber:     #d97706;
      --text:      #0f172a; /* Slate 900 */
      --muted:     #64748b; /* Slate 500 */
      --muted2:    #94a3b8;
      --active-file-bg: #e0f2fe; /* Sky 100 */
      --shadow:    0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    }
    html[data-theme="light"] body { background: var(--bg); }
    html[data-theme="light"] .tree-file.active { background: var(--active-file-bg); }

    /* ── Topbar in light mode ─────────────────────────────────────── */
    html[data-theme="light"] #topbar {
      background: #ffffff;
      border-bottom-color: var(--border);
      box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    }
    html[data-theme="light"] .nav-tab { color: var(--muted); opacity: 0.75; }
    html[data-theme="light"] .nav-tab:hover {
      background: rgba(0,0,0,0.05) !important;
      color: var(--text);
    }
    html[data-theme="light"] .nav-tab.active {
      color: var(--blue);
      background: rgba(1,118,211,0.1) !important;
      border: none !important;
    }
    html[data-theme="light"] .tb-btn { color: var(--muted); }
    html[data-theme="light"] .tb-btn:hover { background: var(--bg2); color: var(--text); border-color: var(--border); }
    html[data-theme="light"] .tb-sep { background: var(--border); }
    html[data-theme="light"] .tb-logo { border-right-color: var(--border); }

    /* ── Tier badges ─────────────────────────────────────────────── */
    html[data-theme="light"] .tier-badge,
    html[data-theme="light"] .tb-badge        { background: var(--bg2) !important; border-color: var(--border2) !important; color: var(--muted) !important; }
    html[data-theme="light"] .badge-t2,
    html[data-theme="light"] .tb-badge.badge-t2,
    html[data-theme="light"] .tier-badge.badge-t2 { background: #dceeff !important; border-color: #a0c8f0 !important; color: #1a5fb4 !important; }
    html[data-theme="light"] .badge-t3,
    html[data-theme="light"] .tb-badge.badge-t3,
    html[data-theme="light"] .tier-badge.badge-t3 { background: #fff0d8 !important; border-color: #f0c080 !important; color: #b45309 !important; }
    html[data-theme="light"] .badge-t4,
    html[data-theme="light"] .tb-badge.badge-t4,
    html[data-theme="light"] .tier-badge.badge-t4 { background: #f5f0ff !important; border-color: #c4b5fd !important; color: #6d28d9 !important; }

    /* ── Status badges ───────────────────────────────────────────── */
    html[data-theme="light"] .status-ok      { background: #d8f5e8; color: var(--green); border-color: #90d8b0; }
    html[data-theme="light"] .status-error   { background: #fde8eb; color: var(--red);   border-color: #f0a0a8; }
    html[data-theme="light"] .status-running { background: #fff3d8; color: var(--amber); border-color: #f0c878; }
    html[data-theme="light"] .status-idle    { background: var(--bg2); color: var(--muted); border-color: var(--border); }

    /* ── Output panels ───────────────────────────────────────────── */
    html[data-theme="light"] .print-output { background: #f8fff8; border-color: #b0d8b0; }
    html[data-theme="light"] .error-output { background: #fff8f8; border-color: #f0b0b0; }
    html[data-theme="light"] .meta-item    { background: var(--bg2); border-color: var(--border); }
    html[data-theme="light"] .err-box      { background: #fff0f0; border-color: #f0b0b0; color: var(--red); }

    /* ── Shell UI surfaces ───────────────────────────────────────── */
    html[data-theme="light"] #statusbar    { background: #e0e4e8; color: var(--muted); }
    html[data-theme="light"] .activity-bar { background: #e8ebef; border-color: var(--border); }
    html[data-theme="light"] .dash-card    { background: var(--bg1); border-color: var(--border); }

    /* ── Upskill / plan modal ────────────────────────────────────── */
    html[data-theme="light"] .plan-card            { background: var(--bg1); border-color: var(--border); }
    html[data-theme="light"] .plan-card.highlight  { background: #fffbeb; border-color: var(--amber); }
    html[data-theme="light"] .plan-btn-std  { background: #dceeff; color: #1a5fb4; border-color: #a0c8f0; }
    html[data-theme="light"] .plan-btn-std:hover { background: #c0ddff; }
    html[data-theme="light"] .plan-btn-pro  { background: #fff0d8; color: #b45309; border-color: #f0c080; }
    html[data-theme="light"] .plan-btn-pro:hover { background: #ffe8c0; }
    html[data-theme="light"] .upskill-inline-btn      { background: var(--bg2); color: var(--text); }
    html[data-theme="light"] .upskill-inline-btn:hover { background: var(--bg3); }

    /* ── Library item separators ─────────────────────────────────── */
    html[data-theme="light"] .lib-item { border-bottom-color: var(--border); }

    /* ── Premium library text in light mode ───────────────────────── */
    html[data-theme="light"] #premium-file-tree .tree-dir { color: var(--text); opacity: 1; }
    html[data-theme="light"] #premium-file-tree .tree-file { color: var(--muted); }
    html[data-theme="light"] #premium-file-tree .tree-file:hover { color: var(--text); }
    html[data-theme="light"] #premium-file-tree .tree-file.active {
      background: var(--active-file-bg);
      color: var(--blue);
    }
    html[data-theme="light"] #premium-tree-container .tree-root-header { color: var(--text); opacity: 1; }

    /* ── Lab / Flow light mode fixes ──────────────────────────────── */
    html[data-theme="light"] .fn-head { background: rgba(0,0,0,0.04); }
    html[data-theme="light"] .toolbar-group { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.08); }
    html[data-theme="light"] .lib-category-header { border-bottom-color: var(--border); }
    html[data-theme="light"] #flow-inspector { box-shadow: 0 8px 30px rgba(0,0,0,0.15); }
    html[data-theme="light"] .flow-toolbar { box-shadow: 0 4px 20px rgba(0,0,0,0.12); border-color: var(--border); }
    html[data-theme="light"] #global-timeline::-webkit-slider-runnable-track { background: rgba(0,0,0,0.12) !important; }
    html[data-theme="light"] #global-timeline::-moz-range-track { background: rgba(0,0,0,0.12) !important; }
    html[data-theme="light"] .timeline-slider { background: rgba(0,0,0,0.12); }

    /* ─── Modern Components ────────────────────────────────────────── */
    .btn {
      display: inline-flex; align-items: center; justify-content: center;
      gap: 6px; padding: 6px 12px; border-radius: var(--radius);
      font-weight: 500; cursor: pointer; transition: all 0.2s;
      border: 1px solid transparent; outline: none;
      font-family: inherit; font-size: 1rem;
    }
    .btn-primary { background: var(--blue); color: white; }
    .btn-primary:hover { background: #005fb2; transform: translateY(-1px); box-shadow: var(--shadow); }
    .btn-ghost { background: transparent; color: var(--muted); }
    .btn-ghost:hover { background: var(--bg2); color: var(--text); }

    .card {
      background: var(--bg1); border: 1px solid var(--border);
      border-radius: var(--radius); padding: 16px;
      box-shadow: var(--shadow); transition: transform 0.2s, box-shadow 0.2s;
    }
    .card:hover { transform: translateY(-2px); box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1); }

    /* ─── Flow Lab Layout (TernFlow) ────────────────────────────────── */
    #view-flow {
      flex: 1; display: none; overflow: hidden;
      flex-direction: row; background: var(--bg);
    }
    #view-flow.active { display: flex; }

    /* Flow Library (Left) */
    #flow-library {
      width: 200px; background: var(--bg1);
      border-right: 1px solid var(--border);
      display: flex; flex-direction: column; flex-shrink: 0;
    }
    .lib-search {
      padding: 12px; border-bottom: 1px solid var(--border);
    }
    .lib-item {
      padding: 10px 16px; font-size: 0.92rem; color: var(--muted);
      cursor: grab; display: flex; align-items: center; gap: 8px;
      transition: all 0.15s; border-bottom: 1px solid rgba(255,255,255,0.02);
    }
    .lib-item:hover { background: var(--bg2); color: var(--text); }
    .lib-item i { width: 14px; color: var(--cyan); }

    /* Flow Canvas (Center) */
    #flow-canvas-wrap {
      flex: 1; position: relative; overflow: hidden; cursor: default;
      background-image: radial-gradient(var(--border2) 1px, transparent 1px);
      background-size: 32px 32px;
    }
    #flow-canvas-wrap.panning { cursor: grabbing; }
    #flow-canvas {
      width: 5000px; height: 5000px;
      position: absolute; top: 0; left: 0;
      transform-origin: 0 0;
      will-change: transform;
      transition: transform 40ms linear;
      z-index: 10;
    }
    #flow-fog-canvas {
      position: absolute; top: 0; left: 0;
      width: 100%; height: 100%;
      pointer-events: none;
      z-index: 1; /* Behind the #flow-canvas (which is z-index 10) */
      mix-blend-mode: screen;
      opacity: 0.4;
    }
    /* SVG follows canvas transform to prevent clipping */
    #flow-svg-layer {
      position: absolute; top: 0; left: 0;
      width: 100%; height: 100%; pointer-events: none;
      z-index: 5;
      overflow: visible;
    }
    #flow-svg-layer path { pointer-events: stroke; }
    #flow-svg-layer .wire-hit { pointer-events: stroke; cursor: pointer; }

    /* Spline handle style */
    .wire-handle {
      width: 12px; height: 12px;
      background: var(--cyan);
      border: 2px solid #fff;
      border-radius: 50%;
      position: absolute;
      cursor: move;
      pointer-events: auto;
      z-index: 100;
      box-shadow: 0 0 10px rgba(56,189,248,0.5);
      display: none;
      transform: translate(-50%, -50%);
    }
    .wire-handle.active { display: block; }
    .wire-handle:hover { background: #fff; transform: translate(-50%, -50%) scale(1.2); }
    /* Canvas Zoom controls — top-right corner */
    #zoom-indicator {
      position: absolute; top: 16px; right: 20px; bottom: auto; left: auto;
      display: flex; align-items: center; gap: 4px;
      background: var(--bg1); backdrop-filter: blur(12px);
      border: 1px solid var(--cyan); border-radius: 20px;
      padding: 6px 14px; z-index: 200;
      box-shadow: 0 4px 16px rgba(0,0,0,0.4);
      transition: all 0.2s ease;
    }
    #zoom-indicator button { background: none; border: none; color: var(--muted); cursor: pointer; padding: 2px 6px; font-size: 1.0769rem; line-height: 1; border-radius: 4px; }
    #zoom-indicator button:hover { background: rgba(34, 211, 238, 0.1); color: var(--cyan); }
    [data-theme="light"] #zoom-indicator {
      background: rgba(240, 240, 240, 0.9);
      border-color: rgba(6, 182, 212, 0.5);
    }
    [data-theme="light"] #zoom-indicator button { color: #1a1a1a; }
    [data-theme="light"] #zoom-indicator #zoomLabel { color: #1a1a1a; font-weight: 700; }

    /* Theme-aware timeline track */
    [data-theme="light"] .timeline-slider {
      background: rgba(0, 0, 0, 0.1);
    }
    html:not([data-theme="light"]) .timeline-slider {
      background: rgba(74, 74, 74, 0.4);
    }
    .flow-wire {
      fill: none; stroke: var(--border2); stroke-width: 2;
      stroke-linecap: round; transition: stroke 0.3s, stroke-width 0.3s;
      cursor: pointer;
    }
    .flow-wire:hover { stroke: var(--cyan); stroke-width: 3; }
    .flow-wire.selected-wire { stroke: var(--blue); stroke-width: 3; stroke-dasharray: 6 3; }
    .flow-wire.cond-affirm { stroke: var(--green); }
    .flow-wire.cond-tend   { stroke: var(--amber); }
    .flow-wire.cond-reject { stroke: var(--red); }
    .flow-wire.cond-all    { stroke: var(--cyan); }
    .flow-wire.active-1  { stroke: var(--green); stroke-width: 3; filter: drop-shadow(0 0 4px var(--green)); }
    .flow-wire.active-0  { stroke: var(--amber); stroke-width: 3; }
    .flow-wire.active-n1 { stroke: var(--red); stroke-width: 3; }

    /* Edge condition badge on wire midpoint */
    .edge-badge {
      position: absolute; background: var(--bg1); border: 1px solid var(--border2);
      border-radius: 10px; padding: 1px 7px; font-size: 0.6923rem; font-weight: 700;
      color: var(--muted); pointer-events: none; transform: translate(-50%,-50%);
      white-space: nowrap; z-index: 25;
    }
    .edge-badge.cond-affirm { border-color: var(--green); color: var(--green); }
    .edge-badge.cond-tend   { border-color: var(--amber); color: var(--amber); }
    .edge-badge.cond-reject { border-color: var(--red);   color: var(--red); }

    /* Archetype panel */
    .archetype-card {
      background: var(--bg2); border: 1px solid var(--border2); border-radius: 12px;
      padding: 14px; cursor: pointer; transition: all 0.2s;
      margin-bottom: 12px;
    }
    .archetype-card:hover { border-color: var(--cyan); background: rgba(56,189,248,0.05); transform: translateY(-2px); }
    .archetype-card-title {
      font-size: 1.0000rem; font-weight: 800; color: var(--cyan);
      margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.02em;
    }
    .archetype-card-desc {
      font-size: 0.8462rem; color: var(--text); opacity: 0.9;
      line-height: 1.7; font-weight: 400;
    }

    /* Resizers */
    .sidebar-resizer {
      width: 4px; cursor: ew-resize; background: transparent;
      transition: background 0.2s; z-index: 1000;
    }
    .sidebar-resizer:hover, .sidebar-resizer.active { background: var(--cyan); }
    
    /* 8-way resize handles for the Execution Inspector */
    .ins-resize-handle {
      position: absolute; z-index: 10; user-select: none;
    }
    .ins-r-n  { top: 0;    left: 12px;   right: 12px;  height: 6px; cursor: n-resize; }
    .ins-r-s  { bottom: 0; left: 12px;   right: 12px;  height: 6px; cursor: s-resize; }
    .ins-r-e  { right: 0;  top: 12px;    bottom: 12px; width: 6px;  cursor: e-resize; }
    .ins-r-w  { left: 0;   top: 12px;    bottom: 12px; width: 6px;  cursor: w-resize; }
    .ins-r-ne { top: 0;    right: 0;  width: 14px; height: 14px; cursor: ne-resize; }
    .ins-r-nw { top: 0;    left: 0;   width: 14px; height: 14px; cursor: nw-resize; }
    .ins-r-se { bottom: 0; right: 0;  width: 14px; height: 14px; cursor: se-resize; }
    .ins-r-sw { bottom: 0; left: 0;   width: 14px; height: 14px; cursor: sw-resize; }
    .ins-resize-handle:hover { background: rgba(100,200,255,0.07); }
    .lib-tab {
      flex: 1; background: none; border: none; padding: 8px;
      font-family: 'Inter', sans-serif; font-size: 0.8462rem; font-weight: 700;
      color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent;
      transition: all 0.2s;
    }
    .lib-tab.active { color: var(--text); border-bottom-color: var(--cyan); }

    .flow-node.external {
      border-color: var(--amber);
      box-shadow: 0 0 15px rgba(245, 158, 11, 0.15), var(--shadow);
    }
    .flow-node.external.selected { border-color: var(--amber); border-width: 2px; box-shadow: 0 0 20px rgba(245, 158, 11, 0.3); }
    
    .node-badge-llm {
      position: absolute; top: -8px; left: -8px;
      background: var(--amber); color: #000;
      font-size: 0.6154rem; font-weight: 900; padding: 2px 5px;
      border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.3);
      z-index: 20;
    }

    /* Flow Properties (Right) */
    #flow-props {
      width: 280px; background: var(--bg1);
      border-left: 1px solid var(--border);
      display: flex; flex-direction: column; flex-shrink: 0;
    }
    .prop-header {
      padding: 12px 16px; border-bottom: 1px solid var(--border);
      font-size: 1rem; font-weight: 700; color: var(--text);
      text-transform: uppercase; letter-spacing: 0.05em;
    }
    .prop-body { padding: 16px; display: flex; flex-direction: column; gap: 18px; }
    .prop-group { display: flex; flex-direction: column; gap: 8px; }
    .prop-label { font-size: 0.92rem; font-weight: 600; color: var(--muted); text-transform: uppercase; margin-bottom: 2px; }
    .prop-input {
      background: var(--bg2); border: 1px solid var(--border2);
      border-radius: 8px; color: var(--text); padding: 10px;
      font-family: inherit; font-size: 1.08rem; outline: none;
      line-height: 1.5;
    }
    .prop-input:focus { border-color: var(--blue); }

    /* Radio/Checkbox scaling in Props */
    .prop-group input[type="radio"], .prop-group input[type="checkbox"] {
      width: 16px; height: 16px;
    }
    .prop-group label { font-size: 1.0769rem; line-height: 1.6; }

    /* ─── Flow Floating Toolbar Overhaul ──────────────────────────── */
    .flow-toolbar {
      position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%);
      display: flex; gap: 12px; align-items: center; z-index: 100;
      background: var(--bg1); backdrop-filter: blur(20px);
      border: 1px solid var(--border2); border-radius: 50px;
      padding: 6px 12px; box-shadow: 0 12px 40px rgba(0,0,0,0.5);
    }
    .toolbar-group {
      display: flex; align-items: center; gap: 4px;
      padding: 2px 6px; border-radius: 40px;
      background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.05);
    }
    .toolbar-divider { width: 1px; height: 18px; background: var(--border2); margin: 0 4px; }
    
    .btn-pill {
      height: 30px; padding: 0 12px; border-radius: 20px;
      font-size: 0.8462rem; font-weight: 700; color: var(--muted);
      transition: all 0.2s; border: 1px solid transparent;
      background: transparent; cursor: pointer; display: flex; align-items: center; gap: 6px;
    }
    .btn-pill:hover { background: var(--bg2); color: var(--text); }
    .btn-pill.primary { background: var(--blue); color: white; border: none; }
    .btn-pill.primary:hover { background: #0084ff; transform: scale(1.05); }
    .btn-pill.simulate { 
      background: #10b981; color: #FFFFFF !important; padding: 0 16px; border-radius: 20px;
      box-shadow: 0 0 15px rgba(16,185,129,0.2);
    }
    .btn-pill.simulate:hover { background: #34d399; transform: translateY(-1px); }
    .btn-pill.simulate.running { background: var(--amber); animation: pulse-node-hold 1s infinite; }

    .speed-slider-industrial {
      width: 120px !important; /* Base 50px + 140% for ergonomic manipulation */
      height: 2px;
      accent-color: var(--cyan);
      cursor: pointer;
    }

    /* ─── Property Panel Industrial Polish ────────────────────────── */
    .prop-section { margin-bottom: 16px; display: flex; flex-direction: column; gap: 8px; }
    .prop-input-strict {
      background: transparent !important; border: 1px solid var(--border2) !important;
      border-radius: 8px; color: var(--text); padding: 8px 10px;
      font-family: inherit; font-size: 1.0000rem; outline: none; width: 100%;
    }
    .prop-input-strict:focus { border-color: var(--cyan) !important; box-shadow: 0 0 0 2px rgba(56,189,248,0.1); }
    .prop-label-strict { 
      font-size: 0.7692rem; font-weight: 800; color: var(--muted2); 
      text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 2px;
      font-family: inherit;
    }

    /* Artifact Stub (Checkpoint) */
    .flow-node.artifact-stub {
      min-width: 40px !important; width: 40px !important; 
      height: 24px !important; border-radius: 12px !important;
      border: 2px solid var(--green) !important; background: var(--bg) !important;
      box-shadow: 0 0 10px var(--green) !important; overflow: hidden;
      display: flex; align-items: center; justify-content: center;
    }
    .flow-node.artifact-stub .fn-head, .flow-node.artifact-stub .fn-body, .flow-node.artifact-stub .fn-injectors { display: none !important; }
    .flow-node.artifact-stub::after {
      content: "DATA"; font-size: 0.5385rem; font-weight: 900; color: var(--green);
      font-family: inherit;
    }

    .flow-node {
      position: absolute; min-width: 200px;
      background: var(--bg1); border: 1px solid var(--border2);
      border-radius: 14px; padding: 0;
      cursor: grab; user-select: none; box-shadow: var(--shadow);
      z-index: 10;
    }
    .flow-node:active { cursor: grabbing; }
    .flow-node.selected { border-color: var(--blue); border-width: 2px; }
    .ghost-node {
      opacity: 0.4 !important;
      pointer-events: none !important;
      border: 1.5px dashed var(--cyan) !important;
      box-shadow: 0 0 20px rgba(6,182,212,0.2) !important;
      animation: ghost-pulse 1.5s infinite ease-in-out;
      z-index: 999 !important;
    }
    @keyframes ghost-pulse {
      0%, 100% { transform: scale(1.0); opacity: 0.4; }
      50% { transform: scale(1.05); opacity: 0.7; }
    }
    .fn-head {
      background: rgba(255,255,255,0.03); padding: 8px 12px;
      border-bottom: 1px solid var(--border);
      display: flex; align-items: center; justify-content: space-between;
      border-top-left-radius: 13px; border-top-right-radius: 13px;
    }
    .fn-body { padding: 12px; }
    .flow-port {
      width: 12px; height: 12px; border-radius: 50%;
      background: var(--bg2); position: absolute;
      border: 2px solid var(--bg1); cursor: crosshair;
      transition: background 0.2s;
      z-index: 20;
    }
    .flow-port::after {
      content: ""; position: absolute;
      top: -8px; left: -8px; right: -8px; bottom: -8px;
      border-radius: 50%;
    }
    .flow-port:hover { background: var(--cyan); transform: scale(1.4); }
    .flow-port.magnet { 
      background: var(--green); 
      transform: scale(2.0); 
      box-shadow: 0 0 15px var(--green); 
      border-color: #fff;
    }

    /* Signal Injectors (God Mode) */
    .fn-injectors {
      position: absolute; left: -55px; top: 50%; transform: translateY(-50%);
      display: flex; flex-direction: column; gap: 2px;
      opacity: 0; transition: opacity 0.2s; pointer-events: none;
    }
    .flow-node.selected .fn-injectors, .flow-node.selected-multi .fn-injectors { opacity: 1; pointer-events: auto; }
    .inj-btn {
      width: 16px; height: 16px; border-radius: 6px; border: 1px solid var(--border2);
      font-size: 0.6923rem; font-weight: 800; cursor: pointer; display: flex;
      align-items: center; justify-content: center; background: var(--bg1);
      transition: all 0.1s; color: var(--muted);
    }
    .inj-btn:hover { transform: scale(1.2); color: #fff; z-index: 50; }
    .inj-neg { border-color: var(--red); }
    .inj-neg:hover { background: var(--red); }
    .inj-zero { border-color: var(--amber); }
    .inj-zero:hover { background: var(--amber); }
    .inj-pos { border-color: var(--green); }
    .inj-pos:hover { background: var(--green); }

    /* Causal Tracing */
    .causal-path { stroke: var(--cyan) !important; stroke-width: 5px !important; filter: drop-shadow(0 0 8px var(--cyan)); }
    .causal-node { border-color: var(--cyan) !important; box-shadow: 0 0 20px rgba(56,189,248,0.4) !important; }
    .dimmed { opacity: 0.15 !important; filter: grayscale(0.8); }
    .flow-port-label {
      position: absolute; font-size: 0.6154rem; font-weight: 600; color: var(--muted2);
      white-space: nowrap; pointer-events: none; line-height: 1;
    }
    .flow-port-in  + .flow-port-label { left: 10px; top: 50%; transform: translateY(-50%); }
    .flow-port-out + .flow-port-label { right: 10px; top: 50%; transform: translateY(-50%); text-align: right; }
    .fn-schema { font-size: 0.6923rem; color: var(--muted2); font-family: 'JetBrains Mono', monospace; margin-top: 4px; line-height: 1.5; }
    .flow-node.external { border-color: var(--amber); border-style: dashed; }
    .flow-node.external .fn-head { }
    .flow-node.gate { border-color: var(--cyan); }
    .flow-node.gate .fn-head { }
    .flow-node.macro { border-color: var(--blue); border-style: dashed; background: rgba(1,118,211,0.05); }
    .flow-node.macro::after {
      content: "MACRO"; position: absolute; bottom: -14px; left: 50%; transform: translateX(-50%);
      font-size: 0.6154rem; font-weight: 800; color: var(--blue); letter-spacing: 1px;
    }
    .flow-node.artifact { border-color: var(--green); border-style: solid; box-shadow: 0 4px 20px rgba(16,185,129,0.1); }
    .flow-node.artifact .fn-head { }
    .flow-node.artifact .flow-port-out { display: none; }
    .flow-node.artifact.state-extend .flow-port-out,
    .flow-node.artifact.has-output .flow-port-out { display: block !important; }
    .flow-node.artifact:not(.state-extend) .flow-port-out { pointer-events: none; opacity: 0.5; }

    .flow-node.moe13 { border-color: var(--magenta); border-style: solid; box-shadow: 0 4px 30px rgba(217,70,239,0.15); }
    .flow-node.moe13 .fn-head { }
    .flow-node.moe13 .fn-body { padding: 12px; }

    .art-btn {
      background: var(--bg1); border: 1px solid var(--border2); color: var(--muted);
      width: 18px; height: 18px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
      cursor: pointer; transition: all 0.1s; padding: 0;
    }
    .art-btn:hover { border-color: var(--green); color: var(--green); background: rgba(16,185,129,0.05); }
    .art-btn.active { background: var(--green); color: #fff; border-color: var(--green); }

    .flow-node .fn-status { width: 6px; height: 6px; border-radius: 50%; background: var(--border2); margin-left: auto; flex-shrink: 0; transition: background 0.2s; }
    .flow-node .fn-status.ok   { background: var(--green); box-shadow: 0 0 4px var(--green); }
    .flow-node .fn-status.err  { background: var(--red);   box-shadow: 0 0 4px var(--red); }
    .flow-node .fn-status.run  { background: var(--amber);  animation: pulse-node-hold 1s infinite; }
    .flow-node.node-error { border-color: var(--red) !important; }
    .flow-node.node-warn  { border-color: var(--amber) !important; }
    .node-badge { position: absolute; top: -8px; right: -8px; width: 18px; height: 18px; border-radius: 50%; font-size: 0.6923rem; font-weight: 800; display: flex; align-items: center; justify-content: center; z-index: 20; }
    .node-badge-error { background: var(--red);   color: #fff; }
    .node-badge-warn  { background: var(--amber); color: #000; }
    .flow-node.selected-multi { border-color: var(--cyan) !important; border-width: 2px; background: rgba(56,189,248,0.05); }
    #rubber-band { position: absolute; border: 1px dashed var(--cyan); background: rgba(56,189,248,0.06); pointer-events: none; z-index: 200; display: none; }

    /* ─── Execution Inspector ────────────────────────────────────────── */
    #flow-inspector {
      position: absolute; bottom: 120px; left: 50%;
      transform: translateX(-50%);
      width: 600px; max-width: 90vw;
      background: var(--bg1);
      backdrop-filter: blur(12px); border: 1px solid var(--border2);
      border-radius: var(--radius); display: none; flex-direction: column;
      z-index: 500; overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,0.3);
      transition: max-height 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.1s linear;
      max-height: 400px;
    }
    #flow-inspector.inspector-expanded { max-height: 400px; }
    #flow-inspector.inspector-minimized { max-height: 32px !important; min-height: 32px; border-bottom: 1px solid var(--border2); }
    #flow-inspector.active { display: flex; }

    /* DAW-Style Multiverse Timeline */
    .timeline-container {
      position: fixed; bottom: 22px;
      height: 40px; background: var(--bg1); border-top: 1px solid var(--border2);
      display: flex; align-items: center; padding: 0 20px; z-index: 1000;
      backdrop-filter: blur(10px);
      box-shadow: 0 -4px 12px rgba(0,0,0,0.3);
    }
    .timeline-slider {
      flex: 1; height: 4px; accent-color: var(--cyan); cursor: pointer;
      background: rgba(74, 74, 74, 0.4); border-radius: 2px; outline: none;
    }
    
    /* Explicit browser-specific track targeting for luminosity calibration */
    #global-timeline::-webkit-slider-runnable-track {
        background: rgba(255, 255, 255, 0.1) !important;
        height: 4px; border-radius: 2px;
    }
    #global-timeline::-moz-range-track {
        background: rgba(255, 255, 255, 0.1) !important;
        height: 4px; border-radius: 2px;
    }

    .timeline-slider::-webkit-slider-thumb { margin-top: -6px; }
    .ins-head {
      padding: 8px 16px; border-bottom: 1px solid var(--border2);
      display: flex; align-items: center; justify-content: space-between;
      font-size: 0.8462rem; font-weight: 700; color: var(--muted);
      text-transform: uppercase;
      cursor: grab; user-select: none;
      background: var(--bg2);
      height: 32px;
    }
    .ins-head:active { cursor: grabbing; }
    .ins-body { flex: 1; overflow-y: auto; min-height: 0; padding: 12px; font-family: 'JetBrains Mono', monospace; font-size: 0.8462rem; color: var(--text); background: var(--bg1); }
    .ins-row { display: flex; gap: 12px; margin-bottom: 6px; border-bottom: 1px solid var(--border); padding-bottom: 4px; }
    .ins-time { color: var(--muted); width: 60px; }
    .ins-node { color: var(--cyan); font-weight: 600; width: 120px; }
    .ins-msg  { flex: 1; }

    /* Signal Animations */
    @keyframes pulse-node-affirm { 0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); } 70% { box-shadow: 0 0 0 15px rgba(16, 185, 129, 0); } 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); } }
    @keyframes pulse-node-reject { 0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); } 70% { box-shadow: 0 0 0 15px rgba(239, 68, 68, 0); } 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); } }
    @keyframes pulse-node-hold   { 0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); } 70% { box-shadow: 0 0 0 15px rgba(245, 158, 11, 0); } 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); } }

    .pulse-affirm { animation: pulse-node-affirm 1.5s infinite; }
    .pulse-reject { animation: pulse-node-reject 1.5s infinite; }
    .pulse-hold   { animation: pulse-node-hold 1.5s infinite; }

    /* Deploy modal */
    .deploy-step-row { display:flex; align-items:center; gap:10px; font-size: 0.9231rem; color:var(--muted); padding:6px 0; }
    .deploy-step-row.done  { color:var(--green); }
    .deploy-step-row.error { color:var(--red); }
    .dstep-icon { font-size: 1.0769rem; width:20px; text-align:center; }
    .deploy-pricing-opt:has(input:checked) { border-color: var(--blue); background: rgba(1,118,211,0.08); }

    .trit-particle {
      width: 10px; height: 10px; border-radius: 50%;
      position: absolute; pointer-events: none; z-index: 30;
      offset-path: path(var(--d)); animation: move-particle var(--speed) linear infinite;
      box-shadow: 0 0 12px var(--glow);
    }
    @keyframes move-particle { 0% { offset-distance: 0%; opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } 100% { offset-distance: 100%; opacity: 0; } }

    /* ─── Topbar ───────────────────────────────────────────────────── */
    #topbar {
      height: 72px; min-height: 72px;
      background: #090e1c;
      border-bottom: 1px solid var(--border);
      display: flex; align-items: center; gap: 0;
      padding: 0 0 0 24px; overflow: hidden;
      z-index: 1000; flex-shrink: 0;
      position: relative;
    }
    
    .tb-left { display: flex; align-items: center; gap: 16px; height: 100%; flex: 1; min-width: 0; overflow: hidden; }
    .tb-logo {
      display: flex; align-items: center; gap: 8px;
      padding-right: 20px; margin-right: 8px;
      border-right: 1px solid var(--border);
      height: 60px; color: var(--cyan);
      font-size: 1.0769rem; font-weight: 800;
      letter-spacing: 0.05em; user-select: none;
      cursor: pointer;
    }
    .logo-v { font-size: 0.7692rem; color: var(--muted2); font-weight: 600; margin-left: -4px; }
    
    .tb-nav { display: flex; align-items: center; gap: 4px; height: 100%; }
    .nav-tab {
      height: 30px; padding: 0 12px; border-radius: 20px;
      appearance: none; -webkit-appearance: none;
      background: transparent !important; border: none !important; outline: none;
      color: var(--text); font-family: inherit; font-size: 0.92rem; font-weight: 600;
      cursor: pointer; display: flex; align-items: center; gap: 6px;
      opacity: 0.65;
      transition: all 0.18s;
    }
    .nav-tab:hover { color: var(--text); background: rgba(255,255,255,0.07) !important; opacity: 0.9; border-radius: 20px; }
    .nav-tab.active { color: var(--cyan); opacity: 1; background: rgba(0,212,170,0.12) !important; border: none !important; border-radius: 20px; }
    .nav-tab.active::after { content: none; }
    .nav-tab i { width: 14px !important; height: 14px !important; }

    .tb-center {
      position: absolute; left: 50%; transform: translateX(-50%);
      display: flex; align-items: center; gap: 4px;
      pointer-events: none;
    }
    .tb-center > * { pointer-events: auto; }
    .tb-sep { width: 1px; height: 20px; background: var(--border); margin: 0 8px; }
    
    .btn-hero {
      height: 32px; padding: 0 16px; border-radius: 8px;
      font-weight: 700; font-size: 0.9231rem; display: flex; align-items: center; gap: 8px;
      cursor: pointer; border: 1px solid transparent; transition: all 0.2s;
      font-family: inherit;
    }
    .btn-hero.run { background: #10b981; color: #000; }
    .btn-hero.run:hover { background: #34d399; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3); }
    .btn-hero.run.running { background: var(--amber); animation: pulse-btn 1s infinite; }
    @keyframes pulse-btn { 0% { opacity: 1; } 50% { opacity: 0.7; } 100% { opacity: 1; } }
    
    .btn-hero.secondary { background: var(--bg2); border-color: var(--border2); color: var(--text); font-weight: 500; }
    .btn-hero.secondary:hover { background: var(--bg3); }

    .tb-btn {
      width: 32px; height: 32px; border-radius: 8px;
      display: flex; align-items: center; justify-content: center;
      background: transparent; border: 1px solid transparent;
      color: var(--muted); cursor: pointer; transition: all 0.2s;
    }
    .tb-btn:hover { background: var(--bg2); color: var(--text); border-color: var(--border2); }
    .tb-btn i { width: 16px !important; height: 16px !important; }

    .tb-right { display: flex; align-items: center; gap: 16px; flex-shrink: 0; padding-right: 24px; }
    .tb-status-wrap { display: flex; align-items: center; gap: 12px; padding-right: 12px; border-right: 1px solid var(--border); }
    .status-pill {
      display: flex; align-items: center; gap: 8px; font-size: 0.8462rem; font-weight: 600; color: var(--muted);
    }
    .status-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
    .status-pill .dot.err { background: var(--red); box-shadow: 0 0 8px var(--red); }
    
    .tier-badge, .tb-badge {
      font-size: 0.7692rem; font-weight: 800; padding: 2px 8px; border-radius: 8px;
      background: var(--bg2); border: 1px solid var(--border2); color: var(--muted);
      text-transform: uppercase; letter-spacing: 0.02em;
    }
    .tier-badge.pro, .tb-badge.badge-t2 { background: #0a1a2e; border-color: #1a4a8a; color: #60a8ff; }
    .tb-badge.badge-free { background: var(--bg2); border-color: var(--border2); color: var(--muted); }
    .tb-badge.badge-t3 { background: #1a1000; border-color: #9a6000; color: var(--amber); }
    .tb-badge.badge-t4 { background: #100a1a; border-color: #6040a0; color: #c080ff; }

    /* ─── Hiding old styles ────────────────────────────────────────── */
    #viewbar { display: none !important; }
    .tb-key-wrap { display: none; }
    .logo-mark { display: none; }
    .logo-sub { display: none; }
    .upskill-btn { display: none; }
    .kbd { display: none; }
    .tb-spacer { display: none; }

    /* ─── Views ────────────────────────────────────────────────────── */
    .view { display: none; flex: 1; overflow: hidden; flex-direction: column; }
    .view.active { display: flex; }

    /* ─── Dashboard ────────────────────────────────────────────────── */
    #view-dashboard { overflow: hidden; padding: 0; flex-direction: column; }

    /* ── 8-box equal grid ─────────────────────────────────────────────── */
    .dash-8grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      grid-template-rows: repeat(2, 1fr);
      gap: 12px;
      padding: 14px;
      height: 100%;
      box-sizing: border-box;
    }
    .dash-box {
      background: var(--bg1); border: 1px solid var(--border2);
      border-radius: var(--radius); padding: 18px 20px;
      display: flex; flex-direction: column; overflow: hidden; min-height: 0;
    }
    html:not([data-theme="light"]) .dash-box { background: #131b2e; border-color: #1e2a42; }
    html[data-theme="light"] .dash-box { background: var(--bg1); border-color: var(--border); }
    .dash-box-title {
      font-size: 12px; font-weight: 700; color: var(--muted);
      text-transform: uppercase; letter-spacing: 0.08em;
      display: flex; align-items: center; gap: 7px;
      margin-bottom: 14px; flex-shrink: 0;
    }
    .dash-box-title i { width: 14px; height: 14px; color: var(--cyan); }
    .dash-box-stat {
      font-size: 30px; font-weight: 700; color: var(--text);
      font-family: 'JetBrains Mono', monospace; line-height: 1;
    }
    .dash-box-label { font-size: 12px; color: var(--muted); margin-top: 3px; }
    .dash-box-link {
      font-size: 12px; color: var(--cyan); text-decoration: none;
      display: inline-flex; align-items: center; gap: 5px;
      opacity: 0.8; transition: opacity 0.15s; padding: 3px 0;
    }
    .dash-box-link:hover { opacity: 1; }
    .dash-box-link i { width: 12px; height: 12px; }
    .dash-box-badge {
      display: inline-flex; align-items: center; gap: 4px;
      font-size: 10px; font-weight: 700; padding: 3px 9px;
      border-radius: 8px; text-transform: uppercase; letter-spacing: 0.05em;
    }
    .dash-box-badge.patent  { background: rgba(0,212,170,0.1); border: 1px solid var(--cyan); color: var(--cyan); }
    .dash-box-badge.measured { background: rgba(16,185,129,0.1); border: 1px solid var(--green); color: var(--green); }

    /* spec table rows inside architecture card */
    .dash-spec-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
    .dash-spec-row:last-child { border-bottom: none; }
    .dash-spec-key { color: var(--muted); font-weight: 500; flex-shrink: 0; }
    .dash-spec-val { color: var(--text); font-weight: 600; text-align: right; }

    .dash-section-title {
      font-size: 0.8462rem; font-weight: 700; color: var(--muted);
      text-transform: uppercase; letter-spacing: 0.1em;
      margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
    }
    
    .rail-btn {
      flex: 1;
      background: var(--bg1);
      border: none;
      color: var(--muted);
      font-size: 0.7692rem;
      font-weight: 700;
      cursor: pointer;
      transition: all 0.1s;
      display: flex;
      align-items: center;
      justify-content: center;
      border-right: 1px solid var(--border2);
    }
    .rail-btn:last-child { border-right: none; }
    .rail-btn:hover { background: var(--bg3); color: var(--text); }
    .rail-btn.active { 
      background: var(--blue); 
      color: #ffffff !important; 
    }
    html[data-theme="light"] .rail-btn.active { background: var(--blue); }
    html:not([data-theme="light"]) .rail-btn.active { background: #3b82f6; } /* Brighter blue for dark mode contrast */

    /* REPL Style */
    .repl-input-wrap {
      background: var(--bg); border: 1px solid var(--border2);
      border-radius: 12px; display: flex; align-items: center; padding: 4px 8px;
      margin-top: 12px;
    }
    .repl-input {
      background: none; border: none; color: var(--cyan); flex: 1;
      font-family: 'JetBrains Mono', monospace; font-size: 0.9231rem; outline: none;
    }
    .repl-res {
      margin-top: 8px; font-family: 'JetBrains Mono', monospace;
      font-size: 0.8462rem; color: var(--green); min-height: 16px;
    }

    .dash-pill {
      display: inline-flex; align-items: center; gap: 8px;
      background: var(--bg2); padding: 6px 14px; border-radius: 20px;
      font-size: 0.9231rem; font-weight: 500;
    }
    .dash-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
    .dash-pill .dot.err { background: var(--red); }
    .dash-pill .dot.warn { background: var(--amber); }

    .dash-quick-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
    .dash-quick-btn {
      background: var(--bg2); border: 1px solid var(--border2);
      color: var(--text); font-family: inherit; font-size: 13px;
      padding: 14px 16px; border-radius: 12px; cursor: pointer;
      text-align: left; transition: all 0.2s;
      display: flex; align-items: center; gap: 12px;
    }
    .dash-quick-btn:hover { background: var(--bg3); border-color: var(--cyan); transform: translateY(-2px); }
    .dash-quick-btn i { width: 17px; height: 17px; color: var(--muted); }

    .dash-run-list { display: flex; flex-direction: column; gap: 6px; }
    .dash-run-item {
      display: flex; align-items: center; gap: 10px;
      font-size: 13px; padding: 10px 14px;
      background: var(--bg2); border-radius: 12px;
      border: 1px solid transparent; transition: border-color 0.2s;
    }
    .dash-run-item:hover { border-color: var(--border2); }
    .dash-run-item .run-name { flex: 1; color: var(--text); font-weight: 500; }
    .run-ok   { color: var(--green); }
    .run-err  { color: var(--red); }
    .dash-run-empty {
      padding: 40px; text-align: center; color: var(--muted2); font-size: 13px;
      border: 1px dashed var(--border2); border-radius: 10px;
    }

    .usage-bar-wrap { background: var(--bg3); border-radius: 8px; height: 8px; margin: 12px 0 6px; overflow: hidden; }
    .usage-bar-fill { height: 100%; width: 0; background: var(--blue); transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); }
    .usage-bar-fill.ok   { background: var(--green); box-shadow: 0 0 10px var(--green); }
    .usage-bar-fill.warn { background: var(--amber); }
    .usage-bar-fill.crit { background: var(--red); }

    /* ─── Editor view ──────────────────────────────────────────────── */
    #view-editor {
      flex: 1; display: none; overflow: hidden;
      flex-direction: row;
    }
    #view-editor.active { display: flex; }

    /* Activity bar */
    .activity-bar {
      width: 40px; min-width: 40px; background: var(--bg1);
      border-right: 1px solid var(--border);
      display: flex; flex-direction: column; align-items: center;
      padding: 6px 0; gap: 2px; z-index: 10;
    }
    .act-btn {
      width: 32px; height: 32px; border-radius: 8px;
      background: transparent; border: none; cursor: pointer;
      color: var(--muted); font-size: 1.1538rem;
      display: flex; align-items: center; justify-content: center;
      transition: all 0.15s;
    }
    .act-btn:hover { background: var(--bg2); color: var(--text); }
    .act-btn.active { background: var(--bg2); color: var(--cyan); }

    /* Sidebar */
    #editor-sidebar {
      width: var(--sidebar-w);
      min-width: 120px; max-width: 400px;
      background: var(--bg1); border-right: 1px solid var(--border);
      display: flex; flex-direction: column; overflow: hidden;
      flex-shrink: 0;
    }
    #editor-sidebar.collapsed { width: 0 !important; min-width: 0; border: none; }
    .sidebar-panel { display: none; flex-direction: column; flex: 1; overflow: hidden; }
    .sidebar-panel.active { display: flex; }
    .sidebar-header {
      padding: 8px 12px 6px; border-bottom: 1px solid var(--border);
      font-size: 0.7692rem; color: var(--muted); letter-spacing: 0.1em;
      text-transform: uppercase; display: flex; align-items: center; justify-content: space-between;
    }
    .sidebar-new-btn {
      background: none; border: none; color: var(--muted); cursor: pointer;
      font-size: 1.0769rem; line-height: 1; padding: 0 2px;
    }
    .sidebar-new-btn:hover { color: var(--cyan); }
    #file-tree { flex: 1; overflow-y: auto; padding: 4px 0; }
    .tree-section { margin-bottom: 2px; }
    .tree-dir {
      padding: 4px 12px; font-size: 0.8462rem; color: var(--muted);
      cursor: pointer; user-select: none; display: flex; align-items: center; gap: 4px;
    }
    .tree-dir:hover { color: var(--text); }
    .tree-dir .arrow { font-size: 0.7692rem; transition: transform 0.15s; }
    .tree-dir.collapsed .arrow { transform: rotate(-90deg); }
    
    /* Tree Guide Lines: Standard IDE hierarchy tracks */
    .tree-files { 
      border-left: 1px solid rgba(255,255,255,0.07); 
      margin-left: 17px; 
      padding-left: 2px;
    }
    .tree-files.hidden { display: none; }
    
    .tree-file {
      padding: 3px 12px 3px 8px; font-size: 0.8462rem; color: var(--muted);
      cursor: pointer; display: flex; align-items: center; gap: 6px;
      border-radius: 0 6px 6px 0; transition: background 0.1s, color 0.1s;
    }
    .tree-file:hover { background: var(--bg2); color: var(--text); }
    .tree-file.active { background: var(--active-file-bg); color: var(--cyan); }
    .tier-dot { width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; }
    .tier-dot.t1 { background: var(--muted2); }
    .tier-dot.t2 { background: #4080c0; }
    .tier-dot.t3 { background: var(--amber); }

    /* Run history panel */
    #history-list { flex: 1; overflow-y: auto; padding: 4px 0; }
    .hist-item {
      padding: 6px 12px; font-size: 0.8462rem; cursor: pointer;
      border-bottom: 1px solid var(--border); transition: background 0.1s;
    }
    .hist-item:hover { background: var(--bg2); }
    .hist-item .hist-name { color: var(--text); margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .hist-item .hist-meta { font-size: 0.7692rem; color: var(--muted); display: flex; gap: 8px; }
    .hist-item .hist-ok { color: var(--green); }
    .hist-item .hist-err { color: var(--red); }

    /* Sidebar resize handle */
    #sidebar-resize {
      width: 4px; cursor: col-resize; background: transparent;
      flex-shrink: 0; transition: background 0.15s;
    }
    #sidebar-resize:hover { background: var(--cyan); }

    /* Editor main area */
    #editor-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

    /* Tabs bar */
    #editorTabsBar {
      height: 34px; min-height: 34px; background: var(--bg1);
      border-bottom: 1px solid var(--border);
      display: flex; align-items: center; overflow-x: auto; flex-shrink: 0;
    }
    #editorTabsBar::-webkit-scrollbar { height: 0; }
    #editorTabs { display: flex; height: 100%; }
    .tab {
      padding: 0 10px 0 14px; height: 100%; display: flex; align-items: center; gap: 6px;
      font-size: 0.8462rem; color: var(--muted); cursor: pointer; white-space: nowrap;
      border-right: 1px solid var(--border); transition: all 0.1s;
    }
    .tab:hover { color: var(--text); background: var(--bg2); }
    .tab.active { color: var(--text); background: var(--bg); border-bottom: 2px solid var(--cyan); }
    .tab-close {
      display: inline-flex; align-items: center; justify-content: center;
      width: 16px; height: 16px; border-radius: 6px; border: none;
      background: none; color: var(--muted2); cursor: pointer; font-size: 0.8462rem;
      opacity: 0; transition: opacity 0.1s, background 0.1s; padding: 0; flex-shrink: 0;
    }
    .tab:hover .tab-close, .tab.active .tab-close { opacity: 1; }
    .tab-close:hover { background: var(--bg3); color: var(--text); }
    .tabs-new-btn {
      width: 34px; height: 100%; display: flex; align-items: center; justify-content: center;
      background: none; border: none; border-right: 1px solid var(--border);
      color: var(--muted); cursor: pointer; font-size: 1.2308rem; flex-shrink: 0;
    }
    .tabs-new-btn:hover { color: var(--cyan); background: var(--bg2); }

    /* Monaco container */
    #monaco-container { flex: 1; min-height: 0; }

    /* Output panel resize handle */
    #output-resize {
      height: 4px; cursor: row-resize; background: transparent;
      flex-shrink: 0; transition: background 0.15s;
    }
    #output-resize:hover { background: var(--cyan); }

    /* Output panel */
    #output-panel {
      height: var(--output-h); min-height: 80px; max-height: 60vh;
      background: var(--bg1); border-top: 1px solid var(--border);
      display: flex; flex-direction: column; flex-shrink: 0; overflow: hidden;
    }
    .out-tabs-bar {
      height: 32px; background: var(--bg1); border-bottom: 1px solid var(--border);
      display: flex; align-items: center; gap: 0; padding: 0 4px; flex-shrink: 0;
    }
    .out-tab {
      height: 100%; padding: 0 12px; font-size: 0.8462rem; color: var(--muted);
      background: none; border: none; cursor: pointer; font-family: inherit;
      display: flex; align-items: center; gap: 5px;
      border-bottom: 2px solid transparent; transition: all 0.1s;
    }
    .out-tab:hover { color: var(--text); }
    .out-tab.active { color: var(--cyan); border-bottom-color: var(--cyan); }
    .out-tab-spacer { flex: 1; }
    .out-clear-btn {
      height: 22px; padding: 0 8px; font-size: 0.7692rem; font-family: inherit;
      background: var(--bg2); border: 1px solid var(--border2); color: var(--muted);
      border-radius: 8px; cursor: pointer;
    }
    .out-clear-btn:hover { color: var(--text); border-color: var(--text); }
    .out-panels { flex: 1; overflow: hidden; }
    .out-panel { display: none; height: 100%; overflow-y: auto; padding: 10px 14px; }
    .out-panel.visible { display: block; }
    .status-pill {
      display: inline-flex; align-items: center; gap: 5px;
      font-size: 0.8462rem; padding: 3px 10px; border-radius: 8px; border: 1px solid;
    }
    .status-idle    { background: var(--bg2); color: var(--muted); border-color: var(--border); }
    .status-running { background: #1a1000; color: var(--amber); border-color: #604000; }
    .status-ok      { background: #0a2010; color: var(--green); border-color: #1a5030; }
    .status-error   { background: #200008; color: var(--red);   border-color: #600020; }
    .print-output {
      font-family: 'JetBrains Mono', monospace;
      font-size: 1.0000rem; color: #a5f3fc;
      line-height: 1.6; white-space: pre-wrap;
      background: #020617; border: 1px solid #1e293b;
      padding: 16px; border-radius: 10px;
      flex: 1; overflow-y: auto;
      position: relative;
      box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
      min-height: 200px;
    }
    .print-output::after {
      content: ""; position: absolute; inset: 0;
      background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%), 
                  linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
      background-size: 100% 3px, 3px 100%;
      pointer-events: none; z-index: 10;
    }
    .print-output.empty { color: #475569; font-style: italic; }
    .term-line { display: flex; gap: 8px; margin-bottom: 2px; position: relative; z-index: 5; }
    .term-prompt { color: var(--cyan); font-weight: 700; opacity: 0.7; }
    .term-err-line { color: #f87171; background: rgba(248,113,113,0.1); padding: 4px 8px; border-left: 3px solid #f87171; margin: 8px 0; font-size: 0.9231rem; }
    .term-success { color: #4ade80; font-weight: 700; }
    .term-dim { color: #475569; }
    .term-header { color: #94a3b8; font-size: 0.7692rem; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 12px; border-bottom: 1px solid #1e293b; padding-bottom: 6px; }
    .error-output {
      font-family: inherit; font-size: 0.9231rem; white-space: pre-wrap;
      padding: 10px; border-radius: 8px; border: 1px solid #400010;
      background: #150005; color: var(--red); margin: 8px 0;
    }
    .meta-grid { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
    .meta-item {
      font-size: 0.8462rem; padding: 4px 10px; border-radius: 8px;
      background: var(--bg2); border: 1px solid var(--border);
    }
    .meta-item .mi-label { color: var(--muted); margin-right: 4px; }
    .reg-table { width: 100%; border-collapse: collapse; font-size: 0.8462rem; margin: 6px 0; }
    .reg-table td { padding: 2px 8px; border-bottom: 1px solid var(--border); }
    .reg-table td:first-child { color: var(--muted); width: 40px; }
    .reg-row-affirm td { color: var(--green); }
    .reg-row-reject td { color: var(--red); }
    .reg-row-zero   td { color: var(--amber); }
    .out-section-title { font-size: 0.7692rem; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; margin: 12px 0 6px; }

    /* API panel */
    .api-block { margin-bottom: 14px; }
    .api-route {
      font-size: 0.8462rem; padding: 5px 10px; border-radius: 8px;
      background: var(--bg2); border: 1px solid var(--border);
      display: flex; align-items: center; gap: 8px; margin-bottom: 4px;
    }
    .api-method { font-weight: 700; font-size: 0.7692rem; color: var(--green); }
    .api-path   { color: var(--cyan); }
    .api-desc   { color: var(--muted); font-size: 0.7692rem; }
    .api-try-btn {
      margin-left: auto; height: 20px; padding: 0 8px; font-size: 0.7692rem;
      font-family: inherit; background: var(--bg3); border: 1px solid var(--border2);
      color: var(--muted); cursor: pointer; border-radius: 8px;
    }
    .api-try-btn:hover { color: var(--cyan); border-color: var(--cyan); }
    .api-response {
      font-size: 0.8462rem; white-space: pre; padding: 8px 10px; border-radius: 8px;
      background: var(--bg); border: 1px solid var(--border);
      color: var(--text); overflow-x: auto; max-height: 140px;
    }

    /* Usage panel */
    .usage-label { font-size: 0.7692rem; color: var(--muted); margin-bottom: 2px; }
    .usage-value { font-size: 0.9231rem; color: var(--text); }
    .usage-meta  { font-size: 0.7692rem; color: var(--muted); margin-top: 2px; }
    .usage-unlimited { font-size: 0.9231rem; color: var(--green); }
    .tier-benefit { font-size: 0.8462rem; padding: 3px 0; color: var(--text); }
    .tier-benefit.muted-benefit { color: var(--muted); }
    .upskill-inline-btn {
      margin-top: 10px; padding: 6px 14px; background: #120a00;
      border: 1px solid var(--amber); color: var(--amber); font-family: inherit;
      font-size: 0.8462rem; font-weight: 600; cursor: pointer; border-radius: 8px;
    }
    .upskill-inline-btn:hover { background: #1c1200; }
    .err-box { background: #150005; border: 1px solid #400010; color: var(--red); font-size: 0.8462rem; padding: 6px 10px; border-radius: 8px; }

    /* Ref panel */
    .ref-section { margin-bottom: 16px; }
    .ref-title { font-size: 0.7692rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 6px; }
    .ref-table { width: 100%; border-collapse: collapse; font-size: 0.8462rem; }
    .ref-table td { padding: 3px 6px; border-bottom: 1px solid var(--border); }
    .ref-table td:first-child { color: var(--cyan); font-weight: 700; width: 80px; }
    .ref-table td:nth-child(2) { color: var(--amber); width: 90px; }
    .ref-table td:nth-child(3) { color: var(--muted); }

    /* ─── Settings view ────────────────────────────────────────────── */
    #view-settings { overflow-y: auto; padding: 24px 32px; gap: 0; }
    .settings-section { margin-bottom: 28px; }
    .settings-section-title {
      font-size: 0.7692rem; color: var(--muted); text-transform: uppercase;
      letter-spacing: 0.1em; margin-bottom: 14px;
      padding-bottom: 6px; border-bottom: 1px solid var(--border);
    }
    .settings-row {
      display: flex; align-items: center; gap: 12px;
      margin-bottom: 10px; flex-wrap: wrap;
    }
    .settings-label { font-size: 0.8462rem; color: var(--text); width: 160px; flex-shrink: 0; }
    .settings-input {
      background: var(--bg2); border: 1px solid var(--border2);
      color: var(--text); font-family: inherit; font-size: 0.8462rem;
      padding: 5px 10px; border-radius: 8px; outline: none; min-width: 200px;
    }
    .settings-input:focus { border-color: var(--cyan); }
    .settings-select {
      background: var(--bg2); border: 1px solid var(--border2);
      color: var(--text); font-family: inherit; font-size: 0.8462rem;
      padding: 5px 10px; border-radius: 8px; outline: none; cursor: pointer;
    }
    .settings-checkbox { width: 14px; height: 14px; accent-color: var(--cyan); cursor: pointer; }
    .settings-btn {
      padding: 5px 14px; background: var(--bg2); border: 1px solid var(--border2);
      color: var(--text); font-family: inherit; font-size: 0.8462rem;
      border-radius: 8px; cursor: pointer;
    }
    .settings-btn:hover { background: var(--bg3); border-color: var(--cyan); color: var(--cyan); }
    .settings-desc { font-size: 0.7692rem; color: var(--muted); margin-top: 2px; }
    .key-display {
      font-size: 0.8462rem; color: var(--text); padding: 5px 10px;
      background: var(--bg2); border: 1px solid var(--border);
      border-radius: 8px; font-family: inherit; letter-spacing: 0.04em;
    }

    /* ─── Statusbar ────────────────────────────────────────────────── */
    #statusbar {
      height: 22px; min-height: 22px; background: var(--bg1);
      border-top: 1px solid var(--border);
      display: flex; align-items: center; gap: 0;
      font-size: 0.7692rem; color: var(--muted); flex-shrink: 0;
    }
    .sb-item { padding: 0 10px; display: flex; align-items: center; gap: 5px; border-right: 1px solid var(--border); height: 100%; }
    .sb-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
    .sb-dot.err  { background: var(--red); }
    .sb-dot.warn { background: var(--amber); }

    /* ─── Modal ────────────────────────────────────────────────────── */
    .modal-overlay {
      display: none; position: fixed; inset: 0;
      background: rgba(0,0,0,0.7); z-index: 1000;
      align-items: center; justify-content: center;
    }
    .modal-box {
      background: var(--bg1); border: 1px solid var(--border2);
      border-radius: 16px; padding: 28px 32px; max-width: 520px; width: 90%;
      max-height: 90vh; overflow-y: auto;
    }
    .modal-title { font-size: 1.2308rem; color: var(--cyan); font-weight: 700; margin-bottom: 6px; }
    .modal-sub   { font-size: 0.9231rem; color: var(--muted); margin-bottom: 20px; }
    .modal-close {
      float: right; background: none; border: none; color: var(--muted);
      font-size: 1.3846rem; cursor: pointer; line-height: 1;
    }
    .modal-close:hover { color: var(--text); }
    .plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
    .plan-card {
      border: 1px solid var(--border2); border-radius: 12px; padding: 16px;
      display: flex; flex-direction: column; gap: 8px;
    }
    .plan-card.highlight { border-color: var(--amber); background: #100a00; }
    .plan-name  { font-size: 1.0000rem; font-weight: 700; color: var(--text); }
    .plan-price { font-size: 1.5385rem; font-weight: 700; color: var(--cyan); }
    .plan-price span { font-size: 0.8462rem; color: var(--muted); }
    .plan-features { font-size: 0.8462rem; color: var(--muted); line-height: 1.7; }
    .plan-btn {
      margin-top: auto; padding: 8px 0; text-align: center; text-decoration: none;
      border-radius: 8px; font-size: 0.9231rem; font-weight: 600; font-family: inherit;
      cursor: pointer; border: none; display: block;
    }
    .plan-btn-std { background: #0a1e38; color: #60a8ff; border: 1px solid #1a4a8a; }
    .plan-btn-std:hover { background: #0d2848; }
    .plan-btn-pro { background: #1a1000; color: var(--amber); border: 1px solid #604000; }
    .plan-btn-pro:hover { background: #241600; }
    .plan-btn-ent {
      background: var(--bg2); color: var(--muted); border: 1px solid var(--border2);
      font-size: 0.8462rem;
    }
    .plan-note { font-size: 0.7692rem; color: var(--muted); text-align: center; }

    /* ─── Config View Visual Identity ────────────────────────── */
    #config-view {
      background-color: var(--bg) !important;
    }
    
    .nav-tab.active#vt-settings {
      border-bottom-color: var(--amber) !important;
      color: var(--amber) !important;
    }
    
    .nav-tab#vt-settings:hover {
      color: var(--amber) !important;
    }
    
    .industrial-card {
      background: var(--bg1) !important;
      border: 1px solid var(--border) !important;
      padding: 32px !important;
      border-radius: 16px !important;
      margin-bottom: 32px !important;
      width: 100% !important;
      max-width: 900px !important;
      display: flex !important;
      flex-direction: column !important;
      gap: 24px !important;
      box-shadow: var(--shadow) !important;
      position: relative;
    }
    html:not([data-theme="light"]) .industrial-card {
      background: #0f131a !important;
      border-color: rgba(255,255,255,0.05) !important;
      box-shadow: 0 10px 30px rgba(0,0,0,0.5) !important;
    }
    
    .industrial-card::before {
      content: "";
      position: absolute;
      top: 0; left: 0; width: 4px; height: 100%;
      background: var(--amber);
      opacity: 0.3;
      border-radius: 16px 0 0 16px;
    }

    .config-card {
      background: var(--bg1);
      border: 1px solid var(--border);
      padding: 24px;
      border-radius: 12px;
      margin-bottom: 24px;
      width: 100%;
      max-width: 800px;
      display: flex;
      flex-direction: column;
    }

    #toast-container {
      position: fixed;
      top: 80px;
      right: 20px;
      display: flex;
      flex-direction: column;
      gap: 10px;
      z-index: 10000;
      pointer-events: none;
      align-items: flex-end;
    }

    .toast {
      background: rgba(15, 20, 30, 0.95);
      color: #fff;
      padding: 12px 20px;
      border-radius: 12px;
      border-left: 4px solid var(--cyan);
      font-size: 0.9231rem;
      font-weight: 600;
      box-shadow: 0 10px 30px rgba(0,0,0,0.5);
      pointer-events: auto;
      animation: toastIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
      max-width: 300px;
      word-wrap: break-word;
    }

    .toast.ok { border-left-color: var(--green); }
    .toast.warn { border-left-color: var(--amber); }
    .toast.err { border-left-color: var(--red); }

    @keyframes toastIn {
      from { opacity: 0; transform: translateX(50px) scale(0.9); }
      to { opacity: 1; transform: translateX(0) scale(1); }
    }

    .industrial-title {
      font-size: 1.0769rem !important;
      font-weight: 800 !important;
      color: var(--text) !important;
      letter-spacing: 1px !important;
      text-transform: uppercase !important;
      margin-bottom: 4px !important;
    }

    .industrial-desc {
      font-size: 0.8462rem !important;
      color: var(--muted2) !important;
      margin-bottom: 16px !important;
    }
    
    .settings-input, .settings-select {
      background: var(--bg) !important;
      border: 1px solid var(--border) !important;
      color: var(--text) !important;
    }

    .settings-input:focus, .settings-select:focus {
      border-color: var(--cyan) !important;
      box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.15) !important;
    }

/* --- Dual-Tree Explorer --- */
.tree-root-header {
  padding: 6px 12px;
  font-size: 0.7692rem;
  font-weight: 700;
  color: var(--muted);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: relative;
}
.tree-root-header:hover {
  background: var(--bg3);
  color: var(--text);
}
.tree-root-header::before {
  content: '▼';
  display: inline-block;
  font-size: 0.6154rem;
  margin-right: 6px;
  transition: transform 0.2s;
  transform-origin: center;
}
#stdlib-tree-container.collapsed > .tree-root-header::before,
#premium-tree-container.collapsed > .tree-root-header::before {
  transform: rotate(-90deg);
}
#stdlib-tree-container.collapsed > .file-tree-body,
#premium-tree-container.collapsed > .file-tree-body {
  display: none;
}
#explorer-trees {
  display: flex;
  flex-direction: column;
}

/* ─── Global Tooltip ────────────────────────────────────────────── */
#global-tooltip {
  position: fixed;
  z-index: 10000;
  background: rgba(15, 23, 42, 0.95); /* Dark Slate with opacity */
  color: #f1f5f9;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #334155;
  font-size: 0.8462rem;
  line-height: 1.4;
  max-width: 250px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 0.2s, transform 0.2s;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}
#global-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}
.file-tree-body {
  padding: 4px 0;
}
#premium-file-tree .tree-file.active {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}
#premium-file-tree .tree-dir {
  color: #ffffff;
  opacity: 0.9;
}
#premium-tree-container .tree-root-header {
  color: #ffffff;
  opacity: 0.9;
}

/* ─── Agent Library Accordion ───────────────────────────────────── */
.lib-category {
  border-bottom: 1px solid var(--border);
}
.lib-category-header {
  padding: 8px 12px;
  background: var(--bg1);
  font-size: 0.7692rem;
  font-weight: 800;
  color: var(--muted2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  transition: background 0.2s, color 0.2s;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.lib-category-header:hover {
  background: var(--bg2);
  color: var(--text);
}
.lib-category-header i {
  width: 12px;
  height: 12px;
  transition: transform 0.2s ease-in-out;
  transform: rotate(-180deg); /* Points UP by default (when open) */
}
.lib-category.collapsed .lib-category-header i {
  transform: rotate(0deg); /* Points DOWN when collapsed (closed) */
}
.lib-category-items {
  overflow: hidden;
}
#no-arch-matches {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100px;
  flex: 1;
}
/* Archetype Card Styling */
.archetype-card {
  background: var(--bg1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}
.archetype-card:hover {
  background: var(--bg2);
  border-color: var(--cyan);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.archetype-card-title {
  font-size: 0.9231rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.archetype-card-desc {
  font-size: 0.7692rem;
  color: var(--muted);
  line-height: 1.4;
}

/* ─── Lab Quick-Add Palette ─────────────────────────────────────────── */
#lab-palette {
  position: absolute; inset: 0; z-index: 5000;
  display: none; pointer-events: none;
}
#lab-palette-inner {
  position: absolute; width: 320px;
  background: var(--bg1); border: 1px solid var(--border2);
  border-radius: 12px; box-shadow: 0 24px 60px rgba(0,0,0,0.5);
  overflow: hidden; pointer-events: auto;
  display: flex; flex-direction: column;
  animation: palette-pop 0.12s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes palette-pop {
  from { opacity: 0; transform: scale(0.94) translateY(-4px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
#lab-palette-input {
  width: 100%; padding: 12px 16px;
  background: transparent; border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text); font-size: 13px;
  outline: none; font-family: inherit;
}
#lab-palette-input::placeholder { color: var(--muted2); }
#lab-palette-hint {
  padding: 6px 16px 4px;
  font-size: 10px; color: var(--muted2);
  display: flex; gap: 12px;
}
#lab-palette-hint span { display: flex; align-items: center; gap: 4px; }
#lab-palette-hint kbd {
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 6px; padding: 1px 5px;
  font-size: 9px; font-family: inherit;
  color: var(--muted); font-weight: 700;
}
#lab-palette-results { max-height: 340px; overflow-y: auto; padding: 6px; }
.palette-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  cursor: pointer; transition: background 0.1s;
}
.palette-item.focused { background: var(--bg2); }
.palette-item-name {
  font-size: 12px; font-weight: 700; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.palette-item-sub {
  font-size: 10px; color: var(--muted); margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.palette-arch-badge {
  margin-left: auto; flex-shrink: 0;
  font-size: 9px; font-weight: 800; padding: 2px 6px;
  border-radius: 6px; background: rgba(56,189,248,0.15);
  color: var(--cyan); text-transform: uppercase; letter-spacing: 0.06em;
}
.palette-section-header {
  font-size: 10px; font-weight: 800; color: var(--muted2);
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 8px 10px 4px; margin-top: 2px;
}
html[data-theme="light"] #lab-palette-inner { box-shadow: 0 8px 30px rgba(0,0,0,0.18); }
