:root {
        --bg-deep: #050811;
        --bg: #070f18;
        --bg-surface: #0c1826;
        --bg-card: rgba(13, 24, 40, 0.85);
        --bg-card-hover: rgba(19, 36, 60, 0.95);
        --bg-glass: rgba(10, 20, 34, 0.8);
        --border: #1e3a59;
        --border-subtle: rgba(56, 189, 248, 0.14);
        --border-mid: rgba(56, 189, 248, 0.28);
        --border-focus: #00f2fe;
        
        --text-primary: #f8fafc;
        --text-secondary: #94a9c4;
        --text-muted: #627b99;
        --text-dim: #475569;
        
        --accent-cyan: #00f2fe;
        --accent-teal: #2dd4bf;
        --accent-blue: #38bdf8;
        --accent-indigo: #818cf8;
        
        --severity-synergy: #10b981;
        --severity-synergy-bg: rgba(16, 185, 129, 0.12);
        --severity-synergy-border: rgba(16, 185, 129, 0.35);
        
        --severity-neutral: #64748b;
        --severity-neutral-bg: rgba(100, 116, 139, 0.10);
        --severity-neutral-border: rgba(100, 116, 139, 0.25);
        
        --severity-moderate: #f59e0b;
        --severity-moderate-bg: rgba(245, 158, 11, 0.12);
        --severity-moderate-border: rgba(245, 158, 11, 0.38);
        
        --severity-high: #ef4444;
        --severity-high-bg: rgba(239, 68, 68, 0.14);
        --severity-high-border: rgba(239, 68, 68, 0.40);
        
        --severity-self: #3b82f6;
        --severity-self-bg: rgba(59, 130, 246, 0.12);
        --severity-self-border: rgba(59, 130, 246, 0.35);
        
        --radius-xs: 4px;
        --radius-sm: 8px;
        --radius-md: 12px;
        --radius-lg: 18px;
        --radius-xl: 24px;
        
        --shadow-card: 0 10px 30px -8px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.05);
        --shadow-glow-cyan: 0 0 25px rgba(0, 242, 254, 0.22);
        --shadow-glow-emerald: 0 0 25px rgba(16, 185, 129, 0.22);
        --shadow-glow-crimson: 0 0 25px rgba(239, 68, 68, 0.22);
      }

      *, *::before, *::after {
        box-sizing: border-box;
        margin: 0;
        padding: 0;
      }

      html {
        min-height: 100%;
        overflow-x: hidden;
        scroll-behavior: smooth;
        scrollbar-gutter: stable;
      }

      /* Modern Webkit Scrollbar */
      ::-webkit-scrollbar {
        width: 10px;
        height: 10px;
      }
      ::-webkit-scrollbar-track {
        background: rgba(10, 20, 34, 0.4);
      }
      ::-webkit-scrollbar-thumb {
        background: rgba(56, 189, 248, 0.2);
        border-radius: 5px;
        border: 2px solid rgba(10, 20, 34, 0.8);
      }
      ::-webkit-scrollbar-thumb:hover {
        background: rgba(56, 189, 248, 0.4);
      }

      body {
        font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
        background-color: var(--bg-deep);
        background-image: 
          radial-gradient(circle at 15% 15%, rgba(0, 242, 254, 0.05) 0%, transparent 40%),
          radial-gradient(circle at 85% 85%, rgba(16, 185, 129, 0.04) 0%, transparent 45%),
          linear-gradient(180deg, #050811 0%, #08111e 100%);
        color: var(--text-primary);
        min-height: 100vh;
        overflow-x: hidden;
        line-height: 1.5;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
      }

      a {
        color: var(--accent-blue);
        text-decoration: none;
        transition: color 0.15s ease;
      }
      a:hover {
        color: var(--accent-cyan);
      }

      .app-wrapper {
        max-width: 1520px;
        margin: 0 auto;
        padding: 16px 22px 60px;
        box-sizing: border-box;
      }

      /* ==========================================================================
         LUCIDE ICONS & VECTOR GLYPHS
         ========================================================================== */
      .lucide,
      svg.lucide,
      .lucide-icon {
        display: inline-block;
        vertical-align: -0.125em;
        stroke-width: 2px;
        stroke: currentColor;
        fill: none;
        stroke-linecap: round;
        stroke-linejoin: round;
        flex-shrink: 0;
      }

      /* When inside flex/inline-flex containers, buttons, chips, pills, or nav-links, align precisely to center */
      button .lucide,
      button svg.lucide,
      .btn .lucide,
      .btn svg.lucide,
      .preset-chip-btn .lucide,
      .preset-chip-btn svg.lucide,
      .quick-cat-btn .lucide,
      .quick-cat-btn svg.lucide,
      .filter-btn .lucide,
      .filter-btn svg.lucide,
      .nav-link .lucide,
      .nav-link svg.lucide,
      .btn-header-action .lucide,
      .btn-header-action svg.lucide,
      .stat-chip-label .lucide,
      .stat-chip-label svg.lucide,
      .kg-spotlight-quick-btn .lucide,
      .kg-spotlight-quick-btn svg.lucide,
      .tab-btn .lucide,
      .tab-btn svg.lucide {
        vertical-align: middle;
        align-self: center;
      }

      .icon-xs {
        width: 12px !important;
        height: 12px !important;
        stroke-width: 2px;
      }

      .icon-sm {
        width: 15px !important;
        height: 15px !important;
        stroke-width: 2px;
      }

      .icon-md {
        width: 19px !important;
        height: 19px !important;
        stroke-width: 1.85px;
      }

      .icon-lg {
        width: 24px !important;
        height: 24px !important;
        stroke-width: 1.75px;
      }

      .icon-xl {
        width: 32px !important;
        height: 32px !important;
        stroke-width: 1.65px;
      }

      /* Color Accent & Glow Classes for Icons */
      .icon-cyan { stroke: var(--accent-cyan) !important; }
      .icon-teal { stroke: var(--accent-teal) !important; }
      .icon-blue { stroke: var(--accent-blue) !important; }
      .icon-indigo { stroke: var(--accent-indigo) !important; }
      .icon-emerald { stroke: var(--severity-synergy) !important; }
      .icon-amber { stroke: var(--severity-moderate) !important; }
      .icon-rose { stroke: var(--severity-high) !important; }
      .icon-purple { stroke: #c084fc !important; }
      .icon-violet { stroke: #a855f7 !important; }
      .icon-sky { stroke: #38bdf8 !important; }
      .icon-muted { stroke: var(--text-muted) !important; }

      .icon-glow-cyan { filter: drop-shadow(0 0 5px rgba(0, 242, 254, 0.55)); }
      .icon-glow-teal { filter: drop-shadow(0 0 5px rgba(45, 212, 191, 0.55)); }
      .icon-glow-emerald { filter: drop-shadow(0 0 5px rgba(16, 185, 129, 0.55)); }
      .icon-glow-amber { filter: drop-shadow(0 0 5px rgba(245, 158, 11, 0.55)); }
      .icon-glow-rose { filter: drop-shadow(0 0 5px rgba(239, 68, 68, 0.55)); }
      .icon-glow-indigo { filter: drop-shadow(0 0 5px rgba(99, 102, 241, 0.55)); }
      .icon-glow-purple { filter: drop-shadow(0 0 5px rgba(192, 132, 252, 0.55)); }

      /* Colored icon badge chips */
      .icon-badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 6px;
        padding: 4px;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.08);
      }
      .icon-badge-cyan { background: rgba(0, 242, 254, 0.12); border-color: rgba(0, 242, 254, 0.3); color: #00f2fe; }
      .icon-badge-teal { background: rgba(45, 212, 191, 0.12); border-color: rgba(45, 212, 191, 0.3); color: #2dd4bf; }
      .icon-badge-emerald { background: rgba(16, 185, 129, 0.12); border-color: rgba(16, 185, 129, 0.3); color: #10b981; }
      .icon-badge-rose { background: rgba(239, 68, 68, 0.12); border-color: rgba(239, 68, 68, 0.3); color: #f87171; }
      .icon-badge-amber { background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.3); color: #fbbf24; }
      .icon-badge-indigo { background: rgba(99, 102, 241, 0.12); border-color: rgba(99, 102, 241, 0.3); color: #818cf8; }
      .icon-badge-purple { background: rgba(168, 85, 247, 0.12); border-color: rgba(168, 85, 247, 0.3); color: #c084fc; }

      /* ==========================================================================
         TOPBAR & GLOBAL HEADER
         ========================================================================== */
      .topbar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 16px;
        padding: 12px 20px;
        background: var(--bg-glass);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-card);
        margin-bottom: 18px;
        position: relative;
        z-index: 120;
      }

      .brand-group {
        display: flex;
        align-items: center;
        gap: 12px;
      }

      .brand-icon {
        width: 38px;
        height: 38px;
        border-radius: var(--radius-md);
        background: linear-gradient(135deg, var(--accent-cyan), #3b82f6);
        display: flex;
        align-items: center;
        justify-content: center;
        color: #04151b;
        font-weight: 900;
        font-size: 1.15rem;
        box-shadow: 0 0 16px rgba(0, 242, 254, 0.4);
        flex-shrink: 0;
      }

      .brand-titles {
        display: flex;
        flex-direction: column;
      }

      .brand-title {
        font-size: clamp(1rem, 2.4vw, 1.22rem);
        font-weight: 800;
        letter-spacing: -0.01em;
        color: var(--text-primary);
        line-height: 1.2;
      }

      .brand-subtitle {
        font-size: clamp(0.68rem, 1.7vw, 0.74rem);
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        color: var(--accent-cyan);
      }

      .topbar-actions {
        display: flex;
        align-items: center;
        gap: 10px;
      }

      .btn-header-action {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius-sm);
        padding: 6px 12px;
        font-size: 0.8rem;
        font-weight: 700;
        color: var(--text-secondary);
        cursor: pointer;
        transition: all 0.2s ease;
      }
      .btn-header-action:hover {
        background: rgba(0, 242, 254, 0.12);
        color: var(--text-primary);
        border-color: rgba(0, 242, 254, 0.4);
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(0, 242, 254, 0.15);
      }
      .btn-header-action:active {
        transform: translateY(1px) scale(0.97);
        box-shadow: none;
      }

      .mode-toggle-group {
        display: flex;
        background: rgba(0, 0, 0, 0.4);
        border: 1px solid var(--border-subtle);
        border-radius: 9999px;
        padding: 2px;
      }

      .mode-btn {
        background: none;
        border: none;
        padding: 5px 12px;
        border-radius: 9999px;
        font-size: 0.75rem;
        font-weight: 700;
        color: var(--text-muted);
        cursor: pointer;
        transition: all 0.2s ease;
      }
      .mode-btn.active {
        background: linear-gradient(135deg, rgba(0, 242, 254, 0.25), rgba(59, 130, 246, 0.25));
        color: var(--accent-cyan);
        box-shadow: 0 0 10px rgba(0, 242, 254, 0.25);
      }

      /* Mode-Specific UX Styles (Standard vs Power User) */
      body.mode-standard .power-user-only {
        display: none !important;
      }
      body.mode-power .standard-user-only {
        display: none !important;
      }
      
      body.mode-standard .axis-val-primary {
        font-size: 1.05rem;
      }
      
      .standard-range-meter-wrap {
        position: relative;
        background: rgba(15, 23, 42, 0.6);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 8px;
        padding: 8px 12px;
        margin: 8px 0;
      }
      .standard-range-track {
        position: relative;
        height: 8px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 9999px;
        margin: 14px 0 8px 0;
        overflow: visible;
      }
      .standard-range-target-zone {
        position: absolute;
        top: 0;
        bottom: 0;
        background: linear-gradient(90deg, rgba(16, 185, 129, 0.35), rgba(16, 185, 129, 0.65));
        border-radius: 9999px;
      }
      .standard-range-pin {
        position: absolute;
        top: -5px;
        width: 18px;
        height: 18px;
        border-radius: 50%;
        border: 2px solid #0f172a;
        transform: translateX(-50%);
        box-shadow: 0 0 8px currentColor;
        transition: left 0.3s ease;
      }
      .standard-range-labels {
        display: flex;
        justify-content: space-between;
        font-size: 0.68rem;
        color: var(--text-muted);
        margin-top: 4px;
      }

      .nav-links {
        display: flex;
        align-items: center;
        gap: 8px;
      }

      .nav-link {
        padding: 6px 12px;
        border-radius: var(--radius-sm);
        font-size: 0.84rem;
        font-weight: 700;
        color: var(--text-secondary);
        transition: all 0.2s ease;
      }
      .nav-link:hover {
        color: var(--text-primary);
        background: rgba(255, 255, 255, 0.05);
      }
      .nav-link.active {
        color: #04151b;
        background: var(--accent-cyan);
        box-shadow: 0 0 14px rgba(0, 242, 254, 0.35);
      }

      .mobile-menu-toggle {
        display: none;
        background: var(--bg-card);
        border: 1px solid var(--border);
        color: var(--text-primary);
        font-size: 1.25rem;
        padding: 6px 12px;
        border-radius: var(--radius-sm);
        cursor: pointer;
      }

      /* ==========================================================================
         PRESET SCENARIOS POPUP MENU
         ========================================================================== */
      .preset-dropdown-wrap {
        position: relative;
      }

      .preset-menu {
        display: none;
        position: absolute;
        top: calc(100% + 8px);
        right: 0;
        width: 360px;
        background: rgba(10, 20, 36, 0.98);
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
        border: 1px solid var(--border-mid);
        border-radius: var(--radius-md);
        box-shadow: 0 18px 45px rgba(0, 0, 0, 0.7);
        padding: 10px;
        z-index: 160;
      }
      .preset-menu.open {
        display: flex;
        flex-direction: column;
        gap: 6px;
        animation: dropFade 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
      }

      .preset-menu-header {
        font-size: 0.72rem;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        color: var(--text-muted);
        padding: 4px 8px 6px;
        border-bottom: 1px solid var(--border-subtle);
        margin-bottom: 2px;
        display: flex;
        justify-content: space-between;
      }

      .preset-item {
        display: flex;
        flex-direction: column;
        gap: 3px;
        padding: 8px 10px;
        border-radius: var(--radius-sm);
        cursor: pointer;
        transition: all 0.15s ease;
        border: 1px solid transparent;
        background: rgba(255, 255, 255, 0.02);
      }
      .preset-item:hover {
        background: rgba(0, 242, 254, 0.12);
        border-color: rgba(0, 242, 254, 0.35);
        transform: translateX(2px);
      }
      .preset-item:active {
        transform: translateX(1px) scale(0.98);
        background: rgba(0, 242, 254, 0.18);
      }

      .preset-item-title {
        font-size: 0.86rem;
        font-weight: 700;
        color: var(--text-primary);
        display: flex;
        align-items: center;
        justify-content: space-between;
      }
      .preset-badge {
        font-size: 0.65rem;
        font-weight: 700;
        padding: 1px 6px;
        border-radius: 4px;
        background: rgba(0, 242, 254, 0.15);
        color: #00f2fe;
      }
      .preset-item-desc {
        font-size: 0.73rem;
        color: var(--text-secondary);
        line-height: 1.35;
      }

      @keyframes dropFade {
        from { opacity: 0; transform: translateY(-6px); }
        to { opacity: 1; transform: translateY(0); }
      }

      /* ==========================================================================
         GAUGE & STATUS SUMMARY BANNER
         ========================================================================== */
      .status-banner {
        display: grid;
        grid-template-columns: 260px 1fr;
        gap: 20px;
        padding: 18px 24px;
        background: var(--bg-card);
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius-xl);
        box-shadow: var(--shadow-card);
        margin-bottom: 20px;
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        align-items: center;
      }

      .gauge-card {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 16px;
        background: rgba(0, 0, 0, 0.3);
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius-lg);
        text-align: center;
      }

      .gauge-meter-wrap {
        position: relative;
        width: 130px;
        height: 130px;
        margin-bottom: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
      }

      .gauge-svg {
        width: 130px;
        height: 130px;
        transform: rotate(-90deg);
      }

      .gauge-bg-circle {
        fill: none;
        stroke: rgba(255, 255, 255, 0.06);
        stroke-width: 10;
      }

      .gauge-bar-circle {
        fill: none;
        stroke: var(--severity-synergy);
        stroke-width: 10;
        stroke-linecap: round;
        stroke-dasharray: 377;
        stroke-dashoffset: 377;
        transition: stroke-dashoffset 0.8s cubic-bezier(0.16, 1, 0.3, 1), stroke 0.4s ease;
      }

      .gauge-inner-text {
        position: absolute;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
      }

      .gauge-score-val {
        font-size: 2.1rem;
        font-weight: 900;
        font-family: 'JetBrains Mono', monospace;
        color: var(--text-primary);
        line-height: 1;
      }

      .gauge-score-label {
        font-size: 0.68rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        color: var(--text-muted);
        margin-top: 2px;
      }

      .risk-band-pill {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 4px 12px;
        border-radius: 9999px;
        font-size: 0.76rem;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        border: 1px solid transparent;
      }

      .band-minimal {
        background: var(--severity-synergy-bg);
        color: var(--severity-synergy);
        border-color: var(--severity-synergy-border);
      }

      .band-low {
        background: rgba(52, 211, 153, 0.14);
        color: #34d399;
        border-color: rgba(52, 211, 153, 0.35);
      }

      .band-moderate {
        background: var(--severity-moderate-bg);
        color: var(--severity-moderate);
        border-color: var(--severity-moderate-border);
      }

      .band-elevated {
        background: rgba(248, 113, 113, 0.14);
        color: #f87171;
        border-color: rgba(248, 113, 113, 0.38);
      }

      .band-severe {
        background: var(--severity-high-bg);
        color: var(--severity-high);
        border-color: var(--severity-high-border);
        box-shadow: var(--shadow-glow-crimson);
      }

      .summary-content {
        display: flex;
        flex-direction: column;
        gap: 14px;
      }

      .summary-heading {
        font-size: 1.18rem;
        font-weight: 800;
        color: var(--text-primary);
        letter-spacing: -0.01em;
        margin-bottom: 4px;
      }

      .summary-text-box {
        font-size: 0.9rem;
        color: var(--text-secondary);
        line-height: 1.45;
      }

      .summary-stats-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
      }

      .stat-chip {
        background: rgba(0, 0, 0, 0.25);
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius-md);
        padding: 10px 14px;
        display: flex;
        flex-direction: column;
        gap: 2px;
      }

      .stat-chip-label {
        font-size: 0.7rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: var(--text-muted);
      }

      .stat-chip-val {
        font-size: 1.3rem;
        font-weight: 800;
        font-family: 'JetBrains Mono', monospace;
        color: var(--text-primary);
      }

      /* ==========================================================================
         WORKBENCH LAYOUT
         ========================================================================== */
      .workbench-layout {
        display: grid;
        grid-template-columns: 430px 1fr;
        gap: 20px;
        align-items: flex-start;
      }

      .panel {
        background: var(--bg-card);
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius-xl);
        padding: 20px;
        box-shadow: var(--shadow-card);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
      }

      .panel-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 14px;
      }

      .panel-title {
        font-size: 1.05rem;
        font-weight: 800;
        color: var(--text-primary);
        display: flex;
        align-items: center;
        gap: 8px;
      }

      .panel-title-badge {
        font-size: 0.72rem;
        font-weight: 700;
        padding: 2px 8px;
        border-radius: 9999px;
        background: rgba(0, 242, 254, 0.12);
        color: var(--accent-cyan);
        border: 1px solid rgba(0, 242, 254, 0.3);
      }

      /* PRESETS IN WORKBENCH QUICK BAR */
      .workbench-presets-bar {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        margin-bottom: 14px;
        padding-bottom: 10px;
        border-bottom: 1px solid var(--border-subtle);
      }

      .preset-chip-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 5px;
        background: rgba(0, 242, 254, 0.08);
        border: 1px solid rgba(0, 242, 254, 0.25);
        color: #e0f2fe;
        font-size: 0.74rem;
        font-weight: 700;
        padding: 4px 10px;
        border-radius: 9999px;
        cursor: pointer;
        line-height: 1;
        white-space: nowrap;
        vertical-align: middle;
        transition: all 0.15s ease;
      }
      .preset-chip-btn:hover {
        background: rgba(0, 242, 254, 0.2);
        border-color: #00f2fe;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(0, 242, 254, 0.25);
      }
      .preset-chip-btn:active {
        transform: translateY(1px) scale(0.95);
        box-shadow: none;
      }

      /* ==========================================================================
         SEARCH & QUICK TAGS
         ========================================================================== */
      /* SEARCH MODALITY FILTER BAR */
      .search-modality-bar {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 6px;
        margin-bottom: 10px;
        padding-bottom: 2px;
      }
      .search-modality-bar::-webkit-scrollbar {
        display: none;
      }

      .search-mod-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 5px;
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid var(--border-subtle);
        border-radius: 9999px;
        padding: 4px 11px;
        font-size: 0.72rem;
        font-weight: 700;
        color: var(--text-muted);
        cursor: pointer;
        white-space: nowrap;
        line-height: 1;
        vertical-align: middle;
        outline: none;
        transition: all 0.15s ease;
        user-select: none;
        font-family: inherit;
      }
      .search-mod-btn:hover {
        color: var(--text-primary);
        background: rgba(255, 255, 255, 0.08);
        border-color: rgba(255, 255, 255, 0.2);
        transform: translateY(-1px);
      }
      .search-mod-btn:active {
        transform: translateY(1px) scale(0.97);
      }
      .search-mod-btn.active {
        background: rgba(0, 242, 254, 0.15);
        color: var(--accent-cyan);
        border-color: rgba(0, 242, 254, 0.45);
        box-shadow: 0 0 10px rgba(0, 242, 254, 0.2);
      }
      .search-mod-btn.active[data-modality="peptide"] {
        background: rgba(45, 212, 191, 0.15);
        color: var(--accent-teal);
        border-color: rgba(45, 212, 191, 0.45);
        box-shadow: 0 0 10px rgba(45, 212, 191, 0.2);
      }
      .search-mod-btn.active[data-modality="biologic_antibody"] {
        background: rgba(192, 132, 252, 0.15);
        color: #c084fc;
        border-color: rgba(192, 132, 252, 0.45);
        box-shadow: 0 0 10px rgba(192, 132, 252, 0.2);
      }
      .search-mod-btn.active[data-modality="botanical_natural"] {
        background: rgba(16, 185, 129, 0.15);
        color: #10b981;
        border-color: rgba(16, 185, 129, 0.45);
        box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
      }
      .search-mod-btn.active[data-modality="combination_drug"] {
        background: rgba(245, 158, 11, 0.15);
        color: #fbbf24;
        border-color: rgba(245, 158, 11, 0.45);
        box-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
      }
      .search-mod-btn.active[data-modality="small_molecule"] {
        background: rgba(59, 130, 246, 0.15);
        color: #60a5fa;
        border-color: rgba(59, 130, 246, 0.45);
        box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
      }

      .search-mod-badge {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        font-size: 0.64rem;
        font-weight: 700;
        letter-spacing: 0.03em;
        padding: 1px 6px;
        border-radius: 4px;
        text-transform: uppercase;
        margin-left: 6px;
        vertical-align: middle;
      }
      .search-mod-badge.badge-peptide {
        background: rgba(45, 212, 191, 0.15);
        color: #2dd4bf;
        border: 1px solid rgba(45, 212, 191, 0.35);
      }
      .search-mod-badge.badge-biologic {
        background: rgba(192, 132, 252, 0.15);
        color: #c084fc;
        border: 1px solid rgba(192, 132, 252, 0.35);
      }
      .search-mod-badge.badge-botanical {
        background: rgba(16, 185, 129, 0.15);
        color: #10b981;
        border: 1px solid rgba(16, 185, 129, 0.35);
      }
      .search-mod-badge.badge-combo {
        background: rgba(245, 158, 11, 0.15);
        color: #f59e0b;
        border: 1px solid rgba(245, 158, 11, 0.35);
      }
      .search-mod-badge.badge-small-molecule {
        background: rgba(59, 130, 246, 0.15);
        color: #60a5fa;
        border: 1px solid rgba(59, 130, 246, 0.35);
      }

      .search-container {
        position: relative;
        margin-bottom: 14px;
      }

      .search-input-wrapper {
        position: relative;
        display: flex;
        align-items: center;
      }

      .search-icon {
        position: absolute;
        left: 12px;
        font-size: 0.95rem;
        opacity: 0.6;
        pointer-events: none;
      }

      .search-input {
        width: 100%;
        background: rgba(5, 12, 22, 0.85);
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
        padding: 10px 36px 10px 36px;
        color: var(--text-primary);
        font-size: 0.88rem;
        font-family: inherit;
        outline: none;
        transition: all 0.2s ease;
      }
      .search-input:focus {
        border-color: var(--border-focus);
        box-shadow: 0 0 12px rgba(0, 242, 254, 0.2);
        background: rgba(7, 16, 30, 0.95);
      }

      .search-dropdown {
        display: none;
        position: absolute;
        top: calc(100% + 6px);
        left: 0;
        right: 0;
        background: rgba(10, 22, 38, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border: 1px solid var(--border-mid);
        border-radius: var(--radius-md);
        box-shadow: 0 14px 36px rgba(0, 0, 0, 0.65);
        max-height: 280px;
        overflow-y: auto;
        z-index: 100;
      }

      .search-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 14px;
        border-bottom: 1px solid var(--border-subtle);
        cursor: pointer;
        transition: background 0.15s ease;
      }
      .search-item:last-child {
        border-bottom: none;
      }
      .search-item:hover {
        background: rgba(0, 242, 254, 0.12);
      }

      .search-item-info {
        display: flex;
        flex-direction: column;
        gap: 2px;
      }

      .search-item-name {
        font-weight: 700;
        font-size: 0.88rem;
        color: var(--text-primary);
      }

      .search-item-class {
        font-size: 0.72rem;
        color: var(--text-muted);
      }

      .search-item-add-btn {
        font-size: 0.76rem;
        font-weight: 700;
        color: var(--accent-cyan);
        background: rgba(0, 242, 254, 0.12);
        border: 1px solid rgba(0, 242, 254, 0.3);
        padding: 3px 8px;
        border-radius: var(--radius-xs);
      }

      /* QUICK TAG CATEGORIES */
      .quick-tags-section {
        margin-bottom: 18px;
      }

      .quick-tags-nav {
        display: flex;
        gap: 6px;
        margin-bottom: 8px;
        overflow-x: auto;
        scrollbar-width: none;
      }
      .quick-tags-nav::-webkit-scrollbar { display: none; }

      .quick-cat-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 5px;
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid var(--border-subtle);
        border-radius: 9999px;
        padding: 4px 10px;
        font-size: 0.72rem;
        font-weight: 700;
        color: var(--text-muted);
        cursor: pointer;
        white-space: nowrap;
        line-height: 1;
        vertical-align: middle;
        transition: all 0.15s ease;
      }
      .quick-cat-btn:hover {
        color: var(--text-primary);
        background: rgba(255, 255, 255, 0.08);
      }
      .quick-cat-btn.active {
        background: rgba(0, 242, 254, 0.15);
        color: var(--accent-cyan);
        border-color: rgba(0, 242, 254, 0.4);
      }

      .quick-tags-wrap {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
      }

      .quick-tag {
        background: rgba(14, 28, 48, 0.6);
        border: 1px solid var(--border-subtle);
        color: var(--text-secondary);
        padding: 4px 10px;
        border-radius: 999px;
        font-size: 0.76rem;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.15s ease;
      }
      .quick-tag:hover {
        background: rgba(0, 242, 254, 0.14);
        color: var(--text-primary);
        border-color: rgba(0, 242, 254, 0.4);
        transform: translateY(-1px);
      }

      /* ACTIVE STACK LIST */
      .stack-list-section {
        margin-bottom: 20px;
      }

      .stack-empty-card {
        padding: 32px 20px;
        border: 2px dashed var(--border-subtle);
        border-radius: var(--radius-lg);
        text-align: center;
        color: var(--text-muted);
        font-size: 0.86rem;
        line-height: 1.4;
      }

      .stack-items-wrap {
        display: flex;
        flex-direction: column;
        gap: 10px;
      }

      .stack-item-card {
        background: rgba(10, 20, 36, 0.7);
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius-md);
        padding: 12px 14px;
        display: flex;
        flex-direction: column;
        gap: 8px;
        transition: border-color 0.2s ease, transform 0.15s ease;
      }
      .stack-item-card:hover {
        border-color: var(--border-mid);
        transform: translateY(-1px);
      }

      .stack-item-top {
        display: flex;
        justify-content: space-between;
        align-items: center;
      }

      .stack-item-name-group {
        display: flex;
        align-items: center;
        gap: 8px;
      }

      .stack-item-name {
        font-weight: 700;
        font-size: 0.92rem;
        color: var(--text-primary);
      }

      .stack-item-class {
        font-size: 0.7rem;
        padding: 2px 6px;
        border-radius: 4px;
        background: rgba(255, 255, 255, 0.06);
        color: var(--text-muted);
      }

      .stack-item-actions {
        display: flex;
        align-items: center;
        gap: 6px;
      }

      .stack-item-link-btn {
        font-size: 0.74rem;
        color: var(--text-muted);
        padding: 2px 6px;
        border-radius: var(--radius-xs);
        transition: all 0.15s ease;
      }
      .stack-item-link-btn:hover {
        color: var(--accent-cyan);
        background: rgba(0, 242, 254, 0.1);
      }

      .stack-item-remove-btn {
        background: none;
        border: none;
        color: var(--text-muted);
        font-size: 1.1rem;
        cursor: pointer;
        padding: 2px 6px;
        border-radius: 4px;
        transition: all 0.15s ease;
      }
      .stack-item-remove-btn:hover {
        color: var(--severity-high);
        background: rgba(239, 68, 68, 0.12);
      }

      .control-select, .control-input {
        background: rgba(5, 12, 22, 0.85);
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius-sm);
        color: var(--text-primary);
        font-size: 0.8rem;
        font-family: inherit;
        padding: 6px 8px;
        outline: none;
        transition: border-color 0.15s ease;
        box-sizing: border-box;
      }
      .control-select:focus, .control-input:focus {
        border-color: var(--border-focus);
      }

      .stack-item-controls-wrap {
        display: flex;
        flex-direction: column;
        gap: 6px;
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
      }

      .stack-item-row {
        display: flex;
        gap: 6px;
        align-items: center;
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
      }

      .stack-item-dose-group {
        display: flex;
        align-items: center;
        gap: 4px;
        flex: 1 1 0;
        min-width: 0;
        box-sizing: border-box;
      }

      .stack-dose-input {
        width: 74px;
        flex: 1 1 0;
        min-width: 0;
        padding: 4px 8px;
        font-weight: 700;
        font-family: 'JetBrains Mono', monospace;
        box-sizing: border-box;
      }

      .stack-unit-select {
        width: 58px;
        flex-shrink: 0;
        padding: 4px 6px;
        font-weight: 700;
        box-sizing: border-box;
      }

      .stack-timing-select {
        flex: 1 1 0;
        min-width: 0;
        box-sizing: border-box;
      }

      .stack-route-select, .stack-freq-select {
        flex: 1 1 0;
        min-width: 0;
        font-size: 0.75rem;
        font-weight: 600;
        box-sizing: border-box;
      }

      .stack-item-eff-row {
        text-align: right;
        min-width: 0;
      }

      .eff-daily-badge {
        font-size: 0.68rem;
        color: #00f2fe;
        font-family: 'JetBrains Mono', monospace;
        white-space: nowrap;
        font-weight: 700;
      }

      /* BIOMARKERS ACCORDION & DRAWER */
      .biomarker-card {
        background: rgba(10, 20, 36, 0.6);
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius-lg);
        padding: 14px 16px;
        margin-top: 16px;
      }

      .biomarker-header {
        font-size: 0.86rem;
        font-weight: 700;
        color: var(--text-primary);
        display: flex;
        justify-content: space-between;
        align-items: center;
        cursor: pointer;
        user-select: none;
      }

      .biomarker-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        margin-top: 12px;
      }

      .biomarker-field {
        display: flex;
        flex-direction: column;
        gap: 4px;
      }

      .biomarker-label {
        font-size: 0.72rem;
        color: var(--text-muted);
        font-weight: 600;
      }

      .biomarker-input {
        background: rgba(5, 12, 22, 0.85);
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius-sm);
        color: var(--text-primary);
        padding: 6px 10px;
        font-size: 0.82rem;
        font-family: inherit;
        outline: none;
        transition: border-color 0.15s ease;
      }
      .biomarker-input:focus {
        border-color: var(--border-focus);
      }

      .action-btn-row {
        display: flex;
        gap: 8px;
        margin-top: 16px;
      }

      .btn-secondary {
        flex: 1;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid var(--border-subtle);
        color: var(--text-secondary);
        font-size: 0.8rem;
        font-weight: 700;
        padding: 8px 12px;
        border-radius: var(--radius-sm);
        cursor: pointer;
        transition: all 0.2s ease;
        text-align: center;
      }
      .btn-secondary:hover {
        background: rgba(255, 255, 255, 0.1);
        color: var(--text-primary);
        border-color: var(--border);
      }

      /* ==========================================================================
         RIGHT PANEL: TABS & VISUALIZERS
         ========================================================================== */
      .tabs-nav {
        display: flex;
        align-items: center;
        gap: 8px;
        border-bottom: 1px solid var(--border-subtle);
        padding-bottom: 12px;
        margin-bottom: 18px;
      }

      .tab-btn {
        background: none;
        border: 1px solid transparent;
        padding: 8px 14px;
        border-radius: var(--radius-sm);
        font-size: 0.86rem;
        font-weight: 700;
        color: var(--text-secondary);
        cursor: pointer;
        transition: all 0.2s ease;
        display: inline-flex;
        align-items: center;
        gap: 6px;
      }
      .tab-btn:hover {
        color: var(--text-primary);
        background: rgba(255, 255, 255, 0.04);
      }
      .tab-btn.active {
        color: var(--accent-cyan);
        background: rgba(0, 242, 254, 0.12);
        border-color: rgba(0, 242, 254, 0.35);
        box-shadow: 0 0 12px rgba(0, 242, 254, 0.15);
      }

      .tab-badge {
        font-size: 0.68rem;
        font-weight: 800;
        padding: 1px 6px;
        border-radius: 9999px;
        background: rgba(0, 0, 0, 0.4);
      }

      .tab-btn-link {
        margin-left: auto;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        background: linear-gradient(135deg, rgba(0, 242, 254, 0.15), rgba(59, 130, 246, 0.15));
        border: 1px solid rgba(0, 242, 254, 0.35);
        padding: 7px 12px;
        border-radius: var(--radius-sm);
        font-size: 0.8rem;
        font-weight: 700;
        color: var(--accent-cyan);
        transition: all 0.2s ease;
      }
      .tab-btn-link:hover {
        background: linear-gradient(135deg, rgba(0, 242, 254, 0.25), rgba(59, 130, 246, 0.25));
        box-shadow: 0 0 14px rgba(0, 242, 254, 0.3);
        transform: translateY(-1px);
      }

      /* MATRIX LEGEND */
      .matrix-legend-row {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 12px;
        margin-bottom: 12px;
        padding: 8px 12px;
        background: rgba(0, 0, 0, 0.25);
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius-sm);
        font-size: 0.72rem;
        color: var(--text-secondary);
      }

      .legend-item {
        display: flex;
        align-items: center;
        gap: 6px;
        font-weight: 600;
      }

      .legend-dot {
        width: 10px;
        height: 10px;
        border-radius: 3px;
      }

      /* COLLISION MATRIX TABLE */
      .matrix-scroll-wrap {
        overflow-x: auto;
        max-width: 100%;
        width: 100%;
        padding-bottom: 14px;
        scrollbar-width: thin;
        scrollbar-color: rgba(0, 242, 254, 0.3) rgba(11, 22, 33, 0.5);
      }

      .matrix-scroll-wrap::-webkit-scrollbar {
        height: 6px;
      }
      .matrix-scroll-wrap::-webkit-scrollbar-track {
        background: rgba(11, 22, 33, 0.5);
        border-radius: 4px;
      }
      .matrix-scroll-wrap::-webkit-scrollbar-thumb {
        background: rgba(0, 242, 254, 0.3);
        border-radius: 4px;
      }

      .matrix-table {
        width: 100%;
        border-collapse: separate;
        border-spacing: 6px;
      }

      .matrix-table th {
        font-size: 0.76rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--text-secondary);
        padding: 8px 10px;
        text-align: center;
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      .matrix-cell {
        min-width: 105px;
        height: 70px;
        border-radius: var(--radius-md);
        padding: 6px 8px;
        cursor: pointer;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 3px;
        transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
        position: relative;
        text-align: center;
      }

      .matrix-cell:hover {
        transform: translateY(-2px) scale(1.02);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
        z-index: 10;
      }

      .matrix-cell.cell-synergy {
        background: var(--severity-synergy-bg);
        border: 1px solid var(--severity-synergy-border);
        color: var(--severity-synergy);
      }

      .matrix-cell.cell-neutral {
        background: var(--severity-neutral-bg);
        border: 1px solid var(--severity-neutral-border);
        color: var(--text-secondary);
      }

      .matrix-cell.cell-moderate {
        background: var(--severity-moderate-bg);
        border: 1px solid var(--severity-moderate-border);
        color: var(--severity-moderate);
      }

      .matrix-cell.cell-high {
        background: var(--severity-high-bg);
        border: 1px solid var(--severity-high-border);
        color: var(--severity-high);
      }

      .matrix-cell.cell-self {
        background: var(--severity-self-bg);
        border: 1px solid var(--severity-self-border);
        color: #93c5fd;
      }

      .matrix-cell.cell-mitigated {
        background: linear-gradient(135deg, rgba(16, 185, 129, 0.22), rgba(6, 182, 212, 0.18));
        border: 1px solid rgba(16, 185, 129, 0.6);
        color: #34d399;
        box-shadow: 0 0 12px rgba(16, 185, 129, 0.2);
      }

      /* FULL STACK EQUILIBRIUM */
      .balance-dashboard-container {
        display: flex;
        flex-direction: column;
        gap: 20px;
      }

      .balance-hero-banner {
        background: linear-gradient(135deg, rgba(14, 32, 52, 0.9), rgba(10, 24, 40, 0.95));
        border: 1px solid var(--border);
        border-radius: var(--radius-lg);
        padding: 20px 24px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 20px;
        backdrop-filter: blur(12px);
      }

      .balance-hero-left {
        display: flex;
        flex-direction: column;
        gap: 6px;
      }

      .balance-hero-title {
        font-size: 1.15rem;
        font-weight: 800;
        color: var(--text-primary);
        display: flex;
        align-items: center;
        gap: 10px;
      }

      .balance-hero-desc {
        font-size: 0.88rem;
        color: var(--text-secondary);
        max-width: 620px;
        line-height: 1.45;
      }

      .balance-hero-badge-wrap {
        display: flex;
        align-items: center;
        gap: 12px;
      }

      .balance-index-gauge {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 12px 18px;
        border-radius: var(--radius-md);
        background: rgba(0, 0, 0, 0.35);
        border: 1px solid var(--border-subtle);
      }

      .balance-index-num {
        font-size: 1.6rem;
        font-weight: 900;
        font-family: 'JetBrains Mono', monospace;
      }

      .balance-index-label {
        font-size: 0.7rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: var(--text-muted);
        font-weight: 700;
      }

      .axes-toolbar-row {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin-bottom: 14px;
        padding-bottom: 10px;
        border-bottom: 1px solid var(--border-subtle);
      }

      .axes-filter-chips {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        align-items: center;
      }

      .axis-filter-btn {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid var(--border);
        border-radius: 9999px;
        padding: 5px 12px;
        font-size: 0.76rem;
        font-weight: 700;
        color: var(--text-secondary);
        cursor: pointer;
        transition: all 0.2s ease;
      }

      .axis-filter-btn:hover {
        background: rgba(255, 255, 255, 0.08);
        color: var(--text-primary);
        border-color: rgba(0, 242, 254, 0.4);
      }

      .axis-filter-btn.active {
        background: rgba(0, 242, 254, 0.15);
        color: #00f2fe;
        border-color: rgba(0, 242, 254, 0.6);
        box-shadow: 0 0 10px rgba(0, 242, 254, 0.2);
      }

      .axis-filter-btn.filter-critical.active {
        background: rgba(239, 68, 68, 0.2);
        color: #f87171;
        border-color: rgba(239, 68, 68, 0.6);
      }

      .axis-filter-btn.filter-mitigated.active {
        background: rgba(16, 185, 129, 0.2);
        color: #34d399;
        border-color: rgba(16, 185, 129, 0.6);
      }

      .axis-sort-wrap {
        display: flex;
        align-items: center;
        gap: 8px;
      }

      .axis-sort-label {
        font-size: 0.74rem;
        font-weight: 700;
        text-transform: uppercase;
        color: var(--text-muted);
        letter-spacing: 0.04em;
      }

      .axis-sort-select {
        background: rgba(0, 0, 0, 0.4);
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        padding: 5px 10px;
        font-size: 0.78rem;
        font-weight: 600;
        color: var(--text-primary);
        outline: none;
        cursor: pointer;
        font-family: inherit;
      }

      .axes-cards-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
        gap: 16px;
      }

      .axis-card {
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
        padding: 18px;
        display: flex;
        flex-direction: column;
        gap: 12px;
        transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
        position: relative;
        overflow: hidden;
      }
      .axis-card:hover {
        transform: translateY(-2px);
        border-color: rgba(0, 242, 254, 0.4);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
      }

      .axis-card.card-tier-critical {
        border-left: 4px solid #ef4444;
        background: linear-gradient(135deg, rgba(239, 68, 68, 0.07), rgba(20, 24, 33, 0.95));
      }
      .axis-card.card-tier-warning {
        border-left: 4px solid #f59e0b;
        background: linear-gradient(135deg, rgba(245, 158, 11, 0.07), rgba(20, 24, 33, 0.95));
      }
      .axis-card.card-tier-mitigated {
        border-left: 4px solid #10b981;
        background: linear-gradient(135deg, rgba(16, 185, 129, 0.07), rgba(20, 24, 33, 0.95));
      }
      .axis-card.card-tier-active {
        border-left: 4px solid #00f2fe;
      }
      .axis-card.card-tier-baseline {
        border-left: 4px solid #64748b;
      }

      .axis-card-top {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 8px;
      }

      .axis-name {
        font-size: 0.96rem;
        font-weight: 800;
        color: var(--text-primary);
      }

      .axis-safe-range {
        font-size: 0.74rem;
        color: var(--text-muted);
        font-weight: 600;
      }

      .axis-values-row {
        display: flex;
        justify-content: space-between;
        align-items: flex-end;
        background: rgba(0, 0, 0, 0.3);
        padding: 10px 12px;
        border-radius: var(--radius-sm);
        border: 1px solid var(--border-subtle);
      }

      .axis-val-primary {
        font-size: 1.25rem;
        font-weight: 900;
        font-family: 'JetBrains Mono', monospace;
      }

      .axis-val-delta {
        font-size: 0.8rem;
        font-weight: 700;
        font-family: 'JetBrains Mono', monospace;
      }

      .axis-tier-tag {
        font-size: 0.7rem;
        font-weight: 800;
        padding: 2px 6px;
        border-radius: 4px;
        text-transform: uppercase;
        letter-spacing: 0.04em;
      }
      .tier-critical { background: rgba(239, 68, 68, 0.2); color: #f87171; }
      .tier-warning { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
      .tier-mitigated { background: rgba(16, 185, 129, 0.2); color: #34d399; }
      .tier-active { background: rgba(0, 242, 254, 0.2); color: #00f2fe; }
      .tier-baseline { background: rgba(100, 116, 139, 0.2); color: #94a3b8; }

      .axis-contrib-list {
        display: flex;
        flex-direction: column;
        gap: 4px;
      }

      .axis-contrib-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 4px 8px;
        background: rgba(255, 255, 255, 0.03);
        border-radius: 4px;
        font-size: 0.76rem;
      }

      .contrib-name {
        color: var(--text-secondary);
        font-weight: 600;
      }

      .contrib-delta {
        font-weight: 700;
        font-family: 'JetBrains Mono', monospace;
      }
      .contrib-delta.up { color: #f87171; }
      .contrib-delta.down { color: #34d399; }

      .mitigations-section, .uncompensated-section {
        display: flex;
        flex-direction: column;
        gap: 10px;
        margin-bottom: 16px;
      }

      .section-heading-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
      }

      .section-heading-title {
        font-size: 0.96rem;
        font-weight: 800;
        color: var(--text-primary);
        display: flex;
        align-items: center;
        gap: 8px;
      }

      .mitigation-card {
        background: rgba(16, 185, 129, 0.08);
        border: 1px solid rgba(16, 185, 129, 0.3);
        border-radius: var(--radius-md);
        padding: 12px 14px;
        display: flex;
        flex-direction: column;
        gap: 6px;
      }

      .mitigation-card-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
      }

      .mitigation-title {
        font-weight: 800;
        font-size: 0.92rem;
        color: #34d399;
      }

      .uncompensated-card {
        background: rgba(239, 68, 68, 0.08);
        border: 1px solid rgba(239, 68, 68, 0.3);
        border-radius: var(--radius-md);
        padding: 12px 14px;
        display: flex;
        flex-direction: column;
        gap: 6px;
      }

      /* BREAKDOWNS TAB */
      .breakdown-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 14px;
      }

      .conflict-card {
        background: var(--bg-card);
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius-md);
        padding: 14px 16px;
        display: flex;
        flex-direction: column;
        gap: 8px;
      }

      .conflict-card.card-high {
        border-left: 4px solid var(--severity-high);
      }
      .conflict-card.card-moderate {
        border-left: 4px solid var(--severity-moderate);
      }
      .conflict-card.card-synergy {
        border-left: 4px solid var(--severity-synergy);
      }

      .conflict-card-top {
        display: flex;
        justify-content: space-between;
        align-items: center;
      }

      .conflict-card-title {
        font-weight: 800;
        font-size: 0.94rem;
        color: var(--text-primary);
      }

      .conflict-card-desc {
        font-size: 0.86rem;
        color: var(--text-secondary);
        line-height: 1.45;
      }

      .conflict-card-rec {
        font-size: 0.8rem;
        padding: 8px 10px;
        border-radius: var(--radius-sm);
        background: rgba(0, 0, 0, 0.3);
        border: 1px solid var(--border-subtle);
        color: var(--accent-cyan);
      }

      /* ==========================================================================
         MODALS & INSPECTOR
         ========================================================================== */
      .modal-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(2, 6, 16, 0.78);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        z-index: 200;
        justify-content: center;
        align-items: center;
      }
      .modal-backdrop.open {
        display: flex;
        animation: fadeIn 0.2s ease forwards;
      }

      .modal-dialog {
        background: var(--bg-surface);
        border: 1px solid var(--border-mid);
        border-radius: var(--radius-xl);
        width: min(580px, calc(100vw - 32px));
        max-height: 85vh;
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
        display: flex;
        flex-direction: column;
        overflow: hidden;
      }

      .modal-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 16px 20px;
        border-bottom: 1px solid var(--border-subtle);
        background: rgba(14, 28, 48, 0.5);
      }

      .modal-title {
        font-size: 1.05rem;
        font-weight: 800;
        color: var(--text-primary);
      }
      .modal-subtitle {
        font-size: 0.76rem;
        color: var(--accent-cyan);
        font-weight: 600;
      }

      .modal-close-btn {
        background: none;
        border: none;
        color: var(--text-muted);
        font-size: 1.4rem;
        cursor: pointer;
        padding: 2px 8px;
        border-radius: 4px;
        transition: color 0.15s ease;
      }
      .modal-close-btn:hover {
        color: var(--text-primary);
      }

      .modal-body {
        padding: 20px;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
        gap: 16px;
      }

      .modal-section-title {
        font-size: 0.75rem;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: var(--text-muted);
        margin-bottom: 6px;
        display: block;
      }

      .modal-chip-wrap {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
      }

      .modal-chip {
        padding: 4px 10px;
        border-radius: var(--radius-sm);
        background: var(--bg-card);
        border: 1px solid var(--border-subtle);
        font-size: 0.78rem;
        font-weight: 600;
        color: var(--text-primary);
      }

      /* TOAST NOTIFICATION */
      .toast-container {
        position: fixed;
        bottom: 24px;
        right: 24px;
        z-index: 300;
        display: flex;
        flex-direction: column;
        gap: 8px;
        pointer-events: none;
      }

      .toast-message {
        background: rgba(10, 24, 42, 0.95);
        border: 1px solid var(--accent-cyan);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 16px rgba(0, 242, 254, 0.25);
        color: var(--text-primary);
        padding: 10px 16px;
        border-radius: var(--radius-md);
        font-size: 0.82rem;
        font-weight: 700;
        display: flex;
        align-items: center;
        gap: 8px;
        animation: toastSlide 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
      }

      @keyframes toastSlide {
        from { opacity: 0; transform: translateY(12px); }
        to { opacity: 1; transform: translateY(0); }
      }

      @keyframes fadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
      }

      /* ==========================================================================
         FLAGSHIP AI COPILOT DRAWER & CHAT UI
         ========================================================================== */
      .floating-copilot-pill {
        position: fixed;
        bottom: 24px;
        right: 24px;
        z-index: 220;
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 18px;
        background: linear-gradient(135deg, rgba(8, 20, 36, 0.92), rgba(13, 30, 54, 0.95));
        border: 1px solid rgba(0, 242, 254, 0.4);
        border-radius: 9999px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 242, 254, 0.3);
        cursor: pointer;
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
      }
      .floating-copilot-pill:hover {
        transform: translateY(-2px) scale(1.03);
        border-color: var(--accent-cyan);
        box-shadow: 0 14px 36px rgba(0, 0, 0, 0.7), 0 0 28px rgba(0, 242, 254, 0.45);
      }
      .copilot-pulse-dot {
        width: 10px;
        height: 10px;
        border-radius: 50%;
        background: var(--accent-teal);
        box-shadow: 0 0 10px var(--accent-teal);
        animation: pulseGlow 2s infinite;
      }
      @keyframes pulseGlow {
        0%, 100% { transform: scale(1); opacity: 1; }
        50% { transform: scale(1.3); opacity: 0.65; }
      }

      .copilot-drawer-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(3, 7, 18, 0.6);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        z-index: 240;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
      }
      .copilot-drawer-backdrop.open {
        opacity: 1;
        visibility: visible;
      }

      .copilot-resize-handle {
        position: absolute;
        top: 0;
        left: 0;
        width: 6px;
        height: 100%;
        cursor: ew-resize;
        background: transparent;
        z-index: 260;
        transition: background 0.15s ease;
      }
      .copilot-resize-handle:hover,
      .copilot-resize-handle.active {
        background: var(--accent-cyan);
        box-shadow: 0 0 10px var(--accent-cyan);
      }

      .copilot-drawer {
        position: fixed;
        top: 0;
        right: -100vw;
        width: var(--copilot-width, 620px);
        max-width: 96vw;
        min-width: 380px;
        height: 100vh;
        background: linear-gradient(180deg, #070f1e 0%, #050a14 100%);
        border-left: 1px solid var(--border);
        box-shadow: -16px 0 50px rgba(0, 0, 0, 0.85);
        z-index: 250;
        display: flex;
        flex-direction: column;
        transition: right 0.35s cubic-bezier(0.16, 1, 0.3, 1), width 0.22s ease;
        overflow: hidden;
      }
      .copilot-drawer.open {
        right: 0;
      }
      .copilot-drawer.resizing {
        transition: none !important;
        user-select: none;
      }
      .copilot-drawer.expanded {
        width: min(940px, 95vw) !important;
      }
      @media (max-width: 768px) {
        .copilot-drawer {
          width: 100vw !important;
          max-width: 100vw !important;
          min-width: 100vw !important;
          border-left: none;
        }
        .copilot-resize-handle {
          display: none;
        }
      }

      .copilot-header {
        padding: 14px 18px;
        background: rgba(10, 22, 38, 0.95);
        border-bottom: 1px solid var(--border-subtle);
        display: flex;
        flex-direction: column;
        gap: 10px;
        flex-shrink: 0;
      }

      .copilot-header-top {
        display: flex;
        justify-content: space-between;
        align-items: center;
      }

      .copilot-title-wrap {
        display: flex;
        align-items: center;
        gap: 10px;
      }

      .copilot-title-icon {
        width: 30px;
        height: 30px;
        border-radius: var(--radius-sm);
        background: linear-gradient(135deg, var(--accent-teal), var(--accent-cyan));
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.05rem;
        box-shadow: 0 0 14px rgba(0, 242, 254, 0.35);
      }

      .copilot-mode-bar {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
        background: rgba(0, 0, 0, 0.35);
        padding: 4px;
        border-radius: var(--radius-md);
        border: 1px solid var(--border-subtle);
      }

      .copilot-mode-btn {
        background: transparent;
        border: 1px solid transparent;
        border-radius: var(--radius-sm);
        padding: 6px 4px;
        color: var(--text-muted);
        font-size: 0.74rem;
        font-weight: 700;
        cursor: pointer;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        transition: all 0.15s ease;
      }
      .copilot-mode-btn:hover {
        color: var(--text-primary);
        background: rgba(255, 255, 255, 0.04);
      }
      .copilot-mode-btn.active {
        background: rgba(0, 242, 254, 0.12);
        border-color: rgba(0, 242, 254, 0.35);
        color: var(--accent-cyan);
        box-shadow: 0 0 10px rgba(0, 242, 254, 0.2);
      }

      .copilot-context-bar {
        padding: 6px 16px;
        background: rgba(0, 0, 0, 0.25);
        border-bottom: 1px solid var(--border-subtle);
        display: flex;
        align-items: center;
        justify-content: space-between;
        font-size: 0.76rem;
        flex-shrink: 0;
      }

      .copilot-stack-tags {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
        max-height: 48px;
        overflow-y: auto;
      }

      .copilot-quick-prompts {
        padding: 8px 16px;
        display: flex;
        gap: 6px;
        overflow-x: auto;
        border-bottom: 1px solid var(--border-subtle);
        background: rgba(255, 255, 255, 0.01);
        flex-shrink: 0;
        scrollbar-width: thin;
      }

      .quick-prompt-chip {
        white-space: nowrap;
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid var(--border-subtle);
        border-radius: 9999px;
        padding: 4px 12px;
        font-size: 0.74rem;
        color: var(--text-secondary);
        cursor: pointer;
        transition: all 0.15s ease;
      }
      .quick-prompt-chip:hover {
        background: rgba(0, 242, 254, 0.1);
        border-color: var(--accent-cyan);
        color: var(--accent-cyan);
      }

      .copilot-chat-container {
        flex: 1;
        overflow-y: auto;
        padding: 16px 18px;
        display: flex;
        flex-direction: column;
        gap: 14px;
        scroll-behavior: smooth;
      }

      .chat-msg {
        display: flex;
        flex-direction: column;
        gap: 5px;
        max-width: 92%;
        animation: fadeIn 0.25s ease forwards;
      }
      .chat-msg.user {
        align-self: flex-end;
      }
      .chat-msg.assistant {
        align-self: flex-start;
        max-width: 98%;
      }

      .chat-msg-header {
        display: flex;
        align-items: center;
        gap: 6px;
        font-size: 0.72rem;
        color: var(--text-muted);
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.04em;
      }

      .chat-msg-bubble {
        padding: 12px 16px;
        border-radius: var(--radius-md);
        font-size: 0.88rem;
        line-height: 1.6;
        word-break: break-word;
      }
      .chat-msg.user .chat-msg-bubble {
        background: linear-gradient(135deg, rgba(0, 242, 254, 0.18), rgba(59, 130, 246, 0.22));
        border: 1px solid rgba(0, 242, 254, 0.35);
        color: #f8fafc;
        border-bottom-right-radius: 2px;
      }
      .chat-msg.assistant .chat-msg-bubble {
        background: var(--bg-card);
        border: 1px solid var(--border-subtle);
        color: var(--text-primary);
        border-bottom-left-radius: 2px;
        box-shadow: 0 4px 20px rgba(0,0,0,0.25);
      }

      .chat-msg.assistant .chat-msg-bubble p {
        margin-bottom: 8px;
      }
      .chat-msg.assistant .chat-msg-bubble p:last-child {
        margin-bottom: 0;
      }
      
      /* ELEGANT TYPING INDICATOR */
      .typing-indicator-wrap {
        display: inline-flex;
        align-items: center;
        gap: 8px;
      }
      .typing-indicator {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        padding: 5px 8px;
        background: rgba(0, 242, 254, 0.08);
        border-radius: 12px;
        border: 1px solid rgba(0, 242, 254, 0.15);
      }
      .typing-dot {
        width: 5px;
        height: 5px;
        background-color: var(--accent-cyan);
        border-radius: 50%;
        animation: typingBounce 1.4s infinite ease-in-out both;
      }
      .typing-dot:nth-child(1) { animation-delay: -0.32s; }
      .typing-dot:nth-child(2) { animation-delay: -0.16s; }
      .typing-dot:nth-child(3) { animation-delay: 0s; }
      @keyframes typingBounce {
        0%, 80%, 100% { transform: scale(0); opacity: 0.5; }
        40% { transform: scale(1); opacity: 1; }
      }

      .chat-msg.assistant .chat-msg-bubble strong {
        color: var(--accent-cyan);
      }
      .chat-msg.assistant .chat-msg-bubble h2,
      .chat-msg.assistant .chat-msg-bubble h3,
      .chat-msg.assistant .chat-msg-bubble h4 {
        line-height: 1.3;
        margin-top: 14px;
        margin-bottom: 6px;
      }
      .chat-msg.assistant .chat-msg-bubble h2:first-child,
      .chat-msg.assistant .chat-msg-bubble h3:first-child,
      .chat-msg.assistant .chat-msg-bubble h4:first-child {
        margin-top: 0;
      }
      .chat-msg.assistant .chat-msg-bubble table {
        width: 100%;
        border-collapse: collapse;
        font-size: 0.78rem;
        margin: 10px 0;
        background: rgba(0, 0, 0, 0.25);
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius-sm);
        overflow: hidden;
      }
      .chat-msg.assistant .chat-msg-bubble th {
        background: rgba(0, 242, 254, 0.08);
        padding: 6px 10px;
        font-weight: 700;
        color: var(--text-primary);
        border-bottom: 1px solid var(--border-subtle);
        border-right: 1px solid rgba(255, 255, 255, 0.05);
        text-align: left;
      }
      .chat-msg.assistant .chat-msg-bubble td {
        padding: 6px 10px;
        color: var(--text-secondary);
        border-bottom: 1px solid rgba(255, 255, 255, 0.04);
        border-right: 1px solid rgba(255, 255, 255, 0.04);
      }
      .chat-msg.assistant .chat-msg-bubble tr:last-child td {
        border-bottom: none;
      }
      .chat-msg.assistant .chat-msg-bubble blockquote {
        margin: 8px 0;
        padding: 6px 12px;
        background: rgba(0, 242, 254, 0.05);
        border-left: 3px solid var(--accent-cyan);
        border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
        font-size: 0.82rem;
        color: var(--text-secondary);
      }
      .chat-msg.assistant .chat-msg-bubble hr {
        border: none;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        margin: 12px 0;
      }
      .chat-msg.assistant .chat-msg-bubble ul, .chat-msg.assistant .chat-msg-bubble ol {
        margin-left: 18px;
        margin-bottom: 8px;
      }
      .chat-msg.assistant .chat-msg-bubble li {
        margin-bottom: 4px;
      }

      /* REASONING & THOUGHT STREAM IN COPILOT */
      .copilot-thought-box {
        background: rgba(6, 15, 28, 0.85);
        border: 1px solid rgba(0, 242, 254, 0.22);
        border-radius: var(--radius-sm);
        margin-bottom: 10px;
        overflow: hidden;
        transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
      }
      .copilot-thought-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 7px 12px;
        cursor: default;
        user-select: none;
        background: rgba(0, 242, 254, 0.06);
        border-bottom: 1px solid rgba(0, 242, 254, 0.1);
        transition: border-color 0.2s ease;
      }
      .copilot-thought-box.reasoning-done .copilot-thought-header {
        border-bottom: none;
      }
      .copilot-thought-header-left {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 0.78rem;
        font-weight: 700;
        color: var(--accent-cyan);
      }
      .copilot-thought-badge {
        font-size: 0.68rem;
        padding: 2px 7px;
        border-radius: 9999px;
        background: rgba(0, 242, 254, 0.12);
        border: 1px solid rgba(0, 242, 254, 0.25);
        color: var(--text-secondary);
        display: inline-flex;
        align-items: center;
        gap: 4px;
        font-weight: 600;
        transition: all 0.25s ease;
      }
      .copilot-thought-badge.live {
        background: rgba(0, 242, 254, 0.18);
        color: var(--accent-cyan);
        box-shadow: 0 0 10px rgba(0, 242, 254, 0.25);
      }
      .copilot-thought-header-right {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 0.74rem;
        color: var(--text-muted);
      }

      /* Tool & Action Indicators in Thought Box */
      .copilot-thought-activity-bar {
        padding: 6px 12px;
        background: rgba(4, 14, 28, 0.92);
        border-bottom: 1px solid rgba(0, 242, 254, 0.1);
        display: flex;
        flex-direction: column;
        gap: 6px;
        transition: all 0.25s ease;
      }
      .copilot-thought-activity-step {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        font-size: 0.74rem;
        color: #38bdf8;
        font-weight: 600;
        font-family: 'JetBrains Mono', 'Fira Code', monospace;
      }
      .copilot-activity-spinner {
        width: 12px;
        height: 12px;
        border: 2px solid rgba(0, 242, 254, 0.25);
        border-top-color: var(--accent-cyan);
        border-radius: 50%;
        animation: spinActivity 0.75s linear infinite;
        display: inline-block;
        flex-shrink: 0;
      }
      @keyframes spinActivity {
        to { transform: rotate(360deg); }
      }
      .copilot-completed-tools-list {
        display: flex;
        flex-wrap: wrap;
        gap: 5px;
      }
      .copilot-tool-chip {
        padding: 2px 7px;
        border-radius: 4px;
        font-size: 0.68rem;
        background: rgba(0, 242, 254, 0.08);
        border: 1px solid rgba(0, 242, 254, 0.2);
        color: #bae6fd;
        display: inline-flex;
        align-items: center;
        gap: 4px;
        font-family: 'JetBrains Mono', 'Fira Code', monospace;
        animation: toolChipPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
      }
      .copilot-tool-chip.success {
        border-color: rgba(16, 185, 129, 0.35);
        background: rgba(16, 185, 129, 0.09);
        color: #6ee7b7;
      }
      @keyframes toolChipPop {
        from { opacity: 0; transform: scale(0.92); }
        to { opacity: 1; transform: scale(1); }
      }
      .copilot-thought-box.reasoning-done .copilot-thought-activity-step {
        display: none;
      }
      .copilot-thought-box.reasoning-done .copilot-thought-activity-bar:empty {
        display: none;
        padding: 0;
        border-bottom: none;
      }

      /* Dynamic Streaming Word Flow Ticker */
      .copilot-thought-flow-container {
        padding: 8px 12px;
        background: rgba(3, 10, 20, 0.8);
        border-bottom: 1px solid rgba(0, 242, 254, 0.08);
        transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
        overflow: hidden;
        max-height: 48px;
        opacity: 1;
      }
      .copilot-thought-box.reasoning-done .copilot-thought-flow-container {
        max-height: 0;
        opacity: 0;
        padding-top: 0;
        padding-bottom: 0;
        border-bottom: none;
      }
      .copilot-thought-flow-inner {
        display: flex;
        align-items: center;
        gap: 4px;
        font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
        font-size: 0.74rem;
        line-height: 1.4;
        color: #38bdf8;
        white-space: nowrap;
        overflow: hidden;
        mask-image: linear-gradient(to right, transparent 0%, black 10%, black 95%, transparent 100%);
        -webkit-mask-image: linear-gradient(to right, transparent 0%, black 10%, black 95%, transparent 100%);
      }
      .copilot-thought-flow-text {
        display: inline-block;
        animation: flowFadeIn 0.15s ease;
      }
      .copilot-thought-flow-cursor {
        display: inline-block;
        width: 6px;
        height: 12px;
        background: var(--accent-cyan);
        border-radius: 1px;
        margin-left: 2px;
        vertical-align: middle;
        animation: thoughtCursorBlink 0.8s infinite;
        box-shadow: 0 0 6px var(--accent-cyan);
      }
      @keyframes thoughtCursorBlink {
        0%, 100% { opacity: 1; transform: scaleY(1); }
        50% { opacity: 0.2; transform: scaleY(0.8); }
      }
      @keyframes flowFadeIn {
        from { opacity: 0.7; transform: translateX(2px); }
        to { opacity: 1; transform: translateX(0); }
      }

      /* ACTION CARDS IN CHAT */
      .action-card-diff {
        background: rgba(5, 15, 28, 0.9);
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
        padding: 12px 14px;
        margin-top: 10px;
        display: flex;
        flex-direction: column;
        gap: 10px;
      }
      .action-card-title {
        font-size: 0.78rem;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: var(--accent-cyan);
        display: flex;
        align-items: center;
        gap: 6px;
      }
      .diff-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 5px 8px;
        border-radius: 4px;
        font-size: 0.8rem;
      }
      .diff-row.add { background: rgba(16, 185, 129, 0.12); border-left: 3px solid var(--accent-teal); }
      .diff-row.modify { background: rgba(245, 158, 11, 0.12); border-left: 3px solid #fbbf24; }
      .diff-row.remove { background: rgba(239, 68, 68, 0.12); border-left: 3px solid #f87171; }

      .copilot-citation-badge {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        padding: 2px 8px;
        border-radius: 9999px;
        font-size: 0.72rem;
        font-weight: 700;
        text-decoration: none;
        margin: 0 3px;
        transition: all 0.15s ease;
        vertical-align: middle;
      }
      .copilot-citation-badge.pmid-badge {
        background: rgba(59, 130, 246, 0.15);
        border: 1px solid rgba(59, 130, 246, 0.4);
        color: #93c5fd;
      }
      .copilot-citation-badge.pmid-badge:hover {
        background: rgba(59, 130, 246, 0.3);
        color: #ffffff;
        transform: translateY(-1px);
      }
      .copilot-citation-badge.chembl-badge {
        background: rgba(168, 85, 247, 0.15);
        border: 1px solid rgba(168, 85, 247, 0.4);
        color: #d8b4fe;
      }
      .copilot-citation-badge.chembl-badge:hover {
        background: rgba(168, 85, 247, 0.3);
        color: #ffffff;
        transform: translateY(-1px);
      }
      .copilot-citation-badge.fda-badge {
        background: rgba(16, 185, 129, 0.15);
        border: 1px solid rgba(16, 185, 129, 0.4);
        color: #6ee7b7;
      }
      .copilot-citation-badge.trial-badge {
        background: rgba(245, 158, 11, 0.15);
        border: 1px solid rgba(245, 158, 11, 0.4);
        color: #fcd34d;
      }
      .copilot-citation-badge.trial-badge:hover {
        background: rgba(245, 158, 11, 0.3);
        color: #ffffff;
        transform: translateY(-1px);
      }
      .copilot-citation-badge.doi-badge {
        background: rgba(14, 165, 233, 0.15);
        border: 1px solid rgba(14, 165, 233, 0.4);
        color: #7dd3fc;
      }
      .copilot-citation-badge.doi-badge:hover {
        background: rgba(14, 165, 233, 0.3);
        color: #ffffff;
        transform: translateY(-1px);
      }
      .copilot-citation-badge.cpic-badge {
        background: rgba(139, 92, 246, 0.15);
        border: 1px solid rgba(139, 92, 246, 0.4);
        color: #c4b5fd;
      }

      .btn-apply-diff {
        background: linear-gradient(135deg, var(--accent-teal), #059669);
        color: #04151b;
        border: 1px solid transparent;
        border-radius: var(--radius-sm);
        padding: 8px 14px;
        font-size: 0.8rem;
        font-weight: 800;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        transition: all 0.18s ease;
        box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
      }
      .btn-apply-diff:hover {
        transform: translateY(-1px);
        box-shadow: 0 6px 18px rgba(16, 185, 129, 0.4);
      }
      .btn-apply-diff.applied {
        background: rgba(16, 185, 129, 0.18) !important;
        border: 1px solid var(--accent-teal) !important;
        color: #34d399 !important;
        box-shadow: 0 0 16px rgba(16, 185, 129, 0.3) !important;
        cursor: default;
      }

      /* ==========================================================================
         INTERACTIVE COPILOT PROTOCOL CANVAS & COMPOUND INSPECTOR
         ========================================================================== */
      .copilot-protocol-loading {
        background: linear-gradient(145deg, rgba(8, 20, 36, 0.9), rgba(4, 12, 22, 0.95));
        border: 1px dashed rgba(0, 242, 254, 0.35);
        border-radius: var(--radius-md);
        padding: 16px 18px;
        display: flex;
        flex-direction: column;
        gap: 12px;
        position: relative;
        overflow: hidden;
        animation: protocolPulse 2s infinite ease-in-out;
      }
      @keyframes protocolPulse {
        0%, 100% { border-color: rgba(0, 242, 254, 0.25); box-shadow: 0 4px 16px rgba(0, 242, 254, 0.05); }
        50% { border-color: var(--accent-cyan); box-shadow: 0 4px 24px rgba(0, 242, 254, 0.2); }
      }
      .copilot-loading-header {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 0.88rem;
        font-weight: 800;
        color: #ffffff;
      }
      .copilot-loading-shimmer-bar {
        height: 3px;
        width: 100%;
        background: linear-gradient(90deg, transparent, var(--accent-cyan), var(--accent-teal), transparent);
        background-size: 200% 100%;
        animation: loadingShimmer 1.4s infinite linear;
        border-radius: 2px;
      }
      @keyframes loadingShimmer {
        0% { background-position: -200% 0; }
        100% { background-position: 200% 0; }
      }
      .copilot-loading-steps {
        display: flex;
        flex-direction: column;
        gap: 7px;
        font-size: 0.78rem;
        color: var(--text-muted);
      }
      .copilot-loading-step {
        display: flex;
        align-items: center;
        gap: 8px;
        transition: all 0.25s ease-in-out;
        opacity: 0.55;
      }
      .copilot-loading-step.active {
        color: var(--accent-cyan);
        font-weight: 700;
        opacity: 1;
        transform: translateX(2px);
      }
      .copilot-loading-step.completed {
        color: var(--accent-teal);
        font-weight: 600;
        opacity: 0.9;
      }
      .copilot-step-badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin-left: auto;
        font-size: 0.74rem;
      }
      .copilot-step-check {
        color: var(--accent-teal);
        font-weight: 800;
        font-size: 0.8rem;
      }
      .copilot-loading-substatus {
        font-size: 0.76rem;
        color: var(--text-muted);
        display: flex;
        align-items: center;
        gap: 7px;
        padding-top: 8px;
        border-top: 1px solid rgba(255, 255, 255, 0.07);
        transition: all 0.2s ease-in-out;
      }
      .copilot-loading-substatus-text {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }
      .copilot-loading-spinner {
        display: inline-block;
        width: 14px;
        height: 14px;
        border: 2px solid rgba(0, 242, 254, 0.2);
        border-top-color: var(--accent-cyan);
        border-radius: 50%;
        animation: spinAnim 0.7s infinite linear;
      }
      @keyframes spinAnim {
        to { transform: rotate(360deg); }
      }

      .copilot-protocol-card {
        background: linear-gradient(145deg, rgba(8, 20, 36, 0.95), rgba(4, 12, 22, 0.98));
        border: 1px solid rgba(0, 242, 254, 0.25);
        border-radius: var(--radius-md);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
        padding: 14px 16px;
        margin: 10px 0;
        display: flex;
        flex-direction: column;
        gap: 12px;
        position: relative;
        overflow: hidden;
        animation: protocolCardFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
      }
      @keyframes protocolCardFadeIn {
        from { opacity: 0; transform: translateY(6px); }
        to { opacity: 1; transform: translateY(0); }
      }
      .copilot-protocol-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 2px;
        background: linear-gradient(90deg, var(--accent-cyan), var(--accent-teal), #8b5cf6);
      }

      /* Hero Header */
      .copilot-protocol-hero {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 10px;
        border-bottom: 1px solid rgba(0, 242, 254, 0.1);
        padding-bottom: 10px;
      }
      .copilot-protocol-hero-left {
        display: flex;
        flex-direction: column;
        gap: 4px;
      }
      .copilot-protocol-title-row {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
      }
      .copilot-protocol-title {
        font-size: 0.96rem;
        font-weight: 800;
        color: #ffffff;
        letter-spacing: -0.01em;
      }
      .copilot-persona-pill {
        font-size: 0.68rem;
        font-weight: 800;
        text-transform: uppercase;
        padding: 2px 6px;
        border-radius: 4px;
        background: rgba(0, 242, 254, 0.15);
        color: var(--accent-cyan);
        border: 1px solid rgba(0, 242, 254, 0.3);
      }
      .copilot-protocol-meta-row {
        display: flex;
        align-items: center;
        gap: 6px;
        flex-wrap: wrap;
        font-size: 0.72rem;
        color: var(--text-muted);
      }
      .copilot-meta-chip {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        background: rgba(255, 255, 255, 0.04);
        padding: 2px 6px;
        border-radius: 4px;
        border: 1px solid rgba(255, 255, 255, 0.08);
      }
      .copilot-meta-chip.bio {
        color: var(--accent-teal);
        border-color: rgba(16, 185, 129, 0.25);
        background: rgba(16, 185, 129, 0.08);
      }
      .copilot-meta-chip.count {
        color: var(--accent-cyan);
        border-color: rgba(0, 242, 254, 0.25);
        background: rgba(0, 242, 254, 0.08);
      }

      /* Executive Summary Box */
      .copilot-protocol-exec-summary {
        background: rgba(0, 242, 254, 0.04);
        border-left: 3px solid var(--accent-cyan);
        border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
        padding: 8px 12px;
        font-size: 0.8rem;
        line-height: 1.45;
        color: var(--text-secondary);
      }

      /* Circadian Chronobiology Schedule Matrix */
      .copilot-chrono-matrix {
        display: flex;
        flex-direction: column;
        gap: 10px;
      }
      .copilot-chrono-matrix-title {
        font-size: 0.76rem;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: var(--accent-cyan);
        display: flex;
        align-items: center;
        justify-content: space-between;
      }
      .copilot-chrono-hint {
        font-size: 0.7rem;
        font-weight: 500;
        color: var(--text-muted);
        text-transform: none;
      }
      .copilot-chrono-group {
        background: rgba(3, 10, 20, 0.6);
        border: 1px solid rgba(255, 255, 255, 0.06);
        border-radius: var(--radius-sm);
        padding: 8px 10px;
        display: flex;
        flex-direction: column;
        gap: 6px;
      }
      .copilot-chrono-header {
        display: flex;
        align-items: center;
        gap: 6px;
        font-size: 0.74rem;
        font-weight: 700;
        color: var(--text-primary);
      }
      .copilot-chrono-slot-badge {
        font-size: 0.68rem;
        color: var(--text-muted);
        background: rgba(255, 255, 255, 0.04);
        padding: 1px 5px;
        border-radius: 4px;
      }
      .copilot-chrono-chips-wrap {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
        gap: 6px;
      }

      /* Interactive Compound Chip */
      .copilot-compound-chip {
        background: rgba(0, 242, 254, 0.04);
        border: 1px solid rgba(0, 242, 254, 0.16);
        border-radius: 6px;
        padding: 7px 10px;
        cursor: pointer;
        transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
        display: flex;
        flex-direction: column;
        gap: 3px;
        user-select: none;
        position: relative;
      }
      .copilot-compound-chip:hover {
        background: rgba(0, 242, 254, 0.12);
        border-color: var(--accent-cyan);
        transform: translateY(-1.5px);
        box-shadow: 0 4px 12px rgba(0, 242, 254, 0.2);
      }
      .copilot-compound-chip.selected {
        background: rgba(0, 242, 254, 0.18);
        border: 1px solid var(--accent-cyan);
        box-shadow: 0 0 14px rgba(0, 242, 254, 0.35);
      }
      .copilot-chip-top {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 6px;
      }
      .copilot-chip-name {
        font-size: 0.82rem;
        font-weight: 700;
        color: #ffffff;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }
      .copilot-chip-action,
      .copilot-chip-quick-add-btn {
        font-size: 0.64rem;
        font-weight: 800;
        padding: 2px 6px;
        border-radius: 4px;
        text-transform: uppercase;
        letter-spacing: 0.02em;
        flex-shrink: 0;
        border: none;
        cursor: pointer;
        transition: all 0.15s ease;
      }
      .copilot-chip-action.add,
      .copilot-chip-quick-add-btn.add {
        background: rgba(16, 185, 129, 0.2);
        color: var(--accent-teal);
        border: 1px solid rgba(16, 185, 129, 0.4);
      }
      .copilot-chip-quick-add-btn.add:hover {
        background: rgba(16, 185, 129, 0.35);
        border-color: var(--accent-teal);
        transform: scale(1.05);
      }
      .copilot-chip-action.modify,
      .copilot-chip-quick-add-btn.modify {
        background: rgba(245, 158, 11, 0.2);
        color: #fbbf24;
        border: 1px solid rgba(245, 158, 11, 0.4);
      }
      .copilot-chip-quick-add-btn.modify:hover {
        background: rgba(245, 158, 11, 0.35);
        border-color: #fbbf24;
        transform: scale(1.05);
      }
      .copilot-chip-action.retain,
      .copilot-chip-quick-add-btn.retain,
      .copilot-chip-quick-add-btn.in-stack {
        background: rgba(59, 130, 246, 0.15);
        color: #93c5fd;
        border: 1px solid rgba(59, 130, 246, 0.3);
      }
      .copilot-chip-quick-add-btn.in-stack {
        background: rgba(16, 185, 129, 0.15);
        color: #34d399;
        border: 1px solid rgba(16, 185, 129, 0.3);
      }
      .copilot-chip-bottom {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 6px;
        font-size: 0.72rem;
      }
      .copilot-chip-dose {
        color: var(--accent-cyan);
        font-weight: 600;
        font-family: 'JetBrains Mono', monospace;
      }
      .copilot-chip-target {
        color: var(--text-muted);
        font-size: 0.68rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 120px;
      }
      .copilot-chip-inspect-icon {
        font-size: 0.7rem;
        opacity: 0.6;
        transition: opacity 0.15s ease;
      }
      .copilot-compound-chip:hover .copilot-chip-inspect-icon {
        opacity: 1;
        color: var(--accent-cyan);
      }

      /* Overlay Compound Inspector Tile Panel */
      .copilot-compound-inspector {
        position: absolute;
        inset: 8px;
        z-index: 70;
        background: rgba(3, 10, 22, 0.96);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        border: 1px solid var(--accent-cyan);
        border-radius: var(--radius-md);
        padding: 16px 18px;
        display: flex;
        flex-direction: column;
        gap: 12px;
        box-shadow: 0 16px 48px rgba(0, 0, 0, 0.85), 0 0 24px rgba(0, 242, 254, 0.18);
        animation: inspectorOverlayIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
        overflow-y: auto;
      }
      @keyframes inspectorOverlayIn {
        from { opacity: 0; transform: scale(0.96) translateY(4px); }
        to { opacity: 1; transform: scale(1) translateY(0); }
      }
      .copilot-inspector-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid rgba(0, 242, 254, 0.15);
        padding-bottom: 6px;
      }
      .copilot-inspector-title {
        font-size: 0.88rem;
        font-weight: 800;
        color: #ffffff;
        display: flex;
        align-items: center;
        gap: 6px;
      }
      .copilot-inspector-close {
        background: rgba(255, 255, 255, 0.06);
        border: 1px solid rgba(255, 255, 255, 0.12);
        color: var(--text-secondary);
        font-size: 1.15rem;
        line-height: 1;
        cursor: pointer;
        width: 22px;
        height: 22px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 4px;
        transition: all 0.15s ease;
      }
      .copilot-inspector-close:hover {
        background: rgba(255, 255, 255, 0.18);
        color: #ffffff;
        border-color: rgba(255, 255, 255, 0.3);
      }
      .copilot-inspector-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 8px;
        font-size: 0.76rem;
      }
      .copilot-inspector-item {
        display: flex;
        flex-direction: column;
        gap: 2px;
      }
      .copilot-inspector-label {
        font-size: 0.66rem;
        font-weight: 700;
        text-transform: uppercase;
        color: var(--text-muted);
        letter-spacing: 0.04em;
      }
      .copilot-inspector-val {
        color: var(--text-primary);
        line-height: 1.35;
      }
      .copilot-inspector-val.highlight {
        color: var(--accent-cyan);
        font-weight: 600;
      }
      .copilot-inspector-rationale {
        background: rgba(0, 242, 254, 0.03);
        border: 1px solid rgba(0, 242, 254, 0.1);
        border-radius: 4px;
        padding: 6px 10px;
        font-size: 0.76rem;
        color: var(--text-secondary);
        line-height: 1.4;
      }
      .copilot-inspector-citations {
        display: flex;
        align-items: center;
        gap: 4px;
        flex-wrap: wrap;
        margin-top: 2px;
      }
      .copilot-inspector-actions {
        display: flex;
        justify-content: flex-end;
        align-items: center;
        gap: 8px;
        margin-top: 4px;
        padding-top: 8px;
        border-top: 1px solid rgba(0, 242, 254, 0.12);
      }
      .btn-inspector-add {
        background: linear-gradient(135deg, rgba(0, 242, 254, 0.2), rgba(79, 70, 229, 0.3));
        border: 1px solid var(--accent-cyan);
        color: #ffffff;
        font-size: 0.76rem;
        font-weight: 800;
        padding: 6px 14px;
        border-radius: var(--radius-sm);
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        transition: all 0.18s ease;
      }
      .btn-inspector-add:hover {
        background: linear-gradient(135deg, rgba(0, 242, 254, 0.35), rgba(79, 70, 229, 0.5));
        box-shadow: 0 4px 12px rgba(0, 242, 254, 0.3);
        transform: translateY(-1px);
      }
      .btn-inspector-add.in-stack {
        background: rgba(16, 185, 129, 0.2);
        border: 1px solid var(--accent-teal);
        color: #34d399;
      }

      /* Collapsible Accordions (Titration Notes & Scientific Sources) */
      .copilot-accordion {
        background: rgba(3, 10, 20, 0.5);
        border: 1px solid rgba(255, 255, 255, 0.07);
        border-radius: var(--radius-sm);
        overflow: hidden;
        transition: border-color 0.15s ease;
      }
      .copilot-accordion:hover {
        border-color: rgba(0, 242, 254, 0.2);
      }
      .copilot-accordion-toggle {
        width: 100%;
        background: transparent;
        border: none;
        padding: 8px 12px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        cursor: pointer;
        color: var(--text-primary);
        font-size: 0.78rem;
        font-weight: 700;
        text-align: left;
        transition: background 0.15s ease;
      }
      .copilot-accordion-toggle:hover {
        background: rgba(255, 255, 255, 0.02);
      }
      .copilot-accordion-title-wrap {
        display: flex;
        align-items: center;
        gap: 6px;
      }
      .copilot-accordion-badge {
        font-size: 0.66rem;
        color: var(--text-muted);
        background: rgba(255, 255, 255, 0.05);
        padding: 1px 5px;
        border-radius: 4px;
      }
      .copilot-accordion-icon {
        font-size: 0.7rem;
        color: var(--text-muted);
        transition: transform 0.2s ease;
      }
      .copilot-accordion.open .copilot-accordion-icon {
        transform: rotate(90deg);
        color: var(--accent-cyan);
      }
      .copilot-accordion-content {
        display: none;
        padding: 10px 14px;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
        font-size: 0.76rem;
        line-height: 1.5;
        color: var(--text-secondary);
        background: rgba(0, 0, 0, 0.25);
      }
      .copilot-accordion.open .copilot-accordion-content {
        display: block;
        animation: accordionSlide 0.2s ease;
      }
      @keyframes accordionSlide {
        from { opacity: 0; transform: translateY(-3px); }
        to { opacity: 1; transform: translateY(0); }
      }

      /* Sticky Protocol Actions Bar */
      .copilot-protocol-actions {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
        border-top: 1px solid rgba(0, 242, 254, 0.12);
        padding-top: 10px;
        margin-top: 2px;
      }
      .copilot-protocol-diff-summary {
        display: flex;
        align-items: center;
        gap: 6px;
        font-size: 0.72rem;
      }
      .copilot-diff-pill {
        padding: 2px 6px;
        border-radius: 4px;
        font-weight: 700;
      }
      .copilot-diff-pill.add {
        background: rgba(16, 185, 129, 0.15);
        color: var(--accent-teal);
      }
      .copilot-diff-pill.mod {
        background: rgba(245, 158, 11, 0.15);
        color: #fbbf24;
      }
      .copilot-diff-pill.rem {
        background: rgba(239, 68, 68, 0.15);
        color: #f87171;
      }

      .copilot-goal-bar {
        background: rgba(6, 16, 30, 0.95);
        border: 1px solid rgba(0, 242, 254, 0.2);
        border-radius: var(--radius-sm);
        padding: 8px 12px;
        margin: 6px 14px 0;
        display: flex;
        flex-direction: column;
        gap: 6px;
        flex-shrink: 0;
      }
      .copilot-goal-top {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
      }
      .copilot-goal-select-wrap {
        display: flex;
        align-items: center;
        gap: 6px;
        flex: 1;
      }
      .copilot-goal-select {
        background: rgba(10, 22, 38, 0.9);
        border: 1px solid var(--border-subtle);
        border-radius: 4px;
        color: var(--accent-cyan);
        font-size: 0.76rem;
        font-weight: 700;
        padding: 3px 6px;
        outline: none;
        cursor: pointer;
        flex: 1;
      }
      .copilot-goal-select:focus {
        border-color: var(--border-focus);
      }
      .copilot-goal-badge {
        font-size: 0.68rem;
        font-weight: 800;
        text-transform: uppercase;
        border-radius: 3px;
        padding: 2px 6px;
      }
      .copilot-goal-badge.auto {
        background: rgba(0, 242, 254, 0.15);
        color: var(--accent-cyan);
        border: 1px solid rgba(0, 242, 254, 0.3);
      }
      .copilot-goal-badge.user {
        background: rgba(16, 185, 129, 0.15);
        color: var(--accent-teal);
        border: 1px solid rgba(16, 185, 129, 0.3);
      }
      .btn-toggle-notes {
        background: transparent;
        border: 1px solid var(--border-subtle);
        color: var(--text-muted);
        font-size: 0.72rem;
        padding: 2px 6px;
        border-radius: 4px;
        cursor: pointer;
        transition: all 0.15s ease;
      }
      .btn-toggle-notes:hover {
        color: var(--text-primary);
        border-color: var(--border);
      }
      .copilot-custom-notes-input {
        width: 100%;
        background: rgba(5, 12, 22, 0.85);
        border: 1px solid var(--border-subtle);
        border-radius: 4px;
        padding: 6px 8px;
        font-size: 0.76rem;
        color: var(--text-primary);
        font-family: inherit;
        resize: none;
        outline: none;
      }
      .copilot-custom-notes-input:focus {
        border-color: var(--border-focus);
      }

      .copilot-input-area {
        padding: 14px 18px;
        background: rgba(10, 22, 38, 0.98);
        border-top: 1px solid var(--border-subtle);
        display: flex;
        flex-direction: column;
        gap: 8px;
        flex-shrink: 0;
      }

      .copilot-input-wrap {
        display: flex;
        align-items: flex-end;
        gap: 8px;
        background: rgba(5, 12, 22, 0.9);
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius-md);
        padding: 8px 12px;
        transition: border-color 0.2s ease;
      }
      .copilot-input-wrap:focus-within {
        border-color: var(--border-focus);
      }

      .copilot-textarea {
        flex: 1;
        background: transparent;
        border: none;
        outline: none;
        color: var(--text-primary);
        font-family: inherit;
        font-size: 0.88rem;
        line-height: 1.4;
        resize: none;
        max-height: 120px;
        min-height: 24px;
      }

      .copilot-send-btn {
        width: 34px;
        height: 34px;
        border-radius: var(--radius-sm);
        background: var(--accent-cyan);
        color: #04151b;
        border: none;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        font-weight: 900;
        font-size: 0.95rem;
        transition: all 0.15s ease;
        flex-shrink: 0;
      }
      .copilot-send-btn:hover {
        transform: scale(1.05);
        box-shadow: 0 0 12px rgba(0, 242, 254, 0.4);
      }
      .copilot-send-btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
        transform: none;
      }

      /* AI STACK BUILDER MODAL & CARDS */
      .builder-goal-card {
        background: rgba(10, 22, 38, 0.7);
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius-sm);
        padding: 10px 8px;
        text-align: center;
        cursor: pointer;
        transition: all 0.15s ease;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 3px;
        user-select: none;
      }
      .builder-goal-card:hover {
        border-color: var(--accent-cyan);
        background: rgba(0, 242, 254, 0.08);
        transform: translateY(-2px);
      }
      .builder-goal-card.active {
        border-color: var(--accent-cyan);
        background: rgba(0, 242, 254, 0.15);
        box-shadow: 0 0 12px rgba(0, 242, 254, 0.25);
      }
      .builder-goal-name {
        font-size: 0.78rem;
        font-weight: 800;
        color: #f8fafc;
      }
      .builder-goal-sub {
        font-size: 0.68rem;
        color: var(--text-muted);
      }

      /* BIOMETRICS & DEMOGRAPHICS CHIPS & PANELS */
      .bio-chip {
        display: inline-flex;
        align-items: center;
        background: rgba(0, 242, 254, 0.12);
        border: 1px solid rgba(0, 242, 254, 0.3);
        border-radius: 4px;
        padding: 2px 7px;
        font-size: 0.72rem;
        color: var(--accent-cyan);
        font-weight: 700;
      }
      .bio-chip-sm {
        display: inline-flex;
        align-items: center;
        background: rgba(0, 242, 254, 0.1);
        border: 1px solid rgba(0, 242, 254, 0.22);
        border-radius: 3px;
        padding: 1px 5px;
        font-size: 0.68rem;
        color: var(--accent-cyan);
        font-weight: 600;
      }
      .builder-bio-panel {
        background: rgba(0, 242, 254, 0.04);
        border: 1px solid rgba(0, 242, 254, 0.22);
        border-radius: var(--radius-sm);
        padding: 12px 14px;
        display: flex;
        flex-direction: column;
        gap: 10px;
      }
      .builder-bio-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
      }
      .builder-bio-toggle-btn {
        background: rgba(0, 242, 254, 0.12);
        border: 1px solid rgba(0, 242, 254, 0.35);
        color: var(--accent-cyan);
        border-radius: var(--radius-sm);
        padding: 4px 10px;
        font-size: 0.74rem;
        font-weight: 700;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        gap: 4px;
        transition: all 0.15s ease;
      }
      .builder-bio-toggle-btn:hover {
        background: rgba(0, 242, 254, 0.22);
        border-color: var(--accent-cyan);
        color: #fff;
      }
      .builder-bio-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 8px;
        padding-top: 8px;
        border-top: 1px dashed rgba(0, 242, 254, 0.18);
      }
      .builder-bio-tip {
        font-size: 0.71rem;
        color: var(--text-secondary);
        line-height: 1.35;
        background: rgba(0, 0, 0, 0.3);
        padding: 6px 10px;
        border-radius: var(--radius-sm);
        border-left: 3px solid var(--accent-cyan);
      }

      .copilot-demographics-bar {
        padding: 6px 16px;
        background: rgba(0, 242, 254, 0.03);
        border-bottom: 1px solid var(--border-subtle);
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        font-size: 0.74rem;
        flex-shrink: 0;
      }
      .copilot-demographics-summary {
        display: flex;
        align-items: center;
        gap: 6px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        flex: 1;
      }
      .copilot-bio-toggle-btn {
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid var(--border-subtle);
        border-radius: 4px;
        color: var(--text-secondary);
        font-size: 0.72rem;
        font-weight: 700;
        padding: 3px 8px;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        gap: 4px;
        white-space: nowrap;
        transition: all 0.15s ease;
      }
      .copilot-bio-toggle-btn:hover,
      .copilot-bio-toggle-btn.active {
        background: rgba(0, 242, 254, 0.12);
        border-color: rgba(0, 242, 254, 0.35);
        color: var(--accent-cyan);
      }
      .copilot-bio-drawer {
        padding: 10px 16px 12px;
        background: rgba(5, 12, 22, 0.95);
        border-bottom: 1px solid var(--border);
        display: flex;
        flex-direction: column;
        gap: 8px;
        flex-shrink: 0;
        animation: fadeIn 0.2s ease;
      }
      .copilot-bio-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
        gap: 6px;
      }

      /* FLAGSHIP AI STACK BUILDER HERO BANNER / BUTTON */
      .ai-stack-builder-hero-banner {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 14px;
        margin-bottom: 12px;
        background: linear-gradient(135deg, rgba(0, 242, 254, 0.16) 0%, rgba(79, 70, 229, 0.28) 50%, rgba(10, 22, 38, 0.9) 100%);
        border: 1.5px solid rgba(0, 242, 254, 0.45);
        border-radius: var(--radius-md);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 16px rgba(0, 242, 254, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.12);
        cursor: pointer;
        user-select: none;
        transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
        position: relative;
        overflow: hidden;
      }
      .ai-stack-builder-hero-banner::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(0, 242, 254, 0.2), transparent);
        transition: 0.6s;
      }
      .ai-stack-builder-hero-banner:hover {
        transform: translateY(-2px);
        border-color: var(--accent-cyan);
        box-shadow: 0 8px 26px rgba(0, 242, 254, 0.35), 0 0 28px rgba(79, 70, 229, 0.4);
        background: linear-gradient(135deg, rgba(0, 242, 254, 0.26) 0%, rgba(79, 70, 229, 0.38) 50%, rgba(10, 24, 44, 0.96) 100%);
      }
      .ai-stack-builder-hero-banner:hover::before {
        left: 100%;
      }
      .ai-stack-builder-hero-banner:focus-visible {
        outline: 2px solid var(--accent-cyan);
        outline-offset: 2px;
      }
      .hero-ai-spark-icon {
        font-size: 1.4rem;
        width: 38px;
        height: 38px;
        border-radius: var(--radius-sm);
        background: linear-gradient(135deg, rgba(0, 242, 254, 0.3), rgba(79, 70, 229, 0.5));
        border: 1px solid rgba(0, 242, 254, 0.5);
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        box-shadow: 0 0 12px rgba(0, 242, 254, 0.35);
      }
      .hero-ai-content {
        display: flex;
        flex-direction: column;
        gap: 2px;
        flex: 1;
      }
      .hero-ai-title {
        font-size: 0.95rem;
        font-weight: 800;
        color: #ffffff;
        display: flex;
        align-items: center;
        gap: 8px;
        letter-spacing: 0.01em;
      }
      .hero-ai-badge {
        font-size: 0.65rem;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        background: linear-gradient(135deg, #00f2fe, #4f46e5);
        color: #04151b;
        padding: 2px 7px;
        border-radius: 4px;
        box-shadow: 0 0 8px rgba(0, 242, 254, 0.4);
      }
      .hero-ai-subtitle {
        font-size: 0.72rem;
        color: var(--text-secondary);
        line-height: 1.3;
      }
      .hero-ai-arrow {
        font-size: 1.05rem;
        color: var(--accent-cyan);
        font-weight: 800;
        transition: transform 0.2s ease;
      }
      .ai-stack-builder-hero-banner:hover .hero-ai-arrow {
        transform: translateX(4px);
        color: #ffffff;
      }

      /* ==========================================================================
         RESPONSIVE STYLES & MOBILE TOUCH OPTIMIZATIONS
         ========================================================================== */
      @media (max-width: 1150px) {
        .workbench-layout {
          grid-template-columns: 370px 1fr;
          gap: 16px;
        }
      }

      @media (max-width: 992px) {
        .app-wrapper {
          padding: 14px 16px 40px;
          max-width: 100%;
          overflow-x: hidden;
          box-sizing: border-box;
        }
        .status-banner {
          grid-template-columns: 1fr;
          gap: 16px;
          min-width: 0;
          max-width: 100%;
        }
        .workbench-layout {
          grid-template-columns: 1fr;
          gap: 18px;
          min-width: 0;
          max-width: 100%;
        }
        .workbench-layout > * {
          min-width: 0;
          max-width: 100%;
        }
        .panel {
          min-width: 0;
          max-width: 100%;
          overflow: hidden;
        }
      }

      @media (max-width: 768px) {
        html, body {
          -webkit-tap-highlight-color: transparent;
          max-width: 100vw;
          overflow-x: hidden;
        }

        .app-wrapper {
          padding: 12px 12px 48px;
          max-width: 100%;
          overflow-x: hidden;
          box-sizing: border-box;
        }

        .topbar {
          padding: 10px 12px;
          gap: 8px;
          flex-wrap: wrap;
          border-radius: var(--radius-md);
          margin-bottom: 14px;
          max-width: 100%;
          box-sizing: border-box;
        }

        .brand-group {
          gap: 8px;
          min-width: 0;
          flex: 1;
        }

        .brand-icon {
          width: 32px;
          height: 32px;
          font-size: 1rem;
          border-radius: var(--radius-sm);
          flex-shrink: 0;
        }

        .brand-titles {
          min-width: 0;
          overflow: hidden;
        }

        .brand-title {
          font-size: 0.95rem;
          line-height: 1.2;
          white-space: nowrap;
          overflow: hidden;
          text-overflow: ellipsis;
        }

        .brand-subtitle {
          font-size: 0.64rem;
          letter-spacing: 0.05em;
          white-space: nowrap;
          overflow: hidden;
          text-overflow: ellipsis;
        }

        .topbar-actions {
          gap: 6px;
          flex-wrap: wrap;
          justify-content: flex-end;
        }

        .btn-header-action {
          padding: 5px 10px;
          font-size: 0.75rem;
          border-radius: var(--radius-xs);
        }

        .mode-toggle-group {
          padding: 1px;
        }

        .mode-btn {
          padding: 4px 8px;
          font-size: 0.7rem;
        }

        .mobile-menu-toggle {
          display: flex;
          align-items: center;
          justify-content: center;
          width: 34px;
          height: 34px;
          padding: 0;
          font-size: 1.15rem;
          border-radius: var(--radius-xs);
        }

        .preset-menu {
          width: min(340px, calc(100vw - 24px));
          right: 0;
          left: auto;
          max-height: 75vh;
          overflow-y: auto;
          -webkit-overflow-scrolling: touch;
          border-radius: var(--radius-md);
        }

        .nav-links {
          display: none;
          position: absolute;
          top: calc(100% + 6px);
          left: 0;
          right: 0;
          background: rgba(8, 16, 30, 0.98);
          backdrop-filter: blur(24px);
          -webkit-backdrop-filter: blur(24px);
          border: 1px solid var(--border-mid);
          border-radius: var(--radius-md);
          box-shadow: 0 16px 40px rgba(0, 0, 0, 0.75);
          padding: 10px;
          flex-direction: column;
          gap: 6px;
          z-index: 250;
        }

        .nav-links.open {
          display: flex;
          animation: dropFade 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
        }

        .nav-link {
          width: 100%;
          padding: 10px 14px;
          font-size: 0.88rem;
          border-radius: var(--radius-sm);
        }

        /* BANNER & STATUS */
        .status-banner {
          padding: 14px 16px;
          border-radius: var(--radius-lg);
          gap: 14px;
          margin-bottom: 16px;
          min-width: 0;
          max-width: 100%;
          box-sizing: border-box;
        }

        .gauge-card {
          padding: 12px;
          min-width: 0;
          max-width: 100%;
        }

        .summary-content {
          min-width: 0;
          max-width: 100%;
        }

        .summary-heading {
          font-size: 1.05rem;
        }

        .summary-text-box {
          font-size: 0.84rem;
          word-break: break-word;
        }

        .summary-stats-grid {
          grid-template-columns: 1fr 1fr;
          gap: 8px;
          min-width: 0;
          max-width: 100%;
        }

        .stat-chip {
          padding: 8px 12px;
          border-radius: var(--radius-sm);
          min-width: 0;
          overflow: hidden;
        }

        .stat-chip-label {
          word-break: break-word;
          line-height: 1.2;
        }

        .stat-chip-val {
          font-size: 1.15rem;
          word-break: break-all;
        }

        /* PANELS & WORKBENCH */
        .workbench-layout, .workbench-layout > * {
          min-width: 0 !important;
          max-width: 100% !important;
          box-sizing: border-box !important;
        }

        .panel {
          padding: 14px 16px;
          border-radius: var(--radius-lg);
          min-width: 0 !important;
          max-width: 100% !important;
          overflow: hidden;
          box-sizing: border-box;
        }

        .panel-header {
          min-width: 0;
        }

        .panel-title {
          font-size: 0.95rem;
          min-width: 0;
          flex-wrap: wrap;
        }

        .ai-stack-builder-hero-banner {
          padding: 12px 14px;
          gap: 10px;
          border-radius: var(--radius-md);
          max-width: 100%;
          box-sizing: border-box;
          overflow: hidden;
        }

        .hero-ai-content {
          min-width: 0;
          flex: 1;
        }

        .hero-ai-spark-icon {
          width: 32px;
          height: 32px;
          font-size: 1.15rem;
          flex-shrink: 0;
        }

        .hero-ai-title {
          font-size: 0.88rem;
          flex-wrap: wrap;
          gap: 4px;
          min-width: 0;
        }

        .hero-ai-subtitle {
          font-size: 0.7rem;
          word-break: break-word;
          min-width: 0;
        }

        .workbench-presets-bar {
          overflow-x: auto;
          flex-wrap: nowrap;
          padding-bottom: 8px;
          scrollbar-width: none;
          -webkit-overflow-scrolling: touch;
          gap: 4px;
          max-width: 100%;
          box-sizing: border-box;
        }
        .workbench-presets-bar::-webkit-scrollbar {
          display: none;
        }

        .preset-chip-btn {
          flex-shrink: 0;
          white-space: nowrap;
          font-size: 0.72rem;
          padding: 4px 8px;
        }

        .search-container {
          max-width: 100%;
          box-sizing: border-box;
        }

        .search-input-wrapper {
          max-width: 100%;
          box-sizing: border-box;
        }

        .search-input {
          padding: 9px 12px 9px 34px;
          font-size: 16px;
          max-width: 100%;
          box-sizing: border-box;
        }

        .search-dropdown {
          max-height: 240px;
          max-width: 100%;
          box-sizing: border-box;
          -webkit-overflow-scrolling: touch;
        }

        .search-item {
          max-width: 100%;
          box-sizing: border-box;
        }

        .search-item-info {
          min-width: 0;
          flex: 1;
        }

        .search-item-name {
          word-break: break-word;
        }

        .quick-tags-section {
          max-width: 100%;
          box-sizing: border-box;
          overflow: hidden;
        }

        .quick-tags-nav {
          overflow-x: auto;
          -webkit-overflow-scrolling: touch;
          gap: 4px;
          max-width: 100%;
          box-sizing: border-box;
        }

        .quick-cat-btn {
          flex-shrink: 0;
          padding: 4px 9px;
          font-size: 0.7rem;
        }

        .quick-tags-wrap {
          gap: 5px;
          max-width: 100%;
          box-sizing: border-box;
        }

        .quick-tag {
          padding: 5px 9px;
          font-size: 0.74rem;
        }

        .stack-list-section {
          max-width: 100%;
          box-sizing: border-box;
        }

        .stack-items-wrap {
          max-width: 100%;
          box-sizing: border-box;
        }

        .stack-empty-card {
          max-width: 100%;
          box-sizing: border-box;
          word-break: break-word;
        }

        .stack-item-card {
          padding: 10px 12px;
          gap: 8px;
          border-radius: var(--radius-sm);
          max-width: 100%;
          box-sizing: border-box;
          min-width: 0;
          overflow: hidden;
        }

        .stack-item-top {
          min-width: 0;
          gap: 6px;
        }

        .stack-item-name-group {
          min-width: 0;
          flex: 1;
          flex-wrap: wrap;
          gap: 4px 6px;
        }

        .stack-item-name {
          font-size: 0.88rem;
          word-break: break-word;
          min-width: 0;
        }

        .stack-item-class {
          word-break: break-word;
        }

        .control-select, .control-input {
          font-size: 16px;
          max-width: 100%;
        }

        .stack-dose-input, .stack-unit-select, .stack-timing-select,
        .stack-route-select, .stack-freq-select {
          font-size: 16px !important;
        }

        .biomarker-card {
          padding: 12px 14px;
          border-radius: var(--radius-md);
          margin-top: 12px;
          max-width: 100%;
          box-sizing: border-box;
        }

        .biomarker-header {
          flex-wrap: wrap;
          gap: 6px;
          min-width: 0;
        }

        .biomarker-grid {
          max-width: 100%;
          box-sizing: border-box;
        }

        .biomarker-field {
          min-width: 0;
          max-width: 100%;
          box-sizing: border-box;
        }

        .biomarker-input {
          font-size: 16px;
          width: 100%;
          max-width: 100%;
          box-sizing: border-box;
        }

        .action-btn-row {
          gap: 6px;
          margin-top: 12px;
          max-width: 100%;
          box-sizing: border-box;
        }

        .btn-secondary {
          padding: 9px 10px;
          font-size: 0.78rem;
          min-width: 0;
        }

        /* VISUALIZER TABS */
        .tabs-nav {
          overflow-x: auto;
          flex-wrap: nowrap;
          -webkit-overflow-scrolling: touch;
          scrollbar-width: none;
          gap: 4px;
          padding-bottom: 8px;
          margin-bottom: 14px;
          max-width: 100%;
          box-sizing: border-box;
        }
        .tabs-nav::-webkit-scrollbar {
          display: none;
        }

        .tab-btn {
          flex-shrink: 0;
          white-space: nowrap;
          padding: 7px 11px;
          font-size: 0.78rem;
          border-radius: var(--radius-xs);
        }

        .tab-btn-link {
          flex-shrink: 0;
          white-space: nowrap;
          margin-left: 0;
          padding: 6px 10px;
          font-size: 0.75rem;
        }

        /* TAB 1: FULL STACK EQUILIBRIUM */
        .balance-dashboard-container {
          gap: 14px;
          max-width: 100%;
          box-sizing: border-box;
        }

        .balance-hero-banner {
          flex-direction: column;
          align-items: stretch;
          padding: 14px 16px;
          gap: 12px;
          border-radius: var(--radius-md);
          max-width: 100%;
          box-sizing: border-box;
        }

        .balance-hero-title {
          font-size: 1.02rem;
        }

        .balance-hero-desc {
          font-size: 0.82rem;
          word-break: break-word;
        }

        .balance-hero-badge-wrap {
          width: 100%;
          justify-content: space-between;
          flex-wrap: wrap;
          gap: 8px;
        }

        .balance-index-gauge {
          padding: 8px 14px;
        }

        .balance-index-num {
          font-size: 1.35rem;
        }

        .axes-toolbar-row {
          flex-direction: column;
          align-items: stretch;
          gap: 8px;
          max-width: 100%;
          box-sizing: border-box;
        }

        .axes-filter-chips {
          overflow-x: auto;
          flex-wrap: nowrap;
          -webkit-overflow-scrolling: touch;
          scrollbar-width: none;
          padding-bottom: 2px;
          gap: 4px;
          max-width: 100%;
          box-sizing: border-box;
        }
        .axes-filter-chips::-webkit-scrollbar {
          display: none;
        }

        .axis-filter-btn {
          flex-shrink: 0;
          white-space: nowrap;
          font-size: 0.72rem;
          padding: 4px 9px;
        }

        .axis-sort-wrap {
          width: 100%;
          justify-content: space-between;
          max-width: 100%;
          box-sizing: border-box;
        }

        .axes-cards-grid {
          grid-template-columns: 1fr;
          gap: 10px;
          max-width: 100%;
          box-sizing: border-box;
        }

        .axis-card {
          padding: 14px;
          border-radius: var(--radius-sm);
          gap: 10px;
          max-width: 100%;
          box-sizing: border-box;
          min-width: 0;
          overflow: hidden;
        }

        .axis-name {
          font-size: 0.9rem;
          word-break: break-word;
        }

        .axis-values-row {
          padding: 8px 10px;
          max-width: 100%;
          box-sizing: border-box;
        }

        .axis-val-primary {
          font-size: 1.1rem;
        }

        .mitigation-card, .uncompensated-card {
          padding: 10px 12px;
          max-width: 100%;
          box-sizing: border-box;
          word-break: break-word;
        }

        /* TAB 2: COLLISION MATRIX */
        .matrix-legend-row {
          gap: 6px 10px;
          padding: 6px 10px;
          font-size: 0.68rem;
          border-radius: var(--radius-xs);
          max-width: 100%;
          box-sizing: border-box;
        }

        .matrix-scroll-wrap {
          -webkit-overflow-scrolling: touch;
          padding-bottom: 12px;
          max-width: 100%;
          box-sizing: border-box;
        }

        .matrix-table {
          border-spacing: 4px;
        }

        .matrix-table th {
          font-size: 0.68rem;
          padding: 6px 4px;
          max-width: 80px;
        }

        .matrix-cell {
          min-width: 82px;
          height: 58px;
          padding: 4px;
          font-size: 0.7rem;
          border-radius: var(--radius-sm);
        }

        /* TAB 3: CONFLICT DEEP DIVE */
        .conflict-card {
          padding: 12px 14px;
          gap: 6px;
          max-width: 100%;
          box-sizing: border-box;
          min-width: 0;
        }

        .conflict-card-title {
          font-size: 0.88rem;
          word-break: break-word;
        }

        .conflict-card-desc {
          font-size: 0.8rem;
          word-break: break-word;
        }

        .conflict-card-rec {
          font-size: 0.76rem;
          padding: 6px 8px;
          word-break: break-word;
        }

        /* MODALS */
        .modal-dialog {
          width: min(640px, calc(100vw - 16px)) !important;
          max-height: 92vh !important;
          margin: 8px auto !important;
          border-radius: var(--radius-lg);
          box-sizing: border-box;
        }

        .modal-header {
          padding: 12px 16px;
        }

        .modal-title {
          font-size: 0.98rem;
        }

        .modal-subtitle {
          font-size: 0.72rem;
        }

        .modal-close-btn {
          width: 36px;
          height: 36px;
          font-size: 1.4rem;
          display: flex;
          align-items: center;
          justify-content: center;
        }

        .modal-body {
          padding: 14px 16px;
          gap: 12px;
          -webkit-overflow-scrolling: touch;
          box-sizing: border-box;
        }

        /* FLOATING COPILOT PILL & DRAWER */
        .floating-copilot-pill {
          bottom: 16px;
          right: 16px;
          padding: 8px 14px;
          font-size: 0.8rem;
          z-index: 180;
        }

        .copilot-drawer {
          width: 100vw !important;
          max-width: 100vw !important;
          min-width: 0 !important;
          border-left: none;
          box-sizing: border-box;
        }

        .copilot-resize-handle {
          display: none;
        }

        .copilot-header {
          padding: 10px 14px;
        }

        .copilot-mode-bar {
          gap: 3px;
          padding: 2px;
        }

        .copilot-mode-btn {
          font-size: 0.68rem;
          padding: 4px 2px;
        }

        .copilot-input-bar {
          padding: 10px 12px max(10px, env(safe-area-inset-bottom));
        }
      }

      @media (max-width: 520px) {
        .stack-item-dose-row {
          flex-direction: column;
          align-items: stretch;
          gap: 6px;
        }

        .stack-item-dose-group {
          width: 100%;
        }

        .stack-item-route-row {
          flex-direction: column;
          align-items: stretch;
          gap: 6px;
        }

        .biomarker-grid {
          grid-template-columns: 1fr;
          gap: 8px;
        }
      }

      @media (max-width: 480px) {
        .app-wrapper {
          padding: 8px 8px 36px;
          max-width: 100%;
          overflow-x: hidden;
        }

        .topbar {
          padding: 8px 10px;
          margin-bottom: 10px;
        }

        .brand-title {
          font-size: 0.88rem;
        }

        .brand-subtitle {
          display: none;
        }

        .status-banner {
          padding: 10px 12px;
          gap: 10px;
          margin-bottom: 12px;
        }

        .summary-stats-grid {
          gap: 6px;
        }

        .stat-chip {
          padding: 6px 8px;
        }

        .stat-chip-val {
          font-size: 1.05rem;
        }

        .stat-chip-label {
          font-size: 0.62rem;
        }

        .matrix-cell {
          min-width: 74px;
          height: 54px;
          font-size: 0.66rem;
        }

        .floating-copilot-pill {
          bottom: 12px;
          right: 12px;
          padding: 7px 12px;
          font-size: 0.76rem;
        }
      }

      /* ==============================================================================
         API KEY SETTINGS & TOKEN QUOTA EXHAUSTION UI
         ============================================================================== */
      .key-status-pill {
        font-size: 0.68rem;
        font-weight: 700;
        padding: 2px 8px;
        border-radius: 999px;
        display: inline-flex;
        align-items: center;
        gap: 4px;
        letter-spacing: 0.02em;
        text-transform: uppercase;
      }
      .key-status-pill.default {
        background: rgba(100, 116, 139, 0.15);
        color: #94a3b8;
        border: 1px solid rgba(100, 116, 139, 0.3);
      }
      .key-status-pill.custom {
        background: rgba(16, 185, 129, 0.15);
        color: #34d399;
        border: 1px solid rgba(16, 185, 129, 0.4);
      }

      .copilot-quota-card {
        background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(239, 68, 68, 0.05) 100%);
        border: 1px solid rgba(245, 158, 11, 0.35);
        border-radius: var(--radius-sm);
        padding: 14px 16px;
        margin: 6px 0;
        display: flex;
        flex-direction: column;
        gap: 10px;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
      }

      .copilot-quota-header {
        display: flex;
        align-items: center;
        gap: 8px;
        font-weight: 800;
        font-size: 0.88rem;
        color: #fbbf24;
      }

      .copilot-quota-desc {
        font-size: 0.78rem;
        color: var(--text-secondary);
        line-height: 1.45;
        margin: 0;
      }

      .copilot-quota-input-wrap {
        display: flex;
        flex-direction: column;
        gap: 8px;
        background: rgba(0, 0, 0, 0.3);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: var(--radius-sm);
        padding: 10px 12px;
      }

      .copilot-quota-field-row {
        display: flex;
        gap: 6px;
        align-items: center;
      }

      .copilot-quota-input {
        flex: 1;
        background: rgba(0, 0, 0, 0.4);
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius-sm);
        padding: 7px 10px;
        font-family: 'JetBrains Mono', monospace;
        font-size: 0.76rem;
        color: #fff;
        outline: none;
        transition: border-color 0.2s ease;
      }
      .copilot-quota-input:focus {
        border-color: var(--accent-cyan);
        box-shadow: 0 0 8px rgba(0, 242, 254, 0.2);
      }

      .copilot-quota-actions {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 0.72rem;
      }

      .copilot-quota-actions a {
        color: var(--accent-cyan);
        text-decoration: none;
        font-weight: 700;
      }
      .copilot-quota-actions a:hover {
        text-decoration: underline;
      }

      .copilot-key-btn-active {
        border-color: rgba(16, 185, 129, 0.4) !important;
        background: rgba(16, 185, 129, 0.12) !important;
        color: #34d399 !important;
      }

      /* ==========================================================================
         KNOWLEDGE GRAPH ELEVATION & EMBEDDED WORKSPACE STYLES
         ========================================================================== */

      .header-flagship-tag,
      .nav-flagship-tag {
        font-family: 'JetBrains Mono', monospace;
        font-size: 0.62rem;
        font-weight: 800;
        padding: 1px 5px;
        border-radius: 4px;
        background: rgba(0, 242, 254, 0.2);
        border: 1px solid rgba(0, 242, 254, 0.45);
        color: #00f2fe;
        letter-spacing: 0.5px;
      }

      .stat-chip-graph {
        transition: all 0.2s ease;
      }
      .stat-chip-graph:hover {
        background: rgba(0, 242, 254, 0.14) !important;
        border-color: rgba(0, 242, 254, 0.6) !important;
        transform: translateY(-2px);
        box-shadow: 0 4px 16px rgba(0, 242, 254, 0.2);
      }

      /* Left Panel 2nd Flagship Spotlight Card */
      .kg-spotlight-card {
        margin: 6px 0 10px;
        padding: 10px 12px;
        background: linear-gradient(135deg, rgba(0, 242, 254, 0.08) 0%, rgba(15, 23, 42, 0.8) 100%);
        border: 1px solid rgba(0, 242, 254, 0.35);
        border-radius: var(--radius-sm);
        display: flex;
        align-items: center;
        gap: 10px;
        cursor: pointer;
        transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
      }
      .kg-spotlight-card:hover {
        background: linear-gradient(135deg, rgba(0, 242, 254, 0.16) 0%, rgba(15, 23, 42, 0.95) 100%);
        border-color: rgba(0, 242, 254, 0.65);
        transform: translateY(-1px);
        box-shadow: 0 6px 20px rgba(0, 242, 254, 0.2);
      }
      .kg-spotlight-icon {
        font-size: 1.35rem;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 34px;
        height: 34px;
        border-radius: 8px;
        background: rgba(0, 242, 254, 0.12);
        border: 1px solid rgba(0, 242, 254, 0.3);
        flex-shrink: 0;
      }
      .kg-spotlight-content {
        flex: 1;
        min-width: 0;
      }
      .kg-spotlight-title {
        font-size: 0.84rem;
        font-weight: 800;
        color: #f8fafc;
        display: flex;
        align-items: center;
        gap: 6px;
      }
      .kg-spotlight-badge {
        font-size: 0.62rem;
        font-weight: 800;
        font-family: 'JetBrains Mono', monospace;
        color: #38bdf8;
        background: rgba(56, 189, 248, 0.15);
        border: 1px solid rgba(56, 189, 248, 0.35);
        padding: 1px 5px;
        border-radius: 4px;
        text-transform: uppercase;
      }
      .kg-spotlight-subtitle {
        font-size: 0.72rem;
        color: var(--text-secondary);
        line-height: 1.3;
        margin-top: 2px;
      }
      .kg-spotlight-actions {
        display: flex;
        align-items: center;
        gap: 5px;
        flex-shrink: 0;
      }
      .kg-spotlight-quick-btn {
        font-size: 0.72rem;
        font-weight: 700;
        color: var(--accent-cyan);
        background: rgba(0, 242, 254, 0.12);
        border: 1px solid rgba(0, 242, 254, 0.3);
        padding: 4px 8px;
        border-radius: 4px;
        transition: all 0.2s ease;
      }
      .kg-spotlight-quick-btn:hover {
        background: var(--accent-cyan);
        color: #04151b;
      }
      .kg-spotlight-ext-btn {
        font-size: 0.8rem;
        color: var(--text-muted);
        text-decoration: none;
        padding: 3px 6px;
        border-radius: 4px;
        transition: all 0.2s ease;
      }
      .kg-spotlight-ext-btn:hover {
        color: #fff;
        background: rgba(255, 255, 255, 0.1);
      }

      /* Tab Header Styling for Knowledge Graph (Featured 2nd Flagship) */
      .tab-btn-graph-featured {
        border-color: rgba(0, 242, 254, 0.25) !important;
      }
      .tab-flagship-tag {
        font-size: 0.6rem;
        font-weight: 800;
        font-family: 'JetBrains Mono', monospace;
        color: #38bdf8;
        background: rgba(0, 242, 254, 0.15);
        padding: 1px 5px;
        border-radius: 3px;
      }
      .tab-badge-graph {
        background: rgba(0, 242, 254, 0.18) !important;
        color: #00f2fe !important;
        border: 1px solid rgba(0, 242, 254, 0.35);
      }

      /* Stack Item Quick Graph Action */
      .stack-item-graph-btn {
        background: rgba(0, 242, 254, 0.08);
        border: 1px solid rgba(0, 242, 254, 0.25);
        color: var(--accent-cyan);
        padding: 2px 6px;
        border-radius: 4px;
        font-size: 0.72rem;
        font-weight: 700;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        gap: 3px;
        transition: all 0.2s ease;
      }
      .stack-item-graph-btn:hover {
        background: rgba(0, 242, 254, 0.22);
        border-color: var(--accent-cyan);
        transform: translateY(-1px);
      }

      /* Embedded Knowledge Graph Tab Pane */
      .embedded-graph-toolbar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
        gap: 8px;
        padding: 8px 12px;
        background: rgba(10, 16, 31, 0.85);
        border: 1px solid rgba(0, 242, 254, 0.2);
        border-radius: var(--radius-sm);
        margin-bottom: 8px;
      }
      .embedded-graph-controls-left {
        display: flex;
        align-items: center;
        gap: 6px;
        flex-wrap: wrap;
      }
      .embedded-graph-controls-right {
        display: flex;
        align-items: center;
        gap: 6px;
        flex-wrap: wrap;
      }
      .embedded-search-wrap {
        position: relative;
        display: flex;
        align-items: center;
      }
      .embedded-search-icon {
        position: absolute;
        left: 8px;
        font-size: 0.72rem;
        pointer-events: none;
        opacity: 0.7;
      }
      .embedded-graph-search-input {
        width: 170px;
        padding: 5px 8px 5px 26px;
        background: rgba(0, 0, 0, 0.4);
        border: 1px solid var(--border-subtle);
        border-radius: 6px;
        color: #fff;
        font-size: 0.76rem;
        outline: none;
        transition: all 0.2s ease;
      }
      .embedded-graph-search-input:focus {
        border-color: var(--accent-cyan);
        box-shadow: 0 0 8px rgba(0, 242, 254, 0.25);
        width: 200px;
      }
      .embedded-graph-select {
        background: rgba(12, 24, 38, 0.95);
        border: 1px solid rgba(0, 242, 254, 0.25);
        color: #f8fafc;
        font-size: 0.74rem;
        font-weight: 600;
        padding: 4px 8px;
        border-radius: 6px;
        outline: none;
        cursor: pointer;
      }
      .btn-graph-tool {
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid var(--border-subtle);
        color: var(--text-secondary);
        font-size: 0.74rem;
        font-weight: 700;
        padding: 5px 10px;
        border-radius: 6px;
        cursor: pointer;
        transition: all 0.2s ease;
        display: inline-flex;
        align-items: center;
        gap: 4px;
        text-decoration: none;
      }
      .btn-graph-tool:hover {
        background: rgba(255, 255, 255, 0.1);
        color: #fff;
        border-color: rgba(255, 255, 255, 0.2);
      }
      .btn-graph-simulate {
        border-color: rgba(0, 242, 254, 0.4);
        background: rgba(0, 242, 254, 0.08);
        color: var(--accent-cyan);
      }
      .btn-graph-simulate:hover {
        background: var(--accent-cyan);
        color: #04151b;
        box-shadow: 0 0 12px rgba(0, 242, 254, 0.4);
      }
      .btn-graph-fullscreen {
        border-color: rgba(59, 130, 246, 0.4);
        background: rgba(59, 130, 246, 0.1);
        color: #60a5fa;
      }
      .btn-graph-fullscreen:hover {
        background: #3b82f6;
        color: #fff;
      }

      /* Cascade strip in embedded view */
      .embedded-cascade-strip {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 6px 10px;
        background: rgba(8, 13, 25, 0.7);
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius-sm);
        margin-bottom: 8px;
        overflow-x: auto;
      }
      .embedded-cascade-title {
        font-size: 0.72rem;
        font-weight: 800;
        color: var(--accent-cyan);
        flex-shrink: 0;
      }
      .embedded-cascade-chips-wrap {
        display: inline-flex;
        gap: 5px;
        flex-wrap: nowrap;
        overflow-x: auto;
      }

      /* Workspace and Canvas */
      .embedded-graph-workspace {
        position: relative;
        width: 100%;
        height: 620px;
        min-height: 520px;
        background: #050811;
        border: 1px solid rgba(0, 242, 254, 0.25);
        border-radius: var(--radius-sm);
        overflow: hidden;
      }
      .embedded-graph-canvas {
        width: 100%;
        height: 100%;
      }

      /* Embedded Node Inspector Drawer inside workbench */
      .embedded-node-inspector {
        position: absolute;
        top: 0;
        right: 0;
        width: 380px;
        max-width: 85%;
        height: 100%;
        background: rgba(10, 15, 29, 0.96);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-left: 1px solid rgba(0, 242, 254, 0.3);
        display: flex;
        flex-direction: column;
        z-index: 20;
        transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
        box-shadow: -8px 0 24px rgba(0, 0, 0, 0.6);
      }
      .embedded-node-inspector.hidden {
        transform: translateX(105%);
        pointer-events: none;
      }
      .embedded-inspector-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 14px;
        border-bottom: 1px solid var(--border-subtle);
      }
      .embedded-inspector-title {
        font-size: 0.88rem;
        font-weight: 800;
        color: #f8fafc;
      }
      .embedded-inspector-close {
        background: none;
        border: none;
        color: var(--text-muted);
        font-size: 1.3rem;
        cursor: pointer;
        line-height: 1;
      }
      .embedded-inspector-close:hover {
        color: #fff;
      }
      .embedded-inspector-tabs {
        display: flex;
        border-bottom: 1px solid var(--border-subtle);
        background: rgba(0, 0, 0, 0.25);
      }
      .embedded-inspector-tab {
        flex: 1;
        padding: 7px 4px;
        text-align: center;
        font-size: 0.72rem;
        font-weight: 700;
        color: var(--text-secondary);
        cursor: pointer;
        border-bottom: 2px solid transparent;
        transition: all 0.2s ease;
      }
      .embedded-inspector-tab.active {
        color: var(--accent-cyan);
        border-bottom-color: var(--accent-cyan);
        background: rgba(0, 242, 254, 0.06);
      }
      .embedded-inspector-body {
        flex: 1;
        overflow-y: auto;
        padding: 12px;
        display: flex;
        flex-direction: column;
        gap: 12px;
      }

      /* Node Inspector components */
      .node-hero-title {
        font-size: 1.05rem;
        font-weight: 800;
        color: #fff;
        line-height: 1.3;
      }
      .node-badge-row {
        display: flex;
        flex-wrap: wrap;
        gap: 5px;
        margin-top: 6px;
      }
      .node-badge {
        font-family: 'JetBrains Mono', monospace;
        font-size: 0.65rem;
        font-weight: 700;
        padding: 2px 6px;
        border-radius: 4px;
        border: 1px solid var(--border-subtle);
        background: rgba(255, 255, 255, 0.04);
      }
      .neighbor-group-title {
        font-size: 0.7rem;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: var(--text-muted);
        margin-bottom: 6px;
      }
      .neighbor-pill-list {
        display: flex;
        flex-direction: column;
        gap: 5px;
      }
      .neighbor-pill {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 5px 8px;
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid var(--border-subtle);
        border-radius: 6px;
        font-size: 0.74rem;
        cursor: pointer;
        transition: all 0.2s ease;
      }
      .neighbor-pill:hover {
        background: rgba(0, 242, 254, 0.08);
        border-color: rgba(0, 242, 254, 0.35);
      }
      .metrics-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
      }
      .metric-card {
        padding: 6px 8px;
        background: rgba(0, 0, 0, 0.35);
        border: 1px solid var(--border-subtle);
        border-radius: 6px;
      }
      .metric-label {
        font-size: 0.62rem;
        text-transform: uppercase;
        color: var(--text-muted);
        letter-spacing: 0.04em;
        font-weight: 700;
      }
      .metric-value {
        font-size: 0.8rem;
        font-weight: 800;
        color: #fff;
        margin-top: 2px;
      }
      .convergence-card {
        background: rgba(0, 0, 0, 0.35);
        border: 1px solid rgba(0, 242, 254, 0.25);
        border-radius: 8px;
        padding: 10px;
      }
      .convergence-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 8px;
      }
      .convergence-tag {
        font-size: 0.72rem;
        font-weight: 800;
        color: var(--accent-cyan);
      }
      .receptor-state-badge {
        font-size: 0.65rem;
        font-weight: 800;
        padding: 2px 6px;
        border-radius: 4px;
        text-transform: uppercase;
      }
      .state-agonism {
        background: rgba(0, 242, 254, 0.15);
        color: #00f2fe;
        border: 1px solid rgba(0, 242, 254, 0.35);
      }
      .state-antagonism {
        background: rgba(255, 75, 114, 0.15);
        color: #ff4b72;
        border: 1px solid rgba(255, 75, 114, 0.35);
      }
      .state-balanced {
        background: rgba(192, 132, 252, 0.15);
        color: #c084fc;
        border: 1px solid rgba(192, 132, 252, 0.35);
      }
      .saturation-pool-wrap {
        margin-bottom: 8px;
      }
      .saturation-pool-bar {
        width: 100%;
        height: 6px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 3px;
        overflow: hidden;
        margin-top: 3px;
      }
      .saturation-pool-fill {
        height: 100%;
        border-radius: 3px;
      }
      .gauge-container {
        margin: 8px 0;
      }
      .gauge-title-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
      }
      .gauge-value-readout {
        font-family: 'JetBrains Mono', monospace;
        font-weight: 800;
        font-size: 0.8rem;
      }
      .gauge-track-wrap {
        position: relative;
        width: 100%;
        height: 8px;
        background: linear-gradient(90deg, #ff4b72 0%, #64748b 50%, #00f2fe 100%);
        border-radius: 4px;
        margin: 5px 0 2px;
      }
      .gauge-center-notch {
        position: absolute;
        left: 50%;
        top: -2px;
        bottom: -2px;
        width: 2px;
        background: #fff;
        transform: translateX(-50%);
      }
      .gauge-marker {
        position: absolute;
        top: -4px;
        width: 6px;
        height: 16px;
        background: #fff;
        border: 2px solid;
        border-radius: 3px;
        transform: translateX(-50%);
        transition: left 0.3s ease;
      }
      .gauge-labels {
        display: flex;
        justify-content: space-between;
        font-size: 0.6rem;
        color: var(--text-muted);
      }
      .compound-influence-list {
        display: flex;
        flex-direction: column;
        gap: 6px;
        margin-top: 8px;
      }
      .compound-card {
        padding: 6px 8px;
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid var(--border-subtle);
        border-radius: 6px;
      }
      .compound-row-top {
        display: flex;
        justify-content: space-between;
        align-items: center;
      }
      .compound-row-title {
        font-size: 0.74rem;
        font-weight: 700;
        color: #fff;
        display: flex;
        align-items: center;
        gap: 5px;
      }
      .compound-action-pill {
        font-size: 0.62rem;
        font-weight: 800;
        padding: 1px 5px;
        border-radius: 3px;
      }
      .pill-agonist {
        background: rgba(0, 242, 254, 0.15);
        color: #00f2fe;
      }
      .pill-antagonist {
        background: rgba(255, 75, 114, 0.15);
        color: #ff4b72;
      }
      .pill-modulator {
        background: rgba(245, 158, 11, 0.15);
        color: #f59e0b;
      }
      .occupancy-bar-wrap {
        display: flex;
        align-items: center;
        gap: 6px;
        font-size: 0.68rem;
      }
      .occupancy-track {
        flex: 1;
        height: 6px;
        background: rgba(255, 255, 255, 0.08);
        border-radius: 3px;
        overflow: hidden;
      }
      .occupancy-fill {
        height: 100%;
        border-radius: 3px;
      }
      .mechanism-summary-card {
        margin-top: 8px;
        padding: 8px;
        background: rgba(0, 0, 0, 0.3);
        border: 1px solid var(--border-subtle);
        border-radius: 6px;
        font-size: 0.72rem;
        color: var(--text-secondary);
        line-height: 1.4;
      }
      
      /* GLOBAL SLIM LOADING BAR */
      .slim-loading-bar {
        position: fixed;
        top: 0;
        left: 0;
        height: 3px;
        background: linear-gradient(90deg, #00f2fe, #4facfe, #00f2fe);
        background-size: 200% 100%;
        width: 100%;
        z-index: 9999;
        animation: slimLoad 1.5s infinite linear;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s;
      }
      .slim-loading-bar.active {
        opacity: 1;
        visibility: visible;
      }
      @keyframes slimLoad {
        0% { background-position: 100% 0; }
        100% { background-position: -100% 0; }
      }

      /* SAFETY LAB COMPOUND LOADING INDICATORS */
      .search-input-wrapper {
        position: relative;
      }
      .search-input-spinner {
        position: absolute;
        right: 12px;
        top: 50%;
        transform: translateY(-50%);
        display: flex;
        align-items: center;
        justify-content: center;
        pointer-events: none;
        z-index: 5;
      }
      .stack-item-loading-card {
        padding: 12px 14px;
        background: rgba(0, 242, 254, 0.04);
        border: 1px dashed rgba(0, 242, 254, 0.35);
        border-radius: var(--radius-sm);
        margin-bottom: 8px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        animation: pulseLoadingCard 1.4s infinite alternate ease-in-out;
      }
      @keyframes pulseLoadingCard {
        0% { border-color: rgba(0, 242, 254, 0.25); background: rgba(0, 242, 254, 0.03); }
        100% { border-color: rgba(0, 242, 254, 0.55); background: rgba(0, 242, 254, 0.08); }
      }
      .stack-eval-indicator {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        font-size: 0.72rem;
        font-weight: 600;
        color: var(--accent-cyan);
        background: rgba(0, 242, 254, 0.08);
        border: 1px solid rgba(0, 242, 254, 0.25);
        border-radius: 9999px;
        padding: 2px 8px;
        margin-left: 8px;
        vertical-align: middle;
      }
      .embedded-graph-loading-overlay {
        position: absolute;
        inset: 0;
        background: rgba(5, 8, 17, 0.84);
        backdrop-filter: blur(4px);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 12px;
        z-index: 20;
        font-size: 0.82rem;
        color: var(--text-secondary);
        font-family: 'JetBrains Mono', monospace;
        transition: opacity 0.2s ease;
      }
      .embedded-graph-loading-overlay.hidden {
        display: none !important;
      }