/* ============================================================
   Vocab COMEX - feuille de style « app mobile »
   Mobile-first : barre d'onglets basse, carte plein écran,
   pavés de notation tactiles. Au-delà de 768 px, la barre
   d'onglets remonte en tête et la mise en page se centre.
   ============================================================ */

/* ---------- Nunito, auto-hébergée (aucun appel réseau) ---------- */
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('fonts/nunito-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
                 U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
                 U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('fonts/nunito-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC,
                 U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- palette ---------- */
:root {
  --ink:        #171526;
  --ink-2:      #5b5872;
  --ink-3:      #8b88a3;
  --bg:         #f4f3fb;
  --surface:    #ffffff;
  --surface-2:  #edecf7;
  --line:       #e3e1f0;

  --brand:      #5145e5;
  --brand-2:    #7c6cff;
  --brand-soft: #eae7ff;
  --on-brand:   #ffffff;

  --ok:         #0ea46b;
  --ok-soft:    #dcf7ec;
  --ko:         #e23d4d;
  --ko-soft:    #fde3e5;
  --warm:       #e08600;
  --warm-soft:  #fdefd4;

  --radius:     24px;
  --radius-md:  18px;
  --radius-sm:  13px;
  --shadow-1:   0 1px 2px rgba(23, 21, 38, .05), 0 4px 14px rgba(23, 21, 38, .06);
  --shadow-2:   0 10px 34px rgba(45, 38, 110, .15);
  --tabbar-h:   62px;
  color-scheme: light;
}

html[data-theme="dark"] {
  --ink:        #f2f1fa;
  --ink-2:      #b4b0cc;
  --ink-3:      #807ca0;
  --bg:         #100f1e;
  --surface:    #1b1930;
  --surface-2:  #262340;
  --line:       #322f4e;

  --brand:      #8b84ff;
  --brand-2:    #a79eff;
  --brand-soft: #2a2551;
  --on-brand:   #14122a;

  --ok:         #34d399;
  --ok-soft:    #10362a;
  --ko:         #fb7185;
  --ko-soft:    #3f1f29;
  --warm:       #fbbf24;
  --warm-soft:  #3a2d11;

  --shadow-1:   0 1px 2px rgba(0, 0, 0, .40), 0 6px 18px rgba(0, 0, 0, .32);
  --shadow-2:   0 12px 36px rgba(0, 0, 0, .50);
  color-scheme: dark;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overscroll-behavior: none;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Nunito', ui-rounded, 'SF Pro Rounded', 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, select, .tab, .badge, .chip, .grade, .srs-state, .set-title, .set-sub {
  font-family: inherit;
  -webkit-user-select: none;
  user-select: none;
}
button { cursor: pointer; border: 0; background: none; color: inherit; font: inherit; }
input, textarea { -webkit-user-select: text; user-select: text; font-family: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--brand-2); outline-offset: 2px; }

/* ============================================================
   Coque de l'application
   ============================================================ */
.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}

.appbar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 10px;
  background: var(--bg);
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -.2px;
}
.brand .logo {
  width: 30px; height: 30px;
  border-radius: 9px;
  background: linear-gradient(140deg, var(--brand-2), var(--brand));
  display: grid; place-items: center;
  color: #fff; font-size: 15px; font-weight: 800;
  box-shadow: 0 4px 12px rgba(81, 69, 229, .32);
}
.brand em { font-style: normal; color: var(--brand); }
.appbar-spacer { flex: 1; }

.streak-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  background: var(--warm-soft);
  color: var(--warm);
  font-weight: 800;
  font-size: 14px;
}
.streak-pill.is-cold { background: var(--surface-2); color: var(--ink-3); }

/* Flamme vivante (Phase B §2.1) : éteinte tant qu'aucune série n'est en cours,
   normale dès le premier jour, pulsante quand l'objectif du jour est atteint.
   La pulsation passe par une animation : le bloc `prefers-reduced-motion` plus
   bas la neutralise sans qu'il faille l'écrire deux fois. */
