@import url('./tokens.css');

/* ——— Jetons de surface (redéfinis par .night) ——— */
:root {
  --fond: var(--creme);
  --surface: var(--blanc);
  --encadre: var(--nuit);
  --focus: var(--nuit); /* l'ocre sur crème n'a que 2:1 de contraste */
  --st: env(safe-area-inset-top, 0px);
  --sb: env(safe-area-inset-bottom, 0px);
  --i-flag: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z'/%3E%3Cpath d='M4 22v-7'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--creme); color: var(--texte);
  font: 400 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0; text-wrap: balance; letter-spacing: -.005em; font-variant-numeric: lining-nums; }
h1 { font-size: 30px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
p { margin: 0; }
small { font-size: 12.5px; color: var(--texte-2); }
a { color: inherit; text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
svg { flex: none; display: block; }
::selection { background: var(--ocre-doux); color: var(--nuit); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 8px; }
.hero, .night, .card.night, .appel, .encadre--ocre, .jr-tot--nuit { --focus: var(--ocre); }
.sheet:focus { outline: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
input, textarea, select {
  font: inherit; font-size: 16px; /* 16 px minimum : sinon iOS zoome sur le champ au focus */ color: var(--texte); caret-color: var(--ocre);
  width: 100%; min-height: 48px; padding: 12px 16px;
  background: var(--surface); border: 1.5px solid var(--trait); border-radius: var(--r-m);
  transition: border-color 160ms var(--ease);
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--nuit); }
input::placeholder, textarea::placeholder { color: var(--texte-2); }

/* ——— Cadre : appli plein écran sur mobile, téléphone centré au-delà de 500 px ——— */
.app {
  position: relative; display: flex; flex-direction: column;
  height: 100dvh; overflow: hidden;
  background: var(--fond); color: var(--texte);
}
[data-view] { flex: 1; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
[data-view]::-webkit-scrollbar { display: none; }
[data-view].enter { animation: vue-in 220ms var(--ease) both; }
@keyframes vue-in { from { opacity: 0; transform: translateY(8px); } }

@media (min-width: 501px) {
  body {
    background: #E9E3D8; min-height: 100vh;
    display: grid; place-items: center; padding: 32px 0;
  }
  .device {
    position: relative; width: 390px; height: 844px;
    border-radius: 48px; overflow: hidden;
    box-shadow: 0 0 0 10px #0E1630, 0 0 0 11px #2A3658, 0 50px 90px -30px rgba(22, 34, 63, .55), 0 18px 36px -18px rgba(22, 34, 63, .4);
  }
  .device::after { /* îlot de l'écran */
    content: ''; position: absolute; z-index: 100; top: 11px; left: 50%; translate: -50% 0;
    width: 112px; height: 32px; border-radius: 20px; background: #0B1022; pointer-events: none;
  }
  .device .app { height: 100%; --st: 50px; --sb: 18px; }
}

/* ——— Mode nuit ——— */
.night {
  --fond: var(--nuit); --surface: var(--nuit-2); --texte: var(--creme);
  --texte-2: rgba(251, 246, 238, .7); --trait: rgba(251, 246, 238, .14); --encadre: var(--ocre);
  color-scheme: dark;
}

/* ——— En-tête nuit + feuille crème ——— */
.hero {
  position: relative; isolation: isolate;
  padding: calc(var(--st) + 18px) 20px 48px;
  color: var(--creme);
  background:
    radial-gradient(120% 70% at 92% -10%, rgba(239, 162, 46, .14), transparent 55%),
    linear-gradient(180deg, var(--nuit-2), var(--nuit) 75%);
}
.hero::before { /* ciel étoilé discret */
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    radial-gradient(1.4px 1.4px at 80% 9%, rgba(251, 246, 238, .75) 99%, transparent),
    radial-gradient(1px 1px at 56% 5%, rgba(251, 246, 238, .55) 99%, transparent),
    radial-gradient(1.6px 1.6px at 58% 30%, rgba(251, 246, 238, .6) 99%, transparent),
    radial-gradient(1px 1px at 72% 14%, rgba(251, 246, 238, .7) 99%, transparent),
    radial-gradient(1.2px 1.2px at 86% 46%, rgba(251, 246, 238, .45) 99%, transparent),
    radial-gradient(1px 1px at 66% 40%, rgba(251, 246, 238, .35) 99%, transparent),
    radial-gradient(1.3px 1.3px at 95% 24%, rgba(251, 246, 238, .4) 99%, transparent),
    radial-gradient(1px 1px at 64% 72%, rgba(251, 246, 238, .3) 99%, transparent);
}
.hero h1, .hero h2 { color: var(--creme); }
.hero p, .hero small { color: rgba(251, 246, 238, .72); }
.sheet-body {
  position: relative; z-index: 1;
  margin-top: -28px; padding: 26px 20px 44px;
  background: var(--fond); border-radius: var(--r-l) var(--r-l) 0 0;
}

/* ——— Cartes et encadrés ——— */
.card {
  background: var(--surface); border-radius: var(--r-m); padding: 18px;
  box-shadow: 0 1px 2px rgba(22, 34, 63, .04), var(--ombre);
}
.card--flat { box-shadow: none; border: 1px solid var(--trait); }
.night .card { box-shadow: none; }

.encadre {
  border: 1.5px solid var(--encadre); border-radius: var(--r-m);
  padding: 16px 20px;
  font-family: var(--serif); font-size: 17px; font-weight: 500; line-height: 1.4; text-wrap: pretty;
}
.encadre--ocre { /* double cadre des publications Instagram : fond nuit, filet ocre en retrait */
  background: var(--nuit); color: var(--creme);
  border: 6px solid var(--nuit); box-shadow: inset 0 0 0 1.5px var(--ocre);
  padding: 18px 20px;
}
.encadre--ocre em, .encadre--ocre strong { color: var(--ocre); font-style: normal; }
.night .encadre--ocre { background: var(--nuit-2); border-color: var(--nuit-2); }

/* ——— Boutons, puces, badge ——— */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 999px;
  border: 1.5px solid var(--trait); background: var(--surface); color: var(--texte);
  font: 500 15px/1 var(--sans); text-decoration: none; cursor: pointer; user-select: none;
  transition: transform 140ms var(--ease), background-color 160ms var(--ease), box-shadow 160ms var(--ease);
}
.btn--primary { background: var(--texte); color: var(--fond); border-color: transparent; box-shadow: 0 6px 16px -6px rgba(22, 34, 63, .45); }
.btn--ocre { background: var(--ocre); color: var(--nuit); border-color: transparent; box-shadow: 0 6px 16px -6px rgba(239, 162, 46, .7); }
.btn--ghost { background: transparent; border-color: transparent; }
.btn--ghost:hover { background: color-mix(in srgb, var(--texte) 6%, transparent); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; box-shadow: none; }

.chip {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--trait); background: var(--surface); color: var(--texte);
  font: 500 13.5px/1 var(--sans); cursor: pointer; white-space: nowrap;
  transition: transform 140ms var(--ease), background-color 160ms var(--ease), color 160ms var(--ease);
}
.chip::before { content: ''; position: absolute; inset: -4px 0; } /* cible tactile 44 px */
.chip[aria-pressed="true"] { background: var(--texte); color: var(--fond); border-color: transparent; }

.badge-new {
  display: inline-flex; align-items: center; gap: 5px; vertical-align: middle;
  padding: 4px 9px 4px 7px; border-radius: 999px;
  background: var(--ocre); color: var(--nuit);
  font: 600 11px/1 var(--sans); letter-spacing: .05em; text-transform: uppercase;
}
.badge-new::before {
  content: ''; width: 12px; height: 12px; background: currentColor;
  -webkit-mask: var(--i-flag) center / contain no-repeat; mask: var(--i-flag) center / contain no-repeat;
}

/* ——— Onglets (contrôle segmenté) ——— */
.tabs {
  display: flex; gap: 2px; padding: 4px; border-radius: 999px;
  background: color-mix(in srgb, var(--texte) 7%, transparent);
  overflow-x: auto; scrollbar-width: none;
}
.tab {
  flex: 1 0 auto; min-height: 44px; padding: 0 14px; border: 0; border-radius: 999px;
  background: transparent; color: var(--texte-2); font: 500 14px/1 var(--sans); cursor: pointer;
  transition: background-color 200ms var(--ease), color 200ms var(--ease), box-shadow 200ms var(--ease);
}
.tab:focus-visible { outline-offset: -2px; } /* les onglets défilent : un anneau extérieur serait rogné */
.tab[aria-current="page"] { background: var(--surface); color: var(--texte); box-shadow: 0 2px 8px rgba(22, 34, 63, .1); }
.hero .tabs { background: rgba(251, 246, 238, .1); }
.hero .tab { color: rgba(251, 246, 238, .7); }
.hero .tab[aria-current="page"], .night .tab[aria-current="page"] { background: var(--creme); color: var(--nuit); }

/* ——— Barre du bas ——— */
.bottomnav {
  flex: none; position: relative; z-index: 20;
  display: flex; justify-content: space-around; align-items: flex-end;
  padding: 8px 8px calc(var(--sb) + 8px);
  background: var(--surface);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -1px 0 rgba(22, 34, 63, .04), 0 -8px 28px rgba(22, 34, 63, .07);
}
.navitem {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  min-width: 56px; min-height: 48px; padding: 4px 6px; border: 0; background: none;
  color: var(--texte-2); font: 500 11px/1.2 var(--sans); text-decoration: none; cursor: pointer;
  transition: transform 140ms var(--ease), color 160ms var(--ease);
  position: relative; white-space: nowrap;
}
.navitem[aria-current="page"] { color: var(--texte); font-weight: 600; }
.navitem[aria-current="page"]::after { content: ''; position: absolute; bottom: -3px; left: 50%; translate: -50% 0; width: 4px; height: 4px; border-radius: 50%; background: var(--ocre); }
.navitem--fab {
  justify-content: center; width: 60px; height: 60px; min-width: 0; padding: 0;
  margin: -30px 4px 4px; border-radius: 50%;
  background: var(--ocre); color: var(--nuit);
  box-shadow: 0 0 0 6px var(--surface), 0 12px 24px -6px rgba(239, 162, 46, .75);
}
.navitem--fab::after { display: none; }
/* Barre rendue par l'écran : collée en bas de la zone qui défile */
[data-view]:has(> .bottomnav) { display: flex; flex-direction: column; }
[data-view]:has(> .bottomnav) > * { flex-shrink: 0; }
[data-view] > .bottomnav { position: sticky; bottom: 0; margin-top: auto; }

/* ——— Listes ——— */
.list-row {
  display: flex; align-items: center; gap: 14px;
  min-height: 64px; padding: 12px 16px;
  color: inherit; text-decoration: none; cursor: pointer;
  transition: transform 140ms var(--ease), background-color 160ms var(--ease);
}
.list-row + .list-row { border-top: 1px solid var(--trait); }
.list-row .grow { flex: 1; min-width: 0; }
.list-row > svg:last-child { color: var(--texte-2); }
.avatar {
  flex: none; display: grid; place-items: center;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--ocre-doux); color: var(--nuit);
  font: 600 18px/1 var(--serif);
}
.unread strong, .unread small { color: var(--texte); font-weight: 600; }
.unread::after {
  content: ''; display: inline-block; flex: none; vertical-align: middle;
  width: 9px; height: 9px; margin-left: 8px; border-radius: 50%;
  background: var(--ocre); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ocre) 22%, transparent);
}

