/* =====================================================================================
   CertNode (HCIA Big Data study site)
   ===================================================================================== */
:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f0f3f9;
  --text: #17202e;
  --muted: #5b6577;
  --line: #dde3ee;
  --accent: #1f4fd8;
  --accent-2: #e8eefc;
  --accent-text: #ffffff;
  --good: #137a3a;
  --good-bg: #e3f6ea;
  --ok: #9a6700;
  --ok-bg: #fff4d6;
  --bad: #c42b1c;
  --bad-bg: #fde8e6;
  --info-bg: #e6f0ff;
  --code-bg: #1c2333;
  --code-fg: #e6edf3;
  --code-com: #8bc48a;
  --out-bg: #f3f5f8;
  --l1: #137a3a; --l2: #9a6700; --l3: #c42b1c; --l4: #7a3fd1;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 2px 8px rgba(16, 24, 40, .05);
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e131c; --surface: #161d29; --surface-2: #1d2635; --text: #e5eaf2; --muted: #9aa5b8; --line: #2a3446;
    --accent: #6d95ff; --accent-2: #1d2a47; --accent-text: #0b1020;
    --good: #4fc27a; --good-bg: #12301f; --ok: #e0b13f; --ok-bg: #33290f; --bad: #ff7b6e; --bad-bg: #3a1714; --info-bg: #15243f;
    --code-bg: #0b0f17; --out-bg: #121925;
    --l1: #4fc27a; --l2: #e0b13f; --l3: #ff7b6e; --l4: #b48cff;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e131c; --surface: #161d29; --surface-2: #1d2635; --text: #e5eaf2; --muted: #9aa5b8; --line: #2a3446;
  --accent: #6d95ff; --accent-2: #1d2a47; --accent-text: #0b1020;
  --good: #4fc27a; --good-bg: #12301f; --ok: #e0b13f; --ok-bg: #33290f; --bad: #ff7b6e; --bad-bg: #3a1714; --info-bg: #15243f;
  --code-bg: #0b0f17; --out-bg: #121925;
  --l1: #4fc27a; --l2: #e0b13f; --l3: #ff7b6e; --l4: #b48cff;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--font); min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .6em; }
h1 { font-size: 1.75rem; letter-spacing: -.01em; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .8em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.2em 0; }
img { max-width: 100%; height: auto; }
code { font-family: var(--mono); font-size: .88em; background: var(--surface-2); border: 1px solid var(--line); padding: .05em .35em; border-radius: 5px; word-break: break-word; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.good { color: var(--good); } .ok { color: var(--ok); } .bad { color: var(--bad); }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; font-weight: 700; color: var(--accent); margin-bottom: .4em; }
.lead { font-size: 1.12rem; color: var(--muted); }
.row { display: flex; align-items: center; }
.row.gap { gap: .6rem; } .row.between { justify-content: space-between; gap: .6rem; } .row.wrap { flex-wrap: wrap; }
.w30 { width: 30%; } .w40 { width: 40%; }