#streakFlame { display: inline-block; transform-origin: 50% 70%; }
.streak-pill.is-cold #streakFlame { filter: grayscale(1); opacity: .55; }
@keyframes flamePulse {
  0%, 100% { transform: scale(1); }
  45%      { transform: scale(1.22); }
}
.streak-pill.is-hot { background: var(--warm); color: #fff; }
.streak-pill.is-hot #streakFlame { animation: flamePulse 1.6s ease-in-out infinite; }

/* ---------- zone des vues + transitions ---------- */
.views {
  flex: 1;
  min-height: 0;
  position: relative;
}
.view {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 0 14px 18px;
}

@keyframes viewFwd  { from { opacity: 0; transform: translateX(16px); }  to { opacity: 1; transform: none; } }
@keyframes viewBack { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: none; } }
.view.anim-fwd  { animation: viewFwd .2s cubic-bezier(.2, .7, .3, 1); }
.view.anim-back { animation: viewBack .2s cubic-bezier(.2, .7, .3, 1); }

/* ---------- barre d'onglets basse ---------- */
.tabbar {
  flex: none;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 6px 4px calc(env(safe-area-inset-bottom, 0px) + 6px);
  box-shadow: 0 -6px 24px rgba(23, 21, 38, .05);
}
html[data-theme="dark"] .tabbar { box-shadow: 0 -6px 24px rgba(0, 0, 0, .35); }

.tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 50px;
  border-radius: 14px;
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 700;
  transition: color .15s, background .15s, transform .12s;
}
.tab svg { width: 24px; height: 24px; display: block; }
.tab .ico-fill { opacity: 0; transition: opacity .18s; }
.tab.is-active { color: var(--brand); }
.tab.is-active .ico-fill { opacity: 1; }
.tab:active { transform: scale(.93); background: var(--surface-2); }

.tab-badge {
  position: absolute;
  top: 2px;
  left: 50%;
  margin-left: 6px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--ko);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 19px;
  text-align: center;
}

/* ============================================================
   Vue Réviser
   ============================================================ */
.view-review {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 10px;
}

.session-bar { flex: none; padding: 2px 0 8px; }
.session-track {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}
.session-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand-2), var(--brand));
  transition: width .35s cubic-bezier(.2, .7, .3, 1);
}
.session-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 7px;
  font-size: 12.5px;
  color: var(--ink-2);
  font-weight: 600;
}
.session-line .grow { flex: 1; min-width: 0; }
.session-meta strong { color: var(--brand); }

.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 700;
  transition: transform .12s, background .15s;
}
.chip-btn:active { transform: scale(.95); }
.chip-btn.is-on { background: var(--brand-soft); border-color: transparent; color: var(--brand); }

.session-panel {
  flex: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 14px;
  margin-bottom: 10px;
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-1);
}
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field > span {
  font-size: 11.5px; font-weight: 800; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: .4px;
}
.field select, .field input {
  height: 44px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 600;
  width: 100%;
}

/* ---------- la carte ---------- */
.card-stage {
  flex: 1;
  min-height: 0;
  perspective: 1600px;
  display: flex;
}
.flashcard {
  flex: 1;
  position: relative;
  transform-style: preserve-3d;
  transition: transform .62s cubic-bezier(.2, 1.28, .34, 1);
  will-change: transform;
  cursor: pointer;
}
.flashcard.flipped { transform: rotateY(180deg); }

.face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-2);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.face.back { transform: rotateY(180deg); }

.badges { display: flex; flex-wrap: wrap; gap: 6px; flex: none; }
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 700;
}
.badge.lang-en { background: var(--brand-soft); color: var(--brand); }
.badge.lang-fr { background: var(--warm-soft); color: var(--warm); }
.badge.level   { background: transparent; border: 1px solid var(--line); color: var(--ink-3); }
.badge.custom  { background: var(--ok-soft); color: var(--ok); }

.term-zone {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: 6px 0;
  min-height: 92px;
}
.term-main {
  font-size: clamp(28px, 8vw, 42px);
  font-weight: 800;
  letter-spacing: -.6px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.phonetic { color: var(--ink-3); font-size: 15px; font-weight: 600; }

.speak-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 14px;
  font-weight: 800;
  transition: transform .12s;
}
.speak-btn:active { transform: scale(.94); }
.speak-inline {
  display: inline-grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 14px;
  vertical-align: middle;
  transition: transform .12s;
}
.speak-inline:active { transform: scale(.9); }

.flip-hint { flex: none; text-align: center; color: var(--ink-3); font-size: 12px; font-weight: 600; }
.only-wide { display: none; }

