/* Bate-papo — identité visuelle
   Deux voix, deux couleurs (portugais / français). Signature : les mots portugais appris
   sont surlignés au marqueur, comme dans un cahier de langue. */

@font-face {
  font-family: 'Atkinson Next';
  src: url('fonts/atkinson-hyperlegible-next-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Atkinson Next';
  src: url('fonts/atkinson-hyperlegible-next-latin-600-normal.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Atkinson Next';
  src: url('fonts/atkinson-hyperlegible-next-latin-700-normal.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

/* ---------- Palettes (Réglages → Couleurs). Chaque palette définit les mêmes variables. */
:root {
  --primary-size: 1.5rem;
  --secondary-size: 0.95rem;
  --radius: 18px;
  --font: 'Atkinson Next', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mata: #1f7a4d;
  --alerta: #c2412d;
  --ocre: #b7791f;
}

/* 0. Origine : le vert et le bleu du premier prototype */
:root:not([data-theme]), [data-theme='origine'] {
  --sky: #eef3f8; --surface: #ffffff; --ink: #0f172a; --ink-soft: #526079; --line: #d4dce7;
  --pt: #16a34a; --pt-ink: #ffffff; --pt-tint: #e2f5e8;
  --fr: #2563eb; --fr-ink: #ffffff; --fr-tint: #e3ebfd;
  --marker: #86efac; --marker-ink: #0f172a;
  --action: #16a34a; --action-ink: #ffffff;
  --scrim: rgba(15, 23, 42, 0.4); --shadow: rgba(15, 23, 42, 0.16);
}
[data-theme='origine'] .bubble.pt { box-shadow: inset 4px 0 0 var(--pt); }
[data-theme='origine'] .bubble.fr { box-shadow: inset 4px 0 0 var(--fr); }

/* 1. Ipê : jaune de l'ipê (Brésil) et bleu de France */
[data-theme='ipe'] {
  --sky: #eaf0f6; --surface: #ffffff; --ink: #13233a; --ink-soft: #586a80; --line: #d3dce6;
  --pt: #f5c400; --pt-ink: #13233a; --pt-tint: #fff6d1;
  --fr: #2b59c3; --fr-ink: #ffffff; --fr-tint: #e3eafb;
  --marker: #f5c400; --marker-ink: #13233a;
  --action: #2b59c3; --action-ink: #ffffff;
  --scrim: rgba(19, 35, 58, 0.38); --shadow: rgba(19, 35, 58, 0.18);
}

/* 2. Lagune : turquoise des plages brésiliennes et bleu nuit, marqueur menthe */
[data-theme='lagune'] {
  --sky: #eef5f4; --surface: #ffffff; --ink: #10292b; --ink-soft: #4f6a6b; --line: #cfe0de;
  --pt: #0b8a8f; --pt-ink: #ffffff; --pt-tint: #dcf1ef;
  --fr: #243b74; --fr-ink: #ffffff; --fr-tint: #e2e7f4;
  --marker: #8fe3cc; --marker-ink: #10292b;
  --action: #0b8a8f; --action-ink: #ffffff;
  --scrim: rgba(16, 41, 43, 0.4); --shadow: rgba(16, 41, 43, 0.16);
}

/* 3. Jacarandá : violet des jacarandas, vert profond, marqueur jaune pâle */
[data-theme='jacaranda'] {
  --sky: #f4f2f8; --surface: #ffffff; --ink: #221a33; --ink-soft: #655b78; --line: #ddd6e8;
  --pt: #6c3fb0; --pt-ink: #ffffff; --pt-tint: #ece4f8;
  --fr: #24614a; --fr-ink: #ffffff; --fr-tint: #e1efe8;
  --marker: #f6dc6b; --marker-ink: #221a33;
  --action: #6c3fb0; --action-ink: #ffffff;
  --scrim: rgba(34, 26, 51, 0.4); --shadow: rgba(34, 26, 51, 0.16);
}

/* 4. Ardoise : sobre, graphite et blanc, seul le marqueur est en couleur */
[data-theme='ardoise'] {
  --sky: #f2f3f5; --surface: #ffffff; --ink: #1c2229; --ink-soft: #5d6670; --line: #d9dde2;
  --pt: #2a333d; --pt-ink: #ffffff; --pt-tint: #e6e8eb;
  --fr: #ffffff; --fr-ink: #1c2229; --fr-tint: #ffffff;
  --marker: #ffe45c; --marker-ink: #1c2229;
  --action: #1c2229; --action-ink: #ffffff;
  --scrim: rgba(28, 34, 41, 0.4); --shadow: rgba(28, 34, 41, 0.16);
}
[data-theme='ardoise'] .talk.fr { box-shadow: inset 0 0 0 2px var(--ink); }
[data-theme='ardoise'] .bubble.fr { box-shadow: inset 0 0 0 1.5px var(--line); }
[data-theme='ardoise'] .lang-tag.fr { box-shadow: inset 0 0 0 1.5px var(--ink); }

/* ---------- Versions sombres (Réglages → Mode sombre) */
[data-mode='dark'] { color-scheme: dark; --scrim: rgba(0, 0, 0, 0.55); --shadow: rgba(0, 0, 0, 0.5); }

[data-theme='origine'][data-mode='dark'] {
  --sky: #0f172a; --surface: #1e293b; --ink: #f1f5f9; --ink-soft: #94a3b8; --line: #334155;
  --pt: #16a34a; --pt-ink: #ffffff; --pt-tint: #15302e;
  --fr: #2563eb; --fr-ink: #ffffff; --fr-tint: #172a55;
  --marker: #15803d; --marker-ink: #ffffff;
  --action: #16a34a; --action-ink: #ffffff;
}

[data-theme='ipe'][data-mode='dark'] {
  --sky: #121726; --surface: #1b2135; --ink: #eceff8; --ink-soft: #9aa3bc; --line: #2c3452;
  --pt: #f6c453; --pt-ink: #1a1400; --pt-tint: #2b2a24;
  --fr: #8aa4ff; --fr-ink: #0d1430; --fr-tint: #222b4a;
  --marker: #9a7414; --marker-ink: #fff8e1;
  --action: #8aa4ff; --action-ink: #0d1430;
}

[data-theme='lagune'][data-mode='dark'] {
  --sky: #0d1c1e; --surface: #142a2c; --ink: #e6f2f1; --ink-soft: #93b0ae; --line: #24403f;
  --pt: #2ec4c4; --pt-ink: #062324; --pt-tint: #163536;
  --fr: #8fa8e8; --fr-ink: #0d1533; --fr-tint: #1c2742;
  --marker: #2f7f6c; --marker-ink: #eafff8;
  --action: #2ec4c4; --action-ink: #062324;
}

[data-theme='jacaranda'][data-mode='dark'] {
  --sky: #16121f; --surface: #211b2e; --ink: #efeaf7; --ink-soft: #a69bba; --line: #352c48;
  --pt: #a77ff0; --pt-ink: #170c2b; --pt-tint: #2a2140;
  --fr: #5cc39a; --fr-ink: #06261a; --fr-tint: #1a2f28;
  --marker: #8a7420; --marker-ink: #fff8dc;
  --action: #a77ff0; --action-ink: #170c2b;
}

[data-theme='ardoise'][data-mode='dark'] {
  --sky: #111417; --surface: #1b1f24; --ink: #eceef1; --ink-soft: #9aa2ad; --line: #2d333b;
  --pt: #eceef1; --pt-ink: #111417; --pt-tint: #262b31;
  --fr: #1b1f24; --fr-ink: #eceef1; --fr-tint: #1b1f24;
  --marker: #a38a12; --marker-ink: #fffbe0;
  --action: #eceef1; --action-ink: #111417;
}

body[data-size='grand'] {
  --primary-size: 1.9rem;
  --secondary-size: 1.1rem;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--sky);
  color: var(--ink);
  font-family: var(--font);
  -webkit-tap-highlight-color: transparent;
}

body {
  display: flex;
  flex-direction: column;
  height: 100dvh;
}

button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--action); outline-offset: 2px; border-radius: 8px; }

.hint { color: var(--ink-soft); font-size: 0.85rem; margin: 8px 0 0; line-height: 1.4; }

/* ---------- barre du haut */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 6px 6px 16px;
  padding-top: max(6px, env(safe-area-inset-top));
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.title { display: flex; align-items: center; gap: 8px; }
.brand { font-size: 1.3rem; font-weight: 700; letter-spacing: -0.01em; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--alerta); }
.dot.ok { background: var(--mata); }
.top-actions { display: flex; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  background: transparent;
  border: none;
  color: var(--ink);
  width: 44px;
  height: 44px;
  border-radius: 12px;
}
.icon-btn:active { background: var(--sky); }
.badge-host { position: relative; }
.badge {
  position: absolute;
  top: 4px;
  right: 3px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--marker);
  color: var(--marker-ink);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 18px;
  border: 2px solid var(--surface);
  box-sizing: content-box;
}

