/* =====================================================================
   W3Teacher design system v4
   Public site only. The Admin area keeps its own stylesheet.
   Type: Bitter (headings) + DM Sans (body) + JetBrains Mono (code)
   ===================================================================== */

/* ---------- Tokens ---------- */
:root {
    --paper: #F6F7FB;
    --surface: #FFFFFF;
    --surface-2: #F0F1F7;
    --ink: #1A1D3A;
    --ink-2: #3A3F63;
    --mute: #6A6F8C;
    --line: #E2E4EE;
    --line-strong: #C9CCDD;

    --violet: #5B34D6;
    --violet-hover: #4A27BD;
    --violet-soft: #EEE9FF;
    --violet-ink: #3D1FA6;
    --hl: #FFE066;
    --note: #FFFBE6;
    --note-line: #EAD98A;

    --easy: #178A5E;  --easy-bg: #E3F5EC;
    --mid: #A86400;   --mid-bg: #FFF1D9;
    --hard: #C93B3B;  --hard-bg: #FDE6E6;
    --info: #1F6FB2;  --info-bg: #E5F1FB;

    --code-bg: #1A1D3A;
    --code-ink: #DDE1FF;

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 18px;
    --shadow-pop: 0 12px 32px rgba(26, 29, 58, .14);
    --hard-shadow: 5px 5px 0 var(--ink);

    --font-head: "Bitter", Georgia, serif;
    --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-code: "JetBrains Mono", Consolas, monospace;

    --wrap: 1300px;
    --nav-h: 68px;
}

