:root {
    --bg-base: #0a0a0f;
    --bg-surface: #14141e;
    --bg-surface-elevated: #1e1e2d;
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.4);
    --secondary: #ec4899;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: #2e2e42;
    --success: #10b981;
    --warning: #f59e0b;
    --bg-card: #1e1e2d;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-base);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: row;
    /* changed for sidebar */
    overflow-x: hidden;
    position: relative;
}

/* Fancy Background Glows */
.glow-blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    z-index: 0;
    pointer-events: none;
    opacity: 0.6;
    animation: float 10s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
}

.glow-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, var(--primary-glow), transparent 70%);
}

.glow-2 {
    bottom: -20%;
    right: -10%;
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.3), transparent 70%);
    animation-delay: -5s;
}

@keyframes float {
    0% {
        transform: translateY(0) scale(1);
    }

    100% {
        transform: translateY(30px) scale(1.05);
    }
}

header {
    position: relative;
    z-index: 10;
    padding: 2rem;
    text-align: center;
    border-bottom: 1px solid var(--border);
    background: rgba(10, 10, 15, 0.7);
    backdrop-filter: blur(12px);
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(to right, #a5b4fc, #f9a8d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

main {
    position: relative;
    z-index: 10;
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    width: 100%;
}

@media (max-width: 900px) {
    main {
        grid-template-columns: 1fr;
    }
}

.card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    border-color: rgba(99, 102, 241, 0.3);
}

.card h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    color: #fff;
}

.card h2 span.step-badge {
    background: var(--primary);
    color: white;
    font-size: 0.9rem;
    padding: 0.2rem 0.6rem;
    border-radius: 8px;
    font-weight: 600;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

label {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.toggle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.view-toggle {
    display: flex;
    background: var(--bg-surface-elevated);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.view-toggle-btn {
    background: transparent;
    color: var(--text-muted);
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    cursor: pointer;
    box-shadow: none;
    border-radius: 0;
    margin: 0;
    border: none;
    display: inline-block;
}

.view-toggle-btn.active {
    background: var(--primary);
    color: white;
}

.view-toggle-btn:hover {
    transform: none;
    box-shadow: none;
}

.struct-builder {
    display: none;
    flex-direction: column;
    gap: 0.5rem;
    background: var(--bg-surface-elevated);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.struct-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.struct-row input,
.struct-row select {
    padding: 0.5rem;
    font-size: 0.9rem;
    flex: 1;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    color: white;
    border-radius: 4px;
}

.struct-row select {
    flex: 0.5;
}

.btn-small {
    padding: 0.5rem 0.8rem;
    font-size: 0.8rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    box-shadow: none;
    display: inline-flex;
    width: auto;
    flex: 0 0 auto;
}

.btn-small:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border-color: #ef4444;
    transform: none;
    box-shadow: none;
}

.btn-small.btn-add {
    justify-content: center;
    color: var(--success);
    border-color: var(--success);
}

.btn-small.btn-add:hover {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.training-item {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
}

.training-item h4 {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin: 0;
}

.training-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
}

.training-item-delete {
    margin: 0;
}

.training-sub-row {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    background: rgba(0, 0, 0, 0.15);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.training-sub-row label {
    font-size: 0.85rem;
    text-align: left;
    color: var(--primary);
    font-family: monospace;
    word-break: break-word;
}

.json-error {
    color: #ef4444;
    font-size: 0.8rem;
    margin-top: 0.2rem;
    display: none;
}

textarea.train-source-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    width: 100%;
    margin-top: 12px;
}

textarea,
input {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-main);
    padding: 1rem;
    font-size: 0.95rem;
    font-family: monospace;
    resize: vertical;
    transition: border-color 0.2s;
}

textarea:focus,
input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

button {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--primary-glow);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--primary-glow);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    background: #2e2e42;
    color: #6b7280;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.disabled-panel {
    position: relative;
    pointer-events: none;
}

.disabled-panel::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 15, 0.5);
    /* 50% opacity dark overlay mapping to background */
    border-radius: inherit;
    z-index: 20;
    pointer-events: all;
    cursor: not-allowed;
}

.run-badge {
    padding: 0.4rem 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.run-badge:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.run-badge.active {
    background: rgba(157, 78, 221, 0.2);
    border-color: var(--primary);
    color: var(--primary);
    font-weight: 600;
}

.loader {
    display: none;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Loaded Scenario Banner */
.loaded-scenario-banner {
    display: none;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
    padding: 0.8rem 1.2rem;
    border-radius: 10px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.3);
    animation: scenarioBannerIn 0.4s ease-out;
}

@keyframes scenarioBannerIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.loaded-scenario-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    flex-shrink: 0;
}

