/* ---------- Couleurs : clair par défaut, sombre via data-mode="dark" ----------
   --accent est fixé par l'app selon la couleur choisie par l'utilisateur. */
:root {
  /* Direction artistique : bleu nuit (texte, logo), crème (fond) et jaune ampoule. */
  --navy: #1d2b55;
  --butter: #f2cf6b;
  --accent: #2f5bea;
  --outer: #ece5d6;
  --bg: #f8f4ec;
  --card: #fffdf8;
  --card-2: #f3ecdf;
  --seg: #efe7d8;
  --ink: #1a2547;
  --muted: #6a7088;
  --line: #e7dfcd;
  --glass: color-mix(in srgb, var(--bg) 72%, transparent);
  --ok: #15803d;
  --ok-bg: #e8f7ee;
  --ko: #dc2626;
  --ko-bg: #fdecec;
  --warn-ink: #9a3412;
  --warn-bg: #fff4e5;
  --gold: #f5b301;
  --star-off: #ddd8cf;
  --shadow: rgba(29, 43, 85, .14);
  --wallpaper: linear-gradient(160deg, #fde2e4, #e2ecff);
  --accent-soft: color-mix(in srgb, var(--accent) 12%, var(--card));
  --accent-text: color-mix(in srgb, var(--accent) 85%, #000);
  --mark: color-mix(in srgb, var(--accent) 30%, transparent);
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
:root[data-mode="dark"] {
  --outer: #080d1d;
  --bg: #0f1730;
  --card: #17213f;
  --card-2: #1f2a4c;
  --seg: #1f2a4c;
  --ink: #f6f0e2;
  --muted: #a6adc4;
  --line: #2a3658;
  --glass: color-mix(in srgb, var(--bg) 72%, transparent);
  --ok: #4ade80;
  --ok-bg: rgba(74, 222, 128, .12);
  --ko: #f87171;
  --ko-bg: rgba(248, 113, 113, .12);
  --warn-ink: #fdba74;
  --warn-bg: rgba(251, 146, 60, .14);
  --star-off: #3a3948;
  --shadow: rgba(0, 0, 0, .5);
  --wallpaper: linear-gradient(160deg, #1e1b4b, #0f172a);
  --accent-text: color-mix(in srgb, var(--accent) 55%, #fff);
  --mark: color-mix(in srgb, var(--accent) 45%, transparent);
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--sans);
  background: var(--outer);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  /* Pendant un glissement, la page qui sort de l'écran ne crée pas de défilement horizontal. */
  overflow-x: clip;
}

button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; }
button:disabled { cursor: default; }

/* Surlignage façon marqueur, dans la couleur choisie */
mark {
  color: inherit;
  padding: 0 .15em;
  border-radius: .4em .2em;
  background: linear-gradient(104deg, transparent .9%, var(--mark) 2.4%, var(--mark) 95%, transparent 97%);
}

/* ---------- Coque de l'application (format téléphone) ---------- */
.app {
  max-width: 440px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}
@media (min-width: 520px) {
  .app {
    margin: 24px auto;
    min-height: calc(100vh - 48px);
    border-radius: 36px;
    box-shadow: 0 30px 80px var(--shadow);
    overflow: clip;
  }
}

/* En-tête et bas flous */
.glass-top, .glass-bottom {
  position: sticky;
  z-index: 10;
  background: var(--glass);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
}
.glass-top {
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 14px 16px 12px;
}
.glass-top::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 22px;
  background: linear-gradient(var(--glass), transparent);
  pointer-events: none;
}
.hicons { display: flex; gap: 2px; }
.hright { display: flex; align-items: center; gap: 6px; }
.badge-wrap { position: relative; }
.badge {
  position: absolute; top: 3px; right: 1px; min-width: 18px; height: 18px; padding: 0 5px;
  display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff;
  background: var(--ko); border: 2px solid var(--bg); border-radius: 999px;
}
.hicon { width: 40px; height: 40px; flex-shrink: 0; display: grid; place-items: center; border-radius: 12px; }
.hicon:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); }
.hleft { display: flex; align-items: center; gap: 4px; min-width: 0; }
.htitle { font-weight: 600; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-weight: 700;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
}

.page { flex: 1; display: flex; flex-direction: column; gap: 14px; padding: 8px 18px 28px; }

.glass-bottom {
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
}
.glass-bottom::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 28px;
  background: linear-gradient(transparent, var(--glass));
  pointer-events: none;
}
.scroll-hint {
  position: absolute;
  bottom: calc(100% + 4px);
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  font-size: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 50%;
  box-shadow: 0 4px 14px var(--shadow);
  animation: bob 1.8s ease-in-out infinite;
}
.scroll-hint.hidden { display: none; }
.home-bar { display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; color: var(--muted); }
.home-bar::before { content: ""; width: 120px; height: 5px; border-radius: 3px; background: var(--ink); opacity: .85; }

