/* Thème montagne — Chalet Vallandry */
:root {
  --night: #1F3A52;
  --night-deep: #142838;
  --ridge: #2B4A64;
  --snow: #F2F4F6;
  --ink: #16222E;
  --muted: #4F5E6C;
  --soft: #36434F;
  --line: #DCE2E8;
  --field: #C3CCD5;
  --sky: #E4ECF3;
  --sky-2: #CFDCE7;
  --ochre: #F2C49B;
  --amber-bg: #FBEBD6;
  --amber-ink: #7A430C;
  --amber-line: #C9852E;
  --pine-bg: #A8C9AE;
  --pine-ink: #1F4A2A;
  --red: #A33B2B;
  --red-deep: #8A2E21;
  --red-bg: #F7E3DF;
  --surface: #FFFFFF;
  --on-dark: #FFFFFF;
  --tint: #EEF1F4;
  --tint-2: #E6EAEE;
  --accent-soft: #DCE8F2;
  --avatar: #DDE5EC;
  --focus: #6C97BD;
  --reserve: var(--night);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: Manrope, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--snow);
  line-height: 1.5;
}
h1, h2, h3 { font-family: "Josefin Sans", Manrope, sans-serif; letter-spacing: .01em; line-height: 1.15; }
h1 { font-size: clamp(30px, 5vw, 40px); margin: 0 0 6px; text-transform: uppercase; }
h2 { font-size: 21px; margin: 0 0 14px; }
a { color: var(--night); }
a:hover { color: var(--night-deep); }
input, select, textarea, button { font: inherit; color: inherit; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* En-tête */
.top { background: var(--night-deep); color: var(--on-dark); }
.top-bar { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; padding-top: 16px; padding-bottom: 4px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--on-dark); text-decoration: none; font-weight: 800; font-size: 17px; }
.brand:hover { color: var(--on-dark); }
.top-nav { display: flex; flex-wrap: wrap; gap: 6px 20px; align-items: center; font-size: 14px; font-weight: 600; }
.top-nav a { color: var(--sky-2); text-decoration: none; padding: 10px 0; }
.top-nav a:hover, .top-nav a[aria-current] { color: var(--on-dark); }
.top-nav a[aria-current] { text-decoration: underline; text-underline-offset: 6px; }
.top-nav .who { color: var(--sky-2); }
.ridge { display: block; width: 100%; height: 56px; }
.inline-form { display: inline; margin: 0; }
.link-btn { background: none; border: 0; padding: 10px 0; color: var(--sky-2); font-weight: 600; font-size: 14px; cursor: pointer; }
.link-btn:hover { color: var(--on-dark); text-decoration: underline; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Site public */
.hero { background: var(--night); color: var(--on-dark); }
.hero .top-bar { padding-top: 18px; }
.hero .brand span { font-family: "Josefin Sans", Manrope, sans-serif; font-weight: 700; font-size: 20px; letter-spacing: .06em; text-transform: uppercase; }
.hero-text { padding-top: 36px; padding-bottom: 4px; }
.hero-text h1 { font-size: clamp(36px, 7vw, 54px); margin: 10px 0 12px; }
.hero-text p { margin: 0; max-width: 620px; font-size: 17px; color: var(--sky-2); }
.kicker { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ochre); }
.hero-ridge { display: block; width: 100%; height: 110px; }

/* Mise en page */
main.wrap { padding-top: 20px; padding-bottom: 64px; }
.page-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between; margin-bottom: 24px; }
.cols { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; }
.col-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.col-side { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 26px; }
.card > :last-child { margin-bottom: 0; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 640px) {
  .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 20px; }
}
hr.sep { border: 0; height: 1px; background: var(--line); margin: 4px 0; }

