/* =========================================================================
   Applied AI Architect — "Study Room" design system
   Built for long learning sessions: low-glare warm ivory (no pure white),
   deep sage accent, serif reading prose, dim warm-charcoal dark mode
   (no blue-black). Light + dark aware, mobile-first.
   ========================================================================= */

:root {
    /* canvas */
    --paper:        #f5f2e9;
    --surface:      #fcfaf4;
    --surface-2:    #efebdf;
    --border:       #e1dbcb;
    --border-soft:  #e9e4d6;

    /* ink — warm dark gray, never pure black */
    --ink:          #2e2d27;
    --ink-soft:     #56534a;
    --muted:        #8b8678;

    /* sage — calm, focus-friendly primary */
    --accent:       #3e7160;
    --accent-deep:  #2f5a4c;
    --accent-tint:  #e3ede4;
    --on-accent:    #fdfcf6;

    /* semantic */
    --sky:          #5c7a99;
    --good:         #3f8464;
    --good-tint:    #e1efe4;
    --bad:          #a9584b;
    --bad-tint:     #f3e3dd;
    --warn:         #a8823c;

    /* code blocks — warm dark slate in both themes */
    --code-bg:      #2a2922;
    --code-ink:     #ece7d8;

    --shadow:       0 1px 2px rgba(46,45,39,.04), 0 10px 30px rgba(46,45,39,.07);
    --shadow-lift:  0 2px 6px rgba(46,45,39,.06), 0 16px 40px rgba(46,45,39,.12);
    --radius:       18px;
    --radius-sm:    12px;
    --tap:          44px;
    --maxw:         720px;
    --font:         -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --serif:        "Charter", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}

/* Dark palette — warm charcoal, dimmed off-white ink, desaturated sage.
   Applied when the system is dark (and the user hasn't forced light),
   or when the user explicitly forces dark via the in-app toggle. */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --paper:       #1c1b17;
        --surface:     #26241e;
        --surface-2:   #2e2b24;
        --border:      #3b3830;
        --border-soft: #34312a;
        --ink:         #e7e3d5;
        --ink-soft:    #c3bdac;
        --muted:       #8f8a7a;
        --accent:      #8abaa4;
        --accent-deep: #a3ccb9;
        --accent-tint: #2a352e;
        --on-accent:   #181f1a;
        --sky:         #94b0c8;
        --good:        #8cc3a6;
        --good-tint:   #263429;
        --bad:         #d08f7f;
        --bad-tint:    #3a2a25;
        --warn:        #c8a35e;
        --code-bg:     #232219;
        --code-ink:    #ddd8c8;
        --shadow:      0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.35);
        --shadow-lift: 0 2px 6px rgba(0,0,0,.35), 0 16px 40px rgba(0,0,0,.45);
    }
}
:root[data-theme="dark"] {
    --paper:       #1c1b17;
    --surface:     #26241e;
    --surface-2:   #2e2b24;
    --border:      #3b3830;
    --border-soft: #34312a;
    --ink:         #e7e3d5;
    --ink-soft:    #c3bdac;
    --muted:       #8f8a7a;
    --accent:      #8abaa4;
    --accent-deep: #a3ccb9;
    --accent-tint: #2a352e;
    --on-accent:   #181f1a;
    --sky:         #94b0c8;
    --good:        #8cc3a6;
    --good-tint:   #263429;
    --bad:         #d08f7f;
    --bad-tint:    #3a2a25;
    --warn:        #c8a35e;
    --code-bg:     #232219;
    --code-ink:    #ddd8c8;
    --shadow:      0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.35);
    --shadow-lift: 0 2px 6px rgba(0,0,0,.35), 0 16px 40px rgba(0,0,0,.45);
}
/* :root[data-theme="light"] keeps the default light variables above,
   overriding the system-dark media query. */

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font);
    background: var(--paper);
    color: var(--ink);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overscroll-behavior-y: none;
}

button, input, select { font-family: inherit; font-size: inherit; }
a { color: var(--accent); text-decoration: none; }

