/* web/tokens.css */
/* Design tokens (DESIGN §3.1). Both themes; the only layout media query of the app lives at the end. */
:root {
  color-scheme: light;
  /* theme jour */
  --bg:        oklch(0.985 0 0);
  --bg-2:      oklch(0.955 0.004 165);
  --surface:   oklch(1 0 0);
  --line:      oklch(0.90 0.006 165);
  --line-2:    oklch(0.82 0.008 165);
  --ink:       oklch(0.20 0.015 165);
  --ink-2:     oklch(0.42 0.015 165);
  --ink-3:     oklch(0.55 0.012 165);
  --accent:    oklch(0.48 0.11 165);
  --accent-2:  oklch(0.92 0.045 165);
  --accent-ink: oklch(0.99 0 0);
  /* data tones (meaning only) */
  --recov-hi:  oklch(0.535 0.14 150);        /* L moved from 0.58 for 4.5:1 as text (DESIGN §3.1 rule) */
  --recov-mid: oklch(0.55 0.115 85);         /* WHOOP yellow as readable amber; was 0.78 (1.9:1) */
  --recov-lo:  oklch(0.58 0.20 25);
  --work:      oklch(0.55 0.19 35);
  --rest:      oklch(0.52 0.13 155);
  --prep:      oklch(0.48 0.12 250);
  --caff:      oklch(0.50 0.10 60);
  --water:     oklch(0.54 0.12 230);
  --in:        var(--accent);
  --out:       oklch(0.50 0.10 290);
  --state-error:   oklch(0.52 0.19 25);
  --state-warn:    oklch(0.56 0.14 70);
  --state-ok:      var(--recov-hi);
  /* type */
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "DejaVu Sans Mono", monospace;
  --fs-0: 0.8125rem; --fs-1: 0.9375rem; --fs-2: 1.0625rem; --fs-3: 1.25rem;
  --fs-4: 1.5rem;   --fs-5: 1.875rem;  --fs-6: 2.5rem;  --fs-timer: clamp(64px, 18vw, 112px);
  /* space, radius, z */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px; --sp-7: 48px;
  --r-1: 6px; --r-2: 12px; --r-3: 20px; --r-pill: 999px;
  --z-sticky: 10; --z-sheet-backdrop: 20; --z-sheet: 30; --z-toast: 40; --z-tooltip: 50;
  /* motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 150ms; --t-base: 200ms; --t-slow: 400ms;
  --bp-two-pane: 900px;   /* informational; the media query below repeats the literal */
  /* chrome */
  --rail-w: 88px;
  --tabbar-h: 64px;
}

[data-theme="nuit"] {
  color-scheme: dark;
  --bg: oklch(0.17 0.01 165); --bg-2: oklch(0.21 0.012 165); --surface: oklch(0.23 0.012 165);
  --line: oklch(0.30 0.01 165); --line-2: oklch(0.38 0.012 165);
  --ink: oklch(0.94 0.005 165); --ink-2: oklch(0.74 0.01 165); --ink-3: oklch(0.62 0.01 165);
  --accent: oklch(0.72 0.11 165); --accent-2: oklch(0.30 0.05 165); --accent-ink: oklch(0.15 0.01 165);
  --work: oklch(0.68 0.17 35); --rest: oklch(0.70 0.12 155); --prep: oklch(0.66 0.10 250);
  /* data tones re-lit for the dark surface (≥ 4.5:1 on --surface) */
  --recov-hi: oklch(0.72 0.15 150); --recov-mid: oklch(0.80 0.15 90); --recov-lo: oklch(0.70 0.17 25);
  --caff: oklch(0.72 0.11 60); --water: oklch(0.72 0.11 230); --out: oklch(0.72 0.10 290);
  --state-error: oklch(0.70 0.17 25); --state-warn: oklch(0.78 0.14 70);
}

@media (prefers-reduced-motion: reduce) { :root { --t-fast: 0ms; --t-base: 0ms; --t-slow: 0ms; } }

/* Below the breakpoint the two panes stack; each screen's own `gap` separates them. */
.two-pane { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; }

/* The one layout breakpoint (--bp-two-pane), mirrored by web/ui/layout.ts. */
@media (min-width: 900px) {
  :root { --layout: two-pane; }
  .app[data-chrome="full"] { grid-template-columns: var(--rail-w) minmax(0, 1fr); }
  .app[data-chrome="full"] .rail { display: flex; }
  .app[data-chrome="full"] .tabbar { display: none; }
  .app[data-chrome="full"] .main-col { padding-bottom: 0; }
  .two-pane { display: grid; grid-template-columns: minmax(420px, 1fr) minmax(360px, 1fr); gap: var(--sp-6); align-items: start; }
  .content { padding: var(--sp-5) var(--sp-6) var(--sp-6); }
  .one-col { max-width: 760px; margin-inline: auto; }
  .sheet { margin: auto; width: min(560px, 90vw); border-radius: var(--r-3); }
  .sheet-handle { display: none; }
  .toasts { bottom: var(--sp-5); }
}

/* web/base.css */
/* Reset, typography, app frame, utilities (DESIGN §3.2–3.3). */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 var(--fs-2) / 1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1, h2, h3 { text-wrap: balance; line-height: 1.2; }
h1 { font-size: var(--fs-4); font-weight: 700; }
h2 { font-size: var(--fs-3); font-weight: 600; }
h3 { font-size: var(--fs-2); font-weight: 600; }
p, li { text-wrap: pretty; }
img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.caption { font-size: var(--fs-1); color: var(--ink-2); }
.muted { color: var(--ink-3); }
.prose { max-width: 68ch; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link { position: absolute; left: -9999px; top: 0; z-index: var(--z-tooltip); background: var(--surface); padding: var(--sp-2) var(--sp-3); }
.skip-link:focus { left: var(--sp-2); top: var(--sp-2); }

/* sections and tiles */
.section { display: grid; gap: var(--sp-3); margin-block-end: var(--sp-6); }
.section-title { font-size: var(--fs-3); font-weight: 600; }
.stack { display: grid; gap: var(--sp-3); }
.row { display: flex; align-items: center; gap: var(--sp-3); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2); padding: var(--sp-4); }
.list > li { min-height: 56px; display: flex; align-items: center; gap: var(--sp-3); border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.source-agent { font-size: var(--fs-0); color: var(--ink-2); }
/* inline icons keep their box in flex rows: a long label squeezed the « Fermer » X and button icons to a 2 px sliver at 412 */
svg.icon { flex: none; }

/* app frame: mobile first (tab bar); tokens.css switches to the rail at 900 px */
.app { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); }
.main-col { min-width: 0; display: flex; flex-direction: column; padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
.content { flex: 1; padding: var(--sp-4) var(--sp-4) var(--sp-6); outline: none; }
.topbar { padding: var(--sp-4) var(--sp-4) 0; }
.screen-title { font-size: var(--fs-4); font-weight: 700; }
.taskbar { display: none; }

.rail {
  display: none;
  position: sticky; top: 0; height: 100dvh;
  flex-direction: column; justify-content: space-between;
  background: var(--bg-2); border-right: 1px solid var(--line);
  padding: var(--sp-3) 0;
}
.rail-items, .rail-bottom { display: grid; gap: var(--sp-1); }
.rail-item, .tab-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 64px; padding: var(--sp-2) var(--sp-1);
  color: var(--ink-2); text-decoration: none; font-size: 11px; font-weight: 600;
  background: none; border: 0; border-radius: var(--r-2);
  transition: color var(--t-fast) var(--ease-out), background-color var(--t-fast) var(--ease-out);
}
.rail-item { margin-inline: var(--sp-2); }
.rail-item:hover, .tab-item:hover { color: var(--ink); background: color-mix(in oklch, var(--accent-2) 50%, transparent); }
.rail-item.is-active, .tab-item.is-active { color: var(--accent); background: var(--accent-2); }
.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: var(--z-sticky);
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--bg-2); border-top: 1px solid var(--line);
}
.tab-item { border-radius: 0; min-height: var(--tabbar-h); }