/* ——— Messagerie ——— */
.bubble--me, .bubble--them {
  width: fit-content; max-width: 80%; padding: 10px 14px; margin-bottom: 6px;
  font-size: 14.5px; line-height: 1.45; text-wrap: pretty;
}
.bubble--me {
  margin-left: auto; background: var(--nuit); color: var(--creme);
  border-radius: 20px 20px 6px 20px;
}
.bubble--them {
  background: var(--surface); color: var(--texte);
  border-radius: 20px 20px 20px 6px; box-shadow: 0 1px 2px rgba(22, 34, 63, .06);
}
.bubble--me small, .bubble--them small { display: block; margin-top: 4px; font-size: 11px; color: inherit; opacity: .6; }
.night .bubble--me { background: var(--creme); color: var(--nuit); }

.call-card {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: var(--r-m);
  background: var(--surface); border: 1px solid var(--trait);
}
.ico { /* pastille d'icône */
  flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--nuit); color: var(--creme);
}
.ico--ocre { background: var(--ocre-doux); color: var(--nuit); }
.ico--orange { background: var(--orange); color: var(--blanc); }

.suggestion {
  padding: 12px 14px; border-radius: var(--r-m);
  background: var(--ocre-doux); color: var(--nuit);
  font-size: 14px; line-height: 1.45;
}
.suggestion > small:first-child {
  display: flex; align-items: center; gap: 6px; margin-bottom: 4px;
  color: var(--nuit); opacity: .75; font-size: 11.5px; font-weight: 600; letter-spacing: .02em;
}

