/* ==========================================================================
   Runnapp — design system
   Verre dépoli clair façon iOS 26, typographie éditoriale (serif) + grotesque.
   Pour utiliser tes propres polices (ID Grotesk, Moara...) : dépose les fichiers
   dans /assets/fonts, déclare-les avec @font-face et change --font-ui / --font-display.
   ========================================================================== */

:root {
  --font-display: "Instrument Serif", "Times New Roman", Times, serif;
  --font-ui: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --bg: #F3F1EE;
  --ink: #1C1917;
  --ink-2: #44403C;
  --muted: #78716C;
  --faint: #A8A29E;
  --line: rgba(28, 25, 23, 0.08);

  --accent: #FF5A1F;
  --accent-2: #FF8A4C;
  --accent-soft: #FFF1EA;
  --accent-ink: #C2410C;

  --glass: rgba(255, 255, 255, 0.58);
  --glass-strong: rgba(255, 255, 255, 0.78);
  --glass-border: rgba(255, 255, 255, 0.85);
  --glass-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 10px 30px -12px rgba(41, 37, 36, 0.18), 0 2px 6px -2px rgba(41, 37, 36, 0.06);
  --blur: saturate(180%) blur(22px);

  --green: #16A34A;   --green-bg: #DCFCE7;
  --red: #E11D48;     --red-bg: #FFE4E6;
  --orange: #EA580C;  --orange-bg: #FFEDD5;
  --yellow: #CA8A04;  --yellow-bg: #FEF9C3;
  --violet: #7C3AED;  --violet-bg: #EDE9FE;
  --indigo: #4F46E5;  --indigo-bg: #E0E7FF;
  --teal: #0D9488;    --teal-bg: #CCFBF1;
  --grey: #78716C;    --grey-bg: #F0EEEC;

  --r-sm: 14px;
  --r: 22px;
  --r-lg: 30px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tabbar-h: 74px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.4, .64, 1);

  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  min-height: 100dvh;
  overflow-x: hidden;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; }
.num { font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }

/* ---------- Fond : taches de couleur floues sous le verre ---------- */
.backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; background: var(--bg); }
.backdrop i {
  position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55;
  animation: drift 28s ease-in-out infinite alternate;
}
.backdrop i:nth-child(1) { width: 60vmax; height: 60vmax; left: -20vmax; top: -22vmax; background: radial-gradient(circle, #FFB08A, transparent 65%); }
.backdrop i:nth-child(2) { width: 55vmax; height: 55vmax; right: -25vmax; top: 18vh; background: radial-gradient(circle, #C9B8FF, transparent 65%); animation-delay: -9s; }
.backdrop i:nth-child(3) { width: 50vmax; height: 50vmax; left: -10vmax; bottom: -25vmax; background: radial-gradient(circle, #A7F3D0, transparent 65%); animation-delay: -18s; opacity: .45; }
@keyframes drift { to { transform: translate3d(6vmax, 4vmax, 0) scale(1.08); } }

/* ---------- Icônes ---------- */
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic.sm { width: 16px; height: 16px; }
.ic.lg { width: 26px; height: 26px; }
.ic.xl { width: 34px; height: 34px; stroke-width: 1.6; }

/* ---------- Structure ---------- */
#app { min-height: 100dvh; }
.view {
  max-width: 640px; margin: 0 auto;
  padding: calc(var(--safe-top) + 18px) 16px calc(var(--tabbar-h) + var(--safe-bottom) + 34px);
  animation: viewIn .5s var(--ease) both;
}
.view.bare { padding-bottom: calc(var(--safe-bottom) + 28px); }
@keyframes viewIn { from { opacity: 0; transform: translateY(14px); } }
.stagger > * { animation: rise .6s var(--ease) both; }
.stagger > *:nth-child(2) { animation-delay: .05s; }
.stagger > *:nth-child(3) { animation-delay: .1s; }
.stagger > *:nth-child(4) { animation-delay: .15s; }
.stagger > *:nth-child(5) { animation-delay: .2s; }
.stagger > *:nth-child(6) { animation-delay: .25s; }
.stagger > *:nth-child(n+7) { animation-delay: .3s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(.985); } }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; min-height: 44px; }
.topbar .left, .topbar .right { display: flex; align-items: center; gap: 8px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.h-display {
  font-family: var(--font-display); font-weight: 400; font-size: clamp(38px, 10vw, 52px);
  line-height: .98; letter-spacing: -0.02em; margin: 6px 0 18px;
}
.h-display em { font-style: italic; color: var(--accent); }
.h2 { font-family: var(--font-display); font-weight: 400; font-size: 28px; line-height: 1.05; letter-spacing: -0.01em; margin: 0; }
.h3 { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 11.5px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 28px 4px 12px; }
.section-title h2 { font-family: var(--font-display); font-weight: 400; font-size: 26px; margin: 0; letter-spacing: -0.01em; }
.section-title a, .section-title button { font-size: 14px; font-weight: 600; color: var(--accent-ink); }
.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.gap-s { gap: 8px; }
.mt { margin-top: 16px; }
.mt-s { margin-top: 8px; }
.mt-l { margin-top: 26px; }
.center { text-align: center; }
.hidden { display: none !important; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Verre ---------- */
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: var(--r);
}
.card { padding: 18px; position: relative; }
.card + .card { margin-top: 12px; }
.card.tap { transition: transform .25s var(--ease), box-shadow .25s var(--ease); cursor: pointer; }
.card.tap:active { transform: scale(.98); }
.list { display: flex; flex-direction: column; gap: 10px; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 52px; padding: 0 22px; border-radius: 999px; font-weight: 650; font-size: 16px;
  transition: transform .2s var(--ease), background .2s, opacity .2s; white-space: nowrap;
}
.btn:active { transform: scale(.96); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.primary { background: var(--ink); color: #fff; box-shadow: 0 10px 24px -10px rgba(28, 25, 23, .55); }
.btn.accent { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; box-shadow: 0 12px 26px -10px rgba(255, 90, 31, .7); }
.btn.ghost { background: var(--glass-strong); border: 1px solid var(--glass-border); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: var(--glass-shadow); }
.btn.danger { background: var(--red-bg); color: var(--red); }
.btn.block { width: 100%; }
.btn.sm { height: 40px; padding: 0 16px; font-size: 14px; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; position: relative;
  background: var(--glass-strong); border: 1px solid var(--glass-border); box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); transition: transform .2s var(--ease);
}
.icon-btn:active { transform: scale(.92); }
.icon-btn .dot { position: absolute; top: 9px; right: 10px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; }
.link { color: var(--accent-ink); font-weight: 600; }

/* ---------- Barre d'onglets flottante ---------- */
.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 40;
  bottom: calc(var(--safe-bottom) + 12px);
  width: min(560px, calc(100% - 24px)); height: 64px; padding: 6px;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .62);
  -webkit-backdrop-filter: saturate(200%) blur(26px); backdrop-filter: saturate(200%) blur(26px);
  border: 1px solid rgba(255, 255, 255, .9);
  box-shadow: 0 1px 0 #fff inset, 0 18px 40px -14px rgba(41, 37, 36, .35);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border-radius: 999px; color: var(--muted); font-size: 10.5px; font-weight: 600; letter-spacing: .01em;
  transition: color .25s, background .35s var(--ease);
}
.tabbar a .ic { width: 22px; height: 22px; }
.tabbar a.on { color: var(--accent-ink); background: rgba(255, 90, 31, .1); }

/* ---------- Formulaires ---------- */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field > label, .label { font-size: 13px; font-weight: 650; color: var(--ink-2); letter-spacing: .01em; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: -2px; }
.input, select.input, textarea.input {
  width: 100%; height: 52px; padding: 0 16px; border-radius: 16px; outline: none;
  background: rgba(255, 255, 255, .72); border: 1px solid rgba(28, 25, 23, .08);
  transition: border-color .2s, box-shadow .2s, background .2s; font-size: 16px; -webkit-appearance: none; appearance: none;
}
textarea.input { height: auto; min-height: 96px; padding: 14px 16px; resize: vertical; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(255, 90, 31, .14); background: #fff; }
.input-suffix { position: relative; }
.input-suffix span { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14px; pointer-events: none; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 15px; border-radius: 999px;
  background: rgba(255, 255, 255, .7); border: 1px solid rgba(28, 25, 23, .08); font-size: 14.5px; font-weight: 550;
  transition: all .2s var(--ease);
}
.chip:active { transform: scale(.95); }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip.on .ic { color: var(--accent-2); }

.choice {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 16px;
  border-radius: 20px; background: rgba(255, 255, 255, .66); border: 1.5px solid rgba(255, 255, 255, .9);
  box-shadow: var(--glass-shadow); transition: all .25s var(--ease);
}
.choice + .choice { margin-top: 10px; }
.choice .ico { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; background: var(--grey-bg); color: var(--ink-2); flex: none; transition: all .25s; }
.choice .t { font-weight: 700; font-size: 16px; }
.choice .d { font-size: 13.5px; color: var(--muted); margin-top: 2px; line-height: 1.35; }
.choice.on { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 4px rgba(255, 90, 31, .12), var(--glass-shadow); }
.choice.on .ico { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }
.choice .check { margin-left: auto; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid rgba(28, 25, 23, .15); display: grid; place-items: center; flex: none; color: transparent; }
.choice.on .check { background: var(--accent); border-color: var(--accent); color: #fff; }
.choices-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choices-grid .choice { flex-direction: column; align-items: flex-start; margin: 0; }
.choices-grid .choice .check { position: absolute; top: 12px; right: 12px; }
.choices-grid .choice { position: relative; }

.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 4px; border-radius: 16px; background: rgba(28, 25, 23, .06); gap: 2px; }
.segmented button { height: 42px; border-radius: 12px; font-weight: 600; font-size: 14.5px; color: var(--ink-2); transition: all .25s var(--ease); }
.segmented button.on { background: #fff; color: var(--ink); box-shadow: 0 2px 8px -2px rgba(28, 25, 23, .18); }

.stepper { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px; border-radius: 18px; background: rgba(255, 255, 255, .72); border: 1px solid rgba(28, 25, 23, .08); }
.stepper button { width: 44px; height: 44px; border-radius: 13px; background: var(--grey-bg); display: grid; place-items: center; }
.stepper .v { font-size: 26px; font-weight: 700; }

.range { width: 100%; -webkit-appearance: none; appearance: none; height: 6px; border-radius: 99px; background: linear-gradient(90deg, var(--accent) var(--p, 50%), rgba(28, 25, 23, .1) var(--p, 50%)); outline: none; }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; border-radius: 50%; background: #fff; box-shadow: 0 2px 10px rgba(28, 25, 23, .25), 0 0 0 1px rgba(28, 25, 23, .05); }
.range::-moz-range-thumb { width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 2px 10px rgba(28, 25, 23, .25); }
.range-value { font-size: 34px; font-weight: 700; letter-spacing: -0.03em; }
.range-value small { font-size: 16px; color: var(--muted); font-weight: 600; margin-left: 4px; }

.switch { position: relative; width: 52px; height: 32px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: rgba(28, 25, 23, .14); transition: background .25s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); transition: transform .3s var(--spring); }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(20px); }

/* ---------- Écran d'accueil (non connecté) ---------- */
.welcome { min-height: 100dvh; display: flex; flex-direction: column; justify-content: space-between; padding: calc(var(--safe-top) + 28px) 22px calc(var(--safe-bottom) + 26px); max-width: 560px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -0.02em; font-size: 19px; }
.brand-mark { width: 36px; height: 36px; border-radius: 11px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); display: grid; place-items: center; color: #fff; box-shadow: 0 8px 18px -8px rgba(255, 90, 31, .8); }
.hero-title { font-family: var(--font-display); font-size: clamp(54px, 15vw, 84px); line-height: .92; letter-spacing: -0.03em; margin: 0; font-weight: 400; }
.hero-title em { font-style: italic; background: linear-gradient(135deg, var(--accent), #FF3D6E); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-feats { display: grid; gap: 10px; margin: 26px 0; }
.hero-feat { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; font-size: 15px; font-weight: 550; }
.hero-feat .ic { color: var(--accent); }
.hero-rings { position: relative; height: 150px; margin: 10px 0; }
.hero-rings svg { width: 100%; height: 100%; }

/* ---------- Questionnaire (étapes) ---------- */
.steps-head { position: sticky; top: 0; z-index: 20; padding: calc(var(--safe-top) + 10px) 16px 12px; max-width: 640px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.progress { flex: 1; height: 6px; border-radius: 99px; background: rgba(28, 25, 23, .08); overflow: hidden; }
.progress > div { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .6s var(--ease); }
.step { max-width: 640px; margin: 0 auto; padding: 8px 16px calc(var(--safe-bottom) + 120px); animation: stepIn .45s var(--ease) both; }
.step.back { animation-name: stepBack; }
@keyframes stepIn { from { opacity: 0; transform: translateX(28px); } }
@keyframes stepBack { from { opacity: 0; transform: translateX(-28px); } }
.step .q { font-family: var(--font-display); font-size: clamp(34px, 9vw, 44px); line-height: 1; letter-spacing: -0.02em; margin: 10px 0 8px; font-weight: 400; }
.step .q em { font-style: italic; color: var(--accent); }
.step .sub { color: var(--muted); margin: 0 0 22px; font-size: 15.5px; }
.step-foot { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 14px 16px calc(var(--safe-bottom) + 16px); background: linear-gradient(to top, var(--bg) 55%, rgba(243, 241, 238, 0)); }
.step-foot .inner { max-width: 640px; margin: 0 auto; display: flex; gap: 10px; }

/* ---------- Accueil ---------- */
.today {
  border-radius: var(--r-lg); padding: 22px; color: #fff; position: relative; overflow: hidden; isolation: isolate;
  background: linear-gradient(145deg, var(--c1, #1C1917), var(--c2, #44403C));
  box-shadow: 0 24px 48px -22px var(--cs, rgba(28, 25, 23, .6));
}
.today::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(120% 80% at 100% 0%, rgba(255, 255, 255, .28), transparent 55%); }
.today::after { content: ""; position: absolute; right: -40px; bottom: -60px; width: 220px; height: 220px; border-radius: 50%; border: 36px solid rgba(255, 255, 255, .08); z-index: -1; }
.today .kicker { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; opacity: .85; display: flex; align-items: center; gap: 8px; }
.today .title { font-family: var(--font-display); font-size: 36px; line-height: 1; margin: 12px 0 16px; letter-spacing: -0.01em; }
.today .metrics { display: flex; gap: 22px; }
.today .metric b { display: block; font-size: 24px; font-weight: 700; letter-spacing: -0.03em; }
.today .metric span { font-size: 12px; opacity: .8; }
.today .go { position: absolute; right: 18px; top: 18px; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .22); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.today .profile-svg { margin-top: 16px; opacity: .95; }

.weekstrip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; padding: 14px 10px; }
.weekstrip .d { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 650; color: var(--muted); cursor: pointer; }
.weekstrip .d .c { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; font-weight: 700; color: var(--ink); background: rgba(28, 25, 23, .05); position: relative; transition: transform .2s var(--ease); }
.weekstrip .d.is-today .c { background: var(--ink); color: #fff; }
.weekstrip .d .c.done { background: var(--green); color: #fff; }
.weekstrip .d .c.missed { background: var(--red-bg); color: var(--red); }
.weekstrip .d .pip { width: 6px; height: 6px; border-radius: 50%; }

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { padding: 14px; border-radius: 18px; }
.stat .k { font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.stat .v { font-size: 24px; font-weight: 750; letter-spacing: -0.03em; margin-top: 4px; }
.stat .v small { font-size: 13px; color: var(--muted); font-weight: 600; margin-left: 2px; letter-spacing: 0; }

.ring-wrap { display: flex; align-items: center; gap: 18px; }
.ring { width: 96px; height: 96px; flex: none; position: relative; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .lbl { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; font-weight: 750; font-size: 20px; letter-spacing: -0.03em; }
.ring .lbl small { display: block; font-size: 10.5px; color: var(--muted); font-weight: 600; letter-spacing: .02em; }
.ring circle { transition: stroke-dashoffset 1.2s var(--ease); }

.insights { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 4px 16px 8px; scrollbar-width: none; }
.insights::-webkit-scrollbar { display: none; }
.insight { flex: 0 0 82%; scroll-snap-align: start; padding: 16px; }
.insight .ico { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 10px; }
.insight p { margin: 6px 0 0; font-size: 14px; color: var(--ink-2); line-height: 1.45; }

.bars { display: flex; align-items: flex-end; gap: 6px; height: 120px; padding-top: 10px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bars .b i { display: block; width: 100%; border-radius: 8px 8px 4px 4px; background: rgba(28, 25, 23, .1); transform-origin: bottom; animation: grow .9s var(--ease) both; }
.bars .b.cur i { background: linear-gradient(to top, var(--accent), var(--accent-2)); }
.bars .b span { font-size: 10px; color: var(--muted); font-weight: 600; }
@keyframes grow { from { transform: scaleY(0); } }

/* ---------- Séances ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 99px; font-size: 12px; font-weight: 700; letter-spacing: .01em; background: var(--tb, var(--grey-bg)); color: var(--tc, var(--grey)); }
.badge .ic { width: 14px; height: 14px; }
.t-green { --tc: var(--green); --tb: var(--green-bg); --c1: #16A34A; --c2: #34D399; --cs: rgba(22, 163, 74, .55); }
.t-red { --tc: var(--red); --tb: var(--red-bg); --c1: #E11D48; --c2: #FB7185; --cs: rgba(225, 29, 72, .5); }
.t-orange { --tc: var(--orange); --tb: var(--orange-bg); --c1: #EA580C; --c2: #FB923C; --cs: rgba(234, 88, 12, .5); }
.t-yellow { --tc: var(--yellow); --tb: var(--yellow-bg); --c1: #CA8A04; --c2: #FACC15; --cs: rgba(202, 138, 4, .5); }
.t-violet { --tc: var(--violet); --tb: var(--violet-bg); --c1: #7C3AED; --c2: #A78BFA; --cs: rgba(124, 58, 237, .5); }
.t-indigo { --tc: var(--indigo); --tb: var(--indigo-bg); --c1: #4F46E5; --c2: #818CF8; --cs: rgba(79, 70, 229, .5); }
.t-teal { --tc: var(--teal); --tb: var(--teal-bg); --c1: #0D9488; --c2: #2DD4BF; --cs: rgba(13, 148, 136, .5); }
.t-grey { --tc: var(--grey); --tb: var(--grey-bg); --c1: #57534E; --c2: #A8A29E; --cs: rgba(87, 83, 78, .45); }

.sess { display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.sess .bar { width: 5px; align-self: stretch; border-radius: 99px; background: var(--tc); flex: none; }
.sess .date { width: 42px; text-align: center; flex: none; }
.sess .date b { display: block; font-size: 20px; font-weight: 750; letter-spacing: -0.03em; line-height: 1; }
.sess .date span { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.sess .info { flex: 1; min-width: 0; }
.sess .info .t { font-weight: 700; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sess .info .m { font-size: 13px; color: var(--muted); margin-top: 2px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.sess .st { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.sess .st.done { background: var(--green); color: #fff; }
.sess .st.skipped { background: var(--grey-bg); color: var(--grey); }
.sess .st.missed { background: var(--red-bg); color: var(--red); }
.sess .st.planned { color: var(--faint); }
.sess.is-today { box-shadow: 0 0 0 2px var(--accent), var(--glass-shadow); }
.sess.info-only { opacity: .75; }

.week-tabs { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 14px; padding: 4px 16px; scrollbar-width: none; scroll-snap-type: x proximity; }
.week-tabs::-webkit-scrollbar { display: none; }
.week-tabs button { flex: none; height: 40px; min-width: 54px; padding: 0 14px; border-radius: 99px; font-weight: 650; font-size: 14px; background: rgba(255, 255, 255, .6); border: 1px solid rgba(255, 255, 255, .9); scroll-snap-align: center; transition: all .25s var(--ease); position: relative; }
.week-tabs button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.week-tabs button.cur::after { content: ""; position: absolute; bottom: 5px; left: 50%; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--accent); }

.phases { display: flex; gap: 3px; height: 8px; border-radius: 99px; overflow: hidden; margin: 14px 0 8px; }
.phases i { display: block; height: 100%; }
.phase-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); }
.phase-legend span { display: inline-flex; align-items: center; gap: 6px; }
.phase-legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

.steps-list { display: flex; flex-direction: column; gap: 8px; }
.stp { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 16px; background: rgba(255, 255, 255, .7); border: 1px solid rgba(28, 25, 23, .05); }
.stp .zb { width: 6px; align-self: stretch; border-radius: 99px; flex: none; }
.stp .t { font-weight: 700; font-size: 15px; }
.stp .m { font-size: 13px; color: var(--muted); margin-top: 2px; }
.rep { border-radius: 18px; padding: 10px; background: rgba(28, 25, 23, .04); }
.rep .rh { display: flex; align-items: center; gap: 8px; font-weight: 750; font-size: 14px; margin: 2px 4px 8px; }
.rep .rh b { background: var(--ink); color: #fff; border-radius: 99px; padding: 2px 10px; font-size: 13px; }
.rep .steps-list { gap: 6px; }

.profile-svg { width: 100%; height: 64px; }

/* ---------- Feuille (bottom sheet) ---------- */
.sheet-bg { position: fixed; inset: 0; z-index: 80; background: rgba(28, 25, 23, .28); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: fade .3s both; }
.sheet {
  position: fixed; left: 50%; bottom: 0; z-index: 81; width: min(640px, 100%); max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain;
  transform: translateX(-50%); border-radius: 30px 30px 0 0; padding: 10px 18px calc(var(--safe-bottom) + 24px);
  background: rgba(250, 249, 247, .9); -webkit-backdrop-filter: saturate(180%) blur(30px); backdrop-filter: saturate(180%) blur(30px);
  border: 1px solid rgba(255, 255, 255, .95); box-shadow: 0 -20px 50px -20px rgba(28, 25, 23, .35);
  animation: sheetUp .5s var(--ease) both;
}
.sheet.closing { animation: sheetDown .3s ease-in both; }
.sheet-bg.closing { animation: fade .3s reverse both; }
.sheet .grab { width: 40px; height: 5px; border-radius: 99px; background: rgba(28, 25, 23, .18); margin: 0 auto 12px; }
.sheet .sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
@keyframes sheetUp { from { transform: translate(-50%, 100%); } }
@keyframes sheetDown { to { transform: translate(-50%, 100%); } }
@keyframes fade { from { opacity: 0; } }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; top: calc(var(--safe-top) + 12px); left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; width: min(420px, calc(100% - 32px)); pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-radius: 18px; font-size: 14.5px; font-weight: 600; background: rgba(28, 25, 23, .88); color: #fff; -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); box-shadow: 0 14px 30px -12px rgba(0, 0, 0, .45); animation: toastIn .45s var(--spring) both; }
.toast.err { background: rgba(190, 18, 60, .92); }
.toast.out { animation: toastOut .3s ease-in both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-16px) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-10px); } }

/* ---------- Coach ---------- */
.chat { display: flex; flex-direction: column; gap: 10px; padding-bottom: 90px; }
.msg { max-width: 86%; padding: 12px 15px; border-radius: 20px; font-size: 15px; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; animation: rise .4s var(--ease) both; }
.msg.user { align-self: flex-end; background: var(--ink); color: #fff; border-bottom-right-radius: 6px; }
.msg.assistant { align-self: flex-start; border-bottom-left-radius: 6px; }
.msg .who { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; color: var(--accent-ink); letter-spacing: .06em; text-transform: uppercase; margin-bottom: 4px; }
.typing { display: inline-flex; gap: 4px; padding: 4px 2px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 60%, 100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
.composer { position: fixed; left: 50%; transform: translateX(-50%); z-index: 35; bottom: calc(var(--safe-bottom) + 86px); width: min(608px, calc(100% - 24px)); display: flex; gap: 8px; padding: 6px; border-radius: 26px; }
.composer textarea { flex: 1; border: 0; outline: 0; background: transparent; resize: none; padding: 11px 12px; max-height: 120px; font-size: 16px; line-height: 1.35; }
.composer .send { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; display: grid; place-items: center; align-self: flex-end; flex: none; }
.quick { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 14px; padding: 2px 16px 6px; scrollbar-width: none; }
.quick::-webkit-scrollbar { display: none; }
.quick .chip { flex: none; }

/* ---------- RABIT ---------- */
.radar { width: 100%; max-width: 300px; margin: 0 auto; }
.score-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.score-row:first-child { border-top: 0; }
.score-row .sc { font-size: 22px; font-weight: 750; letter-spacing: -0.03em; width: 48px; text-align: right; }
.meter { height: 6px; border-radius: 99px; background: rgba(28, 25, 23, .08); overflow: hidden; margin-top: 6px; }
.meter > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transform-origin: left; animation: growX 1s var(--ease) both; }
@keyframes growX { from { transform: scaleX(0); } }

.guide { position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; color: #fff; padding: calc(var(--safe-top) + 16px) 22px calc(var(--safe-bottom) + 24px); background: linear-gradient(160deg, var(--c1), var(--c2)); transition: background .6s; }
.guide .top { display: flex; justify-content: space-between; align-items: center; }
.guide .seg-name { font-family: var(--font-display); font-size: clamp(40px, 11vw, 64px); line-height: 1; margin: 6px 0; letter-spacing: -0.02em; }
.guide .clock { font-size: clamp(84px, 26vw, 140px); font-weight: 750; letter-spacing: -0.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.guide .mid { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 8px; }
.guide .next { padding: 14px 16px; border-radius: 20px; background: rgba(255, 255, 255, .16); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); font-size: 15px; }
.guide .ctrl { display: flex; justify-content: center; gap: 18px; margin-top: 18px; }
.guide .ctrl button { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .2); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.guide .ctrl button.main { width: 84px; height: 84px; background: #fff; color: var(--ink); }
.guide .segbar { display: flex; gap: 3px; margin-top: 14px; }
.guide .segbar i { height: 5px; border-radius: 99px; background: rgba(255, 255, 255, .28); flex: var(--w); position: relative; overflow: hidden; }
.guide .segbar i b { position: absolute; inset: 0; background: #fff; transform-origin: left; transform: scaleX(var(--p, 0)); }

/* ---------- Divers ---------- */
.empty { text-align: center; padding: 34px 20px; }
.empty .ico { width: 64px; height: 64px; border-radius: 22px; margin: 0 auto 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.kv { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); font-size: 15px; }
.kv:first-child { border-top: 0; }
.kv span:first-child { color: var(--muted); }
.kv b { font-weight: 700; }
.menu-item { display: flex; align-items: center; gap: 14px; padding: 14px 4px; border-top: 1px solid var(--line); width: 100%; text-align: left; font-weight: 600; font-size: 15.5px; }
.menu-item:first-child { border-top: 0; }
.menu-item .mi { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--grey-bg); flex: none; }
.menu-item .chev { margin-left: auto; color: var(--faint); }
.avatar { width: 64px; height: 64px; border-radius: 22px; display: grid; place-items: center; font-family: var(--font-display); font-size: 34px; color: #fff; background: linear-gradient(135deg, var(--accent), #FF3D6E); box-shadow: 0 12px 24px -12px rgba(255, 61, 110, .7); }
.zone-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 14px; }
.zone-row .zn { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; font-weight: 750; font-size: 13px; color: #fff; flex: none; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 99px; font-size: 12px; font-weight: 650; background: var(--grey-bg); color: var(--ink-2); }
.pill.warn { background: var(--orange-bg); color: var(--orange); }
.pill.ok { background: var(--green-bg); color: var(--green); }
.pill.bad { background: var(--red-bg); color: var(--red); }
.notice { display: flex; gap: 12px; padding: 14px 16px; border-radius: 18px; background: var(--accent-soft); color: var(--accent-ink); font-size: 14px; line-height: 1.45; }
.notice.info { background: var(--indigo-bg); color: #3730A3; }
.notice .ic { margin-top: 1px; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: spin .8s linear infinite; }
.spinner.dark { border-color: rgba(28, 25, 23, .12); border-top-color: var(--ink); }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { border-radius: var(--r); background: linear-gradient(100deg, rgba(255, 255, 255, .4) 30%, rgba(255, 255, 255, .85) 50%, rgba(255, 255, 255, .4) 70%); background-size: 300% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

.gen { min-height: 70dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 18px; }
.gen .orb { width: 140px; height: 140px; border-radius: 50%; background: conic-gradient(from 0deg, var(--accent), #FF3D6E, #A78BFA, #34D399, var(--accent)); filter: blur(2px); animation: spin 3s linear infinite; position: relative; }
.gen .orb::after { content: ""; position: absolute; inset: 10px; border-radius: 50%; background: var(--bg); }
.gen .orb-wrap { position: relative; width: 140px; height: 140px; }
.gen .orb-wrap .ic { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); color: var(--accent); }

table.splits { width: 100%; border-collapse: collapse; font-size: 14px; }
table.splits th { text-align: left; font-size: 11.5px; color: var(--muted); font-weight: 650; text-transform: uppercase; letter-spacing: .06em; padding: 6px 4px; }
table.splits td { padding: 9px 4px; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }

@media (min-width: 720px) {
  .view { padding-top: calc(var(--safe-top) + 34px); }
  .insight { flex-basis: 46%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ==========================================================================
   Tableau de bord & graphiques
   ========================================================================== */
.tabbar .side-brand { display: none; }
.desk-only { display: none !important; }
.view.wide { max-width: 1360px; }
.filters { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 0 0 16px; }
.filters .segmented { width: auto; min-width: 320px; }
.dash { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; transition: opacity .2s; }
.dash > * { grid-column: span 12; min-width: 0; margin: 0 !important; }
.dash .card + .card { margin-top: 0; }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.kpi .v { font-size: 26px; }
.kpi .v small { font-size: 13px; }
.delta { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 700; padding: 2px 8px; border-radius: 99px; }
.delta.good { color: #006300; background: var(--green-bg); }
.delta.bad { color: #b42318; background: var(--red-bg); }
.viz-card { display: flex; flex-direction: column; gap: 10px; }
.viz-head p { margin: 4px 0 0; }
.viz-host { width: 100%; min-height: 120px; }
.viz-svg { display: block; overflow: visible; font-family: var(--font-ui); }
.viz-svg .num, .viz-svg text.num { font-variant-numeric: tabular-nums; }
.viz-hit { cursor: default; outline: none; }
.viz-hit:focus-visible { stroke: var(--ink); stroke-width: 1; }
.viz-empty { display: flex; align-items: center; justify-content: center; text-align: center; color: var(--muted); font-size: 14px; border-radius: 16px; background: rgba(28, 25, 23, .03); padding: 12px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { display: inline-block; }
.lg-rect { width: 10px; height: 10px; border-radius: 3px; }
.lg-line { width: 16px; height: 2px; border-radius: 2px; }
.lg-tick { width: 14px; height: 2px; border-radius: 2px; }
.lg-dot { width: 9px; height: 9px; border-radius: 50%; }
.legend-scale { display: flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); }
.legend-scale i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.legend-scale span { margin: 0 4px; }
.viz-tip {
  position: fixed; left: 0; top: 0; z-index: 120; pointer-events: none; opacity: 0; transition: opacity .12s;
  min-width: 150px; max-width: 280px; padding: 10px 12px; border-radius: 14px; font-size: 13px;
  background: rgba(255, 255, 255, .96); color: var(--ink); border: 1px solid rgba(28, 25, 23, .08);
  box-shadow: 0 12px 30px -10px rgba(28, 25, 23, .35); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.viz-tip.on { opacity: 1; }
.viz-tip-title { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.viz-tip-row { display: flex; align-items: center; gap: 8px; line-height: 1.6; }
.viz-tip-row b { font-variant-numeric: tabular-nums; font-weight: 750; }
.viz-tip-row span { color: var(--ink-2); }
.viz-tip .k-line { width: 12px; height: 2px; border-radius: 2px; flex: none; }
.viz-tip .k-rect { width: 9px; height: 9px; border-radius: 2px; flex: none; }
.hero-fig { font-size: 52px; font-weight: 750; letter-spacing: -0.04em; line-height: 1; margin: 12px 0 10px; }
.recs { display: flex; flex-direction: column; gap: 2px; margin-top: 10px; }
.rec { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.rec:first-child { border-top: 0; }
.rec .mi { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.rec b { font-size: 17px; }
.zbar, .tbar { padding: 7px 0; }
.zbar .meter, .tbar .meter { margin: 6px 0 3px; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }
.data-table tr.tap { cursor: pointer; }
.data-table tr.tap:hover td { background: rgba(255, 90, 31, .05); }

@media (min-width: 720px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- Ordinateur : barre latérale + grille 12 colonnes ---------- */
@media (min-width: 1024px) {
  #app { padding-left: 112px; }
  .desk-only { display: flex !important; }
  .tabbar {
    left: 20px; top: 20px; bottom: 20px; transform: none; width: 80px; height: auto;
    display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 12px 8px; border-radius: 28px;
  }
  .tabbar a { height: 62px; border-radius: 18px; flex: none; }
  .tabbar .side-brand {
    display: grid !important; place-items: center; height: 52px !important; margin-bottom: 10px;
    color: #fff !important; background: linear-gradient(135deg, var(--accent), var(--accent-2)) !important;
    border-radius: 16px !important; box-shadow: 0 8px 18px -8px rgba(255, 90, 31, .8);
  }
  .view { padding-bottom: 48px; padding-left: 28px; padding-right: 28px; }
  .composer { left: calc(50% + 56px); }
  .toast-wrap { left: calc(50% + 56px); }
  .kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .dash .span-3 { grid-column: span 3; }
  .dash .span-4 { grid-column: span 4; }
  .dash .span-5 { grid-column: span 5; }
  .dash .span-6 { grid-column: span 6; }
  .dash .span-7 { grid-column: span 7; }
  .dash .span-8 { grid-column: span 8; }
  .dash .span-12 { grid-column: span 12; }
  .dash .today .title { font-size: 32px; }
}
.delta { white-space: nowrap; }
.kpi .row svg { flex: none; }
/* Tableau de bord : pas de flou en temps réel sur des dizaines de cartes (rendu plus léger au défilement) */
.dash .glass, .dash .stat { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(255, 255, 255, .74); }

/* ---------- Barre d'onglets « Liquid Glass » ---------- */
.tabbar { touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; isolation: isolate; }
.tabbar a { position: relative; z-index: 1; -webkit-touch-callout: none; }
.tabbar a.on { background: transparent; }
.tabbar a .ic { transition: transform .18s var(--ease); will-change: transform; }
.tabbar.dragging a .ic { transition: none; }
.tabbar a.under { color: var(--accent-ink); }
.tabbar.dragging a.on:not(.under) { color: var(--muted); }
.tab-lens {
  position: absolute; left: 0; top: 0; z-index: 0; pointer-events: none; border-radius: 999px;
  transform-origin: 50% 50%; will-change: transform; transition: opacity .2s, background .25s, box-shadow .25s;
  background:
    radial-gradient(120% 90% at 30% 0%, rgba(255, 255, 255, .95), rgba(255, 255, 255, 0) 55%),
    linear-gradient(180deg, rgba(255, 255, 255, .7), rgba(255, 244, 238, .45));
  box-shadow:
    inset 0 1.5px 1px rgba(255, 255, 255, 1),        /* reflet du haut */
    inset 0 -1.5px 2px rgba(255, 138, 76, .18),      /* lumière qui traverse le bas du verre */
    inset 0 0 0 .5px rgba(255, 255, 255, .8),
    0 8px 22px -8px rgba(255, 90, 31, .45),
    0 2px 6px -1px rgba(28, 25, 23, .12);
  -webkit-backdrop-filter: blur(4px) saturate(220%) brightness(1.06);
  backdrop-filter: blur(4px) saturate(220%) brightness(1.06);
}
.tab-lens::after {
  /* liseré irisé, comme la tranche d'une lentille */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; padding: 1px;
  background: linear-gradient(135deg, rgba(255, 255, 255, .95), rgba(255, 180, 140, .35) 40%, rgba(170, 190, 255, .35) 70%, rgba(255, 255, 255, .8));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.tabbar.dragging .tab-lens {
  /* en glissant, la lentille devient plus claire et plus « optique » */
  background:
    radial-gradient(110% 80% at 30% 0%, rgba(255, 255, 255, .8), rgba(255, 255, 255, 0) 50%),
    linear-gradient(180deg, rgba(255, 255, 255, .28), rgba(255, 255, 255, .1));
  box-shadow:
    inset 0 2px 1px rgba(255, 255, 255, 1), inset 0 -2px 3px rgba(255, 138, 76, .25),
    inset 0 0 12px rgba(255, 255, 255, .55), 0 14px 30px -10px rgba(28, 25, 23, .35);
  -webkit-backdrop-filter: blur(1.5px) saturate(260%) brightness(1.12) contrast(1.08);
  backdrop-filter: blur(1.5px) saturate(260%) brightness(1.12) contrast(1.08);
}
@media (min-width: 1024px) {
  .tab-lens { border-radius: 18px; }
}

/* ---------- Coach : message non envoyé + mise en page ordinateur ---------- */
.msg.user.failed { opacity: .55; }
.msg-failed { align-self: flex-end; display: flex; align-items: center; gap: 8px; max-width: 86%; font-size: 12.5px; color: var(--red); margin-top: -4px; text-align: right; }
.msg-failed button { font-weight: 700; color: var(--accent-ink); flex: none; }
@media (min-width: 1024px) {
  .chat { padding-bottom: 20px; }
  .composer { position: sticky; left: auto; transform: none; width: 100%; bottom: 24px; margin-top: 8px; }
  .quick { flex-wrap: wrap; margin: 0 0 14px; padding: 0; overflow: visible; }
}
@media (min-width: 1024px) {
  .composer { background: rgba(250, 249, 247, .96); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); box-shadow: 0 -18px 30px -12px rgba(243, 241, 238, .95), 0 12px 30px -12px rgba(28, 25, 23, .25); }
  .insights { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); overflow: visible; margin: 0; padding: 0 0 4px; }
  .insight { flex: none; }
}

/* Logo (identique à l'icône de l'app) */
.logo { display: block; flex: none; filter: drop-shadow(0 8px 14px rgba(255, 90, 31, .35)); }
@media (min-width: 1024px) {
  .tabbar .side-brand { background: none !important; box-shadow: none !important; padding: 0; height: auto !important; margin: 2px auto 12px; }
}

/* ==========================================================================
   Page Niveau (fiche de personnage RPG, ordinateur)
   ========================================================================== */
.rpg { display: grid; grid-template-columns: 300px minmax(0, 1fr) 330px; gap: 14px; align-items: stretch; }
.rpg-sheet, .rpg-detail { margin: 0 !important; align-self: start; }
.rpg-level { display: flex; align-items: center; gap: 14px; }
.rpg-lvl {
  width: 68px; height: 68px; border-radius: 20px; display: grid; place-items: center; flex: none;
  font-size: 32px; font-weight: 800; color: #fff; letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--accent), #FF3D6E); box-shadow: 0 12px 24px -10px rgba(255, 61, 110, .7), inset 0 1px 0 rgba(255, 255, 255, .5);
}
.meter.xp { height: 10px; margin-top: 6px; }
.meter.xp > i { background: linear-gradient(90deg, #7C3AED, var(--accent), #FF3D6E); }
.rpg-attr { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.rpg-attr:first-of-type { border-top: 0; }
.rpg-attr .meter { margin-top: 5px; }
.rpg-ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent); }
.rpg-ico.sm { width: 30px; height: 30px; border-radius: 10px; }
.rpg-rank { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; font-family: var(--font-display); font-size: 20px; color: #fff; }
.rank-S { background: linear-gradient(135deg, #7C3AED, #FF3D6E); } .rank-A { background: #E11D48; } .rank-B { background: #EA580C; }
.rank-C { background: #CA8A04; } .rank-D { background: #0D9488; } .rank-E, .rank-– { background: #A8A29E; }
.rpg-stage { position: relative; min-height: 640px; height: calc(100vh - 110px); max-height: 900px; overflow: hidden; border-radius: 28px;
  background: radial-gradient(80% 60% at 50% 42%, rgba(255, 255, 255, .85), rgba(255, 246, 240, .5) 60%, rgba(236, 228, 255, .45)); }
.rpg-canvas { position: absolute; inset: 0; cursor: grab; }
.rpg-canvas:active { cursor: grabbing; }
.rpg-canvas canvas { width: 100% !important; height: 100% !important; display: block; }
.rpg-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.rpg-callouts { position: absolute; inset: 0; pointer-events: none; }
.rpg-tag {
  position: absolute; left: 0; top: 0; min-width: 130px; padding: 9px 13px; border-radius: 14px;
  background: rgba(255, 255, 255, .88); border: 1px solid rgba(255, 255, 255, .95);
  box-shadow: 0 10px 24px -12px rgba(28, 25, 23, .35), inset 0 1px 0 #fff; animation: fade .35s both;
}
.rpg-tag span { display: block; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.rpg-tag b { font-size: 19px; letter-spacing: -0.02em; }
.rpg-skills { position: absolute; left: 16px; right: 16px; bottom: 16px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.rpg-skills .chip { background: rgba(255, 255, 255, .85); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.rpg-hint { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); color: var(--muted); pointer-events: none; }
.rpg-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); }
.rpg-row { padding: 9px 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; font-size: 14px; }
.rpg-row:first-of-type { border-top: 0; }
.rpg-row span { color: var(--ink-2); }
.rpg-row .meter { grid-column: 1 / -1; height: 5px; }
.rpg-detail.pop { animation: rise .45s var(--ease) both; }
@media (max-width: 1280px) { .rpg { grid-template-columns: 270px minmax(0, 1fr); } .rpg-detail { grid-column: 1 / -1; } }
.rpg-skills .chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ==========================================================================
   Planificateur d'itinéraires
   ========================================================================== */
.planner { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 14px; }
.planner-map { position: relative; height: calc(100vh - 110px); min-height: 560px; border-radius: 28px; overflow: hidden; padding: 0; }
#map { position: absolute; inset: 0; background: #eceae6; }
.planner-side { margin: 0 !important; max-height: calc(100vh - 110px); overflow-y: auto; }
.map-tools { position: absolute; top: 14px; right: 14px; z-index: 500; display: flex; gap: 8px; align-items: center; }
.map-tools .segmented { background: rgba(255, 255, 255, .85); box-shadow: var(--glass-shadow); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.map-tools .segmented button { height: 36px; padding: 0 12px; font-size: 13px; }
.map-hint, .map-busy { position: absolute; left: 50%; transform: translateX(-50%); bottom: 22px; z-index: 500; display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 999px; font-size: 13.5px; background: rgba(255, 255, 255, .92); box-shadow: 0 10px 24px -12px rgba(28, 25, 23, .4); max-width: 80%; }
.map-busy { bottom: auto; top: 16px; left: 50%; }
.leaflet-container { font-family: var(--font-ui); }
.leaflet-control-zoom { border: 0 !important; box-shadow: var(--glass-shadow) !important; border-radius: 14px !important; overflow: hidden; margin: 14px !important; }
.leaflet-control-zoom a { width: 36px !important; height: 36px !important; line-height: 36px !important; color: var(--ink) !important; }
.wp { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: var(--ink);
  background: #fff; border: 2.5px solid #FF5A1F; box-shadow: 0 3px 10px rgba(28, 25, 23, .3); cursor: grab; }
.wp.start { background: #16A34A; border-color: #fff; color: #fff; }
.wp.end { background: #1C1917; border-color: #fff; color: #fff; }
.kmpin { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-weight: 800; color: #fff; background: #1C1917; border: 2px solid #fff; }
.search { position: relative; }
.search-res { position: absolute; top: 56px; left: 0; right: 0; z-index: 10; background: #fff; border-radius: 16px; box-shadow: 0 16px 30px -12px rgba(28, 25, 23, .35); overflow: hidden; }
.search-res button { display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left; padding: 10px 14px; font-size: 13px; border-top: 1px solid var(--line); }
.search-res button:first-child { border-top: 0; }
.search-res button:hover { background: var(--accent-soft); }
.search-res span { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.route-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rs { padding: 10px 12px; border-radius: 14px; background: rgba(28, 25, 23, .04); }
.rs span { display: block; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.rs b { font-size: 20px; letter-spacing: -0.02em; }
.rs b small { font-size: 12px; color: var(--muted); }
.rs.big { grid-column: 1 / -1; }
.rs.big b { font-size: 32px; }
.profile-box { padding: 12px 12px 4px; border-radius: 16px; background: rgba(28, 25, 23, .03); }
.saved-route .info .t { font-size: 14.5px; }
@media (max-width: 1100px) { .planner { grid-template-columns: 1fr; } .planner-side { max-height: none; } }
.tiles-clair { filter: saturate(.7) brightness(1.03) contrast(.96); }