/* ---------- QCM ---------- */
.quiz { flex: none; display: flex; flex-direction: column; gap: 8px; }
.quiz-q {
  font-size: 12px; font-weight: 800; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: .5px; text-align: center;
}
.quiz-options { display: flex; flex-direction: column; gap: 8px; }
.quiz-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  background: var(--bg);
  border: 2px solid transparent;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  text-align: left;
  transition: transform .12s, background .15s, border-color .15s, color .15s;
}
html[data-theme="dark"] .quiz-opt { background: var(--surface-2); }
.quiz-opt:active:not(:disabled) { transform: scale(.98); background: var(--brand-soft); }
.quiz-opt:disabled { cursor: default; }
.quiz-key {
  flex: none;
  display: grid; place-items: center;
  width: 24px; height: 24px;
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink-3);
  font-size: 12px; font-weight: 800;
}
html[data-theme="dark"] .quiz-key { background: var(--bg); }
.quiz-label { flex: 1; min-width: 0; overflow-wrap: anywhere; }

.quiz-opt.is-correct { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.quiz-opt.is-correct .quiz-key { background: var(--ok); color: #fff; }
.quiz-opt.is-wrong   { background: var(--ko-soft); border-color: var(--ko); color: var(--ko); }
.quiz-opt.is-wrong .quiz-key { background: var(--ko); color: #fff; }

@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(3px); }
  30%, 50%, 70% { transform: translateX(-6px); }
  40%, 60% { transform: translateX(6px); }
}
.shake { animation: shake .42s cubic-bezier(.36, .07, .19, .97) both; }

@keyframes pop { 0% { transform: scale(1); } 45% { transform: scale(1.035); } 100% { transform: scale(1); } }
.pop { animation: pop .34s cubic-bezier(.2, 1.3, .34, 1) both; }

/* ---------- verso ---------- */
.term-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 19px; font-weight: 800; }
.translation { font-size: 24px; font-weight: 800; color: var(--brand); letter-spacing: -.3px; overflow-wrap: anywhere; }
.quiz-result { padding: 10px 13px; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 800; }
.quiz-result.ok { background: var(--ok-soft); color: var(--ok); }
.quiz-result.ko { background: var(--ko-soft); color: var(--ko); }
.definition { color: var(--ink-2); font-size: 15px; }
.example-block { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--bg); }
html[data-theme="dark"] .example-block { background: var(--surface-2); }
.example-en { font-style: italic; }
.example-tr { margin-top: 5px; color: var(--ink-3); font-size: 13.5px; }
.idiom-block {
  padding: 11px 14px; border-radius: var(--radius-sm);
  background: var(--warm-soft); color: var(--ink-2); font-size: 13.5px; font-weight: 600;
}
.dict-block {
  padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1px dashed var(--line); font-size: 13.5px; color: var(--ink-2);
}
.dict-title {
  font-size: 11.5px; font-weight: 800; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px;
}
.dict-block audio { display: none; }

/* ---------- pavés de notation ---------- */
.grades {
  flex: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding-top: 10px;
}
.grade {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 62px;
  padding: 6px 2px;
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1.2;
  transition: transform .1s;
}
.grade:active { transform: scale(.94); }
.grade small { font-size: 10.5px; font-weight: 700; opacity: .8; }
.grade[data-grade="again"] { background: var(--ko-soft);   color: var(--ko); }
.grade[data-grade="hard"]  { background: var(--warm-soft); color: var(--warm); }
.grade[data-grade="good"]  { background: var(--brand-soft); color: var(--brand); }
.grade[data-grade="easy"]  { background: var(--ok-soft);   color: var(--ok); }
.kbd-hint { display: none; }

/* ---------- fin de session / chargement ---------- */
.session-done, .loading {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  padding: 24px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-2);
  color: var(--ink-2);
  font-weight: 600;
}
.session-done h2 { margin: 0; font-size: 24px; color: var(--ink); font-weight: 800; }
.session-done p { margin: 0; }

