/* Thèmes : contrastes AA/AAA, accent bleu et gris neutres (pas de rouge/vert). Aucun état porté par la couleur seule. */
:root, :root[data-theme="light"] {
  --bg: #ffffff; --fg: #111827; --muted: #4b5563; --card: #f3f4f6; --border: #374151;
  --accent: #0b3d91; --accent-fg: #ffffff; --focus: #b45309; --code: #e5e7eb;
}
:root[data-theme="dark"] {
  --bg: #0f141b; --fg: #f3f4f6; --muted: #cbd5e1; --card: #1b2430; --border: #9ca3af;
  --accent: #8ab4ff; --accent-fg: #0f141b; --focus: #fbbf24; --code: #263243;
}
:root[data-size="s"] { font-size: 15px; }
:root[data-size="m"] { font-size: 18px; }
:root[data-size="l"] { font-size: 22px; }
:root[data-size="xl"] { font-size: 26px; }
:root[data-font="standard"] { --font: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
:root[data-font="dyslexia"] { --font: Luciole, "OpenDyslexic", "Atkinson Hyperlegible", "Comic Sans MS", Verdana, sans-serif; letter-spacing: .04em; word-spacing: .12em; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font, sans-serif); line-height: 1.6; }
main { max-width: 60rem; margin: 0 auto; padding: 1rem; }
main:focus { outline: none; }
h1, h2, h3, h4 { line-height: 1.25; }
a { color: var(--accent); text-decoration: underline; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--bg); padding: .5rem; z-index: 10; }
.top { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-start; justify-content: space-between; padding: .5rem 1rem; border-bottom: 2px solid var(--border); }
.brand { margin: .3rem 0; font-weight: 700; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: .5rem; padding: 1rem; margin: 1rem 0; }
label { display: block; font-weight: 600; margin-bottom: .25rem; }
label.inline { display: inline; margin-left: .5rem; }
input[type=text], input[type=password], textarea { width: 100%; font: inherit; color: var(--fg); background: var(--bg); border: 2px solid var(--border); border-radius: .3rem; padding: .5rem; }
input[type=checkbox] { width: 1.4rem; height: 1.4rem; vertical-align: middle; }
button, .button { font: inherit; color: var(--fg); background: var(--bg); border: 2px solid var(--border); border-radius: .3rem; padding: .5rem 1rem; cursor: pointer; text-decoration: none; display: inline-block; }
button.primary, .button.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); font-weight: 700; }
button.danger { border-width: 3px; border-style: double; font-weight: 700; }
button.link { border: 0; background: none; text-decoration: underline; padding: .3rem; }
button[aria-pressed="true"], button[aria-selected="true"] { background: var(--fg); color: var(--bg); text-decoration: underline; }
button:disabled { opacity: .55; cursor: not-allowed; border-style: dashed; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
form.inline { display: inline; }
fieldset { border: 1px solid var(--border); margin: .5rem 0; }
.settings summary { cursor: pointer; font-weight: 700; }
.settings-body { padding: .5rem 0; }
.notice { border: 2px solid var(--border); border-left-width: 8px; padding: .5rem 1rem; border-radius: .3rem; background: var(--card); }
.icon { font-family: monospace; font-weight: 700; }
code { background: var(--code); padding: .05rem .3rem; border-radius: .2rem; }
pre { background: var(--code); padding: .75rem; overflow-x: auto; border-radius: .3rem; }
table { border-collapse: collapse; width: 100%; margin: .5rem 0; }
th, td { border: 1px solid var(--border); padding: .35rem .5rem; text-align: left; vertical-align: top; }
.links { list-style: none; padding: 0; } .links li { margin: .5rem 0; }
.tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0; }
/* Sans JavaScript tous les panneaux restent visibles ; app.js pose [hidden] sur les panneaux inactifs */
/* Chronomètre : le niveau se lit dans le texte du seuil ; le style de bordure varie aussi (forme), jamais la couleur seule */
.timer { border: 3px solid var(--border); border-radius: .5rem; padding: 1rem; margin: 1rem 0; background: var(--card); }
.timer[data-level="t30"] { border-style: dashed; }
.timer[data-level="t10"] { border-style: double; border-width: 6px; }
.timer[data-level="t5"] { border-style: solid; border-width: 8px; }
.timer[data-level="over"] { border-style: dotted; border-width: 8px; }
.timer-title, .hint { margin: 0; color: var(--muted); }
.digits { font-size: 3rem; font-weight: 800; font-variant-numeric: tabular-nums; margin: .2rem 0; }
.timer-words { margin: 0; }
.threshold { font-weight: 800; margin: .5rem 0 0; }
.timer[data-level="t5"] .threshold, .timer[data-level="over"] .threshold { text-decoration: underline; text-transform: uppercase; }
progress { width: 100%; height: 1.2rem; accent-color: var(--accent); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