/* task chrome: no rail, no tab bar, top bar with « Fermer » */
.app[data-chrome="task"] .rail, .app[data-chrome="task"] .tabbar, .app[data-chrome="task"] .topbar,
.app[data-chrome="bare"] .rail, .app[data-chrome="bare"] .tabbar, .app[data-chrome="bare"] .topbar { display: none; }
.app[data-chrome="task"] .main-col, .app[data-chrome="bare"] .main-col { padding-bottom: env(safe-area-inset-bottom); }
.app[data-chrome="task"] .taskbar {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  position: sticky; top: 0; z-index: var(--z-sticky);
  min-height: 56px; padding: 0 var(--sp-2); background: var(--bg); border-bottom: 1px solid var(--line);
}
.taskbar-close {
  justify-self: start; display: inline-flex; align-items: center; gap: var(--sp-2);
  min-height: 48px; padding: 0 var(--sp-3); border: 0; border-radius: var(--r-2); background: none; font-weight: 600;
}
.taskbar-close:hover { background: var(--bg-2); }
.taskbar-title { min-width: 0; font-size: var(--fs-2); font-weight: 600; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.offline-banner {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4); background: var(--bg-2); color: var(--ink-2);
  font-size: var(--fs-1); border-bottom: 1px solid var(--line);
}

/* connexion */
.auth { min-height: 80dvh; display: grid; place-content: center; justify-items: center; gap: var(--sp-4); text-align: center; padding: var(--sp-5); max-width: 440px; margin-inline: auto; }
.auth-mark { width: 72px; height: 72px; display: grid; place-items: center; border-radius: var(--r-3); background: var(--accent-2); color: var(--accent); }
.auth-title { font-size: var(--fs-5); }
.auth-lead { color: var(--ink-2); }
.auth .btn { width: 100%; }
.auth-error { color: var(--state-error); min-height: 1.5em; }

/* web/ui/ui.css */
/* Shared components (DESIGN §2.5). Every control: default, hover, focus-visible, active, disabled, loading. */

/* button */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: 48px; padding: 0 var(--sp-4); border-radius: var(--r-2); border: 1px solid transparent;
  font-weight: 600; line-height: 1.2; text-decoration: none; user-select: none;
  transition: background-color var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out), transform var(--t-fast) var(--ease-out);
}
.btn-lg { min-height: 56px; padding: 0 var(--sp-5); font-size: var(--fs-2); }
.btn-icon { padding: 0; width: 48px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: color-mix(in oklch, var(--accent) 88%, var(--ink)); }
.btn-secondary { background: var(--surface); border-color: var(--line-2); color: var(--ink); }
.btn-secondary:hover { border-color: var(--ink-3); background: var(--bg-2); }
.btn-ghost { background: none; color: var(--ink); }
.btn-ghost:hover { background: var(--bg-2); }
.btn-danger { background: var(--surface); border-color: var(--state-error); color: var(--state-error); }
.btn-danger:hover { background: color-mix(in oklch, var(--state-error) 10%, var(--surface)); }
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.is-loading { color: transparent; opacity: 1; cursor: progress; }
.btn.is-loading::after {
  content: ""; position: absolute; inset: 50% auto auto 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px;
  border-radius: 50%; border: 2px solid currentColor; border-color: var(--ink-3) transparent var(--ink-3) transparent;
  animation: btn-spin 700ms linear infinite;
}
.btn-primary.is-loading::after { border-color: var(--accent-ink) transparent var(--accent-ink) transparent; }
@keyframes btn-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .btn.is-loading::after { animation-duration: 2s; } }

/* field */
.field { display: grid; gap: var(--sp-1); }
.field-label { font-size: var(--fs-1); font-weight: 600; color: var(--ink-2); }
.input {
  min-height: 48px; width: 100%; padding: var(--sp-2) var(--sp-3);
  background: var(--surface); color: var(--ink); border: 1px solid var(--line-2); border-radius: var(--r-2);
  transition: border-color var(--t-fast) var(--ease-out);
}
.input::placeholder { color: var(--ink-3); }
.input:hover { border-color: var(--ink-3); }
.input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-color: var(--accent); }
.input:disabled { opacity: 0.5; }
textarea.input { min-height: 96px; resize: vertical; }
.field-hint { font-size: var(--fs-1); color: var(--ink-2); }
.field-error { font-size: var(--fs-1); color: var(--state-error); min-height: 0; }
.field-error:empty { display: none; }
.field.has-error .input { border-color: var(--state-error); }

/* stepper */
.stepper { display: inline-grid; grid-template-columns: 56px minmax(88px, auto) 56px; align-items: center; border: 1px solid var(--line-2); border-radius: var(--r-2); background: var(--surface); }
.stepper-btn { width: 56px; height: 56px; display: grid; place-items: center; background: none; border: 0; border-radius: var(--r-2); touch-action: manipulation; }
.stepper-btn:hover { background: var(--bg-2); }
.stepper-btn:active:not(:disabled) { background: var(--accent-2); }
.stepper-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.stepper-value { text-align: center; font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: var(--fs-3); font-weight: 600; }

/* segmented */
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--bg-2); border-radius: var(--r-2); border: 1px solid var(--line); max-width: 100%; overflow-x: auto; }
.seg-btn { min-height: 44px; padding: 0 var(--sp-4); border: 0; border-radius: calc(var(--r-2) - 3px); background: none; color: var(--ink-2); font-weight: 600; white-space: nowrap; transition: background-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out); }
.seg-btn:hover { color: var(--ink); }
.seg-btn[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px oklch(0 0 0 / 0.08); }

/* chips (rating, quick logs) */
.chip { min-height: 44px; padding: 0 var(--sp-4); border-radius: var(--r-pill); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-weight: 600; transition: background-color var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out); }
.chip:hover { border-color: var(--ink-3); }
.chip[aria-pressed="true"] { background: var(--accent-2); border-color: var(--accent); color: var(--ink); }
.chip:disabled { opacity: 0.45; }
.rating-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); }

/* sheet */
.sheet {
  padding: 0; border: 0; background: var(--surface); color: var(--ink);
  width: 100%; max-width: 100%; max-height: 90dvh; margin: auto 0 0 0;
  border-radius: var(--r-3) var(--r-3) 0 0; box-shadow: 0 -8px 32px oklch(0 0 0 / 0.18);
}
.sheet::backdrop { background: oklch(0.2 0.01 165 / 0.45); }
.sheet[open] { animation: sheet-in var(--t-base) var(--ease-out); }
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } }
.sheet-panel { display: grid; gap: var(--sp-4); padding: var(--sp-3) var(--sp-4) calc(var(--sp-4) + env(safe-area-inset-bottom)); }
.sheet-handle { width: 40px; height: 4px; border-radius: var(--r-pill); background: var(--line-2); justify-self: center; }
.sheet-title { font-size: var(--fs-3); }
.sheet-body { overflow-y: auto; max-height: 60dvh; display: grid; gap: var(--sp-3); }
.sheet-actions { display: flex; justify-content: flex-end; gap: var(--sp-2); flex-wrap: wrap; }
.sheet-list { display: grid; }
.sheet-row { width: 100%; min-height: 56px; display: grid; grid-template-columns: 24px 1fr 20px; align-items: center; gap: var(--sp-3); padding: 0 var(--sp-2); background: none; border: 0; border-bottom: 1px solid var(--line); text-align: left; font-weight: 600; }
.sheet-row:hover { background: var(--bg-2); }

/* ring */
.ring { display: inline-grid; justify-items: center; gap: var(--sp-1); }
.ring-figure { position: relative; width: var(--ring-size); height: var(--ring-size); }
.ring-track { stroke: var(--line); }
.ring-arc { transition: stroke-dashoffset var(--t-slow) var(--ease-out); }
.ring-center { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 700; font-size: var(--fs-3); }
.ring-label { font-weight: 600; font-size: var(--fs-1); }
.ring-sublabel { font-size: var(--fs-0); color: var(--ink-2); }

