:root {
  --bg: #faf9f6;
  --surface: #ffffff;
  --sunken: #f3f1ec;
  --text: #1a1c1e;
  --muted: #6d6f73;
  --faint: #9c9ea2;
  --line: #ebe8e1;
  --ink: #1c2b3a;
  --ink-soft: #e8edf2;
  --on-ink: #faf9f6;
  --ok: #2d7a55;
  --ok-soft: #e6f2eb;
  --ko: #b8463b;
  --ko-soft: #f8e9e6;
  --warn: #9a6400;
  --warn-soft: #fbf1dd;
  --lv-officiel: #2d7a55;
  --lv-copie_validee: #2e7c76;
  --lv-recoupement: #3d6a9e;
  --lv-copie: #a06a00;
  --lv-etudiant: #b35a12;
  --lv-ia: #a8430f;
  --lv-aucune: #8a8d92;
  --shadow: 0 1px 2px rgba(20, 20, 20, .04), 0 8px 24px rgba(20, 20, 20, .05);
  --radius: 18px;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121416; --surface: #1b1e21; --sunken: #16181b; --text: #ecebe7; --muted: #a2a5aa; --faint: #74777c;
    --line: #2a2e33; --ink: #dfe7ef; --ink-soft: #243140; --on-ink: #121416;
    --ok: #6cc596; --ok-soft: #1a2e24; --ko: #ef8d82; --ko-soft: #35201d; --warn: #e3b25a; --warn-soft: #30271a;
    --lv-officiel: #6cc596; --lv-copie_validee: #66c3bb; --lv-recoupement: #8db6e3; --lv-copie: #e3b25a;
    --lv-etudiant: #f0a260; --lv-ia: #f08a5a; --lv-aucune: #8d9096;
    --shadow: 0 0 0 1px var(--line);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121416; --surface: #1b1e21; --sunken: #16181b; --text: #ecebe7; --muted: #a2a5aa; --faint: #74777c;
  --line: #2a2e33; --ink: #dfe7ef; --ink-soft: #243140; --on-ink: #121416;
  --ok: #6cc596; --ok-soft: #1a2e24; --ko: #ef8d82; --ko-soft: #35201d; --warn: #e3b25a; --warn-soft: #30271a;
  --lv-officiel: #6cc596; --lv-copie_validee: #66c3bb; --lv-recoupement: #8db6e3; --lv-copie: #e3b25a;
  --lv-etudiant: #f0a260; --lv-ia: #f08a5a; --lv-aucune: #8d9096;
  --shadow: 0 0 0 1px var(--line);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 16px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.2; font-weight: 600; }
p { margin: 0 0 .8em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.loading { padding: 4rem 1rem; text-align: center; color: var(--muted); }

/* ------------------------------------------------ en-tête */
.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 1.25rem; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
}
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; font-weight: 600; letter-spacing: -.01em; }
.logo {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 10px;
  background: var(--ink); color: var(--on-ink); font-family: var(--serif); font-size: 20px; line-height: 1;
}
.icon-btn {
  position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  border: 0; background: none; cursor: pointer; color: var(--text);
}
.icon-btn:hover { background: var(--sunken); }
.sync-dot { position: absolute; top: 9px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: transparent; }
.sync-dot.on { background: var(--ok); }
.sync-dot.busy { background: var(--warn); }
.sync-dot.err { background: var(--ko); }
body.focus .topbar { display: none; }

/* ------------------------------------------------ mise en page */
main { max-width: 680px; margin: 0 auto; padding: 1.5rem 1.25rem 5rem; outline: none; }
body.focus main { padding-top: 1.6rem; }
.page-head { margin: .5rem 0 1.75rem; }
.title { font-family: var(--serif); font-weight: 500; font-size: 2.3rem; letter-spacing: -.015em; line-height: 1.1; }
.subtitle { color: var(--muted); margin-top: .5rem; font-size: 1.02rem; }
.eyebrow { font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.back {
  display: inline-flex; align-items: center; gap: .35rem; color: var(--muted); text-decoration: none; font-size: .92rem;
  margin-bottom: 1rem; padding: .25rem 0;
}
.back:hover { color: var(--text); }
.section-title { font-size: .78rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); margin: 2.2rem 0 .8rem; }
.stack > * + * { margin-top: .75rem; }
.spacer { flex: 1; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.35rem 1.4rem; }

