/* ═══════════════════════════════════════════════════
   LE PACTE — design system
   Bleu (Khalid) · Rose (Karima) — clair par défaut, sombre au choix
   ═══════════════════════════════════════════════════ */

:root {
  --blue: #2f6bff;
  --blue-2: #1e4fd8;
  --blue-soft: #e9f0ff;
  --blue-line: #cfdeff;
  --pink: #ff4d8d;
  --pink-2: #e0326f;
  --pink-soft: #ffecf3;
  --pink-line: #ffd2e2;

  --bg: #f2f5fc;
  --bg-tint-a: rgba(47, 107, 255, .13);
  --bg-tint-b: rgba(255, 77, 141, .11);
  --surface: #ffffff;
  --surface-2: #f7f9ff;
  --surface-3: #eef2fb;

  --ink: #0f1626;
  --ink-2: #35405a;
  --muted: #69748f;
  --faint: #9aa4bd;
  --line: #e6ebf7;
  --line-2: #d9e1f2;

  --ok: #0fae66;
  --ok-soft: #e3f8ee;
  --warn: #e8890c;
  --warn-soft: #fdf1de;
  --danger: #e5484d;

  --grad: linear-gradient(122deg, var(--blue) 0%, #8a5cf0 52%, var(--pink) 100%);
  --grad-soft: linear-gradient(122deg, var(--blue-soft), var(--pink-soft));

  --r-xl: 30px;
  --r-lg: 24px;
  --r: 18px;
  --r-sm: 13px;
  --r-xs: 9px;

  --sh-1: 0 1px 2px rgba(15, 22, 38, .05), 0 4px 12px -4px rgba(15, 22, 38, .07);
  --sh-2: 0 2px 4px rgba(15, 22, 38, .04), 0 12px 28px -10px rgba(15, 22, 38, .13);
  --sh-3: 0 24px 60px -18px rgba(15, 22, 38, .26), 0 4px 12px rgba(15, 22, 38, .06);
  --sh-blue: 0 8px 22px -8px rgba(47, 107, 255, .55);

  --glass: rgba(255, 255, 255, .82);
  --sans: "Google Sans", "Google Sans Text", "Product Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --serif: var(--sans);
  --ease: cubic-bezier(.22, .8, .29, 1);
}

[data-theme="dark"] {
  --blue: #6b95ff;
  --blue-2: #8fb0ff;
  --blue-soft: rgba(107, 149, 255, .15);
  --blue-line: rgba(107, 149, 255, .32);
  --pink: #ff6ea6;
  --pink-2: #ff8dbb;
  --pink-soft: rgba(255, 110, 166, .15);
  --pink-line: rgba(255, 110, 166, .32);

  --bg: #080b13;
  --bg-tint-a: rgba(47, 107, 255, .22);
  --bg-tint-b: rgba(255, 77, 141, .16);
  --surface: #121826;
  --surface-2: #171f31;
  --surface-3: #1e273c;

  --ink: #eef2fb;
  --ink-2: #c3ccdf;
  --muted: #8e9ab5;
  --faint: #6b7796;
  --line: #232d44;
  --line-2: #2c3752;

  --ok: #35d494;
  --ok-soft: rgba(53, 212, 148, .14);
  --warn: #f0a742;
  --warn-soft: rgba(240, 167, 66, .14);
  --danger: #ff6369;

  --sh-1: 0 1px 2px rgba(0, 0, 0, .4);
  --sh-2: 0 2px 6px rgba(0, 0, 0, .35), 0 14px 30px -12px rgba(0, 0, 0, .6);
  --sh-3: 0 28px 70px -20px rgba(0, 0, 0, .8);
  --sh-blue: 0 8px 22px -8px rgba(107, 149, 255, .45);
  --glass: rgba(18, 24, 38, .8);
}

/* ─────────── base ─────────── */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
  min-height: 100dvh;
  overflow-x: hidden;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  transition: background .4s var(--ease), color .3s var(--ease);
}

body::before {
  content: "";
  position: fixed;
  inset: -30% -10% auto -10%;
  height: 70vh;
  background:
    radial-gradient(46% 58% at 18% 20%, var(--bg-tint-a), transparent 70%),
    radial-gradient(44% 54% at 84% 8%, var(--bg-tint-b), transparent 72%);
  filter: blur(20px);
  pointer-events: none;
  z-index: 0;
}

.hidden { display: none !important; }
button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
em { font-style: normal; }
b { font-weight: 600; }

::selection { background: var(--blue); color: #fff; }

* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 20px; border: 3px solid transparent; background-clip: content-box; }