.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 24px;
  border-radius: 999px;
  background: var(--brand);
  color: var(--on-brand);
  font-size: 15.5px;
  font-weight: 800;
  box-shadow: 0 6px 18px rgba(81, 69, 229, .32);
  transition: transform .12s;
}
.primary-btn:active { transform: scale(.96); }
.primary-btn.small { min-height: 44px; padding: 0 18px; font-size: 14px; }
.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 46px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  transition: transform .12s;
}
.ghost-btn:active { transform: scale(.96); }
.danger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  background: var(--ko-soft);
  color: var(--ko);
  font-size: 14px;
  font-weight: 800;
  transition: transform .12s;
}
.danger-btn:active { transform: scale(.96); }
.link-btn { color: var(--brand); font-size: 14px; font-weight: 700; text-decoration: underline; padding: 8px 4px; }

/* ============================================================
   Vue Bibliothèque
   ============================================================ */
.view-head { display: flex; align-items: center; gap: 10px; padding: 4px 0 12px; }
.view-head h1 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.4px; }
.view-head .grow { flex: 1; }

.lib-search {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
}
.lib-filters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.lib-filters select {
  height: 42px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 700;
}
.chip-row {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 12px 0 4px;
  scrollbar-width: none;
}
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  transition: transform .12s;
}
.chip:active { transform: scale(.95); }
.chip.is-on { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }

.lib-summary { padding: 8px 2px 10px; color: var(--ink-3); font-size: 12.5px; font-weight: 600; }
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-row {
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-1);
  padding: 12px 14px;
  cursor: pointer;
  transition: transform .12s;
}
.lib-row:active { transform: scale(.995); }
.lib-row-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lib-term { font-weight: 800; font-size: 15.5px; overflow-wrap: anywhere; }
.lib-tr { color: var(--ink-2); font-size: 14px; flex: 1; min-width: 120px; overflow-wrap: anywhere; }
.lib-tags { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.lib-detail {
  margin-top: 12px; padding-top: 12px;
  border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 10px;
}
.lib-empty, .prog-empty {
  padding: 26px 18px;
  text-align: center;
  color: var(--ink-3);
  background: var(--surface);
  border-radius: var(--radius-md);
  font-weight: 600;
}
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.srs-state { padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 800; }
.srs-new      { background: var(--surface-2); color: var(--ink-3); }
.srs-due      { background: var(--ko-soft); color: var(--ko); }
.srs-learning { background: var(--brand-soft); color: var(--brand); }
.srs-known    { background: var(--ok-soft); color: var(--ok); }

/* ============================================================
   Vue Progrès
   ============================================================ */
.goal-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}
.ring { flex: none; width: 116px; height: 116px; position: relative; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .ring-bg { fill: none; stroke: var(--surface-2); stroke-width: 12; }
.ring .ring-fg {
  fill: none;
  stroke: var(--brand);
  stroke-width: 12;
  stroke-linecap: round;
  transition: stroke-dashoffset .7s cubic-bezier(.2, .7, .3, 1);
}
.ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.ring-num { font-size: 27px; font-weight: 800; line-height: 1; letter-spacing: -.5px; }
.ring-lab { font-size: 11px; font-weight: 700; color: var(--ink-3); margin-top: 3px; }
.goal-text { flex: 1; min-width: 0; }
.goal-text h2 { margin: 0 0 4px; font-size: 17px; font-weight: 800; }
.goal-text p { margin: 0; color: var(--ink-2); font-size: 13.5px; }
.goal-done {
  display: inline-block; margin-top: 8px; padding: 4px 11px;
  border-radius: 999px; background: var(--ok-soft); color: var(--ok);
  font-size: 12px; font-weight: 800;
}

.streak-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--warm-soft), var(--surface));
  box-shadow: var(--shadow-1);
}
.streak-flame { font-size: 34px; line-height: 1; }
.streak-n { font-size: 26px; font-weight: 800; line-height: 1.1; }
.streak-lab { color: var(--ink-2); font-size: 13.5px; font-weight: 600; }

.prog-section { margin-top: 20px; }
.prog-section h2 {
  margin: 0 0 10px; font-size: 13px; font-weight: 800; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: .6px;
}
.prog-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
.stat-card {
  padding: 14px 10px; border-radius: var(--radius-md);
  background: var(--surface); box-shadow: var(--shadow-1); text-align: center;
}
.stat-num { font-size: 22px; font-weight: 800; letter-spacing: -.5px; }
.stat-lab { font-size: 11.5px; font-weight: 700; color: var(--ink-3); margin-top: 2px; }
.prog-panel { padding: 16px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-1); }
.prog-panel-title { font-size: 13px; font-weight: 800; margin-bottom: 12px; }
.prog-note { margin-top: 10px; color: var(--ink-3); font-size: 12.5px; font-weight: 600; text-align: center; }

