/* ============================================================
   JardiCook : styles (repris du design JardiCook.dc.html)
   ============================================================ */

@font-face { font-family: 'Instrument Sans'; font-weight: 400 700; font-display: swap; src: url('fonts/instrument-sans.woff2') format('woff2'); }
@font-face { font-family: 'Instrument Serif'; font-weight: 400; font-display: swap; src: url('fonts/instrument-serif.woff2') format('woff2'); }

:root {
  --page: #e6eae4;
  --bg: #f2f5f1;
  --ink: #10211a;
  --muted: #41544a;
  --green: #1c7a4f;
  --green-dark: #12563a;
  --line: #dde4dd;
  --line-soft: #edf1ec;
  --field: #cdd8cd;
  --dash: #b6c3b8;
  --filled: #eef3ec;
  --done-bg: #eef1ed;
  --done-ink: #5d6d64;
  --note: #2a5bd7;
  --serif: 'Instrument Serif', Georgia, serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--page); }
body { font-family: 'Instrument Sans', system-ui, -apple-system, sans-serif; color: var(--ink); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none; }
input, select, button, textarea { font-family: inherit; font-size: 16px; color: var(--ink); }
button { cursor: pointer; }
a { color: var(--green); text-decoration: none; }
[hidden] { display: none !important; }

