@font-face {
  font-family: 'Newsreader';
  src: url('fonts/newsreader-normal.woff2') format('woff2');
  font-weight: 300 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Newsreader';
  src: url('fonts/newsreader-italic.woff2') format('woff2');
  font-weight: 300 700; font-style: italic; font-display: swap;
}

:root {
  --bg: #F6F0EA;
  --surface: #FFFDFB;
  --ink: #2A2027;
  --muted: #6C5E66;
  --line: #E6DAD1;
  --chip: #EFE5DD;
  --accent: #7A4A73;
  --accent-soft: #EBDCE8;
  --accent-ink: #FFFFFF;
  --flow: #BF3A50;
  --flow-soft: #F4D5DA;
  --sage: #5B8263;
  --warn: #FBEBDD;
  --warn-line: #E9C29F;
  --night: #261B29;
  --night-2: #3B2B3E;
  --night-ink: #F7EEE6;
  --night-muted: #C2B0BC;
  --pearl: #F1E1CF;
  --shadow: 0 1px 2px rgba(58, 30, 46, .05), 0 8px 24px -8px rgba(58, 30, 46, .12);
  --display: 'Newsreader', ui-serif, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
  --r: 22px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --sheet-ease: cubic-bezier(.32, .72, 0, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141016;
    --surface: #1E1820;
    --ink: #F2EAEE;
    --muted: #AE9EA7;
    --line: #33293A;
    --chip: #2A222D;
    --accent: #D3A7CB;
    --accent-soft: #3D2C3D;
    --accent-ink: #1C141E;
    --flow: #EA7383;
    --flow-soft: #4B2531;
    --sage: #93B898;
    --warn: #33251C;
    --warn-line: #5E4430;
    --night: #0C090E;
    --night-2: #2A1F2C;
    --shadow: 0 0 0 1px var(--line);
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 var(--sans);
  padding-top: env(safe-area-inset-top);
  overscroll-behavior-y: none;
  caret-color: var(--accent);
  -webkit-font-smoothing: antialiased;
}
body.locked { overflow: hidden; }
::selection { background: var(--accent-soft); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
#view { max-width: 560px; margin: 0 auto; padding: 4px 16px calc(104px + env(safe-area-inset-bottom)); }

h1, h2 { font-family: var(--display); font-weight: 560; margin: 0; text-wrap: balance; }
h1 { font-size: 36px; line-height: 1.05; letter-spacing: -.02em; font-variation-settings: "opsz" 72; }
h2 { font-size: 20px; line-height: 1.2; letter-spacing: -.01em; font-variation-settings: "opsz" 24; }
h3 { font: 600 13px/1.3 var(--sans); letter-spacing: .02em; color: var(--muted); margin: 24px 0 10px; }
p { margin: 6px 0; }
a { color: var(--accent); text-underline-offset: 3px; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.center { text-align: center; }
.fine { font-size: 12.5px; color: var(--muted); margin-top: 28px; }
.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.i.filled { fill: currentColor; }

.top { padding: 20px 52px 18px 2px; }
.top .date { color: var(--muted); margin: 0 0 6px; font-size: 14px; }
.top .date::first-letter { text-transform: uppercase; }
.top p.muted { margin-top: 8px; }

/* ---------- Boutons ---------- */
.btn {
  appearance: none; border: 0; font: 600 15px/1.2 var(--sans); color: var(--ink);
  background: var(--chip); padding: 11px 18px; border-radius: 999px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px;
  transition: transform .15s var(--ease), background-color .2s, color .2s;
}
.btn .i { width: 18px; height: 18px; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.on { background: var(--flow-soft); color: var(--flow); }
.btn.small { font-size: 14px; padding: 8px 14px; min-height: 38px; }
.btn.big { width: 100%; margin-top: 24px; min-height: 54px; font-size: 16px; }
.btn.danger { background: transparent; color: var(--flow); padding-left: 2px; margin-top: 14px; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.x {
  appearance: none; border: 0; background: var(--chip); color: var(--ink); width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; flex: none; cursor: pointer; transition: transform .15s var(--ease);
}
.x:active { transform: scale(.92); }
.x.small { width: 32px; height: 32px; background: transparent; color: var(--muted); }
.x.small .i { width: 16px; height: 16px; }
.linkish { appearance: none; border: 0; background: none; padding: 0; font: inherit; color: var(--ink); text-align: left; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px; cursor: pointer; }

/* ---------- Panneau de nuit : la lune ---------- */
.night {
  position: relative; overflow: hidden; isolation: isolate;
  background: radial-gradient(120% 80% at 50% 0%, var(--night-2) 0%, var(--night) 62%);
  color: var(--night-ink); border-radius: 30px; padding: 26px 22px 24px; text-align: center; margin-bottom: 14px;
  box-shadow: 0 18px 40px -22px rgba(38, 20, 40, .55);
}
.night::before { /* quelques étoiles, fixes */
  content: ''; position: absolute; inset: 0; z-index: -1; opacity: .55;
  background-image:
    radial-gradient(1px 1px at 12% 18%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 84% 12%, #fff 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 74% 36%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 22% 62%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 90% 70%, #fff 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 8% 86%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 52% 8%, #fff 50%, transparent 51%);
}
.night-label { color: var(--night-muted); font-size: 14px; margin: 0 0 4px; }
.moon { width: min(260px, 72vw); height: auto; display: block; margin: 0 auto; overflow: visible; }
.moon .shadow-disc { fill: #3A2C3D; stroke: rgba(255, 255, 255, .06); }
.moon .halo { opacity: .9; }
.moon .dot { fill: rgba(247, 238, 230, .26); }
.moon .dot.past { fill: rgba(247, 238, 230, .5); }
.moon .dot.flow { fill: #F0788A; }
.moon .dot.pred { fill: rgba(240, 120, 138, .45); }
.moon .dot.ovu { fill: #F6E7D6; stroke: #F6E7D6; stroke-width: 3; stroke-opacity: .3; }
.moon .dot.now { fill: var(--pearl); stroke: rgba(241, 225, 207, .35); stroke-width: 6; }
.moon .dot.now.flow { fill: #F0788A; stroke: rgba(240, 120, 138, .35); }
.night-day { display: flex; flex-direction: column; align-items: center; margin: 2px 0 6px; line-height: 1; }
.night-day .num { font: 600 64px/1 var(--display); letter-spacing: -.03em; font-variation-settings: "opsz" 72; font-variant-numeric: lining-nums; }
.night-day sup { font-size: 24px; vertical-align: top; position: relative; top: 6px; margin-left: 2px; letter-spacing: 0; }
.night-day > span:last-child { color: var(--night-muted); font-size: 15px; margin-top: 8px; }
.night-sub { max-width: 32ch; margin: 10px auto 0; font-size: 15.5px; line-height: 1.5; }
.night-sub .soft { color: var(--night-muted); }
.night-note { display: inline-flex; gap: 6px; align-items: center; color: var(--pearl); font-size: 14px; margin: 12px auto 0; }
.night-note .i { width: 17px; height: 17px; }
.btn.moonlit { margin-top: 18px; background: var(--pearl); color: #2A1E2B; }
.btn.moonlit.ghost { background: rgba(247, 238, 230, .1); color: var(--night-ink); box-shadow: inset 0 0 0 1px rgba(247, 238, 230, .2); }
@media (prefers-color-scheme: dark) { .night { box-shadow: inset 0 0 0 1px var(--line); } }

/* ---------- Blocs ---------- */
.note {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--chip); border-radius: 16px; padding: 13px 15px; margin: 0 0 12px; font-size: 14.5px;
}
.note .i { margin-top: 1px; color: var(--muted); }
.note.warn { background: var(--warn); box-shadow: inset 0 0 0 1px var(--warn-line); display: block; }
.journal { background: var(--surface); border-radius: var(--r); padding: 18px; margin-bottom: 8px; box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.tags { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { background: var(--accent-soft); color: var(--ink); font-size: 13.5px; padding: 5px 11px; border-radius: 999px; }
.menu, .move, .help, .row-link, .history, .block, .stat-intro { padding: 22px 2px 4px; border-top: 1px solid var(--line); margin-top: 18px; }
.journal + .menu, .journal + .row-link, .journal + .help { border-top: 0; margin-top: 8px; }
.row-link { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.row-link p { margin-top: 4px; }
.meals { list-style: none; padding: 0; margin: 10px 0 0; }
.meals li { display: flex; gap: 14px; align-items: baseline; padding: 6px 0; }
.slot-l { font-size: 12.5px; font-weight: 600; color: var(--muted); width: 3.2em; flex: none; letter-spacing: .02em; }
.help ul { padding-left: 18px; margin: 12px 0 0; }
.help li { margin: 9px 0; }
.help li::marker { color: var(--accent); }
.meter { display: flex; align-items: center; gap: 12px; margin: 14px 0 10px; font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bar { flex: 1; height: 8px; background: var(--chip); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--sage); border-radius: 99px; }
.dots-row { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.pip { width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--sage); }
.pip.on { background: var(--sage); }
.dots-row span:last-child { margin-left: 4px; }
.tip { margin: 26px 2px 0; padding: 20px 0 0; border-top: 1px solid var(--line); }
.tip p { font: italic 400 19px/1.45 var(--display); font-variation-settings: "opsz" 24; margin: 0; color: var(--ink); text-wrap: pretty; }
.tip p::before { content: 'Astuce du jour'; display: block; font: 600 13px var(--sans); color: var(--muted); margin-bottom: 8px; font-style: normal; }
.empty { color: var(--muted); text-align: center; padding: 28px 12px; }

/* ---------- Tab bar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; justify-content: space-around;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(20px); backdrop-filter: saturate(1.4) blur(20px);
  border-top: 1px solid var(--line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.tabbar button {
  flex: 1; appearance: none; border: 0; background: none; color: var(--muted); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px; font: 600 11px var(--sans); padding: 4px 0; min-height: 48px;
}
.tabbar svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s var(--ease); }
.tabbar button.on { color: var(--accent); }
.tabbar button.on svg { stroke-width: 2.1; transform: translateY(-1px); }
#lockbtn {
  position: absolute; top: calc(20px + env(safe-area-inset-top)); right: max(16px, calc(50% - 264px)); z-index: 5;
  appearance: none; border: 0; width: 40px; height: 40px; border-radius: 50%; background: var(--chip); color: var(--muted);
  display: grid; place-items: center; cursor: pointer;
}
#lockbtn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

/* ---------- Feuille ---------- */
#sheet { position: fixed; inset: 0; z-index: 20; }
.scrim { position: absolute; inset: 0; background: rgba(22, 10, 18, .4); opacity: 0; transition: opacity .32s; }
.sheet-body {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 92vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  max-width: 560px; margin: 0 auto;
  background: var(--surface); border-radius: 26px 26px 0 0; padding: 8px 18px calc(26px + env(safe-area-inset-bottom));
  transform: translateY(100%); transition: transform .42s var(--sheet-ease);
  overscroll-behavior: contain;
}
#sheet.open .scrim { opacity: 1; }
#sheet.open .sheet-body { transform: none; }
.grab { width: 38px; height: 5px; border-radius: 9px; background: var(--line); margin: 0 auto 10px; }
.sheet-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; position: sticky; top: -8px; background: var(--surface); padding: 8px 0 10px; z-index: 1; }
.sheet-h h2 { font-size: 24px; }
.sheet-h h2::first-letter { text-transform: uppercase; }

/* ---------- Contrôles du journal ---------- */
.seg { display: flex; gap: 3px; background: var(--chip); padding: 4px; border-radius: 15px; }
.seg button {
  flex: 1; appearance: none; border: 0; background: none; color: var(--ink); font: 500 13.5px var(--sans);
  padding: 9px 2px; border-radius: 11px; min-height: 40px; cursor: pointer; transition: background-color .2s, color .2s;
}
.seg button.on { background: var(--surface); box-shadow: 0 1px 3px rgba(40, 20, 30, .14); font-weight: 650; }
.seg.flow button.on { background: var(--flow); color: #fff; }
.seg.flow button:first-child.on { background: var(--surface); color: var(--ink); }
.seg.tabs { margin-bottom: 18px; }
.badge { display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-size: 11px; margin-left: 4px; }
.chips, .filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button, .filters button {
  appearance: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer;
  font: 500 14px var(--sans); padding: 8px 13px; border-radius: 999px; min-height: 38px; transition: background-color .2s, color .2s, border-color .2s;
}
.chips button.on, .filters button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.filters { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px 8px; padding: 0 16px 4px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filters button { flex: none; background: transparent; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stepper { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--chip); border-radius: 15px; padding: 4px; }
.stepper.wide { max-width: 260px; }
.stepper output { flex: 1; text-align: center; font-weight: 650; font-variant-numeric: tabular-nums; font-size: 15px; }
.stepper button { appearance: none; border: 0; width: 40px; height: 40px; border-radius: 11px; background: var(--surface); color: var(--ink); font-size: 21px; cursor: pointer; box-shadow: 0 1px 2px rgba(40, 20, 30, .1); }
.stepper + .chips { margin-top: 10px; }

input, select, textarea {
  font: inherit; font-size: 16px; color: var(--ink); background: var(--chip); border: 1px solid transparent;
  border-radius: 13px; padding: 11px 13px; width: 100%; transition: border-color .2s;
}
input::placeholder, textarea::placeholder { color: var(--muted); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
select { width: auto; margin-right: 6px; }
select.wide { width: 100%; }
.field { display: block; margin: 0 0 18px; }
.field > span:first-child { display: block; font-size: 14px; color: var(--muted); margin-bottom: 7px; }
.field small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 6px; }
.inline { display: flex; align-items: center; gap: 8px; }
.inline input { width: 130px; }
input[type=date] { min-height: 48px; -webkit-appearance: none; }
input[type=checkbox] { accent-color: var(--accent); }
.summary { display: grid; grid-template-columns: auto 1fr; gap: 12px 18px; margin: 8px 0 0; }
.summary dt { color: var(--muted); font-size: 14px; }
.summary dd { margin: 0; }

/* ---------- Calendrier ---------- */
.cal { background: var(--surface); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); }
.cal-h, .week-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 10px; }
.cal-h h2, .week-h h2 { text-align: center; }
.cal-h h2 { text-transform: capitalize; }
.grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.grid.wd span { text-align: center; font-size: 12px; color: var(--muted); font-weight: 600; padding-bottom: 4px; }
.day {
  position: relative; aspect-ratio: 1; appearance: none; border: 0; background: none; color: var(--ink); cursor: pointer;
  font: 500 15px var(--sans); border-radius: 50%; font-variant-numeric: tabular-nums;
}
.day:disabled { cursor: default; }
.day.flow { background: var(--flow); color: #fff; font-weight: 650; }
.day.spot { box-shadow: inset 0 0 0 2px var(--flow); }
.day.pred { background: var(--flow-soft); border-radius: 12px; }
.day.ovu { box-shadow: inset 0 0 0 2px var(--accent); }
.day.today { outline: 2px solid var(--ink); outline-offset: 2px; }
.day.future:not(.pred) { color: var(--muted); opacity: .55; }
.marks { position: absolute; bottom: 4px; left: 0; right: 0; display: flex; justify-content: center; gap: 3px; }
.marks i { width: 4px; height: 4px; border-radius: 50%; }
.m-note { background: var(--accent); }
.m-sex { background: var(--flow); box-shadow: 0 0 0 1.5px var(--surface); }
.day.flow .m-note { background: #fff; }
.day.flow .m-sex { background: #fff; box-shadow: none; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 16px; font-size: 12.5px; color: var(--muted); }
.legend span { display: flex; align-items: center; gap: 6px; }
.lg { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.lg.flow { background: var(--flow); }
.lg.spot { box-shadow: inset 0 0 0 2px var(--flow); }
.lg.pred { background: var(--flow-soft); border-radius: 4px; }
.lg.ovu { box-shadow: inset 0 0 0 2px var(--accent); }
.lg.sex { width: 6px; height: 6px; background: var(--flow); margin: 0 3px; }
.lg.journal-mark { width: 6px; height: 6px; background: var(--accent); margin: 0 3px; }
.list { list-style: none; padding: 0; margin: 10px 0 0; }
.list li { display: flex; flex-direction: column; padding: 11px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.list li .muted { font-size: 14px; }

/* ---------- Cuisine ---------- */
.intro { margin: 0 0 12px; }
.recipes { list-style: none; padding: 0; margin: 6px 0 0; }
.recipes li + li { border-top: 1px solid var(--line); }
.recipes button {
  position: relative; display: flex; flex-direction: column; gap: 3px; width: 100%; text-align: left; cursor: pointer;
  appearance: none; border: 0; background: none; color: inherit; font: inherit; padding: 15px 34px 15px 2px;
}
.r-cat { font-size: 12px; font-weight: 600; color: var(--accent); letter-spacing: .02em; }
.r-title { font: 560 19px/1.25 var(--display); font-variation-settings: "opsz" 24; letter-spacing: -.01em; }
.r-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; color: var(--muted); font-size: 13.5px; }
.r-meta .i { width: 15px; height: 15px; }
.r-meta.big { font-size: 14.5px; margin-top: 2px; }
.sep { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .5; margin: 0 4px; }
.fav-mark { position: absolute; right: 4px; top: 50%; margin-top: -10px; fill: var(--flow); stroke: var(--flow); }
.why { background: var(--accent-soft); padding: 13px 15px; border-radius: 15px; margin: 14px 0 4px; font-size: 15px; }
.ing { list-style: none; padding: 0; margin: 0; }
.ing li { border-bottom: 1px solid var(--line); }
.ing label, .shop label { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; cursor: pointer; flex: 1; }
.ing input, .shop input { width: 21px; height: 21px; flex: none; margin: 1px 0 0; }
.ing label:has(input:checked) span, .shop li.done span { color: var(--muted); text-decoration: line-through; }
.steps { padding-left: 22px; margin: 0; }
.steps li { padding: 6px 0; }
.steps li::marker { font-family: var(--display); color: var(--accent); font-weight: 600; }

.week { list-style: none; padding: 0; margin: 0; }
.week li { display: grid; grid-template-columns: 48px 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.week li:first-child { border-top: 0; }
.week li.is-past { opacity: .6; }
.w-day { display: flex; flex-direction: column; align-items: center; margin: 2px 0 0; line-height: 1.1; color: var(--muted); font-size: 12.5px; text-transform: capitalize; }
.w-day b { font: 600 22px var(--display); color: var(--ink); margin-top: 2px; }
.is-today .w-day, .is-today .w-day b { color: var(--accent); }
.w-slots { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.w-slot {
  appearance: none; border: 1px dashed var(--line); background: transparent; color: var(--ink); text-align: left; cursor: pointer;
  border-radius: 14px; padding: 9px 11px; min-height: 64px; display: flex; flex-direction: column; gap: 3px; font: inherit;
}
.w-slot.set { border-style: solid; border-color: transparent; background: var(--surface); box-shadow: var(--shadow); }
.w-slot .slot-l { width: auto; }
.w-t { font-size: 14px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.w-add { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13.5px; }
.w-add .i { width: 15px; height: 15px; }
.slot-pick { list-style: none; padding: 0; margin: 12px 0 0; }
.slot-pick li { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; align-items: center; padding: 6px 0; }
.sp-day { font-weight: 600; font-size: 14.5px; }
.slot-pick button { appearance: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 12px; padding: 9px; font: 600 14px var(--sans); cursor: pointer; display: flex; flex-direction: column; min-height: 44px; }
.slot-pick button.taken { background: var(--chip); border-color: transparent; }
.slot-pick small { font-weight: 400; color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.free, .add-item { display: flex; gap: 8px; margin: 6px 0 14px; }
.add-item .btn { width: 48px; padding: 0; flex: none; }
.pick { list-style: none; padding: 0; margin: 0; }
.pick button { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px; appearance: none; border: 0; border-top: 1px solid var(--line); background: none; color: var(--ink); font: inherit; text-align: left; padding: 13px 2px; cursor: pointer; }
.pick button.on { color: var(--accent); font-weight: 650; }
.pick small { color: var(--muted); flex: none; }
.shop-group h3 { margin-top: 18px; }
.shop-group .card-h h3 { margin: 18px 0 6px; }
.shop { list-style: none; padding: 0; margin: 0; }
.shop li { display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--line); }

/* ---------- Conseils ---------- */
.guides { border-top: 1px solid var(--line); }
.guide { border-bottom: 1px solid var(--line); }
.guide summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 2px; }
.guide summary::-webkit-details-marker { display: none; }
.guide .chev { color: var(--muted); transition: transform .3s var(--ease); }
.guide[open] .chev { transform: rotate(90deg); }
.guide-body { padding: 0 2px 18px; }
.g-intro { font-size: 16.5px; }
.guide ul { padding-left: 18px; margin: 10px 0 0; }
.guide li { margin: 9px 0; }
.guide li::marker { color: var(--accent); }
.sources { font-size: 13px; color: var(--muted); margin-top: 22px; }

/* ---------- Statistiques ---------- */
.stat-intro { border-top: 0; margin-top: 0; padding-top: 4px; }
.lede { font: 400 21px/1.45 var(--display); font-variation-settings: "opsz" 30; margin: 0 0 6px; text-wrap: pretty; }
.lede b { font-weight: 640; color: var(--accent); }
.chart { width: 100%; height: auto; margin-top: 12px; overflow: visible; }
.chart text { font: 10.5px var(--sans); fill: var(--muted); font-variant-numeric: tabular-nums; }
.chart .band { fill: var(--chip); }
.chart .in { fill: var(--accent); }
.chart .out { fill: var(--flow); }
.chart.temp .tline { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
.chart.temp circle { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
.chart.temp circle.hi { fill: var(--accent); }
.chart.temp .cover { stroke: var(--muted); stroke-dasharray: 3 4; }
.chart.temp .ovu-line { stroke: var(--flow); stroke-width: 1.5; stroke-dasharray: 2 3; }
.bars { list-style: none; padding: 0; margin: 12px 0 0; }
.bars li { display: grid; grid-template-columns: 9.5em 1fr 3em; align-items: center; gap: 10px; font-size: 14px; padding: 5px 0; }
.bars i { height: 8px; border-radius: 99px; background: linear-gradient(var(--accent), var(--accent)) left / var(--w) 100% no-repeat, var(--chip); }
.bars b { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.report { font-size: 14px; }
.report h1 { font-size: 22px; }
.report table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.report th, .report td { text-align: left; padding: 7px 4px; border-bottom: 1px solid var(--line); }

/* ---------- Écran de code et accueil ---------- */
.lock { min-height: calc(100svh - env(safe-area-inset-top) - 30px); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 20px 0 8px; }
.mini-moon { width: 76px; height: 76px; display: block; margin: 0 auto 18px; }
.mini-moon .shadow-disc { fill: var(--chip); }
.mini-lit { fill: var(--accent); }
.wordmark { font-size: 48px; letter-spacing: -.03em; font-variation-settings: "opsz" 72; }
.lock .lead { color: var(--muted); font-size: 17px; margin: 8px 0 26px; }
.who { display: grid; gap: 12px; width: 100%; max-width: 330px; }
.who button {
  appearance: none; border: 0; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; padding: 20px 22px; border-radius: var(--r);
  font: 560 24px var(--display); transition: transform .15s var(--ease);
}
.who button .i { color: var(--muted); }
.who button:active { transform: scale(.98); }
.back { appearance: none; border: 0; background: none; color: var(--accent); font: 600 15px var(--sans); align-self: flex-start; padding: 8px 0; margin-bottom: auto; cursor: pointer; display: inline-flex; align-items: center; gap: 2px; }
.back .i { width: 18px; height: 18px; }
.lock h1 { font-size: 40px; }
.pin-dots { display: flex; gap: 20px; margin: 2px 0 12px; }
.pin-dots span { width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--accent); transition: background-color .15s, transform .2s var(--ease); }
.pin-dots span.on { background: var(--accent); transform: scale(1.08); }
.pin-dots.busy span { animation: wait 1s var(--ease) infinite; }
.pin-dots.busy span:nth-child(2) { animation-delay: .1s; }
.pin-dots.busy span:nth-child(3) { animation-delay: .2s; }
.pin-dots.busy span:nth-child(4) { animation-delay: .3s; }
@keyframes wait { 50% { transform: translateY(-5px); } }
.pin-dots.shake { animation: shake .42s; }
@keyframes shake { 20%, 60% { transform: translateX(-9px); } 40%, 80% { transform: translateX(9px); } }
.lock-msg { min-height: 1.5em; color: var(--flow); font-size: 14.5px; margin: 0 0 16px; max-width: 30ch; }
.pad { display: grid; grid-template-columns: repeat(3, 76px); gap: 16px 26px; margin-bottom: auto; }
.pad button {
  appearance: none; border: 0; width: 76px; height: 76px; border-radius: 50%; background: var(--surface); color: var(--ink); cursor: pointer;
  box-shadow: var(--shadow); font: 400 30px var(--display); font-variant-numeric: lining-nums; transition: background-color .12s, transform .12s var(--ease);
}
.pad button:active { background: var(--accent-soft); transform: scale(.94); }
.pad button[data-del] { background: none; box-shadow: none; color: var(--muted); display: grid; place-items: center; }
.pad button[data-del] .i { width: 28px; height: 28px; }
.onb { padding: 32px 2px 20px; }
.onb .mini-moon { margin: 0 0 22px; }
.onb h1 { font-size: 40px; }
.lead { font-size: 17px; color: var(--muted); margin: 12px 0 28px; }

#toast {
  position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); transform: translate(-50%, 16px);
  background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: 999px; font-size: 14px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .35s var(--ease); z-index: 30; white-space: nowrap; max-width: calc(100vw - 32px);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

#print { display: none; }
@media print {
  body > *:not(#print) { display: none !important; }
  #print { display: block; color: #000; font: 12pt/1.4 Georgia, serif; }
  #print table { width: 100%; border-collapse: collapse; }
  #print th, #print td { text-align: left; border-bottom: 1px solid #ccc; padding: 4px; }
}
@media (max-width: 360px) {
  .pad { grid-template-columns: repeat(3, 68px); gap: 12px 20px; }
  .pad button { width: 68px; height: 68px; }
  .two { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
