/* ============================================
   AZ-500 Exam Simulator — Design System v2
   Cybersteps GmbH · Secure Operations Console
   Dark-first with light theme toggle
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ── Dark Theme (default) ────────────────────── */
:root,
[data-theme="dark"] {
    --c-bg: #0b1120;
    --c-bg-raised: #111827;
    --c-surface: #1a2332;
    --c-surface-hover: #1f2d3f;
    --c-border: #283548;
    --c-border-subtle: #1c2838;

    --c-text: #e2e8f0;
    --c-text-secondary: #8b9bb5;
    --c-text-muted: #5a6d85;

    --c-primary: #3b82f6;
    --c-primary-hover: #60a5fa;
    --c-primary-muted: rgba(59, 130, 246, 0.15);
    --c-primary-glow: rgba(59, 130, 246, 0.25);

    --c-accent: #06b6d4;
    --c-accent-muted: rgba(6, 182, 212, 0.12);

    --c-success: #22c55e;
    --c-success-muted: rgba(34, 197, 94, 0.12);
    --c-success-text: #4ade80;

    --c-warning: #f59e0b;
    --c-warning-muted: rgba(245, 158, 11, 0.12);
    --c-warning-text: #fbbf24;

    --c-danger: #ef4444;
    --c-danger-muted: rgba(239, 68, 68, 0.12);
    --c-danger-text: #f87171;

    --c-sidebar: #0d1525;
    --c-sidebar-active: rgba(59, 130, 246, 0.12);

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.15);

    --overlay-bg: rgba(0, 0, 0, 0.5);
    color-scheme: dark;
}

/* ── Light Theme ─────────────────────────────── */
[data-theme="light"] {
    --c-bg: #f0f4f8;
    --c-bg-raised: #f8fafc;
    --c-surface: #ffffff;
    --c-surface-hover: #f0f4f8;
    --c-border: #dde4ee;
    --c-border-subtle: #e8eef5;

    --c-text: #1a2332;
    --c-text-secondary: #4b5e76;
    --c-text-muted: #8899ad;

    --c-primary: #2563eb;
    --c-primary-hover: #1d4ed8;
    --c-primary-muted: rgba(37, 99, 235, 0.08);
    --c-primary-glow: rgba(37, 99, 235, 0.12);

    --c-accent: #0891b2;
    --c-accent-muted: rgba(8, 145, 178, 0.08);

    --c-success: #16a34a;
    --c-success-muted: rgba(22, 163, 74, 0.08);
    --c-success-text: #15803d;

    --c-warning: #d97706;
    --c-warning-muted: rgba(217, 119, 6, 0.08);
    --c-warning-text: #b45309;

    --c-danger: #dc2626;
    --c-danger-muted: rgba(220, 38, 38, 0.08);
    --c-danger-text: #b91c1c;

    --c-sidebar: #ffffff;
    --c-sidebar-active: rgba(37, 99, 235, 0.08);

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 20px rgba(37, 99, 235, 0.08);

    --overlay-bg: rgba(0, 0, 0, 0.3);
    color-scheme: light;
}

/* ── Shared Tokens ───────────────────────────── */
:root {
    --font-body: 'Sora', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 50%;
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --transition: 0.2s var(--ease);
    --sidebar-w: 260px;
}

/* ── Reset ───────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-body);
    color: var(--c-text);
    background: var(--c-bg);
    line-height: 1.6;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background 0.3s var(--ease), color 0.3s var(--ease);
}

a { color: var(--c-primary); text-decoration: none; }
a:hover { color: var(--c-primary-hover); }

::selection {
    background: var(--c-primary-muted);
    color: var(--c-primary);
}

/* ── Layout ──────────────────────────────────── */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--c-sidebar);
    border-right: 1px solid var(--c-border);
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    overflow-y: auto;
    transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
}

.sidebar-logo {
    padding: 4px 20px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--c-border);
    margin-bottom: 8px;
}

/* Theme-aware logos: light logo on dark bg, dark logo on light bg */
.logo-light-theme { display: none; }
.logo-dark-theme { display: block; }
[data-theme="light"] .logo-light-theme { display: block; }
[data-theme="light"] .logo-dark-theme { display: none; }

.sidebar-logo img {
    height: 28px;
    width: auto;
    object-fit: contain;
}

.sidebar-cert-switcher {
    padding: 0 16px 12px;
}

.sidebar-section-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--c-text-muted);
    margin-bottom: 8px;
}

.cert-switcher-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding: 10px;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    background: var(--c-surface);
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

.cert-switcher-card:hover {
    border-color: var(--c-primary);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
}

.cert-switcher-code {
    min-width: 58px;
    padding: 8px 10px;
    border-radius: var(--radius-md);
    background: var(--c-primary-muted);
    color: var(--c-primary);
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    font-family: var(--font-mono);
}

.cert-switcher-logo {
    width: 100px;
    height: 100px;
    object-fit: contain;
    border-radius: var(--radius-md);
    padding: 2px;
    flex-shrink: 0;
}

.cert-switcher-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.cert-switcher-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.cert-hub-logo {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 110px;
    height: 110px;
    object-fit: contain;
    border-radius: var(--radius-lg);
    padding: 6px;
    opacity: 0.85;
}

.cert-switcher-copy,
.cert-switcher-empty {
    min-width: 0;
    flex: 1;
}

.cert-switcher-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--c-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cert-switcher-meta {
    font-size: 11px;
    color: var(--c-text-muted);
    margin-top: 2px;
}

.cert-switcher-action {
    font-size: 12px;
    font-weight: 600;
    color: var(--c-primary);
    flex-shrink: 0;
}

.sidebar-nav {
    flex: 1;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    color: var(--c-text-secondary);
    font-weight: 500;
    font-size: 14px;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}

.nav-item:hover {
    background: var(--c-surface-hover);
    color: var(--c-text);
    text-decoration: none;
}

.nav-item.active {
    background: var(--c-sidebar-active);
    color: var(--c-primary);
    font-weight: 600;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px; bottom: 8px;
    width: 3px;
    background: var(--c-primary);
    border-radius: 0 2px 2px 0;
}

.nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    opacity: 0.7;
}

.nav-item.active svg,
.nav-item:hover svg { opacity: 1; }

.nav-badge {
    margin-left: auto;
    background: var(--c-primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--c-border);
    flex-shrink: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 34px; height: 34px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.user-name { font-weight: 600; font-size: 13px; }
.user-email { font-size: 11px; color: var(--c-text-muted); }

/* Theme toggle */
.theme-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 6px;
    background: var(--c-bg);
    border-radius: var(--radius-md);
}

.theme-toggle button {
    flex: 1;
    padding: 5px 0;
    font-size: 12px;
    font-family: var(--font-body);
    font-weight: 500;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: transparent;
    color: var(--c-text-secondary);
    transition: var(--transition);
}

.theme-toggle button.active {
    background: var(--c-surface);
    color: var(--c-text);
    box-shadow: var(--shadow-sm);
}

/* Sidebar controls row (theme + lang toggles) */
.sidebar-controls {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}
.sidebar-controls .theme-toggle {
    margin-top: 0;
    flex: 1;
}

.lang-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px;
    background: var(--c-bg);
    border-radius: var(--radius-md);
}
.lang-toggle button {
    padding: 5px 8px;
    font-size: 11px;
    font-family: var(--font-mono);
    font-weight: 600;
    letter-spacing: 0.04em;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: transparent;
    color: var(--c-text-secondary);
    transition: var(--transition);
}
.lang-toggle button.active {
    background: var(--c-surface);
    color: var(--c-text);
    box-shadow: var(--shadow-sm);
}

/* ── Main Content ────────────────────────────── */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-w);
    padding: 32px 40px;
    min-height: 100vh;
    transition: margin-left 0.3s var(--ease);
}

.shell-context-bar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--c-border);
    flex-wrap: wrap;
}

.shell-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--c-text-muted);
}

.shell-breadcrumbs a {
    color: var(--c-text-secondary);
}

.shell-breadcrumbs a:hover {
    color: var(--c-primary);
    text-decoration: none;
}

.shell-breadcrumb-sep {
    color: var(--c-text-muted);
}

.shell-context-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.shell-context-pill {
    font-size: 12px;
}

.shell-context-pill--warning {
    background: var(--c-warning-muted);
    color: var(--c-warning);
}

.shell-context-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--c-text-secondary);
}

.shell-context-note {
    font-size: 12px;
    color: var(--c-text-muted);
}

.how-it-works-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    padding: 7px 16px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-accent, var(--c-primary)) 100%);
    color: #fff;
    border: 1px solid transparent;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
    white-space: nowrap;
}

.how-it-works-pill:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
    filter: brightness(1.08);
    color: #fff;
}

.how-it-works-pill svg {
    flex-shrink: 0;
}

.how-it-works-pill.is-active {
    outline: 2px solid var(--c-primary);
    outline-offset: 2px;
}

.page-header {
    margin-bottom: 32px;
}

.page-title {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}

.page-subtitle {
    font-size: 15px;
    color: var(--c-text-secondary);
}