[data-theme="dark"] {
    --paper: #12142A;
    --surface: #1B1E3A;
    --surface-2: #232748;
    --ink: #ECEEFF;
    --ink-2: #C4C8EA;
    --mute: #9196BC;
    --line: #2E3258;
    --line-strong: #41467A;
    --violet: #8F72FF;
    --violet-hover: #A48CFF;
    --violet-soft: #2A2560;
    --violet-ink: #CFC3FF;
    --note: #2B2A1E;
    --note-line: #5A5430;
    --easy-bg: #163A2D; --easy: #5FD3A2;
    --mid-bg: #3A2C12;  --mid: #F2B653;
    --hard-bg: #3E1C24; --hard: #FF8A8A;
    --info-bg: #15304A; --info: #7FB8EA;
    --code-bg: #0E1024;
    --hard-shadow: 5px 5px 0 #000;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
img, svg, video { max-width: 100%; height: auto; }
a { color: var(--violet); text-decoration: none; }
a:hover { color: var(--violet-hover); }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4, h5, h6 { font-family: var(--font-head); color: var(--ink); line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4vw, 2.75rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); font-weight: 800; }
h3 { font-size: 1.35rem; font-weight: 700; }
h4 { font-size: 1.125rem; font-weight: 700; }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
code, kbd, pre, samp { font-family: var(--font-code); }
small, .small { font-size: .875rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.wrap--narrow { max-width: 760px; }
.wrap--mid { max-width: 960px; }
.page { padding: 40px 0 88px; }
.section { padding: 60px 0; }
.section--tight { padding: 48px 0; }
.section + .section { padding-top: 0; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.grid { display: grid; gap: 20px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 991px) { .grid--3, .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; } }

/* Content + sidebar layouts */
.with-side { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 32px; align-items: start; }
.with-rail { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; align-items: start; }
.three-col { display: grid; grid-template-columns: 260px minmax(0, 1fr) 290px; gap: 28px; align-items: start; }
.sticky { position: sticky; top: calc(var(--nav-h) + 20px); }
@media (max-width: 1199px) { .three-col { grid-template-columns: 240px minmax(0, 1fr); } .three-col > .rail { grid-column: 1 / -1; } }
@media (max-width: 991px) {
    .with-side, .with-rail, .three-col { grid-template-columns: 1fr; }
    .sticky { position: static; }
}

/* ---------- Text helpers ---------- */
.muted { color: var(--mute); }
.ink2 { color: var(--ink-2); }
.lead { font-size: 1.125rem; color: var(--ink-2); max-width: 640px; }
.hl { background: linear-gradient(transparent 55%, var(--hl) 55%, var(--hl) 92%, transparent 92%); color: inherit; }
[data-theme="dark"] .hl { background: linear-gradient(transparent 55%, rgba(255, 224, 102, .35) 55%, rgba(255, 224, 102, .35) 92%, transparent 92%); }
.slab { font-family: var(--font-head); }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.center { text-align: center; }
.mt-0 { margin-top: 0 !important; } .mb-0 { margin-bottom: 0 !important; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 40px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; } .mb-4 { margin-bottom: 40px; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 42px; padding: 0 18px; border-radius: 10px;
    font: 600 15px/1 var(--font-body); white-space: nowrap;
    border: 1.5px solid transparent; background: none; color: var(--ink);
    cursor: pointer; transition: background .15s, color .15s, border-color .15s, transform .1s;
    text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--violet); color: #fff; }
.btn--primary:hover { background: var(--violet-hover); color: #fff; }
.btn--ink { background: var(--ink); color: var(--surface); }
.btn--ink:hover { color: var(--surface); opacity: .9; }
.btn--hl { background: var(--hl); color: #1A1D3A; }
.btn--hl:hover { color: #1A1D3A; filter: brightness(.96); }
.btn--line { border-color: var(--ink); color: var(--ink); }
.btn--line:hover { background: var(--ink); color: var(--surface); }
.btn--soft { background: var(--violet-soft); color: var(--violet-ink); }
.btn--soft:hover { color: var(--violet-ink); filter: brightness(.97); }
.btn--quiet { border-color: var(--line); color: var(--ink-2); background: var(--surface); }
.btn--quiet:hover { border-color: var(--line-strong); color: var(--ink); }
.btn--danger { background: var(--hard-bg); color: var(--hard); }
.btn--ghost { color: var(--ink); }
.btn--ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn--sm { height: 34px; padding: 0 12px; font-size: 14px; border-radius: 8px; }
.btn--lg { height: 52px; padding: 0 24px; font-size: 16px; border-radius: 12px; }
.btn--block { width: 100%; }
.btn--icon { width: 40px; padding: 0; }
.btn[disabled], .btn.is-disabled { opacity: .5; pointer-events: none; }
.link-arrow { font-weight: 600; color: var(--violet); display: inline-flex; align-items: center; gap: 4px; }

/* ---------- Badges / level pills ---------- */
.lvl, .pill {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12px; font-weight: 600; line-height: 1;
    padding: 5px 10px; border-radius: 20px; white-space: nowrap;
}
.lvl--beginner { background: var(--easy-bg); color: var(--easy); }
.lvl--intermediate { background: var(--mid-bg); color: var(--mid); }
.lvl--advanced { background: var(--hard-bg); color: var(--hard); }
.pill { background: var(--surface-2); color: var(--ink-2); }
.pill--violet { background: var(--violet-soft); color: var(--violet-ink); }
.pill--hl { background: var(--hl); color: #1A1D3A; }
.pill--ok { background: var(--easy-bg); color: var(--easy); }
.pill--bad { background: var(--hard-bg); color: var(--hard); }
.count { font-size: 13px; color: var(--mute); font-weight: 500; }

/* ---------- Surfaces ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.panel--pad { padding: 28px; }
.panel--pad-sm { padding: 18px; }
.panel--ink { background: var(--ink); color: #fff; border-color: var(--ink); }
[data-theme="dark"] .panel--ink { background: #0E1024; border-color: var(--line); }
.panel--ink h2, .panel--ink h3, .panel--ink h4 { color: #fff; }
.panel--ink .muted { color: #A9AED6; }
.panel--note { background: var(--note); border: 1.5px solid var(--note-line); border-radius: var(--radius); padding: 20px 24px; }
.panel--outline { border: 1.5px solid var(--ink); }
.panel__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.panel__head h2, .panel__head h3, .panel__head h4 { margin: 0; }
.panel__body { padding: 22px; }
.panel__foot { padding: 14px 22px; border-top: 1px solid var(--line); }

/* ---------- Page header ---------- */
.page-head { background: var(--surface); border-bottom: 1px solid var(--line); padding: 36px 0 32px; }
.page-head h1 { margin-bottom: 10px; }
.page-head .lead { margin: 0; }
.page-head__row { display: flex; gap: 24px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.page-head__icon { display: flex; gap: 18px; align-items: flex-start; }
.page-head__stats { display: flex; gap: 28px; margin-top: 20px; color: var(--mute); font-size: 14px; flex-wrap: wrap; }
.page-head__stats b { display: block; font-family: var(--font-head); font-size: 1.5rem; color: var(--ink); line-height: 1.2; }

.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 14px; color: var(--mute); margin: 0 0 14px; padding: 0; list-style: none; }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--line-strong); }
.crumbs a { color: var(--mute); }
.crumbs a:hover { color: var(--violet); }
.crumbs [aria-current] { color: var(--ink); font-weight: 600; }

.sec-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }
.sec-head h2 { margin: 0; }
.sec-head p { color: var(--mute); margin: 8px 0 0; max-width: 580px; }

/* ---------- Icon tile ---------- */
.itile { display: inline-grid; place-items: center; flex: none; border-radius: 10px; background: var(--violet-soft); color: var(--violet-ink); }
.itile img { object-fit: contain; }

/* ---------- Nav ---------- */
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 200; }
.skip:focus { left: 8px; color: #fff; }
.nav { position: sticky; top: 0; z-index: 100; background: var(--surface); border-bottom: 1px solid var(--line); }
.nav__in { display: flex; align-items: center; gap: 24px; height: var(--nav-h); }
.brand { display: inline-flex; align-items: center; flex: none; text-decoration: none; }
.brand:hover { text-decoration: none; }

/* Logo (restored from the original design) */
:root { --brand: #863EFA; --brand-rest: rgba(111, 111, 112, .85); }
[data-theme="dark"] { --brand: #A372FF; --brand-rest: rgba(222, 226, 230, .75); }
.brand-lockup { display: inline-flex; align-items: center; gap: 8px; line-height: 1; }
.brand-mark { position: relative; display: inline-block; flex: none; font-size: 1.85rem; line-height: 1; color: var(--brand); transform: rotate(-10deg); filter: drop-shadow(0 2px 4px rgba(134, 62, 250, .35)); }
.brand-mark::after { content: ""; position: absolute; top: -1px; right: -5px; width: 6px; height: 6px; border-radius: 1px; background: var(--brand); opacity: .55; transform: rotate(18deg); }
.brand-wordmark { font: 400 1.6rem/1 var(--font-body); letter-spacing: -.01em; white-space: nowrap; }
.brand-wordmark-accent { color: var(--brand); font-weight: 800; }
.brand-wordmark-rest { color: var(--brand-rest); font-weight: 400; }
.auth__side .brand-wordmark-rest { color: rgba(222, 226, 230, .75); }
.auth__side .brand-mark, .auth__side .brand-wordmark-accent { color: #A372FF; }
.auth__side .brand-mark::after { background: #A372FF; }
.foot .brand-wordmark { font-size: 1.45rem; }
.nav__links { display: flex; gap: 4px; margin: 0; padding: 0; list-style: none; }
.nav__links > li { position: relative; }
.nav__link { display: inline-flex; align-items: center; gap: 4px; height: 40px; padding: 0 12px; border-radius: 8px; color: var(--ink-2); font-weight: 500; font-size: 15px; background: none; border: 0; cursor: pointer; font-family: var(--font-body); }
.nav__link:hover, .nav__link[aria-expanded="true"] { background: var(--surface-2); color: var(--ink); }
.nav__link.is-active { color: var(--ink); font-weight: 600; }
.nav__link .bi-chevron-down { font-size: 11px; transition: transform .15s; }
.nav__link[aria-expanded="true"] .bi-chevron-down { transform: rotate(180deg); }
.nav__search { flex: 1; min-width: 160px; max-width: 420px; position: relative; }
.nav__search input { width: 100%; height: 42px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); padding: 0 64px 0 38px; font: 14px var(--font-body); color: var(--ink); }
.nav__search input:focus { outline: none; border-color: var(--violet); background: var(--surface); }
.nav__search .bi-search { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--mute); font-size: 14px; }
.nav__search kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font: 12px var(--font-body); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; color: var(--mute); background: var(--surface); }
.nav__end { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.nav__burger { display: none; }

.menu { position: absolute; top: calc(100% + 8px); left: 0; min-width: 230px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-pop); padding: 8px; z-index: 110; }
.menu--right { left: auto; right: 0; }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 8px; color: var(--ink-2); font: 500 15px var(--font-body); background: none; border: 0; text-align: left; cursor: pointer; }
.menu a:hover, .menu button:hover { background: var(--surface-2); color: var(--ink); }
.menu hr { margin: 6px 0; }
.menu__label { font-size: 13px; color: var(--mute); padding: 8px 12px 4px; }
.mega { width: 640px; padding: 18px; }
.mega__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px 12px; }
.mega__foot { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; display: flex; justify-content: space-between; align-items: center; }
.mega__foot a { width: auto; }

@media (max-width: 1100px) {
    .nav__search { max-width: none; }
    .nav__search kbd { display: none; }
}
@media (max-width: 991px) {
    .nav__burger { display: inline-flex; }
    .nav__links, .nav__end .hide-sm { display: none; }
    .nav__search { display: none; }
    .nav.is-open .nav__drawer { display: block; }
}
.nav__drawer { display: none; border-top: 1px solid var(--line); background: var(--surface); padding: 16px 20px 24px; max-height: calc(100vh - var(--nav-h)); overflow-y: auto; }
.nav__drawer form { position: relative; margin-bottom: 14px; }
.nav__drawer input { width: 100%; height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 0 14px; font: 15px var(--font-body); background: var(--paper); color: var(--ink); }
.nav__drawer a { display: block; padding: 10px 4px; color: var(--ink); font-weight: 500; border-bottom: 1px solid var(--line); }
.nav__drawer .drawer__label { font-size: 13px; color: var(--mute); margin: 16px 0 4px; }
.nav__drawer .row { margin-top: 18px; }

/* ---------- Forms ---------- */
.field { margin-bottom: 18px; }
.field label, .label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; color: var(--ink); }
.input, .select, .textarea {
    width: 100%; height: 46px; padding: 0 14px;
    border: 1.5px solid var(--line); border-radius: 10px;
    background: var(--surface); color: var(--ink);
    font: 15px var(--font-body); transition: border-color .15s;
}
.textarea { height: auto; min-height: 120px; padding: 12px 14px; line-height: 1.5; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%236A6F8C' stroke-width='1.6'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px var(--violet-soft); }
.input-validation-error { border-color: var(--hard) !important; }
.field-validation-error, .text-danger, .validation-summary-errors { color: var(--hard); font-size: 14px; margin-top: 6px; display: block; }
.validation-summary-errors ul { margin: 0; padding-left: 18px; }
.validation-summary-valid { display: none !important; }
.check { display: flex; gap: 10px; align-items: center; font-size: 15px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--violet); }
.form-hint { color: var(--mute); font-size: 13px; margin-top: 6px; }

