@import 'tailwindcss';

@source '../../vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php';
@source '../../storage/framework/views/*.php';
@source '../**/*.blade.php';
@source '../**/*.js';

@theme {
    --font-sans: 'Instrument Sans', ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
        'Segoe UI Symbol', 'Noto Color Emoji';
}

@layer components {
    .app-shell {
        @apply min-h-screen bg-gradient-to-br from-slate-950 via-slate-900 to-blue-950 text-slate-100 transition-colors duration-300;
    }

    .app-card {
        @apply rounded-2xl border border-white/10 bg-white/5 shadow-xl shadow-black/20 backdrop-blur transition duration-200 hover:-translate-y-0.5 hover:border-white/20 hover:shadow-2xl;
    }

    .app-card-light {
        @apply rounded-2xl border border-slate-200 bg-white shadow-sm;
    }

    .app-heading {
        @apply text-3xl font-bold tracking-tight text-white;
    }

    .btn-primary {
        @apply inline-flex items-center justify-center rounded-xl bg-blue-500 px-4 py-2 font-medium text-white transition duration-200 hover:-translate-y-0.5 hover:bg-blue-400 active:translate-y-0;
    }

    .btn-secondary {
        @apply inline-flex items-center justify-center rounded-xl border border-white/20 bg-white/5 px-4 py-2 font-medium text-white transition duration-200 hover:-translate-y-0.5 hover:bg-white/10 active:translate-y-0;
    }

    .app-header {
        @apply border-b border-white/10 bg-black/20 backdrop-blur transition-colors duration-300;
    }

    .app-nav-link {
        @apply rounded-lg px-3 py-2 text-slate-200 transition duration-200 hover:-translate-y-0.5 hover:bg-white/10 hover:text-white;
    }

    .app-nav-link-active {
        @apply bg-blue-500/30 text-white ring-1 ring-blue-300/40;
    }

    .app-theme-toggle {
        @apply rounded-lg border border-white/20 bg-white/5 px-3 py-2 text-xs font-medium text-slate-100 transition hover:bg-white/10;
    }

    .brand-link {
        @apply inline-flex items-center gap-2 text-xl font-semibold tracking-tight text-white transition-colors duration-200;
    }

    .brand-link:hover { @apply text-blue-200; }

    .brand-icon {
        @apply h-6 w-6 text-blue-300 transition-transform duration-300;
        flex-shrink: 0;
    }

    .brand-link:hover .brand-icon { transform: rotate(-8deg) scale(1.05); }

    .brand-name { letter-spacing: -0.01em; }

    .app-footer {
        @apply mt-12 border-t border-white/10 bg-black/20 backdrop-blur transition-colors duration-300;
    }

    .app-footer-logo {
        @apply h-16 w-auto opacity-90 transition-all duration-300;
    }

    .app-footer-text {
        @apply text-xs text-slate-400;
    }
}

@layer base {
    input, select, textarea, button {
        @apply transition duration-200;
    }

    input:focus, select:focus, textarea:focus, button:focus {
        @apply outline-none ring-2 ring-blue-400/60;
    }
}

.theme-light body.app-shell {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 45%, #dbeafe 100%);
    color: #0f172a;
}

.theme-light .app-header {
    border-color: #cbd5e1;
    background: rgba(248, 250, 252, 0.8);
}

.theme-light .app-card {
    border-color: #dbeafe;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
}

.theme-light .app-nav-link,
.theme-light .app-theme-toggle {
    color: #334155;
    border-color: #cbd5e1;
    background: rgba(255, 255, 255, 0.9);
}

.theme-light .app-nav-link:hover,
.theme-light .app-theme-toggle:hover {
    color: #0f172a;
    background: #eef2ff;
}

.theme-light .app-nav-link-active {
    background: #dbeafe;
    color: #1e3a8a;
    box-shadow: inset 0 0 0 1px #93c5fd;
}

.theme-light .app-heading,
.theme-light .text-white {
    color: #0f172a !important;
}