/* ── Cards ───────────────────────────────────── */
.card {
    background: var(--c-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--c-border);
    padding: 24px;
    transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
}

.card-hover:hover {
    border-color: var(--c-primary);
    box-shadow: var(--shadow-glow);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

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

.card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--c-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ── Stat Cards ──────────────────────────────── */
.stat-value {
    font-size: 36px;
    font-weight: 700;
    font-family: var(--font-mono);
    letter-spacing: -0.02em;
    line-height: 1;
    background: linear-gradient(135deg, var(--c-text), var(--c-text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 12px;
    color: var(--c-text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 4px;
}

/* ── Readiness Gauge ─────────────────────────── */
.readiness-gauge {
    position: relative;
    width: 180px; height: 180px;
    margin: 0 auto 16px;
}

.readiness-gauge svg {
    transform: rotate(-90deg);
    width: 100%; height: 100%;
}

.readiness-gauge .gauge-bg {
    fill: none;
    stroke: var(--c-border);
    stroke-width: 10;
}

.readiness-gauge .gauge-fill {
    fill: none;
    stroke: var(--c-primary);
    stroke-width: 10;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s var(--ease);
}

.readiness-gauge .gauge-value {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.readiness-gauge .gauge-pct {
    font-size: 42px;
    font-weight: 700;
    font-family: var(--font-mono);
    letter-spacing: -0.03em;
    line-height: 1;
}

.readiness-gauge .gauge-label {
    font-size: 12px;
    color: var(--c-text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 4px;
}

/* ── Progress Bars ───────────────────────────── */
.progress-bar {
    height: 8px;
    background: var(--c-border);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s var(--ease);
}

.progress-fill.high { background: var(--c-success); }
.progress-fill.medium { background: var(--c-warning); }
.progress-fill.low { background: var(--c-danger); }
.progress-fill.primary { background: var(--c-primary); }

.progress-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.progress-label {
    width: 220px;
    font-size: 14px;
    font-weight: 500;
    flex-shrink: 0;
}

.progress-value {
    width: 48px;
    text-align: right;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-mono);
    color: var(--c-text-secondary);
}

/* ── Buttons ─────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s var(--ease);
    position: relative;
    overflow: hidden;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
    background: var(--c-primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}
.btn-primary:hover {
    background: #2563eb;
    color: #fff;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: var(--c-surface);
    color: var(--c-text);
    border: 1px solid var(--c-border);
}
.btn-secondary:hover {
    background: var(--c-surface-hover);
    border-color: var(--c-text-muted);
}

.btn-success {
    background: var(--c-success);
    color: #fff;
}

.btn-danger {
    background: var(--c-danger);
    color: #fff;
}

.btn-ghost {
    background: transparent;
    color: var(--c-text-secondary);
    padding: 8px 12px;
}
.btn-ghost:hover {
    background: var(--c-surface-hover);
    color: var(--c-text);
}

.btn-outline {
    background: transparent;
    color: var(--c-primary);
    border: 1px solid var(--c-primary);
}
.btn-outline:hover {
    background: var(--c-primary-muted);
}

.btn-lg { padding: 14px 28px; font-size: 15px; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; justify-content: center; }

/* ── Badges ──────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-domain { background: var(--c-primary-muted); color: var(--c-primary); }
.badge-success { background: var(--c-success-muted); color: var(--c-success-text); }
.badge-warning { background: var(--c-warning-muted); color: var(--c-warning-text); }
.badge-danger { background: var(--c-danger-muted); color: var(--c-danger-text); }
.badge-accent { background: var(--c-accent-muted); color: var(--c-accent); }

/* ── Domain Cards (Dashboard) ────────────────── */
.domain-card {
    padding: 20px;
    border-radius: var(--radius-lg);
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    cursor: pointer;
    transition: all 0.25s var(--ease);
}

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

.domain-card .domain-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.domain-card .domain-weight {
    font-size: 12px;
    color: var(--c-text-muted);
    margin-bottom: 12px;
}

.domain-card .domain-pct {
    font-size: 28px;
    font-weight: 700;
    font-family: var(--font-mono);
    margin-bottom: 8px;
}

/* ── Quick Actions ───────────────────────────── */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.quick-action {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s var(--ease);
    font-family: var(--font-body);
    color: var(--c-text);
    font-size: 14px;
    font-weight: 600;
}

.quick-action:hover {
    border-color: var(--c-primary);
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

.quick-action .qa-icon {
    width: 40px; height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.quick-action .qa-icon.learn { background: var(--c-primary-muted); color: var(--c-primary); }
.quick-action .qa-icon.exam { background: var(--c-accent-muted); color: var(--c-accent); }
.quick-action .qa-icon.weak { background: var(--c-danger-muted); color: var(--c-danger-text); }
.quick-action .qa-icon.review { background: var(--c-warning-muted); color: var(--c-warning-text); }

/* ── Streak Display ──────────────────────────── */
.streak-display {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-weight: 600;
}

.streak-flame { font-size: 24px; }
.streak-count { font-size: 24px; color: var(--c-warning-text); }
.streak-label { font-size: 12px; color: var(--c-text-muted); text-transform: uppercase; letter-spacing: 0.06em; }

/* ── Question UI ─────────────────────────────── */
.question-container {
    max-width: 820px;
    margin: 0 auto;
    padding-bottom: 100px; /* space for bottom bar */
}

.question-card {
    padding: 28px;
    margin-bottom: 20px;
}

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

.question-number {
    font-size: 13px;
    font-weight: 600;
    color: var(--c-text-muted);
    font-family: var(--font-mono);
}

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

/* Markdown tables in question text */
.question-text table,
.question-card table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 14px;
}

.question-text th,
.question-text td,
.question-card th,
.question-card td {
    border: 1px solid var(--c-border);
    padding: 8px 12px;
    text-align: left;
}

.question-text th,
.question-card th {
    background: var(--c-primary-muted);
    font-weight: 600;
    font-size: 13px;
}

.question-text pre,
.explanation-text pre,
.case-study-side-body pre {
    background: var(--c-bg);
    border: 1px solid var(--c-border);
    border-radius: 8px;
    padding: 16px 18px;
    margin: 16px 0 20px;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.6;
    color: var(--c-text);
}

.question-text code,
.explanation-text code,
.case-study-side-body code {
    font-family: var(--font-mono);
    font-size: 0.88em;
    padding: 2px 6px;
    background: var(--c-bg);
    border: 1px solid var(--c-border);
    border-radius: 4px;
    color: var(--c-accent);
    word-break: break-word;
}

.question-text pre code,
.explanation-text pre code,
.case-study-side-body pre code {
    padding: 0;
    background: none;
    border: none;
    border-radius: 0;
    font-size: 13px;
    color: inherit;
    word-break: normal;
}

/* ── Options (single/multi choice) ───────────── */
.option-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 18px;
    border: 2px solid var(--c-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s var(--ease);
    font-size: 15px;
    line-height: 1.5;
}

.option-item:hover {
    border-color: var(--c-primary);
    background: var(--c-primary-muted);
}

.option-item.selected {
    border-color: var(--c-primary);
    background: var(--c-primary-muted);
}

.option-item.kb-focus {
    outline: 2px solid var(--c-primary);
    outline-offset: -2px;
}

.option-item.correct {
    border-color: var(--c-success);
    background: var(--c-success-muted);
}

.option-item.incorrect {
    border-color: var(--c-danger);
    background: var(--c-danger-muted);
}

.option-item.disabled {
    pointer-events: none;
    opacity: 0.7;
}

.option-marker {
    width: 28px; height: 28px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--c-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
    font-family: var(--font-mono);
    transition: all 0.15s var(--ease);
}

.option-item.selected .option-marker {
    border-color: var(--c-primary);
    background: var(--c-primary);
    color: #fff;
}

.option-item.correct .option-marker {
    border-color: var(--c-success);
    background: var(--c-success);
    color: #fff;
}

.option-item.incorrect .option-marker {
    border-color: var(--c-danger);
    background: var(--c-danger);
    color: #fff;
}

.option-text { flex: 1; }

.option-feedback {
    font-size: 13px;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid var(--c-border-subtle);
    color: var(--c-text-secondary);
    line-height: 1.5;
}

/* Multi-choice count hint */
.select-hint {
    font-size: 13px;
    color: var(--c-text-muted);
    margin-bottom: 12px;
    font-weight: 500;
}

/* ── Yes/No Grid ─────────────────────────────── */
.yesno-grid {
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.yesno-header {
    display: grid;
    grid-template-columns: 1fr 80px 80px;
    background: var(--c-primary-muted);
    font-weight: 600;
    font-size: 13px;
}

.yesno-header > div {
    padding: 10px 16px;
    text-align: center;
}

.yesno-header > div:first-child { text-align: left; }

.yesno-row {
    display: grid;
    grid-template-columns: 1fr 80px 80px;
    border-top: 1px solid var(--c-border);
    transition: var(--transition);
}

.yesno-row:hover { background: var(--c-surface-hover); }
.yesno-row.correct-row { background: var(--c-success-muted); }
.yesno-row.incorrect-row { background: var(--c-danger-muted); }

.yesno-statement {
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.5;
}

.yesno-choice {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
}

.yesno-choice input[type="radio"] {
    width: 18px; height: 18px;
    accent-color: var(--c-primary);
    cursor: pointer;
}

/* ── Dropdown Slots ──────────────────────────── */
.dropdown-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.dropdown-slot {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: var(--c-bg-raised);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
}

.dropdown-slot label {
    font-weight: 600;
    font-size: 14px;
    min-width: 160px;
    color: var(--c-text);
}

.dropdown-slot select {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid var(--c-border);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 14px;
    background: var(--c-surface);
    color: var(--c-text);
    cursor: pointer;
    transition: var(--transition);
    appearance: auto;
}

.dropdown-slot select:focus {
    border-color: var(--c-primary);
    outline: none;
    box-shadow: 0 0 0 3px var(--c-primary-muted);
}

.dropdown-slot.correct { border-color: var(--c-success); background: var(--c-success-muted); }
.dropdown-slot.incorrect { border-color: var(--c-danger); background: var(--c-danger-muted); }

.code-block-with-dropdowns {
    white-space: pre-wrap;
}

.dropdown-slot-inline {
    display: inline-flex;
    vertical-align: middle;
    padding: 0;
    margin: 0 2px;
    background: none;
    border: none;
    border-radius: 0;
}

.dropdown-slot-inline select {
    min-width: 150px;
    padding: 2px 8px;
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.4;
    border: 1px solid var(--c-border);
    border-radius: 4px;
}

.dropdown-slot-inline.correct select {
    border-color: var(--c-success);
    background: var(--c-success-muted);
}

.dropdown-slot-inline.incorrect select {
    border-color: var(--c-danger);
    background: var(--c-danger-muted);
}

/* ── Drag & Drop ─────────────────────────────── */
.drag-drop-container {
    display: flex;
    gap: 24px;
}

.drag-source-pool,
.drag-target-area {
    flex: 1;
    padding: 16px;
    background: var(--c-bg-raised);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
}

.drag-section-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--c-text-muted);
    margin-bottom: 12px;
}

.drag-pool-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 60px;
}

.drag-chip {
    padding: 10px 14px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    cursor: grab;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s var(--ease);
    user-select: none;
}

.drag-chip:hover { border-color: var(--c-primary); }
.drag-chip:active { cursor: grabbing; }
.drag-chip.dragging { opacity: 0.7; border-style: dashed; }

.target-slot-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 10px;
}

.target-slot-label {
    width: 40%;
    font-weight: 600;
    font-size: 14px;
}

.target-dropzone {
    flex: 1;
    min-height: 44px;
    border: 2px dashed var(--c-border);
    border-radius: var(--radius-sm);
    background: var(--c-surface);
    display: flex;
    align-items: center;
    padding: 4px;
    transition: all 0.15s var(--ease);
}

.target-dropzone.drag-over {
    border-color: var(--c-primary);
    background: var(--c-primary-muted);
}

.target-dropzone.correct { border-color: var(--c-success); border-style: solid; background: var(--c-success-muted); }
.target-dropzone.incorrect { border-color: var(--c-danger); border-style: solid; background: var(--c-danger-muted); }

/* ── Feedback Toast ──────────────────────────── */
.feedback-toast {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 22px;
    margin-bottom: 20px;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    animation: slide-down 0.35s var(--ease);
}

.feedback-toast.correct {
    background: var(--c-success-muted);
    border: 1px solid var(--c-success);
    color: var(--c-success-text);
}

.feedback-toast.incorrect {
    background: var(--c-danger-muted);
    border: 1px solid var(--c-danger);
    color: var(--c-danger-text);
}

.feedback-icon {
    width: 34px; height: 34px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
    color: #fff;
}

.feedback-toast.correct .feedback-icon { background: var(--c-success); }
.feedback-toast.incorrect .feedback-icon { background: var(--c-danger); }

@keyframes slide-down {
    from { opacity: 0; transform: translateY(-12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Explanation Panel ───────────────────────── */
.explanation-panel {
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-top: 20px;
    background: var(--c-bg-raised);
    border: 1px solid var(--c-border);
    animation: slide-down 0.4s var(--ease);
}

.explanation-section {
    margin-bottom: 20px;
}

.explanation-section:last-child { margin-bottom: 0; }

.explanation-section h4 {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.explanation-section h4.expl-title { color: var(--c-primary); }
.explanation-section h4.trap-title { color: var(--c-warning-text); }
.explanation-section h4.incorrect-title { color: var(--c-danger-text); }
.explanation-section h4.concept-title { color: var(--c-accent); }

.explanation-text {
    font-size: 14px;
    line-height: 1.75;
    color: var(--c-text-secondary);
}

/* Exam trap card */
.exam-trap-card {
    padding: 14px 18px;
    background: var(--c-warning-muted);
    border-left: 4px solid var(--c-warning);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    margin: 8px 0;
    font-size: 14px;
    line-height: 1.65;
    color: var(--c-text);
}

/* Key concept card */
.key-concept-card {
    padding: 14px 18px;
    background: var(--c-accent-muted);
    border-left: 4px solid var(--c-accent);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-size: 14px;
    line-height: 1.65;
    color: var(--c-text);
}

/* Why incorrect table */
.why-incorrect-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.why-incorrect-item {
    display: flex;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    background: var(--c-danger-muted);
    font-size: 13px;
    line-height: 1.5;
}

.why-incorrect-item .wi-letter {
    font-weight: 700;
    color: var(--c-danger-text);
    flex-shrink: 0;
    font-family: var(--font-mono);
}

/* ── Confidence Buttons ──────────────────────── */
.confidence-wrapper {
    margin-top: 16px;
    padding: 16px 18px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
}

.confidence-hint {
    font-size: 12px;
    color: var(--c-text-muted);
    margin-bottom: 10px;
    text-align: center;
}

.confidence-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.confidence-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--c-text-secondary);
    margin-right: 4px;
}

.confidence-btn {
    padding: 6px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--c-border);
    background: var(--c-bg);
    color: var(--c-text-secondary);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.confidence-btn:hover {
    border-color: var(--c-primary);
    color: var(--c-primary);
    background: var(--c-primary-muted);
}

.confidence-btn.selected {
    border-color: var(--c-primary);
    background: var(--c-primary);
    color: #fff;
}

/* ── Learning Guide ─────────────────────────── */
.learning-guide {
    max-width: 820px;
    margin: 0 auto 20px;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
    background: var(--c-surface);
    overflow: hidden;
}

.learning-guide-toggle {
    padding: 14px 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--c-primary);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.learning-guide-toggle::-webkit-details-marker { display: none; }

.learning-guide-toggle::before {
    content: "\25B6";
    font-size: 10px;
    transition: transform 0.2s;
}

.learning-guide[open] .learning-guide-toggle::before {
    transform: rotate(90deg);
}

.learning-guide-body {
    padding: 0 20px 20px;
}

.learning-guide-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

@media (max-width: 700px) {
    .learning-guide-grid { grid-template-columns: 1fr; }
}

.learning-guide-card {
    display: flex;
    gap: 12px;
    padding: 14px;
    border-radius: var(--radius-sm);
    background: var(--c-bg);
    border: 1px solid var(--c-border);
}

.learning-guide-card p {
    font-size: 14px;
    color: var(--c-text-secondary);
    line-height: 1.6;
    margin: 4px 0 0;
}

.learning-guide-card ul {
    margin: 6px 0 0;
    padding-left: 16px;
    font-size: 14px;
    color: var(--c-text-secondary);
    line-height: 1.7;
}

.learning-guide-card strong {
    font-size: 15px;
    color: var(--c-text);
}

.learning-guide-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--c-primary-muted);
    color: var(--c-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

.learning-guide-table {
    width: 100%;
    margin-top: 8px;
    border-collapse: collapse;
    font-size: 13px;
}

.learning-guide-table th {
    text-align: left;
    padding: 5px 10px;
    border-bottom: 1px solid var(--c-border);
    color: var(--c-text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 11px;
}

.learning-guide-table td {
    padding: 5px 10px;
    border-bottom: 1px solid var(--c-border);
    color: var(--c-text-secondary);
}

/* ── Bottom Navigation Bar ───────────────────── */
.bottom-bar {
    position: fixed;
    bottom: 0;
    left: var(--sidebar-w);
    right: 0;
    background: var(--c-surface);
    border-top: 1px solid var(--c-border);
    padding: 12px 32px;
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 50;
    backdrop-filter: blur(12px);
}

.bottom-bar .progress-bar {
    flex: 1;
}

/* ── Timer ───────────────────────────────────── */
.timer {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-xl);
    background: var(--c-bg-raised);
    border: 1px solid var(--c-border);
    font-weight: 600;
    font-size: 15px;
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

.timer.warning { border-color: var(--c-warning); color: var(--c-warning-text); background: var(--c-warning-muted); }
.timer.danger { border-color: var(--c-danger); color: var(--c-danger-text); background: var(--c-danger-muted); animation: pulse 1s infinite; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ── Question Navigator (sidebar) ────────────── */
.sidebar-navigator {
    padding: 8px 12px;
    border-top: 1px solid var(--c-border);
    overflow-y: auto;
    max-height: 42vh;
}

.sidebar-nav-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--c-text-muted);
    margin-bottom: 8px;
    font-weight: 600;
}

.question-nav {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
}

.q-nav-item {
    width: 30px; height: 30px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--c-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    font-family: var(--font-mono);
    cursor: pointer;
    transition: var(--transition);
    background: transparent;
    color: var(--c-text-muted);
}

.q-nav-item:hover { border-color: var(--c-primary); color: var(--c-text); }
.q-nav-item.current { border-color: var(--c-primary); background: var(--c-primary-muted); color: var(--c-primary); }
.q-nav-item.correct { background: var(--c-success-muted); border-color: var(--c-success); color: var(--c-success-text); }
.q-nav-item.incorrect { background: var(--c-danger-muted); border-color: var(--c-danger); color: var(--c-danger-text); }
.q-nav-item.answered { background: var(--c-primary-muted); border-color: var(--c-primary); color: var(--c-primary); }
.q-nav-item.flagged { background: var(--c-warning-muted); border-color: var(--c-warning); color: var(--c-warning-text); }

.nav-compact-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.nav-page-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--c-text-muted);
}

.nav-jump-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--c-border);
}

.nav-jump-input {
    width: 52px;
    padding: 4px 6px;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-family: var(--font-mono);
    background: var(--c-surface);
    color: var(--c-text);
}

.nav-jump-input:focus {
    outline: none;
    border-color: var(--c-primary);
    box-shadow: 0 0 0 2px var(--c-primary-muted);
}

/* ── Case Study Side Panel ───────────────────── */
.case-study-side-panel {
    position: fixed;
    right: 0; top: 0; bottom: 0;
    width: 540px;
    max-width: 90vw;
    z-index: 200;
    display: flex;
    flex-direction: column;
    background: var(--c-surface);
    box-shadow: -4px 0 30px rgba(0, 0, 0, 0.3);
    border-left: 3px solid var(--c-primary);
    transform: translateX(100%);
    transition: transform 0.3s var(--ease);
    overflow: hidden;
}

.case-study-side-panel.open { transform: translateX(0); }

.case-study-side-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: var(--c-primary-muted);
    border-bottom: 1px solid var(--c-border);
    flex-shrink: 0;
}