/* ---------- Éléments communs ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 18px; }
.card.flat { font-size: 14px; line-height: 1.5; }
.card.flat p + p, .card.flat p + .btn { margin-top: 10px; }
.card > .btn, .card > .segmented + .btn { margin-top: 12px; }
.card > p { font-size: 15px; line-height: 1.5; }
.label { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.card-title { font-family: var(--serif); font-size: 21px; font-weight: 600; margin: 4px 0 12px; }
.muted { color: var(--muted); font-size: 14px; line-height: 1.5; }
.small { font-size: 12px; }
.center { text-align: center; }
.link { color: var(--accent-text); font-weight: 600; font-size: 14px; }

.chip {
  display: inline-block;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  background: color-mix(in srgb, var(--c) 14%, var(--card));
  color: color-mix(in srgb, var(--c) 75%, var(--ink));
}

.btn { width: 100%; padding: 14px 18px; font-size: 15px; font-weight: 600; border-radius: 14px; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:disabled { opacity: .4; }
.btn.ghost { color: var(--muted); }
.btn.outline { background: var(--card); border: 1px solid var(--line); }
.btn.danger { color: var(--ko); }
.btn-row { display: flex; gap: 8px; margin-top: 12px; }

.segmented { display: flex; padding: 4px; background: var(--seg); border-radius: 12px; }
.segmented button { flex: 1; padding: 8px 4px; font-size: 13px; font-weight: 600; color: var(--muted); border-radius: 9px; }
.segmented button.active { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px var(--shadow); }
.card .segmented { margin-bottom: 4px; }

.progress { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: width .3s; }

.dayline { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.dayline span:first-child::first-letter { text-transform: uppercase; }
.streak {
  padding: 5px 11px;
  font-weight: 600;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
}
button.streak:hover { border-color: var(--accent); }
.streak .chev-s { margin-left: 4px; color: var(--muted); }

/* ---------- Questions du jour en onglets ---------- */
.day-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; background: var(--seg); border-radius: 14px; }
.day-tab {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 6px 4px; font-size: 13px; font-weight: 600; color: var(--muted);
  border-radius: 10px; transition: background .15s, color .15s;
}
.day-tab:hover:not(:disabled):not(.on) { color: var(--ink); }
.day-tab.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px var(--shadow); }
.day-tab.locked { opacity: .55; }
.day-tab-mark {
  display: grid; place-items: center; width: 20px; height: 20px; flex-shrink: 0;
  font-size: 11px; border-radius: 50%; background: var(--card-2); color: var(--muted);
}
.day-tab.on .day-tab-mark { background: var(--accent); color: #fff; }
.day-tab.done .day-tab-mark { background: var(--ok); color: #fff; }
.day-tab.locked .day-tab-mark { background: none; }

/* ---------- Question ---------- */
.q-card h1 { font-family: var(--serif); font-size: 26px; line-height: 1.2; font-weight: 500; letter-spacing: -.01em; margin-top: 10px; }
.q-card .muted { margin-top: 8px; }
.q-author { margin-top: 8px; font-size: 13px; color: var(--muted); }
.q-card .btn { margin-top: 14px; }
/* Question déjà répondue : carte réduite, l'explication passe au premier plan. */
.q-card.compact { padding: 12px 14px; border-radius: 16px; }
.q-card.compact .chip { font-size: 11px; padding: 3px 8px; }
.q-card.compact h1 { font-size: 17px; line-height: 1.3; margin-top: 6px; }
/* Question du jour : l'accroche du widget en grand, puis la question précise. */
.q-card.teaser .q-hook { margin-top: 12px; font-family: var(--serif); font-size: 25px; font-weight: 600; line-height: 1.2; letter-spacing: -.01em; }
.q-card.teaser .q-illu { margin-right: 8px; }
.q-card.teaser h1 { margin-top: 12px; padding-top: 12px; font-family: var(--sans); font-size: 16px; font-weight: 600; line-height: 1.4; color: var(--muted); border-top: 1px solid var(--line); }

.recall { padding: 12px 14px; font-size: 14px; font-weight: 500; line-height: 1.45; color: var(--accent-text); background: var(--accent-soft); border-radius: 14px; }
.choices { display: grid; gap: 10px; }
.choice {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  text-align: left;
  font-size: 16px;
  font-weight: 500;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 16px;
  transition: border-color .15s, background .15s, opacity .2s;
}
.choice:hover:not(:disabled) { border-color: var(--accent); }
.letter {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  background: var(--card-2);
  border-radius: 9px;
}
.choice.correct { border-color: var(--ok); background: var(--ok-bg); }
.choice.correct .letter { background: var(--ok); color: var(--card); }
.choice.wrong { border-color: var(--ko); background: var(--ko-bg); }
.choice.wrong .letter { background: var(--ko); color: var(--card); }
.choice.dim { opacity: .45; }
.choices.done { gap: 6px; }
.choices.done .choice { padding: 9px 12px; font-size: 14px; gap: 10px; border-radius: 12px; }
.choices.done .letter { width: 22px; height: 22px; font-size: 11px; border-radius: 7px; }
.hint { color: var(--muted); font-size: 14px; text-align: center; }
.feedback { padding: 14px 16px; border-radius: 16px; font-size: 15px; font-weight: 600; line-height: 1.4; }
.feedback.ok { background: var(--ok-bg); color: var(--ok); }
.feedback.ko { background: var(--warn-bg); color: var(--warn-ink); }

/* ---------- Explication ---------- */
.learn { animation: rise .45s ease; }
.learn h2 { font-family: var(--serif); font-size: 23px; font-weight: 600; margin: 4px 0 8px; }
.learn-text { font-size: 16px; line-height: 1.6; }
.learn .learn-text { margin-bottom: 16px; }
.learn-grid { display: grid; grid-template-columns: 44% 1fr; gap: 14px; align-items: start; }
.media {
  position: relative;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 16px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--c) 18%, var(--card)), color-mix(in srgb, var(--c) 40%, var(--card)));
}
/* Sans image : l'illustration de la question, en grand, sur un fond aux couleurs du sujet. */
.media-fallback { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.media-fallback b { font-size: 56px; line-height: 1; filter: drop-shadow(0 6px 10px rgb(0 0 0 / .15)); }
.media-fallback small { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: color-mix(in srgb, var(--c) 70%, var(--ink)); }
.media:not(:has(img.loaded)) figcaption { display: none; }
.media:has(img.loaded) .media-fallback { visibility: hidden; }
.media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .4s; }
.media img.loaded { opacity: 1; }
.media figcaption {
  position: absolute;
  left: 6px;
  bottom: 6px;
  padding: 1px 7px;
  font-size: 10px;
  color: #fff;
  background: rgba(0, 0, 0, .5);
  border-radius: 999px;
  max-width: calc(100% - 12px);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.facts ul { list-style: none; display: grid; gap: 9px; margin-top: 8px; }
.facts li { position: relative; padding-left: 14px; font-size: 14px; line-height: 1.35; }
.facts li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .45em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}
@media (max-width: 360px) { .learn-grid { grid-template-columns: 1fr; } }

/* Lecteur audio */
.player {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 8px 10px;
  background: var(--card-2);
  border-radius: 14px;
}
.player-btn {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 15px;
  color: #fff;
  background: var(--accent);
  border-radius: 50%;
}
.player-body { flex: 1; min-width: 0; }
.player-label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; }
.player-track { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.player-track span { display: block; height: 100%; background: var(--accent); transition: width .3s; }
.player-restart { width: 32px; height: 32px; flex-shrink: 0; font-size: 16px; color: var(--muted); border-radius: 50%; }
.player-restart:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); }

.more summary { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 700; cursor: pointer; list-style: none; }
.more summary::-webkit-details-marker { display: none; }
.plus { position: relative; width: 24px; height: 24px; flex-shrink: 0; border: 1.5px solid var(--ink); border-radius: 50%; }
.plus::before, .plus::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 1.5px;
  background: var(--ink);
  transform: translate(-50%, -50%);
  transition: transform .2s;
}
.plus::after { transform: translate(-50%, -50%) rotate(90deg); }
.more[open] .plus::after { transform: translate(-50%, -50%) rotate(0); }
.more p { margin-top: 12px; font-size: 15px; line-height: 1.55; }
.sources { margin-top: -4px; font-size: 12px; color: var(--muted); text-align: center; }

/* Réactions */
.react-row { display: flex; gap: 10px; }
.react {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.react svg { width: 18px; height: 18px; }
.react.on svg { fill: currentColor; }
.react.on { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, var(--card)); color: var(--accent-text); }
.rating { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; }
.rating > span { font-size: 14px; color: var(--muted); }
.star { font-size: 26px; padding: 0 2px; color: var(--star-off); transition: transform .1s; }
.star.on { color: var(--gold); }
.star:hover { transform: scale(1.15); }
.small-note { margin-top: 10px; font-size: 12px; color: var(--muted); }

