/* L'Établi des Lettres — feuille principale (direction « moderne », validée le 28/11/2026) */
:root {
  --bg: #faf6f0;
  --bg-2: #f3ece1;
  --surface: #ffffff;
  --ink: #1f1a15;
  --muted: #6e6458;
  --line: #ebe2d4;
  --accent: #c4532d;
  --accent-ink: #ffffff;
  --accent-soft: #f8e4da;
  --green: #2f6b4f;
  --green-soft: #e1efe7;
  --gold: #c89b3c;
  --gold-ink: #7a5a14;
  --gold-soft: #f6ecd2;
  --gold-line: #e4cd94;
  --header-bg: rgba(250, 246, 240, .94);
  --quote-line: rgba(250, 246, 240, .35);
  --shadow: 0 1px 2px rgba(31,26,21,.05), 0 8px 24px rgba(31,26,21,.07);
  --cover-shadow: 0 2px 4px rgba(0,0,0,.12), 0 12px 24px rgba(31,26,21,.16);
  --e-homo: #d0472b; --e-acc: #2f6db5; --e-usage: #8a52c4; --e-accent: #b8860b; --e-ponct: #1f8a7a; --e-mot: #6b6f76; --e-conj: #c2410c; --e-voc: #2e7d32; --e-gram: #4a5bc4; --e-lire: #b83280;
  --e-homo-soft: #fbe6e1;
  --radius: 16px;
  --serif: Fraunces, Georgia, "Times New Roman", serif;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14120f; --bg-2: #1c1915; --surface: #211d18; --ink: #f4eee5; --muted: #a99e90; --line: #332d25;
    --accent: #ec8a64; --accent-ink: #1b120d; --accent-soft: #3a2419; --green: #7cc7a0; --green-soft: #1d3127;
    --gold: #e2bc62; --gold-ink: #f0d58f; --gold-soft: #3a301a; --gold-line: #5c4a22;
    --header-bg: rgba(20, 18, 15, .94); --quote-line: rgba(20, 18, 15, .35);
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
    --cover-shadow: 0 2px 4px rgba(0,0,0,.4), 0 12px 24px rgba(0,0,0,.45);
    --e-homo: #f08a70; --e-acc: #86b4f0; --e-usage: #c6a2f0; --e-accent: #e8c15a; --e-ponct: #5fd0bd; --e-mot: #a9adb4; --e-conj: #fb9a5b; --e-voc: #7fd18a; --e-gram: #a3aef5; --e-lire: #f28cc4; --e-homo-soft: #3a211b;
  }
}
:root[data-theme="dark"] {
  --bg: #14120f; --bg-2: #1c1915; --surface: #211d18; --ink: #f4eee5; --muted: #a99e90; --line: #332d25;
  --accent: #ec8a64; --accent-ink: #1b120d; --accent-soft: #3a2419; --green: #7cc7a0; --green-soft: #1d3127;
  --gold: #e2bc62; --gold-ink: #f0d58f; --gold-soft: #3a301a; --gold-line: #5c4a22;
  --header-bg: rgba(20, 18, 15, .94); --quote-line: rgba(20, 18, 15, .35);
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
  --cover-shadow: 0 2px 4px rgba(0,0,0,.4), 0 12px 24px rgba(0,0,0,.45);
  --e-homo: #f08a70; --e-acc: #86b4f0; --e-usage: #c6a2f0; --e-accent: #e8c15a; --e-ponct: #5fd0bd; --e-mot: #a9adb4; --e-conj: #fb9a5b; --e-voc: #7fd18a; --e-gram: #a3aef5; --e-lire: #f28cc4; --e-homo-soft: #3a211b;
}

