/* PFK — style « cuisine conviviale » : crème, terracotta, olive. */

@font-face {
  font-family: "Fraunces";
  src: url("fonts/fraunces.woff2") format("woff2");
  font-weight: 600 700;
  font-display: swap;
}
@font-face {
  font-family: "Nunito Sans";
  src: url("fonts/nunito-sans.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}

:root {
  --bg: #f6efe4;
  --bg-deep: #efe4d3;
  --card: #fffcf7;
  --ink: #2b211a;
  --ink-2: #5b4d41;
  --muted: #8c7c6d;
  --line: #eadfce;
  --line-strong: #dccdb8;

  --accent: #c2512e;
  --accent-hover: #a8421f;
  --accent-soft: #f8e2d7;
  --accent-ink: #fff;
  --olive: #587540;
  --olive-soft: #e4ecd8;
  --mustard: #c98f0e;
  --mustard-soft: #f9ecc8;
  --red: #b5382b;
  --red-soft: #f7dcd6;

  --pos: var(--olive);
  --neg: var(--red);

  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgb(74 48 24 / .05), 0 6px 20px -8px rgb(74 48 24 / .12);
  --shadow-lift: 0 2px 4px rgb(74 48 24 / .06), 0 14px 30px -10px rgb(74 48 24 / .22);

  --font-body: "Nunito Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Fraunces", ui-serif, Georgia, "Times New Roman", serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1613;
    --bg-deep: #231c18;
    --card: #262019;
    --ink: #f4ece2;
    --ink-2: #d2c4b5;
    --muted: #a39282;
    --line: #372e26;
    --line-strong: #473c32;
    --accent: #e77750;
    --accent-hover: #f08c67;
    --accent-soft: #43271c;
    --accent-ink: #1b1613;
    --olive: #93b578;
    --olive-soft: #28301f;
    --mustard: #e5b33d;
    --mustard-soft: #3a2f16;
    --red: #ef7f70;
    --red-soft: #432320;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 6px 20px -8px rgb(0 0 0 / .5);
    --shadow-lift: 0 2px 4px rgb(0 0 0 / .3), 0 14px 30px -10px rgb(0 0 0 / .6);
    color-scheme: dark;
  }
}

/* ------------------------------------------------------------------ Base */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  background-image: radial-gradient(circle at 12% -10%, var(--accent-soft) 0, transparent 38%),
                    radial-gradient(circle at 100% 0, var(--mustard-soft) 0, transparent 30%);
  background-attachment: fixed;
  color: var(--ink);
  font: 16px/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 650; letter-spacing: -.01em; line-height: 1.15; margin: 0; }
h1 { font-size: clamp(1.7rem, 4.5vw, 2.3rem); }
h2 { font-size: 1.2rem; }
p { margin: 0 0 .6rem; }
small { font-weight: 400; color: var(--muted); font-size: .82rem; margin-left: .3rem; }
img { max-width: 100%; }

.icon { width: 1.05em; height: 1.05em; flex: none; vertical-align: -.15em; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.sep { color: var(--line-strong); margin: 0 .15rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .74rem; font-weight: 750; color: var(--accent); margin: 0 0 .25rem; }
.label { font-family: var(--font-body); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 750; margin: 1.6rem 0 .6rem .2rem; }
.meta { color: var(--muted); font-size: .88rem; display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.meta-item { display: inline-flex; align-items: center; gap: .3rem; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem 16px calc(6rem + env(safe-area-inset-bottom, 0px));
}
section { margin: 0 0 1rem; }

/* ------------------------------------------------------------------ Navigation */

.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top, 0px);
}
.topbar-inner { max-width: 960px; margin: 0 auto; display: flex; align-items: center; gap: 1rem; padding: .6rem 16px; }
.brand { display: flex; align-items: center; gap: .5rem; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-logo {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--mustard)); font-size: 1.2rem;
  box-shadow: 0 4px 12px -4px color-mix(in srgb, var(--accent) 60%, transparent);
}
.brand-logo.big { width: 64px; height: 64px; border-radius: 20px; font-size: 2rem; margin: 0 auto .8rem; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; letter-spacing: .02em; }
.nav-top { display: flex; gap: .2rem; flex: 1; justify-content: center; }
.nav-top a, .nav-bottom a { display: flex; align-items: center; gap: .45rem; color: var(--ink-2); font-weight: 650; }
.nav-top a { padding: .5rem .9rem; border-radius: 999px; transition: background .15s, color .15s; }
.nav-top a:hover { background: var(--bg-deep); color: var(--ink); }
.nav-top a.on { background: var(--ink); color: var(--bg); }
.me { display: flex; align-items: center; gap: .5rem; color: var(--ink); font-weight: 650; padding: .25rem .7rem .25rem .25rem; border-radius: 999px; }
.me:hover { background: var(--bg-deep); color: var(--ink); }

