:root {
  color-scheme: light dark;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #eef1f5;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --accent: #2563eb;
  --accent-text: #ffffff;
  --up: #16a34a;
  --down: #dc2626;
  --fib: #d97706;
  --grid: rgba(100, 116, 139, 0.12);
  --radius: 14px;
  --tabbar: 62px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1018;
    --surface: #131a25;
    --surface-2: #1c2533;
    --text: #e2e8f0;
    --muted: #94a3b8;
    --border: #243042;
    --accent: #60a5fa;
    --accent-text: #0b1018;
    --up: #22c55e;
    --down: #f87171;
    --fib: #fbbf24;
    --grid: rgba(148, 163, 184, 0.08);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
input, select, button, textarea { font: inherit; color: inherit; }
small, .muted { color: var(--muted); }

/* ---------- Coquille ---------- */
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 8px;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar h1 { flex: 1; margin: 0; font-size: 20px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#actions { display: flex; gap: 6px; }
main { max-width: 720px; margin: 0 auto; padding: 12px 16px calc(var(--tabbar) + env(safe-area-inset-bottom) + 24px); }
main h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin: 18px 2px 8px; }

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; background: var(--surface); border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  flex: 1; height: var(--tabbar); min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted); text-decoration: none; font-size: 11px;
}
.tab-icon { font-size: 20px; line-height: 1.2; }
.tab .tab-emoji { filter: grayscale(1); opacity: 0.7; }
.tab.active { color: var(--accent); font-weight: 600; }
.tab.active .tab-emoji { filter: none; opacity: 1; }
.tab-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Composants ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.list > .row + .row { border-top: 1px solid var(--border); }
.row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; min-height: 52px; }
.row.clickable { cursor: pointer; }
.row.clickable:active { background: var(--surface-2); }
.grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.grow > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grow > .wrap, .wrap { white-space: normal; overflow-wrap: anywhere; }
.link { color: inherit; text-decoration: none; }
.done .label { text-decoration: line-through; color: var(--muted); }
.hint { color: var(--muted); font-size: 13px; margin: 8px 2px; }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); }
.empty p { margin: 0 0 12px; }
.error { color: var(--down); padding: 12px; }

input:not([type=checkbox]):not([type=range]):not([type=color]):not([type=file]), select {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; min-width: 0;
}
input:focus-visible, select:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
input[type=checkbox] { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--accent); }
input[type=range] { width: 100%; accent-color: var(--accent); }
input[type=color] { width: 34px; height: 30px; border: 0; padding: 0; background: none; flex: none; }

