/* =====================================================================
   SmartQuiz – Design System (mobile-first, di atas Bootstrap 5)
   ===================================================================== */

@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../vendor/inter/inter-latin-wght-normal.woff2") format("woff2");
}

:root {
    --sq-primary: #2563EB;
    --sq-primary-600: #1D4ED8;
    --sq-primary-50: #EFF6FF;
    --sq-primary-100: #DBEAFE;
    --sq-navy: #0F172A;
    --sq-navy-700: #1E293B;
    --sq-success: #16A34A;
    --sq-success-50: #F0FDF4;
    --sq-warning: #F59E0B;
    --sq-warning-50: #FFFBEB;
    --sq-danger: #DC2626;
    --sq-danger-50: #FEF2F2;
    --sq-bg: #F8FAFC;
    --sq-surface: #FFFFFF;
    --sq-border: #E2E8F0;
    --sq-text: #0F172A;
    --sq-muted: #475569;      /* kontras 7.5:1 di atas putih (WCAG AA) */
    --sq-subtle: #64748B;     /* kontras 4.8:1 di atas putih */
    --sq-radius: 14px;
    --sq-radius-sm: 10px;
    --sq-shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
    --sq-shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 4px 16px rgba(15, 23, 42, .04);
    --sq-sidebar-w: 256px;
    --sq-sidebar-w-collapsed: 76px;
    --sq-topbar-h: 60px;
    --sq-bottomnav-h: 64px;
    --sq-touch: 44px;

    /* Pemetaan ke variabel Bootstrap */
    --bs-primary: var(--sq-primary);
    --bs-primary-rgb: 37, 99, 235;
    --bs-secondary: var(--sq-navy);
    --bs-secondary-rgb: 15, 23, 42;
    --bs-success: var(--sq-success);
    --bs-success-rgb: 22, 163, 74;
    --bs-warning: var(--sq-warning);
    --bs-warning-rgb: 245, 158, 11;
    --bs-danger: var(--sq-danger);
    --bs-danger-rgb: 220, 38, 38;
    --bs-body-bg: var(--sq-bg);
    --bs-body-color: var(--sq-text);
    --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --bs-border-color: var(--sq-border);
    --bs-border-radius: var(--sq-radius-sm);
    --bs-border-radius-lg: var(--sq-radius);
    --bs-link-color: var(--sq-primary-600);
    --bs-link-color-rgb: 29, 78, 216;
    --bs-link-hover-color: var(--sq-navy);
    --bs-focus-ring-color: rgba(37, 99, 235, .35);
}

