/* Carnet Hygiène — sobre, lisible en cuisine (gros boutons, contrastes forts). */
:root {
  color-scheme: light dark;
  --bg: #f2f5f4; --surface: #ffffff; --surface-2: #e9eeec; --text: #0f1a17; --muted: #4d5b57; --line: rgb(15 26 23 / .12);
  --brand: #0f766e; --brand-ink: #0b5f58; --brand-soft: rgb(15 118 110 / .12);
  --ok: #157347; --ok-soft: rgb(21 115 71 / .12); --nok: #b42318; --nok-soft: rgb(180 35 24 / .10); --warn: #9a5b00;
  --r: 1.125rem; --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px); --tab-h: 4.25rem;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0b1210; --surface: #141d1a; --surface-2: #1d2925; --text: #e8f0ed; --muted: #a3b3ae; --line: rgb(255 255 255 / .12);
    --brand: #2bb3a5; --brand-ink: #5fd1c4; --brand-soft: rgb(43 179 165 / .16); --ok: #4ade80; --ok-soft: rgb(74 222 128 / .14); --nok: #ff8a80; --nok-soft: rgb(255 138 128 / .14); --warn: #fbbf24; }
}
@media (prefers-contrast: more) { :root { --muted: var(--text); --line: rgb(127 127 127 / .6); } }
html { font-size: clamp(0.9375rem, calc(3.6vw + 0.1rem), 1.0625rem); -webkit-text-size-adjust: 100%; }
@media (min-width: 600px) { html { font-size: 1rem; } }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.45; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 60%, transparent); outline-offset: 2px; }
.app { max-width: 34rem; margin: 0 auto; min-height: 100dvh; position: relative; }
.screen { padding: calc(var(--safe-t) + 1rem) 1rem calc(var(--tab-h) + var(--safe-b) + 2rem); display: grid; gap: .9rem; outline: none; }