.nav-bottom { display: none; }
@media (max-width: 720px) {
  .nav-top, .me-name { display: none; }
  .topbar-inner { justify-content: space-between; }
  .nav-bottom {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
    background: color-mix(in srgb, var(--card) 90%, transparent);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--line);
    padding: .35rem .4rem calc(.35rem + env(safe-area-inset-bottom, 0px));
  }
  .nav-bottom a { flex: 1; flex-direction: column; gap: .15rem; font-size: .7rem; padding: .35rem 0; border-radius: 12px; }
  .nav-bottom a .icon { width: 22px; height: 22px; }
  .nav-bottom a.on { color: var(--accent); }
  .nav-bottom a.on .icon { stroke-width: 2.4; }
}

/* ------------------------------------------------------------------ Mise en page */

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin: .3rem 0 1.2rem; }
.page-head p { margin: .3rem 0 0; }
.section-head, .card-head { display: flex; justify-content: space-between; align-items: center; gap: .6rem; margin-bottom: .8rem; }
.section-head { margin-top: 1.6rem; }
.card-head h2 { display: flex; align-items: center; gap: .5rem; font-size: 1.1rem; }
.card-head h2 .icon { color: var(--accent); }
.count { font-weight: 750; font-size: .85rem; color: var(--muted); background: var(--bg-deep); padding: .1rem .55rem; border-radius: 999px; }
.back { display: inline-block; color: var(--muted); font-weight: 650; font-size: .9rem; margin-bottom: .6rem; }
.back:hover { color: var(--accent); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 1rem; margin-bottom: 1rem; }
.grid-2 > .card, .grid-2 > section { margin: 0; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}
.card.note { white-space: pre-wrap; border-left: 4px solid var(--mustard); }
.list-card { padding: .3rem 0; overflow: hidden; }

/* ------------------------------------------------------------------ Boutons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  border: 0; border-radius: 999px; padding: .65rem 1.2rem;
  background: var(--accent); color: var(--accent-ink);
  font: inherit; font-weight: 750; line-height: 1.2; cursor: pointer; white-space: nowrap;
  box-shadow: 0 4px 14px -6px color-mix(in srgb, var(--accent) 70%, transparent);
  transition: transform .12s, background .15s, box-shadow .15s;
}
.btn:hover { background: var(--accent-hover); color: var(--accent-ink); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible, .icon-btn:focus-visible, .chip-btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }
.btn-sm { padding: .42rem .85rem; font-size: .86rem; }
.btn-block { width: 100%; }
.btn-soft { background: var(--accent-soft); color: var(--accent); box-shadow: none; }
.btn-soft:hover { background: color-mix(in srgb, var(--accent-soft) 70%, var(--accent) 12%); color: var(--accent-hover); }
.btn-quiet { background: transparent; color: var(--ink-2); box-shadow: none; border: 1px solid var(--line-strong); }
.btn-quiet:hover { background: var(--bg-deep); color: var(--ink); }
.btn-icon { padding: .6rem; }
.btn-danger { background: var(--red); color: #fff; box-shadow: none; }
.btn-danger:hover { background: color-mix(in srgb, var(--red) 85%, #000); color: #fff; }
.btn-danger-text { color: var(--red); }
.icon-btn { display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--red-soft); color: var(--red); }
.actions-bar { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1rem; }

/* ------------------------------------------------------------------ Pastilles & avatars */

