/* Ferme Goliath — indigo (la ferme), or du mil (agir), terre rouge (alertes). */
/* Polices fournies avec l'application (licence SIL Open Font License) pour marcher hors ligne. */
@font-face { font-family: "Bricolage Grotesque"; src: url("/fonts/bricolage-grotesque.woff2") format("woff2"); font-weight: 500 800; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("/fonts/source-sans-3.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }

:root {
  --bg: #F3F2EE; --card: #FFFFFF; --sunk: #ECEBE5; --ink: #1E221F; --muted: #667066; --line: #E4E3DD;
  --ind: #2B3F86; --ind-ink: #FFFFFF; --ind-soft: #E8EBF5;
  --hero: #2B3F86; --hero-ink: #FFFFFF; --hero-muted: #C9D1EE;
  --mil: #D9A73A; --mil-ink: #3B2A05; --mil-soft: #F7EDD3; --mil-text: #8A6208;
  --ok: #2F7A4B; --ok-soft: #E2F0E6; --lat: #B4532A; --lat-soft: #F7E3DA;
  --r: 18px;
  --display: "Bricolage Grotesque", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --body: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111312; --card: #1B1E1C; --sunk: #151816; --ink: #E9EBE7; --muted: #9AA29B; --line: #2A2E2B;
    --ind: #9FB0EE; --ind-ink: #121833; --ind-soft: #1E2542;
    --hero: #1D2750; --hero-ink: #F2F4FB; --hero-muted: #9EABD8;
    --mil: #E6BE5C; --mil-ink: #2A1E03; --mil-soft: #2B2515; --mil-text: #E6BE5C;
    --ok: #6FC993; --ok-soft: #16291E; --lat: #EE9272; --lat-soft: #35201A;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.45; font-variant-numeric: tabular-nums; -webkit-tap-highlight-color: transparent; overflow-x: clip; overscroll-behavior-y: contain; }
a { color: var(--ind); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ind); outline-offset: 2px; }
[hidden] { display: none !important; }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Retour au toucher : tout ce qui se touche s'enfonce légèrement. */
.btn, .item, .tile, .link-card, .chip, .chip-radio span, .cat, .box span, .ctrl button, .tabbar a, .sync-dot, .person, .icon-btn, .ghost-row a, .seg a, .frise a {
  transition: transform .12s ease, filter .12s ease, background-color .15s ease;
}
.btn:active, .item:active, .tile:active, .link-card:active, .chip:active, .chip-radio:active span, .cat:active, .box:active span, .ctrl button:active, .tabbar a:active, .sync-dot:active, .person:active, .icon-btn:active, .ghost-row a:active, .seg a:active, .frise a:active {
  transform: scale(.97); filter: brightness(.95);
}

/* ---------- Cadre ---------- */
.app { min-height: 100vh; }
.column { min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 10px;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 18px 12px;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(10px);
}
.topbar:empty { display: none; }
.topbar h1 { flex: 1; min-width: 0; margin: 0; font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: -.01em; line-height: 1.15; }
.topbar h1 .t { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar h1 .sub { display: block; font-family: var(--body); font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .back { font-size: 30px; line-height: 1; text-decoration: none; color: var(--ind); padding: 0 4px 4px 0; }
.top-actions { display: flex; align-items: center; gap: 6px; }
.sync-dot { width: 34px; height: 34px; border: 0; background: none; display: grid; place-items: center; cursor: pointer; padding: 0; }
.sync-dot i { width: 11px; height: 11px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); }
.sync-dot.warn i { background: var(--mil); box-shadow: 0 0 0 4px var(--mil-soft); }
.sync-dot.off i { background: var(--muted); box-shadow: 0 0 0 4px var(--sunk); }
.sync-dot.bad i { background: var(--lat); box-shadow: 0 0 0 4px var(--lat-soft); }
.sync-dot.run i { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.gear { display: grid; place-items: center; width: 36px; height: 36px; color: var(--muted); }

.main { padding: 4px 16px calc(104px + env(safe-area-inset-bottom, 0px)); max-width: 880px; margin: 0 auto; outline: none; }
.view { display: grid; gap: 12px; position: relative; z-index: 2; background: var(--bg); align-content: start; }
/* Écran qui s'en va pendant un glissement : figé à sa place. */
.view.ghost { position: fixed; margin: 0; z-index: 1; pointer-events: none; }
.view.ghost.back { z-index: 4; box-shadow: -16px 0 30px -18px rgba(0, 0, 0, .35); }
.view.enter { animation: enter .2s ease-out; }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } }
.loading { color: var(--muted); text-align: center; padding: 60px 0; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--card); border-top: 1px solid var(--line);
  padding: 8px 6px calc(10px + env(safe-area-inset-bottom, 0px));
}
.tabbar a { display: grid; justify-items: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); text-decoration: none; }
.tabbar a em { font-style: normal; }
.tabbar a.on { color: var(--ind); }
.tabbar .ic { width: 23px; height: 23px; }
.tabbar a.plus span { display: grid; place-items: center; width: 50px; height: 50px; margin-top: -18px; border-radius: 17px; background: var(--mil); color: var(--mil-ink); box-shadow: 0 10px 20px -10px var(--mil); }
.tabbar a.plus .ic { stroke-width: 2.4; }
.tabbar a.plus em { display: none; }