.subbar {
  font-size: 0.75rem;
  color: var(--ink-soft);
  padding: 4px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.subbar.bad { color: var(--alerta); }

.banner {
  background: var(--pt-tint);
  color: var(--ink);
  font-size: 0.85rem;
  padding: 8px 16px;
  border-bottom: 1px solid var(--line);
}

/* ---------- conversation */
.conversation {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.empty { margin: auto; max-width: 300px; text-align: center; line-height: 1.5; }
.empty h2 { font-size: 1.25rem; margin: 0 0 8px; }
.empty p { margin: 0 0 10px; color: var(--ink-soft); }
.empty .mark { background: linear-gradient(transparent 58%, var(--marker) 58%); color: var(--ink); }

.bubble {
  max-width: 92%;
  padding: 12px 14px 10px;
  border-radius: var(--radius);
}
.bubble.pt { align-self: flex-start; background: var(--pt-tint); border-bottom-left-radius: 4px; }
.bubble.fr { align-self: flex-end; background: var(--fr-tint); border-bottom-right-radius: 4px; }

.primary { font-size: var(--primary-size); line-height: 1.28; font-weight: 700; margin: 4px 0 2px; }
.secondary { font-size: var(--secondary-size); color: var(--ink-soft); line-height: 1.45; }
.pending { color: var(--ink-soft); font-weight: 400; font-size: 1rem; }

.lang-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 2px 6px;
  border-radius: 6px;
  vertical-align: 0.15em;
  margin-right: 4px;
}
.lang-tag.pt { background: var(--pt); color: var(--pt-ink); }
.lang-tag.fr { background: var(--fr); color: var(--fr-ink); }

.hidden-fr { filter: blur(7px); user-select: none; cursor: pointer; }

/* Mots portugais : soulignés = touchables, surlignés = déjà dans le carnet */
.word {
  cursor: pointer;
  text-decoration: underline dotted color-mix(in srgb, currentColor 28%, transparent);
  text-underline-offset: 0.24em;
  text-decoration-thickness: 1px;
  border-radius: 3px;
}
.word.saved {
  text-decoration: none;
  background: linear-gradient(transparent 52%, var(--marker) 52%, var(--marker) 92%, transparent 92%);
}
.word:active { background: var(--marker); }

.vocab { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px 5px 8px;
  font-size: 0.85rem;
  line-height: 1.2;
  text-align: left;
}
.chip svg { width: 16px; height: 16px; flex: none; color: var(--ink-soft); }
.chip strong { font-weight: 700; }
.chip span { color: var(--ink-soft); }
.chip.saved { border-color: var(--marker); background: var(--marker); }
.chip.saved svg, .chip.saved span { color: var(--ink); }

.actions { display: flex; align-items: center; gap: 2px; margin-top: 8px; margin-left: -6px; }
.action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: none;
  color: var(--ink-soft);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 0.82rem;
  font-weight: 600;
}
.action svg { width: 17px; height: 17px; }
.action:active { background: color-mix(in srgb, var(--ink) 8%, transparent); }
.meta { font-size: 0.72rem; color: var(--ink-soft); margin-left: auto; padding-left: 8px; white-space: nowrap; }
.explanation {
  margin-top: 6px;
  padding: 10px 12px;
  background: var(--surface);
  border-radius: 12px;
  font-size: 0.92rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.live {
  margin: 0 14px 10px;
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--surface);
  border: 1.5px dashed var(--line);
  font-size: 1.1rem;
  color: var(--ink-soft);
}