/* Police adaptée à la dyslexie (réglage de l'élève) : une seule police, plus d'espace entre lettres et lignes */
:root[data-dys="1"] {
  --serif: OpenDyslexic, Verdana, sans-serif;
  --sans: OpenDyslexic, Verdana, sans-serif;
}
:root[data-dys="1"] body { font-size: 15px; letter-spacing: 0; word-spacing: 0; line-height: 1.75; }
:root[data-dys="1"] nav.tabs a { padding: 8px 9px; }
:root[data-dys="1"] h1, :root[data-dys="1"] h2, :root[data-dys="1"] h3, :root[data-dys="1"] .serif { letter-spacing: 0; font-weight: 700; }
:root[data-dys="1"] h1 { font-size: 2.1rem; }
:root[data-dys="1"] .sentence { font-size: 1.4rem; line-height: 1.8; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--sans); }
/* Pied de page collé en bas, même sur une page courte */
body { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
body > main { flex: 1 0 auto; width: 100%; box-sizing: border-box; }
h1, h2, h3, .serif { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; line-height: 1.15; margin: 0 0 .4em; }
h1 { font-size: 2.6rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 .8em; }
button { font-family: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.center { text-align: center; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.eyebrow { font-size: .78rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* En-tête */
header.top { position: sticky; top: 0; z-index: 10; background: var(--header-bg); border-bottom: 1px solid var(--line); }
header.top .wrap { display: flex; align-items: center; gap: 18px; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-weight: 700; font-size: 1.2rem; white-space: nowrap; color: inherit; text-decoration: none; }
.logo .mark { width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 1.05rem; font-style: italic; }
nav.tabs { display: flex; gap: 4px; margin-left: 8px; overflow-x: auto; scrollbar-width: none; }
nav.tabs a { font: 500 .92rem var(--sans); color: var(--muted); text-decoration: none; padding: 8px 12px; border-radius: 999px; white-space: nowrap; }
nav.tabs a .ic { display: none; }
nav.tabs a[aria-current="page"] { background: var(--ink); color: var(--bg); }
.hdr-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.chip-stat { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-weight: 600; font-size: .9rem; white-space: nowrap; }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; font-size: 1rem; }

main.wrap { padding: 28px 16px 48px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.btn { display: inline-block; font: 600 .95rem var(--sans); border-radius: 999px; padding: 10px 18px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn.sm { padding: 6px 12px; font-size: .85rem; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: default; }
.tag { display: inline-block; font-size: .78rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--bg-2); color: var(--muted); }
.note { font-size: .88rem; color: var(--muted); border: 1px dashed var(--line); border-radius: 12px; padding: 10px 14px; margin-top: 18px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 40px 0 14px; flex-wrap: wrap; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* Accueil */
.hero { display: grid; grid-template-columns: 1.25fr 1fr; gap: 28px; align-items: stretch; }
.hero .lead { font-size: 1.1rem; color: var(--muted); max-width: 52ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.panel-dark { background: var(--ink); color: var(--bg); border-radius: var(--radius); padding: 26px; display: flex; flex-direction: column; justify-content: space-between; gap: 14px; box-shadow: var(--shadow); }
.panel-dark .eyebrow { color: var(--gold); }
.panel-dark .big { font: italic 500 1.4rem/1.3 var(--serif); margin: 0; }
.panel-dark .btn { background: transparent; color: inherit; border-color: var(--quote-line); }

.rayons { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.rayon { position: relative; border-radius: 14px; padding: 18px 16px 16px; min-height: 170px; color: #fff; display: flex; flex-direction: column; justify-content: space-between; box-shadow: var(--cover-shadow); overflow: hidden; text-decoration: none; transition: transform .15s; }
a.rayon:hover { transform: translateY(-3px); }
.rayon::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 10px; background: rgba(0,0,0,.18); }
.rayon .rn { font: 600 1.3rem/1.15 var(--serif); }
.rayon .rs { font-size: .82rem; opacity: .85; }
.rayon .prog { height: 6px; border-radius: 999px; background: rgba(255,255,255,.25); overflow: hidden; margin-top: 10px; }
.rayon .prog i { display: block; height: 100%; width: 0; background: #fff; }
.rayon .foot { display: flex; justify-content: space-between; font-size: .8rem; font-weight: 600; margin-top: 6px; }
.r1 { background: #b8462a; } .r2 { background: #2f5f8a; } .r3 { background: #2f6b4f; } .r4 { background: #8a6a2a; }
.r5 { background: #5b3f7a; } .r6 { background: #24646b; } .r7 { background: #9a3d55; } .r8 { background: #4a4540; }
.rayon.soon { opacity: .72; }
/* Couverture illustrée : l'image remplit la carte, le texte se lit en bas sur un dégradé sombre */
.rayon.has-cover { aspect-ratio: 3 / 4; min-height: 0; justify-content: flex-end; gap: 4px; }
.rayon .cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.rayon.has-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(18,14,10,.88) 0%, rgba(18,14,10,.6) 34%, rgba(18,14,10,0) 62%); }
.rayon.has-cover > div { position: relative; z-index: 1; }
.rayon.has-cover::before { z-index: 2; }
.rayon.has-cover.soon { opacity: 1; }
.rayon.has-cover.soon .cover { filter: grayscale(.55) brightness(.9); }
.rayon.has-cover .rn { text-shadow: 0 1px 6px rgba(0,0,0,.45); }

/* Carnet */
.gaps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.gap { display: flex; gap: 12px; align-items: flex-start; }
.gap .bar { width: 4px; align-self: stretch; border-radius: 4px; flex: none; }
.gap b { display: block; }
.fam-homo { background: var(--e-homo); } .fam-acc { background: var(--e-acc); } .fam-usage { background: var(--e-usage); } .fam-accent { background: var(--e-accent); } .fam-ponct { background: var(--e-ponct); } .fam-mot { background: var(--e-mot); } .fam-conj { background: var(--e-conj); } .fam-voc { background: var(--e-voc); } .fam-gram { background: var(--e-gram); } .fam-lire { background: var(--e-lire); }
.empty { text-align: center; padding: 28px; color: var(--muted); }

/* Route */
.route-top { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: end; margin-bottom: 26px; }
.meter { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.meter .row { justify-content: space-between; font-size: .9rem; margin-bottom: 8px; }
.track { height: 10px; border-radius: 999px; background: var(--bg-2); overflow: hidden; }
.track i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--accent)); border-radius: 999px; transition: width .4s ease; }
.road { position: relative; padding-left: 38px; }
.road::before { content: ""; position: absolute; left: 17px; top: 10px; bottom: 10px; width: 3px; background: var(--line); border-radius: 3px; }
.stop { position: relative; margin-bottom: 14px; display: block; color: inherit; text-decoration: none; }
.stop .node { position: absolute; left: -38px; top: 18px; width: 37px; height: 37px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 3px solid var(--line); font-size: .95rem; font-weight: 700; z-index: 1; }
.stop.done .node { background: var(--green); border-color: var(--green); color: #fff; }
.stop.current .node { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 6px var(--accent-soft); }
.stop .card { display: flex; gap: 16px; align-items: center; padding: 14px 18px; }
.stop .emb { flex: none; width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; font-size: 1.5rem; background: var(--bg-2); overflow: hidden; }
.stop .emb img { width: 100%; height: 100%; object-fit: cover; }
.stop.current .card { border-color: var(--accent); }
.stop.locked { opacity: .55; }
.stop .nm { font: 600 1.15rem var(--serif); }
.stop .sub { font-size: .88rem; color: var(--muted); }
.stars { font-size: .95rem; letter-spacing: 2px; color: var(--gold); white-space: nowrap; }
.stars .off { opacity: .28; }
.stop .right { margin-left: auto; text-align: right; flex: none; }
.reward { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--gold-soft); color: var(--gold-ink); }

/* Exercice */
.ex { max-width: 760px; margin: 0 auto; }
.terre-banner { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }
.reward .face { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; margin-left: -6px; background: var(--surface); }
.blank.base:not(.ok) { color: var(--muted); font-style: italic; font-size: .85em; }
.chest .chest-img { width: 160px; height: 160px; object-fit: contain; border-radius: 20px; }
.tip-head .card-back { width: 38px; height: 46px; object-fit: cover; border-radius: 6px; flex: none; box-shadow: var(--shadow); }
.terre-banner img { width: 64px; height: 64px; border-radius: 14px; object-fit: cover; box-shadow: var(--shadow); }
.dots { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.dot { width: 14px; height: 14px; border-radius: 50%; background: var(--bg-2); border: 1px solid var(--line); }
.dot.g { background: var(--green); border-color: var(--green); }
.dot.h { background: var(--green-soft); border-color: var(--green); }
.dot.o { background: var(--gold); border-color: var(--gold); }
.dot.r { background: var(--e-homo); border-color: var(--e-homo); }
.sentence { font: 500 1.6rem/1.45 var(--serif); text-align: center; margin: 14px 0 22px; }
.blank { display: inline-block; min-width: 48px; border-bottom: 3px solid var(--accent); color: var(--accent); padding: 0 4px; }
.blank.ok { color: var(--green); border-color: var(--green); }
.choice-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 360px; margin: 0 auto 18px; }
.choice { font: 600 1.4rem var(--serif); padding: 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.choice:hover:not([disabled]) { border-color: var(--ink); }
.choice.wrong { border-color: var(--e-homo); background: var(--e-homo-soft); }
.choice.right { border-color: var(--green); background: var(--green-soft); }
.choice[disabled] { cursor: default; }
.answer-input { display: flex; gap: 10px; max-width: 420px; margin: 0 auto 18px; }
.answer-input input { flex: 1; min-width: 0; font: 500 1.3rem var(--serif); padding: 10px 14px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); }
.answer-input input:focus { border-color: var(--accent); outline: none; }
.feedback { text-align: center; font-weight: 600; margin: 0 0 14px; }
.feedback.ok { color: var(--green); }
.feedback.ko { color: var(--e-homo); }
.diff { font: 500 1.2rem var(--serif); text-align: center; margin: -6px 0 14px; }
.diff .del { text-decoration: line-through; color: var(--e-homo); }
.diff .add { color: var(--green); text-decoration: underline; }
.gain { display: inline-block; margin-left: 8px; color: var(--gold-ink); }

.tip { border-radius: var(--radius); background: var(--gold-soft); border: 1px solid var(--gold-line); padding: 20px; text-align: left; }
.tip-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.tip-head .badge { width: 38px; height: 38px; border-radius: 12px; background: var(--gold); color: #1f1a15; display: grid; place-items: center; font-size: 1.1rem; flex: none; }
.tip-head .k { font-size: .76rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-ink); }
.tip-head .h { font: 600 1.3rem var(--serif); }
.demo { background: var(--surface); border-radius: 12px; padding: 12px 14px; font-size: 1rem; margin: 10px 0; }
.ok-t { color: var(--green); font-weight: 600; } .ko-t { color: var(--e-homo); font-weight: 600; }
.ex-result > .recall { text-align: left; max-width: 560px; margin: 10px auto 4px; line-height: 1.55; }
.recall .q { font-style: italic; }
.rule-t { color: var(--muted); font-weight: 600; }
.why { font-size: .95rem; }
.trap { font-size: .9rem; background: var(--surface); border-radius: 12px; padding: 10px 14px; margin-top: 10px; }
.levels { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: .85rem; color: var(--muted); flex-wrap: wrap; }
.lv { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .7rem; font-weight: 700; color: #fff; opacity: .3; }
.lv.b { background: #b07a4a; } .lv.s { background: #8d959c; } .lv.g { background: #c99a2e; }
.lv.on { opacity: 1; }
.ex-actions { text-align: center; margin-top: 18px; }

/* Astuces (collection) */
.astuce-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.astuce-card { text-align: left; cursor: pointer; border: 0; padding: 0; background: none; color: inherit; font: inherit; }
.astuce-card .tip { height: 100%; }
.astuce-card.locked .tip { background: var(--bg-2); border-color: var(--line); filter: grayscale(1); opacity: .7; }

/* Réglages */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip-toggle { border: 2px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 8px 14px; font: 600 .95rem var(--sans); cursor: pointer; }
.chip-toggle[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.settings { display: grid; gap: 18px; max-width: 760px; }
.mt { margin-top: 18px; }
.dys-sample { font-family: OpenDyslexic, Verdana, sans-serif; }

/* Clavier des lettres accentuées (saisie libre) */
.accent-pad { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: 420px; margin: -6px auto 16px; }
.accent-key { min-width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-2); color: var(--ink); font: 600 1.05rem var(--serif); cursor: pointer; }
.accent-key:hover { border-color: var(--ink); }
.choice-row { grid-template-columns: repeat(2, 1fr); max-width: 420px; }

/* Fenêtres */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(20, 16, 12, .55); display: grid; place-items: center; padding: 16px; }
.modal { background: var(--surface); color: var(--ink); border-radius: 20px; max-width: 560px; width: 100%; max-height: calc(100vh - 32px); overflow: auto; padding: 26px; box-shadow: var(--shadow); position: relative; }
.modal .close { position: absolute; top: 12px; right: 12px; }
.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 60; background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 999px; font-weight: 600; box-shadow: var(--shadow); max-width: calc(100vw - 32px); text-align: center; }
.chest { font-size: 3.4rem; text-align: center; margin: 4px 0 8px; }

footer.foot { color: var(--muted); font-size: .85rem; text-align: center; border-top: 1px solid var(--line); padding: 18px 0 24px; }
footer.foot a { color: var(--accent); font-weight: 600; text-decoration: none; }
footer.foot a:hover, footer.foot a:focus-visible { text-decoration: underline; }

@media (max-width: 820px) {
  h1 { font-size: 2rem; }
  .hero, .route-top { grid-template-columns: 1fr; }
  .rayons { grid-template-columns: repeat(2, 1fr); }
  .gaps { grid-template-columns: 1fr; }
  .logo .txt { font-size: 1.05rem; }
  .chip-stat.x { display: none; }
  nav.tabs {
    position: fixed; left: 0; right: 0; bottom: 0; margin: 0; z-index: 20; justify-content: space-around;
    background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  nav.tabs a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .7rem; padding: 6px 4px; border-radius: 10px; flex: 1; min-width: 0; }
  nav.tabs a .ic { display: block; font-size: 1.15rem; }
  nav.tabs a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
  .sentence { font-size: 1.3rem; }
  .stop .right { display: none; }
  .toast { bottom: 84px; }
  footer.foot { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
}
@media (max-width: 400px) {
  .rayon { min-height: 150px; padding: 14px 12px 12px; }
  .rayon .rn { font-size: 1.1rem; }
}

/* ---------- Dictées ---------- */
.dictee-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-top: 16px; }
.dictee-card { display: flex; flex-direction: column; gap: 6px; color: inherit; text-decoration: none; transition: transform .15s, box-shadow .15s; }
.dictee-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.dictee-card .nm { font: 600 1.2rem var(--serif); }
.dc-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.score-pill { font-weight: 700; font-size: .85rem; padding: 2px 9px; border-radius: 99px; background: var(--bg-2); border: 1px solid var(--line); }
.score-pill.gold { background: var(--gold-soft); border-color: var(--gold-line); color: var(--gold-ink); }
.dictee .card + .card { margin-top: 14px; }
.dx-settings { display: flex; flex-wrap: wrap; gap: 18px 28px; align-items: flex-end; margin-bottom: 14px; }
.dx-settings .chips { margin-top: 6px; }
.dx-speed { display: flex; align-items: center; gap: 10px; }
.dx-speed input { width: 140px; accent-color: var(--gold); }
.dx-speed output { font-weight: 700; min-width: 3ch; }
.dx-status { font-weight: 600; margin: 12px 0 8px; }
.dx-player.playing .dx-status::before { content: '🔊 '; }
.dx-nav { flex-wrap: wrap; }
.dx-copy { width: 100%; box-sizing: border-box; font: 1.15rem/1.7 var(--sans); padding: 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg); color: inherit; resize: vertical; min-height: 180px; }
.dx-copy:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.dx-score { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.big-score { font: 700 3rem var(--serif); line-height: 1; }
.big-score.gold { color: var(--gold-ink); }
.dx-corrected { font-size: 1.15rem; line-height: 2.1; }
.dw.err { font: inherit; background: none; border: 0; padding: 0 2px; margin: 0; cursor: pointer; border-bottom: 3px solid currentColor; border-radius: 2px; }
.dw.err s { opacity: .75; margin-right: 4px; color: var(--muted, inherit); }
.dw.err b { font-weight: 700; }
.dw.miss b { border-bottom: 2px dashed currentColor; }
.dw.extra s { opacity: 1; }
.dw.err:focus-visible { outline: 2px solid var(--gold); }
.fam-text-homo { color: var(--e-homo); } .fam-text-acc { color: var(--e-acc); } .fam-text-usage { color: var(--e-usage); }
.fam-text-accent { color: var(--e-accent); } .fam-text-ponct { color: var(--e-ponct); } .fam-text-mot { color: var(--e-mot); } .fam-text-conj { color: var(--e-conj); } .fam-text-voc { color: var(--e-voc); } .fam-text-gram { color: var(--e-gram); } .fam-text-lire { color: var(--e-lire); }
.dx-detail { margin-top: 14px; display: grid; gap: 12px; }
.dx-fault { border-left: 5px solid var(--line); padding: 8px 14px; background: var(--bg-2); border-radius: 8px; }
.dx-fault p { margin: 4px 0 0; }
.fam-line-homo { border-left-color: var(--e-homo); } .fam-line-acc { border-left-color: var(--e-acc); } .fam-line-usage { border-left-color: var(--e-usage); }
.fam-line-accent { border-left-color: var(--e-accent); } .fam-line-ponct { border-left-color: var(--e-ponct); } .fam-line-mot { border-left-color: var(--e-mot); } .fam-line-conj { border-left-color: var(--e-conj); } .fam-line-voc { border-left-color: var(--e-voc); } .fam-line-gram { border-left-color: var(--e-gram); } .fam-line-lire { border-left-color: var(--e-lire); }
.dx-causes { list-style: none; padding: 0; margin: 8px 0 12px; display: grid; gap: 6px; }
.dx-causes li { display: grid; grid-template-columns: 6px 1fr auto; gap: 10px; align-items: center; }
.dx-causes .bar { height: 18px; border-radius: 3px; }
.dx-text { line-height: 1.8; }
details.card summary { cursor: pointer; font-weight: 600; }
@media (max-width: 600px) {
  .dx-settings { gap: 12px; }
  .dx-nav { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 6px; }
  .dx-nav .btn { padding-left: 6px; padding-right: 6px; font-size: .88rem; }
  .dx-keys { display: none; }
  .dx-copy { min-height: 150px; }
  .big-score { font-size: 2.4rem; }
}
.conj-hint { background: var(--bg-2); border-left: 4px solid var(--e-conj); border-radius: 8px; padding: 8px 12px; margin: 8px 0; }
.sentence.prompt { font-size: 1.25rem; }
.sentence.prompt mark { background: var(--gold-soft); color: inherit; padding: 0 4px; border-radius: 4px; border-bottom: 2px solid var(--gold); }
.passage { background: var(--bg-2); border-radius: var(--radius); padding: 14px 18px; margin: 6px 0 14px; text-align: left; font: 1.08rem/1.7 var(--serif); max-height: 340px; overflow-y: auto; }
.passage p { margin: 0 0 8px; }