/* bar */
.bar { display: grid; gap: var(--sp-1); }
.bar-head { display: flex; justify-content: space-between; gap: var(--sp-2); font-size: var(--fs-1); }
.bar-label { font-weight: 600; }
.bar-sublabel { color: var(--ink-2); }
.bar-track { height: 10px; border-radius: var(--r-pill); background: var(--line); overflow: hidden; }
.bar-fill { height: 100%; transform-origin: left; border-radius: var(--r-pill); transition: transform var(--t-slow) var(--ease-out); }
.bar.is-over .bar-sublabel { color: var(--state-warn); }

/* charts */
.chart { position: relative; width: 100%; }
.chart-svg { width: 100%; }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.chart-axis { fill: var(--ink-2); font-size: 12px; font-family: var(--mono); }
.chart-line { fill: none; stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; }
.chart-line.is-dashed { stroke-dasharray: 6 5; }
.chart-dot.is-faint { opacity: 0.35; }
.chart-ref { stroke: var(--ink-3); stroke-dasharray: 4 4; stroke-width: 1.5; }
.chart-marker { stroke: var(--state-warn); stroke-dasharray: 5 4; stroke-width: 1.5; }
.chart-marker-label { fill: var(--ink-2); font-size: 12px; }
.chart-bar { transition: opacity var(--t-fast) var(--ease-out); }
.chart-hit { fill: transparent; cursor: pointer; }
.chart-hit:focus-visible { outline: none; stroke: var(--accent); stroke-width: 2; }
.chart-tip {
  position: absolute; z-index: var(--z-tooltip); transform: translate(-50%, calc(-100% - 10px));
  padding: var(--sp-1) var(--sp-2); border-radius: var(--r-1); background: var(--ink); color: var(--bg);
  font-size: var(--fs-0); white-space: nowrap; pointer-events: none;
}

/* day nav */
.daynav { display: flex; align-items: center; gap: var(--sp-1); flex-wrap: wrap; }
.daynav-btn { width: 48px; height: 48px; display: grid; place-items: center; border: 0; border-radius: var(--r-2); background: none; }
.daynav-btn:hover { background: var(--bg-2); }
.daynav-btn:disabled { opacity: 0.3; cursor: default; }
.daynav-label { min-width: 11ch; text-align: center; font-weight: 600; }
.daynav-today { min-height: 44px; padding: 0 var(--sp-3); border: 1px solid var(--line-2); border-radius: var(--r-pill); background: var(--surface); font-weight: 600; font-size: var(--fs-1); }
.daynav-today:hover { border-color: var(--ink-3); }

/* toast */
.toasts { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + var(--sp-3)); transform: translateX(-50%); z-index: var(--z-toast); width: min(560px, calc(100vw - 32px)); }
.toast { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border-radius: var(--r-2); background: var(--ink); color: var(--bg); box-shadow: 0 6px 24px oklch(0 0 0 / 0.2); animation: toast-in var(--t-base) var(--ease-out); }
.toast-error { background: var(--state-error); color: oklch(0.99 0 0); }
.toast-msg { flex: 1; }
.toast-action { min-height: 44px; padding: 0 var(--sp-3); border: 0; border-radius: var(--r-1); background: none; color: inherit; font-weight: 700; text-decoration: underline; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

/* empty + skeleton */
.empty { display: grid; justify-items: start; gap: var(--sp-3); padding: var(--sp-5) 0; max-width: 52ch; }
.empty-title { font-size: var(--fs-3); }
.empty-body { color: var(--ink-2); }
.screen-loading { display: grid; gap: var(--sp-3); }
.skeleton { border-radius: var(--r-2); background: linear-gradient(90deg, var(--bg-2), var(--line), var(--bg-2)); background-size: 200% 100%; animation: sk 1.4s ease-in-out infinite; }
.skeleton-line { height: 16px; width: 60%; }
.skeleton-row { height: 56px; }
.skeleton-block { height: 160px; }
.skeleton-ring { width: 96px; height: 96px; border-radius: 50%; }
@keyframes sk { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }

/* inline rows (push / install prompts) */
.inline-row { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border: 1px solid var(--line); border-radius: var(--r-2); background: var(--surface); flex-wrap: wrap; }
.inline-row-text { flex: 1; min-width: 12ch; font-weight: 600; }
.inline-hint { display: flex; align-items: center; gap: var(--sp-2); color: var(--ink-2); font-size: var(--fs-1); }

/* player clock (muscu-duo header) */
.clock { --phase: var(--prep); display: grid; gap: var(--sp-1); padding: var(--sp-4); border-radius: var(--r-3); background: var(--phase); color: oklch(0.99 0 0); transition: background-color var(--t-base) var(--ease-out); }
.clock[data-phase="work"] { --phase: var(--work); }
.clock[data-phase="rest"] { --phase: var(--rest); }
.clock[data-phase="done"] { --phase: var(--accent); }
[data-theme="nuit"] .clock { color: oklch(0.15 0.01 165); }
.clock-head { display: flex; justify-content: space-between; gap: var(--sp-2); font-weight: 600; }
.clock-time { font-size: var(--fs-timer); font-weight: 700; line-height: 1; letter-spacing: -0.02em; }
.clock-sub { font-size: var(--fs-1); opacity: 0.9; }
.clock-progress { height: 6px; border-radius: var(--r-pill); background: oklch(1 0 0 / 0.3); overflow: hidden; }
.clock-progress-fill { height: 100%; background: currentColor; transform-origin: left; transform: scaleX(0); transition: transform 250ms linear; }
@media (prefers-reduced-motion: reduce) { .clock-progress-fill { transition: none; } }

/* figure */
.figure { display: grid; place-items: center; color: var(--ink); }
.figure svg { width: 100%; max-width: 280px; height: auto; }

/* photo capture */
.photo-capture { display: grid; gap: var(--sp-3); }
.photo-stage { position: relative; aspect-ratio: 3 / 4; border-radius: var(--r-2); overflow: hidden; background: var(--bg-2); }
.photo-video { width: 100%; height: 100%; object-fit: cover; }
.photo-ghost { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.3; pointer-events: none; }
.photo-guide { position: absolute; inset: 6%; width: 88%; height: 88%; fill: none; stroke: oklch(1 0 0 / 0.85); stroke-width: 0.8; stroke-dasharray: 3 2; pointer-events: none; filter: drop-shadow(0 0 1px oklch(0 0 0 / 0.6)); }

/* web/screens/boissons.css */
/* S2 Boissons (DESIGN §5.4). .bottle, .drink-chips, .caffeine-line are unscoped: the
   cockpit (S4) renders them too. The bottle is the one tile of the screen. */

.bottle {
  display: flex;
  gap: var(--sp-5);
  align-items: center;
  padding: var(--sp-4);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: var(--surface);
}
.bottle-hit {
  flex: none;
  cursor: pointer;
  border-radius: var(--r-2);
  touch-action: manipulation;
}
.bottle-hit:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.bottle-svg {
  display: block;
  overflow: visible;
}
.bottle-fill {
  fill: var(--water);
  transition: transform var(--t-slow) var(--ease-out);
}
.bottle-outline {
  fill: none;
  stroke: var(--ink-2);
  stroke-width: 2;
  stroke-linejoin: round;
}
.bottle-hit:hover .bottle-outline {
  stroke: var(--accent);
}
.bottle-mark {
  stroke: var(--ink-3);
  stroke-width: 1.5;
  stroke-linecap: round;
}
.bottle-side {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  min-width: 0;
}
.bottle-level {
  font-size: var(--fs-4);
  font-weight: 700;
}
.bottle-actions {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
}
.hydration {
  margin-top: var(--sp-3);
}
/* the long « dont +0,35 L pour l'entraînement… » sublabel wraps under the figure instead of splitting « Aujourd'hui : 1,68 L / 2,35 L » over three lines at 412 */
.hydration .bar-head {
  flex-wrap: wrap;
}
.hydration .bar-label {
  white-space: nowrap;
}

.drink-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}
.drink-chips .chip {
  touch-action: manipulation;
  -webkit-touch-callout: none;
}