/* Mémorisation */
.memorize { padding: 20px; text-align: center; border-radius: 20px; background: var(--accent-soft); }
.memo-icon { font-size: 30px; }
.memorize h3 { font-family: var(--serif); font-size: 20px; margin: 6px 0; }
.memorize p { font-size: 14px; line-height: 1.5; color: var(--muted); }
.memo-actions { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.memorize.done { text-align: left; }
.memorize.done p { font-size: 15px; color: var(--ink); }

/* Bannières (révision, quiz) */
.banner {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
}
.banner-icon { width: 44px; height: 44px; flex-shrink: 0; display: grid; place-items: center; font-size: 22px; background: var(--accent-soft); border-radius: 14px; }
.banner strong { display: block; font-size: 15px; }
.banner .sub { font-size: 14px; color: var(--muted); }
.chev { margin-left: auto; font-size: 24px; color: var(--muted); }
.tagline { font-size: 13px; line-height: 1.6; color: var(--muted); text-align: center; padding: 6px 12px 0; }

/* ---------- Écran d'accueil du téléphone (simulation) ---------- */
.phone { flex: 1; display: flex; flex-direction: column; padding: 10px 0 14px; color: var(--ink); background: var(--wallpaper); }
.status { display: flex; justify-content: space-between; padding: 6px 26px 14px; font-size: 15px; font-weight: 600; }
.home { display: grid; gap: 24px; padding: 6px 20px; }
.home-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: center; }
.icon-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px 10px; }
.icon-grid.two { grid-template-columns: repeat(2, 1fr); }
.app-icon { display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 11px; font-weight: 500; }
.icon-tile {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  font-size: 27px;
  border-radius: 15px;
  background: color-mix(in srgb, var(--card) 70%, transparent);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
}
.phone .icon-tile.smarter { background: var(--accent); box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 45%, transparent); }
.phone-tools { display: grid; justify-items: center; gap: 8px; margin-top: auto; padding: 22px 20px 16px; text-align: center; }
.phone-tools p { max-width: 280px; font-size: 12px; opacity: .7; }
.pill {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  background: color-mix(in srgb, var(--card) 80%, transparent);
  border-radius: 999px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.dock {
  display: flex;
  justify-content: center;
  margin: 0 14px;
  padding: 12px;
  background: color-mix(in srgb, var(--card) 35%, transparent);
  border-radius: 28px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* ---------- Le widget ----------
   Hauteurs fixes : le texte de l'accroche est ensuite ajusté pour tenir en entier. */
.w {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 16px;
  text-align: left;
  color: var(--w-fg);
  background: var(--w-bg);
  font-family: var(--w-font);
  border-radius: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .16);
  transition: transform .15s;
}
.w:hover { transform: scale(1.015); }
.w > * { position: relative; z-index: 1; }
.w.glass { border: 1px solid rgba(255, 255, 255, .4); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); }
.w.dots::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(currentColor 1px, transparent 1.5px);
  background-size: 14px 14px;
  opacity: .14;
  pointer-events: none;
}
.w-head {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  opacity: .85;
}
.w-cat {
  padding: 3px 8px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
  background: color-mix(in srgb, currentColor 14%, transparent);
  border-radius: 999px;
}
.w-hook {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  margin-top: 8px;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.2;
  overflow-wrap: break-word;
  hyphens: auto;
}
.w-illu { position: relative; flex-shrink: 0; display: grid; place-items: center; align-self: center; width: 64px; height: 64px; }
.w-blob {
  position: absolute;
  inset: 6px -10px;
  background: var(--w-blob);
  border-radius: 46% 54% 60% 40% / 50% 42% 58% 50%;
  transform: rotate(-8deg);
}
.w-emo { position: relative; font-size: 36px; line-height: 1; }
.w-done {
  position: absolute;
  top: -4px;
  right: -12px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  font-family: var(--sans);
  font-size: 12px;
  color: #fff;
  background: #16a34a;
  border-radius: 50%;
}
.w-foot { flex-shrink: 0; display: flex; justify-content: space-between; margin-top: 12px; font-family: var(--sans); font-size: 12px; font-weight: 600; opacity: .85; }

.w-small { aspect-ratio: 1; padding: 14px; }
.w-small .w-hook { margin-top: 6px; }
.w-small .w-illu { width: 40px; height: 40px; margin-top: 4px; }
.w-small .w-emo { font-size: 24px; }

.w-medium {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto minmax(0, 1fr);
  column-gap: 12px;
  height: 170px;
}
.w-medium .w-head { grid-column: 1 / -1; }
.w-medium .w-hook { grid-column: 1; align-self: stretch; display: flex; align-items: center; }
.w-medium .w-illu { grid-column: 2; grid-row: 2; align-self: center; width: 84px; height: 84px; }
.w-medium .w-emo { font-size: 44px; }

.w-large { height: 350px; padding: 20px; }
.w-large .w-hook { margin-top: 14px; }
.w-large .w-illu { width: 116px; height: 116px; margin: 8px auto 0; }
.w-large .w-emo { font-size: 64px; }