/* Formulaires */
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label, .label { font-size: 14px; font-weight: 700; }
.field .hint, .hint { font-size: 13px; color: var(--muted); }
input[type=text], input[type=email], input[type=tel], input[type=url], input[type=date], input[type=number], input[type=password], select, textarea {
  width: 100%; min-height: 48px; padding: 10px 14px; border: 1px solid var(--field); border-radius: 10px; background: var(--surface); color: var(--ink);
}
textarea { resize: vertical; line-height: 1.5; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 3px solid var(--focus); outline-offset: 2px;
}
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--soft); }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--night); flex: none; }
.choice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--field); border-radius: 12px; background: var(--surface); cursor: pointer; }
.choice:has(input:checked) { border: 2px solid var(--night); background: var(--sky); padding: 13px 15px; }
.choice input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--night); flex: none; }
.choice strong { display: block; }
.choice span span { display: block; font-size: 14px; color: var(--soft); }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 22px; border-radius: 12px; border: 2px solid var(--night); background: var(--night); color: var(--on-dark); font-weight: 700; font-size: 16px; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--night-deep); border-color: var(--night-deep); color: var(--on-dark); }
.btn-lg { min-height: 56px; font-size: 17px; width: 100%; }
.btn-ghost { background: var(--surface); color: var(--night); }
.btn-ghost:hover { background: var(--sky); color: var(--night-deep); }
.btn-danger { background: var(--surface); color: var(--red); border-color: var(--red); }
.btn-danger:hover { background: var(--red-bg); color: var(--red-deep); border-color: var(--red-deep); }
.btn-danger.on, .btn-danger.on:hover { background: var(--red); color: var(--on-dark); }
.btn-sm { min-height: 44px; padding: 0 14px; font-size: 14px; border-width: 1px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
button[disabled] { opacity: .5; cursor: not-allowed; }

/* Messages */
.flash { margin: 16px 0 0; padding: 14px 16px; border-radius: 12px; font-size: 15px; }
.flash ul { margin: 6px 0 0; padding-left: 20px; }
.flash-ok { background: var(--sky); color: var(--night-deep); }
.flash-err { background: var(--red-bg); color: var(--red-deep); }
.note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; background: var(--sky); border-radius: 10px; font-size: 14px; color: var(--night-deep); }
.note-warn { background: var(--amber-bg); color: var(--amber-ink); }
.quote { background: var(--snow); border-radius: 10px; padding: 14px 16px; font-style: italic; color: var(--soft); white-space: pre-line; }