/* ---------- boutons de parole */
.controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 10px 14px;
  padding-bottom: max(14px, env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.talk {
  border: none;
  border-radius: 20px;
  min-height: 72px;
  padding: 10px 8px;
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transition: transform 0.1s, box-shadow 0.2s;
}
.talk-flag { font-size: 1.4rem; line-height: 1; }
.talk.pt { background: var(--pt); color: var(--pt-ink); }
.talk.fr { background: var(--fr); color: var(--fr-ink); }
.talk:active { transform: scale(0.97); }
.talk.active.pt { box-shadow: 0 0 0 4px var(--surface), 0 0 0 7px var(--pt); animation: listen-pt 1.4s ease-in-out infinite; }
.talk.active.fr { box-shadow: 0 0 0 4px var(--surface), 0 0 0 7px var(--fr); animation: listen-fr 1.4s ease-in-out infinite; }
@keyframes listen-pt { 50% { box-shadow: 0 0 0 4px var(--surface), 0 0 0 11px var(--pt-tint); } }
@keyframes listen-fr { 50% { box-shadow: 0 0 0 4px var(--surface), 0 0 0 11px var(--fr-tint); } }

/* ---------- vue face à face */
body.face-mode > :not(.face):not(.overlay):not(.modal):not(.toast):not(script) { display: none !important; }
.face { position: fixed; inset: 0; display: flex; flex-direction: column; background: var(--sky); }
.face-half { flex: 1; display: flex; flex-direction: column; gap: 12px; padding: 16px; min-height: 0; }
.face-pt { transform: rotate(180deg); background: var(--pt-tint); padding-bottom: max(16px, env(safe-area-inset-top)); }
.face-fr { background: var(--fr-tint); padding-bottom: max(16px, env(safe-area-inset-bottom)); border-top: 2px solid var(--surface); }
.face-text { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.face-text p { margin: 0; }
.face-other { font-size: calc(var(--primary-size) + 0.15rem); font-weight: 700; line-height: 1.28; }
.face-own { font-size: var(--secondary-size); color: var(--ink-soft); }
.face-interim { font-style: italic; }
.face-bottom { display: flex; gap: 10px; }
.face-bottom .talk { flex: 1; }
.face-exit { background: var(--surface); width: 56px; height: auto; border-radius: 20px; }

/* ---------- écrans superposés (carnet, réglages) */
.overlay { position: fixed; inset: 0; z-index: 20; background: var(--sky); display: flex; flex-direction: column; }
.overlay-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 6px 6px 16px;
  padding-top: max(6px, env(safe-area-inset-top));
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.overlay-head h1 { font-size: 1.3rem; margin: 0; }
.overlay-body { flex: 1; overflow-y: auto; padding: 16px; padding-bottom: max(16px, env(safe-area-inset-bottom)); }

/* boutons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 18px;
  border: none;
  border-radius: 14px;
  font-weight: 700;
  font-size: 1rem;
  width: 100%;
}
.btn-primary { background: var(--action); color: var(--action-ink); }
.btn-danger { background: var(--alerta); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-soft { background: var(--sky); color: var(--ink); }
.btn-marker { background: var(--marker); color: var(--marker-ink); }
.btn:disabled { background: var(--sky); color: var(--ink-soft); cursor: default; }

/* réglages */
.settings fieldset {
  border: none;
  background: var(--surface);
  border-radius: var(--radius);
  margin: 0 0 14px;
  padding: 14px 16px 16px;
}
.settings legend { float: left; width: 100%; padding: 0; margin-bottom: 8px; font-weight: 700; }
.choice { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--sky); clear: both; }
.choice:first-of-type { border-top: none; }
.choice input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--action); flex: none; }
.choice span { display: flex; flex-direction: column; gap: 2px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0 2px; border-top: 1px solid var(--sky); clear: both; cursor: pointer; }
.switch-row span { display: flex; flex-direction: column; gap: 2px; }
.switch-row small { color: var(--ink-soft); font-size: 0.85rem; }
.switch { position: relative; flex: none; width: 52px; height: 32px; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 16px; background: var(--line); transition: background 0.15s; pointer-events: none; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: transform 0.15s; }
.switch input:checked + i { background: var(--action); }
.switch input:checked + i::after { transform: translateX(20px); background: var(--action-ink); }
.switch-row + .switch-row { border-top: none; padding-top: 6px; }
.switch-row.disabled { opacity: 0.45; cursor: default; }
.switch input:disabled { cursor: default; }
.switch input:focus-visible + i { outline: 3px solid var(--action); outline-offset: 2px; }
.choice .swatch {
  flex: none;
  flex-direction: row;
  gap: 3px;
  padding: 5px;
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px var(--line);
}
.swatch i { display: block; width: 14px; height: 22px; border-radius: 5px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12); }
.choice small { color: var(--ink-soft); font-size: 0.85rem; line-height: 1.35; }