.caffeine-line {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  margin: 0;
  font-size: var(--fs-1);
}
.caffeine-line.warn {
  color: var(--state-warn);
  font-weight: 600;
}

.caffeine-totals {
  margin: 0 0 var(--sp-2);
}
.caffeine-totals strong {
  font-size: var(--fs-4);
  color: var(--caff);
}
.caffeine-totals.warn strong {
  color: var(--state-warn);
}
.caffeine-timeline {
  display: block;
  width: 100%;
  min-height: 170px;
}
.caffeine-timeline-svg {
  display: block;
}
.tl-late {
  fill: var(--state-warn);
  opacity: 0.1;
}
.tl-axis {
  stroke: var(--line-2);
}
.tl-tick {
  fill: var(--ink-2);
  font-size: 12px;
  font-family: var(--mono);
}
.tl-label {
  fill: var(--state-warn);
  font-size: 12px;
  font-weight: 600;
}
.tl-area {
  fill: var(--caff);
  opacity: 0.12;
}
.tl-curve {
  fill: none;
  stroke: var(--caff);
  stroke-width: 2.5;
  stroke-linejoin: round;
}
.tl-cutoff {
  stroke: var(--state-warn);
  stroke-width: 2;
  stroke-dasharray: 5 4;
}
.tl-now {
  stroke: var(--ink-3);
  stroke-width: 1.5;
}
.tl-dot {
  fill: var(--surface);
  stroke: var(--caff);
  stroke-width: 3;
}
.tl-dot.late {
  stroke: var(--state-warn);
}
.caffeine-bedtime {
  font-weight: 600;
  margin: var(--sp-2) 0 var(--sp-1);
}
.late-list {
  margin-top: var(--sp-3);
}
.late-list h3 {
  font-size: var(--fs-2);
  margin: 0 0 var(--sp-1);
}
.late-list p {
  margin: 0;
}

.drink-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.drink-row {
  display: grid;
  grid-template-columns: auto 1fr auto 44px;
  gap: var(--sp-3);
  align-items: center;
  min-height: 56px;
  border-bottom: 1px solid var(--line);
}
.drink-row.late .drink-time {
  color: var(--state-warn);
  font-weight: 600;
}
.drink-amount {
  color: var(--ink-2);
  font-size: var(--fs-1);
}

.suggestions {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.suggestion {
  margin: 0;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-2);
  background: var(--accent-2);
  max-width: 68ch;
}
.suggestion p {
  margin: 0 0 var(--sp-2);
}
.suggestion-title {
  font-weight: 600;
}
.suggestion footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
}
.suggestion-actions {
  display: flex;
  gap: var(--sp-2);
  margin-left: auto;
}

.trends-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
  margin-bottom: var(--sp-3);
}
.trends-head h2 {
  margin: 0;
}
.trend-charts h3 {
  font-size: var(--fs-1);
  font-weight: 600;
  color: var(--ink-2);
  margin: var(--sp-3) 0 var(--sp-1);
}
.field-like {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}
.field-label {
  font-size: var(--fs-1);
  font-weight: 600;
}

/* web/screens/bouger.css */
/* S3: Bouger, session preview, players, bilan. Tokens from web/tokens.css only. */

.bouger { display: grid; gap: var(--sp-4); }
.bouger-body { display: grid; gap: var(--sp-4); min-width: 0; }
.grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.stack-tight { display: grid; gap: var(--sp-2); }
.move-sentence { font-size: var(--fs-3); line-height: 1.35; text-wrap: balance; max-width: 68ch; }
.move-sentence[data-band="rouge"] { color: var(--ink); }
.tag { display: inline-flex; align-items: center; min-height: 28px; padding: 0 var(--sp-2); border-radius: var(--r-1); background: var(--bg-2); color: var(--ink-2); font-size: var(--fs-0); font-family: var(--mono); }
.chips { display: flex; flex-wrap: wrap; gap: var(--sp-1); }
.badge { display: inline-flex; align-items: center; min-height: 24px; padding: 0 var(--sp-2); border-radius: var(--r-pill); background: var(--accent); color: var(--accent-ink); font-size: var(--fs-0); font-weight: 600; }
.flag { color: var(--state-warn); font-weight: 600; font-size: var(--fs-1); }
.link-btn { justify-self: start; min-height: 44px; padding: 0; border: 0; background: none; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; }
.link-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* programme list */
.program-list { display: grid; gap: var(--sp-2); }
.program-row { display: grid; gap: var(--sp-1); width: 100%; text-align: start; padding: var(--sp-3) var(--sp-4); border: 1px solid var(--line); border-radius: var(--r-2); background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; transition: border-color var(--t-fast) var(--ease-out), background-color var(--t-fast) var(--ease-out); }
.program-row:hover { border-color: var(--line-2); }
.program-row:active { background: var(--bg-2); }
.program-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.program-row.suggested { background: var(--accent-2); border-color: var(--accent); }
.program-row.selected { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.program-head { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.program-name { font-weight: 600; font-size: var(--fs-2); flex: 1; min-width: 0; }
.program-goal { color: var(--ink-2); font-size: var(--fs-1); }
.preview-pane { position: sticky; top: var(--sp-4); }
.resume { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.history-row { display: flex; align-items: center; gap: var(--sp-3); width: 100%; min-height: 56px; padding: var(--sp-2) 0; border: 0; background: none; color: var(--ink); font: inherit; text-align: start; cursor: pointer; }
.history-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* preview */
.program-preview { gap: var(--sp-4); }
.preview-title { font-size: var(--fs-4); font-weight: 700; text-wrap: balance; }
.gear-check { display: grid; gap: var(--sp-1); border: 0; padding: 0; margin: 0; }
.gear-check legend { font-weight: 600; margin-bottom: var(--sp-1); }
.gear-check label { min-height: 44px; }
.gear-check input, .micro-settings input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--accent); }
.table-wrap { overflow-x: auto; }
.block-table { width: 100%; border-collapse: collapse; font-size: var(--fs-1); }
.block-table th, .block-table td { text-align: start; padding: var(--sp-2); border-bottom: 1px solid var(--line); vertical-align: top; }
.block-table th { color: var(--ink-2); font-weight: 600; font-size: var(--fs-0); }
.block-table td.num { font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.block-table tr.cur { background: var(--accent-2); }
.preview-actions { display: grid; gap: var(--sp-2); }
@media (max-width: 899px) {
  .block-table .col-gear { display: none; }
  .seance-screen .preview-actions { position: sticky; bottom: 0; padding: var(--sp-3) 0 calc(var(--sp-3) + env(safe-area-inset-bottom)); background: var(--bg); }
}

/* micro-doses */
.micro-rows { display: grid; gap: var(--sp-2); }
.micro-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto auto; align-items: center; gap: var(--sp-3); min-height: 88px; border-bottom: 1px solid var(--line); padding-block: var(--sp-2); }
.micro-row:last-child { border-bottom: 0; }
.micro-fig { width: 56px; }
.micro-text { display: grid; gap: 2px; min-width: 0; }
.micro-name { font-weight: 600; }
.micro-add { min-width: 72px; min-height: 56px; font-size: var(--fs-3); font-family: var(--mono); font-variant-numeric: tabular-nums; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.micro-events li { gap: var(--sp-3); }
.micro-settings { display: grid; gap: var(--sp-3); border: 1px solid var(--line); border-radius: var(--r-2); padding: var(--sp-3) var(--sp-4); margin: 0; }
.micro-settings legend { font-weight: 600; padding: 0 var(--sp-1); }
.micro-settings label.row { min-height: 44px; }

/* routines */
.list > li.routine-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; column-gap: var(--sp-3); row-gap: var(--sp-2); padding-block: var(--sp-3); }
.routine-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r-2); background: var(--bg-2); color: var(--ink-2); flex: none; }
.routine-name { font-weight: 600; }

