:root {
  --bg: #f6f3ee;
  --bg-2: #efeae2;
  --card: #ffffff;
  --ink: #1c1a24;
  --ink-2: #5d5a68;
  --muted: #8f8b99;
  --line: #e9e4dc;
  --primary: #5b4bdb;
  --primary-2: #7b6cf0;
  --primary-soft: #ecebfd;
  --accent: #ff7a59;
  --accent-soft: #fff0eb;
  --ok: #18a874;
  --danger: #e5484d;
  --gold: #f5a524;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(28, 26, 36, .04), 0 8px 24px -12px rgba(28, 26, 36, .12);
  --shadow-lg: 0 20px 50px -20px rgba(40, 30, 90, .35);
  --glass: rgba(255, 255, 255, .72);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Fraunces', Georgia, serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111016;
    --bg-2: #18171f;
    --card: #1c1b24;
    --ink: #f3f1f8;
    --ink-2: #c3bfd0;
    --muted: #8a8698;
    --line: #2b2935;
    --primary: #8f84ff;
    --primary-2: #a69dff;
    --primary-soft: #26233f;
    --accent: #ff8f73;
    --accent-soft: #3a231d;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -15px rgba(0, 0, 0, .6);
    --glass: rgba(28, 27, 36, .72);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111016;
  --bg-2: #18171f;
  --card: #1c1b24;
  --ink: #f3f1f8;
  --ink-2: #c3bfd0;
  --muted: #8a8698;
  --line: #2b2935;
  --primary: #8f84ff;
  --primary-2: #a69dff;
  --primary-soft: #26233f;
  --accent: #ff8f73;
  --accent-soft: #3a231d;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -15px rgba(0, 0, 0, .6);
  --glass: rgba(28, 27, 36, .72);
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 15.5px/1.5 var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 110% -10%, color-mix(in srgb, var(--primary) 12%, transparent), transparent 60%),
    radial-gradient(900px 400px at -20% 0%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
  padding-bottom: calc(96px + var(--safe-b));
}
a { color: var(--primary); text-decoration: none; }
h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.2; letter-spacing: -.01em; }
h2 { font-family: var(--serif); font-weight: 700; font-size: 1.3rem; }
h3 { font-size: 1.02rem; font-weight: 700; }
h4 { font-size: .9rem; color: var(--ink-2); }
code { background: var(--bg-2); padding: .1em .4em; border-radius: 6px; font-size: .85em; }
img { max-width: 100%; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; justify-content: center; }
.mt { margin-top: .8rem; }
.grow { flex: 1; min-width: 0; }

/* ---------- Barre du haut ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: .75rem;
  padding: calc(env(safe-area-inset-top, 0px) + .7rem) 1.1rem .7rem;
  background: var(--glass);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}
.topbar .back { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: var(--card); color: var(--ink); font-size: 1.7rem; line-height: 1; box-shadow: var(--shadow); padding-bottom: 3px; }
.topbar .brand { font-family: var(--serif); font-weight: 700; color: var(--ink); font-size: 1.05rem; white-space: nowrap; }
.topbar h1 { flex: 1; font-size: .95rem; font-weight: 600; color: var(--ink-2); margin: 0; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; font-weight: 700;
  background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 60%, #000));
  box-shadow: 0 4px 12px -4px var(--c);
}

.container { max-width: 760px; margin: 0 auto; padding: 1rem 1rem 0; animation: fadein .3s ease both; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.container.narrow { max-width: 420px; padding-top: 12vh; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Navigation flottante ---------- */
.bottomnav {
  position: fixed; z-index: 30;
  left: 50%; transform: translateX(-50%);
  bottom: calc(12px + var(--safe-b));
  width: min(520px, calc(100% - 24px));
  display: flex; justify-content: space-around;
  padding: 6px;
  background: var(--glass);
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: 26px;
  box-shadow: var(--shadow-lg);
}
.bottomnav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 7px 4px; border-radius: 20px;
  font-size: .68rem; font-weight: 600; color: var(--muted);
  transition: background .2s, color .2s, transform .15s;
}
.bottomnav a span { font-size: 1.25rem; line-height: 1.2; filter: grayscale(.6); transition: filter .2s, transform .2s; }
.bottomnav a.active { color: var(--primary); background: var(--primary-soft); }
.bottomnav a.active span { filter: none; transform: translateY(-1px) scale(1.08); }
.bottomnav a:active { transform: scale(.94); }

/* ---------- Cartes ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
  border: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .6rem; }
.card-head h2, .card-head h3 { margin: 0; }
.card-head > a:not(.btn) { font-size: .85rem; font-weight: 600; }
.card.empty { text-align: center; padding: 2.2rem 1rem; }
.card.highlight { background: linear-gradient(135deg, var(--primary-soft), var(--card)); }
.card.banner { display: flex; align-items: center; gap: .8rem; background: linear-gradient(135deg, var(--accent-soft), var(--card)); }
.card.cta { display: flex; align-items: center; gap: 1rem; background: linear-gradient(120deg, var(--primary), var(--primary-2)); color: #fff; border: 0; box-shadow: var(--shadow-lg); }
.card.cta .muted { color: rgba(255,255,255,.8); }
.card.cta .btn { background: #fff; color: var(--primary); border: 0; }
details.card > summary { cursor: pointer; font-weight: 600; color: var(--ink-2); list-style: none; }
details > summary::-webkit-details-marker { display: none; }

.greeting {
  font-family: var(--serif); font-size: 1.65rem; font-weight: 700; line-height: 1.15;
  margin: .4rem 0 1.1rem; letter-spacing: -.02em;
}

/* ---------- Boutons & formulaires ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  padding: .62rem 1rem; border-radius: 14px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font: 600 .9rem var(--font); cursor: pointer; white-space: nowrap;
  transition: transform .12s, box-shadow .2s, background .2s;
}
.btn:active { transform: scale(.96); }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; border-color: transparent; box-shadow: 0 6px 16px -6px var(--primary); }
.btn-light { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.btn-danger { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-sm { padding: .38rem .7rem; font-size: .8rem; border-radius: 11px; }
.btn-block { width: 100%; }
form.btn-block, form > .btn-block { margin-top: .5rem; }
.icon-btn { background: none; border: 0; font-size: 1.2rem; cursor: pointer; padding: .2rem .4rem; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; margin: .4rem 0 1rem; }
.actions form { margin: 0; }

input, select, textarea {
  width: 100%; font: 500 16px var(--font); color: var(--ink);
  background: var(--bg); border: 1.5px solid transparent; border-radius: var(--radius-sm);
  padding: .65rem .8rem; outline: none; transition: border .2s, background .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); background: var(--card); box-shadow: 0 0 0 4px var(--primary-soft); }
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--primary); }
input[type=color] { width: 44px; height: 40px; padding: 3px; flex: none; }
input[type=file] { background: transparent; padding: .4rem 0; }
textarea { resize: vertical; line-height: 1.5; }
label { display: flex; flex-direction: column; gap: .3rem; font-size: .8rem; font-weight: 600; color: var(--ink-2); }
label.inline { flex-direction: row; align-items: center; gap: .5rem; font-weight: 500; }
.stack { display: flex; flex-direction: column; gap: .85rem; }
.row { display: flex; gap: .7rem; flex-wrap: wrap; }
.row > label { flex: 1 1 120px; }
.row-inline { display: flex; align-items: center; gap: .5rem; margin-bottom: .6rem; }
.row-inline input:not([type=color]) { flex: 1; min-width: 0; }

.flash { padding: .8rem 1rem; border-radius: 14px; margin-bottom: 1rem; background: color-mix(in srgb, var(--ok) 12%, var(--card)); color: var(--ink); border: 1px solid color-mix(in srgb, var(--ok) 30%, transparent); font-weight: 500; animation: rise .3s ease; }
.flash-error { background: color-mix(in srgb, var(--danger) 10%, var(--card)); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }

.badge { display: inline-flex; align-items: center; gap: .3rem; font-size: .75rem; font-weight: 600; padding: .12rem .55rem .12rem .4rem; border-radius: 99px; background: color-mix(in srgb, var(--c) 14%, transparent); color: color-mix(in srgb, var(--c) 75%, var(--ink)); }
.badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.badge-empty { --c: var(--danger); }
.pill { display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: .2rem .55rem; border-radius: 99px; background: var(--accent-soft); color: var(--accent); }
.tag { font-size: .8rem; color: var(--muted); }

/* ---------- Tuiles « Plus » ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .8rem; }
.tile { display: flex; flex-direction: column; gap: .5rem; padding: 1.2rem 1rem; border-radius: var(--radius); background: var(--card); color: var(--ink); font-weight: 700; box-shadow: var(--shadow); border: 1px solid color-mix(in srgb, var(--line) 55%, transparent); transition: transform .15s; }
.tile span { font-size: 1.8rem; }
.tile:active { transform: scale(.97); }

/* ---------- Agenda ---------- */
.cal-toolbar { display: flex; align-items: center; gap: .4rem; margin-bottom: .8rem; flex-wrap: wrap; }
.cal-toolbar strong { flex: 1; font-family: var(--serif); font-size: 1.15rem; text-align: center; min-width: 150px; }
.chips { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .4rem; margin-bottom: .6rem; scrollbar-width: none; }
.chips form { margin: 0; }
.chip { border: 1px solid color-mix(in srgb, var(--c, var(--line)) 55%, transparent); border-radius: 99px; padding: .4rem .85rem; font: 600 .8rem var(--font); background: color-mix(in srgb, var(--c, var(--muted)) 16%, var(--card)); color: color-mix(in srgb, var(--c, var(--ink)) 70%, var(--ink)); white-space: nowrap; cursor: pointer; }
.chip.off { background: var(--card); color: var(--muted); text-decoration: line-through; opacity: .7; }

