/* Couleurs de l'église Vases d'honneur :
   bleu-vert #00716D (texte du logo), or #D1AF1F (monogramme), rouge #B31E2A (trait) */
:root {
  --bg: #f6f7f4;
  --surface: #ffffff;
  --surface-2: #eef2f0;
  --ink: #1c2a29;
  --muted: #5f706e;
  --line: #dde5e2;
  --accent: #00716d;
  --accent-ink: #fff;
  --accent-soft: #dcefec;
  --gold: #a8890c;
  --gold-bright: #d1af1f;
  --gold-soft: #f7efc9;
  --red: #b31e2a;
  --ok: #2e7d4f;
  --ok-soft: #ddf0e3;
  --danger: #b31e2a;
  --shadow: 0 1px 2px rgb(10 40 38 / 0.06), 0 4px 16px rgb(10 40 38 / 0.05);
  --radius: 14px;
  --serif: 'Literata', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0d1615;
    --surface: #14201f;
    --surface-2: #1c2b29;
    --ink: #e6efed;
    --muted: #93a6a3;
    --line: #2a3a38;
    --accent: #3db5aa;
    --accent-ink: #04201e;
    --accent-soft: #11312e;
    --gold: #e3c44a;
    --gold-bright: #e3c44a;
    --gold-soft: #3a3214;
    --red: #e0525c;
    --ok: #7ccf9a;
    --ok-soft: #173325;
    --danger: #f07a7f;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
/* un élément masqué reste masqué, même s'il a un style d'affichage (ex. bouton « Arrêter ») */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
/* Taille du texte choisie par le lecteur (bouton « Aa ») */
body { zoom: var(--zoom, 1); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0 0 0.4em; }
h1 { font-size: clamp(1.7rem, 4vw, 2.2rem); }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.1rem; margin: 0; }
p { margin: 0 0 0.8em; }
.muted { color: var(--muted); }
.sm { font-size: 0.85rem; }
.accent { color: var(--accent); font-weight: 600; }
.ok { color: var(--ok); font-weight: 600; }
.error { color: var(--danger); }
.row { display: flex; align-items: center; }
.row.gap { gap: 8px; }
.row.between { justify-content: space-between; gap: 12px; }
.row.wrap { flex-wrap: wrap; }
.stack { display: grid; gap: 8px; }

/* --- Boutons et champs --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: 10px;
  padding: 10px 16px; font: 600 0.95rem var(--sans);
  cursor: pointer; text-decoration: none; transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}
.btn.sm { padding: 7px 12px; font-size: 0.85rem; }
.btn.block { width: 100%; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.done { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.btn:disabled { opacity: 0.5; cursor: default; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link:hover { color: var(--ink); }
.link.danger { color: var(--danger); font-size: 0.85rem; }
.input {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; min-width: 0;
}
.input:focus, .btn:focus-visible, .chap:focus-visible, .tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.input.sm { padding: 6px 10px; font-size: 0.9rem; }
label { font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.fields { display: flex; flex-wrap: wrap; gap: 16px 28px; margin-top: 16px; }
.fields label { display: grid; gap: 6px; }
.fields.compact { margin-top: 0; gap: 10px 16px; }
.check { display: flex; gap: 8px; align-items: center; margin: 16px 0; color: var(--ink); font-weight: 500; }

/* --- Bandeau démo --- */
.demo { background: var(--accent-soft); color: var(--accent); text-align: center; font-size: 0.82rem; padding: 6px 16px; }

/* --- Connexion --- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.demo + .auth { min-height: calc(100vh - 32px); }
.auth-card {
  width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 20px; padding: 32px 28px; box-shadow: var(--shadow); text-align: center;
}
.auth-card form { text-align: left; margin-top: 20px; }
.brand-lg { display: block; margin: 0 auto 14px; }
.brand-lg img { display: block; height: 96px; width: auto; margin: 0 auto; }
.red-bar { display: block; width: 48px; height: 4px; background: var(--red); border-radius: 2px; margin: 0 auto 14px; }
.code-input { text-align: center; font: 600 1.15rem/1 ui-monospace, 'Cascadia Mono', Consolas, monospace; letter-spacing: 0.08em; padding: 12px; }
.code-box { display: flex; gap: 10px; align-items: center; justify-content: center; background: var(--surface-2); border-radius: 12px; padding: 14px; margin: 20px 0 4px; flex-wrap: wrap; }
.code-box code { font: 700 1.35rem ui-monospace, 'Cascadia Mono', Consolas, monospace; letter-spacing: 0.1em; user-select: all; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 0.82rem; margin: 22px 0 14px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* --- En-tête --- */
.top {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px max(16px, calc((100vw - 1040px) / 2)); background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--accent); font: 600 1.05rem var(--serif); }
.brand img { height: 32px; width: auto; display: block; }
.brand span { color: var(--accent); }
.top::after { content: ''; position: absolute; left: max(16px, calc((100vw - 1040px) / 2)); bottom: -1px; width: 44px; height: 3px; background: var(--red); border-radius: 2px; }
.top nav { display: flex; align-items: center; gap: 18px; font-size: 0.9rem; }
.top nav a { text-decoration: none; color: var(--muted); font-weight: 500; }
.top nav a.active, .top nav a:hover { color: var(--ink); }
.top nav .link { text-decoration: none; }
@media (max-width: 520px) {
  .brand span { display: none; }
  .top nav { gap: 14px; font-size: 0.85rem; }
  .top nav > * { white-space: nowrap; }
  /* avec un texte agrandi, les liens passent à la ligne au lieu de déborder */
  .top nav { flex-wrap: wrap; justify-content: flex-end; row-gap: 4px; min-width: 0; }
  .top nav a[href="#/"] { display: none; } /* le logo ramène déjà à l'accueil */
}

/* --- Page --- */
.page { max-width: 1040px; margin: 0 auto; padding: 28px 16px 64px; }
section { margin-top: 32px; }
.section-title { font-family: var(--sans); font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 12px; }
.back { display: inline-block; text-decoration: none; color: var(--muted); font-size: 0.9rem; margin-bottom: 12px; }
.back:hover { color: var(--ink); }
.empty { padding: 20px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); text-align: center; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); margin-top: 16px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.cards .card { margin: 0; display: grid; gap: 12px; }
.pill { background: var(--gold-soft); color: var(--ink); font-weight: 600; font-size: 0.8rem; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }

.bar { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin-top: 12px; }
.bar span { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width 0.3s; }
.cards .bar { margin: 0; }

/* --- Statistiques --- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 20px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 2px; }
.stat-v { font: 600 1.6rem/1.1 var(--serif); font-variant-numeric: tabular-nums; }
.stat-l { color: var(--muted); font-size: 0.82rem; }

/* --- Grille des livres --- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.tile {
  position: relative; overflow: hidden; display: grid; gap: 2px; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px 12px; font-size: 0.82rem;
  transition: border-color 0.15s, transform 0.15s;
}
.tile:hover { border-color: var(--accent); transform: translateY(-1px); }
.tile-name { font: 600 0.95rem var(--serif); }
.tile-fill { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--accent); }
.tile.is-done { background: var(--ok-soft); border-color: transparent; }
.tile.is-done .tile-fill { background: var(--ok); }
.tile.is-active { border-color: var(--accent); }

/* --- Chapitres --- */
.chaps { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 6px; }
.chap {
  display: grid; place-items: center; aspect-ratio: 1; border-radius: 10px; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); font: 600 0.9rem var(--sans); color: var(--ink); cursor: pointer;
}
.chap:hover { border-color: var(--accent); }
.chap.read { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; margin-bottom: 12px; }
.seg button { border: 0; background: none; font: 600 0.82rem var(--sans); color: var(--muted); padding: 6px 14px; border-radius: 8px; cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

.history { display: grid; gap: 10px; }
.hist { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: flex-end; justify-content: space-between; }
.hist-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; color: var(--muted); font-size: 0.85rem; }