/* ---------------------------------------------------------------- top bar */
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1200px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 1.02rem; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-name { font-size: 1.2rem; font-weight: 700; letter-spacing: -.01em; }
.brand-name b { background: linear-gradient(90deg, var(--accent), #9b5cff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav a { color: var(--muted); padding: 6px 10px; border-radius: 8px; font-weight: 500; }
.nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav a.active { color: var(--accent); background: var(--accent-2); }
.nav a.btn-primary { color: var(--accent-text); margin-left: 6px; }
.nav-user { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border: 1px solid var(--line); }
.topbar-actions { display: flex; gap: 6px; }
.nav-logout { font: inherit; font-weight: 500; color: var(--muted); background: none; border: 1px solid transparent; padding: 6px 10px; border-radius: 8px; cursor: pointer; }
.nav-logout:hover { color: var(--bad); background: var(--bad-bg); }
@media (max-width: 860px) { .nav-logout { text-align: left; padding: 10px 12px; } }
.icon-btn { background: none; border: 1px solid var(--line); color: var(--text); width: 36px; height: 36px; border-radius: 8px; cursor: pointer; font-size: 1.05rem; }
.icon-btn:hover { background: var(--surface-2); }
.menu-btn { display: none; }
.demo-banner { background: var(--ok-bg); color: var(--text); border-bottom: 1px solid var(--line); padding: 8px 16px; text-align: center; font-size: .9rem; }

@media (max-width: 860px) {
  .menu-btn { display: inline-block; }
  .brand .brand-name { font-size: 1.1rem; }
  .nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; background: var(--surface); border-bottom: 1px solid var(--line); padding: 8px 16px 14px; box-shadow: var(--shadow); }
  .menu-open .nav { display: flex; }
  .nav a { padding: 10px 12px; }
  .nav a.btn-primary { margin: 6px 0 0; text-align: center; }
  .topbar-actions { margin-left: auto; }
  .nav-user { max-width: none; }
}

/* ---------------------------------------------------------------- layout */
.main { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 24px 16px 48px; outline: none; }
.footer { text-align: center; color: var(--muted); font-size: .82rem; padding: 18px 16px 26px; border-top: 1px solid var(--line); }
.loading { padding: 60px 0; text-align: center; color: var(--muted); }
.noscript { text-align: center; padding: 20px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; min-width: 0; }
.card.narrow { max-width: 560px; margin: 40px auto; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid2 > .card { margin-bottom: 0; }
.grid2 + .card, .grid2 + .grid2, .card + .grid2 { margin-top: 16px; }
@media (max-width: 860px) { .grid2 { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- buttons & forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.2; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn-primary:hover { background: var(--accent); filter: brightness(1.08); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--accent); }
.btn-ghost:hover { background: var(--accent-2); }
.btn-danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.btn-danger:hover { background: var(--bad-bg); }
.btn-sm { padding: 5px 10px; font-size: .85rem; }
.btn-lg { padding: 12px 22px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.form { display: grid; gap: 14px; margin-bottom: 12px; }
label { display: grid; gap: 5px; font-weight: 600; font-size: .92rem; }
input[type=text], input[type=email], input[type=password], input[type=search], input:not([type]), select {
  font: inherit; font-weight: 400; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; width: 100%; min-width: 0; }
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-2); }
input:disabled { background: var(--surface-2); color: var(--muted); }
.form-msg { border-radius: 9px; padding: 10px 12px; margin-bottom: 12px; font-size: .92rem; }
.msg-bad { background: var(--bad-bg); color: var(--bad); }
.msg-good { background: var(--good-bg); color: var(--good); }
.msg-info { background: var(--info-bg); color: var(--text); }
.check { display: inline-flex; flex-direction: row; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

/* ---------------------------------------------------------------- chips, pills, levels, bars */
.chip { display: inline-block; font-size: .78rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }
.chip-soft { background: transparent; }
.pill { display: inline-block; font-size: .72rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--accent-2); color: var(--accent); text-transform: uppercase; letter-spacing: .03em; }
.pill-good { background: var(--good-bg); color: var(--good); }
.pill-bad { background: var(--bad-bg); color: var(--bad); }
.lvl { display: inline-block; font-size: .75rem; font-weight: 700; padding: 1px 9px; border-radius: 999px; border: 1px solid currentColor; white-space: nowrap; }
.lvl-1 { color: var(--l1); } .lvl-2 { color: var(--l2); } .lvl-3 { color: var(--l3); } .lvl-4 { color: var(--l4); }
.bar { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); min-width: 60px; }
.bar span { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .4s; }
.bar-thin { height: 5px; }
.topic-chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------------------------------------------------------------- landing */
.hero { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 32px; align-items: center; padding: 24px 0 36px; }
.hero h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); }
.hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 26px; }
.hero-stats div { display: grid; }
.hero-stats b { font-size: 1.9rem; color: var(--accent); line-height: 1.1; }
.hero-stats span { color: var(--muted); font-size: .9rem; }
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.features .card { margin: 0; }
.features p { color: var(--muted); margin: 0; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; } .features { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- motion & new landing */
@keyframes float { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(18px, -22px) scale(1.06); } }
@keyframes pulse { 0%, 100% { opacity: .35; transform: scale(1); } 50% { opacity: .9; transform: scale(1.18); } }
@keyframes shine { to { background-position: 200% center; } }
@keyframes dash { to { stroke-dashoffset: -40; } }

[data-reveal] { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); transition-delay: var(--d, 0ms); }
[data-reveal].shown { opacity: 1; transform: none; }