.day { background: var(--card); border-radius: var(--radius); padding: .9rem 1rem; margin-bottom: .8rem; box-shadow: var(--shadow); border: 1px solid color-mix(in srgb, var(--line) 55%, transparent); }
.day.today { border: 1.5px solid var(--primary); box-shadow: 0 10px 30px -18px var(--primary); }
.day.today .day-head h3::after { content: "Aujourd'hui"; margin-left: .5rem; font-size: .65rem; text-transform: uppercase; letter-spacing: .06em; background: var(--primary); color: #fff; padding: .15rem .45rem; border-radius: 99px; vertical-align: middle; }
.day.past { opacity: .62; }
.day-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .4rem; }
.day-head h3 { margin: 0; }

.event { display: flex; gap: .8rem; align-items: center; padding: .6rem .7rem; margin: .35rem 0; border-radius: 14px; color: var(--ink); background: color-mix(in srgb, var(--c) 9%, transparent); border-left: 4px solid var(--c); transition: transform .12s; }
.event:active { transform: scale(.98); }
.event .time { font-weight: 700; font-size: .8rem; min-width: 52px; color: color-mix(in srgb, var(--c) 70%, var(--ink)); }
.ev-title { display: flex; flex-direction: column; font-weight: 600; min-width: 0; }
.ev-title small { font-weight: 500; color: var(--muted); font-size: .76rem; }