::selection { background: var(--accent-tint); color: var(--ink); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
button:focus:not(:focus-visible), input:focus:not(:focus-visible) { outline: none; }

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

/* --- App frame ----------------------------------------------------------- */

#app { min-height: 100dvh; }

.boot {
    min-height: 100dvh; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 14px; color: var(--muted);
}
.boot-logo { font-size: 44px; color: var(--accent); animation: breathe 2.2s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { opacity: .35; transform: scale(.92); } 50% { opacity: 1; transform: scale(1.06); } }

.screen {
    max-width: var(--maxw); margin: 0 auto;
    padding: 0 20px calc(110px + env(safe-area-inset-bottom));
}

/* --- Top bar -------------------------------------------------------------- */

.topbar {
    position: sticky; top: 0; z-index: 40;
    background: color-mix(in srgb, var(--paper) 86%, transparent);
    backdrop-filter: saturate(150%) blur(14px);
    -webkit-backdrop-filter: saturate(150%) blur(14px);
    border-bottom: 1px solid color-mix(in srgb, var(--border) 65%, transparent);
    padding: calc(env(safe-area-inset-top) + 10px) 18px 10px;
    display: flex; align-items: center; gap: 10px;
}
.topbar .back {
    width: var(--tap); height: var(--tap); margin: -8px 0 -8px -10px;
    display: flex; align-items: center; justify-content: center;
    background: none; border: none; color: var(--ink); font-size: 22px; cursor: pointer;
    border-radius: 12px;
}
.topbar .back:active { background: var(--surface-2); }
.topbar h1 { font-size: 16.5px; font-weight: 650; letter-spacing: -.01em; flex: 1;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .spacer { flex: 1; }

/* language toggle — present on every screen, switches content in place */
.lang-btn {
    flex: none; min-width: 44px; height: 34px; padding: 0 13px; margin: -4px -4px -4px 0;
    border: 1px solid var(--border); background: var(--surface); color: var(--accent);
    border-radius: 999px; font-weight: 700; font-size: 12.5px; letter-spacing: .05em; cursor: pointer;
    box-shadow: 0 1px 2px rgba(46,45,39,.05);
}
.lang-btn:active { filter: brightness(.96); }
.auth-lang { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 4px; }

/* theme toggle — cycles System → Light → Dark */
.theme-btn {
    flex: none; width: 34px; height: 34px; margin: -4px 0; padding: 0;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--border); background: var(--surface); color: var(--accent);
    border-radius: 999px; font-size: 15px; line-height: 1; cursor: pointer;
    box-shadow: 0 1px 2px rgba(46,45,39,.05);
}
.theme-btn:active { filter: brightness(.96); }

/* segmented control (Account screen, quiz length) */
.seg { display: inline-flex; padding: 3px; gap: 2px;
    background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 999px; }
.seg button { border: none; background: none; color: var(--muted); font-size: 13px;
    font-weight: 600; padding: 6px 13px; cursor: pointer; border-radius: 999px;
    transition: background .15s, color .15s; }
.seg button.on { background: var(--surface); color: var(--accent);
    box-shadow: 0 1px 3px rgba(46,45,39,.12); }

/* --- Bottom nav — floating pill ------------------------------------------ */

.tabbar {
    position: fixed; z-index: 50;
    left: max(14px, env(safe-area-inset-left));
    right: max(14px, env(safe-area-inset-right));
    bottom: calc(env(safe-area-inset-bottom) + 12px);
    max-width: 520px; margin: 0 auto;
    display: flex;
    background: color-mix(in srgb, var(--surface) 90%, transparent);
    backdrop-filter: saturate(160%) blur(16px);
    -webkit-backdrop-filter: saturate(160%) blur(16px);
    border: 1px solid var(--border-soft);
    border-radius: 24px;
    box-shadow: var(--shadow-lift);
    padding: 6px;
}
.tabbar button {
    flex: 1; background: none; border: none; cursor: pointer;
    padding: 7px 0 6px; min-height: var(--tap); border-radius: 18px;
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    color: var(--muted); font-size: 11px; font-weight: 600;
    transition: background .15s, color .15s;
}
.tabbar button .ic { font-size: 20px; line-height: 1.1; }
.tabbar button.active { color: var(--accent); background: var(--accent-tint); }

/* --- Hero / headings ----------------------------------------------------- */

.hero { padding: 30px 0 10px; }
.hero .eyebrow { color: var(--accent); font-weight: 700; font-size: 12px;
    letter-spacing: .09em; text-transform: uppercase; }
.hero h2 { font-family: var(--serif); font-size: 30px; line-height: 1.18;
    letter-spacing: -.01em; margin: 8px 0 10px; font-weight: 700; }
.hero p { color: var(--ink-soft); font-size: 15.5px; max-width: 54ch; }

.section-title { font-size: 12.5px; font-weight: 700; color: var(--muted);
    text-transform: uppercase; letter-spacing: .08em; margin: 30px 4px 12px; }

/* --- Cards --------------------------------------------------------------- */

.card {
    background: var(--surface); border: 1px solid var(--border-soft);
    border-radius: var(--radius); box-shadow: var(--shadow);
}

.module-card {
    display: flex; align-items: center; gap: 14px; padding: 16px;
    margin-bottom: 12px; cursor: pointer; -webkit-tap-highlight-color: transparent;
    transition: transform .12s ease, box-shadow .12s ease;
}
.module-card:active { transform: scale(.985); }
.module-card .emoji {
    width: 50px; height: 50px; flex: none; border-radius: 15px;
    background: linear-gradient(150deg, var(--accent-tint), color-mix(in srgb, var(--accent-tint) 55%, var(--surface)));
    border: 1px solid color-mix(in srgb, var(--accent) 14%, transparent);
    display: flex; align-items: center; justify-content: center;
    font-size: 25px;
}
.module-card .body { flex: 1; min-width: 0; }
.module-card .body .idx { font-size: 11px; font-weight: 700; color: var(--accent);
    letter-spacing: .07em; text-transform: uppercase; }
.module-card .body h3 { font-size: 16px; font-weight: 650; letter-spacing: -.01em; margin: 2px 0 3px; }
.module-card .body .meta { font-size: 12.5px; color: var(--muted); }
.module-card .ring { flex: none; }
.module-card.done .emoji { background: var(--good-tint);
    border-color: color-mix(in srgb, var(--good) 20%, transparent); }

/* --- Progress ring ------------------------------------------------------- */

.ring { position: relative; width: 40px; height: 40px; }
.ring svg { transform: rotate(-90deg); }
.ring .track { stroke: var(--surface-2); }
.ring .fill { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .6s ease; }
.ring.complete .fill { stroke: var(--good); }
.ring .label { position: absolute; inset: 0; display: flex; align-items: center;
    justify-content: center; font-size: 10.5px; font-weight: 700; color: var(--ink-soft); }
.ring .label.check { color: var(--good); font-size: 17px; }

/* --- Overall progress banner --------------------------------------------- */

.overall {
    display: flex; align-items: center; gap: 18px; padding: 20px; margin-top: 8px;
    background: linear-gradient(140deg, var(--accent) 0%, var(--accent-deep) 100%);
    color: var(--on-accent); border-radius: var(--radius); box-shadow: var(--shadow-lift);
}
.overall .ring .track { stroke: color-mix(in srgb, var(--on-accent) 26%, transparent); }
.overall .ring .fill { stroke: var(--on-accent); }
.overall .ring .label { color: var(--on-accent); }
.overall .txt h3 { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.overall .txt p { font-size: 13px; opacity: .88; }

/* --- Lesson list --------------------------------------------------------- */

.lesson-row {
    display: flex; align-items: center; gap: 13px; padding: 15px 16px;
    border-bottom: 1px solid var(--border-soft); cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.lesson-row:last-child { border-bottom: none; }
.lesson-row:active { background: var(--surface-2); }
.lesson-row .tick {
    width: 26px; height: 26px; flex: none; border-radius: 50%;
    border: 2px solid var(--border); display: flex; align-items: center; justify-content: center;
    font-size: 14px; color: transparent; transition: background .2s, border-color .2s;
}
.lesson-row.done .tick { background: var(--good); border-color: var(--good); color: var(--surface); }
.lesson-row .body { flex: 1; min-width: 0; }
.lesson-row .body h4 { font-size: 15px; font-weight: 570; letter-spacing: -.01em; }
.lesson-row .body .meta { font-size: 12px; color: var(--muted); margin-top: 1px; }
.lesson-row .chev { color: var(--muted); font-size: 18px; }

/* --- Buttons ------------------------------------------------------------- */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 48px; padding: 0 22px; border-radius: 15px; border: none;
    background: var(--accent); color: var(--on-accent); font-weight: 650; font-size: 15px;
    cursor: pointer; width: 100%; transition: filter .12s, transform .12s;
    box-shadow: 0 1px 2px rgba(46,45,39,.1);
}
.btn:active { transform: scale(.98); filter: brightness(.94); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn.secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--border); box-shadow: none; }
.btn.ghost { background: none; color: var(--accent); box-shadow: none; }
.btn.good { background: var(--good); color: var(--on-accent); }

/* --- Lesson reader (prose) — tuned for long, comfortable reading --------- */

.reader { padding-top: 14px; }
.reader .lead { color: var(--muted); font-size: 12.5px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .07em; }
.reader h2.title { font-family: var(--serif); font-size: 28px; line-height: 1.22;
    letter-spacing: -.01em; margin: 8px 0 20px; }

.prose {
    font-family: var(--serif);
    font-size: 17.5px; line-height: 1.75; color: var(--ink);
    max-width: 66ch;
}
.prose h3 { font-family: var(--font); font-size: 19px; letter-spacing: -.01em;
    margin: 30px 0 10px; line-height: 1.3; }
.prose h4 { font-family: var(--font); font-size: 16px; margin: 22px 0 8px; color: var(--ink); }
.prose p { margin: 14px 0; color: var(--ink-soft); }
.prose ul, .prose ol { margin: 14px 0 14px 24px; color: var(--ink-soft); }
.prose li { margin: 7px 0; }
.prose li::marker { color: var(--accent); }
.prose strong { color: var(--ink); font-weight: 650; }
.prose code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82em;
    background: var(--surface-2); border: 1px solid var(--border-soft);
    padding: 1px 6px; border-radius: 6px; color: var(--ink);
}
.prose pre {
    background: var(--code-bg); color: var(--code-ink); border-radius: 14px; padding: 16px;
    overflow-x: auto; margin: 18px 0; font-size: 13.5px; line-height: 1.6;
    -webkit-overflow-scrolling: touch;
}
.prose pre code { background: none; border: none; padding: 0; color: inherit; font-size: 13.5px; }
.prose blockquote {
    border-left: 3px solid var(--accent); background: var(--accent-tint);
    padding: 13px 17px; margin: 18px 0; border-radius: 0 12px 12px 0; color: var(--ink-soft);
}
.prose table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 14px;
    font-family: var(--font); display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.prose th { background: var(--surface-2); font-weight: 650; }