.loaded-scenario-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.loaded-scenario-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.loaded-scenario-name {
    font-size: 1rem;
    font-weight: 700;
    color: #a5b4fc;
}

/* Output tags */
.status-banner {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--success);
    color: var(--success);
    padding: 1rem;
    border-radius: 8px;
    font-weight: 600;
    display: none;
    align-items: center;
    gap: 0.5rem;
}

.function-id {
    font-family: monospace;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.results-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 1rem;
}

.score-card {
    background: var(--bg-surface-elevated);
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 4px solid var(--primary);
}

.score-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.score-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.8rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.score-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.score-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

pre {
    background: #000 !important;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 0.9rem;
    color: #a5b4fc;
}

.tab-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.tab {
    padding: 0.5rem 1rem;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
}

.tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.btn-delete-saved {
    padding: 0.2rem 0.2rem;
}

/* Num-results inline control */
.num-results-control {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.3rem 0.55rem 0.3rem 0.7rem;
    cursor: default;
    transition: border-color 0.2s;
}

.num-results-control:hover {
    border-color: rgba(99, 102, 241, 0.45);
}

.num-results-control label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
    cursor: default;
    white-space: nowrap;
}

.num-results-control select {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    font-size: 0.85rem;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    padding: 0.25rem 0.4rem;
    border-radius: 5px;
    cursor: pointer;
    appearance: auto;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.num-results-control select:hover {
    border-color: var(--primary);
}

.num-results-control select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
}

.num-results-control select option {
    background: var(--bg-card);
    color: var(--text-main);
}

/* Collapsible sections */
.collapse-toggle-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.25s ease;
    box-shadow: none;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.collapse-toggle-btn:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--primary);
    color: var(--text-main);
    transform: none;
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.2);
}

.collapse-toggle-btn .chevron {
    display: inline-block;
    transition: transform 0.3s ease;
    font-size: 0.7rem;
}

.collapse-toggle-btn.expanded .chevron {
    transform: rotate(90deg);
}

.collapsible-content {
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease;
    max-height: 0;
    opacity: 0;
}

.collapsible-content.expanded {
    max-height: 12000px;
    opacity: 1;
}

/* Ground Truth Comparison */
.gt-toggle-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    background: rgba(99, 102, 241, 0.06);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.gt-toggle-bar:hover {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.5);
}

.gt-toggle-bar.active {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--primary);
}

.gt-toggle-pill {
    width: 36px;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    position: relative;
    transition: background 0.25s;
    flex-shrink: 0;
}

.gt-toggle-pill::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
    transition: transform 0.25s;
}

.gt-toggle-bar.active .gt-toggle-pill {
    background: var(--primary);
}

.gt-toggle-bar.active .gt-toggle-pill::after {
    transform: translateX(16px);
}

.gt-comparison-panel {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.45s ease, opacity 0.3s ease;
}

.gt-comparison-panel.open {
    max-height: 4000px;
    opacity: 1;
}

.gt-col-header {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.4rem 0.8rem;
    border-radius: 6px 6px 0 0;
    text-align: center;
}

.gt-field-row {
    display: contents;
}

.gt-field-key {
    font-family: monospace;
    font-size: 0.82rem;
    color: var(--primary);
    font-weight: 600;
    padding: 0.45rem 0.6rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
    display: flex;
    align-items: center;
    overflow-wrap: anywhere;
}

.gt-field-val {
    font-family: 'Outfit', sans-serif;
    font-size: 0.82rem;
    line-height: 1.45;
    padding: 0.45rem 0.7rem;
    border-radius: 4px;
    word-break: break-word;
    overflow-wrap: break-word;
}

.gt-match {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
}

.gt-mismatch {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.28);
    color: #fca5a5;
}

.gt-partial {
    background: rgba(234, 179, 8, 0.08);
    border: 1px solid rgba(234, 179, 8, 0.28);
    color: #fef08a;
}

.gt-truth-val {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
}

.gt-score-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.45rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    flex-shrink: 0;
    cursor: default;
}