.month { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; background: var(--card); padding: .6rem; border-radius: var(--radius); box-shadow: var(--shadow); }
.mh { text-align: center; font-size: .7rem; font-weight: 700; color: var(--muted); padding: .2rem; }
.mday { min-height: 74px; padding: .3rem; border-radius: 10px; background: var(--bg); color: var(--ink); display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.mday.other { opacity: .4; }
.mday.today { background: var(--primary-soft); outline: 1.5px solid var(--primary); }
.mday .num { font-weight: 700; font-size: .8rem; }
.dot-ev { font-size: .66rem; line-height: 1.25; padding: 1px 4px; border-radius: 5px; background: color-mix(in srgb, var(--c) 22%, transparent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mday .more { font-size: .62rem; color: var(--muted); }

.fab { position: fixed; right: max(18px, calc(50% - 360px)); bottom: calc(96px + var(--safe-b)); width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; font-size: 1.8rem; color: #fff; background: linear-gradient(135deg, var(--accent), #ff5a8a); box-shadow: 0 12px 28px -10px var(--accent); z-index: 25; }

/* ---------- École ---------- */
.pickup { display: flex; align-items: center; gap: .75rem; padding: .6rem .7rem; margin: .35rem 0; border-radius: 14px; background: color-mix(in srgb, var(--c) 10%, transparent); border-left: 4px solid var(--c); }
.pickup .time { font-weight: 800; font-size: .85rem; min-width: 48px; }
.pk-body { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pk-body small { font-size: .76rem; color: var(--muted); }
.pickup form { margin: 0; }
.pickup.unassigned { background: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--danger) 8%, transparent) 0 10px, transparent 10px 20px); border-left-color: var(--danger); }
.pickup.cancelled { opacity: .45; text-decoration: line-through; }
.pickup-wrap > summary { list-style: none; cursor: pointer; }
.pickup-edit { padding: .6rem .2rem 1rem; }
.tpl-day { padding: .5rem 0; border-top: 1px solid var(--line); }
.tpl-row { display: grid; grid-template-columns: 54px 92px 1fr 1fr; gap: .4rem; align-items: center; margin: .3rem 0; }
.tpl-row input, .tpl-row select { padding: .45rem .5rem; font-size: 14px; }
@media (max-width: 480px) { .tpl-row { grid-template-columns: 50px 88px 1fr; } .tpl-row input[name$='[place]'] { grid-column: 2 / -1; } }

/* ---------- Tâches ---------- */
.segmented { display: flex; background: var(--bg-2); padding: 4px; border-radius: 14px; margin-bottom: 1rem; }
.segmented a { flex: 1; text-align: center; padding: .5rem; border-radius: 11px; color: var(--ink-2); font-weight: 600; font-size: .85rem; }
.segmented a.active { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.task { display: flex; align-items: flex-start; gap: .75rem; padding: .65rem 0; border-bottom: 1px solid var(--line); }
.task:last-child { border-bottom: 0; }
.task form { margin: 0; }
.task-body { display: flex; flex-direction: column; gap: 3px; color: var(--ink); flex: 1; min-width: 0; }
.task-body small { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: .76rem; }
.task.done .task-body strong { text-decoration: line-through; color: var(--muted); }
.late { color: var(--danger); font-weight: 700; }
.check { width: 26px; height: 26px; flex: none; border-radius: 9px; border: 2px solid color-mix(in srgb, var(--primary) 50%, var(--line)); background: transparent; color: #fff; font-weight: 800; cursor: pointer; display: grid; place-items: center; transition: all .2s; }
.done .check, .check.on { background: var(--ok); border-color: var(--ok); }
.task-form > input[name=title] { font-size: 1.05rem; font-weight: 600; }

/* ---------- Recettes ---------- */
.searchbar { display: flex; gap: .5rem; margin-bottom: .8rem; }
.searchbar input { flex: 2; }
.searchbar select { flex: 1; }
.recipe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: .9rem; }
.recipe-card, .recipe-card > button { display: flex; flex-direction: column; gap: .35rem; color: var(--ink); background: none; border: 0; padding: 0; text-align: left; font: inherit; cursor: pointer; }
.recipe-card .thumb { aspect-ratio: 4/5; border-radius: 18px; background: linear-gradient(135deg, var(--accent-soft), var(--primary-soft)) center/cover; display: grid; place-items: center; font-size: 2.6rem; box-shadow: var(--shadow); transition: transform .2s; }
.recipe-card:hover .thumb { transform: translateY(-2px); }
.recipe-card strong { font-family: var(--serif); font-size: 1rem; line-height: 1.2; padding: 0 .15rem; }
.recipe-card small { color: var(--muted); font-size: .76rem; padding: 0 .15rem; }

.recipe .hero { width: calc(100% + 2rem); max-height: 380px; object-fit: cover; margin: -1rem -1rem 1rem; border-radius: 0 0 28px 28px; display: block; box-shadow: var(--shadow-lg); }
.recipe-head { display: flex; justify-content: space-between; align-items: flex-start; }
.recipe-head h2 { font-size: 1.9rem; letter-spacing: -.02em; }
.recipe-head form { margin: 0; }
.meta { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; color: var(--ink-2); font-weight: 600; font-size: .88rem; }
.stepper { display: flex; align-items: center; gap: .3rem; background: var(--bg); border-radius: 12px; padding: 3px; font-size: .85rem; }
.stepper button { width: 30px; height: 30px; border-radius: 9px; border: 0; background: var(--card); font-size: 1.1rem; cursor: pointer; color: var(--ink); box-shadow: var(--shadow); }
.ingredients { list-style: none; padding: 0; margin: 0 0 .5rem; }
.ingredients li { padding: .5rem 0; border-bottom: 1px dashed var(--line); }
.ingredients li.section { font-family: var(--serif); font-weight: 700; color: var(--accent); border: 0; padding-top: .9rem; }
.ingredients b { color: var(--primary); }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: s; position: relative; padding: .2rem 0 1rem 2.6rem; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 1.9rem; height: 1.9rem; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .85rem; background: var(--accent-soft); color: var(--accent); }
.preview { max-height: 160px; border-radius: 12px; object-fit: cover; }
ol.help { padding-left: 1.2rem; }
ol.help li { margin-bottom: .4rem; }

/* ---------- Repas ---------- */
.day.empty .day-head { margin-bottom: 0; }
.meal { display: flex; align-items: center; gap: .5rem; background: var(--card); border-radius: 12px; padding: .35rem .45rem; box-shadow: var(--shadow); }
.meal img { width: 38px; height: 38px; border-radius: 9px; object-fit: cover; }
.meal a { color: var(--ink); font-weight: 600; font-size: .88rem; }
.meal form { margin: 0; }
.serv-mini { display: flex; align-items: center; font-size: .75rem; }
.serv-mini input { width: 44px; padding: .2rem; text-align: center; font-size: 13px; }
.count-badge { display: inline-grid; place-items: center; min-width: 1.6em; height: 1.6em; padding: 0 .4em; margin-left: .3rem; border-radius: 99px; background: var(--primary); color: #fff; font: 700 .75rem var(--font); vertical-align: middle; }
.meal-line { display: flex; gap: .6rem; align-items: center; padding: .45rem 0; color: var(--ink); font-weight: 600; }

/* ---------- Courses ---------- */
.addbar { display: flex; gap: .5rem; margin-bottom: 1rem; position: sticky; top: 64px; z-index: 5; }
.addbar input { background: var(--card); box-shadow: var(--shadow); }
.addbar .btn { font-size: 1.3rem; width: 52px; }
.store-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin-bottom: 1rem; }
.store { display: flex; flex-direction: column; padding: .8rem; border-radius: 16px; color: #fff; border: 0; font: inherit; text-align: left; cursor: pointer; box-shadow: var(--shadow); }
.store b { font-size: .95rem; }
.store small { opacity: .85; font-size: .72rem; }
.store.carrefour { background: linear-gradient(135deg, #004e9f, #1b6fd1); }
.store.leclerc { background: linear-gradient(135deg, #0066b3, #f39200 160%); }
.store.share { background: linear-gradient(135deg, #2d2a3a, #4a4560); }
.aisle h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; color: var(--accent); }
.shop-item { display: flex; align-items: center; gap: .75rem; padding: .55rem 0; border-bottom: 1px solid var(--line); margin: 0; }
.shop-item form { margin: 0; }
.item-edit { display: flex; align-items: center; gap: .6rem; background: none; border: 0; padding: .2rem 0; font: 500 1rem var(--font); color: var(--ink); text-align: left; cursor: pointer; min-width: 0; }
.item-edit > span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.shop-item .icon-btn { font-size: .95rem; opacity: .55; }
.done-btn { margin-bottom: 1rem; }
.usual { display: flex; gap: .4rem; overflow-x: auto; padding: 0 0 .8rem; margin-top: -.4rem; scrollbar-width: none; align-items: center; }
.usual form { margin: 0; }
.usual-label { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); white-space: nowrap; }
.chip-add { border: 1px dashed color-mix(in srgb, var(--primary) 40%, var(--line)); background: var(--card); color: var(--primary); border-radius: 99px; padding: .35rem .75rem; font: 600 .8rem var(--font); white-space: nowrap; cursor: pointer; }
.chip-add:active { transform: scale(.95); }
.mic { width: 48px; font-size: 1.15rem; flex: none; }
.addbar.plain { position: static; margin: 0; }
.addbar.plain input { box-shadow: none; background: var(--bg); }
.mic.listening { background: var(--danger); color: #fff; border-color: transparent; animation: pulse 1s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--danger) 25%, transparent); } }
.shop-item:last-child { border-bottom: 0; }
.shop-item .qty, .drive-item .qty { font-size: .82rem; font-weight: 700; color: var(--ink-2); background: var(--bg); padding: .15rem .5rem; border-radius: 8px; }
.shop-item.done .item-edit { text-decoration: line-through; color: var(--muted); }
.shop-item.leaving { animation: away .35s ease forwards; }
@keyframes away { to { opacity: 0; transform: translateX(30px); height: 0; padding: 0; } }
.drive-item { display: flex; align-items: center; gap: .7rem; padding: .7rem 0; border-bottom: 1px solid var(--line); color: var(--ink); font-weight: 600; }
.drive-item.seen { opacity: .4; }

/* ---------- Dialogues ---------- */
dialog { border: 0; border-radius: 24px; padding: 1.3rem; width: min(420px, calc(100% - 32px)); background: var(--card); color: var(--ink); box-shadow: var(--shadow-lg); }
dialog::backdrop { background: rgba(15, 12, 30, .45); backdrop-filter: blur(4px); }

/* ---------- Connexion ---------- */
body.public { padding-bottom: 2rem; }
.public .logo { display: block; margin: 0 auto 1rem; width: 84px; height: 84px; border-radius: 22px; box-shadow: 0 18px 40px -14px rgba(91, 75, 219, .55); }
.public h1 { font-family: var(--serif); font-size: 2.2rem; }
.public .card { padding: 1.4rem; }
.member > summary { padding: .5rem 0; cursor: pointer; }

/* ---------- Anniversaires ---------- */
.date-row { display: flex; align-items: center; gap: .8rem; padding: .55rem 0; border-bottom: 1px solid var(--line); color: var(--ink); }
.date-row:last-child { border-bottom: 0; }
.date-row .grow { display: flex; flex-direction: column; }
.date-chip { width: 48px; flex: none; text-align: center; border-radius: 12px; background: var(--accent-soft); color: var(--accent); font-size: .66rem; font-weight: 700; text-transform: uppercase; padding: .3rem 0; line-height: 1.1; }
.date-chip b { display: block; font-family: var(--serif); font-size: 1.25rem; }
.date-row.is-today .date-chip { background: var(--accent); color: #fff; }
.date-line { display: block; padding: .4rem 0; color: var(--ink); font-size: .9rem; }
.fill-btn { margin-bottom: 1rem; background: linear-gradient(135deg, var(--accent-soft), var(--card)); border-color: color-mix(in srgb, var(--accent) 30%, transparent); color: var(--accent); }
.chips-check { display: flex; flex-wrap: wrap; gap: .4rem .9rem; }
.meal .icon-btn { font-size: .95rem; padding: .1rem .2rem; }

/* ---------- Mode cuisine ---------- */
body.cook { padding: 0; min-height: 100vh; display: flex; flex-direction: column; }
.cook-top { display: flex; align-items: center; gap: .8rem; padding: calc(env(safe-area-inset-top, 0px) + .7rem) 1rem .7rem; }
.cook-close { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--card); color: var(--ink); box-shadow: var(--shadow); font-size: 1.1rem; }
.cook-title { flex: 1; font-weight: 700; display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.cook-title small { color: var(--muted); font-weight: 500; }
.cook-ing-btn { border: 0; background: var(--accent-soft); color: var(--accent); font: 700 .85rem var(--font); padding: .55rem .8rem; border-radius: 12px; }
.cook-progress { height: 4px; background: var(--line); margin: 0 1rem; border-radius: 4px; overflow: hidden; }
.cook-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width .3s; }
.cook-steps { flex: 1; position: relative; padding: 1.5rem 1.4rem 9rem; max-width: 760px; width: 100%; margin: 0 auto; }
.cook-step { display: none; animation: rise .3s ease; }
.cook-step.active { display: block; }
.cook-step .kicker { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 700; color: var(--accent); margin: 0 0 1rem; }
.cook-step h1 { font-family: var(--serif); font-size: 2.1rem; }
.cook-text { font-size: clamp(1.45rem, 5.5vw, 2.1rem); line-height: 1.4; font-weight: 500; margin: 0 0 1.5rem; }
.cook-ing-list { list-style: none; padding: 0; margin: 1rem 0; }
.cook-ing-list li { padding: .65rem 0; border-bottom: 1px dashed var(--line); font-size: 1.1rem; }
.cook-ing-list label { flex-direction: row; align-items: center; gap: .7rem; font-size: 1.1rem; font-weight: 500; color: var(--ink); }
.cook-ing-list input { width: 24px; height: 24px; }
.cook-ing-list input:checked + b, .cook-ing-list label:has(input:checked) { opacity: .45; text-decoration: line-through; }
.timer-btn { display: inline-flex; margin: 0 .5rem .6rem 0; border: 0; border-radius: 16px; padding: .9rem 1.2rem; font: 700 1.05rem var(--font); background: var(--primary-soft); color: var(--primary); }
.cook-nav { position: fixed; left: 0; right: 0; bottom: 0; display: flex; gap: .7rem; padding: .9rem 1rem calc(.9rem + var(--safe-b)); background: var(--glass); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-top: 1px solid var(--line); }
.cook-nav .btn { flex: 1; padding: 1rem; font-size: 1.05rem; border-radius: 18px; }
.cook-nav .btn:disabled { opacity: .4; }
.timers { position: fixed; left: 1rem; right: 1rem; bottom: calc(86px + var(--safe-b)); display: flex; flex-direction: column; gap: .4rem; z-index: 5; max-width: 728px; margin: 0 auto; }
.timer { display: flex; align-items: center; gap: .7rem; background: var(--ink); color: var(--bg); padding: .7rem 1rem; border-radius: 16px; box-shadow: var(--shadow-lg); }
.timer .t-label { flex: 1; font-size: .85rem; opacity: .8; }
.timer b { font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.timer button { background: none; border: 0; color: inherit; font-size: 1rem; opacity: .7; }
.timer.ringing { background: var(--danger); color: #fff; animation: pulse 1s infinite; }

/* ---------- Écran cuisine (tablette) ---------- */
body.screen { padding: 1.4rem 1.6rem; min-height: 100vh; background: radial-gradient(1000px 600px at 100% 0%, color-mix(in srgb, var(--primary) 18%, transparent), transparent 60%), radial-gradient(800px 500px at 0% 100%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 60%), var(--bg); cursor: none; }
.scr-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 1.2rem; }
.scr-clock { font-family: var(--serif); font-size: clamp(3.5rem, 9vw, 6.5rem); font-weight: 700; line-height: .9; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.scr-date { font-size: clamp(1.1rem, 2.2vw, 1.5rem); color: var(--ink-2); font-weight: 600; margin-top: .3rem; }
.scr-weather { display: flex; align-items: center; gap: .7rem; text-align: right; }
.scr-weather .w-icon { font-size: 3.2rem; }
.scr-weather b { display: block; font-size: 2.6rem; font-family: var(--serif); line-height: 1; }
.scr-weather small { color: var(--muted); font-weight: 600; }
.scr-grid { display: grid; grid-template-columns: 1.25fr 1fr 1fr; grid-template-rows: auto auto; gap: 1rem; }
.scr-card { background: var(--card); border-radius: 26px; padding: 1.2rem 1.4rem; box-shadow: var(--shadow); border: 1px solid color-mix(in srgb, var(--line) 55%, transparent); }
.scr-card h2 { font-size: 1.35rem; }
.scr-card h2 small { color: var(--muted); font-family: var(--font); font-size: .9rem; }
.scr-card h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin: .9rem 0 .4rem; }
.scr-today { grid-row: span 2; }
.scr-week { grid-column: span 2; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .3rem 1rem; align-content: start; }
.scr-week h2 { grid-column: 1 / -1; }
.scr-day h3 { margin-top: .3rem; }
.scr-ev { display: flex; gap: .8rem; align-items: baseline; padding: .55rem .8rem; margin: .35rem 0; border-radius: 14px; background: color-mix(in srgb, var(--c) 11%, transparent); border-left: 5px solid var(--c); font-size: 1.15rem; font-weight: 600; }
.scr-ev span { font-size: .95rem; font-weight: 800; min-width: 52px; color: color-mix(in srgb, var(--c) 70%, var(--ink)); }
.scr-ev.small { font-size: .9rem; padding: .35rem .6rem; border-left-width: 3px; }
.scr-ev.small span { font-size: .8rem; min-width: 40px; }
.scr-meal { display: flex; gap: .8rem; align-items: center; margin: .45rem 0; font-weight: 700; font-size: 1.1rem; }
.scr-meal img { width: 54px; height: 54px; border-radius: 14px; object-fit: cover; }
.scr-meal small { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.scr-task { border-left: 4px solid var(--p); padding: .4rem 0 .4rem .6rem; margin: .3rem 0; font-size: 1.08rem; font-weight: 600; }
.scr-meal small { color: var(--c) !important; }
.scr-task small { color: var(--muted); font-weight: 500; }
.scr-shop { color: var(--ink-2); font-weight: 500; line-height: 1.6; }
@media (max-width: 900px) and (orientation: portrait) {
  .scr-grid { grid-template-columns: 1fr 1fr; }
  .scr-today { grid-row: auto; grid-column: span 2; }
}


/* ---------- Repas : semaine, type de repas, fiche ---------- */
.meal-card { display: flex; flex-direction: column; gap: .1rem; padding: .55rem .8rem; margin: .4rem 0; border-radius: 14px; border-left: 4px solid var(--c); background: color-mix(in srgb, var(--c) 12%, var(--card)); color: var(--ink); }
.meal-card small { font-size: .72rem; font-weight: 700; color: color-mix(in srgb, var(--c) 65%, var(--ink)); }
.meal-card span { font-weight: 600; font-size: .95rem; }
.meal-card em { font-size: .8rem; color: var(--muted); }
dialog.sheet { margin: auto auto 0; width: min(560px, 100%); border-radius: 26px 26px 0 0; padding: 1.2rem 1.1rem calc(1rem + var(--safe-b)); }
.meal-types { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin: .8rem 0; }
.meal-type { display: flex; flex-direction: column; gap: .4rem; color: var(--ink); font-weight: 700; }
.mt-art, .mh-art { display: grid; place-items: center; aspect-ratio: 16/9; border-radius: 16px; font-size: 2.1rem; letter-spacing: .1em; background: linear-gradient(135deg, color-mix(in srgb, var(--c) 75%, #fff), var(--c)); box-shadow: var(--shadow); }
.meal-type:active .mt-art { transform: scale(.96); }
.meal-hero { position: relative; margin: -1rem -1rem 1rem; }
.meal-hero .mh-art { aspect-ratio: auto; height: 150px; border-radius: 0 0 28px 28px; font-size: 3.2rem; }
.meal-hero h2 { position: absolute; left: 1.2rem; bottom: .8rem; margin: 0; color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,.35); }
.meal-hero h2 small { display: block; font-family: var(--font); font-size: .85rem; font-weight: 600; opacity: .9; }
.section-title { text-transform: uppercase; letter-spacing: .07em; font-size: .72rem; color: var(--muted); margin-bottom: .6rem; }
.dish { display: flex; align-items: center; gap: .6rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.dish form { margin: 0; }
.dish img { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; }
.dish .grow { display: flex; flex-direction: column; color: var(--ink); font-weight: 600; }
.dish .grow small { font-weight: 500; color: var(--muted); font-size: .75rem; }
.add-dish { width: 100%; text-align: left; background: none; border: 0; padding: .7rem 0 .2rem; color: var(--primary); font: 600 .95rem var(--font); cursor: pointer; }
.field-label { display: block; font-size: .8rem; font-weight: 600; color: var(--ink-2); margin-bottom: .35rem; }
.people-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.pchip input { display: none; }
.pchip span { display: inline-block; padding: .4rem .8rem; border-radius: 99px; border: 1.5px solid var(--line); font-size: .85rem; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.pchip input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; }
.num-sm { width: 64px; padding: .3rem .4rem; }
dialog.fullscreen { width: 100%; max-width: 640px; height: 100%; max-height: 100%; margin: 0 auto; border-radius: 0; padding: calc(env(safe-area-inset-top, 0px) + .8rem) 1rem 1rem; }
.picker-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .7rem; }
.picker-head h3 { flex: 1; text-align: center; margin: 0 2rem 0 0; }
.picker-search { margin-bottom: .7rem; }
.picker-chips { margin-bottom: .3rem; }
.chip.active { background: var(--primary); color: #fff; }
.picker-action { display: flex; align-items: center; gap: .8rem; width: 100%; padding: .6rem 0; background: none; border: 0; border-bottom: 1px solid var(--line); color: var(--ink); font: 600 1rem var(--font); text-align: left; cursor: pointer; }
.picker-action small { display: block; color: var(--muted); font-weight: 500; }
.pa-ico { width: 42px; height: 42px; flex: none; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--c); font-size: 1.2rem; }
.picker-list { list-style: none; padding: 0; margin: 0; }
.picker-list li { display: flex; align-items: center; gap: .8rem; padding: .7rem .1rem; border-bottom: 1px solid var(--line); cursor: pointer; }
.pl-ico { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--muted); }
.pl-ico.recette { background: var(--accent); }

/* Courses : barre d'ajout en bas de l'écran, gestion des rayons */
.addbar.bottom { position: fixed; z-index: 29; top: auto; left: 50%; transform: translateX(-50%); bottom: calc(84px + var(--safe-b)); width: min(520px, calc(100% - 24px)); margin: 0; padding: 6px; background: var(--glass); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border: 1px solid color-mix(in srgb, var(--line) 70%, transparent); border-radius: 20px; box-shadow: var(--shadow-lg); }
.addbar.bottom input { box-shadow: none; background: var(--card); }
body:has(.addbar.bottom) { padding-bottom: calc(160px + var(--safe-b)); }
.aisle-edit { display: flex; gap: .4rem; align-items: center; }
.aisle-edit .emoji-in { width: 52px; flex: none; text-align: center; padding: .45rem .2rem; }
.aisle-edit input:not(.emoji-in):not(.num-sm) { flex: 1; min-width: 0; padding: .45rem .6rem; }
.aisle-edit .num-sm { width: 52px; flex: none; padding: .45rem .3rem; text-align: center; }

/* ---------- Agenda : vues Jour / 3 jours / Semaine (grille horaire) ---------- */
.segmented.views { overflow-x: auto; scrollbar-width: none; }
.segmented.views a { white-space: nowrap; font-size: .8rem; padding: .45rem .55rem; }
.tg-ev.kind-meal, .tg-chip.kind-meal { color: #3b3326; }
[data-theme="dark"] .tg-ev.kind-meal, [data-theme="dark"] .tg-chip.kind-meal { color: var(--ink); background: color-mix(in srgb, var(--c) 22%, var(--card)); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tg-ev.kind-meal, :root:not([data-theme="light"]) .tg-chip.kind-meal { color: var(--ink); background: color-mix(in srgb, var(--c) 22%, var(--card)); } }
.tgrid { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid color-mix(in srgb, var(--line) 55%, transparent); overflow: hidden; margin-bottom: 1rem; }
.tg-head, .tg-allday { display: grid; grid-template-columns: 46px repeat(var(--days), 1fr); border-bottom: 1px solid var(--line); }
.tg-day { display: flex; flex-direction: column; align-items: center; padding: .45rem 0; color: var(--ink-2); }
.tg-day small { font-size: .68rem; font-weight: 700; text-transform: uppercase; }
.tg-day b { font-size: 1.15rem; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; }
.tg-day.today b { background: var(--primary); color: #fff; }
.tg-corner { display: flex; align-items: center; justify-content: center; font-size: .62rem; }
.tg-cell { padding: 3px 2px; border-left: 1px solid var(--line); min-height: 26px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tg-chip { display: block; font-size: .76rem; font-weight: 600; padding: 2px 5px; border-radius: 6px; background: color-mix(in srgb, var(--c) 28%, var(--card)); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-body { position: relative; display: grid; grid-template-columns: 46px repeat(var(--days), 1fr); height: min(70vh, 640px); overflow-y: auto; }
.tg-hours { position: relative; height: calc(24 * var(--hour)); }
.tg-hours span { position: absolute; right: 6px; transform: translateY(-50%); font-size: .7rem; color: var(--muted); }
.tg-col { position: relative; height: calc(24 * var(--hour)); border-left: 1px solid var(--line); background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--hour) - 1px), var(--line) calc(var(--hour) - 1px), var(--line) var(--hour)); cursor: pointer; }
.tg-col.today { background-color: color-mix(in srgb, var(--primary) 4%, transparent); }
.tg-ev { position: absolute; z-index: 1; overflow: hidden; padding: 2px 5px; border-radius: 7px; background: color-mix(in srgb, var(--c) 30%, var(--card)); border-left: 3px solid var(--c); color: var(--ink); font-size: .78rem; line-height: 1.2; }
.tg-ev b { display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-ev small { display: block; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); z-index: 2; }
.tg-now::before { content: ''; position: absolute; left: -4px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }

/* ---------- Tâches : listes, filtres, code couleur ---------- */
.list-tabs { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .5rem; margin-bottom: .4rem; scrollbar-width: none; }
.list-tab { flex: none; display: flex; align-items: center; gap: .5rem; padding: .55rem .8rem; border-radius: 14px; background: var(--card); border: 1.5px solid color-mix(in srgb, var(--c) 35%, var(--line)); color: var(--ink); font: 600 .85rem var(--font); box-shadow: var(--shadow); cursor: pointer; }
.list-tab b { min-width: 1.5em; text-align: center; padding: 0 .35em; border-radius: 99px; background: color-mix(in srgb, var(--c) 18%, transparent); color: color-mix(in srgb, var(--c) 75%, var(--ink)); font-size: .75rem; }
.list-tab.active { background: var(--c); border-color: var(--c); color: #fff; }
.list-tab.active b { background: rgba(255,255,255,.25); color: #fff; }
.list-tab.add { border-style: dashed; color: var(--primary); box-shadow: none; }
.chips.filters .chip { text-decoration: none; }
.tag-chip small { opacity: .7; }
.task { border-left: 4px solid var(--p); padding-left: .7rem; }
.task .check { border-color: var(--p); }
.task:not(.done) .task-body strong { color: var(--ink); }
.task.done { border-left-color: var(--line); }
.task-img { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; flex: none; }
.list-dot::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c); margin-right: .3rem; }
.prio-pick { display: flex; gap: .4rem; }
.prio-pick label { flex: 1; }
.prio-pick input { display: none; }
.prio-pick span { display: block; text-align: center; padding: .55rem .3rem; border-radius: 12px; border: 1.5px solid color-mix(in srgb, var(--p) 45%, var(--line)); color: var(--p); font-weight: 700; font-size: .85rem; cursor: pointer; }
.prio-pick input:checked + span { background: var(--p); color: #fff; }
.task-edit .card { margin-bottom: 0; }

/* ---------- Connexion Google ---------- */
.google-btn { background: #fff; color: #1f1f1f; border: 1px solid #dadce0; font-weight: 600; gap: .6rem; }
.g-logo { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font: 800 .85rem/1 Arial, sans-serif; color: #fff; background: conic-gradient(#ea4335 0 25%, #fbbc05 0 50%, #34a853 0 75%, #4285f4 0); }
.wizard { padding-left: 1.2rem; margin: .8rem 0 0; }
.wizard li { margin-bottom: 1rem; line-height: 1.5; }
.wizard li .btn { margin-top: .35rem; }
.copy-field { display: flex; gap: .4rem; }
.copy-field input { flex: 1; min-width: 0; font-size: 13px; padding: .45rem .6rem; }

/* ---------- Équilibre des menus ---------- */
.balance-head { display: flex; align-items: center; gap: .9rem; cursor: pointer; list-style: none; }
.balance-head .grow { display: flex; flex-direction: column; }
.score-ring { width: 54px; height: 54px; flex: none; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--v) * 1%), var(--line) 0); }
.score-ring b { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--card); font-size: 1rem; }
.group-counts { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .8rem; }
.gcount { display: inline-flex; align-items: center; gap: .35rem; font-size: .78rem; padding: .25rem .6rem; border-radius: 99px; background: color-mix(in srgb, var(--c) 12%, var(--card)); }
.gcount i, .gdots i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); display: inline-block; }
.gcount.warn { outline: 1.5px solid var(--danger); }
.tips { margin: .8rem 0 .3rem; padding-left: 1.1rem; font-size: .88rem; }
.tips li { margin-bottom: .3rem; }
.gdots { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: .2rem; }
.gdots small { font-size: .72rem; color: var(--muted); margin-left: .3rem; }
.backup-row { display: flex; align-items: center; gap: .4rem; padding: .6rem 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.backup-row .grow { display: flex; flex-direction: column; min-width: 160px; }
.backup-row form { margin: 0; }
.holiday { margin: .3rem 0; padding: .5rem .8rem; border-radius: 12px; background: color-mix(in srgb, #f2b84b 20%, var(--card)); font-weight: 600; font-size: .9rem; }
#offline-bar { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 64px); left: 50%; transform: translateX(-50%); z-index: 40; background: var(--ink); color: var(--bg); padding: .5rem .9rem; border-radius: 99px; font-size: .8rem; font-weight: 600; box-shadow: var(--shadow-lg); max-width: calc(100% - 24px); text-align: center; }
/* Saison */
.season-badge { display: inline-block; font-size: .68rem; font-weight: 700; padding: .12rem .5rem; border-radius: 99px; background: color-mix(in srgb, #2f9e5c 16%, var(--card)); color: #2f9e5c; align-self: flex-start; margin-left: .15rem; }
.season-badge.off { background: color-mix(in srgb, #8f8b99 15%, var(--card)); color: var(--muted); }
.season-line { font-size: .85rem; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: .3rem .5rem; align-items: center; }
.produce { display: flex; flex-wrap: wrap; gap: .4rem; }
.produce span { padding: .35rem .7rem; border-radius: 99px; background: color-mix(in srgb, #2f9e5c 12%, var(--card)); font-weight: 600; font-size: .85rem; }
.produce.fruits span { background: color-mix(in srgb, #f08a24 14%, var(--card)); }

/* ---------- Listes ---------- */
.list-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.list-card { position: relative; display: flex; flex-direction: column; gap: .2rem; padding: 1rem; border-radius: var(--radius); background: var(--card); color: var(--ink); box-shadow: var(--shadow); border-top: 5px solid var(--c); min-height: 96px; }
.list-card small { color: var(--muted); font-size: .76rem; }
.lc-count { position: absolute; right: .8rem; bottom: .7rem; font-weight: 800; color: var(--c); }
.tpl-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.tpl-chips form { margin: 0; }
.list-head { display: flex; align-items: center; gap: .6rem; border-left: 5px solid var(--c); }
.list-head form { margin: 0; }
.li-item form { margin: 0; }
.btn.reserved { background: color-mix(in srgb, var(--ok) 15%, var(--card)); color: var(--ok); border-color: transparent; }

/* ---------- Stock & anti-gaspi ---------- */
.card.soon { border-left: 4px solid var(--gold); }
.cook-idea { display: flex; align-items: center; gap: .8rem; padding: .6rem 0; border-bottom: 1px solid var(--line); color: var(--ink); }
.cook-idea .grow { display: flex; flex-direction: column; }
.ci-ratio { width: 46px; height: 46px; flex: none; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--ok) calc(var(--v) * 1%), var(--line) 0); }
.ci-ratio b { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--card); font-size: .72rem; }
.anti-gaspi { color: var(--ok); font-weight: 600; }
.warn-date { color: var(--gold); font-weight: 600; }

/* ---------- Assistant IA ---------- */
.ai-entry { display: flex; align-items: center; gap: .6rem; padding: .8rem 1rem; margin-bottom: 1rem; border-radius: 16px; color: var(--ink-2); font-size: .88rem; background: linear-gradient(120deg, color-mix(in srgb, var(--primary) 14%, var(--card)), color-mix(in srgb, var(--accent) 12%, var(--card))); border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent); }
.ai-entry span { font-size: 1.3rem; }
.chat { display: flex; flex-direction: column; gap: .6rem; }
.bubble { max-width: 85%; padding: .7rem .95rem; border-radius: 18px; line-height: 1.45; box-shadow: var(--shadow); }
.bubble.ai { align-self: flex-start; background: var(--card); border-bottom-left-radius: 6px; }
.bubble.me { align-self: flex-end; background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; border-bottom-right-radius: 6px; }
.proposal .prop { align-items: flex-start; padding: .45rem 0; border-bottom: 1px solid var(--line); font-weight: 500; color: var(--ink); }
.proposal .prop input { margin-top: .15rem; flex: none; }
.ai-thinking { align-self: flex-start; color: var(--muted); font-style: italic; }
.tpl-chips .chip-add { white-space: normal; text-align: left; border-radius: 14px; line-height: 1.3; }

/* École : horaires (bande de fond dans l'agenda), cantine, horaires */
.tg-ev.kind-school { z-index: 0; background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c) 13%, var(--card)) 0 7px, color-mix(in srgb, var(--c) 6%, var(--card)) 7px 14px); border-left: 3px dashed color-mix(in srgb, var(--c) 70%, transparent); text-align: right; }
.tg-ev.kind-school b, .tg-ev.kind-school small { opacity: .7; font-weight: 600; }
.event.kind-school { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c) 9%, transparent) 0 7px, transparent 7px 14px); border-left-style: dashed; }
.school-links { margin: -.3rem 0 1rem; }
.school-hours { display: flex; align-items: center; gap: .5rem; padding: .45rem .7rem; margin: .3rem 0; border-radius: 12px; font-size: .88rem; background: color-mix(in srgb, var(--c) 8%, transparent); border-left: 3px dashed var(--c); }
.school-hours form { margin: 0; }
.hours-on { font-size: 1rem; }
.hours-grid { display: grid; grid-template-columns: auto 1fr 1fr; gap: .4rem .5rem; align-items: center; margin-top: .7rem; }
.hours-pair { display: flex; align-items: center; gap: .2rem; min-width: 0; }
.hours-pair input { padding: .4rem .3rem; font-size: 14px; min-width: 0; flex: 1; }
.canteen-week h3 { margin: 0 0 .3rem; text-transform: uppercase; letter-spacing: .04em; }
.canteen-row { display: flex; align-items: center; gap: .5rem; padding: .45rem 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.canteen-row:first-of-type { border-top: 0; }
.canteen-row.today b { color: var(--primary); }
.canteen-toggle { cursor: pointer; }
.canteen-toggle { position: relative; }
.canteen-toggle input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.canteen-toggle > span { display: inline-block; padding: .4rem .8rem; border-radius: 99px; font: 600 .82rem var(--font); border: 1px solid var(--line); background: var(--card); color: var(--muted); transition: all .15s; }
.canteen-toggle i { font-style: normal; }
.canteen-toggle .yes, .canteen-toggle input:checked + span .no { display: none; }
.canteen-toggle input:checked + span .yes { display: inline; }
.canteen-toggle input:checked + span { background: color-mix(in srgb, var(--c) 22%, var(--card)); border-color: var(--c); color: var(--ink); }
.canteen-toggle input:focus-visible + span { outline: 2px solid var(--primary); }
.canteen-toggle.off > span { opacity: .5; }
.canteen-quick { margin-bottom: .8rem; }
.sticky-save { position: sticky; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 6; }
.tpl-row-hours { grid-template-columns: 110px 1fr 1fr; }

/* Mémos */
.memo-editor { background: color-mix(in srgb, var(--c) 30%, var(--card)); }
.memo-editor summary { cursor: pointer; list-style: none; }
.memo-editor summary::-webkit-details-marker { display: none; }
.memo-editor[open] summary { margin-bottom: .7rem; }
.memo-editor textarea { resize: vertical; min-height: 110px; }
.memo-colors { display: flex; gap: .5rem; }
.memo-colors label { position: relative; }
.memo-colors input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.memo-colors span { display: block; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; }
.memo-colors input:checked + span { border-color: var(--primary); box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--primary); }
.memo-search { margin: 0 0 1rem; }
.memo-search input { width: 100%; }
.memo-grid { columns: 2 160px; column-gap: .7rem; }
.memo { break-inside: avoid; display: block; margin: 0 0 .7rem; border-radius: 16px; background: color-mix(in srgb, var(--c) 55%, var(--card)); border: 1px solid color-mix(in srgb, var(--c) 70%, var(--line)); color: var(--ink); overflow: hidden; box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,.06)); }
.memo .memo-body, .memo.memo-body { display: block; padding: .8rem .9rem .3rem; color: var(--ink); cursor: pointer; }
.memo.memo-body { padding-bottom: .8rem; }
.memo h3 { margin: 0 0 .35rem; font-size: 1rem; }
.memo p { margin: 0; white-space: pre-line; font-size: .9rem; line-height: 1.4; word-break: break-word; }
.memo footer { display: flex; align-items: center; justify-content: space-between; padding: .2rem .5rem .4rem .9rem; }
.memo footer form { margin: 0; }
.memo-pin { background: none; border: 0; font-size: 1rem; cursor: pointer; opacity: .3; filter: grayscale(1); padding: .3rem; }
.memo-pin.on { opacity: 1; filter: none; }
.memo-grid-home { columns: 2 140px; }
[data-theme="dark"] .memo, [data-theme="dark"] .memo-editor { background: color-mix(in srgb, var(--c) 22%, var(--card)); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .memo, :root:not([data-theme="light"]) .memo-editor { background: color-mix(in srgb, var(--c) 22%, var(--card)); } }
.tgrid:not(.days-1) .tg-ev.kind-school small { display: none; }
.tgrid:not(.days-1) .tg-ev.kind-school b { font-size: .7rem; opacity: .85; }
.tg-ev.kind-school b { opacity: .85; }
.event.kind-school_day { border-left-style: dashed; background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c) 10%, transparent) 0 7px, transparent 7px 14px); }

/* Agenda lisible sur tablette et ordinateur : hauteur d'heure et textes adaptés à l'écran */
.tgrid { --hour: 56px; }
.tgrid.days-1 { --hour: 64px; }
.tgrid.days-1 .tg-ev { font-size: .9rem; padding: 4px 8px; }
.tgrid.days-1 .tg-ev small { font-size: .8rem; }
@media (min-width: 700px) {
  .container:has(.tgrid), .container:has(.month) { max-width: 1100px; }
  .tgrid { --hour: 72px; }
  .tgrid.days-1 { --hour: 84px; }
  .tg-head, .tg-allday, .tg-body { grid-template-columns: 64px repeat(var(--days), 1fr); }
  .tg-body { height: calc(100vh - 330px); min-height: 480px; max-height: none; }
  .tg-hours span { font-size: .85rem; right: 10px; }
  .tg-corner { font-size: .8rem; }
  .tg-day small { font-size: .85rem; }
  .tg-day b { font-size: 1.5rem; width: 46px; height: 46px; }
  .tg-chip { font-size: .95rem; padding: 4px 8px; border-radius: 8px; }
  .tg-cell { padding: 4px; gap: 4px; }
  .tg-ev { font-size: .95rem; padding: 4px 8px; border-radius: 9px; line-height: 1.25; }
  .tg-ev small { font-size: .82rem; }
  .tgrid.days-1 .tg-ev { font-size: 1.1rem; padding: 6px 12px; }
  .tgrid.days-1 .tg-ev small { font-size: .95rem; }
  .month .dot-ev { font-size: .85rem; padding: 2px 6px; }
  .mday { min-height: 120px; padding: .45rem; }
  .mday .num { font-size: 1rem; }
  .mday .more { font-size: .8rem; }
  .event { font-size: 1.05rem; }
}
.tg-ev.short { display: flex; align-items: center; padding-top: 0; padding-bottom: 0; }
.tg-ev.short b { min-width: 0; }
.tg-ev.short b small { display: inline; font-weight: 500; }
.tg-ev .tg-t { font-weight: 600; opacity: .7; }
.tg-ev.kind-school { display: flex; flex-direction: column; justify-content: flex-end; padding-bottom: 6px; }
/* Vues sur plusieurs jours : colonnes étroites, on garde le titre (l'heure se lit sur la grille) */
.tgrid:not(.days-1) .tg-ev.short .tg-t, .tgrid:not(.days-1) .tg-ev.short b small { display: none; }
.tgrid:not(.days-1) .tg-ev { padding-left: 4px; padding-right: 3px; }

/* Tâches dans l'agenda : case à cocher ; tâches en retard */
.ag-check-form { margin: 0; flex: none; }
.ag-check { width: 24px; height: 24px; border-radius: 8px; border-color: color-mix(in srgb, var(--c) 75%, var(--line)); font-size: .8rem; }
.event-task { display: flex; align-items: center; gap: .5rem; }
.event-task > .event { flex: 1; min-width: 0; }
.event-task.done .ev-title, .tg-task.done a, .tg-ev.done b { text-decoration: line-through; opacity: .55; }
.tg-chip.tg-task { display: flex; align-items: center; gap: 4px; padding-left: 3px; }
.tg-chip.tg-task a { color: inherit; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tg-chip.tg-task .ag-check { width: 18px; height: 18px; border-radius: 6px; font-size: .65rem; border-width: 1.5px; }
.tg-task-wrap { position: absolute; z-index: 3; margin: 3px 0 0 3px; }
.tg-task-wrap .ag-check { width: 20px; height: 20px; border-radius: 6px; font-size: .7rem; background: var(--card); }
.tg-task-wrap .ag-check.on { background: var(--ok); }
.tg-ev.kind-task { padding-left: 28px; }
.overdue-bar { display: flex; align-items: center; gap: .6rem; margin: 0 0 .8rem; padding: .55rem .6rem .55rem .9rem; border-radius: 14px; background: color-mix(in srgb, var(--danger) 10%, var(--card)); border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent); color: color-mix(in srgb, var(--danger) 80%, var(--ink)); }
.overdue-bar .btn { white-space: nowrap; }
.head-actions { display: flex; align-items: center; gap: .7rem; }
.head-actions > a:not(.btn) { font-size: .85rem; font-weight: 600; }
.feed-row { display: flex; gap: .4rem; }
.feed-row input { flex: 1; min-width: 0; font-size: .8rem; }
@media (min-width: 700px) { .tg-chip.tg-task .ag-check { width: 22px; height: 22px; } }

/* =====================================================================
   Tablette (iPad Pro 13", iPad) et ordinateur : menu latéral, colonnes
   ===================================================================== */
.sidenav { display: none; }
.masonry > * { break-inside: avoid; }

@media (min-width: 1000px) {
  :root { --side: 92px; }
  body:has(> .sidenav) { padding-left: var(--side); padding-bottom: 2rem; font-size: 16.5px; }
  .bottomnav { display: none; }
  .topbar .brand { visibility: hidden; }
  .topbar { padding-left: 1.6rem; padding-right: 1.6rem; }
  .container { max-width: 1180px; padding: 1.4rem 1.6rem 0; }
  .container.narrow { max-width: 440px; }

  .sidenav {
    display: flex; flex-direction: column; gap: .4rem;
    position: fixed; z-index: 35; left: 0; top: 0; bottom: 0; width: var(--side);
    padding: calc(env(safe-area-inset-top, 0px) + .8rem) .55rem calc(.8rem + var(--safe-b));
    background: var(--glass);
    backdrop-filter: saturate(180%) blur(22px); -webkit-backdrop-filter: saturate(180%) blur(22px);
    border-right: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
    overflow-y: auto;
  }
  .side-brand { display: flex; flex-direction: column; align-items: center; color: var(--ink); padding: .2rem 0 .6rem; }
  .side-brand span { font-size: 1.7rem; }
  .side-brand b { font-family: var(--serif); font-size: .85rem; }
  .side-links { display: flex; flex-direction: column; gap: 2px; flex: 1; }
  .side-links hr { border: 0; border-top: 1px solid var(--line); margin: .4rem .5rem; }
  .sidenav a:not(.side-brand) {
    display: flex; flex-direction: column; align-items: center; gap: 1px;
    padding: .5rem .2rem; border-radius: 16px; color: var(--muted);
    font-size: .68rem; font-weight: 600; text-align: center; transition: background .2s, color .2s;
  }
  .sidenav a span { font-size: 1.35rem; line-height: 1.2; filter: grayscale(.5); }
  .sidenav a b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .sidenav a:hover { background: color-mix(in srgb, var(--primary) 6%, transparent); color: var(--ink); }
  .sidenav a.active { color: var(--primary); background: var(--primary-soft); }
  .sidenav a.active span { filter: none; }

  /* Éléments fixes : plus de barre du bas, on les recale */
  .fab { right: 28px; bottom: calc(28px + var(--safe-b)); width: 62px; height: 62px; }
  .addbar.bottom { left: calc(50% + var(--side) / 2); bottom: calc(20px + var(--safe-b)); width: min(640px, calc(100% - var(--side) - 48px)); }
  body:has(.addbar.bottom) { padding-bottom: 100px; }
  .sticky-save { bottom: calc(16px + var(--safe-b)); }
  .timers { left: calc(var(--side) + 1rem); bottom: calc(20px + var(--safe-b)); }
  #offline-bar { left: calc(50% + var(--side) / 2); }
  dialog.sheet { margin: auto; border-radius: 26px; width: min(560px, calc(100% - 48px)); }
  dialog { width: min(480px, calc(100% - 48px)); }

  /* Colonnes (lecture de haut en bas, puis colonne suivante) */
  .masonry { columns: 2 360px; column-gap: 1.1rem; }
  .masonry > .card, .masonry > .day, .masonry > section, .masonry > details { display: inline-block; width: 100%; }
  .masonry > .day { display: block; }
  .greeting { font-size: 2rem; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
  .recipe-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.1rem; }
  .memo-grid { columns: 4 200px; }
  .memo-grid-home { columns: 2 160px; }
  .store-buttons { max-width: 760px; }
  .task-edit, .memo-editor, .recipe-form { max-width: 820px; margin-left: auto; margin-right: auto; }
  .bubble { max-width: 70%; }
}

/* Écran large (iPad Pro 13" à l'horizontale, ordinateur) : menu avec libellés */
@media (min-width: 1200px) {
  :root { --side: 236px; }
  .sidenav { padding-left: .9rem; padding-right: .9rem; }
  .side-brand { flex-direction: row; gap: .5rem; justify-content: flex-start; padding: .3rem .6rem 1rem; }
  .side-brand b { font-size: 1.25rem; }
  .sidenav a:not(.side-brand) { flex-direction: row; gap: .75rem; padding: .62rem .8rem; font-size: .95rem; text-align: left; border-radius: 14px; }
  .sidenav a span { font-size: 1.2rem; width: 1.6rem; text-align: center; }
  .masonry { columns: 3 320px; }
  .masonry.two { columns: 2 360px; }
}
@media (min-width: 1000px) {
  .week-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; align-items: start; }
  .week-grid > .day { margin: 0; }
  .masonry > .day { margin-bottom: 1rem; }
}
.ai-service summary { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.ai-service summary b { color: var(--ink); }
.ai-status { margin-left: auto; font-size: .8rem; color: var(--muted); font-weight: 600; }
.ai-service.has-key .ai-status { color: var(--ok); }
.ai-settings .sticky-save { background: var(--glass); padding: .6rem; border-radius: 18px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }

/* Agenda : zoom, retour à la ligne des titres */
.zoom-bar { display: flex; align-items: center; justify-content: flex-end; gap: .35rem; margin: -.2rem 0 .6rem; }
.zoom-bar .btn { min-width: 40px; }
.tg-ev b, .tg-ev.short b { white-space: normal; overflow-wrap: anywhere; display: block; }
.tg-ev.short { align-items: flex-start; padding-top: 2px; }
.tg-ev small { white-space: normal; }
.tg-chip, .tg-chip.tg-task a { white-space: normal; overflow-wrap: anywhere; text-overflow: clip; }
.tg-chip.tg-task { align-items: flex-start; }
.dot-ev { white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tg-body { touch-action: pan-x pan-y; }
.public-page { padding-bottom: 2rem; }
.public-page .container { max-width: 720px; }

/* Recettes : affichage en liste */
.view-toggle { display: flex; gap: .4rem; justify-content: flex-end; margin: -.2rem 0 .7rem; }
.recipe-grid.as-list { display: flex; flex-direction: column; gap: .5rem; }
.recipe-grid.as-list .recipe-card, .recipe-grid.as-list .recipe-card > button {
  display: grid; grid-template-columns: 64px 1fr auto; grid-template-rows: auto auto; align-items: center; column-gap: .9rem; row-gap: .1rem;
  background: var(--card); border-radius: 16px; padding: .5rem .8rem .5rem .5rem; box-shadow: var(--shadow); border: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
}
.recipe-grid.as-list form.recipe-card { padding: 0; background: none; box-shadow: none; border: 0; }
.recipe-grid.as-list .recipe-card .thumb { grid-row: 1 / 3; width: 64px; height: 64px; aspect-ratio: auto; border-radius: 12px; font-size: 1.6rem; box-shadow: none; }
.recipe-grid.as-list .recipe-card strong { grid-column: 2; align-self: end; font-size: 1rem; }
.recipe-grid.as-list .recipe-card small { grid-column: 2; align-self: start; }
.recipe-grid.as-list .recipe-card .season-badge { grid-column: 3; grid-row: 1 / 3; position: static; }
@media (min-width: 1000px) { .recipe-grid.as-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: .7rem; } }

/* Mémos : éditeur et mise en forme */
.rte-toolbar { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.rte-toolbar button, .rte-toolbar select { min-width: 38px; height: 36px; padding: 0 .55rem; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: 600 .9rem var(--font); cursor: pointer; }
.rte-toolbar select { width: auto; font-weight: 500; }
.rte-toolbar button:disabled { opacity: .35; cursor: default; }
.rte { min-height: 150px; padding: .8rem .9rem; border-radius: 14px; background: var(--card); border: 1px solid var(--line); outline: none; line-height: 1.5; overflow-wrap: anywhere; }
.rte:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.rte:empty::before { content: attr(data-placeholder); color: var(--muted); }
.rte p, .memo-content p { margin: 0 0 .4rem; }
.rte ul, .memo-content ul, .rte ol, .memo-content ol { margin: .2rem 0 .5rem; padding-left: 1.3rem; }
.rte ul:not(.checklist), .memo-content ul:not(.checklist) { list-style: '– '; }
ul.checklist { list-style: none; padding-left: 0; }
ul.checklist > li { position: relative; padding-left: 1.75rem; margin: .25rem 0; min-height: 1.4em; }
ul.checklist > li::before { content: ''; position: absolute; left: 0; top: .15em; width: 1.1em; height: 1.1em; border: 2px solid color-mix(in srgb, var(--primary) 55%, var(--line)); border-radius: 6px; background: var(--card); cursor: pointer; }
ul.checklist > li.done::before { background: var(--ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3 3 7-7' stroke='white' stroke-width='2.4' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/80% no-repeat; border-color: var(--ok); }
ul.checklist > li.done { text-decoration: line-through; color: var(--muted); }
.rte table, .memo-content table { border-collapse: collapse; width: 100%; margin: .4rem 0; font-size: .92em; }
.rte td, .rte th, .memo-content td, .memo-content th { border: 1px solid color-mix(in srgb, var(--ink) 20%, transparent); padding: .3rem .45rem; min-width: 40px; vertical-align: top; }
font[size="1"] { font-size: .7em; } font[size="2"] { font-size: .85em; } font[size="4"] { font-size: 1.15em; }
font[size="5"] { font-size: 1.35em; } font[size="6"] { font-size: 1.7em; } font[size="7"] { font-size: 2.1em; }
.memo-content { font-size: .9rem; line-height: 1.4; overflow-wrap: anywhere; max-height: 22rem; overflow: hidden; }
.memo-content.short { max-height: 8rem; }
.memo-content table { font-size: .85em; }
.chip-count { font-size: .72rem; opacity: .7; margin-left: .15rem; }
.side-badge { font-style: normal; font-size: .68rem; font-weight: 700; min-width: 1.4em; padding: 0 .35em; border-radius: 99px; background: var(--primary-soft); color: var(--primary); text-align: center; }
@media (min-width: 1000px) and (max-width: 1199px) { .sidenav a { position: relative; } .side-badge { position: absolute; top: 4px; right: 10px; } }
@media (min-width: 1200px) { .side-badge { margin-left: auto; } }

.canteen-check { position: relative; display: grid; place-items: center; }
.canteen-check input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.canteen-check span { display: grid; place-items: center; width: 40px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); filter: grayscale(1); opacity: .45; cursor: pointer; transition: all .15s; }
.canteen-check input:checked + span { filter: none; opacity: 1; background: color-mix(in srgb, var(--ok) 18%, var(--card)); border-color: var(--ok); }
.canteen-check input:focus-visible + span { outline: 2px solid var(--primary); }
@media (max-width: 560px) {
  .hours-grid { grid-template-columns: 1fr 1fr; row-gap: .25rem; }
  .hours-grid .hg-corner { display: none; }
  .hours-grid .hg-day { grid-column: 1 / -1; margin-top: .45rem; }
  .hours-pair input { font-size: 15px; padding: .4rem .2rem; }
}
.hours-pair input[type=time]::-webkit-calendar-picker-indicator { display: none; }
.hours-pair input[type=time] { text-align: center; }