.bar-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 9px; align-items: center; margin-bottom: 9px; font-size: 12.5px; }
.bar-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 9px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand-2), var(--brand)); }
.bar-val { color: var(--ink-3); font-weight: 700; white-space: nowrap; }

.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; align-items: end; height: 140px; }
.week-col { display: flex; flex-direction: column; align-items: center; gap: 5px; height: 100%; }
.week-n { font-size: 11px; font-weight: 800; color: var(--ink-2); height: 14px; }
.week-wrap { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.week-bar {
  width: 100%;
  min-height: 4px;
  border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, var(--brand-2), var(--brand));
}
.week-bar.is-zero { background: var(--surface-2); }
.week-lab { font-size: 10.5px; font-weight: 700; color: var(--ink-3); }
.week-col.is-today .week-lab { color: var(--brand); }

/* ============================================================
   Vue Réglages
   ============================================================ */
.set-group { margin-bottom: 16px; }
.set-group > h2 {
  margin: 0 0 8px 4px; font-size: 12.5px; font-weight: 800; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: .6px;
}
.set-card { background: var(--surface); border-radius: var(--radius-md); box-shadow: var(--shadow-1); overflow: hidden; }
.set-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  padding: 11px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.set-row:last-child { border-bottom: 0; }
.set-row.column { flex-direction: column; align-items: stretch; gap: 10px; }
.set-row .grow { flex: 1; min-width: 0; }
.set-title { display: block; font-size: 14.5px; font-weight: 700; }
.set-sub { display: block; font-size: 12px; color: var(--ink-3); font-weight: 600; margin-top: 1px; }
button.set-row { transition: background .15s; }
button.set-row:active { background: var(--surface-2); }
.set-row .arrow { color: var(--ink-3); font-size: 18px; }
.set-row.danger .set-title { color: var(--ko); }

.segmented { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface-2); }
.segmented button {
  flex: 1;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 700;
  transition: background .15s, color .15s, transform .1s;
}
.segmented button:active { transform: scale(.95); }
.segmented button.is-on { background: var(--surface); color: var(--brand); box-shadow: var(--shadow-1); }

.goal-input {
  width: 88px; height: 44px; text-align: center;
  border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--bg); color: var(--ink); font-size: 16px; font-weight: 800;
}
.set-note { padding: 10px 6px 0; color: var(--ink-3); font-size: 12px; font-weight: 600; line-height: 1.5; }
.set-note a { color: var(--brand); }

/* ============================================================
   Toast, bannière d'installation, confettis, modale
   ============================================================ */
#fx {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 60;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + var(--tabbar-h) + 14px);
  transform: translate(-50%, 14px);
  max-width: min(460px, calc(100vw - 28px));
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 13.5px;
  font-weight: 700;
  text-align: center;
  box-shadow: var(--shadow-2);
  opacity: 0;
  transition: opacity .22s, transform .22s;
  z-index: 70;
  pointer-events: none;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