.gt-score-match {
    background: rgba(16, 185, 129, 0.18);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.gt-score-partial {
    background: rgba(234, 179, 8, 0.18);
    color: #fef08a;
    border: 1px solid rgba(234, 179, 8, 0.35);
}

.gt-score-miss {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.gt-tooltip-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.gt-tooltip {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #1e1e2d;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    font-size: 0.78rem;
    line-height: 1.4;
    padding: 0.45rem 0.65rem;
    border-radius: 6px;
    white-space: normal;
    width: max-content;
    max-width: 240px;
    z-index: 100;
    pointer-events: none;
    transition: opacity 0.15s;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.gt-tooltip-wrap:hover .gt-tooltip {
    visibility: visible;
    opacity: 1;
}

/* Onboarding Modal */
.onboard-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.onboard-overlay.visible {
    opacity: 1;
    pointer-events: all;
}

.onboard-card {
    background: linear-gradient(160deg, #1a1a2e 0%, #16162a 100%);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 20px;
    width: 50vw;
    max-width: 92vw;
    height: 70vh;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6), 0 0 40px rgba(99, 102, 241, 0.15);
    display: flex;
    flex-direction: column;
    transform: translateY(20px) scale(0.97);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.onboard-overlay.visible .onboard-card {
    transform: translateY(0) scale(1);
}

.onboard-card-body {
    padding: 2.5rem 2.5rem 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
}

@keyframes iconGlow {

    0%,
    100% {
        box-shadow: 0 0 18px rgba(99, 102, 241, 0.2), 0 0 4px rgba(99, 102, 241, 0.1);
    }

    50% {
        box-shadow: 0 0 28px rgba(99, 102, 241, 0.35), 0 0 8px rgba(168, 85, 247, 0.2);
    }
}

@keyframes iconSpin {
    0% {
        --icon-angle: 0deg;
    }

    100% {
        --icon-angle: 360deg;
    }
}

@property --icon-angle {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}

.onboard-icon {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(168, 85, 247, 0.08), rgba(236, 72, 153, 0.06));
    border: 1.5px solid transparent;
    background-clip: padding-box;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.4rem;
    flex-shrink: 0;
    animation: iconGlow 3s ease-in-out infinite, iconSpin 8s linear infinite;
    overflow: hidden;
}

.onboard-icon::before {
    content: '';
    position: absolute;
    inset: -1.5px;
    border-radius: 21px;
    padding: 1.5px;
    background: conic-gradient(from var(--icon-angle, 0deg), #6366f1, #a855f7, #ec4899, #6366f1);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.5;
    pointer-events: none;
}

.onboard-icon::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    background: radial-gradient(ellipse at 30% 20%, rgba(99, 102, 241, 0.1), transparent 60%);
    pointer-events: none;
}

.onboard-icon svg {
    width: 36px;
    height: 36px;
    stroke: url(#iconGrad);
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 0 6px rgba(165, 180, 252, 0.4));
}

.onboard-icon--img {
    width: 340px;
    height: 140px;
    border-radius: 18px;
    background: transparent;
    border: none;
    animation: iconGlow 3s ease-in-out infinite;
    overflow: hidden;
}

.onboard-icon--img::before {
    border-radius: 19px;
}

.onboard-icon--img::after {
    display: none;
}

.onboard-icon--img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 18px;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 0 12px rgba(99, 102, 241, 0.4));
}

.onboard-icon--illust {
    width: 200px;
    height: 140px;
    border-radius: 0;
    background: none;
    border: none;
    box-shadow: none;
    animation: none;
    overflow: visible;
}

.onboard-icon--illust::before,
.onboard-icon--illust::after {
    display: none;
}

.onboard-icon--illust img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.onboard-step-num {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, #a5b4fc, #c4b5fd, #f0abfc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 0 8px rgba(165, 180, 252, 0.5));
}

.onboard-card-body h2 {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(to right, #a5b4fc, #f9a8d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1.2rem;
}

.onboard-card-body p {
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.7;
    max-width: 540px;
}

.onboard-card-body p+p {
    margin-top: 0.6rem;
}

.onboard-card-body p strong {
    color: var(--text-main);
}

.onboard-card-body .onboard-tip {
    margin-top: 1rem;
    font-size: 0.92rem;
    color: var(--text-muted);
    opacity: 0.75;
    max-width: 540px;
}

.onboard-card-body .highlight-box {
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 10px;
    padding: 1rem 1.2rem;
    margin-top: 1rem;
    text-align: left;
    width: 100%;
}

.onboard-card-body .highlight-box p {
    margin: 0.35rem 0;
    font-size: 1.05rem;
}

.onboard-card-body .info-table th,
.onboard-card-body .info-table td {
    font-size: 0.92rem;
    padding: 11px 16px;
    white-space: nowrap;
}

.onboard-card-body .info-table td:last-child {
    white-space: normal;
}

.onboard-card-body .info-table {
    width: 90%;
    max-width: none;
}

.onboard-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.2rem 2.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.15);
}