.hero-x { position: relative; isolation: isolate; padding: 48px 0 56px; min-height: 460px; }
html, body { overflow-x: clip; }        /* the full-width hero glow must never cause sideways scrolling */
.hero-bg { position: absolute; top: -24px; bottom: 0; left: 50%; width: 100vw; transform: translateX(-50%); z-index: -1; overflow: hidden; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .45; animation: float 14s ease-in-out infinite; }
.b1 { width: 420px; height: 420px; background: var(--accent); top: -140px; left: 8%; }
.b2 { width: 360px; height: 360px; background: #9b5cff; top: 40px; right: 6%; animation-delay: -5s; }
.b3 { width: 260px; height: 260px; background: #18c3b8; bottom: -90px; left: 45%; animation-delay: -9s; opacity: .3; }
.grid-lines { position: absolute; inset: 0; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 44px 44px; mask-image: radial-gradient(ellipse at 50% 30%, #000 10%, transparent 70%); -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 10%, transparent 70%); opacity: .55; }
.hero-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 70%, transparent); font-size: .85rem; font-weight: 600; color: var(--muted); backdrop-filter: blur(6px); }
.hero-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 4px color-mix(in srgb, var(--good) 25%, transparent); animation: pulse 2.2s infinite; }
.hero-title { font-size: clamp(2.2rem, 5.4vw, 3.6rem) !important; letter-spacing: -.025em; margin: .45em 0 .4em; }
.grad { background: linear-gradient(90deg, var(--accent), #9b5cff, #18c3b8, var(--accent)); background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shine 6s linear infinite; }
.byline { margin-top: 14px; color: var(--muted); }
.btn-arrow { border-radius: 999px; padding-right: 8px; gap: 12px; box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 35%, transparent); transition: transform .2s, box-shadow .2s; }
.btn-arrow:hover { transform: translateY(-2px); box-shadow: 0 12px 30px color-mix(in srgb, var(--accent) 45%, transparent); }
.arrow-dot { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-text); color: var(--accent); transition: transform .25s; }
.arrow-dot svg { width: 16px; height: 16px; }
.btn-arrow:hover .arrow-dot { transform: rotate(45deg); }
.btn-glass { border-radius: 999px; background: color-mix(in srgb, var(--surface) 60%, transparent); backdrop-filter: blur(6px); }

.hero-art { display: grid; place-items: center; }
.cluster { width: 100%; max-width: 440px; overflow: visible; }
.c-link { stroke: color-mix(in srgb, var(--accent) 45%, var(--line)); stroke-width: 2; stroke-dasharray: 6 6; animation: dash 3s linear infinite; fill: none; }
.c-packet { fill: #18c3b8; filter: drop-shadow(0 0 4px #18c3b8); }
.c-halo { fill: var(--accent); opacity: .18; transform-box: fill-box; transform-origin: center; animation: pulse 3s ease-in-out infinite; animation-delay: calc(var(--i) * -.4s); }
.c-badge rect { fill: var(--surface); stroke: color-mix(in srgb, var(--accent) 60%, var(--line)); stroke-width: 2; filter: drop-shadow(0 10px 24px rgba(0, 0, 0, .18)); }
.c-badge text { fill: var(--text); font: 800 22px var(--font); letter-spacing: .04em; }
.c-badge text.sub { font: 600 11px var(--font); fill: var(--muted); letter-spacing: .02em; }
.c-badge { animation: float 7s ease-in-out infinite; transform-box: fill-box; }

.stats-band { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 22px; border-radius: 18px; border: 1px solid var(--line);
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, var(--surface)), var(--surface)); margin-bottom: 48px; text-align: center; }
.stats-band b { display: block; font-size: clamp(1.6rem, 3.4vw, 2.3rem); line-height: 1.1; color: var(--accent); font-variant-numeric: tabular-nums; }
.stats-band span { color: var(--muted); font-size: .9rem; }
.section-x { margin-bottom: 56px; }
.eyebrow.center, .section-title { text-align: center; }
.section-title { font-size: clamp(1.5rem, 3vw, 2.1rem); margin-bottom: 1.1em; letter-spacing: -.015em; }
.feat { transition: transform .25s, border-color .25s, box-shadow .25s; }
.feat:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); box-shadow: 0 14px 30px rgba(16, 24, 40, .12); }
.feat-ico { display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: var(--accent-2); font-size: 1.4rem; margin-bottom: 10px; }

/* tracks */
.track-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.track-grid .card { margin: 0; }
.track-card { --tc: var(--accent); position: relative; overflow: hidden; color: var(--text); display: flex; flex-direction: column; gap: 6px; padding: 24px;
  transition: transform .25s, box-shadow .25s, border-color .25s; }
