:root {
    /* Dark-first - Computational Research Terminal theme */
    /* Nord-inspired palette */
    --bg-primary: #2e3440;
    --bg-secondary: #3b4252;
    --bg-tertiary: #434c5e;
    --bg-elevated: #4c566a;
    --text-primary: #eceff4;
    --text-secondary: #d8dee9;
    --text-tertiary: #8b95a8;
    --border-color: #4c566a;

    /* Frost blue - primary accent */
    --primary: #88c0d0;
    --primary-hover: #8fbcbb;
    --primary-light: rgba(136, 192, 208, 0.15);

    /* Aurora red - secondary accent */
    --accent: #bf616a;
    --accent-hover: #d08770;
    --accent-light: rgba(191, 97, 106, 0.15);

    /* Semantic colors */
    --success: #a3be8c;
    --danger: #bf616a;
    --warning: #ebcb8b;
    --info: #81a1c1;

    --border-focus: #88c0d0;
    --shadow-sm: 0 2px 4px 0 rgba(0, 0, 0, 0.3);
    --shadow: 0 4px 6px 0 rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 20px 0 rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 40px 0 rgba(0, 0, 0, 0.6);

    /* Brutalist: no rounded corners */
    --radius-sm: 0px;
    --radius: 0px;
    --radius-lg: 0px;
    --radius-xl: 0px;

    /* Visualization-specific rounding (data viz intentionally uses rounded corners) */
    --radius-viz: 8px;
    --radius-viz-sm: 6px;
    --radius-viz-pill: 20px;

    /* Spacing scale */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
}

[data-theme="light"] {
    --bg-primary: #eceff4;
    --bg-secondary: #e5e9f0;
    --bg-tertiary: #d8dee9;
    --bg-elevated: #ffffff;
    --text-primary: #2e3440;
    --text-secondary: #3b4252;
    --text-tertiary: #626c7e;
    --border-color: #d8dee9;
    --primary: #5e81ac;
    --primary-hover: #81a1c1;
    --accent: #bf616a;
    --accent-hover: #d08770;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 16px 0 rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===== FOCUS-VISIBLE — Keyboard-only focus ring ===== */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

[role="button"]:focus-visible,
.wizard-card:focus-visible,
.choice-card:focus-visible,
.iw-provider-card:focus-visible,
.theme-toggle:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px var(--primary-light);
}

body {
    font-family: 'Public Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.65;
    transition: background 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
    overflow-x: hidden;
}

/* Terminal scanline effect */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        repeating-linear-gradient(
            0deg,
            rgba(136, 192, 208, 0.03) 0px,
            rgba(136, 192, 208, 0.03) 1px,
            transparent 1px,
            transparent 2px
        );
    pointer-events: none;
    z-index: -1;
    opacity: 0.5;
}

/* Subtle grid accent on left edge */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(
        180deg,
        var(--primary) 0%,
        var(--accent) 100%
    );
    z-index: 1000;
    pointer-events: none;
}

/* Page load animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.container {
    animation: fadeInUp 0.6s ease-out;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Azeret Mono', monospace;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-transform: uppercase;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px;
}

@media (min-width: 768px) {
    .container {
        padding: 40px;
    }
}

/* Header - Minimal & Clean */
header {
    background: var(--bg-primary);
    padding: 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 32px;
    border: 2px solid var(--border-color);
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

.header-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.header-logo-section {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.header-text {
    text-align: left;
}

.header-content h1 {
    font-size: 28px;
    margin-bottom: 4px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.header-title-main {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: 400;
    text-align: center;
    margin-top: 4px;
}

/* Dark Mode Toggle - Floating */
.theme-toggle {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 10px 16px;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    transition: all 0.2s ease;
    box-shadow: var(--shadow);
}

.theme-toggle:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
}

.theme-icon {
    font-size: 18px;
    transition: transform 0.3s ease;
}

.theme-toggle:hover .theme-icon {
    transform: rotate(180deg);
}

[data-theme="dark"] .sun-icon {
    display: none;
}

[data-theme="light"] .moon-icon {
    display: none;
}

/* Landing Page */
#landingPage {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    animation: fadeIn 0.8s ease-out;
}

#landingPage.hidden {
    display: none;
}

.landing-header {
    text-align: center;
    margin-bottom: 60px;
    max-width: 800px;
}