.onboard-dots {
    display: flex;
    gap: 8px;
}

.onboard-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    transition: all 0.3s;
}

.onboard-dot.active {
    background: var(--primary);
    box-shadow: 0 0 8px var(--primary-glow);
    width: 24px;
    border-radius: 4px;
}

.onboard-btns {
    display: flex;
    gap: 0.6rem;
}

.onboard-btn {
    padding: 0.55rem 1.3rem;
    font-size: 0.9rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.onboard-btn-skip {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-muted);
    box-shadow: none;
}

.onboard-btn-skip:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    transform: none;
    box-shadow: none;
}

.onboard-btn-next {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    color: #fff;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.onboard-btn-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--primary-glow);
}

.onboard-dismiss-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 2.5rem 1.2rem;
    background: rgba(0, 0, 0, 0.15);
}

.onboard-dismiss-row input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--primary);
    cursor: pointer;
    padding: 0;
}

.onboard-dismiss-row label {
    font-size: 0.8rem;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
    font-weight: 400;
}

/* Sidebar orientation button */
.sidebar-orient-btn {
    margin-top: auto;
    padding: 0.6rem 1rem;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    box-shadow: none;
    font-family: 'Outfit', sans-serif;
}

.sidebar-orient-btn:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--primary);
    color: var(--text-main);
    transform: none;
    box-shadow: none;
}

/* Sidebar compiled function items */
.sidebar-item {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.sidebar-item:hover {
    border-color: var(--primary);
}

.sidebar-item--active {
    border-color: rgba(99, 102, 241, 0.6);
    background: rgba(99, 102, 241, 0.1);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.15), inset 0 0 0 1px rgba(99, 102, 241, 0.15);
}

.sidebar-item--active:hover {
    border-color: rgba(99, 102, 241, 0.7);
}

.info-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.info-table th,
.info-table td {
    padding: 14px 20px;
    text-align: left;
}

.info-table th {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.02);
}

.info-table td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.75);
}

.info-table tr:last-child td {
    border-bottom: none;
}

.info-table .label {
    color: var(--accent-primary);
    font-weight: 600;
}

/* Toast notification */
.toast-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.15s ease;
}

.toast-box {
    background: #2a2a35;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 1.5rem 2rem;
    max-width: 380px;
    width: 90%;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.toast-box p {
    color: var(--text-main);
    margin: 0 0 1.2rem 0;
    font-size: 0.95rem;
    line-height: 1.5;
}

.toast-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.toast-actions button {
    padding: 0.45rem 1.4rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.toast-btn-cancel {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
}

.toast-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-main);
}

.toast-btn-confirm {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3) !important;
}

.toast-btn-confirm:hover {
    background: rgba(239, 68, 68, 0.35);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Delete button on run badges */
.run-badge {
    position: relative;
}

.run-delete-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.8);
    border: none;
    color: white;
    font-size: 11px;
    line-height: 18px;
    padding: 0;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.run-badge:hover .run-delete-btn {
    display: flex;
}

.run-delete-btn:hover {
    background: #ef4444;
    transform: scale(1.15);
}

/* --- Consensus Colorful JSON --- */
.ccj-container {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 1rem;
    overflow-x: auto;
    margin-top: 1rem;
}

.ccj-header {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ccj-sub {
    text-transform: none;
    opacity: 0.7;
}

.ccj-pre {
    margin: 0;
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    font-size: 0.82rem;
    line-height: 1.65;
    white-space: pre-wrap;
    word-break: break-word;
}

.ccj-punct {
    color: var(--text-muted);
    opacity: 0.6;
}

.ccj-key {
    color: #94a3b8;
}

.ccj-pre span[title] {
    cursor: help;
    border-bottom: 1px dotted rgba(255, 255, 255, 0.15);
}

.ccj-legend {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.ccj-legend-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.ccj-legend-bar {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right,
            rgb(134, 239, 172),
            rgb(22, 163, 74),
            rgb(253, 224, 71),
            rgb(202, 138, 4),
            rgb(253, 186, 116),
            rgb(234, 88, 12),
            rgb(252, 165, 165),
            rgb(185, 28, 28));
    max-width: 200px;
}