/* compte */
.account { display: flex; flex-direction: column; gap: 10px; clear: both; }
.account-text { margin: 0; line-height: 1.45; color: var(--ink-soft); }
.account-text strong { display: block; color: var(--ink); font-size: 1.05rem; margin-bottom: 2px; }
.account-actions { display: grid; gap: 8px; }
.account .hint { margin: -2px 0 0; }

/* carnet */
.carnet-top { margin-bottom: 16px; }
.carnet-count { color: var(--ink-soft); font-size: 0.85rem; margin: 10px 0 0; text-align: center; }
.carnet-list { background: var(--surface); border-radius: var(--radius); padding: 0 16px; }
.carnet-item { display: flex; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--sky); }
.carnet-item:last-child { border-bottom: none; }
.carnet-item .term {
  font-size: 1.1rem;
  font-weight: 700;
  background: linear-gradient(transparent 55%, var(--marker) 55%, var(--marker) 92%, transparent 92%);
}
.carnet-item .pron { color: var(--ink-soft); font-size: 0.85rem; margin-left: 4px; }
.carnet-item .meaning { margin-top: 4px; }
.carnet-item .note, .carnet-item .sentence { color: var(--ink-soft); font-size: 0.85rem; margin-top: 2px; line-height: 1.4; }
.carnet-side { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 0.78rem; color: var(--ink-soft); white-space: nowrap; }
.carnet-side .icon-btn { width: 36px; height: 36px; color: var(--ink-soft); }
.carnet-side .icon-btn svg { width: 18px; height: 18px; }
.carnet-empty { text-align: center; color: var(--ink-soft); line-height: 1.5; padding: 24px 12px; }