@keyframes up { from { transform: translateY(101%); } to { transform: translateY(0); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.shell { max-width: 430px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; background: var(--bg); position: relative; padding-bottom: calc(104px + var(--safe-b)); overflow-x: hidden; }

/* ---------- en-têtes ---------- */
.head { padding: 22px 18px 12px; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.head--center { align-items: center; }
.h1 { font-family: var(--serif); font-weight: 400; font-size: 32px; line-height: 1.05; margin: 0; }
.h2 { font-family: var(--serif); font-weight: 400; font-size: 25px; line-height: 1.1; margin: 0; }
.sub { font-size: 15px; color: var(--muted); margin-top: 3px; font-weight: 500; }
.hint { padding: 0 18px 8px; font-size: 13px; color: var(--muted); line-height: 1.4; }
.lead { font-size: 15px; color: var(--muted); font-weight: 500; margin: 0; }

.week-nav { display: flex; align-items: center; gap: 4px; margin-top: 3px; }
.week-nav .sub { margin: 0; }
.nav-btn { width: 36px; height: 36px; border: 0; background: transparent; border-radius: 10px; font-size: 20px; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; margin-left: -8px; }
.nav-btn + .sub + .nav-btn { margin-left: 0; }

/* ---------- boutons ---------- */
.btn { height: 44px; padding: 0 14px; border-radius: 12px; font-size: 14px; font-weight: 600; border: 1.5px solid var(--ink); background: #fff; white-space: nowrap; }
.btn-soft { border-color: var(--field); color: var(--muted); }
.btn-primary { border: 0; background: var(--green); color: #fff; font-weight: 700; font-size: 15px; }
.btn-primary:active { background: var(--green-dark); }
.btn-xl { width: 100%; height: 58px; border-radius: 14px; font-size: 18px; }
.btn-lg { width: 100%; height: 54px; border-radius: 14px; font-size: 16px; }
.btn-dashed { width: 100%; height: 50px; border: 1.5px dashed var(--dash); background: transparent; border-radius: 13px; font-size: 16px; font-weight: 600; }
.btn:disabled { opacity: .5; }

/* ---------- semaine ---------- */
.days { display: flex; flex-direction: column; gap: 10px; padding: 8px 14px 20px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.day { padding: 12px 12px 13px; }
.day-head { display: flex; align-items: baseline; gap: 8px; padding: 0 2px 9px; }
.day-name { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.day-date { font-size: 13px; color: var(--muted); font-weight: 500; }
.day--today .day-name::after { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green); margin-left: 7px; vertical-align: middle; }
.slots { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.slot { min-height: 92px; border-radius: 13px; padding: 9px 10px; display: flex; flex-direction: column; gap: 5px; touch-action: manipulation; position: relative; border: 1.5px dashed var(--dash); background: transparent; text-align: left; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.slot--filled { background: var(--filled); border: 1.5px solid var(--field); }
.slot--aucun { background: transparent; border: 1.5px solid var(--line); }
.moment { font-size: 11px; font-weight: 700; letter-spacing: .07em; color: var(--muted); }
.slot-name { font-size: 15px; font-weight: 600; line-height: 1.2; letter-spacing: -.01em; }
.slot-meta { font-size: 12px; color: var(--muted); font-weight: 500; }
.slot-note { font-size: 15px; font-weight: 600; color: var(--note); }
.slot--aucun .slot-note { color: var(--muted); }
.slot-add { flex: 1; display: flex; align-items: center; font-size: 15px; font-weight: 600; color: var(--muted); }
.badge-fixe { align-self: flex-start; margin-top: 1px; font-size: 10px; font-weight: 700; letter-spacing: .06em; background: var(--ink); color: var(--bg); border-radius: 5px; padding: 3px 6px; }

/* ---------- courses ---------- */
.add-row { display: flex; gap: 8px; padding: 6px 14px 14px; }
.input { width: 100%; min-width: 0; height: 52px; border: 1.5px solid var(--field); background: #fff; border-radius: 13px; padding: 0 14px; font-size: 16px; font-weight: 500; }
.input:focus, .select:focus, .textarea:focus { outline: 2px solid var(--green); outline-offset: 0; border-color: var(--green); }
.input--lg { height: 54px; font-size: 17px; font-weight: 600; }
.add-row .btn-primary { height: 52px; padding: 0 18px; border-radius: 13px; font-size: 16px; }
.groups { display: flex; flex-direction: column; gap: 18px; padding: 0 14px 8px; }
.group-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 7px; }
.group-name { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.group-count { font-size: 13px; font-weight: 600; color: var(--muted); }
.list { overflow: hidden; }
.item { display: flex; align-items: center; gap: 13px; padding: 0 12px; min-height: 60px; border-top: 1px solid var(--line-soft); background: #fff; touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.list > .item:first-child, .list > .row:first-child, .list > .ing:first-child, .list > .rayon:first-child { border-top: 0; }
.check { width: 30px; height: 30px; flex: 0 0 30px; border: 2px solid var(--ink); border-radius: 8px; background: #fff; display: flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 700; }
.item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 9px 0; }
.item-name { font-size: 17px; font-weight: 600; line-height: 1.2; }
.item-q { font-size: 13px; color: var(--muted); font-weight: 500; }
.icon-btn { width: 44px; height: 44px; flex: 0 0 44px; border: 0; background: transparent; color: var(--muted); font-size: 20px; font-weight: 600; border-radius: 10px; }
.done-head { font-size: 13px; font-weight: 700; letter-spacing: .06em; color: var(--muted); padding: 0 4px 7px; }
.list--done { background: var(--done-bg); }
.list--done .item { background: var(--done-bg); min-height: 56px; border-top-color: #e3e8e2; }
.list--done .check { background: var(--ink); color: var(--bg); }
.list--done .item-name { font-weight: 500; color: var(--done-ink); text-decoration: line-through; }
.empty { margin: 8px 14px; padding: 18px 16px; font-size: 16px; font-weight: 500; color: var(--muted); line-height: 1.4; }
.empty .btn { margin-top: 12px; }

/* ---------- plats ---------- */
.search { padding: 4px 14px 14px; }
.rows { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.row { display: flex; align-items: center; gap: 12px; padding: 13px 18px; min-height: 68px; border-top: 1px solid var(--line-soft); width: 100%; background: #fff; border-left: 0; border-right: 0; border-bottom: 0; text-align: left; }
.rows > .row:first-child { border-top: 0; }
.row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.row-name { font-size: 17px; font-weight: 600; line-height: 1.2; }
.row-meta { font-size: 13px; color: var(--muted); font-weight: 500; }
.row-side { font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.row-choose { font-size: 15px; font-weight: 700; color: var(--green); }

/* ---------- formulaire ---------- */
.form { display: flex; flex-direction: column; gap: 16px; padding: 0 16px 20px; }
.label { display: block; font-size: 14px; font-weight: 700; padding-bottom: 7px; }
.field-row { display: flex; gap: 10px; }
.field-row > * { flex: 1; min-width: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { height: 46px; display: inline-flex; align-items: center; padding: 0 15px; border-radius: 12px; background: #fff; border: 1.5px solid var(--field); font-size: 15px; font-weight: 500; }
.chip--on { background: var(--ink); color: var(--bg); border-color: var(--ink); font-weight: 600; }
.chips--sm .chip { height: 44px; padding: 0 14px; border-radius: 11px; }
.chip-radio input { position: absolute; opacity: 0; pointer-events: none; }
.chip-radio input:checked + .chip { background: var(--ink); color: var(--bg); border-color: var(--ink); font-weight: 600; }
.ing-edit { background: #fff; border: 1.5px solid var(--field); border-radius: 13px; padding: 9px; display: flex; flex-direction: column; gap: 8px; }
.ing-edit .input, .select { height: 48px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; font-size: 16px; }
.ing-edit .input:first-child { font-weight: 600; }
.select { background: #fff; padding: 0 8px; min-width: 0; -webkit-appearance: none; appearance: none; }
.ing-line { display: flex; gap: 8px; }
.ing-line .q { width: 76px; flex: 0 0 76px; }
.ing-line .u { width: 92px; flex: 0 0 92px; }
.ing-line .c { flex: 1; }
.ing-line .icon-btn { width: 40px; flex-basis: 40px; }
.textarea { width: 100%; min-height: 150px; border: 1.5px solid var(--field); background: #fff; border-radius: 13px; padding: 12px 14px; font-size: 16px; line-height: 1.45; resize: vertical; }
.import { display: flex; gap: 8px; }
.photo-pick { display: flex; align-items: center; gap: 12px; }
.photo-thumb { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; border: 1px solid var(--line); }
.file-btn { position: relative; overflow: hidden; display: inline-flex; align-items: center; }
.file-btn input { position: absolute; inset: 0; opacity: 0; }
.notice { background: #fff; border: 1.5px solid var(--field); border-radius: 14px; padding: 14px 16px; font-size: 15px; font-weight: 500; color: var(--muted); }
.notice--error { border-color: #c2412d; color: #8f2a1b; }

/* ---------- rayons ---------- */
.rayon { display: flex; align-items: center; gap: 10px; padding: 0 10px 0 14px; min-height: 64px; border-top: 1px solid var(--line-soft); background: #fff; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.grip { display: flex; flex-direction: column; gap: 3px; width: 20px; flex: 0 0 20px; }
.grip i { height: 2px; background: #8b9c90; border-radius: 2px; display: block; }
.rayon-name { flex: 1; min-width: 0; font-size: 17px; font-weight: 600; }
.arrow { width: 46px; height: 46px; flex: 0 0 46px; border: 1.5px solid var(--field); background: #fff; border-radius: 11px; font-size: 17px; font-weight: 700; }
.arrow:disabled { opacity: .35; }
.section { padding: 8px 14px 20px; }
.section-title { font-size: 14px; font-weight: 700; padding: 6px 4px 8px; }
.toggle { width: 52px; height: 32px; border-radius: 16px; background: var(--field); border: 0; position: relative; flex: 0 0 52px; }
.toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: transform .15s ease; }
.toggle--on { background: var(--green); }
.toggle--on::after { transform: translateX(20px); }
.foot-link { display: block; text-align: center; padding: 8px 0 24px; font-size: 15px; font-weight: 600; color: var(--muted); }

/* ---------- fiche recette ---------- */
.fiche-photo { width: 100%; max-height: 220px; object-fit: cover; border-radius: 14px; margin-bottom: 12px; display: block; }
.fiche-meta { font-size: 15px; font-weight: 600; color: var(--muted); padding-bottom: 12px; }
.stepper { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 2px 12px; }
.stepper-ctl { display: flex; align-items: center; gap: 6px; }
.stepper-val { min-width: 34px; text-align: center; font-size: 18px; font-weight: 700; }
.ing { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 14px; border-top: 1px solid var(--line-soft); min-height: 54px; }
.ing-name { font-size: 16px; font-weight: 600; }
.ing-q { font-size: 15px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: flex; flex-direction: column; gap: 12px; }
.steps li { counter-increment: step; display: flex; gap: 12px; font-size: 16px; line-height: 1.45; }
.steps li::before { content: counter(step); flex: 0 0 28px; height: 28px; border-radius: 8px; background: var(--ink); color: var(--bg); font-size: 14px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.fiche-actions { display: flex; gap: 8px; padding-top: 16px; }
.fiche-actions .btn { flex: 1; height: 50px; }

/* ---------- feuille (bottom sheet) ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(16, 33, 26, .5); animation: fade .15s ease; z-index: 40; }
.sheet { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 430px; z-index: 41; }
.sheet-panel { animation: up .2s ease-out; background: var(--bg); border-radius: 20px 20px 0 0; padding: 14px 16px calc(22px + var(--safe-b)); max-height: 86vh; max-height: 86dvh; overflow-y: auto; overscroll-behavior: contain; box-shadow: 0 -8px 30px rgba(16, 33, 26, .28); }
.sheet-grip { width: 44px; height: 5px; border-radius: 3px; background: #c7d1c8; margin: 0 auto 12px; }
.sheet-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 0 2px 12px; }
.sheet-close { height: 40px; padding: 0 12px; border: 0; background: transparent; font-size: 15px; font-weight: 600; color: var(--muted); flex: 0 0 auto; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 9px; }
.pad { padding: 14px; }
.big-btn { width: 100%; min-height: 58px; border: 1.5px solid var(--field); background: #fff; border-radius: 14px; font-size: 18px; font-weight: 600; text-align: left; padding: 0 18px; }
.big-btn--primary { border: 0; background: var(--green); color: #fff; font-weight: 700; }
.big-btn--ink { border-color: var(--ink); }
.big-btn--ghost { background: transparent; font-size: 17px; color: var(--muted); }
.pick { display: flex; align-items: center; gap: 12px; background: #fff; border: 1.5px solid var(--field); border-radius: 14px; padding: 12px 14px; min-height: 66px; width: 100%; text-align: left; }
.pick--thin { border: 1px solid var(--line); border-radius: 13px; padding: 11px 14px; min-height: 62px; }
.filters { display: flex; flex-direction: column; gap: 11px; padding-bottom: 14px; }
.filter-label { font-size: 13px; font-weight: 700; color: var(--muted); padding-bottom: 6px; }

/* ---------- barre d'onglets ---------- */
.tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 430px; background: #fff; border-top: 1px solid var(--line); padding: 8px 8px calc(14px + var(--safe-b)); display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; z-index: 30; }
.tab { position: relative; height: 52px; border-radius: 13px; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 600; color: var(--muted); border: 0; background: transparent; }
.tab--on { background: var(--ink); color: var(--bg); font-weight: 700; }
.tab-badge { position: absolute; top: 2px; right: 4px; min-width: 22px; height: 22px; border-radius: 11px; background: var(--green); color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 5px; }

/* ---------- synchro ---------- */
.sync { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(86px + var(--safe-b)); z-index: 35; background: var(--ink); color: var(--bg); font-size: 13px; font-weight: 600; padding: 8px 14px; border-radius: 20px; white-space: nowrap; animation: fade .2s ease; }

/* ---------- compléments ---------- */
.linklike { border: 0; background: transparent; padding: 0; font: inherit; font-size: 15px; font-weight: 500; color: var(--muted); min-height: 36px; white-space: nowrap; text-align: left; }
.head > div { min-width: 0; }
.week-nav .nav-btn { width: 32px; }
.no-anim { animation: none !important; }
.fixe-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dragging { position: relative; z-index: 60; pointer-events: none; box-shadow: 0 10px 26px rgba(16, 33, 26, .25); transition: none; }
.drop-target { outline: 2.5px solid var(--green); outline-offset: 1px; }
.row[role="button"] { cursor: pointer; }
.pick .row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }

/* ---------- ingrédients partagés ---------- */
.src-btn { flex: 0 0 auto; height: 36px; padding: 0 11px; border-radius: 18px; border: 1.5px solid var(--ink); background: #fff; font-size: 13px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.src-btn--partiel { border-style: dashed; border-color: var(--green); color: var(--green); }
.src-total { font-size: 18px; font-weight: 700; padding: 0 2px 12px; }
.src-row .rayon-name { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; font-size: 16px; }
.src-off { text-decoration: line-through; color: var(--done-ink); }

/* ---------- connexion ---------- */
.auth { padding: 48px 18px 40px; display: flex; flex-direction: column; gap: 18px; }