/* --- Takeaways ----------------------------------------------------------- */

.takeaways { margin: 30px 0; padding: 20px;
    background: linear-gradient(150deg, var(--accent-tint), color-mix(in srgb, var(--accent-tint) 40%, var(--surface)));
    border: 1px solid color-mix(in srgb, var(--accent) 16%, transparent);
    border-radius: var(--radius); }
.takeaways h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em;
    color: var(--accent); margin-bottom: 10px; }
.takeaways ul { list-style: none; }
.takeaways li { display: flex; gap: 10px; padding: 6px 0; font-size: 15px;
    line-height: 1.55; color: var(--ink-soft); }
.takeaways li::before { content: "✦"; color: var(--accent); flex: none; }

/* --- Hands-on practice ---------------------------------------------------- */

.practice { margin: 28px 0; }
.practice > h3 { font-size: 18px; margin-bottom: 4px; }
.practice .psub { color: var(--muted); font-size: 13.5px; margin-bottom: 14px; }
.task {
    background: var(--surface); border: 1px solid var(--border-soft);
    border-left: 3px solid var(--warn);
    border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 15px 17px; margin-bottom: 12px;
}
.task .t-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.task .t-num {
    width: 24px; height: 24px; flex: none; border-radius: 50%;
    background: color-mix(in srgb, var(--warn) 16%, var(--surface));
    color: var(--warn); font-size: 12.5px; font-weight: 750;
    display: flex; align-items: center; justify-content: center;
}
.task .t-head h4 { font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.task .t-body.prose { font-family: var(--font); font-size: 14.5px; line-height: 1.65; max-width: none; }
.task .t-body.prose p { margin: 8px 0; }
.task .t-body.prose ul, .task .t-body.prose ol { margin: 8px 0 8px 20px; }
.task .t-body.prose li { margin: 4px 0; }
.task .t-body.prose pre { margin: 10px 0; font-size: 12.5px; }

/* --- Quiz ---------------------------------------------------------------- */

.quiz { margin: 28px 0; }
.quiz > h3 { font-size: 18px; margin-bottom: 4px; }
.quiz .qsub { color: var(--muted); font-size: 13.5px; margin-bottom: 14px; }
.qcard { background: var(--surface); border: 1px solid var(--border-soft);
    border-radius: var(--radius); box-shadow: var(--shadow); padding: 17px; margin-bottom: 14px; }
.qcard .q { font-weight: 600; font-size: 15.5px; line-height: 1.5; margin-bottom: 13px; }
.opt {
    display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
    padding: 12px 14px; margin-bottom: 8px; border: 1.5px solid var(--border);
    background: var(--surface); border-radius: 13px; cursor: pointer; color: var(--ink);
    font-size: 14.5px; line-height: 1.45; min-height: var(--tap);
    transition: border-color .12s, background .12s;
}
.opt .mark { width: 22px; height: 22px; flex: none; border-radius: 50%;
    border: 2px solid var(--border); display: flex; align-items: center; justify-content: center;
    font-size: 13px; color: transparent; }
.opt.correct { border-color: var(--good); background: var(--good-tint); }
.opt.correct .mark { background: var(--good); border-color: var(--good); color: var(--surface); }
.opt.wrong { border-color: var(--bad); background: var(--bad-tint); }
.opt.wrong .mark { background: var(--bad); border-color: var(--bad); color: var(--surface); }
.opt[disabled] { cursor: default; }
.explain { font-size: 13.5px; line-height: 1.6; color: var(--ink-soft); margin-top: 8px;
    padding: 11px 13px; background: var(--surface-2); border-radius: 11px; }
.explain strong { color: var(--good); }

/* --- Auth ---------------------------------------------------------------- */

.auth { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center;
    max-width: 420px; margin: 0 auto; padding: 32px 22px; }
.auth .brand { text-align: center; margin-bottom: 28px; }
.auth .brand .mark { font-size: 40px; color: var(--accent); }
.auth .brand h1 { font-family: var(--serif); font-size: 26px; letter-spacing: -.01em; margin-top: 10px; }
.auth .brand p { color: var(--muted); font-size: 14.5px; margin-top: 8px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }
.field input {
    width: 100%; min-height: var(--tap); padding: 0 15px; border-radius: 13px;
    border: 1.5px solid var(--border); background: var(--surface); color: var(--ink); font-size: 16px;
    transition: border-color .12s;
}
.field input:focus { outline: none; border-color: var(--accent); }
.field select {
    width: 100%; min-height: var(--tap); padding: 0 15px; border-radius: 13px;
    border: 1.5px solid var(--border); background-color: var(--surface); color: var(--ink);
    font-size: 16px; -webkit-appearance: none; appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
        linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position: right 18px center, right 13px center;
    background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
.field select:focus { outline: none; border-color: var(--accent); }
.seg.wide { display: flex; width: 100%; }
.seg.wide button { flex: 1; }
.auth .switch { text-align: center; margin-top: 18px; font-size: 14px; color: var(--muted); }
.auth .switch button { background: none; border: none; color: var(--accent); font-weight: 650; cursor: pointer; }
.formerr { background: var(--bad-tint); color: var(--bad); border-radius: 12px;
    padding: 11px 14px; font-size: 13.5px; margin-bottom: 14px; }

/* --- Profile ------------------------------------------------------------- */

.profile-head { text-align: center; padding: 32px 0 8px; }
.profile-head .avatar { width: 78px; height: 78px; border-radius: 50%; margin: 0 auto 12px;
    background: linear-gradient(140deg, var(--accent), var(--accent-deep));
    color: var(--on-accent); display: flex; align-items: center; justify-content: center;
    font-size: 30px; font-weight: 700; box-shadow: var(--shadow); }
.profile-head h2 { font-family: var(--serif); font-size: 22px; }
.profile-head p { color: var(--muted); font-size: 14px; }

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 20px 0; }
.stat { background: var(--surface); border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm); box-shadow: var(--shadow);
    padding: 16px 10px; text-align: center; }