/* --- Lecture --- */
.reader-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; max-width: 680px; margin: 0 auto; }
.reader-head .back { margin: 0; }
.scripture { max-width: 680px; margin: 16px auto 0; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: clamp(22px, 5vw, 44px); box-shadow: var(--shadow); }
.scripture h1 { text-align: center; margin-bottom: 24px; }
.scripture h1 span { color: var(--accent); }
.text { font: 400 1.12rem/1.85 var(--serif); hyphens: auto; text-align: justify; }
@media (max-width: 520px) { .text { text-align: left; font-size: 1.05rem; } }
.text sup { font: 600 0.62rem var(--sans); color: var(--accent); margin-right: 3px; vertical-align: 0.55em; }
.tts {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 10px;
  padding: 10px; margin: -6px 0 24px; background: var(--surface-2); border-radius: 12px;
}
.tts .btn { min-width: 118px; }
.tts select { max-width: 200px; }
.check.inline { margin: 0; font-size: 0.85rem; font-weight: 500; color: var(--muted); }
.text .v { border-radius: 4px; transition: background 0.2s; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.text.listening .v { cursor: pointer; }
.text.listening .v:hover { background: var(--surface-2); }
.text .v.speaking { background: var(--gold-soft); box-shadow: 0 0 0 3px var(--gold-soft); }
.source { text-align: right; color: var(--muted); font-size: 0.78rem; font-style: italic; margin: 20px 0 0; }
.read-actions { max-width: 680px; margin: 16px auto 0; display: grid; gap: 12px; }
.read-actions .btn { padding: 14px; font-size: 1rem; }
.finish-prompt { background: var(--ok-soft); border-radius: var(--radius); padding: 16px; }
.finish-prompt p { color: var(--ok); font-weight: 600; }
.chapter-nav { max-width: 680px; margin: 16px auto 0; display: flex; justify-content: space-between; gap: 12px; }

/* --- Administration --- */
.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.hbars li { display: grid; grid-template-columns: minmax(90px, 160px) 1fr auto; gap: 12px; align-items: center; font-size: 0.88rem; }
.hb-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-track { position: relative; height: 12px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.hb-track span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; }
.hb-started { background: var(--accent-soft); outline: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.hb-done { background: var(--accent); }
.hb-val { font-variant-numeric: tabular-nums; color: var(--muted); }
.legend { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 0.8rem; margin: 14px 0 0; }
.key { width: 12px; height: 12px; border-radius: 3px; display: inline-block; margin-left: 8px; }
.k-done { background: var(--accent); margin-left: 0; }
.k-started { background: var(--accent-soft); outline: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }

.readers { display: grid; gap: 8px; }
.reader { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.reader summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 14px 16px; cursor: pointer; list-style: none; }
.reader summary::-webkit-details-marker { display: none; }
.reader summary::before { content: '›'; color: var(--muted); transition: transform 0.15s; font-size: 1.2rem; line-height: 1; }
.reader[open] summary::before { transform: rotate(90deg); }
.reader-id { font: 600 0.92rem ui-monospace, 'Cascadia Mono', Consolas, monospace; }
.reader-stats { margin-left: auto; display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: 0.82rem; }
.table-wrap { overflow-x: auto; border-top: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th, td { text-align: left; padding: 9px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 600; background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.pad { padding: 0 16px 14px; margin: 0; }

/* --- Notifications --- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0;
  background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 10px; font-size: 0.9rem; font-weight: 500;
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.2); transition: opacity 0.25s, transform 0.25s; z-index: 100; max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
body.has-pill .toast { bottom: 62px; }
.toast-error { background: var(--danger); color: #fff; }
.toast-success { background: var(--ok); color: #fff; }

/* --- Recherche dans la Bible --- */
.search-form { display: flex; gap: 8px; margin: 8px 0 6px; }
.search-form .input { flex: 1; min-width: 0; font-size: 1rem; }
.search-count { margin: 14px 0 8px; }
.search-scopes { margin-bottom: 12px; max-height: 132px; overflow-y: auto; }
.chip-n { opacity: 0.7; font-weight: 600; margin-left: 2px; }
button.chip { cursor: pointer; font: 500 0.85rem var(--sans); color: var(--ink); }
button.chip.read { color: var(--accent-ink); }
.search-list { display: grid; gap: 6px; }
.search-hit { display: grid; gap: 2px; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.search-hit:hover { border-color: var(--accent); }
.search-ref { font: 600 0.88rem var(--serif); color: var(--accent); }
.search-text { font: 400 0.95rem/1.55 var(--serif); }
.search-text mark { background: var(--gold-soft); color: inherit; border-radius: 3px; padding: 0 1px; box-shadow: 0 0 0 1px color-mix(in srgb, var(--gold-bright) 50%, transparent); }

/* --- Rappel quotidien --- */
.reminder-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.reminder-card > div:first-child { flex: 1; min-width: 220px; }
.reminder-card p { margin: 4px 0 0; }
.reminder-line { margin: 10px 0 0; }
.reminder-admin { display: grid; gap: 10px; }
.reminder-admin p { margin: 0; }
.reminder-admin label { display: grid; gap: 6px; font-size: 0.85rem; }

/* --- Verset du jour --- */
.votd-card { display: grid; gap: 8px; background: linear-gradient(0deg, var(--surface), var(--surface)); border-left: 4px solid var(--gold-bright); }
.votd-date { display: inline-block; }
.votd-date::first-letter { text-transform: uppercase; }
.votd-text { margin: 4px 0 0; font: 400 1.15rem/1.6 var(--serif); }
.votd-ref { font: 600 0.95rem var(--serif); color: var(--accent); }
.votd-note { margin: 0; font-size: 0.88rem; background: var(--gold-soft); border-radius: 10px; padding: 8px 12px; }
.votd-actions { margin-top: 4px; }
.votd-table td { white-space: normal; vertical-align: top; }
.table-wrap.flush-x { margin: 0 -20px; border-top: 1px solid var(--line); }
.votd-editor td { background: var(--surface-2); }
.votd-form { display: grid; gap: 10px; }
.votd-form label { display: grid; gap: 6px; }
.votd-all { margin-top: 14px; }
.votd-all summary { cursor: pointer; font-size: 0.85rem; font-weight: 600; color: var(--accent); }
.votd-months { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px 18px; margin-top: 12px; }
.votd-months h4 { margin: 0 0 4px; text-transform: capitalize; font-size: 0.9rem; }
.votd-year { list-style: none; margin: 0; padding: 0; font-size: 0.8rem; display: grid; gap: 1px; }
.votd-year .muted { display: inline-block; width: 22px; }
.s-row:has(> :nth-child(3)) { grid-template-columns: repeat(3, 1fr); }
.s-row:has(> :nth-child(3)) .s-big { padding: 22px 12px; }
.s-row:has(> :nth-child(3)) .s-big svg { width: 50px; }

/* --- Mon parcours --- */
a.stat.link-card { text-decoration: none; color: inherit; transition: border-color 0.15s; }
a.stat.link-card:hover { border-color: var(--accent); }
.stat-more { font-size: 0.75rem; font-weight: 600; color: var(--accent); margin-top: 2px; }
.j-months { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 16px 18px; margin-top: 12px; }
.jm-head { display: flex; justify-content: space-between; font-size: 0.8rem; font-weight: 600; text-transform: capitalize; margin-bottom: 6px; }
.jm-head .muted { text-transform: none; font-weight: 500; }
.jm-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
/* échelle séquentielle à une seule teinte (bleu-vert de l'église), du plus clair au plus foncé */
.jd { aspect-ratio: 1; border-radius: 4px; border: 0; padding: 0; background: var(--surface-2); display: block; }
button.jd { cursor: pointer; }
.jd.empty, .jd.future { background: transparent; }
.jd.future { outline: 1px dashed color-mix(in srgb, var(--line) 70%, transparent); outline-offset: -1px; }
.jd.l1 { background: color-mix(in srgb, var(--accent) 30%, var(--surface-2)); }
.jd.l2 { background: color-mix(in srgb, var(--accent) 55%, var(--surface-2)); }
.jd.l3 { background: color-mix(in srgb, var(--accent) 80%, var(--surface-2)); }
.jd.l4 { background: var(--accent); }
.jd.today { box-shadow: 0 0 0 2px var(--gold-bright); }
.jd.selected { box-shadow: 0 0 0 2px var(--ink); }
.jd:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 1px; }
.j-legend { display: flex; align-items: center; gap: 4px; font-size: 0.75rem; color: var(--muted); justify-content: flex-end; }
.j-legend .jd { width: 14px; height: 14px; }
.j-legend span { margin: 0 4px; }
.j-detail { margin: 8px 0 0; font-size: 0.88rem; min-height: 1.4em; }
.j-testaments { display: grid; gap: 14px; }
.j-testaments .bar { margin-top: 6px; }
.j-books { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.j-books li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.j-book-name { font: 600 1rem var(--serif); color: var(--ok); }

/* --- Guide de première visite --- */
.tour { position: fixed; inset: 0; z-index: 95; background: rgb(0 0 0 / 0.5); display: grid; place-items: center; padding: 16px; }
.tour-card { position: relative; width: 100%; max-width: 420px; max-height: calc(100vh - 32px); overflow: auto; background: var(--surface);
  border-radius: 22px; padding: 28px 22px 18px; display: grid; gap: 12px; text-align: center; box-shadow: 0 20px 60px rgb(0 0 0 / 0.3);
  border-top: 4px solid var(--gold-bright); }
.tour-skip { position: absolute; top: 12px; right: 16px; font-size: 0.85rem; }
.tour-icon { width: 64px; height: 64px; margin: 0 auto; padding: 14px; border-radius: 20px; background: var(--accent-soft); color: var(--accent); }
.tour-icon svg { width: 100%; height: 100%; display: block; }
.tour-card h2 { font-size: 1.35rem; margin: 0; }
.tour-body { text-align: left; font-size: 0.95rem; }
.tour-body p { margin: 0 0 8px; }
.tour-list { margin: 0; padding-left: 18px; display: grid; gap: 8px; }
.tour-dots { display: flex; justify-content: center; gap: 6px; }
.tour-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.tour-dots span.on { background: var(--accent); width: 22px; border-radius: 4px; }
.tour-nav { display: flex; justify-content: space-between; gap: 10px; }
.tour-nav .btn { min-width: 120px; }
.home-foot { text-align: center; margin-top: 32px; }

/* --- Administration : évolution --- */
.evo-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.evo-tiles .stat { background: var(--surface-2); border: 0; }
.evo-chart { margin: 8px 0 14px; }
.evo-chart figcaption { font-size: 0.85rem; font-weight: 600; margin-bottom: 4px; }
.evo-svg { width: 100%; height: auto; display: block; overflow: visible; }
.evo-grid { stroke: var(--line); stroke-width: 1; }
.evo-axis { stroke: var(--muted); stroke-width: 1; opacity: 0.5; }
.evo-tick { fill: var(--muted); font: 500 11px var(--sans); }
.evo-val { fill: var(--ink); font: 700 12px var(--sans); }
.evo-bar { fill: var(--accent); }
.evo-hit { fill: transparent; }
.evo-col { outline: none; cursor: default; }
.evo-col.active .evo-hit, .evo-col:focus-visible .evo-hit { fill: color-mix(in srgb, var(--accent) 8%, transparent); }
.evo-tip { position: fixed; z-index: 90; pointer-events: none; display: grid; gap: 1px; background: var(--ink); color: var(--bg);
  padding: 6px 10px; border-radius: 8px; font-size: 0.8rem; box-shadow: 0 4px 14px rgb(0 0 0 / 0.2); }
.evo-tip strong { font-size: 0.95rem; }
.evo-tip[hidden] { display: none; }
.evo-table summary { cursor: pointer; font-size: 0.85rem; color: var(--accent); font-weight: 600; }
.export-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }

/* --- Hors ligne --- */
/* en bas à gauche : ne cache ni l'en-tête ni les boutons ; les notifications passent au-dessus */
.sync-pill { position: fixed; left: 12px; bottom: 14px; z-index: 70; display: inline-flex; align-items: center; gap: 8px;
  background: var(--ink); color: var(--bg); font-size: 0.8rem; font-weight: 600; padding: 6px 12px; border-radius: 999px; box-shadow: 0 4px 14px rgb(0 0 0 / 0.2); white-space: nowrap; }
.sync-pill[hidden] { display: none; }
.sync-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold-bright); }
.sync-pill .dot.off { background: #e0525c; }
.sync-pill .dot.sync { animation: sync-blink 1s infinite alternate; }
@keyframes sync-blink { to { opacity: 0.3; } }
.dl-progress { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 80; width: min(92vw, 420px);
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; box-shadow: 0 8px 28px rgb(0 0 0 / 0.2); display: grid; gap: 8px; }
.dl-label { font-size: 0.85rem; font-weight: 600; }
.dl-progress .bar { margin: 0; }
.offline-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.offline-card > div { flex: 1; min-width: 220px; }
.offline-card p { margin: 4px 0 0; }
.offline-ok { font-size: 0.82rem; color: var(--ok); margin: 6px 0 0; }

/* --- Versets gardés et notes --- */
.text .v { cursor: pointer; }
.text .v:hover { background: var(--surface-2); }
.text .v.fav sup::before { content: '★ '; color: var(--gold-bright); }
.text .v.fav { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--gold-bright) 60%, transparent); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.text .v.has-note::after { content: '✎'; font-size: 0.75em; color: var(--accent); margin: 0 4px; }
.tap-hint { text-align: center; color: var(--muted); font-size: 0.8rem; margin: 6px 0 0; }
.sheet { position: fixed; inset: auto 0 0 0; z-index: 60; display: flex; justify-content: center; padding: 0 12px 12px;
  transform: translateY(110%); transition: transform 0.22s ease-out; pointer-events: none; }
.sheet.show { transform: none; }
.sheet-card { pointer-events: auto; width: 100%; max-width: 560px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  padding: 16px; display: grid; gap: 10px; box-shadow: 0 -6px 30px rgb(0 0 0 / 0.18); max-height: 80vh; overflow: auto; }
.sheet-ref { font-family: var(--serif); font-size: 1.05rem; color: var(--accent); }
.sheet-verse { margin: 0; font: 400 0.98rem/1.6 var(--serif); background: var(--gold-soft); border-radius: 10px; padding: 10px 12px; }
.sheet-note { display: grid; gap: 6px; }
.sheet-note textarea { resize: vertical; font: inherit; }
@media (prefers-reduced-motion: reduce) { .sheet { transition: none; } }
.fav-tools { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin: 14px 0; }
.fav-tools .input { flex: 1; min-width: 220px; }
.fav-list { display: grid; gap: 10px; }
.fav-item { margin: 0; display: grid; gap: 8px; }
.fav-item[hidden] { display: none; }
.fav-ref { font: 600 1rem var(--serif); color: var(--accent); text-decoration: none; }
.fav-verse { margin: 0; font: 400 0.95rem/1.6 var(--serif); }
.fav-note { margin: 0; white-space: pre-wrap; font-size: 0.9rem; background: var(--accent-soft); border-radius: 10px; padding: 8px 12px; }

/* --- Aller à une référence --- */
.goto-form { display: flex; gap: 8px; margin: 12px 0 4px; max-width: 460px; }
.goto-form .input { flex: 1; min-width: 0; }
.reader-goto { max-width: 680px; margin: 10px auto 0; }
.text .v.target { background: var(--gold-soft); box-shadow: 0 0 0 3px var(--gold-soft); border-radius: 4px; }
.text .v.target sup { color: var(--gold); }

/* --- Défi de l'église --- */
.church-card { display: grid; gap: 8px; border-top: 3px solid var(--accent); }
.church-card h3 { margin: 0; }
.church-card p { margin: 0; }
.church-card.compact { gap: 2px; }
.church-card.reached { border-top-color: var(--ok); }
.church-count { font-size: 0.95rem; color: var(--muted); }
.church-count strong { font: 700 1.6rem var(--sans); color: var(--ink); font-variant-numeric: tabular-nums; }
.church-pct { float: right; font-weight: 700; color: var(--accent); }
.bar.gold { margin-top: 0; height: 10px; }
.bar.gold span { background: linear-gradient(90deg, var(--accent), var(--gold-bright)); }
.church-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; font-size: 0.85rem; color: var(--muted); }
.church-mine { font-size: 0.9rem; background: var(--accent-soft); border-radius: 10px; padding: 8px 12px; }
.church-week { font-size: 0.88rem; color: var(--muted); }
.church-week strong { color: var(--ink); }

/* --- Série de jours --- */
.stat.streak .stat-v { color: var(--muted); }
.stat.streak.on { background: var(--gold-soft); border-color: color-mix(in srgb, var(--gold-bright) 45%, transparent); }
.stat.streak.on .stat-v { color: var(--ink); }
.text-size-btn { font: 700 0.95rem var(--serif) !important; text-decoration: none !important; color: var(--accent) !important; }
.s-progress-top { display: flex; justify-content: center; align-items: center; gap: 24px; }
.s-progress-top .s-trophy { margin: 8px 0 0; }
.s-streak { display: grid; justify-items: center; line-height: 1; color: var(--muted); opacity: 0.5; }
.s-streak span { font-size: 64px; }
.s-streak b { font: 700 2.4rem var(--sans); color: var(--ink); margin-top: 4px; }
.s-streak.on { opacity: 1; }
.s-size { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.s-size .btn { padding: 8px 4px; }
.s-size .btn:nth-child(2) { font-size: 0.95rem; }
.s-size .btn:nth-child(3) { font-size: 1.05rem; }

/* --- Plans de lecture --- */
.eyebrow { display: block; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--gold); margin-bottom: 2px; }
.plan-card { display: grid; gap: 10px; border-top: 3px solid var(--gold-bright); }
.plan-card .bar { margin-top: 0; }
.plan-empty { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.plan-empty p { margin: 4px 0 0; }
.plan-status { margin: 0; font-size: 0.9rem; }
.plan-status.ok { color: var(--ok); font-weight: 500; }
.plan-status.late { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; background: var(--gold-soft); border-radius: 10px; padding: 10px 12px; }
.plan-status.late p { margin: 0; flex: 1; min-width: 200px; }
.plan-day { display: grid; gap: 10px; background: var(--surface-2); border-radius: 12px; padding: 12px 14px; justify-items: start; }
.plan-day > .row { width: 100%; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { text-decoration: none; font-size: 0.85rem; font-weight: 500; padding: 5px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.chip:hover { border-color: var(--accent); }
.chip.read { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.plans { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-top: 16px; }
.plans .card { margin: 0; }
.plan-item { display: grid; gap: 8px; align-content: start; justify-items: start; }
.plan-item h3 { margin: 0; }
.plan-item p { margin: 0; }
.plan-item.is-current { border-color: var(--accent); }
.plan-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 0.82rem; color: var(--muted); }
.cal { display: grid; gap: 4px; margin-top: 12px; }
.cal-day { display: grid; grid-template-columns: 40px 64px 1fr 24px; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--line); text-decoration: none; font-size: 0.88rem; }
.cal-day:hover { border-color: var(--accent); }
.cal-n { font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.cal-date { color: var(--muted); font-size: 0.8rem; }
.cal-ok { color: var(--ok); font-weight: 700; text-align: right; }
.cal-day.done { background: var(--ok-soft); border-color: transparent; }
.cal-day.today { border: 2px solid var(--accent); }
.cal-day.late { background: var(--gold-soft); border-color: transparent; }
.k-cal-done { background: var(--ok-soft); margin-left: 0; }
.k-cal-today { border: 2px solid var(--accent); }
.k-cal-late { background: var(--gold-soft); }
.table-wrap.flush { border-top: 0; margin: -18px -20px; }
tr.inactive td { opacity: 0.5; }
.plan-actions { display: flex; flex-wrap: wrap; gap: 4px 12px; white-space: nowrap; }
.plan-item .pill { justify-self: start; }
.plan-form-wrap summary { cursor: pointer; }
.plan-form { display: grid; gap: 12px; margin-top: 14px; }
.plan-form label { display: grid; gap: 6px; }
.book-pick { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px 12px; }
.book-pick legend { font-weight: 600; font-size: 0.85rem; padding: 0 6px; display: flex; gap: 10px; align-items: baseline; }
.book-pick label { display: flex; gap: 6px; align-items: center; font-weight: 400; color: var(--ink); font-size: 0.88rem; }

/* --- Installation de l'application --- */
.install-card {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; text-align: left;
  background: var(--gold-soft); border: 1px solid color-mix(in srgb, var(--gold-bright) 45%, transparent);
  border-radius: var(--radius); padding: 12px 14px; margin: 16px 0;
}
.install-card img { border-radius: 10px; flex: none; background: #fff; }
.install-card > div:nth-child(2) { flex: 1; min-width: 180px; display: grid; gap: 2px; font-size: 0.85rem; }
.install-card strong { font-size: 0.95rem; }
.install-card span { color: var(--muted); }
.install-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.ios-key { display: inline-flex; align-items: center; gap: 3px; color: var(--ink); white-space: nowrap; }
.ios-key svg { vertical-align: -3px; color: #0a84ff; }

/* =========================================================================
   Mode simple (personnes qui ne lisent pas)
   ========================================================================= */
:root {
  --f-amber-bg: #faeeda; --f-amber-ink: #6b3d07; --f-amber: #c27c12;
  --f-coral-bg: #fae6de; --f-coral-ink: #712b13; --f-coral: #cc5a2e;
  --f-pink-bg: #fbe6ee; --f-pink-ink: #72243e; --f-pink: #c94f7a;
  --f-violet-bg: #ecebfc; --f-violet-ink: #3c3489; --f-violet: #6b62d1;
  --f-teal-bg: #dff3ec; --f-teal-ink: #085041; --f-teal: #1a8f6b;
  --f-blue-bg: #e3eefa; --f-blue-ink: #0c447c; --f-blue: #2f7fd0;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --f-amber-bg: #3d2a0c; --f-amber-ink: #f6d39a; --f-amber: #e6a33a;
    --f-coral-bg: #3d2017; --f-coral-ink: #f5c4b3; --f-coral: #e8794e;
    --f-pink-bg: #3b1d29; --f-pink-ink: #f4c0d1; --f-pink: #e0729a;
    --f-violet-bg: #26234a; --f-violet-ink: #cecbf6; --f-violet: #8f87e8;
    --f-teal-bg: #12332a; --f-teal-ink: #9fe1cb; --f-teal: #3cbf95;
    --f-blue-bg: #132b45; --f-blue-ink: #b5d4f4; --f-blue: #5ea3e6;
  }
}
.f-amber { --fb: var(--f-amber-bg); --fi: var(--f-amber-ink); --fc: var(--f-amber); }
.f-coral { --fb: var(--f-coral-bg); --fi: var(--f-coral-ink); --fc: var(--f-coral); }
.f-pink { --fb: var(--f-pink-bg); --fi: var(--f-pink-ink); --fc: var(--f-pink); }
.f-violet { --fb: var(--f-violet-bg); --fi: var(--f-violet-ink); --fc: var(--f-violet); }
.f-teal { --fb: var(--f-teal-bg); --fi: var(--f-teal-ink); --fc: var(--f-teal); }
.f-blue { --fb: var(--f-blue-bg); --fi: var(--f-blue-ink); --fc: var(--f-blue); }

.login-options { display: grid; gap: 8px; margin: 4px 0 8px; }
.login-options .simple-check { margin: 0; }
.simple-check input:disabled + span { opacity: 0.75; }
.simple-check { align-items: flex-start; text-align: left; background: var(--surface-2); border-radius: 12px; padding: 12px; margin: 4px 0 8px; }
.simple-check input { margin-top: 3px; width: 18px; height: 18px; flex: none; }
.simple-check small { display: block; color: var(--muted); font-weight: 400; font-size: 0.8rem; margin-top: 2px; }

body.simple { -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.s-app { max-width: 520px; margin: 0 auto; padding: 12px 16px 32px; min-height: 100vh; display: flex; flex-direction: column; gap: 16px; }
.s-app svg { width: 100%; height: 100%; display: block; }
.s-app button { font: inherit; color: inherit; cursor: pointer; border: 0; -webkit-touch-callout: none; }
.s-app button:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.s-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.s-mid { flex: 1; display: flex; justify-content: center; min-width: 0; }
.s-icon { width: 64px; height: 64px; padding: 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line) !important; flex: none; }
.s-help { color: var(--accent); background: var(--accent-soft); border-color: transparent !important; animation: s-pulse 2.4s ease-in-out 3; }
@keyframes s-pulse { 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent) 18%, transparent); } }
@media (prefers-reduced-motion: reduce) { .s-help { animation: none; } }

.s-novoice { display: flex; gap: 12px; align-items: center; background: var(--accent-soft); color: var(--accent); border-radius: 16px; padding: 14px; }
.s-novoice[hidden] { display: none; }
.s-novoice-icon { width: 48px; height: 48px; flex: none; }
.s-novoice p { margin: 0; font-size: 0.85rem; color: var(--ink); }

.s-bar { height: 12px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.s-bar span { display: block; height: 100%; background: var(--fc, var(--accent)); border-radius: inherit; transition: width 0.4s; }
.s-bar.light { background: color-mix(in srgb, var(--accent-ink) 30%, transparent); width: 70%; }
.s-bar.light span { background: var(--accent-ink); }

/* Accueil */
.s-hero { flex: 1; min-height: 340px; border-radius: 32px; background: var(--accent) !important; color: var(--accent-ink) !important;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 24px; transition: transform 0.1s; }
.s-hero:active { transform: scale(0.98); }
.s-hero-icon { width: 120px; height: 120px; }
.s-hero-book { font: 600 1.6rem var(--serif); }
.s-hero-chap { font: 700 3.2rem/1 var(--sans); }
.s-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.s-big { height: 110px; border-radius: 24px; background: var(--surface) !important; border: 1px solid var(--line) !important; padding: 26px; display: flex; justify-content: center; }
.s-big svg { width: 58px; }
.s-big:active, .s-fam:active, .s-book:active, .s-round:active { transform: scale(0.97); }

/* Familles et livres */
.s-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.s-fam { background: var(--fb) !important; color: var(--fi) !important; border-radius: 24px; padding: 18px 14px 16px; min-height: 150px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; border: 3px solid transparent !important; transition: border-color 0.15s, transform 0.1s; }
.s-fam-icon { width: 58px; height: 58px; }
.s-fam-name { font-size: 0.82rem; font-weight: 600; text-align: center; line-height: 1.2; }
.s-fam .s-bar { width: 80%; height: 8px; background: color-mix(in srgb, var(--fi) 15%, transparent); }
.armed { border-color: var(--fc) !important; box-shadow: 0 0 0 4px color-mix(in srgb, var(--fc) 25%, transparent); }
.s-fam-badge { display: inline-grid; place-items: center; width: 52px; height: 52px; padding: 10px; border-radius: 16px; background: var(--fb); color: var(--fi); flex: none; }
.s-fam-badge.sm { width: 34px; height: 34px; padding: 6px; border-radius: 10px; }
.s-books { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.s-book { position: relative; background: var(--fb) !important; color: var(--fi) !important; border-radius: 18px; min-height: 92px; padding: 14px 12px 12px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 8px; text-align: left; border: 3px solid transparent !important; transition: border-color 0.15s, transform 0.1s; }
.s-book-name { font: 600 1.05rem/1.2 var(--serif); padding-right: 26px; }
.s-book .s-bar { height: 8px; background: color-mix(in srgb, var(--fi) 15%, transparent); }
.s-book-ok { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; color: var(--ok); }
.s-book.is-active { border-color: color-mix(in srgb, var(--fc) 60%, transparent) !important; }

/* Écoute */
.s-listen-title { display: flex; align-items: center; gap: 10px; font: 600 1.2rem var(--serif); min-width: 0; }
.s-listen-title span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-chapnum { text-align: center; font: 700 4.5rem/1 var(--sans); color: var(--accent); }
.s-text { flex: 1; min-height: 140px; max-height: 34vh; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  padding: 14px 16px; font: 400 0.95rem/1.7 var(--serif); -webkit-user-select: text; user-select: text; }
.s-text sup { font: 600 0.6rem var(--sans); color: var(--accent); margin-right: 2px; }
.s-text .v { border-radius: 4px; transition: background 0.2s; }
.s-text .v.speaking { background: var(--gold-soft); box-shadow: 0 0 0 3px var(--gold-soft); }
.s-controls { display: flex; align-items: center; justify-content: center; gap: 22px; }
.s-round { width: 76px; height: 76px; border-radius: 50%; padding: 22px; background: var(--surface) !important; border: 1px solid var(--line) !important; transition: transform 0.1s; flex: none; }
.s-round.s-main { width: 132px; height: 132px; padding: 36px 34px 36px 40px; background: var(--accent) !important; color: var(--accent-ink) !important; border: 0 !important; }
.s-round.s-main.is-playing { padding: 36px; }
.s-status { width: 72px; height: 72px; margin: 0 auto; color: var(--line); }
.s-status.ok { color: var(--ok); }
@media (max-width: 380px) {
  .s-controls { gap: 14px; }
  .s-round { width: 64px; height: 64px; padding: 18px; }
  .s-round.s-main { width: 116px; height: 116px; }
}

/* Progrès */
.s-trophy { position: relative; width: 150px; height: 150px; margin: 8px auto 0; color: var(--gold-bright); }
.s-trophy span { position: absolute; top: 24%; left: 0; right: 0; text-align: center; font: 700 2.4rem var(--sans); color: var(--ink); }
.s-map { display: grid; gap: 10px; }
.s-map-row { display: flex; align-items: center; gap: 10px; }
.s-map-cells { display: flex; flex-wrap: wrap; gap: 5px; }
.s-map-cells i { width: 22px; height: 22px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); }
.s-map-cells i.doing { background: var(--fb); border-color: var(--fc); }
.s-map-cells i.done { background: var(--fc); border-color: var(--fc); }

/* Menu caché */
.s-menu { position: fixed; inset: 0; background: rgb(0 0 0 / 0.45); display: grid; place-items: center; padding: 16px; z-index: 50; }
.s-menu-card { background: var(--surface); border-radius: 20px; padding: 20px; width: 100%; max-width: 340px; display: grid; gap: 10px; text-align: center; }

/* =========================================================================
   Interface compacte du mode complet : onglets, accueil « Aujourd’hui »,
   onglet Bible, lecture épurée, onglet « Moi »
   ========================================================================= */
:root { --tabbar-h: 62px; --side-w: 216px; }
body.tabbed { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
body.tabbed .page { max-width: 760px; padding: 14px 16px 28px; }

/* Barre d’onglets (en bas sur téléphone) */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.tabbar a { display: grid; justify-items: center; gap: 2px; text-decoration: none; color: var(--muted); font-size: 0.7rem; font-weight: 600; padding: 4px 0; border-radius: 10px; }
.tabbar svg { width: 24px; height: 24px; }
.tabbar a.on { color: var(--accent); }
.tabbar a.on svg { stroke-width: 2.3; }

/* En-tête allégé */
body.tabbed .top { padding: 8px 16px; }
body.tabbed .top .brand img { height: 28px; }
.icon-btn { display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 8px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: 600 1.15rem/1 var(--sans); text-decoration: none; cursor: pointer; flex: none; }
.icon-btn:hover { border-color: var(--accent); }
.top .text-size-btn { border-color: transparent; background: transparent; color: var(--accent); font: 700 1.05rem var(--serif); }

/* Accueil « Aujourd’hui » */
.hello { display: flex; align-items: baseline; gap: 4px 12px; flex-wrap: wrap; }
.hello h1 { margin: 0; }
.hello-date { display: inline-block; font-size: 0.9rem; }
.hello-date::first-letter { text-transform: uppercase; }
.hpills { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.hpill { text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 0.85rem; font-weight: 600; }
.hpill.on { background: var(--gold-soft); border-color: transparent; }
body.tabbed .page > .card, #votd-slot > .card, #suggest-slot > .card, #suggest-slot .install-card { margin-top: 12px; }
.today-card { display: grid; gap: 8px; border-top: 3px solid var(--gold-bright); }
.today-card .bar { margin: 0; }
.today-label { font: 600 1.15rem/1.3 var(--serif); }
.today-status { margin: 0; font-size: 0.85rem; }
.today-status.ok { color: var(--ok); }
.votd-card.compact { gap: 6px; border-left-width: 3px; }
.votd-card.compact .votd-text { margin: 0; font-size: 1.05rem; line-height: 1.55; cursor: pointer; }
.votd-text.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.votd-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.votd-foot .votd-ref { text-decoration: none; }
.votd-icons { display: flex; gap: 6px; }
.votd-icons .icon-btn { min-width: 36px; height: 36px; font-size: 0.95rem; }
.church-mini summary { list-style: none; display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; cursor: pointer; }
.church-mini summary::-webkit-details-marker { display: none; }
.church-mini summary .bar { grid-column: 1 / -1; margin: 0; }
.church-mini-title { font-weight: 600; }
.church-mini-title .eyebrow { display: inline; margin-right: 4px; }
.church-mini-pct { font-weight: 700; color: var(--accent); }
.church-mini-body { display: grid; gap: 8px; margin-top: 10px; }
.church-mini-body > .row:first-child, .church-mini-body > .church-count, .church-mini-body > .bar { display: none; }
.church-line { margin: 14px 2px 0; }

/* Onglet Bible */
.bfam { margin-top: 18px; }
.bfam .section-title { margin-bottom: 8px; }
.bchips { display: flex; flex-wrap: wrap; gap: 6px; }
.bchip { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-width: 48px; padding: 9px 10px; border-radius: 10px;
  text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--fc); font: 600 0.9rem var(--sans); color: var(--ink); }
.bchip:hover { border-color: var(--fc); }
.bchip .full { display: none; }
.bchip em { font-style: normal; font-size: 0.72rem; font-weight: 700; }
.bchip.is-done { background: var(--fb); color: var(--fi); }
.bchip.is-done em { color: var(--ok); }
.bchip.is-active { box-shadow: inset 0 0 0 1px var(--fc); }
.bchip.is-active em { color: var(--accent); }
@media (min-width: 700px) {
  .bchip .ab { display: none; }
  .bchip .full { display: inline; }
}
.bible-legend { margin-top: 20px; }
.bchip-key { display: inline-block; padding: 0 6px; border-radius: 6px; font-weight: 700; margin-left: 8px; }
.bchip-key.done { background: var(--ok-soft); color: var(--ok); margin-left: 0; }
.bchip-key.active { border: 1px solid var(--accent); color: var(--accent); }
.reading-list { display: grid; gap: 8px; margin-top: 14px; }
.reading-row { display: grid; gap: 6px; text-decoration: none; margin: 0 !important; }
.reading-row .bar { margin: 0; }

/* Lecture : barre fine en haut, action fixe en bas */
.reader-top { display: flex; align-items: center; gap: 8px; }
.reader-top::after { display: none; }
.reader-title { flex: 1; position: relative; text-align: center; font: 600 1.05rem var(--serif); color: var(--ink); min-width: 0; }
.reader-title span { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reader-title select { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.play-btn.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.reader-menu { position: relative; }
.reader-menu summary { list-style: none; }
.reader-menu summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; right: 0; top: 48px; width: 260px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px; display: grid; gap: 10px; box-shadow: 0 12px 34px rgb(0 0 0 / 0.2); z-index: 80; }
.menu-pop label { display: grid; gap: 4px; font-size: 0.8rem; }
.menu-pop .check.inline { display: flex; }
body.tabbed .scripture { margin-top: 2px; padding: 18px 18px 22px; border-radius: 16px; }
body.reading { padding-bottom: calc(var(--tabbar-h) + 72px + env(safe-area-inset-bottom)); }
.read-bar { position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); z-index: 55; display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-top: 1px solid var(--line); }
.read-bar .grow { flex: 1; padding: 12px; font-size: 1rem; }
.read-bar .icon-btn { height: 46px; min-width: 46px; font-size: 1.4rem; }
.ghost-slot { visibility: hidden; }
body.tabbed .finish-prompt { max-width: 680px; margin: 12px auto 0; }

/* Notifications et indicateurs au-dessus des barres */
body.tabbed .toast { bottom: calc(var(--tabbar-h) + 14px + env(safe-area-inset-bottom)); }
body.reading .toast { bottom: calc(var(--tabbar-h) + 82px + env(safe-area-inset-bottom)); }
body.tabbed .sync-pill { bottom: calc(var(--tabbar-h) + 10px + env(safe-area-inset-bottom)); }
body.reading .sync-pill { bottom: calc(var(--tabbar-h) + 78px + env(safe-area-inset-bottom)); }
body.tabbed.has-pill .toast { bottom: calc(var(--tabbar-h) + 58px + env(safe-area-inset-bottom)); }
body.reading.has-pill .toast { bottom: calc(var(--tabbar-h) + 124px + env(safe-area-inset-bottom)); }
body.tabbed .dl-progress { bottom: calc(var(--tabbar-h) + 14px + env(safe-area-inset-bottom)); }
body.tabbed .sheet { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }

/* Onglet « Moi » */
.moi-list.card { padding: 0; margin-top: 12px; overflow: hidden; }
.moi-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding: 13px 16px; text-decoration: none; border-bottom: 1px solid var(--line); }
.moi-row:last-child { border-bottom: 0; }
a.moi-row:hover { background: var(--surface-2); }
.moi-row .seg { margin: 0; }
.moi-list .install-slot:empty { display: none; }
.moi-list .install-card { margin: 10px 12px; }
.moi-foot { text-align: center; margin-top: 22px; }

/* Ordinateur : menu latéral à gauche */
@media (min-width: 900px) {
  body.tabbed { padding-bottom: 0; padding-left: var(--side-w); }
  body.reading { padding-bottom: 88px; }
  .tabbar { top: 0; bottom: 0; right: auto; width: var(--side-w); grid-auto-flow: row; grid-auto-rows: min-content; align-content: start; gap: 4px;
    padding: 80px 12px 16px; border-top: 0; border-right: 1px solid var(--line); }
  .tabbar a { grid-auto-flow: column; justify-content: start; align-items: center; gap: 12px; font-size: 0.95rem; padding: 10px 14px; }
  .tabbar a.on { background: var(--accent-soft); }
  .tabbar svg { width: 22px; height: 22px; }
  body.tabbed .top:not(.reader-top) { position: fixed; left: 0; top: 0; width: var(--side-w); z-index: 61; border: 0; background: transparent; backdrop-filter: none; padding: 18px 16px; }
  body.tabbed .top:not(.reader-top)::after { display: none; }
  body.tabbed .top .brand span { display: inline; }
  body.tabbed .demo + .top:not(.reader-top) { top: 32px; }
  .read-bar { left: var(--side-w); bottom: 0; justify-content: center; }
  .read-bar .grow { max-width: 420px; }
  body.tabbed .toast, body.tabbed .sync-pill, body.tabbed .dl-progress { bottom: 20px; }
  body.reading .toast, body.reading .sync-pill { bottom: 90px; }
  body.tabbed .sync-pill { left: calc(var(--side-w) + 12px); }
  body.tabbed .sheet { bottom: 0; left: var(--side-w); }
}

.moi-list + .section-title { margin-top: 22px; }

@media (min-width: 900px) {
  body.tabbed .top:not(.reader-top) .brand span { font-size: 0.95rem; white-space: nowrap; }
  body.tabbed .demo ~ .tabbar { padding-top: 112px; }
}

/* Police du texte biblique (choisie dans « Moi » ou le menu ⋮ de lecture) */
.text, .votd-text, .s-text, .search-text { font-family: var(--read-font, var(--serif)); font-size-adjust: var(--read-adjust, none); }
.moi-font { display: grid; gap: 10px; }
.font-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.font-pick button { display: grid; gap: 2px; text-align: left; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.font-pick button b { font-size: 1.1rem; font-weight: 600; }
.font-pick button small { font-size: 0.75rem; color: var(--muted); line-height: 1.3; }
.font-pick button.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); }

/* Pas de zoom accidentel : le double-toucher ne zoome plus (le zoom à deux doigts reste possible),
   et les cases de saisie font au moins 16 px pour que l'iPhone ne zoome pas en les touchant. */
html { touch-action: manipulation; }
@media (hover: none) and (pointer: coarse) {
  input, select, textarea { font-size: max(16px, 1em) !important; }
}

/* =========================================================================
   Allure « application » : icônes, toucher, transitions, fenêtres du bas,
   titre réduit, squelettes de chargement, confettis, écran de démarrage
   ========================================================================= */

/* Icônes */
.i { width: 1.2em; height: 1.2em; vertical-align: -0.24em; flex: none; }
.icon-btn .i { width: 22px; height: 22px; vertical-align: 0; }
.read-bar .icon-btn .i { width: 26px; height: 26px; }
.btn .i { width: 1.1em; height: 1.1em; margin-right: 2px; }
.hpill { display: inline-flex; align-items: center; gap: 6px; }
.hpill .i { width: 17px; height: 17px; color: var(--accent); }
.hpill.on .i { color: #e0672a; }
.stat-v .i { color: #e0672a; width: 0.9em; height: 0.9em; vertical-align: -0.08em; }
.church-line .i, .reminder-line .i { color: var(--accent); margin-right: 2px; }
.ri { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; flex: none; color: #fff; }
.ri .i { width: 18px; height: 18px; vertical-align: 0; }
.ri-teal { background: #00857f; } .ri-red { background: #d9534a; } .ri-blue { background: #3b7bd6; }
.ri-gold { background: #d6a516; } .ri-green { background: #2e9a5c; } .ri-grey { background: #7a8786; }
.moi-row .ml { display: inline-flex; align-items: center; gap: 12px; font-weight: 500; }
.moi-row .mr { display: inline-flex; align-items: center; gap: 4px; }
.moi-row .mr .i { width: 18px; height: 18px; opacity: 0.6; }
.moi-font .font-pick { margin-left: 42px; }
@media (max-width: 420px) { .moi-font .font-pick { margin-left: 0; } }

/* Toucher : pas de surbrillance du navigateur, retour visuel, pas de « rebond » */
html { -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none; }
body { overscroll-behavior-y: none; }
.btn, .icon-btn, .tabbar a, .moi-row, .hpill, .bchip, .seg button, .font-pick button, .card.reading-row, .search-hit, summary {
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  transition: transform 0.12s ease, background-color 0.15s, border-color 0.15s, opacity 0.15s;
}
.btn:active, .icon-btn:active, .hpill:active, .bchip:active, .font-pick button:active, .seg button:active { transform: scale(0.96); }
.tabbar a:active { transform: scale(0.92); }
a.moi-row:active, .card.reading-row:active, .search-hit:active { background: var(--surface-2); transform: scale(0.99); }
.top, .tabbar, .read-bar { -webkit-user-select: none; user-select: none; }

/* Transitions entre écrans (navigateurs compatibles : Chrome sur Android) */
.tabbar { view-transition-name: tabbar; }
.read-bar { view-transition-name: readbar; }
@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.26s; animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1); }
  html[data-nav="forward"]::view-transition-old(root) { animation-name: vt-out-left; }
  html[data-nav="forward"]::view-transition-new(root) { animation-name: vt-in-right; }
  html[data-nav="back"]::view-transition-old(root) { animation-name: vt-out-right; }
  html[data-nav="back"]::view-transition-new(root) { animation-name: vt-in-left; }
  html[data-nav="fade"]::view-transition-old(root) { animation: 0.16s ease both vt-fade-out; }
  html[data-nav="fade"]::view-transition-new(root) { animation: 0.2s ease both vt-fade-in; }
}
@keyframes vt-in-right { from { transform: translateX(28%); opacity: 0; } }
@keyframes vt-out-left { to { transform: translateX(-14%); opacity: 0; } }
@keyframes vt-in-left { from { transform: translateX(-28%); opacity: 0; } }
@keyframes vt-out-right { to { transform: translateX(14%); opacity: 0; } }
@keyframes vt-fade-in { from { opacity: 0; } }
@keyframes vt-fade-out { to { opacity: 0; } }

/* Titre qui apparaît dans la barre du haut en défilant (téléphone) */
.top .top-title { display: none; }
@media (max-width: 899px) {
  .top .top-title { display: block; position: absolute; left: 64px; right: 64px; text-align: center; font: 600 1.02rem var(--serif); color: var(--ink);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; transform: translateY(6px); transition: opacity 0.18s, transform 0.18s; pointer-events: none; }
  body.title-up .top .top-title { opacity: 1; transform: none; }
}

/* Fenêtres du bas : poignée, et menu de lecture en feuille sur téléphone */
.sheet-card::before { content: ""; display: block; width: 38px; height: 5px; border-radius: 3px; background: var(--line); margin: -6px auto 2px; }
.sheet-card { transition: transform 0.2s ease; }
@media (max-width: 899px) {
  details.reader-menu[open] > summary::before { content: ""; position: fixed; inset: 0; z-index: 79; background: rgb(0 0 0 / 0.35); cursor: default; }
  details.reader-menu .menu-pop { position: fixed; left: 0; right: 0; top: auto; bottom: 0; width: auto; z-index: 80; border-radius: 20px 20px 0 0;
    padding: 10px 16px calc(18px + env(safe-area-inset-bottom)); gap: 12px; box-shadow: 0 -10px 40px rgb(0 0 0 / 0.25);
    animation: sheet-up 0.24s cubic-bezier(0.2, 0.8, 0.2, 1); transition: transform 0.2s ease; }
  details.reader-menu .menu-pop::before { content: ""; justify-self: center; width: 38px; height: 5px; border-radius: 3px; background: var(--line); }
  details.reader-menu .menu-pop label { font-size: 0.9rem; }
  /* le flou de la barre empêcherait la feuille de se placer en bas de l'écran */
  .top:has(details.reader-menu[open]) { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--bg); z-index: 90; }
}
@keyframes sheet-up { from { transform: translateY(100%); } }

/* Squelettes de chargement */
.skel { display: inline-block; height: 0.9em; border-radius: 6px; vertical-align: middle;
  background: linear-gradient(90deg, var(--surface-2) 25%, color-mix(in srgb, var(--surface-2) 40%, var(--surface)) 50%, var(--surface-2) 75%);
  background-size: 200% 100%; animation: skel 1.2s linear infinite; }
.skel.w6 { width: 6em; }
.skel-page { display: grid; gap: 14px; padding-top: 4px; }
.skel-page .skel { display: block; }
.skel-page .skel.h1 { width: 45%; height: 2rem; }
.skel-page .skel.card { height: 110px; border-radius: var(--radius); }
.skel-page .skel.card.short { height: 64px; width: 70%; }
@keyframes skel { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }

/* Confettis (livre terminé) */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 200; overflow: hidden; }
.confetti span { position: absolute; top: -12px; width: 8px; height: 13px; border-radius: 2px; opacity: 0.95;
  animation: confetti-fall 1.6s cubic-bezier(0.25, 0.6, 0.4, 1) forwards; }
@keyframes confetti-fall { to { transform: translate(var(--dx), 105vh) rotate(var(--r)); opacity: 0.8; } }

/* Écran de démarrage : seulement dans l'application installée */
#splash { display: none; }
@media (display-mode: standalone) {
  #splash { display: grid; place-content: center; justify-items: center; gap: 18px; position: fixed; inset: 0; z-index: 1000; background: var(--bg);
    transition: opacity 0.35s ease; animation: splash-auto 0.35s ease 5s forwards; }
  #splash img { width: 112px; height: 112px; border-radius: 26px; box-shadow: var(--shadow); animation: splash-pop 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); }
  #splash span { font: 600 1.2rem var(--serif); color: var(--accent); letter-spacing: 0.01em; }
  #splash.hide { opacity: 0; pointer-events: none; }
}
@keyframes splash-pop { from { transform: scale(0.85); opacity: 0; } }
@keyframes splash-auto { to { opacity: 0; visibility: hidden; } }

/* =========================================================================
   SYSTÈME DE DESIGN v2 — rendu « application native » (iOS / Linear / Stripe)
   Thème clair épuré ou sombre profond selon le réglage du téléphone,
   une seule couleur d'accent (bleu-vert de l'église), police Inter pour
   l'interface ; le texte biblique garde la police choisie par le lecteur.
   ========================================================================= */
:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --accent: #00716d;
  --accent-ink: #ffffff;
  --accent-soft: #e3f2f0;
  /* une seule couleur d'accent : l'or devient le bleu-vert */
  --gold: var(--accent);
  --gold-bright: var(--accent);
  --gold-soft: var(--accent-soft);
  --ok: #15803d;
  --ok-soft: #dcfce7;
  --red: #dc2626;
  --danger: #dc2626;
  --shadow: 0 1px 2px rgb(15 23 42 / 0.04), 0 1px 3px rgb(15 23 42 / 0.05);
  --shadow-lg: 0 10px 40px rgb(15 23 42 / 0.16);
  --radius: 16px;
  --radius-sm: 12px;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: var(--sans); /* interface entièrement en Inter */
  --scripture: var(--read-font, 'Literata', Georgia, serif);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #09090b;
    --surface: #121215;
    --surface-2: #1a1a1f;
    --ink: #fafafa;
    --muted: #a1a1aa;
    --line: #27272a;
    --accent: #2dd4bf;
    --accent-ink: #042f2e;
    --accent-soft: #0f2a27;
    --gold: var(--accent);
    --gold-bright: var(--accent);
    --gold-soft: var(--accent-soft);
    --ok: #4ade80;
    --ok-soft: #0f2a1a;
    --red: #f87171;
    --danger: #f87171;
    --shadow: none;
    --shadow-lg: 0 10px 40px rgb(0 0 0 / 0.6);
  }
}