/* Badges */
.badge { display: inline-block; padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge-option { background: var(--amber-bg); color: var(--amber-ink); }
.badge-acceptee { background: var(--sky); color: var(--night-deep); }
.badge-confirmee { background: var(--reserve); color: var(--on-dark); }
.badge-famille { background: var(--pine-bg); color: var(--pine-ink); }
.badge-refusee, .badge-annulee { background: var(--red-bg); color: var(--red-deep); }
.badge-expiree { background: var(--tint); color: var(--muted); }
.badge-oui { background: var(--accent-soft); color: var(--night-deep); }
.badge-non { background: var(--red-bg); color: var(--red-deep); }
.badge-att { background: var(--tint); color: var(--muted); }
.tag-super { padding: 2px 8px; border-radius: 6px; background: var(--ink); color: var(--on-dark); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }

/* Lignes de détail */
.kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.kv div span { display: block; font-size: 13px; color: var(--muted); }
.kv div strong { display: block; margin-top: 3px; }
@media (max-width: 640px) { .kv { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.line { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 12px; font-size: 15px; }
.line > :first-child { flex: 1 1 170px; min-width: 0; }
.line .badge { flex: none; }
.line span:first-child { color: var(--muted); }
.line.total { font-size: 16px; font-weight: 800; }
.line.total span:first-child { color: var(--ink); }

/* Liste des votes */
.voter { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--tint-2); }
.avatar { flex: none; width: 40px; height: 40px; border-radius: 20px; background: var(--avatar); color: var(--night-deep); display: flex; align-items: center; justify-content: center; font-weight: 800; }
.avatar.super { background: var(--ink); color: var(--on-dark); }
.voter .who { flex: 1; min-width: 0; }
.voter .who > div:first-child { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-weight: 700; }
.voter .who > div + div { font-size: 13px; color: var(--muted); }
.progress { height: 8px; border-radius: 4px; background: var(--tint-2); overflow: hidden; }
.progress > div { height: 100%; background: var(--night); }

/* Bandeaux de décision */
.banner { border-radius: 16px; padding: 22px 26px; color: var(--on-dark); display: flex; gap: 14px; align-items: flex-start; }
.banner.ok { background: var(--night-deep); }
.banner.ko { background: var(--red-deep); }
.banner.neutral { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.banner strong { display: block; font-size: 18px; }
.banner p { margin: 4px 0 0; color: inherit; opacity: .9; }

.super-panel { border: 2px solid var(--ink); }

/* Étapes */
.steps { display: flex; flex-direction: column; gap: 16px; }
.step { display: flex; gap: 14px; }
.step .num { flex: none; width: 32px; height: 32px; border-radius: 16px; background: var(--night); color: var(--on-dark); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; }
.step p { margin: 2px 0 0; font-size: 14px; color: var(--muted); }

/* Calendrier */
.cal-wrap { overflow-x: auto; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; min-width: 300px; }
.cal-h { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 4px 6px; }
.cal-d { min-height: 46px; border-radius: 10px; padding: 7px 8px; display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; }
.cal-d .n { font-weight: 800; font-size: 15px; }
.cal-d .l { font-size: 12px; font-weight: 600; line-height: 1.25; overflow: hidden; }
.cal-big .cal-d { min-height: 88px; }
.cal-past { opacity: .45; }
.cal-busy { background: var(--line); color: var(--muted); text-decoration: line-through; }
.cal-option { background: var(--amber-bg); color: var(--amber-ink); border: 2px dashed var(--amber-line); }
.cal-acceptee { background: var(--sky-2); color: var(--night-deep); border-color: var(--sky-2); }
.cal-famille { background: var(--pine-bg); color: var(--pine-ink); border-color: var(--pine-bg); }
.cal-loue { background: var(--night); color: var(--on-dark); border-color: var(--night); }
a.cal-d:hover { filter: brightness(.95); color: inherit; }
.cal-pick .cal-free { cursor: pointer; }
.cal-pick .cal-free:hover { border-color: var(--night); }
.cal-sel { background: var(--night) !important; color: var(--on-dark) !important; border-color: var(--night) !important; }
.cal-range { background: var(--sky) !important; border-color: var(--sky-2) !important; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 14px; font-weight: 600; }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend i { width: 16px; height: 16px; border-radius: 4px; display: inline-block; }
.month-nav { display: flex; align-items: center; gap: 12px; }
.month-nav h1 { margin: 0; }
.icon-btn { width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--field); background: var(--surface); display: inline-flex; align-items: center; justify-content: center; text-decoration: none; color: var(--ink); }
.months { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.months h3 { margin: 0 0 10px; font-size: 17px; text-transform: capitalize; }

/* Listes */
.list-item { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 12px; background: var(--snow); text-decoration: none; color: var(--ink); }
.list-item.warn { background: var(--amber-bg); }
.list-item .top-line { display: flex; justify-content: space-between; gap: 8px; font-weight: 800; }
.list-item .sub { font-size: 13px; color: var(--muted); }
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 760px; }
table.data th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 0 8px 10px; }
table.data td { padding: 8px; border-top: 1px solid var(--tint-2); vertical-align: middle; }
table.data input[type=text], table.data input[type=email], table.data select { min-height: 44px; }

.foot { padding: 24px 0 40px; font-size: 13px; color: var(--muted); text-align: center; }

/* Assistant d'installation */
.wizard { list-style: none; margin: 0 0 20px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 14px; font-weight: 600; color: var(--muted); }
.wizard li { display: flex; align-items: center; gap: 8px; }
.wizard li span { width: 28px; height: 28px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; background: var(--tint-2); color: var(--muted); font-weight: 800; }
.wizard li.current { color: var(--ink); }
.wizard li.current span { background: var(--night); color: var(--on-dark); }
.wizard li.done span { background: var(--sky-2); color: var(--night-deep); }
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.checklist li { display: flex; gap: 12px; align-items: flex-start; }
.checklist li > strong { flex: none; width: 24px; height: 24px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; }
.checklist li.ok > strong { background: var(--accent-soft); color: var(--night-deep); }
.checklist li.warn > strong { background: var(--amber-bg); color: var(--amber-ink); }
.checklist li.bad > strong { background: var(--red-bg); color: var(--red-deep); }
code { background: var(--tint); padding: 1px 6px; border-radius: 5px; font-size: .92em; }

/* Administration */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 24px; padding: 0; list-style: none; }
.tabs a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 14px; }
.tabs a:hover { border-color: var(--night); }
.tabs a[aria-current] { background: var(--night); border-color: var(--night); color: var(--on-dark); }
.test-banner { background: var(--amber-bg); color: var(--amber-ink); font-size: 14px; font-weight: 600; }
.test-banner .wrap { padding-top: 10px; padding-bottom: 10px; }
.test-banner a { color: inherit; }
.mail-preview { white-space: pre-wrap; background: var(--snow); border-radius: 10px; padding: 14px 16px; font-size: 14px; margin: 10px 0 0; max-height: 420px; overflow: auto; word-break: break-word; }
.photo-admin { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.photo-admin figure { margin: 0; background: var(--snow); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.photo-admin img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.photo-admin .tools { padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.photo-admin .tools .btn-row { gap: 6px; }
.log { white-space: pre-wrap; font-size: 12.5px; background: var(--ink); color: var(--tint-2); border-radius: 10px; padding: 14px; max-height: 360px; overflow: auto; margin: 0; }

/* Site public : présentation */
.about { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; }
.about-text { flex: 999 1 520px; min-width: 0; }
.about-text p { margin: 0 0 12px; font-size: 16px; line-height: 1.65; }
.about-side { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.equip { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 15px; }
.equip li { display: flex; gap: 10px; align-items: flex-start; }
.equip li::before { content: ""; flex: none; width: 8px; height: 8px; margin-top: 8px; border-radius: 2px; background: var(--night); transform: rotate(45deg); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-top: 20px; }
.gallery a { display: block; border-radius: 12px; overflow: hidden; background: var(--line); }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; transition: transform .2s; }
.gallery a:hover img { transform: scale(1.03); }
.gallery { align-items: start; }
.gallery img { height: auto; }

[hidden] { display: none !important; }
.proof-name { margin: 0; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 26px; font-weight: 700; letter-spacing: .04em; background: var(--sky); color: var(--night-deep); border-radius: 12px; padding: 14px 18px; text-align: center; user-select: all; }
.cal-busy.cal-pub-opt { background: var(--amber-bg); color: var(--amber-ink); border: 2px dashed var(--amber-line); text-decoration: none; }
.cal-reserve { background: var(--reserve); color: var(--on-dark); border-color: var(--reserve); }
a.cal-free:hover { border-color: var(--night); background: var(--sky); color: var(--ink); }
.badge-confirmee { background: var(--reserve); color: var(--on-dark); }
@media (max-width: 640px) {
  .cal-big .cal-d { min-height: 52px; }
  .cal-d .l { display: none; }
  .month-nav h1 { font-size: 26px; }
}

/* Légende et petits éléments thémés */
.legend i.sw-free { background: var(--surface); border: 1px solid var(--field); }
.legend i.sw-option { background: var(--amber-bg); border: 2px dashed var(--amber-line); }
.legend i.sw-reserve { background: var(--reserve); }
.attn { font-weight: 700; color: var(--amber-ink); }
.muted-link { color: var(--muted); }
.accent-text { white-space: nowrap;  color: var(--night); }
.kicker-accent { color: var(--amber-ink); }
.err-text { color: var(--red-deep); }
.theme-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.theme-pick label { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--field); border-radius: 12px; background: var(--surface); cursor: pointer; }
.theme-pick label:has(input:checked) { border: 2px solid var(--night); padding: 13px; }
.theme-pick .chips { display: flex; gap: 6px; }
.theme-pick .chips i { width: 28px; height: 28px; border-radius: 8px; display: inline-block; border: 1px solid rgba(0,0,0,.08); }
.theme-pick strong { display: flex; align-items: center; gap: 8px; }

/* ===== Palettes ===== */
/* Forêt de mélèzes : vert sapin, or des mélèzes, crème */
[data-theme="foret"] {
  --night: #234334; --night-deep: #162B21; --ridge: #33604B; --snow: #F4F3EC;
  --ink: #1C2620; --muted: #535F57; --soft: #36443B; --line: #DDE1D6; --field: #C3CABD;
  --sky: #E5EEE4; --sky-2: #C9DCCB; --ochre: #E9C27A;
  --amber-bg: #FBEBD3; --amber-ink: #7A4A0C; --amber-line: #C98A2E;
  --tint: #ECEEE6; --tint-2: #E3E7DD; --accent-soft: #D9E8DC; --avatar: #D8E3D9; --focus: #6FA387;
  --reserve: #234334;
}
/* Alpenglow : prune du crépuscule, rose des cimes, neige rosée */
[data-theme="alpenglow"] {
  --night: #4B2D45; --night-deep: #301B2C; --ridge: #6E4263; --snow: #FAF5F3;
  --ink: #2B1F27; --muted: #685A63; --soft: #463842; --line: #ECE0E3; --field: #D6C6CD;
  --sky: #F6E7EA; --sky-2: #EBCCD4; --ochre: #F5B98D;
  --amber-bg: #FCEBDD; --amber-ink: #80420F; --amber-line: #D28A4A;
  --tint: #F1EBED; --tint-2: #EAE1E4; --accent-soft: #F0DCE2; --avatar: #EADDE3; --focus: #B9789E;
  --reserve: #4B2D45;
}
/* Chalet bois et pierre : noyer, rouge chalet, pierre claire */
[data-theme="bois"] {
  --night: #4A3427; --night-deep: #2E2019; --ridge: #6B4D3B; --snow: #F5F1EB;
  --ink: #2A211B; --muted: #685B51; --soft: #46392F; --line: #E4DCD1; --field: #CFC2B3;
  --sky: #EFE6DA; --sky-2: #E0D0BB; --ochre: #E6AE5C;
  --amber-bg: #E2EDF4; --amber-ink: #22506F; --amber-line: #5A8DB3;
  --tint: #EEE9E2; --tint-2: #E7E0D7; --accent-soft: #EADFCF; --avatar: #E6DACB; --focus: #A9805F;
  --reserve: #8C3B2C;
}

/* Invitations */
.invite-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 0; border-top: 1px solid var(--line); }
.invite-row .who { flex: 1 1 280px; min-width: 0; overflow-wrap: anywhere; }
.invite-row .btn-row { gap: 8px; }


/* Alignement des champs côte à côte : libellés, champs et aides sur trois lignes communes,
   pour que les champs restent alignés même si un libellé passe sur deux lignes. */
@supports (grid-template-rows: subgrid) {
  .grid2 > .field, .grid3 > .field { display: grid; grid-row: span 3; grid-template-rows: subgrid; row-gap: 7px; align-content: start; }
  .grid2 > .field > label, .grid3 > .field > label { align-self: end; }
  .grid2 > :not(.field), .grid3 > :not(.field) { grid-row: span 2; align-self: end; }
  .grid2, .grid3 { row-gap: 9px; }
}

/* Date + demi-journée */
.date-half { display: flex; flex-wrap: wrap; gap: 8px; }
.date-half input { flex: 1 1 150px; min-width: 0; }
.date-half select { flex: 1 0 128px; width: auto; }

/* Jours partagés entre matin et après-midi : coupés en diagonale */
.cal-split { --am: var(--surface); --pm: var(--surface); background: linear-gradient(135deg, var(--am) 0 50%, var(--pm) 50% 100%); border: 1px solid var(--line); }
.cal-split.am-option { --am: var(--amber-bg); }
.cal-split.pm-option { --pm: var(--amber-bg); }
.cal-split.am-reserve { --am: var(--reserve); }
.cal-split.pm-reserve { --pm: var(--reserve); }
.cal-split.am-reserve .n { color: var(--on-dark); }
.cal-split.am-option .n { color: var(--amber-ink); }
.cal-split .l { margin-top: auto; text-align: right; }
.cal-split.pm-reserve .l { color: var(--on-dark); }
.cal-split.pm-option .l { color: var(--amber-ink); }
.sw-half { background: linear-gradient(135deg, var(--reserve) 0 50%, var(--amber-bg) 50% 100%); border: 1px solid var(--line); }

/* Tableau des membres : cartes sur petit écran */
table.members .check { align-items: center; white-space: nowrap; }
table.members .check input { margin: 0; }
@media (max-width: 820px) {
  table.members, table.members tbody, table.members tr, table.members td { display: block; }
  table.members { min-width: 0; }
  table.members thead { display: none; }
  table.members tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; padding: 14px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 12px; }
  table.members td { padding: 0; border: 0; }
  table.members td.wide { grid-column: 1 / -1; }
  table.members td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 5px; font-size: 13px; font-weight: 700; }
  table.members td.actions { grid-column: 1 / -1; }
}