.btn { background: var(--accent); color: var(--accent-text); border: 0; border-radius: 10px; padding: 10px 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn.ghost { background: transparent; color: var(--accent); border: 1px dashed var(--border); }
.btn.danger { background: var(--down); color: #fff; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.icon-btn { background: var(--surface-2); border: 0; border-radius: 999px; padding: 6px 12px; cursor: pointer; font-size: 14px; white-space: nowrap; }
.icon-btn:disabled { opacity: 0.3; cursor: default; }
.del { background: none; border: 0; color: var(--muted); font-size: 16px; padding: 6px; cursor: pointer; flex: none; }
.star { background: none; border: 0; font-size: 20px; color: var(--muted); cursor: pointer; padding: 4px; flex: none; }
.star.on { color: #f59e0b; }

.chips { display: flex; gap: 6px; overflow-x: auto; padding: 10px 0; scrollbar-width: none; }
.chip { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 6px 14px; cursor: pointer; white-space: nowrap; }
.chip.active { background: var(--text); color: var(--bg); border-color: var(--text); }

.add-form { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.add-form .main { flex: 1 1 180px; }
.add-form .qty { width: 70px; }
.add-form select { flex: 1 1 140px; }
.qty-tag { background: var(--surface-2); border-radius: 8px; padding: 2px 8px; font-size: 13px; flex: none; }
.overdue { color: var(--down); }
.check-line { display: flex; align-items: center; gap: 10px; padding: 6px 0; cursor: pointer; }
.check-line.compact { padding: 0; gap: 6px; white-space: nowrap; font-size: 14px; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.toolbar select { flex: 1; }

/* ---------- Bourse ---------- */
.search { position: relative; margin-bottom: 12px; }
.search input { width: 100%; }
.search-results {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 4; margin-top: 4px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}
.search-results:empty { display: none; }
.result { display: flex; gap: 8px; align-items: baseline; width: 100%; padding: 11px 12px; background: none; border: 0; text-align: left; cursor: pointer; }
.result + .result { border-top: 1px solid var(--border); }
.result span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.right { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: none; }
.price { font-variant-numeric: tabular-nums; font-weight: 600; }
.pill { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 13px; padding: 2px 8px; border-radius: 8px; min-width: 74px; text-align: center; color: var(--muted); background: var(--surface-2); }
.pill.up { color: var(--up); background: color-mix(in srgb, var(--up) 14%, transparent); }
.pill.down { color: var(--down); background: color-mix(in srgb, var(--down) 14%, transparent); }
.quote-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; padding: 4px 2px; }
.quote-head .big { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.quote-head .full { flex-basis: 100%; }
.chart { height: min(55vh, 420px); min-height: 280px; margin: 0 -6px; }
.panel { padding: 0 14px 14px; margin-top: 4px; }
.ma-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.ma-row select { flex: 1; }
.ma-row .num { width: 76px; }
.slider { display: flex; flex-direction: column; gap: 6px; padding: 6px 0; }

/* ---------- Vidéos ---------- */
.video-list { display: grid; gap: 16px; }
@media (min-width: 560px) { .video-list { grid-template-columns: 1fr 1fr; } }
.group-title { grid-column: 1 / -1; margin: 6px 2px -6px; }
.video { display: flex; flex-direction: column; gap: 8px; color: inherit; text-decoration: none; min-width: 0; }
.thumb { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tag { position: absolute; bottom: 6px; right: 6px; background: rgba(0, 0, 0, 0.75); color: #fff; font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 6px; }
.tag.new { right: auto; left: 6px; background: #dc2626; }
.video .meta { display: flex; flex-direction: column; gap: 2px; }
.video .meta b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-weight: 600; }

/* ---------- Idées ---------- */
.btn:disabled { opacity: 0.4; cursor: default; }
.add-task-btn + input[type=search] { width: 100%; }
.added-count { color: var(--up); font-weight: 600; }
.idea-row .grow { gap: 2px; }
.excerpt { white-space: normal !important; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; color: var(--muted); font-size: 14px; }
.idea-title { width: 100%; font-size: 18px; font-weight: 600; }
.idea-card { padding: 4px; }
.idea-text {
  display: block; width: 100%; min-height: 220px; resize: none; overflow: hidden;
  border: 0; background: transparent; padding: 12px; line-height: 1.55;
}
.idea-text:focus { outline: none; }
.interim { margin: 0; padding: 0 12px 10px; color: var(--muted); font-style: italic; min-height: 1em; }
.interim:empty { display: none; }
.dictation-bar { display: flex; margin-top: 12px; }
.mic { flex: 1; padding: 14px; }
.mic.listening { background: var(--down); color: #fff; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--down) 25%, transparent); } }
@media (prefers-reduced-motion: reduce) { .mic.listening { animation: none; } }
.idea-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 24px; }

/* ---------- Événements ---------- */
.event-list { display: grid; gap: 10px; }
.event-card { padding: 12px 14px; cursor: pointer; display: flex; flex-direction: column; gap: 10px; }
.event-card:active { background: var(--surface-2); }
.event-head { display: flex; align-items: center; gap: 12px; }
.event-icon { font-size: 26px; line-height: 1; }
.progress { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; flex: 1; }
.progress span { display: block; height: 100%; background: var(--up); border-radius: inherit; transition: width 0.3s; }
.event-progress { display: flex; align-items: center; gap: 10px; margin: 14px 2px 12px; }
.event-form { display: flex; flex-direction: column; }
.event-form .idea-title { margin-bottom: 4px; }
.icon-chip { font-size: 18px; padding: 4px 10px; }
.field-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.field { flex: 1 1 140px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.field input, .field select { color: var(--text); font-size: 15px; width: 100%; }
.btn.wide { width: 100%; margin-top: 16px; padding: 13px; }
.section-add { margin-top: 8px; }
.event-actions { margin-top: 20px; }
.event-tag {
  align-self: flex-start; max-width: 100%; margin-top: 3px; padding: 1px 8px; border: 0; border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent);
  font-size: 12px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---------- Événements partagés ---------- */
.share-choice { align-items: flex-start; margin-top: 16px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.share-choice input { margin-top: 2px; }
.share-btn { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.share-banner { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.shared-badge { font-size: 12px; color: var(--accent); white-space: nowrap; }
.who { color: var(--muted); }
.claim { background: none; border: 1px solid transparent; border-radius: 999px; font-size: 16px; padding: 3px 6px; cursor: pointer; filter: grayscale(1); opacity: 0.45; flex: none; }
.claim.on { filter: none; opacity: 1; border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); align-self: center; opacity: 0.5; }
.live-dot.on { background: var(--up); opacity: 1; box-shadow: 0 0 0 3px color-mix(in srgb, var(--up) 25%, transparent); }
.join-card { padding: 24px 18px; text-align: center; display: flex; flex-direction: column; gap: 6px; }
.join-card h2 { margin: 0; }
.join-card p { margin: 2px 0; }
.event-icon.big { font-size: 44px; }

/* ---------- To-do : catégories et cloche ---------- */
.bell { position: relative; background: var(--surface-2); border: 0; border-radius: 999px; width: 36px; height: 32px; font-size: 17px; cursor: pointer; }
.badge, .tab-badge {
  position: absolute; top: -4px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--accent); color: var(--accent-text);
  font: 700 11px/18px system-ui, sans-serif; text-align: center; box-shadow: 0 0 0 2px var(--bg);
}
.badge.late { background: var(--down); color: #fff; }
.tab-icon { position: relative; }
.tab-badge { top: -3px; right: -10px; background: var(--down); color: #fff; box-shadow: 0 0 0 2px var(--surface); filter: none; }
.chip-count { display: inline-block; margin-left: 6px; min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--down); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.chip.ghost-chip { border-style: dashed; color: var(--accent); }
.status-chips { padding-top: 0; }
.chip.small { padding: 4px 12px; font-size: 13px; }
.cat-title { display: flex; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; font-size: 15px; color: var(--text); font-weight: 700; }
.cat-bell { font-size: 12px; font-weight: 600; color: var(--down); background: color-mix(in srgb, var(--down) 12%, transparent); padding: 1px 8px; border-radius: 999px; }
.cat-select { flex: 1 1 130px; }
.grow.clickable { cursor: pointer; }
.edit-row { flex-wrap: wrap; background: var(--surface-2); }
.edit-row .main { flex: 1 1 100%; }
.edit-row select, .edit-row input[type=date] { flex: 1 1 140px; }
.edit-row .btn-row { flex: 1 1 100%; }
.icon-choice { background: var(--surface-2); border: 2px solid transparent; border-radius: 10px; font-size: 20px; width: 42px; height: 42px; cursor: pointer; padding: 0; flex: none; }
.icon-choice.active { border-color: var(--accent); }
.icon-choice.big { width: 46px; height: 46px; font-size: 24px; }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 6px; }
.icon-picker { display: flex; flex-direction: column; gap: 10px; }
.picker-card { padding: 4px 14px 14px; margin-top: 12px; }
.emoji-input { width: 100%; }
.grow-input { flex: 1; min-width: 0; }

/* ---------- To-do : statuts ---------- */
.status-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.status-tab {
  display: flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 6px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface); cursor: pointer; font-weight: 600; white-space: nowrap;
}
.status-count { font-size: 12px; font-weight: 700; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--surface-2); line-height: 18px; }
.status-tab.todo.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.status-tab.encours.active { background: #d97706; color: #fff; border-color: #d97706; }
.status-tab.done.active { background: var(--up); color: #fff; border-color: var(--up); }
.status-tab.active .status-count { background: rgba(255, 255, 255, 0.25); color: inherit; }
.status-btn {
  flex: none; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; font-size: 15px; font-weight: 700; line-height: 1;
  border: 2px solid var(--muted); background: transparent; color: var(--muted);
}
.status-btn.encours { border-color: #d97706; color: #d97706; background: color-mix(in srgb, #d97706 12%, transparent); }
.status-btn.done { border-color: var(--up); background: var(--up); color: #fff; }
.add-task-btn { margin: 0 0 10px; }

/* ---------- Fenêtre modale ---------- */
.sheet-overlay {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(0, 0, 0, 0.45); animation: fade 0.15s ease-out;
}
.sheet {
  width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto;
  background: var(--bg); border-radius: 18px 18px 0 0;
  padding: 8px 16px calc(env(safe-area-inset-bottom) + 16px); animation: rise 0.2s ease-out;
}
@media (min-width: 640px) {
  .sheet-overlay { align-items: center; }
  .sheet { border-radius: 18px; }
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 0 10px; }
.sheet-head h2 { margin: 0; font-size: 18px; }
.sheet-text { display: block; width: 100%; resize: vertical; border: 0; background: transparent; padding: 12px; font: inherit; color: inherit; line-height: 1.5; }
.sheet-text:focus { outline: none; }
.wrap-chips { flex-wrap: wrap; overflow: visible; padding-top: 0; }
.sheet-actions { justify-content: flex-end; margin-top: 8px; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sheet-overlay, .sheet { animation: none; } }
.btn.add-top { padding: 6px 14px; border-radius: 999px; font-size: 14px; }

/* ---------- Urgence ---------- */
.subtabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; background: var(--surface-2); border-radius: 12px; padding: 4px; margin-bottom: 12px; }
.subtab { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border: 0; border-radius: 9px; background: transparent; font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; }
.subtab-icon { font-size: 18px; }
.subtab.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.numbers { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 1px; background: var(--border); }
.number { display: flex; flex-direction: column; padding: 10px 12px; background: var(--surface); color: inherit; text-decoration: none; }
.number b { font-size: 22px; color: var(--down); }
.number small { font-size: 12px; }
.check-row { cursor: pointer; align-items: flex-start; }
.check-row input { margin-top: 2px; }
.link-row { color: inherit; text-decoration: none; }
.autonomy { padding: 14px; display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.autonomy-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.persons { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.autonomy-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gauge { border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.gauge b { font-size: 22px; }
.gauge.good { background: color-mix(in srgb, var(--up) 14%, transparent); }
.gauge.ok { background: color-mix(in srgb, #d97706 16%, transparent); }
.gauge.low { background: color-mix(in srgb, var(--down) 14%, transparent); }
.alert-card { padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; margin: 10px 0; border-color: color-mix(in srgb, #d97706 50%, var(--border)); background: color-mix(in srgb, #d97706 8%, var(--surface)); }
.expiry.soon { color: #d97706; font-weight: 600; }
.expiry.expired { color: var(--down); font-weight: 600; }
.qty-ctrl { display: flex; align-items: center; gap: 6px; flex: none; }
.qty-ctrl b { min-width: 46px; text-align: center; font-size: 14px; }
.qty-line { display: flex; align-items: center; gap: 8px; }
.qty-line input { width: 90px !important; flex: none; }
.tip { display: block; }
.tip summary { cursor: pointer; font-weight: 600; }
.tip p { margin: 8px 0 0; color: var(--muted); }
.risk { color: var(--down); font-weight: 600; }
.setup-card { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.setup-card h2 { margin: 0; font-size: 18px; }
.setup-card p, .setup-card ol { margin: 0; }
.result-row { width: 100%; border: 0; background: none; text-align: left; font: inherit; color: inherit; }
.map { height: min(60vh, 520px); min-height: 320px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); z-index: 0; }
.map.adding { cursor: crosshair; outline: 3px solid var(--accent); }
.map-actions { margin-top: 10px; }
.map-actions .btn { flex: 1; }
.options-card { padding: 12px 14px; margin-top: 16px; }
.options-card summary { cursor: pointer; font-weight: 600; }
.poi-popup { display: flex; flex-direction: column; gap: 4px; font-size: 13px; max-width: 240px; }
.poi-popup .small { font-size: 12px; }
.safety-card { padding: 12px 14px; border-color: color-mix(in srgb, var(--down) 45%, var(--border)); background: color-mix(in srgb, var(--down) 7%, var(--surface)); }
.safety-card ul { margin: 6px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.plant-result.danger { background: color-mix(in srgb, var(--down) 8%, transparent); }
.flag-row { align-items: flex-start; }
.yes-no { display: flex; gap: 4px; flex: none; }
.chip.danger-chip { background: var(--down); border-color: var(--down); color: #fff; }
.verdict { padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.verdict.danger { background: color-mix(in srgb, var(--down) 12%, var(--surface)); border-color: var(--down); }
.verdict.neutral { background: color-mix(in srgb, #d97706 10%, var(--surface)); border-color: #d97706; }
.link-btn { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 8px 2px; font-size: 14px; }
.catalogue { display: flex; flex-direction: column; gap: 10px; }
.pack-offer { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.pack-offer-head { display: flex; align-items: center; gap: 10px; }
.pack-offer-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.place-picker { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.place-picker .list .row { padding: 8px 4px; min-height: 0; font-size: 14px; }
.pack-row { align-items: flex-start; }
.pack-row .grow { gap: 3px; }
.pack-row .progress { margin-top: 4px; }

.plant-results { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.plant-card { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.plant-head { display: flex; align-items: flex-start; gap: 10px; }
.plant-desc { margin: 0; font-size: 14px; }
.food-verdict { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border-radius: 10px; font-size: 14px; }
.food-verdict.danger, .food-verdict.stop { background: color-mix(in srgb, var(--down) 12%, transparent); }
.food-verdict.caution { background: color-mix(in srgb, #d97706 14%, transparent); }
.food-verdict.unknown { background: var(--surface-2); }

/* Connexion */
.auth-card { max-width: 420px; margin: 24px auto; padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.auth-card h2 { margin: 6px 0 0; }
.auth-logo { font-size: 40px; text-align: center; }
.auth-form { display: flex; flex-direction: column; gap: 10px; }
.auth-form input { width: 100%; font-size: 16px; }
.auth-links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.link-btn { background: none; border: 0; padding: 4px 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; }
#tabs[hidden] { display: none; }
.auth-legal { align-self: center; font-size: 13px; color: var(--muted); }

/* Objectifs de l'année */
.goal-summary { display: flex; align-items: center; gap: 12px; margin: 6px 2px 12px; }
.goal-summary .progress { height: 10px; }
.goal-bravo { margin: 0 2px 12px; font-weight: 600; color: var(--up); }
.section-toggle { display: block; width: 100%; text-align: left; margin: 18px 0 8px; padding: 6px 2px; background: none; border: 0; color: inherit; font: inherit; font-weight: 700; font-size: 16px; cursor: pointer; }
.goal-ideas { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.goal-idea { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px; text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: inherit; font: inherit; cursor: pointer; }
.goal-idea:active { background: var(--surface-2); }
.goal-idea-icon { font-size: 24px; }
.goal-idea.added { border-color: var(--up); }
.goal-idea small { color: var(--up); font-weight: 600; }
.goal-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; font-weight: 600; }
.goal-field input { font-weight: 400; }
.goal-num { max-width: 140px; }
.goal-weight { display: flex; gap: 12px; flex-wrap: wrap; flex: 1 1 100%; }
.goal-weight .goal-field { flex: 1 1 130px; }
.goal-weight .goal-num { max-width: none; width: 100%; }
.unit-bar { align-items: center; padding-top: 0; font-size: 14px; }

/* ---------- Routine ---------- */
.rt-chapter, .rt-prog { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 14px; margin-bottom: 10px; color: inherit; font: inherit; cursor: pointer; }
.rt-chapter { border-left: 6px solid var(--c); }
.rt-chapter .grow, .rt-prog .grow { gap: 3px; }
.rt-icon { font-size: 32px; flex: none; }
.rt-icon.big { font-size: 52px; display: block; text-align: center; }
.rt-streak { font-weight: 700; white-space: nowrap; }
.rt-go { font-size: 26px; color: var(--muted); }
.rt-tags { color: var(--accent) !important; font-weight: 600; }
.rt-week { display: flex; gap: 4px; margin-top: 4px; }
.rt-week span { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; background: var(--surface-2); color: var(--muted); text-transform: uppercase; }
.rt-week span.on { background: var(--up); color: #fff; }
.rt-done { padding: 12px 14px; margin-bottom: 8px; border-left: 4px solid var(--up); }
.rt-prog-head { text-align: center; padding: 18px; }
.rt-prog-head h2 { margin: 6px 0; }
.rt-num { width: 28px; height: 28px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-weight: 700; }
.rt-ex .grow { gap: 3px; }
.rt-session { text-align: center; padding: 22px 16px; border-top: 6px solid #f97316; }
.rt-session.rest, .rt-session.ready { border-top-color: var(--up); }
.rt-session.med { border-top-color: #8b5cf6; }
.rt-session.finished { border-top-color: var(--up); }
.rt-phase { margin: 0; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-size: 13px; }
.rt-ex-name { margin: 8px 0; font-size: 24px; }
.rt-clock { font-size: 72px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.rt-tip { margin: 8px 0; }
.rt-controls { margin-top: 12px; }
.rt-controls .btn { flex: 1; }
.rt-reading, .rt-book { padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.rt-page-form { padding: 0; gap: 8px; min-height: 0; }
.rt-mode { width: 100%; text-align: left; background: none; border: 0; color: inherit; font: inherit; cursor: pointer; }
.rt-mode + .rt-mode { border-top: 1px solid var(--border); }
.rt-mode .grow { gap: 3px; }
.rt-radio { font-size: 20px; color: var(--accent); }
.rt-breath { width: 180px; height: 180px; margin: 10px auto 18px; border-radius: 50%; background: radial-gradient(circle, #c4b5fd, #8b5cf6); animation: rt-breathe 10s ease-in-out infinite; }
.rt-breath.still { animation: none; transform: scale(0.8); opacity: 0.6; }
.rt-breath.paused { animation-play-state: paused; }
@keyframes rt-breathe { 0% { transform: scale(0.55); } 40% { transform: scale(1); } 100% { transform: scale(0.55); } }

/* Objectif « Voyager » : pays de destination */
.country-picker { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; flex: 1 1 100%; }
.country-results { display: flex; flex-direction: column; gap: 4px; }
.goal-countries { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; white-space: normal; }
.goal-countries .chips { padding: 4px 0; }
.chip.visited { background: var(--up); border-color: var(--up); color: #fff; }

/* Illustrations animées des exercices : personnage illustré */
.ex-fig { display: block; flex: none; --skin: #f1c27d; --skin-back: #d9a066; --shirt: #3b82f6; --shirt-back: #2563eb; --shorts: #1f2937; --shoe: #ef4444; --hair: #3b2a20; }
.hm-skin { fill: none; stroke: var(--skin); stroke-width: 6.2; stroke-linecap: round; stroke-linejoin: round; }
.hm-limb.back .hm-skin { stroke: var(--skin-back); }
.hm-sleeve { stroke: var(--shirt); stroke-width: 7.6; stroke-linecap: round; }
.hm-limb.back .hm-sleeve { stroke: var(--shirt-back); }
.hm-shorts { stroke: var(--shorts); stroke-width: 8.6; stroke-linecap: round; }
.hm-hand { fill: var(--skin); }
.hm-limb.back .hm-hand { fill: var(--skin-back); }
.hm-shoe { fill: var(--shoe); }
.hm-limb.back .hm-shoe { fill: #b91c1c; }
.hm-torso { fill: none; stroke: var(--shirt); stroke-width: 13; stroke-linecap: round; stroke-linejoin: round; }
.hm-belt { stroke: var(--shorts); stroke-width: 13; stroke-linecap: round; }
.hm-neck { stroke: var(--skin); stroke-width: 4.5; stroke-linecap: round; }
.hm-head { fill: var(--skin); }
.hm-hair { fill: var(--hair); }
.ex-ground { fill: var(--surface-2); }
.ex-mat { fill: #a7f3d0; opacity: 0.8; }
.ex-prop { fill: #e5d3b3; stroke: #c8b08a; }
.rt-ex-card { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.rt-ex-card + .rt-ex-card { border-top: 1px solid var(--border); }
.rt-ex-top { display: flex; gap: 12px; align-items: center; }
.rt-ex-top .grow { gap: 3px; }
.rt-ex-fig { position: relative; flex: none; background: var(--surface-2); border-radius: 12px; padding: 4px; }
.rt-ex-fig .rt-num { position: absolute; top: 4px; left: 4px; width: 22px; height: 22px; font-size: 12px; background: var(--surface); }
.rt-chrono { display: flex; align-items: center; gap: 10px; }
.rt-chrono-time { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 56px; }
.rt-chrono-btn { flex: 1; }
.rt-chrono-btn.running { background: var(--down); }
.rt-session-fig { display: flex; justify-content: center; margin: 6px 0; min-height: 175px; }
.rt-session-fig.preview { opacity: 0.45; }

/* Objectifs : progression chiffrée */
.goal-track, .goal-countries { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; white-space: normal; }
.goal-progress { display: flex; align-items: center; gap: 10px; }
.goal-progress .progress { height: 8px; }
.goal-pct { font-size: 13px; min-width: 40px; text-align: right; }
.goal-slider-row { display: flex; align-items: center; gap: 8px; }
.goal-slider { flex: 1; min-width: 0; accent-color: var(--up); height: 28px; }
.goal-exact { width: 84px; padding: 6px 8px; font: inherit; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); }
.goal-unit { color: var(--muted); font-size: 13px; min-width: 24px; }
.goal-track-info { color: var(--muted); }
.goal-target { flex: 1 1 100%; }
button.rt-ex-top { width: 100%; text-align: left; background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; }
.rt-zoom { position: absolute; right: 4px; bottom: 4px; font-size: 14px; background: var(--surface); border-radius: 50%; width: 24px; height: 24px; display: grid; place-items: center; }
.rt-see { color: var(--accent) !important; font-weight: 600; }
.rt-demo { display: flex; flex-direction: column; gap: 12px; }
.rt-demo-fig { display: flex; justify-content: center; background: var(--surface-2); border-radius: 16px; padding: 8px; }
.rt-demo-fig .ex-fig { width: 100%; max-width: 380px; height: auto; }
.rt-demo-ctrl .btn { flex: 1; }
.rt-demo-ctrl .btn.on { background: var(--accent); color: var(--accent-text); border-style: solid; }
.rt-demo-tip { margin: 0; font-size: 16px; }
.rt-yt { display: block; text-align: center; text-decoration: none; background: #dc2626; color: #fff; }
.rt-ex-top .grow > .rt-see { white-space: normal; }
.rt-dose { display: inline-block; align-self: flex-start; margin: 2px 0; padding: 2px 10px; border-radius: 99px; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); font-weight: 700; font-size: 13px; white-space: normal !important; }
.rt-dose.big { font-size: 16px; padding: 4px 12px; align-self: center; }

/* Corps anatomique 3D */
.an-stage { position: relative; width: 100%; aspect-ratio: 1 / 1; max-width: 100%; border-radius: 16px; overflow: hidden; touch-action: none; background: radial-gradient(120% 90% at 50% 30%, #1d2738, #0b0f17); display: grid; place-items: center; }
.an-stage.fallback { background: var(--surface-2); }
.an-stage.preview { opacity: 0.55; }
.an-canvas { display: block; width: 100%; height: 100%; }
.an-loading { color: #c9d3e2; font-size: 14px; }
.rt-session-fig .an-stage { max-width: 320px; margin: 0 auto; }
.rt-session-fig { min-height: 0; }
.an-muscles { display: flex; flex-direction: column; gap: 4px; }
.an-chip { padding: 4px 10px; border-radius: 99px; font-size: 13px; font-weight: 600; background: #fde3d6; color: #8a2c0a; }
.an-chip.cool { background: #d6efff; color: #0b5a8a; }
.an-views { align-items: center; padding: 0; }
.rt-thumb { width: 110px; height: 110px; display: grid; place-items: center; border-radius: 12px; overflow: hidden; background: radial-gradient(120% 90% at 50% 30%, #1d2738, #0b0f17); }
.rt-thumb img { width: 110px; height: 110px; display: block; }

/* Routines des objectifs : tabac et poids */
.tb-hero { text-align: center; padding: 18px; display: flex; flex-direction: column; gap: 2px; border-top: 6px solid #0ea5e9; }
.tb-big { font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; }
.tb-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 10px 0; }
.tb-stats .card { padding: 12px 8px; text-align: center; display: flex; flex-direction: column; gap: 2px; }
.tb-stats b { font-size: 20px; }
.tb-stats small { color: var(--muted); font-size: 12px; line-height: 1.3; }
.tb-craving { background: #0ea5e9; }
.tb-today, .tb-setup, .tb-help { padding: 14px; display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.tb-counter { display: flex; align-items: center; justify-content: center; gap: 18px; }
.tb-counter b { font-size: 20px; min-width: 130px; text-align: center; }
.tb-counter .icon-btn { width: 44px; height: 44px; font-size: 22px; border-radius: 50%; }
.tb-benefit .tb-check { width: 26px; height: 26px; flex: none; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--border); color: var(--muted); font-weight: 700; }
.tb-benefit.on .tb-check { background: var(--up); border-color: var(--up); color: #fff; }
.tb-benefit:not(.on) { color: var(--muted); }
.tb-tips { margin: 0; padding-left: 20px; }
.tb-help p { margin: 0; }
.legacy-card { padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.legacy-card h2 { margin: 0; font-size: 20px; }
.legacy-card p { margin: 0; }
.legacy-card .btn-col { display: flex; flex-direction: column; gap: 8px; }
.wt-card { padding: 10px; margin-top: 10px; }
.wt-chart { display: block; width: 100%; height: auto; }
.wt-grid { stroke: var(--border); stroke-width: 1; }
.wt-target { stroke: var(--up); stroke-width: 1.5; stroke-dasharray: 5 4; }
.wt-line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; }
.wt-dot { fill: var(--accent); }
.wt-label { fill: var(--muted); font-size: 10px; }
.wt-plan { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 2 4; }
.wt-hero { border-top-color: #16a34a; }
.wt-row { gap: 10px; }
.wt-week { width: 52px; flex: none; font-weight: 700; color: var(--muted); }
.wt-gap { width: 48px; flex: none; text-align: right; font-size: 13px; font-weight: 700; }
.wt-gap.ok { color: var(--up); }
.wt-gap.over { color: #ea580c; }
/* Tabac : plan de réduction et badges */
.tb-preview { margin: 0; font-size: 14px; color: var(--muted); }
.wrap-chips { flex-wrap: wrap; }
.tb-plan { padding: 12px; margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.tb-bars { display: grid; grid-template-columns: repeat(14, 1fr); gap: 3px; height: 110px; align-items: end; }
.tb-bar { position: relative; height: 100%; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 16px; }
.tb-bar .goal { position: absolute; bottom: 16px; left: 2px; right: 2px; border: 1.5px solid #0ea5e9; border-radius: 4px 4px 0 0; background: color-mix(in srgb, #0ea5e9 12%, transparent); }
.tb-bar .real { position: absolute; bottom: 16px; left: 5px; right: 5px; border-radius: 3px 3px 0 0; }
.tb-bar .real.ok { background: var(--up); }
.tb-bar .real.over { background: #ea580c; }
.tb-max { position: absolute; left: 0; right: 0; text-align: center; font-size: 11px; line-height: 1.2; color: #0284c7; }
.tb-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 6px; }
.tb-day { display: flex; flex-direction: column; align-items: center; padding: 6px 4px; border-radius: 10px; background: var(--surface-2); }
.tb-day small { font-size: 11px; color: var(--muted); }
.tb-day b { font-size: 14px; }
.tb-day.zero { background: color-mix(in srgb, var(--up) 15%, transparent); }
.tb-bar small { position: absolute; bottom: 0; font-size: 11px; color: var(--muted); }
.tb-bar.today small { color: var(--text); font-weight: 800; }
.tb-patch { margin-top: 4px; padding: 22px 16px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: linear-gradient(160deg, #0ea5e9, #4f46e5); color: #fff; border: none; }
.tb-patch small { color: #fff; font-weight: 600; margin-top: 6px; }
.tb-patch-icon { font-size: 54px; line-height: 1; filter: drop-shadow(0 4px 8px rgba(0,0,0,.25)); }
.tb-badges { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.tb-badge { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); filter: grayscale(1); opacity: .45; }
.tb-badge span { font-size: 26px; }
.tb-badge small { font-size: 11px; }
.tb-badge.on { filter: none; opacity: 1; border-color: #0ea5e9; }
.goal-routine { align-self: flex-start; margin-top: 4px; font-weight: 600; color: var(--accent); text-decoration: none; }
.legacy-card .btn { white-space: normal; text-align: center; line-height: 1.35; }

/* ==================== Nouveau look « coach » ==================== */
/* Couleurs : indigo pour l'action, menthe pour la réussite, fond légèrement teinté. */
:root {
  --bg: #f3f4fb;
  --surface: #ffffff;
  --surface-2: #eceefa;
  --text: #171a33;
  --muted: #646b8a;
  --border: #e3e5f3;
  --accent: #4f46e5;
  --accent-2: #06b6d4;
  --accent-text: #ffffff;
  --up: #10b981;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(23, 26, 51, .05), 0 6px 20px rgba(23, 26, 51, .06);
  --tabbar: 64px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0f1c;
    --surface: #161a2e;
    --surface-2: #1f2440;
    --text: #e8eaf7;
    --muted: #9ba1c2;
    --border: #262c4b;
    --accent: #8b85ff;
    --accent-2: #22d3ee;
    --accent-text: #0d0f1c;
    --up: #34d399;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  }
}
body { background: var(--bg); font-size: 15.5px; }
.card { border-color: transparent; box-shadow: var(--shadow); }
.topbar { background: color-mix(in srgb, var(--bg) 82%, transparent); border-bottom-color: transparent; }
.topbar h1 { font-size: 22px; letter-spacing: -.01em; }
.btn { border-radius: 12px; box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 25%, transparent); }
.btn.ghost, .btn.danger { box-shadow: none; }
.chip.active { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.progress span { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.progress span.over { background: var(--down); }
.tabs { background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px); border-top: 0; box-shadow: 0 -4px 20px rgba(23, 26, 51, .06); }
.tab { position: relative; font-size: 10.5px; }
.tab .tab-icon { width: 42px; height: 28px; display: grid; place-items: center; border-radius: 99px; transition: background .2s; }
.tab.active .tab-icon { background: color-mix(in srgb, var(--accent) 14%, transparent); }

/* ---------- Accueil ---------- */
.home-hero { margin: 4px 0 6px; padding: 20px; border-radius: 22px; color: #fff; background: linear-gradient(135deg, #4f46e5, #7c3aed 55%, #06b6d4); box-shadow: 0 10px 30px rgba(79, 70, 229, .3); }
.home-hero h2 { margin: 2px 0 14px; font-size: 26px; letter-spacing: -.02em; }
.home-date { margin: 0; text-transform: capitalize; opacity: .85; font-size: 14px; }
.home-hero-row { display: flex; align-items: center; gap: 16px; }
.home-hero-text { display: flex; flex-direction: column; gap: 2px; }
.home-hero-text b { font-size: 17px; }
.home-hero-text small { color: rgba(255, 255, 255, .85); }
.ring { width: 78px; height: 78px; flex: none; }
.ring-bg { fill: none; stroke: rgba(255, 255, 255, .25); stroke-width: 8; }
.ring-fg { fill: none; stroke: #fff; stroke-width: 8; stroke-linecap: round; }
.ring-text { fill: #fff; font-size: 17px; font-weight: 800; }
.home-tips { display: flex; flex-direction: column; gap: 8px; }
.home-tip { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); color: inherit; text-decoration: none; }
.home-tip-icon { font-size: 26px; flex: none; }
.home-tip span:nth-child(2) { flex: 1; }
.home-go { color: var(--accent); font-size: 22px; font-weight: 700; }
.home-chapters { display: flex; flex-wrap: wrap; gap: 8px; }
.home-chip { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 99px; background: var(--surface); box-shadow: var(--shadow); color: inherit; text-decoration: none; font-weight: 600; font-size: 14px; }
.home-chip.done { background: color-mix(in srgb, var(--up) 16%, var(--surface)); }
.home-chip-icon { font-size: 18px; }
.home-check { color: var(--up); font-weight: 800; }
.home-more { display: block; margin: 8px 4px 0; color: var(--accent); font-weight: 600; text-decoration: none; }
.home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.home-tile { display: flex; flex-direction: column; gap: 6px; padding: 14px; color: inherit; text-decoration: none; }
.home-tile b { font-size: 26px; letter-spacing: -.02em; }
.home-tile .progress { height: 7px; flex: none; }
.home-goals { margin-top: 10px; }
.home-goals .row { color: inherit; text-decoration: none; }
.home-goals .grow { gap: 6px; }
.home-goals .progress { height: 6px; flex: none; }
.home-event { color: inherit; text-decoration: none; }
.home-event .grow { gap: 2px; }

/* ---------- Vidéos : temps du jour et lecteur ---------- */
.vid-budget { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.vid-budget-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.vid-budget select { border: 1px solid var(--border); border-radius: 10px; padding: 6px 8px; background: var(--surface); }
.vid-budget .progress { height: 8px; flex: none; }
.vid-stop { margin: 0; color: var(--down); font-weight: 600; }
.vid-player { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: #000; }
.vid-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.home-date { text-transform: none !important; } .home-date::first-letter { text-transform: uppercase; }

/* Coach Android : réseaux sociaux et rappels */
.home-social { padding: 14px; display: flex; flex-direction: column; gap: 6px; margin-top: 18px; }
.home-social-top { display: flex; justify-content: space-between; align-items: baseline; }
.home-social-top b { font-size: 24px; }
.home-social .progress { height: 8px; flex: none; }
.home-social .btn { align-self: flex-start; margin-top: 4px; }
.coach-settings { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.coach-settings h4 { margin: 8px 0 0; }
.coach-settings .row { padding: 0; min-height: 0; }
.coach-settings select, .coach-settings input[type=time] { border: 1px solid var(--border); border-radius: 10px; padding: 6px 8px; background: var(--surface); }
.coach-warn { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 12px; background: color-mix(in srgb, var(--down) 10%, transparent); }
.coach-warn .btn { align-self: flex-start; }
/* ---------- Bibliothèque et liseuse ---------- */
.lib-card { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.lib-card p { margin: 0; }
.lib-resume { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: none; border: none; padding: 4px 0; color: inherit; font: inherit; cursor: pointer; }
.lib-resume .grow { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.lib-resume small { color: var(--muted); }
.lib-resume-icon { font-size: 30px; width: 48px; height: 48px; flex: none; display: grid; place-items: center; border-radius: 12px; background: color-mix(in srgb, #3b82f6 15%, transparent); }
.lib-pct { font-variant-numeric: tabular-nums; }
.lib-book { width: 100%; text-align: left; background: none; border: none; color: inherit; font: inherit; cursor: pointer; gap: 12px; }
.lib-book .grow { display: flex; flex-direction: column; min-width: 0; }
.lib-book small { color: var(--muted); }
.lib-cover { font-size: 24px; width: 42px; height: 52px; flex: none; display: grid; place-items: center; border-radius: 6px 10px 10px 6px; background: var(--surface-2); box-shadow: inset 4px 0 0 rgba(0,0,0,.12); }
.lib-state { font-size: 13px; font-weight: 700; color: #3b82f6; }
.lib-state.done { color: var(--up); }
.reader { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; background: var(--r-bg); color: var(--r-fg); }
.reader.look-clair { --r-bg: #ffffff; --r-fg: #1f2328; --r-soft: #6b7280; --r-line: #e5e7eb; }
.reader.look-sepia { --r-bg: #f5ecd9; --r-fg: #3d3022; --r-soft: #8a7356; --r-line: #e3d5b8; }
.reader.look-sombre { --r-bg: #121417; --r-fg: #d6d3cd; --r-soft: #8b8f96; --r-line: #262a30; }
.reader-top, .reader-foot { display: flex; align-items: center; gap: 6px; padding: 6px 8px; padding-top: max(6px, env(safe-area-inset-top)); border-bottom: 1px solid var(--r-line); }
.reader-foot { border-bottom: none; border-top: 1px solid var(--r-line); padding-top: 6px; padding-bottom: max(6px, env(safe-area-inset-bottom)); }
.reader-btn { min-width: 40px; height: 40px; border: none; border-radius: 10px; background: transparent; color: var(--r-fg); font-size: 20px; cursor: pointer; }
.reader-btn:active { background: var(--r-line); }
.reader-titles { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.reader-titles b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader-chap { font-size: 12px; color: var(--r-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader-where { display: flex; flex-direction: column; gap: 4px; text-align: center; color: var(--r-soft); }
.reader-where .progress { background: var(--r-line); }
.reader-frame { flex: 1; overflow: hidden; padding: 18px 22px; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.reader-cols { column-fill: auto; font-family: Georgia, 'Times New Roman', serif; font-size: var(--reader-font, 19px); line-height: 1.6; text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.reader-cols p { margin: 0 0 .7em; text-indent: 1.2em; white-space: pre-line; }
.reader-cols p.verse { text-indent: 0; }
.reader-cols p.verse sup { color: var(--r-soft); font-size: .65em; font-family: system-ui, sans-serif; font-weight: 700; }
.reader-cols .reader-h { font-size: 1.2em; text-align: center; margin: .4em 0 1.2em; line-height: 1.35; break-after: avoid; }
.reader-cols h3 { font-size: 1em; text-align: center; margin: 1.2em 0 .8em; letter-spacing: .02em; break-after: avoid; }
.reader-settings { display: flex; flex-direction: column; gap: 10px; }
.reader-toc { max-height: 60vh; overflow-y: auto; }
.reader-toc .row { width: 100%; text-align: left; background: none; border: none; color: inherit; font: inherit; cursor: pointer; gap: 10px; }
.reader-toc .row.active { background: color-mix(in srgb, #3b82f6 14%, transparent); font-weight: 700; }
.reader-toc small { color: var(--muted); flex: none; }
.reader-cols h3 { text-transform: none; color: inherit; font-weight: 700; }
.reader-where .progress { display: block; height: 4px; border-radius: 2px; overflow: hidden; }
.reader-where .progress span { display: block; height: 100%; background: #3b82f6; }
/* Coran en arabe */
.reader-cols.book-ar p.verse.ar { font-family: 'Noto Naskh Arabic', 'Amiri', 'Scheherazade New', 'Traditional Arabic', 'Arabic Typesetting', serif; font-size: 1.3em; line-height: 2.1; text-align: right; text-indent: 0; }
.reader-cols.book-ar .ayah { color: var(--r-soft); white-space: nowrap; }
.reader-cols.book-ar p.ar-note { text-indent: 0; text-align: center; color: var(--r-soft); font-size: .85em; }
.reader-cols.book-ar p.ar-flow { font-family: 'Noto Naskh Arabic', 'Amiri', 'Scheherazade New', 'Traditional Arabic', 'Arabic Typesetting', serif; font-size: 1.3em; line-height: 2.1; text-align: justify; text-align-last: right; text-indent: 0; }
.auth-logo img { display: block; margin: 0 auto; border-radius: 18px; box-shadow: 0 6px 18px rgba(79, 70, 229, .35); }
.install-link { display: block; text-align: center; text-decoration: none; margin: 10px 0; }