/* ---------- Personnalisation ---------- */
.preview { display: grid; place-items: center; padding: 26px 22px; border-radius: 24px; background: var(--wallpaper); }
.preview .w { pointer-events: none; }
.preview .w-small { width: 170px; }
.section-title { margin-top: 6px; font-family: var(--serif); font-size: 21px; font-weight: 600; }
.opt-group h3 { margin-bottom: 10px; font-size: 15px; font-weight: 700; }
/* Réglages : des pastilles, sans texte. L'option choisie est entourée de la couleur de l'app. */
.opts { display: flex; flex-wrap: wrap; gap: 9px; }
.opt {
  position: relative;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 50%;
  transition: transform .15s, box-shadow .15s;
}
.opt:active { transform: scale(.92); }
.opt.on { border-color: transparent; box-shadow: 0 0 0 2.5px var(--bg), 0 0 0 4.5px var(--accent); }
.opt.locked > :not(.opt-lock) { opacity: .35; filter: grayscale(.6); }
.opt-lock { position: absolute; right: -4px; bottom: -4px; font-size: 13px; font-style: normal; }
.swatch {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 700;
  border: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
  border-radius: 50%;
}
.opt-icon { font-size: 20px; line-height: 1; color: var(--ink); }
.font-sample { font-size: 19px; line-height: 1; color: var(--ink); }
.size-sample { display: block; border: 2px solid var(--ink); border-radius: 4px; }
.size-small { width: 14px; height: 14px; }
.size-medium { width: 24px; height: 14px; }
.size-large { width: 24px; height: 24px; }
.tex-sample { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); }
.tex-dots { background: radial-gradient(circle, rgba(255,255,255,.75) 1.6px, transparent 1.8px) 0 0/7px 7px, var(--accent); }
.tex-glass { background: linear-gradient(135deg, rgba(255,255,255,.9), rgba(255,255,255,.35)); border: 1px solid var(--line); backdrop-filter: blur(2px); }
.tex-photo { background: linear-gradient(180deg, #8ec5ff 0 55%, #4f9d5c 55%); }
.settings-block + .settings-block { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.settings-title { margin-bottom: 6px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.opt-row { display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 8px; padding: 7px 0; }
.opt-row > span { font-size: 14px; font-weight: 600; color: var(--muted); }

/* ---------- Série et récompenses ---------- */
.streak-hero { text-align: center; }
.streak-hero .big { font-family: var(--serif); font-size: 56px; font-weight: 700; line-height: 1.1; }
.streak-hero p { margin-top: 6px; }
.week { display: flex; justify-content: space-between; gap: 6px; margin-top: 16px; }
.day { flex: 1; display: grid; justify-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.day i {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  font-style: normal;
  font-size: 14px;
  border: 1.5px dashed var(--line);
  border-radius: 50%;
}
.day.on i { border: none; background: var(--accent); color: #fff; }
.day.today { color: var(--ink); font-weight: 700; }
.day.today:not(.on) i { border-color: var(--accent); }
.timeline { list-style: none; display: grid; gap: 0; }
.tier { position: relative; display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding-bottom: 18px; }
.tier:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 34px;
  bottom: 0;
  width: 2px;
  background: var(--line);
}
.tier-dot {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
  background: var(--card-2);
  border-radius: 50%;
}
.tier.unlocked .tier-dot { background: var(--accent); color: #fff; }
.tier.next .tier-dot { box-shadow: 0 0 0 3px var(--accent-soft), 0 0 0 5px var(--accent); }
.tier h3 { font-size: 15px; font-weight: 700; }
.tier .when { font-size: 13px; color: var(--muted); margin: 2px 0 8px; }
.tier .opts { gap: 6px; }
.tier .opt { padding: 5px 9px; font-size: 13px; pointer-events: none; }

/* ---------- Progression (graphiques) ---------- */
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kpi { padding: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
.kpi b { display: block; font-family: var(--serif); font-size: 24px; line-height: 1.1; }
.kpi span { font-size: 12px; color: var(--muted); line-height: 1.3; display: block; margin-top: 2px; }
.chart-card h2 { font-size: 16px; font-weight: 700; }
.chart-card .chart-sub { margin: 2px 0 10px; font-size: 13px; color: var(--muted); }
.chart-wrap { position: relative; }
.chart { display: block; width: 100%; height: auto; overflow: visible; touch-action: pan-y; }
.chart:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 8px; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis-label { fill: var(--muted); font-size: 11px; font-family: var(--sans); }
.chart .area { fill: var(--accent); opacity: .1; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .end-dot, .chart .focus-dot { fill: var(--accent); stroke: var(--card); stroke-width: 2; }
.chart .end-label { fill: var(--ink); font-size: 12px; font-weight: 700; font-family: var(--sans); }
.chart .crosshair { stroke: var(--muted); stroke-width: 1; }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart-tip {
  position: absolute;
  top: 0;
  z-index: 2;
  padding: 6px 10px;
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 6px 18px var(--shadow);
  pointer-events: none;
  transform: translateX(-50%);
}
.chart-tip strong { display: block; font-size: 14px; }
.chart-tip span { color: var(--muted); }
.data-table summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--accent-text); margin-top: 10px; }
.data-table table { width: 100%; margin-top: 8px; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td { padding: 6px 4px; text-align: right; border-bottom: 1px solid var(--line); }
.data-table th:first-child, .data-table td:first-child { text-align: left; }
.data-table th { font-weight: 600; color: var(--muted); }

/* ---------- Recherche / enregistrements ---------- */
.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 14px;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.search-box input { flex: 1; padding: 11px 0; font: inherit; font-size: 16px; color: var(--ink); background: transparent; border: none; outline: none; }
.list { display: grid; gap: 10px; }
.item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 14px;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.item-emoji {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 20px;
  background: color-mix(in srgb, var(--c) 16%, var(--card));
  border-radius: 12px;
}
.item-q { font-size: 15px; font-weight: 600; line-height: 1.35; }
.item-meta { margin-top: 4px; font-size: 13px; color: var(--muted); }
.empty { padding: 40px 20px; font-size: 15px; line-height: 1.5; color: var(--muted); text-align: center; }
.empty .big { display: block; margin-bottom: 8px; font-size: 38px; }

/* ---------- Quiz ---------- */
.page-title { font-family: var(--serif); font-size: 30px; font-weight: 700; }
.page-sub { margin-top: -8px; font-size: 14px; color: var(--muted); }
.history { list-style: none; margin-top: 8px; }
.history li { display: flex; justify-content: space-between; padding: 10px 0; font-size: 14px; border-bottom: 1px solid var(--line); }
.history li:last-child { border-bottom: none; }
.score { text-align: center; }
.score-value { font-family: var(--serif); font-size: 64px; font-weight: 700; line-height: 1.1; margin: 6px 0; }
.score-value small { font-size: 28px; color: var(--muted); }
.learned { list-style: none; margin-top: 6px; }
.learned li { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.learned li:last-child { border-bottom: none; }
.learned li > span { font-weight: 700; }
.learned li.ok > span { color: var(--ok); }
.learned li.ko > span { color: var(--ko); }
.learned b { display: block; font-size: 14px; font-weight: 600; line-height: 1.35; }
.learned small { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); }

/* ---------- Profil et compte ---------- */
.profile-head { display: flex; align-items: center; gap: 14px; }
.profile-head h1 { font-family: var(--serif); font-size: 24px; }
.big-avatar {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border-radius: 50%;
}
.big-avatar svg { width: 30px; height: 30px; }
.avatar, .big-avatar { overflow: hidden; }
.avatar svg.avatar-art, .big-avatar svg.avatar-art { width: 100%; height: 100%; display: block; }

/* ---------- Avatar personnalisable ---------- */
.avatar-editor { display: grid; gap: 12px; }
.avatar-editor h3 { font-size: 13px; font-weight: 600; color: var(--muted); margin-top: 6px; }
.avatar-hero { width: 120px; height: 120px; margin: 0 auto; border-radius: 50%; overflow: hidden; box-shadow: 0 2px 10px var(--shadow); }
.avatar-hero svg { width: 100%; height: 100%; display: block; }
.skin-row { display: flex; gap: 10px; flex-wrap: wrap; }
.skin-pick { width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--card); box-shadow: 0 0 0 1px var(--line); }
.skin-pick.on { box-shadow: 0 0 0 3px var(--accent); }
.color-row { gap: 8px; flex-wrap: nowrap; }
.color-row .skin-pick { width: 34px; height: 34px; }
.pick-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.avatar-pick { display: grid; justify-items: center; gap: 4px; padding: 4px 0; border-radius: 12px; }
.avatar-pick small { font-size: 11px; line-height: 1.2; color: var(--muted); text-align: center; }
.pick-art { width: 52px; height: 52px; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 1px var(--line); }
.pick-art svg { width: 100%; height: 100%; display: block; }
.avatar-pick.on .pick-art { box-shadow: 0 0 0 3px var(--accent); }
.avatar-pick.on small { color: var(--ink); font-weight: 600; }
.avatar-editor .link { justify-self: center; }
.field-hint { font-size: 12px; font-weight: 400; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat { padding: 14px 16px; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 18px; }
button.stat:hover { border-color: var(--accent); }
.stat b { display: block; font-family: var(--serif); font-size: 26px; }
.stat span { font-size: 13px; color: var(--muted); }
.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.section-head h3 { font-size: 15px; font-weight: 700; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }
.form input {
  padding: 12px 14px;
  font: inherit;
  font-size: 16px;
  font-weight: 400;
  color: var(--ink);
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.form input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.form-error { font-size: 14px; color: var(--ko); }
.code { margin: 10px 0; padding: 10px 12px; font-family: "Space Mono", monospace; font-size: 14px; color: #fff; background: #1c1b29; border-radius: 10px; }

/* ---------- Premiers pas ---------- */
.onb { flex: 1; display: flex; flex-direction: column; padding: 28px 22px 24px; }
.dots { display: flex; gap: 6px; margin-bottom: 28px; }
.dots i { flex: 1; height: 6px; background: var(--line); border-radius: 3px; }
.dots i.on { background: var(--accent); }
.hero { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.logo {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  margin-bottom: 24px;
  font-size: 36px;
  background: var(--accent);
  border-radius: 22px;
  box-shadow: 0 14px 30px color-mix(in srgb, var(--accent) 35%, transparent);
}
.hero h1 { font-family: var(--serif); font-size: 46px; font-weight: 700; letter-spacing: -.02em; }
/* Logo et nom côte à côte, comme la marque : ampoule et « Smarter » en bleu nuit. */
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; color: var(--ink); }
.brand h1 { font-size: 52px; }
:root:not([data-mode="dark"]) .brand { color: var(--navy); }
.hero .lead { margin-top: 10px; font-size: 18px; line-height: 1.5; color: var(--muted); }
.hero .lead mark { color: var(--ink); }
.promises { display: grid; gap: 14px; margin-top: 32px; }
.promise { display: flex; align-items: flex-start; gap: 14px; }
.promise .ico {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.promise b { display: block; font-size: 15px; }
.promise span { font-size: 14px; color: var(--muted); }
.onb h2 { font-family: var(--serif); font-size: 30px; font-weight: 700; letter-spacing: -.01em; }
.onb .sub { margin: 8px 0 22px; font-size: 15px; color: var(--muted); }
.interest-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.interest {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 16px;
  text-align: left;
  font-size: 15px;
  font-weight: 600;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 18px;
}
.interest .emo { font-size: 28px; }
.interest.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 10%, var(--card)); }
.interest.on::after {
  content: "✓";
  position: absolute;
  top: 12px;
  right: 12px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  font-size: 12px;
  color: #fff;
  background: var(--c);
  border-radius: 50%;
}
.level-list { display: grid; gap: 10px; }
.level {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  text-align: left;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 18px;
}
.level.on { border-color: var(--accent); background: var(--accent-soft); }
.level .emo { font-size: 28px; }
.level b { display: block; font-size: 16px; }
.level span { font-size: 14px; color: var(--muted); }
.onb-footer { display: flex; gap: 10px; margin-top: auto; padding-top: 24px; }
.onb-footer.column { flex-direction: column; gap: 4px; }
.onb-footer:not(.column) .btn.ghost { width: auto; }

/* ---------- Divers ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 110px;
  z-index: 50;
  max-width: calc(100vw - 32px);
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  color: var(--bg);
  background: var(--ink);
  border-radius: 999px;
  animation: toast 2.6s forwards;
}
@keyframes toast {
  0%       { opacity: 0; transform: translate(-50%, 10px); }
  10%, 85% { opacity: 1; transform: translate(-50%, 0); }
  100%     { opacity: 0; transform: translate(-50%, 0); }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(4px); }
}

/* Niveau de difficulté affiché sur la question */
.q-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.level-badge { font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.level-badge span { color: var(--accent-text); letter-spacing: 1px; }

/* ---------- Social : messagerie, amis, stories, groupes ---------- */
.pav {
  width: var(--s); height: var(--s); flex-shrink: 0; display: grid; place-items: center; overflow: hidden;
  font-weight: 700; font-size: calc(var(--s) * .42); color: #fff; background: var(--accent); border-radius: 50%;
}
.pav svg { width: 100%; height: 100%; display: block; }
.pav-group { position: relative; width: 46px; height: 46px; flex-shrink: 0; }
.pav-group .pav { position: absolute; border: 2px solid var(--bg); }
.pav-group .pav:first-child { top: 0; left: 0; }
.pav-group .pav:nth-child(2) { bottom: 0; right: 0; }

.story-rail { display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px 6px; scrollbar-width: none; }
.story-rail::-webkit-scrollbar { display: none; }
.story-bubble { display: grid; justify-items: center; gap: 4px; width: 64px; flex-shrink: 0; }
.story-bubble small { max-width: 64px; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.story-ring { position: relative; padding: 3px; border-radius: 50%; background: conic-gradient(var(--accent), #ec4899, #f59e0b, var(--accent)); }
.story-ring .pav { border: 2px solid var(--bg); }
.story-bubble.seen .story-ring, .story-bubble.add .story-ring { background: var(--line); }
.story-bubble.me { position: relative; }
.story-open { display: grid; }
.story-bubble.me .story-plus { top: 42px; right: 0; font-size: 15px; line-height: 1; }
.story-pager { margin-left: auto; display: flex; align-items: center; gap: 2px; color: var(--muted); }
.story-pager .hicon { font-size: 22px; }
.story-pager .hicon:disabled { opacity: .3; }
.story-new { justify-self: start; }
.story-plus {
  position: absolute; right: -1px; bottom: -1px; width: 22px; height: 22px; display: grid; place-items: center;
  font-weight: 700; color: #fff; background: var(--accent); border: 2px solid var(--bg); border-radius: 50%;
}

.social-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pill-btn { position: relative; padding: 9px 14px; font-size: 14px; font-weight: 600; background: var(--card); border: 1px solid var(--line); border-radius: 999px; }
.pill-btn:hover { border-color: var(--accent); }
.pill-btn .badge { top: -6px; right: -6px; }
.badge.static { position: static; border: none; }

.conv-list, .person-list, .pick-list, .my-questions, .achievements, .awards { list-style: none; display: grid; gap: 8px; }
.conv-row { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 18px; }
.conv-row:hover { border-color: var(--accent); }
.conv-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.conv-main b { font-size: 15px; }
.conv-preview { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-row.unread .conv-preview { color: var(--ink); font-weight: 600; }
.conv-side { display: grid; justify-items: end; gap: 4px; font-size: 12px; color: var(--muted); }
.conv-flame { font-size: 13px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.conv-flame.warn { color: var(--warn-ink); }
.conv-flame.lost { color: var(--muted); font-weight: 500; }
.empty-social { display: grid; gap: 10px; text-align: center; }
.empty-social .big { font-size: 38px; }

.person-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
.person-name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-actions { display: flex; gap: 6px; }
.btn.small { width: auto; padding: 8px 12px; font-size: 13px; border-radius: 10px; }
.code-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 0; }
.friend-code { font-family: "Space Mono", monospace; font-size: 22px; letter-spacing: .04em; }
.link.danger { color: var(--ko); justify-self: center; }

.achievements li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
.ach-emoji { font-size: 26px; }
.achievements b { display: block; font-size: 15px; }
.achievements small { font-size: 12px; color: var(--muted); }

/* Conversation */
.streak-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; font-size: 13px; color: var(--muted); background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.streak-lost { display: grid; gap: 10px; padding: 14px; background: var(--warn-bg); color: var(--warn-ink); border-radius: 16px; }
.streak-lost .btn { justify-self: start; }
.thread { display: flex; flex-direction: column; gap: 10px; }
.msg { display: grid; justify-items: start; gap: 2px; max-width: 82%; }
.msg.mine { align-self: flex-end; justify-items: end; }
.bubble { padding: 10px 14px; font-size: 15px; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--card); border: 1px solid var(--line); border-radius: 18px 18px 18px 6px; }
.msg.mine .bubble { color: #fff; background: var(--accent); border-color: var(--accent); border-radius: 18px 18px 6px 18px; }
.msg-time, .msg-from { font-size: 11px; color: var(--muted); padding: 0 6px; }
.msg-system { align-self: center; max-width: 90%; padding: 6px 12px; font-size: 13px; line-height: 1.4; text-align: center; color: var(--muted); background: var(--seg); border-radius: 12px; }
.msg-question { display: grid; gap: 10px; padding: 14px; background: var(--card); border: 1.5px solid var(--accent-soft); border-radius: 18px; }
.msg-question h3 { font-family: var(--serif); font-size: 18px; font-weight: 500; line-height: 1.3; }
.msg-q-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.msg-expl summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--accent-text); }
.msg-expl p { margin-top: 6px; font-size: 14px; line-height: 1.5; }
.composer {
  position: sticky; bottom: 70px; display: flex; align-items: center; gap: 6px; padding: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 4px 16px var(--shadow);
}
.composer input { flex: 1; min-width: 0; padding: 10px; font: inherit; font-size: 16px; color: var(--ink); background: none; border: none; }
.composer input:focus { outline: none; }
.quota { font-size: 12px; color: var(--muted); text-align: center; }
.group-info summary { cursor: pointer; font-weight: 600; }
.group-info .person-list { margin: 10px 0; }


/* Partage */
.pick-row { width: 100%; display: flex; align-items: center; gap: 10px; padding: 12px 14px; font-size: 14px; line-height: 1.35; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.pick-row:hover, .pick-row.on { border-color: var(--accent); }
.checkbox { width: 22px; height: 22px; flex-shrink: 0; display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #fff; border: 1.5px solid var(--line); border-radius: 7px; }
.pick-row.on .checkbox { background: var(--accent); border-color: var(--accent); }
.share-q { font-family: var(--serif); font-size: 18px; line-height: 1.3; margin-top: 4px; }

/* Story */
.story-head { display: flex; align-items: center; gap: 10px; }
.story-head small { display: block; font-size: 12px; color: var(--muted); }
.story-card { background: linear-gradient(160deg, var(--accent-soft), var(--card)); }
.story-results { display: grid; gap: 8px; }
.result-row { position: relative; display: flex; justify-content: space-between; gap: 10px; padding: 13px 16px; overflow: hidden; font-weight: 500; background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; }
.result-fill { position: absolute; inset: 0 auto 0 0; background: var(--seg); }
.result-row.correct { border-color: var(--ok); }
.result-row.correct .result-fill { background: var(--ok-bg); }
.result-row.wrong { border-color: var(--ko); }
.result-row.wrong .result-fill { background: var(--ko-bg); }
.result-label, .result-row b { position: relative; }
.result-row b { white-space: nowrap; }
.story-expl { margin-top: 4px; }

/* Créer une question */
.form textarea {
  padding: 12px 14px; font: inherit; font-size: 16px; font-weight: 400; color: var(--ink); resize: vertical;
  background: var(--card-2); border: 1px solid var(--line); border-radius: 12px;
}
.form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.cq-choices { display: grid; gap: 8px; border: none; }
.cq-choices legend { margin-bottom: 6px; font-size: 14px; font-weight: 600; }
.cq-choice { display: flex; align-items: center; gap: 8px; }
.cq-choice input { flex: 1; min-width: 0; }
.cq-good { width: 36px; height: 36px; flex-shrink: 0; display: grid; place-items: center; font-weight: 700; color: var(--muted); background: var(--card-2); border: 1.5px solid var(--line); border-radius: 10px; }
.cq-choice.on .cq-good { color: #fff; background: var(--ok); border-color: var(--ok); }
.cq-status { font-size: 13px; font-weight: 700; }
.cq-status.approved { color: var(--ok); }
.cq-status.rejected { color: var(--ko); }
.cq-status.unchecked { color: var(--warn-ink); }
.my-questions .card { display: grid; gap: 6px; }

/* Bilan du mois */
.month-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 17px; }
.month-nav b::first-letter { text-transform: uppercase; }
.month-nav .hicon { font-size: 24px; }
.month-nav .hicon:disabled { opacity: .3; }
.kpis.wrap, .monthly .kpis { grid-template-columns: repeat(3, 1fr); }
.compare { list-style: none; display: grid; gap: 8px; margin: 10px 0; font-size: 15px; }
.group-awards { display: grid; gap: 12px; }
.group-awards h3 { font-size: 17px; }
.awards li { display: flex; gap: 10px; align-items: flex-start; }
.awards b { display: block; margin-bottom: 4px; }
.award { display: block; margin-top: 4px; padding: 6px 10px; font-size: 14px; font-weight: 600; background: var(--accent-soft); border-radius: 10px; }
.award small { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
.award.nominee { background: var(--seg); }
.ranking { list-style: none; display: grid; gap: 6px; margin-top: 8px; }
.ranking li { display: flex; justify-content: space-between; font-size: 14px; }
.group-awards summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--accent-text); }

/* Bilans partagés (message ou story) */
.msg.wide { max-width: 100%; width: 100%; justify-items: stretch; }
.msg.mine.wide { justify-items: stretch; }
.report-card { display: grid; gap: 10px; padding: 14px; background: linear-gradient(160deg, var(--accent-soft), var(--card)); border: 1px solid var(--line); border-radius: 18px; }
.report-title { font-weight: 700; font-size: 15px; }
.report-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.report-stats span { display: grid; gap: 2px; padding: 8px 4px; font-size: 11px; line-height: 1.2; text-align: center; color: var(--muted); background: var(--card); border-radius: 12px; }
.report-stats b { font-family: var(--serif); font-size: 18px; color: var(--ink); }
.report-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.report-chips .award { margin: 0; font-size: 13px; }
.report-awards { list-style: none; display: grid; gap: 8px; }
.report-awards li { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 1.4; }
.report-awards b { display: block; font-size: 14px; }
.report-awards i { display: block; font-style: normal; color: var(--muted); }

/* Paliers des succès */
.tier-tag { margin-left: 4px; padding: 2px 7px; font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; vertical-align: 2px; border-radius: 999px; }
.tier-tag.t1 { color: #7c4a1e; background: #f3dcc4; }
.tier-tag.t2 { color: #475569; background: #e2e8f0; }
.tier-tag.t3 { color: #854d0e; background: #fde68a; }
.tier-tag.t4 { color: #0e7490; background: #cffafe; }
.tier-tag.t5 { color: #6d28d9; background: #ede9fe; }
.achievements li.t3 { border-color: #f5d76e; }
.achievements li.t4 { border-color: #67e8f9; }
.achievements li.t5 { border-color: #c4b5fd; background: linear-gradient(135deg, var(--card), color-mix(in srgb, #8b5cf6 8%, var(--card))); }
.achievements li.locked { opacity: .5; border-style: dashed; background: none; }
.tier-section .section-title small { font-family: var(--sans); font-size: 14px; font-weight: 500; color: var(--muted); }
.ach-summary { display: grid; gap: 10px; }
.ach-count { font-size: 15px; }
.ach-count b { font-family: var(--serif); font-size: 28px; }

/* Avis */
.form-label { font-size: 14px; font-weight: 600; }
.stars-input { display: flex; gap: 4px; margin-top: -6px; }
.stars-input .star { font-size: 34px; }
.form .tags .chip { --c: var(--muted); border: 1.5px solid transparent; }
.form .tags .chip.on { --c: var(--accent); border-color: var(--accent); }
.form textarea + .muted, .form .muted { margin-top: -4px; }

/* « Voir plus » : approfondissement d'une question */
.deep-toggle { font-weight: 600; }
.deep { display: grid; gap: 12px; }
.deep h4 { margin-top: 6px; font-family: var(--serif); font-size: 17px; font-weight: 600; }
.deep-text { display: grid; gap: 10px; }
.deep-text p { font-size: 15px; line-height: 1.6; }
.deep-player { display: grid; gap: 6px; }
.deep-player video { width: 100%; max-height: 260px; background: #000; border-radius: 12px; }
.deep-player audio { width: 100%; }
.deep figcaption { font-size: 12px; line-height: 1.4; color: var(--muted); }
.deep-gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.deep-gallery figure { display: grid; gap: 4px; align-content: start; }
.deep-gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--card-2); border-radius: 10px; }
.deep-related { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.deep-related summary { display: flex; align-items: center; gap: 12px; padding: 10px; cursor: pointer; list-style: none; }
.deep-related summary::-webkit-details-marker { display: none; }
.deep-related summary img, .deep-noimg { width: 56px; height: 56px; flex-shrink: 0; display: grid; place-items: center; object-fit: cover; font-size: 24px; background: var(--card-2); border-radius: 10px; }
.deep-related summary b { display: block; font-size: 15px; }
.deep-related summary small { display: block; font-size: 12px; color: var(--muted); line-height: 1.35; }
.deep-related p { padding: 0 12px 12px; font-size: 14px; line-height: 1.55; }
.deep-source { font-size: 11px; line-height: 1.5; color: var(--muted); }
.deep-source a { color: var(--accent-text); }
.deep-less { justify-self: center; }

/* Parcours d'arrivée : compte, préférences et amis */
.onb .segmented { margin-top: 18px; }
.onb-form { margin-top: 16px; }
.onb-card { margin-top: 16px; display: grid; gap: 12px; }
.onb .opt-group { margin-top: 14px; }
.onb-skip { align-self: center; margin-top: 12px; color: var(--muted); }

/* ---------- Partage et invitations (invite.js) ---------- */
.code-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-top: 4px; font-size: 14px; color: var(--muted); }
.code-line .friend-code { font-size: 15px; color: var(--ink); }
.code-line .link { font-size: 14px; }
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgb(0 0 0 / .35);
  animation: sheet-fade .2s;
}
.sheet {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 22px 16px calc(16px + env(safe-area-inset-bottom));
  color: var(--ink);
  background: var(--bg);
  border-radius: 22px 22px 0 0;
  animation: sheet-up .25s ease-out;
}
.sheet h2 { font-family: var(--serif); font-size: 22px; text-align: center; }
.sheet > .muted { text-align: center; }
.sheet-person { display: flex; justify-content: center; }
.share-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 6px 0; }
.share-app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 2px;
  font: inherit;
  font-size: 12px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.share-app span { font-size: 24px; }
.share-link { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.share-link input { flex: 1; min-width: 0; padding: 0; font: inherit; font-size: 14px; color: var(--ink); background: none; border: 0; outline: none; text-overflow: ellipsis; -webkit-user-select: text; user-select: text; }
.invite-banner { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
.invite-who { display: flex; align-items: center; gap: 12px; }
.install-steps { display: flex; flex-direction: column; gap: 6px; margin: 0; padding-left: 20px; font-size: 14px; }
.install-steps b { color: var(--ink); }
.share-ico { display: inline-block; padding: 0 4px; color: var(--accent); font-weight: 700; }
.invite-who > div > b { display: block; }
.invite-who > div > span { font-size: 14px; color: var(--muted); }
@keyframes sheet-fade { from { opacity: 0; } }
@keyframes sheet-up { from { transform: translateY(40px); } }

/* Choix de la voix (Apparence) */
.voice-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.voice { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; font: inherit; text-align: left; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.voice span { font-size: 12px; color: var(--muted); }
.voice.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }

/* Navigation : remonter en haut, glisser d'une page à l'autre */
.to-top {
  position: absolute;
  right: 16px;
  bottom: calc(100% + 4px);
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  font-size: 19px;
  font-weight: 700;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 50%;
  box-shadow: 0 4px 14px var(--shadow);
  transition: opacity .2s, transform .2s;
}
.to-top.hidden { opacity: 0; transform: translateY(8px); pointer-events: none; }
.email-fix { display: flex; flex-wrap: wrap; gap: 8px; margin-top: -4px; }
.email-fix .btn { width: auto; }

/* Série : récompenses à venir, les grands jours en jaune */
.tier h3 { display: flex; align-items: baseline; gap: 8px; }
.tier h3 small { font-size: 12px; font-weight: 500; color: var(--muted); }
.tier.big-day .tier-dot { color: var(--navy); background: var(--butter); border-color: var(--butter); }
.tier .opts { margin-top: 8px; }
.tier .opt { width: 40px; height: 40px; }
.tier .swatch { width: 28px; height: 28px; }
.tier .opt { padding: 0; }

/* Glissement entre deux pages : la page de destination attend dessous, légèrement décalée et ombrée. */
.app.swiping { position: relative; z-index: 2; box-shadow: 0 0 34px rgba(13, 20, 45, .22); }
.swipe-under {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
  margin: 0 auto;
}
.swipe-under-page { min-height: 100vh; display: flex; flex-direction: column; }
.swipe-under .glass-top { position: relative; z-index: 2; }
.swipe-under .glass-bottom { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; }
.swipe-shade { position: absolute; inset: 0; background: #0b1020; opacity: .18; }

/* « Pourquoi c'est intéressant » : un encart jaune ampoule, sous l'explication */
.why {
  margin: 0 0 16px;
  padding: 12px 14px;
  background: color-mix(in srgb, var(--butter) 26%, var(--card));
  border-left: 4px solid var(--butter);
  border-radius: 4px 14px 14px 4px;
}
.why-title { display: block; margin-bottom: 4px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: color-mix(in srgb, var(--navy) 80%, var(--butter)); }
:root[data-mode="dark"] .why { background: color-mix(in srgb, var(--butter) 12%, var(--card)); }
:root[data-mode="dark"] .why-title { color: var(--butter); }
.why p { font-size: 15px; line-height: 1.5; }

/* Plusieurs images : elles prennent toute la largeur et défilent sur le côté */
.learn-grid.wide { grid-template-columns: 1fr; }
.gallery { margin: 0 -2px; }
.gallery-track { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.gallery-track::-webkit-scrollbar { display: none; }
.gallery .slide { flex: 0 0 88%; aspect-ratio: 4 / 3; scroll-snap-align: start; }

/* Raccourcis « J'aime » / « Enregistrer » : angle droit sous le message de réponse, collés sous l'en-tête au défilement.
   Hauteur nulle (et marge négative = l'écart de .page) : la pastille flotte au-dessus de la carte sans rien décaler. */
.quick-react {
  position: sticky;
  top: var(--qr-top, 70px);
  z-index: 9;
  align-self: flex-end;
  height: 0;
  margin: 0 8px -14px 0;
  display: flex;
  gap: 8px;
}
.quick-react .qr {
  width: 40px;
  height: 40px;
  margin-top: 10px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--ink);
  background: var(--glass);
  border: 1px solid var(--line);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
  backdrop-filter: blur(12px) saturate(1.3);
  -webkit-backdrop-filter: blur(12px) saturate(1.3);
  transition: transform .12s;
}
.quick-react .qr:active { transform: scale(.9); }
.quick-react .qr svg { width: 20px; height: 20px; }
.quick-react .qr.on { color: var(--accent-text); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, var(--card)); }
.quick-react .qr.on svg { fill: currentColor; }
/* Le titre de l'explication laisse la place aux deux pastilles. */
.quick-react + .learn > .label, .quick-react + .learn > h2 { padding-right: 96px; }

/* Invitation à partager / ajouter des amis (première découverte, nouvel ami). */
.nudge { display: flex; flex-direction: column; gap: 10px; text-align: center; border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.nudge-icon { font-size: 30px; line-height: 1; }
.nudge h3 { font-family: var(--serif); font-size: 21px; }
.nudge > p { font-size: 15px; line-height: 1.45; color: var(--muted); }
.nudge-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.perks { display: grid; gap: 6px; margin: 2px 0; padding: 0; list-style: none; text-align: left; }
.perks li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; font-size: 14px; background: var(--card-2); border-radius: 12px; }
.perks li span { font-size: 18px; }

/* Accueil : la promesse « Défie tes amis » est un bouton qui mène à la création de compte. */
.promise-cta { padding: 12px; margin: 0 -12px; width: calc(100% + 24px); font: inherit; color: inherit; text-align: left; background: var(--card); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); border-radius: 16px; }
.promise-cta .promise-link { display: inline-block; margin-top: 6px; font-size: 14px; font-style: normal; font-weight: 600; color: var(--accent-text); }

/* Voix naturelle en préparation (première écoute : le serveur fabrique le fichier audio). */
.player.loading .player-track span { width: 30% !important; animation: player-wait 1.2s ease-in-out infinite alternate; }
@keyframes player-wait { from { margin-left: 0; } to { margin-left: 70%; } }

/* Suppression du compte */
.delete-link { margin-top: 4px; font-size: 14px; }
.delete-card { display: flex; flex-direction: column; gap: 8px; }
.delete-icon { font-size: 28px; line-height: 1; }
.delete-list { margin: 0; padding-left: 20px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.btn.danger-fill { color: #fff; background: var(--ko); border-color: var(--ko); }
.btn.danger-fill:disabled { opacity: .45; }

/* Signaler / bloquer */
.msg-more { margin-left: 6px; padding: 0 6px; font-size: 14px; line-height: 1; color: var(--muted); background: none; border: 0; }
.msg-question { position: relative; }
.msg-question > .msg-more { position: absolute; top: 8px; right: 8px; }
.profile-safety { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; }
.story-report { display: block; margin: 8px auto 0; font-size: 13px; }
.sheet-textarea { width: 100%; min-height: 64px; padding: 10px 12px; font: inherit; font-size: 14px; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 12px; resize: vertical; }
.report-reason { justify-content: flex-start; text-align: left; }
.btn.outline.danger { color: var(--ko); }

/* Proposition d'activer les notifications (Messagerie) */
.notif-card { display: grid; gap: 8px; border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.notif-actions { display: flex; gap: 8px; align-items: center; }

/* Proposition d'installer l'app sur l'écran d'accueil (écran d'accueil simulé) */
.install-card { display: grid; gap: 8px; width: 100%; max-width: 340px; text-align: left; color: var(--ink); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.phone-tools .install-card p { max-width: none; font-size: 14px; opacity: 1; }
.phone-tools .install-card p.muted { font-size: 13px; }
.install-card .btn.ghost { justify-self: start; }

/* Droits d'image : auteur et licence sous les images de « Voir plus » */
.deep figcaption .credit { display: block; font-size: 10px; opacity: .75; }

/* Liens vers la page Confidentialité / conditions / crédits (bas du profil) */
.legal-links { margin: 4px 0 8px; text-align: center; font-size: 12px; color: var(--muted); }
.legal-links a { color: inherit; }

/* Texte d'accueil lu par les moteurs de recherche, visible le temps que l'app se charge (écran de chargement). */
.seo-intro { display: grid; place-content: center; gap: 10px; min-height: 100vh; padding: 24px; text-align: center; color: var(--ink); }
.seo-intro h1 { font-family: Fraunces, Georgia, serif; font-size: 40px; }
.seo-intro .seo-tag { font-weight: 600; }
.seo-intro p:last-child { max-width: 420px; margin: 0 auto; font-size: 13px; color: var(--muted); }

/* Répondre à une story (réactions + message) et rappel de la story dans la conversation */
.story-reply { display: grid; gap: 10px; margin-top: 14px; }
.story-reactions { display: flex; justify-content: center; gap: 10px; }
.story-reaction { width: 46px; height: 46px; font-size: 24px; line-height: 1; border-radius: 50%; border: 1px solid var(--line); background: var(--card); cursor: pointer; transition: transform .15s; }
.story-reaction:active { transform: scale(1.25); }
.story-reply .composer { position: static; margin: 0; }
.msg-story { display: grid; gap: 2px; max-width: 260px; margin-bottom: 4px; padding: 6px 10px; text-align: left; font: inherit; font-size: 11px; color: var(--muted); background: transparent; border: 0; border-left: 3px solid var(--accent); cursor: pointer; }
.msg.mine .msg-story { justify-self: end; text-align: right; border-left: 0; border-right: 3px solid var(--accent); }
.msg-story span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 12px; color: var(--ink); opacity: .8; }
.story-article { display: grid; gap: 14px; margin-top: 4px; }