/* Typographie */
body { background: var(--bg); color: var(--ink); font-family: var(--sans); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--sans); font-weight: 700; letter-spacing: -0.025em; line-height: 1.15; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.15rem; }
.section-title { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em; color: var(--muted); margin: 26px 2px 10px; }
.muted { color: var(--muted); }
.text, .votd-text, .s-text, .search-text, .sheet-verse, .fav-verse { font-family: var(--scripture); font-variant-numeric: normal; }
.stat-v, .today-label, .tile-name, .reader-title, .sheet-ref, .fav-ref, .search-ref, .votd-ref, .j-book-name, .brand,
.s-hero-book, .s-book-name, .s-listen-title, #splash span, .top .top-title { font-family: var(--sans); letter-spacing: -0.02em; }
.stat-v { font-weight: 700; font-size: 1.6rem; }
.today-label { font-weight: 700; font-size: 1.2rem; }
.reader-title { font-weight: 650; }
.top .text-size-btn { font-family: var(--sans) !important; font-weight: 700; }

/* Barre du haut : flou, zone sûre (encoche) */
.top { background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line); padding-top: calc(8px + env(safe-area-inset-top)); }
.top::after { display: none; }
.demo { padding-top: calc(6px + env(safe-area-inset-top)); }
.demo + .top { padding-top: 8px; }
body.tabbed .page { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }

/* Barre d'onglets : floutée, zone sûre du bas */
.tabbar { background: color-mix(in srgb, var(--surface) 80%, transparent); backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--line); }
.tabbar a { font-weight: 500; font-size: 0.68rem; letter-spacing: 0.01em; }
.tabbar a.on { color: var(--accent); font-weight: 600; }

/* Cartes et conteneurs : rounded-2xl, p-5 */
.card, .stat, .hist, .reader, .j-books li, .search-hit, .install-card, .offline-card, .auth-card, .tour-card { border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); }
.card { padding: 20px; background: var(--surface); }
@media (max-width: 480px) { .card { padding: 16px; } }
.stat { padding: 16px; }
.scripture { border-radius: 20px; box-shadow: var(--shadow); }
.today-card { border-top: 1px solid var(--line); gap: 12px; }
.votd-card, .votd-card.compact { border-left-width: 1px; }
.eyebrow { color: var(--accent); font-weight: 600; letter-spacing: 0.06em; }

/* Boutons et champs : rounded-xl */
.btn { border-radius: var(--radius-sm); min-height: 44px; padding: 10px 16px; font-weight: 600; letter-spacing: -0.01em; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn.sm { min-height: 36px; padding: 7px 12px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.ghost { background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
.btn.danger { background: var(--danger); color: #fff; border-color: transparent; }
.btn.done { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.btn.block { display: flex; width: 100%; }
.input, select.input, textarea.input { border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); color: var(--ink); min-height: 44px; }
.input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.icon-btn { border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); }
.seg { border-radius: var(--radius-sm); padding: 3px; }
.seg button { border-radius: 9px; font-weight: 500; }
.seg button.on { font-weight: 600; }
.bchip { border-radius: var(--radius-sm); font-weight: 600; }
.bchip em .i { width: 13px; height: 13px; vertical-align: -0.15em; }
.bchip-key .i { width: 12px; height: 12px; vertical-align: -0.1em; }
.hpill { background: var(--surface); border: 1px solid var(--line); font-weight: 600; padding: 7px 12px; }
.hpill.on { background: var(--accent-soft); border-color: transparent; }
.hpill.on .i, .stat-v .i { color: var(--accent); }
.toast { border-radius: var(--radius-sm); }
.bar { background: var(--surface-2); height: 6px; }

/* Listes de réglages (onglet Moi) : icônes neutres, une seule couleur d'accent */
.ri, .ri-teal, .ri-red, .ri-blue, .ri-gold, .ri-green, .ri-grey { background: var(--surface-2); color: var(--ink); border-radius: 9px; }
.moi-row { padding: 14px 16px; }
.moi-row .ml { font-weight: 500; }
.ok .i, .offline-ok .i, .j-book-name .i { width: 1em; height: 1em; vertical-align: -0.12em; }

/* Liens « retour » et « voir plus » avec icône */
.back { display: inline-flex; align-items: center; gap: 2px; color: var(--accent); font-weight: 600; text-decoration: none; margin: 0 0 10px -4px; }
.back .i { width: 20px; height: 20px; }
.link-more, .stat-more, .votd-ref { display: inline-flex; align-items: center; gap: 2px; }
.link-more .i, .stat-more .i, .votd-ref .i { width: 16px; height: 16px; }
.reader-title span .i { width: 16px; height: 16px; vertical-align: -0.15em; opacity: 0.6; }
.fav-ref .i, .sheet-ref .i { color: var(--accent); width: 16px; height: 16px; vertical-align: -0.12em; margin-right: 4px; }
.chip .i { width: 14px; height: 14px; vertical-align: -0.15em; margin-right: 3px; }
.cal-ok .i { width: 14px; height: 14px; }

/* Versets favoris et notes dans le texte : icônes au lieu de symboles */
.text .v.fav sup::before { content: ''; display: inline-block; width: 0.95em; height: 0.95em; margin-right: 2px; vertical-align: -0.1em; background: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m12 3 2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1L3.2 9.5l6.1-.9z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m12 3 2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1L3.2 9.5l6.1-.9z'/%3E%3C/svg%3E") center / contain no-repeat; }
.text .v.fav { text-decoration-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.text .v.has-note::after { content: ''; display: inline-block; width: 0.8em; height: 0.8em; margin: 0 4px; vertical-align: -0.05em; background: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20h4L19 9l-4-4L4 16v4Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20h4L19 9l-4-4L4 16v4Z'/%3E%3C/svg%3E") center / contain no-repeat; }

/* États vides : icône, message, action */
.empty { border: 1px solid var(--line); border-style: solid; background: var(--surface); border-radius: var(--radius); padding: 24px 20px; color: var(--muted); }
.empty-state { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 36px 20px; margin-top: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.es-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--accent-soft); color: var(--accent); margin-bottom: 4px; }
.es-icon .i { width: 26px; height: 26px; vertical-align: 0; }
.es-title { margin: 0; font-weight: 650; font-size: 1.02rem; letter-spacing: -0.015em; }
.es-text { margin: 0 0 6px; color: var(--muted); font-size: 0.9rem; max-width: 34ch; line-height: 1.5; }

/* Chargement du texte : lignes squelettes */
.skel-lines { display: grid; gap: 14px; padding: 6px 0; }
.skel-lines .skel { display: block; height: 0.95em; width: 100%; }
.skel-lines .skel.short { width: 55%; }

/* Confirmation en feuille du bas */
.ask { z-index: 120; padding: 0 0 0 0; }
.ask .ask-backdrop { position: fixed; inset: 0; background: rgb(0 0 0 / 0.4); opacity: 0; transition: opacity 0.2s; pointer-events: auto; }
.ask.show .ask-backdrop { opacity: 1; }
.ask .sheet-card { position: relative; border-radius: 22px 22px 0 0; border-bottom: 0; max-width: 560px; padding: 14px 20px calc(20px + env(safe-area-inset-bottom)); gap: 16px; box-shadow: var(--shadow-lg); }
.ask-msg { margin: 4px 0 0; font-size: 1rem; line-height: 1.5; font-weight: 500; }
.ask-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (min-width: 900px) { .ask { padding-bottom: 24px; } .ask .sheet-card { border-radius: 22px; border-bottom: 1px solid var(--line); } }

/* Fenêtres du bas : coins arrondis, zone sûre */
.sheet { padding: 0; }
.sheet:not(.ask) .sheet-card { border-radius: 22px 22px 0 0; border-bottom: 0; padding: 14px 20px calc(18px + env(safe-area-inset-bottom)); box-shadow: var(--shadow-lg); }
@media (min-width: 900px) { .sheet:not(.ask) { padding: 0 12px 12px; } .sheet:not(.ask) .sheet-card { border-radius: 22px; border-bottom: 1px solid var(--line); } }

/* Guide de première visite : feuille du bas sur téléphone */
@media (max-width: 899px) {
  .tour { align-items: end; padding: 0; }
  .tour .tour-card { width: 100%; max-width: none; border-radius: 24px 24px 0 0; border-bottom: 0; padding: 22px 20px calc(18px + env(safe-area-inset-bottom));
    animation: sheet-up 0.28s cubic-bezier(0.2, 0.8, 0.2, 1); }
}
.tour-card h2 { font-family: var(--sans); }
.tour-icon { border-radius: 16px; }

/* Feuilles du bas : au-dessus de la barre d'onglets, fond assombri plein écran */
body.tabbed .sheet:not(.ask) { bottom: 0; z-index: 70; }
.ask { position: fixed; inset: 0; transform: none !important; display: flex; align-items: flex-end; justify-content: center; pointer-events: auto; }
body.tabbed .ask { bottom: 0; }
.ask .sheet-card { width: 100%; transform: translateY(100%); transition: transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1); }
.ask.show .sheet-card { transform: none; }
@media (min-width: 900px) { body.tabbed .ask { left: 0; } }

/* =========================================================================
   v2.1 — Conformité aux directives UI/UX du projet (CLAUDE.md)
   ========================================================================= */
:root { --elevated: #ffffff; --disabled: #94a3b8; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --elevated: #18181b;   /* surface surélevée : feuilles du bas, menus */
    --disabled: #52525b;
    --shadow-lg: none;     /* jamais d'ombre portée lourde en sombre : bordure à la place */
  }
}
.sheet-card, .menu-pop, .tour-card, .ask .sheet-card { background: var(--elevated); border: 1px solid var(--line); }
:disabled, .btn:disabled { color: var(--disabled); }

/* Typographie : titres d'écran text-2xl, titres de cartes text-base semibold, labels text-xs */
h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.025em; }
.hello h1 { font-size: 1.5rem; }
.today-label, .es-title, .tile-name { font-size: 1rem; font-weight: 600; }
.eyebrow, .section-title { font-size: 0.75rem; font-weight: 500; text-transform: uppercase; }

/* Icônes Lucide : 20 px dans les boutons et onglets, 16 px dans les badges */
.tabbar svg, .tabbar .i { width: 20px; height: 20px; }
.icon-btn .i, .read-bar .icon-btn .i, .btn .i, .back .i, .ri .i { width: 20px; height: 20px; }
.hpill .i, .chip .i, .link-more .i, .stat-more .i, .votd-ref .i, .moi-row .mr .i, .fav-ref .i, .sheet-ref .i,
.church-line .i, .reminder-line .i, .ok .i, .offline-ok .i, .j-book-name .i, .bchip em .i, .bchip-key .i { width: 16px; height: 16px; }
.es-icon .i { width: 24px; height: 24px; }

/* États vides : icône dans un cercle discret */
.es-icon { border-radius: 50%; width: 56px; height: 56px; }

/* Squelettes : pulsation (animate-pulse) */
.skel { background: var(--surface-2); animation: skel-pulse 1.6s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
@keyframes skel-pulse { 50% { opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }

/* Grille de 4 px */
.moi-row { padding: 12px 16px; min-height: 56px; }
.card.reading-row { padding: 16px; }

/* Zones tactiles d'au moins 44 × 44 px sur écran tactile */
@media (pointer: coarse) {
  .btn, .btn.sm, .icon-btn { min-height: 44px; }
  .icon-btn { min-width: 44px; }
  .seg button { min-height: 44px; }
  .hpill, .chip, .bchip { min-height: 44px; display: inline-flex; align-items: center; }
  /* liens texte (« Calendrier », « Désactiver »…) : zone tactile agrandie sans changer la mise en page */
  .link, .back, .votd-ref, .link-more { position: relative; }
  .link::after, .back::after, .votd-ref::after { content: ''; position: absolute; inset: -12px -8px; }
}

/* Feuilles du bas : poignée sur le guide de première visite */
@media (max-width: 899px) {
  .tour .tour-card::before { content: ''; display: block; width: 38px; height: 5px; border-radius: 3px; background: var(--line); margin: -10px auto 6px; }
}
.tour-body .i { width: 16px; height: 16px; vertical-align: -0.2em; color: var(--accent); }

/* =========================================================================
   v3 — Interface « application native » : couleurs par sujet, barre de
   navigation, accueil en carte héros, listes groupées, réglages façon iOS
   Le bleu-vert reste l'accent des actions ; les teintes servent de repères.
   ========================================================================= */
:root {
  --t-orange: #ea580c; --t-orange-bg: #ffedd5;
  --t-teal: #0f766e;   --t-teal-bg: #ccfbf1;
  --t-violet: #7c3aed; --t-violet-bg: #ede9fe;
  --t-gold: #b45309;   --t-gold-bg: #fef3c7;
  --t-red: #dc2626;    --t-red-bg: #fee2e2;
  --t-green: #15803d;  --t-green-bg: #dcfce7;
  --t-blue: #2563eb;   --t-blue-bg: #dbeafe;
  --t-grey: #475569;   --t-grey-bg: #f1f5f9;
  --hero: #00716d; --hero-ink: #ffffff; --hero-sub: rgb(255 255 255 / 0.78); --hero-track: rgb(255 255 255 / 0.22);
  --gold-card: #fffbeb; --gold-line: #fde68a; --gold-ink: #78350f;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --t-orange: #fb923c; --t-orange-bg: #2a1708;
    --t-teal: #2dd4bf;   --t-teal-bg: #0f2a27;
    --t-violet: #a78bfa; --t-violet-bg: #221b3d;
    --t-gold: #fbbf24;   --t-gold-bg: #2a220c;
    --t-red: #f87171;    --t-red-bg: #2d1215;
    --t-green: #4ade80;  --t-green-bg: #0f2a1a;
    --t-blue: #60a5fa;   --t-blue-bg: #0c1f3d;
    --t-grey: #a1a1aa;   --t-grey-bg: #1f1f23;
    --hero: #0f766e; --hero-track: rgb(255 255 255 / 0.18);
    --gold-card: #1c170a; --gold-line: #3f3417; --gold-ink: #fef3c7;
  }
}
.t-orange { --tc: var(--t-orange); --tb: var(--t-orange-bg); }
.t-teal { --tc: var(--t-teal); --tb: var(--t-teal-bg); }
.t-violet { --tc: var(--t-violet); --tb: var(--t-violet-bg); }
.t-gold { --tc: var(--t-gold); --tb: var(--t-gold-bg); }
.t-red { --tc: var(--t-red); --tb: var(--t-red-bg); }
.t-green { --tc: var(--t-green); --tb: var(--t-green-bg); }
.t-blue { --tc: var(--t-blue); --tb: var(--t-blue-bg); }

/* Tuiles d'icônes colorées (réglages, listes) */
.ri { background: var(--t-grey-bg); color: var(--t-grey); }
.ri-orange { background: var(--t-orange-bg); color: var(--t-orange); }
.ri-teal { background: var(--t-teal-bg); color: var(--t-teal); }
.ri-violet { background: var(--t-violet-bg); color: var(--t-violet); }
.ri-gold { background: var(--t-gold-bg); color: var(--t-gold); }
.ri-red { background: var(--t-red-bg); color: var(--t-red); }
.ri-green { background: var(--t-green-bg); color: var(--t-green); }
.ri-blue { background: var(--t-blue-bg); color: var(--t-blue); }
.ri-grey { background: var(--t-grey-bg); color: var(--t-grey); }
.ri { width: 32px; height: 32px; border-radius: 9px; }
.kpi-ic { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--tb, var(--t-grey-bg)); color: var(--tc, var(--t-grey)); }
.kpi-ic .i { width: 18px; height: 18px; vertical-align: 0; }

/* A. Barre de navigation */
.nav-bar { display: grid !important; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 52px; }
.nav-left { display: flex; align-items: center; justify-self: start; min-width: 0; }
.nav-right { display: flex; align-items: center; justify-self: end; }
.nav-bar .top-title { position: static !important; grid-column: 2; max-width: 56vw; }
.nav-back { margin: 0 !important; padding: 8px 4px; min-height: 44px; font-weight: 500; }
@media (max-width: 899px) {
  .nav-bar:not(.is-home) .brand, .nav-bar.has-back .brand { display: none; }
  .nav-bar .brand img { height: 30px; }
}
.avatar { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--t-teal-bg); color: var(--t-teal);
  font-weight: 700; font-size: 0.95rem; letter-spacing: 0.02em; text-decoration: none; flex: none; }
.avatar.sm { width: 36px; height: 36px; font-size: 0.8rem; }
.page-sub { color: var(--muted); font-size: 0.9rem; margin: -4px 0 16px; line-height: 1.5; }

/* C. Accueil */
.hello { display: grid; gap: 0; margin-bottom: 4px; }
.hello-date { color: var(--muted); font-size: 0.82rem; font-weight: 500; text-transform: capitalize; }
.hello h1 { font-size: 1.75rem; }
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 16px 0 4px; }
.kpi { display: grid; gap: 4px; justify-items: start; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow); text-decoration: none; color: var(--ink); min-width: 0; transition: transform 0.15s; }
.kpi:active { transform: scale(0.98); }
.kpi b { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; margin-top: 6px; }
.kpi small { color: var(--muted); font-size: 0.75rem; font-weight: 500; line-height: 1.25; }