/* ——— Typographie de signature ——— */
.big-time {
  font: 600 40px/1 var(--serif); letter-spacing: -.01em;
  font-variant-numeric: lining-nums tabular-nums;
}
.lettrine {
  float: left; margin: 2px 6px -4px -2px;
  font: 600 72px/.78 var(--serif); color: var(--ocre);
}

/* ——— Stepper vertical ——— */
.stepper { list-style: none; margin: 0; padding: 0; }
.stepper > * { position: relative; min-height: 30px; padding: 3px 0 24px 46px; }
.stepper > *:last-child { padding-bottom: 0; }
.stepper > *::before { /* pastille */
  content: ''; position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%;
  background: var(--surface); border: 1.5px solid var(--trait);
}
.stepper > *:not(:last-child)::after { /* fil */
  content: ''; position: absolute; left: 14.25px; top: 34px; bottom: 4px; width: 1.5px;
  background: repeating-linear-gradient(var(--trait) 0 4px, transparent 4px 8px);
}
.stepper strong, .stepper b { display: block; font-weight: 600; }
.stepper small { display: block; }
.step--done::before {
  border-color: transparent;
  background: var(--nuit) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FBF6EE' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 15px no-repeat;
}
.night .step--done::before {
  background: var(--creme) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2316223F' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 15px no-repeat;
}
.step--done:not(:last-child)::after { background: var(--texte); }
.step--current::before {
  background: var(--ocre); border-color: transparent;
  box-shadow: inset 0 0 0 9px var(--ocre), inset 0 0 0 30px var(--nuit), 0 0 0 6px color-mix(in srgb, var(--ocre) 25%, transparent);
}
.step--next { color: var(--texte-2); }
.step--next strong, .step--next b { color: var(--texte); font-weight: 500; }

