        :root {
            --color-error:   #e74c3c;
            --color-success: #2ecc71;
            --color-warning: #f39c12;
            --color-info:    #3498db;
            --color-muted:   rgba(255,255,255,0.5);
        }
        * { margin: 0; padding: 0; box-sizing: border-box; }
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            min-height: 100vh;
            background: linear-gradient(135deg, #5a55a6 0%, #3e3a7a 100%);
            color: #fff;
        }
        html {
            overflow-y: scroll;
        }
        /* ── Sticky nav wrapper ── */
        #nav-sticky {
            position: sticky;
            top: 0;
            z-index: 100;
            backdrop-filter: blur(12px);
            background: rgba(52, 48, 108, 0.9);
            box-shadow: 0 2px 12px rgba(0,0,0,0.2);
        }
        .mode-selector {
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 0.4rem;
            padding: 0.5rem 1rem 0.6rem;
        }
        /* Spring spacers between tab-groups (injected by JS) */
        .tab-spring {
            flex: 1 0 0;
            max-width: 2.5rem;
            min-width: 0.4rem;
            height: 1px;
            /* animate flex-basis for spring feel */
            transition: max-width 0.55s cubic-bezier(0.34, 1.56, 0.64, 1),
                        min-width  0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
        }
        /* Phantom: force last row to NOT stretch to full width */
        .tab-spring-end {
            flex: 100 0 0;
            height: 1px;
        }
        /* Spring bounce on reflow */
        @keyframes navSpringIn {
            0%   { transform: scaleX(0.96) translateZ(0); }
            100% { transform: scaleX(1)    translateZ(0); }
        }
        .tab-group.spring-bounce {
            animation: navSpringIn 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
        }
        .tab-group {
            display: inline-flex;
            align-items: center;
            gap: 0.3rem;
            white-space: nowrap;
            flex-shrink: 0;
        }
        .mode-btn {
            background: rgba(255, 255, 255, 0.1);
            border: 2px solid rgba(255, 255, 255, 0.2);
            color: #fff;
            padding: 0.6rem 1.2rem;
            border-radius: 8px;
            font-size: 0.9rem;
            cursor: pointer;
            transition: all 0.2s;
            font-weight: 500;
        }
        .mode-btn:hover {
            background: rgba(255, 255, 255, 0.2);
        }
        .mode-btn.active {
            background: rgba(255, 255, 255, 0.25);
            border-color: rgba(255, 255, 255, 0.6);
        }
        .tab-new-dot {
            display: inline-block;
            width: 7px;
            height: 7px;
            border-radius: 50%;
            background: #2ecc71;
            margin-left: 5px;
            vertical-align: middle;
            flex-shrink: 0;
            animation: tab-dot-pulse 2s ease-in-out infinite;
        }
        @keyframes tab-dot-pulse {
            0%, 100% { opacity: 1; transform: scale(1); }
            50%       { opacity: 0.5; transform: scale(0.75); }
        }
        /* ── Nav info bar & health badge ── */
        .nav-info-bar {
            text-align: left;
            font-size: 0.75rem;
            opacity: 0.45;
            padding: 0 1rem 0.4rem;
            display: flex;
            align-items: center;
            gap: 0.6rem;
        }
        #health-badge {
            font-size: 0.72rem;
            padding: 0.15rem 0.55rem;
            border-radius: 10px;
            background: rgba(255,255,255,0.1);
            color: rgba(255,255,255,0.6);
        }

        /* ── Login form ── */
        .login-form {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 0.6rem;
            width: 320px;
        }
        .login-row {
            display: flex;
            gap: 0.5rem;
            width: 100%;
            margin-top: 0.5rem;
        }
        .login-input {
            flex: 1;
            padding: 0.55rem 1rem;
            border-radius: 8px;
            border: 2px solid rgba(255,255,255,0.3);
            background: rgba(255,255,255,0.1);
            color: #fff;
            font-size: 0.9rem;
        }
        .login-input::placeholder { color: rgba(255,255,255,0.5); }
        .login-input:focus { outline: none; border-color: rgba(255,255,255,0.6); }
        .login-submit-btn {
            padding: 0.55rem 1rem;
            border-radius: 8px;
            border: 2px solid rgba(255,255,255,0.3);
            background: rgba(255,255,255,0.15);
            color: #fff;
            font-size: 1.2rem;
            cursor: pointer;
            line-height: 1;
        }
        .login-submit-btn:hover { background: rgba(255,255,255,0.25); }
        #login-error {
            font-size: 0.82rem;
            color: #ff7675;
            min-height: 1.2em;
        }

        /* ── Home empty state ── */
        .home-welcome-text {
            opacity: 0.55;
            font-size: 1.05rem;
            margin-bottom: 1.5rem;
            letter-spacing: 0.03em;
        }

        /* ── Utility: text colors ── */
        .text-error   { color: var(--color-error); }
        .text-success { color: var(--color-success); }
        .text-warning { color: var(--color-warning); }
        .text-muted   { color: var(--color-muted); }

        /* ── Utility: placeholder / empty-state ── */
        .placeholder-text {
            opacity: 0.5;
            padding: 0.5rem;
            font-size: 0.82rem;
        }
        .empty-state {
            text-align: center;
            padding: 1rem;
            opacity: 0.5;
        }
        .instr-loading.error { color: var(--color-error); }
        .content {
            max-width: 900px;
            margin: 0 auto;
            padding: 0 1rem 2rem;
        }
        .section {
            display: none;
        }
        .section.active {
            display: block;
        }
        .section-title {
            font-size: 1rem;
            font-weight: 500;
            margin-bottom: 0.75rem;
            padding-left: 0.5rem;
            opacity: 0.9;
        }
        .endpoints-card {
            background: rgba(0, 0, 0, 0.18);
            border-radius: 12px;
            padding: 16px;
            backdrop-filter: blur(10px);
            margin-bottom: 20px;
            transition: transform 120ms, box-shadow 120ms;
        }
        .endpoints-card:hover {
            transform: translateY(-1px);
            box-shadow: 0 6px 16px rgba(0,0,0,0.25);
        }
        .endpoint {
            padding: 0.6rem 0;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }
        .endpoint:last-child {
            border-bottom: none;
        }
        .endpoint-row {
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        .endpoint-method {
            display: inline-block;
            padding: 0.15rem 0.4rem;
            border-radius: 4px;
            font-size: 0.7rem;
            font-weight: 600;
            min-width: 36px;
            text-align: center;
        }
        .method-get { background: #61affe; color: #000; }
        .method-post { background: #49cc90; color: #000; }
        .method-put { background: #fca130; color: #000; }
        .method-patch { background: #50e3c2; color: #000; }
        .method-delete { background: #f93e3e; color: #fff; }
        .endpoint-path {
            font-family: 'Courier New', monospace;
            font-size: 0.85rem;
            color: #a8d5ff;
            text-decoration: none;
            flex: 1;
        }
        a.endpoint-path:hover {
            text-decoration: underline;
        }
        .endpoint-desc {
            font-size: 0.8rem;
            opacity: 0.7;
            padding-left: 44px;
            margin-top: 0.2rem;
        }
        .btn, .action-btn {
            background: rgba(255, 255, 255, 0.15);
            border: 1px solid rgba(255, 255, 255, 0.25);
            color: #fff;
            padding: 0.3rem 0.6rem;
            border-radius: 5px;
            font-size: 0.75rem;
            cursor: pointer;
            transition: all 0.15s;
        }
        .tg-edit-form {
            display: none;
            flex-direction: column;
            gap: 6px;
            padding: 0.5rem 0;
        }
        .tg-edit-help {
            font-size: 0.75rem;
            color: rgba(255,255,255,0.58);
            line-height: 1.35;
        }
        .btn:hover, .action-btn:hover {
            background: rgba(255, 255, 255, 0.25);
        }
        .input-area {
            display: none;
            margin-top: 0.5rem;
            padding-left: 44px;
        }
        .input-area.active {
            display: block;
        }
        .input-row {
            display: flex;
            gap: 0.4rem;
            margin-bottom: 0.4rem;
        }
        .input-field {
            flex: 1;
            padding: 0.4rem 0.6rem;
            border-radius: 5px;
            border: 1px solid rgba(255, 255, 255, 0.25);
            background: rgba(255, 255, 255, 0.1);
            color: #fff;
            font-size: 0.8rem;
            font-family: 'Courier New', monospace;
        }
        .input-field::placeholder {
            color: rgba(255, 255, 255, 0.4);
        }
        textarea.input-field {
            width: 100%;
            resize: vertical;
        }
        .response-box {
            margin-top: 0.4rem;
            padding: 0.5rem;
            border-radius: 5px;
            background: rgba(0, 0, 0, 0.3);
            font-family: 'Courier New', monospace;
            font-size: 0.7rem;
            max-height: 180px;
            overflow-y: auto;
            display: none;
            white-space: pre-wrap;
            word-wrap: break-word;
        }
        .response-box.active {
            display: block;
        }
        .no-debug {
            text-align: center;
            padding: 3rem 1rem;
            opacity: 0.7;
        }

        /* Tab group labels */
        .tab-group-label {
            display: inline-flex;
            align-items: center;
            font-size: 0.82rem;
            font-weight: 700;
            letter-spacing: 0.07em;
            text-transform: uppercase;
            opacity: 0.6;
            padding: 0.4rem 0.5rem 0.4rem 0.3rem;
            cursor: pointer;
            color: #fff;
            user-select: none;
            border-radius: 5px;
            transition: opacity 0.15s, background 0.15s;
        }
        .tab-group-label:hover { opacity: 0.9; }
        .tab-group-label::before { content: '▾ '; font-size: 0.7rem; opacity: 0.8; }
        .tab-group-label.collapsed::before { content: '▸ '; }
        /* Collapsed group gets a dark sunken look to signal hidden content */
        .tab-group:has(.tab-group-label.collapsed) {
            background: rgba(0, 0, 0, 0.2);
            border-radius: 8px;
            padding: 0 0.3rem;
            box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);
        }
        .tab-group:has(.tab-group-label.collapsed) .tab-group-label {
            opacity: 0.5;
        }
        /* Dot always present to avoid layout shift — transparent by default */
        .tab-group-label::after {
            content: '';
            display: inline-block;
            width: 5px;
            height: 5px;
            border-radius: 50%;
            background: transparent;
            margin-left: 0.3rem;
            vertical-align: middle;
            transition: background 0.15s, box-shadow 0.15s;
        }
        /* Group label accent when a tab from this group is active */
        .tab-group:has(.mode-btn.active) .tab-group-label {
            opacity: 1;
        }
        .tab-group:has(.mode-btn.active) .tab-group-label::after {
            background: rgba(255, 255, 255, 0.85);
            box-shadow: 0 0 4px rgba(255,255,255,0.6);
        }
        /* Collapsed + has active tab: override the dim, keep the dot visible */
        .tab-group:has(.tab-group-label.collapsed):has(.mode-btn.active) .tab-group-label {
            opacity: 0.9;
        }
        /* Telegram panel styles */
        .tg-toolbar { display: flex; gap: 0.5rem; margin-bottom: 0.75rem; }
        .tg-channel { background: rgba(0,0,0,0.2); border-radius: 6px; padding: 0.75rem; margin-bottom: 0.75rem; }
        .tg-channel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
        .tg-channel-name { font-weight: 600; font-size: 0.95rem; }
        .tg-channel-id { font-family: monospace; font-size: 0.75rem; opacity: 0.6; }
        .tg-status { margin: 0.5rem 0; }
        .tg-status-row { display: flex; gap: 0.5rem; align-items: center; font-size: 0.85rem; margin: 0.25rem 0; }
        .tg-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
        .tg-dot.ok { background: #2ecc71; }
        .tg-dot.err { background: #e74c3c; }
        .tg-dot.warn { background: #f39c12; }
        .tg-dot.unknown { background: #95a5a6; }
        .tg-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.5rem; }
        .tg-error { color: #e74c3c; font-size: 0.8rem; margin-top: 0.3rem; }
        .tg-webhook-url { font-family: monospace; font-size: 0.75rem; color: #a8d5ff; word-break: break-all; }
        .tg-commands-list { font-size: 0.8rem; opacity: 0.8; }

        .model-config-panel { padding: 0.5rem 0; }
        .model-status { margin-bottom: 1rem; padding: 0.5rem; background: rgba(0,0,0,0.2); border-radius: 6px; }
        .model-row { display: flex; align-items: center; gap: 0.5rem; margin: 0.3rem 0; }
        .model-label { font-weight: 500; min-width: 100px; }
        .model-controls { margin-top: 0.5rem; }
        .model-select { flex: 1; padding: 0.4rem; border-radius: 5px; border: 1px solid rgba(255,255,255,0.25); background: rgba(47, 42, 85, 0.9); color: #f0f0ff; font-size: 0.85rem; }
        .model-select option { background: #2f2a55; color: #f0f0ff; }
        .model-buttons { display: flex; gap: 0.5rem; margin-top: 0.5rem; }

        /* Instructions panel styles */
        .instr-panel { padding: 0.5rem 0; }
        .instr-toolbar { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 0.75rem; flex-wrap: wrap; }
        .instr-toolbar label { display: flex; align-items: center; gap: 0.3rem; font-size: 0.85rem; color: rgba(255,255,255,0.8); }
        .instr-list { }
        .instr-item { background: rgba(0,0,0,0.2); border-radius: 6px; padding: 0.6rem; margin-bottom: 0.5rem; }
        .instr-item.inactive { opacity: 0.5; }
        .instr-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.5rem; }
        .instr-key { font-family: monospace; font-size: 0.85rem; color: #4ecdc4; font-weight: 600; }
        .instr-title { font-size: 0.9rem; color: #fff; margin: 0.2rem 0; }
        .instr-meta { font-size: 0.75rem; color: rgba(255,255,255,0.6); display: flex; gap: 1rem; flex-wrap: wrap; }
        .instr-badge { padding: 0.15rem 0.4rem; border-radius: 4px; font-size: 0.7rem; font-weight: 600; }
        .instr-badge.importance-0 { background: #e74c3c; color: #fff; }
        .instr-badge.importance-1 { background: #f39c12; color: #000; }
        .instr-badge.importance-2 { background: #3498db; color: #fff; }
        .instr-badge.importance-3 { background: #95a5a6; color: #fff; }
        .instr-badge.inactive { background: #7f8c8d; color: #fff; }
        .instr-actions { display: flex; gap: 0.3rem; }
        .instr-btn { padding: 0.2rem 0.5rem; font-size: 0.75rem; cursor: pointer; border: none; border-radius: 4px; background: rgba(255,255,255,0.15); color: #fff; }
        .instr-btn:hover { background: rgba(255,255,255,0.25); }
        .instr-btn.delete { color: #e74c3c; }
        .instr-content-preview { font-size: 0.8rem; color: rgba(255,255,255,0.7); margin-top: 0.4rem; white-space: pre-wrap; max-height: 60px; overflow: hidden; background: rgba(0,0,0,0.2); padding: 0.3rem 0.5rem; border-radius: 4px; }
        .instr-loading { text-align: center; padding: 1rem; color: rgba(255,255,255,0.6); }
        .instr-form-card { margin-top: 0.75rem; }
        .instr-form { padding: 0.5rem 0; }
        .form-row { display: flex; align-items: center; gap: 0.5rem; margin: 0.4rem 0; }
        .form-row label { min-width: 90px; font-size: 0.85rem; }
        .instr-input, .instr-select { flex: 1; padding: 0.4rem; border-radius: 5px; border: 1px solid rgba(255,255,255,0.25); background: rgba(255,255,255,0.1); color: #fff; font-size: 0.85rem; }
        .instr-input::placeholder, .instr-textarea::placeholder { color: rgba(255,255,255,0.45); }
        .instr-select option { background: #2f2a55; color: #f0f0ff; }
        .instr-textarea { width: 100%; padding: 0.4rem; border-radius: 5px; border: 1px solid rgba(255,255,255,0.25); background: rgba(255,255,255,0.1); color: #fff; font-size: 0.85rem; font-family: monospace; resize: vertical; }
        .instr-stats { background: rgba(0,0,0,0.3); padding: 0.5rem 0.75rem; border-radius: 6px; margin-bottom: 0.75rem; display: flex; gap: 1.5rem; flex-wrap: wrap; font-size: 0.85rem; }
        .instr-warning { color: #e74c3c; font-weight: 600; }
        .instr-tag { background: rgba(78, 205, 196, 0.3); color: #4ecdc4; padding: 0.1rem 0.4rem; border-radius: 3px; font-size: 0.75rem; margin-right: 0.2rem; font-family: monospace; }
        .instr-item.fits { border-left: 3px solid #2ecc71; }
        .instr-item.overflow { border-left: 3px solid #e74c3c; }
        .fit-status { font-size: 0.9rem; }

        /* Global select styling */
        select, .model-select, .instr-select {
            font-size: 14px;
            padding: 8px 12px;
            background: rgba(47, 42, 85, 0.9);
            border: 1px solid rgba(255,255,255,0.15);
            color: #f0f0ff;
            border-radius: 6px;
        }
        select:hover { background: rgba(58, 53, 102, 0.9); }
        select option { background: #2f2a55; color: #f0f0ff; padding: 6px 10px; }

        /* .btn-sm — compact button variant */
        .btn-sm {
            font-size: 0.8rem;
            padding: 0.3rem 0.8rem;
        }

        /* Button semantic variants (apply to both .btn and .action-btn) */
        .btn.primary, .action-btn.primary {
            background: #6f7bff;
            border-color: #6f7bff;
            color: #fff;
            font-weight: 600;
        }
        .btn.primary:hover, .action-btn.primary:hover { background: #5a66ee; }

        .btn.danger, .action-btn.danger {
            background: rgba(255, 95, 109, 0.15);
            border-color: #ff5f6d;
            color: #ff5f6d;
        }
        .btn.danger:hover, .action-btn.danger:hover { background: rgba(255, 95, 109, 0.3); }

        /* Unified tag style */
        .tag {
            display: inline-block;
            font-size: 11px;
            padding: 2px 6px;
            border-radius: 6px;
            background: rgba(255,255,255,0.1);
            color: rgba(255,255,255,0.8);
            margin-right: 3px;
        }



        /* Login screen centering */
        #login-area {
            padding: 0.5rem 1rem 1rem;
            min-height: 60vh;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .login-card {
            background: rgba(255,255,255,0.05);
            padding: 24px;
            border-radius: 12px;
            border: 1px solid rgba(255,255,255,0.1);
            min-width: 300px;
            text-align: center;
            animation: slideInRight 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.1s both;
        }
        @keyframes slideInRight {
            from { transform: translateX(80px); opacity: 0; }
            to   { transform: translateX(0);    opacity: 1; }
        }

        /* Home empty state — slide up from below */
        #home-empty-state {
            animation: slideUpIn 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
        }
        @keyframes slideUpIn {
            from { transform: translateY(50px); opacity: 0; }
            to   { transform: translateY(0);    opacity: 1; }
        }

        @keyframes homeFaceFloat {
            0%, 100% { transform: translateY(0) scale(1); }
            50% { transform: translateY(-10px) scale(1.02); }
        }
        @keyframes homeOrbitSpin {
            from { transform: rotate(0deg); }
            to { transform: rotate(360deg); }
        }
        #home-empty-state {
            min-height: 420px;
        }
        .home-face-stage {
            position: relative;
            width: 280px;
            height: 280px;
            margin: 0 auto;
            display: grid;
            place-items: center;
        }
        .home-face-hero {
            position: relative;
            z-index: 2;
            font-size: 7.5rem;
            line-height: 1;
            filter: drop-shadow(0 10px 30px rgba(0,0,0,0.2));
            animation: homeFaceFloat 3.2s ease-in-out infinite;
            user-select: none;
        }
        .home-face-orbit {
            position: absolute;
            inset: 0;
            animation: homeOrbitSpin 22s linear infinite;
        }
        .home-face-orbit span {
            position: absolute;
            left: 50%;
            top: 50%;
            width: 2.2rem;
            margin-left: -1.1rem;
            margin-top: -1.1rem;
            font-size: 2.2rem;
            line-height: 1;
            opacity: 0.82;
            user-select: none;
        }
        .home-face-orbit span.ghost {
            opacity: 0;
            pointer-events: none;
        }
        .home-face-orbit span:nth-child(1)  { transform: rotate(0deg) translateY(-122px); font-size: 2.55rem; }
        .home-face-orbit span:nth-child(2)  { transform: rotate(24deg) translateY(-122px); font-size: 1.95rem; }
        .home-face-orbit span:nth-child(3)  { transform: rotate(48deg) translateY(-122px); font-size: 2.25rem; }
        .home-face-orbit span:nth-child(4)  { transform: rotate(72deg) translateY(-122px); }
        .home-face-orbit span:nth-child(5)  { transform: rotate(96deg) translateY(-122px); font-size: 2.1rem; }
        .home-face-orbit span:nth-child(6)  { transform: rotate(120deg) translateY(-122px); font-size: 1.85rem; }
        .home-face-orbit span:nth-child(7)  { transform: rotate(144deg) translateY(-122px); }
        .home-face-orbit span:nth-child(8)  { transform: rotate(168deg) translateY(-122px); font-size: 2.35rem; }
        .home-face-orbit span:nth-child(9)  { transform: rotate(192deg) translateY(-122px); font-size: 2rem; }
        .home-face-orbit span:nth-child(10) { transform: rotate(216deg) translateY(-122px); }
        .home-face-orbit span:nth-child(11) { transform: rotate(240deg) translateY(-122px); font-size: 2.3rem; }
        .home-face-orbit span:nth-child(12) { transform: rotate(264deg) translateY(-122px); }
        .home-face-orbit span:nth-child(13) { transform: rotate(288deg) translateY(-122px); }
        .home-face-orbit span:nth-child(14) { transform: rotate(312deg) translateY(-122px); }
        .home-face-orbit span:nth-child(15) { transform: rotate(336deg) translateY(-122px); }

        /* DB row count history slots */
        .db-count-slots {
            display: flex;
            align-items: baseline;
            gap: 0.4rem;
        }
        .db-count-slot-0 { font-weight: 700; color: #fff; font-size: 0.9rem; }
        .db-count-slot-1 { color: rgba(255,255,255,0.45); font-size: 0.78rem; text-decoration: line-through; }
        .db-count-slot-2 { color: rgba(255,255,255,0.22); font-size: 0.7rem;  text-decoration: line-through; }

        /* ── Tests / Simulation layout ── */
        #section-tests {
            position: relative;
            z-index: 10;
            overflow: visible;
            /* Break out of .content max-width:900px — tests section uses full viewport */
            width: 100vw;
            margin-left: calc(-50vw + 50% - 1rem);
            box-sizing: border-box;
            padding-left: 376px;
            padding-right: 88px;
        }
        .sim-tests-stack {
            display: flex;
            flex-direction: column;
            gap: 0.9rem;
        }
        .sim-scenario-rail {
            position: fixed;
            left: -8px;
            top: var(--sim-sticky-top, 158px);
            width: 360px;
            max-width: 360px;
            max-height: calc(100vh - var(--sim-sticky-top, 158px) - 16px);
            overflow-y: auto;
            scrollbar-width: thin;
            z-index: 20;
            background: rgba(83, 76, 166, 0.96);
            border-radius: 14px;
            padding: 68px 16px 16px;
            box-shadow: 0 16px 40px rgba(0,0,0,0.18);
        }
        .sim-rail-header {
            display: flex;
            gap: 0.3rem;
            align-items: center;
            position: fixed;
            left: -8px;
            top: 10px;
            width: 360px;
            z-index: 130;
            padding: 12px 16px 10px;
            margin-bottom: 0;
            border-bottom: 1px solid rgba(255,255,255,0.1);
            background: rgba(83, 76, 166, 0.98);
            border-radius: 14px 14px 0 0;
            box-shadow: 0 10px 28px rgba(0,0,0,0.16);
        }
        .sim-run-all-fab {
            position: fixed;
            left: 18px;
            top: max(var(--sim-sticky-top, 158px), 118px);
            z-index: 130;
            display: flex;
            flex-direction: column;
            gap: 0.4rem;
        }
        .sim-sc-tag {
            appearance: none;
            -webkit-appearance: none;
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            gap: 0.45rem;
            width: 100%;
            padding: 0.9rem 0.95rem;
            border-radius: 12px;
            border: 1px solid transparent;
            background: rgba(255,255,255,0.06);
            color: rgba(255,255,255,0.82);
            font-size: 0.82rem;
            text-align: left;
            cursor: pointer;
            margin-bottom: 0.55rem;
            transition: background 0.15s, border-color 0.15s, color 0.15s;
        }
        .sim-sc-tag:hover {
            background: rgba(255,255,255,0.1);
            color: rgba(255,255,255,0.9);
        }
        .sim-sc-tag.active {
            background: rgba(255,255,255,0.15);
            border-color: rgba(255,255,255,0.25);
            color: #fff;
        }
        .sim-sc-dot {
            width: 6px; height: 6px;
            border-radius: 50%;
            flex-shrink: 0;
            background: #666;
        }
        .sim-sc-dot.passed  { background: #2ecc71; }
        .sim-sc-dot.failed  { background: #e74c3c; }
        .sim-sc-dot.error   { background: #c0392b; }
        .sim-sc-dot.running { background: #f39c12; animation: pulse 1s ease-in-out infinite; }
        @keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }

        /* sim-controls: glass panel wrapping Run All + Refresh */
        .sim-controls {
            display: flex;
            gap: 0.6rem;
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            background: rgba(255,255,255,0.08);
            border: 1px solid rgba(255,255,255,0.12);
            border-radius: 10px;
            padding: 0.35rem 0.45rem;
        }
        .sim-controls button {
            appearance: none;
            -webkit-appearance: none;
            background: rgba(255,255,255,0.12);
            border: 1px solid rgba(255,255,255,0.18);
            border-radius: 7px;
            padding: 0.35rem 0.7rem;
            font-size: 0.8rem;
            color: #fff;
            cursor: pointer;
            transition: background 0.15s;
        }
        .sim-controls button:hover {
            background: rgba(255,255,255,0.2);
        }

        .sim-view-tabs {
            position: fixed;
            right: -4px;
            top: max(var(--sim-sticky-top, 158px), 118px);
            display: flex;
            flex-direction: column;
            gap: 0.4rem;
            z-index: 130;
        }
        .sim-view-tab {
            appearance: none;
            -webkit-appearance: none;
            display: block;
            padding: 0.35rem 0.7rem;
            border-radius: 6px;
            border: 1px solid rgba(255,255,255,0.12);
            background: rgba(255,255,255,0.05);
            color: rgba(255,255,255,0.55);
            font-size: 0.75rem;
            cursor: pointer;
            white-space: nowrap;
            transition: all 0.15s;
            text-align: center;
        }
        .sim-view-tab:hover { background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.85); }
        .sim-view-tab.active {
            background: rgba(255,255,255,0.18);
            border-color: rgba(255,255,255,0.3);
            color: #fff;
            font-weight: 600;
        }
        /* sim-run-btn: green Run button inside scenario detail header */
        .sim-run-btn {
            background: #27ae60;
            border: none;
            border-radius: 8px;
            padding: 0.45rem 0.9rem;
            font-size: 0.85rem;
            color: #fff;
            cursor: pointer;
            white-space: nowrap;
            transition: background 0.15s;
        }
        .sim-run-btn:hover { background: #229954; }

        /* sim-test-row: two-column header inside scenario detail panel */
        .sim-test-row {
            display: flex;
            align-items: flex-start;
            gap: 1rem;
        }
        .sim-test-body {
            flex: 1;
        }
        .sim-test-actions {
            flex: 0 0 auto;
            display: flex;
            align-items: center;
            gap: 0.4rem;
        }
        .sim-run-shell {
            background: rgba(0,0,0,0.15);
            border-radius: 8px;
            padding: 0.75rem;
            min-height: 520px;
            overflow-y: auto;
        }
        .sim-run-shell-main {
            min-height: 680px;
        }
        #sim-run-area {
            margin-left: 32px;
        }
        #section-tests .section-title {
            margin-left: 32px;
        }
        .sim-export-panel {
            background: rgba(0,0,0,0.16);
            border-radius: 10px;
            border: 1px solid rgba(255,255,255,0.08);
            padding: 0;  /* reset — body handles padding */
        }
        .sim-export-dock {
            position: fixed;
            right: 0;
            bottom: 0;
            width: 344px;
            max-width: min(344px, calc(100vw - 340px));
            z-index: 5;
            box-shadow: 0 16px 38px rgba(0,0,0,0.22);
            transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
        }
        .sim-export-dock.sim-export-collapsed {
            transform: translateX(calc(100% - 28px));
        }
        .sim-export-dock.sim-export-has-new .sim-export-collapse-tab {
            background: rgba(46,204,113,0.18);
            border-color: rgba(46,204,113,0.4);
            animation: sim-pulse-handle 1.8s ease-in-out infinite;
        }
        @keyframes sim-pulse-handle {
            0%, 100% { background: rgba(46,204,113,0.18); }
            50%       { background: rgba(46,204,113,0.32); }
        }
        .sim-export-collapse-tab {
            position: absolute;
            left: 0;
            top: 0;
            bottom: 0;
            width: 28px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 6px;
            cursor: pointer;
            background: rgba(255,255,255,0.04);
            border: none;
            border-right: 1px solid rgba(255,255,255,0.09);
            border-radius: 10px 0 0 10px;
            padding: 0;
            color: rgba(255,255,255,0.55);
            font-size: 0.85rem;
            line-height: 1;
            transition: background 0.15s;
        }
        .sim-export-collapse-tab:hover {
            background: rgba(111,123,255,0.15);
            color: rgba(255,255,255,0.85);
        }
        .sim-export-tab-label {
            writing-mode: vertical-rl;
            text-orientation: mixed;
            font-size: 0.58rem;
            text-transform: uppercase;
            letter-spacing: 0.07em;
            color: rgba(255,255,255,0.38);
        }
        .sim-export-body {
            padding: 0.7rem 0.7rem 0.7rem calc(28px + 0.55rem);
        }
        .sim-export-header {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 0.75rem;
            margin-bottom: 0.5rem;
        }
        .sim-export-title {
            font-size: 0.82rem;
            font-weight: 700;
            color: rgba(255,255,255,0.9);
            text-transform: uppercase;
            letter-spacing: 0.04em;
        }
        .sim-export-subtitle {
            margin-top: 0.15rem;
            font-size: 0.72rem;
            color: rgba(255,255,255,0.48);
        }
        .sim-export-controls {
            display: flex;
            flex-wrap: wrap;
            gap: 0.45rem 0.65rem;
            margin-bottom: 0.55rem;
            font-size: 0.72rem;
            color: rgba(255,255,255,0.76);
        }
        .sim-export-controls label {
            display: inline-flex;
            align-items: center;
            gap: 0.28rem;
        }
        .sim-export-controls input[type="number"] {
            width: 58px;
            padding: 0.15rem 0.3rem;
            border-radius: 5px;
            border: 1px solid rgba(255,255,255,0.18);
            background: rgba(255,255,255,0.08);
            color: #fff;
        }
        .sim-export-textarea {
            width: 100%;
            min-height: 220px;
            max-height: 280px;
            resize: none;
            border-radius: 8px;
            border: 1px solid rgba(255,255,255,0.12);
            background: rgba(7,7,12,0.72);
            color: rgba(255,255,255,0.88);
            padding: 0.75rem 0.85rem;
            font-size: 0.78rem;
            line-height: 1.5;
            font-family: 'Cascadia Code', 'Fira Mono', 'Courier New', monospace;
        }
        .sim-export-textarea:focus {
            outline: none;
            border-color: rgba(111,123,255,0.55);
            box-shadow: 0 0 0 1px rgba(111,123,255,0.22);
        }
        .sim-sc-head {
            display: flex;
            align-items: center;
            gap: 0.45rem;
            width: 100%;
        }
        .sim-sc-title {
            flex: 1;
            font-size: 0.9rem;
            font-weight: 700;
            line-height: 1.3;
        }
        .sim-sc-meta {
            display: flex;
            align-items: center;
            gap: 0.55rem;
            flex-wrap: wrap;
            width: 100%;
            font-size: 0.74rem;
            color: rgba(255,255,255,0.74);
        }
        .sim-sc-status {
            padding: 0.18rem 0.52rem;
            border-radius: 999px;
            font-size: 0.78rem;
            font-weight: 700;
            text-transform: uppercase;
        }
        .sim-sc-status.idle    { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.74); }
        .sim-sc-status.passed  { background: #2ecc71; color: #fff; }
        .sim-sc-status.failed,
        .sim-sc-status.error   { background: #e74c3c; color: #fff; }
        .sim-sc-status.running { background: #f39c12; color: #fff; }
        .sim-sc-status.pending { background: #95a5a6; color: #fff; }
        .sim-sc-score {
            font-weight: 700;
        }
        .sim-run-body {
            margin-top: 0.6rem;
        }
        .sim-run-collapsed .sim-run-body {
            display: none;
        }
        .sim-run-toggle {
            background: transparent;
            border: none;
            color: rgba(255,255,255,0.72);
            cursor: pointer;
            font-size: 0.9rem;
            padding: 0;
            line-height: 1;
        }



        /* User checkboxes for bulk actions */
        .user-checkbox {
            width: 16px;
            height: 16px;
            accent-color: #6f7bff;
            cursor: pointer;
            flex-shrink: 0;
        }

        #users-bulk-toolbar {
            background: rgba(111,123,255,0.12);
            border: 1px solid rgba(111,123,255,0.3);
            border-radius: 8px;
            padding: 0.6rem 1rem;
            margin-bottom: 0.75rem;
            display: flex;
            align-items: center;
            gap: 0.75rem;
            flex-wrap: wrap;
        }