/* Carte héros « Lecture du jour » */
.today-card.hero, body.tabbed .page > .today-card { background: var(--hero); color: var(--hero-ink); border: 0; box-shadow: none; padding: 20px; gap: 14px; }
.today-card .eyebrow { color: var(--hero-sub); }
.today-card .link { color: var(--hero-ink); text-decoration-color: var(--hero-sub); }
.today-card .today-label { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.02em; color: var(--hero-ink); }
.today-card .today-status, .today-card .muted { color: var(--hero-sub); }
.today-card .today-status.ok { color: var(--hero-ink); }
.today-card .chip { background: rgb(255 255 255 / 0.14); border-color: transparent; color: var(--hero-ink); }
.today-card .chip.read { background: var(--hero-ink); color: var(--hero); }
.today-card .bar { background: var(--hero-track); }
.today-card .bar span { background: var(--hero-ink); }
.today-card .btn.primary { background: var(--hero-ink); color: var(--hero); }
.today-card .btn.ghost { background: rgb(255 255 255 / 0.14); color: var(--hero-ink); border-color: transparent; }
.hero-main { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ring { --p: 0; flex: none; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%;
  background: radial-gradient(closest-side, var(--hero) 76%, transparent 78%), conic-gradient(var(--hero-ink) calc(var(--p) * 1%), var(--hero-track) 0); }
.ring b { font-size: 0.8rem; font-weight: 700; }

/* Verset du jour : encadré doré */
.votd-card.tint-gold { background: var(--gold-card); border-color: var(--gold-line); }
.votd-card.tint-gold .eyebrow { color: var(--t-gold); display: inline-flex; align-items: center; gap: 6px; }
.votd-card.tint-gold .eyebrow .i { width: 16px; height: 16px; }
.votd-card.tint-gold .votd-text { color: var(--gold-ink); }
.votd-card.tint-gold .votd-ref { color: var(--t-gold); }
.votd-card.tint-gold .icon-btn { background: transparent; border-color: var(--gold-line); color: var(--t-gold); }

/* D. Listes groupées (onglet Bible) */
.card.list { padding: 0; overflow: hidden; }
.lrow { display: flex; align-items: center; gap: 12px; padding: 10px 16px; min-height: 56px; text-decoration: none; color: var(--ink);
  border-bottom: 1px solid var(--line); transition: background-color 0.15s, transform 0.15s; }
.lrow:last-child { border-bottom: 0; }
.lrow:active { background: var(--surface-2); }
.lic { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; flex: none; background: var(--fb); color: var(--fi);
  font-size: 0.78rem; font-weight: 700; letter-spacing: -0.01em; }
.lt { flex: 1; min-width: 0; display: grid; gap: 4px; }
.lt b { font-weight: 600; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lt small { color: var(--muted); font-size: 0.78rem; }
.lbar { display: block; height: 4px; border-radius: 2px; background: var(--surface-2); overflow: hidden; max-width: 180px; }
.lbar span { display: block; height: 100%; background: var(--fc); border-radius: 2px; }
.lr { display: inline-flex; align-items: center; color: var(--muted); flex: none; }
.lr em { font-style: normal; font-weight: 600; font-size: 0.82rem; color: var(--fc); }
.lr .i { width: 18px; height: 18px; opacity: 0.6; }
.ldone { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--t-green-bg); color: var(--t-green); }
.ldone .i { width: 14px; height: 14px; opacity: 1; }
.bfam { margin-top: 20px; }

/* E. Onglet Moi : profil, interrupteur */
.card.profile { display: flex; align-items: center; gap: 14px; padding: 16px; margin-top: 8px; }
.profile-t { display: grid; gap: 2px; min-width: 0; }
.profile-t b { font-weight: 600; font-size: 1rem; }
.profile-t small { color: var(--muted); font-size: 0.8rem; }
.ml-t { display: grid; gap: 1px; }
.ml-t small { color: var(--muted); font-size: 0.75rem; font-weight: 400; }
.switch-wrap { display: inline-flex; align-items: center; gap: 10px; }
.switch { position: relative; width: 51px; height: 31px; border-radius: 999px; border: 0; padding: 0; background: var(--line); cursor: pointer; flex: none; transition: background-color 0.2s; }
.switch span { position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgb(0 0 0 / 0.25); transition: transform 0.2s; }
.switch.on { background: var(--accent); }
.switch.on span { transform: translateX(20px); }
.moi-row:has(.switch) { flex-wrap: nowrap; }

/* F. Aide repliable */
details.help { margin: 4px 0 12px; }
details.help summary { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-size: 0.85rem; font-weight: 500; cursor: pointer; list-style: none; min-height: 44px; }
details.help summary::-webkit-details-marker { display: none; }
details.help summary .i { width: 16px; height: 16px; }
details.help p { margin: 0; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--muted); font-size: 0.85rem; line-height: 1.55; }