.sidebar { display: none; }
@media (min-width: 900px) {
  .app.with-nav { display: grid; grid-template-columns: 236px 1fr; }
  .sidebar:not([hidden]) { z-index: 7; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; padding: 22px 12px; background: var(--card); border-right: 1px solid var(--line); }
  .sidebar .brand { font-family: var(--display); font-weight: 800; font-size: 19px; padding: 2px 12px 20px; letter-spacing: -.01em; }
  .sidebar a { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 12px; color: var(--muted); text-decoration: none; font-weight: 600; }
  .sidebar a.on { background: var(--ind-soft); color: var(--ind); }
  .sidebar a.plus { background: var(--mil); color: var(--mil-ink); margin: 6px 0; }
  .sidebar .side-user { margin-top: auto; padding: 12px; font-size: 13px; color: var(--muted); }
  .tabbar { display: none !important; }
  .main { padding: 8px 32px 48px; }
  .topbar { padding-inline: 32px; }
  .topbar .gear { display: none; }
}

/* ---------- Blocs ---------- */
.card { background: var(--card); border-radius: var(--r); padding: 14px 16px; display: grid; gap: 8px; }
.link-card { text-decoration: none; color: inherit; }
.label { font-size: 13px; font-weight: 600; color: var(--muted); }
.num { font-family: var(--display); font-weight: 800; letter-spacing: -.02em; line-height: 1.05; }
.big { font-family: var(--display); font-weight: 800; font-size: 30px; letter-spacing: -.02em; line-height: 1.05; }
.big-m { font-family: var(--display); font-size: 19px; font-weight: 700; }
.fine { font-size: 12.5px; color: var(--muted); margin: 0; }
.muted { color: var(--muted); }
.center { text-align: center; }
.lead { margin: 2px 0; }
.m { white-space: nowrap; font-weight: 700; font-size: 14.5px; }
.m.neg, .n.neg { color: var(--lat); }
.m.pos { color: var(--ok); }
.row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.kv { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 3px 0; }
.kv.sub { padding-left: 12px; font-size: 14px; color: var(--muted); }
.note-text { margin: 4px 0; white-space: pre-wrap; }
.notice-card { background: var(--mil-soft); }

.hero { background: var(--hero); color: var(--hero-ink); padding: 16px 16px 14px; }
.hero .label { color: var(--hero-muted); }
.hero .num { font-size: 36px; }
.hero .num small { font-size: 19px; font-weight: 700; opacity: .8; }
.split { display: flex; height: 8px; border-radius: 99px; overflow: hidden; gap: 2px; margin-top: 4px; background: color-mix(in srgb, var(--hero-ink) 12%, transparent); }
.split i { display: block; height: 100%; min-width: 3px; }
.legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 6px; }
.legend a { font-size: 12px; color: var(--hero-muted); line-height: 1.3; text-decoration: none; }
.legend b { display: block; color: var(--hero-ink); font-size: 14px; font-weight: 700; }
.legend b.neg { color: #FFB39B; }
.sw { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; vertical-align: 1px; }

.herd { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; align-items: end; }
.herd .num { font-size: 40px; }
.spark { display: block; width: 100%; height: 46px; }
.mini-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mini-kpis div { background: var(--bg); border-radius: 12px; padding: 8px 10px; min-width: 0; }
.mini-kpis b { display: block; font-family: var(--display); font-size: 17px; font-weight: 700; white-space: nowrap; }
.mini-kpis span { font-size: 12px; color: var(--muted); }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.duo .num { font-size: 21px; }
.in-c { color: var(--ok); }

.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; border: 0; text-decoration: none; }
button.pill, a.pill { cursor: pointer; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--mil-soft); color: var(--mil-text); }
.pill.bad { background: var(--lat-soft); color: var(--lat); }
.pill.neutral { background: var(--sunk); color: var(--muted); }
.pill.acc { background: var(--ind-soft); color: var(--ind); }

