/* ============ Cyber Academy design tokens ============ */
:root {
  --bg: #f4f7fb;
  --bg-2: #eaf0f8;
  --surface: #ffffff;
  --surface-2: #f6f9fc;
  --border: #dbe3ee;
  --text: #0d1726;
  --muted: #5b6b82;
  --accent: #0891b2;
  --accent-ink: #ffffff;
  --accent-soft: #e0f6fb;
  --ok: #059669;
  --ok-soft: #dcfce9;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --bad: #dc2626;
  --bad-soft: #fee2e2;
  --xp: #6366f1;
  --xp-soft: #e8e9ff;
  --grid: rgba(8, 145, 178, 0.06);
  --shadow: 0 1px 2px rgba(13, 23, 38, .06), 0 8px 24px rgba(13, 23, 38, .06);
  --glow: 0 0 0 1px rgba(8, 145, 178, .25), 0 10px 30px rgba(8, 145, 178, .15);
  --radius: 16px;
  --radius-sm: 10px;
  --font: "Hind Siliguri", "Noto Sans Bengali", system-ui, sans-serif;
  --font-num: "Space Grotesk", "Hind Siliguri", system-ui, sans-serif;
  --sidebar: 248px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #060a13; --bg-2: #0a1120; --surface: #0e1627; --surface-2: #121c31; --border: #1e2a42;
    --text: #e6edf7; --muted: #8a99b4; --accent: #22d3ee; --accent-ink: #04212a; --accent-soft: rgba(34, 211, 238, .12);
    --ok: #34d399; --ok-soft: rgba(52, 211, 153, .13); --warn: #fbbf24; --warn-soft: rgba(251, 191, 36, .13);
    --bad: #f87171; --bad-soft: rgba(248, 113, 113, .13); --xp: #a5b4fc; --xp-soft: rgba(129, 140, 248, .15);
    --grid: rgba(34, 211, 238, .05); --shadow: 0 1px 2px rgba(0,0,0,.4), 0 12px 32px rgba(0,0,0,.35);
    --glow: 0 0 0 1px rgba(34, 211, 238, .3), 0 12px 40px rgba(34, 211, 238, .12);
  }
}
:root[data-theme="dark"] {
  --bg: #060a13; --bg-2: #0a1120; --surface: #0e1627; --surface-2: #121c31; --border: #1e2a42;
  --text: #e6edf7; --muted: #8a99b4; --accent: #22d3ee; --accent-ink: #04212a; --accent-soft: rgba(34, 211, 238, .12);
  --ok: #34d399; --ok-soft: rgba(52, 211, 153, .13); --warn: #fbbf24; --warn-soft: rgba(251, 191, 36, .13);
  --bad: #f87171; --bad-soft: rgba(248, 113, 113, .13); --xp: #a5b4fc; --xp-soft: rgba(129, 140, 248, .15);
  --grid: rgba(34, 211, 238, .05); --shadow: 0 1px 2px rgba(0,0,0,.4), 0 12px 32px rgba(0,0,0,.35);
  --glow: 0 0 0 1px rgba(34, 211, 238, .3), 0 12px 40px rgba(34, 211, 238, .12);
}

/* ============ base ============ */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 16.5px; line-height: 1.7; color: var(--text);
  background: var(--bg);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 44px 44px; background-attachment: fixed;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.35; margin: 0 0 .5em; }
h1 { font-size: clamp(1.5rem, 2.5vw + 1rem, 2.1rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.tiny { font-size: .8rem; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.5rem 0; }
code, kbd { font-family: ui-monospace, Consolas, monospace; font-size: .9em; background: var(--surface-2); border: 1px solid var(--border); padding: .05em .4em; border-radius: 6px; }

/* ============ app shell ============ */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 20px 14px; border-right: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 85%, transparent); backdrop-filter: blur(12px);
  display: flex; flex-direction: column; gap: 4px; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; padding: 6px 10px 18px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--xp)); color: #fff; box-shadow: var(--glow);
}
.brand-mark svg { width: 20px; height: 20px; }
.nav-label { font-size: .75rem; color: var(--muted); padding: 14px 12px 4px; letter-spacing: .02em; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; color: var(--muted);
  font-weight: 500; transition: background .2s, color .2s;
}
.nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--accent-soft); color: var(--accent); }
.nav .ico { width: 20px; text-align: center; font-size: 1.05rem; }
.nav .badge { margin-left: auto; }
.sidebar-foot { margin-top: auto; padding-top: 16px; }