/* ─────────── typographie utilitaire ─────────── */
.serif { font-family: var(--sans); font-weight: 600; letter-spacing: -.022em; }
.small { font-size: .82rem; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.italic { font-style: italic; }

.k {
  font-size: .655rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ═══════════ ÉCRAN VERROUILLÉ ═══════════ */
.lock {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 2rem 1.4rem calc(2rem + env(safe-area-inset-bottom));
  background: var(--bg);
  overflow-y: auto;
}
.lock-aura {
  position: absolute;
  width: min(560px, 120vw);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--grad);
  opacity: .16;
  filter: blur(72px);
  top: -14%;
  animation: aura 14s ease-in-out infinite alternate;
}
@keyframes aura { to { transform: translate(4%, 8%) scale(1.16); } }

.lock-inner {
  position: relative;
  width: 100%;
  max-width: 360px;
  text-align: center;
  animation: rise .7s var(--ease) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }

.mark {
  display: inline-flex;
  align-items: baseline;
  gap: .12em;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: .02em;
  padding: .5rem 1rem;
  border-radius: 100px;
  background: var(--surface);
  box-shadow: var(--sh-2);
  margin-bottom: 1.5rem;
}
.mark-k { color: var(--blue); }
.mark-s { color: var(--pink); }
.mark-amp { color: var(--faint); font-weight: 400; font-size: .82em; }

.lock-title {
  font-size: clamp(2.4rem, 12vw, 3.1rem);
  font-weight: 700;
  letter-spacing: -.04em;
  line-height: 1.02;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lock-sub {
  margin-top: .55rem;
  font-size: .85rem;
  color: var(--muted);
}

.who {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .7rem;
  margin-top: 0;
}
.who-card {
  position: relative;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r);
  padding: 1.05rem 1rem;
  min-height: 58px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: .1rem;
  box-shadow: var(--sh-1);
  transition: transform .28s var(--ease), box-shadow .28s var(--ease), border-color .28s var(--ease);
}
.who-card:active { transform: scale(.965); }
@media (hover: hover) {
  .who-card:hover { transform: translateY(-4px); box-shadow: var(--sh-2); border-color: var(--blue-line); }
  .who-s:hover { border-color: var(--pink-line); }
}
.who-initial {
  width: 56px; height: 56px;
  display: grid; place-items: center;
  border-radius: 50%;
  font-size: 1.4rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(140deg, var(--blue), #6f8dff);
  box-shadow: var(--sh-blue);
  margin-bottom: .7rem;
}
.who-s .who-initial {
  background: linear-gradient(140deg, var(--pink), #ff8ab4);
  box-shadow: 0 8px 22px -8px rgba(255, 77, 141, .55);
}
.who-name { font-weight: 600; font-size: 1.04rem; letter-spacing: -.01em; }
.who-go { font-size: .72rem; color: var(--faint); }

/* PIN */
.pin { margin-top: 2rem; animation: rise .45s var(--ease) both; }
.pin-who { font-size: .95rem; color: var(--ink-2); margin-bottom: 1.1rem; font-weight: 500; }
.pin-dots { display: flex; justify-content: center; gap: .7rem; margin-bottom: 2rem; }
.pin-dots span {
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--line-2);
  transition: transform .22s var(--ease), background .22s;
}
.pin-dots span.on { background: var(--blue); transform: scale(1.25); }
.pin-dots.err span { background: var(--danger) !important; }
.pin-dots.err { animation: shake .4s; }
@keyframes shake {
  20% { transform: translateX(-9px); } 40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); } 80% { transform: translateX(4px); }
}

.pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .7rem;
  max-width: 290px;
  margin: 0 auto;
}
.pad button {
  aspect-ratio: 1 / .82;
  border-radius: var(--r);
  background: var(--surface);
  border: 1.5px solid var(--line);
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--ink);
  box-shadow: var(--sh-1);
  transition: transform .12s var(--ease), background .2s, border-color .2s;
}
.pad button:active { transform: scale(.93); background: var(--blue-soft); border-color: var(--blue-line); }
.pad .pad-ghost { visibility: hidden; box-shadow: none; }
.pin-back {
  display: block;
  margin: 1.7rem auto 0;
  font-size: .82rem;
  color: var(--muted);
  padding: .5rem;
}

.theme-fab {
  position: absolute;
  top: calc(1rem + env(safe-area-inset-top));
  right: 1.1rem;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--surface);
  border: 1.5px solid var(--line);
  color: var(--muted);
  box-shadow: var(--sh-1);
}

/* ═══════════ SHELL ═══════════ */
.app { position: relative; z-index: 1; min-height: 100dvh; }