.case-study-badge {
    padding: 2px 10px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: var(--c-primary);
    border-radius: var(--radius-sm);
}

.case-study-close {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--c-text-secondary);
    padding: 2px 6px;
    line-height: 1;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.case-study-close:hover { background: var(--c-surface-hover); color: var(--c-text); }

.case-study-side-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    font-size: 14px;
    line-height: 1.7;
    color: var(--c-text-secondary);
}

.case-study-side-body h2,
.case-study-side-body h3 {
    color: var(--c-text);
    margin: 18px 0 8px;
    font-size: 15px;
}

.case-study-side-body h2:first-child,
.case-study-side-body h3:first-child { margin-top: 0; }

.case-study-side-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    font-size: 13px;
}

.case-study-side-body th,
.case-study-side-body td {
    border: 1px solid var(--c-border);
    padding: 8px 10px;
    text-align: left;
}

.case-study-side-body th {
    background: var(--c-primary-muted);
    font-weight: 600;
}

.case-study-side-body ul,
.case-study-side-body ol {
    padding-left: 20px;
    margin: 8px 0;
}

.case-study-side-body p { margin: 8px 0; }

.case-study-show-btn {
    position: fixed;
    right: 0; top: 50%;
    transform: translateY(-50%);
    z-index: 190;
    padding: 14px 12px;
    font-size: 13px;
    font-weight: 700;
    font-family: var(--font-body);
    background: var(--c-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    cursor: pointer;
    box-shadow: 0 2px 16px rgba(99, 102, 241, 0.4);
    writing-mode: vertical-rl;
    text-orientation: mixed;
    letter-spacing: 0.5px;
    transition: var(--transition);
}

.case-study-show-btn:hover {
    background: var(--c-primary-hover);
    padding-right: 18px;
}

.case-study-info-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    margin-bottom: 14px;
    background: var(--c-primary-muted);
    border: 1px solid var(--c-primary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.case-study-info-banner:hover {
    box-shadow: var(--shadow-glow);
}

.cs-banner-badge {
    padding: 2px 10px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: var(--c-primary);
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

.cs-banner-text {
    font-size: 13px;
    font-weight: 500;
}

.cs-banner-arrow {
    margin-left: auto;
    font-size: 18px;
    color: var(--c-primary);
    font-weight: 700;
}

.case-study-backdrop {
    position: fixed;
    inset: 0;
    z-index: 199;
    background: var(--overlay-bg);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s var(--ease);
}

.case-study-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

/* ── Score / Results ─────────────────────────── */
.score-gauge {
    text-align: center;
    padding: 40px 0;
}

.score-value {
    font-size: 64px;
    font-weight: 700;
    font-family: var(--font-mono);
    line-height: 1;
}

.score-total {
    font-size: 20px;
    color: var(--c-text-muted);
    font-weight: 500;
}

.score-status {
    font-size: 18px;
    font-weight: 700;
    margin-top: 12px;
}

.score-status.passed { color: var(--c-success-text); }
.score-status.failed { color: var(--c-danger-text); }

/* ── Recent Sessions Table ───────────────────── */
.sessions-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.sessions-table th {
    text-align: left;
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--c-text-muted);
    border-bottom: 1px solid var(--c-border);
}

.sessions-table td {
    padding: 12px;
    border-bottom: 1px solid var(--c-border-subtle);
}

.sessions-table tr:hover td {
    background: var(--c-surface-hover);
}

/* ── Empty State ─────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--c-text-muted);
}

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

.empty-state h3 {
    font-size: 18px;
    color: var(--c-text-secondary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    max-width: 400px;
    margin: 0 auto 20px;
}

/* ── Loading Spinner ─────────────────────────── */
.spinner {
    width: 36px; height: 36px;
    border: 3px solid var(--c-border);
    border-top-color: var(--c-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 40px auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Mobile hamburger button ─────────────────── */
.mobile-menu-btn {
    display: none;  /* hidden on desktop */
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 200;
    width: 40px;
    height: 40px;
    padding: 8px;
    border: none;
    border-radius: 8px;
    background: var(--c-surface);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
}
.mobile-menu-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--c-text);
    border-radius: 2px;
    transition: transform 0.25s, opacity 0.25s;
}
/* Animate to X when open */
.mobile-menu-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mobile-menu-btn.open span:nth-child(2) { opacity: 0; }
.mobile-menu-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 99;
}
.sidebar-overlay.active { display: block; }

/* ── Responsive ──────────────────────────────── */
@media (max-width: 768px) {
    .mobile-menu-btn { display: flex; }
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .sidebar-navigator { display: none; }
    .main-content { margin-left: 0; padding: 16px; padding-top: 60px; }
    .shell-context-bar { margin-bottom: 20px; padding-bottom: 14px; }
    .bottom-bar { left: 0; }
    .card-grid { grid-template-columns: 1fr; }
    .question-container { padding-bottom: 80px; }
    .drag-drop-container { flex-direction: column; }
    .case-study-side-panel { width: 100%; max-width: 100%; }
    .quick-actions { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
    .quick-actions { grid-template-columns: 1fr; }
}

/* ── Utilities ───────────────────────────────── */
.text-muted { color: var(--c-text-muted); }
.text-secondary { color: var(--c-text-secondary); }
.text-primary { color: var(--c-primary); }
.text-success { color: var(--c-success-text); }
.text-danger { color: var(--c-danger-text); }
.text-warning { color: var(--c-warning-text); }
.text-mono { font-family: var(--font-mono); }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.mb-0 { margin-bottom: 0; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.hidden { display: none !important; }


/* ============================================
   Study Day — Markdown content rendering
   ============================================ */

.study-day-page {
    max-width: 860px;
    margin: 0 auto;
    padding-bottom: 60px;
}

/* Nav bar */
.study-day-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.study-back-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--c-text-secondary);
    text-decoration: none;
    transition: color 0.15s;
}
.study-back-link:hover {
    color: var(--c-primary);
}

.study-day-pager {
    display: flex;
    gap: 8px;
}

.study-pager-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--c-text-muted);
    text-decoration: none;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid var(--c-border);
    transition: all 0.15s;
}
.study-pager-btn:hover {
    color: var(--c-primary);
    border-color: var(--c-primary);
    background: var(--c-primary-muted);
}