/* ------------------------------------------------ boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .7rem 1.2rem; min-height: 46px;
  border-radius: 14px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; text-decoration: none;
  font-weight: 600; font-size: .98rem; letter-spacing: -.005em; transition: background .15s, transform .05s, border-color .15s;
}
.btn:hover { background: var(--sunken); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.btn.primary:hover { background: color-mix(in srgb, var(--ink) 88%, var(--bg)); }
.btn.ghost { background: none; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--sunken); }
.btn.block { width: 100%; }
.btn.big { min-height: 56px; font-size: 1.05rem; border-radius: 16px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn:focus-visible, .opt:focus-visible, .icon-btn:focus-visible, .row-link:focus-visible, .seg button:focus-visible {
  outline: 2px solid var(--ink); outline-offset: 2px;
}
.link { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: .9rem; }
.link:hover { color: var(--text); }
.link.danger { color: var(--ko); }

/* ------------------------------------------------ accueil */
.subjects { display: grid; gap: .9rem; }
.subject { display: block; text-decoration: none; transition: transform .15s; }
.subject:hover { transform: translateY(-1px); }
.subject-top { display: flex; gap: 1rem; align-items: flex-start; justify-content: space-between; }
.subject h2 { font-size: 1.15rem; letter-spacing: -.01em; }
.subject .caption { font-size: .82rem; color: var(--faint); margin-top: .25rem; }
.grade-pill { font-family: var(--serif); font-size: 1.35rem; white-space: nowrap; }
.grade-pill small { font-family: var(--sans); font-size: .75rem; color: var(--faint); margin-left: .1rem; }
.bar { height: 6px; border-radius: 99px; background: var(--sunken); overflow: hidden; margin: 1.1rem 0 .7rem; }
.bar > span { display: block; height: 100%; background: var(--ink); border-radius: 99px; transition: width .4s; }
.subject-foot { display: flex; align-items: center; justify-content: space-between; gap: .8rem; font-size: .88rem; color: var(--muted); }
.subject-foot .go { font-weight: 600; color: var(--text); white-space: nowrap; }
.quiet-link { display: inline-block; margin-top: 1.6rem; color: var(--muted); font-size: .92rem; text-decoration: none; }
.quiet-link:hover { color: var(--text); }