.section-head { display: flex; justify-content: space-between; align-items: baseline; margin: 6px 4px 2px; }
.section-head h2 { margin: 0; font-family: var(--display); font-size: 18px; font-weight: 700; }
.section-head a { font-size: 14px; font-weight: 600; text-decoration: none; }

/* Listes */
.list { background: var(--card); border-radius: var(--r); overflow: hidden; display: grid; }
.item { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; padding: 11px 14px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; width: 100%; color: inherit; text-decoration: none; cursor: pointer; font: inherit; }
.item.with-icon { grid-template-columns: 38px minmax(0, 1fr) auto; }
.item.with-icon .ibox { grid-row: span 2; }
.item.static { cursor: default; }
.item:last-child { border-bottom: 0; }
.item .t { font-weight: 700; line-height: 1.3; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.item.with-icon .t { white-space: nowrap; }
.item.with-icon .m { grid-row: span 2; }
.item .d { font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; min-width: 0; }
.item:not(.with-icon) .d { grid-column: 1 / -1; }
.item.void .t, .item.void .m { text-decoration: line-through; color: var(--muted); }
.item.void .ibox { opacity: .5; }
.menu .item { align-items: center; }
.chev { color: var(--muted); font-size: 20px; }

.ibox { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; }
.t-mil { background: var(--mil-soft); color: var(--mil-text); }
.t-ind { background: var(--ind-soft); color: var(--ind); }
.t-ok { background: var(--ok-soft); color: var(--ok); }
.t-lat { background: var(--lat-soft); color: var(--lat); }

.empty { text-align: center; padding: 28px 16px; background: var(--card); border-radius: var(--r); }
.empty b { display: block; font-family: var(--display); font-size: 18px; }
.empty p { color: var(--muted); margin: 6px 0 14px; }

.notice { background: var(--ind-soft); color: var(--ink); border-radius: 12px; padding: 10px 12px; margin: 0; font-size: 14px; }
.notice.warn { background: var(--mil-soft); color: var(--mil-text); }
.notice.bad { background: var(--lat-soft); color: var(--lat); }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 11px 18px; border-radius: 16px; border: 0; background: var(--ind); color: var(--ind-ink); font-weight: 700; font-size: 15.5px; text-decoration: none; cursor: pointer; }
.btn:disabled { opacity: .6; cursor: wait; }
.btn.mil { background: var(--mil); color: var(--mil-ink); }
.btn.ghost { background: var(--card); color: var(--ind); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.small { min-height: 38px; padding: 7px 13px; font-size: 14px; border-radius: 12px; }
.btn.danger { background: var(--lat); color: #fff; }
.btn.danger-text { color: var(--lat); }
.btn.block { width: 100%; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.row-actions .btn { flex: 1 1 auto; }
.ghost-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ghost-row a { display: block; background: var(--card); border-radius: 14px; padding: 11px 6px; text-align: center; font-weight: 700; font-size: 14px; color: var(--ind); text-decoration: none; }
.link-btn { background: none; border: 0; padding: 0; color: var(--ind); cursor: pointer; font-size: inherit; text-decoration: underline; text-underline-offset: 2px; }
.icon-btn { background: var(--sunk); border: 0; border-radius: 50%; width: 36px; height: 36px; font-size: 20px; line-height: 1; cursor: pointer; color: var(--muted); }

/* ---------- Formulaires ---------- */
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; border: 0; margin: 0; padding: 0; min-width: 0; }
.field > label, .field > .label, .field legend { font-weight: 600; font-size: 14px; color: var(--ink); }
.field legend { margin-bottom: 6px; padding: 0; }
.field input:not([type=radio]):not([type=checkbox]), .field select, .field textarea {
  width: 100%; min-height: 48px; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--card);
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--ind); outline: none; }
.field textarea { min-height: 70px; resize: vertical; }
.field input.amount { font-family: var(--display); font-size: 26px; font-weight: 800; letter-spacing: -.01em; }
.field.inline { grid-template-columns: auto 1fr; align-items: center; gap: 10px; }
.hint { font-size: 12.5px; color: var(--muted); }
.form-error { margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--lat-soft); color: var(--lat); font-weight: 600; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check-line { display: flex; gap: 10px; align-items: center; font-size: 15px; }
.check-line input { width: 20px; height: 20px; accent-color: var(--ind); }
.inline-form { grid-template-columns: 1fr auto; align-items: end; }
@media (max-width: 420px) { .grid2 { grid-template-columns: 1fr; } }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip { flex: none; font-size: 14px; font-weight: 600; padding: 8px 14px; border-radius: 999px; background: var(--card); color: var(--muted); text-decoration: none; }
.chip.on { background: var(--ind); color: var(--ind-ink); }
.chip-radio { position: relative; }
.chip-radio input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip-radio span { display: inline-block; font-size: 14px; font-weight: 600; padding: 8px 14px; border-radius: 999px; background: var(--sunk); color: var(--muted); }
.chip-radio input:checked + span { background: var(--ind); color: var(--ind-ink); }
.chip-radio input:focus-visible + span { outline: 2px solid var(--ind); outline-offset: 2px; }