/* ——— Bandeau des jours ——— */
.daystrip { display: flex; justify-content: space-between; gap: 4px; }
.daystrip > * {
  flex: 1; min-width: 44px; max-width: 48px; min-height: 66px; text-decoration: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border-radius: 999px; border: 1.5px solid var(--trait); background: transparent; color: var(--texte-2);
  font: 500 11px/1 var(--sans); text-transform: capitalize; cursor: pointer;
  transition: transform 140ms var(--ease);
}
.daystrip > * b, .daystrip > * strong { font: 600 16px/1 var(--sans); color: var(--texte); font-variant-numeric: tabular-nums; }
.day--past { background: var(--surface); border-color: transparent; }
.day--past::after { content: ''; width: 4px; height: 4px; border-radius: 50%; background: var(--texte); opacity: .35; }
.day--today {
  background: var(--texte); border-color: transparent; color: var(--fond);
  box-shadow: 0 8px 18px -8px rgba(22, 34, 63, .6);
}
.day--today b, .day--today strong { color: var(--fond); }
.day--today::after { content: ''; width: 4px; height: 4px; border-radius: 50%; background: var(--ocre); }
.day--future { border-style: dashed; }
.day--change::after { content: ''; width: 4px; height: 4px; border-radius: 50%; background: var(--ocre); }
/* Jour affiché (aria-current) ; aujourd'hui garde un anneau ocre quand on regarde un autre jour */
.daystrip > [aria-current="page"] { background: var(--texte); border: 1.5px solid transparent; color: var(--fond); box-shadow: 0 8px 18px -8px rgba(22, 34, 63, .6); }
.daystrip > [aria-current="page"] b { color: var(--fond); }
.daystrip:has([aria-current="page"]) .day--today:not([aria-current]) { background: transparent; border-color: var(--ocre); color: var(--texte-2); box-shadow: none; }
.daystrip:has([aria-current="page"]) .day--today:not([aria-current]) b { color: var(--texte); }
.hero .daystrip { margin-inline: -8px; } /* 7 × 44 px tiennent à 360 px */
.hero .daystrip > * { border-color: rgba(251, 246, 238, .18); color: rgba(251, 246, 238, .6); }
.hero .daystrip > * b, .hero .daystrip > * strong { color: var(--creme); }
.hero .day--past { background: rgba(251, 246, 238, .08); border-color: transparent; }
.hero .day--past::after { background: var(--creme); }
.hero .day--today { background: var(--creme); color: var(--nuit); }
.hero .day--today b, .hero .day--today strong { color: var(--nuit); }
.hero .daystrip > [aria-current="page"] { background: var(--creme); color: var(--nuit); }
.hero .daystrip > [aria-current="page"] b { color: var(--nuit); }
.hero .daystrip > [aria-current="page"].day--past::after { background: var(--nuit); }
.hero .daystrip:has([aria-current="page"]) .day--today:not([aria-current]) { background: transparent; border-color: var(--ocre); color: rgba(251, 246, 238, .6); }
.hero .daystrip:has([aria-current="page"]) .day--today:not([aria-current]) b { color: var(--creme); }