.stat .n { font-size: 24px; font-weight: 750; color: var(--accent); letter-spacing: -.02em; }
.stat .l { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

.list-card { background: var(--surface); border: 1px solid var(--border-soft);
    border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 14px; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 15px 16px;
    border-bottom: 1px solid var(--border-soft); }
.list-row:last-child { border-bottom: none; }
.list-row .ic { font-size: 19px; width: 24px; text-align: center; }
.list-row .t { flex: 1; font-size: 15px; }
.list-row .bar { flex: 1; }

.pbar { height: 8px; background: var(--surface-2); border: 1px solid var(--border-soft);
    border-radius: 99px; overflow: hidden; }
.pbar > span { display: block; height: 100%; background: var(--accent); border-radius: 99px;
    transition: width .5s ease; }
.pbar.done > span { background: var(--good); }

/* --- Misc ---------------------------------------------------------------- */

.footer-cta { margin: 30px 0 10px; display: flex; flex-direction: column; gap: 10px; }

.toast {
    position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom));
    transform: translateX(-50%) translateY(20px); opacity: 0;
    background: var(--ink); color: var(--paper); padding: 11px 18px; border-radius: 99px;
    font-size: 14px; font-weight: 550; z-index: 100; pointer-events: none;
    transition: opacity .25s, transform .25s; box-shadow: var(--shadow-lift); white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.empty { text-align: center; color: var(--muted); padding: 40px 20px; }

.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 50%, var(--surface-2) 75%);
    background-size: 200% 100%; animation: sk 1.3s infinite; border-radius: 8px; }
@keyframes sk { to { background-position: -200% 0; } }

@media (min-width: 640px) {
    .hero h2 { font-size: 34px; }
    .prose { font-size: 18px; }
}