.top { display: flex; align-items: flex-end; justify-content: space-between; gap: .75rem; }
.top h1 { margin: 0; font-size: 1.7rem; letter-spacing: -.02em; line-height: 1.1; }
.kicker { margin: 0 0 2px; color: var(--muted); font-size: .9rem; }
.icon-btn { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; }
.i { width: 1.3rem; height: 1.3rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 1rem; display: grid; gap: .75rem; }
.card h2 { margin: 0; font-size: 1.1rem; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.list { display: grid; }
.item { display: flex; align-items: center; gap: .75rem; min-height: 56px; padding: .55rem 0; border-top: 1px solid var(--line); background: none; border-left: 0; border-right: 0; border-bottom: 0; width: 100%; text-align: left; }
.item:first-child { border-top: 0; }
.item .mid { flex: 1; min-width: 0; display: grid; }
.item .t { font-weight: 650; }
.item .s { font-size: .85rem; color: var(--muted); }
.badge { flex: none; font-size: .8rem; font-weight: 700; padding: .25rem .6rem; border-radius: 999px; white-space: nowrap; }
.badge.ok { color: var(--ok); background: var(--ok-soft); }
.badge.nok { color: var(--nok); background: var(--nok-soft); }
.badge.todo { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.ico { flex: none; width: 2.6rem; height: 2.6rem; border-radius: .9rem; display: grid; place-items: center; color: var(--brand-ink); background: var(--brand-soft); }
.ico.ok { color: var(--ok); background: var(--ok-soft); }
.ico.nok { color: var(--nok); background: var(--nok-soft); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; width: 100%; min-height: 3.1rem; padding: 0 1.1rem; border-radius: 999px; border: 1px solid transparent; font-weight: 700; }
.btn-primary { background: var(--brand); color: #fff; }
@media (prefers-color-scheme: dark) { .btn-primary { color: #04201d; } }
.btn-ghost { background: var(--surface); border-color: var(--line); }
.btn-soft { background: var(--brand-soft); color: var(--brand-ink); min-height: 44px; width: auto; }
.btn-danger { background: none; color: var(--nok); border-color: color-mix(in srgb, var(--nok) 40%, transparent); }
.btn:active, .icon-btn:active, .item:active { transform: scale(.98); }
.actions { display: grid; gap: .6rem; margin-top: 1rem; }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }

.hero { border-radius: 1.4rem; padding: 1.1rem 1.2rem; color: #fff; background: linear-gradient(135deg, #0f766e, #115e59); display: grid; gap: .3rem; }
.hero.alert { background: linear-gradient(135deg, #b42318, #7a1810); }
.hero .big { font-size: 1.9rem; font-weight: 800; margin: 0; }
.hero p { margin: 0; }
.progress { height: .5rem; border-radius: 999px; background: rgb(255 255 255 / .25); overflow: hidden; margin-top: .4rem; }
.progress i { display: block; height: 100%; background: #fff; border-radius: inherit; }

.empty { text-align: center; color: var(--muted); padding: 1rem .5rem; }

/* Barre d'onglets */
.tabbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(.6rem + var(--safe-b)); width: min(34rem, calc(100% - 1.2rem)); height: var(--tab-h); z-index: 5;
  display: grid; grid-template-columns: repeat(4, 1fr); padding: .3rem; border-radius: 1.6rem; border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 82%, transparent); -webkit-backdrop-filter: blur(20px) saturate(1.4); backdrop-filter: blur(20px) saturate(1.4); box-shadow: 0 .8rem 2rem rgb(0 0 0 / .14); }
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) { .tabbar { background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; } }
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; border-radius: 1.2rem; background: none; color: var(--muted); font-size: max(11px, .72rem); font-weight: 650; min-height: 44px; }
.tab[aria-current="page"] { color: var(--brand-ink); background: var(--brand-soft); }
.tab-i .i { width: 1.4rem; height: 1.4rem; }

/* Feuille du bas */
.sheet { border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 34rem; max-height: 92dvh; border-radius: 1.6rem 1.6rem 0 0; background: var(--surface); color: var(--text); }
.sheet::backdrop { background: rgb(0 0 0 / .45); }
.sheet-in { padding: .6rem 1.1rem calc(1.2rem + var(--safe-b)); overflow-y: auto; max-height: 92dvh; }
.grab { width: 2.5rem; height: .3rem; border-radius: 999px; background: var(--line); margin: 0 auto .6rem; }
.sheet-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .4rem; }
.sheet-top h2 { margin: 0; font-size: 1.25rem; }
.field-l { display: block; font-size: .82rem; font-weight: 700; color: var(--muted); margin: .9rem .15rem .4rem; text-transform: uppercase; letter-spacing: .04em; }
.input { width: 100%; min-height: 3rem; padding: 0 .9rem; border-radius: .9rem; border: 1px solid var(--line); background: var(--surface-2); }
textarea.input { padding: .7rem .9rem; min-height: 5rem; resize: vertical; }
.hint { font-size: .85rem; color: var(--muted); margin: .4rem .15rem 0; }
.err { color: var(--nok); font-weight: 650; min-height: 1.2em; margin: .5rem 0 0; text-align: center; }
.temp-entry { display: grid; grid-template-columns: 3.5rem 1fr 3.5rem; gap: .6rem; align-items: center; margin-top: .6rem; }
.temp-entry .icon-btn { width: 3.5rem; height: 3.5rem; font-size: 1.6rem; font-weight: 700; }
.temp-val { text-align: center; font-size: 2.6rem; font-weight: 800; border: 0; background: none; width: 100%; font-variant-numeric: tabular-nums; }
.temp-state { text-align: center; font-weight: 700; margin: .2rem 0 0; }
.temp-state.ok { color: var(--ok); } .temp-state.nok { color: var(--nok); }
.chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.chip { min-height: 44px; padding: .4rem .9rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); font-weight: 600; }
.chip[aria-pressed="true"] { background: var(--brand); color: #fff; border-color: var(--brand); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: .25rem; padding: .25rem; border-radius: 999px; background: var(--surface-2); }
.seg button { min-height: 44px; border: 0; border-radius: 999px; background: none; font-weight: 650; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgb(0 0 0 / .12); }
.check-row { display: flex; gap: .7rem; align-items: flex-start; min-height: 44px; padding-top: .7rem; }
.check-row input { width: 1.3rem; height: 1.3rem; margin: .1rem 0 0; accent-color: var(--brand); flex: none; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tab-h) + var(--safe-b) + 1.4rem); z-index: 50; max-width: 90vw;
  background: var(--text); color: var(--bg); padding: .75rem 1.1rem; border-radius: 999px; font-weight: 650; box-shadow: 0 .6rem 1.6rem rgb(0 0 0 / .25); }
@media (prefers-reduced-motion: no-preference) { .sheet[open] { animation: up .3s cubic-bezier(.2,.8,.2,1); } @keyframes up { from { transform: translateY(30%); opacity: .4; } } }