/* Saisie tactile */
.seg { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--card); border-radius: 16px; padding: 4px; gap: 4px; }
.seg a { text-align: center; font-size: 14px; font-weight: 700; padding: 9px 0; border-radius: 12px; color: var(--muted); text-decoration: none; }
.seg a.on { background: var(--ind); color: var(--ind-ink); }
.more-kinds { display: flex; gap: 16px; justify-content: center; font-size: 13.5px; }
.more-kinds a { color: var(--muted); font-weight: 600; text-decoration: none; }
.more-kinds a.on { color: var(--ind); text-decoration: underline; text-underline-offset: 3px; }
.amount-big { display: grid; justify-items: center; gap: 2px; padding: 8px 0 2px; }
.amount-big input { width: 100%; border: 0; background: none; text-align: center; font-family: var(--display); font-weight: 800; font-size: 46px; letter-spacing: -.02em; padding: 0; outline: none; color: var(--ink); }
.amount-big input::placeholder { color: var(--line); }
.amount-big .fine { text-align: center; }
.grid-cat { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.cat { position: relative; display: grid; justify-items: center; gap: 5px; padding: 10px 2px 9px; border-radius: 16px; background: var(--card); font-size: 12px; font-weight: 600; color: var(--muted); text-align: center; line-height: 1.15; cursor: pointer; }
.cat input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.cat .ibox { width: 34px; height: 34px; border-radius: 11px; }
.cat:has(input:checked) { box-shadow: inset 0 0 0 2px var(--ind); color: var(--ind); }
.cat:has(input:focus-visible) { outline: 2px solid var(--ind); outline-offset: 2px; }
.boxes { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
.box { position: relative; cursor: pointer; }
.box input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.box span { display: block; background: var(--card); border-radius: 14px; padding: 10px 11px; font-size: 12.5px; color: var(--muted); line-height: 1.3; height: 100%; }
.box b { display: block; font-size: 14px; color: var(--ink); }
.box b.neg { color: var(--lat); }
.box input:checked + span { box-shadow: inset 0 0 0 2px var(--ind); }
.box input:checked + span b { color: var(--ind); }
.box input:focus-visible + span { outline: 2px solid var(--ind); outline-offset: 2px; }
.line-field { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 12px; background: var(--card); border-radius: 14px; padding: 4px 8px 4px 14px; }
.line-field > label, .line-field > span { color: var(--muted); font-size: 14px; }
.line-field input, .line-field select { border: 0; background: none; min-height: 44px; text-align: right; font-weight: 600; width: 100%; outline: none; }
.line-field select { text-align-last: right; }
.sticky-save { position: sticky; bottom: calc(88px + env(safe-area-inset-bottom, 0px)); padding-top: 10px; background: linear-gradient(to top, var(--bg) 72%, transparent); z-index: 3; }
@media (min-width: 900px) { .sticky-save { bottom: 0; padding-bottom: 12px; } }

/* Fiche du jour */
.stepper { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.stepper:last-child { border-bottom: 0; }
.stepper > span { font-weight: 600; }
.ctrl { display: flex; align-items: center; gap: 8px; }
.ctrl button { width: 40px; height: 40px; border-radius: 13px; border: 0; background: var(--sunk); color: var(--ink); font-size: 22px; font-weight: 700; line-height: 1; cursor: pointer; }
.ctrl button.plus { background: var(--ind-soft); color: var(--ind); }
.ctrl input { width: 48px; min-height: 40px; border: 0; background: none; text-align: center; font-family: var(--display); font-size: 21px; font-weight: 800; color: var(--ink); padding: 0; }
.ctrl input.on { color: var(--lat); }
.ctrl input { transition: color .2s ease; }
.photo-tile { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center; cursor: pointer; }
.ph { width: 64px; height: 64px; border-radius: 14px; background: var(--ind-soft); color: var(--ind); display: grid; place-items: center; }
.ph .ic { width: 26px; height: 26px; }
details.more summary { cursor: pointer; color: var(--ind); font-weight: 600; font-size: 14.5px; list-style: none; }
details.more summary::-webkit-details-marker { display: none; }
details.more[open] summary { margin-bottom: 10px; }

.photos { display: flex; flex-wrap: wrap; gap: 8px; }
.photos:empty { display: none; }
.thumb { position: relative; width: 86px; height: 86px; border-radius: 14px; overflow: hidden; background: var(--sunk); display: grid; place-items: center; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb button { position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .6); color: #fff; cursor: pointer; }
.thumb-wait { font-size: 11px; color: var(--muted); text-align: center; padding: 4px; }
.photo-add { justify-self: start; }

/* ---------- Élevage ---------- */
.journey { display: grid; gap: 8px; }
.track { position: relative; height: 8px; border-radius: 99px; background: var(--sunk); margin: 6px 8px; }
.track i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: var(--mil); }
.track b { position: absolute; top: -4px; width: 16px; height: 16px; border-radius: 50%; background: var(--card); border: 3px solid var(--ind); transform: translateX(-50%); }
.track u { position: absolute; top: -2px; width: 4px; height: 12px; border-radius: 2px; background: var(--muted); transform: translateX(-50%); }
.steps { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); line-height: 1.3; }
.steps strong { color: var(--ink); font-weight: 700; }
.steps span:not(:first-child):not(:last-child) { text-align: center; }
.steps span:last-child { text-align: right; }
.kpi3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kpi3 .card { padding: 11px 12px; gap: 2px; }
.kpi3 .num { font-size: 23px; white-space: nowrap; }
.chart { display: block; width: 100%; height: auto; }
.ch-t { fill: var(--muted); font-size: 10.5px; font-family: var(--body); }
.ch-t.strong { fill: var(--ind); font-weight: 700; font-size: 11.5px; }
.ch-grid { stroke: var(--line); stroke-width: 1; }
.ch-bad { fill: var(--lat); }
.ch-empty { fill: var(--line); }
.ch-plan { fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-dasharray: 4 4; }
.ch-area { fill: var(--ind-soft); stroke: none; }
.ch-line { fill: none; stroke: var(--ind); stroke-width: 2.4; stroke-linejoin: round; }
.ch-dot { fill: var(--card); stroke: var(--ind); stroke-width: 2; }
.frise { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.frise::-webkit-scrollbar { display: none; }
.frise a { flex: 1 0 64px; border-radius: 12px; padding: 7px 6px; text-align: center; font-size: 11.5px; line-height: 1.25; background: var(--sunk); color: var(--muted); text-decoration: none; }
.frise a b { display: block; font-size: 12.5px; color: var(--ink); }
.frise a.fait { background: var(--ok-soft); color: var(--ok); }
.frise a.fait b { color: var(--ok); }
.frise a.a_faire { background: var(--mil-soft); color: var(--mil-text); box-shadow: inset 0 0 0 2px var(--mil); }
.frise a.a_faire b, .frise a.retard b { color: inherit; }
.frise a.retard { background: var(--lat-soft); color: var(--lat); box-shadow: inset 0 0 0 2px var(--lat); }
.causes { display: grid; gap: 7px; margin-top: 2px; }
.cause { display: grid; grid-template-columns: 96px 1fr 34px; gap: 10px; align-items: center; font-size: 14px; }
.bar { display: block; height: 6px; border-radius: 99px; background: var(--sunk); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; background: var(--ind); }
.cause .bar i { background: var(--lat); }
.cause .m { text-align: right; }

/* ---------- Associés ---------- */
.stack { display: flex; height: 14px; border-radius: 99px; overflow: hidden; gap: 2px; background: var(--sunk); }
.stack i { display: block; height: 100%; min-width: 3px; }
.people { background: var(--card); border-radius: var(--r); overflow: hidden; display: grid; }
.person { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; padding: 11px 14px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.person:last-child { border-bottom: 0; }
.avatar { grid-row: span 2; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 14px; color: #fff; }
.person .n { font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person .p { grid-row: span 2; font-family: var(--display); font-weight: 800; font-size: 19px; }
.person .d { font-size: 12px; color: var(--muted); margin-top: 3px; }
.prog { height: 5px; border-radius: 99px; background: var(--sunk); overflow: hidden; }
.prog i { display: block; height: 100%; background: var(--ok); border-radius: 99px; }
.prog.big { height: 8px; }

.table-wrap { overflow-x: auto; background: var(--card); border-radius: var(--r); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { font-size: 12px; font-weight: 700; color: var(--muted); background: var(--sunk); }
.table td.n, .table th.n { text-align: right; white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }

/* ---------- Feuille du bas ---------- */
.sheet { border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 560px; max-height: 88vh; border-radius: 22px 22px 0 0; background: var(--card); color: var(--ink); }
.sheet[open] { animation: sheet-up .22s cubic-bezier(.2, .8, .2, 1); }
.sheet::backdrop { background: rgba(10, 14, 12, .45); animation: fade .2s ease-out; }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.sheet-body { padding: 18px 18px calc(24px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 12px; overflow-y: auto; max-height: 88vh; }
.sheet-grab { height: 22px; margin: -10px 0 -6px; display: grid; place-items: center; touch-action: none; cursor: grab; }
.sheet-grab::after { content: ""; width: 40px; height: 4px; border-radius: 99px; background: var(--line); }
.sheet-head { touch-action: none; }
.sheet.closing::backdrop { animation: fade-out .22s ease forwards; }
@keyframes fade-out { to { opacity: 0; } }
.sheet-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.sheet-head h2 { margin: 0; font-family: var(--display); font-size: 21px; font-weight: 700; }
@media (min-width: 700px) { .sheet { margin: auto; border-radius: 22px; } .sheet-grab { display: none; } }
.dl { display: grid; grid-template-columns: auto 1fr; gap: 7px 16px; margin: 0; }
.dl dt { color: var(--muted); font-size: 14px; }
.dl dd { margin: 0; font-weight: 600; }
.cancel-box { border-top: 1px solid var(--line); padding-top: 10px; }
.cancel-box summary { color: var(--lat); cursor: pointer; font-weight: 600; }
.cancel-box .form { margin-top: 10px; }

/* ---------- Connexion ---------- */
.login { max-width: 400px; margin: 8vh auto 0; display: grid; gap: 12px; text-align: center; }
.login h1 { margin: 0; font-family: var(--display); font-size: 32px; font-weight: 800; letter-spacing: -.02em; }
.login p { margin: 0; }
.login .form { text-align: left; }
.login-mark { width: 68px; height: 68px; margin: 0 auto; border-radius: 20px; background: #2B3F86; position: relative; }
.login-mark::after { content: ""; position: absolute; left: 22px; top: 15px; width: 24px; height: 33px; border-radius: 50% 50% 46% 46% / 58% 58% 42% 42%; background: #E7BE52; }

/* ---------- Notification ---------- */
.toast { position: fixed; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 20; max-width: min(92vw, 480px); padding: 12px 18px; border-radius: 14px; background: var(--ink); color: var(--bg); font-weight: 600; box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .5); animation: toast-in .2s ease-out; }
.toast.error { background: var(--lat); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }
@media (min-width: 900px) { .toast { bottom: 28px; } }

/* Bouton devenu coche après enregistrement. */
.btn.done { background: var(--ok) !important; color: #fff !important; padding: 0; margin-inline: auto; display: flex; }
.btn.done .ic { width: 24px; height: 24px; stroke-width: 3; }

/* Tirer pour synchroniser. */
.pull-ind { position: fixed; left: 50%; top: 0; z-index: 8; width: 42px; height: 42px; border-radius: 50%; background: var(--card); box-shadow: 0 8px 20px -10px rgba(0, 0, 0, .45); display: grid; place-items: center; opacity: 0; transform: translate(-50%, -44px); pointer-events: none; }
.pull-ind svg { width: 26px; height: 26px; }
.spin { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Journal par paquets. */
.more-row { display: grid; place-items: center; padding: 6px 0 2px; }

/* Bulle de la courbe de poids. */
.ch-guide { stroke: var(--mil); stroke-width: 1.5; }
.ch-gdot { fill: var(--mil); stroke: var(--card); stroke-width: 2; }
.ch-tip { fill: var(--ink); }
.ch-tip-1 { fill: var(--bg); font-size: 10.5px; font-weight: 700; font-family: var(--body); }
.ch-tip-2 { fill: var(--bg); opacity: .75; font-size: 9.5px; font-family: var(--body); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