.install-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + var(--tabbar-h) + 12px);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-2);
  z-index: 65;
  animation: viewFwd .25s ease-out;
}
.install-banner .ib-ico { width: 40px; height: 40px; border-radius: 12px; flex: none; }
.install-banner .grow { flex: 1; min-width: 0; }
.install-banner .ib-t { font-size: 14px; font-weight: 800; }
.install-banner .ib-s { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.install-banner .ib-yes {
  min-height: 40px; padding: 0 16px; border-radius: 999px;
  background: var(--brand); color: var(--on-brand); font-weight: 800; font-size: 13.5px;
}
.install-banner .ib-no { width: 34px; height: 34px; border-radius: 50%; color: var(--ink-3); font-size: 17px; font-weight: 800; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(15, 13, 30, .5);
}
@keyframes sheetUp { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.modal {
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  max-height: 92dvh;
  overflow-y: auto;
  padding: 18px 16px calc(env(safe-area-inset-bottom, 0px) + 18px);
  border-radius: 24px 24px 0 0;
  background: var(--surface);
  box-shadow: var(--shadow-2);
  animation: sheetUp .22s cubic-bezier(.2, .8, .3, 1);
}
.modal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.modal-head h2 { margin: 0; font-size: 18px; font-weight: 800; flex: 1; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--surface-2); color: var(--ink-2);
  font-size: 17px; font-weight: 800;
  display: inline-grid; place-items: center;
  transition: transform .12s;
}
.icon-btn:active { transform: scale(.92); }

.word-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.word-form .field.full { grid-column: 1 / -1; }
.word-form input, .word-form select, .word-form textarea {
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  width: 100%;
  font-family: inherit;
}
.word-form textarea { resize: vertical; line-height: 1.45; }
.form-error {
  grid-column: 1 / -1;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  background: var(--ko-soft);
  color: var(--ko);
  font-size: 13px;
  font-weight: 700;
}
.form-actions {
  grid-column: 1 / -1;
  display: flex; align-items: center; justify-content: flex-end;
  gap: 12px; margin-top: 6px; flex-wrap: wrap;
}
.form-req { margin-right: auto; font-size: 12px; color: var(--ink-3); font-weight: 700; }

/* ============================================================
   Réduction des animations
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* ============================================================
   Écrans larges - la barre d'onglets remonte en tête
   ============================================================ */
@media (min-width: 768px) {
  body { font-size: 15.5px; }

  .appbar { order: -2; padding: calc(env(safe-area-inset-top, 0px) + 14px) 24px 8px; }
  .tabbar {
    order: -1;
    grid-template-columns: repeat(5, auto);
    justify-content: center;
    gap: 8px;
    background: transparent;
    border-top: 0;
    box-shadow: none;
    padding: 0 24px 12px;
  }
  html[data-theme="dark"] .tabbar { box-shadow: none; }
  .tab {
    flex-direction: row;
    gap: 8px;
    min-height: 44px;
    padding: 0 18px;
    font-size: 14px;
    background: var(--surface);
    box-shadow: var(--shadow-1);
  }
  .tab svg { width: 20px; height: 20px; }
  .tab.is-active { background: var(--brand); color: var(--on-brand); }
  .tab-badge { position: static; margin: 0; }

  .toast, .install-banner { bottom: 20px; }
  .install-banner { left: auto; right: 20px; width: 380px; }

  .view { padding: 0 24px 24px; }
  .view > .wrap { max-width: 940px; margin: 0 auto; }
  .view-review { padding-bottom: 20px; }
  .view-review > * { max-width: 860px; width: 100%; margin-left: auto; margin-right: auto; }

  .face { padding: 26px 30px; gap: 14px; }
  .term-main { font-size: 46px; }
  .grade { min-height: 70px; font-size: 14px; }
  .grades { gap: 10px; }
  .kbd-hint {
    display: block; flex: none; text-align: center;
    color: var(--ink-3); font-size: 11.5px; font-weight: 600; padding-top: 8px; margin: 0;
  }
  .only-wide { display: inline; }

  .session-panel { grid-template-columns: repeat(3, 1fr); }
  .lib-filters { grid-template-columns: repeat(4, 1fr); }
  .lib-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: start; }
  .modal-backdrop { align-items: center; padding: 20px; }
  .modal { border-radius: 24px; max-height: 86vh; padding-bottom: 18px; }
  .goal-card { padding: 24px; }
  .week { height: 170px; }
}

@media (min-width: 1100px) {
  .lib-list { grid-template-columns: repeat(3, 1fr); }
}

/* ============================================================
   v5 - Natures de contenu (culture.js)
   ============================================================ */
.badge.kind { background: var(--surface-2); color: var(--ink-2); }
.badge.kind.kind-idiom        { background: var(--warm-soft); color: var(--warm); }
.badge.kind.kind-false_friend { background: var(--ko-soft);   color: var(--ko); }
.badge.kind.kind-register     { background: var(--brand-soft); color: var(--brand); }
.badge.kind.kind-proverb      { background: var(--ok-soft);   color: var(--ok); }
.badge.kind.kind-quote        { background: transparent; border: 1px solid var(--line); color: var(--ink-2); }

.chip.chip-kind { border-style: dashed; }
.chip.chip-kind.is-on { border-style: solid; }