/* Header */
.study-day-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--c-border);
}

.study-day-badge {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    background: var(--c-primary-muted);
    color: var(--c-primary);
    flex-shrink: 0;
    box-shadow: var(--shadow-glow);
}

.study-day-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--c-text);
    margin: 0 0 4px;
    line-height: 1.3;
}

.study-day-subtitle {
    font-size: 13px;
    color: var(--c-text-muted);
    margin: 0;
}

/* Bottom nav */
.study-day-bottom-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--c-border);
    gap: 12px;
}

/* ── Table of Contents ──────────────────────── */

.study-toc {
    background: var(--c-bg-raised);
    border: 1px solid var(--c-border);
    border-radius: 10px;
    margin-bottom: 32px;
    overflow: hidden;
}

.study-toc-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--c-text-secondary);
    padding: 14px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
    list-style: none;
}
.study-toc-title::-webkit-details-marker {
    display: none;
}
.study-toc-title::before {
    content: "\25b6";
    font-size: 10px;
    transition: transform 0.2s;
    color: var(--c-text-muted);
}
.study-toc[open] > .study-toc-title::before {
    transform: rotate(90deg);
}

.study-toc-body {
    padding: 0 20px 16px;
    max-height: 400px;
    overflow-y: auto;
}

.study-toc-body ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.study-toc-body li {
    margin: 0;
}