.top {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: calc(.55rem + env(safe-area-inset-top)) 1.1rem .55rem;
  background: var(--glass);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--line);
}
.top-brand {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-weight: 600;
  font-size: .98rem;
  letter-spacing: -.02em;
}
.top-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--grad);
}
.top-actions { display: flex; gap: .3rem; }
.icon-btn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: var(--muted);
  transition: background .2s, color .2s;
}
.icon-btn:active { background: var(--surface-3); }
@media (hover: hover) { .icon-btn:hover { background: var(--surface-3); color: var(--ink); } }

.views {
  padding: 1.1rem 1.1rem calc(6.5rem + env(safe-area-inset-bottom));
  max-width: 720px;
  margin: 0 auto;
}
.view { animation: viewIn .42s var(--ease) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } }
.view > * { animation: viewIn .5s var(--ease) both; }
.view > *:nth-child(1) { animation-delay: .02s; }
.view > *:nth-child(2) { animation-delay: .06s; }
.view > *:nth-child(3) { animation-delay: .1s; }
.view > *:nth-child(4) { animation-delay: .14s; }
.view > *:nth-child(5) { animation-delay: .18s; }
.view > *:nth-child(n+6) { animation-delay: .22s; }

/* ─────────── tabbar (mobile) / sidebar (desktop) ─────────── */
.tabbar {
  position: fixed;
  z-index: 50;
  left: .7rem; right: .7rem;
  bottom: calc(.55rem + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: .05rem;
  padding: .4rem .25rem;
  background: var(--glass);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--sh-2);
}
.side-brand { display: none; }
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .18rem;
  padding: .5rem .05rem .42rem;
  border-radius: 14px;
  color: var(--faint);
  font-size: .575rem;
  font-weight: 500;
  letter-spacing: -.015em;
  white-space: nowrap;
  transition: color .24s var(--ease), background .24s var(--ease);
}
.tab svg { width: 20px; height: 20px; transition: transform .28s var(--ease); }
.tab.active { color: var(--blue); background: var(--blue-soft); }
.tab.active svg { transform: translateY(-1px) scale(1.06); }
.tab:active svg { transform: scale(.9); }

/* ─────────── cartes ─────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 1.15rem 1.1rem;
  box-shadow: var(--sh-1);
  margin-bottom: .85rem;
  width: 100%;
  transition: box-shadow .3s var(--ease), transform .3s var(--ease), border-color .3s;
}
button.card { display: block; text-align: left; }
button.card:active { transform: scale(.985); }
@media (hover: hover) { button.card:hover { box-shadow: var(--sh-2); border-color: var(--line-2); } }

.card-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .7rem;
  margin-bottom: .8rem;
}
.card-t { font-size: 1.02rem; font-weight: 600; letter-spacing: -.02em; line-height: 1.35; }

.badge {
  flex: none;
  font-size: .64rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: .28rem .55rem;
  border-radius: 100px;
  background: var(--surface-3);
  color: var(--muted);
}
.badge-gold { background: var(--blue-soft); color: var(--blue-2); }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-ox { background: var(--pink-soft); color: var(--pink-2); }

.empty {
  text-align: center;
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.7;
  padding: 2.4rem 1rem;
  background: var(--surface-2);
  border: 1px dashed var(--line-2);
  border-radius: var(--r-lg);
}

.orn-sep {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 1.5rem .15rem .8rem;
  color: var(--faint);
  font-size: .655rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.orn-sep::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line-2), transparent);
}

/* ─────────── boutons ─────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .72rem 1.15rem;
  border-radius: 100px;
  background: var(--surface);
  border: 1.5px solid var(--line-2);
  color: var(--ink);
  font-size: .875rem;
  font-weight: 500;
  letter-spacing: -.01em;
  transition: transform .14s var(--ease), background .2s, border-color .2s, box-shadow .2s;
}
.btn:active { transform: scale(.955); }
@media (hover: hover) { .btn:hover { background: var(--surface-3); border-color: var(--faint); } }

.btn-solid {
  background: var(--grad);
  border-color: transparent;
  color: #fff;
  box-shadow: var(--sh-blue);
}
@media (hover: hover) { .btn-solid:hover { background: var(--grad); filter: brightness(1.07); border-color: transparent; } }

.btn-ghost { background: none; border-color: transparent; color: var(--muted); }
@media (hover: hover) { .btn-ghost:hover { background: var(--surface-3); border-color: transparent; } }

.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); background: none; }
@media (hover: hover) { .btn-danger:hover { background: color-mix(in srgb, var(--danger) 10%, transparent); border-color: var(--danger); } }

.btn-sm { padding: .42rem .8rem; font-size: .78rem; border-radius: 100px; }
.btn-block { display: flex; width: 100%; margin-top: .5rem; }

.fab {
  position: fixed;
  right: 1.2rem;
  bottom: calc(5.8rem + env(safe-area-inset-bottom));
  z-index: 45;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
  font-size: 1.7rem;
  font-weight: 300;
  line-height: 0;
  display: grid;
  place-items: center;
  box-shadow: 0 12px 28px -8px rgba(47, 107, 255, .6);
  transition: transform .2s var(--ease);
}
.fab:active { transform: scale(.9) rotate(90deg); }
@media (hover: hover) { .fab:hover { transform: scale(1.06); } }

/* ─────────── chips ─────────── */
.chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.chip {
  padding: .48rem .85rem;
  border-radius: 100px;
  background: var(--surface-2);
  border: 1.5px solid var(--line);
  color: var(--muted);
  font-size: .82rem;
  font-weight: 500;
  transition: all .22s var(--ease);
}
.chip:active { transform: scale(.95); }
.chip.on {
  background: var(--blue-soft);
  border-color: var(--blue);
  color: var(--blue-2);
  font-weight: 600;
}