.bigsearch { display: flex; align-items: center; gap: 8px; height: 62px; border: 2px solid var(--ink); border-radius: 14px; padding: 0 8px 0 20px; background: var(--surface); box-shadow: var(--hard-shadow); max-width: 580px; }
.bigsearch input { flex: 1; min-width: 0; border: 0; outline: none; background: none; font: 17px var(--font-body); color: var(--ink); height: 100%; }
.bigsearch input::placeholder { color: var(--mute); }
.bigsearch .btn { height: 46px; }
.bigsearch:focus-within { box-shadow: var(--hard-shadow), 0 0 0 4px var(--violet-soft); }

/* ---------- Alerts / flash ---------- */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px; border-radius: var(--radius); font-size: 15px; margin-bottom: 20px; border: 1px solid transparent; }
.alert > .bi { font-size: 18px; line-height: 1.3; }
.alert--ok { background: var(--easy-bg); color: var(--easy); }
.alert--bad { background: var(--hard-bg); color: var(--hard); }
.alert--info { background: var(--info-bg); color: var(--info); }
.alert--warn { background: var(--mid-bg); color: var(--mid); }
.alert__close { margin-left: auto; background: none; border: 0; color: inherit; cursor: pointer; font-size: 18px; line-height: 1; padding: 0; opacity: .7; }
.flash { padding-top: 20px; }

.empty { text-align: center; padding: 56px 24px; border: 1.5px dashed var(--line-strong); border-radius: var(--radius-lg); background: var(--surface); }
.empty > .bi { font-size: 34px; color: var(--violet); display: block; margin-bottom: 10px; }
.empty h3 { margin-bottom: 6px; }
.empty p { color: var(--mute); max-width: 420px; margin: 0 auto 18px; }

/* ---------- Lists / rows ---------- */
.qlist { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.qlist__head, .qlist__row { display: grid; grid-template-columns: minmax(0, 1fr) 200px 120px 90px; gap: 16px; align-items: center; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.qlist__head { background: var(--surface-2); font-size: 13px; color: var(--mute); font-weight: 600; padding-top: 11px; padding-bottom: 11px; }
.qlist__row:last-child { border-bottom: 0; }
.qlist__row { position: relative; transition: background .12s; }
.qlist__row:hover { background: var(--paper); }
.qlist__q { font-weight: 600; color: var(--ink); }
.qlist__q a { color: inherit; }
.qlist__q a::after { content: ""; position: absolute; inset: 0; }
.qlist__meta { color: var(--mute); font-size: 14px; }
.qlist__end { color: var(--mute); font-size: 13px; text-align: right; }
@media (max-width: 760px) {
    .qlist__head { display: none; }
    .qlist__row { grid-template-columns: 1fr auto; }
    .qlist__row .qlist__meta { grid-column: 1; grid-row: 2; }
    .qlist__row .qlist__end { display: none; }
}

.linklist { list-style: none; margin: 0; padding: 0; }
.linklist li { border-bottom: 1px solid var(--line); }
.linklist li:last-child { border-bottom: 0; }
.linklist a { display: flex; justify-content: space-between; gap: 12px; padding: 10px 2px; color: var(--ink-2); font-size: 15px; }
.linklist a:hover { color: var(--violet); }

/* Tiles (technology / category) */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.tiles--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1100px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .tiles, .tiles--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 460px) { .tiles, .tiles--3 { grid-template-columns: 1fr; } }
.tile { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); transition: border-color .15s, transform .15s; }
.tile:hover { border-color: var(--ink); color: var(--ink); transform: translateY(-2px); }
.tile__name { font-weight: 700; font-size: 16px; line-height: 1.3; }
.tile__desc { color: var(--mute); font-size: 14px; }
.tile__meta { color: var(--mute); font-size: 13px; margin-top: auto; }
.tile--paper { background: var(--paper); }
.tile--technology { display: grid; grid-template-columns: 38px minmax(0, 1fr); align-items: center; gap: 12px; min-height: 82px; padding: 16px; }
.tile--technology .tile__name { font-size: 15px; line-height: 1.35; overflow-wrap: normal; word-break: normal; }

/* Progress bar */
.bar { height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--violet); border-radius: 6px; }
.bar--ok > i { background: var(--easy); }

/* Side nav (topic lists etc.) */
.sidenav { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px; }
.sidenav__title { font-family: var(--font-head); font-size: 17px; font-weight: 700; margin: 2px 6px 4px; }
.sidenav__sub { font-size: 13px; color: var(--mute); margin: 0 6px 12px; }
.sidenav ul { list-style: none; margin: 0; padding: 0; }
.sidenav a { display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px; border-radius: 9px; font-size: 14px; line-height: 1.4; color: var(--ink-2); }
.sidenav a:hover { background: var(--surface-2); color: var(--ink); }
.sidenav a.active, .sidenav a[aria-current="page"] { background: var(--violet-soft); color: var(--violet-ink); font-weight: 600; }
.sidenav .dot { flex: none; width: 16px; height: 16px; margin-top: 1px; border-radius: 50%; border: 1.5px solid var(--line-strong); }
.sidenav .dot.is-done { background: var(--easy); border-color: var(--easy); }
.sidenav a.active .dot { border: 5px solid var(--violet); }
.sidenav__group { font-size: 13px; color: var(--mute); font-weight: 600; margin: 14px 10px 4px; }

