﻿/* lovv-ui.css - clean futuristic green/cyan override layer */
:root{
    --purple-50:#ecfdf5;
    --purple-100:#d1fae5;
    --purple-200:#a7f3d0;
    --purple-300:#6ee7b7;
    --purple-400:#34d399;
    --purple-500:#10b981;
    --purple-600:#059669;
    --purple-700:#047857;
    --purple-800:#065f46;
    --purple-900:#064e3b;
    --purple-950:#022c22;

    --bg:#eef8f4;
    --bg-alt:#e3f4ef;
    --surface:#ffffff;
    --text:#071f1a;
    --text-muted:#526b63;
    --border:#c7ded6;
    --border-strong:#8dc5b2;

    --success:#059669;
    --success-bg:rgba(16,185,129,.14);
    --success-bg-strong:rgba(16,185,129,.24);
    --success-border:rgba(5,150,105,.38);

    --danger:#dc2626;
    --danger-bg:rgba(239,68,68,.12);
    --danger-bg-strong:rgba(239,68,68,.22);
    --danger-border:rgba(220,38,38,.38);

    --warning:#d97706;
    --warning-bg:rgba(217,119,6,.12);
    --warning-border:rgba(217,119,6,.38);

    --radius:16px;
    --radius-sm:10px;
    --radius-lg:24px;

    --focus-ring:0 0 0 4px rgba(20,184,166,.18);
    --shadow-sm:0 6px 18px rgba(3,45,37,.07);
    --shadow-md:0 14px 38px rgba(3,45,37,.11);
    --shadow-lg:0 28px 78px rgba(3,45,37,.18);

    --lovv-ink:#071f1a;
    --lovv-muted:#526b63;
    --lovv-line:rgba(6,78,59,.14);
    --lovv-line-strong:rgba(20,184,166,.34);
    --lovv-cyan:#22d3ee;
    --lovv-green:#10b981;
    --lovv-lime:#a3e635;
    --lovv-night:#021614;
    --lovv-panel:rgba(255,255,255,.82);
    --lovv-panel-solid:#ffffff;
    --lovv-glow:0 20px 60px rgba(16,185,129,.13), 0 4px 14px rgba(3,45,37,.07);
}

