/* 12-24 — thème sobre noir et or, mobile d'abord, polices système uniquement. */
:root {
  --bg: #0e1014; --bg2: #151820; --card: #191d26; --line: #2a303c; --line2: #353c4a;
  --text: #e9e6df; --muted: #9a9fab; --gold: #c9a44c; --gold2: #e2c477; --gold-dim: #8a7136;
  --ok: #6fbf8a; --warn: #e0b057; --bad: #e07a6f; --info: #7fa7d9;
  --silver: #c5cbd4; --silver2: #e4e8ee; --silver-dim: #8a919c;
  --radius: 10px; --shadow: 0 6px 24px rgba(0,0,0,.35);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --nav-h: 64px;
  --touch: 44px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: hidden; max-width: 100%;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--sans);
  background-image: radial-gradient(1200px 500px at 50% -200px, #1b1f2a 0%, transparent 70%);
  min-height: 100vh; min-height: 100dvh; overflow-x: hidden; max-width: 100%;
  padding-left: var(--safe-left); padding-right: var(--safe-right);
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea, select, [contenteditable], [contenteditable="true"] {
  -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
a { color: var(--gold2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; color: var(--gold2); letter-spacing: .01em; line-height: 1.25; }
h1 { font-size: 1.55rem; margin: .2rem 0 1rem; }
h2 { font-size: 1.2rem; margin: 1.6rem 0 .7rem; }
h3 { font-size: 1.05rem; margin: 1rem 0 .5rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.pad { padding: 1rem; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.hidden { display: none !important; }

/* En-tête et navigation */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .6rem 1rem; padding-top: max(.6rem, env(safe-area-inset-top)); background: rgba(14,16,20,.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: .55rem; font-family: var(--serif); font-size: 1.2rem; color: var(--gold2); letter-spacing: .06em; }
.brand:hover { text-decoration: none; }
.nav { display: flex; gap: .25rem; }
.nav a { display: flex; flex-direction: row; align-items: center; gap: .4rem; color: var(--muted); padding: .45rem .7rem; border-radius: 8px; font-size: .92rem; }
.nav a:hover { color: var(--text); background: var(--bg2); text-decoration: none; }
.nav a.active { color: var(--gold2); background: #1f2430; }
.nav .ico { width: 18px; height: 18px; flex-shrink: 0; }
.nav a.active .ico { color: var(--gold); }
.view { max-width: 1080px; margin: 0 auto; padding: 1rem 1rem calc(var(--nav-h) + 1.5rem + var(--safe-bottom)); outline: none;
  min-width: 0; width: 100%; container-type: inline-size; container-name: app; }

@media (max-width: 699px) {
  .topbar { backdrop-filter: none; background: rgba(14,16,20,.98); } /* sinon la barre fixe du bas se positionne dans l'en-tête */
  .nav { position: fixed; left: 0; right: 0; bottom: 0; justify-content: space-around; gap: 0; z-index: 25;
    background: rgba(17,19,25,.97); border-top: 1px solid var(--line);
    padding: .25rem .15rem calc(.25rem + var(--safe-bottom));
    padding-left: max(.15rem, var(--safe-left)); padding-right: max(.15rem, var(--safe-right)); }
  .nav a { flex-direction: column; gap: 2px; font-size: .7rem; padding: .25rem .3rem; flex: 1; text-align: center;
    min-height: var(--touch); justify-content: center; }
  .nav .ico { width: 22px; height: 22px; display: block; }
  .nav:empty { display: none; }
  .brand span { font-size: 1.05rem; }
}
@media (min-width: 700px) {
  :root { --nav-h: 0px; }
  .view { padding-bottom: 3rem; }
  .nav a { min-height: var(--touch); }
}

/* Cartes, formulaires, boutons */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin: 0 0 1rem; }
.card.narrow { max-width: 460px; margin-left: auto; margin-right: auto; }
.card h2:first-child, .card h3:first-child { margin-top: 0; }
.grid2 { display: grid; gap: .8rem; }
@media (min-width: 640px) { .grid2 { grid-template-columns: 1fr 1fr; } .grid2 .full { grid-column: 1 / -1; } }
label { display: block; font-size: .88rem; color: var(--muted); margin: 0 0 .25rem; }
.field { position: relative; margin: 0 0 .8rem; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
}
input, select, textarea { width: 100%; font: inherit; color: var(--text); background: #11141a; border: 1px solid var(--line2);
  border-radius: 8px; padding: .62rem .7rem; min-height: 44px; }
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; border-color: var(--gold-dim); }
input[readonly] { color: var(--muted); background: #151820; }
input[type=checkbox] { width: auto; min-height: 0; margin-right: .5rem; accent-color: var(--gold); transform: scale(1.2); }
input::placeholder, textarea::placeholder { color: #7a8090; opacity: 1; }
select:has(option:checked[disabled]),
select:has(option:checked[hidden][value=""]) { color: #7a8090; }
select option { color: var(--text); }
select option[disabled], select option[hidden] { color: #7a8090; }

.check { display: flex; align-items: center; color: var(--text); font-size: 1rem; margin: .4rem 0 .8rem; }

/* Cases à cocher or, faites maison */
.degree-set {
  border: 0; margin: 0 0 .85rem; padding: 0;
  display: flex; flex-wrap: wrap; gap: .55rem 1rem; align-items: center;
  min-width: 0;
}
.gold-check-label, .check-line {
  display: inline-flex; align-items: center; gap: .45rem;
  color: var(--text); font-size: .95rem; cursor: pointer; margin: 0;
  user-select: none; position: relative;
}
.check-line { display: flex; margin: .25rem 0 .85rem; }
.gold-check-label input.gold-check {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
  /* reste focalisable : le focus-visible s'applique au voisin */
}
.gold-check-ui {
  width: 20px; height: 20px; flex: 0 0 auto;
  border: 1.5px solid var(--gold-dim); border-radius: 4px;
  background: #11141a;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(201,164,76,.08);
}
.gold-check:focus-visible + .gold-check-ui {
  outline: 2px solid var(--gold); outline-offset: 2px;
}
.gold-check:checked + .gold-check-ui {
  background: linear-gradient(#d3b05a, #b89236);
  border-color: var(--gold);
}
.gold-check:checked + .gold-check-ui::after {
  content: '';
  width: 5px; height: 9px;
  border: solid #1a1407;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translateY(-1px);
}
.deg-chip, .tag-pill.deg-chip {
  border-color: var(--gold-dim); color: var(--gold2); background: #1c1910;
}
.deg-cells { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.cal .ev-degs { display: flex; flex-wrap: wrap; gap: 2px; margin: 1px 0 0; }
.cal .ev-deg {
  display: inline-block; font-size: .62rem; line-height: 1.15;
  padding: 0 3px; border-radius: 3px;
  border: 1px solid var(--gold-dim); color: var(--gold2); background: #1c1910;
}
.cal .ev.foreign .ev-deg { border-color: var(--silver-dim); color: var(--silver2); background: #16181c; }
.hint { font-size: .82rem; color: var(--muted); margin-top: .25rem; }
.login-status.ok { color: var(--ok); }
.login-status.bad { color: var(--bad, #c45c5c); }

.field.icon-field {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin: 0 0 .7rem;
}
.field.icon-field > .field-ico {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  color: var(--gold);
  display: block;
}
.field.icon-field > input,
.field.icon-field > select,
.field.icon-field > .send-wrap,
.field.icon-field > .phone-static-value {
  flex: 1;
  min-width: 0;
}
.phone-static-value {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: .62rem 0;
  color: var(--muted);
  font: inherit;
  letter-spacing: .02em;
}
.phone-static-value.is-ok { color: var(--ok); }
input.login-ok, input.login-ok:focus {
  color: var(--ok);
  border-color: var(--ok);
  outline-color: var(--ok);
}
input.login-bad, input.login-bad:focus {
  color: var(--bad);
  border-color: var(--bad);
  outline-color: var(--bad);
}
.contact .fields > .field.icon-field { margin: 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font: inherit; font-weight: 600; cursor: pointer;
  border-radius: 8px; padding: .6rem 1rem; min-height: 44px; border: 1px solid var(--gold-dim); background: linear-gradient(#d3b05a, #b89236);
  color: #1a1407; }
.btn:hover { filter: brightness(1.06); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.ghost { background: transparent; color: var(--gold2); }
.btn.subtle { background: #1f2430; color: var(--text); border-color: var(--line2); font-weight: 500; }
.btn.danger { background: transparent; color: var(--bad); border-color: #6b3a35; }
.btn.small { min-height: var(--touch); padding: .35rem .7rem; font-size: .85rem; }
.btn.block { width: 100%; }
.row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }
.links { display: grid; gap: .35rem; margin-top: 1rem; font-size: .95rem; }
.signup-link { margin: 1rem 0 0; text-align: center; font-size: .95rem; }
.error { color: var(--bad); font-size: .9rem; margin: .4rem 0; min-height: 1.2em; }
.notice { border-left: 3px solid var(--gold); background: #1c1a14; padding: .7rem .9rem; border-radius: 6px; margin: 0 0 1rem; }
.notice.info { border-color: var(--info); background: #151b24; }
.notice.silver { border-color: var(--silver); background: #1a1d22; }
.notice.warn { border-color: var(--warn); }
.code-big { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 1.35rem; letter-spacing: .12em; color: var(--gold2);
  background: #11141a; border: 1px dashed var(--gold-dim); border-radius: 8px; padding: .6rem .9rem; display: inline-block; }

/* Badges et tableaux */
.badge { display: inline-block; font-size: .75rem; padding: .1rem .5rem; border-radius: 999px; border: 1px solid var(--line2); color: var(--muted); white-space: nowrap; }
.badge.ok { color: var(--ok); border-color: #2f5a3e; }
.badge.warn { color: var(--warn); border-color: #66512a; }
.badge.bad { color: var(--bad); border-color: #6b3a35; }
.badge.gold { color: var(--gold2); border-color: var(--gold-dim); }
.badge.info { color: var(--info); border-color: #34465e; }
.badge.silver { color: var(--silver2); border-color: var(--silver-dim); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: .55rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; background: var(--bg2); font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; }
tr:last-child td { border-bottom: 0; }
.list { list-style: none; padding: 0; margin: 0; }
.list > li { border-bottom: 1px solid var(--line); padding: .7rem 0; }
.list > li:last-child { border-bottom: 0; }

/* Calendrier */
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .6rem; }
.cal-head h1 { margin: 0; text-transform: capitalize; font-size: 1.35rem; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cal .dow { background: var(--bg2); color: var(--muted); font-size: .72rem; text-align: center; padding: .35rem 0; text-transform: uppercase; letter-spacing: .05em; }
.cal .day {
  background: var(--card); min-height: 54px; padding: .25rem; position: relative;
  display: flex; flex-direction: column; align-items: stretch; width: 100%;
  border: 0; margin: 0; font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.cal .day.other { background: #13161d; color: #59606d; }
.cal .day.past { background: #12141a; color: #5c6370; }
.cal .day.past.other { background: #10131a; color: #4e5562; }
.cal .day.past .num { color: #6a7180; }
.cal .day.past .ev, .cal .day.past .ev-more { opacity: .45; }
.cal .day.today .num { background: var(--gold); color: #1a1407; border-radius: 50%; }
.cal .day.today { background: var(--card); color: inherit; }
.cal .day.selected { background: #1c1910; box-shadow: inset 0 0 0 1px var(--gold); }
.cal .day:hover { filter: brightness(1.08); }
.cal .day:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; z-index: 1; }
.cal .num { font-size: .8rem; width: 1.6rem; height: 1.6rem; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.cal .ev-list { display: flex; flex-direction: column; gap: 2px; min-width: 0; margin-top: 2px; }
.cal .ev { display: flex; flex-direction: column; align-items: stretch; gap: 1px; font-size: .7rem; line-height: 1.25; padding: 1px 4px; border-radius: 4px; background: #2a2416;
  color: var(--gold2); border-left: 2px solid var(--gold); overflow: hidden; }
.cal .ev-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal .ev.foreign { background: #22262c; color: var(--silver2); border: 1px solid var(--silver); border-left: 3px solid var(--silver); }
.cal .ev.cancelled { text-decoration: line-through; opacity: .6; }
.cal .ev-more { font-size: .68rem; line-height: 1.2; color: var(--muted); font-weight: 600; padding: 0 2px; }
.cal .ev-more-m { display: none; }
.cal .ev-more-d { display: none; }
@media (max-width: 640px) {
  .cal .day { min-height: 52px; align-items: center; }
  .cal .ev-list { flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: center; gap: 3px; }
  .cal .ev { font-size: 0; height: 7px; width: 7px; border-radius: 50%; padding: 0; border: 0; background: var(--gold); flex: 0 0 auto; display: block; }
  .cal .ev .ev-title { display: none; }
  .cal .ev.foreign { background: var(--silver); border: 0; }
  .cal .ev-list .ev:nth-child(n+3) { display: none; }
  .cal .ev .ev-degs { display: none; }
  .cal .ev-more-m { display: inline; font-size: 9px; letter-spacing: 0; }
  .cal .ev-more-d { display: none !important; }
}
@media (min-width: 641px) {
  .cal .ev-list .ev:nth-child(n+4) { display: none; }
  .cal .ev-more-d { display: block; }
  .cal .ev-more-m { display: none !important; }
}
@media (min-width: 900px) and (min-height: 900px) { .cal .day { min-height: 102px; } }
@media (min-width: 900px) and (max-height: 899px) { .cal .day { min-height: 72px; } }

.cal-layout { display: block; }
.cal-main { min-width: 0; }
.cal-side { display: none; }
@media (min-width: 1024px), (min-width: 900px) and (orientation: landscape) {
  .view:has(.cal-layout) { max-width: 1280px; }
  .cal-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, .95fr);
    gap: 1.25rem;
    align-items: start;
  }
  .cal-side {
    display: block;
    position: sticky;
    top: calc(4.2rem + var(--safe-top));
    max-height: calc(100dvh - 6rem);
    overflow: auto;
    margin: 0;
  }
}

.cal-day { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .85rem 1rem; }
.cal-day-head { margin-bottom: .75rem; gap: .5rem; }
.cal-day-head h1, .cal-day-head h2, .day-page h1 { text-transform: capitalize; }
.cal-day-head h2 { font-size: 1.15rem; }
.day-page { margin: 0 0 1.2rem; }
.day-page h1 { margin-top: .2rem; font-size: 1.4rem; }
.day-page .btn .ico { width: 18px; height: 18px; }
.icon-btn {
  width: var(--touch); height: var(--touch); margin: 0; padding: 0; border: 0; border-radius: 8px;
  background: transparent; color: var(--muted); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: var(--bg2); color: var(--text); }
.icon-btn .ico { width: 18px; height: 18px; }
a.icon-btn { text-decoration: none; }
.icon-btn.add-tenue {
  width: var(--touch); height: var(--touch); color: var(--gold);
  border: 1px solid var(--gold-dim);
  background: rgba(201, 164, 76, 0.12);
  border-radius: 10px; flex-shrink: 0;
}
.icon-btn.add-tenue:hover { color: var(--gold2); background: rgba(201, 164, 76, 0.22); border-color: var(--gold); }
.icon-btn.add-tenue .ico { width: 22px; height: 22px; stroke-width: 2.2; }
.cal-actions-end { display: flex; align-items: center; gap: .4rem; }
.cal-views { display: inline-flex; gap: .25rem; }
.cal-view-btn { width: var(--touch); height: var(--touch); color: var(--muted); border: 1px solid var(--line2); background: transparent; border-radius: 10px; }
.cal-view-btn:hover { color: var(--gold2); border-color: var(--gold-dim); background: rgba(201, 164, 76, 0.08); }
.cal-view-btn.active { color: var(--gold); border-color: var(--gold); background: rgba(201, 164, 76, 0.12); }
.cal-view-btn .ico { width: 20px; height: 20px; }
.cal-jour.past { opacity: .92; }
.cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cal-week-day {
  background: var(--card); min-height: 140px; padding: .4rem; position: relative;
  display: flex; flex-direction: column; align-items: stretch; width: 100%;
  border: 0; margin: 0; font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.cal-week-day:hover { filter: brightness(1.08); }
.cal-week-day:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; z-index: 1; }
.cal-week-label { display: flex; align-items: center; justify-content: space-between; gap: .3rem; margin-bottom: .25rem; }
.cal-week-day .dow-s { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.cal-week-day.past { background: #12141a; color: #5c6370; }
.cal-week-day.past .num, .cal-week-day.past .dow-s { color: #6a7180; }
.cal-week-day.past .ev, .cal-week-day.past .ev-more { opacity: .45; }
.cal-week-day.selected { box-shadow: inset 0 0 0 1px var(--gold); }
.cal-week-day.today { background: #1c1910; }
.cal-week-day.today .num { background: var(--gold); color: #1a1407; border-radius: 50%; }
.cal-week .ev-list { display: flex; flex-direction: column; gap: 2px; min-width: 0; margin-top: 2px; }
.cal-week .ev { display: flex; flex-direction: column; align-items: stretch; gap: 1px; font-size: .7rem; line-height: 1.25; padding: 2px 5px; border-radius: 4px; background: #2a2416; color: var(--text); border-left: 2px solid var(--gold); min-width: 0; }
.cal-week .ev-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-week .ev-degs { display: flex; flex-wrap: wrap; gap: 2px; margin: 1px 0 0; }
.cal-week .ev-deg { font-size: .62rem; padding: 0 .25rem; border: 1px solid var(--gold-dim); border-radius: 999px; color: var(--gold2); }
.cal-week .ev.foreign { background: #22262c; color: var(--silver2); border: 1px solid var(--silver); border-left: 3px solid var(--silver); }
.cal-week .ev.cancelled { text-decoration: line-through; opacity: .6; }
.cal-week .ev-more { font-size: .68rem; line-height: 1.2; color: var(--muted); font-weight: 600; padding: 0 2px; }
.cal-week .ev-more-m { display: none; }
.cal-week .ev-list.overflow-d .ev:nth-child(n+4) { display: none; }
.cal-week .ev-list.overflow-d .ev-more-d { display: block; }
@media (max-width: 760px) {
  .cal-week { display: flex; flex-direction: column; gap: 0; background: transparent; border: 1px solid var(--line); }
  .cal-week-day { min-height: 0; padding: .55rem .7rem; flex-direction: row; align-items: flex-start; gap: .7rem; border-bottom: 1px solid var(--line); }
  .cal-week-day:last-child { border-bottom: 0; }
  .cal-week-label { flex-direction: column; align-items: flex-start; min-width: 3.2rem; margin: 0; }
  .cal-week-day .ev-list { flex: 1; }
}
.tag-tools { display: flex; align-items: flex-start; gap: .25rem; flex: 0 0 auto; }
.tag-pills-row { display: flex; align-items: flex-start; gap: .45rem; margin-top: .35rem; }
.tag-pills-row .tag-pills { flex: 1 1 auto; min-width: 0; margin-top: 0; }
.tag-inscrire {
  flex: 0 0 auto; margin-left: auto; align-self: flex-start; white-space: nowrap;
  min-height: 36px; padding: 0 .7rem; border: 1px solid var(--gold-dim); border-radius: 8px;
  background: #1c1910; color: var(--gold2); font: inherit; font-size: .82rem; font-weight: 600;
  cursor: pointer;
}
.tag-inscrire:hover { background: #2a2416; }
.tag-inscrire[aria-expanded="true"] { background: #2a2416; }
.tag-inscrire:disabled { opacity: .55; cursor: default; }
.tenue-tag.open-inscription { border-color: var(--gold-dim); background: #16141a; }
.tenue-tag.foreign.open-inscription { border-color: var(--silver); background: #181a1e; }
.tag-inscription { padding: .15rem .85rem .85rem; border-top: 1px solid var(--line); }
.tag-inscription .tag-agapes { padding: 0; border-top: 0; }
.tag-agapes { padding: .15rem .85rem .85rem; border-top: 1px solid var(--line); }
.agapes-summary { margin: .7rem 0 .45rem; font-weight: 600; color: var(--gold2); }
.agapes-names { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .25rem; }
.agapes-names li { font-size: .92rem; }
.agapes-names .visitor { color: var(--text); }
.attend-block { margin: .7rem 0 0; }
.attend-block:first-child { margin-top: .5rem; }
.attend-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .28rem; }
.attend-head .field-ico, .attend-head .ico { width: 18px; height: 18px; color: var(--gold); flex: 0 0 auto; display: block; }
.attend-count { font-weight: 600; color: var(--gold2); }
.attend-extra { display: flex; align-items: center; gap: .9rem; margin-top: .7rem; color: var(--muted); font-size: .88rem; }
.attend-extra span { display: inline-flex; align-items: center; gap: .28rem; }
.attend-extra .ico { width: 15px; height: 15px; }
.tag-reply { margin-top: .75rem; display: flex; flex-direction: column; gap: .4rem; }
.tag-reply-row { gap: .4rem; }
.tenue-tag { touch-action: manipulation; }
.day-tags { display: flex; flex-direction: column; gap: .6rem; }
.tenue-tag {
  border: 1px solid var(--line2); border-radius: 10px; background: var(--bg2);
  border-left: 3px solid var(--gold); overflow: hidden;
}
.tenue-tag.foreign { border: 1px solid var(--silver); border-left: 3px solid var(--silver); background: #1a1d22; box-shadow: 0 0 0 1px rgba(197, 203, 212, .25); }
.tenue-tag.cancelled { opacity: .72; }
.tenue-tag.open { border-color: var(--gold-dim); background: #16141a; }
.tenue-tag.foreign.open { border-color: var(--silver); background: #181a1e; }
.tag-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; padding: .65rem .75rem; }
.tag-main { min-width: 0; flex: 1; }
.tag-line { display: flex; align-items: baseline; gap: .55rem; flex-wrap: wrap; }
.tag-time { font-weight: 700; color: var(--gold2); font-variant-numeric: tabular-nums; }
.tag-title { font-weight: 600; }
.tag-pills { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .35rem; }
.tag-pill { display: inline-block; font-size: .72rem; padding: .1rem .45rem; border-radius: 999px; border: 1px solid var(--line2); color: var(--muted); }
.tag-pill.bad { color: var(--bad); border-color: #6b3a35; }
.tag-toggle {
  flex: 0 0 auto; width: 36px; height: 36px; margin: 0; padding: 0; border: 0; border-radius: 8px;
  background: #1c1910; color: var(--gold); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.tag-toggle:hover { background: #2a2416; }
.tag-toggle .ico { width: 18px; height: 18px; transition: transform .2s ease; }
.tenue-tag.open .tag-toggle .ico { transform: rotate(180deg); }
.tag-body { padding: 0 .85rem .85rem; border-top: 1px solid var(--line); }
.tag-body .kv { margin-top: .7rem; }
.tag-actions { margin-top: .85rem; }
.legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .82rem; color: var(--muted); margin: .5rem 0 0; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: .35rem; vertical-align: middle; }

.tenue-card { display: grid; grid-template-columns: 64px 1fr; gap: .8rem; align-items: start; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: .75rem; margin-bottom: .6rem; color: var(--text); }
.tenue-card:hover { border-color: var(--gold-dim); text-decoration: none; }
.tenue-card.foreign, .card.foreign { border: 1px solid var(--silver); border-left: 3px solid var(--silver); background: #1a1d22; }
.tenue-card.own { border-left: 3px solid var(--gold); }
.datebox { text-align: center; border: 1px solid var(--line2); border-radius: 8px; padding: .3rem 0; background: var(--bg2); }
.datebox .d { font-family: var(--serif); font-size: 1.5rem; color: var(--gold2); line-height: 1.1; }
.datebox .m { font-size: .72rem; text-transform: uppercase; color: var(--muted); letter-spacing: .05em; }
.tenue-card .t { font-weight: 600; }
.tenue-card .meta { font-size: .85rem; color: var(--muted); }
.tenue-card .badges { margin-top: .3rem; display: flex; gap: .3rem; flex-wrap: wrap; }

/* Réponse */
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; margin: .3rem 0 1rem; }
.seg.two { grid-template-columns: repeat(2, 1fr); }
.seg button { font: inherit; min-height: 48px; padding: .45rem .35rem; line-height: 1.2; white-space: normal; border-radius: 8px; border: 1px solid var(--line2); background: #11141a; color: var(--text); cursor: pointer; }
.seg button[aria-pressed=true] { border-color: var(--gold); background: #2a2416; color: var(--gold2); font-weight: 600; }
.seg button.no[aria-pressed=true] { border-color: #6b3a35; background: #2a1715; color: var(--bad); }
.seg button.maybe[aria-pressed=true] { border-color: #66512a; background: #262014; color: var(--warn); }

.presence-head { display: flex; align-items: center; gap: .5rem; margin: 0 0 .55rem; }
.presence-head h2 { flex: 1; margin: 0; }
.presence-head.compact { margin: 0 0 .35rem; justify-content: flex-end; min-height: 18px; }
.presence-saved {
  width: 18px; height: 18px; flex: 0 0 auto;
  color: var(--ok); opacity: 0; transform: scale(.85);
  transition: opacity .18s ease, transform .18s ease;
}
.presence-saved.show { opacity: 1; transform: scale(1); }
.presence-toggles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .45rem;
  margin: 0;
}
.presence-toggles.two { grid-template-columns: repeat(2, 1fr); }
.presence-toggles.four { grid-template-columns: repeat(2, 1fr); }
.presence-toggles button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .28rem;
  font: inherit;
  font-size: .92rem;
  min-height: 64px;
  padding: .45rem .3rem;
  line-height: 1.15;
  border-radius: 8px;
  border: 1px solid var(--line2);
  background: #11141a;
  color: var(--text);
  cursor: pointer;
}
.presence-toggles button .ico { width: 20px; height: 20px; color: var(--gold); display: block; }
.presence-toggles button[aria-pressed=true] {
  border-color: var(--gold);
  background: #2a2416;
  color: var(--gold2);
  font-weight: 600;
}
.presence-toggles button[aria-pressed=true] .ico { color: var(--gold2); }
.presence-toggles button:disabled { opacity: .45; cursor: not-allowed; }
.kv { display: grid; grid-template-columns: 8.5rem 1fr; gap: .35rem .8rem; font-size: .95rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 420px) { .kv { grid-template-columns: 1fr; } .kv dd { margin-bottom: .4rem; } }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: .5rem; margin: .5rem 0 1rem; }
.stat { background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: .55rem; text-align: center; }
.stat b { display: block; font-family: var(--serif); font-size: 1.6rem; color: var(--gold2); line-height: 1.1; }
.stat span { font-size: .75rem; color: var(--muted); }
.stat.agapes b { color: var(--ok); }

/* Contacts réordonnables */
.contact { display: grid; grid-template-columns: 2rem 1fr auto; gap: .5rem; align-items: start; background: var(--bg2); border: 1px solid var(--line);
  border-radius: 8px; padding: .6rem; margin-bottom: .5rem; }
.contact .prio { font-family: var(--serif); color: var(--gold2); font-size: 1.3rem; text-align: center; padding-top: .4rem; }
.contact .fields { display: grid; gap: .4rem; }
@media (min-width: 640px) { .contact .fields { grid-template-columns: 1.3fr 1fr 1fr; } }
.contact .ctl { display: flex; flex-direction: column; gap: .3rem; }
.contact .ctl button { min-width: var(--touch); min-height: var(--touch); }

.tabs { display: flex; gap: .3rem; overflow-x: auto; padding-bottom: .4rem; margin-bottom: 1rem; border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.tabs a { white-space: nowrap; padding: .55rem .75rem; min-height: var(--touch); display: inline-flex; align-items: center; border-radius: 8px 8px 0 0; color: var(--muted); font-size: .92rem; }
.tabs a.active { color: var(--gold2); background: var(--card); border: 1px solid var(--line); border-bottom-color: var(--card); }
.steps { display: flex; gap: .4rem; margin-bottom: 1rem; }
.steps span { flex: 1; height: 4px; border-radius: 2px; background: var(--line2); }
.steps span.on { background: var(--gold); }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 1rem); z-index: 50; max-width: min(92vw, 520px);
  background: #232937; color: var(--text); border: 1px solid var(--line2); border-left: 3px solid var(--ok); border-radius: 8px;
  padding: .7rem 1rem; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .2s; }
.toast.show { opacity: 1; }
.toast.err { border-left-color: var(--bad); }
@media (min-width: 700px) { .toast { bottom: 1.5rem; } }
.divider { text-align: center; color: var(--gold-dim); letter-spacing: .6em; margin: 1.2rem 0; font-size: .8rem; }
.hero { text-align: center; margin: 1.2rem 0 1.4rem; }
.brand img, .hero img { background: transparent; border: 0; box-shadow: none; }
.hero img { width: 64px; height: 64px; }
.hero h1 { margin: .5rem 0 .2rem; font-size: 1.7rem; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}


/* Utilitaires (pas d'attribut style : la CSP les interdit) */
.flush { margin-top: 0 !important; margin-bottom: 0; }
.card h2.flush, .card h3.flush { margin-bottom: .7rem; }
.row.between h2.flush, .row.between h3.flush { margin-bottom: 0; }
.mt { margin-top: 1rem; }
.mt-s { margin-top: .4rem; }
.ml { margin-left: .4rem; }
.warn-text { color: var(--warn); }
.tenue-title { margin-top: .6rem; }
.extra-row { margin-bottom: .5rem; }
.row.nowrap { flex-wrap: nowrap; }
.row.nowrap input { flex: 1; }
.lg-own { background: var(--gold); }
.lg-foreign { background: var(--silver); }
.cal-actions { margin-bottom: .6rem; }
.cal-actions-end { align-items: center; gap: .35rem; }
.cal-filter-btn {
  position: relative;
  width: var(--touch); height: var(--touch);
  color: var(--silver2);
  border: 1px solid var(--silver-dim);
  background: rgba(197, 203, 212, 0.08);
  border-radius: 10px;
}
.cal-filter-btn:hover { color: var(--silver2); border-color: var(--silver); background: rgba(197, 203, 212, 0.16); }
.cal-filter-btn.active, .cal-filter-btn.open { color: var(--silver2); border-color: var(--silver); background: rgba(197, 203, 212, 0.18); }
.cal-filter-count {
  position: absolute; top: -4px; right: -4px;
  min-width: 1.15rem; height: 1.15rem; padding: 0 3px;
  border-radius: 999px; font-size: .62rem; line-height: 1.15rem;
  text-align: center; background: #2a2e35; color: var(--silver2); border: 1px solid var(--silver-dim);
}
.cal-filter {
  border: 1px solid var(--silver-dim); border-radius: var(--radius);
  background: #16181c; padding: .7rem .8rem; margin: 0 0 .7rem;
}
.cal-filter-title { margin: 0 0 .45rem; font-size: .82rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.cal-filter-list { display: flex; flex-direction: column; gap: .35rem; }
.cal-filter-item {
  display: flex; align-items: center; gap: .5rem;
  padding: .45rem .5rem; min-height: var(--touch); border-radius: 8px; cursor: pointer;
}
.cal-filter-item.own { cursor: default; }
.cal-filter-item.foreign { border: 1px solid transparent; }
.cal-filter-item.foreign.on { border-color: var(--silver-dim); background: #1a1c20; }
.cal-filter-item input { accent-color: var(--gold); }
.cal-filter-item.foreign input { accent-color: var(--silver); }
.cal-filter-swatch { width: 10px; height: 10px; border-radius: 2px; flex: 0 0 auto; }
.cal-filter-name { flex: 1; min-width: 0; }

a.stat:hover { text-decoration: none; border-color: var(--gold-dim); }

.verified-value { display: block; font-size: 1.05rem; padding: .55rem 0 .2rem; color: var(--text); word-break: break-word; }
.field.locked .hint { color: var(--ok); }

/* Icône d'envoi dans le champ (inscription Admin, 390 px) */
.send-row { margin: 0 0 .5rem; }
.send-wrap { position: relative; }
.send-wrap input { padding-right: 2.55rem; min-width: 0; }
.send-btn {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; margin: 0; padding: 0; border: 0; border-radius: 7px;
  background: transparent; color: var(--gold); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.send-btn .ico { width: 20px; height: 20px; display: block; }
.send-btn:hover:not(:disabled) { background: #2a2418; color: var(--gold2); }
.send-btn:disabled { color: var(--muted); opacity: .6; cursor: not-allowed; }
.send-btn .send-cd {
  position: absolute; right: -1px; bottom: 0; font-size: 9px; line-height: 1;
  font-weight: 700; color: var(--muted); pointer-events: none;
}
.verify-block { margin: 0 0 1.05rem; }
.verify-block .field { margin-bottom: .5rem; }
.verify-panel {
  display: flex; align-items: center; gap: .7rem; width: 100%; box-sizing: border-box;
  min-height: 52px; padding: .65rem .85rem; border-radius: 8px;
  border: 1px solid #2e4a38; background: #15211a;
  animation: verifyIn .28s ease;
}
.verify-panel-ico {
  flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ok); background: #1c3326;
}
.verify-panel-ico .ico { width: 20px; height: 20px; display: block; }
.verify-panel-body { min-width: 0; flex: 1; }
.verify-panel-value { font-size: 1.02rem; font-weight: 600; color: var(--text); word-break: break-word; }
.verify-panel-status { font-size: .82rem; color: var(--ok); margin-top: .12rem; }
@keyframes verifyIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
input:disabled, select:disabled, textarea:disabled { opacity: .55; cursor: not-allowed; color: var(--muted); }

/* Page d'attente de validation + actions S-Admin */
[data-page='pending-validation'] .kv { margin: 1rem 0 1.2rem; }
.refuse-form { margin-top: .85rem; padding-top: .75rem; border-top: 1px solid var(--line); }

/* Fiche tenue dépliée : icônes or devant les valeurs, sans libellés texte */
.tenue-facts { list-style: none; margin: .7rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .42rem; }
.tenue-facts .fact-row { display: flex; align-items: flex-start; gap: .55rem; margin: 0; }
.tenue-facts .field-ico {
  width: 18px; height: 18px; flex: 0 0 auto; margin-top: .2rem;
  color: var(--gold); display: block;
}
.tenue-facts .fact-val { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.tenue-facts .fact-val.pre { white-space: pre-wrap; }
.day-page h1, .cal-day-head h2 { text-transform: none; }

.stack { display: flex; flex-direction: column; gap: .5rem; margin: .8rem 0; }
.contacts-editor { margin: .4rem 0 0.8rem; }


/* ——— 0.1.31 : téléphone, tablette, bureau ——— */
button, a, .icon-btn, .cal-view-btn, .cal-filter-btn, .nav a { touch-action: manipulation; }

.cal-shell { container-type: inline-size; container-name: cal; min-width: 0; }
.cal-head { gap: .45rem; }
.cal-head .btn { min-width: var(--touch); justify-content: center; flex-shrink: 0; }
.cal-actions { flex-wrap: wrap; gap: .45rem .6rem; }
.cal-actions-end { flex-wrap: wrap; }

/* Tablette portrait : cartes plus aérées, nav haute assez large */
@media (min-width: 700px) and (max-width: 1023px) {
  .view { padding-left: 1.4rem; padding-right: 1.4rem; max-width: 1100px; }
  .card.narrow { max-width: 520px; }
  .topbar { padding-left: 1.2rem; padding-right: 1.2rem; }
}

/* Bureau large */
@media (min-width: 1280px) {
  .view { max-width: 1180px; }
  .view:has(.cal-layout) { max-width: 1360px; }
}

/* Téléphone paysage : chrome compact, calendrier plus bas */
@media (max-width: 899px) and (max-height: 500px) and (orientation: landscape) {
  :root { --nav-h: 48px; }
  .topbar { padding: .2rem .7rem; padding-top: max(.2rem, var(--safe-top)); }
  .brand span { font-size: .95rem; }
  .brand img { width: 24px; height: 24px; }
  .nav { padding-top: .1rem; padding-bottom: max(.1rem, var(--safe-bottom)); }
  .nav a { min-height: 44px; font-size: 0; gap: 0; padding: .2rem .25rem; }
  .nav a .ico { width: 22px; height: 22px; }
  .view { padding-top: .55rem; padding-bottom: calc(var(--nav-h) + .6rem + var(--safe-bottom)); }
  .cal-head h1 { font-size: 1.15rem; }
  .cal .day { min-height: 36px; }
  .hero { margin: .4rem 0 .8rem; }
  .hero img { width: 48px; height: 48px; }
  .card { padding: .75rem; }
}

/* Tableaux empilés sur écran étroit */
@media (max-width: 699px) {
  .table-wrap { border: 0; overflow: visible; }
  .table-wrap table, .table-wrap tbody { display: block; width: 100%; }
  .table-wrap thead { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
  .table-wrap tr { display: block; background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: .55rem .7rem; margin: 0 0 .55rem; }
  .table-wrap td { display: flex; justify-content: space-between; align-items: baseline; gap: .8rem; border: 0; padding: .28rem 0; }
  .table-wrap td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: .82rem; flex: 0 0 auto; }
  .table-wrap td:not([data-label]) { justify-content: flex-end; }
  .table-wrap tr:last-child td { border-bottom: 0; }
}

/* Barre d'actions collante dans les formulaires */
form .row.end, .form-actions {
  position: sticky;
  bottom: calc(var(--nav-h) + var(--safe-bottom));
  z-index: 6;
  margin-top: .8rem;
  padding: .55rem 0 .15rem;
  background: linear-gradient(180deg, transparent, var(--card) 28%);
  gap: .5rem;
  flex-wrap: wrap;
}
@media (min-width: 700px) {
  form .row.end, .form-actions { bottom: 0; }
}

/* Survol seulement quand un vrai pointeur est disponible ; le tactile a :active / :focus-visible */
@media (hover: none) {
  a:hover { text-decoration: none; }
  .btn:hover { filter: none; }
  .cal .day:hover, .cal-week-day:hover { filter: none; }
}
.cal .day:focus-visible, .cal-week-day:focus-visible, .icon-btn:focus-visible, .cal-view-btn:focus-visible, .cal-filter-btn:focus-visible, .presence-toggles button:focus-visible {
  outline: 2px solid var(--gold); outline-offset: 1px;
}

.cal-list { display: flex; flex-direction: column; gap: .85rem; }
.cal-list-day h2 { margin: 0 0 .45rem; font-size: 1.05rem; }
.cal-list-empty { margin: 0; }

img { max-width: 100%; height: auto; }
.brand img { height: 30px; width: 30px; }
.hero img { height: 64px; width: 64px; }

@container cal (max-width: 520px) {
  .cal .day { min-height: 48px; }
}

/* 0.1.31 suite : débordements constatés sur les captures */
@media (max-width: 699px) {
  .table-wrap td[data-label] {
    display: grid;
    grid-template-columns: 6.2rem minmax(0, 1fr);
    align-items: start;
    gap: .25rem .75rem;
  }
  .table-wrap td[data-label]::before { grid-column: 1; }
  .table-wrap td[data-label] > * { grid-column: 2; min-width: 0; }
  .table-wrap td { overflow-wrap: break-word; }
  .table-wrap td .badge { justify-self: start; width: max-content; }
}

/* Barre d'actions fixe seulement pour un formulaire page entière (pas Membres ni Profil) */
@media (max-width: 699px), (max-height: 500px) and (orientation: landscape) {
  .view > form.card:last-child:has(> .row.end),
  .view > form.card:last-child:has(> .form-actions) { padding-bottom: 4.6rem; }
  .view > form.card:last-child > .row.end,
  .view > form.card:last-child > .form-actions {
    position: fixed;
    left: 0; right: 0;
    bottom: calc(var(--nav-h) + var(--safe-bottom));
    margin: 0;
    padding: .55rem 1rem;
    background: rgba(25, 29, 38, .96);
    border-top: 1px solid var(--line);
    z-index: 15;
    justify-content: flex-end;
  }
}

/* Paysage large : la nav est déjà dans l'en-tête, ne pas réserver 48 px en bas */
@media (min-width: 700px) and (max-width: 899px) and (max-height: 500px) and (orientation: landscape) {
  :root { --nav-h: 0px; }
  .view { padding-bottom: 1.2rem; }
  .hero { margin: .2rem 0 .45rem; }
  .hero img { width: 40px; height: 40px; }
  .hero h1 { margin: .25rem 0 0; font-size: 1.25rem; }
  .cal .day { min-height: 32px; }
  .cal .ev-list { flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: center; gap: 3px; }
  .cal .ev { font-size: 0; height: 7px; width: 7px; border-radius: 50%; padding: 0; border: 0; background: var(--gold); flex: 0 0 auto; display: block; }
  .cal .ev .ev-title, .cal .ev .ev-degs { display: none; }
  .cal .ev.foreign { background: var(--silver); border: 0; }
}

/* Mois entier visible sur écran bas (tablette paysage, petit portable) */
@media (max-height: 850px) {
  .cal-shell .cal {
    max-height: calc(100dvh - 11.25rem);
    grid-auto-rows: minmax(40px, 1fr);
  }
  .cal-shell .cal .day { min-height: 0; }
}

@media (min-width: 800px) and (min-height: 520px), (min-width: 700px) and (orientation: landscape) {
  .tenue-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(240px, .9fr);
    gap: 1rem;
    align-items: start;
  }
  .tenue-layout > .notice { grid-column: 1 / -1; }
  .tenue-layout > [data-page] {
    position: sticky;
    top: calc(4rem + var(--safe-top));
  }
}

@media (prefers-reduced-motion: reduce) {
  .tenue-layout > [data-page] { position: static; }
}

/* Le mois occupe la hauteur restante (filtre ouvert, paysage bas) */
@media (max-height: 850px) {
  body:has(.cal-shell) {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    overflow: hidden;
  }
  body:has(.cal-shell) .topbar { flex: 0 0 auto; }
  body:has(.cal-shell) .view {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  .cal-shell, .cal-layout, .cal-main {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
  }
  .cal-layout { width: 100%; }
  .cal-shell { overflow: hidden; }
  body:has([data-cal-view="liste"]) .cal-shell { overflow: auto; }
  .cal-shell .cal {
    flex: 1 1 auto;
    max-height: none;
    min-height: 0;
    grid-auto-rows: minmax(28px, 1fr);
  }
  .cal-shell .cal .day { min-height: 0; }
  .cal-shell .legend { flex: 0 0 auto; margin-top: .35rem; }
}
@media (min-width: 1024px) and (max-height: 850px), (min-width: 900px) and (orientation: landscape) and (max-height: 850px) {
  .cal-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, .95fr);
    gap: 1.25rem;
    align-items: stretch;
  }
  .cal-side { flex: none; }
}

/* Formulaire création : zone commentaire plus courte sur écran bas */
@media (max-height: 820px) {
  form.card textarea[name=agenda] { min-height: 4.2rem; height: 4.2rem; max-height: 8rem; }
}

/* Filtre ouvert en paysage bas : défiler plutôt que d'écraser le mois */
@media (max-height: 500px) and (orientation: landscape) {
  body:has(#cal-lodge-filter) .cal-shell { overflow: auto; }
  body:has(#cal-lodge-filter) .cal-shell .cal {
    flex: 0 0 auto;
    min-height: 200px;
    grid-auto-rows: minmax(28px, 1fr);
  }
}

/* Vénérable Maître — fiche Loge (combobox + e-mail) */
.vm-block { margin: 0 0 1.15rem; padding: .85rem .9rem 1rem; border: 1px solid var(--line2); border-radius: var(--radius); background: #141820; }
form.card .vm-block { margin-top: .2rem; }
.vm-block-title { display: flex; align-items: center; gap: .45rem; margin: 0 0 .45rem; }
.vm-block-title .ico { width: 1.2rem; height: 1.2rem; color: var(--gold); flex: 0 0 auto; }
.vm-block > .muted { margin: 0 0 .7rem; }
.vm-combo { position: relative; }
.vm-combo-btn {
  width: 100%; min-height: var(--touch); font-size: 16px; line-height: 1.3;
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  text-align: left; color: var(--text); background: #11141a;
  border: 1px solid var(--line2); border-radius: 8px; padding: .62rem .7rem;
  font-family: inherit; cursor: pointer;
}
.vm-combo-btn .ico { width: 1.1rem; height: 1.1rem; color: var(--muted); flex: 0 0 auto; transition: transform .15s ease; }
.vm-combo-btn[aria-expanded="true"] .ico { transform: rotate(180deg); color: var(--gold); }
.vm-combo-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; border-color: var(--gold-dim); }
.vm-combo-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vm-combo-list {
  position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 4px);
  margin: 0; padding: .25rem 0; list-style: none;
  max-height: min(50vh, 16rem); overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: var(--bg2); border: 1px solid var(--gold-dim); border-radius: 8px;
  box-shadow: var(--shadow);
}
.vm-combo-option {
  display: flex; align-items: center; min-height: var(--touch); font-size: 16px; line-height: 1.3;
  padding: .5rem .75rem; cursor: pointer; color: var(--text);
}
.vm-combo-option.is-active, .vm-combo-option:hover { background: #1c1910; color: var(--gold2); }
.vm-combo-option.is-selected { color: var(--gold2); }
.vm-block input[name=vm_email] { font-size: 16px; min-height: var(--touch); }
.vm-badge { display: inline-flex; align-items: center; gap: .2rem; vertical-align: middle; }
.vm-badge .ico { width: .85rem; height: .85rem; }
form.card, .vm-block { overflow: visible; }
@media (max-width: 699px) {
  .vm-combo-list { max-height: min(60vh, 18rem); }
}
