/* English Islands – styles. Pensé d'abord pour le téléphone, confortable sur PC. */

:root {
  color-scheme: light dark;
  --bg: #f4f7f6;
  --surface: #ffffff;
  --surface-2: #eaf1f0;
  --text: #14231f;
  --muted: #56665f;
  --border: #d5e0dd;
  --accent: #0b6e79;
  --accent-ink: #ffffff;
  --accent-soft: #d8eef0;
  --sand: #e9c46a;
  --ok: #2a7d4f;
  --warn: #9a5800;
  --danger: #b3261e;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.05), 0 4px 16px rgb(0 0 0 / 0.04);
  --tabs-h: 60px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1a1c;
    --surface: #16252a;
    --surface-2: #1d3036;
    --text: #e6f0ee;
    --muted: #9db0ac;
    --border: #2a4047;
    --accent: #4fb3bf;
    --accent-ink: #06282c;
    --accent-soft: #173c42;
    --sand: #e9c46a;
    --ok: #5cc28a;
    --warn: #e0a24a;
    --danger: #ff8a80;
    --shadow: none;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--font);
  -webkit-tap-highlight-color: transparent;
}

a { color: var(--accent); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 0.5em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.15rem; }
p { margin: 0 0 0.75em; }
[hidden] { display: none !important; }

/* ---------- Barre du haut et onglets ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(8px + var(--safe-top)) 16px 8px;
  /* Fond opaque : un backdrop-filter ferait de l'en-tête le repère des onglets
     « position: fixed » qu'il contient, qui ne seraient plus collés en bas de l'écran. */
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  margin-right: auto;
}
.brand img { border-radius: 7px; }

.tabs {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-around;
  height: calc(var(--tabs-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.tabs a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 44px;
  color: var(--muted);
  font-size: 0.72rem;
  text-decoration: none;
}
.tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabs a[aria-current="page"] { color: var(--accent); font-weight: 600; }

body.logged-out .tabs,
body.logged-out .sync,
body.booting .tabs,
body.booting .sync { display: none; }

@media (min-width: 900px) {
  .tabs {
    position: static;
    height: auto;
    padding: 0;
    background: none;
    border: 0;
    gap: 4px;
    flex: 0 1 auto;
  }
  .tabs a { flex-direction: row; gap: 6px; padding: 8px 12px; border-radius: var(--radius-sm); font-size: 0.95rem; }
  .tabs a:hover { background: var(--surface-2); }
  .tabs a[aria-current="page"] { background: var(--accent-soft); }
  .tabs svg { width: 20px; height: 20px; }
}

/* Indicateur de synchronisation */
.sync {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}
.sync .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.sync[data-status="ok"] .dot { background: var(--ok); }
.sync[data-status="syncing"] .dot { background: var(--accent); animation: pulse 1s ease-in-out infinite; }
.sync[data-status="pending"] .dot { background: var(--sand); }
.sync[data-status="offline"] .dot { background: var(--muted); }
.sync[data-status="error"] .dot,
.sync[data-status="auth"] .dot { background: var(--danger); }
@keyframes pulse { 50% { opacity: 0.3; } }
@media (prefers-reduced-motion: reduce) { .sync .dot { animation: none !important; } }

/* ---------- Contenu ---------- */

main {
  outline: none;
  padding-bottom: calc(var(--tabs-h) + var(--safe-bottom) + 24px);
}
@media (min-width: 900px) { main { padding-bottom: 48px; } }

.page { max-width: 860px; margin: 0 auto; padding: 20px 16px; }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-header h1 { margin: 0; }
.boot-message { text-align: center; color: var(--muted); padding: 48px 16px; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 16px;
}
.card > :last-child { margin-bottom: 0; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.stat .value { font-size: 1.8rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .label { color: var(--muted); font-size: 0.85rem; }

.list { list-style: none; margin: 0; padding: 0; }
.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  color: var(--text);
  text-decoration: none;
}
.list-item:hover { border-color: var(--accent); }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge.draft { background: color-mix(in srgb, var(--sand) 30%, transparent); color: var(--warn); }
.badge.learning { background: var(--accent-soft); color: var(--accent); }
.badge.mastered { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  flex-direction: column;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
}
.chip small { color: var(--muted); font-size: 0.78rem; }
.chip:hover { border-color: var(--accent); }

.empty { text-align: center; padding: 32px 16px; color: var(--muted); }

/* ---------- Formulaires et boutons ---------- */

.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; margin-bottom: 4px; }
.field .hint { display: block; color: var(--muted); font-size: 0.85rem; margin-top: 4px; }

input[type="text"], input[type="password"], input[type="search"], select, textarea {
  width: 100%;
  font: inherit;
  font-size: 16px; /* évite le zoom automatique de l'iPhone */
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
}
textarea { min-height: 180px; resize: vertical; line-height: 1.55; }
input:focus-visible, select:focus-visible, textarea:focus-visible, .btn:focus-visible, a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: 2px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { color: var(--danger); }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: 0.875rem; }
.btn:disabled { opacity: 0.55; cursor: default; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.actions .spacer { flex: 1; }

.notice { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--text); margin-bottom: 16px; font-size: 0.925rem; }
.notice.error { background: color-mix(in srgb, var(--danger) 14%, transparent); }

dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 12px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; }