*{ box-sizing:border-box; }
html,body{ min-height:100%; overflow-x:hidden; }
body{
    color:var(--text);
    background:
        radial-gradient(900px 460px at 8% -8%, rgba(34,211,238,.20), transparent 62%),
        radial-gradient(820px 420px at 94% 4%, rgba(16,185,129,.20), transparent 60%),
        linear-gradient(180deg, #f7fffb 0%, #eef8f4 48%, #edf4f1 100%);
    -webkit-font-smoothing:antialiased;
}
::selection{ background:rgba(16,185,129,.24); color:var(--lovv-night); }
.container{ max-width:1180px; margin:0 auto; padding-left:22px; padding-right:22px; width:100%; }
.main{ flex:1; padding:32px 0 60px; }
a{ color:var(--purple-700); }
a:hover{ color:var(--purple-900); }

/* Header */
.topbar{
    position:sticky;
    top:0;
    z-index:100;
    color:#eafff8;
    background:
        linear-gradient(135deg, rgba(2,22,20,.96), rgba(5,95,70,.92) 58%, rgba(20,184,166,.88));
    border-bottom:1px solid rgba(255,255,255,.10);
    box-shadow:0 16px 44px rgba(2,22,20,.26);
}
@supports (backdrop-filter: blur(18px)){
    .topbar{
        background:linear-gradient(135deg, rgba(2,22,20,.84), rgba(5,95,70,.78) 58%, rgba(20,184,166,.72));
        backdrop-filter:blur(18px) saturate(1.2);
    }
}
.topbar-inner{ min-height:72px; height:auto; display:flex; align-items:center; justify-content:space-between; gap:16px; padding-top:10px; padding-bottom:10px; }
.brand{ color:#fff; font-family:var(--font-brand); font-size:38px; font-weight:800; letter-spacing:0; line-height:1; text-decoration:none; }
.brand:hover{ color:#fff; transform:translateY(-1px); }
.brand-text{
    color:transparent;
    background:linear-gradient(180deg, #ffffff 0%, #d9fff2 48%, #5eead4 100%);
    -webkit-background-clip:text;
    background-clip:text;
    filter:drop-shadow(0 10px 22px rgba(45,212,191,.25));
}
.topnav{ display:flex; align-items:center; gap:8px; min-width:0; }
.topnav a,
.user-chip{
    display:inline-flex;
    align-items:center;
    gap:7px;
    color:rgba(240,253,250,.94);
    background:rgba(255,255,255,.10);
    border:1px solid rgba(255,255,255,.16);
    border-radius:999px;
    padding:9px 15px;
    text-decoration:none;
    font-size:14px;
    font-weight:650;
    white-space:nowrap;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.10);
    transition:background .18s ease, color .18s ease, transform .14s ease, border-color .18s ease;
}
.topnav a:hover,
.topnav a.logout:hover{ color:#fff; background:rgba(255,255,255,.18); border-color:rgba(255,255,255,.26); transform:translateY(-1px); }
.topnav a.logout{ background:rgba(255,255,255,.14); }
.topnav-dot{ width:8px; height:8px; border-radius:50%; background:#34d399; box-shadow:0 0 0 5px rgba(52,211,153,.14), 0 0 14px rgba(52,211,153,.7); }
.user-role{ padding:2px 8px; border-radius:999px; background:rgba(255,255,255,.16); color:#fff; font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.04em; }

/* Buttons and forms */
.btn{
    border-radius:14px;
    font-weight:750;
    transition:transform .12s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease, color .18s ease;
}
.btn:hover{ transform:translateY(-1px); }
.btn:active{ transform:translateY(0) scale(.99); }
.btn:focus-visible,
.field input:focus,
.field select:focus,
.field textarea:focus,
.text-answer:focus,
.matching-table select:focus,
.fill-blank-text input:focus,
.filter-bar select:focus,
.upload-form input[type=file]:focus,
.editor input[type=text]:focus,
.editor input[type=number]:focus,
.editor textarea:focus,
.editor select:focus{ outline:0; box-shadow:var(--focus-ring); }
.btn-primary{
    color:#022c22;
    background:linear-gradient(135deg, #a3e635 0%, #34d399 40%, #22d3ee 100%);
    border:0;
    box-shadow:0 14px 30px rgba(16,185,129,.26);
}
.btn-primary:hover{ color:#022c22; box-shadow:0 18px 40px rgba(16,185,129,.32); }
.btn-ghost{
    color:#075e54;
    background:rgba(255,255,255,.80);
    border:1px solid var(--lovv-line);
}
.btn-ghost:hover{ color:#022c22; background:#fff; border-color:var(--lovv-line-strong); box-shadow:0 10px 24px rgba(3,45,37,.08); }
.btn-success{ background:linear-gradient(135deg, #059669, #10b981); color:#fff; border:0; }
.btn-danger{ color:#b91c1c; background:#fff5f5; border:1px solid rgba(220,38,38,.28); }
.btn-danger:hover{ color:#fff; background:#dc2626; border-color:#dc2626; }
.btn-warn{ background:#f59e0b; color:#1f1300; border:0; }
.btn-sm{ padding:7px 11px; font-size:13px; }
.btn-lg{ min-height:48px; padding:12px 20px; }

input,select,textarea,button{ font-family:inherit; }
.field input,
.field select,
.field textarea,
.filter-bar select,
.filter-bar input,
.upload-form input[type=file],
.tac-owner-form select,
.text-answer,
.matching-table select,
.fill-blank-text input{
    border-color:var(--border);
    background:#fff;
    color:var(--text);
}

/* Shared cards, tables, admin */
.admin-body .main{ background:linear-gradient(180deg, rgba(209,250,229,.46), rgba(255,255,255,0) 220px); }
.admin-page{ max-width:1240px; padding:14px 0 72px; }
.page-title{ color:var(--lovv-ink); font-size:36px; line-height:1.08; letter-spacing:0; }
.section-title{ color:#064e3b; letter-spacing:0; }
.muted{ color:var(--lovv-muted); }
.login-card,
.stat-card,
.table-wrap,
.filter-bar,
.test-admin-card,
.user-create-card,
.result-card,
.editor-card,
.upload-block,
.card,
.hero-card,
.empty{
    background:var(--lovv-panel);
    border:1px solid var(--lovv-line);
    border-radius:20px;
    box-shadow:var(--lovv-glow);
}
@supports (backdrop-filter: blur(14px)){
    .login-card,
    .stat-card,
    .table-wrap,
    .filter-bar,
    .test-admin-card,
    .user-create-card,
    .result-card,
    .editor-card,
    .upload-block,
    .card,
    .hero-card,
    .empty{ backdrop-filter:blur(14px) saturate(1.08); }
}
.stats-grid{ gap:16px; }
.stat-card{ padding:22px; }
.stat-value{
    color:transparent;
    background:linear-gradient(135deg, #022c22, #059669 58%, #22d3ee);
    -webkit-background-clip:text;
    background-clip:text;
    letter-spacing:0;
}
.stat-label{ color:var(--lovv-muted); }
.page-header-row{ gap:18px; }
.filter-bar{ display:flex; flex-wrap:wrap; gap:12px; align-items:end; padding:16px; background:rgba(255,255,255,.78); }
.filter-form{ display:flex; flex-wrap:wrap; gap:10px; align-items:center; min-width:0; }
.filter-label{ color:#047857; font-weight:800; }
.filter-actions{ display:flex; flex-wrap:wrap; gap:8px; align-items:center; justify-content:flex-end; }
.table-wrap{ overflow:auto; background:#fff; }
.data-table{ min-width:760px; width:100%; border-collapse:collapse; }
.data-table th{
    position:sticky;
    top:0;
    z-index:2;
    background:linear-gradient(180deg, #f8fffc, #eafaf3);
    color:#075e54;
    border-bottom:1px solid var(--lovv-line);
    letter-spacing:.04em;
}
.data-table td{ color:#102620; border-bottom-color:rgba(6,78,59,.09); }
.data-table tr:nth-child(even) td{ background:#fbfffd; }
.data-table tr:hover td{ background:#effdf7; }
.tests-grid{ grid-template-columns:repeat(auto-fit, minmax(300px, 1fr)); gap:18px; }
.test-admin-card{ padding:20px; }
.test-admin-card:hover,
.stat-card:hover{ border-color:var(--lovv-line-strong); box-shadow:0 24px 62px rgba(3,45,37,.13); }
.tac-share{ background:linear-gradient(135deg, #ecfdf5, #f8fffc); border-color:rgba(16,185,129,.20); }
.tac-share-label{ color:#047857; }
.tac-share-url{ color:#064e3b; border-color:rgba(16,185,129,.24); }
.tac-owner summary{ background:#f8fffc; border-color:rgba(6,78,59,.14); color:#075e54; }
.tac-owner summary:hover,
.tac-owner[open] summary{ background:#ecfdf5; border-color:rgba(16,185,129,.30); }
.badge{ border-radius:999px; }
.badge-admin{ background:linear-gradient(135deg, #047857, #14b8a6); color:#fff; border:0; }
.badge-teacher{ color:#047857; background:#ecfdf5; border:1px solid #a7f3d0; }
.badge-success{ color:#047857; background:#ecfdf5; border:1px solid #a7f3d0; }
.badge-fail,.badge-expired{ color:#b91c1c; background:#fff1f2; border:1px solid #fecdd3; }
.badge-muted{ color:#64748b; background:#f1f5f9; }
.badge-timer,.live-ttl{ color:#047857; background:#ecfdf5; border:1px solid #a7f3d0; }
.live-ttl-urgent{ color:#b45309; background:#fffbeb; border-color:#fde68a; }
.live-page .table-wrap{ max-height:none; }
.live-controls{ display:flex; flex-wrap:wrap; justify-content:flex-end; gap:10px; }

/* Toasts and status */
.lovv-toasts{ position:fixed; top:14px; right:14px; z-index:9999; display:flex; flex-direction:column; gap:10px; pointer-events:none; max-width:calc(100vw - 28px); }
.lovv-toast{ pointer-events:auto; display:flex; align-items:center; gap:12px; min-width:260px; max-width:420px; padding:12px 14px; background:#fff; border-radius:14px; box-shadow:var(--shadow-md); font-size:14px; line-height:1.4; color:var(--text); border:1px solid var(--lovv-line); border-left:4px solid var(--purple-600); opacity:0; transform:translateX(20px) scale(.96); transition:opacity .25s ease, transform .25s ease; }
.lovv-toast--in{ opacity:1; transform:translateX(0) scale(1); }
.lovv-toast--leaving{ opacity:0; transform:translateX(20px) scale(.96); }
.lovv-toast--success{ border-left-color:#10b981; }
.lovv-toast--error{ border-left-color:#ef4444; }
.lovv-toast--warn{ border-left-color:#f59e0b; }
.lovv-toast__icon{ flex:0 0 28px; width:28px; height:28px; display:inline-flex; align-items:center; justify-content:center; border-radius:50%; color:#022c22; font-weight:800; background:#a3e635; }
.lovv-toast--success .lovv-toast__icon{ background:#10b981; color:#fff; }
.lovv-toast--error .lovv-toast__icon{ background:#ef4444; color:#fff; }
.lovv-toast--warn .lovv-toast__icon{ background:#f59e0b; color:#1f1300; }
.lovv-toast__msg{ flex:1 1 auto; word-break:break-word; }
.lovv-toast__close{ flex:0 0 24px; width:24px; height:24px; border:0; background:transparent; cursor:pointer; font-size:20px; line-height:1; color:#64748b; padding:0; border-radius:50%; }
.lovv-toast__close:hover{ background:#ecfdf5; color:#022c22; }
.net-status,.save-status{ position:fixed; left:14px; bottom:14px; z-index:998; display:inline-flex; align-items:center; gap:8px; padding:8px 12px; border-radius:999px; border:1px solid var(--lovv-line); background:#fff; box-shadow:var(--shadow-sm); color:var(--text); font-size:13px; font-weight:750; }
.net-dot,.save-status::before{ content:""; display:inline-block; width:8px; height:8px; border-radius:50%; background:#10b981; box-shadow:0 0 0 5px rgba(16,185,129,.12); }
.net-status--offline,.save-status--offline,.save-status--invalid{ color:#92400e; background:#fffbeb; }
.net-status--offline .net-dot{ background:#f59e0b; box-shadow:none; }
.save-status--idle{ opacity:0; pointer-events:none; }
.save-status--saving,.save-status--typing{ color:#047857; }
.save-status--saved{ color:#059669; }
.save-status--error{ color:#b91c1c; background:#fff1f2; }
.save-status--saving::after,.save-status--typing::after{ content:""; width:7px; height:7px; border-radius:50%; background:currentColor; opacity:.55; animation:saveBlink 1s ease-in-out infinite; }
@keyframes saveBlink{ 0%,100%{ opacity:.25; } 50%{ opacity:1; } }

/* Landing */
.student-body .main:has(.landing-v2){ padding-top:0; padding-bottom:0; }
.landing-v2{ overflow:hidden; color:var(--text); }
.landing-v2 .lp-hero-v2{ position:relative; min-height:660px; padding:92px 0 82px; background:linear-gradient(135deg, #f8fffc 0%, #eefcf6 44%, #e7fbff 100%); isolation:isolate; }
.landing-v2 .lp-hero-surface{ position:absolute; inset:0; z-index:-1; overflow:hidden; }
.landing-v2 .lp-hero-surface::before{ content:""; position:absolute; inset:0; background-image:linear-gradient(rgba(6,78,59,.045) 1px, transparent 1px),linear-gradient(90deg, rgba(6,78,59,.045) 1px, transparent 1px); background-size:44px 44px; mask-image:linear-gradient(180deg, rgba(0,0,0,.70), transparent 78%); }
.landing-v2 .lp-hero-surface::after{ content:""; position:absolute; left:-10%; right:-10%; top:20%; height:240px; background:linear-gradient(90deg, rgba(16,185,129,.18), rgba(34,211,238,.17), rgba(163,230,53,.14)); transform:skewY(-6deg); filter:blur(18px); opacity:.70; animation:lovvBandMove 14s ease-in-out infinite alternate; }
@keyframes lovvBandMove{ from{ transform:translateX(-18px) skewY(-6deg); } to{ transform:translateX(18px) skewY(-4deg); } }
.landing-v2 .lp-hero-grid{ position:relative; display:grid; grid-template-columns:minmax(0, 1.02fr) minmax(360px, .92fr); gap:56px; align-items:center; }
.landing-v2 .lp-hero-copy{ max-width:680px; }
.landing-v2 .lp-pill,.landing-v2 .lp-section-tag{ display:inline-flex; align-items:center; width:auto; margin:0 0 18px; padding:8px 13px; border:1px solid rgba(6,78,59,.12); border-radius:999px; background:rgba(255,255,255,.76); color:#047857; font-size:12px; font-weight:850; letter-spacing:.04em; text-transform:uppercase; box-shadow:var(--shadow-sm); }
.landing-v2 .lp-h1{ margin:0 0 22px; line-height:1.02; letter-spacing:0; }
.landing-v2 .lp-h1-brand{ display:block; width:max-content; font-family:var(--font-brand); font-size:88px; font-weight:800; letter-spacing:0; line-height:.86; color:transparent; background:linear-gradient(180deg, #022c22 0%, #059669 54%, #22d3ee 100%); -webkit-background-clip:text; background-clip:text; filter:drop-shadow(0 20px 34px rgba(16,185,129,.16)); }
.landing-v2 .lp-h1-line{ display:block; max-width:660px; margin-top:18px; font-family:var(--font-brand); font-size:50px; font-weight:800; color:#071f1a; letter-spacing:0; }
.landing-v2 .lp-tagline{ max-width:640px; margin:0 0 28px; color:var(--lovv-muted); font-size:19px; line-height:1.65; font-weight:550; }
.landing-v2 .lp-cta{ justify-content:flex-start; gap:12px; margin:0 0 30px; }
.landing-v2 .lp-stats{ width:min(100%, 620px); margin:0; justify-content:flex-start; border:1px solid var(--lovv-line); border-radius:20px; background:rgba(255,255,255,.78); box-shadow:var(--lovv-glow); }
.landing-v2 .lp-stat{ min-width:120px; align-items:flex-start; }
.landing-v2 .lp-stat strong{ color:transparent; font-size:32px; letter-spacing:0; background:linear-gradient(135deg, #022c22, #059669 68%, #22d3ee); -webkit-background-clip:text; background-clip:text; }
.landing-v2 .lp-stat span{ color:var(--lovv-muted); letter-spacing:.03em; text-align:left; }
.lp-device-shell{ border:1px solid var(--lovv-line); border-radius:28px; background:rgba(255,255,255,.82); box-shadow:var(--shadow-lg); overflow:hidden; transform:rotateY(-5deg) rotateX(2deg); animation:lovvDeviceFloat 7s ease-in-out infinite; }
@keyframes lovvDeviceFloat{ 0%,100%{ transform:rotateY(-5deg) rotateX(2deg) translateY(0); } 50%{ transform:rotateY(-3deg) rotateX(1deg) translateY(-8px); } }
.lp-device-top{ display:flex; align-items:center; gap:8px; padding:16px 18px; border-bottom:1px solid var(--lovv-line); background:rgba(248,255,252,.86); }
.lp-dot{ width:10px; height:10px; border-radius:50%; background:#cbd5e1; }
.lp-dot:nth-child(1){ background:#f97316; } .lp-dot:nth-child(2){ background:#facc15; } .lp-dot:nth-child(3){ background:#10b981; }
.lp-device-title{ margin-left:auto; color:var(--lovv-muted); font-size:13px; font-weight:750; }
.lp-device-body{ display:flex; flex-direction:column; gap:16px; padding:20px; }
.lp-live-row,.lp-question-preview,.lp-mini-card,.landing-v2 .lp-feature,.landing-v2 .lp-flow-card{ border:1px solid var(--lovv-line); border-radius:18px; background:rgba(255,255,255,.84); box-shadow:var(--shadow-sm); }
.lp-live-row{ display:flex; justify-content:space-between; gap:14px; align-items:center; padding:16px; }
.lp-kicker{ display:block; margin-bottom:4px; color:var(--lovv-muted); font-size:12px; font-weight:800; text-transform:uppercase; letter-spacing:.05em; }
.lp-live-row strong,.lp-question-preview h2,.lp-mini-card strong{ color:var(--text); }
.lp-live-badge{ display:inline-flex; align-items:center; gap:6px; padding:8px 11px; border-radius:999px; background:#ecfdf5; color:#047857; font-size:12px; font-weight:850; }
.lp-live-badge::before{ content:""; width:7px; height:7px; border-radius:50%; background:#10b981; box-shadow:0 0 0 4px rgba(16,185,129,.14); }
.lp-question-preview{ padding:18px; }
.lp-question-preview h2{ margin:0 0 14px; font-size:21px; line-height:1.3; }
.lp-answer{ padding:12px 14px; border:1px solid rgba(16,185,129,.18); border-radius:13px; color:#334155; font-weight:650; background:#fff; }
.lp-answer + .lp-answer{ margin-top:8px; }
.lp-answer.is-selected{ border-color:rgba(16,185,129,.36); background:linear-gradient(135deg, rgba(16,185,129,.10), rgba(34,211,238,.08)); color:#047857; }
.lp-device-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
.lp-mini-card{ padding:13px; }
.lp-mini-card span{ color:var(--lovv-muted); font-size:12px; }
.landing-v2 .lp-section{ padding:82px 0; }
.landing-v2 .lp-section-head{ max-width:760px; margin-bottom:42px; }
.landing-v2 .lp-h2{ color:var(--text); font-size:42px; line-height:1.12; letter-spacing:0; }
.landing-v2 .lp-section-sub{ color:var(--lovv-muted); font-size:17px; }
.landing-v2 .lp-features-section{ background:linear-gradient(180deg, rgba(255,255,255,.70), rgba(236,253,245,.68)); }
.landing-v2 .lp-features{ grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
.landing-v2 .lp-feature{ min-height:222px; padding:24px; position:relative; overflow:hidden; }
.landing-v2 .lp-flow-card{ padding:22px; position:relative; overflow:hidden; }
.landing-v2 .lp-feature::before,.landing-v2 .lp-flow-card::before{ content:""; position:absolute; left:0; right:0; top:0; height:3px; background:linear-gradient(90deg, #059669, #14b8a6, #22d3ee); }
.landing-v2 .lp-feature:hover,.landing-v2 .lp-flow-card:hover{ transform:translateY(-3px); border-color:var(--lovv-line-strong); box-shadow:var(--lovv-glow); }
.lp-feature-index,.lp-flow-card span{ color:#059669; font-family:var(--font-brand); font-size:13px; font-weight:850; }
.lp-feature-index{ display:inline-flex; margin-bottom:20px; }
.lp-flow-card span{ display:inline-flex; margin-bottom:16px; }
.landing-v2 .lp-feature h3,.landing-v2 .lp-flow-card h3{ color:var(--text); font-size:20px; letter-spacing:0; }
.landing-v2 .lp-feature p,.landing-v2 .lp-flow-card p{ color:var(--lovv-muted); font-size:15px; line-height:1.65; }
.lp-flow-section{ background:linear-gradient(135deg, rgba(16,185,129,.07), rgba(255,255,255,0) 34%), linear-gradient(315deg, rgba(34,211,238,.08), rgba(255,255,255,0) 38%); }
.lp-flow{ display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; }
.landing-v2 .lp-cta-section{ padding:76px 0 96px; background:linear-gradient(180deg, #fbfffd, #eef8f4); }
.landing-v2 .lp-cta-card{ max-width:none; text-align:left; padding:44px; border:1px solid rgba(255,255,255,.14); border-radius:24px; color:#eafff8; background:linear-gradient(135deg, #021614, #064e3b 62%, #0f766e); box-shadow:0 28px 78px rgba(3,45,37,.24); }
.landing-v2 .lp-cta-card::before{ display:none; }
.landing-v2 .lp-cta-card .lp-section-tag{ color:#d1fae5; background:rgba(255,255,255,.10); border-color:rgba(255,255,255,.16); }
.landing-v2 .lp-cta-card h2{ color:#fff; max-width:860px; margin:0 0 14px; font-size:34px; letter-spacing:0; }
.landing-v2 .lp-cta-card p{ color:rgba(236,253,245,.78); max-width:720px; margin:0; }

/* Test page: stable, no overlaps */
.main:has(.test-shell){ padding-top:0; padding-bottom:28px; }
.main > .test-shell{ margin-top:0; }
.test-shell{ width:100%; min-height:calc(100dvh - 72px); color:var(--text); background:var(--bg); user-select:none; -webkit-user-select:none; -webkit-touch-callout:none; -webkit-tap-highlight-color:transparent; touch-action:pan-y; }
.test-shell.unselectable *{ user-select:none !important; -webkit-user-select:none !important; }
.test-shell.unselectable input,.test-shell.unselectable textarea{ user-select:text !important; -webkit-user-select:text !important; }
.test-shell .test-header{ position:relative; margin:0 0 22px; padding:30px 0 34px; color:#eafff8; background:linear-gradient(135deg, #021614, #064e3b 60%, #0f766e); border-bottom:1px solid rgba(255,255,255,.12); box-shadow:var(--shadow-md); overflow:hidden; }
.test-shell .test-header::before{ content:""; position:absolute; inset:0; background-image:linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px); background-size:48px 48px; opacity:.45; pointer-events:none; }
.test-shell .test-header-inner{ position:relative; z-index:1; min-height:0; display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:start; gap:18px; }
.test-shell .test-info{ min-width:0; }
.test-shell .test-title{ color:#fff; font-size:28px; line-height:1.18; font-weight:800; letter-spacing:0; overflow-wrap:anywhere; }
.test-shell .test-student{ margin-top:6px; color:rgba(236,253,245,.76); font-size:15px; font-weight:650; overflow-wrap:anywhere; }
.test-shell .test-stats{ display:flex; justify-content:flex-end; margin:0; min-width:max-content; }
.test-shell .stat-pill{ min-height:40px; padding:8px 15px; border-radius:999px; color:#fff; background:rgba(255,255,255,.13); border:1px solid rgba(255,255,255,.20); box-shadow:none; font-size:14px; font-weight:800; white-space:nowrap; }
.test-shell .stat-pill.timer::before{ display:none; }
.test-shell .stat-pill.timer.danger{ background:var(--danger); border-color:var(--danger); }
.test-shell .container{ max-width:min(1440px, calc(100vw - 88px)); }
.test-shell .test-body{ position:relative; display:block; margin:0; padding-bottom:42px; }
.test-shell .progress-bar{ display:none !important; }
.test-shell .question-area{ min-height:0; margin:0 0 20px; padding:30px; border-radius:22px; border:1px solid var(--border); background:#fff; box-shadow:var(--shadow-md); overflow:visible; }
.test-shell .question-area::before,.test-shell .question-area::after{ display:none; }
.test-shell .question-text{ margin:0 0 22px; color:var(--text); font-size:24px; line-height:1.42; font-weight:800; letter-spacing:0; overflow-wrap:anywhere; }
.test-shell .option-list{ display:flex; flex-direction:column; gap:10px; min-width:0; }
.test-shell .option-item{ display:flex; align-items:center; gap:12px; min-width:0; min-height:58px; padding:14px 18px; border:2px solid var(--border); border-radius:14px; background:#fff; color:var(--text); box-shadow:none; font-size:19px; font-weight:650; line-height:1.35; overflow-wrap:anywhere; transition:background .15s ease, border-color .15s ease; }
.test-shell .option-item::after{ display:none; }
.test-shell .option-item:hover{ transform:none; border-color:var(--purple-300); background:var(--purple-50); }
.test-shell .option-item.checked{ border-color:var(--purple-500); background:var(--purple-50); }
.test-shell .option-item input[type="radio"],.test-shell .option-item input[type="checkbox"]{ appearance:auto; -webkit-appearance:auto; flex:0 0 22px; width:22px; height:22px; accent-color:var(--purple-700); margin:0; }
.test-shell .matching-table{ width:100%; table-layout:fixed; border-spacing:0 10px; }
.test-shell .matching-table td{ width:50%; min-width:0; padding:0 8px; }
.test-shell .matching-left{ background:var(--purple-50); border:1px solid var(--purple-200); color:var(--text); overflow-wrap:anywhere; }
.test-shell .matching-left,.test-shell .matching-table select,.test-shell .text-answer,.test-shell .fill-blank-text input{ max-width:100%; border-radius:13px; border:2px solid var(--border); box-shadow:none; font-size:17px; }
.test-shell .matching-table select{ width:100%; min-width:0; min-height:54px; text-overflow:ellipsis; }
.test-shell .text-answer:focus,.test-shell .matching-table select:focus,.test-shell .fill-blank-text input:focus{ border-color:var(--purple-500); box-shadow:var(--focus-ring); }
.test-shell .ordering-item{ border:2px solid var(--border); border-radius:13px; background:#fff; box-shadow:none; }
.test-shell .ordering-item:hover{ border-color:var(--purple-300); box-shadow:none; }
.test-shell .ordering-item .ord-num{ color:#fff; background:linear-gradient(135deg, #047857, #14b8a6); }
.test-shell .ordering-item .handle{ color:#10b981; }
.test-shell .test-controls{ display:grid; grid-template-columns:minmax(160px,240px) minmax(0,1fr) minmax(220px,270px); gap:14px; align-items:center; margin:0 0 14px; }
.test-shell .test-controls #prevBtn{ grid-column:1; min-height:52px; }
.test-shell .test-controls #nextBtn,.test-shell .test-controls #finishBtn{ grid-column:3; min-height:52px; font-size:17px; font-weight:800; }
.test-shell .test-controls #nextBtn{ background:linear-gradient(135deg, #022c22, #059669 64%, #22d3ee); color:#fff; box-shadow:0 12px 26px rgba(6,95,70,.20); }
.test-shell .test-controls #finishBtn{ background:linear-gradient(135deg, #047857, #10b981); color:#fff; }
.test-shell .question-nav{ display:flex; flex-wrap:wrap; gap:7px; max-width:100%; padding:12px; overflow:visible; border-radius:16px; border:1px solid var(--border); background:#fff; box-shadow:var(--shadow-sm); }
.test-shell .qnav-btn{ flex:0 0 42px; width:42px; height:42px; border-radius:12px; border:2px solid var(--border); background:#fff; color:var(--text-muted); box-shadow:none; font-size:15px; font-weight:800; }
.test-shell .qnav-btn:hover{ border-color:var(--purple-400); color:var(--purple-800); }
.test-shell .qnav-btn.answered{ color:var(--purple-800); background:var(--purple-100); border-color:var(--purple-300); }
.test-shell .qnav-btn.current{ color:#022c22; background:linear-gradient(135deg, #a3e635, #34d399); border-color:transparent; box-shadow:0 5px 14px rgba(16,185,129,.28); }
.test-shell .qnav-btn.locked{ opacity:.42; }

/* Entry/unavailable overlays */
.overlay{ background:rgba(2,22,20,.78); backdrop-filter:blur(12px); }
.overlay-box{ border:1px solid rgba(255,255,255,.65); border-radius:24px; background:#fff; box-shadow:var(--shadow-lg); }
.overlay-box h2{ color:#047857; }
.unavailable-shell{ min-height:calc(100dvh - 200px); display:flex; align-items:center; justify-content:center; padding:24px 16px; }
.unavailable-card{ max-width:520px; width:100%; padding:42px 34px; background:#fff; border:1px solid var(--lovv-line); border-radius:24px; box-shadow:var(--shadow-lg); text-align:center; }
.unavailable-title{ color:#047857; }

/* Footer */
.footer{ display:block; margin-top:46px; padding:26px 0; color:#eafff8; background:linear-gradient(135deg, #021614, #064e3b); border-top:1px solid rgba(255,255,255,.10); }
.footer-inner{ display:flex; align-items:center; justify-content:space-between; gap:18px; }
.footer-brand{ color:#fff; }
.footer-tagline,.footer-dev-label{ color:rgba(236,253,245,.72); }
.footer-right{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.footer-tg{ color:#fff; background:rgba(255,255,255,.12); border:1px solid rgba(255,255,255,.22); white-space:nowrap; }
.footer-tg:hover{ color:#fff; background:rgba(255,255,255,.18); }
.footer-tg svg{ color:#5eead4; }
body:has(.test-shell) .footer{ display:none; }

/* Responsive */
@media (max-width:1100px){
    .landing-v2 .lp-hero-grid{ grid-template-columns:1fr; gap:38px; }
    .landing-v2 .lp-hero-copy{ max-width:760px; }
    .lp-hero-product{ max-width:620px; }
    .lp-device-shell{ transform:none; animation:none; }
    .lp-flow{ grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:980px){
    .container{ padding-left:16px; padding-right:16px; }
    .topbar-inner{ align-items:flex-start; }
    .topnav{ width:100%; overflow-x:auto; padding-bottom:4px; scrollbar-width:thin; }
    .topnav a{ flex:0 0 auto; }
    .user-chip{ display:none; }
    .page-header-row{ flex-direction:column; align-items:stretch; }
    .page-header-row .btn.btn-lg{ width:100%; justify-content:center; }
    .filter-actions{ justify-content:flex-start; }
    .landing-v2 .lp-features{ grid-template-columns:repeat(2,minmax(0,1fr)); }
    .test-shell .container{ max-width:100%; }
    .test-shell .test-header-inner{ grid-template-columns:1fr; }
    .test-shell .test-stats{ justify-content:flex-start; }
    .test-shell .test-title{ font-size:24px; }
    .test-shell .question-text{ font-size:22px; }
}
@media (max-width:720px){
    .main{ padding-top:24px; padding-bottom:42px; }
    .brand{ font-size:30px; }
    .topbar-inner{ min-height:64px; }
    .landing-v2 .lp-hero-v2{ min-height:0; padding:70px 0 58px; }
    .landing-v2 .lp-h1-brand{ font-size:58px; }
    .landing-v2 .lp-h1-line{ font-size:30px; }
    .landing-v2 .lp-tagline{ font-size:16px; }
    .landing-v2 .lp-cta{ flex-direction:column; align-items:stretch; }
    .landing-v2 .lp-cta .btn{ width:100%; justify-content:center; }
    .landing-v2 .lp-stats{ flex-direction:column; align-items:stretch; gap:12px; }
    .landing-v2 .lp-stat{ width:100%; min-width:0; }
    .landing-v2 .lp-stat-sep{ display:none; }
    .lp-device-grid,.landing-v2 .lp-features,.lp-flow{ grid-template-columns:1fr; }
    .landing-v2 .lp-section{ padding:58px 0; }
    .landing-v2 .lp-section-head{ text-align:left; }
    .landing-v2 .lp-h2{ font-size:31px; }
    .landing-v2 .lp-cta-card{ padding:28px; }
    .landing-v2 .lp-cta-card h2{ font-size:26px; }
    .stats-grid,.tests-grid{ grid-template-columns:1fr; }
    .filter-bar{ align-items:stretch; }
    .filter-bar > *, .filter-actions, .upload-form .btn, .upload-form input[type=file]{ width:100%; }
    .test-shell .test-header{ padding:20px 0 26px; margin-bottom:16px; }
    .test-shell .test-title{ font-size:20px; line-height:1.24; }
    .test-shell .test-student{ font-size:13px; }
    .test-shell .question-area{ padding:20px 14px; border-radius:18px; }
    .test-shell .question-text{ font-size:18px; line-height:1.36; margin-bottom:16px; }
    .test-shell .option-item{ min-height:50px; padding:12px; border-radius:12px; font-size:16px; }
    .test-shell .matching-table,.test-shell .matching-table tbody,.test-shell .matching-table tr,.test-shell .matching-table td{ display:block; width:100%; }
    .test-shell .matching-table td{ padding:4px 0; }
    .test-shell .test-controls{ grid-template-columns:1fr; gap:10px; }
    .test-shell .test-controls #prevBtn,.test-shell .test-controls #nextBtn,.test-shell .test-controls #finishBtn{ grid-column:1; width:100%; min-height:48px; font-size:15px; }
    .test-shell .test-controls #nextBtn,.test-shell .test-controls #finishBtn{ order:1; }
    .test-shell .test-controls #prevBtn{ order:2; }
    .test-shell .question-nav{ flex-wrap:nowrap; overflow-x:auto; overflow-y:hidden; padding:9px; }
    .test-shell .qnav-btn{ flex-basis:40px; width:40px; height:40px; font-size:14px; }
    .footer-inner{ flex-direction:column; align-items:flex-start; }
}
@media (max-width:480px){
    .lovv-toasts{ top:10px; right:10px; left:10px; }
    .lovv-toast{ min-width:0; max-width:none; width:100%; }
    .net-status,.save-status{ left:10px; bottom:10px; font-size:12px; padding:7px 10px; }
    .data-table th,.data-table td{ padding:10px 8px; font-size:13px; }
}
@media (prefers-reduced-motion: reduce){
    *,*::before,*::after{ animation-duration:.01ms !important; animation-iteration-count:1 !important; transition-duration:.01ms !important; scroll-behavior:auto !important; }
}

/* Support pages: 2FA, users, editor helpers */
.login-page{ display:flex; align-items:center; justify-content:center; min-height:calc(100dvh - 190px); padding:24px 0; }
.login-page .login-card{ max-width:430px; width:100%; }
.totp-page{ max-width:820px; padding-top:24px; padding-bottom:44px; }
.totp-success-banner{ display:flex; align-items:center; gap:18px; padding:20px 24px; margin-bottom:20px; border:1px solid #a7f3d0; border-radius:20px; background:linear-gradient(135deg, #ecfdf5, #f8fffc); box-shadow:var(--shadow-sm); }
.totp-success-icon{ flex:0 0 56px; width:56px; height:56px; display:grid; place-items:center; border-radius:50%; background:linear-gradient(135deg, #10b981, #22d3ee); color:#022c22; font-size:30px; font-weight:900; }
.totp-recovery-card{ padding:22px; border:1px solid #a7f3d0; border-radius:20px; background:#f8fffc; box-shadow:var(--shadow-sm); }
.recovery-codes{ margin:12px 0; padding:18px; border:1px dashed #10b981; border-radius:14px; background:#fff; color:#064e3b; font-family:ui-monospace, Menlo, Consolas, monospace; font-size:17px; letter-spacing:1px; line-height:2; text-align:center; user-select:all; overflow-wrap:break-word; }
.totp-actions{ display:flex; flex-wrap:wrap; gap:10px; align-items:center; }
.totp-steps{ display:flex; flex-direction:column; gap:14px; margin-top:18px; }
.totp-step{ display:flex; gap:16px; padding:18px; border:1px solid var(--lovv-line); border-radius:18px; background:#fff; box-shadow:var(--shadow-sm); }
.totp-step-num{ flex:0 0 38px; width:38px; height:38px; display:grid; place-items:center; border-radius:50%; background:linear-gradient(135deg, #059669, #22d3ee); color:#022c22; font-family:var(--font-brand); font-size:18px; font-weight:900; }
.totp-step-body{ flex:1 1 auto; min-width:0; }
.totp-step-body h2{ margin:4px 0 10px; color:#064e3b; font-family:var(--font-brand); font-size:18px; }
.totp-add-grid{ display:grid; grid-template-columns:250px minmax(0,1fr); gap:18px; align-items:start; }
.totp-qr-box{ padding:12px; border:1px solid var(--lovv-line); border-radius:16px; background:#fff; text-align:center; }
.totp-qr-box img{ display:block; max-width:100%; height:auto; margin:0 auto; border-radius:8px; image-rendering:pixelated; }
.totp-qr-fallback{ padding:20px 8px; border-radius:12px; background:#ecfdf5; color:#064e3b; }
.totp-manual-box{ display:flex; flex-direction:column; gap:8px; padding:14px; border:1px solid var(--lovv-line); border-radius:16px; background:#f8fffc; }
.totp-manual-label,.totp-manual-hint{ color:var(--lovv-muted); font-size:13px; }
.totp-secret-display{ display:block; padding:11px 12px; border:1px solid var(--border); border-radius:12px; background:#fff; color:#064e3b; font-family:ui-monospace, Menlo, Consolas, monospace; font-size:16px; letter-spacing:2px; word-break:break-all; user-select:all; }
.totp-code-input input{ width:100%; max-width:290px; margin-bottom:12px; padding:14px 16px; border:2px solid var(--border); border-radius:14px; background:#fff; color:var(--text); font-family:ui-monospace, Menlo, Consolas, monospace; font-size:28px; letter-spacing:8px; text-align:center; }
.totp-code-input input:focus{ outline:0; border-color:#10b981; box-shadow:var(--focus-ring); }
.share-url-row{ display:flex; gap:8px; align-items:stretch; }
.share-url-row input{ flex:1 1 auto; min-width:0; font-family:ui-monospace, Menlo, Consolas, monospace; background:#f8fffc; color:#064e3b; font-weight:650; }
.share-url-row .btn{ flex-shrink:0; white-space:nowrap; }
.expiry-info{ display:flex; align-items:center; gap:8px; margin-top:10px; padding:10px 14px; border-radius:12px; font-size:14px; }
.expiry-info--active{ color:#047857; background:#ecfdf5; border:1px solid #a7f3d0; }
.expiry-info--expired{ color:#b91c1c; background:#fff1f2; border:1px solid #fecdd3; }
.editor-restore-banner{ display:flex; align-items:center; gap:14px; margin:0 0 16px; padding:14px 18px; border:1px solid #f59e0b; border-left:4px solid #d97706; border-radius:16px; background:linear-gradient(135deg, #fff8e6, #fffbeb); color:#78350f; }
.editor-restore-banner .erb-text{ flex:1 1 auto; line-height:1.4; }
.editor-restore-banner .erb-actions{ display:flex; flex-shrink:0; gap:8px; }
.badge-2fa-on{ display:inline-block; padding:3px 8px; border-radius:999px; background:#dcfce7; color:#166534; font-size:12px; font-weight:700; }
.badge-2fa-off{ display:inline-block; padding:3px 8px; border-radius:999px; background:#fef3c7; color:#92400e; font-size:12px; font-weight:700; }
.badge-locked{ display:inline-block; margin-left:6px; padding:3px 8px; border-radius:999px; background:#fee2e2; color:#991b1b; font-size:12px; font-weight:700; }
.row-locked{ background:#fef2f2; }
.actions-row{ display:flex; flex-wrap:wrap; gap:6px; align-items:center; }
.users-page .actions-row form{ margin:0; }
.card-muted{ padding:16px 20px; border:1px solid var(--lovv-line); border-radius:14px; background:#ecfdf5; }
@media (max-width:720px){
    .totp-step{ flex-direction:column; gap:12px; padding:16px; }
    .totp-add-grid{ grid-template-columns:1fr; }
    .totp-actions{ align-items:stretch; }
    .totp-actions .btn{ width:100%; justify-content:center; }
    .share-url-row{ flex-direction:column; }
    .editor-restore-banner{ flex-direction:column; align-items:stretch; }
    .editor-restore-banner .erb-actions{ justify-content:flex-end; }
}

/* Absolute no-purple lock for the test runtime. Overrides legacy style.css body:has rules. */
body:has(.test-shell) .main{
    padding-top:0 !important;
    padding-bottom:28px !important;
}

body:has(.test-shell) .test-header,
.test-shell .test-header{
    position:relative !important;
    margin:0 0 22px !important;
    padding:30px 0 34px !important;
    overflow:hidden !important;
    color:#eafff8 !important;
    background:
        linear-gradient(135deg, #021614 0%, #064e3b 58%, #0f766e 100%) !important;
    border-bottom:1px solid rgba(255,255,255,.12) !important;
    box-shadow:0 14px 38px rgba(3,45,37,.16) !important;
}

body:has(.test-shell) .test-header::before,
.test-shell .test-header::before{
    content:"" !important;
    display:block !important;
    position:absolute !important;
    inset:0 !important;
    background-image:
        linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px) !important;
    background-size:48px 48px !important;
    opacity:.42 !important;
    pointer-events:none !important;
}

body:has(.test-shell) .test-header::after,
.test-shell .test-header::after{
    display:none !important;
}

body:has(.test-shell) .test-header-inner,
.test-shell .test-header-inner{
    position:relative !important;
    z-index:1 !important;
    min-height:0 !important;
    display:grid !important;
    grid-template-columns:minmax(0,1fr) auto !important;
    align-items:start !important;
    gap:18px !important;
}

body:has(.test-shell) .test-title,
.test-shell .test-title{
    color:#ffffff !important;
    font-size:28px !important;
    line-height:1.18 !important;
    font-weight:800 !important;
    letter-spacing:0 !important;
    overflow-wrap:anywhere !important;
}

body:has(.test-shell) .test-student,
.test-shell .test-student{
    margin-top:6px !important;
    color:rgba(236,253,245,.76) !important;
    font-size:15px !important;
    font-weight:650 !important;
}

body:has(.test-shell) .test-stats,
.test-shell .test-stats{
    display:flex !important;
    justify-content:flex-end !important;
    margin:0 !important;
    min-width:max-content !important;
}

body:has(.test-shell) .question-area,
.test-shell .question-area{
    margin:0 0 20px !important;
    padding:30px !important;
    border-radius:22px !important;
    border:1px solid var(--border) !important;
    background:#ffffff !important;
    box-shadow:var(--shadow-md) !important;
}

body:has(.test-shell) .test-controls,
.test-shell .test-controls{
    display:grid !important;
    grid-template-columns:minmax(160px,240px) minmax(0,1fr) minmax(220px,270px) !important;
    gap:14px !important;
    align-items:center !important;
    margin:0 0 14px !important;
}

@media (max-width:980px){
    body:has(.test-shell) .test-header-inner,
    .test-shell .test-header-inner{
        grid-template-columns:1fr !important;
    }
    body:has(.test-shell) .test-title,
    .test-shell .test-title{
        font-size:24px !important;
    }
    body:has(.test-shell) .test-stats,
    .test-shell .test-stats{
        justify-content:flex-start !important;
    }
}

@media (max-width:720px){
    body:has(.test-shell) .test-header,
    .test-shell .test-header{
        padding:20px 0 26px !important;
        margin-bottom:16px !important;
    }
    body:has(.test-shell) .test-title,
    .test-shell .test-title{
        font-size:20px !important;
        line-height:1.24 !important;
    }
    body:has(.test-shell) .question-area,
    .test-shell .question-area{
        padding:20px 14px !important;
        border-radius:18px !important;
    }
    body:has(.test-shell) .test-controls,
    .test-shell .test-controls{
        grid-template-columns:1fr !important;
        gap:10px !important;
    }
}
