/* ==========================================================
   Inkling — warm, friendly, a little bit bookish
   ========================================================== */
:root {
    --ink: #2b2a4c;
    --ink-soft: #5f5d80;
    --paper: #fff9f1;
    --line: #eadfce;
    --violet: #6c5ce7;
    --violet-dark: #5546c9;
    --coral: #ff7a59;
    --sun: #ffc53d;
    --sun-dark: #e0a21b;
    --leaf: #2fb67c;
    --leaf-dark: #24935f;
    --rose: #ef5d6b;
    --radius: 18px;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
    background: var(--paper);
    color: var(--ink);
    font-size: 1.05rem;
}
body.has-bottom-nav { padding-bottom: 76px; }
@media (min-width: 768px) { body.has-bottom-nav { padding-bottom: 0; } }

h1, h2, h3, .brand-name, .step-title {
    font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--ink);
}

a { color: var(--violet-dark); }
.text-muted { color: var(--ink-soft) !important; }

/* ---------- buttons ---------- */
.btn { font-weight: 800; border-radius: 14px; }
.btn-chunky {
    border-width: 0 0 4px 0;
    border-style: solid;
    padding: .7rem 1.4rem;
    transition: transform .05s ease, filter .1s ease;
}
.btn-chunky.btn-sm { padding: .4rem .9rem; border-bottom-width: 3px; }
.btn-chunky:hover { filter: brightness(1.04); }
.btn-chunky:active { transform: translateY(2px); }

.btn-primary {
    --bs-btn-bg: var(--violet); --bs-btn-border-color: var(--violet-dark);
    --bs-btn-hover-bg: var(--violet); --bs-btn-hover-border-color: var(--violet-dark);
    --bs-btn-active-bg: var(--violet-dark); --bs-btn-active-border-color: var(--violet-dark);
    --bs-btn-disabled-bg: #cfcadf; --bs-btn-disabled-border-color: #b9b3cf;
}
.btn-success {
    --bs-btn-bg: var(--leaf); --bs-btn-border-color: var(--leaf-dark);
    --bs-btn-hover-bg: var(--leaf); --bs-btn-hover-border-color: var(--leaf-dark);
    --bs-btn-active-bg: var(--leaf-dark); --bs-btn-active-border-color: var(--leaf-dark);
    --bs-btn-disabled-bg: #d9d4c9; --bs-btn-disabled-border-color: #c4bdaf;
    --bs-btn-disabled-color: #8f897c;
}
.btn-warning {
    --bs-btn-bg: var(--sun); --bs-btn-border-color: var(--sun-dark);
    --bs-btn-hover-bg: var(--sun); --bs-btn-hover-border-color: var(--sun-dark);
    --bs-btn-color: var(--ink); --bs-btn-hover-color: var(--ink);
}
.btn-light {
    --bs-btn-bg: #fff; --bs-btn-border-color: var(--line);
    --bs-btn-hover-bg: #fff; --bs-btn-hover-border-color: #d9ccb6;
    --bs-btn-color: var(--ink); --bs-btn-hover-color: var(--ink);
}
.btn-light.btn-chunky { border-width: 2px 2px 4px 2px; }

/* ---------- navigation ---------- */
.app-nav {
    background: rgba(255, 249, 241, .94);
    backdrop-filter: blur(8px);
    border-bottom: 2px solid var(--line);
    padding: .55rem 0;
    z-index: 1030;
}
.brand { display: flex; align-items: center; gap: .45rem; text-decoration: none; }
.brand-mark { font-size: 1.7rem; line-height: 1; }
.brand-name { font-size: 1.45rem; color: var(--violet-dark); }