/* ——— Retour tactile ——— */
.btn:active, .chip:active, .list-row:active, .navitem:active, .daystrip > *:active, .card[data-action]:active { transform: scale(.98); }
.list-row:active { background: color-mix(in srgb, var(--texte) 4%, transparent); }

/* ——— Panneau du bas, voile, toast ——— */
.sheet-wrap { position: absolute; inset: 0; z-index: 50; }
.sheet-wrap.out { pointer-events: none; }
.voile { position: absolute; inset: 0; background: rgba(14, 22, 48, .45); animation: fondu 240ms var(--ease) both; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 88%; overflow-y: auto;
  padding: 28px 20px calc(var(--sb) + 24px);
  background: var(--fond); color: var(--texte);
  border-radius: var(--r-l) var(--r-l) 0 0;
  box-shadow: 0 -12px 40px rgba(14, 22, 48, .18);
  animation: monte 280ms var(--ease) both;
}
.sheet::before { /* poignée */
  content: ''; position: absolute; top: 10px; left: 50%; translate: -50% 0;
  width: 40px; height: 4px; border-radius: 4px; background: var(--trait);
}
.sheet-wrap.out .voile { animation: fondu 200ms var(--ease) reverse both; }
.sheet-wrap.out .sheet { animation: monte 220ms var(--ease) reverse both; }
@keyframes fondu { from { opacity: 0; } }
@keyframes monte { from { transform: translateY(100%); } }

.toast {
  position: absolute; z-index: 60; left: 50%; bottom: calc(var(--sb) + 96px);
  translate: -50% 0; width: max-content; max-width: calc(100% - 40px);
  padding: 12px 20px; border-radius: 999px;
  background: var(--nuit); color: var(--creme); font-size: 14px; font-weight: 500;
  box-shadow: 0 12px 30px -10px rgba(14, 22, 48, .5);
  animation: toast 2500ms var(--ease) both;
}
.night .toast { background: var(--creme); color: var(--nuit); }
@keyframes toast {
  0% { opacity: 0; transform: translateY(12px); }
  10%, 88% { opacity: 1; transform: none; }
  100% { opacity: 0; transform: translateY(6px); }
}

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