.pill {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .18rem .62rem; border-radius: 999px; font-size: .8rem; font-weight: 750; white-space: nowrap;
  background: var(--bg-deep); color: var(--ink-2); border: 0;
}
.pill-ok { background: var(--olive-soft); color: var(--olive); }
.pill-mid { background: var(--mustard-soft); color: var(--mustard); }
.pill-low { background: var(--red-soft); color: var(--red); }
.pill-empty { background: var(--red); color: #fff; }
.pill-none { background: var(--bg-deep); color: var(--muted); }
.pill-accent { background: var(--accent-soft); color: var(--accent); }
.pill-btn { cursor: pointer; font: inherit; font-size: .78rem; font-weight: 700; }
.pill-btn:hover { background: var(--accent-soft); color: var(--accent); }
a.pill:hover { filter: brightness(.96); }

.avatar {
  --h: 20;
  display: inline-grid; place-items: center; flex: none;
  width: 38px; height: 38px; border-radius: 50%;
  background: hsl(var(--h) 55% 88%); color: hsl(var(--h) 55% 30%);
  font-weight: 800; font-size: .82rem; letter-spacing: .02em;
}
@media (prefers-color-scheme: dark) { .avatar { background: hsl(var(--h) 35% 28%); color: hsl(var(--h) 70% 85%); } }
.avatar.sm { width: 30px; height: 30px; font-size: .7rem; }
.avatar.xs { width: 22px; height: 22px; font-size: .58rem; }
.avatar.xl { width: 64px; height: 64px; font-size: 1.3rem; }
.avatar.more { background: var(--bg-deep); color: var(--muted); }
.avatars { display: inline-flex; }
.avatars .avatar { box-shadow: 0 0 0 2px var(--card); }
.avatars .avatar + .avatar { margin-left: -8px; }

/* ------------------------------------------------------------------ Formulaires */

.form label { display: block; font-weight: 700; font-size: .92rem; margin-bottom: 1rem; color: var(--ink-2); }
.form h2 { margin-bottom: 1rem; }
input, select, textarea {
  display: block; width: 100%; margin-top: .35rem;
  padding: .7rem .85rem; border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--ink); font: inherit; font-weight: 500;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
input[type="checkbox"] { width: auto; display: inline; margin: 0; accent-color: var(--accent); }
input[type="range"] { padding: 0; border: 0; background: none; accent-color: var(--accent); box-shadow: none; }
textarea { resize: vertical; }
fieldset { border: 0; padding: 0; margin: 0 0 1rem; min-width: 0; }
legend { font-weight: 700; font-size: .92rem; color: var(--ink-2); margin-bottom: .5rem; padding: 0; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 0 1rem; }
.form-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .4rem; }
.narrow { max-width: 640px; }
.check { display: flex !important; align-items: center; gap: .5rem; }
output { float: right; font-weight: 800; color: var(--accent); }
.inline-form { display: flex; gap: .5rem; align-items: center; margin: .6rem 0; }
.inline-form select, .inline-form input { margin: 0; flex: 1; min-width: 0; }

.search { position: relative; margin-bottom: 1rem; }
.search .icon { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { margin: 0; padding-left: 2.6rem; border-radius: 999px; background: var(--card); box-shadow: var(--shadow); }

.amount-field { display: flex; align-items: baseline; justify-content: center; gap: .3rem; margin: .2rem 0 1.2rem; }
.amount-field input {
  width: 8ch; text-align: right; border: 0; border-bottom: 2px solid var(--line-strong); border-radius: 0;
  background: transparent; font-family: var(--font-display); font-size: 2.6rem; font-weight: 700; padding: .1rem 0; box-shadow: none;
}
.amount-field input:focus { border-color: var(--accent); box-shadow: none; }
.amount-field span { font-family: var(--font-display); font-size: 2rem; color: var(--muted); }

.segmented { display: inline-flex; background: var(--bg-deep); border-radius: 999px; padding: .25rem; margin-bottom: 1rem; }
.segmented a { display: flex; align-items: center; gap: .4rem; padding: .45rem 1rem; border-radius: 999px; color: var(--ink-2); font-weight: 700; font-size: .92rem; }
.segmented a.on { background: var(--card); color: var(--accent); box-shadow: var(--shadow); }

.quick-select { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .6rem; }
.chip-btn { border: 0; background: none; color: var(--accent); font: inherit; font-size: .84rem; font-weight: 700; cursor: pointer; padding: .1rem .3rem; border-radius: 6px; }
.chip-btn:hover { background: var(--accent-soft); }
.who { display: flex; flex-wrap: wrap; gap: .45rem; }
.chip {
  display: inline-flex !important; align-items: center; gap: .45rem; margin: 0 !important;
  padding: .35rem .8rem .35rem .4rem; border: 1.5px solid var(--line-strong); border-radius: 999px;
  font-weight: 650 !important; cursor: pointer; user-select: none; transition: all .12s;
}
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.chip:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); }
.split-preview { margin: .7rem 0 0; font-weight: 700; color: var(--olive); min-height: 1.5em; }