.scopes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .25rem;
  padding: .3rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 100px;
  margin-bottom: 1rem;
}
.scope-tab {
  padding: .58rem .5rem;
  border-radius: 100px;
  font-size: .85rem;
  font-weight: 500;
  color: var(--muted);
  transition: all .26s var(--ease);
}
.scope-tab.active {
  background: var(--surface);
  color: var(--blue-2);
  font-weight: 600;
  box-shadow: var(--sh-1);
}

/* ─────────── formulaires ─────────── */
.f { margin-bottom: .95rem; }
.f label { display: block; margin-bottom: .42rem; }
.f input, .f textarea, input[type="date"] {
  width: 100%;
  padding: .78rem .9rem;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1.5px solid var(--line);
  color: var(--ink);
  font-size: .93rem;
  transition: border-color .22s, background .22s, box-shadow .22s;
}
.f textarea { min-height: 86px; resize: vertical; line-height: 1.55; }
.f input::placeholder, .f textarea::placeholder { color: var(--faint); }
.f input:focus, .f textarea:focus {
  outline: none;
  background: var(--surface);
  border-color: var(--blue);
  box-shadow: 0 0 0 4px var(--blue-soft);
}
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }

/* ─────────── accueil ─────────── */
.greet { padding: .3rem .15rem 1.3rem; }
.greet-date {
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: .3rem;
}
.greet-name {
  font-size: clamp(1.7rem, 7vw, 2.1rem);
  font-weight: 600;
  letter-spacing: -.035em;
  line-height: 1.12;
}
.greet-name em {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.pinwarn {
  display: block;
  width: 100%;
  margin-top: .9rem;
  padding: .7rem .85rem;
  border-radius: var(--r-sm);
  background: var(--warn-soft);
  color: var(--warn);
  font-size: .78rem;
  font-weight: 500;
  text-align: left;
  line-height: 1.45;
}

.wx-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: .35rem; }
.wx {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .28rem;
  padding: .7rem .1rem .55rem;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1.5px solid transparent;
  font-size: 1.35rem;
  transition: all .24s var(--ease);
}
.wx small { font-size: .58rem; color: var(--faint); font-weight: 500; }
.wx:active { transform: scale(.92); }
.wx.on {
  background: var(--blue-soft);
  border-color: var(--blue);
  transform: translateY(-2px);
}
.wx.on small { color: var(--blue-2); font-weight: 600; }

.nrg { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1rem; }
.nrg-l { font-size: .82rem; color: var(--muted); font-weight: 500; }
.nrg-dots { display: flex; gap: .4rem; }
.nrg-dots button {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--surface-3);
  border: 1.5px solid transparent;
  transition: all .22s var(--ease);
}
.nrg-dots button.on { background: var(--grad); border-color: transparent; }

.wx-note { display: flex; gap: .5rem; margin-top: .95rem; }
.wx-note input {
  flex: 1;
  padding: .68rem .85rem;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1.5px solid var(--line);
  font-size: .86rem;
}
.wx-note input:focus { outline: none; border-color: var(--blue); background: var(--surface); box-shadow: 0 0 0 4px var(--blue-soft); }

.partner-wx { display: flex; align-items: center; gap: .85rem; }
.partner-emo {
  width: 52px; height: 52px;
  flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--pink-soft);
  font-size: 1.5rem;
}
.partner-txt { flex: 1; min-width: 0; }
.partner-name { font-weight: 600; letter-spacing: -.015em; margin-bottom: .12rem; }
.streak {
  flex: none;
  text-align: center;
  padding: .45rem .7rem;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.streak b { display: block; font-size: 1.2rem; font-weight: 600; color: var(--blue); line-height: 1.1; }
.streak small { font-size: .53rem; color: var(--faint); letter-spacing: .04em; text-transform: uppercase; line-height: 1.25; display: block; }

.home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem; margin-bottom: .85rem; }
.home-grid .card { margin-bottom: 0; }
.tile-num { font-size: 1.9rem; font-weight: 600; letter-spacing: -.045em; line-height: 1; color: var(--ink); }
.tile-sub { font-size: .73rem; color: var(--muted); line-height: 1.45; margin-top: .4rem; }