/* G. Recherche : loupe dans le champ */
.search-form { align-items: stretch; }
.search-field { position: relative; flex: 1; min-width: 0; display: flex; }
.search-field .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.search-field .input { width: 100%; padding-left: 38px; background: var(--surface-2); border-color: transparent; }

/* G. Tuiles de chiffres (parcours, administration) */
.stat { display: grid; gap: 4px; align-content: start; }
.stat .kpi-ic { margin-bottom: 6px; }
.stat .stat-v { font-size: 1.5rem; }
.stat.streak.on .stat-v { color: var(--t-orange); }

/* G. Plans : bandeau de couleur */
.plan-item { position: relative; overflow: hidden; padding-top: 24px; }
.plan-item::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--t-violet); }
.plan-item.is-current::before { background: var(--accent); }
.plan-item .pill { background: var(--t-violet-bg); color: var(--t-violet); }

/* G. Calendrier du plan */
.cal-day { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.cal-day.done { background: var(--t-green-bg); border-color: transparent; }
.cal-day.done .cal-n, .cal-day.done .cal-ok { color: var(--t-green); }
.cal-day.late { background: var(--t-orange-bg); border-color: transparent; }
.cal-day.late .cal-n { color: var(--t-orange); }
.cal-day.today { background: var(--accent-soft); border: 2px solid var(--accent); }
.k-cal-done { background: var(--t-green-bg); }
.k-cal-late { background: var(--t-orange-bg); }

/* Ordinateur : la barre du haut reste dans le menu latéral */
@media (min-width: 900px) {
  .nav-bar { display: flex !important; }
  .nav-bar .nav-right, .nav-bar .top-title { display: none; }
}

/* v3 — ajustements après essai sur téléphone */
.kpi { align-content: start; }
.kpi small { min-height: 2.5em; }
@media (max-width: 899px) {
  /* onglets sans retour : barre discrète, la bordure n'apparaît qu'en défilant */
  .nav-bar { min-height: 44px; }
  .nav-bar:not(.is-home):not(.has-back) { background: var(--bg); border-bottom-color: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
  body.title-up .nav-bar:not(.is-home):not(.has-back) { background: color-mix(in srgb, var(--bg) 78%, transparent); border-bottom-color: var(--line);
    backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px); }
  .nav-bar:not(.is-home):not(.has-back) + .tabbar + .page, .nav-bar:not(.is-home):not(.has-back) ~ .page { padding-top: 0; }
}
.switch-wrap .muted { white-space: nowrap; }
.moi-row:has(.switch) .ml { flex: 1; min-width: 0; }

/* =========================================================================
   v4 — Direction artistique « Éditorial Papier & Encre » (thème clair seul)
   Papier chaud, encre sombre, un seul accent ambre / terre de Sienne.
   Le thème sombre est désactivé par data-theme="light" sur <html>.
   ========================================================================= */
:root {
  color-scheme: light;
  /* Papier & encre */
  --bg: #fbf9f5;
  --surface: #ffffff;
  --surface-2: #f5f1ea;
  --elevated: #ffffff;
  --ink: #1c1917;
  --muted: #57534e;
  --faint: #a8a29e;
  --disabled: #a8a29e;
  --line: #eae5dc;
  /* Accent unique : ambre / terre de Sienne */
  --accent: #b45309;
  --accent-ink: #ffffff;
  --accent-soft: #fef3c7;
  --gold: var(--accent); --gold-bright: var(--accent); --gold-soft: var(--accent-soft);
  /* « Terminé » suit l'accent ; seul le danger garde sa couleur */
  --ok: var(--accent); --ok-soft: var(--accent-soft);
  --red: #b91c1c; --danger: #b91c1c;
  /* Pas d'ombres lourdes : filets fins */
  --shadow: none;
  --shadow-lg: 0 -1px 0 var(--line), 0 -12px 32px rgb(28 25 23 / 0.08);
  /* Polices : Inter pour l'interface, Lora pour la Bible */
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: var(--sans);
  --bible-serif: 'Lora', 'Newsreader', Georgia, serif;
  /* Repères par sujet ramenés à l'accent unique */
  --t-orange: var(--accent); --t-orange-bg: var(--accent-soft);
  --t-teal: var(--accent);   --t-teal-bg: var(--accent-soft);
  --t-violet: var(--accent); --t-violet-bg: var(--accent-soft);
  --t-gold: var(--accent);   --t-gold-bg: var(--accent-soft);
  --t-red: var(--accent);    --t-red-bg: var(--accent-soft);
  --t-green: var(--accent);  --t-green-bg: var(--accent-soft);
  --t-blue: var(--accent);   --t-blue-bg: var(--accent-soft);
  --t-grey: var(--muted);    --t-grey-bg: var(--surface-2);
  /* Familles de livres : même teinte neutre, accent pour la progression */
  --f-amber-bg: var(--surface-2); --f-amber-ink: var(--muted); --f-amber: var(--accent);
  --f-coral-bg: var(--surface-2); --f-coral-ink: var(--muted); --f-coral: var(--accent);
  --f-pink-bg: var(--surface-2); --f-pink-ink: var(--muted); --f-pink: var(--accent);
  --f-violet-bg: var(--surface-2); --f-violet-ink: var(--muted); --f-violet: var(--accent);
  --f-teal-bg: var(--surface-2); --f-teal-ink: var(--muted); --f-teal: var(--accent);
  --f-blue-bg: var(--surface-2); --f-blue-ink: var(--muted); --f-blue: var(--accent);
  /* Carte « lecture du jour » : provisoire en attendant l'étape 2 (carte blanche) */
  --hero: #ffffff; --hero-ink: var(--ink); --hero-sub: var(--muted); --hero-track: var(--line);
  --gold-card: #ffffff; --gold-line: var(--line); --gold-ink: var(--ink);
}
html, body { background: var(--bg); color: var(--ink); }

/* Cartes et conteneurs : blanc, filet 1px, aucune ombre */
.card, .stat, .kpi, .hist, .reader, .search-hit, .empty, .empty-state, .install-card, .offline-card, .auth-card,
.cal-day, .j-books li, .scripture { background: var(--surface); border: 1px solid var(--line); box-shadow: none; }
.today-card.hero, body.tabbed .page > .today-card { border: 1px solid var(--line); }

/* Texte biblique : serif élégante, 17 px, interligne 1,75 ; numéros discrets */
.text, .s-text, .votd-text, .sheet-verse, .fav-verse, .search-text { font-family: var(--read-font, var(--bible-serif)); }
.text { font-size: 17px; line-height: 1.75; text-align: left; hyphens: manual; }
.text sup, .s-text sup { font: 400 0.75rem var(--sans); color: var(--faint); margin-right: 6px; vertical-align: 0.5em; }

/* Barre du haut : papier légèrement translucide */
.top, .nav-bar:not(.is-home):not(.has-back), body.title-up .nav-bar:not(.is-home):not(.has-back) {
  background: rgb(251 249 245 / 0.9); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.demo { background: var(--accent-soft); color: var(--accent); }

/* Barre d'onglets : papier flouté, icône + libellé, aucun trait sur l'onglet actif */
.tabbar { background: rgb(251 249 245 / 0.9); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line);
  padding-bottom: calc(6px + env(safe-area-inset-bottom)); }
.tabbar a { color: var(--faint); font-weight: 500; }
.tabbar a.on { color: var(--accent); background: none; box-shadow: none; }
.tabbar a.on::before, .tabbar a.on::after { display: none; }
.tabbar a.on svg { stroke-width: 2; }
@media (min-width: 900px) {
  .tabbar { border-top: 0; border-right: 1px solid var(--line); }
  .tabbar a.on { background: var(--accent-soft); }
}

/* Boutons et champs */
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.ghost, .icon-btn { background: var(--surface); border-color: var(--line); color: var(--ink); }
.input, select.input, textarea.input { background: var(--surface); border-color: var(--line); }
.seg { background: var(--surface-2); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line); }
.switch.on { background: var(--accent); }
.avatar { background: var(--accent-soft); color: var(--accent); }
.es-icon { background: var(--accent-soft); color: var(--accent); }

/* Tuiles d'icônes : une seule teinte */
.ri, .ri-orange, .ri-teal, .ri-violet, .ri-gold, .ri-red, .ri-green, .ri-blue { background: var(--accent-soft); color: var(--accent); }
.ri-grey { background: var(--surface-2); color: var(--muted); }

/* Bandeaux, pastilles et calendrier : accent unique */
.plan-item::before { background: var(--accent); }
.plan-item .pill, .pill { background: var(--accent-soft); color: var(--accent); }
.cal-day.done { background: var(--accent-soft); }
.cal-day.late { background: var(--surface-2); }
.cal-day.late .cal-n { color: var(--muted); }

/* Écran de démarrage et feuilles du bas */
#splash { background: var(--bg) !important; }
.sheet-card, .menu-pop, .tour-card, .ask .sheet-card { background: var(--surface); border-color: var(--line); }

/* =========================================================================
   v4 — Étape 2 : accueil éditorial, lecture, panneau du verset
   ========================================================================= */