.ings { display: flex; flex-direction: column; gap: .45rem; margin-bottom: .6rem; }
.ing-row { display: grid; grid-template-columns: 10px 1fr minmax(90px, 30%) 30px; gap: .5rem; align-items: center; }
.ing-row input { margin: 0; }
.ing-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); }
.ing-row.linked .ing-dot { background: var(--olive); box-shadow: 0 0 0 3px var(--olive-soft); }

/* ------------------------------------------------------------------ Messages */

.flash {
  display: flex; align-items: center; gap: .6rem;
  padding: .8rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem;
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); font-weight: 650;
  animation: pop .25s ease-out;
}
.flash .icon { width: 20px; height: 20px; padding: 3px; border-radius: 50%; color: #fff; }
.flash-success .icon { background: var(--olive); }
.flash-error { border-color: color-mix(in srgb, var(--red) 40%, var(--line)); }
.flash-error .icon { background: var(--red); }
.notice { display: flex; gap: .6rem; align-items: center; padding: .8rem 1rem; border-radius: var(--radius-sm); background: var(--mustard-soft); color: var(--ink); margin-bottom: 1rem; font-weight: 650; }
@keyframes pop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.empty { text-align: center; padding: 1.5rem 1rem; color: var(--muted); }
.empty-emoji { font-size: 2.6rem; margin-bottom: .4rem; }
.empty p { max-width: 36ch; margin: 0 auto 1rem; }
.calm { display: flex; align-items: center; gap: .5rem; color: var(--olive); font-weight: 650; margin: 0; }
.big-calm { font-size: 1.1rem; justify-content: center; padding: 1rem 0; }

.danger-zone { margin: 2rem 0 0; color: var(--muted); }
.danger-zone summary { cursor: pointer; font-size: .88rem; font-weight: 650; display: inline-flex; align-items: center; gap: .4rem; list-style: none; }
.danger-zone summary::-webkit-details-marker { display: none; }
.danger-zone summary:hover { color: var(--red); }
.danger-body { margin-top: .6rem; padding: 1rem; border: 1px dashed color-mix(in srgb, var(--red) 50%, var(--line)); border-radius: var(--radius-sm); }

/* ------------------------------------------------------------------ Dates & repas */

.date-tile {
  flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 62px; height: 70px; border-radius: 16px; background: var(--card); border: 1px solid var(--line);
  box-shadow: var(--shadow); line-height: 1;
}
.dt-wd { font-size: .66rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 800; color: var(--accent); }
.dt-day { font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; margin: .12rem 0; }
.dt-mon { font-size: .72rem; font-weight: 700; color: var(--muted); }
.date-tile.big { width: 78px; height: 88px; border-radius: 20px; }
.date-tile.big .dt-day { font-size: 2.2rem; }

.hello { margin: .4rem 0 1.2rem; }

.feature {
  position: relative; overflow: hidden;
  border-radius: calc(var(--radius) + 6px); padding: 1.4rem;
  background: linear-gradient(135deg, var(--accent) 0%, color-mix(in srgb, var(--accent) 55%, var(--mustard)) 100%);
  color: #fff; box-shadow: var(--shadow-lift); margin-bottom: 1rem;
}
.feature::after {
  content: "🍽️"; position: absolute; right: -10px; bottom: -28px; font-size: 9rem; opacity: .12; transform: rotate(-12deg); pointer-events: none;
}
.feature .eyebrow { color: rgb(255 255 255 / .85); }
.feature h2 { font-size: clamp(1.5rem, 4vw, 2rem); margin-bottom: .4rem; }
.feature h2 a { color: #fff; }
.feature .meta { color: rgb(255 255 255 / .88); }
.feature .date-tile { background: #fff; border: 0; color: #2b211a; }
.feature-top { display: flex; gap: 1.1rem; align-items: center; }
.feature-body { min-width: 0; }
.feature-foot { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid rgb(255 255 255 / .25); position: relative; z-index: 1; }
.feature-people { display: flex; align-items: center; gap: .6rem; font-weight: 650; }
.feature .avatars .avatar { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 80%, var(--mustard)); }
.feature .btn { background: #fff; color: var(--accent); box-shadow: 0 6px 18px -6px rgb(0 0 0 / .35); }
.feature .btn:hover { background: #fff7f1; }
.feature .btn-quiet { background: rgb(255 255 255 / .15); color: #fff; border-color: rgb(255 255 255 / .4); box-shadow: none; }
.feature .pill-ok { background: rgb(255 255 255 / .92); color: var(--olive); }
@media (prefers-color-scheme: dark) { .feature, .feature h2 a { color: #1b1613; } .feature .meta, .feature .eyebrow { color: rgb(27 22 19 / .75); } .feature .btn-quiet { color: #1b1613; border-color: rgb(27 22 19 / .3); } .feature-foot { border-color: rgb(27 22 19 / .2); } }

.meal-card { display: flex; gap: 1rem; align-items: center; position: relative; transition: transform .15s, box-shadow .15s; }
.meal-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.meal-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .2rem; }
.meal-card-foot { display: flex; align-items: center; gap: .6rem; margin-top: .35rem; }
.meal-card-action { position: relative; z-index: 2; }
.card-title { font-family: var(--font-display); font-weight: 650; font-size: 1.15rem; color: var(--ink); }
.stretched::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.signup { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 560px) {
  .meal-card { flex-wrap: wrap; }
  .meal-card-body { flex-basis: calc(100% - 80px); }
  .meal-card-action { width: 100%; }
  .meal-card-action .signup { justify-content: flex-start; }
}

.meal-hero { display: flex; gap: 1.2rem; align-items: center; margin: .2rem 0 1rem; flex-wrap: wrap; }
.meal-hero-body { flex: 1; min-width: 220px; }
.meal-hero-body h1 { margin-bottom: .35rem; }
.meal-hero-actions { display: flex; gap: .5rem; align-items: center; }

.tabs { display: flex; gap: .3rem; border-bottom: 2px solid var(--line); margin-bottom: 1.2rem; overflow-x: auto; scrollbar-width: none; }
.tabs a {
  display: flex; align-items: center; gap: .45rem; white-space: nowrap;
  padding: .7rem 1rem; margin-bottom: -2px; border-bottom: 2px solid transparent;
  color: var(--muted); font-weight: 750;
}
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--accent); border-color: var(--accent); }
.tab-count { font-size: .78rem; background: var(--bg-deep); color: var(--ink-2); padding: .08rem .5rem; border-radius: 999px; }
.tab-dot { width: 8px; height: 8px; border-radius: 50%; }
.tab-dot.ok { background: var(--olive); }
.tab-dot.due { background: var(--mustard); box-shadow: 0 0 0 3px var(--mustard-soft); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; margin-bottom: 1rem; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .8rem 1rem; box-shadow: var(--shadow); }
.stat-label { display: block; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 750; color: var(--muted); }
.stat-value { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 480px) { .stat { padding: .7rem; } .stat-value { font-size: 1.05rem; } }

/* ------------------------------------------------------------------ Listes */

.row-item, .stock-row, .user-row {
  display: flex; align-items: center; gap: .9rem; padding: .8rem 1.2rem; color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.row-item:last-child, .stock-row:last-child, .user-row:last-child { border-bottom: 0; }
a.row-item:hover { background: color-mix(in srgb, var(--bg-deep) 55%, transparent); color: var(--ink); }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 750; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.row-amount { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-date { font-weight: 750; color: var(--muted); font-size: .85rem; width: 4.5rem; flex: none; }
.row-item.is-transfer .row-title { color: var(--ink-2); font-weight: 650; }
.row-item.is-transfer .row-amount { color: var(--muted); }

.people-list { list-style: none; padding: 0; margin: 0 0 .4rem; }
.people-list li { display: flex; align-items: center; gap: .6rem; padding: .45rem 0; border-bottom: 1px solid var(--line); font-weight: 650; }
.people-list li:last-child { border-bottom: 0; }
.push { margin-left: auto; }

.shopping, .ing-list { list-style: none; padding: 0; margin: 0; }
.shopping li, .ing-list li { display: flex; align-items: center; gap: .6rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.shopping li:last-child, .ing-list li:last-child { border-bottom: 0; }
.shop-name, .ing-name { flex: 1; font-weight: 650; min-width: 0; }
.ing-name a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.ing-name a:hover { color: var(--accent); }

.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; }
.steps li { counter-increment: step; position: relative; padding: .2rem 0 1rem 2.8rem; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-family: var(--font-display); font-weight: 700;
}

/* ------------------------------------------------------------------ Équilibre */

.transfer { display: flex; justify-content: space-between; align-items: center; gap: .8rem; flex-wrap: wrap; padding: .8rem 0; border-bottom: 1px solid var(--line); }
.transfer:last-of-type { border-bottom: 0; }
.transfer-who { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.transfer-arrow { color: var(--muted); margin: 0 .2rem; }
.transfer-end { display: flex; align-items: center; gap: .8rem; margin-left: auto; }
.transfer-amount { font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; }

.bal-row { display: grid; grid-template-columns: minmax(110px, 1.2fr) 2fr minmax(90px, auto); gap: .9rem; align-items: center; padding: .45rem 0; }
.bal-name { display: flex; align-items: center; gap: .5rem; font-weight: 650; min-width: 0; }
.bal-bar { position: relative; height: 10px; background: var(--bg-deep); border-radius: 6px; }
.bal-bar::after { content: ""; position: absolute; left: 50%; top: -4px; bottom: -4px; width: 2px; border-radius: 1px; background: var(--line-strong); }
.bal-bar span { position: absolute; top: 0; bottom: 0; border-radius: 6px; }
.bal-bar span.pos { background: var(--olive); }
.bal-bar span.neg { background: var(--red); }
.bal-amount { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
@media (max-width: 480px) { .bal-row { grid-template-columns: 1fr auto; } .bal-bar { grid-column: 1 / -1; order: 3; } }

.debt { padding: .6rem 0; border-bottom: 1px solid var(--line); }
.debt:last-child { border-bottom: 0; }
.debt-meal { font-weight: 750; color: var(--ink); }
.debt-line { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; margin-top: .35rem; }

/* ------------------------------------------------------------------ Recettes */

.recipe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 1rem; }
.recipe-card { padding: 0; overflow: hidden; margin: 0; color: var(--ink); transition: transform .15s, box-shadow .15s; }
.recipe-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); color: var(--ink); }
.recipe-cover {
  --h: 20; height: 110px; display: grid; place-items: center;
  background: radial-gradient(circle at 22% 18%, hsl(calc(var(--h) + 18) 70% 74% / .9), transparent 58%),
              linear-gradient(135deg, hsl(var(--h) 52% 58%), hsl(calc(var(--h) + 22) 48% 46%));
}
.recipe-cover span { font-family: var(--font-display); font-size: 3.4rem; font-weight: 700; color: rgb(255 255 255 / .92); text-shadow: 0 4px 18px rgb(0 0 0 / .15); }
.recipe-body { padding: 1rem 1.1rem 1.1rem; }
.recipe-body .card-title { display: block; margin-bottom: .3rem; }
.recipe-meta { display: flex; gap: .9rem; flex-wrap: wrap; color: var(--muted); font-size: .84rem; font-weight: 650; margin-top: .5rem; }
.recipe-meta span { display: inline-flex; align-items: center; gap: .3rem; }

.recipe-hero { --h: 20; display: flex; gap: 1.2rem; align-items: center; margin: .2rem 0 1.2rem; }
.recipe-hero-letter {
  flex: none; width: 88px; height: 88px; border-radius: 24px; display: grid; place-items: center;
  background: linear-gradient(135deg, hsl(var(--h) 52% 58%), hsl(calc(var(--h) + 22) 48% 46%));
  font-family: var(--font-display); font-size: 2.8rem; font-weight: 700; color: #fff; box-shadow: var(--shadow-lift);
}
.recipe-hero-body { flex: 1; min-width: 0; }
.recipe-hero-body p { color: var(--ink-2); margin: .4rem 0 0; }
@media (max-width: 480px) { .recipe-hero-letter { width: 64px; height: 64px; font-size: 2rem; border-radius: 18px; } }

/* ------------------------------------------------------------------ Stock */

.level { display: block; position: relative; height: 8px; border-radius: 999px; background: var(--bg-deep); overflow: hidden; min-width: 60px; }
.level span { position: absolute; inset: 0 auto 0 0; border-radius: inherit; transition: width .3s; }
.lvl-ok span { background: var(--olive); }
.lvl-mid span { background: var(--mustard); }
.lvl-low span, .lvl-empty span { background: var(--red); }
.lvl-text-ok { color: var(--olive); }
.lvl-text-mid { color: var(--mustard); }
.lvl-text-low, .lvl-text-empty { color: var(--red); }

.level-btns { display: inline-flex; background: var(--bg-deep); border-radius: 999px; padding: 3px; gap: 2px; }
.level-btns button {
  border: 0; background: transparent; color: var(--muted); font: inherit; font-size: .76rem; font-weight: 750;
  padding: .3rem .5rem; min-width: 2.4rem; border-radius: 999px; cursor: pointer; transition: all .12s;
}
.level-btns button:hover { background: var(--card); color: var(--ink); }
.level-btns button.on { background: var(--ink); color: var(--bg); }

.stock-row { gap: 1rem; }
.stock-name { flex: 1; min-width: 0; font-weight: 750; color: var(--ink); display: flex; flex-direction: column; }
.stock-name:hover { color: var(--accent); }
.stock-name .meta { font-weight: 500; }
.stock-level { display: flex; align-items: center; gap: .6rem; width: 150px; }
.stock-level .level { flex: 1; }
.stock-pct { font-weight: 800; font-size: .85rem; width: 3rem; text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .stock-row { flex-wrap: wrap; gap: .5rem 1rem; }
  .stock-name { flex-basis: 100%; }
  .stock-level { flex: 1; width: auto; }
}

.stock-mini { display: grid; grid-template-columns: 1fr 80px 3rem; gap: .7rem; align-items: center; padding: .45rem 0; color: var(--ink); font-weight: 650; border-bottom: 1px solid var(--line); }
.stock-mini:last-child { border-bottom: 0; }
.stock-mini:hover { color: var(--accent); }
.stock-mini .small { text-align: right; }

.add-card { padding: 0; }
.add-card summary { cursor: pointer; padding: 1rem 1.2rem; font-weight: 750; color: var(--accent); display: flex; align-items: center; gap: .5rem; list-style: none; }
.add-card summary::-webkit-details-marker { display: none; }
.add-card[open] summary { border-bottom: 1px solid var(--line); }
.add-form { padding: 1.2rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 0 1rem; align-items: end; }
.add-form .btn { margin-bottom: 1rem; }

.low-card { border-left: 4px solid var(--red); }
.low-list { display: flex; flex-wrap: wrap; gap: .45rem; }

.stock-hero { display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; align-items: center; }
.stock-hero-level { display: flex; flex-direction: column; gap: .6rem; min-width: min(100%, 280px); }
.big-pct { font-family: var(--font-display); font-size: 3rem; font-weight: 700; line-height: 1; }
.big-pct small { font-size: 1.4rem; color: inherit; margin: 0; }
.stock-hero .level { height: 12px; }
.add-to-recipe { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.add-to-recipe label { margin-bottom: .2rem; }

/* ------------------------------------------------------------------ Admin & compte */

.user-row { flex-wrap: wrap; }
.user-row.inactive { opacity: .6; }
.user-actions { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.confirm { position: relative; }
.confirm summary { list-style: none; }
.confirm summary::-webkit-details-marker { display: none; }
.confirm-pop {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 5; width: 260px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .9rem; box-shadow: var(--shadow-lift);
}
@media (max-width: 640px) {
  .user-actions { width: 100%; padding-left: calc(38px + .9rem); }
  .user-actions .btn span { display: none; }
  .confirm-pop { left: 0; right: auto; }
}
.profile-head { display: flex; align-items: center; gap: 1rem; }
.profile-head p { margin: .2rem 0 0; }
.logout { margin-top: 1rem; }

/* ------------------------------------------------------------------ Connexion */

.auth-page { display: grid; place-items: center; min-height: 100vh; min-height: 100dvh; padding-block: 2rem; }
.auth { width: 100%; max-width: 400px; }
.auth-brand { text-align: center; margin-bottom: 1.4rem; }
.auth-brand p { color: var(--muted); margin-top: .4rem; }
.auth .card { padding: 1.6rem; }
.auth-foot { text-align: center; color: var(--muted); margin-top: 1rem; }