.app-links { gap: .25rem; margin-left: 1rem; }
.app-links a {
    text-decoration: none; color: var(--ink-soft); font-weight: 800;
    padding: .45rem .85rem; border-radius: 12px;
}
.app-links a:hover { background: #f4ecdf; color: var(--ink); }
.app-links a.active { background: #efeaff; color: var(--violet-dark); }

.nav-login { font-weight: 800; text-decoration: none; color: var(--ink); }
.nav-stats { display: flex; gap: .4rem; }
.stat {
    background: #fff; border: 2px solid var(--line); border-radius: 999px;
    padding: .2rem .7rem; font-weight: 800; color: #b3ab9c; white-space: nowrap;
    filter: grayscale(1);
}
.stat.lit { color: var(--ink); filter: none; }

.avatar-btn {
    width: 42px; height: 42px; border-radius: 50%; border: 2px solid var(--line);
    background: #fff; font-size: 1.35rem; line-height: 1;
}
.dropdown-menu { border: 2px solid var(--line); border-radius: 14px; }
.dropdown-item { font-weight: 700; }

.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 1030;
    display: flex; background: #fff; border-top: 2px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav a {
    flex: 1; text-align: center; padding: .55rem 0 .45rem; text-decoration: none;
    color: var(--ink-soft); font-weight: 800; font-size: .75rem;
    display: flex; flex-direction: column; align-items: center; gap: .1rem;
}
.bottom-nav a i { font-size: 1.35rem; }
.bottom-nav a.active { color: var(--violet-dark); }

/* ---------- shared bits ---------- */
.card-soft {
    background: #fff; border: 2px solid var(--line); border-radius: var(--radius); padding: 1.25rem;
}
.page-head { margin-bottom: 1.25rem; }
.alert.gentle { border: 2px solid; border-radius: 14px; font-weight: 600; }
.alert-warning.gentle { background: #fff6dd; border-color: #ffe3a1; color: #6b5312; }
.alert-success.gentle { background: #e8f8f0; border-color: #b8e8d2; color: #1d6b48; }

.avatar-sm { font-size: 1.3rem; }
.avatar-lg {
    width: 64px; height: 64px; border-radius: 50%; background: #f4ecdf; flex: none;
    display: grid; place-items: center; font-size: 2rem;
}
.avatar-xl {
    width: 92px; height: 92px; border-radius: 50%; background: #f4ecdf; flex: none;
    display: grid; place-items: center; font-size: 3rem;
}

.fade-in { animation: fadeUp .28s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.inky-says { display: flex; gap: .7rem; align-items: flex-start; margin: 1rem 0; }
.inky-says .inky { font-size: 2.2rem; line-height: 1; flex: none; }
.inky-says .bubble {
    background: #efeaff; border-radius: 4px 16px 16px 16px; padding: .7rem 1rem; font-weight: 600;
}
.inky-hello { font-size: 3.2rem; line-height: 1; margin-bottom: .5rem; animation: bob 2.4s ease-in-out infinite; display: inline-block; }
.inky-hello.big { font-size: 4.5rem; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* ---------- landing ---------- */
.hero { padding: 2rem 0 3rem; }
.pill {
    display: inline-block; background: #ffe9e2; color: #c2482b; font-weight: 800;
    border-radius: 999px; padding: .25rem .9rem; font-size: .9rem; margin-bottom: 1rem;
}
.hero-title { font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.08; }
.underline-wave {
    text-decoration: underline wavy var(--coral); text-decoration-thickness: 3px; text-underline-offset: 8px;
}
.demo-card {
    background: #fff; border: 2px solid var(--line); border-radius: 24px; padding: 1.5rem;
    box-shadow: 0 18px 0 -8px #f1e6d4; transform: rotate(1.2deg);
}
.features, .course-preview { padding: 2rem 0; }
.feature-emoji { font-size: 2.4rem; }
.features h3 { font-size: 1.3rem; }
.unit-chip {
    display: flex; gap: .8rem; align-items: center; background: var(--unit-soft); border-radius: 16px;
    padding: .9rem 1rem; height: 100%; border: 2px solid transparent;
}
.unit-chip-emoji { font-size: 2rem; }
.closing { padding: 3rem 0 2rem; }
.big-quote { font-family: 'Fraunces', Georgia, serif; font-size: clamp(1.3rem, 3vw, 1.9rem); max-width: 760px; margin: 0 auto 1.5rem; }
.big-quote footer { font-family: 'Nunito', sans-serif; font-size: 1rem; color: var(--ink-soft); margin-top: .5rem; }

/* ---------- auth ---------- */
.auth-wrap { display: flex; justify-content: center; padding: 1rem 0 3rem; }
.auth-card {
    width: 100%; max-width: 460px; background: #fff; border: 2px solid var(--line);
    border-radius: 24px; padding: 2rem;
}
.auth-card h1 { font-size: 1.9rem; }
.form-control, .form-select { border: 2px solid var(--line); border-radius: 12px; }
.form-control:focus, .form-select:focus { border-color: var(--violet); box-shadow: 0 0 0 .2rem rgba(108, 92, 231, .15); }
.form-label { font-weight: 800; }

/* ---------- unit colours ---------- */
.unit-coral  { --unit: #ff7a59; --unit-dark: #d9583a; --unit-soft: #ffe9e2; }
.unit-teal   { --unit: #1fb5a6; --unit-dark: #15897d; --unit-soft: #dcf5f2; }
.unit-violet { --unit: #7d6cf0; --unit-dark: #5b4bd0; --unit-soft: #ebe8ff; }
.unit-amber  { --unit: #f0a81c; --unit-dark: #c4840a; --unit-soft: #fff1d1; }
.unit-sky    { --unit: #3f9ef0; --unit-dark: #2578c6; --unit-soft: #e0f0ff; }
.unit-green  { --unit: #42b96a; --unit-dark: #2e9450; --unit-soft: #e1f6e8; }

.unit-kicker { text-transform: uppercase; font-size: .75rem; font-weight: 800; letter-spacing: .06em; opacity: .85; }
.unit-banner {
    background: var(--unit); color: #fff; border-radius: var(--radius); padding: 1rem 1.25rem;
    border-bottom: 5px solid var(--unit-dark);
    display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.unit-banner h2 { color: #fff; font-size: 1.4rem; margin: 0; }
.unit-banner p { margin: .15rem 0 0; opacity: .95; font-weight: 600; }
.unit-count { background: rgba(255, 255, 255, .25); border-radius: 999px; padding: .2rem .8rem; font-weight: 800; white-space: nowrap; }

/* ---------- learning path ---------- */
.side-stack { display: flex; flex-direction: column; gap: 1rem; }
@media (min-width: 992px) { .side-stack { position: sticky; top: 84px; } }

.path { display: flex; flex-direction: column; align-items: center; gap: 1.5rem; padding: 2.4rem 0 2rem; }
.path-step { display: flex; flex-direction: column; align-items: center; text-align: center; width: 170px; }
.node {
    width: 78px; height: 78px; border-radius: 50%; display: grid; place-items: center; position: relative;
    font-size: 2rem; text-decoration: none; color: #fff;
    background: var(--unit); border-bottom: 6px solid var(--unit-dark);
    transition: transform .08s ease;
}
a.node:hover { transform: translateY(-2px); }
a.node:active { transform: translateY(3px); }
.node.done { background: var(--sun); border-bottom-color: var(--sun-dark); }
.node.locked { background: #e9e3d8; border-bottom-color: #d3cbbd; color: #a9a193; font-size: 1.4rem; cursor: not-allowed; }
.node.current { box-shadow: 0 0 0 6px var(--unit-soft); animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 6px var(--unit-soft); } 50% { box-shadow: 0 0 0 12px var(--unit-soft); } }
.node-start {
    position: absolute; top: -32px; background: #fff; color: var(--unit-dark); border: 2px solid var(--line);
    font-family: 'Nunito', sans-serif; font-weight: 800; font-size: .72rem; letter-spacing: .05em;
    padding: .15rem .6rem; border-radius: 10px; animation: bob 1.6s ease-in-out infinite; white-space: nowrap;
}
.node-label { margin-top: .45rem; font-weight: 800; font-size: .92rem; line-height: 1.2; }
.node-stars { font-size: .75rem; color: #ddd5c6; }
.node-stars .on { color: var(--sun-dark); }
.path-end { text-align: center; padding: 1rem 0 2rem; }
.path-end-emoji { font-size: 3rem; }

.goal-card { display: flex; align-items: center; gap: 1rem; }
.ring {
    --p: 0; width: 84px; height: 84px; border-radius: 50%; flex: none; display: grid; place-items: center;
    background: conic-gradient(var(--sun) calc(var(--p) * 1%), #f1e8d9 0);
}
.ring-inner { width: 64px; height: 64px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-weight: 800; }
.quote-card { background: #fff6dd; border-color: #ffe3a1; }
.quote-text { font-family: 'Fraunces', Georgia, serif; font-size: 1.15rem; margin-bottom: .4rem; }
.quote-author { color: var(--ink-soft); font-weight: 700; }
.admin-note { background: #f1efe9; border: 2px dashed #c9c2b4; border-radius: 14px; padding: .8rem 1rem; font-size: .92rem; }

/* ---------- lesson player ---------- */
.lesson-shell { max-width: 720px; margin: 0 auto; }
.lesson-header { display: flex; align-items: center; gap: .9rem; margin-bottom: 1.1rem; }
.lesson-quit { color: #b3ab9c; font-size: 1.2rem; text-decoration: none; }
.lesson-quit:hover { color: var(--ink); }
.lesson-progress { flex: 1; height: 16px; border-radius: 999px; background: #efe6d6; }
.lesson-progress .progress-bar {
    background: var(--leaf); border-radius: 999px;
    animation: fill .5s ease both;
}
@keyframes fill { from { width: var(--from, 0%); } }
.lesson-name { font-weight: 800; color: var(--ink-soft); font-size: .9rem; max-width: 38%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.lesson-card { background: #fff; border: 2px solid var(--line); border-radius: 24px; padding: 1.5rem; }
@media (min-width: 576px) { .lesson-card { padding: 2rem; } }

.kicker { display: inline-block; font-weight: 800; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; border-radius: 999px; padding: .2rem .8rem; margin-bottom: .8rem; }
.kicker-teach { background: #fff1d1; color: #8a5d00; }
.kicker-quiz { background: #ebe8ff; color: var(--violet-dark); }
.kicker-write { background: #e1f6e8; color: #1d6b48; }

.step-title { font-size: clamp(1.35rem, 3.2vw, 1.75rem); line-height: 1.25; margin-bottom: 1rem; }
.teach-body { font-size: 1.12rem; line-height: 1.65; }
.teach-body ul, .teach-body ol { padding-left: 1.3rem; }
.teach-body li { margin-bottom: .35rem; }
.recipe { background: #fff6dd; border-radius: 14px; padding: 1rem 1.1rem; font-size: 1.15rem; }
.example {
    font-family: 'Fraunces', Georgia, serif; font-size: 1.1rem; line-height: 1.55; white-space: pre-line;
    background: #faf6ee; border-left: 5px solid var(--sun); border-radius: 0 14px 14px 0;
    padding: .9rem 1.1rem; margin: 1rem 0;
}
.step-actions { display: flex; justify-content: flex-end; margin-top: 1.5rem; }
.step-actions .btn { min-width: 180px; }
@media (max-width: 575.98px) { .step-actions .btn { width: 100%; } }

/* choices */
.btn-choice {
    display: flex; align-items: center; gap: .8rem; text-align: left; width: 100%;
    background: #fff; color: var(--ink); border: 2px solid var(--line); border-bottom-width: 4px;
    border-radius: 16px; padding: .85rem 1rem; margin-bottom: .7rem; font-weight: 700;
}
.btn-choice:hover { background: #faf7ff; border-color: #cfc8f5; color: var(--ink); }
.btn-check:checked + .btn-choice, .btn-choice.picked { background: #efeaff; border-color: var(--violet); color: var(--violet-dark); }
.btn-check:focus-visible + .btn-choice { outline: 3px solid rgba(108, 92, 231, .4); outline-offset: 2px; }
.btn-choice.demo { cursor: default; }
.choice-key {
    width: 28px; height: 28px; flex: none; border: 2px solid var(--line); border-radius: 8px;
    display: grid; place-items: center; font-size: .8rem; color: var(--ink-soft); background: #fff;
}
.choice-emoji { font-size: 1.5rem; flex: none; }

/* ordering */
.order-answer {
    min-height: 66px; border: 2px dashed #d9ccb6; border-radius: 16px; padding: .6rem;
    display: flex; flex-direction: column; gap: .5rem; counter-reset: tile; margin-bottom: 1rem; background: #fdfaf4;
}
.order-answer.is-empty::before { content: 'Your order will appear here'; color: #b3ab9c; padding: .55rem .4rem; font-weight: 700; }
.order-bank { display: flex; flex-direction: column; gap: .5rem; min-height: 12px; }
.btn-tile {
    text-align: left; background: #fff; color: var(--ink); border: 2px solid var(--line); border-bottom-width: 4px;
    border-radius: 14px; padding: .7rem .9rem; font-weight: 700; display: flex; gap: .7rem; align-items: center;
}
.btn-tile:hover { background: #faf7ff; border-color: #cfc8f5; color: var(--ink); }
.order-answer .btn-tile { counter-increment: tile; border-color: var(--violet); background: #efeaff; }
.order-answer .btn-tile::before {
    content: counter(tile); width: 26px; height: 26px; flex: none; border-radius: 50%;
    background: var(--violet); color: #fff; display: grid; place-items: center; font-size: .8rem;
}

/* spot-the-word */
.spot-sentence {
    display: flex; flex-wrap: wrap; gap: .4rem .3rem; align-items: baseline;
    font-family: 'Fraunces', Georgia, serif; font-size: 1.35rem; line-height: 1.5;
    background: #faf6ee; border-radius: 16px; padding: 1rem 1.1rem; margin-bottom: .5rem;
}
.spot-token {
    padding: .15rem .45rem; border-radius: 10px; cursor: pointer;
    border: 2px solid transparent; border-bottom: 2px dashed #cfc3ad;
}
label.spot-token:hover { background: #fff; border-color: #cfc8f5; }
.btn-check:checked + .spot-token { background: #efeaff; border: 2px solid var(--violet); color: var(--violet-dark); }
.btn-check:focus-visible + .spot-token { outline: 3px solid rgba(108, 92, 231, .4); outline-offset: 2px; }
.spot-plain { padding: .15rem .1rem; border: 2px solid transparent; }

.spot-sentence.reveal { font-size: 1.2rem; background: rgba(255, 255, 255, .65); }
.spot-sentence.reveal .spot-token { cursor: default; border-bottom-style: solid; border-color: transparent; }
.spot-sentence.reveal .target { background: #c9f0dc; border-color: var(--leaf); font-weight: 700; }
.spot-sentence.reveal .missed { color: var(--ink-soft); text-decoration: line-through; text-decoration-color: var(--rose); border-color: transparent; border-bottom: 2px dashed var(--rose); }

/* writing */
.writing-area { font-family: 'Fraunces', Georgia, serif; font-size: 1.15rem; line-height: 1.6; padding: 1rem; background: #fffdf8; }
.writing-meta { display: flex; justify-content: space-between; font-size: .9rem; color: var(--ink-soft); font-weight: 700; margin-top: .4rem; }
.writing-meta .reached { color: var(--leaf-dark); }
.writing-meta .reached::after { content: ' ✓'; }
.sample { margin-top: 1rem; }
.sample summary { cursor: pointer; font-weight: 800; color: var(--violet-dark); }

/* feedback */
.feedback-panel { border-radius: 18px; padding: 1.25rem; border: 2px solid; }
.feedback-panel.correct { background: #e8f8f0; border-color: #b8e8d2; }
.feedback-panel.incorrect { background: #fff6dd; border-color: #ffe3a1; }
.feedback-panel.writing { background: #f5f3ff; border-color: #dcd6ff; }
.feedback-head { display: flex; gap: .8rem; align-items: center; margin-bottom: .8rem; }
.feedback-head h2 { font-size: 1.4rem; margin: 0; }
.feedback-icon { font-size: 2.2rem; line-height: 1; }
.feedback-sub { font-family: 'Nunito', sans-serif; font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 800; color: var(--ink-soft); margin: 1rem 0 .4rem; }
.feedback-list { list-style: none; padding: 0; margin: 0; }
.feedback-list li { padding: .3rem 0 .3rem 1.8rem; position: relative; }
.feedback-list.good li::before { content: '💚'; position: absolute; left: 0; }
.feedback-list.nudge li::before { content: '💡'; position: absolute; left: 0; }
.checklist { list-style: none; padding: 0; }
.checklist li { display: flex; gap: .6rem; align-items: flex-start; padding: .25rem 0; }
.xp-chip { display: inline-block; background: var(--sun); border-radius: 999px; padding: 0 .6rem; font-weight: 800; font-size: .85rem; margin-left: .3rem; }

.new-badges { margin-top: 1rem; display: flex; flex-direction: column; gap: .6rem; }
.new-badge {
    display: flex; gap: .8rem; align-items: center; text-align: left; background: #fff6dd; border: 2px solid #ffe3a1;
    border-radius: 16px; padding: .7rem 1rem; animation: pop .45s ease both;
}
.new-badge .badge-emoji { font-size: 2rem; }
@keyframes pop { 0% { transform: scale(.8); opacity: 0; } 70% { transform: scale(1.04); } 100% { transform: scale(1); opacity: 1; } }

/* admin bar */
.admin-bar {
    margin-top: 1rem; background: #f1efe9; border: 2px dashed #c9c2b4; border-radius: 14px; padding: .6rem .8rem;
    display: flex; flex-wrap: wrap; gap: .4rem; align-items: center;
}
.admin-jump { display: inline-flex; flex-wrap: wrap; gap: .25rem; align-items: center; margin-left: auto; }

/* completion */
.complete { background: #fff; border: 2px solid var(--line); border-radius: 24px; padding: 2rem 1.5rem; text-align: center; }
.complete h1 { font-size: 2.2rem; }
.stars { font-size: 3rem; line-height: 1; margin: .6rem 0 1.2rem; color: #e6ddcd; }
.star { display: inline-block; }
.star.on { color: var(--sun); animation: pop .5s ease both; text-shadow: 0 3px 0 var(--sun-dark); }
.complete-stats { max-width: 520px; margin: 0 auto 1rem; }
.stat-tile { border-radius: 16px; padding: .8rem .5rem; border: 2px solid; height: 100%; text-align: center; background: #fff; }
.stat-tile.xp { border-color: #ffe3a1; background: #fff9e8; }
.stat-tile.streak { border-color: #ffd0c2; background: #fff1ec; }
.stat-tile.goal { border-color: #dcd6ff; background: #f5f3ff; }
.stat-tile.words { border-color: #b8e8d2; background: #eefaf4; }
.stat-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 800; color: var(--ink-soft); }
.stat-value { font-size: 1.35rem; font-weight: 800; white-space: nowrap; }
.stat-note { font-size: .75rem; color: var(--ink-soft); }
.complete-actions { display: flex; flex-direction: column; gap: .7rem; max-width: 420px; margin: 1.5rem auto 0; }

.confetti-layer { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 2000; }
.confetti-layer i { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 3px; animation: confetti-fall linear forwards; }
@keyframes confetti-fall { to { transform: translateY(110vh) rotate(720deg); opacity: .9; } }

/* ---------- onboarding ---------- */
.onboard-shell { max-width: 600px; margin: 0 auto; }
.onboard-card { background: #fff; border: 2px solid var(--line); border-radius: 24px; padding: 1.5rem; }
@media (min-width: 576px) { .onboard-card { padding: 2rem; } }
.onboard-title { font-size: 1.7rem; margin-bottom: .6rem; }
.onboard-dots { display: flex; gap: .4rem; margin-bottom: 1.2rem; }
.onboard-dots span { flex: 1; height: 8px; border-radius: 999px; background: #efe6d6; }
.onboard-dots span.on { background: var(--leaf); }
.option-grid.two-col { display: grid; grid-template-columns: 1fr; column-gap: .7rem; }
@media (min-width: 576px) { .option-grid.two-col { grid-template-columns: 1fr 1fr; } }
.avatar-grid { display: flex; flex-wrap: wrap; gap: .5rem; }
.avatar-option {
    width: 52px; height: 52px; border-radius: 14px; border: 2px solid var(--line); border-bottom-width: 4px;
    display: grid; place-items: center; font-size: 1.6rem; cursor: pointer; background: #fff;
}
.btn-check:checked + .avatar-option { border-color: var(--violet); background: #efeaff; }
.btn-check:focus-visible + .avatar-option { outline: 3px solid rgba(108, 92, 231, .4); }
.promise-list { list-style: none; padding: 0; margin: 1rem 0 1.5rem; }
.promise-list li { display: flex; gap: .8rem; align-items: flex-start; padding: .5rem 0; }
.promise-list li > span { font-size: 1.6rem; line-height: 1.2; }

/* ---------- notebook ---------- */
.notebook-tabs { gap: .4rem; margin-bottom: 1rem; }
.notebook-tabs .nav-link { font-weight: 800; color: var(--ink-soft); border-radius: 12px; }
.notebook-tabs .nav-link.active { background: #efeaff; color: var(--violet-dark); }
.slot { background: #fff; border: 2px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; height: 100%; }
.slot.empty { background: transparent; border-style: dashed; }
.slot-head { font-weight: 800; margin-bottom: .5rem; }
.slot-empty { color: var(--ink-soft); font-size: .95rem; }
.entry-text { font-family: 'Fraunces', Georgia, serif; font-size: 1.08rem; line-height: 1.6; white-space: pre-wrap; }
.entry-meta { display: flex; justify-content: space-between; align-items: center; font-size: .82rem; color: var(--ink-soft); margin-top: .6rem; font-weight: 700; }

/* ---------- leaderboard ---------- */
.board { max-width: 640px; }
.board-list { list-style: none; padding: 0; margin: 0; }
.board-row { display: flex; align-items: center; gap: .8rem; padding: .7rem .6rem; border-radius: 14px; }
.board-row + .board-row { border-top: 1px solid #f1e8d9; }
.board-row.me { background: #efeaff; }
.board-rank { width: 2rem; text-align: center; font-weight: 800; color: var(--ink-soft); }
.board-name { flex: 1; font-weight: 800; }
.board-streak { font-size: .9rem; font-weight: 700; color: var(--ink-soft); }
.board-xp { font-weight: 800; white-space: nowrap; }

/* ---------- profile ---------- */
.profile-head { display: flex; align-items: center; gap: 1.2rem; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem; }
.badge-card { border: 2px dashed var(--line); border-radius: 16px; padding: .9rem .7rem; text-align: center; opacity: .6; }
.badge-card.earned { border-style: solid; border-color: #ffe3a1; background: #fff9e8; opacity: 1; }
.badge-card .badge-emoji { font-size: 2rem; }
.badge-title { font-weight: 800; }
.badge-desc { font-size: .8rem; color: var(--ink-soft); }

/* ---------- admin ---------- */
.admin-table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); }
.content-lesson { background: #fff; border: 2px solid var(--line); border-radius: 16px; padding: .8rem 1rem; margin-top: .7rem; }
.content-lesson summary { display: flex; justify-content: space-between; align-items: center; gap: 1rem; cursor: pointer; }
.content-steps > li { padding: .8rem 0; border-top: 1px solid #f1e8d9; }
.content-body { margin-top: .4rem; }
.content-options { margin: .4rem 0; }
ul.content-options { list-style: none; padding-left: .5rem; }
.content-options .right { font-weight: 800; color: var(--leaf-dark); }
.kind-Teach { background: #8a5d00; }
.kind-Choice { background: var(--violet-dark); }
.kind-Order { background: #2578c6; }
.kind-Write { background: var(--leaf-dark); }
.kind-Spot { background: #c2482b; }

/* ---------- toasts ---------- */
#toast-zone { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 2100; width: min(92vw, 420px); }
.toast-note { background: var(--ink); color: #fff; border-radius: 14px; padding: .8rem 1rem; font-weight: 700; text-align: center; animation: fadeUp .25s ease both; }

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

/* extra unit colours */
.unit-rose   { --unit: #e8638c; --unit-dark: #c2436b; --unit-soft: #fde6ee; }
.unit-indigo { --unit: #5468d4; --unit-dark: #3d4fb0; --unit-soft: #e4e8fb; }
.unit-slate  { --unit: #5f7d8c; --unit-dark: #47626f; --unit-soft: #e4edf1; }
.unit-berry  { --unit: #a45ad1; --unit-dark: #8341ad; --unit-soft: #f1e4fa; }

/* part dividers on the path */
.part-divider { text-align: center; padding: 1.5rem 1rem 1.25rem; }
.part-divider:not(:first-child) { margin-top: 1rem; border-top: 2px dashed var(--line); padding-top: 2.5rem; }
.part-name { display: inline-block; background: var(--ink); color: #fff; font-weight: 800; font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; border-radius: 999px; padding: .2rem .9rem; margin-bottom: .5rem; }
.part-divider h2 { font-size: 1.7rem; margin-bottom: .25rem; }
.part-divider p { color: var(--ink-soft); max-width: 460px; margin: 0 auto; }

/* "Go deeper" fold-out on teaching cards */
.go-deeper { margin: 1rem 0; border: 2px dashed var(--line); border-radius: 14px; padding: .7rem 1rem; background: #fdfaf4; }
.go-deeper summary { cursor: pointer; font-weight: 800; color: var(--violet-dark); }
.go-deeper[open] summary { margin-bottom: .5rem; }
.go-deeper div { font-size: 1rem; line-height: 1.6; color: var(--ink-soft); }

/* craft radar */
.radar { width: 100%; max-width: 320px; }
.radar-ring { fill: none; stroke: var(--line); stroke-width: 1.5; }
.radar-axis { stroke: var(--line); stroke-width: 1; }
.radar-shape { fill: rgba(108, 92, 231, .25); stroke: var(--violet); stroke-width: 2.5; stroke-linejoin: round; }
.radar-label { font-size: 20px; }

.skill-list { list-style: none; padding: 0; margin: 0; }
.skill-row { display: flex; align-items: center; gap: .8rem; padding: .6rem 0; }
.skill-row + .skill-row { border-top: 1px solid #f1e8d9; }
.skill-row.stale .skill-fill { background: #cfc8bb; }
.skill-emoji { font-size: 1.5rem; width: 2rem; text-align: center; flex: none; }
.skill-body { flex: 1; min-width: 0; }
.skill-bar { height: 10px; border-radius: 999px; background: #efe6d6; margin: .3rem 0; overflow: hidden; }
.skill-fill { height: 100%; border-radius: 999px; background: var(--violet); transition: width .4s ease; }
.skill-trend { font-weight: 800; margin-left: .3rem; }
.skill-trend.up { color: var(--leaf-dark); }
.skill-trend.down { color: var(--rose); }
.skill-stale { color: #a59f92; margin-left: .3rem; }
.practice-card { background: #f5f3ff; border-color: #dcd6ff; }

/* revision */
.revise-notes { background: #fff6dd; border: 2px solid #ffe3a1; border-radius: 14px; padding: .8rem 1rem; margin-bottom: 1rem; }
.revise-notes ul { padding-left: 1.2rem; margin-top: .3rem; }

.delta-table { width: 100%; border-collapse: collapse; margin: .5rem 0 1rem; background: rgba(255, 255, 255, .7); border-radius: 12px; overflow: hidden; }
.delta-table th, .delta-table td { padding: .5rem .7rem; text-align: left; border-bottom: 1px solid rgba(0, 0, 0, .06); }
.delta-table thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); }
.delta-table tbody th { font-weight: 700; }
.delta-table td { font-weight: 800; white-space: nowrap; }
.delta-table tr.focus th::after { content: ' ★'; color: var(--sun-dark); }
.delta-table .verdict { font-size: .85rem; color: var(--ink-soft); }
.delta-table .verdict.up { color: var(--leaf-dark); }
.delta-table .verdict.down { color: var(--rose); }

.diff { font-family: 'Fraunces', Georgia, serif; font-size: 1.05rem; line-height: 1.7; margin: .6rem 0 0; }
.diff ins, .diff del, .diff span { margin-right: .25em; }
.diff ins { background: #c9f0dc; text-decoration: none; border-radius: 4px; padding: 0 .15em; }
.diff del { background: #ffe0e3; color: #a4535b; border-radius: 4px; padding: 0 .15em; }
