/* =====================================================================
   CODERS ARCADE - ASSESSMENT PORTAL
   Design system: slate / green / blue (original theme colours)
   Type: Manrope (UI) + JetBrains Mono (code only)
   ===================================================================== */

:root {
    /* Theme colours (unchanged palette) */
    --slate-900: #0F172A;
    --slate-800: #1E293B;
    --slate-700: #334155;
    --slate-600: #475569;
    --slate-500: #64748B;
    --slate-400: #94A3B8;
    --slate-200: #E2E8F0;
    --slate-100: #F1F5F9;
    --slate-50:  #F8FAFC;
    --white: #FFFFFF;

    --green: #22C55E;
    --green-700: #16A34A;
    --green-800: #15803D;
    --green-100: #DCFCE7;
    --green-50:  #F0FDF4;

    --blue: #3B82F6;
    --blue-700: #2563EB;
    --blue-100: #DBEAFE;
    --blue-50:  #EFF6FF;

    --red: #EF4444;
    --red-700: #B91C1C;
    --red-100: #FEE2E2;
    --red-50:  #FEF2F2;
    --amber-700: #B45309;
    --amber-100: #FEF3C7;

    /* Roles */
    --text: var(--slate-900);
    --text-2: var(--slate-600);
    --text-3: var(--slate-500);
    --line: var(--slate-200);
    --bg: var(--slate-50);

    /* Type */
    --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --mono: "JetBrains Mono", Consolas, Monaco, "Courier New", monospace;

    /* Radius hierarchy: panel > control > chip */
    --r-panel: 14px;
    --r-ctl: 9px;
    --r-chip: 6px;

    --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 1px rgba(15, 23, 42, .03);
    --ring: 0 0 0 3px rgba(34, 197, 94, .28);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; line-height: 1.25; color: var(--text); letter-spacing: -0.015em; }
h1 { font-size: clamp(1.5rem, 2.6vw, 1.9rem); font-weight: 800; }
h2 { font-size: 1.25rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 700; }
h4 { font-size: .95rem; font-weight: 700; }
p  { margin: 0; }
a  { color: var(--blue-700); text-decoration: none; }
a:hover { text-decoration: underline; }
small, .small { font-size: .82rem; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.mono  { font-family: var(--mono); }
.hidden { display: none !important; }

:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-chip); }

.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.icon-sm { width: 15px; height: 15px; vertical-align: -2px; }
.icon-lg { width: 22px; height: 22px; }

/* ------------------------------------------------------------------
   HEADER
   ------------------------------------------------------------------ */