.main { min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 12px 28px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border);
}
.search { flex: 1; max-width: 460px; position: relative; }
.search input { width: 100%; padding: 9px 14px 9px 38px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; }
.search::before { content: "⌕"; position: absolute; left: 14px; top: 50%; transform: translateY(-52%); color: var(--muted); font-size: 1.15rem; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn {
  position: relative; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; font-size: 1.05rem;
}
.icon-btn:hover { border-color: var(--accent); text-decoration: none; }
.dot-count {
  position: absolute; top: -5px; right: -5px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 99px;
  background: var(--bad); color: #fff; font-size: .7rem; display: grid; place-items: center; font-family: var(--font-num);
}
.avatar { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--accent), var(--xp)); }
.content { padding: 28px; max-width: 1180px; margin: 0 auto; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.page-head p { margin: 0; color: var(--muted); }
.crumbs { font-size: .88rem; color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: var(--muted); }

.mobile-nav { display: none; }

/* ============ components ============ */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
}
.card.glow { box-shadow: var(--glow); border-color: transparent; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head h2, .card-head h3 { margin: 0; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.between { justify-content: space-between; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 20px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 600;
  cursor: pointer; transition: transform .15s, box-shadow .2s, background .2s; text-decoration: none; min-height: 44px;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); border-color: var(--accent); }
.btn:active { transform: translateY(0); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: var(--glow); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--border)); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 6px 12px; min-height: 34px; font-size: .9rem; border-radius: 9px; }
.btn.lg { padding: 14px 26px; font-size: 1.05rem; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 99px; font-size: .8rem; font-weight: 600; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.badge.info { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge.xp { background: var(--xp-soft); color: var(--xp); border-color: transparent; }

.alert { padding: 12px 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); margin-bottom: 14px; }
.alert.ok { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.alert.bad { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.alert.warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.alert.info { background: var(--accent-soft); border-color: transparent; }

label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .95rem; }
.field { margin-bottom: 16px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], input[type=date],
input[type=datetime-local], select, textarea {
  width: 100%; padding: 11px 14px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text); font: inherit; min-height: 44px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { min-height: 96px; resize: vertical; }
.help { font-size: .85rem; color: var(--muted); margin-top: 4px; }
.errorlist { color: var(--bad); margin: 6px 0 0; padding-left: 18px; font-size: .9rem; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: .82rem; color: var(--muted); font-weight: 600; background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty .big { font-size: 2.2rem; display: block; margin-bottom: 6px; }

/* progress */
.bar { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; border: 1px solid var(--border); }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--xp)); border-radius: 99px; width: 0; transition: width 1.2s cubic-bezier(.2,.8,.2,1); }
.ring { position: relative; width: 132px; height: 132px; }
.ring svg { transform: rotate(-90deg); }
.ring .track { stroke: var(--surface-2); }
.ring .val { stroke: url(#ringGrad); stroke-linecap: round; transition: stroke-dashoffset 1.4s cubic-bezier(.2,.8,.2,1); }
.ring .label { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring .label b { font-size: 1.9rem; font-family: var(--font-num); line-height: 1; }

.stat { display: flex; align-items: center; gap: 14px; }
.stat .ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 1.4rem; background: var(--accent-soft); flex: none; }
.stat b { display: block; font-size: 1.5rem; font-family: var(--font-num); line-height: 1.2; }
.stat span { color: var(--muted); font-size: .9rem; }

/* step tracker: read → quiz → lab */
.steps { display: flex; align-items: center; gap: 0; margin: 14px 0; }
.step { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.step .n { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--border); background: var(--surface); font-family: var(--font-num); transition: all .3s; }
.step.done { color: var(--ok); }
.step.done .n { background: var(--ok); border-color: var(--ok); color: #fff; }
.step.now { color: var(--accent); }
.step.now .n { border-color: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); animation: pulse 2s infinite; }
.step-line { flex: 1; height: 2px; background: var(--border); margin: 0 10px; min-width: 18px; position: relative; overflow: hidden; }
.step-line.done::after { content: ""; position: absolute; inset: 0; background: var(--ok); animation: fill .8s ease-out both; }
@keyframes fill { from { transform: translateX(-100%); } to { transform: none; } }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 4px var(--accent-soft); } 50% { box-shadow: 0 0 0 9px transparent; } }

