/* =====================================================================
   DFK20013 WEB DESIGN TECHNOLOGY — PORTAL STYLESHEET
   Palette inherited from the JTMK Digital Multimedia portal
   (navy · coral · teal · gold · ivory) with a code-editor accent.
   ===================================================================== */
:root {
    --navy: #0e2234;
    --navy-2: #071827;
    --navy-3: #16324b;
    --coral: #ef7c5b;
    --coral-2: #f19872;
    --teal: #2f8f83;
    --gold: #e4a33a;
    --indigo: #4f6bd8;
    --ivory: #f7f3ec;
    --paper: #ffffff;
    --text: #172033;
    --muted: #64707f;
    --line: #e6dfd4;
    --line-2: #efe9df;
    --good: #1f8a5b;
    --ok: #b7791f;
    --bad: #c2413b;
    --radius: 18px;
    --shadow: 0 14px 38px rgba(14, 34, 52, .09);
    --shadow-sm: 0 4px 14px rgba(14, 34, 52, .06);
    --font: "Plus Jakarta Sans", Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
    --container: 1240px;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { min-height: 100vh; font-family: var(--font); background: var(--ivory); color: var(--text); line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
code, pre, kbd { font-family: var(--mono); }
:focus-visible { outline: 3px solid rgba(239, 124, 91, .55); outline-offset: 2px; border-radius: 6px; }
.container { width: min(var(--container), calc(100% - 32px)); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.mt { margin-top: 18px; } .mt-lg { margin-top: 30px; } .mb { margin-bottom: 18px; }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border: 1px solid transparent; border-radius: 12px; font-weight: 700; cursor: pointer; transition: transform .15s, box-shadow .15s, background .15s; white-space: nowrap; }
.btn:hover { transform: translateY(-1px); }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: .9rem; border-radius: 10px; }
.btn-xs { min-height: 30px; padding: 0 10px; font-size: .8rem; border-radius: 8px; }
.btn-primary { background: linear-gradient(135deg, var(--coral), var(--coral-2)); color: #fff; box-shadow: 0 8px 20px rgba(239, 124, 91, .28); }
.btn-dark { background: var(--navy); color: #fff; }
.btn-teal { background: var(--teal); color: #fff; }
.btn-ghost { background: rgba(255, 255, 255, .08); color: #fff; border-color: rgba(255, 255, 255, .22); }
.btn-outline { background: var(--paper); border-color: var(--line); color: var(--text); }
.btn-outline:hover { border-color: var(--coral); color: var(--coral); }
.btn-danger { background: #fff; color: var(--bad); border-color: #f0c9c6; }
.btn-block { width: 100%; }

/* ---------------------------------------------------------------- flash */
.flash-wrap { position: fixed; bottom: 18px; right: 18px; z-index: 300; display: grid; gap: 10px; width: min(420px, calc(100% - 32px)); }
.flash { position: relative; padding: 14px 44px 14px 16px; border-radius: 14px; background: #fff; border-left: 5px solid var(--teal); box-shadow: var(--shadow); font-weight: 600; animation: slideIn .3s ease; }
.flash-error { border-left-color: var(--bad); }
.flash-info { border-left-color: var(--indigo); }
.flash-x { position: absolute; top: 8px; right: 10px; border: 0; background: none; font-size: 1.3rem; cursor: pointer; color: var(--muted); }
@keyframes slideIn { from { opacity: 0; transform: translateY(-8px); } }

/* ---------------------------------------------------------------- brand */
.brand { display: inline-flex; align-items: center; gap: 12px; color: #fff; }
.brand-mark { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; background: linear-gradient(135deg, var(--coral), var(--gold)); font-family: var(--mono); font-weight: 700; font-size: .95rem; color: #fff; flex: none; }
.brand-text small { display: block; color: #ffc9b6; font-size: .7rem; letter-spacing: .18em; font-weight: 700; }
.brand-text strong { display: block; font-size: .92rem; letter-spacing: .02em; }

/* =============================================================== PUBLIC */
.topbar { position: sticky; top: 0; z-index: 100; background: rgba(7, 24, 39, .96); backdrop-filter: blur(10px); border-bottom: 1px solid rgba(255, 255, 255, .07); }
.nav { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.menu { display: flex; align-items: center; gap: 4px; list-style: none; }
.menu a:not(.btn) { display: block; padding: 9px 14px; border-radius: 999px; color: #dfe7ee; font-weight: 600; font-size: .95rem; }
.menu a:not(.btn):hover, .menu a.active { background: rgba(255, 255, 255, .09); color: #fff; }
.menu .btn { margin-left: 6px; }
.menu-toggle { display: none; border: 0; background: none; color: #fff; font-size: 1.6rem; cursor: pointer; }

.hero { position: relative; color: #fff; overflow: hidden; background: radial-gradient(circle at 85% 15%, rgba(47, 143, 131, .28), transparent 34%), radial-gradient(circle at 10% 90%, rgba(239, 124, 91, .18), transparent 30%), linear-gradient(140deg, var(--navy-2), var(--navy-3)); }
.hero::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px); background-size: 44px 44px; mask-image: linear-gradient(to bottom, #000 40%, transparent); pointer-events: none; }
.hero-grid { position: relative; display: grid; grid-template-columns: 1fr 1.05fr; gap: 48px; align-items: center; padding: 72px 0 84px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 7px 13px; border-radius: 999px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .1); color: #ffd3c3; font-size: .74rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.eyebrow.dark { background: #fdeee8; color: #b84d2f; border-color: #f8d9cc; }
.hero h1 { margin-top: 20px; font-size: clamp(2.6rem, 6.2vw, 5rem); line-height: .98; letter-spacing: -.045em; font-weight: 800; }
.hero h1 .code { color: var(--coral); font-family: var(--mono); font-weight: 600; letter-spacing: -.06em; }
.hero h1 span.l2 { display: block; background: linear-gradient(90deg, #fff, #9fd8cf); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { max-width: 560px; margin-top: 22px; color: #cfdae4; font-size: 1.08rem; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 26px; margin-top: 38px; }
.hero-meta div b { display: block; font-size: 1.6rem; font-weight: 800; }
.hero-meta div span { color: #a9b8c6; font-size: .84rem; }

/* browser mock-up */
.browser { border-radius: 18px; overflow: hidden; background: #0b1622; border: 1px solid rgba(255, 255, 255, .1); box-shadow: 0 30px 70px rgba(0, 0, 0, .35); }
.browser-bar { display: flex; align-items: center; gap: 7px; padding: 12px 14px; background: #13263a; }
.browser-bar i { width: 11px; height: 11px; border-radius: 50%; background: #ef6b5b; }
.browser-bar i:nth-child(2) { background: #e9b33f; } .browser-bar i:nth-child(3) { background: #3fbf7f; }
.browser-bar span { flex: 1; margin-left: 10px; padding: 5px 12px; border-radius: 8px; background: rgba(255, 255, 255, .06); color: #8ea3b6; font-family: var(--mono); font-size: .76rem; }
.browser-body { display: grid; grid-template-columns: 1.05fr .95fr; min-height: 330px; }
.code-pane { padding: 18px 20px; font-family: var(--mono); font-size: .78rem; line-height: 1.75; color: #c6d3df; border-right: 1px solid rgba(255, 255, 255, .06); white-space: pre; overflow: hidden; }
.code-pane .t { color: #f39a7c; } .code-pane .a { color: #9fd8cf; } .code-pane .s { color: #e9c46a; } .code-pane .c { color: #5f7a91; }
.preview-pane { padding: 16px; background: #f7f3ec; color: var(--text); display: grid; gap: 10px; align-content: start; }
.pv-nav { height: 26px; border-radius: 8px; background: var(--navy); display: flex; align-items: center; padding: 0 10px; gap: 6px; }
.pv-nav i { width: 26px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .5); }
.pv-nav i:first-child { width: 40px; background: var(--coral); margin-right: auto; }
.pv-hero { height: 70px; border-radius: 10px; background: linear-gradient(135deg, var(--coral), var(--gold)); }
.pv-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pv-row span { height: 64px; border-radius: 10px; background: #fff; border: 1px solid var(--line); position: relative; }
.pv-row span::after { content: ""; position: absolute; left: 8px; right: 14px; bottom: 10px; height: 5px; border-radius: 3px; background: #e6dfd4; }
.pv-label { font-family: var(--mono); font-size: .66rem; color: var(--muted); }

.section { padding: 72px 0; }
.section-alt { background: #fff; border-block: 1px solid var(--line-2); }
.section-title { max-width: 720px; margin: 0 auto 38px; text-align: center; }
.section-title.left { margin-left: 0; text-align: left; }
.section-title small { color: var(--coral); font-weight: 800; letter-spacing: .16em; font-size: .76rem; }
.section-title h2 { margin-top: 8px; font-size: clamp(1.8rem, 3.4vw, 2.6rem); line-height: 1.15; letter-spacing: -.03em; }
.section-title p { margin-top: 12px; color: var(--muted); }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }

.feature { padding: 26px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.feature .f-ico { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 12px; background: #fdeee8; color: var(--coral); font-family: var(--mono); font-weight: 700; margin-bottom: 14px; }
.feature b { display: block; font-size: 1.06rem; }
.feature p { margin-top: 6px; color: var(--muted); font-size: .95rem; }

.chapter-card { --accent: var(--coral); --soft: #fdeee8; position: relative; display: flex; flex-direction: column; padding: 26px; background: #fff; border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-sm); overflow: hidden; transition: transform .2s, box-shadow .2s; }
.chapter-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 5px; background: var(--accent); }
.chapter-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.chapter-card .ch-top { display: flex; justify-content: space-between; align-items: center; }
.chapter-card .ch-no { font-size: 2.6rem; font-weight: 800; letter-spacing: -.05em; color: var(--accent); line-height: 1; }
.chapter-card .ch-ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--soft); color: var(--accent); font-family: var(--mono); font-weight: 700; }
.chapter-card h3 { margin-top: 18px; font-size: 1.12rem; line-height: 1.3; }
.chapter-card p { margin-top: 8px; color: var(--muted); font-size: .92rem; flex: 1; }
.chapter-card ul { margin-top: 14px; list-style: none; display: grid; gap: 6px; }
.chapter-card li { font-size: .84rem; color: #3c4858; display: flex; gap: 8px; }
.chapter-card li code { color: var(--accent); font-weight: 600; font-size: .78rem; padding-top: 1px; }
.chapter-card .ch-link { margin-top: 18px; font-weight: 800; color: var(--accent); }

.assess-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.panel { padding: 30px; background: #fff; border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-sm); }
.panel h3 { font-size: 1.3rem; }
.panel-dark { background: linear-gradient(140deg, var(--navy-2), var(--navy-3)); color: #fff; border: 0; }
.panel-dark p { color: #c8d4df; }
.weight-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; align-items: center; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.weight-row:last-child { border-bottom: 0; }
.weight-row .wbar { grid-column: 1 / -1; height: 8px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.weight-row .wbar span { display: block; height: 100%; border-radius: inherit; background: var(--coral); }
.weight-row small { color: var(--muted); }

.cta { display: flex; align-items: center; justify-content: space-between; gap: 22px; flex-wrap: wrap; padding: 36px; border-radius: 26px; background: linear-gradient(120deg, var(--coral), var(--gold)); color: #fff; }
.cta h2 { font-size: 1.7rem; letter-spacing: -.02em; }
.cta p { opacity: .92; }

.page-hero { padding: 64px 0 56px; color: #fff; background: radial-gradient(circle at 80% 0%, rgba(47, 143, 131, .3), transparent 40%), linear-gradient(140deg, var(--navy-2), var(--navy-3)); }
.page-hero h1 { margin-top: 14px; font-size: clamp(2.2rem, 5vw, 3.4rem); letter-spacing: -.04em; line-height: 1.05; }
.page-hero p { margin-top: 12px; max-width: 640px; color: #c8d4df; font-size: 1.05rem; }

.person { padding: 24px; background: #fff; border: 1px solid var(--line); border-radius: 20px; text-align: center; box-shadow: var(--shadow-sm); }
.person .avatar-lg { width: 76px; height: 76px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 1.4rem; color: #fff; background: linear-gradient(135deg, var(--teal), var(--indigo)); }
.person b { display: block; }
.person span { color: var(--muted); font-size: .9rem; }
.clo { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; padding: 18px 20px; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.clo b.tag { font-family: var(--mono); color: var(--coral); }
.clo span.tax { font-size: .8rem; padding: 4px 10px; border-radius: 99px; background: var(--ivory); color: var(--muted); font-weight: 700; }
.ref { padding: 18px 20px; border-left: 4px solid var(--teal); background: #fff; border-radius: 0 14px 14px 0; }
.ref b { display: block; }
.ref span { color: var(--muted); font-size: .92rem; }

/* login */
.login-wrap { min-height: calc(100vh - 76px); display: grid; grid-template-columns: 1fr 1fr; }
.login-side { position: relative; padding: 60px; color: #fff; display: flex; flex-direction: column; justify-content: center; gap: 22px; background: radial-gradient(circle at 20% 80%, rgba(239, 124, 91, .25), transparent 40%), linear-gradient(140deg, var(--navy-2), var(--navy-3)); overflow: hidden; }
.login-side h1 { font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -.04em; line-height: 1.05; }
.login-side p { color: #c8d4df; max-width: 440px; }
.role-list { display: grid; gap: 12px; max-width: 440px; }
.role-list div { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08); }
.role-list i { font-style: normal; width: 36px; height: 36px; flex: none; border-radius: 10px; display: grid; place-items: center; background: rgba(239, 124, 91, .2); color: #ffb79f; font-weight: 800; }
.role-list b { display: block; } .role-list small { color: #a9b8c6; }
.login-main { display: grid; place-items: center; padding: 40px 18px; }
.login-card { width: min(430px, 100%); }
.login-card h2 { font-size: 2rem; letter-spacing: -.03em; }
.login-card .note { margin-top: 18px; padding: 14px 16px; border-radius: 12px; background: #fff; border: 1px dashed var(--line); font-size: .86rem; color: var(--muted); }
.login-card .note code { background: var(--ivory); padding: 1px 6px; border-radius: 5px; color: var(--text); font-size: .8rem; }

.site-footer { background: var(--navy-2); color: #b9c6d2; padding-top: 50px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 30px; padding-bottom: 34px; }
.footer-grid p { margin-top: 14px; font-size: .9rem; }
.footer-grid b { display: block; color: #fff; margin-bottom: 10px; }
.footer-grid a, .footer-grid span { display: block; font-size: .9rem; padding: 3px 0; }
.footer-grid a:hover { color: var(--coral); }
.footer-bottom { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 18px 0 26px; border-top: 1px solid rgba(255, 255, 255, .08); font-size: .82rem; }

/* ================================================================ FORMS */
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label, .label { font-weight: 700; font-size: .9rem; }
.input, .select, .textarea { width: 100%; padding: 12px 14px; border: 1px solid #d8d0c3; border-radius: 12px; background: #fff; transition: border .15s, box-shadow .15s; }
.input:focus, .select:focus, .textarea:focus { outline: 0; border-color: var(--coral); box-shadow: 0 0 0 4px rgba(239, 124, 91, .15); }
.textarea { min-height: 120px; resize: vertical; }
.textarea.code { font-family: var(--mono); font-size: .84rem; min-height: 260px; background: #0e1b28; color: #dbe6f0; border-color: #0e1b28; line-height: 1.6; tab-size: 2; }
.hint { font-size: .8rem; color: var(--muted); }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 18px; }
.filters .select, .filters .input { width: auto; min-width: 150px; padding: 9px 12px; }
.rating-input { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; }
.rating-input input { display: none; }
.rating-input label { font-size: 1.9rem; color: #d9d2c6; cursor: pointer; line-height: 1; }
.rating-input input:checked ~ label, .rating-input label:hover, .rating-input label:hover ~ label { color: var(--gold); }

/* ============================================================ DASHBOARD */
/* ---- Hoverable sidebar (collapsed rail that expands on hover; lock keeps it open) ---- */
body.dash { --sb-open: 268px; --sb-rail: 78px; --sb-w: var(--sb-open); }
body.dash.sb-unlocked { --sb-w: var(--sb-rail); }
.sidebar { position: fixed; z-index: 120; left: 0; top: 0; height: 100vh; width: var(--sb-w); display: flex; flex-direction: column; background: var(--navy-2); color: #c9d5e0; overflow: hidden; transition: width .3s ease, box-shadow .3s ease; }
body.sb-unlocked .sidebar:hover, body.sb-unlocked .sidebar:focus-within { width: var(--sb-open); box-shadow: 18px 0 40px rgba(7, 24, 39, .28); }
.side-brand { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 84px; padding: 18px 16px 18px 16px; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.side-brand .brand { flex: 1; min-width: 0; }
.side-brand .brand-text { min-width: 150px; transition: opacity .2s; }
.side-brand .brand-text strong { font-size: .84rem; line-height: 1.25; }
.sb-lock { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 10px; background: rgba(255, 255, 255, .07); color: #dbe5ee; font-size: 1.2rem; cursor: pointer; transition: background .15s, opacity .2s; }
.sb-lock:hover { background: var(--coral); color: #fff; }
.side-nav { flex: 1; padding: 12px 12px 16px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; }
.side-nav::-webkit-scrollbar { display: none; }
.side-head { position: relative; margin: 14px 10px 6px; height: 16px; font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: #6f8599; font-weight: 800; white-space: nowrap; }
.side-head::after { content: ""; position: absolute; left: 6px; top: 7px; width: 20px; height: 2px; border-radius: 2px; background: #3a5068; opacity: 0; transition: opacity .2s; }
.side-nav a, .side-logout { position: relative; display: flex; align-items: center; gap: 14px; height: 46px; padding: 0 12px; border-radius: 12px; font-weight: 600; font-size: .92rem; white-space: nowrap; transition: background .15s, color .15s; }
.side-nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side-nav a.active { background: linear-gradient(135deg, rgba(239, 124, 91, .22), rgba(239, 124, 91, .08)); color: #fff; box-shadow: inset 3px 0 0 var(--coral); }
.side-nav .ico, .side-logout .ico { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 9px; background: rgba(255, 255, 255, .06); font-size: 1.2rem; }
.side-nav a.active .ico { background: var(--coral); color: #fff; }
.side-nav .lbl, .side-logout .lbl { transition: opacity .2s; }
.side-foot { padding: 12px; border-top: 1px solid rgba(255, 255, 255, .07); }
.side-logout { color: #ffb4a8; }
.side-logout .ico { background: rgba(194, 65, 59, .18); }
.side-logout:hover { background: rgba(194, 65, 59, .22); color: #fff; }
/* collapsed rail: hide words, keep icons */
body.sb-unlocked .sidebar:not(:hover):not(:focus-within) .brand-text,
body.sb-unlocked .sidebar:not(:hover):not(:focus-within) .lbl,
body.sb-unlocked .sidebar:not(:hover):not(:focus-within) .sb-lock { opacity: 0; pointer-events: none; }
body.sb-unlocked .sidebar:not(:hover):not(:focus-within) .side-head { color: transparent; }
body.sb-unlocked .sidebar:not(:hover):not(:focus-within) .side-head::after { opacity: 1; }
.role-admin .side-nav a.active { box-shadow: inset 3px 0 0 var(--gold); background: linear-gradient(135deg, rgba(228, 163, 58, .22), rgba(228, 163, 58, .06)); }
.role-admin .side-nav a.active .ico { background: var(--gold); }
.role-lecturer .side-nav a.active { box-shadow: inset 3px 0 0 #5cc4b6; background: linear-gradient(135deg, rgba(47, 143, 131, .3), rgba(47, 143, 131, .08)); }
.role-lecturer .side-nav a.active .ico { background: var(--teal); }

.dash-main { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; margin-left: var(--sb-w); transition: margin-left .3s ease; }
.dash-top { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 16px; padding: 16px 30px; background: rgba(247, 243, 236, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.dash-title { flex: 1; min-width: 0; }
.dash-title h1 { font-size: 1.4rem; letter-spacing: -.02em; line-height: 1.2; }
.dash-title p { color: var(--muted); font-size: .9rem; margin-top: 2px; }
.who { display: flex; align-items: center; gap: 10px; }
.avatar { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--navy); color: #fff; font-weight: 800; font-size: .85rem; }
.who-text b { display: block; font-size: .9rem; line-height: 1.2; }
.who-text small { color: var(--muted); font-size: .78rem; }
.side-toggle { display: none; border: 0; background: var(--navy); color: #fff; width: 40px; height: 40px; border-radius: 10px; cursor: pointer; font-size: 1.1rem; }
.dash-body { flex: 1; padding: 28px 30px 40px; }
.dash-foot { padding: 18px 30px; color: var(--muted); font-size: .8rem; border-top: 1px solid var(--line); }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line-2); }
.card-head h2, .card-head h3 { font-size: 1.04rem; letter-spacing: -.01em; }
.card-head a { font-size: .86rem; font-weight: 700; color: var(--coral); }
.card-body { padding: 20px 22px; }
.stack { display: grid; gap: 22px; }
.cols { display: grid; grid-template-columns: 1.6fr 1fr; gap: 22px; align-items: start; }
.cols-even { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat { position: relative; padding: 18px 20px; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-sm); overflow: hidden; }
.stat::after { content: ""; position: absolute; right: -18px; top: -18px; width: 70px; height: 70px; border-radius: 50%; background: var(--ivory); }
.stat small { position: relative; z-index: 1; display: block; color: var(--muted); font-weight: 700; font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; }
.stat b { position: relative; z-index: 1; display: block; margin-top: 6px; font-size: 1.9rem; letter-spacing: -.03em; line-height: 1.1; }
.stat span { position: relative; z-index: 1; display: block; margin-top: 4px; color: var(--muted); font-size: .82rem; }
.stat.coral::after { background: #fdeee8; } .stat.teal::after { background: #e3f3f0; } .stat.gold::after { background: #fcf2de; } .stat.indigo::after { background: #e9edfb; }
.stat.coral b { color: var(--coral); } .stat.teal b { color: var(--teal); } .stat.gold b { color: #b77b16; } .stat.indigo b { color: var(--indigo); }

.welcome { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; padding: 26px 28px; margin-bottom: 22px; border-radius: 22px; color: #fff; background: radial-gradient(circle at 90% 10%, rgba(47, 143, 131, .4), transparent 40%), linear-gradient(135deg, var(--navy-2), var(--navy-3)); }
.welcome h2 { font-size: 1.5rem; letter-spacing: -.02em; }
.welcome p { color: #c8d4df; margin-top: 4px; }
.welcome .ring { --p: 0; width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--coral) calc(var(--p) * 1%), rgba(255, 255, 255, .12) 0); }
.welcome .ring span { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; background: var(--navy-3); font-weight: 800; font-size: 1.2rem; }

.bar-row { --bar: var(--coral); display: grid; grid-template-columns: minmax(80px, 140px) 1fr 52px; gap: 12px; align-items: center; padding: 7px 0; font-size: .88rem; }
.bar-label { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 10px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: inherit; background: var(--bar); }
.bar-row b { text-align: right; font-variant-numeric: tabular-nums; }

.progress { height: 8px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--teal); border-radius: inherit; }

.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; padding: 12px 16px; font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: #faf7f2; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fcfaf6; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table td.c, .table th.c { text-align: center; }
.person-cell { display: flex; align-items: center; gap: 10px; }
.person-cell .avatar { width: 34px; height: 34px; border-radius: 10px; font-size: .74rem; background: var(--teal); }
.person-cell b { display: block; font-size: .9rem; line-height: 1.25; }
.person-cell small { color: var(--muted); font-size: .78rem; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 99px; font-size: .74rem; font-weight: 800; white-space: nowrap; background: var(--ivory); color: var(--muted); }
.badge.good { background: #e3f4ea; color: var(--good); } .badge.ok { background: #fbf0d9; color: var(--ok); } .badge.bad { background: #fbe5e3; color: var(--bad); }
.badge.info { background: #e9edfb; color: var(--indigo); } .badge.coral { background: #fdeee8; color: #c4532f; } .badge.teal { background: #e3f3f0; color: var(--teal); }
.badge.muted { background: #f1ede6; color: #8a8378; }
.stars { color: var(--gold); letter-spacing: 1px; white-space: nowrap; } .stars i { color: #ddd5c8; font-style: normal; }

.empty { padding: 34px; text-align: center; color: var(--muted); }
.pager { display: flex; flex-wrap: wrap; gap: 6px; padding: 16px 22px; }
.pager a { min-width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; border: 1px solid var(--line); background: #fff; font-weight: 700; font-size: .85rem; }
.pager a.on { background: var(--navy); color: #fff; border-color: var(--navy); }

.list { display: grid; }
.list-item { display: flex; gap: 14px; align-items: flex-start; padding: 14px 22px; border-bottom: 1px solid var(--line-2); }
.list-item:last-child { border-bottom: 0; }
.list-item .li-main { flex: 1; min-width: 0; }
.list-item .li-main b { display: block; font-size: .92rem; }
.list-item .li-main p { color: var(--muted); font-size: .86rem; margin-top: 2px; }
.list-item time { color: var(--muted); font-size: .78rem; white-space: nowrap; }

/* chapter pages */
.ch-banner { --accent: var(--coral); --soft: #fdeee8; display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: center; padding: 26px; margin-bottom: 22px; background: #fff; border: 1px solid var(--line); border-radius: 22px; border-top: 5px solid var(--accent); }
.ch-banner .big-no { width: 86px; height: 86px; border-radius: 22px; display: grid; place-items: center; background: var(--soft); color: var(--accent); font-size: 2.4rem; font-weight: 800; }
.ch-banner h2 { font-size: 1.4rem; letter-spacing: -.02em; line-height: 1.25; }
.ch-banner p { color: var(--muted); margin-top: 6px; }
.ch-banner .meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.tabs a { padding: 9px 16px; border-radius: 99px; background: #fff; border: 1px solid var(--line); font-weight: 700; font-size: .88rem; }
.tabs a.on, .tabs a:hover { background: var(--navy); color: #fff; border-color: var(--navy); }
.subtopic { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.subtopic:last-child { border-bottom: 0; }
.subtopic code { flex: none; padding: 2px 8px; height: fit-content; border-radius: 7px; background: var(--ivory); color: var(--coral); font-weight: 700; font-size: .8rem; }
.check-list { list-style: none; display: grid; gap: 8px; }
.check-list li { position: relative; padding-left: 26px; font-size: .92rem; }
.check-list li::before { content: "✓"; position: absolute; left: 0; top: 0; width: 18px; height: 18px; border-radius: 50%; background: #e3f3f0; color: var(--teal); font-size: .7rem; font-weight: 800; display: grid; place-items: center; margin-top: 3px; }
.res-card { display: flex; gap: 16px; align-items: center; padding: 18px 20px; background: #fff; border: 1px solid var(--line); border-radius: 16px; transition: border .15s, transform .15s; }
.res-card:hover { border-color: var(--coral); transform: translateY(-2px); }
.res-card .r-ico { width: 48px; height: 48px; flex: none; border-radius: 14px; display: grid; place-items: center; background: var(--ivory); font-family: var(--mono); font-weight: 700; color: var(--coral); }
.res-card .r-main { flex: 1; min-width: 0; }
.res-card .r-main b { display: block; }
.res-card .r-main span { color: var(--muted); font-size: .86rem; }

/* slide deck */
.deck { position: relative; background: var(--navy-2); border-radius: 22px; overflow: hidden; box-shadow: var(--shadow); }
.deck:fullscreen { border-radius: 0; display: flex; flex-direction: column; justify-content: center; }
.deck-stage { position: relative; width: 100%; }
.deck:fullscreen .deck-stage { height: calc(100vh - 64px); overflow: auto; }
.slide { position: relative; display: none; min-height: 520px; padding: clamp(22px, 3.6vw, 48px); color: #fff; background: radial-gradient(circle at 92% 8%, rgba(47, 143, 131, .25), transparent 35%), linear-gradient(140deg, var(--navy-2), var(--navy-3)); }
.deck:fullscreen .slide { min-height: 100%; }
.slide.on { display: flex; flex-direction: column; animation: fadeUp .35s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } }
.slide .s-sub { font-family: var(--mono); color: var(--coral); font-weight: 600; font-size: clamp(.75rem, 1.2vw, .9rem); }
.slide h2 { margin-top: 6px; font-size: clamp(1.3rem, 3vw, 2.3rem); letter-spacing: -.03em; line-height: 1.15; }
.slide-grid { flex: 1; display: grid; grid-template-columns: 1fr; gap: clamp(16px, 2.4vw, 30px); margin-top: clamp(14px, 2.4vw, 28px); align-items: start; }
.slide-grid.has-code { grid-template-columns: 1fr 1fr; }
.slide ul { list-style: none; display: grid; gap: clamp(8px, 1.3vw, 14px); }
.slide li { position: relative; padding-left: 26px; font-size: clamp(.9rem, 1.55vw, 1.12rem); color: #dbe5ee; }
.slide li::before { content: ""; position: absolute; left: 4px; top: .6em; width: 9px; height: 9px; border-radius: 3px; background: var(--coral); }
.slide pre { margin: 0; padding: clamp(14px, 1.8vw, 20px); border-radius: 14px; background: #06121d; border: 1px solid rgba(255, 255, 255, .08); font-size: clamp(.7rem, 1.1vw, .86rem); line-height: 1.65; color: #cfe0ee; overflow: auto; white-space: pre; }
.slide .s-tip { margin-top: auto; padding: 12px 16px; border-radius: 12px; background: rgba(228, 163, 58, .15); border: 1px solid rgba(228, 163, 58, .3); color: #f6dba8; font-size: clamp(.8rem, 1.2vw, .95rem); }
.slide.cover { justify-content: center; background: radial-gradient(circle at 80% 30%, rgba(239, 124, 91, .35), transparent 40%), linear-gradient(140deg, var(--navy-2), var(--navy-3)); }
.slide.cover h2 { font-size: clamp(1.8rem, 4.6vw, 3.6rem); max-width: 900px; }
.slide.cover ul { margin-top: 26px; }
.deck-bar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: #06121d; color: #9fb2c4; }
.deck-bar button { min-width: 40px; height: 36px; padding: 0 12px; border: 1px solid rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .05); color: #fff; border-radius: 9px; cursor: pointer; font-weight: 700; }
.deck-bar button:hover { background: rgba(255, 255, 255, .12); }
.deck-progress { flex: 1; height: 5px; border-radius: 99px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.deck-progress span { display: block; height: 100%; width: 0; background: var(--coral); transition: width .3s; }
.deck-count { font-family: var(--mono); font-size: .84rem; min-width: 56px; text-align: center; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 16px; }
.thumbs button { text-align: left; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: .8rem; font-weight: 600; line-height: 1.3; min-height: 64px; }
.thumbs button small { display: block; font-family: var(--mono); color: var(--coral); font-size: .7rem; }
.thumbs button.on { border-color: var(--coral); box-shadow: 0 0 0 3px rgba(239, 124, 91, .15); }

/* lab & playground */
.steps { counter-reset: s; list-style: none; display: grid; gap: 10px; }
.steps li { counter-increment: s; position: relative; padding: 12px 14px 12px 52px; background: var(--ivory); border-radius: 12px; font-size: .92rem; }
.steps li::before { content: counter(s); position: absolute; left: 12px; top: 10px; width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--navy); color: #fff; font-weight: 800; font-size: .8rem; }
.playground { display: grid; grid-template-columns: 1fr 1fr; border-radius: 16px; overflow: hidden; border: 1px solid #0e1b28; background: #0e1b28; }
.playground .pg-head { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: #13263a; color: #9fb2c4; font-family: var(--mono); font-size: .8rem; }
.playground .pg-head span { flex: 1; }
.playground textarea { border: 0; border-radius: 0; min-height: 420px; resize: vertical; }
.playground iframe { width: 100%; height: 100%; min-height: 420px; border: 0; background: #fff; }
.answer-box { padding: 14px 16px; border-radius: 12px; background: var(--ivory); white-space: pre-wrap; font-size: .92rem; }
pre.code-view { padding: 16px; border-radius: 12px; background: #0e1b28; color: #dbe6f0; font-size: .8rem; overflow: auto; max-height: 420px; line-height: 1.6; }
.review-box { padding: 16px 18px; border-radius: 14px; background: #e3f3f0; border: 1px solid #c4e5df; }
.review-box b { color: var(--teal); }

/* quiz */
.q-card { padding: 20px 22px; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.q-card + .q-card { margin-top: 14px; }
.q-card .q-no { font-family: var(--mono); color: var(--coral); font-weight: 700; font-size: .8rem; }
.q-card h3 { margin: 4px 0 14px; font-size: 1.02rem; line-height: 1.45; }
.opt { display: flex; gap: 12px; align-items: flex-start; padding: 11px 14px; margin-top: 8px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; transition: border .15s, background .15s; font-size: .93rem; }
.opt:hover { border-color: var(--coral); }
.opt input { margin-top: 4px; accent-color: var(--coral); }
.opt.correct { border-color: #9bd3b5; background: #eef8f2; }
.opt.wrong { border-color: #f0b8b3; background: #fdf0ef; }
.explain { margin-top: 12px; padding: 10px 14px; border-radius: 10px; background: var(--ivory); font-size: .88rem; color: #3c4858; }
.score-hero { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; padding: 26px; border-radius: 20px; background: #fff; border: 1px solid var(--line); margin-bottom: 18px; }
.score-hero .big { font-size: 3rem; font-weight: 800; letter-spacing: -.04em; line-height: 1; }

.rubric { width: 100%; border-collapse: collapse; font-size: .88rem; }
.rubric td { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.rubric td:last-child { text-align: right; font-weight: 700; font-family: var(--mono); }

.matrix td.cell { text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.cell-good { background: #eef8f2; color: var(--good); } .cell-ok { background: #fdf6e7; color: var(--ok); } .cell-bad { background: #fdf0ef; color: var(--bad); } .cell-none { color: #c7bfb2; }

/* ============================================================ RESPONSIVE */
@media (max-width: 1100px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .cols { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
    .hero-grid { grid-template-columns: 1fr; padding: 56px 0 64px; }
    .grid-3 { grid-template-columns: 1fr 1fr; }
    .assess-wrap, .cols-even, .grid-2 { grid-template-columns: 1fr; }
    .login-wrap { grid-template-columns: 1fr; }
    .login-side { padding: 40px 24px; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .footer-grid > div:first-child { grid-column: 1 / -1; }
    body.dash, body.dash.sb-unlocked { --sb-w: 0px; }
    .sidebar, body.sb-unlocked .sidebar:hover { z-index: 200; width: 280px; transform: translateX(-100%); transition: transform .25s; }
    .sb-lock { display: none; }
    body.sb-unlocked .sidebar .brand-text, body.sb-unlocked .sidebar .lbl { opacity: 1 !important; }
    body.sb-unlocked .sidebar .side-head { color: #6f8599 !important; }
    body.sb-unlocked .sidebar .side-head::after { opacity: 0 !important; }
    body.side-open .sidebar { transform: none; box-shadow: 20px 0 40px rgba(0, 0, 0, .25); }
    body.side-open::after { content: ""; position: fixed; inset: 0; background: rgba(7, 24, 39, .45); z-index: 150; }
    .side-toggle { display: grid; place-items: center; }
    .slide-grid.has-code { grid-template-columns: 1fr; }
    .playground { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    .menu-toggle { display: block; }
    .menu { display: none; position: absolute; top: 76px; left: 0; right: 0; flex-direction: column; align-items: stretch; padding: 12px 16px 18px; background: var(--navy-2); border-bottom: 1px solid rgba(255, 255, 255, .08); }
    .menu.open { display: flex; }
    .menu .btn { margin: 6px 0 0; }
    .browser-body { grid-template-columns: 1fr; }
    .code-pane { border-right: 0; border-bottom: 1px solid rgba(255, 255, 255, .06); font-size: .72rem; }
    .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .section { padding: 52px 0; }
    .dash-top { padding: 12px 16px; }
    .dash-body { padding: 18px 16px 30px; }
    .who-text { display: none; }
    .ch-banner { grid-template-columns: 1fr; }
    .clo { grid-template-columns: 1fr; gap: 6px; }
    .bar-row { grid-template-columns: 90px 1fr 46px; }
    .stats { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .stat b { font-size: 1.5rem; }
    .welcome .ring { width: 80px; height: 80px; } .welcome .ring span { width: 62px; height: 62px; font-size: 1rem; }
}


/* =================================================== INTERACTIVE LEARNING */
/* slide v2 */
.s-head { display: flex; align-items: center; gap: 16px; }
.s-icon { width: clamp(48px, 5vw, 64px); height: clamp(48px, 5vw, 64px); flex: none; display: grid; place-items: center; border-radius: 18px; background: linear-gradient(135deg, var(--acc, var(--coral)), rgba(255, 255, 255, .12)); font-size: clamp(1.6rem, 2.6vw, 2.1rem); color: #fff; box-shadow: 0 10px 24px rgba(0, 0, 0, .25); }
.s-key { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 4px 12px; border-radius: 99px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16); font-size: .78rem; font-weight: 700; color: #ffe2d6; }
.slide.on li { animation: liIn .4s ease both; }
.slide.on li:nth-child(2) { animation-delay: .08s; } .slide.on li:nth-child(3) { animation-delay: .16s; } .slide.on li:nth-child(4) { animation-delay: .24s; } .slide.on li:nth-child(5) { animation-delay: .32s; }
@keyframes liIn { from { opacity: 0; transform: translateX(-8px); } }
.s-notes { margin-top: auto; padding-top: 18px; }
.s-notes-box { padding: 14px 18px; border-radius: 14px; background: rgba(228, 163, 58, .12); border: 1px solid rgba(228, 163, 58, .32); }
.s-notes-box b { display: flex; align-items: center; gap: 8px; color: #ffd98f; font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; }
.s-notes-box ul { margin-top: 8px; gap: 6px; }
.s-notes-box li { font-size: clamp(.82rem, 1.15vw, .95rem); color: #f3e4c6; padding-left: 22px; }
.s-notes-box li::before { background: var(--gold); border-radius: 50%; width: 7px; height: 7px; top: .62em; }
.deck.notes-off .s-notes { display: none; }
.read-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; background: rgba(47, 143, 131, .25); color: #a9e6dc; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.thumbs button { position: relative; }
.thumbs button.read::after { content: "✓"; position: absolute; top: 6px; right: 8px; width: 18px; height: 18px; border-radius: 50%; background: var(--teal); color: #fff; font-size: .66rem; display: grid; place-items: center; }

/* component cards on chapter page */
.comp-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.comp { position: relative; padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-sm); }
.comp .c-top { display: flex; justify-content: space-between; align-items: center; }
.comp .c-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 1.35rem; background: var(--ivory); color: var(--coral); }
.comp .c-w { font-size: .72rem; font-weight: 800; color: var(--muted); letter-spacing: .06em; }
.comp b.c-title { display: block; margin-top: 12px; }
.comp .c-meta { color: var(--muted); font-size: .84rem; }
.comp .progress { margin-top: 10px; }
.comp .c-mark { margin-top: 8px; font-size: .84rem; }
.ring-sm { --p: 0; --c: var(--coral); width: 64px; height: 64px; flex: none; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--line-2) 0); }
.ring-sm span { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; background: #fff; font-weight: 800; font-size: .86rem; }
.ch-summary { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }

/* lab stepper */
.stepper-dots { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 16px; }
.stepper-dots button { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-weight: 800; cursor: pointer; }
.stepper-dots button.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.stepper-dots button.done { background: #e3f3f0; color: var(--teal); border-color: #bfe3dc; }
.step-panel { display: none; padding: 20px; border-radius: 16px; background: var(--ivory); border: 1px solid var(--line); }
.step-panel.on { display: block; animation: fadeUp .3s ease; }
.step-panel .s-no { font-family: var(--mono); font-weight: 700; color: var(--coral); font-size: .82rem; }
.step-panel p.s-text { margin-top: 6px; font-size: 1.02rem; font-weight: 600; }
.step-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 16px; }
.check-done { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: .9rem; cursor: pointer; }
.check-done input { width: 18px; height: 18px; accent-color: var(--teal); }

/* modal (native dialog) */
dialog.modal { margin: auto; border: 0; padding: 0; border-radius: 20px; width: min(560px, calc(100% - 32px)); box-shadow: 0 30px 80px rgba(7, 24, 39, .35); }
dialog.modal::backdrop { background: rgba(7, 24, 39, .55); backdrop-filter: blur(2px); }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px; background: var(--navy); color: #fff; }
.modal-head i.bx { font-size: 1.5rem; color: var(--gold); }
.modal-head h3 { flex: 1; font-size: 1.05rem; }
.modal-x { border: 0; background: rgba(255, 255, 255, .12); color: #fff; width: 32px; height: 32px; border-radius: 9px; cursor: pointer; font-size: 1.1rem; }
.modal-body { padding: 20px; font-size: .95rem; line-height: 1.7; }
.modal-body code { background: var(--ivory); padding: 1px 6px; border-radius: 5px; font-size: .84rem; word-break: break-word; }

/* exercises */
.ex-item { padding: 20px 22px; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.ex-item + .ex-item { margin-top: 14px; }
.ex-item .ex-type { display: inline-flex; gap: 6px; align-items: center; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--indigo); background: #e9edfb; padding: 3px 10px; border-radius: 99px; }
.ex-item h3 { margin: 10px 0 12px; font-size: 1.02rem; line-height: 1.45; }
.ex-item.correct { border-color: #9bd3b5; box-shadow: inset 4px 0 0 var(--good); }
.ex-item.partial { border-color: #f2d59b; box-shadow: inset 4px 0 0 var(--ok); }
.ex-item.wrong { border-color: #f0b8b3; box-shadow: inset 4px 0 0 var(--bad); }
.tf-row { display: flex; gap: 10px; }
.tf-row label { flex: 1; max-width: 200px; }
.tf-row input { display: none; }
.tf-row span { display: flex; justify-content: center; align-items: center; gap: 8px; padding: 12px; border: 2px solid var(--line); border-radius: 12px; font-weight: 800; cursor: pointer; transition: all .15s; }
.tf-row input:checked + span { border-color: var(--coral); background: #fdeee8; color: #b84d2f; }
.fill-input { display: inline-block; width: 170px; padding: 6px 10px; margin: 0 4px; border: 0; border-bottom: 2px solid var(--coral); background: #fdf6f2; font-family: var(--mono); font-size: .92rem; border-radius: 6px 6px 0 0; }
.fill-input:focus { outline: 0; background: #fdeee8; }
.match-row { display: grid; grid-template-columns: minmax(120px, 1fr) 24px 1.4fr; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.match-row:last-child { border-bottom: 0; }
.match-row .m-left { padding: 9px 12px; border-radius: 10px; background: var(--navy); color: #fff; font-weight: 700; font-family: var(--mono); font-size: .86rem; }
.match-row .m-arrow { color: var(--muted); text-align: center; }
.match-row select { padding: 9px 12px; border-radius: 10px; border: 1px solid #d8d0c3; background: #fff; }
.order-list { list-style: none; display: grid; gap: 8px; }
.order-list li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: grab; user-select: none; }
.order-list li.dragging { opacity: .5; border-style: dashed; }
.order-list .o-handle { color: var(--muted); font-size: 1.2rem; }
.order-list .o-text { flex: 1; font-family: var(--mono); font-size: .88rem; }
.order-list .o-btns button { border: 1px solid var(--line); background: #fff; border-radius: 8px; width: 30px; height: 30px; cursor: pointer; }
.answer-key { margin-top: 12px; padding: 10px 14px; border-radius: 10px; background: var(--ivory); font-size: .88rem; }

/* badges & crown */
.medal { --m1: #ffd76e; --m2: #c98a12; position: relative; display: inline-grid; justify-items: center; width: 74px; height: 88px; flex: none; }
.medal-hex { position: relative; z-index: 1; width: 70px; height: 70px; display: grid; place-items: center; clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%); background: linear-gradient(145deg, var(--m1), var(--m2)); color: #fff; font-size: 1.9rem; text-shadow: 0 2px 4px rgba(0, 0, 0, .25); }
.medal-hex::after { content: ""; position: absolute; inset: 5px; clip-path: inherit; border: 0; background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, .45), transparent 45%); }
.medal-ribbon { position: absolute; bottom: 0; width: 34px; height: 30px; background: linear-gradient(90deg, var(--m2) 0 48%, var(--m1) 52%); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 75%, 0 100%); }
.medal.locked { filter: grayscale(1); opacity: .35; }
.medal.sm { width: 40px; height: 48px; } .medal.sm .medal-hex { width: 38px; height: 38px; font-size: 1.05rem; } .medal.sm .medal-ribbon { width: 18px; height: 16px; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.badge-card { display: flex; gap: 14px; align-items: center; padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.badge-card b { display: block; } .badge-card small { color: var(--muted); display: block; font-size: .8rem; line-height: 1.4; }
.badge-card.earned { border-color: #f1d9a0; background: linear-gradient(135deg, #fffaf0, #fff); }
.badge-strip { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.avatar { position: relative; overflow: visible; }
.avatar .crown { position: absolute; top: -13px; left: 50%; width: 24px; height: 16px; transform: translateX(-50%) rotate(-8deg); filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .25)); }
.avatar.crowned { box-shadow: 0 0 0 2px #f6c343; }
.avatar-xl { width: 84px; height: 84px; border-radius: 24px; font-size: 1.6rem; }
.avatar-xl .crown { width: 46px; height: 30px; top: -24px; }
.toast-badge { position: fixed; z-index: 400; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; align-items: center; gap: 14px; padding: 14px 22px 14px 14px; border-radius: 18px; background: var(--navy); color: #fff; box-shadow: 0 20px 50px rgba(7, 24, 39, .4); animation: popIn .5s cubic-bezier(.2, 1.4, .4, 1); }
.toast-badge b { display: block; color: var(--gold); }
@keyframes popIn { from { opacity: 0; transform: translate(-50%, 30px) scale(.9); } }

@media (max-width: 1100px) { .comp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
    .comp-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .match-row { grid-template-columns: 1fr; gap: 6px; }
    .match-row .m-arrow { display: none; }
    .slide { min-height: 0; }
    .s-head { align-items: flex-start; }
}
.medal.xs { width: 26px; height: 32px; } .medal.xs .medal-hex { width: 26px; height: 26px; font-size: .78rem; } .medal.xs .medal-ribbon { width: 12px; height: 10px; }
.badge-strip.tight { flex-wrap: nowrap; gap: 2px; }

/* ---- collapsible chapter groups in sidebar ---- */
.side-gbtn { position: relative; width: 100%; display: flex; align-items: center; gap: 14px; height: 50px; padding: 0 12px; border: 0; border-radius: 12px; background: transparent; color: inherit; font-weight: 600; font-size: .92rem; text-align: left; white-space: nowrap; cursor: pointer; transition: background .15s; }
.side-gbtn:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side-gbtn .lbl { flex: 1; min-width: 0; line-height: 1.15; }
.side-gbtn .lbl small { display: block; font-size: .72rem; font-weight: 500; color: #7f93a6; overflow: hidden; text-overflow: ellipsis; }
.side-gbtn .chev { font-size: 1.15rem; color: #7f93a6; transition: transform .25s, opacity .2s; }
.side-group.open .side-gbtn .chev { transform: rotate(180deg); }
.side-gbtn.current { color: #fff; }
.side-gbtn.current .ico { background: var(--coral); color: #fff; }
.side-sub { overflow: hidden; }
.side-group .side-sub { display: block; max-height: 0; transition: max-height .3s ease; }
.side-group.open .side-sub { max-height: 900px; }
.side-sub { margin-left: 26px; padding-left: 12px; border-left: 1px solid rgba(255, 255, 255, .1); }
.side-sub .sub-head { display: block; margin: 8px 0 2px 10px; font-size: .64rem; letter-spacing: .14em; text-transform: uppercase; color: #5f758a; font-weight: 800; white-space: nowrap; }
.side-sub a { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: 9px; font-size: .84rem; font-weight: 500; color: #b9c7d4; white-space: nowrap; }
.side-sub a i.bx { font-size: 1rem; color: #7f93a6; flex: none; }
.side-sub a span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.side-sub a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side-sub a.active { background: rgba(239, 124, 91, .18); color: #fff; }
.side-sub a.active i.bx { color: var(--coral); }
.side-sub a .done { flex: none; width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; background: rgba(47, 143, 131, .35); color: #9fe0d5; font-size: .6rem; }
.side-sub a em { flex: none; font-style: normal; font-size: .7rem; font-weight: 700; color: #ffb79f; }
body.sb-unlocked .sidebar:not(:hover):not(:focus-within) .side-sub,
body.sb-unlocked .sidebar:not(:hover):not(:focus-within) .chev { display: none; }
@media (max-width: 960px) { body.sb-unlocked .sidebar .side-sub { display: block !important; } }

/* ---- tidy page tabs ---- */
.page-narrow { max-width: 980px; }
.ptabs { display: flex; gap: 4px; padding: 5px; margin-bottom: 18px; background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow-x: auto; }
.ptabs button, .ptabs a { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 14px; border: 0; border-radius: 10px; background: transparent; font-weight: 700; font-size: .9rem; color: var(--muted); cursor: pointer; white-space: nowrap; }
.ptabs button:hover, .ptabs a:hover { background: var(--ivory); color: var(--text); }
.ptabs button.on, .ptabs a.on { background: var(--navy); color: #fff; }
.ptabs .num { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, .08); font-size: .74rem; }
.ptabs button.on .num { background: var(--coral); color: #fff; }
.tabpane { display: none; }
.tabpane.on { display: block; animation: fadeUp .25s ease; }
.page-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head .chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; background: #fff; border: 1px solid var(--line); font-size: .84rem; font-weight: 700; }
.page-head .chip i { color: var(--coral); }
.status-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 16px; border-radius: 14px; background: #e3f3f0; border: 1px solid #c4e5df; font-size: .9rem; }
.status-bar.pending { background: #fdf6e7; border-color: #f2dfb3; }
.status-bar.none { background: #fff; border-color: var(--line); }
details.fold { background: #fff; border: 1px solid var(--line); border-radius: 16px; }
details.fold + details.fold { margin-top: 12px; }
details.fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 16px 20px; font-weight: 700; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after { content: "\203A"; margin-left: auto; font-size: 1.4rem; color: var(--muted); transition: transform .2s; }
details.fold[open] > summary::after { transform: rotate(90deg); }
details.fold > .fold-body { padding: 0 20px 18px; }
.comp ul.comp-list { list-style: none; margin-top: 12px; display: grid; gap: 4px; }
.comp ul.comp-list a { display: flex; align-items: center; gap: 8px; padding: 6px 8px; margin: 0 -8px; border-radius: 8px; font-size: .84rem; }
.comp ul.comp-list a:hover { background: var(--ivory); }
.comp ul.comp-list a > span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comp ul.comp-list a > .badge { flex: none; }
.comp { min-width: 0; }
.comp ul.comp-list .badge { padding: 2px 8px; font-size: .7rem; }
.comp .btn { margin-top: 12px; width: 100%; }

/* ---- learning journey (chapter overview) ---- */
.journey { position: relative; display: grid; gap: 18px; margin-bottom: 22px; }
.journey::before { content: ""; position: absolute; left: 39px; top: 40px; bottom: 40px; width: 3px; border-radius: 3px; background: repeating-linear-gradient(to bottom, var(--line) 0 8px, transparent 8px 14px); }
.jstep { --j1: #ef7c5b; --j2: #f6a77f; --jsoft: #fdeee8; position: relative; background: #fff; border: 1px solid var(--line); border-radius: 22px; overflow: hidden; box-shadow: var(--shadow-sm); }
.j-practise { --j1: #2f8f83; --j2: #5cc4b6; --jsoft: #e3f3f0; }
.j-build    { --j1: #d18c13; --j2: #f2c15e; --jsoft: #fcf2de; }
.j-prove    { --j1: #4f6bd8; --j2: #8ea2f2; --jsoft: #e9edfb; }
.jhead { position: relative; display: flex; align-items: center; gap: 16px; padding: 20px 22px; background: linear-gradient(120deg, var(--jsoft), #fff 70%); border-bottom: 1px solid var(--line-2); }
.jhead::after { content: ""; position: absolute; right: -40px; top: -60px; width: 200px; height: 200px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--j2) 35%, transparent), transparent 70%); pointer-events: none; }
.jnum { position: relative; z-index: 1; width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--j1); color: #fff; font-weight: 800; font-size: 1rem; box-shadow: 0 0 0 5px #fff, 0 0 0 6px var(--line); }
.jicon { width: 54px; height: 54px; flex: none; display: grid; place-items: center; border-radius: 16px; background: linear-gradient(135deg, var(--j1), var(--j2)); color: #fff; font-size: 1.7rem; box-shadow: 0 10px 22px color-mix(in srgb, var(--j1) 35%, transparent); transform: rotate(-4deg); }
.jtitle { flex: 1; min-width: 0; }
.jtitle small { display: block; font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--j1); }
.jtitle h2 { font-size: 1.45rem; letter-spacing: -.03em; line-height: 1.15; }
.jtitle p { color: var(--muted); font-size: .9rem; margin-top: 2px; }
.jstat { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; min-width: 120px; }
.jstat small { font-size: .74rem; color: var(--muted); line-height: 1.3; }
.jring { --p: 0; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--j1) calc(var(--p) * 1%), var(--line-2) 0); }
.jring b { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: #fff; font-size: .82rem; color: var(--text); }
.jstep.complete .jring b { color: var(--j1); font-size: 1.1rem; }
.jbody { padding: 10px 14px 14px 76px; display: grid; gap: 6px; }
.jrow { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 14px; border: 1px solid transparent; transition: background .15s, border-color .15s, transform .15s; }
.jrow:hover { background: var(--jsoft); border-color: color-mix(in srgb, var(--j1) 25%, transparent); transform: translateX(3px); }
.jrow > i.bx:first-child { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 11px; background: var(--jsoft); color: var(--j1); font-size: 1.2rem; }
.jrow > span:not(.badge) { flex: 1; min-width: 0; }
.jrow b { display: block; font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jrow small { display: block; color: var(--muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jrow .badge { flex: none; }
.jrow .go { color: var(--muted); font-size: 1.3rem; flex: none; }
@media (max-width: 760px) {
    .journey::before { display: none; }
    .jhead { flex-wrap: wrap; padding: 16px; }
    .jnum { display: none; }
    .jstat { flex-direction: row; min-width: 0; width: 100%; justify-content: flex-start; text-align: left; }
    .jbody { padding: 8px; }
    .jtitle h2 { font-size: 1.2rem; }
}

/* ---- sidebar: hidden by default, peeks in on hover, pin keeps it open ---- */
body.dash { --sb-w: 0px; }
body.dash.sb-pinned { --sb-w: var(--sb-open); }
body.dash .sidebar { width: var(--sb-open); transform: translateX(-100%); transition: transform .3s cubic-bezier(.2, .8, .2, 1), box-shadow .3s; }
body.dash.sb-peek .sidebar, body.dash.sb-pinned .sidebar { transform: none; }
body.dash.sb-peek:not(.sb-pinned) .sidebar { box-shadow: 24px 0 60px rgba(7, 24, 39, .35); z-index: 160; }
.sb-edge { position: fixed; z-index: 150; left: 0; top: 0; bottom: 0; width: 18px; cursor: e-resize; }
.sb-edge::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: linear-gradient(to bottom, var(--coral), var(--gold), var(--teal)); opacity: .55; transition: opacity .2s, width .2s; }
.sb-edge:hover::before { opacity: 1; width: 6px; }
.sb-handle { position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 22px; height: 64px; display: grid; place-items: center; border-radius: 0 12px 12px 0; background: var(--navy); color: #fff; font-size: 1.1rem; box-shadow: 4px 0 14px rgba(7, 24, 39, .25); transition: width .2s; }
.sb-edge:hover .sb-handle { width: 28px; }
body.sb-pinned .sb-edge, body.sb-peek .sb-edge { display: none; }
.sb-lock.on { background: var(--coral); color: #fff; }
.side-toggle { display: grid; place-items: center; }
@media (max-width: 960px) {
    .sb-edge { display: none; }
    body.dash .sidebar, body.dash.sb-pinned .sidebar { transform: translateX(-100%); width: 280px; }
    body.dash.side-open .sidebar { transform: none; }
    body.dash, body.dash.sb-pinned { --sb-w: 0px; }
    .sb-lock { display: none; }
}

/* =================================================== QUESTION PLAYER (one per page) */
.page-narrow { max-width: 1100px; margin-inline: auto; width: 100%; }
.qplayer { --qa: var(--coral); }
.qtop { position: sticky; top: 74px; z-index: 30; padding: 14px 16px; margin-bottom: 16px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-sm); }
.qtop-row { display: flex; align-items: center; gap: 12px; }
.qtop-row b { font-size: .95rem; }
.qtop-row .qcount { margin-left: auto; font-size: .84rem; color: var(--muted); font-weight: 700; }
.qbar { height: 8px; margin-top: 10px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.qbar span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--coral), var(--gold)); transition: width .35s ease; }
.qnav { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.qnav button { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-weight: 800; font-size: .82rem; color: var(--muted); cursor: pointer; transition: all .15s; }
.qnav button:hover { border-color: var(--coral); color: var(--coral); }
.qnav button.answered { background: #e3f3f0; border-color: #bfe3dc; color: var(--teal); }
.qnav button.on { background: var(--navy); border-color: var(--navy); color: #fff; transform: translateY(-2px); box-shadow: 0 6px 14px rgba(14, 34, 52, .25); }
.qslide { display: none; }
.qslide.on { display: block; animation: qIn .35s cubic-bezier(.2, .8, .2, 1); }
.qslide.on.back { animation-name: qInBack; }
@keyframes qIn { from { opacity: 0; transform: translateX(26px); } }
@keyframes qInBack { from { opacity: 0; transform: translateX(-26px); } }
.qcard { position: relative; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); }
.qcard-head { display: flex; align-items: center; gap: 16px; padding: 22px 26px; background: linear-gradient(120deg, var(--qsoft, #fdeee8), #fff 75%); border-bottom: 1px solid var(--line-2); }
.qcard-head .qbig { width: 58px; height: 58px; flex: none; display: grid; place-items: center; border-radius: 18px; background: linear-gradient(135deg, var(--qa), var(--qa2, #f6a77f)); color: #fff; font-size: 1.8rem; box-shadow: 0 10px 22px rgba(0, 0, 0, .12); transform: rotate(-4deg); }
.qcard-head .qno { font-size: .74rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--qa); }
.qcard-head h3 { margin-top: 4px; font-size: clamp(1.05rem, 2vw, 1.3rem); line-height: 1.4; letter-spacing: -.01em; }
.qcard-body { padding: 22px 26px 26px; }
.qcard.t-mcq   { --qa: #4f6bd8; --qa2: #8ea2f2; --qsoft: #e9edfb; }
.qcard.t-tf    { --qa: #2f8f83; --qa2: #5cc4b6; --qsoft: #e3f3f0; }
.qcard.t-fill  { --qa: #d18c13; --qa2: #f2c15e; --qsoft: #fcf2de; }
.qcard.t-match { --qa: #ef7c5b; --qa2: #f6a77f; --qsoft: #fdeee8; }
.qcard.t-order { --qa: #8a5cd6; --qa2: #b896f0; --qsoft: #f1eafc; }
.qcard.l-easy   { --qa: #1f8a5b; --qa2: #57c08f; --qsoft: #e3f4ea; }
.qcard.l-medium { --qa: #c27c0e; --qa2: #f0bd55; --qsoft: #fcf2de; }
.qcard.l-hard   { --qa: #c2413b; --qa2: #ee7d73; --qsoft: #fbe7e5; }
.lvl { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; font-size: .72rem; font-weight: 800; }
.lvl.easy { background: #e3f4ea; color: var(--good); } .lvl.medium { background: #fbf0d9; color: var(--ok); } .lvl.hard { background: #fbe5e3; color: var(--bad); }
/* options */
.choice { position: relative; display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-top: 10px; border: 2px solid var(--line); border-radius: 16px; background: #fff; cursor: pointer; transition: border-color .15s, background .15s, transform .12s; font-size: .97rem; }
.choice:hover { border-color: color-mix(in srgb, var(--qa) 55%, transparent); transform: translateX(3px); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice .letter { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--ivory); font-weight: 800; color: var(--muted); transition: all .15s; }
.choice .tick { margin-left: auto; font-size: 1.4rem; color: var(--qa); opacity: 0; transform: scale(.5); transition: all .2s; }
.choice:has(input:checked) { border-color: var(--qa); background: var(--qsoft); }
.choice:has(input:checked) .letter { background: var(--qa); color: #fff; }
.choice:has(input:checked) .tick { opacity: 1; transform: none; }
.choice:has(input:focus-visible) { outline: 3px solid rgba(239, 124, 91, .45); outline-offset: 2px; }
.tf-big { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tf-big .choice { flex-direction: column; justify-content: center; padding: 26px 16px; text-align: center; font-weight: 800; font-size: 1.1rem; margin: 0; }
.tf-big .choice i.bx { font-size: 2.4rem; color: var(--qa); }
.tf-big .choice .tick { position: absolute; top: 10px; right: 12px; }
.qfill { display: flex; align-items: center; gap: 12px; padding: 18px; border-radius: 16px; background: var(--qsoft); border: 2px dashed color-mix(in srgb, var(--qa) 45%, transparent); }
.qfill i.bx { font-size: 1.6rem; color: var(--qa); }
.qfill input { flex: 1; padding: 12px 14px; border: 2px solid transparent; border-radius: 12px; font-family: var(--mono); font-size: 1rem; background: #fff; }
.qfill input:focus { outline: 0; border-color: var(--qa); }
.qsentence { padding: 14px 16px; margin-bottom: 14px; border-radius: 14px; background: var(--ivory); font-family: var(--mono); font-size: .92rem; line-height: 1.7; }
.qsentence .blank { display: inline-block; min-width: 90px; border-bottom: 2px solid var(--qa); color: var(--qa); text-align: center; font-weight: 700; }
.qfoot { display: flex; align-items: center; gap: 10px; margin-top: 18px; }
.qfoot .btn { min-width: 130px; }
.qfoot .grow { flex: 1; }
.qhint { font-size: .8rem; color: var(--muted); text-align: center; margin-top: 10px; }
/* results */
.result-hero { position: relative; overflow: hidden; display: flex; align-items: center; gap: 26px; flex-wrap: wrap; padding: 28px; margin-bottom: 18px; border-radius: 24px; color: #fff; background: radial-gradient(circle at 90% 10%, rgba(255, 255, 255, .18), transparent 40%), linear-gradient(135deg, var(--navy-2), var(--navy-3)); }
.result-hero .rh-ring { --p: 0; --c: var(--good); width: 120px; height: 120px; flex: none; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), rgba(255, 255, 255, .12) 0); }
.result-hero .rh-ring b { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; background: var(--navy-3); font-size: 1.7rem; letter-spacing: -.03em; }
.result-hero h2 { font-size: 1.5rem; letter-spacing: -.02em; }
.result-hero p { color: #c8d4df; }
.result-hero .actions { margin-left: auto; }
.lvl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.lvl-card { padding: 16px; border-radius: 16px; background: #fff; border: 1px solid var(--line); }
.lvl-card b { display: block; font-size: 1.5rem; letter-spacing: -.02em; margin-top: 6px; }
.rev { background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.rev + .rev { margin-top: 10px; }
.rev > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 14px 18px; }
.rev > summary::-webkit-details-marker { display: none; }
.rev > summary .rs { width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; }
.rev.ok > summary .rs { background: var(--good); } .rev.part > summary .rs { background: var(--ok); } .rev.no > summary .rs { background: var(--bad); }
.rev > summary span.t { flex: 1; min-width: 0; font-weight: 600; font-size: .93rem; }
.rev > summary::after { content: "\203A"; font-size: 1.3rem; color: var(--muted); transition: transform .2s; }
.rev[open] > summary::after { transform: rotate(90deg); }
.rev .rev-body { padding: 0 18px 16px 60px; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 500; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(720deg); opacity: .8; } }
@media (max-width: 760px) {
    .qtop { top: 64px; }
    .qcard-head, .qcard-body { padding: 16px; }
    .qcard-head .qbig { width: 46px; height: 46px; font-size: 1.4rem; }
    .lvl-grid { grid-template-columns: 1fr; }
    .qfoot .btn { min-width: 0; flex: 1; }
    .rev .rev-body { padding: 0 14px 14px; }
}

/* =================================================== ANALYTICS */
.an-hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; margin-bottom: 20px; }
.an-hero .card { display: flex; flex-direction: column; }
.radar { width: 100%; max-width: 360px; margin: 0 auto; display: block; }
.band { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; font-size: .74rem; font-weight: 800; white-space: nowrap; }
.band.strong { background: #e3f4ea; color: var(--good); } .band.fair { background: #fbf0d9; color: var(--ok); } .band.weak { background: #fbe5e3; color: var(--bad); } .band.none { background: #f1ede6; color: #8a8378; }
.sw { display: grid; gap: 8px; }
.sw-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: #fff; }
.sw-item .sw-ico { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 11px; font-size: 1.2rem; }
.sw.good .sw-ico { background: #e3f4ea; color: var(--good); } .sw.bad .sw-ico { background: #fbe5e3; color: var(--bad); }
.sw-item .sw-main { flex: 1; min-width: 0; }
.sw-item .sw-main b { display: block; font-size: .92rem; }
.sw-item .sw-main small { color: var(--muted); font-size: .8rem; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sw-item .sw-val { font-weight: 800; font-size: 1.05rem; }
.sw.good .sw-val { color: var(--good); } .sw.bad .sw-val { color: var(--bad); }
.chap-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.chap-tile { position: relative; padding: 18px; border-radius: 18px; background: #fff; border: 1px solid var(--line); overflow: hidden; }
.chap-tile::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--acc, var(--coral)); }
.chap-tile .ct-top { display: flex; justify-content: space-between; align-items: center; }
.chap-tile .ct-no { font-weight: 800; color: var(--acc); font-size: .8rem; letter-spacing: .08em; }
.chap-tile b.ct-score { display: block; margin-top: 8px; font-size: 1.9rem; letter-spacing: -.03em; }
.chap-tile small { color: var(--muted); }
.chap-tile .ct-verdict { margin-top: 8px; font-size: .84rem; font-weight: 600; }
.recs { display: grid; gap: 10px; }
.rec { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border-radius: 16px; background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--rc, var(--teal)); }
.rec.bad { --rc: var(--bad); } .rec.ok { --rc: var(--gold); } .rec.info { --rc: var(--indigo); } .rec.good { --rc: var(--good); }
.rec i.bx { font-size: 1.5rem; color: var(--rc); margin-top: 2px; }
.rec b { display: block; }
.rec p { color: var(--muted); font-size: .88rem; margin-top: 2px; }
.rec .btn { margin-left: auto; flex: none; }
.dist { display: flex; height: 12px; border-radius: 99px; overflow: hidden; background: var(--line-2); }
.dist span { display: block; height: 100%; }
.dist .d-strong { background: #2f9e6b; } .dist .d-fair { background: #e4a33a; } .dist .d-weak { background: #d65a50; } .dist .d-none { background: #ddd5c8; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .78rem; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.heat { width: 100%; border-collapse: separate; border-spacing: 4px; font-size: .84rem; }
.heat th { font-size: .72rem; color: var(--muted); font-weight: 800; text-align: left; padding: 4px; }
.heat td.h { text-align: center; border-radius: 10px; padding: 12px 6px; font-weight: 800; }
.h0 { background: #f1ede6; color: #a59e92; } .h1 { background: #fbe5e3; color: #a3332d; } .h2 { background: #fcf0dc; color: #9a6510; } .h3 { background: #e8f5ee; color: #1c7a50; } .h4 { background: #c9ebd8; color: #135e3d; }
@media (max-width: 1100px) { .an-hero { grid-template-columns: 1fr; } .chap-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .rec { flex-wrap: wrap; } .rec .btn { margin-left: 0; } }