/* Segmented filter */
.seg { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 10px; flex-wrap: wrap; }
.seg a, .seg button, .seg label { padding: 7px 14px; border-radius: 8px; font: 600 14px var(--font-body); color: var(--ink-2); background: none; border: 0; cursor: pointer; }
.seg a:hover, .seg button:hover { color: var(--ink); }
.seg .is-on, .seg [aria-current="true"], .seg input:checked + span { background: var(--ink); color: var(--surface); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }

/* Tabs */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 24px; overflow-x: auto; }
.tabs a, .tabs button { padding: 10px 14px; font: 600 15px var(--font-body); color: var(--mute); border: 0; background: none; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; }
.tabs .is-on, .tabs [aria-selected="true"] { color: var(--ink); border-bottom-color: var(--violet); }

/* Pagination */
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 32px; flex-wrap: wrap; list-style: none; padding: 0; }
.pager a, .pager span { min-width: 40px; height: 40px; padding: 0 12px; display: inline-grid; place-items: center; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-weight: 600; font-size: 14px; }
.pager a:hover { border-color: var(--ink); color: var(--ink); }
.pager .is-on { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.pager .is-off { opacity: .45; }

/* FAQ (native <details>, no JS) */
.faq { display: grid; gap: 12px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .15s, box-shadow .15s; }
.faq details:hover { border-color: var(--line-strong); }
.faq details[open] { border-color: var(--ink); box-shadow: 4px 4px 0 var(--ink); }
[data-theme="dark"] .faq details[open] { border-color: var(--violet); box-shadow: 4px 4px 0 #000; }
.faq summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 16px; padding: 18px 20px; font: 600 16px/1.4 var(--font-body); color: var(--ink); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary:focus-visible { outline-offset: -3px; }
.faq summary > span { flex: 1; }
.faq summary::after { content: "+"; flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); font: 500 20px/1 var(--font-body); transition: transform .2s, background .15s; }
.faq details[open] summary::after { content: "−"; background: var(--hl); color: #1A1D3A; }
.faq__a { padding: 0 66px 20px 20px; color: var(--ink-2); font-size: 15.5px; line-height: 1.7; }
.faq__a p:last-child { margin-bottom: 0; }

.faq-section { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.faq-wrap { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 64px; align-items: start; }
.faq-intro h2 { margin-bottom: 10px; }
.faq-intro > p { color: var(--mute); margin-bottom: 28px; }
.faq-help { background: var(--ink); color: #fff; border-radius: var(--radius-lg); padding: 24px; }
[data-theme="dark"] .faq-help { background: #0E1024; border: 1px solid var(--line); }
.faq-help h3 { color: #fff; font-size: 1.15rem; margin-bottom: 6px; }
.faq-help p { color: #C4C8EA; font-size: 14.5px; margin-bottom: 16px; }
.faq-help form { display: flex; gap: 8px; margin-bottom: 12px; }
.faq-help input { flex: 1; min-width: 0; height: 42px; border-radius: 10px; border: 1px solid #3A3F70; background: #252950; color: #fff; padding: 0 12px; font: 14px var(--font-body); }
.faq-help input::placeholder { color: #9EA3CF; }
.faq-help input:focus { outline: none; border-color: var(--hl); }
.faq-help .row { gap: 8px; }
@media (max-width: 991px) { .faq-wrap { grid-template-columns: 1fr; gap: 28px; } .faq-intro .sticky { position: static; } }
@media (max-width: 600px) { .faq__a { padding-right: 20px; } }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th { text-align: left; font-size: 13px; color: var(--mute); font-weight: 600; background: var(--surface-2); padding: 11px 16px; }
.table td { padding: 14px 16px; border-top: 1px solid var(--line); vertical-align: middle; }

/* Stat */
.stat { padding: 20px; }
.stat__num { font-family: var(--font-head); font-size: 2rem; font-weight: 700; line-height: 1.1; }
.stat__label { color: var(--mute); font-size: 14px; }

/* ---------- Q&A content ---------- */
.qa { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 30px 34px; margin-bottom: 20px; }
.qa__meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 14px; color: var(--mute); }
.qa__q { font-size: 1.5rem; margin: 14px 0 18px; line-height: 1.3; }
.qa__q a { color: inherit; }
.qa__q a:hover { color: var(--violet); }
.qa__tools { display: flex; gap: 8px; margin-left: auto; align-items: center; }
.qa__block { padding-top: 22px; }
.qa__block + .qa__block { border-top: 1px dashed var(--line); margin-top: 22px; }
.qa__label { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-size: 1.1rem; font-weight: 700; margin-bottom: 10px; }
.qa__label .ic { width: 28px; height: 28px; border-radius: 8px; background: var(--violet-soft); color: var(--violet-ink); display: grid; place-items: center; font-size: 14px; font-family: var(--font-body); }
.qa--focus { padding: 40px 46px; }
.qa--focus .qa__q { font-size: clamp(1.7rem, 3vw, 2.25rem); font-weight: 800; }
@media (max-width: 600px) { .qa, .qa--focus { padding: 22px 20px; } }

.answer-reveal { position: relative; }
.answer-cover { width: 100%; padding: 28px; border: 1.5px dashed var(--note-line); background: var(--note); border-radius: var(--radius); cursor: pointer; font: 600 15px var(--font-body); color: var(--ink); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.answer-cover span { font-family: var(--font-head); font-size: 1.15rem; }
.answer-cover small { color: var(--mute); font-weight: 500; }

/* Prose: rendered HTML from the editor (answers, tutorials, pages) */
.prose { font-size: 17px; line-height: 1.75; color: var(--ink-2); overflow-wrap: anywhere; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose h1, .prose h2, .prose h3, .prose h4 { color: var(--ink); margin: 1.6em 0 .5em; }
.prose h2 { font-size: 1.5rem; }
.prose h3 { font-size: 1.25rem; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose table, .prose pre { margin: 0 0 1.1em; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin-bottom: .35em; }
.prose a { text-decoration: underline; text-underline-offset: 3px; }
.prose strong { color: var(--ink); }
.prose blockquote { border-left: 4px solid var(--hl); background: var(--note); padding: 12px 18px; border-radius: 0 10px 10px 0; color: var(--ink); }
.prose img { border-radius: 10px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 9px 12px; text-align: left; }
.prose th { background: var(--surface-2); color: var(--ink); }
.prose :not(pre) > code { background: var(--surface-2); color: var(--violet-ink); padding: 2px 6px; border-radius: 5px; font-size: .88em; }
.prose--pre { white-space: pre-line; }

pre, .code {
    background: var(--code-bg); color: var(--code-ink);
    border-radius: var(--radius); padding: 18px 20px;
    font: 14px/1.7 var(--font-code); overflow-x: auto; tab-size: 4;
}
pre code { background: none !important; color: inherit !important; padding: 0 !important; font-size: inherit !important; }

/* ---------- MCQ / quiz options ---------- */
.opts { display: grid; gap: 10px; margin: 16px 0; padding: 0; list-style: none; }
.opt { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; font-size: 15px; color: var(--ink); transition: border-color .12s, background .12s; }
.opt:hover { border-color: var(--line-strong); }
.opt input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--violet); flex: none; }
.opt__key { flex: none; width: 26px; height: 26px; border-radius: 7px; background: var(--surface-2); display: grid; place-items: center; font-weight: 700; font-size: 13px; color: var(--ink-2); }
.opt:has(input:checked) { border-color: var(--violet); background: var(--violet-soft); }
.opt.is-correct { border-color: var(--easy); background: var(--easy-bg); }
.opt.is-wrong { border-color: var(--hard); background: var(--hard-bg); }
.opt.is-correct .opt__key { background: var(--easy); color: #fff; }
.opt.is-wrong .opt__key { background: var(--hard); color: #fff; }
.feedback { margin-top: 12px; padding: 12px 16px; border-radius: 10px; font-size: 15px; }
.feedback--ok { background: var(--easy-bg); color: var(--easy); }
.feedback--bad { background: var(--hard-bg); color: var(--hard); }

/* Timer */
.timer { font-family: var(--font-head); font-weight: 700; font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.dots { display: flex; gap: 5px; }
.dots i { flex: 1; height: 7px; border-radius: 4px; background: var(--line); }
.dots i.is-done { background: var(--violet); }
.dots i.is-now { background: var(--hl); }

/* ---------- Ad slot ---------- */
.ad-slot { text-align: center; margin: 28px auto; max-width: 100%; overflow: hidden; }
.w3t-ad-unit { display: inline-block; max-width: none; vertical-align: top; }
.ad-slot__label { display: block; font-size: 11px; color: var(--mute); margin-bottom: 6px; letter-spacing: .02em; }
.ad-slot--rail { margin: 0 0 20px; }
.ad-slot img { max-width: 100%; height: auto; border-radius: 8px; }
.ad-band { padding: 20px 0 0; }

/* ---------- Footer ---------- */
.foot { background: var(--surface); border-top: 1px solid var(--line); padding: 56px 0 28px; margin-top: 40px; }
.foot__grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr 1.6fr; gap: 36px; }
.foot h2 { font: 700 14px var(--font-body); margin: 0 0 14px; color: var(--ink); letter-spacing: 0; }
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li { margin-bottom: 9px; }
.foot li a { color: var(--mute); font-size: 14px; }
.foot li a:hover { color: var(--violet); }
.foot__tag { color: var(--mute); font-size: 14px; margin-top: 14px; max-width: 280px; }
.foot__social { display: flex; gap: 8px; margin-top: 16px; }
.foot__social a { width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--line); display: grid; place-items: center; color: var(--ink-2); }
.foot__social a:hover { border-color: var(--ink); color: var(--ink); }
.foot__sub { display: flex; margin-top: 4px; }
.foot__sub input { flex: 1; min-width: 0; height: 42px; border: 1px solid var(--line); border-right: 0; border-radius: 9px 0 0 9px; padding: 0 12px; font: 14px var(--font-body); background: var(--paper); color: var(--ink); }
.foot__sub button { height: 42px; border: 0; border-radius: 0 9px 9px 0; background: var(--ink); color: var(--surface); padding: 0 16px; font: 600 14px var(--font-body); cursor: pointer; }
.foot__bottom { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line); margin-top: 40px; padding-top: 20px; font-size: 13px; color: var(--mute); }
@media (max-width: 991px) { .foot__grid { grid-template-columns: 1fr 1fr; } .foot__grid > :first-child, .foot__grid > :last-child { grid-column: 1 / -1; } }

.to-top { position: fixed; right: 20px; bottom: 20px; width: 44px; height: 44px; border-radius: 12px; background: var(--ink); color: var(--surface); border: 0; display: grid; place-items: center; cursor: pointer; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 90; }
.to-top.is-on { opacity: 1; pointer-events: auto; }

/* Loading state used by topic AJAX */
.is-loading { opacity: .5; pointer-events: none; transition: opacity .15s; }

/* ---------- Auth ---------- */
.auth { min-height: calc(100vh - var(--nav-h)); display: grid; grid-template-columns: 1fr 1fr; }
.auth__side { background: var(--ink); color: #fff; padding: 64px; display: flex; flex-direction: column; justify-content: center; }
.auth__side h2 { color: #fff; font-size: 2.2rem; max-width: 440px; }
.auth__side p { color: #C4C8EA; max-width: 420px; }
.auth__side ul { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 12px; color: #E6E8FF; }
.auth__side li { display: flex; gap: 10px; }
.auth__side li .bi { color: var(--hl); }
.auth__main { display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.auth__card { width: 100%; max-width: 420px; }
.auth__card h1 { font-size: 2rem; }
@media (max-width: 900px) { .auth { grid-template-columns: 1fr; } .auth__side { display: none; } }

/* =====================================================================
   Home
   ===================================================================== */
.hero { background: var(--surface); border-bottom: 1px solid var(--line); padding: 64px 0 76px; overflow: hidden; }
.hero__in { display: grid; grid-template-columns: minmax(0, 1fr) 520px; gap: 64px; align-items: center; }
.hero__title { font-size: clamp(2.4rem, 5vw, 3.75rem); line-height: 1.05; font-weight: 800; max-width: 620px; margin-bottom: 20px; }
.hero__lead { font-size: 1.2rem; color: var(--ink-2); max-width: 540px; margin-bottom: 30px; }
.hero__chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 22px; font-size: 14px; color: var(--mute); }
.chip { border: 1px solid var(--line); border-radius: 20px; padding: 5px 13px; color: var(--ink-2); background: var(--paper); font-weight: 500; font-size: 14px; }
.chip:hover { border-color: var(--ink); color: var(--ink); }
.hero__facts { display: flex; gap: 40px; margin: 40px 0 0; flex-wrap: wrap; }
.hero__facts div { display: flex; flex-direction: column-reverse; }
.hero__facts dt { color: var(--mute); font-size: 14px; }
.hero__facts dd { margin: 0; font-family: var(--font-head); font-size: 1.75rem; font-weight: 700; line-height: 1.2; }

.deck { position: relative; padding: 18px 34px 34px 0; }
.deck__back { position: absolute; border-radius: var(--radius-lg); border: 1.5px solid; }
.deck__back--2 { inset: 46px 0 6px 40px; transform: rotate(4deg); background: var(--violet-soft); border-color: #CFC3FA; }
.deck__back--1 { inset: 32px 14px 20px 22px; transform: rotate(-2.5deg); background: #FFF8D6; border-color: var(--note-line); }
[data-theme="dark"] .deck__back--2 { border-color: var(--line-strong); }
[data-theme="dark"] .deck__back--1 { background: var(--note); }
.deck__card { position: relative; background: var(--surface); border: 1.5px solid var(--ink); border-radius: var(--radius-lg); padding: 30px 32px 28px; box-shadow: 8px 10px 0 var(--ink); }
[data-theme="dark"] .deck__card { box-shadow: 8px 10px 0 #000; border-color: var(--line-strong); }
.deck__tag { position: absolute; top: -14px; right: 28px; background: var(--hl); color: #1A1D3A; border: 1.5px solid var(--ink); border-radius: 20px; padding: 3px 12px; font-size: 13px; font-weight: 700; transform: rotate(3deg); }
.deck__meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13px; color: var(--mute); }
.deck__q { font-size: 1.5rem; line-height: 1.25; margin: 14px 0 18px; }
.deck__answer { border-top: 1px dashed var(--line); padding-top: 16px; font-size: 15px; color: var(--ink-2); }
.deck__answer p { margin: 0; }
.deck__label { font-size: 13px; font-weight: 600; color: var(--violet); margin-bottom: 6px; }
.deck__acts { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }

.picker { display: grid; grid-template-columns: 280px minmax(0, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; box-shadow: 0 12px 36px rgba(25, 30, 65, .06); }
.picker__list { border-right: 1px solid var(--line); padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; background: var(--paper); }
.picker__list button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 10px; border: 0; background: transparent; color: var(--ink-2); font: 500 14px/1.3 var(--font-body); text-align: left; cursor: pointer; transition: background .15s, color .15s; }
.picker__list button span { flex: 1; }
.picker__list button .bi { width: 16px; color: var(--mute); }
.picker__list button small { display: grid; min-width: 25px; height: 25px; place-items: center; border-radius: 7px; background: var(--surface); color: var(--mute); font-size: 12px; }
.picker__list button:hover { background: var(--surface-2); color: var(--ink); }
.picker__list button.is-on { background: var(--violet-soft); color: var(--violet); font-weight: 650; }
.picker__list button.is-on .bi { color: var(--violet); }
.picker__list button.is-on small { background: var(--surface); color: var(--violet); }
.picker__list button:focus-visible, .tile--technology:focus-visible { outline: 3px solid var(--violet); outline-offset: 2px; }
.picker__pane { min-width: 0; padding: 30px; }
.picker__pane .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.picker__pane .tile--technology { border-radius: 13px; }
.picker__pane .tile--technology:hover { box-shadow: 0 8px 20px rgba(25, 30, 65, .08); }
.picker__top { margin-bottom: 20px; }
.picker__top h3 { font-size: 1.55rem; margin-bottom: 7px; }
.picker__top p { margin: 0; max-width: 640px; }
@media (max-width: 1100px) { .picker__pane .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
    .picker { grid-template-columns: 1fr; }
    .picker__list { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
    .picker__list button { width: auto; white-space: nowrap; }
    .picker__list button small, .picker__list button .bi { display: none; }
    .picker__pane { padding: 22px 18px; }
}
@media (max-width: 600px) { .picker__pane .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
@media (max-width: 420px) { .picker__pane .tiles { grid-template-columns: 1fr; } }

.ladder { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; }
.ladder__step { border: 1.5px solid var(--ink); background: var(--surface); padding: 28px; margin-right: -1.5px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.ladder__step:nth-child(1) { min-height: 210px; border-radius: var(--radius-lg) 0 0 var(--radius-lg); }
.ladder__step:nth-child(2) { min-height: 240px; }
.ladder__step--top { min-height: 270px; border-radius: 0 var(--radius-lg) var(--radius-lg) 0; background: var(--ink); color: #fff; margin-right: 0; }
[data-theme="dark"] .ladder__step { border-color: var(--line-strong); }
[data-theme="dark"] .ladder__step--top { background: #0E1024; }
.ladder__step h3 { margin: 4px 0 0; font-size: 1.4rem; }
.ladder__step p { color: var(--ink-2); font-size: 15px; margin: 0; }
.ladder__step .link-arrow { margin-top: auto; }
.ladder__step--top h3 { color: #fff; }
.ladder__step--top p { color: #C4C8EA; }
.ladder__step--top .link-arrow { color: var(--hl); }
.ladder__n { font-family: var(--font-head); font-size: 14px; color: var(--mute); }
.ladder__step--top .ladder__n { color: #9EA3CF; }
@media (max-width: 860px) {
    .ladder { grid-template-columns: 1fr; gap: 12px; }
    .ladder__step, .ladder__step--top { min-height: 0 !important; border-radius: var(--radius-lg) !important; margin: 0; }
}

.mockband { background: var(--ink); color: #fff; border-radius: 24px; padding: 56px 60px; display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 56px; align-items: center; }
[data-theme="dark"] .mockband { background: #0E1024; border: 1px solid var(--line); }
.mockband h2 { color: #fff; font-size: clamp(1.9rem, 3.5vw, 2.6rem); }
.mockband p { color: #C4C8EA; font-size: 1.1rem; margin: 16px 0 28px; max-width: 520px; }
.mockband__ghost { border-color: #5B5F89; color: #fff; }
.mockband__ghost:hover { border-color: #fff; color: #fff; }
.question-topic-cta { height: auto; min-height: 42px; padding: 9px 12px; line-height: 1.35; white-space: normal; text-align: center; overflow-wrap: break-word; }
.mockband__timer { background: #252950; border: 1px solid #3A3F70; border-radius: var(--radius-lg); padding: 26px; }
.mockband__clock { font-family: var(--font-head); font-size: 3.4rem; font-weight: 700; color: var(--hl); line-height: 1; font-variant-numeric: tabular-nums; }
.mockband__sub { color: #9EA3CF; font-size: 14px; margin: 8px 0 18px; }
.mockband .dots i { background: #3A3F70; }
.mockband .dots i.is-done { background: #8F72FF; }
.mockband .dots i.is-now { background: var(--hl); }
.mockband__q { color: #E6E8FF !important; font-size: 15px !important; margin: 18px 0 0 !important; }

@media (max-width: 991px) {
    .hero__in, .mockband { grid-template-columns: 1fr; }
    .hero { padding: 40px 0 56px; }
    .mockband { padding: 36px 28px; }
    .deck { max-width: 560px; }
}

/* =====================================================================
   Listing pages (Fields, Categories, Search)
   ===================================================================== */
.toolbar { display: grid; grid-template-columns: minmax(0, 1fr) 200px 150px; gap: 12px; margin-bottom: 16px; }
.toolbar__search { position: relative; }
.toolbar__search .bi { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--mute); }
.toolbar__search .input { padding-left: 40px; }
@media (max-width: 700px) { .toolbar { grid-template-columns: 1fr 1fr; } .toolbar__search { grid-column: 1 / -1; } }
.tile--field { padding: 22px; }

/* Question cards (category page, topic lists) */
.topic-block { margin-bottom: 44px; }
.qcards { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: q; }
.qcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px 16px 56px; position: relative; counter-increment: q; }
.qcard::before { content: counter(q); position: absolute; left: 18px; top: 16px; width: 26px; height: 26px; border-radius: 7px; background: var(--surface-2); color: var(--ink-2); font: 700 13px/26px var(--font-body); text-align: center; }
.qcard:hover { border-color: var(--line-strong); }
.qcard__top { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; }
.qcard__q { font-weight: 600; color: var(--ink); font-size: 16px; }
.qcard__q:hover { color: var(--violet); }
.qcard__a { color: var(--mute); font-size: 14px; margin: 6px 0 0; }

/* =====================================================================
   Topic pages
   ===================================================================== */
.topic-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 28px 30px; margin-bottom: 20px; }
.topic-head h1 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin-bottom: 8px; }
.topic-head .lead { font-size: 1rem; margin-bottom: 4px; }
.qfilter { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.qfilter .toolbar__search { flex: 1; min-width: 200px; }
.qfilter .select { width: auto; }
.seg label { position: relative; padding: 0; }
.seg label span { display: block; padding: 7px 14px; border-radius: 8px; }
.seg input:focus-visible + span { outline: 3px solid var(--violet); outline-offset: 1px; }

/* Previous / next */
.prevnext { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); }
.prevnext a { display: flex; flex-direction: column; gap: 4px; color: var(--ink); }
.prevnext a:hover span { color: var(--violet); }
.prevnext small { color: var(--mute); font-size: 13px; }
.prevnext span { font-weight: 600; }
.prevnext__next { text-align: right; align-items: flex-end; }
@media (max-width: 600px) { .prevnext { grid-template-columns: 1fr; } .prevnext__next { text-align: left; align-items: flex-start; } }
.mb-1.btn { margin-bottom: 8px; }

/* Score bar (MCQ practice, quizzes) */
.scorebar { position: sticky; top: calc(var(--nav-h) + 10px); z-index: 20; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 20px; box-shadow: 0 6px 18px rgba(26, 29, 58, .06); }
.scorebar__nums { display: flex; gap: 20px; font-size: 14px; color: var(--mute); }
.scorebar__nums b { font-family: var(--font-head); font-size: 1.15rem; color: var(--ink); margin-right: 3px; }
.scorebar__nums b.ok { color: var(--easy); }
.scorebar__nums b.bad { color: var(--hard); }
.scorebar__bar { display: flex; height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; margin-top: 10px; }
.scorebar__bar i { display: block; height: 100%; width: 0; transition: width .3s; }
.scorebar__bar i.ok { background: var(--easy); }
.scorebar__bar i.bad { background: var(--hard); }
button.opt { width: 100%; text-align: left; font-family: var(--font-body); }
button.opt[disabled] { cursor: default; }

/* Search */
mark { background: var(--hl); color: #1A1D3A; padding: 0 2px; border-radius: 3px; }
.srch-top { margin-bottom: 36px; }
.chip .count { margin-left: 4px; }

/* Quizzes */
.quiz-tile { gap: 12px; }
.quiz-tile:hover { transform: none; border-color: var(--line-strong); }
.quiz-tile__facts { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--mute); margin-top: auto; }
.quiz-tile__facts .bi { margin-right: 4px; }
.quiz-intro { background: var(--surface); border: 1.5px solid var(--ink); border-radius: var(--radius-lg); box-shadow: var(--hard-shadow); padding: 36px 40px 32px; text-align: center; }
[data-theme="dark"] .quiz-intro { border-color: var(--line-strong); }
.quiz-intro__top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.quiz-intro h1 { font-size: clamp(1.8rem, 3.5vw, 2.4rem); }
.quiz-intro__facts { display: flex; justify-content: center; gap: 40px; margin: 0 0 28px; padding: 18px 0; border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); flex-wrap: wrap; }
.quiz-intro__facts div { display: flex; flex-direction: column-reverse; }
.quiz-intro__facts dt { color: var(--mute); font-size: 13px; }
.quiz-intro__facts dd { margin: 0; font-family: var(--font-head); font-size: 1.5rem; font-weight: 700; }
.opt.active { border-color: var(--violet); background: var(--violet-soft); }
.opt.active .opt__key { background: var(--violet); color: #fff; }
.timer--low { color: var(--hard); }
.result-score { font-family: var(--font-head); font-size: 4rem; font-weight: 800; line-height: 1; margin: 6px 0 10px; }

/* Mock interview */
.mock-setup { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 56px; align-items: start; padding-top: 12px; }
.mock-setup__intro h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
.mock-steps { margin: 28px 0 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 14px; }
.mock-steps li { counter-increment: s; position: relative; padding-left: 46px; color: var(--ink-2); }
.mock-steps li::before { content: counter(s); position: absolute; left: 0; top: -2px; width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--ink); display: grid; place-items: center; font: 700 14px var(--font-head); color: var(--ink); }
.mock-steps b { color: var(--ink); }
.mock-setup__form { box-shadow: var(--hard-shadow); }
@media (max-width: 900px) { .mock-setup { grid-template-columns: 1fr; gap: 32px; } }
.mi-status { position: sticky; top: calc(var(--nav-h) + 10px); z-index: 20; display: flex; justify-content: space-between; align-items: center; gap: 16px; background: var(--ink); color: #fff; border-radius: var(--radius); padding: 14px 20px; margin-bottom: 20px; }
[data-theme="dark"] .mi-status { background: #0E1024; border: 1px solid var(--line); }
.mi-status__meta { font-size: 13px; color: #A9AED6; }
.mi-status .timer { color: var(--hl); }
.mi-rate-box { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.mi-rate { border: 1.5px solid var(--line); background: var(--surface); }
.mi-rate--ok:hover { border-color: var(--easy); background: var(--easy-bg); color: var(--easy); }
.mi-rate--mid:hover { border-color: var(--mid); background: var(--mid-bg); color: var(--mid); }
.mi-rate--bad:hover { border-color: var(--hard); background: var(--hard-bg); color: var(--hard); }
.report-list { list-style: none; margin: 0; padding: 0; counter-reset: r; }
.report-list li { counter-increment: r; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 14px 22px 14px 58px; border-top: 1px solid var(--line); position: relative; }
.report-list li:first-child { border-top: 0; }
.report-list li::before { content: counter(r); position: absolute; left: 22px; top: 14px; width: 24px; height: 24px; border-radius: 6px; background: var(--surface-2); font: 700 12px/24px var(--font-body); text-align: center; color: var(--ink-2); }
.validation-summary-errors.alert { display: block; }

/* =====================================================================
   Account area (bookmarks, dashboard)
   ===================================================================== */
.rows { list-style: none; margin: 0; padding: 0; }
.rows > li { display: flex; align-items: center; gap: 14px; padding: 14px 22px; border-top: 1px solid var(--line); }
.rows > li:first-child { border-top: 0; }
.rows__main { flex: 1; min-width: 0; }
.rows__title { display: block; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rows__title:hover { color: var(--violet); }
.rows__sub { font-size: 13px; color: var(--mute); }
.rows__end { flex: none; text-align: right; display: flex; align-items: center; gap: 10px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 24px; }
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.dash { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 24px; align-items: start; }
@media (max-width: 991px) { .dash { grid-template-columns: 1fr; } }
.panel__empty { padding: 22px; color: var(--mute); font-size: 15px; }

/* =====================================================================
   SEO content blocks (how-to steps, answer anatomy, key facts, bylines)
   ===================================================================== */
.howto { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; counter-reset: h; }
.howto li { counter-increment: h; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 58px 22px 22px; position: relative; display: flex; flex-direction: column; gap: 8px; }
.howto li::before { content: counter(h); position: absolute; top: 18px; left: 22px; width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--ink); display: grid; place-items: center; font: 700 14px var(--font-head); color: var(--ink); }
.howto h3 { font-size: 1.1rem; margin: 0; }
.howto p { font-size: 15px; color: var(--ink-2); margin: 0; }
.howto .link-arrow { margin-top: auto; font-size: 14px; }
@media (max-width: 991px) { .howto { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .howto { grid-template-columns: 1fr; } }
.anatomy { margin-top: 28px; background: var(--note); border: 1.5px solid var(--note-line); border-radius: var(--radius-lg); padding: 26px 28px; }
.anatomy h3 { font-size: 1.2rem; margin-bottom: 16px; }
.anatomy dl { margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.anatomy dt { font-weight: 700; color: var(--ink); display: flex; gap: 8px; align-items: center; margin-bottom: 4px; }
.anatomy dt .bi { color: var(--violet); }
.anatomy dd { margin: 0; font-size: 14px; color: var(--ink-2); }
@media (max-width: 991px) { .anatomy dl { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .anatomy dl { grid-template-columns: 1fr; } }

.short-answer { border-left: 4px solid var(--violet); background: var(--violet-soft); border-radius: 0 var(--radius) var(--radius) 0; padding: 16px 20px; margin: 4px 0 6px; }
.short-answer__label { font-size: 13px; font-weight: 700; color: var(--violet-ink); margin-bottom: 4px; }
.short-answer p { margin: 0; color: var(--ink); font-size: 17px; line-height: 1.6; }
.byline { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 14px; color: var(--mute); }
.byline .bi { margin-right: 4px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 0; }
.facts div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.facts dt { font-size: 13px; color: var(--mute); }
.facts dd { margin: 2px 0 0; font-family: var(--font-head); font-weight: 700; font-size: 1.25rem; color: var(--ink); }
.related { margin-top: 28px; }
.related h2 { font-size: 1.2rem; margin-bottom: 10px; }

/* Home: compact lists and hero card */
.deck__q { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; font-size: 1.35rem; }
.qlist--compact .qlist__head, .qlist--compact .qlist__row { grid-template-columns: minmax(0, 1fr) 220px 120px 100px; padding-top: 12px; padding-bottom: 12px; }
.qlist--compact .qlist__q { font-size: 15px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.qlist--compact .qlist__head { padding-top: 10px; padding-bottom: 10px; }
.popular-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 16px; font-size: 14px; color: var(--mute); }
.ad-band-home { padding: 8px 0 0; }
.ad-band-home .ad-slot { margin: 0 auto; }

/* =====================================================================
   Mobile hardening + list fields (tags, follow-ups) + code blocks
   ===================================================================== */
/* Nothing may widen the page beyond the screen (a single long word or tag used to
   make phones zoom out the whole page). clip keeps position: sticky working. */
html, body { overflow-x: clip; max-width: 100%; }
.qa, .prose, .panel, .tile, .qcard, .faq__a { overflow-wrap: anywhere; min-width: 0; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags .pill, .tags .chip { white-space: normal; max-width: 100%; line-height: 1.35; text-align: left; }

.followups { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.followups li { position: relative; padding: 10px 14px 10px 36px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--ink-2); font-size: 15.5px; line-height: 1.5; }
.followups li::before { content: "\F135"; font-family: "bootstrap-icons"; position: absolute; left: 12px; top: 10px; color: var(--violet); font-size: 14px; }

/* Highlighter wrapper (bar + pre) reads as one block */
.w3t-code-block { margin: 12px 0 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--code-bg); }
.w3t-code-block pre, .w3t-code-block .qa-code { margin: 0 !important; border-radius: 0 !important; border: 0; }
.w3t-code-bar { background: rgba(255, 255, 255, .04); border-bottom: 1px solid rgba(255, 255, 255, .08); }

@media (max-width: 600px) {
    .page { padding: 24px 0 56px; }
    .wrap { padding: 0 16px; }
    .qa, .qa--focus { padding: 20px 16px; border-radius: var(--radius); }
    .qa__q { font-size: 1.3rem; }
    .qa--focus .qa__q { font-size: 1.6rem; }
    .qa__label { font-size: 1rem; }
    .prose { font-size: 16px; line-height: 1.7; }
    pre, .code { font-size: 13px; padding: 14px; }
    .topic-head { padding: 20px 16px; }
    .topic-head .btn { width: 100%; }
    .qfilter .select, .qfilter .btn { flex: 1; }
    .qfilter .seg { width: 100%; }
    .qfilter .seg label { flex: 1; text-align: center; }
    .page-head { padding: 24px 0; }
    .page-head__stats { gap: 18px; }
    .sec-head { margin-bottom: 18px; }
    .three-col, .with-side, .with-rail { gap: 20px; }
    .sidenav { padding: 12px; }
    .short-answer { padding: 14px 16px; }
    .short-answer p { font-size: 16px; }
    .byline { font-size: 13px; }
    .prevnext { margin-top: 22px; }
    .to-top { right: 14px; bottom: 14px; width: 40px; height: 40px; }
}
/* Phones/tablets: main content first, side navigation after it */
@media (max-width: 991px) {
    .with-side > aside:first-child, .three-col > aside:first-child { order: 2; }
    .three-col > .rail { order: 3; }
}

/* Plain (non-code) example under an answer */
.example-box { background: var(--note); border: 1px solid var(--note-line); border-left: 4px solid var(--hl); border-radius: var(--radius-sm); padding: 12px 16px; }
.example-box__label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--mid); margin-bottom: 4px; }
.example-box p { margin: 0; color: var(--ink); font-size: 16px; line-height: 1.6; }