.vic-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .1rem .65rem;
  padding: .7rem 0;
  border-top: 1px solid var(--line);
}
.vic-item:first-of-type { border-top: 0; padding-top: .1rem; }
.vic-glyph { grid-row: span 2; color: var(--pink); font-size: .9rem; line-height: 1.5; }
.vic-txt { font-size: .88rem; line-height: 1.5; color: var(--ink-2); }
.vic-meta { font-size: .68rem; color: var(--faint); }

.season-bar {
  height: 7px;
  border-radius: 100px;
  background: var(--surface-3);
  overflow: hidden;
}
.season-bar i { display: block; height: 100%; border-radius: 100px; background: var(--grad); transition: width .8s var(--ease); }

/* ─────────── bande de la semaine ─────────── */
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: .3rem; }
.wk {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .1rem;
  padding: .5rem .1rem .45rem;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1.5px solid transparent;
  transition: all .22s var(--ease);
}
.wk:active { transform: scale(.93); }
@media (hover: hover) { .wk:hover { background: var(--surface-3); } }
.wk-today { border-color: var(--blue); background: var(--blue-soft); }
.wk-l { font-size: .58rem; font-weight: 600; color: var(--faint); text-transform: uppercase; }
.wk-n { font-size: .78rem; font-weight: 600; color: var(--ink-2); line-height: 1.1; margin-bottom: .22rem; }
.wk-today .wk-n, .wk-today .wk-l { color: var(--blue-2); }
.wk-e { font-size: .82rem; line-height: 1.3; min-height: 1.1rem; color: var(--faint); }
.wk-you { opacity: .75; }
.wk-legend {
  display: flex;
  align-items: center;
  gap: .85rem;
  flex-wrap: wrap;
  margin-top: .7rem;
  font-size: .66rem;
  color: var(--muted);
}
.wk-legend span { display: inline-flex; align-items: center; gap: .3rem; }
.wk-legend i { width: 8px; height: 8px; border-radius: 50%; display: block; }
.wk-dot-me { background: var(--blue); }
.wk-dot-you { background: var(--pink); }

/* ─────────── journal ─────────── */
.jday { padding: 1rem 1.05rem .9rem; }
.jday-h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .6rem;
  padding-bottom: .7rem;
  margin-bottom: .35rem;
  border-bottom: 1px solid var(--line);
}
.jday-t { font-size: .95rem; font-weight: 600; letter-spacing: -.02em; }
.jday-d { font-size: .66rem; color: var(--faint); text-align: right; }