/* Bloc « culture » au verso : piège, équivalent, auteur, origine, emploi. */
.culture-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg);
}
html[data-theme="dark"] .culture-block { background: var(--surface-2); }
.culture-row { display: flex; gap: 10px; align-items: baseline; font-size: 13.5px; line-height: 1.45; }
.culture-label {
  flex: none;
  min-width: 84px;
  color: var(--ink-3);
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.culture-value { flex: 1; min-width: 0; color: var(--ink-2); font-weight: 600; overflow-wrap: anywhere; }
.culture-row.is-trap .culture-value { color: var(--ko); }
.culture-row.is-trap .culture-value s { text-decoration-thickness: 2px; }
.culture-warn { font-style: normal; color: var(--warm); font-size: 12px; font-weight: 700; }

/* ============================================================
   v5 - Feuilles plein écran (compte, matières)
   ============================================================ */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  animation: sheetUp .22s cubic-bezier(.2, .8, .3, 1);
}
.sheet-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 14px 10px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.sheet-head h2 { margin: 0; font-size: 18px; font-weight: 800; flex: 1; min-width: 0; }
.sheet-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 14px calc(env(safe-area-inset-bottom, 0px) + 24px);
}
.sheet-body > p { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.55; }
.sheet-body > h3 { margin: 6px 0 0; font-size: 14px; font-weight: 800; }
/* Une feuille est ouverte : le fond ne défile plus derrière elle. */
body.sheet-open { overflow: hidden; }

/* ---------- champs de formulaire dans une feuille ---------- */
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field > span { font-size: 12.5px; font-weight: 800; color: var(--ink-3); }
.form-field input,
.form-field select,
.form-field textarea,
.sheet-body textarea {
  width: 100%;
  padding: 12px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 15.5px;
  font-weight: 600;
  font-family: inherit;
}
.sheet-body textarea { resize: vertical; line-height: 1.5; min-height: 130px; }
.form-err {
  margin: 0;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  background: var(--ko-soft);
  color: var(--ko);
  font-size: 13px;
  font-weight: 700;
}
.form-note { margin: 0; color: var(--ink-3); font-size: 12.5px; font-weight: 600; line-height: 1.5; }
.form-links { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.form-check,
.form-choice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.4;
}
.form-choice input[type="radio"],
.form-check input[type="checkbox"] { flex: none; width: 20px; height: 20px; accent-color: var(--brand); }
.form-choice input[type="text"] { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink); font: inherit; }
.file-input { font-size: 13px; font-weight: 600; color: var(--ink-2); }

.mono { font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace; }
.breakable { overflow-wrap: anywhere; word-break: break-all; }
.codes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0;
  padding: 12px;
  list-style: none;
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}
.codes li { font-size: 15px; font-weight: 700; letter-spacing: .5px; text-align: center; }
.qr {
  display: block;
  width: 200px;
  max-width: 100%;
  height: auto;
  margin: 4px auto;
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 10px;
}

.primary-btn.wide,
.ghost-btn.wide { display: flex; width: 100%; }
.primary-btn.danger { background: var(--ko); box-shadow: 0 6px 18px rgba(226, 61, 77, .3); }
.set-row.warn .set-title { color: var(--warm); }
.empty {
  margin: 0;
  padding: 22px 16px;
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  color: var(--ink-3);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.55;
  text-align: center;
}

/* Interrupteur des réglages (notifications, options du compte). */
.switch {
  flex: none;
  appearance: none;
  -webkit-appearance: none;
  width: 50px;
  height: 30px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  position: relative;
  transition: background .18s, border-color .18s;
  cursor: pointer;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow-1);
  transition: transform .18s;
}
.switch:checked { background: var(--brand); border-color: var(--brand); }
.switch:checked::after { transform: translateX(20px); }
.switch:disabled { opacity: .5; cursor: default; }

.range { width: 100%; accent-color: var(--brand); }
.time-pair { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink-3); }
.time-pair input[type="time"] {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
}

/* ============================================================
   v5 - Vue Matières
   ============================================================ */