/* countdown */
.countdown { display: inline-flex; gap: 6px; font-family: var(--font-num); }
.countdown .u { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 6px 10px; text-align: center; min-width: 54px; }
.countdown .u b { display: block; font-size: 1.35rem; line-height: 1.1; }
.countdown .u small { font-family: var(--font); color: var(--muted); font-size: .72rem; }
.countdown.late .u { border-color: var(--bad); color: var(--bad); background: var(--bad-soft); }

/* hero / today card */
.today {
  position: relative; overflow: hidden; border-radius: 22px; padding: 28px; border: 1px solid var(--border);
  background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--accent) 22%, transparent) 0%, transparent 55%),
              radial-gradient(90% 120% at 0% 100%, color-mix(in srgb, var(--xp) 18%, transparent) 0%, transparent 60%), var(--surface);
  box-shadow: var(--shadow);
}
.today .kicker { display: inline-flex; gap: 8px; align-items: center; font-size: .85rem; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 4px 12px; border-radius: 99px; }
.today h2 { font-size: clamp(1.3rem, 2vw + .8rem, 1.8rem); margin: 12px 0 6px; }
.today .orb { position: absolute; right: -60px; top: -60px; width: 240px; height: 240px; border-radius: 50%; border: 1px dashed color-mix(in srgb, var(--accent) 40%, transparent); animation: spin 40s linear infinite; pointer-events: none; }
.today .orb::after { content: ""; position: absolute; inset: 30px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--xp) 35%, transparent); }
@keyframes spin { to { transform: rotate(360deg); } }

/* course map */
.track-card { border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); overflow: hidden; margin-bottom: 22px; }
.track-top { display: flex; gap: 16px; align-items: center; padding: 20px; border-bottom: 1px solid var(--border); background: linear-gradient(90deg, var(--accent-soft), transparent); }
.track-top .emoji { font-size: 2rem; }
.module { padding: 14px 20px 6px; }
.module h3 { font-size: .95rem; color: var(--muted); }
.lessons { list-style: none; margin: 0 0 10px; padding: 0; }
.lessons li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; }
.lessons li:hover { background: var(--surface-2); }
.lessons .day { width: 42px; height: 42px; flex: none; border-radius: 12px; display: grid; place-items: center; font-family: var(--font-num); font-weight: 700; background: var(--surface-2); border: 1px solid var(--border); }
.lessons .done .day { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.lessons .open .day { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.lessons .locked { opacity: .55; }
.lessons .t { flex: 1; min-width: 0; }
.lessons .t b { display: block; font-weight: 600; }

/* lesson reader */
.reader { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; align-items: start; }
.prose { font-size: 1.06rem; }
.prose section { padding: 24px 26px; margin-bottom: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); scroll-margin-top: 90px; }
.prose h2 { font-size: 1.3rem; display: flex; align-items: center; gap: 10px; }
.prose h2 .sn { width: 30px; height: 30px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: .95rem; font-family: var(--font-num); flex: none; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin-bottom: 6px; }
.prose .callout { border-left: 4px solid var(--accent); background: var(--accent-soft); padding: 12px 16px; border-radius: 0 12px 12px 0; margin: 14px 0; }
.prose .callout.warn { border-color: var(--warn); background: var(--warn-soft); }
.prose .callout.bad { border-color: var(--bad); background: var(--bad-soft); }
.prose .callout.ok { border-color: var(--ok); background: var(--ok-soft); }
.prose .story { background: var(--surface-2); border: 1px dashed var(--border); border-radius: 12px; padding: 14px 18px; margin: 14px 0; }
.prose .story::before { content: "📖 বাস্তব ঘটনা"; display: block; font-weight: 700; color: var(--accent); margin-bottom: 6px; font-size: .9rem; }
.prose .term { border-bottom: 1px dashed var(--accent); cursor: help; }
.prose table { margin: 12px 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.prose .diagram { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; padding: 18px; margin: 14px 0; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.prose .diagram .node { padding: 10px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); text-align: center; font-weight: 600; min-width: 96px; }
.prose .diagram .node small { display: block; font-weight: 400; color: var(--muted); }
.prose .diagram .arrow { color: var(--accent); font-size: 1.3rem; animation: nudge 1.6s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateX(4px); } }
.toc { position: sticky; top: 86px; }
.toc ol { list-style: none; padding: 0; margin: 0; counter-reset: s; }
.toc li a { display: block; padding: 7px 10px; border-radius: 9px; color: var(--muted); font-size: .92rem; border-left: 2px solid transparent; }
.toc li a.active { color: var(--accent); background: var(--accent-soft); border-left-color: var(--accent); }
.keypoints li { margin-bottom: 8px; }
.keypoints li::marker { content: "✔  "; color: var(--ok); }

/* quiz */
.q { padding: 22px; margin-bottom: 16px; }
.q .qn { font-size: .82rem; color: var(--accent); font-weight: 700; margin-bottom: 4px; }
.q .qt { font-size: 1.08rem; font-weight: 600; margin-bottom: 14px; white-space: pre-line; }
.opt { display: flex; align-items: flex-start; gap: 12px; padding: 13px 16px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--surface-2); margin-bottom: 9px; cursor: pointer; font-weight: 500; transition: border-color .15s, background .15s; }
.opt:hover { border-color: var(--accent); }
.opt input { margin-top: 5px; width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.opt.right { border-color: var(--ok); background: var(--ok-soft); }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.explain { margin-top: 10px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); font-size: .96rem; }
.quiz-bar { position: sticky; bottom: 0; padding: 14px 0; background: linear-gradient(transparent, var(--bg) 35%); }
.score-big { font-size: 3.6rem; font-family: var(--font-num); font-weight: 700; line-height: 1; }