.jrow { display: flex; gap: .65rem; padding: .6rem 0; }
.jav {
  flex: none;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 50%;
  font-size: .76rem;
  font-weight: 600;
  color: #fff;
}
.jav-me { background: linear-gradient(140deg, var(--blue), #6f8dff); }
.jav-you { background: linear-gradient(140deg, var(--pink), #ff8ab4); }
.jbody { flex: 1; min-width: 0; }
.jmeta { font-size: .74rem; color: var(--muted); line-height: 1.4; }
.jmeta b { color: var(--ink); font-weight: 600; }
.jnote { font-size: .87rem; line-height: 1.55; color: var(--ink-2); margin-top: .15rem; }
.jnone { color: var(--faint); font-size: .78rem; font-style: italic; }

.jev {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  font-size: .76rem;
  line-height: 1.5;
  color: var(--muted);
  padding: .42rem .6rem;
  margin-top: .35rem;
  background: var(--surface-2);
  border-radius: var(--r-xs);
}
.jev span { color: var(--pink); flex: none; }

/* ─────────── standards ─────────── */
.std-detail {
  font-size: .82rem;
  color: var(--muted);
  line-height: 1.55;
  margin: -.35rem 0 .85rem;
}
.rate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .7rem .8rem;
  background: var(--surface-2);
  border-radius: var(--r-sm);
}
.rate-l { font-size: .78rem; font-weight: 500; color: var(--muted); }
.rate-dots { display: flex; gap: .35rem; }
.rate-dots button {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--surface-3);
  border: 1.5px solid var(--line-2);
  transition: all .2s var(--ease);
}
.rate-dots button.on { background: var(--grad); border-color: transparent; }
.rate-dots button:active { transform: scale(.85); }

.spark { margin-top: .9rem; }
.spark svg { width: 100%; height: 46px; display: block; overflow: visible; }
.spark-cap {
  display: flex;
  justify-content: space-between;
  font-size: .6rem;
  color: var(--faint);
  margin-top: .3rem;
}
.legend { display: flex; gap: .9rem; margin-top: .5rem; font-size: .68rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: .32rem; }
.legend i { width: 14px; height: 3px; border-radius: 2px; }

/* ─────────── propositions ─────────── */
.prop-cta {
  display: flex;
  align-items: center;
  gap: .6rem;
  width: 100%;
  text-align: left;
  padding: .85rem 1rem;
  margin-bottom: .95rem;
  border-radius: var(--r);
  background: var(--grad-soft);
  border: 1.5px dashed var(--blue-line);
  color: var(--blue-2);
  font-size: .84rem;
  font-weight: 500;
  line-height: 1.4;
  transition: transform .18s var(--ease), box-shadow .22s var(--ease);
}
.prop-cta span { font-size: 1rem; color: var(--pink); flex: none; }
.prop-cta:active { transform: scale(.98); }
@media (hover: hover) { .prop-cta:hover { box-shadow: var(--sh-1); } }

.prop {
  display: flex;
  gap: .75rem;
  padding: .85rem .9rem;
  border-radius: var(--r);
  background: var(--surface-2);
  border: 1.5px solid var(--line);
  margin-bottom: .55rem;
  transition: border-color .22s var(--ease), background .22s var(--ease), opacity .22s;
}
.prop-on { border-color: var(--blue); background: var(--blue-soft); }
.prop-done { opacity: .5; }

.prop-check {
  flex: none;
  width: 22px; height: 22px;
  margin-top: .1rem;
  border-radius: 7px;
  border: 1.5px solid var(--line-2);
  background: var(--surface);
  position: relative;
  transition: all .2s var(--ease);
}
.prop-check::after {
  content: "";
  position: absolute;
  left: 6px; top: 2px;
  width: 5px; height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform .2s var(--ease);
}
.prop-on .prop-check { background: var(--blue); border-color: var(--blue); }
.prop-on .prop-check::after { transform: rotate(45deg) scale(1); }
.prop-done .prop-check { background: var(--ok); border-color: var(--ok); }
.prop-done .prop-check::after { transform: rotate(45deg) scale(1); }

.prop-body { flex: 1; min-width: 0; }
.prop-t { font-size: .9rem; font-weight: 600; letter-spacing: -.018em; line-height: 1.4; }
.prop-d { font-size: .78rem; color: var(--muted); line-height: 1.55; margin-top: .28rem; }
.prop-foot { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: .6rem; }
.prop-vis {
  font-size: .66rem;
  font-weight: 600;
  letter-spacing: .02em;
  padding: .28rem .6rem;
  border-radius: 100px;
  background: var(--surface-3);
  color: var(--muted);
  border: 1.5px solid transparent;
  transition: all .2s var(--ease);
}
.prop-vis.on { background: var(--pink-soft); color: var(--pink-2); border-color: var(--pink-line); }

/* ─────────── signaux ─────────── */
.sig-intro { font-size: .85rem; line-height: 1.65; color: var(--ink-2); }
.sig-field { margin-bottom: .75rem; }
.sig-field p { font-size: .89rem; line-height: 1.55; color: var(--ink-2); margin-top: .2rem; }
.sig-foot {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  padding-top: .75rem;
  margin-top: .3rem;
  border-top: 1px solid var(--line);
}
.sig-author { flex: 1; font-size: .68rem; color: var(--faint); min-width: 120px; }
.sig { border-left: 3px solid var(--pink); }

/* ─────────── défis ─────────── */
.season-band {
  padding: 1.4rem 1.25rem;
  border-radius: var(--r-xl);
  background: var(--grad);
  color: #fff;
  margin-bottom: 1.2rem;
  box-shadow: 0 16px 36px -14px rgba(47, 107, 255, .6);
}
.season-num {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  opacity: .82;
}
.season-title { font-size: 1.45rem; font-weight: 600; letter-spacing: -.03em; margin: .15rem 0 1.1rem; }
.season-band .season-bar { background: rgba(255, 255, 255, .25); }
.season-band .season-bar i { background: #fff; }
.season-dates {
  display: flex;
  justify-content: space-between;
  font-size: .68rem;
  opacity: .9;
  margin-top: .5rem;
}

.chall { display: flex; align-items: center; gap: 1rem; }
.chall-main { flex: 1; min-width: 0; }
.chall-t { font-size: .96rem; font-weight: 600; letter-spacing: -.018em; line-height: 1.35; }
.chall-r { font-size: .73rem; color: var(--muted); margin-top: .22rem; }
.chall-r em { color: var(--pink); font-weight: 500; }
.chall-done { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.chall-done .chall-r { color: var(--ok); font-weight: 500; }

.stepper {
  flex: none;
  display: flex;
  align-items: center;
  gap: .1rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: .2rem;
}
.stepper button {
  width: 30px; height: 30px;
  border-radius: 50%;
  font-size: 1.05rem;
  color: var(--blue);
  display: grid; place-items: center;
  transition: background .2s;
}
.stepper button:active { background: var(--blue-soft); }
.stepper b { min-width: 24px; text-align: center; font-size: .88rem; font-weight: 600; }

/* ─────────── board ─────────── */
.board-hero { padding: .3rem .15rem 1.3rem; }
.board-hero h2 {
  font-size: clamp(1.7rem, 7vw, 2.1rem);
  font-weight: 600;
  letter-spacing: -.035em;
  line-height: 1.12;
}
.board-hero p { font-size: .87rem; color: var(--muted); line-height: 1.6; margin-top: .5rem; }

.mentors-row {
  display: flex;
  gap: .65rem;
  overflow-x: auto;
  padding: .2rem 1.1rem 1rem;
  margin: 0 -1.1rem;
  scroll-padding-left: 1.1rem;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.mentors-row::-webkit-scrollbar { display: none; }
.mentor-chip {
  flex: none;
  width: 156px;
  scroll-snap-align: start;
  padding: 1rem .9rem;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--sh-1);
}
.mentor-emb {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: var(--grad-soft);
  color: var(--blue-2);
  font-weight: 600;
  font-size: .95rem;
  margin-bottom: .6rem;
}
.mentor-n { font-size: .88rem; font-weight: 600; letter-spacing: -.015em; }
.mentor-d { font-size: .7rem; color: var(--muted); line-height: 1.45; margin-top: .2rem; }

.dec-item { display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.dec-t { font-size: .93rem; font-weight: 500; letter-spacing: -.015em; line-height: 1.4; }

.advice {
  padding: 1rem 1.05rem;
  border-radius: var(--r);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue);
  margin-bottom: .7rem;
}
.advice-n { font-size: .9rem; font-weight: 600; color: var(--blue-2); margin-bottom: .35rem; }
.advice-x { font-size: .86rem; line-height: 1.62; color: var(--ink-2); }
.advice-r {
  font-size: .8rem;
  line-height: 1.5;
  margin-top: .6rem;
  padding-top: .6rem;
  border-top: 1px dashed var(--line-2);
  color: var(--ink-2);
}
.advice-r b { color: var(--pink); }
.advice:nth-of-type(even) { border-left-color: var(--pink); }
.advice:nth-of-type(even) .advice-n { color: var(--pink-2); }

.synth {
  padding: 1rem 1.05rem;
  border-radius: var(--r);
  background: var(--grad-soft);
  border: 1px dashed var(--blue-line);
  font-size: .88rem;
  line-height: 1.62;
  color: var(--ink-2);
  margin-top: .9rem;
}

.thinking { text-align: center; padding: 2.4rem 1rem 1.6rem; }
.thinking p { font-size: .87rem; color: var(--muted); margin-top: 1.2rem; }
.thinking .seal {
  width: 58px; height: 58px;
  margin: 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
}
.thinking .seal-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2.5px solid var(--line);
  border-top-color: var(--blue);
  border-right-color: var(--pink);
  animation: spin 1.1s linear infinite;
}
.thinking .seal-mono { font-size: 1.1rem; color: var(--pink); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─────────── conseil ─────────── */
.steps { display: flex; gap: .3rem; margin-bottom: 1.3rem; }
.steps i {
  flex: 1;
  height: 4px;
  border-radius: 100px;
  background: var(--surface-3);
  transition: background .4s var(--ease);
}
.steps i.done { background: var(--grad); }
.council-step-t { font-size: 1.15rem; font-weight: 600; letter-spacing: -.025em; margin-bottom: .4rem; }
.council-step-s { font-size: .86rem; color: var(--muted); line-height: 1.62; margin-bottom: 1rem; }

/* ─────────── pacte ─────────── */
.pact-txt-wrap {
  max-height: 42dvh;
  overflow-y: auto;
  padding: 1.1rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  margin-bottom: 1rem;
}
.pact-txt {
  white-space: pre-wrap;
  font-size: .93rem;
  line-height: 1.75;
  color: var(--ink-2);
}
.signs { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.sign-slot {
  padding: .85rem .7rem;
  border-radius: var(--r-sm);
  border: 1.5px dashed var(--line-2);
  text-align: center;
  background: var(--surface-2);
}
.sign-slot.signed { border-style: solid; border-color: var(--blue); background: var(--blue-soft); }
.sign-name { font-weight: 600; font-size: .92rem; letter-spacing: -.015em; }
.sign-slot.signed .sign-name { color: var(--blue-2); }
.sign-date { font-size: .66rem; color: var(--faint); margin-top: .1rem; }

/* ─────────── feuille modale ─────────── */
.sheet { position: fixed; inset: 0; z-index: 90; display: flex; align-items: flex-end; }
.sheet-veil {
  position: absolute;
  inset: 0;
  background: rgba(15, 22, 38, .42);
  backdrop-filter: blur(3px);
  animation: fade .3s var(--ease);
}
@keyframes fade { from { opacity: 0; } }
.sheet-card {
  position: relative;
  width: 100%;
  max-height: 92dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--surface);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: .6rem 1.2rem calc(1.6rem + env(safe-area-inset-bottom));
  box-shadow: var(--sh-3);
  animation: sheetUp .38s var(--ease);
}
@keyframes sheetUp { from { transform: translateY(100%); } }
.sheet-grab {
  width: 38px; height: 4px;
  border-radius: 100px;
  background: var(--line-2);
  margin: .35rem auto 1.1rem;
}
.sheet-title { font-size: 1.3rem; font-weight: 600; letter-spacing: -.032em; line-height: 1.25; }
.sheet-sub { font-size: .85rem; color: var(--muted); line-height: 1.62; margin: .45rem 0 1.2rem; }
.sheet-actions {
  display: flex;
  gap: .55rem;
  margin-top: 1.3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.sheet-actions .btn { flex: 1; }

/* ─────────── toast ─────────── */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(6.6rem + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px);
  z-index: 120;
  padding: .7rem 1.15rem;
  border-radius: 100px;
  background: var(--ink);
  color: var(--bg);
  font-size: .83rem;
  font-weight: 500;
  box-shadow: var(--sh-3);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s var(--ease), transform .3s var(--ease);
  max-width: 88vw;
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ═══════════════════════════════════════════════════
   DESKTOP
   ═══════════════════════════════════════════════════ */
@media (min-width: 900px) {
  body::before { height: 100vh; }

  .tabbar {
    left: 0; top: 0; bottom: 0; right: auto;
    width: 250px;
    grid-template-columns: 1fr;
    grid-auto-rows: max-content;
    align-content: start;
    gap: .25rem;
    padding: 1.5rem .85rem;
    border-radius: 0;
    border: 0;
    border-right: 1px solid var(--line);
    background: var(--surface);
    backdrop-filter: none;
    box-shadow: none;
  }
  .side-brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: 0 .65rem 1.6rem;
  }
  .side-mark {
    width: 34px; height: 34px;
    display: grid; place-items: center;
    border-radius: 11px;
    background: var(--grad);
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: -.02em;
    box-shadow: var(--sh-blue);
  }
  .side-name { font-weight: 600; letter-spacing: -.025em; font-size: 1.02rem; }

  .tab {
    flex-direction: row;
    justify-content: flex-start;
    gap: .8rem;
    padding: .72rem .8rem;
    border-radius: 13px;
    font-size: .9rem;
    font-weight: 500;
    letter-spacing: -.015em;
    color: var(--muted);
  }
  .tab svg { width: 20px; height: 20px; }
  .tab.active svg { transform: none; }
  .tab.active { color: var(--blue-2); background: var(--blue-soft); }

  .app { padding-left: 250px; }
  .top {
    padding: 1rem 2rem;
    background: transparent;
    backdrop-filter: none;
    border-bottom: 0;
    max-width: 1180px;
    margin: 0 auto;
  }
  .top-brand { display: none; }
  .top-actions { margin-left: auto; }

  .views {
    max-width: 780px;
    padding: .4rem 2rem 5rem;
  }

  .fab { right: 2.2rem; bottom: 2.2rem; }
  .toast { bottom: 2rem; left: calc(50% + 125px); }

  .sheet { align-items: center; justify-content: center; padding: 2rem; }
  .sheet-card {
    max-width: 620px;
    max-height: 86dvh;
    border-radius: var(--r-xl);
    padding: 1.6rem 1.8rem 1.8rem;
    animation: pop .32s var(--ease);
  }
  @keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.97); } }
  .sheet-grab { display: none; }

  .home-grid { gap: 1rem; }
  .mentors-row { margin: 0; padding: .2rem .15rem 1rem; flex-wrap: wrap; overflow: visible; }
  .mentor-chip { width: calc(33.333% - .44rem); }
  .lock-inner { max-width: 400px; }
}

@media (min-width: 900px) and (hover: hover) {
  .tab:hover { background: var(--surface-3); color: var(--ink); }
  .tab.active:hover { background: var(--blue-soft); color: var(--blue-2); }
}

@media (min-width: 1180px) {
  .views { max-width: 940px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
