/* Gestion Famille — styles */
:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --surface-2: #f3efe8;
  --border: #e8e2d8;
  --text: #24221f;
  --muted: #77716a;
  --accent: #e0684b;
  --accent-2: #c9553a;
  --accent-soft: #fbe6df;
  --ok: #2f9e6a;
  --danger: #cf3b3b;
  --danger-soft: #fbe3e3;
  --warn: #c7811d;
  --shadow: 0 1px 2px rgb(40 30 20 / .05), 0 4px 16px rgb(40 30 20 / .05);
  --radius: 16px;
  --radius-sm: 10px;
  --note-jaune: #fff3c4; --note-bleu: #dcebff; --note-vert: #daf3e3; --note-rose: #fde0ea; --note-violet: #ebe2ff;
  color-scheme: light;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16171c; --surface: #1f2027; --surface-2: #282a32; --border: #33353e;
    --text: #ecebe8; --muted: #a09d98; --accent: #f07a5c; --accent-2: #ff8f72; --accent-soft: #3d2620;
    --ok: #4cc28a; --danger: #ef6464; --danger-soft: #3b2224; --warn: #e6a347;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 6px 20px rgb(0 0 0 / .25);
    --note-jaune: #3d3720; --note-bleu: #1f3047; --note-vert: #1f3a2b; --note-rose: #422434; --note-violet: #30284a;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.45; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 1.6rem; letter-spacing: -.02em; }
h2 { font-size: 1.02rem; display: flex; align-items: center; gap: .45rem; }
h3 { font-size: .95rem; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.grow { flex: 1; }

.ic { width: 20px; height: 20px; flex: none; }
.ic.sm { width: 14px; height: 14px; vertical-align: -2px; }

.splash { display: grid; place-items: center; min-height: 100vh; }
.splash img { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.92); opacity: .7; } }

/* Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  border: 1px solid transparent; border-radius: 999px; padding: .55rem 1rem; min-height: 40px;
  background: var(--surface-2); cursor: pointer; font-weight: 600; white-space: nowrap;
  transition: background .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); }
.btn.ghost { background: transparent; border-color: var(--border); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger-ghost { background: transparent; color: var(--danger); padding-inline: .6rem; }
.btn.danger-ghost:hover { background: var(--danger-soft); }
.btn.small { min-height: 32px; padding: .3rem .75rem; font-size: .85rem; }
.btn.block { width: 100%; }
.btn.icon-only { padding: 0; width: 40px; flex: none; }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; flex: none;
  border: 0; border-radius: 999px; background: transparent; cursor: pointer; color: var(--muted);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.subtle { width: 32px; height: 32px; }
.icon-btn.subtle .ic { width: 17px; height: 17px; }
.link { font-size: .85rem; font-weight: 600; }

/* Formulaires */
input:not([type=checkbox]):not([type=radio]), select, textarea {
  width: 100%; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); padding: .6rem .75rem; min-height: 42px; font-size: 16px;
}
textarea { resize: vertical; min-height: 80px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 18px; height: 18px; margin: 0; }
.field { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .85rem; min-width: 0; }
.label { font-size: .85rem; font-weight: 600; }
.label em { font-weight: 400; color: var(--muted); font-style: normal; }
.hint { font-size: .8rem; color: var(--muted); }
.modal-body > .hint { margin: -.4rem 0 .85rem; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.check-line { display: flex; align-items: center; gap: .55rem; font-size: .92rem; cursor: pointer; margin: .2rem 0 .6rem; }
.form-error { color: var(--danger); background: var(--danger-soft); border-radius: var(--radius-sm); padding: .55rem .75rem; margin: 0 0 .8rem; font-size: .9rem; }
.login-box { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .4rem .9rem .2rem; margin: 0 0 .9rem; }
.login-box legend { padding: 0 .3rem; font-weight: 600; font-size: .9rem; }
.login-box legend .check-line { margin: 0; }

.swatches { display: flex; flex-wrap: wrap; gap: .5rem; }
.swatch input { position: absolute; opacity: 0; pointer-events: none; }
.swatch span { display: block; width: 30px; height: 30px; border-radius: 50%; background: var(--c); cursor: pointer; box-shadow: inset 0 0 0 2px rgb(255 255 255 / .35); }
.swatch input:checked + span { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--c); }
.swatch input:focus-visible + span { outline: 2px solid var(--text); outline-offset: 4px; }