.track-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: linear-gradient(90deg, var(--tc), #9b5cff); }
.track-card:hover { text-decoration: none; transform: translateY(-5px); border-color: color-mix(in srgb, var(--tc) 55%, var(--line)); box-shadow: 0 18px 36px color-mix(in srgb, var(--tc) 22%, transparent); }
.track-card h3 { margin: 6px 0 0; font-size: 1.25rem; }
.track-card p { margin: 0; flex: 1; }
.track-ico { display: inline-grid; place-items: center; width: 60px; height: 60px; border-radius: 16px; color: var(--tc, var(--accent));
  background: color-mix(in srgb, var(--tc, var(--accent)) 14%, var(--surface)); font-size: 1.8rem; font-weight: 700; }
.track-ico svg { width: 38px; height: 38px; }
.track-ico.big { width: 76px; height: 76px; border-radius: 20px; flex: none; }
.track-ico.big svg { width: 48px; height: 48px; }
.track-card:hover .track-ico svg { animation: float 2.4s ease-in-out infinite; }
.ico-pulse { transform-box: fill-box; transform-origin: center; animation: pulse 2.4s ease-in-out infinite; }
.ico-pulse.d2 { animation-delay: -.8s; } .ico-pulse.d3 { animation-delay: -1.6s; }
.track-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.track-card .go { position: absolute; top: 20px; right: 20px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--line); color: var(--tc); transition: transform .25s, background .25s, color .25s; }
.track-card .go svg { width: 16px; height: 16px; }
.track-card:hover .go { background: var(--tc); color: #fff; transform: rotate(45deg); }
.track-card.soon { border-style: dashed; box-shadow: none; background: transparent; align-items: flex-start; }
.track-card.soon::before { display: none; }
.track-card.soon .track-ico { color: var(--muted); background: var(--surface-2); }
.center { text-align: center; }
.chooser { max-width: 980px; margin: 0 auto; padding-top: 12px; }
.chooser h1 { font-size: clamp(1.6rem, 3.6vw, 2.3rem); letter-spacing: -.015em; }
.steps { display: flex; justify-content: center; gap: 8px; list-style: none; padding: 0; margin: 0 0 22px; flex-wrap: wrap; }
.steps li { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-weight: 600; font-size: .9rem; }
.steps li span { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); font-size: .8rem; }
.steps li.on { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); background: var(--accent-2); }
.steps li.on span { background: var(--accent); color: var(--accent-text); }
.chooser-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.track-card.pick { align-items: center; text-align: center; padding: 34px 26px 28px; }
.track-card.pick .track-ico.big { width: 108px; height: 108px; border-radius: 30px; margin-bottom: 6px; box-shadow: 0 16px 34px color-mix(in srgb, var(--tc) 25%, transparent); }
.track-card.pick .track-ico.big svg { width: 66px; height: 66px; }
.track-card.pick .track-meta { justify-content: center; }
.pick-cta { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; padding: 10px 18px; border-radius: 999px; background: var(--tc); color: #fff; font-weight: 700; transition: gap .2s; }
.pick-cta svg { width: 16px; height: 16px; }
.track-card.pick:hover .pick-cta { gap: 14px; }
.track-card.pick .go { display: none; }
.track-head { --tc: var(--accent); display: flex; align-items: center; gap: 18px; margin-bottom: 18px; }
.track-head h1 { margin: 0 0 .2em; }
.track-head p { margin: 0; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .88rem; margin-bottom: 14px; color: var(--muted); }
.crumbs a { font-weight: 600; }
.crumbs .sep { opacity: .6; }
.crumbs [aria-current] { color: var(--text); font-weight: 600; }
.tbadge { --h: 222; display: inline-grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 11px; font-weight: 800; font-size: .85rem; letter-spacing: .02em;
  color: hsl(var(--h) 70% 45%); background: hsl(var(--h) 85% 94%); }
:root[data-theme="dark"] .tbadge { color: hsl(var(--h) 90% 75%); background: hsl(var(--h) 45% 20%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tbadge { color: hsl(var(--h) 90% 75%); background: hsl(var(--h) 45% 20%); } }
.topic-card { transition: transform .2s, border-color .2s, box-shadow .2s; }
.topic-card:hover { box-shadow: 0 12px 26px rgba(16, 24, 40, .12); }

/* author */
.avatar { --s: 44px; position: relative; display: inline-grid; place-items: center; width: var(--s); height: var(--s); flex: none; border-radius: 50%; overflow: hidden;
  background: linear-gradient(135deg, var(--accent), #9b5cff); color: #fff; font-weight: 800; font-size: calc(var(--s) * .36); box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px color-mix(in srgb, var(--accent) 45%, transparent); }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.author { display: flex; align-items: center; gap: 20px; max-width: 760px; margin: 0 auto; padding: 24px 28px; border-radius: 18px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, var(--surface)), var(--surface)); }
.author h3 { font-size: 1.3rem; margin: 0 0 .2em; }
.author p { margin: 0; }
.author-text { flex: 1; min-width: 0; }
.btn-linkedin { background: #0a66c2; border-color: #0a66c2; color: #fff; border-radius: 999px; }
.btn-linkedin:hover { background: #0a66c2; filter: brightness(1.1); }
.btn-linkedin svg { width: 16px; height: 16px; }
.footer { display: grid; gap: 8px; justify-items: center; }
.footer-by { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: .9rem; }
.footer-in { display: inline-flex; align-items: center; gap: 5px; color: #0a66c2; font-weight: 600; }
:root[data-theme="dark"] .footer-in { color: #5aa2ff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .footer-in { color: #5aa2ff; } }

@media (max-width: 860px) {
  .hero-x { padding-top: 24px; }
  .blob { width: 220px !important; height: 220px !important; opacity: .22; filter: blur(50px); }
  .b2 { top: 260px; }
  .hero-art { max-width: 360px; margin: 0 auto; }
  .stats-band { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .author { flex-direction: column; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  .blob, .grad, .c-link, .c-halo, .c-badge, .ico-pulse, .hero-pill .dot { animation: none !important; }
  .c-packet { display: none; }
  [data-reveal] { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------------- auth */
.auth { max-width: 440px; margin: 24px auto; }
.auth-card { padding: 28px; }
.auth-foot { text-align: center; color: var(--muted); }

/* ---------------------------------------------------------------- dashboard */
.dash-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.kpis { display: grid; grid-template-columns: 1.5fr repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.topic-head + .kpis, .kpis:has(> .kpi:nth-child(4):last-child) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi { margin: 0; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.kpi > b { font-size: 1.8rem; line-height: 1.1; }
.kpi > b small { font-size: .95rem; color: var(--muted); font-weight: 500; }
.kpi > span { color: var(--muted); font-size: .9rem; line-height: 1.35; }
.kpi-ring { flex-direction: row; align-items: center; gap: 14px; }
.kpi-ring > div { display: grid; }
.ring-bg { fill: none; stroke: var(--surface-2); stroke-width: 12; }
.ring-fg { fill: none; stroke: var(--accent); stroke-width: 12; stroke-linecap: round; transition: stroke-dashoffset .6s; }
.ring-txt { fill: var(--text); font: 700 24px var(--font); }
@media (max-width: 1000px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpi-ring { grid-column: 1 / -1; } }
@media (max-width: 420px) { .kpi > b { font-size: 1.45rem; } }
.next { border-left: 4px solid var(--accent); }
.weak { list-style: none; padding: 0; margin: 0 0 10px; }
.weak li { padding: 8px 0; border-bottom: 1px solid var(--line); display: grid; gap: 2px; }
.weak li:last-child { border-bottom: 0; }
.weak a { display: flex; justify-content: space-between; gap: 10px; font-weight: 600; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 0 12px; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 2px solid var(--line); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:hover td { background: var(--surface-2); }
.topics-table td:first-child { font-weight: 600; white-space: nowrap; }
.mini { margin-bottom: 14px; }
.heatmap { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 1fr); gap: 3px; max-width: 100%; overflow-x: auto; padding-bottom: 4px; }
.heatmap i { width: 13px; height: 13px; border-radius: 3px; background: var(--surface-2); border: 1px solid var(--line); }
.heatmap .hm1 { background: color-mix(in srgb, var(--accent) 30%, var(--surface)); }
.heatmap .hm2 { background: color-mix(in srgb, var(--accent) 55%, var(--surface)); }
.heatmap .hm3 { background: color-mix(in srgb, var(--accent) 78%, var(--surface)); }
.heatmap .hm4 { background: var(--accent); }

/* ---------------------------------------------------------------- topics */
.group-title { margin-top: 1.4em; color: var(--muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; }
.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.topic-grid .card { margin: 0; }
.topic-card { color: var(--text); display: flex; flex-direction: column; gap: 6px; transition: transform .12s, border-color .12s; }
.topic-card:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-2px); }
.topic-card h3 { margin: 0; }
.topic-card p { margin: 0; flex: 1; }
.tc-stats { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .85rem; color: var(--muted); }
.tc-stats b { color: var(--text); }
.topic-head { margin-bottom: 16px; }
.topic-head h1 { margin-top: 6px; margin-bottom: 4px; }
.back { font-size: .9rem; font-weight: 600; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-top: 12px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; white-space: nowrap; margin-bottom: -1px; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--accent); border-bottom-color: var(--accent); }
.ch-list { padding-left: 1.4em; margin: 0 0 14px; }
.ch-list li { padding: 3px 0; }
.ch-list li.done a { color: var(--good); }
.ch-list li.done::marker { color: var(--good); }
.ch-list li.done a::after { content: " ✓"; }

/* ---------------------------------------------------------------- lesson reader */
.reader { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 20px; align-items: start; }
.reader-toc { position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow: auto; padding: 16px; margin: 0; }
.toc-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.reader-toc ol { list-style: none; padding: 0; margin: 12px 0 0; counter-reset: ch; }
.reader-toc li { counter-increment: ch; }
.reader-toc li a { display: block; padding: 6px 8px; border-radius: 7px; color: var(--muted); font-size: .9rem; line-height: 1.35; }
.reader-toc li a::before { content: counter(ch) ". "; font-weight: 600; }
.reader-toc li a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.reader-toc li.cur a { background: var(--accent-2); color: var(--accent); font-weight: 600; }
.reader-toc li.done a::after { content: " ✓"; color: var(--good); font-weight: 700; }
.reader-body { padding: 28px 32px; margin: 0; }
.ch-title { font-size: 1.6rem; }
.reader-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line); margin-top: 28px; padding-top: 18px; }
@media (max-width: 900px) {
  .reader { grid-template-columns: 1fr; }
  .reader-toc { position: static; max-height: 260px; }
  .reader-body { padding: 20px 16px; }
}
.lesson { font-size: 1rem; }
.lesson h2 { margin-top: 1.6em; padding-bottom: .25em; border-bottom: 1px solid var(--line); }
.lesson h3 { margin-top: 1.3em; color: var(--muted); }
.lesson ul, .lesson ol { padding-left: 1.4em; margin: 0 0 1.1em; }
.lesson li { margin: .3em 0; }
.lesson .sub { list-style: "– "; color: var(--muted); font-size: .95em; margin: .2em 0 .4em; }
.steps > li::marker { font-weight: 700; color: var(--accent); }
.callout { border-left: 4px solid var(--accent); background: var(--accent-2); border-radius: 0 10px 10px 0; padding: 12px 16px; margin: 0 0 1.2em; }
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }
.callout ul { padding-left: 1.2em; margin: 0; }
.callout-label { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 4px; }
.callout-note { border-color: #2f74d0; background: color-mix(in srgb, #2f74d0 10%, var(--surface)); } .callout-note .callout-label { color: #2f74d0; }
.callout-tip { border-color: var(--good); background: color-mix(in srgb, var(--good) 10%, var(--surface)); } .callout-tip .callout-label { color: var(--good); }
.callout-warn { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, var(--surface)); } .callout-warn .callout-label { color: var(--ok); }
.callout-docker { border-color: #1d63ed; background: color-mix(in srgb, #1d63ed 9%, var(--surface)); } .callout-docker .callout-label { color: #3b7bff; }
.callout-exam { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 9%, var(--surface)); } .callout-exam .callout-label { color: var(--bad); }
.callout-extra { border-color: var(--l4); background: color-mix(in srgb, var(--l4) 9%, var(--surface)); } .callout-extra .callout-label { color: var(--l4); }
.code { background: var(--code-bg); color: var(--code-fg); border-radius: 10px; margin: 0 0 1.1em; overflow: hidden; }
.code-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px 0 14px; font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #9da5b4; min-height: 26px; }
.copy { background: transparent; border: 1px solid #3a4459; color: #c3cad6; font-size: .72rem; padding: 2px 8px; border-radius: 6px; cursor: pointer; }
.copy:hover { background: #2a3346; }
.code pre { margin: 0; padding: 8px 14px 14px; overflow-x: auto; font: 13.5px/1.55 var(--mono); tab-size: 4; }
.code pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; word-break: normal; }
.c-com { color: var(--code-com); }
.code.out { background: var(--out-bg); color: var(--text); border: 1px solid var(--line); border-left: 3px solid var(--muted); }
.code.out .code-head { color: var(--muted); }
.code.out .copy { border-color: var(--line); color: var(--muted); }
.line-ex { margin-bottom: 1.3em; }
.line-ex .code { margin-bottom: .5em; }
.explain { list-style: none; padding-left: 0 !important; }
.explain li { position: relative; padding-left: 1.3em; }
.explain li::before { content: "▸"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.lesson table { margin: 0; }
.lesson .table-wrap { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 1.2em; }
.lesson th { background: var(--surface-2); text-transform: none; letter-spacing: 0; font-size: .85rem; color: var(--text); white-space: normal; }
.lesson td { vertical-align: top; }
.lesson tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-2) 50%, var(--surface)); }
.fig { margin: 1.6em 0 1.8em; text-align: center; }
.fig img { background: #fff; border-radius: 10px; border: 1px solid var(--line); padding: 6px; max-height: 560px; object-fit: contain; }
.fig figcaption { color: var(--muted); font-size: .88rem; margin-top: 8px; }
.blank { display: inline-block; min-width: 4.5em; border-bottom: 2px solid var(--accent); color: transparent; line-height: 1; margin: 0 2px; user-select: none; }
.code .blank { border-bottom-color: #ffd166; }

/* ---------------------------------------------------------------- quiz */
.quiz { max-width: 820px; margin: 0 auto; }
.quiz-top { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; flex-wrap: wrap; }
.quiz-top .back { margin-right: auto; }
.quiz-count { font-weight: 600; }
.quiz-score { color: var(--good); font-weight: 700; }
.quiz > .bar { margin-bottom: 16px; }
.q-strip { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 14px; }
.q-strip .nav-q { width: 34px; height: 34px; aspect-ratio: auto; }
.qcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); margin-bottom: 16px; }
.qmeta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 14px; }
.qid { margin-left: auto; font-size: .75rem; color: var(--muted); font-family: var(--mono); }
.qtext { font-size: 1.1rem; font-weight: 500; margin-bottom: 14px; }
.opts { border: 0; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; min-width: 0; }
.hint { margin: 0 0 4px; font-size: .9rem; color: var(--muted); }
.opt { display: flex; flex-direction: row; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer; font-weight: 400; font-size: 1rem; transition: border-color .1s, background .1s; }
.opt:hover { border-color: var(--accent); }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.opt-l { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .85rem; background: var(--surface-2); border: 1px solid var(--line); }
.opt input[type=checkbox] + .opt-l { border-radius: 7px; }
.opt-t { padding-top: 2px; min-width: 0; overflow-wrap: anywhere; }
.opt.selected { border-color: var(--accent); background: var(--accent-2); }
.opt.selected .opt-l { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.opt.is-correct { border-color: var(--good); background: var(--good-bg); }
.opt.is-correct .opt-l { background: var(--good); color: #fff; border-color: var(--good); }
.opt.is-wrong { border-color: var(--bad); background: var(--bad-bg); }
.opt.is-wrong .opt-l { background: var(--bad); color: #fff; border-color: var(--bad); }
.opt:has(input:disabled) { cursor: default; }
.tf { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fill input { font-size: 1.05rem; font-family: var(--mono); }
.fill.is-correct input { border-color: var(--good); background: var(--good-bg); }
.fill.is-wrong input { border-color: var(--bad); background: var(--bad-bg); }
.feedback { border-radius: 10px; padding: 14px 16px; margin-bottom: 16px; border-left: 4px solid; }
.fb-ok { background: var(--good-bg); border-color: var(--good); }
.fb-bad { background: var(--bad-bg); border-color: var(--bad); }
.fb-title { font-weight: 800; font-size: 1.05rem; margin-bottom: 4px; }
.fb-ok .fb-title { color: var(--good); } .fb-bad .fb-title { color: var(--bad); }
.fb-row { margin: 4px 0; }
.fb-why { margin: 8px 0 0; padding-left: 1.2em; }
.qactions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.kbd-hint { margin-left: auto; font-size: .78rem; color: var(--muted); }
@media (max-width: 600px) { .qcard { padding: 16px; } .kbd-hint { display: none; } .tf { grid-template-columns: 1fr; } }
.result-card { text-align: center; }
.result-card .row { justify-content: center; flex-wrap: wrap; }
.result-card .mini { max-width: 520px; margin: 0 auto 16px; text-align: left; }
.result-big { font-size: 3.4rem; font-weight: 800; line-height: 1.1; margin: 6px 0; }
.result-big small { font-size: 1.2rem; color: var(--muted); }
.review { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--bad); border-radius: 10px; padding: 12px 16px; margin-bottom: 10px; }
.review.rv-ok { border-left-color: var(--good); }
.review.rv-skip { border-left-color: var(--line); }
.rv-mark { display: inline-block; width: 1.4em; font-weight: 800; font-size: 1.05rem; }
.rv-n { color: var(--muted); }
.review summary { cursor: pointer; font-weight: 500; }
.review[open] summary { margin-bottom: 10px; }
.rv-opts { margin: 0 0 8px; }

/* ---------------------------------------------------------------- exam */
.exam-top { display: flex; align-items: center; gap: 16px; justify-content: space-between; flex-wrap: wrap; position: sticky; top: 64px; z-index: 5; padding: 12px 18px; }
.timer { font: 700 1.5rem var(--mono); }
.timer-low { color: var(--bad); }
.exam-body { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; align-items: start; }
.exam-nav { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; padding: 14px; position: sticky; top: 140px; margin: 0; }
.nav-q { aspect-ratio: 1; border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 7px; font: 600 .8rem var(--font); cursor: pointer; padding: 0; position: relative; }
.nav-q.done { background: var(--accent-2); border-color: var(--accent); color: var(--accent); }
.nav-q.flag::after { content: "★"; position: absolute; top: -6px; right: -3px; font-size: .7rem; color: var(--ok); }
.nav-q.cur { outline: 2px solid var(--accent); outline-offset: 1px; }
.exam-qhead { font-weight: 700; color: var(--muted); margin-bottom: 8px; }
@media (max-width: 860px) {
  .exam-body { grid-template-columns: 1fr; }
  .exam-nav { position: static; grid-template-columns: repeat(10, 1fr); }
  .exam-top { top: 56px; }
}
@media (max-width: 480px) { .exam-nav { grid-template-columns: repeat(6, 1fr); } }

/* ---------------------------------------------------------------- practice setup */
.level-pick { border: 0; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.level-pick legend { font-weight: 600; font-size: .92rem; margin-bottom: 6px; }
.lp { display: flex; flex-direction: row; align-items: center; gap: 10px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer; font-weight: 500; }
.lp input { accent-color: var(--accent); }
.lp.sel { border-color: var(--accent); background: var(--accent-2); }
.lp .pill { margin-left: auto; }
#pf .row label { flex: 1; min-width: 140px; }

/* ---------------------------------------------------------------- leader / admin */
.kpis-admin { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1000px) { .kpis-admin { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.daybars { display: flex; align-items: flex-end; gap: 2px; height: 90px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.daybars span { flex: 1; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; opacity: .85; }
.daybars span:hover { opacity: 1; }
.inv-form { align-items: flex-end; }
.inv-form label:not(.check) { flex: 1; min-width: 200px; }
.inv-form .check { padding-bottom: 10px; }
#q { min-width: 220px; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.admin .topics-table td .pill { margin-left: 4px; }

/* ---------------------------------------------------------------- PDF files */
.files h3 { font-size: .95rem; margin: 0 0 8px; }
.files ul { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 6px; }
.files a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: var(--surface); }
.files a:hover { text-decoration: none; border-color: color-mix(in srgb, var(--bad) 50%, var(--line)); }
.files a span:nth-child(2) { flex: 1; min-width: 0; overflow-wrap: anywhere; font-weight: 600; font-size: .92rem; }
.pdf-ico { flex: none; font-size: .68rem; font-weight: 800; color: #fff; background: #d93025; border-radius: 6px; padding: 3px 6px; letter-spacing: .03em; }
.reader-toc .files { margin-top: 14px; }

/* ---------------------------------------------------------------- idle logout warning */
.idle-warn { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(8, 12, 20, .55); backdrop-filter: blur(3px); }
.idle-warn .card { max-width: 420px; width: 100%; margin: 0; text-align: center; }
.idle-warn .row { justify-content: center; flex-wrap: wrap; }
.idle-warn b { font-variant-numeric: tabular-nums; color: var(--bad); }

/* ---------------------------------------------------------------- toasts */
.toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 50; width: min(480px, calc(100% - 32px)); }
.toast { background: var(--text); color: var(--bg); padding: 12px 16px; border-radius: 10px; box-shadow: 0 6px 24px rgba(0, 0, 0, .2); font-size: .92rem; transition: opacity .3s, transform .3s; }
.toast-good { background: var(--good); color: #fff; }
.toast-error { background: var(--bad); color: #fff; }
.toast.leaving { opacity: 0; transform: translateY(8px); }

/* ---------------------------------------------------------------- leader dashboard layout */
.admin-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 22px; align-items: start; }
.admin-side { position: sticky; top: 74px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.admin-me { display: grid; gap: 2px; padding: 4px 8px 12px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.admin-side nav { display: grid; gap: 3px; }
.admin-side nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: .93rem; }
.admin-side nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.admin-side nav a.active { background: var(--accent-2); color: var(--accent); }
.admin-main > .card:first-child { margin-top: 0; }
.quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-bottom: 16px; }
.quick-grid .card { margin: 0; }
.quick { display: grid; gap: 4px; color: var(--text); transition: transform .2s, border-color .2s; }
.quick:hover { text-decoration: none; transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.quick-ico { font-size: 1.5rem; }
.leader-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.leader-grid .card { margin: 0; }
.row-off { opacity: .55; }
.admin-chapters { list-style: decimal; padding-left: 22px; margin: 8px 0 0; display: grid; gap: 6px; }
.admin-chapters li { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.admin-chapters li::marker { color: var(--muted); }
.ach-main { min-width: 0; flex: 1; }
.ach-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.admin-files { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 6px; }
.admin-files li { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.admin-files a { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.upload { margin-top: 8px; }
.upload input[name=title] { flex: 1 1 200px; width: auto; }
.upload input[type=file] { flex: 1 1 200px; font: inherit; font-size: .88rem; }
.ce-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; }
.ce-help { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; line-height: 1.9; margin-bottom: 8px; }
.ce-preview { border: 1px dashed var(--line); border-radius: 10px; padding: 10px 14px; max-height: 420px; overflow: auto; }
@media (max-width: 960px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-side { position: static; padding: 8px; }
  .admin-me { display: none; }
  .admin-side nav { display: flex; overflow-x: auto; gap: 6px; }
  .admin-side nav a { white-space: nowrap; }
  .ce-grid { grid-template-columns: 1fr; }
  .admin-chapters li { flex-direction: column; }
}

/* ---------------------------------------------------------------- leader: roles */
form.inv-form { display: grid; gap: 12px; }
.inv-form .check { padding-bottom: 0; }
.inv-perms summary { cursor: pointer; font-weight: 600; font-size: .92rem; }
.perm-boxes { display: grid; gap: 8px; margin: 10px 0 12px; }

/* ---------------------------------------------------------------- leader: questions */
.admin-tabs { margin: 0 0 16px; overflow-y: hidden; }
.q-filters { margin-bottom: 10px; }
.q-filters select, .q-filters input { width: auto; flex: 1 1 200px; }
.q-filters input[type=search], .q-editor textarea {
  font: inherit; font-weight: 400; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; min-width: 0; }
.q-editor textarea { width: 100%; resize: vertical; box-sizing: border-box; }
.q-editor textarea.mono { font-family: var(--mono); font-size: .9rem; }
.q-editor textarea:focus, .q-filters input[type=search]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-2); }
.q-editor form { display: grid; gap: 14px; }
.qe-row label { flex: 1 1 150px; }
.qe-choice { display: grid; gap: 14px; }
.q-bulk { margin-bottom: 8px; }
.q-list { display: grid; gap: 8px; margin-bottom: 12px; }
.q-row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px 12px; align-items: start; border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: var(--surface); }
.q-row .q-sel { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--accent); }
.q-hidden { background: var(--surface-2); }
.q-hidden .q-text { color: var(--muted); text-decoration: line-through; }
.q-edited { border-left: 3px solid var(--accent); }
.q-added { border-left: 3px solid var(--good); }
.q-text { margin: 4px 0; overflow-wrap: anywhere; }
.q-code { font-family: var(--mono); font-size: .85rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin: 4px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.q-opts { margin: 6px 0; padding-left: 0; list-style: none; font-size: .9rem; }
.q-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
@media (max-width: 640px) {
  .q-row { grid-template-columns: auto 1fr; }
  .q-actions { grid-column: 1 / -1; justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