/* players */
.player { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-4); max-width: 1100px; margin-inline: auto; }
/* sticks under the task bar (56 px, base.css) so « Fermer », the one exit, stays reachable when the page scrolls */
.player-top { position: sticky; top: 56px; z-index: var(--z-sticky); display: grid; gap: var(--sp-2); padding-block: var(--sp-2); background: var(--bg); }
.player-title { font-weight: 600; color: var(--ink-2); }
.player-controls { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: var(--sp-2); }
.player-controls .btn { padding-inline: var(--sp-2); }
.player-controls .btn { min-height: 56px; }
.player-main { display: grid; gap: var(--sp-5); }
.player-page-host { position: relative; display: grid; min-width: 0; overflow-x: clip; }
.player-page-host > .player-page { grid-area: 1 / 1; }
.player-page-host > .leaving { pointer-events: none; }
.player-page { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: var(--sp-4); align-items: start; }
.player-figure { width: 160px; }
.player-text { display: grid; gap: var(--sp-2); align-content: start; min-width: 0; }
.player-kicker { color: var(--ink-2); font-weight: 600; }
.player-ex { font-size: var(--fs-5); font-weight: 700; line-height: 1.15; text-wrap: balance; overflow-wrap: anywhere; }
.player-cue { font-size: var(--fs-3); }
.player-tip { color: var(--ink-2); }
.gear { justify-self: start; }
.fait-wrap { display: grid; gap: var(--sp-1); margin-top: var(--sp-2); }
.player-fait { min-height: 72px; font-size: var(--fs-4); touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.player-page.kind-rest .player-figure { opacity: 0.7; }
@media (min-width: 900px) {
  .player-main { grid-template-columns: minmax(0, 1.2fr) minmax(300px, 1fr); align-items: start; }
  .player-page { grid-template-columns: 200px minmax(0, 1fr); }
  .player-figure { width: 200px; }
}
@media (max-width: 420px) {
  .player-page { grid-template-columns: 120px minmax(0, 1fr); }
  .player-figure { width: 120px; }
}

/* bilan */
.bilan { max-width: 760px; margin-inline: auto; }
.rpe-row { display: grid; grid-template-columns: repeat(10, minmax(44px, 1fr)); gap: var(--sp-1); }
.rpe-chip { display: grid; place-items: center; min-height: 44px; min-width: 44px; padding: var(--sp-1) 0; border-radius: var(--r-2); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-weight: 700; font-size: var(--fs-2); cursor: pointer; transition: background-color var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out); }
.rpe-chip small { font-size: 0.6875rem; font-weight: 600; color: var(--ink-2); font-family: var(--sans); }
.rpe-chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.rpe-chip[aria-pressed="true"] small { color: var(--accent-ink); }
.rpe-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 480px) { .rpe-row { grid-template-columns: repeat(5, 1fr); } }
.bilan-ex { align-items: flex-start !important; padding-block: var(--sp-3); }
.bilan-fig { width: 64px; flex: none; }
.bilan-name { font-weight: 600; }
.rating-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); }

/* routine player */
.routine-page .player-figure { opacity: 0.95; }
.breath-page { grid-template-columns: 1fr; justify-items: center; text-align: center; }
.breath-stage { display: grid; place-items: center; width: min(78vw, 360px); aspect-ratio: 1; }
.breath-circle { display: grid; place-items: center; width: 56%; aspect-ratio: 1; border-radius: 50%; background: var(--accent-2); border: 2px solid var(--accent); will-change: transform; }
.breath-word { font-size: var(--fs-3); font-weight: 600; color: var(--ink); }
.routine-rating { display: grid; gap: var(--sp-2); }
.dim-overlay { position: fixed; inset: 0; z-index: var(--z-sheet); display: grid; place-content: center; justify-items: center; gap: var(--sp-4); background: oklch(0 0 0 / 0.7); cursor: pointer; }
.dim-overlay[hidden] { display: none; }
.dim-time { font-size: var(--fs-6); color: oklch(0.6 0 0); }
.dim-prompt { color: oklch(0.7 0 0); font-size: var(--fs-3); opacity: 0; transition: opacity 1.2s var(--ease-out); }
.dim-prompt.show { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .dim-prompt { transition: none; } }
.labelled { display: grid; gap: var(--sp-1); }
.routine-player .player-main { grid-template-columns: minmax(0, 1fr); max-width: 760px; width: 100%; margin-inline: auto; }
.routine-player.dimmed > :not(.dim-overlay) { visibility: hidden; }
.med-chooser { grid-column: 2 / -1; display: grid; gap: var(--sp-1); justify-items: start; }

/* web/screens/cockpit.css */
/* S4 cockpit (DESIGN §7.1). Sections separated by space + heading, no tiles except the bottle. */
.cockpit {
  padding: var(--sp-4);
  gap: var(--sp-6);
}
.cockpit .pane {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
  min-width: 0;
}
.cockpit-lede {
  font-size: var(--fs-3);
  line-height: 1.35;
  margin: 0;
  text-wrap: balance;
  max-width: 68ch;
  grid-column: 1 / -1;
}
.cockpit-lede button.lede-link {
  all: unset;
  cursor: pointer;
  border-radius: var(--r-1);
}
.cockpit-lede button.lede-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.cockpit section > h2 {
  font-size: var(--fs-3);
  font-weight: 600;
  margin: 0 0 var(--sp-3);
}
.band-vert { color: var(--recov-hi); }
.band-jaune { color: var(--recov-mid); }
.band-rouge { color: var(--recov-lo); }

.night-figures {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-3);
  align-items: center;
}
.night-figure {
  all: unset;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-1);
  min-height: 56px;
  cursor: pointer;
  border-radius: var(--r-2);
  padding: var(--sp-2);
  transition: background var(--t-fast) var(--ease-out);
}
.night-figure:hover { background: var(--bg-2); }
.night-figure:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.night-figure .num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-4);
  font-weight: 700;
}
.night-figure .lbl { font-size: var(--fs-1); color: var(--ink-2); }
.night-figure .flag { font-size: var(--fs-0); font-weight: 600; color: var(--state-warn); }

.stages { display: flex; flex-direction: column; gap: var(--sp-3); }
.stage-row { display: grid; grid-template-columns: 7rem 1fr 4.5rem; gap: var(--sp-3); align-items: center; }
.stage-row .track { height: 12px; background: var(--bg-2); border-radius: var(--r-pill); overflow: hidden; }
.stage-row .fill { height: 100%; background: var(--accent); border-radius: var(--r-pill); }
.stage-row .val { font-family: var(--mono); font-variant-numeric: tabular-nums; text-align: right; }
.need-list { margin: var(--sp-4) 0 0; padding: 0; list-style: none; color: var(--ink-2); }
.need-list li { display: flex; justify-content: space-between; padding: var(--sp-1) 0; }

.cockpit .row-list { display: flex; flex-direction: column; }
.cockpit .row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-height: 56px;
  border-bottom: 1px solid var(--line);
  padding: var(--sp-2) 0;
}
.cockpit .row:last-child { border-bottom: 0; }
.cockpit .row .grow { flex: 1; min-width: 0; }
.cockpit .row .sub { font-size: var(--fs-1); color: var(--ink-2); }
.cockpit .by-agent { font-size: var(--fs-1); color: var(--ink-2); }

/* Maïa's suggestions reuse the Boissons tile (.suggestion in boissons.css: accent-2 fill, padding). */
.cockpit .suggestion {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.cockpit .suggestion + .suggestion { margin-top: var(--sp-3); }
.cockpit .suggestion blockquote { margin: 0; max-width: 68ch; }
.cockpit .suggestion blockquote strong { display: block; font-weight: 600; }
.cockpit .suggestion .actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; }