.study-toc-body > ul > li > a {
    display: block;
    padding: 6px 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--c-text);
    text-decoration: none;
    border-bottom: 1px solid var(--c-border-subtle);
    transition: color 0.15s;
}
.study-toc-body > ul > li > a:hover {
    color: var(--c-primary);
}

.study-toc-body > ul > li > ul > li > a {
    display: block;
    padding: 4px 0 4px 16px;
    font-size: 12px;
    font-weight: 400;
    color: var(--c-text-secondary);
    text-decoration: none;
    transition: color 0.15s;
}
.study-toc-body > ul > li > ul > li > a:hover {
    color: var(--c-primary);
}

/* Nested list indentation */
.study-toc-body ul ul {
    padding-left: 0;
}

/* ── Rendered Markdown article ─────────────── */

.study-content {
    color: var(--c-text);
    font-size: 15px;
    line-height: 1.75;
}

.study-content > *:first-child {
    margin-top: 0;
}

/* Headings */
.study-content h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--c-text);
    margin: 48px 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--c-border);
    line-height: 1.3;
}

.study-content h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--c-text);
    margin: 40px 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--c-border-subtle);
    line-height: 1.3;
}

.study-content h3 {
    font-size: 17px;
    font-weight: 600;
    color: var(--c-text);
    margin: 32px 0 12px;
    line-height: 1.4;
}

.study-content h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--c-text-secondary);
    margin: 24px 0 8px;
    line-height: 1.4;
}

/* Paragraphs */
.study-content p {
    margin: 0 0 14px;
}

/* Bold & italic */
.study-content strong {
    color: var(--c-text);
    font-weight: 600;
}

/* Links */
.study-content a {
    color: var(--c-primary);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.15s;
}
.study-content a:hover {
    border-bottom-color: var(--c-primary);
}

/* Lists */
.study-content ul,
.study-content ol {
    margin: 0 0 16px;
    padding-left: 24px;
}

.study-content li {
    margin-bottom: 6px;
}

.study-content li > ul,
.study-content li > ol {
    margin-top: 6px;
    margin-bottom: 0;
}

/* Tables */
.study-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0 20px;
    font-size: 13.5px;
    line-height: 1.5;
    background: var(--c-bg-raised);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--c-border);
}

.study-content thead {
    background: var(--c-surface);
}

.study-content th {
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--c-text-secondary);
    border-bottom: 1px solid var(--c-border);
}

.study-content td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--c-border-subtle);
    color: var(--c-text);
    vertical-align: top;
}

.study-content tbody tr:last-child td {
    border-bottom: none;
}

.study-content tbody tr:hover {
    background: var(--c-surface-hover);
}

/* Code blocks */
.study-content pre {
    background: var(--c-bg);
    border: 1px solid var(--c-border);
    border-radius: 8px;
    padding: 16px 18px;
    margin: 16px 0 20px;
    overflow-x: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: var(--c-text);
}

.study-content code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.88em;
    padding: 2px 6px;
    background: var(--c-surface);
    border: 1px solid var(--c-border-subtle);
    border-radius: 4px;
    color: var(--c-accent);
}

.study-content pre code {
    padding: 0;
    background: none;
    border: none;
    border-radius: 0;
    font-size: 13px;
    color: var(--c-text);
}

/* Blockquotes — standard */
.study-content blockquote {
    margin: 16px 0 20px;
    padding: 14px 18px;
    border-left: 3px solid var(--c-primary);
    background: var(--c-primary-muted);
    border-radius: 0 8px 8px 0;
    color: var(--c-text);
    font-size: 14px;
}

.study-content blockquote p {
    margin: 0 0 8px;
}
.study-content blockquote p:last-child {
    margin-bottom: 0;
}

/* Exam trap blockquotes — special amber/warning style */
.study-content blockquote.exam-trap {
    border-left-color: var(--c-warning);
    background: var(--c-warning-muted);
    position: relative;
}

.study-content blockquote.exam-trap::before {
    content: "EXAM TRAP";
    display: block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--c-warning-text);
    margin-bottom: 8px;
    font-family: 'JetBrains Mono', monospace;
}

/* Horizontal rules */
.study-content hr {
    border: none;
    border-top: 1px solid var(--c-border);
    margin: 32px 0;
}

/* Checkboxes in review checklist */
.study-content input[type="checkbox"] {
    accent-color: var(--c-primary);
    margin-right: 6px;
}

/* Images (if any) */
.study-content img {
    max-width: 100%;
    border-radius: 8px;
    margin: 16px 0;
}

/* Definition-like patterns (used in some materials) */
.study-content dl {
    margin: 12px 0;
}
.study-content dt {
    font-weight: 600;
    color: var(--c-text);
    margin-top: 12px;
}
.study-content dd {
    margin-left: 20px;
    color: var(--c-text-secondary);
}

/* Responsive */
@media (max-width: 640px) {
    .study-day-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .study-day-badge {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }
    .study-day-title {
        font-size: 18px;
    }
    .study-content {
        font-size: 14px;
    }
    .study-content pre {
        font-size: 12px;
        padding: 12px 14px;
    }
    .study-content table {
        font-size: 12px;
    }
    .study-content th,
    .study-content td {
        padding: 8px 10px;
    }
    .study-day-bottom-nav {
        flex-direction: column;
    }
}

/* ── "Read Material" button in study plan overview ─ */
.study-material-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--c-primary);
    text-decoration: none;
    padding: 5px 12px;
    border-radius: 6px;
    border: 1px solid var(--c-primary);
    background: var(--c-primary-muted);
    transition: all 0.15s;
    margin-top: 8px;
    cursor: pointer;
}
.study-material-btn:hover {
    background: var(--c-primary);
    color: #fff;
}

/* Button styles used in study day */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.15s;
    cursor: pointer;
    border: none;
}
.btn--primary {
    background: var(--c-primary);
    color: #fff;
}
.btn--primary:hover {
    background: var(--c-primary-hover);
}
.btn--outline {
    background: transparent;
    color: var(--c-text-secondary);
    border: 1px solid var(--c-border);
}
.btn--outline:hover {
    color: var(--c-text);
    border-color: var(--c-text-muted);
    background: var(--c-surface-hover);
}

/* ── PBQ (Performance-Based Questions) ─────────────────── */
.pbq-container { margin-top: 12px; }
.pbq-topology { margin: 0 0 16px; padding: 12px; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-md); text-align: center; }
.pbq-topology img { max-width: 100%; height: auto; border-radius: 8px; display: block; margin: 0 auto; }
.pbq-description { font-size: 15px; color: var(--c-text-secondary); margin-bottom: 16px; line-height: 1.5; }

/* ── Tabs ── */
.pbq-tabs { display: flex; gap: 0; border-bottom: 2px solid var(--c-border); margin-bottom: 0; overflow-x: auto; scrollbar-width: none; }
.pbq-tabs::-webkit-scrollbar { display: none; }
.pbq-tab { padding: 10px 18px; cursor: pointer; font-size: 13px; font-weight: 600; background: none; border: none; border-bottom: 2px solid transparent; margin-bottom: -2px; color: var(--c-text-secondary); transition: color 0.15s, border-color 0.15s; white-space: nowrap; }
.pbq-tab:hover { color: var(--c-text); background: var(--c-primary-muted); }
.pbq-tab.active { border-color: var(--c-primary); color: var(--c-primary); }
.pbq-panels { padding-top: 20px; }

/* ── Section ── */
.pbq-section { margin-bottom: 24px; }
.pbq-section-title { font-size: 17px; font-weight: 700; margin-bottom: 12px; color: var(--c-text); text-transform: uppercase; letter-spacing: 0.05em; }
.pbq-section-desc { font-size: 15px; color: var(--c-text-secondary); margin-bottom: 14px; line-height: 1.6; }