/* notifications & lists */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: 0; }
.list .li-ico { width: 38px; height: 38px; flex: none; border-radius: 11px; display: grid; place-items: center; background: var(--surface-2); }
.list .unread { background: linear-gradient(90deg, var(--accent-soft), transparent); border-radius: 10px; }

/* leaderboard */
.lb-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 14px; margin-bottom: 8px; background: var(--surface); border: 1px solid var(--border); }
.lb-row .pos { width: 34px; font-family: var(--font-num); font-weight: 700; font-size: 1.1rem; text-align: center; }
.lb-row.me { border-color: var(--accent); box-shadow: var(--glow); }

/* ============ public pages (landing, auth) ============ */
.public { min-height: 100vh; position: relative; overflow-x: hidden; }
#net { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.public > *:not(#net) { position: relative; z-index: 1; }
.pub-nav { display: flex; align-items: center; justify-content: space-between; padding: 18px clamp(16px, 4vw, 48px); }
.hero { max-width: 1120px; margin: 0 auto; padding: clamp(40px, 8vw, 96px) clamp(16px, 4vw, 48px) 40px; text-align: center; }
.hero h1 { font-size: clamp(2rem, 5vw + .5rem, 3.6rem); line-height: 1.2; margin-bottom: 18px; }
.hero h1 .hl { background: linear-gradient(90deg, var(--accent), var(--xp)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: clamp(1.05rem, 1vw + .8rem, 1.25rem); color: var(--muted); max-width: 680px; margin: 0 auto 30px; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 30px; }
.chip { padding: 8px 16px; border-radius: 99px; border: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 80%, transparent); backdrop-filter: blur(8px); font-weight: 500; }
.features { max-width: 1120px; margin: 0 auto; padding: 30px clamp(16px, 4vw, 48px) 80px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.feature { padding: 24px; border-radius: 18px; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px); border: 1px solid var(--border); }
.feature .fi { font-size: 1.8rem; margin-bottom: 10px; }
.auth-wrap { min-height: calc(100vh - 80px); display: grid; place-items: center; padding: 24px 16px 60px; }
.auth-card { width: 100%; max-width: 440px; padding: 32px; border-radius: 22px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(16px); border: 1px solid var(--border); box-shadow: var(--shadow); }
.auth-card h1 { font-size: 1.6rem; }
.qr { background: #fff; padding: 12px; border-radius: 14px; display: inline-block; }
.qr svg { display: block; width: 200px; height: 200px; }

/* ============ labs ============ */
.lab-shell { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
.lab-stage { min-height: 420px; }
.result-list { list-style: none; padding: 0; margin: 0; }
.result-list li { display: flex; gap: 10px; padding: 12px; border-radius: 12px; margin-bottom: 8px; background: var(--surface-2); border: 1px solid var(--border); animation: rise .4s both; }
.result-list li.ok { background: var(--ok-soft); border-color: transparent; }
.result-list li.bad { background: var(--bad-soft); border-color: transparent; }
.result-list .ri { font-size: 1.2rem; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0; padding: 12px 20px; border-radius: 12px; background: var(--text); color: var(--bg); font-weight: 600; z-index: 100; transition: all .3s; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast.bad { background: var(--bad); color: #fff; }

/* phone frame (settings lab) */
.phone { width: 340px; max-width: 100%; margin: 0 auto; border-radius: 38px; padding: 14px; background: #0b1220; box-shadow: 0 30px 60px rgba(0,0,0,.35), inset 0 0 0 2px #26324a; }
.phone-screen { border-radius: 28px; overflow: hidden; background: #f2f4f8; color: #111827; min-height: 560px; }
.phone-status { display: flex; justify-content: space-between; padding: 10px 22px 6px; font-size: .78rem; font-family: var(--font-num); font-weight: 600; }
.phone-title { padding: 6px 20px 12px; font-size: 1.5rem; font-weight: 700; }
.set-group { margin: 0 12px 14px; background: #fff; border-radius: 16px; overflow: hidden; }
.set-group h4 { margin: 0; padding: 10px 16px 4px; font-size: .78rem; color: #6b7280; font-weight: 600; }
.set-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid #eef0f4; }
.set-row:first-of-type { border-top: 0; }
.set-row .si { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: #eef2ff; flex: none; }
.set-row .st { flex: 1; min-width: 0; font-size: .95rem; line-height: 1.35; }
.set-row .st small { display: block; color: #6b7280; font-size: .78rem; }
.set-row .st { min-width: 84px; }
.set-row select { width: auto; max-width: 52%; text-overflow: ellipsis;min-height: 34px; padding: 4px 8px; background: #f3f4f6; color: #111827; border-color: #e5e7eb; font-size: .85rem; }
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; position: absolute; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; background: #d1d5db; border-radius: 99px; transition: .25s; }
.switch span::after { content: ""; position: absolute; width: 24px; height: 24px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .25s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch input:checked + span { background: #10b981; }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }

/* fake gmail */
.gm { border-radius: 16px; overflow: hidden; border: 1px solid var(--border); background: #fff; color: #1f2937; }
.gm-top { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: #f8fafc; border-bottom: 1px solid #e5e7eb; }
.gm-logo { font-weight: 700; font-size: 1.05rem; }
.gm-logo .g1 { color: #4285f4; } .gm-logo .g2 { color: #ea4335; } .gm-logo .g3 { color: #fbbc05; } .gm-logo .g4 { color: #34a853; }
.gm-badge { margin-left: auto; font-size: .72rem; background: #fef3c7; color: #92400e; padding: 3px 10px; border-radius: 99px; font-weight: 600; }
.gm-body { display: grid; grid-template-columns: 190px 1fr; min-height: 470px; }
.gm-side { background: #f8fafc; padding: 10px; border-right: 1px solid #e5e7eb; }
.gm-side button { display: flex; width: 100%; gap: 10px; align-items: center; padding: 9px 12px; border: 0; background: none; border-radius: 0 99px 99px 0; font: inherit; color: #374151; cursor: pointer; text-align: left; }
.gm-side button.on { background: #d3e3fd; color: #0b57d0; font-weight: 600; }
.gm-main { padding: 18px; min-width: 0; }
.gm-main h3 { color: #111827; }
.gm-card { border: 1px solid #e5e7eb; border-radius: 14px; padding: 16px; margin-bottom: 14px; background: #fff; }
.gm-card .row label { margin: 0; color: #374151; }
.gm-card input, .gm-card select { background: #f9fafb; color: #111827; border-color: #d1d5db; }
.gm-card .muted { color: #6b7280; }
.gm-mail { display: flex; gap: 12px; padding: 12px; border-bottom: 1px solid #f1f5f9; cursor: pointer; border-radius: 10px; }
.gm-mail:hover { background: #f8fafc; }
.gm-mail .from { font-weight: 700; min-width: 0; }
.gm .mail-av { background: #e8eaed; color: #3c4043; flex: none; }
.gm-open { border: 1px solid #e5e7eb; border-radius: 14px; padding: 18px; }
.gm-open .fake-link { color: #1a73e8; text-decoration: underline; cursor: pointer; background: none; border: 0; font: inherit; padding: 0; }
.gm .btn { background: #fff; color: #1f2937; border-color: #d1d5db; }
.gm .btn.primary { background: #0b57d0; border-color: #0b57d0; color: #fff; box-shadow: none; }
.gm .btn.danger { color: #b91c1c; border-color: #fecaca; }
.sess { display: flex; gap: 12px; align-items: center; padding: 12px; border: 1px solid #e5e7eb; border-radius: 12px; margin-bottom: 8px; }
.sess.out { opacity: .5; text-decoration: line-through; }

/* phishing */
.mail-list { border: 1px solid var(--border); border-radius: 16px; overflow: hidden; background: var(--surface); }
.mail-row { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; align-items: center; transition: background .15s; }
.mail-row:hover, .mail-row.sel { background: var(--accent-soft); }
.mail-row:last-child { border-bottom: 0; }
.mail-av { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-weight: 700; }
.mail-view { border: 1px solid var(--border); border-radius: 16px; background: var(--surface); padding: 20px; margin-top: 16px; }
.mail-view .hdr { border-bottom: 1px solid var(--border); padding-bottom: 12px; margin-bottom: 12px; }
.mail-body { background: #fff; color: #1f2937; border-radius: 12px; padding: 16px; border: 1px solid #e5e7eb; }
.mail-body a, .mail-body .lnk { color: #1a73e8; text-decoration: underline; }
.reason-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 10px 0; }
.reason-grid .opt { margin: 0; padding: 9px 12px; font-size: .92rem; }

/* scenario */
.scn { padding: 18px; margin-bottom: 14px; }
.scn-opts { display: grid; gap: 8px; margin-top: 10px; }

/* confetti */
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 200; }

/* reveal */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity .4s ease, transform .4s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ============ responsive ============ */
@media (max-width: 1080px) {
  .reader, .lab-shell { grid-template-columns: minmax(0, 1fr); }
  .toc { position: static; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .content { padding: 18px 16px 100px; }
  .topbar { padding: 10px 16px; }
  .g2, .g3, .features { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .mobile-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px); border-top: 1px solid var(--border);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .mobile-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .72rem; color: var(--muted); padding: 6px 2px; border-radius: 10px; position: relative; }
  .mobile-nav a .ico { font-size: 1.25rem; }
  .mobile-nav a.active { color: var(--accent); }
  .mobile-nav a:hover { text-decoration: none; }
  .gm-body { grid-template-columns: 1fr; }
  .gm-side { display: flex; overflow-x: auto; border-right: 0; border-bottom: 1px solid #e5e7eb; }
  .gm-side button { border-radius: 99px; white-space: nowrap; width: auto; }
  .today { padding: 22px 18px; }
  .prose section { padding: 18px 16px; }
  .steps .step .lbl { display: none; }
  .reason-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .g4 { grid-template-columns: 1fr 1fr; }
  .search { display: none; }
  .auth-card { padding: 24px 18px; }
  .countdown .u { min-width: 46px; padding: 5px 6px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* DNS + terminal labs */
.term-out { background: #050912; color: #9fe8c2; border-radius: 12px; padding: 14px; margin-top: 12px; font: .85rem/1.55 ui-monospace, Consolas, monospace; white-space: pre-wrap; max-height: 280px; overflow: auto; border: 1px solid var(--border); }
.term { border-radius: 16px; overflow: hidden; border: 1px solid #1e2a42; background: #050912; color: #d6e2f5; font-family: ui-monospace, Consolas, monospace; }
.term-bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; background: #0d1526; font-size: .85rem; }
.term-bar span { width: 11px; height: 11px; border-radius: 50%; background: #f87171; }
.term-bar span:nth-child(2) { background: #fbbf24; } .term-bar span:nth-child(3) { background: #34d399; }
.term-bar b { margin-left: 8px; } .term-bar small { margin-left: auto; color: #8a99b4; font-family: var(--font); }
.term-body { padding: 14px; height: 340px; overflow-y: auto; font-size: .88rem; line-height: 1.5; }
.term-line { white-space: pre-wrap; word-break: break-word; } .term-line.muted { color: #8a99b4; font-family: var(--font); }
.term-out2 { margin: 2px 0 8px; white-space: pre-wrap; color: #b8f5d6; font: inherit; }
.term .pr { color: #22d3ee; }
.term-in { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-top: 1px solid #1e2a42; }
.term-in input { flex: 1; background: transparent; border: 0; color: #fff; font: inherit; min-height: 40px; padding: 0; }
.term-in input:focus { box-shadow: none; outline: none; }
.term-help { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 14px 14px; border-top: 1px dashed #1e2a42; }
.chip-cmd { background: #0d1526; color: #9fe8c2; border: 1px solid #1e2a42; border-radius: 8px; padding: 4px 8px; font: .78rem ui-monospace, Consolas, monospace; cursor: pointer; }
.chip-cmd:hover, .chip-cmd:focus-visible { border-color: #22d3ee; }
@media (max-width: 860px) { .term-body { height: 300px; } .dns .grid.g4 { grid-template-columns: 1fr 1fr; } }

/* certificate */
.cert { max-width: 860px; margin: 0 auto; padding: 14px; border-radius: 22px; background: linear-gradient(135deg, var(--accent), var(--xp)); box-shadow: var(--glow); }
.cert-inner { background: var(--surface); border-radius: 14px; padding: clamp(22px, 5vw, 48px); text-align: center; }
.cert-seal { font-size: 3rem; }
.cert-kicker { color: var(--accent); font-weight: 700; letter-spacing: .02em; }
.cert h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 10px 0 4px; }
.cert h2 { font-size: 1.4rem; margin: 6px 0 12px; }
.cert-line { color: var(--muted); margin: 0; }
.cert-skills { text-align: left; margin: 18px auto; max-width: 560px; }
.cert-skills ul { columns: 2; font-size: .9rem; padding-left: 18px; }
.cert-foot { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 18px; text-align: left; }
@media (max-width: 600px) { .cert-skills ul { columns: 1; } }
@media print {
  .sidebar, .topbar, .mobile-nav, .no-print, #confetti { display: none !important; }
  body { background: #fff; }
  .shell { display: block; } .content { padding: 0; }
  .cert { box-shadow: none; } .cert-inner { color: #000; background: #fff; }
}

/* AI teacher */
.reader { grid-template-columns: minmax(0, 1fr) 300px; }
.reader > aside.toc { grid-column: 2; }
.reader > aside.tutor { grid-column: 2; position: sticky; top: 86px; }
.tmsgs { max-height: 320px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.tmsg { padding: 9px 12px; border-radius: 12px; font-size: .92rem; white-space: pre-wrap; line-height: 1.6; animation: rise .25s both; }
.tmsg.user { align-self: flex-end; background: var(--accent-soft); max-width: 90%; }
.tmsg.assistant { background: var(--surface-2); border: 1px solid var(--border); }
.tmsg.system { color: var(--muted); font-size: .85rem; }
.chip-ask { border: 1px solid var(--border); background: var(--surface-2); color: var(--text); border-radius: 99px; padding: 4px 10px; font: inherit; font-size: .8rem; cursor: pointer; }
.chip-ask:hover { border-color: var(--accent); }
.typing { display: inline-flex; gap: 3px; vertical-align: middle; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: blink 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 50% { opacity: .2; } }
@media (max-width: 1080px) { .reader > aside.toc, .reader > aside.tutor { grid-column: auto; position: static; } }
.reader > div:first-child { grid-row: span 2; }
@media (max-width: 1080px) { .reader > div:first-child { grid-row: auto; } }
.dns td code { word-break: break-all; }
.lab-stage, .lab-shell > aside, .reader > div { min-width: 0; }
