/* Jow Fit — thème sombre par défaut, clair si le système le demande */
:root {
  color-scheme: dark;
  --bg: #090d15;
  --bg-2: #0d1320;
  --surface: #121a2a;
  --surface-2: #18223599;
  --surface-3: #1e2a40;
  --line: #ffffff12;
  --line-2: #ffffff1f;
  --text: #eef2f8;
  --text-2: #b6c0d2;
  --muted: #7d89a0;
  --accent: #3ddc97;
  --accent-2: #2bb3a3;
  --accent-ink: #052016;
  --intake: #3987e5;
  --burn: #e8743f;
  --deficit: #22b07d;
  --weight: #9085e9;
  --warn: #f2b33d;
  --danger: #ef5d5d;
  --shadow: 0 10px 30px #00000059, 0 2px 6px #00000040;
  --radius: 18px;
  --radius-s: 12px;
  --ease: cubic-bezier(.22, .8, .24, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f3f5f9; --bg-2: #eaeef5; --surface: #ffffff; --surface-2: #f6f8fbcc; --surface-3: #eef2f7;
    --line: #0b14281a; --line-2: #0b142829; --text: #0d1424; --text-2: #3d4960; --muted: #69758c;
    --accent: #12b277; --accent-2: #0f9488; --accent-ink: #ffffff;
    --intake: #2a78d6; --burn: #e4602b; --deficit: #138f63; --weight: #6250d6;
    --shadow: 0 10px 30px #0b14281a, 0 2px 6px #0b142812;
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f5f9; --bg-2: #eaeef5; --surface: #ffffff; --surface-2: #f6f8fbcc; --surface-3: #eef2f7;
  --line: #0b14281a; --line-2: #0b142829; --text: #0d1424; --text-2: #3d4960; --muted: #69758c;
  --accent: #12b277; --accent-2: #0f9488; --accent-ink: #ffffff;
  --intake: #2a78d6; --burn: #e4602b; --deficit: #138f63; --weight: #6250d6;
  --shadow: 0 10px 30px #0b14281a, 0 2px 6px #0b142812;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  background-image: radial-gradient(1200px 600px at 85% -10%, #3ddc9714, transparent 60%),
                    radial-gradient(900px 500px at -10% 110%, #3987e512, transparent 60%);
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.45 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 1, "cv11" 1;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
h1 { font-size: 26px; font-weight: 750; }
h2 { font-size: 17px; font-weight: 700; }
h3 { font-size: 14px; font-weight: 650; color: var(--text-2); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }

/* --------------------------------------------------------------- contrôles */
button, .btn {
  font: inherit; cursor: pointer; border: 1px solid var(--line-2); background: var(--surface-3);
  color: var(--text); border-radius: 12px; padding: 9px 14px; font-weight: 600;
  transition: transform .18s var(--ease), background .2s, border-color .2s, opacity .2s, box-shadow .2s;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
}
button:hover { border-color: var(--line-2); background: color-mix(in srgb, var(--surface-3) 80%, var(--text) 8%); }
button:active { transform: scale(.97); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--accent-ink);
  border-color: transparent; box-shadow: 0 6px 18px #3ddc9733;
}
button.primary:hover { filter: brightness(1.06); }
button.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
button.ghost:hover { background: var(--surface-3); color: var(--text); }
button.danger { color: var(--danger); }
button.icon { padding: 8px; border-radius: 10px; }
button.sm { padding: 6px 10px; font-size: 13px; border-radius: 10px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

input, select, textarea {
  font: inherit; color: var(--text); background: var(--bg-2); border: 1px solid var(--line-2);
  border-radius: 12px; padding: 10px 12px; width: 100%; transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px #3ddc9726; }
input[type="checkbox"] { width: auto; accent-color: var(--accent); }
input[type="range"] { padding: 0; accent-color: var(--accent); background: none; border: 0; }
label { display: grid; gap: 6px; font-size: 13px; color: var(--text-2); font-weight: 550; }
label.inline { display: flex; align-items: center; gap: 8px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.spacer { flex: 1; }
.err { color: var(--danger); font-size: 13px; min-height: 18px; }
.ok { color: var(--accent); }

.seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; font-size: 13px; color: var(--text-2); border-radius: 9px; }
.seg button.on { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 4px #0003; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px;
  background: var(--surface-3); color: var(--text-2); font-size: 12px; font-weight: 600; border: 1px solid var(--line);
}
.chip.green { color: var(--accent); background: #3ddc971a; border-color: #3ddc9733; }
.chip.orange { color: var(--burn); background: #e8743f1a; border-color: #e8743f33; }
.chip.warn { color: var(--warn); background: #f2b33d1a; border-color: #f2b33d33; }

/* ------------------------------------------------------------------ cartes */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); position: relative;
}
.card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-h .spacer { flex: 1; }

/* ---------------------------------------------------------- page d'accès */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: min(420px, 100%); padding: 30px 26px; animation: rise .6s var(--ease) both; }
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.brand svg { width: 42px; height: 42px; flex: none; }
.brand b { font-size: 21px; letter-spacing: -.02em; }
.brand span { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }
.auth-card form { display: grid; gap: 14px; }
.otp { letter-spacing: .5em; text-align: center; font-size: 22px; font-weight: 700; }
.lock-note { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; color: var(--muted); margin-top: 16px; }
.lock-note svg { flex: none; width: 16px; height: 16px; margin-top: 1px; }
.qr { display: grid; place-items: center; background: #fff; border-radius: 14px; padding: 8px; width: max-content; margin: 4px auto; }
.qr svg { display: block; width: 200px; height: 200px; }
.secret { font-family: ui-monospace, Menlo, monospace; font-size: 12px; word-break: break-all; text-align: center; color: var(--text-2); }
.steps { display: flex; gap: 6px; margin-bottom: 18px; }
.steps i { flex: 1; height: 4px; border-radius: 4px; background: var(--surface-3); transition: background .4s; }
.steps i.on { background: var(--accent); }

/* ----------------------------------------------------------- application */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; padding: 22px 14px; display: flex; flex-direction: column; gap: 4px;
  border-right: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(14px);
}
.side .brand { padding: 0 8px; margin-bottom: 18px; }
.nav-btn {
  justify-content: flex-start; width: 100%; background: transparent; border: 0; color: var(--text-2);
  padding: 10px 12px; border-radius: 12px; font-weight: 600; position: relative;
}
.nav-btn svg { width: 20px; height: 20px; flex: none; }
.nav-btn:hover { background: var(--surface-3); color: var(--text); }
.nav-btn.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.nav-btn.on::before {
  content: ""; position: absolute; left: -14px; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--accent);
}
.side .foot { margin-top: auto; display: grid; gap: 6px; }
.jow-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); margin-left: auto; }
.jow-dot.on { background: var(--accent); box-shadow: 0 0 0 4px #3ddc9726; }

main { padding: 26px 30px 90px; max-width: 1280px; width: 100%; margin: 0 auto; min-width: 0; }
.view { animation: viewIn .45s var(--ease) both; }
.view-h { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.view-h .sub { color: var(--muted); font-size: 14px; margin-top: 2px; }

.datenav { display: inline-flex; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 4px; }
.datenav b { min-width: 150px; text-align: center; font-size: 14px; }

/* Aujourd'hui */
.hero { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: 18px; margin-bottom: 18px; }
.ring-card { display: grid; place-items: center; padding: 22px; }
.ring { position: relative; width: 240px; height: 240px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.ring .track { stroke: var(--surface-3); }
.ring .arc { transition: stroke-dashoffset 1.3s var(--ease), stroke .4s; stroke-linecap: round; }
.ring .arc.over { stroke: var(--warn); }
.ring-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-center .big { font-size: 46px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.ring-center .lbl { color: var(--muted); font-size: 13px; margin-top: 6px; }
.ring-legend { display: flex; gap: 14px; margin-top: 14px; font-size: 12px; color: var(--muted); }
.ring-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.kpi { padding: 16px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); min-width: 0; }
.kpi .k { font-size: 12px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.kpi .k i { width: 8px; height: 8px; border-radius: 50%; }
.kpi .v { font-size: 26px; font-weight: 780; letter-spacing: -.02em; margin-top: 6px; }
.kpi .v small { font-size: 13px; color: var(--muted); font-weight: 600; margin-left: 3px; }
.kpi .d { font-size: 12px; color: var(--muted); margin-top: 2px; }
.hero-right { display: grid; gap: 14px; align-content: start; }

.macros { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.macro .top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 7px; }
.macro .top b { font-weight: 650; }
.meter { height: 8px; border-radius: 8px; background: var(--surface-3); overflow: hidden; }
.meter > i { display: block; height: 100%; width: 0; border-radius: 8px; transition: width 1.1s var(--ease); }

.weight-quick { display: flex; gap: 10px; align-items: center; }
.weight-quick input { max-width: 120px; }

.slots { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.slot .card-h svg { width: 22px; height: 22px; color: var(--accent); }
.slot-kcal { font-weight: 700; font-size: 14px; }
.items { display: grid; gap: 8px; }
.item {
  display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: center; padding: 8px;
  border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line);
  animation: itemIn .4s var(--ease) both; transition: opacity .3s, transform .3s, border-color .2s;
}
.item.planned { border-style: dashed; }
.item.planned .thumb { filter: grayscale(.6); opacity: .75; }
.item .thumb { width: 48px; height: 48px; border-radius: 11px; object-fit: cover; background: var(--surface-3); display: grid; place-items: center; color: var(--muted); }
.item .thumb svg { width: 22px; height: 22px; }
.item .t { font-weight: 620; font-size: 14px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.item .m { font-size: 12px; color: var(--muted); margin-top: 2px; }
.item .acts { display: flex; align-items: center; gap: 4px; }
.item.removing { opacity: 0; transform: translateX(16px) scale(.98); }
.eat {
  width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line-2); background: transparent; padding: 0;
  display: grid; place-items: center; color: transparent; transition: all .3s var(--spring);
}
.eat svg { width: 16px; height: 16px; }
.eat.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); transform: scale(1.05); }
.empty { color: var(--muted); font-size: 13px; padding: 14px; text-align: center; border: 1px dashed var(--line-2); border-radius: 14px; }
.stepper { display: inline-flex; align-items: center; background: var(--surface-3); border-radius: 10px; }
.stepper button { padding: 4px 8px; border: 0; background: transparent; font-size: 15px; }
.stepper span { min-width: 30px; text-align: center; font-size: 13px; font-weight: 650; }

/* Semaine */
.week { display: grid; grid-template-columns: repeat(7, minmax(150px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.day-col { padding: 14px; display: flex; flex-direction: column; gap: 10px; min-height: 340px; animation: rise .5s var(--ease) both; }
.day-col.today { border-color: #3ddc9766; box-shadow: 0 0 0 1px #3ddc9733, var(--shadow); }
.day-col .dh { display: flex; align-items: baseline; justify-content: space-between; }
.day-col .dh b { font-size: 15px; text-transform: capitalize; }
.day-col .dh span { font-size: 12px; color: var(--muted); }
.mini-meal { display: flex; gap: 8px; align-items: center; font-size: 12px; padding: 6px; border-radius: 10px; background: var(--bg-2); cursor: pointer; }
.mini-meal img, .mini-meal .ph { width: 30px; height: 30px; border-radius: 8px; object-fit: cover; flex: none; background: var(--surface-3); }
.mini-meal .tt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.mini-meal.done { opacity: .6; }
.slot-tag { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin-top: 4px; }
.day-col .add { margin-top: auto; }

/* Recettes */
.search { position: relative; flex: 1; min-width: 240px; max-width: 560px; }
.search input { padding-left: 42px; height: 46px; border-radius: 14px; font-size: 15px; }
.search svg { position: absolute; left: 14px; top: 13px; width: 20px; height: 20px; color: var(--muted); }
.rgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.rcard {
  padding: 0; overflow: hidden; cursor: pointer; text-align: left; display: block; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--text);
  animation: rise .5s var(--ease) both; transition: transform .3s var(--ease), box-shadow .3s;
}
.rcard:hover { transform: translateY(-4px); box-shadow: 0 18px 40px #0006; background: var(--surface); }
.rcard .img { aspect-ratio: 4/3; background: var(--surface-3); overflow: hidden; position: relative; }
.rcard img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s var(--ease), opacity .5s; opacity: 0; }
.rcard img.loaded { opacity: 1; }
.rcard:hover img { transform: scale(1.06); }
.rcard .kc {
  position: absolute; right: 10px; bottom: 10px; background: #0b1220d9; color: #fff; padding: 4px 9px; border-radius: 99px;
  font-size: 12px; font-weight: 700; backdrop-filter: blur(6px); transition: opacity .4s; opacity: 0;
}
.rcard .kc.show { opacity: 1; }
.rcard .body { padding: 12px 14px 14px; }
.rcard .t { font-weight: 680; font-size: 14px; line-height: 1.3; }
.rcard .c { font-size: 12px; color: var(--muted); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Modales */
dialog {
  border: 1px solid var(--line-2); background: var(--surface); color: var(--text); border-radius: 22px; padding: 0;
  width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 40px); box-shadow: 0 30px 80px #000a;
}
dialog[open] { animation: dlgIn .35s var(--ease) both; }
dialog::backdrop { background: #04070dcc; backdrop-filter: blur(6px); animation: fade .3s both; }
dialog.small { width: min(440px, calc(100vw - 32px)); }
.dlg-body { padding: 22px; overflow: auto; max-height: calc(100vh - 40px); }
.dlg-h { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.dlg-h .spacer { flex: 1; }
.rhero { margin: -22px -22px 18px; aspect-ratio: 16/8; background: var(--surface-3); position: relative; overflow: hidden; }
.rhero img { width: 100%; height: 100%; object-fit: cover; }
.rhero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 40%, var(--surface)); }
.rhero .x { position: absolute; top: 12px; right: 12px; z-index: 1; background: #0b1220aa; color: #fff; border: 0; }
.nutri { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 14px 0; }
.nutri div { background: var(--bg-2); border-radius: 12px; padding: 10px; text-align: center; border: 1px solid var(--line); }
.nutri b { display: block; font-size: 18px; }
.nutri span { font-size: 11px; color: var(--muted); }
.ing { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 16px; font-size: 13px; }
.ing li { display: flex; gap: 8px; }
.ing li span { color: var(--muted); margin-left: auto; white-space: nowrap; }
ol.steps-list { padding-left: 20px; font-size: 14px; color: var(--text-2); display: grid; gap: 8px; }
.add-bar { position: sticky; bottom: -22px; margin: 18px -22px -22px; padding: 14px 22px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px); border-top: 1px solid var(--line); display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.add-bar label { flex: 1; min-width: 110px; }

/* Sport */
.act-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.act {
  flex-direction: column; gap: 6px; padding: 12px 8px; font-size: 12px; font-weight: 600; background: var(--bg-2);
  border-radius: 14px; color: var(--text-2); white-space: normal; text-align: center; line-height: 1.2;
}
.act svg { width: 24px; height: 24px; color: var(--burn); }
.act.on { border-color: var(--burn); background: #e8743f14; color: var(--text); box-shadow: 0 0 0 3px #e8743f22; }
.estimate { font-size: 40px; font-weight: 800; letter-spacing: -.03em; color: var(--burn); }
.sport-layout { display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px; }
.list { display: grid; gap: 8px; }
.li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line); animation: itemIn .4s var(--ease) both; }
.li .ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: #e8743f1f; color: var(--burn); flex: none; }
.li .ic svg { width: 20px; height: 20px; }
.li .grow { flex: 1; min-width: 0; }
.li .grow b { display: block; font-size: 14px; }
.li .grow span { font-size: 12px; color: var(--muted); }

/* Progrès */
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.charts { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.charts .wide { grid-column: 1 / -1; }
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .grid line { stroke: var(--line); }
.chart .axis text { fill: var(--muted); font-size: 11px; }
.chart .draw { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: draw 1.4s var(--ease) forwards; }
.chart .fadein { opacity: 0; animation: fade .9s .4s var(--ease) forwards; }
.chart rect.bar { transform-box: fill-box; transform-origin: bottom; animation: grow .8s var(--ease) both; }
.chart rect.bar.neg { transform-origin: top; }
.chart .hover-line { stroke: var(--text-2); stroke-dasharray: 3 3; opacity: 0; transition: opacity .15s; }
.chart.hovering .hover-line { opacity: .6; }
.chart .dot { transition: r .15s; }
.tip {
  position: absolute; pointer-events: none; background: var(--surface-3); border: 1px solid var(--line-2); border-radius: 12px;
  padding: 8px 11px; font-size: 12px; box-shadow: var(--shadow); opacity: 0; transform: translateY(4px);
  transition: opacity .15s, transform .15s; white-space: nowrap; z-index: 3;
}
.chart.hovering .tip { opacity: 1; transform: none; }
.tip b { display: block; margin-bottom: 3px; }
.tip .r { display: flex; gap: 8px; align-items: center; color: var(--text-2); }
.tip .r i { width: 8px; height: 8px; border-radius: 2px; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-2); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.legend i.line { height: 3px; border-radius: 2px; }
.progress-goal { height: 12px; border-radius: 12px; background: var(--surface-3); overflow: hidden; margin-top: 10px; }
.progress-goal i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--weight), var(--accent)); border-radius: 12px; transition: width 1.4s var(--ease); }

/* Jow */
.jow-layout { display: grid; grid-template-columns: 380px 1fr; gap: 18px; align-items: start; }
.plan-item { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; padding: 10px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line); animation: itemIn .4s var(--ease) both; }
.plan-item img { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; }
.plan-item.done { opacity: .55; }
.order { padding: 12px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line); display: grid; gap: 10px; }
.order-recipes { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.order-recipe { flex: none; width: 130px; font-size: 12px; cursor: pointer; }
.order-recipe img { width: 130px; height: 90px; object-fit: cover; border-radius: 10px; display: block; margin-bottom: 4px; }
.status-big { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line); }
.status-big .pulse { width: 12px; height: 12px; border-radius: 50%; background: var(--muted); flex: none; }
.status-big .pulse.on { background: var(--accent); animation: pulse 2.4s infinite; }

/* Réglages */
.settings { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t td, table.t th { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.t th { color: var(--muted); font-weight: 600; font-size: 12px; }
.ua { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }

/* Toast */
.toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 100; width: max-content; max-width: calc(100vw - 32px); }
.toast { background: var(--surface-3); border: 1px solid var(--line-2); padding: 11px 16px; border-radius: 14px; box-shadow: var(--shadow); font-size: 14px; animation: toastIn .4s var(--spring) both; }
.toast.err { border-color: #ef5d5d66; }
.toast.out { animation: toastOut .3s var(--ease) forwards; }

.skeleton { background: linear-gradient(90deg, var(--surface-3), color-mix(in srgb, var(--surface-3) 60%, var(--text) 8%), var(--surface-3)); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 12px; }

/* Barre du bas (mobile) */
.tabbar { display: none; }

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes itemIn { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes dlgIn { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.95); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 #3ddc9766; } 70% { box-shadow: 0 0 0 10px #3ddc9700; } 100% { box-shadow: 0 0 0 0 #3ddc9700; } }

@media (max-width: 1100px) {
  .hero { grid-template-columns: 1fr; }
  .kpis, .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .charts, .sport-layout, .jow-layout, .settings { grid-template-columns: 1fr; }
  .week { grid-template-columns: repeat(7, 210px); }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  main { padding: 18px 16px 100px; }
  h1 { font-size: 22px; }
  .slots, .macros { grid-template-columns: 1fr 1fr; }
  .slots { grid-template-columns: 1fr; }
  .nutri { grid-template-columns: repeat(3, 1fr); }
  .ing { grid-template-columns: 1fr; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .ring { width: 210px; height: 210px; }
  .kpi .v { font-size: 22px; }
  .rgrid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .week { grid-template-columns: repeat(7, 78vw); scroll-snap-type: x mandatory; }
  .day-col { scroll-snap-align: start; }
  .tabbar {
    display: grid; grid-template-columns: repeat(6, 1fr); position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
    background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(16px); border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar button { flex-direction: column; gap: 3px; font-size: 10px; padding: 6px 2px; border: 0; background: transparent; color: var(--muted); }
  .tabbar button svg { width: 22px; height: 22px; }
  .tabbar button.on { color: var(--accent); }
  .datenav b { min-width: 110px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; }
}

/* utilitaires complémentaires */
.grid-col { display: grid; gap: 18px; align-content: start; }
form.grid-col { gap: 12px; }
.mt { margin-top: 14px; }
.inline-ic { width: 16px; height: 16px; vertical-align: -3px; margin-right: 4px; }
.card.small.muted > svg.inline-ic { width: 20px; height: 20px; color: var(--accent); }
.li img.mini-thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; flex: none; }
.li .grow b { cursor: pointer; }
.ring-center .big.over { color: var(--warn); }
.item .t.link { cursor: pointer; }
.item .t.link:hover { color: var(--accent); }
.day-col .dh { cursor: pointer; }
.chip svg { width: 14px; height: 14px; }
.btn { text-decoration: none !important; }
.btn svg, button svg { width: 18px; height: 18px; flex: none; }
.estimate small { font-size: 15px; }
.search > span svg, .search > svg { position: absolute; left: 14px; top: 13px; width: 20px; height: 20px; color: var(--muted); }
#amJow .search { max-width: none; margin: 14px 0 6px; }
#amJow .list { max-height: 52vh; overflow: auto; }
#amCustom form { margin-top: 12px; }
#amRecent { margin-top: 12px; gap: 6px; }
#amRecent .chip { cursor: pointer; }
.side .brand img { width: 42px; height: 42px; }
.datenav b { cursor: pointer; }

.pair-code { font-size: 44px; font-weight: 800; letter-spacing: .25em; text-align: center; padding: 14px; border-radius: 16px; background: var(--bg-2); border: 1px dashed #3ddc9766; color: var(--accent); animation: rise .5s var(--spring) both; }
.center { text-align: center; }
#pairBar { background: var(--accent); width: 100%; transition: width .5s linear; }
code.snippet { display: block; font: 11px/1.4 ui-monospace, Menlo, monospace; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px; word-break: break-all; color: var(--text-2); max-height: 120px; overflow: auto; }