/* ── Generic form fields (form_tabs, terminal_ordering fallback) ── */
.pbq-field { display: flex; align-items: center; gap: 12px; padding: 9px 14px; border: 1px solid var(--c-border); border-radius: var(--radius-sm); margin-bottom: 6px; background: var(--c-bg-raised); transition: border-color 0.2s, background 0.2s; }
.pbq-field-label { min-width: 200px; font-size: 14px; font-weight: 500; color: var(--c-text-secondary); flex-shrink: 0; }
.pbq-select, .pbq-input { flex: 1; padding: 7px 10px; border: 1px solid var(--c-border); border-radius: var(--radius-sm); background: var(--c-bg); color: var(--c-text); font-size: 14px; min-width: 0; }
.pbq-select:focus, .pbq-input:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 2px var(--c-primary-muted); }
.pbq-fixed-value { display: inline-block; font-size: 13px; color: var(--c-accent); font-weight: 600; padding: 5px 10px; background: rgba(6, 182, 212, 0.08); border: 1px solid rgba(6, 182, 212, 0.2); border-radius: var(--radius-sm); font-family: var(--font-mono); }

.pbq-field.correct { border-color: var(--c-success) !important; background: var(--c-success-muted) !important; }
.pbq-field.incorrect { border-color: var(--c-danger) !important; background: var(--c-danger-muted) !important; }
[data-pbq-field].correct { border-color: var(--c-success) !important; background: var(--c-success-muted) !important; }
[data-pbq-field].incorrect { border-color: var(--c-danger) !important; background: var(--c-danger-muted) !important; }

/* ── Checkbox / multi-select ── */
.pbq-checkbox-group { display: flex; flex-direction: column; gap: 4px; }
.pbq-checkbox-label { display: flex; align-items: center; gap: 10px; font-size: 13px; cursor: pointer; padding: 7px 12px; border-radius: var(--radius-sm); border: 1px solid transparent; transition: background 0.15s, border-color 0.15s; }
.pbq-checkbox-label:hover { background: var(--c-primary-muted); border-color: var(--c-border); }
.pbq-checkbox-label input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--c-primary); flex-shrink: 0; }

/* ── TABLE DROPDOWNS (PBQ8) ── */
.pbq-table-wrap { overflow-x: auto; border-radius: var(--radius-md); border: 1px solid var(--c-border); margin-bottom: 4px; }
.pbq-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.pbq-table thead tr { background: var(--c-surface); }
.pbq-table th { padding: 11px 14px; text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--c-text-secondary); border-bottom: 2px solid var(--c-border); white-space: nowrap; }
.pbq-table th:first-child { width: 36px; text-align: center; }
.pbq-table tbody tr { transition: background 0.15s; }
.pbq-table tbody tr:hover { background: var(--c-surface); }
.pbq-table tbody tr:not(:last-child) td { border-bottom: 1px solid var(--c-border); }
.pbq-table td { padding: 10px 14px; vertical-align: middle; color: var(--c-text); line-height: 1.5; font-size: 14px; }
.pbq-table td:first-child { text-align: center; font-weight: 700; font-size: 13px; color: var(--c-text-secondary); width: 36px; }
.pbq-table td.pbq-td-desc { max-width: 300px; font-size: 14px; color: var(--c-text-secondary); }
.pbq-table td.pbq-td-target { font-size: 13px; font-weight: 600; color: var(--c-accent); white-space: nowrap; }
.pbq-table td.pbq-td-dropdown { min-width: 160px; }
.pbq-table td.pbq-td-dropdown .pbq-table-select { width: 100%; padding: 6px 10px; border: 1px solid var(--c-border); border-radius: var(--radius-sm); background: var(--c-bg); color: var(--c-text); font-size: 14px; }
.pbq-table td.pbq-td-dropdown .pbq-table-select:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 2px var(--c-primary-muted); }
[data-pbq-field].correct .pbq-table-select { border-color: var(--c-success); background: var(--c-success-muted); }
[data-pbq-field].incorrect .pbq-table-select { border-color: var(--c-danger); background: var(--c-danger-muted); }

/* ── NETWORK DIAGRAM (PBQ6, PBQ7) ── */
.pbq-diagram-container { background: var(--c-bg); border: 1px solid var(--c-border); border-radius: var(--radius-md); padding: 24px 20px; overflow-x: auto; }
.pbq-diagram-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--c-text-muted); margin-bottom: 20px; }

/* Zone (subnet bands) */
.pbq-diagram-zone { position: relative; border: 2px solid var(--c-border); border-radius: var(--radius-md); padding: 14px 16px 14px 16px; margin-bottom: 0; }
.pbq-diagram-zone + .pbq-diagram-zone { margin-top: 8px; }
.pbq-zone-label { position: absolute; top: -10px; left: 14px; background: var(--c-bg); padding: 0 6px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--c-text-muted); border-radius: 3px; }
.pbq-zone-label.zone-internet { color: var(--c-warning); }
.pbq-zone-label.zone-public { color: var(--c-primary); }
.pbq-zone-label.zone-private { color: var(--c-success); }
.pbq-zone-label.zone-database { color: var(--c-danger); }
.pbq-zone-label.zone-power { color: var(--c-accent); }
.pbq-zone-label.zone-network { color: var(--c-primary); }

/* Zone gradient backgrounds for visual depth */
.pbq-diagram-zone.zone-internet { background: linear-gradient(135deg, rgba(245,158,11,0.04) 0%, transparent 60%); border-color: rgba(245,158,11,0.3); }
.pbq-diagram-zone.zone-public { background: linear-gradient(135deg, rgba(59,130,246,0.05) 0%, transparent 60%); border-color: rgba(59,130,246,0.3); }
.pbq-diagram-zone.zone-private { background: linear-gradient(135deg, rgba(34,197,94,0.05) 0%, transparent 60%); border-color: rgba(34,197,94,0.3); }
.pbq-diagram-zone.zone-database { background: linear-gradient(135deg, rgba(239,68,68,0.04) 0%, transparent 60%); border-color: rgba(239,68,68,0.25); }
.pbq-diagram-zone.zone-power { background: linear-gradient(135deg, rgba(6,182,212,0.05) 0%, transparent 60%); border-color: rgba(6,182,212,0.3); }
.pbq-diagram-zone.zone-network { background: linear-gradient(135deg, rgba(59,130,246,0.04) 0%, transparent 60%); border-color: rgba(59,130,246,0.25); }
.pbq-diagram-zone.zone-isp { background: linear-gradient(135deg, rgba(245,158,11,0.04) 0%, transparent 60%); border-color: rgba(245,158,11,0.25); }
.pbq-diagram-zone.zone-servers { background: linear-gradient(135deg, rgba(34,197,94,0.04) 0%, transparent 60%); border-color: rgba(34,197,94,0.25); }

/* Connector arrow between zones */
.pbq-diagram-connector { display: flex; align-items: center; justify-content: center; height: 28px; position: relative; }
.pbq-diagram-connector::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: var(--c-border); transform: translateX(-50%); }
.pbq-diagram-connector::after { content: '▼'; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--c-text-muted); line-height: 1; }
.pbq-diagram-connector-label { position: relative; z-index: 1; font-size: 10px; font-weight: 600; color: var(--c-text-muted); background: var(--c-bg); padding: 0 8px; }

/* Fixed node (non-interactive box in diagram) */
.pbq-diagram-fixed-node { display: flex; align-items: center; justify-content: center; background: var(--c-surface); border: 2px solid var(--c-border); border-radius: var(--radius-sm); padding: 8px 20px; font-size: 13px; font-weight: 600; color: var(--c-text-secondary); min-height: 40px; white-space: nowrap; }
.pbq-diagram-fixed-node.node-primary { border-color: var(--c-primary); color: var(--c-primary); background: var(--c-primary-muted); }