html { -webkit-text-size-adjust: 100%; }
body {
    background: var(--sq-bg);
    color: var(--sq-text);
    font-feature-settings: "cv11", "ss01";
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { font-weight: 700; letter-spacing: -.01em; color: var(--sq-navy); }
.text-muted, .text-body-secondary { color: var(--sq-muted) !important; }
.text-subtle { color: var(--sq-subtle) !important; }
.small-caps { font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--sq-subtle); }
.font-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* ---------- Aksesibilitas ---------- */
.skip-link {
    position: absolute; left: 12px; top: -60px; z-index: 2000;
    background: var(--sq-navy); color: #fff; padding: 10px 16px; border-radius: 8px; text-decoration: none;
}
.skip-link:focus { top: 12px; color: #fff; }
:focus-visible { outline: 3px solid rgba(37, 99, 235, .55); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- Tombol & input (target sentuh ≥ 44px, teks input ≥ 16px) ---------- */
.btn {
    --bs-btn-font-weight: 600;
    --bs-btn-padding-y: .625rem;
    --bs-btn-padding-x: 1.1rem;
    --bs-btn-border-radius: var(--sq-radius-sm);
    min-height: var(--sq-touch);
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .05s ease;
}
.btn:active { transform: translateY(1px); }
.btn-sm { min-height: 36px; --bs-btn-padding-y: .375rem; --bs-btn-padding-x: .75rem; }
.btn-icon { width: var(--sq-touch); padding: 0; }
.btn-primary {
    --bs-btn-bg: var(--sq-primary); --bs-btn-border-color: var(--sq-primary);
    --bs-btn-hover-bg: var(--sq-primary-600); --bs-btn-hover-border-color: var(--sq-primary-600);
    --bs-btn-active-bg: #1E40AF; --bs-btn-active-border-color: #1E40AF;
    --bs-btn-disabled-bg: var(--sq-primary); --bs-btn-disabled-border-color: var(--sq-primary);
}
.btn-outline-primary {
    --bs-btn-color: var(--sq-primary-600); --bs-btn-border-color: var(--sq-primary-100);
    --bs-btn-hover-bg: var(--sq-primary-50); --bs-btn-hover-color: var(--sq-primary-600); --bs-btn-hover-border-color: var(--sq-primary);
    --bs-btn-active-bg: var(--sq-primary-100); --bs-btn-active-color: var(--sq-primary-600);
}
.btn-light { --bs-btn-bg: #fff; --bs-btn-border-color: var(--sq-border); --bs-btn-hover-bg: #F1F5F9; --bs-btn-hover-border-color: #CBD5E1; --bs-btn-color: var(--sq-navy); }
.btn-secondary { --bs-btn-bg: var(--sq-navy); --bs-btn-border-color: var(--sq-navy); --bs-btn-hover-bg: var(--sq-navy-700); --bs-btn-hover-border-color: var(--sq-navy-700); }
.btn-success { --bs-btn-bg: var(--sq-success); --bs-btn-border-color: var(--sq-success); --bs-btn-hover-bg: #15803D; --bs-btn-hover-border-color: #15803D; }
.btn-danger { --bs-btn-bg: var(--sq-danger); --bs-btn-border-color: var(--sq-danger); --bs-btn-hover-bg: #B91C1C; --bs-btn-hover-border-color: #B91C1C; }
.btn-outline-danger { --bs-btn-color: #B91C1C; --bs-btn-border-color: #FECACA; --bs-btn-hover-bg: var(--sq-danger-50); --bs-btn-hover-color: #B91C1C; --bs-btn-hover-border-color: var(--sq-danger); }

.form-control, .form-select {
    font-size: 1rem;              /* 16px – mencegah auto-zoom iOS */
    min-height: 48px;
    border-radius: var(--sq-radius-sm);
    border-color: #CBD5E1;
    padding: .65rem .9rem;
}
textarea.form-control { min-height: 96px; }
.form-control:focus, .form-select:focus { border-color: var(--sq-primary); box-shadow: 0 0 0 .25rem rgba(37, 99, 235, .18); }
.form-label { font-weight: 600; font-size: .9rem; color: var(--sq-navy-700); margin-bottom: .4rem; }
.form-text { color: var(--sq-subtle); }
.form-check-input { width: 1.25em; height: 1.25em; margin-top: .15em; }
.form-check-input:checked { background-color: var(--sq-primary); border-color: var(--sq-primary); }
.form-switch .form-check-input { width: 2.6em; height: 1.4em; }
.form-check { min-height: var(--sq-touch); display: flex; align-items: center; gap: .6rem; padding-left: 0; }
.form-check .form-check-input { float: none; margin: 0; flex-shrink: 0; }
.form-switch { padding-left: 0; }
.form-switch .form-check-input { margin-left: 0; }
.invalid-feedback { font-weight: 500; }
.input-group .btn { min-height: 48px; border-color: #CBD5E1; }
.input-password .btn { border-top-left-radius: 0; border-bottom-left-radius: 0; }

/* ---------- Card ---------- */
.card {
    --bs-card-border-radius: var(--sq-radius);
    --bs-card-inner-border-radius: calc(var(--sq-radius) - 1px);
    --bs-card-border-color: var(--sq-border);
    --bs-card-cap-bg: transparent;
    box-shadow: var(--sq-shadow-sm);
}
.card-header { padding: 1rem 1.25rem; border-bottom-color: var(--sq-border); }
.card-body { padding: 1.25rem; }
.card-title { font-size: 1rem; font-weight: 700; margin-bottom: 0; }
.card-link-hover { transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.card-link-hover:hover { border-color: var(--sq-primary-100); box-shadow: var(--sq-shadow); }

.stat-card { display: flex; flex-direction: row; gap: .75rem; align-items: center; padding: .9rem; height: 100%; }
@media (max-width: 359.98px) { .stat-card { flex-direction: column; align-items: flex-start; } }
.stat-card .stat-icon {
    width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; font-size: 1.25rem;
}
.stat-card .stat-value { font-size: 1.5rem; font-weight: 800; line-height: 1.1; color: var(--sq-navy); }
.stat-card .stat-label { font-size: .8rem; color: var(--sq-muted); font-weight: 500; }
.tone-primary { background: var(--sq-primary-50); color: var(--sq-primary-600); }
.tone-success { background: var(--sq-success-50); color: #15803D; }
.tone-warning { background: var(--sq-warning-50); color: #B45309; }
.tone-danger { background: var(--sq-danger-50); color: #B91C1C; }
.tone-navy { background: #F1F5F9; color: var(--sq-navy); }

/* ---------- Badge status ---------- */
.badge { font-weight: 600; padding: .4em .65em; border-radius: 999px; }
.badge-soft-primary { background: var(--sq-primary-50); color: var(--sq-primary-600); }
.badge-soft-success { background: var(--sq-success-50); color: #15803D; }
.badge-soft-warning { background: var(--sq-warning-50); color: #B45309; }
.badge-soft-danger { background: var(--sq-danger-50); color: #B91C1C; }
.badge-soft-secondary { background: #F1F5F9; color: var(--sq-navy-700); }

/* ---------- Alert ---------- */
.alert { border-radius: var(--sq-radius-sm); border: 1px solid transparent; display: flex; gap: .75rem; align-items: flex-start; }
.alert > .bi { font-size: 1.15rem; line-height: 1.3; flex-shrink: 0; }
.alert-danger { background: var(--sq-danger-50); border-color: #FECACA; color: #991B1B; }
.alert-warning { background: var(--sq-warning-50); border-color: #FDE68A; color: #92400E; }
.alert-success { background: var(--sq-success-50); border-color: #BBF7D0; color: #166534; }
.alert-info { background: var(--sq-primary-50); border-color: var(--sq-primary-100); color: #1E40AF; }

/* ---------- Avatar ---------- */
.avatar {
    width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; flex-shrink: 0;
    background: var(--sq-primary-100); color: var(--sq-primary-600); font-weight: 700; font-size: .875rem; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 88px; height: 88px; font-size: 1.75rem; }
.avatar-sm { width: 32px; height: 32px; font-size: .75rem; }

/* =====================================================================
   App shell – mobile-first
   ===================================================================== */
.app-shell { min-height: 100vh; }
.app-main { min-height: 100vh; display: flex; flex-direction: column; }

.app-topbar {
    position: sticky; top: 0; z-index: 1020;
    height: var(--sq-topbar-h);
    background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(180%) blur(10px);
    -webkit-backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--sq-border);
    display: flex; align-items: center; gap: .75rem;
    padding: 0 1rem; padding-top: env(safe-area-inset-top);
}
.app-topbar .topbar-title { font-size: 1.05rem; font-weight: 700; margin: 0; color: var(--sq-navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 800; color: var(--sq-navy); text-decoration: none; letter-spacing: -.02em; }
.brand:hover { color: var(--sq-navy); }
.brand-mark {
    width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0;
    background: linear-gradient(135deg, var(--sq-primary), #4F46E5); color: #fff; font-size: 1.1rem;
}
.brand-text { font-size: 1.1rem; }

.app-content {
    flex: 1;
    padding: 1rem 1rem calc(var(--sq-bottomnav-h) + 1.5rem + env(safe-area-inset-bottom));
    max-width: 1280px; width: 100%; margin: 0 auto;
}

/* Sidebar disembunyikan di mobile */
.app-sidebar { display: none; }

/* Bottom navigation (mobile) */
.bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
    background: #fff; border-top: 1px solid var(--sq-border);
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    height: calc(var(--sq-bottomnav-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -4px 20px rgba(15, 23, 42, .05);
}
.bottom-nav a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    min-height: var(--sq-touch); color: var(--sq-subtle); text-decoration: none; font-size: .7rem; font-weight: 600;
    position: relative;
}
.bottom-nav a .bi { font-size: 1.3rem; line-height: 1; }
.bottom-nav a.active { color: var(--sq-primary); }
.bottom-nav a.active::before {
    content: ""; position: absolute; top: 0; width: 32px; height: 3px; border-radius: 0 0 3px 3px; background: var(--sq-primary);
}

/* Desktop: sidebar yang dapat diperkecil */
@media (min-width: 992px) {
    .app-shell { display: flex; }
    .app-sidebar {
        display: flex; flex-direction: column;
        position: sticky; top: 0; height: 100vh; flex-shrink: 0;
        width: var(--sq-sidebar-w);
        background: var(--sq-navy); color: #CBD5E1;
        transition: width .2s ease;
        z-index: 1035;
    }
    .app-main { flex: 1; min-width: 0; }
    .app-content { padding: 1.75rem 2rem 2.5rem; }
    .app-topbar { padding: 0 2rem; }
    .bottom-nav { display: none; }

    .sidebar-header { height: var(--sq-topbar-h); display: flex; align-items: center; padding: 0 1.1rem; gap: .5rem; border-bottom: 1px solid rgba(255,255,255,.06); }
    .sidebar-header .brand { color: #fff; }
    .sidebar-nav { flex: 1; overflow-y: auto; padding: 1rem .75rem; }
    .sidebar-section { font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #94A3B8; padding: .75rem .75rem .4rem; white-space: nowrap; }
    .sidebar-link {
        display: flex; align-items: center; gap: .8rem; min-height: var(--sq-touch);
        padding: .55rem .8rem; border-radius: 10px; color: #CBD5E1; text-decoration: none; font-weight: 500; font-size: .925rem;
        white-space: nowrap; margin-bottom: 2px;
    }
    .sidebar-link .bi { font-size: 1.15rem; width: 22px; text-align: center; flex-shrink: 0; }
    .sidebar-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
    .sidebar-link.active { background: var(--sq-primary); color: #fff; box-shadow: 0 4px 12px rgba(37, 99, 235, .35); }
    .sidebar-footer { padding: .75rem; border-top: 1px solid rgba(255,255,255,.06); }
    .sidebar-user { display: flex; align-items: center; gap: .65rem; padding: .5rem; border-radius: 10px; color: #E2E8F0; min-width: 0; }
    .sidebar-user .meta { min-width: 0; }
    .sidebar-user .name { font-weight: 600; font-size: .875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .sidebar-user .role { font-size: .75rem; color: #94A3B8; }
    .sidebar-toggle { color: #94A3B8; margin-left: auto; }
    .sidebar-toggle:hover { color: #fff; background: rgba(255,255,255,.06); }

    body.sidebar-collapsed .app-sidebar { width: var(--sq-sidebar-w-collapsed); }
    body.sidebar-collapsed .sidebar-link span,
    body.sidebar-collapsed .sidebar-section,
    body.sidebar-collapsed .brand-text,
    body.sidebar-collapsed .sidebar-user .meta { display: none; }
    body.sidebar-collapsed .sidebar-link { justify-content: center; padding: .55rem; }
    body.sidebar-collapsed .sidebar-header { flex-direction: column; justify-content: center; height: auto; padding: .75rem 0; }
    body.sidebar-collapsed .sidebar-toggle { margin: .25rem 0 0; }
    body.sidebar-collapsed .sidebar-toggle .bi { transform: rotate(180deg); }
    body.sidebar-collapsed .sidebar-user { justify-content: center; }
}

/* ---------- Header halaman ---------- */
.page-header { display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: flex-end; justify-content: space-between; margin-bottom: 1.25rem; }
.page-header h1 { font-size: 1.4rem; margin: 0; }
.page-header p { margin: .25rem 0 0; color: var(--sq-muted); }
@media (min-width: 992px) { .page-header h1 { font-size: 1.65rem; } }

/* ---------- Hero sambutan dashboard ---------- */
.welcome-card {
    background: linear-gradient(135deg, var(--sq-navy) 0%, #1E3A8A 100%);
    color: #E2E8F0; border: 0; border-radius: 18px; overflow: hidden; position: relative;
}
.welcome-card::after {
    content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%;
    background: radial-gradient(circle, rgba(96, 165, 250, .35), transparent 70%);
}
.welcome-card h2 { color: #fff; font-size: 1.3rem; }
.welcome-card .btn-light { --bs-btn-border-color: transparent; }

/* ---------- Daftar responsif (pengganti tabel di mobile) ---------- */
.list-card { list-style: none; margin: 0; padding: 0; }
.list-card > li { display: flex; gap: .875rem; align-items: center; padding: .9rem 1.25rem; border-top: 1px solid var(--sq-border); }
.list-card > li:first-child { border-top: 0; }
.list-card .item-main { flex: 1; min-width: 0; }
.list-card .item-title { font-weight: 600; color: var(--sq-navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-card .item-sub { font-size: .825rem; color: var(--sq-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-card a.stretched { text-decoration: none; color: inherit; }

.room-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 700; letter-spacing: .12em; background: #F1F5F9; color: var(--sq-navy); padding: .2rem .55rem; border-radius: 8px; font-size: .85rem; }

/* Tabel di desktop, kartu di mobile */
.table { --bs-table-bg: transparent; margin: 0; }
.table > :not(caption) > * > * { padding: .85rem 1rem; border-bottom-color: var(--sq-border); }
.table thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--sq-subtle); font-weight: 700; background: #F8FAFC; }
@media (max-width: 767.98px) {
    .table-stack thead { display: none; }
    .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
    .table-stack tr { padding: .9rem 1.1rem; border-top: 1px solid var(--sq-border); }
    .table-stack tr:first-child { border-top: 0; }
    .table-stack > :not(caption) > * > * { padding: .2rem 0; border: 0; }
    .table-stack td[data-label] { display: inline-block; width: auto; margin: .35rem 1.25rem 0 0; vertical-align: top; }
    .table-stack td[data-label]::before { content: attr(data-label); display: block; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--sq-subtle); margin-bottom: 2px; }
    .table-stack td.td-primary::before { display: none; }
    .table-stack td.td-actions { padding-top: .6rem; }
}

/* ---------- Empty / error / skeleton states ---------- */
.empty-state { text-align: center; padding: 2.25rem 1.25rem; }
.empty-state .empty-icon {
    width: 64px; height: 64px; border-radius: 18px; margin: 0 auto 1rem; display: grid; place-items: center;
    font-size: 1.75rem; background: var(--sq-primary-50); color: var(--sq-primary);
}
.empty-state h3 { font-size: 1.05rem; margin-bottom: .35rem; }
.empty-state p { color: var(--sq-muted); max-width: 420px; margin: 0 auto 1rem; font-size: .925rem; }
.empty-state.is-error .empty-icon { background: var(--sq-danger-50); color: var(--sq-danger); }

.skeleton {
    display: block; border-radius: 8px; min-height: 14px;
    background: linear-gradient(90deg, #EEF2F7 25%, #E2E8F0 37%, #EEF2F7 63%);
    background-size: 400% 100%; animation: sq-shimmer 1.4s ease infinite;
}
@keyframes sq-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- Status kesehatan ---------- */
.status-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.status-ok { background: var(--sq-success); box-shadow: 0 0 0 4px var(--sq-success-50); }
.status-warning { background: var(--sq-warning); box-shadow: 0 0 0 4px var(--sq-warning-50); }
.status-error { background: var(--sq-danger); box-shadow: 0 0 0 4px var(--sq-danger-50); }

/* ---------- Banner koneksi ---------- */
.offline-banner {
    position: fixed; left: 50%; transform: translateX(-50%); top: calc(var(--sq-topbar-h) + 10px); z-index: 1090;
    background: var(--sq-navy); color: #fff; padding: .6rem 1rem; border-radius: 999px; font-size: .875rem; font-weight: 600;
    display: none; align-items: center; gap: .5rem; box-shadow: var(--sq-shadow);
}
body.is-offline .offline-banner { display: inline-flex; }

/* =====================================================================
   Halaman autentikasi
   ===================================================================== */
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; }
.auth-main { flex: 1; display: flex; align-items: flex-start; justify-content: center; padding: 1.25rem 1rem 2rem; }
.auth-card { width: 100%; max-width: 440px; }
.auth-card .card-body { padding: 1.5rem 1.25rem; }
.auth-top { padding: 1rem; display: flex; justify-content: space-between; align-items: center; max-width: 1120px; width: 100%; margin: 0 auto; }
.auth-title { font-size: 1.5rem; margin-bottom: .35rem; }
.auth-sub { color: var(--sq-muted); margin-bottom: 1.5rem; }
.divider-text { display: flex; align-items: center; gap: .75rem; color: var(--sq-subtle); font-size: .8rem; margin: 1.25rem 0; }
.divider-text::before, .divider-text::after { content: ""; flex: 1; height: 1px; background: var(--sq-border); }
@media (min-width: 576px) {
    .auth-main { align-items: center; padding-top: 0; }
    .auth-card .card-body { padding: 2.25rem 2rem; }
}

.demo-accounts { font-size: .825rem; }
.demo-accounts button { min-height: 40px; }

/* =====================================================================
   Landing page & halaman publik
   ===================================================================== */
.public-nav { background: rgba(255,255,255,.9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--sq-border); position: sticky; top: 0; z-index: 1020; }
.public-nav .container { min-height: var(--sq-topbar-h); display: flex; align-items: center; justify-content: space-between; gap: .75rem; }

.hero { padding: 2.5rem 0 2rem; }
.hero h1 { font-size: 2rem; line-height: 1.15; letter-spacing: -.03em; font-weight: 800; }
.hero h1 .hl { color: var(--sq-primary); }
.hero .lead { color: var(--sq-muted); font-size: 1.05rem; }
@media (min-width: 768px) { .hero { padding: 4.5rem 0 3.5rem; } .hero h1 { font-size: 3rem; } }

.join-box { border-radius: 18px; padding: 1.25rem; background: #fff; border: 1px solid var(--sq-border); box-shadow: var(--sq-shadow); }
.join-input {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    text-transform: uppercase; letter-spacing: .25em; font-weight: 700; text-align: center;
    font-size: 1.35rem !important; min-height: 56px !important;
}
.join-input::placeholder { letter-spacing: .12em; font-weight: 500; color: #94A3B8; text-transform: none; }

.feature-card { padding: 1.25rem; height: 100%; }
.feature-card .stat-icon { margin-bottom: .875rem; }
.feature-card h3 { font-size: 1rem; }
.feature-card p { color: var(--sq-muted); font-size: .9rem; margin: 0; }

.site-footer { border-top: 1px solid var(--sq-border); padding: 1.5rem 0; color: var(--sq-subtle); font-size: .85rem; }


/* ---------- Utilitas ---------- */
.min-w-0 { min-width: 0; }
.gap-2-5 { gap: .75rem; }
.rounded-xl { border-radius: var(--sq-radius) !important; }
.fade-in { animation: sq-fade .25s ease both; }
@keyframes sq-fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.pagination { --bs-pagination-border-radius: 10px; --bs-pagination-padding-x: .85rem; --bs-pagination-padding-y: .55rem; gap: 4px; }
.pagination .page-link { min-width: 40px; text-align: center; border-radius: 10px !important; }
.pagination .active > .page-link { background: var(--sq-primary); border-color: var(--sq-primary); }
.dropdown-menu { border-radius: 12px; border-color: var(--sq-border); box-shadow: var(--sq-shadow); padding: .4rem; }
.dropdown-item { border-radius: 8px; padding: .6rem .8rem; min-height: 40px; display: flex; align-items: center; gap: .6rem; }
.nav-pills .nav-link { border-radius: 999px; font-weight: 600; color: var(--sq-muted); min-height: 40px; display: inline-flex; align-items: center; }
.nav-pills .nav-link.active { background: var(--sq-navy); }
.filter-scroll { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.filter-scroll::-webkit-scrollbar { display: none; }
.swal2-popup { border-radius: 16px !important; font-family: var(--bs-body-font-family) !important; }
.last-no-border:last-child { border-bottom: 0 !important; padding-bottom: 0 !important; margin-bottom: 0 !important; }
.stat-card.text-center { align-items: center !important; }
.list-card-links > li { position: relative; }
.list-card-links > li:hover { background: #F8FAFC; }

/* =====================================================================
   Tahap 2 – Kelas, kuis, editor soal
   ===================================================================== */
.room-code-lg {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 2.1rem; font-weight: 800; letter-spacing: .18em; color: var(--sq-navy);
    background: var(--sq-primary-50); border: 1px dashed var(--sq-primary-100); border-radius: 12px; padding: .4rem .5rem .4rem .7rem;
}
.qr-box { width: 200px; height: 200px; padding: 8px; background: #fff; border: 1px solid var(--sq-border); border-radius: 12px; display: grid; place-items: center; }
.qr-box svg { width: 100%; height: 100%; display: block; }
.qr-box svg path, .qr-box svg rect[fill="black"] { fill: var(--sq-navy); }
.qr-box-lg { width: min(70vw, 360px); height: min(70vw, 360px); }

/* Layar presentasi */
.focus-body { background: linear-gradient(160deg, #EFF6FF 0%, #F8FAFC 60%); }
.present-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem 1rem; position: relative; }
.present-card { background: #fff; border-radius: 24px; box-shadow: var(--sq-shadow); border: 1px solid var(--sq-border); padding: 2rem 1.5rem; text-align: center; width: 100%; max-width: 1040px; }
.present-title { font-size: clamp(1.4rem, 3.5vw, 2.4rem); }
.present-step { font-size: clamp(1rem, 2.2vw, 1.35rem); color: var(--sq-muted); margin-bottom: .5rem; }
.present-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 800; letter-spacing: .14em; color: var(--sq-primary); font-size: clamp(2.6rem, 7vw, 6rem); line-height: 1.1; overflow-wrap: anywhere; }
.present-actions { position: absolute; top: 1rem; right: 1rem; display: flex; gap: .5rem; }

/* Daftar soal */
.question-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; }
.question-card { scroll-margin-top: calc(var(--sq-topbar-h) + 12px); }
.question-card:target { box-shadow: 0 0 0 3px var(--sq-primary-100); border-color: var(--sq-primary); }
.question-card.moved { animation: sq-flash .6s ease; }
@keyframes sq-flash { from { background: var(--sq-primary-50); } to { background: #fff; } }
.question-actions { display: flex; flex-direction: column; gap: .35rem; flex-shrink: 0; }
.question-actions .btn-sm { min-height: 40px; width: 40px; padding: 0; }
@media (min-width: 576px) { .question-actions { flex-direction: row; align-items: flex-start; } }
.q-number { width: 28px; height: 28px; border-radius: 8px; background: var(--sq-navy); color: #fff; font-weight: 700; font-size: .8rem; display: inline-grid; place-items: center; }
.q-text { font-weight: 500; color: var(--sq-navy); white-space: normal; overflow-wrap: anywhere; }
.q-image { max-width: 100%; max-height: 260px; border-radius: 10px; border: 1px solid var(--sq-border); object-fit: contain; }
.q-image-thumb { max-width: 160px; max-height: 110px; border-radius: 8px; border: 1px solid var(--sq-border); object-fit: cover; }
.option-preview { list-style: none; padding: 0; margin: 0; display: grid; gap: .35rem; }
.option-preview li { display: flex; align-items: center; gap: .6rem; padding: .45rem .65rem; border: 1px solid var(--sq-border); border-radius: 10px; font-size: .925rem; overflow-wrap: anywhere; }
.option-preview li.is-correct { border-color: #86EFAC; background: var(--sq-success-50); }
.opt-letter { width: 26px; height: 26px; border-radius: 7px; background: #F1F5F9; color: var(--sq-navy-700); font-weight: 700; font-size: .78rem; display: inline-grid; place-items: center; flex-shrink: 0; cursor: pointer; margin: 0; }
.is-correct .opt-letter { background: var(--sq-success); color: #fff; }
.answer-chip { display: inline-block; background: var(--sq-success-50); color: #166534; border: 1px solid #BBF7D0; border-radius: 999px; padding: .1rem .6rem; margin: .15rem .25rem 0 0; font-weight: 500; }
.add-question-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; }
@media (min-width: 768px) { .add-question-grid { grid-template-columns: repeat(4, 1fr); } }
.add-question-grid .btn { justify-content: flex-start; }

/* Form soal */
.option-row { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.option-row .form-control { flex: 1; min-width: 0; }
.option-row .option-correct { width: 1.5em; height: 1.5em; margin: 0; flex-shrink: 0; cursor: pointer; }
.option-row .option-correct:checked + .opt-letter { background: var(--sq-success); color: #fff; }
.option-row:has(.option-correct:checked) .option-text { border-color: #86EFAC; background: var(--sq-success-50); }
.tf-choices { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.tf-choices .btn { min-height: 56px; font-size: 1.05rem; }
.sticky-actions { position: sticky; bottom: calc(var(--sq-bottomnav-h) + env(safe-area-inset-bottom)); background: rgba(248,250,252,.95); backdrop-filter: blur(6px); padding: .75rem 0; z-index: 5; }
@media (min-width: 992px) { .sticky-actions { bottom: 0; } }

/* Pilih mode & impor */
.mode-grid { display: grid; gap: .6rem; }
@media (min-width: 768px) { .mode-grid { grid-template-columns: repeat(3, 1fr); } }
.mode-card { border: 2px solid var(--sq-border); border-radius: 12px; padding: .9rem 1rem; cursor: pointer; height: 100%; transition: border-color .15s, background .15s; }
.btn-check:checked + .mode-card { border-color: var(--sq-primary); background: var(--sq-primary-50); }
.btn-check:focus-visible + .mode-card { outline: 3px solid rgba(37, 99, 235, .55); outline-offset: 2px; }
.pick-card { cursor: pointer; }
.pick-card:has(.js-pick:checked) { border-color: var(--sq-primary); box-shadow: 0 0 0 2px var(--sq-primary-100); }
.pick-card .js-pick { width: 1.4em; height: 1.4em; margin-top: .2rem; }

/* =====================================================================
   Tahap 3 – Halaman pengerjaan kuis (fokus, mobile-first)
   ===================================================================== */
.exam-shell { min-height: 100vh; display: flex; flex-direction: column; background: var(--sq-bg); }
.exam-narrow { width: 100%; max-width: 720px; margin: 0 auto; padding: 1rem 1rem calc(88px + env(safe-area-inset-bottom)); flex: 1; }
.exam-top { position: sticky; top: 0; z-index: 1020; background: #fff; border-bottom: 1px solid var(--sq-border); padding-top: env(safe-area-inset-top); }
.exam-top-inner { max-width: 720px; margin: 0 auto; display: flex; align-items: center; gap: .75rem; padding: .6rem 1rem; }
.exam-title { font-weight: 700; color: var(--sq-navy); font-size: .95rem; }
.exam-progress { height: 4px; border-radius: 0; background: #EEF2F7; }
.exam-progress .progress-bar { background: var(--sq-primary); transition: width .3s ease; }
.exam-timer { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 1.05rem; color: var(--sq-navy); background: #F1F5F9; border-radius: 999px; padding: .35rem .8rem; white-space: nowrap; }
.exam-timer.is-warning { background: var(--sq-danger-50); color: #B91C1C; animation: sq-pulse 1s ease infinite; }
@keyframes sq-pulse { 50% { box-shadow: 0 0 0 4px rgba(220, 38, 38, .15); } }
.exam-question-text { font-size: 1.15rem; line-height: 1.5; font-weight: 600; color: var(--sq-navy); margin-bottom: 1rem; white-space: pre-line; overflow-wrap: anywhere; }
@media (min-width: 768px) { .exam-question-text { font-size: 1.3rem; } }
.exam-options { display: grid; gap: .6rem; }
.exam-option {
    display: flex; align-items: center; gap: .8rem; min-height: 56px; padding: .75rem 1rem; cursor: pointer;
    border: 2px solid var(--sq-border); border-radius: 14px; background: #fff; font-size: 1rem; overflow-wrap: anywhere;
    transition: border-color .12s ease, background .12s ease;
}
.exam-option:hover { border-color: #93C5FD; }
.exam-option:has(.exam-radio:checked), .exam-option.is-selected { border-color: var(--sq-primary); background: var(--sq-primary-50); }
.exam-option:has(.exam-radio:checked) .opt-letter { background: var(--sq-primary); color: #fff; }
.exam-option:has(.exam-radio:focus-visible) { outline: 3px solid rgba(37, 99, 235, .55); outline-offset: 2px; }
.exam-option:has(.exam-radio:disabled) { cursor: default; }
.exam-option.is-correct { border-color: var(--sq-success); background: var(--sq-success-50); }
.exam-option.is-correct .opt-letter { background: var(--sq-success); color: #fff; }
.exam-option.is-wrong { border-color: var(--sq-danger); background: var(--sq-danger-50); }
.exam-option .opt-letter { width: 32px; height: 32px; font-size: .85rem; }
.exam-radio { position: absolute; opacity: 0; width: 1px; height: 1px; }
.save-indicator { font-size: .85rem; font-weight: 600; display: inline-flex; align-items: center; gap: .35rem; min-height: 24px; }
.exam-bottom { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1020; background: #fff; border-top: 1px solid var(--sq-border); padding-bottom: env(safe-area-inset-bottom); }
.exam-bottom-inner { max-width: 720px; margin: 0 auto; display: flex; gap: .5rem; justify-content: space-between; padding: .6rem 1rem; }
.exam-bottom-inner .btn { flex: 1; min-height: 48px; }
.exam-grid-panel { height: auto !important; max-height: 70vh; border-radius: 18px 18px 0 0; }
.exam-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: .5rem; }
.grid-cell { min-height: 48px; border-radius: 10px; border: 2px solid var(--sq-border); background: #fff; font-weight: 700; color: var(--sq-navy); }
.grid-cell.is-answered { background: var(--sq-primary); border-color: var(--sq-primary); color: #fff; }
.grid-cell.is-current { box-shadow: 0 0 0 3px var(--sq-primary-100); border-color: var(--sq-navy); }
.legend-dot { display: inline-block; width: 12px; height: 12px; border-radius: 3px; border: 2px solid var(--sq-border); vertical-align: -1px; }
.legend-dot.is-answered { background: var(--sq-primary); border-color: var(--sq-primary); }
.exam-facts { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .6rem; }
.exam-facts li { display: flex; gap: .7rem; align-items: flex-start; }
.exam-facts .bi { color: var(--sq-primary); font-size: 1.15rem; margin-top: .05rem; }
.result-icon { width: 72px; height: 72px; border-radius: 22px; display: grid; place-items: center; font-size: 2rem; }
.result-score { line-height: 1; }
.result-pct { font-size: 3.5rem; font-weight: 800; color: var(--sq-navy); letter-spacing: -.03em; }
.result-stat { background: #F8FAFC; border: 1px solid var(--sq-border); border-radius: 12px; padding: .6rem; display: flex; flex-direction: column; }
.result-stat strong { font-size: 1.25rem; color: var(--sq-navy); }
.option-preview li.is-wrong { border-color: #FECACA; background: var(--sq-danger-50); }
.answer-box { background: #F8FAFC; border: 1px solid var(--sq-border); border-radius: 10px; padding: .6rem .8rem; white-space: pre-line; overflow-wrap: anywhere; }
.paced-current { border: 1px solid var(--sq-border); border-radius: 12px; padding: 1rem; background: #fff; }

/* =====================================================================
   Tahap 4 – Pengawasan perpindahan tab
   ===================================================================== */
.log-list .log-item { align-items: flex-start; }
.log-icon { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: #F1F5F9; color: var(--sq-muted); flex-shrink: 0; }
.log-item.is-violation .log-icon { background: var(--sq-danger-50); color: #B91C1C; }
.log-item.is-system .log-icon { background: var(--sq-primary-50); color: var(--sq-primary-600); }
.log-item.is-voided .item-title { text-decoration: line-through; color: var(--sq-subtle); }
.log-item .item-sub { white-space: normal; }
.list-card > li.log-void { border-top: 0; padding-top: 0; padding-left: calc(1.25rem + 32px + .875rem); }
.ac-indicator { display: inline-flex; align-items: center; gap: .3rem; font-size: .78rem; font-weight: 700; border-radius: 999px; padding: .25rem .6rem; background: var(--sq-success-50); color: #15803D; white-space: nowrap; }
.ac-indicator.has-violations { background: var(--sq-warning-50); color: #B45309; }
.ac-indicator.is-final { background: var(--sq-danger-50); color: #B91C1C; }
.ac-notice { border: 1px solid #FDE68A; background: var(--sq-warning-50); border-radius: 12px; padding: .9rem 1rem; }

/* =====================================================================
   Tahap 5 – Asesmen interaktif, Space Race, dashboard real-time
   ===================================================================== */
.keyword-cloud { display: flex; flex-wrap: wrap; gap: .4rem .5rem; align-items: baseline; }
.keyword-chip { background: var(--sq-primary-50); color: var(--sq-primary-600); border-radius: 999px; padding: .15rem .65rem; font-weight: 600; line-height: 1.6; }
.rating-scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: .4rem; }
.rating-option { border: 2px solid var(--sq-border); border-radius: 12px; padding: .5rem .25rem; text-align: center; cursor: pointer; min-height: 64px; display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.rating-option strong { font-size: 1.2rem; color: var(--sq-navy); }
.rating-option span { font-size: .66rem; color: var(--sq-muted); line-height: 1.1; }
.btn-check:checked + .rating-option { border-color: var(--sq-success); background: var(--sq-success-50); }
.btn-check:focus-visible + .rating-option { outline: 3px solid rgba(37, 99, 235, .55); outline-offset: 2px; }
.rating-badge { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; flex-shrink: 0; color: #fff; }
.rating-1 { background: #DC2626; } .rating-2 { background: #F59E0B; } .rating-3 { background: #94A3B8; } .rating-4 { background: #22C55E; } .rating-5 { background: #16A34A; }
.interactive-card { border-color: var(--sq-primary-100); }

/* Space Race */
.race-wrap { min-height: 100vh; padding: 1.25rem; display: flex; flex-direction: column; gap: 1rem; background: radial-gradient(circle at 20% 0%, #1E3A8A 0%, #0F172A 55%); color: #E2E8F0; }
.race-head { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: flex-end; }
.race-kicker { color: #93C5FD; font-weight: 600; margin: 0 0 .25rem; }
.race-title { color: #fff; font-size: clamp(1.4rem, 3.5vw, 2.4rem); margin: 0; }
.race-code { background: rgba(255,255,255,.08); border-radius: 14px; padding: .6rem 1rem; text-align: right; display: flex; flex-direction: column; }
.race-code strong.font-mono { font-size: clamp(1.6rem, 4vw, 2.6rem); letter-spacing: .14em; color: #fff; }
.race-track { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; flex: 1; align-content: start; }
.race-lane { display: grid; grid-template-columns: 2.2rem minmax(90px, 220px) 1fr 3.5rem; gap: .75rem; align-items: center; background: rgba(255,255,255,.05); border-radius: 14px; padding: .6rem .8rem; }
.race-rank { width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--lane); color: #fff; display: grid; place-items: center; font-weight: 800; }
.race-name { font-weight: 700; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.race-bar { height: 22px; border-radius: 999px; background: rgba(255,255,255,.1); position: relative; overflow: visible; }
.race-fill { display: block; height: 100%; min-width: 22px; border-radius: 999px; background: var(--lane); position: relative; transition: width .8s cubic-bezier(.2,.8,.2,1); }
.race-rocket { position: absolute; right: -6px; top: 50%; transform: translateY(-50%) rotate(45deg); font-size: 1.5rem; color: #fff; filter: drop-shadow(0 0 6px var(--lane)); }
.race-pct { font-weight: 800; text-align: right; color: #fff; font-variant-numeric: tabular-nums; }
.race-lane.is-finished .race-name::after { content: " ✓"; color: #86EFAC; }
.race-empty { text-align: center; color: #94A3B8; font-size: 1.2rem; margin: 2rem 0; }
.race-foot { display: flex; justify-content: space-between; align-items: center; color: #94A3B8; }
@media (max-width: 575.98px) { .race-lane { grid-template-columns: 2rem 1fr 3rem; } .race-bar { grid-column: 1 / -1; } }
@media (prefers-reduced-motion: reduce) { .race-fill { transition: none; } }
.race-chip { display: inline-flex; align-items: center; gap: .3rem; font-size: .78rem; font-weight: 700; border-radius: 999px; padding: .25rem .6rem; background: color-mix(in srgb, var(--lane, #2563EB) 14%, white); color: var(--sq-navy); white-space: nowrap; }

/* Statistik per soal (dashboard sesi) */
.qstat { display: grid; gap: .35rem; }
.qstat-bar { height: 8px; border-radius: 999px; background: #EEF2F7; overflow: hidden; display: flex; }
.qstat-bar span { display: block; height: 100%; }
.qstat-opt { display: grid; grid-template-columns: 1.6rem 1fr 3rem; gap: .5rem; align-items: center; font-size: .85rem; }
.qstat-opt .opt-letter { width: 22px; height: 22px; font-size: .7rem; }
.qstat-opt.is-correct .opt-letter { background: var(--sq-success); color: #fff; }
.provisional { font-size: .7rem; color: var(--sq-subtle); }

/* =====================================================================
   Tahap 6 – Laporan, analisis soal, rekap kelas
   ===================================================================== */
.chart-box { position: relative; height: 240px; }
.chart-box.is-tall { height: 300px; }
.score-pill { display: inline-block; min-width: 3.4rem; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; border-radius: 8px; padding: .2rem .45rem; font-size: .85rem; }
.score-success { background: var(--sq-success-50); color: #15803D; }
.score-primary { background: var(--sq-primary-50); color: var(--sq-primary-600); }
.score-warning { background: var(--sq-warning-50); color: #B45309; }
.score-danger { background: var(--sq-danger-50); color: #B91C1C; }
.score-none { color: var(--sq-subtle); }
.metric-row { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; font-size: .85rem; color: var(--sq-muted); }
.metric-row strong { color: var(--sq-navy); font-variant-numeric: tabular-nums; }
.item-card + .item-card { border-top: 1px solid var(--sq-border); }
.item-card { padding: 1rem 1.1rem; }
.item-advice { font-size: .85rem; border-left: 3px solid var(--sq-primary-100); padding: .35rem .7rem; background: #F8FAFC; border-radius: 0 8px 8px 0; }
.item-advice.is-warn { border-left-color: var(--sq-warning); background: var(--sq-warning-50); }
.qstat-opt.is-weak .opt-letter { outline: 2px dashed var(--sq-warning); outline-offset: 1px; }
.recap-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.recap-table { font-size: .85rem; min-width: 100%; }
.recap-table th, .recap-table td { white-space: nowrap; vertical-align: middle; }
.recap-table .sticky-col { position: sticky; left: 0; background: var(--sq-surface); z-index: 1; box-shadow: 1px 0 0 var(--sq-border); max-width: 220px; }
.recap-table thead .sticky-col { background: #F8FAFC; }
.recap-table tfoot td { font-weight: 700; background: #F8FAFC; }
.recap-table a.score-pill { text-decoration: none; }
.recap-table a.score-pill:hover { filter: brightness(.95); text-decoration: underline; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: .3rem; }

/* =====================================================================
   Materi belajar mahasiswa
   ===================================================================== */
.materi-content { max-width: 72ch; line-height: 1.65; }
.materi-content pre { background: var(--sq-navy); color: #E2E8F0; border-radius: var(--sq-radius-sm); padding: .9rem 1rem; font-size: .85rem; line-height: 1.5; overflow-x: auto; }
.materi-content pre code { color: inherit; font-size: inherit; }
.materi-content :not(pre) > code { background: var(--sq-primary-50); color: var(--sq-primary-600); border-radius: 4px; padding: .05rem .3rem; }
.materi-content dt { font-weight: 600; }
.materi-content dd { color: var(--sq-muted); margin-bottom: .6rem; }
.materi-figure { margin: 0 0 1rem; }
.materi-figure img { max-width: 100%; height: auto; border: 1px solid var(--sq-border); border-radius: var(--sq-radius-sm); background: #fff; }
.materi-video { border-radius: var(--sq-radius-sm); overflow: hidden; background: #000; }
.materi-video iframe { border: 0; }
.materi-toc { position: sticky; top: calc(var(--sq-topbar-h) + 1rem); }
.materi-toc-link { display: block; padding: .3rem .6rem; border-radius: 8px; color: var(--sq-muted); text-decoration: none; font-size: .9rem; }
.materi-toc-link:hover { background: var(--sq-bg); color: var(--sq-navy); }
.materi-toc-link.active { background: var(--sq-primary-50); color: var(--sq-primary-600); font-weight: 600; }
.materi-demo { border: 1px solid var(--sq-border); border-radius: var(--sq-radius-sm); padding: 1rem; background: var(--sq-bg); }
.materi-code-lines [data-line] { display: block; padding: 0 .35rem; margin: 0 -.35rem; border-radius: 4px; min-height: 1.5em; transition: background-color .15s; }
.materi-code-lines [data-line].is-active { background: rgba(34, 197, 94, .35); }
.materi-output { min-height: 8rem; font-size: 1.25rem !important; line-height: 1.3 !important; background: var(--sq-surface) !important; color: var(--sq-navy) !important; border: 1px solid var(--sq-border); }
@media (max-width: 991.98px) { .materi-toc { position: static; } }