.landing-title {
    font-family: 'Azeret Mono', monospace;
    font-size: 48px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.landing-subtitle {
    font-size: 20px;
    color: var(--text-secondary);
    font-weight: 400;
    line-height: 1.6;
}

.landing-choices {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    max-width: 1200px;
    width: 100%;
}

@media (max-width: 768px) {
    .landing-choices {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .landing-title {
        font-size: 32px;
    }
}

.choice-card {
    background: var(--bg-secondary);
    border: 3px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.choice-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.choice-card:hover::before {
    transform: scaleX(1);
}

.choice-card:hover {
    border-color: var(--primary);
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.choice-card.guided {
    border-color: var(--accent);
}

.choice-card.guided:hover {
    border-color: var(--accent);
}

.choice-card.interactive {
    border-color: var(--primary);
}

.choice-card.interactive:hover {
    border-color: var(--primary);
}

.choice-icon {
    font-size: 64px;
    margin-bottom: 24px;
    display: block;
}

.choice-title {
    font-family: 'Azeret Mono', monospace;
    font-size: 28px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: -0.01em;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.choice-card.guided .choice-title {
    color: var(--accent);
}

.choice-card.interactive .choice-title {
    color: var(--primary);
}

.choice-description {
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.choice-features {
    list-style: none;
    margin: 0;
    padding: 0;
}

.choice-features li {
    font-size: 14px;
    color: var(--text-tertiary);
    margin-bottom: 12px;
    padding-left: 24px;
    position: relative;
}

.choice-features li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: 700;
}

.choice-card.guided .choice-features li::before {
    color: var(--accent);
}

.choice-cta {
    display: inline-block;
    margin-top: 24px;
    padding: 14px 28px;
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    font-family: 'Azeret Mono', monospace;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.2s ease;
}

.choice-card:hover .choice-cta {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--bg-primary);
}

.choice-card.guided:hover .choice-cta {
    background: var(--accent);
    border-color: var(--accent);
}

.landing-footer {
    margin-top: 60px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 14px;
}

/* Red Hat AI Section */
.rhai-section {
    max-width: 1200px;
    width: 100%;
    margin-top: 48px;
    border: 2px solid var(--border-color);
    background: var(--bg-secondary);
}

.rhai-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 28px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.rhai-header:hover {
    background: var(--bg-tertiary);
}

.rhai-title {
    font-family: 'Azeret Mono', monospace;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-primary);
    margin: 0;
}

.rhai-toggle-icon {
    font-size: 14px;
    color: var(--text-tertiary);
    transition: transform 0.2s ease;
}

.rhai-content {
    padding: 0 28px 28px;
    border-top: 1px solid var(--border-color);
}

.rhai-content.hidden {
    display: none;
}

.rhai-intro {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 20px 0 24px;
}

.rhai-cards {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

@media (max-width: 768px) {
    .rhai-cards {
        grid-template-columns: 1fr;
    }
}

.rhai-card {
    padding: 24px;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    transition: border-color 0.2s ease;
}

.rhai-card:hover {
    border-color: var(--primary);
}

.rhai-card-icon {
    font-size: 28px;
    margin-bottom: 12px;
}

.rhai-card h3 {
    font-family: 'Azeret Mono', monospace;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.rhai-card p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 14px;
}

.rhai-code {
    display: block;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: var(--primary);
    word-break: break-all;
    line-height: 1.5;
}

.rhai-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.rhai-links a {
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.rhai-links a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.rhai-link-sep {
    color: var(--border-color);
    font-size: 12px;
}

/* Main demo container - initially hidden */
#demoContainer.hidden {
    display: none;
}

/* Back to Home button */
.back-to-home {
    position: fixed;
    top: 24px;
    left: 24px;
    z-index: 1001;
    padding: 10px 16px;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.2s ease;
    box-shadow: var(--shadow);
    display: none;
}

.back-to-home.visible {
    display: flex;
    align-items: center;
    gap: 8px;
}

.back-to-home:hover {
    background: var(--bg-secondary);
    border-color: var(--primary);
    color: var(--text-primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
}


.guided-demo-badge {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 999;
    padding: 8px 14px;
    background: linear-gradient(135deg, rgba(191, 97, 106, 0.15) 0%, rgba(208, 135, 112, 0.15) 100%);
    color: var(--accent);
    border: 2px solid var(--accent);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow);
    animation: fadeInUp 0.6s ease-out 0.3s both;
}

/* Guided Mode Question Selector */
.guided-questions {
    display: none;
    margin-bottom: 20px;
}

.guided-questions.visible {
    display: block;
}

.guided-questions-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: block;
}

.guided-questions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 768px) {
    .guided-questions-grid {
        grid-template-columns: 1fr;
    }
}

.guided-question-card {
    position: relative;
    display: block;
    cursor: pointer;
    border-radius: var(--radius);
    border: 2px solid var(--border-color);
    background: var(--bg-secondary);
    padding: 16px;
    transition: all 0.2s ease;
}

.guided-question-card:hover {
    border-color: var(--primary);
    background: var(--bg-tertiary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.guided-question-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.guided-question-card.selected {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(136, 192, 208, 0.15);
}

.guided-question-number {
    display: inline-block;
    width: 24px;
    height: 24px;
    background: var(--primary);
    color: var(--bg-primary);
    border-radius: 50%;
    text-align: center;
    line-height: 24px;
    font-size: 12px;
    font-weight: 700;
    margin-right: 8px;
    flex-shrink: 0;
}

.guided-question-text {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
}

.guided-question-card.selected .guided-question-number {
    background: var(--primary);
    box-shadow: 0 0 0 2px var(--bg-primary), 0 0 0 4px var(--primary);
}

/* Locked control styling */
.form-group.locked label::after {
    content: "🔒";
    margin-left: 8px;
    font-size: 12px;
    opacity: 0.6;
}

.form-group.locked select,
.form-group.locked input[type="range"] {
    opacity: 0.6;
    cursor: not-allowed;
    background: var(--bg-secondary);
}

.locked-helper {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 6px;
    font-style: italic;
    display: flex;
    align-items: center;
    gap: 6px;
}

.locked-helper::before {
    content: "ℹ️";
    font-size: 14px;
}

/* Section Styling */
.section {
    background: var(--bg-primary);
    padding: 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
    border: 2px solid var(--border-color);
    animation: fadeInUp 0.6s ease-out calc(0.2s + var(--animation-delay, 0s)) both;
}

.section:nth-child(2) { --animation-delay: 0.05s; }
.section:nth-child(3) { --animation-delay: 0.1s; }
.section:nth-child(4) { --animation-delay: 0.15s; }

/* Use Case Cards */
.use-case-card {
    position: relative;
    display: block;
    cursor: pointer;
    border-radius: var(--radius-lg);
    border: 2px solid var(--border-color);
    background: var(--bg-secondary);
    transition: all 0.2s ease;
    overflow: hidden;
}

.use-case-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.use-case-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.use-case-card input[type="radio"]:checked + .use-case-content {
    background: var(--primary-light);
    border-color: var(--primary);
}

.use-case-card input[type="radio"]:checked ~ .use-case-content::before {
    content: '✓';
    position: absolute;
    top: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}

.use-case-content {
    position: relative;
    padding: 24px;
    background: transparent;
    border: 2px solid transparent;
    border-radius: var(--radius-lg);
    transition: all 0.2s ease;
}

.use-case-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.use-case-icon {
    font-size: 28px;
}

.use-case-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.use-case-description {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.5;
}

.use-case-comparison {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: var(--bg-primary);
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 500;
}

.comparison-item {
    flex: 1;
    text-align: center;
    padding: 6px 8px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
}

.comparison-item.highlight {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

.comparison-vs {
    font-size: 11px;
    color: var(--text-tertiary);
    font-weight: 400;
}

@media (max-width: 768px) {
    .section > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }

    .use-case-title {
        font-size: 14px;
    }

    .use-case-description {
        font-size: 13px;
    }
}

.section-header {
    margin-bottom: 24px;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.section-description {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 400;
}

/* Algorithm Info Card - Expandable */
.algorithm-info {
    margin-top: 16px;
    padding: 20px;
    background: var(--primary-light);
    border-radius: var(--radius);
    border-left: 3px solid var(--primary);
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

.algorithm-info-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.algorithm-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.algorithm-type-badge.outcome {
    background: var(--success);
    color: white;
}

.algorithm-type-badge.process {
    background: var(--info);
    color: white;
}

.algorithm-info h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.algorithm-info p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    line-height: 1.6;
}

.algorithm-info .use-case {
    font-size: 13px;
    color: var(--primary);
    font-weight: 500;
}

/* Form Controls - Clean & Modern */
.form-grid {
    display: grid;
    gap: 20px;
}

@media (min-width: 768px) {
    .form-grid {
        grid-template-columns: 2fr 1fr;
    }
}

.form-group {
    margin-bottom: 0;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
    color: var(--text-primary);
}

.label-helper {
    color: var(--text-tertiary);
    font-weight: 400;
    font-size: 13px;
}

select, textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

select:hover, textarea:hover {
    border-color: var(--text-tertiary);
}

select:focus, textarea:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.6;
}

textarea:disabled {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: not-allowed;
    opacity: 0.8;
    border-color: var(--border-color);
}

/* Budget Slider - Modern Design */
.slider-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.slider-container input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, var(--primary) 0%, var(--primary) 12.5%, var(--border-color) 12.5%, var(--border-color) 100%);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 3px solid var(--bg-primary);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.slider-container input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 0 0 8px rgba(13, 148, 136, 0.1);
}

.slider-container input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 3px solid var(--bg-primary);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.budget-value {
    font-weight: 600;
    min-width: 40px;
    text-align: center;
    padding: 6px 16px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: var(--radius-sm);
    font-size: 15px;
}

/* Example Questions - Subtle */
.example-questions-container {
    margin-top: 12px;
}

.example-label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 13px;
    color: var(--text-secondary);
}

.example-select {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 13px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.example-select:hover {
    border-color: var(--text-tertiary);
}

.example-select:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

/* Action Buttons - Modern & Clean */
.action-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 24px;
}

button {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Public Sans', sans-serif;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-secondary);
    border-color: var(--text-tertiary);
    color: var(--text-primary);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Performance Metrics - Removed from main dashboard, moved to Performance Details */

/* Results - Clean Side-by-Side */
.results {
    display: grid;
    gap: 20px;
    margin-bottom: 24px;
}

@media (min-width: 1024px) {
    .results {
        grid-template-columns: 1fr 1fr;
    }

    .results.three-column {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .results.three-column {
        grid-template-columns: 1fr 1fr;
    }

    .results.three-column .result-pane:last-child {
        grid-column: 1 / -1;
    }
}

.result-pane {
    background: var(--bg-primary);
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 2px solid var(--border-color);
    min-height: 400px;
    position: relative;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.result-pane:hover {
    box-shadow: var(--shadow);
}

.pane-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border-color);
}

.pane-title {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.pane-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.pane-indicator.baseline {
    background: var(--text-tertiary);
    box-shadow: 0 0 0 3px rgba(156, 163, 175, 0.15);
}

.pane-indicator.its {
    background: var(--primary);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.pane-indicator.frontier {
    background: var(--success);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

/* Subtle background tint for ITS pane */
.results .result-pane:last-child {
    background: linear-gradient(to bottom, var(--bg-primary), var(--bg-primary) 50%, rgba(13, 148, 136, 0.02) 100%);
}

.latency-badge {
    background: var(--bg-secondary);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.cost-badge {
    background: rgba(16, 185, 129, 0.1);
    border: 2px solid rgba(16, 185, 129, 0.3);
    color: var(--success);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
}

.cost-badge.expensive {
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid rgba(239, 68, 68, 0.3);
    color: var(--danger);
}

.size-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-left: 6px;
}

.size-badge.large {
    background: rgba(13, 148, 136, 0.1);
    color: var(--primary);
    border: 2px solid rgba(13, 148, 136, 0.3);
}

.size-badge.small {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 2px solid rgba(16, 185, 129, 0.3);
}

.answer-content {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-primary);
    flex: 1;
    overflow-y: auto;
    padding: 4px;
    margin: -4px;
}

.answer-content p {
    margin-bottom: 16px;
}

.answer-content p:last-child {
    margin-bottom: 0;
}

/* Math Expression Styling */
.answer-content .katex {
    font-size: 1.05em;
}

.answer-content .katex-display {
    margin: 20px 0;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border: 2px solid var(--border-color);
    overflow-x: auto;
    text-align: center;
    max-width: 100%;
}

.answer-content .katex-display::-webkit-scrollbar {
    height: 6px;
}

.answer-content .katex-display::-webkit-scrollbar-track {
    background: transparent;
}

.answer-content .katex-display::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.answer-content .katex-display::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* Inline math should stand out slightly */
.answer-content .katex:not(.katex-display) {
    padding: 2px 4px;
    background: var(--bg-secondary);
    border-radius: 3px;
}

/* Inline code and math */
.answer-content code {
    font-family: 'IBM Plex Mono', monospace;
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    color: var(--primary);
}

/* Step markers */
.answer-step {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.answer-step:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.step-marker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 50%;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
    margin-top: 2px;
}

.answer-step > span:last-child {
    flex: 1;
    padding-top: 2px;
}

/* Final answer at the top */
.final-answer-section {
    margin-bottom: 20px;
    padding: 20px 24px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    animation: slideDown 0.3s ease;
}

.final-answer-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.final-answer-content {
    font-size: 15px;
    font-weight: 400;
    color: var(--text-primary);
    line-height: 1.7;
    text-align: left;
}

.final-answer-content p {
    margin: 0.75em 0;
}

.final-answer-content p:first-child {
    margin-top: 0;
}

.final-answer-content p:last-child {
    margin-bottom: 0;
}

/* Expandable Sections */
.expandable-section {
    margin-top: 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-primary);
    transition: all 0.2s ease;
}

.expandable-section:hover {
    border-color: var(--primary);
}

.expand-button {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.expand-button:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.expand-icon {
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.expandable-section.expanded .expand-icon {
    transform: rotate(180deg);
}

.expandable-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.expandable-section.expanded .expandable-content {
    max-height: 5000px;
}

.details-section {
    padding: 16px;
    background: var(--bg-secondary);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 2px solid var(--border-color);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.detail-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    font-family: 'IBM Plex Mono', monospace;
}

/* Algorithm Trace Visualization */
.trace-section {
    padding: 16px;
    background: var(--bg-secondary);
}

.trace-summary {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-bottom: 12px;
    font-style: italic;
}

.candidate-card {
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 8px;
    transition: border-color 0.2s ease;
}

.candidate-card.winner {
    border-color: var(--success);
    background: rgba(163, 190, 140, 0.08);
}

.candidate-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.candidate-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.candidate-card.winner .candidate-label {
    color: var(--success);
}

.winner-badge {
    font-size: 11px;
    font-weight: 700;
    color: var(--success);
    background: rgba(163, 190, 140, 0.15);
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.candidate-content {
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-secondary);
    max-height: 80px;
    overflow: hidden;
    position: relative;
}

.candidate-content.expanded-candidate {
    max-height: none;
}

.candidate-content::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(transparent, var(--bg-primary));
    pointer-events: none;
}

.candidate-content.expanded-candidate::after {
    display: none;
}

.candidate-card.winner .candidate-content::after {
    background: linear-gradient(transparent, rgba(46, 52, 64, 0.92));
}

.candidate-expand-btn {
    font-size: 11px;
    color: var(--primary);
    cursor: pointer;
    background: none;
    border: none;
    padding: 4px 0;
    margin-top: 4px;
}

.candidate-expand-btn:hover {
    text-decoration: underline;
}

.candidate-metric {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.metric-bar-container {
    flex: 1;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.metric-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

.metric-bar.score-bar {
    background: var(--primary);
}

.candidate-card.winner .metric-bar.score-bar {
    background: var(--success);
}

.metric-bar.vote-bar {
    background: var(--info);
}

.candidate-card.winner .metric-bar.vote-bar {
    background: var(--success);
}

.metric-bar.weight-bar {
    background: var(--primary);
}

.candidate-card.winner .metric-bar.weight-bar {
    background: var(--success);
}

.metric-value {
    font-size: 12px;
    font-weight: 600;
    font-family: 'IBM Plex Mono', monospace;
    color: var(--text-secondary);
    min-width: 50px;
    text-align: right;
}

.metric-label {
    font-size: 11px;
    color: var(--text-tertiary);
    min-width: 40px;
}

/* Vote distribution for Self-Consistency */
.vote-distribution {
    margin-bottom: 16px;
}

.vote-distribution-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.vote-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.vote-answer {
    font-size: 12px;
    color: var(--text-secondary);
    min-width: 80px;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: 'IBM Plex Mono', monospace;
}

.vote-bar-container {
    flex: 1;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.vote-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: var(--info);
    transition: width 0.5s ease;
}

.vote-count {
    font-size: 12px;
    font-weight: 600;
    font-family: 'IBM Plex Mono', monospace;
    color: var(--text-secondary);
    min-width: 30px;
    text-align: right;
}

/* Iteration tabs for Particle Gibbs */
.iteration-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 8px;
}

.iteration-tab {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-tertiary);
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 6px 6px 0 0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.iteration-tab:hover {
    color: var(--text-secondary);
    border-color: var(--primary);
}

.iteration-tab.active {
    color: var(--primary);
    background: var(--bg-tertiary);
    border-color: var(--primary);
}

.iteration-content {
    display: none;
}

.iteration-content.active {
    display: block;
}

/* Guided Wizard Styles */
.guided-wizard {
    margin-bottom: 32px;
    padding: 32px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    max-width: 100%;
    box-sizing: border-box;
}


/* Model Selection */
.model-selection-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.model-card {
    padding: 24px;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: var(--radius);
}

.model-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.model-card.selected {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: scale(0.97);
    box-shadow: inset 0 0 0 2px var(--primary);
}

.model-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.model-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.model-provider {
    font-size: 11px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    padding: 2px 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
}

.frontier-match {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 8px;
    font-style: italic;
}

/* Algorithm Selection */
.algorithm-selection-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.algorithm-card {
    padding: 24px;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: var(--radius);
}

.algorithm-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.algorithm-card.selected {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: scale(0.97);
    box-shadow: inset 0 0 0 2px var(--primary);
}

.algorithm-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.algorithm-name {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.algorithm-type-badge {
    display: inline-block;
    font-size: 10px;
    padding: 2px 8px;
    background: var(--info);
    color: var(--bg-primary);
    text-transform: uppercase;
    margin-bottom: 12px;
    border-radius: 4px;
}

.algorithm-description {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 12px;
}

.algorithm-usecase {
    font-size: 12px;
    color: var(--text-tertiary);
    font-style: italic;
}

/* Wizard Breadcrumbs */
.wizard-breadcrumbs {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.breadcrumb {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-tertiary);
    font-weight: 600;
    letter-spacing: 0.05em;
}

.breadcrumb.active {
    color: var(--primary);
}

.breadcrumb.completed {
    color: var(--success);
}

.breadcrumb-separator {
    color: var(--border-color);
}

/* Clickable completed breadcrumbs */
.breadcrumb.completed {
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 4px;
}
.breadcrumb.completed:hover {
    color: var(--primary);
}

/* Per-step back buttons */
.wizard-back-step-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    padding: 4px 12px;
    margin-bottom: 16px;
    transition: all 0.2s ease;
}
.wizard-back-step-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Algorithm step reassurance */
.wizard-step-reassurance {
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-style: italic;
    line-height: 1.5;
}

/* Styled prompt display */
.wizard-prompt-display {
    padding: 20px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-left: 4px solid var(--primary);
    margin-bottom: 16px;
}
.wizard-prompt-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-tertiary);
    font-weight: 600;
    margin-bottom: 8px;
}
.wizard-prompt-text {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
}

/* Results headline banner */
.wizard-results-headline {
    padding: 20px 24px;
    background: linear-gradient(135deg, var(--primary-light), transparent);
    border: 2px solid var(--primary);
    margin-bottom: 20px;
    text-align: center;
}
.headline-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.5;
}

/* Quality metric highlight */
.perf-metric-card.quality-highlight {
    border-color: var(--success);
    border-width: 2px;
}

/* Trace intro */
.trace-intro {
    margin-bottom: 12px;
}
.trace-intro strong {
    color: var(--primary);
    font-size: 14px;
}
.trace-intro p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
    line-height: 1.5;
}

/* Copy summary button */
.copy-summary-btn {
    margin-top: 12px;
    font-size: 13px;
    padding: 6px 16px;
}

/* Trace Visualization */
.trace-visualization-container {
    margin-top: 24px;
    border-top: 2px solid var(--border-color);
    padding-top: 24px;
}

.trace-section {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
}

.trace-toggle {
    width: 100%;
    padding: 16px 20px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: 'Azeret Mono', monospace;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
}

.trace-toggle:hover {
    background: var(--bg-tertiary);
    color: var(--primary);
}

.trace-toggle.active {
    color: var(--primary);
}

.trace-toggle-icon {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.trace-content {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    animation: fadeIn 0.3s ease-out;
}

/* Trace Direct Display (wizard mode - no expandable wrapper) */
.trace-direct-display {
    padding: 16px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    animation: fadeIn 0.3s ease-out;
}

/* === Self-Consistency: Voting Arena === */
.voting-arena {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.voting-arena-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.voting-arena-header .arena-icon {
    font-size: 16px;
}

.vote-chart {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.vote-chart-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius);
    transition: background 0.2s ease;
    position: relative;
}

.vote-chart-row.is-winner {
    background: rgba(163, 190, 140, 0.12);
    border: 2px solid var(--success);
}

.vote-chart-row:not(.is-winner) {
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
}

.vote-chart-rank {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-tertiary);
    min-width: 20px;
    text-align: center;
}

.vote-chart-row.is-winner .vote-chart-rank {
    color: var(--success);
}

.vote-chart-answer {
    flex: 0 0 120px;
    font-size: 12px;
    font-family: 'IBM Plex Mono', monospace;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vote-chart-bar-wrap {
    flex: 1;
    height: 24px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.vote-chart-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    min-width: 2px;
}

.vote-chart-row.is-winner .vote-chart-bar {
    background: linear-gradient(90deg, var(--success), #8fbf7f);
}

.vote-chart-row:not(.is-winner) .vote-chart-bar {
    background: var(--bg-elevated);
}

.vote-chart-count {
    font-size: 13px;
    font-weight: 700;
    font-family: 'IBM Plex Mono', monospace;
    color: var(--text-secondary);
    min-width: 55px;
    text-align: right;
}

.vote-chart-row.is-winner .vote-chart-count {
    color: var(--success);
}

.vote-chart-winner-badge {
    font-size: 10px;
    font-weight: 700;
    color: var(--success);
    background: rgba(163, 190, 140, 0.2);
    padding: 1px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 4px;
}

/* Candidate chips grid */
.candidate-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.candidate-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    color: var(--text-secondary);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    cursor: default;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.candidate-chip.is-winner {
    border-color: var(--success);
    color: var(--success);
    background: rgba(163, 190, 140, 0.08);
}

.candidate-chip .chip-index {
    font-weight: 700;
    font-size: 10px;
    opacity: 0.6;
}

/* Candidates expandable detail area */
.trace-candidates-detail {
    margin-top: 8px;
}

.trace-candidates-toggle {
    font-size: 12px;
    color: var(--primary);
    cursor: pointer;
    background: none;
    border: none;
    padding: 4px 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.trace-candidates-toggle:hover {
    text-decoration: underline;
}

.trace-candidates-list {
    display: none;
    margin-top: 8px;
}

.trace-candidates-list.expanded {
    display: block;
}

/* === Best-of-N: Score Leaderboard === */
.score-leaderboard {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.score-leaderboard-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.leaderboard-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius);
    transition: all 0.2s ease;
    position: relative;
}

.leaderboard-row.is-winner {
    background: rgba(235, 203, 139, 0.1);
    border: 2px solid var(--warning);
    margin-bottom: 8px;
}

.leaderboard-row:not(.is-winner) {
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
}

.leaderboard-rank {
    font-size: 14px;
    font-weight: 800;
    min-width: 24px;
    text-align: center;
    color: var(--text-tertiary);
}

.leaderboard-row.is-winner .leaderboard-rank {
    color: var(--warning);
    font-size: 16px;
}

.leaderboard-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.leaderboard-preview {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.leaderboard-row.is-winner .leaderboard-preview {
    color: var(--text-primary);
    font-weight: 500;
}

.leaderboard-bar-wrap {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.leaderboard-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    min-width: 2px;
}

.leaderboard-score {
    font-size: 14px;
    font-weight: 700;
    font-family: 'IBM Plex Mono', monospace;
    min-width: 50px;
    text-align: right;
}

.leaderboard-row.is-winner .leaderboard-score {
    color: var(--warning);
    font-size: 16px;
}

.leaderboard-winner-tag {
    font-size: 10px;
    font-weight: 700;
    color: var(--warning);
    background: rgba(235, 203, 139, 0.2);
    padding: 1px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.leaderboard-full-text {
    display: none;
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-secondary);
    padding: 8px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    max-height: 200px;
    overflow-y: auto;
}

.leaderboard-full-text.expanded {
    display: block;
}

.leaderboard-expand-btn {
    font-size: 11px;
    color: var(--primary);
    cursor: pointer;
    background: none;
    border: none;
    padding: 2px 0;
}

.leaderboard-expand-btn:hover {
    text-decoration: underline;
}

/* Separator line between winner and rest */
.leaderboard-separator {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0 8px 0;
}

/* Performance Badges */
.performance-badges {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.perf-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    font-size: 12px;
}

.perf-label {
    color: var(--text-tertiary);
    font-weight: 600;
}

.perf-value {
    color: var(--text-primary);
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 500;
}

/* Performance Details Section */
.performance-details-section {
    margin-top: 40px;
    padding: 32px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.perf-details-header {
    text-align: center;
    margin-bottom: 32px;
}

.perf-details-header h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.perf-details-subtitle {
    font-size: 13px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.perf-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.perf-metric-card {
    padding: 20px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    text-align: center;
    border-radius: var(--radius);
}

.perf-metric-label {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-tertiary);
    font-weight: 600;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.perf-metric-values {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 16px;
}

.metric-baseline {
    color: var(--text-secondary);
}

.metric-arrow {
    color: var(--text-tertiary);
    font-size: 14px;
}

.metric-its {
    color: var(--primary);
    font-weight: 700;
}

.perf-metric-change {
    font-size: 14px;
    font-weight: 700;
}

.perf-metric-change.positive {
    color: var(--success);
}

.perf-metric-change.negative {
    color: var(--accent);
}

.perf-metric-change.neutral {
    color: var(--text-tertiary);
}

.perf-metric-note {
    font-size: 11px;
    color: var(--text-tertiary);
    font-style: italic;
}

/* Why ITS Helped Banner */
.why-its-helped-banner {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: var(--primary-light);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.why-its-helped-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.why-its-helped-content {
    flex: 1;
}

.why-its-helped-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.why-its-helped-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 768px) {
    .wizard-use-case-cards {
        grid-template-columns: 1fr;
    }

    .wizard-breadcrumbs {
        font-size: 10px;
        gap: 8px;
    }
}

.final-answer-content .katex {
    font-size: 1.1em;
}

/* Make display math in final answer look better */
.final-answer-content .katex-display {
    margin: 8px 0 0 0;
    padding: 0;
    background: transparent;
    border: none;
}

/* Chat response - main model output */
.chat-response {
    padding: 20px 24px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-primary);
    animation: slideDown 0.3s ease;
}

.chat-response p {
    margin: 0 0 12px 0;
}

.chat-response p:last-child {
    margin-bottom: 0;
}

/* No final answer fallback */
.no-final-answer {
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    text-align: center;
    color: var(--text-tertiary);
    font-size: 13px;
    margin-bottom: 24px;
}

/* Reasoning trace section */
.reasoning-section {
    padding: 16px;
}

.reasoning-section .reasoning-content {
    line-height: 1.6;
    color: var(--text-primary);
}

.reasoning-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    cursor: pointer;
    user-select: none;
    padding: 8px 0;
}

.reasoning-header:hover {
    color: var(--primary);
}

.reasoning-header:hover .reasoning-title {
    color: var(--primary);
}

.reasoning-header:hover .reasoning-toggle {
    color: var(--primary);
}

.reasoning-title {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.reasoning-toggle {
    font-size: 12px;
    color: var(--text-tertiary);
    transition: transform 0.2s ease;
}

.reasoning-toggle.collapsed {
    transform: rotate(-90deg);
}

.reasoning-content {
    overflow: hidden;
    transition: all 0.3s ease;
}

.reasoning-content.collapsed {
    max-height: 0 !important;
    opacity: 0;
    margin-top: 0;
}

.reasoning-content:not(.collapsed) {
    max-height: 10000px;
    opacity: 1;
}

/* Enhanced readability */
.answer-content strong {
    color: var(--text-primary);
    font-weight: 600;
}

.answer-content em {
    color: var(--text-secondary);
    font-style: italic;
}

/* List styling */
.answer-content ul, .answer-content ol {
    margin: 12px 0 16px 20px;
}

.answer-content li {
    margin-bottom: 8px;
}

/* Custom Scrollbar */
.answer-content::-webkit-scrollbar {
    width: 6px;
}

.answer-content::-webkit-scrollbar-track {
    background: transparent;
}

.answer-content::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
    transition: background 0.2s ease;
}

.answer-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* Result Actions - Minimal */
.result-actions {
    display: flex;
    gap: 6px;
}

.action-btn {
    padding: 6px 10px;
    background: transparent;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    color: var(--text-secondary);
}

.action-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--text-tertiary);
}

/* Expected Answer - Clean */
.expected-answer-container {
    background: var(--bg-primary);
    border: 2px solid var(--success);
    border-left: 4px solid var(--success);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 24px;
    display: none;
}

.expected-answer-container.visible {
    display: block;
}

.expected-answer-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.check-icon {
    font-size: 20px;
    color: var(--success);
}

.expected-answer-header strong {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 600;
}

.expected-answer-content {
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.8;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
}

.expected-answer-content .katex {
    font-size: 1.05em;
}

.expected-answer-content .katex-display {
    margin: 12px 0;
    padding: 12px;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    text-align: center;
}

.expected-answer-content p {
    margin-bottom: 12px;
}

.expected-answer-content p:last-child {
    margin-bottom: 0;
}

/* Highlight matching answers */
@keyframes highlight {
    0%, 100% { background-color: transparent; }
    50% { background-color: rgba(16, 185, 129, 0.1); }
}

.answer-matches {
    animation: highlight 2s ease-in-out;
}

/* Analysis Panel - Hidden by default for simplicity */
.analysis-panel {
    display: none !important;
}

/* Loading States - Minimal */
.spinner {
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--primary);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    animation: spin 0.8s linear infinite;
    margin: 80px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.empty-state {
    color: var(--text-tertiary);
    text-align: center;
    padding: 80px 20px;
    font-size: 14px;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.3;
}

/* Loading skeleton */
.loading-skeleton {
    padding: 20px 0;
}

.skeleton-line {
    height: 16px;
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-tertiary) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 12px;
}

.skeleton-line:last-child {
    width: 70%;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.error-message {
    background: var(--bg-primary);
    color: var(--danger);
    padding: 16px 20px;
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    border: 2px solid var(--danger);
    border-left: 4px solid var(--danger);
    font-weight: 400;
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .results {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 16px;
    }

    .section {
        padding: 24px 20px;
    }

    header {
        padding: 24px 20px;
    }

    .header-logo-section {
        flex-direction: column;
        gap: 12px;
    }

    .header-text {
        text-align: center;
    }

    .header-logo {
        width: 60px;
        height: 60px;
    }

    .header-title-main {
        font-size: 12px;
    }

    .header-content h1 {
        font-size: 20px;
    }

    .subtitle {
        font-size: 14px;
    }

    .theme-toggle {
        top: 16px;
        right: 16px;
        padding: 8px 12px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .metrics-summary {
        flex-direction: column;
    }

    .result-pane {
        padding: 20px;
    }
}

/* Utility Classes */
.text-gradient {
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Performance Visualization Container */
#performance-visualization-container {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px 60px 20px;
}

/* ============================================================
   SHARED WIZARD STYLES
   Common UI shared between guided-demo and interactive-demo.
   Demo-specific CSS files extend these with overrides.
   ============================================================ */

/* --- Progress Bar --- */
.wizard-progress {
    height: 4px;
    background: var(--bg-tertiary);
    margin-bottom: 20px;
    overflow: hidden;
}

.wizard-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Breadcrumbs --- */
.wizard-breadcrumbs {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.wizard-crumb {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    color: var(--text-tertiary);
    padding: 4px 10px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.wizard-crumb.active {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-light);
}

.wizard-crumb.completed {
    color: var(--success);
    cursor: pointer;
}

.wizard-crumb.completed:hover {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.wizard-crumb-sep {
    color: var(--border-color);
    font-size: 10px;
    user-select: none;
}

/* --- Step Container --- */
.wizard-step {
    animation: wizardFadeIn 0.4s ease-out;
}

@keyframes wizardFadeIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.wizard-step-title {
    font-size: 22px;
    text-align: center;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.wizard-step-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 28px;
    font-weight: 400;
}

/* --- Back Button --- */
.wizard-back-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    padding: 6px 14px;
    margin-bottom: 20px;
    transition: all 0.2s ease;
}

.wizard-back-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* --- Cards Grid --- */
.wizard-cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 768px) {
    .wizard-cards-grid {
        grid-template-columns: 1fr;
    }
}

.wizard-card {
    padding: 28px 24px;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    border-radius: var(--radius-lg);
    position: relative;
}

.wizard-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.wizard-card.selected {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: scale(0.97);
    box-shadow: inset 0 0 0 2px var(--primary);
}

.wizard-card-icon {
    font-size: 40px;
    margin-bottom: 14px;
}

.wizard-card h4 {
    font-size: 16px;
    margin-bottom: 10px;
    color: var(--text-primary);
    font-weight: 700;
}

.wizard-card p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 12px;
}

/* --- Success color variables for performance viz --- */
:root {
    --success-shadow: rgba(163, 190, 140, 0.3);
    --success-glow: rgba(163, 190, 140, 0.6);
}

/* ===== UTILITY CLASSES (replacing inline styles) ===== */

.use-case-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: 1fr 1fr 1fr;
}

.setup-code {
    display: block;
    margin: 8px 0 4px;
    padding: 8px 10px;
    background: var(--bg-tertiary);
    font-size: 12px;
}

.setup-code + .setup-code {
    margin-top: 0;
    margin-bottom: 8px;
}

.form-separator {
    border-top: 1px solid var(--border-color);
    margin-top: 24px;
    padding-top: 24px;
}

.form-section-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.pane-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.slider-hint {
    font-size: 13px;
    color: var(--text-secondary);
}

.form-group--spaced {
    margin-top: 20px;
}

.btn-secondary + .btn-secondary {
    margin-left: 12px;
}

.performance-viz-wrapper {
    margin-top: 48px;
}

/* ===== SAVINGS SUMMARY CARD ===== */

.savings-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 24px;
}

.savings-card-header {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    margin-bottom: 16px;
}

.savings-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.savings-card-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.savings-card-icon {
    font-size: 24px;
    line-height: 1;
    flex-shrink: 0;
}

.savings-card-body {
    min-width: 0;
}

.savings-card-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-tertiary);
    margin-bottom: 2px;
}

.savings-card-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 4px;
}

.savings-card-detail {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Utility class to replace inline display:none */
/* !important is required — compound selectors like .foo.bar .baz { display:block }
   have higher specificity than a single class and would override .hidden without it. */
.hidden { display: none !important; }