/* Connexion */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border-radius: 22px; padding: 2rem 1.6rem; box-shadow: var(--shadow); }
.auth-card h1 { margin: .9rem 0 .3rem; }
.auth-card > .muted { margin-bottom: 1.4rem; }
.auth-card .btn { margin-top: .4rem; }

/* Structure */
.shell { min-height: 100vh; }
.sidebar { display: none; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 8px) 16px 8px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: .6rem; color: var(--text); font-weight: 700; font-size: 1.05rem; min-width: 0; }
.brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.me-mini { border: 0; background: none; padding: 0; cursor: pointer; }
.view { padding: 18px 16px calc(96px + env(safe-area-inset-bottom)); max-width: 1180px; margin: 0 auto; outline: none; }
.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 20; display: grid; grid-template-columns: repeat(7, 1fr);
  background: var(--surface); border-top: 1px solid var(--border); padding: 4px 2px calc(4px + env(safe-area-inset-bottom));
}
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; color: var(--muted); font-size: .66rem; font-weight: 600; border-radius: 12px; }
.tabbar a:hover { text-decoration: none; }
.tabbar a.active { color: var(--accent); }
.tabbar a.active .ic { background: var(--accent-soft); border-radius: 999px; padding: 3px 12px; width: 44px; height: 26px; }
.tabbar .ic { width: 22px; height: 22px; }

@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: 240px 1fr; }
  .topbar, .tabbar { display: none; }
  .sidebar {
    display: flex; flex-direction: column; gap: 1.2rem; position: sticky; top: 0; height: 100vh;
    padding: 22px 14px; border-right: 1px solid var(--border); background: var(--surface);
  }
  .sidebar .brand { padding: 0 .5rem; }
  .nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
  .nav a { display: flex; align-items: center; gap: .75rem; padding: .62rem .8rem; border-radius: 12px; color: var(--muted); font-weight: 600; }
  .nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
  .nav a.active { background: var(--accent-soft); color: var(--accent-2); }
  .me { display: flex; align-items: center; gap: .6rem; border: 1px solid var(--border); background: transparent; border-radius: 999px; padding: 5px 14px 5px 5px; cursor: pointer; font-weight: 600; text-align: left; }
  .me:hover { background: var(--surface-2); }
  .me span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .view { padding: 32px 36px 48px; }
}

/* Avatars */
.avatar {
  display: inline-grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%;
  background: var(--c, var(--accent)); color: #fff; font-weight: 700; font-size: .9rem;
}
.avatar.sm { width: 26px; height: 26px; font-size: .75rem; }
.avatar.xs { width: 20px; height: 20px; font-size: .62rem; }
.avatar.lg { width: 56px; height: 56px; font-size: 1.4rem; }
.avatar-all { background: var(--surface-2); color: var(--muted); }
.avatar-all .ic { width: 60%; height: 60%; }

/* En-têtes de page, cartes */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.page-head .muted { margin-top: .25rem; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 14px; min-width: 0; }
.card > h2 { margin-bottom: .75rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .75rem; }
.card h2 .ic { color: var(--accent); }
.count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: .75rem; }
h2.late { color: var(--danger); }
.tag { display: inline-block; font-size: .7rem; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); color: var(--muted); vertical-align: 2px; }
.tag.accent { background: var(--accent-soft); color: var(--accent-2); }

.empty { text-align: center; padding: 1.6rem .5rem; color: var(--muted); }
.empty .ic { width: 34px; height: 34px; opacity: .55; }
.empty-title { color: var(--text); font-weight: 600; margin: .4rem 0 .2rem; }