:root { --hl-jaune: #fdf0b0; --hl-vert: #d9f2dc; --hl-bleu: #dbe8fb; --hl-rose: #fbe0ea; }

/* Accueil : en-tête léger */
.hello { margin: 4px 0 18px; }
.hello-date { color: var(--muted); font-size: 0.8rem; font-weight: 500; letter-spacing: 0.02em; }
.hello h1 { font-size: 1.75rem; letter-spacing: -0.03em; }
.section-title { margin: 28px 2px 10px; }

/* Verset du jour : grande carte éditoriale */
.votd-card.editorial { padding: 24px 22px 18px; display: grid; gap: 14px; border-radius: 20px; }
.votd-card.editorial .eyebrow { color: var(--accent); }
.votd-card.editorial .votd-text { margin: 0; font-family: var(--read-font, var(--bible-serif)); font-size: 1.3rem; line-height: 1.6;
  color: var(--ink); letter-spacing: -0.005em; cursor: default; -webkit-line-clamp: unset; display: block; }
.votd-card.editorial .votd-text::before { content: '« '; color: var(--faint); }
.votd-card.editorial .votd-text::after { content: ' »'; color: var(--faint); }
.votd-card.editorial .votd-foot { border-top: 1px solid var(--line); padding-top: 12px; }
.votd-card.editorial .votd-ref { color: var(--muted); font-weight: 600; font-size: 0.9rem; }
.votd-card.editorial .icon-btn { border-color: transparent; background: transparent; color: var(--muted); }
.votd-card.editorial .icon-btn:hover { color: var(--accent); }

/* Continuer la lecture : carte compacte, barre fine */
.today-card.continue { background: var(--surface); color: var(--ink); border: 1px solid var(--line); padding: 16px 18px; gap: 10px; border-radius: var(--radius); }
.today-card.continue .eyebrow { color: var(--muted); }
.today-card.continue .link { color: var(--accent); text-decoration: none; font-weight: 500; }
.today-card.continue .today-label { color: var(--ink); font-size: 1rem; }
.cont-main { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.cont-t { flex: 1; min-width: 0; display: grid; gap: 2px; }
.cont-t b { font-size: 1.1rem; font-weight: 600; letter-spacing: -0.015em; }
.cont-t small { color: var(--muted); font-size: 0.82rem; }
.cont-go { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); flex: none; }
.cont-go .i { width: 18px; height: 18px; margin-left: 2px; }
.bar.thin { display: block; height: 3px; margin: 0; background: var(--line); border-radius: 2px; }
.bar.thin span { background: var(--accent); }
.today-card.continue .chips { gap: 6px; }
.today-card.continue .chip { background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: 0.8rem; min-height: 36px; }
.today-card.continue .chip.read { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.today-card.continue .today-status { color: var(--muted); font-size: 0.82rem; margin: 0; }
.today-card.continue .today-status .link { color: var(--accent); }
.today-card.continue .btn.primary { background: var(--accent); color: var(--accent-ink); }
.today-card.continue .btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }

/* Accès rapides épurés */
.quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.qa { display: flex; align-items: center; gap: 12px; padding: 14px; min-height: 64px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--line); text-decoration: none; color: var(--ink); transition: transform 0.15s; }
.qa:active { transform: scale(0.98); }
.qa-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--surface-2); color: var(--accent); flex: none; }
.qa-ic .i { width: 20px; height: 20px; }
.qa-t { display: grid; gap: 1px; font-weight: 600; font-size: 0.92rem; min-width: 0; }
.qa-t small { color: var(--muted); font-weight: 400; font-size: 0.75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.church-line { margin-top: 20px; }

/* Lecture : barre du haut minimaliste */
.reader-top { background: rgb(251 249 245 / 0.92); }
.reader-top .icon-btn { border-color: transparent; background: transparent; }
.reader-title { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.reader-title .ver { font-style: normal; font-size: 0.68rem; font-weight: 600; letter-spacing: 0.06em; color: var(--muted);
  border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.aa-btn { font: 600 1rem var(--sans) !important; color: var(--ink); }
.menu-label { font-size: 0.8rem; color: var(--muted); margin-bottom: -4px; }
.seg.block { display: flex; margin: 0; }
.seg.block button { flex: 1; }

/* Texte : feuille de papier, sans cadre lourd */
body.tabbed .scripture { background: transparent; border: 0; padding: 8px 4px 4px; max-width: 640px; }
.source { font-size: 0.75rem; color: var(--faint); }
.tap-hint { color: var(--faint); font-size: 0.78rem; text-align: center; margin: 8px 0 0; }

/* Surlignage pastel */
.text .v[class*='hl-'] { border-radius: 3px; padding: 1px 0; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.hl-jaune { background: var(--hl-jaune) !important; }
.hl-vert { background: var(--hl-vert) !important; }
.hl-bleu { background: var(--hl-bleu) !important; }
.hl-rose { background: var(--hl-rose) !important; }

/* Précédent / suivant : discrets, en fin de chapitre */
.chap-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 640px; margin: 24px auto 8px; }
.chap-link { display: flex; align-items: center; gap: 8px; padding: 10px 12px; min-height: 52px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  text-decoration: none; color: var(--ink); background: var(--surface); font-size: 0.88rem; font-weight: 500; }
.chap-link.next { justify-content: flex-end; text-align: right; }
.chap-link span { display: grid; gap: 1px; min-width: 0; }
.chap-link small { color: var(--faint); font-size: 0.7rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; }
.chap-link .i { width: 18px; height: 18px; color: var(--muted); flex: none; }
.read-bar { justify-content: center; }
.read-bar .grow { max-width: 480px; }
.btn.done { background: var(--accent-soft); color: var(--accent); }

/* Grille des chapitres : 5 colonnes, aérée */
.chaps { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.chap { aspect-ratio: auto; min-height: 52px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface);
  font-weight: 500; font-variant-numeric: tabular-nums; color: var(--ink); }
.chap.read { background: var(--accent-soft); border-color: transparent; color: var(--accent); font-weight: 600; }
@media (min-width: 700px) { .chaps { grid-template-columns: repeat(8, minmax(0, 1fr)); } }

/* Panneau du verset (feuille du bas) */
.verse-sheet { gap: 16px; }
.vs-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.vs-head .sheet-ref { color: var(--ink); font-weight: 600; font-size: 1rem; }
.vs-head .icon-btn { border-color: transparent; background: var(--surface-2); min-width: 36px; height: 36px; border-radius: 50%; }
.verse-sheet .sheet-verse { background: var(--surface-2); color: var(--ink); font-size: 1.02rem; line-height: 1.65; border-radius: var(--radius-sm); padding: 12px 14px; margin: 0; }
.vs-colors { display: flex; gap: 12px; align-items: center; }
.swatch { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); cursor: pointer; display: grid; place-items: center; color: var(--ink); padding: 0; }
.swatch.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.swatch .i { width: 18px; height: 18px; }
.swatch.none { background: var(--surface); color: var(--muted); }
.vs-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.vs-act { display: grid; justify-items: center; gap: 6px; padding: 12px 4px; min-height: 64px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: 500 0.75rem var(--sans); cursor: pointer; }
.vs-act .i { width: 20px; height: 20px; color: var(--muted); }
.vs-act.on { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.vs-act.on .i { color: var(--accent); }
.vs-note { display: grid; gap: 10px; }
.vs-note[hidden] { display: none; }

/* =========================================================================
   v4 — Étape 3 : recherche, favoris, plans, calendrier, parcours
   ========================================================================= */

/* Recherche : barre arrondie, filtres qui défilent, mot mis en évidence */
.search-form { gap: 8px; align-items: center; }
.search-field .input { border-radius: 999px; background: var(--surface); border: 1px solid var(--line); min-height: 48px; padding-left: 42px; }
.search-field .i { left: 15px; }
.search-form .btn { border-radius: 999px; min-height: 48px; padding: 0 18px; }
.search-scopes { display: flex !important; flex-wrap: nowrap !important; overflow-x: auto; max-height: none !important; gap: 8px;
  margin: 4px -16px 14px; padding: 2px 16px 6px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.search-scopes::-webkit-scrollbar { display: none; }
.search-scopes .chip { flex: none; white-space: nowrap; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--muted);
  font-size: 0.85rem; font-weight: 500; padding: 0 14px; }
.search-scopes .chip.read { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.search-scopes .chip-n { color: var(--faint); font-weight: 500; }
.search-scopes .chip.read .chip-n { color: var(--accent); opacity: 0.7; }
.search-count { color: var(--muted); font-size: 0.85rem; }
.search-list { display: grid; gap: 10px; }
.search-hit { padding: 14px 16px; border-radius: var(--radius); gap: 6px; }
.search-ref { color: var(--accent); font: 600 0.82rem var(--sans); letter-spacing: 0.01em; }
.search-text { font-size: 1rem; line-height: 1.65; color: var(--ink); }
.search-text mark { background: var(--accent-soft); color: var(--accent); font-weight: 600; box-shadow: none; padding: 0 2px; border-radius: 4px; }
details.help summary { color: var(--accent); }

/* Favoris */
.fav-tools .input { border-radius: 999px; min-height: 44px; }
.fav-item { padding: 16px 18px; gap: 10px; }
.fav-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fav-ref { display: inline-flex; align-items: center; gap: 8px; font: 600 0.9rem var(--sans); color: var(--ink); text-decoration: none; }
.fav-ref .i { width: 16px; height: 16px; color: var(--accent); margin: 0; }
.fav-ref .dot { width: 12px; height: 12px; border-radius: 50%; border: 1px solid var(--line); flex: none; }
.fav-acts { display: inline-flex; gap: 2px; }
.fav-acts .icon-btn { border-color: transparent; background: transparent; color: var(--muted); }
.fav-verse { font-size: 1.02rem; line-height: 1.65; color: var(--ink); }
.fav-note { background: var(--surface-2); color: var(--muted); border-radius: var(--radius-sm); font-size: 0.88rem; }

/* Carte unifiée : 3 colonnes séparées par des filets verticaux fins */
.card.unified { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 0; overflow: hidden; margin: 8px 0 6px; }
.u-col { display: grid; justify-items: center; align-content: start; gap: 4px; padding: 16px 8px; text-align: center; text-decoration: none; color: var(--ink);
  border-left: 1px solid var(--line); transition: background-color 0.15s; }
.u-col:first-child { border-left: 0; }
.u-col:active { background: var(--surface-2); }
.u-ic { color: var(--accent); }
.u-ic .i { width: 18px; height: 18px; }
.u-col b { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.u-col b i { font-style: normal; font-size: 0.85rem; color: var(--faint); font-weight: 500; }
.u-col small { color: var(--muted); font-size: 0.75rem; line-height: 1.3; }
.u-sub { color: var(--muted); font-size: 0.82rem; margin: 4px 2px 0; line-height: 1.5; }

/* Calendrier d'un plan : frise de jours horizontale */
.day-strip { display: flex; gap: 8px; overflow-x: auto; margin: 6px -16px 14px; padding: 4px 16px 10px; scroll-snap-type: x proximity;
  scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.day-strip::-webkit-scrollbar { display: none; }
.day { flex: none; scroll-snap-align: center; display: grid; justify-items: center; gap: 2px; width: 54px; padding: 8px 0 10px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.day small { color: var(--faint); font-size: 0.68rem; font-weight: 500; text-transform: capitalize; }
.day b { font-size: 1.05rem; font-weight: 700; }
.day em { font-style: normal; font-size: 0.68rem; color: var(--muted); }
.day.done { background: var(--accent-soft); border-color: transparent; }
.day.done b { color: var(--accent); }
.day.late { border-style: dashed; border-color: var(--accent); }
.day.today { border: 2px solid var(--accent); }
.day.sel { background: var(--accent); border-color: var(--accent); }
.day.sel b, .day.sel small, .day.sel em { color: var(--accent-ink); }

/* Passage du jour : carte principale */
.day-card { padding: 20px; display: grid; gap: 12px; }
.day-card .eyebrow { color: var(--muted); text-transform: none; letter-spacing: 0; font-size: 0.82rem; }
.day-title { margin: 0; font-size: 1.35rem; font-weight: 700; letter-spacing: -0.02em; }
.day-chaps { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.day-chaps li + li { border-top: 1px solid var(--line); }
.dc { display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 52px; text-decoration: none; color: var(--ink); }
.dc:active { background: var(--surface-2); }
.dc-check { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--line); flex: none; color: var(--accent-ink); }
.dc.read .dc-check { background: var(--accent); border-color: var(--accent); }
.dc-check .i { width: 14px; height: 14px; }
.dc-name { flex: 1; font-weight: 500; }
.dc.read .dc-name { color: var(--muted); }
.dc > .i { width: 18px; height: 18px; color: var(--faint); }
.day-card .btn.done[disabled] { opacity: 1; color: var(--accent); }
.cal-legend { margin-top: 12px; font-size: 0.78rem; }
.k-cal-done { background: var(--accent-soft); }
.k-cal-today { border: 2px solid var(--accent); background: transparent; }
.k-cal-late { border: 1px dashed var(--accent); background: transparent; }

/* Plans : cartes sobres */
.plan-item { padding: 22px 18px 18px; }
.plan-item::before { height: 4px; }
.plan-meta { color: var(--muted); font-size: 0.82rem; display: flex; flex-wrap: wrap; gap: 4px 12px; }

/* Parcours : carte de la frise annuelle et livres terminés */
.j-books li { border-radius: var(--radius-sm); }
.j-book-name { color: var(--ink); font-family: var(--sans); font-weight: 600; }
.j-book-name .i { color: var(--accent); }

/* =========================================================================
   v4 — Étape 4 : Moi (listes groupées façon iOS) et Administration
   ========================================================================= */

/* Moi : listes groupées, filets #EAE5DC entre les lignes */
.moi-list.card { padding: 0; border-radius: var(--radius); }
.moi-row { border-bottom: 1px solid var(--line); background: var(--surface); }
.moi-row:last-child { border-bottom: 0; }
.moi-row .ml { font-weight: 500; color: var(--ink); }
.moi-row .mr { color: var(--muted); font-size: 0.88rem; }
.moi-row.as-btn { width: 100%; border: 0; border-bottom: 1px solid var(--line); font: inherit; text-align: left; cursor: pointer; color: var(--ink); }
.moi-row.as-btn:last-child { border-bottom: 0; }
.moi-row.as-btn:active { background: var(--surface-2); }
.moi-row.is-danger .ml { color: var(--danger); }
.ri-danger { background: #fee2e2; color: var(--danger); }
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent);
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.02em; }
.moi-foot { color: var(--faint); font-size: 0.75rem; margin: 18px 0 8px; }
.card.profile { border-radius: var(--radius); }
.moi-font .font-pick button { background: var(--surface); border-color: var(--line); }
.moi-font .font-pick button.on { background: var(--accent-soft); border-color: var(--accent); box-shadow: none; }

/* Administration : même système, sections nettes */
.admin-page section, main.page > section { margin-top: 8px; }
.stats { gap: 10px; }
.stat { padding: 16px; border-radius: var(--radius); }
.stat .kpi-ic { background: var(--accent-soft); color: var(--accent); }
.stat-l { color: var(--muted); }

/* Tableaux */
.table-wrap { border-top: 1px solid var(--line); }
table { font-size: 0.86rem; }
th { background: var(--bg); color: var(--muted); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.06em; padding: 10px 16px; border-bottom: 1px solid var(--line); }
td { padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--ink); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--bg); }
tr.inactive td { color: var(--faint); }
.num { font-variant-numeric: tabular-nums; }
td .pill { margin-left: 6px; }
td .link { color: var(--accent); text-decoration: none; font-weight: 500; }
td .link.danger { color: var(--danger); }

/* Formulaires (plans, défis, verset du jour, rappel) */
.plan-form-wrap { padding: 0; overflow: hidden; }
.plan-form-wrap > summary { display: flex; align-items: center; gap: 8px; padding: 14px 18px; min-height: 52px; font-weight: 600; color: var(--accent); list-style: none; }
.plan-form-wrap > summary::-webkit-details-marker { display: none; }
.plan-form-wrap > summary::before { content: '+'; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft); font-weight: 600; }
.plan-form-wrap[open] > summary { border-bottom: 1px solid var(--line); }
.plan-form-wrap[open] > summary::before { content: '–'; }
.plan-form { padding: 4px 18px 18px; gap: 14px; }
.plan-form label, .fields label, .reminder-admin label { font-size: 0.82rem; font-weight: 500; color: var(--muted); gap: 6px; }
.plan-form .input, .fields .input, .reminder-admin .input, .votd-form .input { color: var(--ink); font-size: 0.95rem; }
.reminder-admin { display: grid; gap: 12px; }
.reminder-admin form { align-items: end; }
.votd-form { display: grid; gap: 10px; padding: 12px 0; }

/* Lecteurs (lignes repliables) */
.readers { display: grid; gap: 8px; }
.reader { border-radius: var(--radius-sm); }
.reader summary { min-height: 52px; }
.reader summary::before { color: var(--faint); }
.reader-id { font-family: var(--sans); font-weight: 600; letter-spacing: 0.02em; }
.reader-stats { color: var(--muted); font-size: 0.8rem; }

/* Barres « livres les plus lus » */
.hbars li { font-size: 0.86rem; }
.hb-track { background: var(--surface-2); height: 8px; }
.hb-track .hb-started { background: color-mix(in srgb, var(--accent) 35%, var(--surface)); }
.hb-track .hb-done { background: var(--accent); }

/* Administration — Verset du jour : liste claire par jour */
.vd-intro { display: grid; gap: 8px; justify-items: start; margin: 0 2px 4px; }
.vd-intro p { margin: 0; color: var(--muted); font-size: 0.86rem; line-height: 1.5; }
.vd-intro .i { width: 15px; height: 15px; vertical-align: -0.15em; color: var(--accent); }
.vd-group { font-size: 0.8rem; font-weight: 600; color: var(--muted); margin: 14px 2px 8px; }
.vd-list { padding: 0; overflow: hidden; }
.vd-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 14px; min-height: 64px; border-bottom: 1px solid var(--line); }
.vd-row:last-child { border-bottom: 0; }
.vd-row.is-today { background: var(--accent-soft); }
.vd-date { display: grid; justify-items: center; width: 44px; flex: none; padding: 4px 0; border-radius: 10px; background: var(--surface-2); line-height: 1.1; }
.vd-row.is-today .vd-date { background: var(--accent); color: var(--accent-ink); }
.vd-date small { font-size: 0.62rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: inherit; opacity: 0.75; }
.vd-date b { font-size: 1.05rem; font-weight: 700; }
.vd-date em { font-style: normal; font-size: 0.62rem; opacity: 0.75; }
.vd-main { flex: 1; min-width: 0; display: grid; gap: 1px; }
.vd-main small { color: var(--muted); font-size: 0.72rem; text-transform: capitalize; }
.vd-main b { font-weight: 600; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vd-note { color: var(--muted); font-size: 0.8rem; font-style: italic; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vd-side { display: flex; align-items: center; gap: 6px; flex: none; }
.vd-auto { font-size: 0.7rem; color: var(--faint); font-weight: 500; }
.vd-acts { display: inline-flex; }
.vd-acts .icon-btn { border-color: transparent; background: transparent; color: var(--muted); }
.vd-more { margin-top: 10px; }
.vd-more > summary, .votd-all > summary { display: flex; align-items: center; min-height: 44px; padding: 0 2px; color: var(--accent); font-weight: 600; font-size: 0.88rem; cursor: pointer; list-style: none; }
.vd-more > summary::-webkit-details-marker, .votd-all > summary::-webkit-details-marker { display: none; }
.vd-more > summary::after, .votd-all > summary::after { content: '›'; margin-left: 6px; transition: transform 0.15s; }
.vd-more[open] > summary::after, .votd-all[open] > summary::after { transform: rotate(90deg); }
.votd-all { margin-top: 4px; }
.votd-months { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.votd-editor { padding: 14px; background: var(--bg); border-bottom: 1px solid var(--line); }
.votd-editor:last-child { border-bottom: 0; }
.votd-form { gap: 12px; padding: 0; }
.vd-ed-title { margin: 0; font-weight: 600; text-transform: capitalize; }
.vd-ed-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Écran d'installation (lien ouvert dans le navigateur d'un téléphone) */
.gate { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: calc(24px + env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom)); background: var(--bg); }
.gate-card { width: 100%; max-width: 420px; display: grid; justify-items: center; gap: 14px; text-align: center; }
.gate-icon { width: 96px; height: 96px; border-radius: 24px; border: 1px solid var(--line); background: var(--surface); }
.gate h1 { margin: 6px 0 0; font-size: 1.6rem; letter-spacing: -0.03em; }
.gate-lead { margin: 0; color: var(--muted); font-size: 0.98rem; line-height: 1.5; max-width: 32ch; }
.gate-perks { list-style: none; margin: 4px 0; padding: 14px 16px; display: grid; gap: 10px; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.gate-perks li { display: flex; align-items: center; gap: 10px; font-size: 0.92rem; font-weight: 500; }
.gate-perks svg { color: var(--accent); flex: none; }
#gate-actions { width: 100%; display: grid; gap: 12px; }
.gate-cta { min-height: 54px; font-size: 1.05rem; border-radius: 14px; }
.gate-steps { margin: 0; padding: 14px 16px 14px 36px; display: grid; gap: 10px; text-align: left; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); font-size: 0.92rem; line-height: 1.5; }
.gate-steps li::marker { color: var(--accent); font-weight: 700; }
.gate-steps svg { vertical-align: -0.25em; }
.gate-tip { margin: 0; color: var(--muted); font-size: 0.82rem; }
.gate-tip svg { vertical-align: -0.25em; }
.gate-closed { margin: 0; color: var(--muted); font-size: 0.85rem; background: var(--accent-soft); border-radius: var(--radius-sm); padding: 10px 12px; }
.gate-skip { color: var(--muted); font-size: 0.85rem; min-height: 44px; }

/* Administration : partager l'application (QR code) */
.share-app { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 20px; }
.share-app .qr { width: 148px; height: 148px; border-radius: 12px; border: 1px solid var(--line); background: #fff; padding: 6px; flex: none; }
.share-app-t { flex: 1; min-width: 200px; display: grid; gap: 8px; }
.share-app-t p { margin: 0; color: var(--muted); font-size: 0.88rem; line-height: 1.5; }
.share-app-t .share-url { color: var(--ink); font-weight: 600; font-size: 0.9rem; word-break: break-all; }
.share-app-acts { display: flex; flex-wrap: wrap; gap: 8px; }

/* =========================================================================
   Thèmes au choix (Moi > Thème) — enregistré sur l'appareil
   Sépia « parchemin » par défaut, Clair « papier soutenu », Sombre « nuit d'encre »
   ========================================================================= */
/* B. Sépia — par défaut (aussi sans réglage enregistré) */
:root, html[data-palette='sepia'] {
  --bg: #e8dcc4; --surface: #f4ecdb; --surface-2: #eadfc9; --elevated: #f7f0e2;
  --ink: #2b2118; --muted: #5c4a36; --faint: #8c7a62; --disabled: #a8977d; --line: #d2bf9c;
  --accent: #8a3c0b; --accent-ink: #ffffff; --accent-soft: #f0d9ae;
  --danger: #9f1d1d; --red: #9f1d1d; --danger-soft: #f3d3c8;
  --bar-bg: rgb(232 220 196 / 0.92);
  --hl-jaune: #f3df8a; --hl-vert: #cfe4bf; --hl-bleu: #c9dbee; --hl-rose: #efcfd6;
  --theme-color: #e8dcc4;
}
/* A. Clair — papier soutenu */
html[data-palette='clair'] {
  --bg: #f1eadd; --surface: #fbf7f0; --surface-2: #efe7d9; --elevated: #fffbf5;
  --ink: #1c1917; --muted: #57534e; --faint: #8f877e; --disabled: #a8a29e; --line: #dcd1be;
  --accent: #9a4a0a; --accent-ink: #ffffff; --accent-soft: #f6e3c3;
  --danger: #b91c1c; --red: #b91c1c; --danger-soft: #fde2dc;
  --bar-bg: rgb(241 234 221 / 0.92);
  --hl-jaune: #fbe7a1; --hl-vert: #d6ecd2; --hl-bleu: #d4e3f6; --hl-rose: #f6d9e2;
  --theme-color: #f1eadd;
}
/* D. Sombre — nuit d'encre */
html[data-palette='sombre'] {
  color-scheme: dark;
  --bg: #1c1917; --surface: #292524; --surface-2: #322d2a; --elevated: #2e2926;
  --ink: #f5f0e8; --muted: #b5ada6; --faint: #7d7570; --disabled: #6b635e; --line: #3d3532;
  --accent: #f59e0b; --accent-ink: #1c1917; --accent-soft: #3d2c12;
  --danger: #f87171; --red: #f87171; --danger-soft: #3a1c1c;
  --bar-bg: rgb(28 25 23 / 0.92);
  --hl-jaune: #5c4b14; --hl-vert: #24432b; --hl-bleu: #213656; --hl-rose: #4d2535;
  --theme-color: #1c1917;
  --shadow-lg: 0 -1px 0 var(--line), 0 -12px 32px rgb(0 0 0 / 0.5);
}
html[data-palette] { --ok: var(--accent); --ok-soft: var(--accent-soft); --gold: var(--accent); --gold-bright: var(--accent); --gold-soft: var(--accent-soft);
  --hero: var(--surface); --gold-card: var(--surface); }

/* Barres du haut et du bas : couleur du thème */
html[data-palette] .top, html[data-palette] .tabbar, html[data-palette] .reader-top,
html[data-palette] .nav-bar:not(.is-home):not(.has-back), html[data-palette] body.title-up .nav-bar:not(.is-home):not(.has-back) { background: var(--bar-bg); }
html[data-palette] .ri-danger { background: var(--danger-soft); }
html[data-palette] .text sup, html[data-palette] .s-text sup { color: var(--faint); }
/* Logo de l'écran de connexion : monogramme doré, lisible sur fond sombre */
html[data-palette='sombre'] .brand-lg img { content: url('../assets/monogram.png'); }
html[data-palette='sombre'] .gate-icon, html[data-palette='sombre'] .share-app .qr { border-color: var(--line); }

/* Choix du thème (Moi et menu Aa de lecture) */
.theme-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-left: 42px; }
@media (max-width: 420px) { .theme-pick { margin-left: 0; } }
.theme-pick button { display: grid; justify-items: center; gap: 6px; padding: 10px 6px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: 500 0.8rem var(--sans); cursor: pointer; min-height: 44px; }
.theme-pick button.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--accent-soft); }
.theme-pick .tp-sw { width: 100%; height: 34px; border-radius: 8px; display: flex; align-items: flex-end; gap: 4px; padding: 5px; border: 1px solid rgb(0 0 0 / 0.08); }
.theme-pick .tp-sw i { flex: 1; height: 10px; border-radius: 3px; }
.theme-pick .tp-sw b { width: 10px; height: 10px; border-radius: 50%; }
.theme-pick small { color: var(--muted); font-size: 0.68rem; }
.moi-theme { display: grid; gap: 10px; }

/* Améliorations écran par écran */
/* Accueil : anneau de progression du jour autour du bouton de lecture */
.cont-go { position: relative; margin: 5px; }
.cont-go::before { content: ''; position: absolute; inset: -5px; border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--p, 0) * 1%), var(--line) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px)); }