.review-card {
  background: var(--surface);
  border-radius: 24px;
  padding: 22px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: center;
}
.remaining { color: var(--ink-soft); font-size: 0.85rem; margin: 0; }
.review-term { font-size: 2.2rem; font-weight: 700; margin: 12px auto 0; background: linear-gradient(transparent 55%, var(--marker) 55%, var(--marker) 92%, transparent 92%); }
.review-sentence { color: var(--ink-soft); margin: 0; line-height: 1.45; }
.review-answer { border-top: 1.5px dashed var(--line); padding-top: 14px; }
.review-meaning { font-size: 1.35rem; font-weight: 700; margin: 0; }
.review-extra { color: var(--ink-soft); margin: 6px 0 0; }
.grades { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.grades button { border: none; border-radius: 14px; min-height: 54px; color: #fff; font-weight: 700; font-size: 0.9rem; }
.grades [data-g='again'] { background: var(--alerta); }
.grades [data-g='hard'] { background: var(--ocre); }
.grades [data-g='good'] { background: var(--mata); }
.grades [data-g='easy'] { background: #2b59c3; }
.review-done { text-align: center; padding: 40px 12px; }
.review-done h2 { margin: 0 0 6px; }
.review-done p { color: var(--ink-soft); margin: 0 0 20px; }

/* ---------- panneaux du bas (correction, confirmation, mot à mot) */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.backdrop { position: absolute; inset: 0; background: var(--scrim); opacity: 0; transition: opacity 0.2s; }
.sheet-panel {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 88dvh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: 24px 24px 0 0;
  padding: 8px 18px max(18px, env(safe-area-inset-bottom));
  box-shadow: 0 -12px 40px var(--shadow);
  transform: translateY(100%);
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.modal.open .backdrop { opacity: 1; }
.modal.open .sheet-panel { transform: translateY(0); }
.sheet-panel:focus { outline: none; }
.grabber { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 12px; }

.sheet-content { display: flex; flex-direction: column; gap: 12px; }
.sheet-title { font-size: 1.25rem; margin: 0; line-height: 1.3; }
.sheet-text { margin: 0; color: var(--ink-soft); line-height: 1.45; }
.sheet-actions { display: grid; grid-template-columns: 1fr 1.6fr; gap: 10px; margin-top: 4px; }
.field {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 1.1rem;
  line-height: 1.4;
  background: var(--surface);
  resize: none;
}
.field:focus { outline: none; border-color: var(--action); box-shadow: 0 0 0 3px var(--line); }

/* mot à mot */
.word-term { font-size: 1.8rem; font-weight: 700; margin: 0; }
.word-term span { background: linear-gradient(transparent 55%, var(--marker) 55%, var(--marker) 92%, transparent 92%); }
.word-pron { color: var(--ink-soft); margin: -6px 0 0; }
.word-meaning { font-size: 1.2rem; margin: 0; line-height: 1.4; }
.word-note { color: var(--ink-soft); margin: 0; font-size: 0.92rem; line-height: 1.45; }
.word-sentence { color: var(--ink-soft); margin: 0; font-size: 0.85rem; border-left: 3px solid var(--marker); padding-left: 10px; }

.toast {
  position: fixed;
  left: 50%;
  top: calc(env(safe-area-inset-top) + 64px);
  transform: translate(-50%, -8px);
  z-index: 60;
  background: var(--ink);
  color: var(--surface);
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  max-width: 88%;
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  .talk.active { animation: none !important; }
  .sheet-panel, .backdrop, .toast { transition: none; }
}