.subj-list { display: flex; flex-direction: column; gap: 10px; }
.subj-card {
  display: block;
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  transition: transform .12s;
}
.subj-card:active { transform: scale(.99); }
.subj-name { display: block; font-size: 16px; font-weight: 800; letter-spacing: -.2px; }
.subj-meta { display: block; margin-top: 3px; color: var(--ink-3); font-size: 12.5px; font-weight: 700; }
.subj-desc { display: block; margin-top: 6px; color: var(--ink-2); font-size: 13.5px; font-weight: 600; line-height: 1.45; }

.seg-wide { display: flex; flex-direction: column; gap: 8px; }
.sample {
  margin: 0;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px dashed var(--line);
  color: var(--ink-2);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.55;
  overflow-x: auto;
  white-space: pre;
}
.rejects {
  margin: 0;
  padding: 12px 14px 12px 30px;
  border-radius: var(--radius-sm);
  background: var(--ko-soft);
  color: var(--ko);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.6;
}

.hist { display: flex; flex-direction: column; gap: 8px; }
.hist > li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  list-style: none;
}
.hist-score { flex: none; font-size: 15px; font-weight: 800; color: var(--brand); }
.hist-meta { flex: 1; min-width: 0; color: var(--ink-3); font-size: 12.5px; font-weight: 600; }

/* ---------- partie de QCM ---------- */
.game-head { display: flex; align-items: center; gap: 10px; }
.game-count { flex: none; color: var(--ink-3); font-size: 12.5px; font-weight: 800; }
.game-bar {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}
.game-bar > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand-2), var(--brand));
  transition: width .25s cubic-bezier(.2, .8, .3, 1);
}
.game-score { text-align: center; font-size: 46px; font-weight: 800; letter-spacing: -1.5px; color: var(--ink-3); }
.game-score.good { color: var(--ok); }
.game-score.mid  { color: var(--warm); }
.game-score.low  { color: var(--ko); }
.game-pct { display: block; }
.game-sub { display: block; margin-top: 4px; font-size: 13.5px; font-weight: 700; color: var(--ink-3); letter-spacing: 0; }
.game-h { margin: 6px 0 0; font-size: 14px; font-weight: 800; }

.corrections { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.corrections > li {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}
.corr-q  { display: block; font-size: 14.5px; font-weight: 800; line-height: 1.4; }
.corr-bad { display: block; margin-top: 6px; color: var(--ko); font-size: 13.5px; font-weight: 700; }
.corr-ok  { display: block; margin-top: 3px; color: var(--ok); font-size: 13.5px; font-weight: 700; }
.corr-exp { display: block; margin-top: 6px; color: var(--ink-2); font-size: 13px; font-weight: 600; line-height: 1.5; }
.quiz-exp { color: var(--ink-2); font-size: 13.5px; font-weight: 600; line-height: 1.5; }

/* ============================================================
   v5 - Mot surprise
   ============================================================ */
.surprise {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 13, 30, .55);
}
.surprise-inner {
  width: 100%;
  max-width: 460px;
  max-height: 88vh;
  max-height: 88dvh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px 20px calc(env(safe-area-inset-bottom, 0px) + 20px);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-2);
  animation: sheetUp .24s cubic-bezier(.2, .8, .3, 1);
}
.surprise-inner > p { margin: 0; }
.surprise-kicker {
  color: var(--brand);
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .8px;
}
.surprise-term { font-size: 30px; font-weight: 800; letter-spacing: -.6px; line-height: 1.15; overflow-wrap: anywhere; }
.surprise-fr { font-size: 19px; font-weight: 800; color: var(--brand); overflow-wrap: anywhere; }
.surprise-ex { color: var(--ink-2); font-size: 14px; font-style: italic; line-height: 1.5; }
.surprise-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }

/* ============================================================
   v5 - Cinq onglets : la place se prend sur les libellés
   ============================================================ */
@media (max-width: 400px) {
  .tab { font-size: 10px; letter-spacing: -.1px; }
  .tab svg { width: 22px; height: 22px; }
}

@media (min-width: 768px) {
  .sheet-head { padding: calc(env(safe-area-inset-top, 0px) + 16px) 24px 12px; }
  .sheet-head h2 { max-width: 940px; }
  .sheet-body { padding: 20px 24px 32px; }
  .sheet-body > * { width: 100%; max-width: 620px; margin-left: auto; margin-right: auto; }
  .subj-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: start; }
  .surprise { align-items: center; }
  .codes { grid-template-columns: repeat(5, 1fr); }
}