/* ------------------------------------------------ matière */
.hero { padding: 1.8rem 1.6rem 1.5rem; }
.hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.6rem; }
.hero-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; text-align: center; gap: .7rem; }
.hero-col .hero-figure { height: 84px; display: flex; align-items: center; justify-content: center; font-size: 2.3rem; }
.hero-label strong { color: var(--text); font-weight: 600; }
.ring {
  --p: 0; width: 84px; height: 84px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: conic-gradient(var(--ink) calc(var(--p) * 1%), var(--sunken) 0);
}
.ring > div {
  width: 70px; height: 70px; border-radius: 50%; background: var(--surface); display: grid; place-items: center;
  font-family: var(--serif); font-size: 1.35rem;
}
.ring-unit { font-family: var(--sans); font-size: .7rem; color: var(--faint); margin-left: 1px; }
.hero-figure { font-family: var(--serif); font-size: 2rem; line-height: 1; }
.hero-figure small { font-family: var(--sans); font-size: .85rem; color: var(--faint); }
.hero-label { font-size: .85rem; color: var(--muted); line-height: 1.45; }
.hero-hint { text-align: center; font-size: .85rem; color: var(--muted); margin-top: .7rem; }
.seg-wrap { text-align: center; }
.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--sunken); margin-top: 1rem; }
.seg button { border: 0; background: none; padding: .35rem .95rem; border-radius: 9px; font-size: .85rem; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.notice { font-size: .88rem; color: var(--muted); margin: -.9rem 0 1.4rem; }
.notice a { color: var(--muted); text-underline-offset: 3px; }

.list { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.row-link {
  display: flex; align-items: center; gap: 1rem; width: 100%; padding: 1.05rem 1.3rem; text-align: left; text-decoration: none;
  background: none; border: 0; cursor: pointer;
}
.list > * + * { border-top: 1px solid var(--line); }
.row-link:hover { background: var(--sunken); }
.row-link[disabled] { opacity: .45; cursor: default; background: none; }
.rl-main { flex: 1; min-width: 0; }
.row-link strong { display: block; font-weight: 600; }
.rl-sub { display: block; font-size: .86rem; color: var(--muted); margin-top: .1rem; }
.rl-end { color: var(--faint); font-size: .9rem; white-space: nowrap; }
.chev { color: var(--faint); flex: none; }

/* ------------------------------------------------ séance */
.session-head { display: flex; align-items: center; gap: .8rem; margin: -.4rem -.4rem .7rem; }
.session-title { flex: 1; min-width: 0; text-align: center; line-height: 1.25; }
.session-title strong { display: block; font-size: .95rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.session-title span { display: block; font-size: .78rem; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.session-head .count { min-width: 40px; text-align: right; }
.session-progress { margin-bottom: 2rem; flex: none; }
.progress { flex: 1; height: 4px; background: var(--sunken); border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--ink); transition: width .3s; }
.count { font-size: .85rem; color: var(--faint); font-variant-numeric: tabular-nums; }
.meta { display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: center; justify-content: space-between; font-size: .8rem; color: var(--faint); margin-bottom: .9rem; }
.lvl { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; font-size: .8rem; cursor: help; }
.lvl::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.lv-officiel { color: var(--lv-officiel); } .lv-copie_validee { color: var(--lv-copie_validee); }
.lv-recoupement { color: var(--lv-recoupement); } .lv-copie { color: var(--lv-copie); }
.lv-etudiant { color: var(--lv-etudiant); } .lv-ia { color: var(--lv-ia); } .lv-aucune { color: var(--lv-aucune); }
.enonce { font-size: 1.28rem; font-weight: 600; line-height: 1.4; letter-spacing: -.01em; margin: 0 0 1.4rem; white-space: pre-line; }
.hint { font-size: .82rem; color: var(--faint); margin: -.8rem 0 1rem; }
.context { background: var(--sunken); border-radius: 14px; padding: .1rem 1rem; margin-bottom: 1.2rem; font-size: .94rem; }
.context summary { cursor: pointer; font-weight: 600; font-size: .88rem; color: var(--muted); padding: .7rem 0; }
.context .rich { padding-bottom: .8rem; }
.opts { display: grid; gap: .6rem; }
.opt {
  display: flex; gap: .9rem; align-items: flex-start; width: 100%; text-align: left; padding: .95rem 1.05rem; line-height: 1.45;
  border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface); cursor: pointer; transition: border-color .12s, background .12s;
}
.opt:hover:not([disabled]) { border-color: color-mix(in srgb, var(--ink) 40%, var(--line)); }
.opt .letter {
  flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  border: 1.5px solid var(--line); font-weight: 600; font-size: .8rem; color: var(--muted);
}
.opts:not(.single) .opt .letter { border-radius: 7px; }   /* cases à cocher : carré ; une seule réponse : rond */
.opt.sel { border-color: var(--ink); background: var(--ink-soft); }
.opt.sel .letter { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.opt[disabled] { cursor: default; }
.opt.good { border-color: var(--ok); background: var(--ok-soft); }
.opt.good .letter { background: var(--ok); border-color: var(--ok); color: var(--surface); }
.opt.missed { border-color: var(--ok); border-style: dashed; }
.opt.missed .letter { border-color: var(--ok); color: var(--ok); }
.opt.alt { border-color: var(--ok); border-style: dashed; }
.opt.bad { border-color: var(--ko); background: var(--ko-soft); }
.opt.bad .letter { background: var(--ko); border-color: var(--ko); color: var(--surface); }
textarea.answer {
  width: 100%; min-height: 140px; padding: .9rem 1rem; border-radius: 14px; border: 1.5px solid var(--line);
  background: var(--surface); color: var(--text); font: inherit; resize: vertical;
}
textarea.answer:focus { outline: none; border-color: var(--ink); }
.dock {
  position: sticky; bottom: 0; margin: 1.6rem -1.25rem 0; padding: 1rem 1.25rem calc(1rem + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 72%, transparent); display: flex; gap: .6rem; align-items: stretch;
}
.dock .btn.primary { flex: 1; }
.verdict { font-weight: 600; font-size: 1.05rem; margin: 1.4rem 0 .2rem; }
.verdict.ok { color: var(--ok); } .verdict.mid { color: var(--warn); } .verdict.ko { color: var(--ko); }
.verdict.none { color: var(--muted); font-weight: 500; font-size: .95rem; }
.answer-block { margin-top: 1.1rem; padding: 1.1rem 1.2rem; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); }
.answer-block .eyebrow { margin-bottom: .45rem; }
.answer-block img { max-width: 100%; border-radius: 10px; margin-top: .6rem; background: #fff; }
.source { margin-top: 1rem; font-size: .84rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: .3rem .7rem; align-items: baseline; }
.alerte { margin-top: .9rem; font-size: .88rem; background: var(--warn-soft); border-radius: 12px; padding: .75rem .9rem; }
.note { margin-top: .7rem; font-size: .86rem; color: var(--muted); }
.selfeval { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; flex: 1; }
.selfeval .btn { padding: .6rem .4rem; font-size: .9rem; }
.grades { display: grid; grid-template-columns: repeat(4, 1fr); gap: .45rem; flex: 1; }
.grade { flex-direction: column; gap: 0; padding: .45rem .2rem; min-height: 56px; font-size: .92rem; }
.grade small { font-weight: 500; color: var(--faint); font-size: .75rem; }
.grade.g0 { color: var(--ko); } .grade.g3 { color: var(--ok); }
.kbd { font-size: .76rem; color: var(--faint); text-align: center; margin-top: .2rem; }
kbd { font-family: inherit; font-size: .72rem; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 .3rem; }
@media (max-width: 520px) {
  .title { font-size: 1.95rem; }
  .enonce { font-size: 1.15rem; }
  .grade { font-size: .82rem; }
  .kbd { display: none; }
}

/* ------------------------------------------------ bilans et examens */
.result { text-align: center; padding: 2.4rem 1.4rem 2rem; }
.big-number { font-family: var(--serif); font-size: 4rem; line-height: 1; letter-spacing: -.02em; }
.big-number small { font-size: 1.4rem; color: var(--faint); }
.result p { color: var(--muted); max-width: 42ch; margin: 1rem auto 1.6rem; }
.result .row { justify-content: center; }
.scores { display: flex; justify-content: center; gap: 2.4rem; flex-wrap: wrap; align-items: flex-end; }
.scores .second .big-number { font-size: 2.6rem; }
.scores .lbl { font-size: .82rem; color: var(--muted); margin-top: .4rem; }
.breakdown { margin-top: 1.6rem; text-align: left; }
.breakdown div { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-top: 1px solid var(--line); font-size: .92rem; }
.qline { display: flex; gap: .8rem; align-items: baseline; padding: .8rem 1.3rem; font-size: .93rem; }
.mark { flex: none; width: 1.2rem; font-weight: 700; text-align: center; }
.mark.ok { color: var(--ok); } .mark.ko { color: var(--ko); } .mark.mid { color: var(--warn); } .mark.none { color: var(--faint); }
.qcard { padding: 1.4rem; }
.qcard + .qcard { margin-top: .9rem; }
.qcard .enonce { font-size: 1.08rem; margin-bottom: 1rem; }
.pts { font-size: .85rem; color: var(--muted); margin-top: .7rem; }
.scale { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .6rem; }
.scale .btn { min-height: 38px; padding: .35rem .8rem; font-size: .88rem; }
.btn.chosen { border-color: var(--ink); background: var(--ink-soft); }

/* ------------------------------------------------ texte riche, tableaux */
.rich p:last-child { margin-bottom: 0; }
.table-wrap { overflow-x: auto; margin: .5rem 0 .8rem; }
table { border-collapse: collapse; font-size: .86rem; width: 100%; }
th, td { border-bottom: 1px solid var(--line); padding: .5rem .6rem; text-align: left; vertical-align: top; }
th { font-weight: 600; color: var(--muted); font-size: .8rem; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------ pages de contenu */
.prose ul { padding-left: 1.1rem; margin: 0; }
.prose li { margin-bottom: .55rem; }
.prose li:last-child { margin-bottom: 0; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 0 0 1rem 1.2rem; border-left: 1px solid var(--line); position: relative; }
.timeline li::before { content: ""; position: absolute; left: -4px; top: .5em; width: 7px; height: 7px; border-radius: 50%; background: var(--ink); }
.timeline li:last-child { padding-bottom: 0; }
.timeline b { display: block; font-size: .9rem; }
.timeline span { color: var(--muted); font-size: .93rem; }
.ec-row { display: flex; gap: 1rem; align-items: center; padding: .85rem 1.3rem; text-decoration: none; }
a.ec-row:hover { background: var(--sunken); }
.ec-row strong { font-weight: 500; display: block; }
.ec-row .rl-sub { font-size: .8rem; color: var(--faint); margin: 0; }
.pill { font-size: .75rem; font-weight: 600; padding: .2rem .6rem; border-radius: 99px; background: var(--sunken); color: var(--muted); white-space: nowrap; }
.pill.on { background: var(--ink); color: var(--on-ink); }
.ue-label { padding: .95rem 1.3rem .35rem; font-size: .75rem; font-weight: 600; color: var(--faint); letter-spacing: .05em; text-transform: uppercase; }
.list > .ue-label + .ec-row { border-top: 0; }

/* ------------------------------------------------ formulaires */
.field { display: grid; gap: .35rem; }
.field label, .field .label { font-weight: 600; font-size: .88rem; }
select, input[type="text"] {
  font: inherit; color: var(--text); background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px;
  padding: .6rem .75rem; min-height: 46px; width: 100%;
}
.checks { display: flex; flex-wrap: wrap; gap: .4rem; }
.check { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .75rem; border: 1px solid var(--line); border-radius: 99px; font-size: .86rem; cursor: pointer; background: var(--surface); }

/* ------------------------------------------------ fenêtres */
.modal-back { position: fixed; inset: 0; background: rgba(15, 17, 20, .38); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 640px) { .modal-back { align-items: center; padding: 1rem; } }
.modal {
  background: var(--bg); width: 100%; max-width: 480px; max-height: 90vh; overflow: auto;
  padding: 1.6rem 1.4rem calc(1.4rem + env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0; animation: rise .22s ease-out;
}
@media (min-width: 640px) { .modal { border-radius: 22px; } }
@keyframes rise { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal h2 { font-family: var(--serif); font-weight: 500; font-size: 1.6rem; margin-bottom: .8rem; }
.modal .list { margin-top: .4rem; }
.code-box {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 1.15rem; font-weight: 600; text-align: center;
  padding: 1rem; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); word-break: keep-all; overflow-wrap: normal; user-select: all;
}
.toast {
  position: fixed; bottom: calc(1.2rem + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg);
  padding: .7rem 1.1rem; border-radius: 12px; z-index: 60; font-size: .9rem; max-width: calc(100% - 2rem); box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }

.fiab-select { max-width: 380px; margin: 1.1rem auto 0; text-align: left; }
.fiab-select label { display: block; font-size: .8rem; font-weight: 600; color: var(--muted); margin-bottom: .35rem; }
.fiab-select select { font-size: .92rem; min-height: 42px; }
.fiab-select .hero-hint { text-align: left; }

.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { border-bottom: 1px solid var(--line); font-size: .95rem; }
.plain-list li a { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .6rem 0; text-decoration: none; }
.plain-list li a:hover { color: var(--text); }
.plain-list li a .chev { opacity: .6; }
.plain-list li:last-child { border-bottom: 0; }
.plain-list.faint li { color: var(--muted); font-size: .9rem; }
.report { margin-top: .7rem; font-size: .8rem; color: var(--faint); }
.report a { color: var(--muted); text-underline-offset: 3px; }

.save-line {
  display: flex; align-items: center; gap: .75rem; width: 100%; margin-top: 1.4rem; padding: .85rem 1.1rem;
  background: none; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; text-align: left; font-size: .9rem; color: var(--muted);
}
.save-line:hover { background: var(--surface); }
.save-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--faint); }
.save-dot.on { background: var(--ok); }
.save-code { display: block; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .8rem; color: var(--faint); margin-top: .1rem; }
.save-cta { font-weight: 600; color: var(--text); white-space: nowrap; }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: .7rem 1.4rem; margin: 0; font-size: .93rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.facts a { text-underline-offset: 3px; }
@media (max-width: 460px) { .facts { grid-template-columns: 1fr; gap: .15rem; } .facts dd { margin-bottom: .6rem; } }

.welcome { max-width: 420px; margin: 8vh auto 0; text-align: center; }
.welcome .field { text-align: left; }
.big-logo { width: 56px; height: 56px; border-radius: 16px; font-size: 34px; }
.or { display: flex; align-items: center; gap: .8rem; margin: 1.6rem 0 1rem; color: var(--faint); font-size: .85rem; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.welcome-code summary { cursor: pointer; font-weight: 600; color: var(--muted); list-style: none; }
.welcome-code summary::-webkit-details-marker { display: none; }
.welcome-code summary:hover { color: var(--text); }

.tc-item > summary { list-style: none; cursor: pointer; padding: .95rem 1.3rem; display: flex; flex-direction: column; gap: .15rem; }
.tc-item > summary::-webkit-details-marker { display: none; }
.tc-item > summary:hover { background: var(--sunken); }
.tc-item[open] > summary { background: var(--sunken); }
.tc-q { font-weight: 500; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tc-item[open] .tc-q { display: block; }
.tc-meta { font-size: .8rem; color: var(--faint); }
.tc-body { padding: .2rem 1.3rem 1.1rem; }
.tc-opts { list-style: none; margin: .6rem 0 0; padding: 0; display: grid; gap: .35rem; font-size: .92rem; }
.tc-opts li { display: flex; gap: .6rem; align-items: baseline; }
.tc-opts li.is-answer { color: var(--ok); font-weight: 600; }
.letter-sm { flex: none; font-size: .75rem; font-weight: 600; color: var(--faint); width: 1rem; }
.tc-opts li.is-answer .letter-sm { color: var(--ok); }

.how-to { font-size: .92rem; }
.how-to p { color: var(--muted); margin: .4rem 0 .6rem; }
.how-to p strong { color: var(--text); }
.file-line { margin-top: .6rem; font-size: .8rem; color: var(--faint); word-break: break-word; }
.file-line strong { color: var(--muted); font-weight: 600; }

.sync-status { display: flex; gap: .75rem; align-items: flex-start; margin-top: 1.2rem; padding: .9rem 1rem; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); font-size: .88rem; }
.sync-status .save-dot { margin-top: .35rem; }
.sync-status strong { display: block; font-weight: 600; }
.sync-status span { color: var(--muted); }

.selfeval-wrap { flex: 1; }
.selfeval-q { font-size: .88rem; font-weight: 600; text-align: center; margin: 0 0 .55rem; }

.prev-btn { flex: none; min-width: 48px; padding: .6rem .8rem; font-size: 1.1rem; }
.dock .selfeval-wrap + * { flex: none; }

.why { margin-top: .7rem; padding-top: .7rem; border-top: 1px solid var(--line); font-size: .9rem; color: var(--muted); }

.hint-link { color: inherit; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.hint-link:hover { text-decoration-color: currentColor; }
