    :root {
      --bg-base: #05070a;
      --bg-card: rgba(13, 22, 35, 0.88);
      --bg-card-hover: rgba(20, 35, 55, 0.95);
      --border-glass: rgba(56, 189, 248, 0.22);
      --accent-cyan: #38bdf8;
      --accent-emerald: #34d399;
      --accent-amber: #f59e0b;
      --accent-purple: #c084fc;
      --accent-rose: #fb7185;
      --text-primary: #f0f6fc;
      --text-secondary: #94a3b8;
      --text-muted: #64748b;
    }
    * { box-sizing: border-box; }
    body {
      margin: 0;
      padding: 0;
      background: radial-gradient(circle at 50% 50%, #0d1626 0%, #05070a 100%);
      color: var(--text-primary);
      font-family: 'Inter', system-ui, -apple-system, sans-serif;
      overflow: hidden;
      height: 100vh;
      width: 100vw;
    }
    #canvas {
      position: absolute;
      top: 0;
      left: 0;
      width: 100vw;
      height: 100vh;
      z-index: 1;
      display: block;
    }
    #header {
      position: absolute;
      top: 16px;
      left: 20px;
      z-index: 20;
      background: var(--bg-card);
      padding: 16px 22px;
      border-radius: 14px;
      border: 1px solid var(--border-glass);
      backdrop-filter: blur(14px);
      box-shadow: 0 12px 36px rgba(0,0,0,0.65);
      max-width: 580px;
      transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    #header.collapsed {
      transform: translateY(-40px);
      opacity: 0;
      pointer-events: none;
    }
    .title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
    h1 {
      margin: 0;
      font-family: 'Outfit', sans-serif;
      font-size: 21px;
      font-weight: 700;
      background: linear-gradient(135deg, #58a6ff, #34d399);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
    }
    .subtitle {
      font-size: 12.5px;
      color: var(--text-secondary);
      margin-bottom: 12px;
      line-height: 1.45;
    }
    .kpi-row {
      display: flex;
      gap: 12px;
      margin-bottom: 12px;
      background: rgba(0, 0, 0, 0.3);
      padding: 8px 12px;
      border-radius: 8px;
      border: 1px solid rgba(255,255,255,0.06);
    }
    .kpi-item { display: flex; flex-direction: column; }
    .kpi-val { font-size: 13px; font-weight: 700; color: #58a6ff; font-family: 'Fira Code', monospace; }
    .kpi-lbl { font-size: 10.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
    .controls {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      align-items: center;
      font-size: 12.5px;
    }
    select, input, button {
      background: #16202e;
      color: var(--text-primary);
      border: 1px solid #304256;
      padding: 7px 12px;
      border-radius: 8px;
      font-size: 12.5px;
      font-family: inherit;
      outline: none;
      transition: all 0.2s;
    }
    input { width: 145px; }
    select:hover, input:focus, button:hover {
      border-color: #58a6ff;
      background: #1c2a3d;
      cursor: pointer;
    }
    .btn-primary {
      background: linear-gradient(135deg, #1f6feb, #10b981);
      border: none;
      color: #fff;
      font-weight: 600;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 6px;
    }
    .btn-primary:hover {
      opacity: 0.92;
      box-shadow: 0 0 14px rgba(56, 189, 248, 0.5);
    }
    #selectionBanner {
      margin-top: 10px;
      padding: 8px 12px;
      background: rgba(88, 166, 255, 0.15);
      border: 1px solid #58a6ff;
      border-radius: 8px;
      font-size: 12px;
      color: #79c0ff;
      display: none;
    }

    /* Universal Inspector & Projection Panel */
    #inspectorPanel {
      position: absolute;
      top: 16px;
      right: 20px;
      z-index: 25;
      background: var(--bg-card);
      border: 1px solid var(--border-glass);
      border-radius: 14px;
      padding: 16px 20px;
      width: 480px;
      max-height: calc(100vh - 32px);
      overflow-y: auto;
      backdrop-filter: blur(16px);
      box-shadow: 0 14px 42px rgba(0,0,0,0.75);
      transition: transform 0.35s ease, opacity 0.35s ease;
    }
    #inspectorPanel.collapsed {
      transform: translateX(520px);
      pointer-events: none;
      opacity: 0;
    }
    .inspector-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 8px;
    }
    .inspector-title {
      font-family: 'Outfit', sans-serif;
      font-size: 16px;
      font-weight: 700;
      color: #38bdf8;
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .close-btn {
      background: none;
      border: none;
      color: var(--text-muted);
      font-size: 18px;
      cursor: pointer;
      padding: 2px 6px;
    }
    .close-btn:hover { color: #fff; }
    .inspector-desc {
      font-size: 12px;
      color: var(--text-secondary);
      margin-bottom: 10px;
      line-height: 1.4;
    }
    .sample-pills {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin-bottom: 10px;
    }
    .sample-pill {
      font-size: 11px;
      padding: 4px 8px;
      border-radius: 6px;
      background: rgba(56, 189, 248, 0.12);
      border: 1px solid rgba(56, 189, 248, 0.3);
      color: #7dd3fc;
      cursor: pointer;
      transition: all 0.2s;
    }
    .sample-pill:hover {
      background: rgba(56, 189, 248, 0.28);
      border-color: #38bdf8;
      color: #fff;
    }
    #seqTextarea {
      width: 100%;
      height: 85px;
      background: #090e17;
      color: #f1f5f9;
      border: 1px solid #233549;
      border-radius: 8px;
      padding: 8px 10px;
      font-family: 'Fira Code', monospace;
      font-size: 11.5px;
      resize: vertical;
      outline: none;
      margin-bottom: 10px;
    }
    #seqTextarea:focus { border-color: #38bdf8; }
    .action-bar { display: flex; gap: 8px; margin-bottom: 14px; }
    
    /* Result Display Card inside Inspector */
    #analysisHUD {
      display: none;
      background: rgba(9, 14, 23, 0.95);
      border: 1px solid #1e3a5f;
      border-radius: 10px;
      padding: 14px;
      margin-top: 10px;
      animation: fadeIn 0.3s ease;
    }
    @keyframes fadeIn {
      from { opacity: 0; transform: translateY(6px); }
      to { opacity: 1; transform: translateY(0); }
    }
    .hud-title-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      border-bottom: 1px solid #1e293b;
      padding-bottom: 8px;
      margin-bottom: 10px;
    }
    .hud-beacon-alert {
      font-size: 11.5px;
      font-weight: 600;
      color: #34d399;
      display: flex;
      align-items: center;
      gap: 6px;
    }
    .badge {
      display: inline-block;
      padding: 3px 8px;
      border-radius: 6px;
      font-size: 11px;
      font-weight: 600;
    }
    .badge-species { background: rgba(56, 189, 248, 0.2); color: #38bdf8; border: 1px solid #0284c7; }
    .badge-chain { background: rgba(168, 85, 247, 0.2); color: #c084fc; border: 1px solid #9333ea; }
    .badge-clan { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid #d97706; }
    .badge-family { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid #059669; }
    .badge-low { background: rgba(52, 211, 153, 0.2); color: #34d399; }
    .badge-mod { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
    .badge-high { background: rgba(244, 63, 94, 0.2); color: #fb7185; }
    .hud-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
      margin-bottom: 10px;
      font-size: 12px;
    }
    .hud-box {
      background: rgba(255,255,255,0.02);
      padding: 6px 10px;
      border-radius: 6px;
      border: 1px solid rgba(255,255,255,0.06);
    }
    .hud-label { font-size: 10.5px; color: var(--text-muted); text-transform: uppercase; margin-bottom: 2px; }
    .hud-value { font-family: 'Fira Code', monospace; font-size: 12px; font-weight: 600; color: #fff; }
    .hud-ribbon {
      background: #060a12;
      border: 1px solid #1e293b;
      border-radius: 6px;
      padding: 8px;
      font-family: 'Fira Code', monospace;
      font-size: 11px;
      word-break: break-all;
      line-height: 1.5;
    }
    .rf-fr { color: #94a3b8; }
    .rf-cdr1 { color: #38bdf8; font-weight: bold; background: rgba(56, 189, 248, 0.15); padding: 0 2px; border-radius: 2px; }
    .rf-cdr2 { color: #34d399; font-weight: bold; background: rgba(52, 211, 153, 0.15); padding: 0 2px; border-radius: 2px; }
    .rf-cdr3 { color: #f43f5e; font-weight: bold; background: rgba(244, 63, 94, 0.18); padding: 0 2px; border-radius: 2px; }

    /* Tooltip */
    #tooltip {
      position: absolute;
      display: none;
      background: rgba(13, 22, 35, 0.96);
      border: 1px solid #38bdf8;
      border-radius: 10px;
      padding: 14px 18px;
      color: #f0f6fc;
      font-size: 12px;
      pointer-events: none;
      z-index: 100;
      box-shadow: 0 10px 30px rgba(0,0,0,0.7);
      max-width: 400px;
    }

    /* Legend with Checkboxes & Multi-Selection */
    .legend {
      position: absolute;
      bottom: 20px;
      left: 20px;
      background: var(--bg-card);
      border: 1px solid var(--border-glass);
      border-radius: 12px;
      padding: 14px 16px;
      font-size: 12px;
      max-height: 480px;
      overflow-y: auto;
      backdrop-filter: blur(14px);
      box-shadow: 0 8px 28px rgba(0,0,0,0.65);
      width: 360px;
      z-index: 15;
      transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .legend.collapsed {
      transform: translateX(-400px);
      opacity: 0;
      pointer-events: none;
    }
    .legend-header {
      border-bottom: 1px solid rgba(255,255,255,0.08);
      padding-bottom: 8px;
      margin-bottom: 8px;
    }
    .legend-title {
      font-weight: 700;
      color: #38bdf8;
      font-size: 13px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 6px;
    }
    .legend-badge {
      font-size: 11px;
      background: rgba(56, 189, 248, 0.15);
      color: #38bdf8;
      padding: 2px 7px;
      border-radius: 10px;
      font-weight: 600;
    }
    .legend-btn-row {
      display: flex;
      gap: 5px;
      margin-top: 4px;
      flex-wrap: wrap;
    }
    .legend-btn {
      padding: 3px 8px;
      font-size: 10.5px;
      border-radius: 5px;
      background: #1a2738;
      border: 1px solid #304256;
      color: #cbd5e1;
      cursor: pointer;
      transition: all 0.15s ease;
    }
    .legend-btn:hover {
      background: #253850;
      border-color: #38bdf8;
      color: #fff;
    }
    .legend-instruction { font-size: 10px; color: var(--text-muted); margin-bottom: 8px; }

    /* Hierarchical Tree Group Styles */
    .legend-group {
      margin-bottom: 6px;
      border: 1px solid rgba(255, 255, 255, 0.07);
      border-radius: 8px;
      background: rgba(15, 23, 42, 0.45);
      overflow: hidden;
      transition: border-color 0.2s;
    }
    .legend-group:hover {
      border-color: rgba(56, 189, 248, 0.3);
    }
    .legend-group-header {
      display: flex;
      align-items: center;
      gap: 7px;
      padding: 5px 8px;
      background: rgba(30, 41, 59, 0.65);
      cursor: pointer;
      user-select: none;
      font-size: 11.5px;
    }
    .legend-group-header:hover {
      background: rgba(56, 189, 248, 0.14);
    }
    .legend-arrow {
      font-size: 9px;
      color: #94a3b8;
      width: 14px;
      text-align: center;
      transition: transform 0.2s ease;
      cursor: pointer;
    }
    .legend-arrow.collapsed {
      transform: rotate(-90deg);
    }
    .legend-group-cb {
      cursor: pointer;
      width: 14px;
      height: 14px;
      accent-color: #38bdf8;
      flex-shrink: 0;
    }
    .legend-group-title {
      font-weight: 600;
      color: #f1f5f9;
      flex: 1;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .legend-group-badge {
      font-size: 10px;
      color: #94a3b8;
      background: rgba(0, 0, 0, 0.35);
      padding: 1px 6px;
      border-radius: 8px;
      flex-shrink: 0;
    }
    .legend-children {
      padding: 4px 6px 6px 22px;
      display: flex;
      flex-direction: column;
      gap: 2px;
      background: rgba(10, 15, 26, 0.35);
    }
    .legend-children.collapsed {
      display: none;
    }
    .legend-child-item {
      display: flex;
      align-items: center;
      gap: 7px;
      padding: 3px 6px;
      border-radius: 5px;
      cursor: pointer;
      font-size: 11px;
      transition: background 0.15s;
    }
    .legend-child-item:hover {
      background: rgba(56, 189, 248, 0.16);
    }
    .legend-child-item.checked-item {
      background: rgba(56, 189, 248, 0.22);
    }
    .legend-child-cb {
      cursor: pointer;
      width: 13px;
      height: 13px;
      accent-color: #38bdf8;
      flex-shrink: 0;
    }

    /* Flat Legend Item Fallback */
    .legend-item {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 4px 6px;
      border-radius: 6px;
      cursor: pointer;
      transition: background 0.15s ease;
      user-select: none;
      font-size: 11.5px;
    }
    .legend-item:hover { background: rgba(56, 189, 248, 0.16); }
    .legend-item.checked-item {
      background: rgba(56, 189, 248, 0.22);
      border: 1px solid rgba(56, 189, 248, 0.4);
    }
    .legend-cb {
      cursor: pointer;
      width: 14px;
      height: 14px;
      accent-color: #38bdf8;
      flex-shrink: 0;
    }
    .legend-color { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }
    .legend-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .legend-count { font-size: 10px; color: var(--text-muted); flex-shrink: 0; }

    /* Pulsating Sonar Radar Beacon */
    @keyframes sonarWave {
      0% { r: 6px; opacity: 0.95; stroke-width: 3.5px; }
      50% { opacity: 0.6; stroke-width: 2.5px; }
      100% { r: 50px; opacity: 0; stroke-width: 0.5px; }
    }
    @keyframes sonarWaveSecondary {
      0% { r: 6px; opacity: 0.8; stroke-width: 2.5px; }
      50% { opacity: 0.45; stroke-width: 1.5px; }
      100% { r: 68px; opacity: 0; stroke-width: 0.4px; }
    }
    .sonar-beacon {
      fill: none;
      stroke: #38bdf8;
      pointer-events: none;
      animation: sonarWave 1.4s infinite cubic-bezier(0.2, 0.6, 0.3, 1);
    }
    .sonar-beacon-secondary {
      fill: none;
      stroke: #f59e0b;
      pointer-events: none;
      animation: sonarWaveSecondary 2.0s infinite cubic-bezier(0.2, 0.6, 0.3, 1) 0.4s;
    }
    .sonar-beacon-inner {
      fill: #34d399;
      stroke: #ffffff;
      stroke-width: 2.5px;
      pointer-events: none;
    }

    /* Landmark Star Beacons */
    .landmark-beacon {
      pointer-events: none;
    }

    /* Landmark Star Tribute Card */
    .stellar-tribute-card {
      position: absolute;
      top: 90px;
      right: 25px;
      max-width: 440px;
      background: linear-gradient(145deg, rgba(15, 23, 42, 0.95), rgba(30, 27, 75, 0.95));
      border: 2px solid #f59e0b;
      border-radius: 14px;
      padding: 16px 20px;
      box-shadow: 0 20px 45px rgba(0,0,0,0.85), 0 0 30px rgba(245,158,11,0.3);
      backdrop-filter: blur(16px);
      z-index: 100;
      color: #f8fafc;
      font-size: 12.5px;
      line-height: 1.55;
      animation: slideInRight 0.5s ease-out;
    }

    .stellar-tribute-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 8px;
      border-bottom: 1px solid rgba(245,158,11,0.3);
      padding-bottom: 8px;
    }

    .stellar-tribute-title {
      font-size: 15px;
      font-weight: 800;
      color: #fef08a;
      display: flex;
      align-items: center;
      gap: 6px;
      text-shadow: 0 0 12px rgba(251, 191, 36, 0.6);
    }

    .stellar-tribute-tag {
      background: rgba(245, 158, 11, 0.2);
      border: 1px solid #f59e0b;
      color: #fef08a;
      font-size: 10.5px;
      font-weight: 700;
      padding: 2px 7px;
      border-radius: 4px;
    }

    .landmark-item:hover {
      background: rgba(255, 255, 255, 0.08);
      transform: translateX(3px);
      transition: all 0.15s ease;
    }

    @keyframes slideInRight {
      from { transform: translateX(40px); opacity: 0; }
      to { transform: translateX(0); opacity: 1; }
    }

    /* Evolutionary Timeline Bar */
    .evo-bar {
      position: absolute;
      bottom: 20px;
      left: 395px;
      right: 20px;
      max-width: 840px;
      background: var(--bg-card);
      border: 1px solid var(--border-glass);
      border-radius: 12px;
      padding: 12px 18px;
      backdrop-filter: blur(16px);
      box-shadow: 0 10px 32px rgba(0,0,0,0.7);
      z-index: 20;
      display: flex;
      flex-direction: column;
      gap: 8px;
      transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .evo-bar.collapsed {
      transform: translateY(120px);
      opacity: 0;
      pointer-events: none;
    }
    .evo-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
    }
    .evo-title {
      font-size: 12.5px;
      color: #38bdf8;
      display: flex;
      align-items: center;
      gap: 6px;
      font-family: 'Outfit', sans-serif;
      letter-spacing: 0.3px;
    }
    .evo-controls {
      display: flex;
      gap: 8px;
    }
    .btn-evo {
      background: linear-gradient(135deg, #0284c7, #10b981);
      color: #fff;
      border: none;
      padding: 5px 14px;
      border-radius: 6px;
      font-size: 11.5px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s;
    }
    .btn-evo:hover {
      box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
    }
    .btn-evo-ghost {
      background: rgba(255,255,255,0.06);
      color: var(--text-secondary);
      border: 1px solid #304256;
      padding: 5px 10px;
      border-radius: 6px;
      font-size: 11.5px;
      cursor: pointer;
    }
    .btn-evo-ghost:hover {
      background: #1c2a3d;
      color: #fff;
    }
    .evo-slider-row {
      display: flex;
      align-items: center;
      gap: 12px;
    }
    .evo-slider-row input[type="range"] {
      flex: 1;
      accent-color: #38bdf8;
      cursor: pointer;
    }
    .evo-age-tag {
      font-family: 'Fira Code', monospace;
      font-size: 11px;
      color: var(--text-secondary);
      min-width: 75px;
    }
    .evo-epoch-info {
      font-size: 11.5px;
      color: var(--text-secondary);
      background: rgba(0,0,0,0.3);
      padding: 6px 10px;
      border-radius: 6px;
      border: 1px solid rgba(255,255,255,0.05);
      display: flex;
      align-items: center;
      justify-content: space-between;
    }
    .evo-badge {
      background: rgba(56, 189, 248, 0.2);
      color: #38bdf8;
      border: 1px solid #0284c7;
      padding: 2px 7px;
      border-radius: 4px;
      font-weight: 600;
      font-size: 11px;
      white-space: nowrap;
    }

    /* Minimize Button & Floating Restore Pills */
    .panel-minimize-btn {
      background: rgba(255, 255, 255, 0.05);
      border: 1px solid rgba(255, 255, 255, 0.12);
      border-radius: 6px;
      color: #94a3b8;
      font-size: 12px;
      cursor: pointer;
      width: 22px;
      height: 22px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding: 0;
      transition: all 0.15s ease;
      line-height: 1;
      flex-shrink: 0;
    }
    .panel-minimize-btn:hover {
      background: rgba(239, 68, 68, 0.2);
      border-color: #ef4444;
      color: #f87171;
      transform: scale(1.08);
    }
    .floating-panel-pill {
      position: absolute;
      z-index: 30;
      background: rgba(13, 22, 35, 0.9);
      border: 1px solid rgba(56, 189, 248, 0.35);
      border-radius: 20px;
      padding: 7px 14px;
      color: #f1f5f9;
      font-family: 'Outfit', sans-serif;
      font-size: 12px;
      font-weight: 600;
      cursor: pointer;
      backdrop-filter: blur(14px);
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
      display: inline-flex;
      align-items: center;
      gap: 7px;
      transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
      user-select: none;
    }
    .floating-panel-pill:hover {
      background: rgba(20, 35, 55, 0.98);
      border-color: #38bdf8;
      box-shadow: 0 0 16px rgba(56, 189, 248, 0.5);
      transform: translateY(-2px);
      color: #38bdf8;
    }
    .pill-top-left { top: 16px; left: 20px; }
    .pill-top-left-home {
      top: 16px;
      left: 140px;
      border-color: #38bdf8;
      color: #ffffff;
      background: linear-gradient(135deg, rgba(2, 132, 199, 0.6), rgba(16, 185, 129, 0.4));
      text-decoration: none;
      font-weight: 700;
    }
    .pill-top-left-home:hover {
      background: linear-gradient(135deg, rgba(2, 132, 199, 0.85), rgba(16, 185, 129, 0.7));
      border-color: #38bdf8;
      box-shadow: 0 0 16px rgba(56, 189, 248, 0.6);
      transform: translateY(-2px);
      color: #ffffff;
    }
    .hub-back-btn {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 5px 12px;
      border-radius: 8px;
      font-size: 12px;
      font-weight: 700;
      text-decoration: none;
      color: #ffffff;
      background: linear-gradient(135deg, rgba(2, 132, 199, 0.45), rgba(16, 185, 129, 0.35));
      border: 1px solid rgba(56, 189, 248, 0.5);
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), 0 0 10px rgba(56, 189, 248, 0.15);
      transition: all 0.2s ease;
      cursor: pointer;
      white-space: nowrap;
    }
    .hub-back-btn:hover {
      background: linear-gradient(135deg, rgba(2, 132, 199, 0.8), rgba(16, 185, 129, 0.6));
      border-color: #38bdf8;
      box-shadow: 0 4px 16px rgba(56, 189, 248, 0.4);
      transform: translateY(-1px);
      color: #ffffff;
    }
    .pill-top-right { top: 16px; right: 20px; }
    .pill-bottom-left { bottom: 20px; left: 20px; }
    .pill-bottom-evo { bottom: 20px; left: 395px; }
    .pill-bottom-align { bottom: 20px; right: 20px; border-color: rgba(52, 211, 153, 0.4); }
    .pill-bottom-align:hover { border-color: #34d399; box-shadow: 0 0 16px rgba(52, 211, 153, 0.5); color: #34d399; }

    /* Sequence Alignment Drawer (1..104 Canonical IMGT Register) */
    #alignmentDrawer {
      position: fixed;
      bottom: 16px;
      left: 50%;
      transform: translateX(-50%);
      width: min(1340px, 96vw);
      max-height: 420px;
      background: rgba(10, 16, 26, 0.97);
      border: 1px solid #1e3a5f;
      border-radius: 12px;
      backdrop-filter: blur(16px);
      box-shadow: 0 16px 48px rgba(0, 0, 0, 0.88);
      display: flex;
      flex-direction: column;
      z-index: 45;
      transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    }
    #alignmentDrawer.collapsed {
      transform: translateX(-50%) translateY(520px);
      opacity: 0;
      pointer-events: none;
    }
    .alignment-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 10px 16px;
      border-bottom: 1px solid #1e293b;
      background: rgba(15, 23, 42, 0.75);
      border-radius: 12px 12px 0 0;
      user-select: none;
    }
    .alignment-title-row {
      display: flex;
      align-items: center;
      gap: 10px;
    }
    .alignment-title {
      font-family: 'Outfit', sans-serif;
      font-size: 15px;
      font-weight: 700;
      color: #38bdf8;
    }
    .align-mode-badge {
      font-size: 11px;
      padding: 3px 8px;
      border-radius: 6px;
      font-weight: 600;
      letter-spacing: 0.2px;
    }
    .align-mode-badge.single {
      background: rgba(56, 189, 248, 0.15);
      border: 1px solid rgba(56, 189, 248, 0.4);
      color: #7dd3fc;
    }
    .align-mode-badge.multi {
      background: rgba(52, 211, 153, 0.15);
      border: 1px solid rgba(52, 211, 153, 0.4);
      color: #6ee7b7;
    }
    .alignment-actions {
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .drawer-action-btn {
      background: #152238;
      border: 1px solid #233549;
      color: #e2e8f0;
      font-size: 11.5px;
      font-family: 'Outfit', sans-serif;
      padding: 4px 10px;
      border-radius: 6px;
      cursor: pointer;
      transition: all 0.15s ease;
    }
    .drawer-action-btn:hover {
      background: #1e3a5f;
      border-color: #38bdf8;
      color: #38bdf8;
    }
    .alignment-body {
      flex: 1;
      overflow-y: auto;
      overflow-x: auto;
      padding: 12px 16px;
      font-family: 'Fira Code', monospace;
      font-size: 12px;
      line-height: 1.45;
    }
    .imgt-ruler-container {
      position: sticky;
      top: 0;
      background: #090e17;
      z-index: 5;
      padding-bottom: 6px;
      border-bottom: 1px solid #233549;
      margin-bottom: 8px;
      white-space: nowrap;
      min-width: 1100px;
    }
    .ruler-region-row {
      color: #94a3b8;
      font-size: 11px;
      font-weight: 600;
      white-space: nowrap;
      display: flex;
      align-items: center;
      line-height: 18px;
    }
    .ruler-ticks-row {
      color: #64748b;
      font-size: 10.5px;
      white-space: nowrap;
      display: flex;
      align-items: center;
      line-height: 16px;
    }
    .align-region-fr1 { display: inline-block; width: 26ch; min-width: 26ch; }
    .align-region-cdr1 { display: inline-block; width: 12ch; min-width: 12ch; margin-left: 4px; }
    .align-region-fr2 { display: inline-block; width: 17ch; min-width: 17ch; margin-left: 4px; }
    .align-region-cdr2 { display: inline-block; width: 10ch; min-width: 10ch; margin-left: 4px; }
    .align-region-fr3 { display: inline-block; width: 39ch; min-width: 39ch; margin-left: 4px; }

    .align-row {
      white-space: nowrap;
      padding: 3px 6px;
      border-radius: 4px;
      display: flex;
      align-items: center;
      cursor: pointer;
      min-width: 1100px;
      transition: background 0.15s ease;
    }
    .align-row:hover {
      background: rgba(30, 58, 95, 0.45);
    }
    .align-row.selected-align-row {
      background: rgba(56, 189, 248, 0.12);
      border-left: 2px solid rgba(56, 189, 248, 0.6);
    }
    .align-row.active-align-row {
      background: rgba(56, 189, 248, 0.28) !important;
      border-left: 4px solid #38bdf8 !important;
      box-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
    }
    .align-gene-tag {
      display: inline-block;
      width: 270px;
      min-width: 270px;
      color: #58a6ff;
      font-weight: 600;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .align-seq-chars {
      letter-spacing: 1.2px;
      font-size: 11.5px;
    }
    .seq-gap {
      color: #334155;
    }
    .seq-cdr1 {
      color: #fbbf24;
      background: rgba(251, 191, 36, 0.1);
      padding: 1px 2px;
      border-radius: 2px;
    }
    .seq-cdr2 {
      color: #34d399;
      background: rgba(52, 211, 153, 0.1);
      padding: 1px 2px;
      border-radius: 2px;
    }
    .single-seq-card {
      background: rgba(13, 22, 35, 0.6);
      border: 1px solid #1e293b;
      border-radius: 8px;
      padding: 14px 16px;
    }

    /* Dataset Manager Modal & Controls */
    .dataset-modal-backdrop {
      position: fixed;
      top: 0;
      left: 0;
      width: 100vw;
      height: 100vh;
      background: rgba(4, 9, 20, 0.75);
      backdrop-filter: blur(8px);
      z-index: 100;
      display: flex;
      align-items: center;
      justify-content: center;
      animation: fadeIn 0.2s ease-out;
    }
    .dataset-modal-card {
      background: rgba(15, 23, 42, 0.96);
      border: 1px solid rgba(56, 189, 248, 0.35);
      border-radius: 12px;
      padding: 20px 24px;
      box-shadow: 0 20px 48px rgba(0, 0, 0, 0.8), 0 0 24px rgba(56, 189, 248, 0.2);
      max-width: 620px;
      width: 90%;
      max-height: 85vh;
      display: flex;
      flex-direction: column;
    }
    .modal-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
    }
    .dataset-actions-bar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 8px;
    }
    .small-action-btn {
      background: rgba(255, 255, 255, 0.08);
      border: 1px solid #334155;
      color: #94a3b8;
      font-size: 11px;
      padding: 3px 8px;
      border-radius: 4px;
      cursor: pointer;
      transition: all 0.2s;
    }
    .small-action-btn:hover {
      background: rgba(56, 189, 248, 0.2);
      color: #38bdf8;
      border-color: #38bdf8;
    }
    .dataset-list-container {
      display: flex;
      flex-direction: column;
      gap: 8px;
      overflow-y: auto;
      max-height: 38vh;
      padding-right: 4px;
      margin-bottom: 14px;
    }
    .dataset-item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      background: rgba(30, 41, 59, 0.6);
      border: 1px solid #334155;
      border-radius: 8px;
      padding: 8px 12px;
      transition: all 0.2s;
    }
    .dataset-item:hover {
      border-color: #475569;
      background: rgba(30, 41, 59, 0.85);
    }
    .dataset-item-left {
      display: flex;
      align-items: center;
      gap: 10px;
    }
    .dataset-item-checkbox {
      width: 16px;
      height: 16px;
      cursor: pointer;
      accent-color: #38bdf8;
    }
    .dataset-swatch {
      width: 12px;
      height: 12px;
      border-radius: 50%;
      display: inline-block;
      box-shadow: 0 0 6px currentColor;
    }
    .dataset-info-name {
      font-weight: 600;
      font-size: 13px;
      color: #f1f5f9;
    }
    .dataset-info-meta {
      font-size: 11px;
      color: #94a3b8;
    }
    .upload-dropzone {
      border: 2px dashed rgba(56, 189, 248, 0.4);
      border-radius: 10px;
      background: rgba(15, 23, 42, 0.4);
      padding: 16px;
      text-align: center;
      cursor: pointer;
      transition: all 0.2s;
    }
    .upload-dropzone:hover, .upload-dropzone.dragover {
      border-color: #38bdf8;
      background: rgba(56, 189, 248, 0.08);
    }
    .upload-browse-btn {
      background: linear-gradient(135deg, #0284c7, #0284c7);
      color: #fff;
      border: none;
      padding: 6px 14px;
      border-radius: 6px;
      font-size: 11.5px;
      font-weight: 600;
      cursor: pointer;
      margin-top: 8px;
    }
    .upload-browse-btn:hover {
      background: #0369a1;
    }
    .wasm-badge {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      background: rgba(15, 23, 42, 0.8);
      border: 1px solid rgba(148, 163, 184, 0.25);
      color: #94a3b8;
      font-size: 11px;
      font-weight: 600;
      padding: 3px 10px;
      border-radius: 9999px;
      letter-spacing: 0.3px;
      transition: all 0.25s ease;
      user-select: none;
    }
    .wasm-badge.wasm-active {
      border-color: rgba(52, 211, 153, 0.5);
      color: #34d399;
      background: rgba(16, 185, 129, 0.12);
      box-shadow: 0 0 12px rgba(52, 211, 153, 0.25);
    }
    .wasm-badge.native-active {
      border-color: rgba(56, 189, 248, 0.6);
      color: #38bdf8;
      background: rgba(14, 165, 233, 0.15);
      box-shadow: 0 0 14px rgba(56, 189, 248, 0.35);
    }
    .wasm-badge-pulse {
      display: inline-block;
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: #34d399;
      box-shadow: 0 0 6px #34d399;
      animation: wasmPulse 2s infinite;
    }
    .wasm-badge.native-active .wasm-badge-pulse {
      background: #38bdf8;
      box-shadow: 0 0 6px #38bdf8;
      animation: nativePulse 1.8s infinite;
    }
    @keyframes wasmPulse {
      0% { transform: scale(0.9); opacity: 0.7; }
      50% { transform: scale(1.3); opacity: 1; }
      100% { transform: scale(0.9); opacity: 0.7; }
    }
    @keyframes nativePulse {
      0% { transform: scale(0.9); opacity: 0.8; }
      50% { transform: scale(1.4); opacity: 1; }
      100% { transform: scale(0.9); opacity: 0.8; }
    }

    /* Dual Engine Switcher */
    .engine-switcher {
      display: inline-flex;
      align-items: center;
      background: rgba(15, 23, 42, 0.9);
      border: 1px solid rgba(148, 163, 184, 0.25);
      border-radius: 8px;
      padding: 2px;
      gap: 2px;
    }
    .engine-btn {
      background: transparent;
      border: none;
      color: #94a3b8;
      font-size: 11px;
      font-weight: 600;
      padding: 4px 9px;
      border-radius: 6px;
      cursor: pointer;
      transition: all 0.2s ease;
      white-space: nowrap;
    }
    .engine-btn:hover {
      color: #f1f5f9;
      background: rgba(255, 255, 255, 0.06);
    }
    .engine-btn.active.wasm {
      background: rgba(16, 185, 129, 0.22);
      color: #34d399;
      border: 1px solid rgba(52, 211, 153, 0.4);
      box-shadow: 0 1px 6px rgba(16, 185, 129, 0.2);
    }
    .engine-btn.active.native {
      background: rgba(14, 165, 233, 0.22);
      color: #38bdf8;
      border: 1px solid rgba(56, 189, 248, 0.5);
      box-shadow: 0 1px 8px rgba(56, 189, 248, 0.25);
    }
    .engine-btn.bench-btn {
      background: rgba(245, 158, 11, 0.15);
      color: #fbbf24;
      border: 1px solid rgba(245, 158, 11, 0.3);
      margin-left: 4px;
    }
    .engine-btn.bench-btn:hover {
      background: rgba(245, 158, 11, 0.28);
      color: #fef3c7;
    }

    /* Benchmark Modal Dialog */
    .benchmark-modal-backdrop {
      position: fixed;
      top: 0; left: 0; width: 100vw; height: 100vh;
      background: rgba(3, 7, 18, 0.75);
      backdrop-filter: blur(8px);
      z-index: 100;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .benchmark-modal-card {
      background: #0b1322;
      border: 1px solid rgba(56, 189, 248, 0.3);
      border-radius: 14px;
      width: 92vw;
      max-width: 820px;
      max-height: 88vh;
      overflow-y: auto;
      box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(56, 189, 248, 0.15);
      padding: 22px 26px;
      color: #f1f5f9;
    }
    .benchmark-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 16px;
      padding-bottom: 12px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }
    .benchmark-title {
      font-size: 18px;
      font-weight: 700;
      font-family: 'Outfit', sans-serif;
      display: flex;
      align-items: center;
      gap: 10px;
      color: #f8fafc;
    }
    .benchmark-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 16px;
      margin-bottom: 18px;
    }
    @media (max-width: 700px) {
      .benchmark-grid { grid-template-columns: 1fr; }
    }
    .benchmark-col-card {
      background: rgba(15, 23, 42, 0.65);
      border: 1px solid rgba(148, 163, 184, 0.15);
      border-radius: 10px;
      padding: 14px 16px;
    }
    .benchmark-col-card.wasm-col {
      border-top: 3px solid #34d399;
    }
    .benchmark-col-card.native-col {
      border-top: 3px solid #38bdf8;
    }
    .bench-col-title {
      font-size: 14px;
      font-weight: 700;
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 8px;
    }
    .bench-stat-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 6px 0;
      border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
      font-size: 12px;
    }
    .bench-stat-label { color: #94a3b8; }
    .bench-stat-value {
      font-family: 'Fira Code', monospace;
      font-weight: 600;
      color: #f1f5f9;
    }
    .speedup-badge {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      background: linear-gradient(135deg, rgba(14, 165, 233, 0.25), rgba(16, 185, 129, 0.25));
      border: 1px solid rgba(56, 189, 248, 0.5);
      padding: 3px 8px;
      border-radius: 6px;
      font-size: 11px;
      font-weight: 700;
      color: #38bdf8;
    }
    .benchmark-run-bar {
      display: flex;
      gap: 12px;
      align-items: center;
      margin-top: 14px;
    }

    /* TCR D & J Elements Drawer & Component Styling */
    #tcrDjDrawer {
      position: fixed;
      bottom: 16px;
      left: 50%;
      transform: translateX(-50%);
      width: min(1380px, 96vw);
      max-height: 520px;
      background: rgba(10, 14, 26, 0.98);
      border: 1px solid #7c3aed;
      border-radius: 12px;
      backdrop-filter: blur(18px);
      box-shadow: 0 18px 50px rgba(0, 0, 0, 0.92);
      display: flex;
      flex-direction: column;
      z-index: 46;
      transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    }
    #tcrDjDrawer.collapsed {
      transform: translateX(-50%) translateY(650px);
      opacity: 0;
      pointer-events: none;
    }
    .dj-drawer-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 10px 16px;
      border-bottom: 1px solid rgba(124, 58, 237, 0.3);
      background: rgba(20, 15, 38, 0.85);
      border-radius: 12px 12px 0 0;
      user-select: none;
      flex-wrap: wrap;
      gap: 10px;
    }
    .dj-drawer-title-row {
      display: flex;
      align-items: center;
      gap: 12px;
    }
    .dj-drawer-title {
      font-family: 'Outfit', sans-serif;
      font-size: 15px;
      font-weight: 700;
      color: #c084fc;
    }
    .dj-tab-pill {
      font-size: 11.5px;
      padding: 4px 10px;
      border-radius: 6px;
      font-weight: 600;
      cursor: pointer;
      background: rgba(124, 58, 237, 0.15);
      border: 1px solid rgba(124, 58, 237, 0.35);
      color: #d8b4fe;
      transition: all 0.2s;
    }
    .dj-tab-pill:hover {
      background: rgba(124, 58, 237, 0.3);
      color: #fff;
    }
    .dj-tab-pill.active {
      background: #7c3aed;
      border-color: #a855f7;
      color: #fff;
      box-shadow: 0 0 12px rgba(168, 85, 247, 0.5);
    }
    .dj-drawer-actions {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }
    .dj-drawer-body {
      overflow-y: auto;
      padding: 14px 18px;
      font-family: 'Inter', sans-serif;
      color: #f0f6fc;
      max-height: 440px;
    }
    .pill-bottom-dj {
      bottom: 65px;
      right: 20px;
      border-color: rgba(168, 85, 247, 0.5);
      color: #c084fc;
    }
    .pill-bottom-dj:hover {
      border-color: #c084fc;
      box-shadow: 0 0 16px rgba(168, 85, 247, 0.6);
      color: #f3e8ff;
    }

    /* TCR D-gene Cards & Reading Frame Grid */
    .tcr-d-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
      gap: 14px;
    }
    .tcr-d-card {
      background: rgba(15, 23, 42, 0.85);
      border: 1px solid rgba(124, 58, 237, 0.3);
      border-radius: 10px;
      padding: 12px 14px;
      display: flex;
      flex-direction: column;
      gap: 8px;
      transition: all 0.2s;
    }
    .tcr-d-card:hover {
      border-color: #a855f7;
      box-shadow: 0 4px 18px rgba(124, 58, 237, 0.25);
    }
    .tcr-d-card-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
    }
    .tcr-d-card-title {
      font-family: 'Outfit', sans-serif;
      font-size: 14px;
      font-weight: 700;
      color: #e2e8f0;
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .rf-matrix-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 6px;
      margin-top: 4px;
    }
    .rf-subbox {
      background: rgba(2, 6, 23, 0.6);
      border: 1px solid rgba(255, 255, 255, 0.06);
      border-radius: 6px;
      padding: 5px 8px;
      font-size: 11px;
    }
    .rf-subbox-title {
      font-size: 10px;
      font-weight: 700;
      color: #94a3b8;
      text-transform: uppercase;
      display: flex;
      justify-content: space-between;
    }
    .rf-subbox-seq {
      font-family: 'Fira Code', monospace;
      font-size: 11.5px;
      color: #38bdf8;
      word-break: break-all;
      margin-top: 2px;
    }
    .rf-subbox-seq.inv {
      color: #f59e0b;
    }

    /* TCR J-gene Table */
    .tcr-j-table-container {
      background: rgba(15, 23, 42, 0.6);
      border: 1px solid rgba(56, 189, 248, 0.2);
      border-radius: 8px;
      overflow-x: auto;
    }
    .tcr-j-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 12px;
      text-align: left;
    }
    .tcr-j-table th {
      background: rgba(30, 41, 59, 0.85);
      color: #94a3b8;
      padding: 8px 12px;
      font-weight: 600;
      border-bottom: 1px solid rgba(255, 255, 255, 0.08);
      white-space: nowrap;
    }
    .tcr-j-table td {
      padding: 7px 12px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.04);
      color: #e2e8f0;
      white-space: nowrap;
    }
    .tcr-j-table tr:hover td {
      background: rgba(56, 189, 248, 0.08);
    }
    .j-boundary-tag {
      display: inline-block;
      font-family: 'Fira Code', monospace;
      font-size: 11px;
      font-weight: 700;
      color: #34d399;
      background: rgba(52, 211, 153, 0.15);
      border: 1px solid rgba(52, 211, 153, 0.4);
      padding: 2px 6px;
      border-radius: 4px;
    }