.theme-light .brand-link { color: #0f172a; }
.theme-light .brand-link:hover { color: #1d4ed8; }
.theme-light .brand-icon { color: #2563eb; }

.theme-light .app-footer {
    border-top-color: #cbd5e1;
    background: rgba(248, 250, 252, 0.8);
}
.theme-light .app-footer-logo {
    filter: brightness(0);
    opacity: 0.85;
}
.theme-light .app-footer-text { color: #475569; }

.theme-light .text-slate-300,
.theme-light .text-slate-200,
.theme-light .text-slate-100 {
    color: #334155 !important;
}

.theme-light .text-blue-300,
.theme-light .text-blue-200 {
    color: #1d4ed8 !important;
}

.theme-light .text-emerald-200 { color: #047857 !important; }
.theme-light .text-rose-100    { color: #9f1239 !important; }
.theme-light .text-emerald-100 { color: #065f46 !important; }
.theme-light .text-slate-400   { color: #64748b !important; }
.theme-light .text-slate-500   { color: #475569 !important; }

/* --- form fields (covers Tailwind utility-styled inputs across staff forms) --- */
.theme-light input[type="text"],
.theme-light input[type="number"],
.theme-light input[type="search"],
.theme-light input[type="url"],
.theme-light input[type="email"],
.theme-light input[type="password"],
.theme-light input[type="file"],
.theme-light select,
.theme-light textarea {
    background-color: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}
.theme-light input::placeholder,
.theme-light textarea::placeholder {
    color: #94a3b8 !important;
}
.theme-light label,
.theme-light kbd {
    color: #334155;
}

/* --- model detail tabs --- */
.theme-light [data-tab-btn] {
    color: #475569 !important;
}
.theme-light [data-tab-btn].bg-blue-500\/30,
.theme-light [data-tab-btn][class*="bg-blue-500"] {
    background-color: #dbeafe !important;
    color: #1e3a8a !important;
}

/* --- generic dark surfaces nested inside cards --- */
.theme-light .app-card .border-white\/10,
.theme-light .app-card [class*="border-white/"] {
    border-color: #e2e8f0 !important;
}
.theme-light .app-card .bg-white\/5,
.theme-light .app-card [class*="bg-white/"] {
    background-color: #f8fafc !important;
}
.theme-light .app-card .bg-slate-900\/40,
.theme-light .app-card .bg-slate-900\/60,
.theme-light .app-card .bg-slate-900\/70,
.theme-light .app-card [class*="bg-slate-900/"] {
    background-color: #ffffff !important;
}

/* ============================================================
   LIGHT THEME — bespoke component overrides
   ============================================================ */

/* Hero */
.theme-light .hero-card {
    background:
        radial-gradient(80% 60% at 100% 0%, rgba(59, 130, 246, 0.10), transparent 70%),
        linear-gradient(135deg, #ffffff, #f1f5f9);
    border-color: #dbeafe;
    box-shadow: 0 10px 30px -16px rgba(15, 23, 42, 0.10);
}
.theme-light .hero-eyebrow { color: #1d4ed8; }
.theme-light .hero-title   { color: #0f172a; }
.theme-light .hero-lede    { color: #475569; }
.theme-light .hero-btn-primary { background: #2563eb; color: #ffffff; }
.theme-light .hero-btn-primary:hover { background: #1d4ed8; }
.theme-light .hero-btn-ghost {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #1f2937;
}
.theme-light .hero-btn-ghost:hover {
    background: #eef2ff;
    border-color: #93c5fd;
    color: #1e3a8a;
}
.theme-light .hero-stats {
    background: #eef2f7;
    border-color: #e2e8f0;
}
.theme-light .hero-stat       { background: #ffffff; }
.theme-light .hero-stat-value { color: #0f172a; }
.theme-light .hero-stat-label { color: #64748b; }

/* Section heads / library head */
.theme-light .section-title { color: #0f172a; }
.theme-light .section-link  { color: #1d4ed8; }
.theme-light .section-link:hover { color: #1e40af; }
.theme-light .filter-clear { color: #64748b; }
.theme-light .filter-clear:hover { color: #be123c; }

/* Library filter */
.theme-light .library-filter {
    background: #ffffff;
    border-color: #e2e8f0;
}
.theme-light .library-filter-label { color: #475569; }
.theme-light .library-filter-field input,
.theme-light .library-filter-field select {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}
.theme-light .library-filter-field input:focus,
.theme-light .library-filter-field select:focus {
    border-color: #93c5fd !important;
}
.theme-light .library-empty {
    background: #ffffff;
    border-color: #cbd5e1;
}

/* Model card */
.theme-light .model-card {
    background: #ffffff;
    border-color: #e2e8f0;
}
.theme-light .model-card:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}
.theme-light .model-card-thumb {
    background: #f1f5f9;
    border-bottom-color: #e2e8f0;
}
.theme-light .model-card-thumb-fallback {
    background:
        radial-gradient(120% 80% at 30% 20%, rgba(59, 130, 246, 0.18), transparent 60%),
        linear-gradient(135deg, #eff6ff, #e0e7ff);
}
.theme-light .model-card-thumb-fallback span { color: rgba(30, 64, 175, 0.55); }
.theme-light .model-card-type {
    color: #1d4ed8;
    background: #dbeafe;
}
.theme-light .model-card-title { color: #0f172a; }
.theme-light .model-card-meta  { color: #64748b; }
.theme-light .model-card-time  { color: #64748b; }
.theme-light .model-card-cta   { color: #1d4ed8; }

/* Lesson card */
.theme-light .lesson-card {
    background: #ffffff;
    border-color: #e2e8f0;
}
.theme-light .lesson-card:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}
.theme-light .lesson-card-title   { color: #0f172a; }
.theme-light .lesson-card-summary { color: #64748b; }
.theme-light .lesson-card-steps   { color: #64748b; }
.theme-light .lesson-card-cta     { color: #1d4ed8; }

/* Meta strip */
.theme-light .meta-strip {
    background: #ffffff;
    border-color: #e2e8f0;
    color: #1f2937;
}
.theme-light .meta-strip-dot      { color: #cbd5e1; }
.theme-light .meta-strip-included { color: #475569; }
.theme-light .meta-strip-chip-blue    { color: #1d4ed8; background: #eff6ff; }
.theme-light .meta-strip-chip-emerald { color: #047857; background: #ecfdf5; }
.theme-light .meta-strip-chip-amber   { color: #b45309; background: #fffbeb; }

/* Teaching-content steps */
.theme-light .tc-meta-chip {
    background: #ffffff;
    border-color: #e2e8f0;
    color: #475569;
}
.theme-light .tc-meta-hint { color: #64748b; }
.theme-light .tc-step {
    background: #ffffff;
    border-color: #e2e8f0;
}
.theme-light .tc-step[open] {
    background: linear-gradient(180deg, #eff6ff, #ffffff);
    border-color: #bfdbfe;
}
.theme-light .tc-step-num {
    background: #dbeafe;
    border-color: #bfdbfe;
    color: #1d4ed8;
}
.theme-light .tc-step[open] .tc-step-num {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}
.theme-light .tc-step-heading { color: #0f172a; }
.theme-light .tc-step-chevron { color: #94a3b8; }
.theme-light .tc-step[open] .tc-step-chevron { color: #1d4ed8; }
.theme-light .tc-step-body { border-top-color: #e2e8f0; }
.theme-light .tc-step-prose { color: #1e293b; }

/* Video tab */
.theme-light .video-frame {
    background:
        radial-gradient(60% 80% at 50% -10%, rgba(59, 130, 246, 0.15), transparent 70%),
        #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 20px 50px -28px rgba(15, 23, 42, 0.18);
}
.theme-light .video-frame-inner {
    background: #0f172a;
    border-color: #e2e8f0;
}
.theme-light .video-fallback { color: #475569; }
.theme-light .video-action {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #1f2937;
}
.theme-light .video-action:hover {
    background: #eef2ff;
    border-color: #93c5fd;
    color: #1e3a8a;
}
.theme-light .video-badge { background: #ffffff; }
.theme-light .video-notes {
    background: #ffffff;
    border-color: #e2e8f0;
    border-left-color: #93c5fd;
}
.theme-light .video-notes-label { color: #1d4ed8; }
.theme-light .video-notes-body  { color: #1e293b; }

/* AI assistant */
.theme-light .ai-card        { background: #ffffff; border-color: #e2e8f0; }
.theme-light .ai-input-area  { background: transparent; }
.theme-light .ai-answer-area { background: #f8fafc; border-color: #e2e8f0; }
.theme-light .ai-answer-label { color: #047857; }
.theme-light .ai-message,
.theme-light .assistant-typing { color: #0f172a !important; }

/* Staff form tabs */
.theme-light .staff-tabs {
    background: #f8fafc;
    border-color: #e2e8f0;
}
.theme-light .staff-tab        { color: #475569; }
.theme-light .staff-tab:hover  { color: #0f172a; background: #eef2f7; }
.theme-light .staff-tab-active {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #1e3a8a;
}
.theme-light .staff-tab-num {
    background: #ffffff;
    border-color: #cbd5e1;
}
.theme-light .staff-tab-active .staff-tab-num {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}
.theme-light .staff-panel-footer { border-top-color: #e2e8f0; }

/* Buttons */
.theme-light .btn-primary { color: #ffffff; }
.theme-light .btn-secondary {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}
.theme-light .btn-secondary:hover {
    background: #eef2ff !important;
    border-color: #93c5fd !important;
}

/* Validation / notice banners */
.theme-light .bg-rose-500\/20 {
    background-color: #ffe4e6 !important;
    color: #9f1239 !important;
}
.theme-light .bg-emerald-500\/20 {
    background-color: #d1fae5 !important;
    color: #065f46 !important;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .app-card,
    .btn-primary,
    .btn-secondary,
    .app-nav-link {
        transform: none !important;
    }
}

.model-top-layout,
.model-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 24px;
    align-items: stretch;
    height: 650px;
}

.model-main-panel,
.model-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
}

/* Let the viewer fill: inner card must flex and allow shrinking (min-height: 0). */
.model-main-panel > .app-card {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.model-sidebar {
    width: 340px;
    max-width: 340px;
    min-width: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
}

.model-viewer-container {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    display: flex;
    min-height: 0;
}

.model-viewer-container iframe,
.model-viewer iframe {
    width: 100%;
    height: 100%;
    min-height: 480px;
    min-width: 0;
    max-width: none;
    border: 0;
    border-radius: 12px;
    display: block;
    flex: 1 1 auto;
    align-self: stretch;
}

.audio-card {
    flex: 0 0 auto;
}

.ai-card {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.ai-input-area {
    flex: 0 0 auto;
}

.ai-chat-history,
.ai-answer-area {
    flex: 1 1 auto;
    min-height: 0;
    max-height: 260px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 8px;
    overscroll-behavior: contain;
}

.ai-message,
.ai-answer {
    max-width: 100%;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.ai-input {
    width: 100%;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    border-radius: 10px;
    box-shadow: none;
    outline: none;
    resize: vertical;
}

.ai-input:focus {
    outline: none;
    box-shadow: none;
    border: 1px solid rgba(59, 130, 246, 0.8) !important;
    background: rgba(255, 255, 255, 0.06);
}

.ai-input::placeholder {
    color: rgba(255, 255, 255, 0.55);
    font-style: italic;
}

@media (max-width: 700px) {
    .model-top-layout,
    .model-layout {
        grid-template-columns: 1fr;
        height: auto;
    }

    .model-sidebar {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .model-viewer-container iframe,
    .model-viewer iframe {
        min-height: 360px;
    }
}

/* AI assistant final overrides: fixed-height scrollable answer box */
.model-sidebar {
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
}

.ai-card {
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

.ai-input-area {
    flex: 0 0 auto !important;
    margin-top: 12px !important;
    padding-top: 0 !important;
}

.ai-answer-area,
.ai-chat-history {
    flex: 1 1 auto !important;
    min-height: 160px !important;
    overflow-y: scroll !important;
    overflow-x: hidden !important;
    margin-top: 16px !important;
    padding: 12px !important;
    border-radius: 10px !important;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.55) rgba(15, 23, 42, 0.4);
}

.ai-answer-area::-webkit-scrollbar,
.ai-chat-history::-webkit-scrollbar {
    width: 8px;
}

.ai-answer-area::-webkit-scrollbar-track,
.ai-chat-history::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.4);
    border-radius: 8px;
}

.ai-answer-area::-webkit-scrollbar-thumb,
.ai-chat-history::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.55);
    border-radius: 8px;
}

.ai-answer-area::-webkit-scrollbar-thumb:hover,
.ai-chat-history::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.8);
}

.ai-message {
    display: block !important;
    max-width: 100% !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
}

.ai-answer .assistant-typing,
.ai-message .assistant-typing {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* ===================================================================
   Quiz runner (used inside the Quiz tab on /models/{slug})
   =================================================================== */

.quiz-runner {
    color: rgb(241 245 249);
}

.quiz-runner [hidden] {
    display: none !important;
}

.quiz-runner kbd {
    display: inline-block;
    min-width: 18px;
    padding: 1px 6px;
    margin: 0 1px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    color: rgb(226 232 240);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 11px;
    line-height: 1;
}

/* ---------- Cover screen ---------- */

.quiz-cover {
    max-width: 560px;
    margin: 0 auto;
    padding: 28px 24px;
    text-align: center;
    animation: quiz-fade-in 0.35s ease;
}

.quiz-cover-eyebrow {
    color: rgb(147 197 253);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-weight: 600;
}

.quiz-cover-title {
    margin-top: 8px;
    font-size: 26px;
    font-weight: 700;
    color: white;
    letter-spacing: -0.01em;
}

.quiz-cover-subtitle {
    margin-top: 8px;
    color: rgb(203 213 225);
    font-size: 14px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.quiz-cover-dot {
    color: rgba(148, 163, 184, 0.6);
}

.quiz-toggle {
    margin-top: 20px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    color: rgb(203 213 225);
    font-size: 13px;
}

.quiz-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.quiz-toggle-track {
    position: relative;
    width: 36px;
    height: 20px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    transition: background 0.2s ease, border-color 0.2s ease;
}

.quiz-toggle-track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background: rgb(226 232 240);
    border-radius: 999px;
    transition: transform 0.2s ease, background 0.2s ease;
}

.quiz-toggle input:checked + .quiz-toggle-track {
    background: rgba(59, 130, 246, 0.55);
    border-color: rgba(96, 165, 250, 0.6);
}

.quiz-toggle input:checked + .quiz-toggle-track::after {
    transform: translateX(16px);
    background: white;
}

.quiz-toggle input:focus-visible + .quiz-toggle-track {
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.35);
}

.quiz-cover-cta {
    margin-top: 20px;
    padding-left: 28px;
    padding-right: 28px;
    gap: 8px;
}

.quiz-cover-hint {
    margin-top: 16px;
    font-size: 12px;
    color: rgb(148 163 184);
}

/* ---------- Question screen ---------- */

.quiz-progress {
    margin-bottom: 16px;
    animation: quiz-fade-in 0.3s ease;
}

.quiz-progress-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 12px;
    color: rgb(148 163 184);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

.quiz-progress-text {
    color: rgb(226 232 240);
}

.quiz-progress-level {
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.15);
    color: rgb(110 231 183);
    border: 1px solid rgba(16, 185, 129, 0.25);
    text-transform: none;
    letter-spacing: 0;
}

.quiz-progress-level:empty {
    display: none;
}

.quiz-progress-bar {
    display: flex;
    gap: 4px;
    height: 6px;
}

.quiz-progress-segment {
    flex: 1 1 0;
    height: 100%;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    transition: background 0.2s ease, transform 0.2s ease;
}

.quiz-progress-segment.is-active {
    background: rgba(96, 165, 250, 0.6);
    transform: scaleY(1.4);
}

.quiz-progress-segment.is-correct {
    background: rgb(16 185 129);
}

.quiz-progress-segment.is-incorrect {
    background: rgb(244 63 94);
}

.quiz-progress-segment.is-skipped {
    background: rgba(148, 163, 184, 0.5);
}

.quiz-question-card {
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(15, 23, 42, 0.55);
    padding: 22px;
    animation: quiz-fade-in 0.35s ease;
}

.quiz-question-prompt {
    color: white;
    font-weight: 600;
    font-size: 17px;
    line-height: 1.5;
    margin-bottom: 18px;
}

.quiz-options-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quiz-option {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: rgb(226 232 240);
    text-align: left;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.quiz-option:hover:not(:disabled):not(.is-correct):not(.is-incorrect) {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.07);
}

.quiz-option:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.45);
}

.quiz-option.is-selected {
    border-color: rgba(96, 165, 250, 0.7);
    background: rgba(59, 130, 246, 0.18);
    box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.45) inset;
}

.quiz-option.is-correct {
    border-color: rgba(16, 185, 129, 0.7);
    background: rgba(16, 185, 129, 0.18);
    box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.55) inset;
    animation: quiz-pop 0.4s ease;
}

.quiz-option.is-incorrect {
    border-color: rgba(244, 63, 94, 0.65);
    background: rgba(244, 63, 94, 0.16);
    box-shadow: 0 0 0 1px rgba(244, 63, 94, 0.45) inset;
}

.quiz-option:disabled {
    cursor: default;
}

.quiz-option-letter {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
    color: rgb(226 232 240);
    font-size: 13px;
    font-weight: 700;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.quiz-option.is-selected .quiz-option-letter {
    background: rgba(59, 130, 246, 0.55);
    border-color: rgba(96, 165, 250, 0.7);
    color: white;
}

.quiz-option.is-correct .quiz-option-letter {
    background: rgb(16 185 129);
    border-color: rgb(16 185 129);
    color: white;
}

.quiz-option.is-incorrect .quiz-option-letter {
    background: rgb(244 63 94);
    border-color: rgb(244 63 94);
    color: white;
}

.quiz-option-text {
    flex: 1 1 auto;
    font-size: 14px;
    line-height: 1.5;
    color: rgb(226 232 240);
}

.quiz-option-icon {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.quiz-option.is-correct .quiz-option-icon::before {
    content: '\2713';
    color: rgb(110 231 183);
    font-weight: 700;
}

.quiz-option.is-incorrect .quiz-option-icon::before {
    content: '\2717';
    color: rgb(252 165 165);
    font-weight: 700;
}

.quiz-option.is-correct .quiz-option-icon,
.quiz-option.is-incorrect .quiz-option-icon {
    opacity: 1;
}

/* ---------- Feedback ---------- */

.quiz-feedback {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    animation: quiz-slide-in 0.3s ease;
}

.quiz-feedback.is-correct {
    border-color: rgba(16, 185, 129, 0.45);
    background: rgba(16, 185, 129, 0.12);
}

.quiz-feedback.is-incorrect {
    border-color: rgba(244, 63, 94, 0.45);
    background: rgba(244, 63, 94, 0.10);
}

.quiz-feedback.is-skipped {
    border-color: rgba(148, 163, 184, 0.4);
    background: rgba(148, 163, 184, 0.10);
}

.quiz-feedback-headline {
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: white;
}

.quiz-feedback.is-correct .quiz-feedback-headline {
    color: rgb(110 231 183);
}

.quiz-feedback.is-incorrect .quiz-feedback-headline {
    color: rgb(252 165 165);
}

.quiz-feedback.is-skipped .quiz-feedback-headline {
    color: rgb(203 213 225);
}

.quiz-feedback-text {
    margin-top: 6px;
    color: rgb(226 232 240);
    font-size: 14px;
    line-height: 1.55;
}

.quiz-feedback-text:empty {
    display: none;
}

/* ---------- Action bar ---------- */

.quiz-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 18px;
    flex-wrap: wrap;
}

.quiz-actions-end {
    justify-content: center;
}

.quiz-runner .btn-primary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

/* ---------- Results screen ---------- */

.quiz-results {
    text-align: center;
    padding: 12px 8px 4px;
    animation: quiz-fade-in 0.4s ease;
}

.quiz-score-ring {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto 18px;
    color: rgb(96 165 250);
}

.quiz-score-ring.tier-perfect { color: rgb(52 211 153); }
.quiz-score-ring.tier-high { color: rgb(74 222 128); }
.quiz-score-ring.tier-mid { color: rgb(250 204 21); }
.quiz-score-ring.tier-low { color: rgb(251 113 133); }

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

.quiz-score-track {
    stroke: rgba(255, 255, 255, 0.08);
}

.quiz-score-fill {
    stroke: currentColor;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.quiz-score-text {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.quiz-score-pct {
    font-size: 26px;
    font-weight: 700;
    color: white;
    letter-spacing: -0.02em;
}

.quiz-score-fraction {
    font-size: 12px;
    color: rgb(148 163 184);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.quiz-results-headline {
    font-size: 20px;
    font-weight: 700;
    color: white;
}

.quiz-results-message {
    margin-top: 6px;
    color: rgb(203 213 225);
    font-size: 14px;
}

.quiz-results-review {
    margin-top: 22px;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quiz-review-item {
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    overflow: hidden;
}

.quiz-review-item[open] {
    background: rgba(255, 255, 255, 0.05);
}

.quiz-review-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.quiz-review-summary::-webkit-details-marker { display: none; }

.quiz-review-number {
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: rgb(226 232 240);
    font-size: 12px;
    font-weight: 700;
}

.quiz-review-prompt {
    flex: 1 1 auto;
    color: rgb(226 232 240);
    font-size: 14px;
    line-height: 1.4;
}

.quiz-review-status {
    flex: 0 0 auto;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid transparent;
}

.quiz-review-item.is-correct .quiz-review-status {
    color: rgb(110 231 183);
    background: rgba(16, 185, 129, 0.18);
    border-color: rgba(16, 185, 129, 0.35);
}

.quiz-review-item.is-incorrect .quiz-review-status {
    color: rgb(252 165 165);
    background: rgba(244, 63, 94, 0.18);
    border-color: rgba(244, 63, 94, 0.35);
}

.quiz-review-item.is-skipped .quiz-review-status {
    color: rgb(203 213 225);
    background: rgba(148, 163, 184, 0.18);
    border-color: rgba(148, 163, 184, 0.3);
}

.quiz-review-item.is-correct .quiz-review-number {
    background: rgba(16, 185, 129, 0.25);
    color: rgb(167 243 208);
}

.quiz-review-item.is-incorrect .quiz-review-number {
    background: rgba(244, 63, 94, 0.25);
    color: rgb(254 205 211);
}

.quiz-review-body {
    padding: 0 14px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.quiz-review-body > .quiz-review-line:first-child {
    margin-top: 12px;
}

.quiz-review-line {
    font-size: 13px;
    color: rgb(226 232 240);
    line-height: 1.5;
}

.quiz-review-label {
    color: rgb(148 163 184);
    font-weight: 600;
    margin-right: 4px;
}

.quiz-review-explanation {
    color: rgb(203 213 225);
    font-style: normal;
}

.quiz-review-empty {
    color: rgb(148 163 184);
    font-style: italic;
}

/* ---------- Animations ---------- */

@keyframes quiz-fade-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes quiz-slide-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes quiz-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .quiz-cover,
    .quiz-progress,
    .quiz-question-card,
    .quiz-feedback,
    .quiz-results,
    .quiz-option.is-correct {
        animation: none !important;
    }
}

/* ---------- Light theme tweaks ---------- */

.theme-light .quiz-question-card {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(15, 23, 42, 0.08);
}

.theme-light .quiz-option {
    background: white;
    border-color: rgba(15, 23, 42, 0.1);
    color: rgb(15 23 42);
}

.theme-light .quiz-option-text,
.theme-light .quiz-question-prompt,
.theme-light .quiz-results-headline,
.theme-light .quiz-cover-title,
.theme-light .quiz-score-pct {
    color: rgb(15 23 42);
}

.theme-light .quiz-option-letter {
    background: rgba(15, 23, 42, 0.05);
    border-color: rgba(15, 23, 42, 0.1);
    color: rgb(15 23 42);
}

.theme-light .quiz-cover-subtitle,
.theme-light .quiz-cover-hint,
.theme-light .quiz-results-message,
.theme-light .quiz-toggle,
.theme-light .quiz-progress-text,
.theme-light .quiz-review-prompt,
.theme-light .quiz-review-line {
    color: rgb(51 65 85);
}

.theme-light .quiz-review-item {
    background: white;
    border-color: rgba(15, 23, 42, 0.08);
}

/* ---------- Small screens ---------- */

@media (max-width: 640px) {
    .quiz-question-card { padding: 16px; }
    .quiz-option { padding: 10px 12px; }
    .quiz-option-letter { width: 26px; height: 26px; font-size: 12px; }
    .quiz-actions { justify-content: stretch; }
    .quiz-actions .btn-primary,
    .quiz-actions .btn-secondary { flex: 1 1 auto; }
}

/* ============================================================
   Metadata tab — stat-card grid + jump row
   ============================================================ */

.meta-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(16, 185, 129, 0.06) 60%, rgba(245, 158, 11, 0.06));
    color: rgb(226 232 240);
    font-size: 12.5px;
}

.meta-strip-chip {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.01em;
    border: 1px solid currentColor;
    background: rgba(255, 255, 255, 0.04);
}

.meta-strip-chip-blue    { color: rgb(147 197 253); }
.meta-strip-chip-emerald { color: rgb(110 231 183); }
.meta-strip-chip-amber   { color: rgb(252 211 77); }

.meta-strip-dot {
    color: rgba(255, 255, 255, 0.25);
    font-size: 14px;
    line-height: 1;
}

.meta-strip-included {
    margin-left: auto;
    font-size: 12px;
    color: rgb(148 163 184);
}

.meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.meta-card {
    position: relative;
    overflow: hidden;
    padding: 16px 16px 14px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(6px);
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.meta-card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(135deg, var(--meta-accent, rgba(255,255,255,0.08)) 0%, transparent 60%);
    opacity: 0.55;
}

.meta-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.06);
}

.meta-card-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    margin-bottom: 10px;
    color: var(--meta-accent-strong, rgb(191 219 254));
    background: var(--meta-accent-soft, rgba(59, 130, 246, 0.15));
    border: 1px solid var(--meta-accent-border, rgba(147, 197, 253, 0.25));
}

.meta-card-icon svg {
    width: 18px;
    height: 18px;
}

.meta-card-label {
    position: relative;
    margin: 0;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgb(148 163 184);
}

.meta-card-value {
    position: relative;
    margin: 4px 0 0;
    font-size: 16px;
    font-weight: 600;
    color: rgb(248 250 252);
    line-height: 1.3;
    word-break: break-word;
}

.meta-card-unit {
    margin-left: 2px;
    font-size: 12px;
    font-weight: 500;
    color: rgb(148 163 184);
}

.meta-card-blue {
    --meta-accent: rgba(59, 130, 246, 0.18);
    --meta-accent-strong: rgb(147 197 253);
    --meta-accent-soft: rgba(59, 130, 246, 0.18);
    --meta-accent-border: rgba(147, 197, 253, 0.28);
}
.meta-card-emerald {
    --meta-accent: rgba(16, 185, 129, 0.18);
    --meta-accent-strong: rgb(110 231 183);
    --meta-accent-soft: rgba(16, 185, 129, 0.18);
    --meta-accent-border: rgba(110, 231, 183, 0.28);
}
.meta-card-amber {
    --meta-accent: rgba(245, 158, 11, 0.20);
    --meta-accent-strong: rgb(252 211 77);
    --meta-accent-soft: rgba(245, 158, 11, 0.18);
    --meta-accent-border: rgba(252, 211, 77, 0.28);
}
.meta-card-indigo {
    --meta-accent: rgba(99, 102, 241, 0.20);
    --meta-accent-strong: rgb(165 180 252);
    --meta-accent-soft: rgba(99, 102, 241, 0.18);
    --meta-accent-border: rgba(165, 180, 252, 0.28);
}
.meta-card-rose {
    --meta-accent: rgba(244, 63, 94, 0.18);
    --meta-accent-strong: rgb(253 164 175);
    --meta-accent-soft: rgba(244, 63, 94, 0.18);
    --meta-accent-border: rgba(253, 164, 175, 0.28);
}

/* ============================================================
   Teaching Content tab — numbered steps
   ============================================================ */

.tc-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.tc-meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(255, 255, 255, 0.04);
    color: rgb(203 213 225);
    font-size: 12px;
    font-weight: 500;
}
.tc-meta-chip svg { width: 14px; height: 14px; }

.tc-meta-hint {
    margin-left: auto;
    font-size: 11.5px;
    color: rgb(148 163 184);
}

.tc-stack { display: flex; flex-direction: column; gap: 10px; }

.tc-step {
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
    overflow: hidden;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.tc-step[open] {
    border-color: rgba(147, 197, 253, 0.30);
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.10), rgba(255, 255, 255, 0.03));
}

.tc-step-summary {
    list-style: none;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    cursor: pointer;
    user-select: none;
}
.tc-step-summary::-webkit-details-marker { display: none; }

.tc-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.18);
    border: 1px solid rgba(147, 197, 253, 0.30);
    color: rgb(191 219 254);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}
.tc-step[open] .tc-step-num {
    background: rgba(59, 130, 246, 0.30);
    color: white;
    border-color: rgba(147, 197, 253, 0.55);
}

.tc-step-heading {
    font-size: 14px;
    font-weight: 600;
    color: rgb(248 250 252);
    line-height: 1.35;
}

.tc-step-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: rgb(148 163 184);
    transition: transform 0.25s ease, color 0.2s ease;
}
.tc-step-chevron svg { width: 16px; height: 16px; }
.tc-step[open] .tc-step-chevron {
    transform: rotate(180deg);
    color: rgb(191 219 254);
}

.tc-step-body {
    padding: 0 14px 14px 56px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin-top: 0;
    animation: tc-step-fade-in 0.25s ease;
}

.tc-step-prose {
    margin: 12px 0 0;
    font-size: 14px;
    line-height: 1.65;
    color: rgb(226 232 240);
    white-space: pre-line;
}

@keyframes tc-step-fade-in {
    from { opacity: 0; transform: translateY(-3px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 640px) {
    .tc-step-body { padding-left: 14px; }
}

/* ============================================================
   Video tab — cinematic frame, provider badge, action buttons
   ============================================================ */

.video-frame {
    position: relative;
    padding: 14px;
    border-radius: 22px;
    background:
        radial-gradient(60% 80% at 50% -10%, rgba(59, 130, 246, 0.20), transparent 70%),
        radial-gradient(70% 80% at 50% 110%, rgba(168, 85, 247, 0.15), transparent 70%),
        rgba(8, 11, 22, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        0 30px 80px -30px rgba(59, 130, 246, 0.45),
        0 10px 40px -20px rgba(0, 0, 0, 0.6);
}

.video-frame-inner {
    position: relative;
    overflow: hidden;
    border-radius: 14px;
    aspect-ratio: 16 / 9;
    background: black;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.video-player {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    background: black;
}

.video-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 16px;
    color: rgb(203 213 225);
    font-size: 14px;
}

.video-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: 1px solid currentColor;
    background: rgba(255, 255, 255, 0.04);
}
.video-badge-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: currentColor;
    box-shadow: 0 0 6px currentColor;
}
.video-badge-youtube     { color: rgb(252 165 165); }
.video-badge-vimeo       { color: rgb(125 211 252); }
.video-badge-mediahopper { color: rgb(253 186 116); }
.video-badge-file        { color: rgb(110 231 183); }
.video-badge-external    { color: rgb(196 181 253); }

.video-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 11px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: rgb(226 232 240);
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.video-action:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.22);
    color: white;
}
.video-action svg { width: 14px; height: 14px; }
.video-action-success {
    color: rgb(110 231 183);
    border-color: rgba(110, 231, 183, 0.45);
    background: rgba(16, 185, 129, 0.12);
}

.video-notes {
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
        linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(255, 255, 255, 0.03));
    border-left: 3px solid rgba(147, 197, 253, 0.55);
}
.video-notes-label {
    margin: 0 0 4px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgb(191 219 254);
}
.video-notes-body {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: rgb(226 232 240);
    white-space: pre-line;
}

/* ============================================================
   Staff model form — tabbed layout
   ============================================================ */

.staff-form { display: flex; flex-direction: column; gap: 18px; }

.staff-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.staff-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: rgb(148 163 184);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.staff-tab:hover {
    color: rgb(226 232 240);
    background: rgba(255, 255, 255, 0.04);
}

.staff-tab-active {
    background: rgba(59, 130, 246, 0.18);
    border-color: rgba(147, 197, 253, 0.30);
    color: white;
}

.staff-tab-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.10);
    font-size: 11px;
    font-weight: 700;
    color: inherit;
}

.staff-tab-active .staff-tab-num {
    background: rgba(59, 130, 246, 0.40);
    border-color: rgba(147, 197, 253, 0.50);
    color: white;
}

.staff-panel { animation: staff-panel-fade 0.2s ease; }
.staff-panel.hidden { display: none; }

@keyframes staff-panel-fade {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.staff-panel-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.staff-panel-footer-right {
    margin-left: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.staff-panel-footer .btn-primary[disabled],
.staff-panel-footer .btn-secondary[disabled] {
    opacity: 0.45;
    pointer-events: none;
    cursor: not-allowed;
}

@media (max-width: 540px) {
    .staff-panel-footer { gap: 8px; }
    .staff-panel-footer-right { width: 100%; justify-content: stretch; }
    .staff-panel-footer-right > * { flex: 1 1 auto; text-align: center; }
    .staff-panel-footer > [data-form-nav="prev"] { width: 100%; }
}

/* ============================================================
   Section heads (used on home + library indexes)
   ============================================================ */

.section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.section-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: rgb(248 250 252);
    letter-spacing: -0.01em;
}

.section-link {
    font-size: 13px;
    color: rgb(147 197 253);
    transition: color 0.15s ease;
}
.section-link:hover { color: rgb(191 219 254); }

/* ============================================================
   Hero card (home page)
   ============================================================ */

.hero-card {
    position: relative;
    overflow: hidden;
    padding: 36px 28px 32px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
        radial-gradient(80% 60% at 100% 0%, rgba(59, 130, 246, 0.10), transparent 70%),
        linear-gradient(135deg, rgba(15, 23, 42, 0.85), rgba(30, 41, 59, 0.55));
}

.hero-inner { position: relative; }

.hero-eyebrow {
    margin: 0 0 12px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgb(147 197 253);
}

.hero-title {
    margin: 0;
    font-size: clamp(26px, 4vw, 38px);
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.1;
    color: rgb(248 250 252);
}

.hero-lede {
    margin: 12px 0 0;
    max-width: 60ch;
    font-size: 14.5px;
    line-height: 1.6;
    color: rgb(203 213 225);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.hero-btn {
    display: inline-flex;
    align-items: center;
    padding: 9px 16px;
    border-radius: 10px;
    font-weight: 500;
    font-size: 14px;
    border: 1px solid transparent;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.hero-btn-primary {
    color: white;
    background: rgb(59 130 246);
}
.hero-btn-primary:hover { background: rgb(37 99 235); }
.hero-btn-ghost {
    color: rgb(226 232 240);
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.12);
}
.hero-btn-ghost:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.20);
}

.hero-stats {
    margin-top: 24px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 1px;
    padding: 0;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    overflow: hidden;
}

.hero-stat {
    padding: 14px 16px;
    background: rgba(15, 23, 42, 0.55);
}
.hero-stat-value {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    color: rgb(248 250 252);
    line-height: 1.15;
}
.hero-stat-label {
    margin: 2px 0 0;
    font-size: 11.5px;
    font-weight: 500;
    color: rgb(148 163 184);
}

@media (max-width: 640px) {
    .hero-card { padding: 26px 20px 22px; border-radius: 16px; }
    .hero-stat { padding: 12px 14px; }
    .hero-stat-value { font-size: 20px; }
}

/* ============================================================
   Model card (home + models index)
   ============================================================ */

.model-card {
    --card-accent: rgb(125 211 252);
    --card-accent-soft: rgba(59, 130, 246, 0.14);

    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.model-card:hover {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.05);
}
.model-card:hover .model-card-thumb img {
    transform: scale(1.03);
}

.model-card-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    width: 100%;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.model-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}
.model-card-thumb-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(120% 80% at 30% 20%, rgba(59, 130, 246, 0.20), transparent 60%),
        linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.9));
}
.model-card-thumb-fallback span {
    font-size: 38px;
    font-weight: 700;
    color: rgba(147, 197, 253, 0.55);
    letter-spacing: 0.04em;
}

.model-card-inner {
    flex: 1 1 auto;
    padding: 14px 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.model-card-type {
    align-self: flex-start;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: rgb(147 197 253);
    background: rgba(59, 130, 246, 0.12);
}

.model-card-title {
    margin: 4px 0 0;
    font-size: 16px;
    font-weight: 600;
    color: rgb(248 250 252);
    line-height: 1.3;
}

.model-card-meta {
    margin: 0;
    font-size: 12.5px;
    color: rgb(148 163 184);
}

.model-card-foot {
    margin-top: auto;
    padding-top: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.model-card-time {
    font-size: 12px;
    color: rgb(148 163 184);
}

.model-card-cta {
    font-size: 12.5px;
    font-weight: 500;
    color: rgb(147 197 253);
}

/* per-type accents — subtle text-only */
.model-card-rose     { --card-accent: rgb(253 164 175); --card-accent-soft: rgba(244, 63, 94, 0.12);  }
.model-card-emerald  { --card-accent: rgb(110 231 183); --card-accent-soft: rgba(16, 185, 129, 0.12); }
.model-card-sky      { --card-accent: rgb(125 211 252); --card-accent-soft: rgba(14, 165, 233, 0.12); }
.model-card-amber    { --card-accent: rgb(252 211 77);  --card-accent-soft: rgba(245, 158, 11, 0.12); }
.model-card-indigo   { --card-accent: rgb(165 180 252); --card-accent-soft: rgba(99, 102, 241, 0.12); }
.model-card-fuchsia  { --card-accent: rgb(240 171 252); --card-accent-soft: rgba(217, 70, 239, 0.12); }

/* ============================================================
   Lesson card
   ============================================================ */

.lesson-card {
    display: block;
    padding: 16px 18px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.lesson-card:hover {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.05);
}

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

.lesson-card-title {
    margin: 0;
    font-size: 15.5px;
    font-weight: 600;
    color: rgb(248 250 252);
}

.lesson-card-summary {
    margin: 4px 0 0;
    font-size: 13px;
    line-height: 1.55;
    color: rgb(148 163 184);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.lesson-card-footrow {
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.lesson-card-steps {
    font-size: 12px;
    color: rgb(148 163 184);
}

.lesson-card-cta {
    font-size: 12.5px;
    font-weight: 500;
    color: rgb(147 197 253);
}

/* ============================================================
   Library (models / lessons index) — head + filter bar
   ============================================================ */

.library-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.filter-clear {
    font-size: 13px;
    color: rgb(148 163 184);
    transition: color 0.15s ease;
}
.filter-clear:hover { color: rgb(253 164 175); }

.library-filter {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 10px;
    padding: 12px;
    margin-bottom: 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
}

.library-filter-field { display: flex; flex-direction: column; gap: 4px; }

.library-filter-label {
    font-size: 11px;
    font-weight: 500;
    color: rgb(148 163 184);
}

.library-filter-field input,
.library-filter-field select {
    width: 100%;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(15, 23, 42, 0.55);
    color: rgb(241 245 249);
    font-size: 13.5px;
}
.library-filter-field input::placeholder { color: rgb(100 116 139); }
.library-filter-field input:focus,
.library-filter-field select:focus {
    outline: none;
    border-color: rgba(147, 197, 253, 0.40);
}

.library-filter-submit {
    align-self: flex-end;
    height: 36px;
    padding: 0 18px;
}

@media (max-width: 720px) {
    .library-filter { grid-template-columns: 1fr 1fr; }
    .library-filter-field:first-child { grid-column: 1 / -1; }
    .library-filter-submit { grid-column: 1 / -1; justify-content: center; }
}

.library-active-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}
.library-chip {
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: rgb(203 213 225);
    font-size: 12px;
}
.library-chip strong { color: white; font-weight: 600; }

.library-empty {
    padding: 28px 24px;
    border-radius: 18px;
    border: 1px dashed rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.02);
    text-align: center;
}

/* --- Suggested prompt chips on the public AI assistant --- */
.ai-prompts {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.ai-prompts-label {
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: rgba(148, 163, 184, 0.85);
    margin: 0;
}
.ai-prompts-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.ai-prompt-chip {
    appearance: none;
    border: 1px solid rgba(59, 130, 246, 0.35);
    background: rgba(59, 130, 246, 0.10);
    color: rgb(191 219 254);
    border-radius: 999px;
    padding: 5px 11px;
    font-size: 12px;
    line-height: 1.3;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
    text-align: left;
    max-width: 100%;
}
.ai-prompt-chip:hover {
    background: rgba(59, 130, 246, 0.18);
    border-color: rgba(59, 130, 246, 0.55);
    color: white;
}
.ai-prompt-chip:active { transform: translateY(1px); }

.theme-light .ai-prompts-label { color: #475569; }
.theme-light .ai-prompt-chip {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
}
.theme-light .ai-prompt-chip:hover {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #1e3a8a;
}

/* --- Staff prompt-row editor (AI Assistant tab) --- */
.prompt-row { transition: border-color 0.15s ease, background 0.15s ease; }
.prompt-row:focus-within {
    border-color: rgba(59, 130, 246, 0.55);
    background: rgba(59, 130, 246, 0.08);
}
.prompt-remove {
    appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(248, 113, 113, 0.85);
    width: 30px;
    height: 30px;
    border-radius: 8px;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
}
.prompt-remove:hover {
    background: rgba(248, 113, 113, 0.15);
    border-color: rgba(248, 113, 113, 0.45);
    color: rgb(254 226 226);
}

.theme-light .prompt-row {
    border-color: #e2e8f0 !important;
    background: #ffffff !important;
}
.theme-light .prompt-row:focus-within {
    border-color: #93c5fd !important;
    background: #eff6ff !important;
}
.theme-light .prompt-remove {
    border-color: #fecaca;
    background: #ffffff;
    color: #b91c1c;
}
.theme-light .prompt-remove:hover {
    background: #fee2e2;
    border-color: #f87171;
    color: #7f1d1d;
}