/* « Pesée du matin » / « Poids du jour » : label above, then the field and its button on one line */
.weigh-inline { display: flex; gap: var(--sp-2); align-items: flex-end; }
.weigh-inline > :first-child { flex: 1; min-width: 0; text-align: start; }

.micro-rows { display: flex; flex-direction: column; gap: var(--sp-2); }
.drinks-region { display: flex; flex-direction: column; gap: var(--sp-3); }
.done-list { font-size: var(--fs-1); color: var(--ink-2); margin: var(--sp-2) 0 0; }
.done-list li { padding: 2px 0; }

.night-figure .lbl { white-space: nowrap; }

/* Fold (≥ 900 px): Nuit, Balance, Boissons and Micro-doses all above the fold at 968×875 (COCK-1). */
@media (min-width: 900px) {
  .cockpit.two-pane { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); row-gap: var(--sp-3); }
  .cockpit .pane { gap: var(--sp-3); }
  .cockpit section > h2 { margin-bottom: var(--sp-1); }
  .cockpit .night-figure { padding: 2px var(--sp-2); min-height: 0; }
  .cockpit .night-figure .ring-figure { width: 40px; height: 40px; }
  .cockpit .night-figure .ring-figure svg { width: 100%; height: 100%; }
  .cockpit .night-figure .ring-center { font-size: var(--fs-1); }
  .cockpit .balance-note { display: none; }
  /* one line per macro: label | bar | value */
  .cockpit .macros-compact { gap: 6px; }
  .cockpit .macros-compact .bar { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr) auto; align-items: center; column-gap: var(--sp-3); }
  .cockpit .macros-compact .bar-head { display: contents; }
  .cockpit .macros-compact .bar-label { grid-area: 1 / 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cockpit .macros-compact .bar-track { grid-area: 1 / 2; }
  .cockpit .macros-compact .bar-sublabel { grid-area: 1 / 3; white-space: nowrap; }
  .cockpit .bottle { padding: var(--sp-2) var(--sp-4); gap: var(--sp-4); }
  .cockpit .bottle-svg { width: 48px; height: 96px; }
  .cockpit .bottle-side { gap: var(--sp-2); }
  .cockpit .bottle-side .hint { display: none; }
  .cockpit .drink-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; mask-image: linear-gradient(to right, #000 85%, transparent); padding-bottom: 2px; }
  .cockpit .drink-chips > * { flex: none; }
  .cockpit .drinks-region { gap: var(--sp-2); }
  .cockpit .micro-rows { gap: 0; }
  .cockpit .micro-row { min-height: 0; padding-block: var(--sp-1); grid-template-columns: 44px minmax(0, 1fr) auto auto; }
  .cockpit .micro-fig { width: 44px; }
  .cockpit .micro-row .ring-figure { width: 48px; height: 48px; }
  .cockpit .micro-row .ring-figure svg { width: 100%; height: 100%; }
  .cockpit .micro-row .ring-center { font-size: var(--fs-2); }
  .cockpit .micro-add { min-height: 48px; }
}

/* web/screens/corps.css */
/* S4 Corps, mesure, photos (DESIGN §7.2). */
.corps { padding: var(--sp-4); gap: var(--sp-6); }
.corps .pane { display: flex; flex-direction: column; gap: var(--sp-4); min-width: 0; }
.corps h2 { font-size: var(--fs-3); font-weight: 600; margin: 0; }
.corps h3 { font-size: var(--fs-2); font-weight: 600; margin: var(--sp-3) 0 var(--sp-2); }
.corps .sub, .measure-form .sub { font-size: var(--fs-1); color: var(--ink-2); }
.corps .mono, .measures .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.corps .by-agent { font-size: var(--fs-1); color: var(--ink-2); }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; }
.section-head .head-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; }

.weight-head { display: flex; flex-direction: column; gap: var(--sp-1); }
.weight-now { display: flex; align-items: baseline; gap: var(--sp-2); flex-wrap: wrap; }
.weight-now .big { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: var(--fs-5); font-weight: 700; }
.weight-now .sub { color: var(--ink-2); }
.weight-meta { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-4); color: var(--ink-2); font-size: var(--fs-1); }
.weight-meta .hint { color: var(--ink-3); }

.weigh-inline { display: flex; gap: var(--sp-2); align-items: flex-end; flex-wrap: wrap; }
.weigh-inline > :first-child { flex: 1; min-width: 8rem; }

.corps .row-list { display: flex; flex-direction: column; }
.corps .row { display: flex; align-items: center; gap: var(--sp-3); min-height: 56px; border-bottom: 1px solid var(--line); }
.corps .row:last-child { border-bottom: 0; }
.corps .row .grow { flex: 1; min-width: 0; }

/* wide table in a narrow pane: the week column stays put and the right edge fades while more columns hide (review item 3) */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; mask-image: linear-gradient(to right, #000 88%, transparent); }
.table-scroll.at-end { mask-image: none; }
.measures th:first-child, .measures tbody th { position: sticky; left: 0; z-index: 1; background: var(--bg); }
.measures { border-collapse: collapse; width: 100%; font-size: var(--fs-1); }
.measures th, .measures td { padding: var(--sp-2) var(--sp-2); text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.measures th:first-child, .measures tbody th { text-align: left; font-weight: 600; }
.measures thead th { font-weight: 600; color: var(--ink-2); padding: 0; }
.measures .delta { display: block; font-size: var(--fs-0); color: var(--ink-2); font-family: var(--mono); }
.col-btn {
  all: unset;
  box-sizing: border-box;
  display: block;
  width: 100%;
  min-height: 44px;
  padding: var(--sp-2);
  text-align: right;
  cursor: pointer;
  border-radius: var(--r-1);
  color: var(--ink-2);
  transition: background var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
}
.col-btn:hover { background: var(--bg-2); }
.col-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.col-btn.is-active { color: var(--accent); font-weight: 700; }
.site-trend { margin-top: var(--sp-3); }

.photo-weeks { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--sp-3); }
.photo-week { margin: 0; }
.photo-week .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; border-radius: var(--r-2); overflow: hidden; background: var(--bg-2); }
.photo-week img, .photo-week .missing { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; display: block; }
.photo-week .missing { display: grid; place-items: center; color: var(--ink-3); font-size: var(--fs-0); }
.photo-week figcaption { font-size: var(--fs-1); color: var(--ink-2); margin-top: var(--sp-1); }

/* /corps/mesure */
.measure-form { display: flex; flex-direction: column; gap: var(--sp-4); padding: var(--sp-4); max-width: 760px; margin: 0 auto; }
.measure-form .protocol { margin: 0; color: var(--ink-2); max-width: 68ch; }
.measure-form fieldset.site { border: 0; border-top: 1px solid var(--line); margin: 0; padding: var(--sp-4) 0 0; }
.measure-form legend { font-size: var(--fs-3); font-weight: 600; padding: 0; }
.measure-form legend .opt { font-size: var(--fs-1); font-weight: 400; color: var(--ink-2); }
.measure-form .hint { margin: var(--sp-1) 0 var(--sp-3); color: var(--ink-2); font-size: var(--fs-1); max-width: 68ch; }
.measure-form .readings { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: var(--sp-3); }
.measure-form .site-result { margin: var(--sp-2) 0 0; font-size: var(--fs-1); color: var(--ink-2); min-height: 1.4em; }
.measure-form .form-actions { padding-bottom: var(--sp-6); }

/* /corps/photos */
.photo-capture, .photo-compare { display: flex; flex-direction: column; gap: var(--sp-3); padding: var(--sp-4); max-width: 760px; margin: 0 auto; }
.pose-steps { display: flex; gap: var(--sp-4); list-style: none; margin: 0; padding: 0; color: var(--ink-3); }
.pose-steps .is-current { color: var(--ink); font-weight: 700; }
.pose-steps .is-done { color: var(--accent); }
.capture-status { margin: 0; color: var(--ink-2); max-width: 68ch; }
.capture-done { display: flex; flex-direction: column; gap: var(--sp-3); align-items: stretch; padding: var(--sp-6) 0; }