/* Accueil */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; color: var(--muted); font-size: .8rem; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.stat:hover { text-decoration: none; border-color: var(--accent); }
.stat-n { font-size: 1.6rem; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; line-height: 1.1; }
.home-grid { display: grid; gap: 0 14px; }
@media (min-width: 700px) {
  .home-grid { grid-template-columns: 1fr 1fr; }
  .span-2 { grid-column: span 2; }
}
@media (min-width: 1150px) {
  .home-grid { grid-template-columns: repeat(3, 1fr); }
  .home-grid .span-2:first-child { grid-row: span 2; grid-column: span 2; }
}
.day-group + .day-group { margin-top: .8rem; }
.day-group h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: .4rem; }
.quick-add { display: flex; gap: .5rem; margin-bottom: .8rem; }
.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { background: var(--surface-2); border-radius: 999px; padding: 3px 10px; font-size: .85rem; }
.chips li b { color: var(--muted); font-weight: 600; }
.chips .more { color: var(--muted); }
.meal-day + .meal-day { margin-top: .7rem; }
.meal-day h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: .25rem; }
.meal-day dl { display: grid; grid-template-columns: 48px 1fr; gap: 2px 8px; margin: 0; }
.meal-day dt { color: var(--muted); font-size: .85rem; }
.meal-day dd { margin: 0; }
.bdays { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.bdays li { display: flex; align-items: center; gap: .6rem; }
.bdays li span:nth-child(2) { flex: 1; font-weight: 600; }

/* Événements */
.events { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.event { display: flex; gap: 12px; align-items: flex-start; padding: 9px 12px; border-radius: 12px; background: var(--surface-2); border-left: 4px solid var(--c); }
.event[role=button] { cursor: pointer; }
.event[role=button]:hover { filter: brightness(.97); }
.event.birthday { background: color-mix(in srgb, var(--c) 14%, var(--surface)); }
.ev-time { font-weight: 700; font-size: .85rem; min-width: 46px; font-variant-numeric: tabular-nums; display: flex; flex-direction: column; }
.ev-time small { color: var(--muted); font-weight: 500; }
.ev-body { min-width: 0; }
.ev-title { font-weight: 600; overflow-wrap: anywhere; }
.meta { color: var(--muted); font-size: .8rem; display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: center; }

/* Agenda */
.agenda { display: grid; gap: 0 14px; }
@media (min-width: 900px) { .agenda { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; } .day-panel { position: sticky; top: 24px; } }
.cal-head { display: flex; align-items: center; gap: .25rem; margin-bottom: .75rem; }
.cal-head h2 { flex: 1; justify-content: center; text-align: center; font-size: 1.1rem; }
.cal-head .btn { margin-left: .4rem; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.dow { text-align: center; font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; padding: 2px 0 6px; }
.cell {
  position: relative; min-height: 54px; border: 0; border-radius: 10px; background: var(--surface-2); padding: 5px 4px;
  display: flex; flex-direction: column; align-items: center; gap: 3px; cursor: pointer; text-align: left; min-width: 0;
}
.cell:hover { box-shadow: inset 0 0 0 1px var(--border); }
.cell.out { opacity: .45; }
.cell .num { font-size: .85rem; font-weight: 600; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.cell.today .num { background: var(--accent); color: #fff; }
.cell.sel { box-shadow: inset 0 0 0 2px var(--accent); }
.chips-cal { display: none; }
.dots { display: flex; gap: 3px; flex-wrap: wrap; justify-content: center; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
@media (min-width: 700px) {
  .cell { min-height: 96px; align-items: stretch; padding: 6px; }
  .cell .num { align-self: flex-end; }
  .dots { display: none; }
  .chips-cal { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .cchip { font-size: .7rem; line-height: 1.3; padding: 1px 5px; border-radius: 5px; background: color-mix(in srgb, var(--c) 22%, var(--surface)); border-left: 3px solid var(--c); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .cmore { font-size: .7rem; color: var(--muted); padding-left: 4px; }
}

/* Tâches */
.filters { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 8px; scrollbar-width: none; }
.fchip { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: .35rem .8rem; cursor: pointer; white-space: nowrap; font-size: .88rem; font-weight: 600; }
.fchip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.two-cols { display: grid; gap: 0 14px; }
@media (min-width: 980px) { .two-cols { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; } .two-cols > aside { position: sticky; top: 24px; } }
.tasks, .items { list-style: none; margin: 0; padding: 0; }
.task, .item { display: flex; align-items: center; gap: 10px; padding: 8px 2px; border-bottom: 1px solid var(--border); }
.task:last-child, .item:last-child { border-bottom: 0; }
.check {
  flex: none; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--border); background: transparent;
  display: grid; place-items: center; cursor: pointer; color: transparent; padding: 0; transition: .15s;
}
.check .ic { width: 16px; height: 16px; stroke-width: 2.6; }
.check:hover { border-color: var(--ok); color: var(--ok); }
.done .check, .checked .check { background: var(--ok); border-color: var(--ok); color: #fff; }
.task-main { flex: 1; min-width: 0; cursor: pointer; }
.task-title { font-weight: 600; overflow-wrap: anywhere; }
.done .task-title, .checked .item-name { text-decoration: line-through; color: var(--muted); }
.meta .late { color: var(--danger); font-weight: 600; }
.meta .soon { color: var(--warn); font-weight: 600; }
.meta .pts { color: var(--warn); font-weight: 600; }
.done-box summary { cursor: pointer; list-style: none; }
.done-box summary::-webkit-details-marker { display: none; }
.done-box[open] summary { margin-bottom: .5rem; }
.board { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.board li { display: grid; grid-template-columns: 16px 26px minmax(0, 70px) 1fr auto; align-items: center; gap: 8px; }
.rank { color: var(--muted); font-weight: 700; font-size: .85rem; }
.b-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--c); border-radius: 99px; min-width: 4px; }
.b-pts { font-size: .8rem; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Courses */
.add-bar { display: flex; gap: .5rem; position: sticky; top: calc(env(safe-area-inset-top) + 62px); z-index: 5; flex-wrap: wrap; }
.add-bar input { flex: 1 1 200px; }
.add-bar select { flex: 0 1 170px; width: auto; }
@media (max-width: 520px) { .add-bar select { flex: 1 1 auto; } .add-bar .btn span { display: none; } .add-bar .btn { width: 42px; padding: 0; } }
@media (min-width: 900px) { .add-bar { top: 12px; } }
.shop-cols { columns: 1; column-gap: 14px; }
@media (min-width: 760px) { .shop-cols { columns: 2; } }
@media (min-width: 1200px) { .shop-cols { columns: 3; } }
.shop-cat { break-inside: avoid; display: inline-block; width: 100%; }
.shop-cat h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: .2rem; }
.item-name { flex: 1; min-width: 0; cursor: pointer; overflow-wrap: anywhere; }
.qty { color: var(--accent-2); font-weight: 700; margin-left: .2rem; }
.basket { opacity: .85; }

/* Repas */
.meals { display: grid; gap: 8px; }
.meals-head { display: none; }
.meal-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 10px; border-radius: 12px; background: var(--surface-2); }
.meal-row.today { box-shadow: inset 0 0 0 2px var(--accent); }
.meal-day-label { grid-column: 1 / -1; display: flex; gap: .5rem; align-items: baseline; }
.meal-day-label span { color: var(--muted); font-size: .85rem; }
.meal-input { background: var(--surface) !important; transition: box-shadow .3s, border-color .3s; }
.meal-input.saved { border-color: var(--ok) !important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent) !important; }
@media (min-width: 760px) {
  .meals-head, .meal-row { display: grid; grid-template-columns: 150px 1fr 1fr; gap: 10px; align-items: center; }
  .meals-head { padding: 0 10px; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
  .meal-day-label { grid-column: auto; flex-direction: column; gap: 0; }
}

/* Notes */
.notes { columns: 1; column-gap: 14px; }
@media (min-width: 600px) { .notes { columns: 2; } }
@media (min-width: 1000px) { .notes { columns: 3; } }
.notes.mini { columns: 1; }
@media (min-width: 700px) { .notes.mini { columns: 2; } }
.note { position: relative; break-inside: avoid; display: inline-block; width: 100%; margin-bottom: 12px; padding: 14px 16px; border-radius: 14px; background: var(--note-jaune); cursor: pointer; box-shadow: var(--shadow); }
.notes.mini .note { cursor: default; box-shadow: none; }
.note p { white-space: pre-wrap; overflow-wrap: anywhere; }
.note footer { display: flex; align-items: center; gap: .4rem; margin-top: .7rem; font-size: .75rem; color: var(--muted); }
.note footer span { flex: 1; }
.note .pin-ic { position: absolute; top: 10px; right: 10px; color: var(--accent); }
.note:has(.pin-ic) p { padding-right: 18px; }
.c-jaune { background: var(--note-jaune); } .c-bleu { background: var(--note-bleu); } .c-vert { background: var(--note-vert); }
.c-rose { background: var(--note-rose); } .c-violet { background: var(--note-violet); }
.note-colors { display: flex; flex-wrap: wrap; gap: 6px; }
.ncolor input { position: absolute; opacity: 0; }
.ncolor span { display: inline-block; padding: .35rem .8rem; border-radius: 999px; font-size: .85rem; cursor: pointer; border: 2px solid transparent; }
.ncolor input:checked + span { border-color: var(--text); font-weight: 600; }
.ncolor input:focus-visible + span { outline: 2px solid var(--accent); }

/* Famille */
.members { display: grid; gap: 0 14px; }
@media (min-width: 700px) { .members { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1150px) { .members { grid-template-columns: repeat(3, 1fr); } }
.member { display: flex; gap: 14px; align-items: flex-start; border-top: 4px solid var(--c); }
.member-info { flex: 1; min-width: 0; display: grid; gap: .2rem; }
.member-info .muted { font-size: .85rem; }

/* Modales */
.modal { border: 0; padding: 0; background: transparent; width: min(560px, 100%); max-width: 100%; max-height: 100%; margin: auto auto 0; }
.modal::backdrop { background: rgb(20 15 10 / .45); backdrop-filter: blur(2px); }
.modal-card { background: var(--surface); color: var(--text); border-radius: 22px 22px 0 0; display: flex; flex-direction: column; max-height: 92vh; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 6px 20px; }
.modal-head h2 { font-size: 1.15rem; }
.modal-body { padding: 10px 20px 4px; overflow-y: auto; }
.modal-card > .form-error { margin: 0 20px 8px; }
.modal-foot { display: flex; align-items: center; gap: .5rem; padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); }
@media (min-width: 600px) {
  .modal { margin: auto; }
  .modal-card { border-radius: 22px; }
  .modal-foot { padding-bottom: 16px; }
}
@media (max-width: 420px) { .row { grid-template-columns: 1fr; gap: 0; } }

/* Notifications */
#toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 100; display: grid; gap: 8px; width: max-content; max-width: calc(100% - 32px); }
@media (min-width: 900px) { #toasts { bottom: 28px; } }
.toast { background: var(--text); color: var(--bg); padding: .6rem 1rem; border-radius: 12px; font-weight: 600; font-size: .9rem; box-shadow: var(--shadow); animation: up .2s ease-out; transition: opacity .3s, transform .3s; }
.toast.ok { background: var(--ok); color: #fff; }
.toast.err { background: var(--danger); color: #fff; }
.toast.out { opacity: 0; transform: translateY(6px); }
@keyframes up { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