/* Calendrier de sélection (poser une option) */
.picker { --pick: color-mix(in srgb, var(--focus) 42%, var(--surface)); --pick-strong: var(--night); user-select: none; -webkit-user-select: none; }
.picker-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.picker-help { margin: 0; flex: 1; text-align: center; font-weight: 600; font-size: 15px; }
.picker-head .icon-btn { cursor: pointer; flex: none; }
.picker-head .icon-btn:disabled { opacity: .35; cursor: default; }
.picker-months { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.picker-month h3 { margin: 0 0 8px; font-size: 16px; text-transform: capitalize; }
.picker .cal { gap: 4px; min-width: 0; }
.picker .cal-h { padding: 2px; text-align: center; font-size: 11px; }
.picker .cal-d { min-height: 40px; padding: 0; align-items: center; justify-content: center; font: inherit; color: var(--ink); cursor: default; -webkit-tap-highlight-color: transparent; }
.picker .cal-d .n { font-size: 14px; }
.picker button.cal-d { cursor: pointer; }
.picker button.cal-d:hover { border-color: var(--pick-strong); }
.picker button.cal-d:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.picker .pk-free { background: var(--surface); }
.picker .pk-option { background: var(--amber-bg); color: var(--amber-ink); border: 2px dashed var(--amber-line); }
.picker .pk-reserve { background: var(--reserve); color: var(--on-dark); border-color: var(--reserve); }
.picker .pk-sel { background: var(--pick); border-color: var(--pick); }
.picker .cal-split.am-sel { --am: var(--pick); }
.picker .cal-split.pm-sel { --pm: var(--pick); }
.picker .cal-split.am-free { --am: var(--surface); }
.picker .cal-split.pm-free { --pm: var(--surface); }
.picker .cal-split .n { color: var(--ink); background: var(--surface); border-radius: 6px; padding: 0 5px; line-height: 1.5; box-shadow: 0 0 0 1px var(--line); }
.picker .pk-start, .picker .pk-end, .picker .pk-pending { border: 2px solid var(--pick-strong); }
.picker .pk-start .n, .picker .pk-end .n, .picker .pk-pending .n { font-weight: 900; }
.picker .pk-pending { background: var(--pick); }
.picker-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.picker-foot .legend { font-size: 13px; gap: 12px; }
.legend i.sw-pick { background: color-mix(in srgb, var(--focus) 42%, var(--surface)); border: 2px solid var(--night); }
.picker-sum { margin: 12px 0 0; font-weight: 700; min-height: 1.5em; }
.picker-sum:empty { display: none; }
.picker-sum.ok { color: var(--ink); }
.picker-sum.warn { color: var(--amber-ink); }
@media (max-width: 720px) {
  .picker-months { grid-template-columns: 1fr; }
  .picker .cal-d { min-height: 42px; }
  .picker-help { font-size: 14px; }
}