.btn.big { min-height: 52px; padding: 12px 28px; font-size: 1.05rem; }
.card.highlight { border-color: var(--accent); background: var(--accent-soft); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
h3 { font-size: 1rem; margin: 20px 0 8px; }
details > summary { cursor: pointer; }
details[open] > summary { margin-bottom: 8px; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--accent);
  font: inherit;
  cursor: pointer;
}
.icon-btn svg, .btn svg { width: 20px; height: 20px; fill: currentColor; }

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 6px;
  vertical-align: -2px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }

/* ---------- Correction ---------- */

.diff { line-height: 1.9; }
.diff .del, .mistakes .del { color: var(--danger); text-decoration: line-through; }
.diff .add, .mistakes .add { color: var(--ok); font-weight: 600; }
.diff .del, .diff .add { padding: 1px 3px; border-radius: 4px; }
.diff .del { background: color-mix(in srgb, var(--danger) 10%, transparent); }
.diff .add { background: color-mix(in srgb, var(--ok) 12%, transparent); }

.mistakes, .vocab { padding-left: 20px; margin: 0; }
.mistakes li, .vocab li { margin-bottom: 10px; }
.mistakes .badge { margin-left: 4px; }

.sentence-editor { padding: 0; margin: 0 0 12px; list-style: none; counter-reset: sentence; }
.sentence-editor li {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  counter-increment: sentence;
}
.sentence-editor li::before { content: "Phrase " counter(sentence); font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.sentence-editor textarea { min-height: 0; }
.sentence-editor textarea[name="fr"] { color: var(--muted); }
.sentence-editor .row-actions { display: flex; gap: 8px; align-items: center; }
@media (min-width: 700px) {
  .sentence-editor li { grid-template-columns: 1fr 1fr auto; align-items: start; }
  .sentence-editor li::before { grid-column: 1 / -1; }
  .sentence-editor .row-actions { flex-direction: column; }
}

/* Phrases d'un îlot validé */
.sentences { list-style: none; padding: 0; margin: 0 0 16px; }
.sentence-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
}
.sentence-row .grow { flex: 1; min-width: 0; }
.sentence-row .en { font-weight: 600; }
.sentence-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; flex: none; max-width: 40%; }
.stage { color: var(--accent); letter-spacing: 2px; font-size: 0.8rem; }
@media (max-width: 520px) {
  .sentence-row { flex-wrap: wrap; }
  .sentence-meta { flex-direction: row; flex-wrap: wrap; gap: 8px; max-width: none; width: 100%; padding-left: 56px; text-align: left; }
}

/* ---------- Session de révision ---------- */

.session { max-width: 640px; }
.session-top { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.progress { flex: 1; height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); border-radius: 999px; transition: width 0.3s; }
.mode-label { font-weight: 700; color: var(--accent); margin-bottom: 2px; }