.topbar {
    background: var(--slate-700);
    border-bottom: 3px solid var(--green);
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-inner {
    max-width: 1160px;
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 12px; color: var(--white); }
.brand:hover { text-decoration: none; }
.brand-logo { height: 40px; width: auto; display: block; border-radius: 6px; }
.brand-name { font-weight: 700; font-size: 1.02rem; color: var(--white); line-height: 1.2; }
.brand-name span { display: block; font-weight: 500; font-size: .78rem; color: var(--slate-400); }

.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav a, .nav .nav-user {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 7px 12px;
    border-radius: var(--r-ctl);
    color: var(--slate-200);
    font-weight: 600;
    font-size: .9rem;
}
.nav a:hover { background: rgba(255, 255, 255, .08); color: var(--white); text-decoration: none; }
.nav a.active { background: rgba(34, 197, 94, .16); color: #86EFAC; }
.nav .nav-user { color: var(--slate-400); font-weight: 500; }
.nav .nav-cta { background: var(--green); color: var(--slate-900); }
.nav .nav-cta:hover { background: #4ADE80; color: var(--slate-900); }

@media (max-width: 640px) {
    .topbar-inner { padding: 8px 14px; }
    .brand-logo { height: 32px; }
    .brand-name span { display: none; }
    .nav { width: 100%; }
    .nav a, .nav .nav-user { padding: 6px 9px; font-size: .85rem; }
}

/* ------------------------------------------------------------------
   LAYOUT
   ------------------------------------------------------------------ */

.main { flex: 1; width: 100%; }
.shell { max-width: 1160px; margin: 0 auto; padding: 28px 20px 48px; }
.shell-narrow { max-width: 760px; }
.shell-wide { max-width: 1440px; }
td.nowrap, th.nowrap { white-space: nowrap; }
@media (max-width: 640px) { .shell { padding: 18px 14px 36px; } }

.page-head {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 16px; flex-wrap: wrap; margin-bottom: 22px;
}
.page-head p { color: var(--text-2); margin-top: 4px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

.stack > * + * { margin-top: 18px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.panel {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--r-panel);
    padding: 22px;
    box-shadow: var(--shadow);
}
.panel + .panel { margin-top: 18px; }
.grid-2, .grid-3, .grid-4, .about { margin-bottom: 18px; }
.grid-2 > .panel, .grid-3 > .panel, .grid-4 > .panel, .about > .panel { margin-top: 0; }
.panel-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    margin-bottom: 16px; flex-wrap: wrap;
}
.panel-head h2, .panel-head h3 { display: flex; align-items: center; gap: 9px; }
.panel-head .icon { color: var(--green-700); }
@media (max-width: 640px) { .panel { padding: 16px; } }

.divider { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

/* ------------------------------------------------------------------
   BUTTONS
   ------------------------------------------------------------------ */

.btn, button[type="submit"]:where(:not(.btn, .tool-button)) {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 18px;
    border-radius: var(--r-ctl);
    border: 1px solid transparent;
    font-family: inherit;
    font-size: .92rem;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
    white-space: nowrap;
}
.btn:hover { text-decoration: none; }

.btn-primary, button[type="submit"]:where(:not(.btn, .tool-button)) { background: var(--green); color: var(--slate-900); }
.btn-primary:hover, button[type="submit"]:where(:not(.btn, .tool-button)):hover { background: var(--green-700); color: var(--white); }

.btn-dark { background: var(--slate-800); color: var(--white); }
.btn-dark:hover { background: var(--slate-700); }

.btn-blue { background: var(--blue); color: var(--white); }
.btn-blue:hover { background: var(--blue-700); }

.btn-secondary { background: var(--white); color: var(--slate-700); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--slate-400); color: var(--slate-900); }

.btn-danger { background: var(--white); color: var(--red-700); border-color: #FECACA; }
.btn-danger:hover { background: var(--red-50); border-color: var(--red); }

.btn-sm { padding: 6px 11px; font-size: .82rem; border-radius: var(--r-chip); }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-disabled { background: var(--slate-100); color: var(--slate-400); border-color: var(--line); cursor: not-allowed; }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ------------------------------------------------------------------
   FORMS
   ------------------------------------------------------------------ */

.field { margin-bottom: 14px; }
label, .label { display: block; font-size: .85rem; font-weight: 700; color: var(--slate-700); margin-bottom: 6px; }
.hint { font-size: .8rem; color: var(--text-3); margin-top: 5px; }

input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="tel"], input[type="datetime-local"], select, textarea {
    width: 100%;
    padding: 10px 12px;
    font-family: inherit;
    font-size: .95rem;
    color: var(--text);
    background: var(--white);
    border: 1px solid #CBD5E1;
    border-radius: var(--r-ctl);
    transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { font-family: var(--mono); font-size: .88rem; line-height: 1.55; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green); box-shadow: var(--ring); }
input[readonly] { background: var(--slate-50); color: var(--text-2); }
input::placeholder, textarea::placeholder { color: var(--slate-400); }

.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }

/* Segmented choice (student type) */
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.seg-option { position: relative; margin: 0; cursor: pointer; }
.seg-option input { position: absolute; opacity: 0; pointer-events: none; }
.seg-card {
    display: flex; gap: 11px; align-items: flex-start;
    padding: 13px 14px;
    border: 1px solid #CBD5E1;
    border-radius: var(--r-ctl);
    background: var(--white);
    transition: border-color .15s ease, background-color .15s ease;
}
.seg-card .icon { color: var(--slate-500); margin-top: 2px; }
.seg-card strong { display: block; font-size: .92rem; color: var(--text); }
.seg-card span { display: block; font-size: .8rem; font-weight: 500; color: var(--text-3); }
.seg-option input:checked + .seg-card { border-color: var(--green); background: var(--green-50); box-shadow: inset 0 0 0 1px var(--green); }
.seg-option input:checked + .seg-card .icon { color: var(--green-700); }
.seg-option input:focus-visible + .seg-card { box-shadow: var(--ring); }
@media (max-width: 480px) { .segmented { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------
   ALERTS / BADGES
   ------------------------------------------------------------------ */

.alert {
    display: flex; gap: 10px; align-items: flex-start;
    padding: 12px 14px;
    border-radius: var(--r-ctl);
    border: 1px solid;
    font-size: .9rem;
    margin-bottom: 16px;
}
.alert .icon { margin-top: 2px; }
.alert-success { background: var(--green-50); border-color: #BBF7D0; color: var(--green-800); }
.alert-error   { background: var(--red-50); border-color: #FECACA; color: var(--red-700); }
.alert-info    { background: var(--blue-50); border-color: #BFDBFE; color: #1D4ED8; }
.alert-warn    { background: #FFFBEB; border-color: #FDE68A; color: var(--amber-700); }

.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: .76rem;
    font-weight: 700;
    white-space: nowrap;
}
.badge-green { background: var(--green-100); color: var(--green-800); }
.badge-red   { background: var(--red-100); color: var(--red-700); }
.badge-blue  { background: var(--blue-100); color: #1D4ED8; }
.badge-grey  { background: var(--slate-100); color: var(--slate-600); }
.badge-amber { background: var(--amber-100); color: var(--amber-700); }

/* ------------------------------------------------------------------
   TABLES
   ------------------------------------------------------------------ */

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-ctl); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th {
    text-align: left; font-weight: 700; font-size: .8rem; color: var(--slate-600);
    background: var(--slate-50); padding: 11px 14px; border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
th a { color: inherit; }
td { padding: 11px 14px; border-bottom: 1px solid var(--slate-100); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #FBFDFF; }
td .sub { display: block; font-size: .8rem; color: var(--text-3); }
.td-actions { display: flex; gap: 6px; align-items: center; flex-wrap: nowrap; }
.td-actions form { margin: 0; }
.num { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------
   KEY-VALUE / STATS
   ------------------------------------------------------------------ */

.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.kv > div { padding: 12px 14px; background: var(--slate-50); border: 1px solid var(--slate-100); border-radius: var(--r-ctl); }
.kv dt, .kv .k { font-size: .78rem; font-weight: 600; color: var(--text-3); }
.kv dd, .kv .v { margin: 2px 0 0; font-weight: 700; color: var(--text); word-break: break-word; }

.stat { display: flex; align-items: center; gap: 14px; }
.stat-icon {
    width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center;
    background: var(--green-50); color: var(--green-700);
}
.stat-icon.blue { background: var(--blue-50); color: var(--blue-700); }
.stat-icon.slate { background: var(--slate-100); color: var(--slate-600); }
.stat-value { font-size: 1.55rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-label { font-size: .82rem; color: var(--text-3); font-weight: 600; }

.score-strip { display: flex; gap: 18px; flex-wrap: wrap; font-weight: 700; font-size: .9rem; margin-top: 14px; }
.score-strip .ok { color: var(--green-700); }
.score-strip .bad { color: var(--red-700); }
.score-strip .na { color: var(--slate-500); }

/* ------------------------------------------------------------------
   LIST ROWS (tests, items)
   ------------------------------------------------------------------ */

.rows { border: 1px solid var(--line); border-radius: var(--r-ctl); overflow: hidden; }
.row-item {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    padding: 14px 16px; background: var(--white);
}
.row-item + .row-item { border-top: 1px solid var(--slate-100); }
.row-item h4 { font-size: .97rem; }
.row-meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: .82rem; color: var(--text-3); margin-top: 2px; }
.row-meta span { display: inline-flex; align-items: center; gap: 5px; }
@media (max-width: 560px) { .row-item { flex-direction: column; align-items: stretch; } }

.empty {
    padding: 28px 18px; text-align: center; color: var(--text-2);
    border: 1px dashed #CBD5E1; border-radius: var(--r-ctl); background: var(--slate-50);
}
.empty .icon { color: var(--slate-400); width: 26px; height: 26px; display: block; margin: 0 auto 8px; }

/* ------------------------------------------------------------------
   HOME (landing)
   ------------------------------------------------------------------ */

.hero {
    display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: 44px; align-items: center; padding: 26px 0 34px;
}
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; gap: 28px; padding-top: 6px; } }

.hero-kicker {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: .85rem; font-weight: 700; color: var(--green-800);
    background: var(--green-50); border: 1px solid #BBF7D0;
    padding: 5px 11px; border-radius: 999px; margin-bottom: 18px;
}
.hero-kicker .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.hero h1 {
    font-size: clamp(2rem, 4.6vw, 3.1rem);
    line-height: 1.08;
    letter-spacing: -0.035em;
    font-weight: 800;
    max-width: 14ch;
}
.hero h1 .bracket { font-family: var(--mono); font-weight: 500; color: var(--slate-400); letter-spacing: -0.06em; }
.hero-lead { font-size: 1.06rem; color: var(--text-2); max-width: 52ch; margin: 18px 0 26px; }
.hero .btn { padding: 12px 22px; font-size: .97rem; }

/* Code editor panel - the one bold element */
.editor {
    background: var(--slate-800);
    border-radius: var(--r-panel);
    border: 1px solid #0B1220;
    box-shadow: 0 24px 48px -24px rgba(15, 23, 42, .45);
    overflow: hidden;
    font-family: var(--mono);
    font-size: .86rem;
}
.editor-bar {
    display: flex; align-items: center; gap: 8px;
    padding: 11px 14px; background: var(--slate-900); color: var(--slate-400); font-size: .78rem;
}
.editor-bar i { width: 10px; height: 10px; border-radius: 50%; background: #475569; display: inline-block; }
.editor-bar i:nth-child(1) { background: #EF4444; }
.editor-bar i:nth-child(2) { background: #F59E0B; }
.editor-bar i:nth-child(3) { background: var(--green); }
.editor-bar .file { margin-left: 8px; }
.editor pre { margin: 0; padding: 18px 0; line-height: 1.75; color: #CBD5E1; overflow-x: auto; }
.editor .ln { display: inline-block; width: 38px; padding-right: 14px; text-align: right; color: #475569; user-select: none; }
.editor .c { color: #64748B; }
.editor .k { color: #60A5FA; }
.editor .f { color: #4ADE80; }
.editor .s { color: #FDE68A; }
.editor .n { color: #F0ABFC; }
.editor-out {
    border-top: 1px solid #0B1220; background: #172033; padding: 12px 18px; color: #86EFAC; font-size: .82rem;
}
.editor-out .faint { color: #64748B; }
.cursor { display: inline-block; width: 8px; height: 1.05em; background: #4ADE80; vertical-align: -2px; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }


.about { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 18px; margin-bottom: 18px; }
@media (max-width: 900px) { .about { grid-template-columns: 1fr; } }
.tracks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.track {
    padding: 7px 12px; border-radius: var(--r-chip);
    background: var(--slate-50); border: 1px solid var(--line);
    font-weight: 700; font-size: .86rem; color: var(--slate-700);
}
.yt { display: flex; flex-direction: column; justify-content: space-between; gap: 16px; background: var(--slate-700); border-color: var(--slate-700); color: var(--slate-200); }
.yt h3 { color: var(--white); }
.yt p { color: var(--slate-400); font-size: .92rem; margin-top: 6px; }
.yt-figures { display: flex; gap: 22px; flex-wrap: wrap; }
.yt-figures b { display: block; font-size: 1.35rem; color: var(--white); font-variant-numeric: tabular-nums; }
.yt-figures span { font-size: .8rem; color: var(--slate-400); }
.yt a.btn { align-self: flex-start; }

/* ------------------------------------------------------------------
   AUTH
   ------------------------------------------------------------------ */

.auth { max-width: 480px; margin: 12px auto 0; }
.auth-head { margin-bottom: 18px; }
.auth-head h1 { font-size: 1.6rem; }
.auth-head p { color: var(--text-2); margin-top: 6px; }
.auth-foot { text-align: center; margin-top: 16px; color: var(--text-2); font-size: .9rem; }
.locked { padding: 12px 14px; border-radius: var(--r-ctl); background: var(--slate-50); border: 1px solid var(--line); margin-bottom: 18px; }
.locked .kv-line { display: flex; justify-content: space-between; gap: 10px; font-size: .9rem; padding: 3px 0; }
.locked .kv-line span:first-child { color: var(--text-3); }
.locked .kv-line span:last-child { font-weight: 700; text-align: right; }
.otp-input { font-family: var(--mono); font-size: 1.35rem !important; letter-spacing: .45em; text-align: center; }
.otp-status { font-size: .88rem; min-height: 1.4em; margin: 8px 0 4px; color: var(--green-800); font-weight: 600; }

/* ------------------------------------------------------------------
   DASHBOARD
   ------------------------------------------------------------------ */

.verify-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; }
.verify-item + .verify-item { border-top: 1px solid var(--slate-100); }
.verify-item .who { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.verify-item .who .icon { color: var(--slate-500); }
.inline-form { display: flex; gap: 8px; margin-top: 12px; }
.inline-form input { flex: 1; }

/* ------------------------------------------------------------------
   TEST PAGE
   ------------------------------------------------------------------ */

.test-head {
    display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; flex-wrap: wrap;
    margin-bottom: 18px;
}
.rules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 22px; margin: 0; padding: 0; list-style: none; }
.rules li { display: flex; gap: 10px; font-size: .9rem; color: var(--text-2); }
.rules li .icon { color: var(--green-700); margin-top: 3px; }
.rules li.warn .icon { color: var(--amber-700); }
@media (max-width: 640px) { .rules { grid-template-columns: 1fr; } }

.q-card {
    background: var(--white); border: 1px solid var(--line); border-radius: var(--r-panel);
    padding: 20px 22px; margin-top: 14px; box-shadow: var(--shadow);
}
.q-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.q-num {
    flex: none; min-width: 34px; height: 34px; padding: 0 8px; border-radius: var(--r-ctl);
    display: grid; place-items: center; background: var(--slate-800); color: var(--white);
    font-family: var(--mono); font-weight: 700; font-size: .88rem;
}
.q-text, .question-text {
    font-size: .98rem; line-height: 1.6; color: var(--text); font-weight: 500;
    word-break: break-word; padding-top: 5px; flex: 1; min-width: 0;
}
.q-para { margin: 0 0 10px; white-space: pre-wrap; }
.q-para:last-child { margin-bottom: 0; }
.q-code, .opt-code {
    margin: 0 0 10px; padding: 12px 14px; border-radius: var(--r-ctl);
    background: #0F172A; color: #E2E8F0; border: 1px solid #1E293B;
    font-family: var(--mono); font-size: .86rem; line-height: 1.6; font-weight: 400;
    white-space: pre; overflow-x: auto; tab-size: 4;
}
.q-code:last-child { margin-bottom: 0; }
.q-code code, .opt-code code { font: inherit; color: inherit; background: none; padding: 0; }
.opt-code { margin: 6px 0 0; padding: 8px 10px; font-size: .82rem; }
.opt-inline { font-family: var(--mono); font-size: .88rem; background: var(--slate-100, #F1F5F9); padding: 1px 6px; border-radius: 4px; }
.q-text-compact { padding: 0; font-size: .85rem; }
.q-text-compact .q-code { padding: 6px 8px; font-size: .78rem; margin-bottom: 4px; }
.q-text-compact .q-para { margin-bottom: 4px; }
textarea.opt-input { min-height: 42px; font-family: var(--mono); font-size: .88rem; resize: vertical; }
.options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 720px) { .options { grid-template-columns: 1fr; } }
.opt {
    display: flex; align-items: flex-start; gap: 11px; margin: 0;
    padding: 12px 14px; border: 1px solid #CBD5E1; border-radius: var(--r-ctl);
    cursor: pointer; font-weight: 500; font-size: .92rem; color: var(--text);
    transition: border-color .12s ease, background-color .12s ease;
}
.opt:hover { border-color: var(--slate-400); }
.opt input { margin: 3px 0 0; accent-color: var(--green-700); width: 16px; height: 16px; flex: none; }
.opt .key { font-family: var(--mono); font-weight: 700; color: var(--slate-500); }
.opt > span { min-width: 0; flex: 1; }
.opt span.txt { white-space: pre-wrap; word-break: break-word; }
.opt:has(input:checked) { border-color: var(--green); background: var(--green-50); box-shadow: inset 0 0 0 1px var(--green); }
.opt:has(input:checked) .key { color: var(--green-800); }

.submit-bar {
    margin-top: 18px; display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap;
    background: var(--white); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 16px 20px;
}

#floating-timer {
    position: fixed; right: 18px; bottom: 18px; z-index: 60;
    display: flex; align-items: center; gap: 10px;
    background: var(--slate-800); color: var(--slate-200);
    padding: 10px 16px; border-radius: 999px;
    font-weight: 600; font-size: .85rem;
    box-shadow: 0 10px 24px -8px rgba(15, 23, 42, .5);
}
#floating-timer .icon { color: var(--green); }
#timer-display { font-family: var(--mono); font-size: 1.05rem; font-weight: 700; color: var(--white); font-variant-numeric: tabular-nums; }

/* Modal used by test.js */
.modal-overlay {
    position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 18px;
    background: rgba(15, 23, 42, .55); backdrop-filter: blur(2px);
}
.modal-box {
    width: min(440px, 100%); background: var(--white); border-radius: var(--r-panel);
    padding: 24px; box-shadow: 0 30px 60px -20px rgba(15, 23, 42, .5); border-top: 4px solid var(--green);
}
#modal-message { font-weight: 600; font-size: 1rem; color: var(--text); white-space: pre-line; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* ------------------------------------------------------------------
   RESULTS / BREAKDOWN
   ------------------------------------------------------------------ */

.result-hero { text-align: center; padding: 34px 22px; }
.result-check {
    width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 14px;
    background: var(--green-100); color: var(--green-800);
}
.result-check .icon { width: 28px; height: 28px; stroke-width: 2.4; }
.result-score { font-size: 3.2rem; font-weight: 800; letter-spacing: -0.04em; line-height: 1; margin: 22px 0 6px; font-variant-numeric: tabular-nums; }
.result-score small { font-size: 1.4rem; color: var(--text-3); font-weight: 700; letter-spacing: 0; }
.meter { height: 8px; border-radius: 999px; background: var(--slate-100); overflow: hidden; max-width: 320px; margin: 14px auto 0; }
.meter > i { display: block; height: 100%; background: var(--green); border-radius: 999px; }

.bd-card { background: var(--white); border: 1px solid var(--line); border-left: 4px solid var(--slate-400); border-radius: var(--r-panel); padding: 18px 20px; margin-top: 12px; }
.bd-card.correct { border-left-color: var(--green); }
.bd-card.wrong { border-left-color: var(--red); }
.bd-card .q-head { margin-bottom: 12px; }
.bd-opts { display: grid; gap: 8px; }
.bd-opt {
    display: flex; justify-content: space-between; align-items: center; gap: 10px;
    padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--r-ctl); font-size: .9rem;
}
.bd-opt .txt { white-space: pre-wrap; word-break: break-word; }
.bd-opt .key { font-family: var(--mono); font-weight: 700; color: var(--slate-500); margin-right: 6px; }
.bd-opt.correct-selected { border-color: var(--green); background: var(--green-50); }
.bd-opt.wrong-selected { border-color: #FCA5A5; background: var(--red-50); }
.bd-opt.correct-answer { border-color: var(--green); border-style: dashed; }
.bd-tags { display: flex; gap: 6px; flex: none; }
.bd-status { margin-top: 10px; font-weight: 700; font-size: .85rem; display: flex; align-items: center; gap: 6px; }
.bd-status.correct { color: var(--green-700); }
.bd-status.wrong { color: var(--red-700); }
.bd-status.not_attempted { color: var(--slate-500); }

/* ------------------------------------------------------------------
   STATUS PAGES (not active / submitted / errors)
   ------------------------------------------------------------------ */

.status-page { max-width: 560px; margin: 24px auto 0; text-align: center; padding: 36px 26px; }
.status-icon {
    width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; margin: 0 auto 16px;
    background: var(--slate-100); color: var(--slate-600);
}
.status-icon .icon { width: 26px; height: 26px; }
.status-code { font-family: var(--mono); font-size: 3rem; font-weight: 700; color: var(--slate-300, #CBD5E1); line-height: 1; margin-bottom: 10px; }
.status-page p { color: var(--text-2); margin-top: 8px; }
.status-page .btn-row { justify-content: center; margin-top: 22px; }

/* ------------------------------------------------------------------
   ADMIN
   ------------------------------------------------------------------ */

.filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 12px; align-items: end; }
.filters .field { margin: 0; }
@media (max-width: 900px) { .filters { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .filters { grid-template-columns: 1fr; } }

.tool-links { display: grid; gap: 10px; }
.tool-link {
    display: flex; align-items: center; gap: 12px; padding: 13px 14px;
    border: 1px solid var(--line); border-radius: var(--r-ctl); color: var(--text); font-weight: 700;
}
.tool-link:hover { border-color: var(--green); background: var(--green-50); text-decoration: none; }
.tool-link .icon { color: var(--green-700); }
.tool-link small { display: block; font-weight: 500; color: var(--text-3); }

.event-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* ------------------------------------------------------------------
   FOOTER
   ------------------------------------------------------------------ */

.footer { background: var(--slate-700); color: var(--slate-400); border-top: 3px solid var(--green); font-size: .85rem; }
.footer-inner {
    max-width: 1160px; margin: 0 auto; padding: 18px 20px;
    display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
}
.footer strong { color: var(--white); font-weight: 700; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { color: var(--slate-200); display: inline-flex; align-items: center; gap: 6px; }
.footer-links a:hover { color: var(--white); }
@media (max-width: 640px) { .footer-inner { flex-direction: column; text-align: center; } .footer-links { justify-content: center; } }

/* ------------------------------------------------------------------
   CAMERA PROCTORING
   ------------------------------------------------------------------ */

.camera-gate { border-color: #BFDBFE; }
.camera-terms { grid-template-columns: 1fr; margin: 14px 0 16px; }
.consent {
    display: flex; gap: 10px; align-items: flex-start; font-weight: 600; font-size: .9rem;
    padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--slate-50);
    margin-bottom: 14px; cursor: pointer;
}
.consent input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--green-700); flex: none; }
.consent .faint { font-weight: 500; }
.toggle-row { margin: 4px 0 18px; }
.camera-error { color: var(--red-700); font-weight: 600; font-size: .88rem; margin-top: 10px; min-height: 1.2em; }

.camera-preview {
    position: fixed; left: 18px; bottom: 18px; z-index: 60; width: 168px;
    background: var(--slate-800); border-radius: 12px; overflow: hidden;
    box-shadow: 0 10px 24px -8px rgba(15, 23, 42, .5); border: 2px solid var(--slate-700);
}
.camera-preview video { display: block; width: 100%; height: 126px; object-fit: cover; transform: scaleX(-1); background: #0B1220; }
.cam-status { display: block; padding: 5px 8px; font-size: .74rem; font-weight: 700; }
.cam-status.ok { color: #86EFAC; }
.cam-status.warn { color: #FCA5A5; background: rgba(239, 68, 68, .15); }
@media (max-width: 640px) { .camera-preview { width: 112px; left: 10px; bottom: 74px; } .camera-preview video { height: 84px; } }

.snap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.snap { margin: 0; border: 1px solid var(--line); border-radius: var(--r-ctl); overflow: hidden; background: var(--white); }
.snap.flagged { border-color: #FCA5A5; box-shadow: inset 0 0 0 1px #FCA5A5; }
.snap img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--slate-100); }
.snap-empty { aspect-ratio: 4 / 3; display: grid; place-items: center; background: var(--slate-100); color: var(--slate-400); }
.snap figcaption { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 6px 8px; font-size: .75rem; color: var(--text-3); }

/* Form buttons that look like tool links / inline forms in tables & rows */
.tool-button { width: 100%; background: var(--white); font: inherit; font-weight: 700; text-align: left; cursor: pointer; }
.verify-item form, .td-actions form { margin: 0; }

/* ------------------------------------------------------------------
   CODING QUESTIONS
   ------------------------------------------------------------------ */

.problem { flex: 1; min-width: 0; }
.problem-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: .82rem; color: var(--text-3); margin: 4px 0 10px; }
.problem-text { white-space: pre-wrap; word-break: break-word; font-size: .95rem; line-height: 1.65; color: var(--text); }
.sample { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
@media (max-width: 640px) { .sample { grid-template-columns: 1fr; } }
.sample pre, .case-io pre, .code-block, .run-error {
    margin: 4px 0 0; padding: 10px 12px; border-radius: var(--r-ctl); background: var(--slate-50);
    border: 1px solid var(--line); font-family: var(--mono); font-size: .84rem; white-space: pre-wrap; word-break: break-word;
    max-height: 260px; overflow: auto;
}
.code-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin: 16px 0 10px; }
.code-toolbar select { width: auto; min-width: 200px; }
.code-card .CodeMirror {
    border: 1px solid #CBD5E1; border-radius: var(--r-ctl); font-family: var(--mono); font-size: .88rem; line-height: 1.55;
}
.code-card .CodeMirror-focused { border-color: var(--green); box-shadow: var(--ring); }
.code-card .CodeMirror-gutters { background: var(--slate-50); border-right: 1px solid var(--line); }
.code-output:empty { display: none; }
.code-output { margin-top: 12px; }
.run-summary { padding: 10px 12px; border-radius: var(--r-ctl); font-weight: 700; font-size: .9rem; margin-bottom: 10px; }
.run-summary.ok { background: var(--green-50); color: var(--green-800); border: 1px solid #BBF7D0; }
.run-summary.bad { background: #FFFBEB; color: var(--amber-700); border: 1px solid #FDE68A; }
.run-error { background: var(--red-50); border-color: #FECACA; color: var(--red-700); }
.case-list { display: grid; gap: 8px; margin-top: 10px; }
.case { border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--white); }
.case summary { display: flex; justify-content: space-between; gap: 10px; padding: 9px 12px; cursor: pointer; font-weight: 700; font-size: .86rem; list-style: none; }
.case summary::-webkit-details-marker { display: none; }
.case.ok summary { color: var(--green-800); }
.case.bad summary { color: var(--red-700); }
.case.ok { border-left: 3px solid var(--green); }
.case.bad { border-left: 3px solid var(--red); }
.case[open] { padding-bottom: 10px; }
.case[open] > *:not(summary) { margin-left: 12px; margin-right: 12px; }
.case-io { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 720px) { .case-io { grid-template-columns: 1fr; } }
.code-view { margin-top: 12px; }
.code-view summary { cursor: pointer; font-weight: 700; font-size: .86rem; color: var(--slate-600); display: inline-flex; gap: 6px; align-items: center; }
.code-view .code-block { max-height: 420px; }

/* admin coding form */
.lang-checks { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.lang-checks .consent { margin: 0; padding: 8px 12px; }
.case-row { border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 12px 14px 0; margin-bottom: 10px; background: var(--slate-50); }
.case-row-head { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.case-row-head .remove-case { margin-left: auto; }
.inline-check { display: inline-flex; gap: 6px; align-items: center; font-weight: 600; margin: 0; font-size: .85rem; }
.inline-check input { width: 16px; height: 16px; accent-color: var(--green-700); }
.case-row textarea { font-size: .84rem; }

/* ------------------------------------------------------------------
   LANDING: headline lines + animated assessment journey
   ------------------------------------------------------------------ */

.hero-title span { display: block; }
.hero-title .bracket { display: inline; }
.hero h1.hero-title { max-width: none; font-size: clamp(2rem, 3.5vw, 2.85rem); }
@media (min-width: 901px) { .hero-title > span { white-space: nowrap; } }

.editor-wrap { position: relative; }
.editor-wrap::before {
    content: ""; position: absolute; inset: 8% -6% -10% 6%; z-index: 0;
    background: radial-gradient(closest-side, rgba(34, 197, 94, .22), rgba(34, 197, 94, 0) 70%);
    filter: blur(24px); pointer-events: none;
}
.editor-wrap .editor { position: relative; z-index: 1; }

.journey-steps {
    display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 10px 14px;
    background: #172033; border-bottom: 1px solid #0B1220; font-family: var(--font);
}
.journey-steps li {
    font-size: .74rem; font-weight: 700; color: #64748B; padding: 4px 10px; border-radius: 999px;
    border: 1px solid #334155; transition: color .25s ease, background-color .25s ease, border-color .25s ease;
}
.journey-steps li.active { color: #86EFAC; border-color: #22C55E; background: rgba(34, 197, 94, .12); }
.journey-steps li.done { color: #0F172A; background: #22C55E; border-color: #22C55E; }
.journey-steps li.done::before { content: "\2713  "; }

.journey-code { min-height: calc(12 * 1.75em + 36px); }
.journey-code .p { color: #F0ABFC; }
.journey-code .k { color: #60A5FA; }
.journey-code .f { color: #4ADE80; }
.journey-code .s { color: #FDE68A; }
.journey-code .n { color: #FDBA74; }
.journey-out { min-height: calc(4 * 1.6em + 24px); line-height: 1.6; }
.journey-out .ok { color: #4ADE80; }
.journey-out .faint { color: #64748B; }
@media (max-width: 640px) { .journey-steps li { font-size: .68rem; padding: 3px 8px; } .journey-code { font-size: .78rem; } }

/* Show code exactly as typed: no font ligatures (-> != == <= would turn into arrows/symbols). */
html, .CodeMirror, code, pre, textarea, input {
    font-variant-ligatures: none;
    font-feature-settings: "liga" 0, "calt" 0;
}
.opt-inline { -webkit-box-decoration-break: clone; box-decoration-break: clone; word-break: normal; overflow-wrap: anywhere; }
.CodeMirror .CodeMirror-code pre.CodeMirror-line,
.CodeMirror .CodeMirror-code pre.CodeMirror-line-like {
    -webkit-font-variant-ligatures: none;
    font-variant-ligatures: none;
}

/* Results table: keep the action buttons reachable when the table scrolls sideways */
@media (max-width: 1100px) {
    .results-table th:last-child, .results-table td:last-child {
        position: sticky; right: 0; z-index: 1; background: var(--white, #fff);
        box-shadow: -10px 0 10px -10px rgba(15, 23, 42, .25);
    }
    .results-table thead th:last-child { background: var(--slate-50); }
}

/* ---------- Help page ---------- */
.help-video-panel .panel-head { flex-wrap: wrap; gap: 10px; }
.seg-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: var(--slate-50); }
.seg-btn { border: 0; background: transparent; padding: 6px 14px; border-radius: 999px; font: 600 .85rem inherit; font-family: inherit; color: var(--slate-600); cursor: pointer; }
.seg-btn.active { background: var(--white, #fff); color: var(--text); box-shadow: 0 1px 3px rgba(15, 23, 42, .15); }
.help-video-wrap { background: #0B1220; border-radius: var(--r-ctl); overflow: hidden; display: flex; justify-content: center; }
.help-video-wrap video { width: 100%; max-height: 72vh; display: block; background: #0B1220; }
.help-video-wrap.is-mobile video { width: auto; max-width: 100%; height: 72vh; max-height: 760px; }
@media (max-width: 760px) { .help-video-wrap.is-mobile video { width: 100%; height: auto; max-height: 80vh; } }
.chapters { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 8px; }
.chapter { border: 1px solid var(--line); background: var(--white, #fff); border-radius: 999px; padding: 5px 11px; font: 500 .82rem inherit; font-family: inherit; color: var(--text); cursor: pointer; }
.chapter:hover { border-color: var(--green); background: var(--green-50); }
.chapter .mono { color: var(--slate-500); font-size: .78rem; margin-right: 2px; }
.help-toc { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: .9rem; }
.help-toc strong { margin-right: 6px; }
.manual h2 { font-size: 1.15rem; margin: 0 0 10px; }
.manual h3 { font-size: .98rem; margin: 16px 0 6px; }
.manual ul, .manual ol { margin: 0 0 4px 20px; padding: 0; line-height: 1.7; }
.manual li { margin-bottom: 4px; }
.manual code { font-family: var(--mono); font-size: .86em; background: var(--slate-100, #F1F5F9); padding: 1px 5px; border-radius: 4px; }
.manual pre.q-code code { background: none; padding: 0; }
.manual pre.q-code { margin: 8px 0 4px; max-width: 520px; }
.manual section { scroll-margin-top: 90px; }
.faq dt { font-weight: 700; margin-top: 12px; }
.faq dd { margin: 4px 0 0; color: var(--slate-600); line-height: 1.6; }
@media print {
    .topbar, footer, .no-print, .page-head .actions, .alert { display: none !important; }
    .manual .panel { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
    body { background: #fff; }
}