/* ——— Toast avec action ——— */
.toast--action { display: flex; align-items: center; gap: 4px; padding: 4px 6px 4px 20px; animation-duration: 5000ms; }
.toast-btn {
  min-height: 44px; padding: 0 14px; border: 0; border-radius: 999px; background: none; cursor: pointer;
  color: var(--ocre); font: 600 14px/1 var(--sans); text-decoration: underline; text-underline-offset: 4px;
}
.night .toast-btn { color: var(--nuit); } /* jamais d'ocre sur crème */

/* ——— Panneaux : sous-titre, actions ——— */
.sheet h2 { font-size: 24px; }
.sheet-sous { margin: 4px 0 18px; font-size: 13.5px; color: var(--texte-2); }
.sheet-actions { display: grid; gap: 8px; margin-top: 20px; }
.btn--suppr { color: var(--texte-2); }
.sheet .form { margin-top: 0; }

/* ——— Journal (parents) ——— */
.hero--journal { padding-bottom: 56px; }
.jr-date { margin: 4px 0 20px; font-size: 14px; }
.jr-date::first-letter { text-transform: uppercase; }
.jr-jours { margin-inline: -4px; }
.jr-jours .tab { flex: 1 1 0; display: grid; place-items: center; min-height: 44px; padding: 0 4px; text-decoration: none; white-space: nowrap; font-size: 13.5px; }

.jr-totaux { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.jr-tot {
  display: flex; flex-direction: column; gap: 8px; min-width: 0;
  padding: 14px 12px 14px 14px; border-radius: var(--r-m); background: var(--surface);
  box-shadow: 0 1px 2px rgba(22, 34, 63, .04), var(--ombre);
}
.jr-tot .label { display: flex; align-items: center; gap: 6px; font-size: 12px; white-space: nowrap; }
.jr-tot .label svg { color: var(--texte-2); }
.jr-tot .big-time { font-size: 32px; white-space: nowrap; }
.jr-tot .big-time i { font: 500 .46em/1 var(--sans); font-style: normal; margin: 0 .18em 0 .1em; color: var(--texte-2); letter-spacing: 0; }
.jr-tot--nuit {
  grid-column: 1 / -1; display: grid; grid-template-columns: 1fr auto; gap: 8px 20px; padding: 18px 20px 20px;
  background: var(--nuit); color: var(--creme);
}
.jr-tot--nuit > div { display: grid; gap: 8px; align-content: start; }
.jr-tot--nuit small { grid-column: 1 / -1; }
.jr-reveils { padding-left: 20px; border-left: 1px solid rgba(251, 246, 238, .16); }
.jr-tot--nuit .jr-reveils .label { color: rgba(251, 246, 238, .72); font-weight: 500; }
.jr-tot--nuit .label { color: var(--ocre); font-size: 12.5px; font-weight: 600; letter-spacing: .02em; }
.jr-tot--nuit .big-time { font-size: 56px; }
.jr-tot--nuit .label svg { color: inherit; }
.jr-tot--nuit .big-time i { color: rgba(251, 246, 238, .7); }
.jr-tot--nuit small { color: rgba(251, 246, 238, .72); font-size: 12.5px; }
.night .jr-tot { box-shadow: none; }
.night .jr-tot--nuit { background: var(--surface); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--ocre) 55%, transparent); }