.exercise { display: flex; flex-direction: column; gap: 12px; }
.exercise > * { margin: 0; }
.prompt { font-size: 1.35rem; line-height: 1.5; font-weight: 600; }
.prompt.ok { color: var(--ok); }
.prompt.letters { letter-spacing: 0.04em; }
.prompt.cloze { line-height: 2.2; }
.blank {
  font: inherit;
  font-size: 1.1rem;
  padding: 2px 6px;
  border: 0;
  border-bottom: 2px solid var(--accent);
  border-radius: 6px 6px 0 0;
  background: var(--accent-soft);
  color: var(--text);
  text-align: center;
}
.filled { padding: 2px 6px; border-radius: 6px; }
.filled.ok { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.filled.ko { background: color-mix(in srgb, var(--danger) 12%, transparent); }
.filled.ko s { color: var(--danger); font-weight: 400; }
.exercise textarea { min-height: 72px; }
.answer { border-top: 1px dashed var(--border); padding-top: 12px; }
.hint-list, .answer-list { margin: 0; padding-left: 22px; }
.hint-list li, .answer-list li { margin-bottom: 6px; }
.answer-list li { font-weight: 600; }
.recorder { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.recorder audio { max-width: 100%; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: currentColor; animation: pulse 1s ease-in-out infinite; }

.grades { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 16px; }
.grade {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-height: 60px;
  padding: 8px 4px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
}
.grade small { color: var(--muted); font-weight: 400; font-size: 0.75rem; }
.grade.again { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); }
.grade.hard { border-color: color-mix(in srgb, var(--warn) 45%, var(--border)); }
.grade.good { border-color: color-mix(in srgb, var(--ok) 45%, var(--border)); }
.grade.easy { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.grade.suggested { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
.grade-stat.again .value { color: var(--danger); }
.grade-stat.hard .value { color: var(--warn); }
.grade-stat.good .value { color: var(--ok); }
.grade-stat.easy .value { color: var(--accent); }

/* ---------- Mémo conjugaison ---------- */

button.chip { font: inherit; cursor: pointer; }
.chip.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip.active small { color: inherit; }
.chip-warn { border-color: color-mix(in srgb, var(--warn) 50%, var(--border)); }
.tense-chips { margin-bottom: 12px; }
.tense-chips .chip { padding: 6px 12px; font-size: 0.85rem; }

.sheet-list { list-style: none; margin: 0; padding: 0; }
.sheet-list li + li { border-top: 1px solid var(--border); }
.sheet-list a { display: flex; flex-direction: column; padding: 10px 0; color: var(--text); text-decoration: none; }
.sheet-list a:hover strong { color: var(--accent); }

.form-cells { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.form-cell { display: flex; flex-direction: column; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); }
.form-cell strong { font-size: 1.15rem; }
.form-cell.irregular strong { color: var(--accent); }
@media (max-width: 340px) { .form-cells { grid-template-columns: 1fr; } }

.conj-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.conj-table, .grammar-table, .irregular-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.conj-table th, .grammar-table th, .irregular-table th { text-align: left; font-size: 0.8rem; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.conj-table td, .grammar-table td, .irregular-table td { padding: 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.irregular-table tr[data-href] { cursor: pointer; }
.irregular-table tr[data-href]:hover { background: var(--surface-2); }
.irregular-table a { color: var(--text); text-decoration: none; }
.table-wrap { overflow-x: auto; margin-bottom: 12px; }

/* Sur téléphone, chaque ligne des tableaux devient une petite fiche. */
@media (max-width: 640px) {
  .conj-table thead, .grammar-table thead { display: none; }
  .conj-table tr, .grammar-table tr { display: block; padding: 8px 0; border-bottom: 1px solid var(--border); }
  .conj-table td, .grammar-table td { display: block; padding: 2px 0; border: 0; }
  .conj-table td::before, .grammar-table td[data-label]:not([data-label=""])::before {
    content: attr(data-label) " : ";
    color: var(--muted);
    font-size: 0.78rem;
  }
  .hide-mobile { display: none; }
  .irregular-table { font-size: 0.875rem; }
  .irregular-table td, .irregular-table th { padding: 6px 4px; }
}

.examples { list-style: none; padding: 0; margin: 0 0 12px; }
.examples li { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; }
.icon-btn.small { width: 32px; height: 32px; font-size: 0.7rem; }
.notice.warn { background: color-mix(in srgb, var(--warn) 14%, transparent); }
.grammar article h2 { margin-top: 20px; }
.grammar article h2:first-child { margin-top: 0; }
.grammar article ul { padding-left: 20px; }
.grammar article li { margin-bottom: 6px; }
mark { background: color-mix(in srgb, var(--sand) 45%, transparent); color: inherit; border-radius: 3px; padding: 0 2px; }

.form-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-input { display: flex; flex-direction: column; gap: 4px; }
.form-input input { font: inherit; font-size: 1.1rem; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); }
.form-input .filled { align-self: flex-start; font-weight: 600; }

/* ---------- Tableau de bord ---------- */

.streak { padding: 6px 12px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-weight: 700; white-space: nowrap; }
.streak.on { background: color-mix(in srgb, var(--sand) 35%, transparent); color: var(--text); }
.notice.reminder { background: color-mix(in srgb, var(--sand) 30%, transparent); font-weight: 600; }
.today-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.today-head h2 { margin: 0; }
.today .muted { margin: 0; }
.goal { margin-top: 16px; }
.goal-label { display: flex; justify-content: space-between; font-size: 0.875rem; margin-bottom: 6px; }
.goal .progress { background: var(--surface); }
.ok-text { color: var(--ok); margin: 6px 0 0; font-weight: 600; }

a.stat { color: var(--text); text-decoration: none; }
a.stat:hover { border-color: var(--accent); }
.stat .value small { font-size: 0.9rem; color: var(--muted); font-weight: 600; }

.heatmap { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; margin-top: 12px; max-width: 420px; }
.heat { display: inline-block; aspect-ratio: 1; min-width: 12px; border-radius: 4px; background: var(--surface-2); }
.heat.l1 { background: color-mix(in srgb, var(--accent) 30%, var(--surface-2)); }
.heat.l2 { background: color-mix(in srgb, var(--accent) 55%, var(--surface-2)); }
.heat.l3 { background: color-mix(in srgb, var(--accent) 80%, var(--surface-2)); }
.heat.l4 { background: var(--accent); }
.heat-legend { display: flex; align-items: center; gap: 4px; margin-top: 8px; }
.heat-legend .heat { width: 12px; height: 12px; }

.bars { list-style: none; padding: 0; margin: 0 0 12px; }
.bars li { display: grid; grid-template-columns: 9rem 1fr 2rem; gap: 10px; align-items: center; margin-bottom: 8px; }
.bar { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--warn); border-radius: 999px; }
.bar-value { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }

.pack-list { list-style: none; padding: 0; margin: 0 0 12px; }
.pack-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.pack-list .grow { flex: 1; min-width: 0; }

/* ---------- Réglages ---------- */

.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 420px) { .row-2 { grid-template-columns: 1fr; } }
.devices { list-style: none; padding: 0; margin: 0 0 16px; }
.devices li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.devices .grow { flex: 1; min-width: 0; }
label.btn { cursor: pointer; }

/* ---------- Connexion ---------- */

.login { max-width: 400px; margin: 8vh auto 0; padding: 0 16px; }
.login .logo { display: block; width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 16px; }
.login h1 { text-align: center; }
.login p.lead { text-align: center; color: var(--muted); }

/* ---------- Bandeau et notifications ---------- */

.banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 16px;
  background: var(--accent-soft);
  font-size: 0.925rem;
}

#toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabs-h) + var(--safe-bottom) + 16px);
  transform: translateX(-50%) translateY(20px);
  max-width: calc(100% - 32px);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--text);
  color: var(--bg);
  font-size: 0.925rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 20;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.error { background: var(--danger); color: #fff; }
@media (min-width: 900px) { #toast { bottom: 24px; } }