.side-by-side { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
.side-by-side figure { margin: 0; }
.side-by-side img, .side-by-side .missing { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: var(--r-2); display: block; background: var(--bg-2); }
.side-by-side figcaption { text-align: center; color: var(--ink-2); margin-top: var(--sp-1); }
.compare-view .missing { display: grid; place-items: center; color: var(--ink-2); aspect-ratio: 3 / 4; background: var(--bg-2); }

.slider-frame { position: relative; aspect-ratio: 3 / 4; border-radius: var(--r-2); overflow: hidden; touch-action: none; user-select: none; background: var(--bg-2); }
.slider-frame .before, .slider-frame .after { position: absolute; inset: 0; }
.slider-frame img, .slider-frame .missing { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.slider-frame .divider { position: absolute; top: 0; bottom: 0; width: 44px; margin-left: -22px; cursor: ew-resize; }
.slider-frame .divider::before { content: ""; position: absolute; left: 21px; top: 0; bottom: 0; width: 2px; background: var(--accent-ink); box-shadow: 0 0 0 1px var(--ink); }
.slider-frame .divider:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.slider-frame .tag { position: absolute; bottom: var(--sp-2); padding: 2px var(--sp-2); border-radius: var(--r-pill); background: var(--surface); color: var(--ink); font-size: var(--fs-0); }
.slider-frame .tag-a { left: var(--sp-2); }
.slider-frame .tag-b { right: var(--sp-2); }

/* web/screens/nourriture.css */
/* S2 Nourriture, photo capture, meal detail (DESIGN §5.1-5.3). Component classes (.balance,
   .macros, .kind-chips) are unscoped because the cockpit (S4) renders them too. */

.food-screen,
.drinks-screen,
.meal-detail,
.photo-screen {
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}
.food-panes,
.drinks-panes {
  gap: var(--sp-6);
}
.food-panes > .pane,
.drinks-panes > .pane {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
  min-width: 0;
}
.food-screen section > h2,
.drinks-screen section > h2,
.meal-detail > h2 {
  font-size: var(--fs-3);
  font-weight: 600;
  margin: 0 0 var(--sp-3);
}
.food-tabs {
  align-self: flex-start;
}
.food-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--sp-3);
}

/* shared small pieces */
.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
.hint {
  color: var(--ink-2);
  font-size: var(--fs-1);
  margin: 0;
  max-width: 68ch;
}
.warn {
  color: var(--state-warn);
}
.by-agent {
  color: var(--ink-2);
  font-size: var(--fs-1);
}

/* chips (meal kind, drink types) */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}
.chips .chip {
  min-height: 48px;
  padding: 0 var(--sp-4);
  border: 1px solid var(--line-2);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: var(--fs-1);
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out);
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}
.chips .chip:hover {
  border-color: var(--accent);
}
.chips .chip:active {
  background: var(--accent-2);
}
.chips .chip.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.chips .chip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* balance bar */
.balance {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.balance-ends {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--sp-3);
  font-size: var(--fs-1);
  flex-wrap: wrap;
}
.balance-ends strong {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-3);
}
.balance-in strong {
  color: var(--in);
}
.balance-out strong {
  color: var(--out);
}
.balance-out.muted {
  color: var(--ink-2);
}
.balance-diff {
  font-family: var(--mono);
  font-weight: 600;
  font-size: var(--fs-2);
}
.balance-track {
  position: relative;
  height: 14px;
  border-radius: var(--r-pill);
  background: var(--bg-2);
  overflow: hidden;
}
.balance-fill-in,
.balance-fill-out {
  position: absolute;
  left: 0;
  height: 50%;
  transition: width var(--t-slow) var(--ease-out);
}
.balance-fill-in {
  top: 0;
  background: var(--in);
}
.balance-fill-out {
  bottom: 0;
  background: var(--out);
}
.balance-note {
  color: var(--ink-2);
  font-size: var(--fs-1);
  margin: 0;
  max-width: 68ch;
}

/* macros */
.macros {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.macros-compact {
  gap: var(--sp-2);
}
.macro-free {
  display: flex;
  justify-content: space-between;
  margin: 0;
}
.macro-name {
  font-weight: 600;
}
.macro-kcal {
  margin: 0;
  font-size: var(--fs-1);
  color: var(--ink-2);
}

/* meal list */
.meal-group {
  font-size: var(--fs-1);
  font-weight: 600;
  color: var(--ink-2);
  margin: var(--sp-4) 0 var(--sp-1);
}
.meal-row-wrap {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.meal-del {
  position: absolute;
  inset: 0 0 0 auto;
  width: 112px;
  border: 0;
  background: var(--state-error);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  visibility: hidden;
}
.meal-row-wrap.open .meal-del,
.meal-row-wrap:has(.meal-row.dragging) .meal-del {
  visibility: visible;
}
.meal-del.confirm {
  background: oklch(0.42 0.19 25);
}
.meal-row {
  position: relative;
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: var(--sp-3);
  align-items: center;
  min-height: 80px;
  padding: var(--sp-2) 0;
  background: var(--bg);
  cursor: pointer;
  touch-action: pan-y;
  transition: transform var(--t-base) var(--ease-out);
  -webkit-user-select: none;
  user-select: none;
}
.meal-row.dragging {
  transition: none;
}
.meal-row:hover .meal-title {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.meal-row:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.meal-thumb {
  width: 64px;
  height: 64px;
  border-radius: var(--r-1);
  object-fit: cover;
  background: var(--bg-2);
}
.meal-thumb-icon {
  display: grid;
  place-items: center;
  color: var(--ink-2);
}
.meal-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  align-items: flex-start;
}
.meal-title {
  font-weight: 600;
}
.meal-macros {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-0);
  color: var(--ink-2);
}
.meal-sub {
  font-size: var(--fs-0);
  color: var(--ink-3);
}
.meal-sub.warn {
  color: var(--state-warn);
  font-weight: 600;
}
.meal-retry {
  margin-top: var(--sp-1);
}
.meal-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-size: var(--fs-1);
}

/* week strip */
.week-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--sp-1);
}
.week-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-height: 44px;
  padding: var(--sp-1) 0;
  border: 1px solid transparent;
  border-radius: var(--r-1);
  background: none;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.week-col:hover {
  border-color: var(--line-2);
}
.week-col.selected {
  border-color: var(--accent);
  background: var(--accent-2);
}
.week-col:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.week-bars {
  height: 72px;
  display: flex;
  align-items: flex-end;
  gap: 3px;
}
.week-in,
.week-out {
  width: 9px;
  border-radius: 3px 3px 0 0;
  transition: height var(--t-slow) var(--ease-out);
}
.week-in {
  background: var(--in);
}
.week-out {
  background: var(--out);
}
.week-out.none {
  background: none;
}
.week-day {
  font-size: var(--fs-0);
  color: var(--ink-2);
}
.week-num {
  font-family: var(--mono);
  font-size: var(--fs-0);
}

/* manual entry and detail forms */
.manual-form,
.drink-form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.macro-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--sp-3);
}

/* photo capture */
.photo-screen {
  padding: 0;
  gap: 0;
}
.photo-preview {
  width: 100%;
  max-height: 55vh;
  object-fit: contain;
  background: #000;
  transition: opacity var(--t-base) var(--ease-out);
}
.photo-preview.dimmed {
  opacity: 0.45;
}
.photo-controls {
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
}
.photo-actions,
.detail-actions {
  display: flex;
  gap: var(--sp-3);
  justify-content: flex-end;
  flex-wrap: wrap;
}
.photo-status {
  font-size: var(--fs-3);
  font-weight: 600;
  margin: 0;
}
.photo-status.warn {
  color: var(--state-warn);
}
.hint-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--sp-3);
  align-items: end;
}
.analysis-result h2 {
  font-size: var(--fs-4);
  margin: 0 0 var(--sp-2);
  text-wrap: balance;
}
.analysis-items {
  list-style: none;
  padding: 0;
  margin: 0;
}
.analysis-items li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: var(--sp-3);
  min-height: 44px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.item-grams,
