/* ===== 1. Design tokens ===== */
:root {
  --ood-bg: #0f1b2d;
  --ood-surface: #1a2b45;
  --ood-surface-2: #263d61;
  --ood-text: #f2f6fc;
  --ood-muted: #b4c0d4;
  --ood-accent: #5fd0a4;
  --ood-accent-text: #06231a;
  --ood-danger: #ff8a80;
  --ood-radius: 18px;
  --ood-shadow: 0 2px 12px rgba(0,0,0,.25);
  --ood-transition: 0.2s ease;
}

/* ===== 2. Thème clair ===== */
:root[data-theme="light"] {
  --ood-bg: #f4f7fb; --ood-surface: #fff; --ood-surface-2: #e4ebf5;
  --ood-text: #14213a; --ood-muted: #4b5a73; --ood-accent: #1f8a64; --ood-accent-text: #fff;
  --ood-danger: #b3261e; --ood-shadow: 0 2px 12px rgba(20,33,58,.12);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --ood-bg: #f4f7fb; --ood-surface: #fff; --ood-surface-2: #e4ebf5;
    --ood-text: #14213a; --ood-muted: #4b5a73; --ood-accent: #1f8a64; --ood-accent-text: #fff;
    --ood-danger: #b3261e; --ood-shadow: 0 2px 12px rgba(20,33,58,.12);
  }
}

/* ===== 3. Layout : plein écran, la page ne défile jamais ===== */
html, body { height: 100%; overflow: hidden; background: var(--ood-bg); }
.ood-app {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  max-width: 560px; margin: 0 auto;
  color: var(--ood-text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding: env(safe-area-inset-top) 16px env(safe-area-inset-bottom);
}
.ood-app h1, .ood-app h2, .ood-app h3 { font-family: inherit; }
.ood-screen { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; padding: 14px 0; }
.ood-screen[hidden] { display: none; }
.ood-center { align-items: center; justify-content: center; text-align: center; }

/* ===== 4. Zone A : en-têtes ===== */
.ood-head { text-align: center; padding-top: 4vh; }
.ood-logo { font-size: clamp(2.6rem, 12vw, 4rem); }
.ood-title { font-size: clamp(1.6rem, 7vw, 2.3rem); line-height: 1.15; }
.ood-sub { color: var(--ood-muted); font-size: clamp(1rem, 3.8vw, 1.15rem); margin-top: 6px; }
.ood-bar { display: flex; align-items: center; gap: 10px; }
.ood-bar-title { flex: 1; font-size: clamp(1.05rem, 4.2vw, 1.3rem); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ood-clock { color: var(--ood-muted); font-variant-numeric: tabular-nums; }
.ood-subhead { font-size: 1rem; color: var(--ood-muted); font-weight: 600; }

/* ===== 5. Zone B : accueil ===== */
.ood-home-main { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: center; gap: 12px; }
.ood-tabbar { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ood-tab { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 56px; padding: 8px; border: 0; border-radius: 14px; background: transparent; color: var(--ood-muted); font: inherit; font-size: .9rem; cursor: pointer; }
.ood-tab span { font-size: 1.4rem; }

/* ===== 6. Zone B : listes (bibliothèque, aide, historique) ===== */
.ood-list { flex: 1; min-height: 0; display: grid; grid-auto-rows: minmax(60px, 1fr); gap: 10px; overflow-y: auto; align-content: start; }
.ood-list-big { grid-auto-rows: minmax(84px, 1fr); }

/* ===== 7. Zone B : séance ===== */
.ood-progress { height: 8px; border-radius: 99px; background: var(--ood-surface-2); overflow: hidden; }
.ood-progress span { display: block; height: 100%; width: 0; background: var(--ood-accent); transition: width .3s ease; }
.ood-stage { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; overflow-y: auto; }
.ood-step-count { color: var(--ood-muted); font-size: .95rem; }
.ood-step-title { font-size: clamp(1.5rem, 7vw, 2.2rem); line-height: 1.2; }
.ood-instruction { color: var(--ood-muted); font-size: clamp(1rem, 4vw, 1.2rem); max-width: 26em; line-height: 1.4; }
.ood-pace { height: 4px; border-radius: 99px; background: var(--ood-surface-2); overflow: hidden; }
.ood-pace span { display: block; height: 100%; width: 0; background: var(--ood-muted); }
.ood-pace.ood-pace-done span { background: var(--ood-accent); }
.ood-actions { display: flex; flex-direction: column; gap: 10px; }
.ood-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ===== 8. Zone C : réglages / fin ===== */
.ood-spacer { flex: 1; }
.ood-ask { margin-top: 8px; color: var(--ood-muted); }
.ood-center .ood-btn { width: 100%; }