.jr-head { margin-bottom: 12px; }
.jr-head small { display: block; margin-top: 2px; font-size: 12.5px; }
.frise { position: relative; list-style: none; margin: 0 -6px; padding: 0; }
.frise::before { /* fil de la journée */
  content: ''; position: absolute; left: 81px; top: 28px; bottom: 28px; width: 2px; border-radius: 2px;
  background: var(--trait);
}
.frise-ev {
  display: grid; grid-template-columns: 64px 12px 1fr auto; align-items: center; column-gap: 12px;
  width: 100%; min-height: 60px; padding: 6px; border: 0; border-radius: 14px;
  background: none; color: inherit; text-align: left; cursor: pointer;
  transition: transform 140ms var(--ease), background-color 160ms var(--ease);
}
.frise-ev:active { transform: scale(.98); background: color-mix(in srgb, var(--texte) 5%, transparent); }
.frise-ev .big-time { font-size: 25px; text-align: right; }
.frise-pt { position: relative; z-index: 1; width: 12px; height: 12px; border-radius: 50%; background: var(--ocre); box-shadow: 0 0 0 4px var(--surface); }
.frise-ev--nuit .frise-pt { background: var(--nuit); }
.night .frise-ev--nuit .frise-pt { background: var(--creme); }
.frise-ev b { display: block; font-weight: 500; font-size: 15px; line-height: 1.3; }
.frise-ev small { display: block; font-size: 12px; }
.frise-ev > svg { color: var(--texte-2); opacity: .7; }
.frise-ev.is-new { animation: nouveau 2400ms var(--ease) both; }
@keyframes nouveau { 0%, 40% { background: var(--ocre-doux); } }
.night .frise-ev.is-new { animation-name: nouveau-nuit; }
@keyframes nouveau-nuit { 0%, 40% { background: rgba(239, 162, 46, .18); } }
.frise-minuit { position: relative; z-index: 1; padding: 6px 0 6px 100px; }
.frise-minuit span {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  background: var(--fond); color: var(--texte-2); font: 500 11px/1.4 var(--sans); letter-spacing: .04em; text-transform: uppercase;
}
.frise-vide { padding: 8px 0 4px; color: var(--texte-2); font-size: 14px; text-wrap: pretty; }
.jr-oublie { margin-top: 14px; padding: 0 14px; font-size: 14.5px; }

#jr-note { min-height: 96px; resize: vertical; line-height: 1.45; }
.jr-note-ok { margin-top: 10px; }

.jr-histo h2 { margin: 12px 0 12px 2px; font-size: 22px; }
.card--list { padding: 4px 0; overflow: hidden; }
.card--list .list-row { min-height: 68px; padding: 12px 14px 12px 18px; }
.card--list .list-row strong { display: block; font-weight: 600; font-size: 15px; }
.card--list .list-row small { display: block; font-size: 12px; }
.card--list .list-row[aria-current="page"] { background: color-mix(in srgb, var(--ocre) 12%, transparent); }
.jr-histo-t { text-align: right; }
.jr-histo-t b { display: block; font: 600 19px/1.15 var(--serif); font-variant-numeric: lining-nums tabular-nums; }

/* Panneau rapide : cibles de 72 px minimum */
.rapide-tete { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.rapide-tete p { margin-top: 4px; font-size: 13.5px; color: var(--texte-2); }
.rapide-tete .big-time { font-size: 44px; }
.rapide-h { margin: 16px 0 10px; font: 600 12px/1.3 var(--sans); color: var(--texte-2); letter-spacing: .04em; text-transform: uppercase; }
.rapide { display: grid; gap: 10px; }
.rapide--2 { grid-template-columns: 1fr 1fr; }
.rapide--3 { grid-template-columns: repeat(3, 1fr); }
.rapide-btn {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 10px;
  min-height: 88px; padding: 14px; border: 0; border-radius: var(--r-m);
  background: var(--surface); color: var(--texte); text-align: left; cursor: pointer;
  font: 500 14px/1.2 var(--sans); box-shadow: 0 1px 2px rgba(22, 34, 63, .05), 0 4px 14px rgba(22, 34, 63, .06);
  transition: transform 140ms var(--ease), background-color 160ms var(--ease);
}
.rapide--2 .rapide-btn { min-height: 96px; font-size: 15px; }
.rapide-btn svg { color: var(--nuit); }
.night .rapide-btn { box-shadow: none; }
.night .rapide-btn svg { color: var(--ocre); }
.rapide-btn:active { transform: scale(.97); background: var(--ocre-doux); color: var(--nuit); }
.rapide-btn:active svg { color: var(--nuit); }
.rapide + .btn { margin-top: 16px; }

/* Mode nuit : surfaces des écrans parents qui étaient crème */
.night .sheet-body { box-shadow: 0 -1px 0 var(--trait); }
.night .tuile, .night .rituel li { background: color-mix(in srgb, var(--creme) 8%, transparent); }
.night .rituel li span { background: var(--creme); color: var(--nuit); }
.night .bottomnav { box-shadow: 0 -1px 0 var(--trait); }