.item-kcal {
  color: var(--ink-2);
}
.analysis-totals {
  font-weight: 600;
  margin: var(--sp-3) 0 var(--sp-1);
}
.analysis-confidence {
  margin: 0;
  color: var(--ink-2);
  max-width: 68ch;
}

/* meal detail */
.meal-detail {
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
}
.detail-photo {
  all: unset;
  cursor: zoom-in;
  display: block;
  border-radius: var(--r-2);
  overflow: hidden;
}
.detail-photo:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.detail-photo img {
  display: block;
  width: 100%;
  max-height: 40vh;
  object-fit: cover;
}
.detail-fields {
  display: grid;
  grid-template-columns: 1fr 140px;
  gap: var(--sp-3);
}
.item-grid {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  overflow-x: auto;
}
.item-head,
.item-row {
  display: grid;
  grid-template-columns: minmax(140px, 2fr) repeat(6, minmax(58px, 1fr)) 44px;
  gap: var(--sp-2);
  align-items: center;
  min-width: 620px;
}
.item-head {
  font-size: var(--fs-0);
  color: var(--ink-2);
}
.item-row input {
  min-height: 44px;
  width: 100%;
  box-sizing: border-box;
  padding: 0 var(--sp-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-1);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: var(--fs-1);
}
.item-row input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.item-row input.invalid {
  border-color: var(--state-error);
}
/* Narrow screens: no sideways scroll. Each item takes two lines, name (+ remove) then the six
   numbers under the same six column heads. */
@media (max-width: 699px) {
  .item-grid { overflow-x: visible; }
  .item-head,
  .item-row { grid-template-columns: repeat(6, minmax(0, 1fr)); min-width: 0; row-gap: var(--sp-1); }
  .item-head > :first-child { grid-column: 1 / -1; }
  .item-head > :last-child { display: none; }
  .item-row .item-label-input { grid-row: 1; grid-column: 1 / 6; }
  .item-row .item-remove { grid-row: 1; grid-column: 6; justify-self: end; }
  .item-row input:not(.item-label-input) { padding: 0 var(--sp-1); text-align: center; }
  .item-row { padding-bottom: var(--sp-2); border-bottom: 1px solid var(--line); }
}
.item-remove,
.drink-del,
.viewer-close {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: var(--r-1);
  background: none;
  color: var(--ink-2);
  cursor: pointer;
}
.item-remove:hover,
.drink-del:hover {
  background: var(--bg-2);
  color: var(--state-error);
}
.item-remove:focus-visible,
.drink-del:focus-visible,
.viewer-close:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.photo-viewer {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #000;
  overflow: auto;
}
.photo-viewer img {
  display: block;
  max-width: none;
  width: 100%;
  height: auto;
  touch-action: pinch-zoom;
}
.photo-viewer .viewer-close {
  position: fixed;
  top: var(--sp-3);
  left: var(--sp-3);
  background: oklch(0 0 0 / 0.55);
  color: #fff;
}


/* web/screens/objectifs.css */
/* S4 Objectifs and Réglages (DESIGN §7.3, §7.4). */
.objectifs { display: flex; flex-direction: column; gap: var(--sp-5); padding: var(--sp-4); max-width: 760px; margin: 0 auto; }
.objectifs .screen-title { font-size: var(--fs-4); font-weight: 700; margin: 0; text-wrap: balance; }
.objectifs h2 { font-size: var(--fs-3); font-weight: 600; margin: 0 0 var(--sp-2); }
.objectifs .sub, .reglages .sub, .sheet .sub { font-size: var(--fs-1); color: var(--ink-2); }
.objectifs .warn, .reglages .warn { color: var(--state-warn); }
.by-agent { color: var(--ink-2); }

.goal-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-height: 56px;
  padding: var(--sp-3) var(--sp-2);
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  border-radius: var(--r-1);
  transition: background var(--t-fast) var(--ease-out), opacity var(--t-fast) var(--ease-out);
}
.goal-row:hover { background: var(--bg-2); }
.goal-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.goal-row.is-inactive { opacity: 0.55; }
.goal-row .goal-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--sp-1); }
.goal-row .goal-label { font-weight: 600; }

.form-grid { display: flex; flex-direction: column; gap: var(--sp-3); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
.check { display: flex; align-items: center; gap: var(--sp-2); min-height: 44px; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); }

/* `.sheet`: the Réglages sheets (notification history) render outside `.reglages` */
.objectifs .row-list, .reglages .row-list, .sheet .row-list { display: flex; flex-direction: column; }
.objectifs .row, .reglages .row, .sheet .row { display: flex; align-items: center; gap: var(--sp-3); min-height: 56px; border-bottom: 1px solid var(--line); padding: var(--sp-2) 0; }
.objectifs .row:last-child, .reglages .row:last-child, .sheet .row:last-child { border-bottom: 0; }
.objectifs .row .grow, .reglages .row .grow, .sheet .row .grow { flex: 1; min-width: 0; }

/* Réglages */
.reglages { padding: var(--sp-4); gap: var(--sp-6); }
.reglages .pane { display: flex; flex-direction: column; gap: var(--sp-6); min-width: 0; }
.settings-section { display: flex; flex-direction: column; gap: var(--sp-3); }
.settings-section h2 { font-size: var(--fs-3); font-weight: 600; margin: 0; }
.settings-section h3 { font-size: var(--fs-2); font-weight: 600; margin: var(--sp-2) 0 0; }
.section-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.banner { margin: 0; padding: var(--sp-3); border-radius: var(--r-2); background: var(--bg-2); }
.banner.warn { color: var(--ink); border: 1px solid var(--state-warn); }

.rules { display: flex; flex-direction: column; }
.rule { border-bottom: 1px solid var(--line); padding: var(--sp-2) 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.rule-head { display: flex; align-items: center; gap: var(--sp-3); min-height: 48px; cursor: pointer; }
.rule-head .grow { flex: 1; }
.rule-head input[role="switch"] { width: 44px; height: 24px; accent-color: var(--accent); }
.rule-details { display: flex; flex-direction: column; gap: var(--sp-3); padding-bottom: var(--sp-2); }
.rule-details[hidden] { display: none; }

.day-chips, .fav-chips { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.day-chip {
  min-width: 44px;
  min-height: 44px;
  padding: 0 var(--sp-2);
  border-radius: var(--r-pill);
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: var(--fs-1);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out);
}
.day-chip.wide { padding: 0 var(--sp-3); }
.day-chip:hover { border-color: var(--accent); }
.day-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.day-chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.advanced summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--ink-2); }
.status { font-size: var(--fs-0); color: var(--ink-2); }
.status-failed { color: var(--state-error); }
.status-sent, .status-done { color: var(--state-ok); }

/* web/figures/figures.css */
/* Exercise figures (S3): stroke-only stick figures, one stroke language with the icons. */
svg.figure {
  display: block;
  width: 100%;
  height: auto;
  color: var(--ink);
  overflow: visible;
}
svg.figure line,
svg.figure circle,
svg.figure path {
  fill: none;
  stroke: currentColor;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
svg.figure .far {
  opacity: 0.42;
}
svg.figure .ground {
  stroke: var(--line-2);
  stroke-width: 2;
}
svg.figure .prop {
  stroke: var(--ink-3);
  stroke-width: 2.5;
}
svg.figure .kb,
svg.figure .db {
  stroke-width: 3.5;
}
svg.figure .b {
  transform-box: view-box;
  transform-origin: 0 0;
}
svg.figure.paused .b {
  animation-play-state: paused;
}