/* Node row — horizontal layout of nodes */
.pbq-node-row { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.pbq-node-row + .pbq-node-row { margin-top: 10px; }

/* Interactive node (dropdown node) */
.pbq-diagram-node { display: flex; flex-direction: column; align-items: center; gap: 6px; max-width: 180px; }
.pbq-node-label { font-size: 12px; font-weight: 600; color: var(--c-text-muted); text-transform: uppercase; letter-spacing: 0.04em; text-align: center; word-wrap: break-word; overflow-wrap: break-word; white-space: normal; line-height: 1.3; }
.pbq-node-select-wrap { background: var(--c-surface); border: 2px solid var(--c-border); border-radius: var(--radius-sm); padding: 6px 10px; min-width: 150px; transition: border-color 0.2s, background 0.2s, box-shadow 0.2s; box-shadow: 0 2px 6px rgba(0,0,0,0.15); }
.pbq-node-select-wrap:focus-within { border-color: var(--c-primary); background: var(--c-primary-muted); box-shadow: 0 0 0 3px var(--c-primary-muted), 0 2px 8px rgba(0,0,0,0.2); }
.pbq-node-select { width: 100%; background: transparent; border: none; color: var(--c-text); font-size: 12px; font-weight: 600; text-align: center; appearance: none; -webkit-appearance: none; cursor: pointer; padding: 2px 0; }
.pbq-node-select:focus { outline: none; }
.pbq-node-select option { background: var(--c-surface); color: var(--c-text); }
[data-pbq-field].correct .pbq-node-select-wrap { border-color: var(--c-success); background: var(--c-success-muted); box-shadow: 0 0 0 2px rgba(34,197,94,0.15); }
[data-pbq-field].incorrect .pbq-node-select-wrap { border-color: var(--c-danger); background: var(--c-danger-muted); box-shadow: 0 0 0 2px rgba(239,68,68,0.15); }

/* Correct value hint shown after submission on incorrect diagram nodes */
.pbq-node-correct-hint { font-size: 11px; font-weight: 600; color: var(--c-success); text-align: center; margin-top: 2px; }

/* Bidirectional link (for ISP A <-> ISP B etc) */
.pbq-node-bilink { display: flex; align-items: center; gap: 0; }
.pbq-node-bilink-line { width: 32px; height: 2px; background: var(--c-border); }
.pbq-node-bilink-arrow { font-size: 10px; color: var(--c-text-muted); }

/* ── INVESTIGATION (PBQ3, PBQ5) ── */
.pbq-investigation-panels { margin-bottom: 20px; display: flex; flex-direction: column; gap: 4px; }
.pbq-inv-toggle { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 11px 16px; background: var(--c-bg-raised); border: 1px solid var(--c-border); border-radius: var(--radius-sm); cursor: pointer; font-size: 13px; font-weight: 600; color: var(--c-text); transition: background 0.15s, border-color 0.15s; }
.pbq-inv-toggle:hover { background: var(--c-surface); border-color: var(--c-text-muted); }
.pbq-inv-toggle.open { background: var(--c-primary-muted); border-color: var(--c-primary); color: var(--c-primary); border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.pbq-inv-toggle-icon { font-size: 10px; flex-shrink: 0; transition: transform 0.2s; }
.pbq-inv-toggle.open .pbq-inv-toggle-icon { transform: rotate(90deg); }
.pbq-inv-toggle-badge { margin-left: auto; font-size: 10px; font-weight: 600; padding: 2px 7px; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 20px; color: var(--c-text-secondary); text-transform: uppercase; letter-spacing: 0.04em; }
.pbq-inv-toggle.open .pbq-inv-toggle-badge { background: rgba(59,130,246,0.2); border-color: var(--c-primary); color: var(--c-primary); }
.pbq-inv-content { display: none; border: 1px solid var(--c-primary); border-top: none; border-radius: 0 0 var(--radius-sm) var(--radius-sm); background: #0d1520; }
.pbq-inv-content.open { display: block; }

/* Terminal-style log output */
.pbq-inv-log { padding: 14px 18px; font-family: var(--font-mono); font-size: 12px; line-height: 1.8; color: #a8c5a0; white-space: pre-wrap; word-break: break-all; max-height: 280px; overflow-y: auto; }
.pbq-inv-log::-webkit-scrollbar { width: 6px; }
.pbq-inv-log::-webkit-scrollbar-track { background: transparent; }
.pbq-inv-log::-webkit-scrollbar-thumb { background: var(--c-border); border-radius: 3px; }

/* Inline log highlighting */
.pbq-inv-log .log-warn { color: var(--c-warning); }
.pbq-inv-log .log-error { color: var(--c-danger); }
.pbq-inv-log .log-ok { color: var(--c-success); }
.pbq-inv-log .log-ts { color: var(--c-text-muted); }

/* Investigation data table */
.pbq-inv-table-wrap { overflow-x: auto; }
.pbq-inv-data-table { width: 100%; border-collapse: collapse; font-size: 12px; font-family: var(--font-mono); }
.pbq-inv-data-table thead tr { background: rgba(255,255,255,0.03); }
.pbq-inv-data-table th { padding: 8px 12px; text-align: left; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--c-text-muted); border-bottom: 1px solid var(--c-border); white-space: nowrap; }
.pbq-inv-data-table td { padding: 6px 12px; border-bottom: 1px solid rgba(255,255,255,0.04); color: var(--c-text-secondary); }
.pbq-inv-data-table tbody tr:hover td { background: rgba(255,255,255,0.02); color: var(--c-text); }

/* Answer section below investigation panels */
.pbq-investigation-answers { background: var(--c-bg-raised); border: 1px solid var(--c-border); border-radius: var(--radius-md); padding: 16px; }
.pbq-investigation-answers .pbq-section-title { margin-bottom: 14px; }

/* ── TERMINAL ORDERING (PBQ1) ── */
.pbq-terminal-section { background: #0a0f1a; border: 1px solid #1e2d3d; border-radius: var(--radius-md); overflow: hidden; margin-bottom: 16px; }
.pbq-terminal-header { display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: #111827; border-bottom: 1px solid #1e2d3d; }
.pbq-terminal-dots { display: flex; gap: 5px; }
.pbq-terminal-dot { width: 10px; height: 10px; border-radius: 50%; }
.pbq-terminal-dot.red { background: #ff5f57; }
.pbq-terminal-dot.yellow { background: #febc2e; }
.pbq-terminal-dot.green { background: #28c840; }
.pbq-terminal-title { margin-left: 4px; font-size: 12px; font-weight: 600; color: var(--c-text-muted); font-family: var(--font-mono); }
.pbq-terminal-body { padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; }
.pbq-terminal-step { display: flex; align-items: center; gap: 12px; }
.pbq-terminal-prompt { font-family: var(--font-mono); font-size: 15px; color: #4ade80; flex-shrink: 0; user-select: none; }
.pbq-terminal-step-label { font-family: var(--font-mono); font-size: 13px; color: var(--c-text-muted); flex-shrink: 0; min-width: 220px; }
.pbq-terminal-select { flex: 1; padding: 8px 12px; border: 1px solid #1e2d3d; border-radius: var(--radius-sm); background: #111827; color: #a8c5a0; font-size: 14px; font-family: var(--font-mono); }
.pbq-terminal-select:focus { outline: none; border-color: var(--c-primary); background: #0d1a2e; }
[data-pbq-field].correct .pbq-terminal-select { border-color: var(--c-success); background: rgba(34,197,94,0.08); color: var(--c-success); }
[data-pbq-field].incorrect .pbq-terminal-select { border-color: var(--c-danger); background: rgba(239,68,68,0.08); color: var(--c-danger); }

/* ── Inline Command Terminal (PBQ2 Part 2) ── */
.pbq-terminal { background: #0a0f1a; border: 1px solid #1e2d3d; border-radius: var(--radius-md); overflow: hidden; margin-bottom: 16px; }
.pbq-terminal-chrome { display: flex; align-items: center; gap: 8px; padding: 8px 14px; background: #111827; border-bottom: 1px solid #1e2d3d; }
.pbq-terminal-chrome .pbq-terminal-dots { display: flex; gap: 5px; }
.pbq-terminal-chrome .pbq-terminal-dots span { width: 10px; height: 10px; border-radius: 50%; }
.pbq-terminal-chrome .pbq-terminal-dots span:nth-child(1) { background: #ff5f57; }
.pbq-terminal-chrome .pbq-terminal-dots span:nth-child(2) { background: #febc2e; }
.pbq-terminal-chrome .pbq-terminal-dots span:nth-child(3) { background: #28c840; }
.pbq-terminal-chrome .pbq-terminal-title { font-size: 12px; font-weight: 600; color: var(--c-text-muted); font-family: var(--font-mono); }
.pbq-inline-cmd-body { padding: 16px 20px; }
.pbq-inline-cmd-line { font-family: var(--font-mono); font-size: 15px; line-height: 2.2; color: #c8d6e5; white-space: pre-wrap; }
.pbq-cmd-text { color: #a8c5a0; }
.pbq-inline-select-wrap { display: inline-block; vertical-align: baseline; }
.pbq-inline-select { font-family: var(--font-mono); font-size: 14px; font-weight: 600; padding: 3px 8px; border: 2px solid var(--c-primary); border-radius: 4px; background: rgba(59,130,246,0.1); color: var(--c-primary-hover); cursor: pointer; min-width: 140px; }
.pbq-inline-select:focus { outline: none; border-color: var(--c-accent); background: rgba(6,182,212,0.1); }
[data-pbq-field].correct .pbq-inline-select { border-color: var(--c-success); background: rgba(34,197,94,0.1); color: var(--c-success); }
[data-pbq-field].incorrect .pbq-inline-select { border-color: var(--c-danger); background: rgba(239,68,68,0.1); color: var(--c-danger); }
[data-theme="light"] .pbq-terminal { background: #1a1a2e; border-color: #2d3561; }
[data-theme="light"] .pbq-terminal-chrome { background: #16213e; border-color: #2d3561; }

/* ── FORM TABS (PBQ2, PBQ4) ── */
.pbq-form-section { margin-bottom: 20px; }
.pbq-form-section-header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--c-border); }
.pbq-form-section-icon { width: 28px; height: 28px; border-radius: 50%; background: var(--c-primary-muted); border: 1px solid var(--c-primary); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: var(--c-primary); flex-shrink: 0; }
.pbq-form-section-title { font-size: 17px; font-weight: 700; color: var(--c-text); }
.pbq-form-desc { font-size: 14px; color: var(--c-text-secondary); margin-bottom: 14px; line-height: 1.6; font-family: var(--font-mono); background: var(--c-bg); border: 1px solid var(--c-border); border-radius: var(--radius-sm); padding: 10px 14px; }
.pbq-form-row { display: grid; grid-template-columns: minmax(180px, 240px) 1fr; align-items: center; gap: 12px; padding: 9px 14px; border: 1px solid var(--c-border); border-radius: var(--radius-sm); margin-bottom: 6px; background: var(--c-bg-raised); transition: border-color 0.2s; }
.pbq-form-row:hover { border-color: var(--c-text-muted); }
.pbq-form-row.row-fixed { background: rgba(6,182,212,0.04); border-color: rgba(6,182,212,0.2); }
.pbq-form-row-label { font-size: 14px; font-weight: 500; color: var(--c-text-secondary); }
.pbq-form-row-value .pbq-select, .pbq-form-row-value .pbq-input { width: 100%; }
.pbq-form-row.correct { border-color: var(--c-success) !important; background: var(--c-success-muted) !important; }
.pbq-form-row.incorrect { border-color: var(--c-danger) !important; background: var(--c-danger-muted) !important; }
[data-pbq-field].correct.pbq-form-row { border-color: var(--c-success) !important; background: var(--c-success-muted) !important; }
[data-pbq-field].incorrect.pbq-form-row { border-color: var(--c-danger) !important; background: var(--c-danger-muted) !important; }
/* Correct value hint for form rows */
.pbq-form-row-correct-hint { font-size: 12px; font-weight: 600; color: var(--c-success); margin-top: 3px; }

/* ── VPN GATEWAY DUAL-PANEL LAYOUT (PBQ4) ── */
.pbq-vpn-panels { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 8px; }
.pbq-vpn-panel { border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--c-border); }
.pbq-vpn-panel-header { padding: 12px 16px; font-size: 13px; font-weight: 700; letter-spacing: 0.04em; display: flex; align-items: center; gap: 8px; }
.pbq-vpn-panel-alpha .pbq-vpn-panel-header { background: linear-gradient(90deg, rgba(59,130,246,0.25) 0%, rgba(59,130,246,0.08) 100%); border-bottom: 1px solid rgba(59,130,246,0.35); color: #93c5fd; }
.pbq-vpn-panel-beta .pbq-vpn-panel-header { background: linear-gradient(90deg, rgba(6,182,212,0.25) 0%, rgba(6,182,212,0.08) 100%); border-bottom: 1px solid rgba(6,182,212,0.35); color: #67e8f9; }
.pbq-vpn-panel-body { padding: 12px 14px; background: var(--c-bg-raised); }
.pbq-vpn-phase-header { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--c-text-muted); padding: 8px 0 6px 0; margin-top: 4px; border-bottom: 1px solid var(--c-border); margin-bottom: 8px; }
.pbq-vpn-phase-header:first-child { margin-top: 0; }
.pbq-vpn-panel .pbq-form-row { margin-bottom: 5px; grid-template-columns: minmax(130px, 160px) 1fr; gap: 8px; padding: 7px 10px; }
.pbq-vpn-panel .pbq-form-row-label { font-size: 13px; }

/* VPN Gateway banner (old, kept for legacy compat) */
.pbq-vpn-banner { display: flex; align-items: center; justify-content: center; gap: 0; margin-bottom: 20px; padding: 14px 16px; background: var(--c-bg); border: 1px solid var(--c-border); border-radius: var(--radius-md); flex-wrap: wrap; gap: 8px; }
.pbq-vpn-gateway { text-align: center; }
.pbq-vpn-gw-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--c-text-muted); margin-bottom: 4px; }
.pbq-vpn-gw-box { background: var(--c-primary-muted); border: 2px solid var(--c-primary); border-radius: var(--radius-sm); padding: 8px 16px; font-size: 12px; font-weight: 700; color: var(--c-primary); font-family: var(--font-mono); white-space: nowrap; }
.pbq-vpn-tunnel { display: flex; flex-direction: column; align-items: center; padding: 0 12px; }
.pbq-vpn-tunnel-line { height: 2px; width: 80px; background: linear-gradient(90deg, var(--c-primary), var(--c-accent)); }
.pbq-vpn-tunnel-label { font-size: 9px; color: var(--c-text-muted); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.07em; }
.pbq-vpn-internet { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-sm); padding: 8px 14px; font-size: 12px; font-weight: 600; color: var(--c-text-secondary); }

/* ── SSL FLOW DIAGRAM (PBQ2 Part 1) ── */
.pbq-ssl-flow { display: flex; align-items: flex-start; gap: 0; flex-wrap: wrap; margin-bottom: 16px; padding: 24px 20px; background: var(--c-bg); border: 1px solid var(--c-border); border-radius: var(--radius-md); overflow-x: auto; justify-content: center; }
.pbq-ssl-flow-split { flex-basis: 100%; margin-top: 0; }
.pbq-ssl-flow-node { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 120px; }
.pbq-ssl-flow-node-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--c-text-muted); text-align: center; max-width: 150px; line-height: 1.3; }
.pbq-ssl-flow-node-box { background: var(--c-surface); border: 2px solid var(--c-border); border-radius: var(--radius-sm); padding: 6px 10px; min-width: 120px; text-align: center; box-shadow: 0 2px 6px rgba(0,0,0,0.15); }
.pbq-ssl-flow-node-box select { width: 100%; background: transparent; border: none; color: var(--c-text); font-size: 14px; font-weight: 600; text-align: center; cursor: pointer; padding: 4px 0; appearance: none; -webkit-appearance: none; }
.pbq-ssl-flow-node-box select:focus { outline: none; }
.pbq-ssl-flow-node-box.flow-internet { background: rgba(245,158,11,0.08); border-color: rgba(245,158,11,0.4); }
.pbq-ssl-flow-node-box.flow-internet span { font-size: 13px; font-weight: 700; color: var(--c-warning); padding: 4px 0; display: block; }
.pbq-ssl-flow-arrow { display: flex; align-items: center; padding: 0 2px; margin-top: 22px; color: var(--c-text-muted); font-size: 16px; flex-shrink: 0; }
.pbq-ssl-flow-split { display: flex; flex-direction: column; align-items: center; gap: 0; position: relative; padding-top: 20px; }
.pbq-ssl-flow-split::before { content: '↓'; position: absolute; top: 0; left: 50%; transform: translateX(-50%); color: var(--c-text-muted); font-size: 18px; line-height: 1; }
.pbq-ssl-flow-split-label { display: none; }
.pbq-ssl-flow-split-row { display: flex; gap: 32px; align-items: flex-start; position: relative; padding-top: 20px; }
.pbq-ssl-flow-split-row::before { content: ''; position: absolute; top: 8px; left: 25%; width: 50%; height: 2px; background: var(--c-text-muted); opacity: 0.5; }
.pbq-ssl-flow-split-row .pbq-ssl-flow-node { position: relative; }
.pbq-ssl-flow-split-row .pbq-ssl-flow-node::before { content: '↓'; position: absolute; top: -20px; left: 50%; transform: translateX(-50%); color: var(--c-text-muted); font-size: 14px; }
[data-pbq-field].correct .pbq-ssl-flow-node-box { border-color: var(--c-success); background: var(--c-success-muted); }
[data-pbq-field].incorrect .pbq-ssl-flow-node-box { border-color: var(--c-danger); background: var(--c-danger-muted); }
.pbq-ssl-flow-node .pbq-node-correct-hint { font-size: 10px; }

/* ── SCORE INFO ── */
.pbq-score-info { margin-top: 12px; padding: 10px 14px; background: var(--c-warning-muted); border: 1px solid var(--c-warning); border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; color: var(--c-warning); }

/* ── Light theme overrides ── */
[data-theme="light"] .pbq-terminal-section { background: #1a1a2e; border-color: #2d3561; }
[data-theme="light"] .pbq-terminal-header { background: #16213e; border-color: #2d3561; }
[data-theme="light"] .pbq-inv-content { background: #f8fafc; }
[data-theme="light"] .pbq-inv-log { color: #166534; background: #f0fdf4; }
[data-theme="light"] .pbq-fixed-value { background: rgba(6,182,212,0.1); }

/* ── Mobile responsive ── */
@media (max-width: 768px) {
    .pbq-field { flex-direction: column; align-items: flex-start; gap: 6px; }
    .pbq-field-label { min-width: unset; }
    .pbq-tabs { gap: 0; }
    .pbq-tab { padding: 8px 12px; font-size: 12px; }
    .pbq-table th, .pbq-table td { padding: 8px 10px; }
    .pbq-table td.pbq-td-desc { max-width: 160px; font-size: 12px; }
    .pbq-node-row { gap: 8px; }
    .pbq-node-select-wrap { min-width: 120px; }
    .pbq-form-row { grid-template-columns: 1fr; }
    .pbq-vpn-panels { grid-template-columns: 1fr; }
    .pbq-vpn-panel .pbq-form-row { grid-template-columns: 1fr; }
    .pbq-vpn-tunnel-line { width: 40px; }
    .pbq-terminal-step { flex-direction: column; align-items: flex-start; }
    .pbq-terminal-step-label { min-width: unset; }
    .pbq-terminal-select { width: 100%; }
    .pbq-ssl-flow { gap: 0; }
    .pbq-ssl-flow-node { min-width: 80px; }
    .pbq-ssl-flow-node-box { min-width: 75px; }
}