/* Livre : chapitres lus lors d'une lecture précédente */
.chap.was-read { position: relative; color: var(--muted); }
.chap.was-read::after { content: ''; position: absolute; top: 7px; right: 7px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); opacity: 0.55; }

/* Lecture : animation de validation « Marquer comme lu » */
.read-bar .btn.pop { animation: mark-pop 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.4); }
.read-bar .btn.pop .i { animation: mark-check 0.5s ease-out; }
@keyframes mark-pop { 0% { transform: scale(0.94); } 55% { transform: scale(1.04); } 100% { transform: none; } }
@keyframes mark-check { 0% { transform: scale(0.2) rotate(-25deg); opacity: 0; } 60% { transform: scale(1.3); opacity: 1; } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) { .read-bar .btn.pop, .read-bar .btn.pop .i { animation: none; } }

/* Lecture sans distraction : barre d'onglets masquée en descendant */
@media (max-width: 899px) {
  .tabbar, .read-bar { transition: transform 0.25s ease, bottom 0.25s ease; }
  body.reading.chrome-hidden .tabbar { transform: translateY(110%); }
  body.reading.chrome-hidden .read-bar { bottom: 0; padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
}

/* Calendrier : jour à rattraper */
.late-note { display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--accent-soft); color: var(--ink); font-size: 0.86rem; line-height: 1.45; }
.late-note .i { width: 18px; height: 18px; color: var(--accent); flex: none; margin-top: 1px; }
.day-card .btn.block + .btn.block { margin-top: 0; }

/* Administration : période */
.admin-period { margin: 4px 0 14px; }

/* Recherche vocale */
.search-field .voice-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; border: 0;
  background: transparent; color: var(--accent); display: grid; place-items: center; cursor: pointer; }
.search-field .voice-btn .i { position: static; transform: none; width: 20px; height: 20px; color: var(--accent); }
.search-field .voice-btn:active { background: var(--accent-soft); }
.search-field:has(.voice-btn) .input { padding-right: 46px; }

.voice-sheet .sheet-card { justify-items: center; text-align: center; gap: 10px; padding-top: 22px; }
.vs-mic { position: relative; width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); margin: 4px 0 6px; }
.vs-mic::before, .vs-mic::after { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--accent); animation: vs-wave 1.6s ease-out infinite; }
.vs-mic::after { animation-delay: 0.8s; }
.vs-mic.loading { background: var(--surface-2); color: var(--muted); }
.vs-mic.loading::before, .vs-mic.loading::after, .vs-mic.off::before, .vs-mic.off::after { display: none; }
.vs-mic.off { background: var(--surface-2); color: var(--muted); }
@keyframes vs-wave { from { transform: scale(1); opacity: 0.7; } to { transform: scale(1.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .vs-mic::before, .vs-mic::after { animation: none; display: none; } }
.vs-title { margin: 0; font-size: 1.15rem; font-weight: 700; letter-spacing: -0.01em; }
.vs-hint, .vs-transcript { margin: 0; color: var(--muted); font-size: 0.92rem; line-height: 1.5; max-width: 34ch; min-height: 1.5em; }
.vs-transcript.live { color: var(--ink); font-family: var(--read-font, var(--bible-serif)); font-size: 1.15rem; }
.vs-engine { margin: 0; color: var(--faint); font-size: 0.72rem; }
.vs-note { margin: 0; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--muted); font-size: 0.8rem; line-height: 1.45; text-align: left; }
.voice-sheet .btn.block { width: 100%; }
.voice-sheet .ask-actions { width: 100%; }

/* Moi : progression du téléchargement */
.voice-prog { display: inline-flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.voice-prog .bar.thin { width: 90px; }

/* Mode simple : « Dire le nom d'un livre » */
.s-voice { display: flex; align-items: center; justify-content: center; gap: 14px; width: 100%; min-height: 72px; margin: 4px 0 14px; padding: 12px 18px;
  border-radius: 20px; border: 0; background: var(--accent); color: var(--accent-ink); font: 700 1.2rem var(--sans); cursor: pointer; }
.s-voice-ic { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: rgb(255 255 255 / 0.2); }
.s-voice-ic svg { width: 28px; height: 28px; }
