/* Polices auto-hébergées (licence SIL OFL 1.1, voir fonts/) */
@font-face { font-family: 'Big Shoulders'; src: url('../fonts/big-shoulders-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Big Shoulders'; src: url('../fonts/big-shoulders-latin-800-normal.woff2') format('woff2'); font-weight: 800; font-style: normal; font-display: swap; }
@font-face { font-family: 'Atkinson Hyperlegible Next'; src: url('../fonts/atkinson-hyperlegible-next-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Atkinson Hyperlegible Next'; src: url('../fonts/atkinson-hyperlegible-next-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --ground: #1E3B33;
  --surface: #24463D;
  --line: #3B5B52;
  --nav: #183029;
  --chalk: #EEF0E6;
  --muted: #A3B2A9;
  --dim: #7F938A;
  --yellow: #F5D547;
  --blue: #8CC4F0;
  --on-yellow: #1E3B33;
  --lvl1: #2C4F45;
  --lvl2: #3F6B5C;
  --lvl3: #C8CF73;
  --display: 'Big Shoulders', 'Arial Narrow', sans-serif;
  --body: 'Atkinson Hyperlegible Next', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--chalk); font-family: var(--body); font-size: 16px; line-height: 1.45; -webkit-tap-highlight-color: transparent; }
body.has-sheet { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--chalk); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.m0 { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.is-yellow { color: var(--yellow); }
.is-blue { color: var(--blue); }
.stack-2, .stack-4, .stack-6, .stack-8, .stack-10, .stack-12 { display: flex; flex-direction: column; }
.stack-2 { gap: 2px; } .stack-4 { gap: 4px; } .stack-6 { gap: 6px; } .stack-8 { gap: 8px; } .stack-10 { gap: 10px; } .stack-12 { gap: 12px; }

/* ---------- Structure ---------- */
#app { max-width: 560px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; }
.screen { display: flex; flex-direction: column; gap: 24px; padding: calc(20px + env(safe-area-inset-top)) 20px calc(112px + env(safe-area-inset-bottom)); }
.loading { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 800; font-size: 40px; color: var(--muted); }

.screen-head { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.screen-head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; width: 100%; }
.screen-head-text { min-width: 0; }
.screen-kicker { margin: 0 0 4px; font-size: 15px; color: var(--muted); }
.screen-title { margin: 0; font-family: var(--display); font-weight: 800; font-size: 40px; line-height: 1; letter-spacing: .01em; }
.screen-title-md { font-size: 36px; line-height: 1.05; }
.screen-subtitle { margin: 4px 0 0; font-size: 15px; color: var(--muted); }
.back-link { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; margin-left: -6px; padding-right: 8px; font-size: 15px; text-decoration: none; }
.head-actions { display: flex; gap: 8px; flex: none; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex: none; border-radius: 50%; border: 1.5px solid var(--line); background: transparent; color: var(--chalk); text-decoration: none; cursor: pointer; }

.section { display: flex; flex-direction: column; gap: 12px; }
.section-title { margin: 0; font-family: var(--display); font-weight: 700; font-size: 24px; line-height: 1.1; }
.section-title-sm { font-size: 20px; }

.banner { display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 10px 14px; border-radius: 12px; border: 1.5px dashed var(--blue); font-size: 14px; color: var(--chalk); text-decoration: none; }
.banner .icon { flex: none; color: var(--blue); margin-top: 1px; }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 10px; border: 1.5px solid transparent; font-size: 16px; font-weight: 700; line-height: 1.2; text-align: center; text-decoration: none; cursor: pointer; }
.btn-primary { background: var(--yellow); color: var(--on-yellow); }
.btn-secondary { background: transparent; border-color: var(--chalk); color: var(--chalk); font-weight: 400; }
.btn-chalk { background: var(--chalk); color: var(--ground); }
.btn-ghost { background: transparent; color: var(--chalk); font-weight: 400; }
.btn-danger { background: transparent; border-color: var(--muted); color: var(--muted); font-weight: 400; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-row > .btn { flex: 1 1 0; }
.rsvp { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.rsvp .btn { padding: 0 6px; font-size: 15px; }
.rsvp-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.link-btn { padding: 0 2px; border: 0; background: none; color: var(--muted); font-size: 13px; text-decoration: underline; cursor: pointer; min-height: 32px; }
.link-more { align-self: flex-start; font-size: 15px; }
.tool-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 44px; border: 0; border-radius: 8px; background: transparent; color: var(--chalk); cursor: pointer; }
.tool-btn:disabled { color: var(--line); cursor: default; }

/* ---------- Panneaux et listes ---------- */
.panel { display: flex; flex-direction: column; gap: 12px; padding: 20px; border-radius: 14px; background: var(--surface); }
.panel-label { margin: 0; font-size: 14px; color: var(--muted); }
.panel-title { margin: 0; font-family: var(--display); font-weight: 800; font-size: 28px; line-height: 1.05; }

.rows { list-style: none; margin: 0; padding: 0; }
.row-link { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 10px 0; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--chalk); text-align: left; text-decoration: none; cursor: pointer; }
.row-link > .icon { flex: none; color: var(--muted); }
.row-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-title { font-weight: 700; }
.row-sub { font-size: 14px; color: var(--muted); }
.score { flex: none; min-width: 52px; font-family: var(--display); font-weight: 800; font-size: 40px; line-height: 1; color: var(--yellow); }

.session-row { display: grid; grid-template-columns: 88px minmax(0, 1fr) 20px; gap: 12px; align-items: center; min-height: 68px; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--chalk); text-decoration: none; }
.session-row > .icon { color: var(--muted); }
.session-when { display: flex; flex-direction: column; }
.session-day { font-size: 13px; color: var(--muted); }
.session-time { font-family: var(--display); font-weight: 800; font-size: 24px; line-height: 1.1; }

.empty { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 4px 0; }

/* ---------- Semaine et dispos ---------- */
.week-strip { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.week-strip li { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 0; border-radius: 10px; border: 1.5px solid transparent; }
.week-strip li.is-today { border-color: var(--yellow); }
.week-strip .wd { font-size: 12px; color: var(--muted); }
.week-strip .num { font-family: var(--display); font-weight: 800; font-size: 22px; line-height: 1; }
.week-strip .dot { width: 6px; height: 6px; border-radius: 50%; }
.week-strip .dot.on { background: var(--yellow); }

.heat { width: calc(100% + 8px); margin: 0 -4px; border-collapse: separate; border-spacing: 4px; table-layout: fixed; }
.heat th { font-size: 12px; font-weight: 400; color: var(--muted); }
.heat th[scope="row"] { width: 40px; text-align: left; white-space: nowrap; }
.heat td { height: 36px; border-radius: 8px; text-align: center; font-size: 14px; font-weight: 700; }
.heat .l0 { border: 1px solid var(--line); color: var(--muted); font-weight: 400; }
.heat .l1 { background: var(--lvl1); }
.heat .l2 { background: var(--lvl2); }
.heat .l3 { background: var(--lvl3); color: var(--on-yellow); }
.heat .l4 { background: var(--yellow); color: var(--on-yellow); }
.dispo-grid td, .heat-team td { height: auto; padding: 0; }
.dispo-cell { display: flex; align-items: center; justify-content: center; width: 100%; height: 40px; border-radius: 8px; border: 1.5px solid var(--line); background: transparent; color: var(--on-yellow); cursor: pointer; }
.dispo-cell.st-dispo { background: var(--yellow); border-color: var(--yellow); }
.dispo-cell.st-peut { background: var(--blue); border-color: var(--blue); }
.dispo-cell .q { font-weight: 800; font-size: 15px; }
.grid-head { width: 100%; min-height: 32px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--muted); font-size: 12px; cursor: pointer; }
.heat-cell { display: flex; align-items: baseline; justify-content: center; width: 100%; height: 34px; padding: 8px 0 0; border: 0; border-radius: 8px; background: transparent; color: inherit; font-size: 14px; font-weight: inherit; cursor: pointer; }
.heat-plus { margin-left: 1px; font-size: 10px; font-weight: 400; }
.brush { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.brush-btn { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 52px; padding: 4px 8px; border-radius: 10px; border: 1.5px solid var(--line); background: transparent; color: var(--chalk); font-size: 14px; line-height: 1.2; text-align: center; cursor: pointer; }
.brush-btn.is-active { border-color: var(--chalk); background: var(--surface); font-weight: 700; }
.swatch { flex: none; width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid var(--muted); }
.brush-dispo .swatch { background: var(--yellow); border-color: var(--yellow); }
.brush-peut .swatch { background: var(--blue); border-color: var(--blue); }
.day-tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.day-tile { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 100%; padding: 8px 0; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: var(--chalk); cursor: pointer; }
.day-tile .wd { font-size: 12px; }
.day-tile .num { font-family: var(--display); font-weight: 800; font-size: 20px; line-height: 1; }
.day-tile .cnt { font-size: 13px; font-weight: 700; }
.day-tile small { font-size: 10px; font-weight: 400; }
.day-tile.l1 { background: var(--lvl1); border-color: var(--lvl1); }
.day-tile.l2 { background: var(--lvl2); border-color: var(--lvl2); }
.day-tile.l3 { background: var(--lvl3); border-color: var(--lvl3); color: var(--on-yellow); }
.day-tile.l4 { background: var(--yellow); border-color: var(--yellow); color: var(--on-yellow); }
.day-detail { list-style: none; margin: 0; padding: 0; }
.day-detail li { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.day-hour { font-family: var(--display); font-weight: 700; font-size: 18px; }
.who-dispo strong { color: var(--yellow); }
.who-peut { color: var(--blue); }

/* ---------- Puces et étiquettes ---------- */
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips-scroll { display: flex; gap: 8px; overflow-x: auto; margin: 0 -20px; padding: 0 20px 2px; scrollbar-width: none; }
.chips-scroll::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: none; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line); background: transparent; color: var(--chalk); font-size: 14px; white-space: nowrap; text-decoration: none; cursor: pointer; }
.chip.is-active { background: var(--yellow); border-color: var(--yellow); color: var(--on-yellow); font-weight: 700; }
.role-chips { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.role-chips .chip { padding: 0 4px; }
.tag { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 2px 12px; border-radius: 999px; border: 1.5px solid var(--line); font-size: 14px; }
.tag-start { align-self: flex-start; }
.tag-ok { background: var(--yellow); border-color: var(--yellow); color: var(--on-yellow); font-weight: 700; }
.tag-info { border-color: var(--blue); color: var(--blue); font-weight: 700; }
.badge { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--yellow); color: var(--on-yellow); font-size: 12px; font-weight: 700; vertical-align: 1px; }

.pchip { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 0 12px; border-radius: 999px; border: 1.5px solid transparent; background: transparent; font-size: 14px; }
button.pchip { min-height: 40px; cursor: pointer; }
.pchip-sm { min-height: 28px; padding: 0 10px; font-size: 13px; }
.pchip-main { background: var(--yellow); border-color: var(--yellow); color: var(--on-yellow); font-weight: 700; }
.pchip-secondaire { border-color: var(--chalk); color: var(--chalk); }
.pchip-pocket { border-color: var(--blue); color: var(--blue); }
.pchip-travail { border-color: var(--muted); border-style: dashed; color: var(--muted); }
.pchip-add { border-color: var(--line); border-style: dashed; color: var(--muted); }
.pchip-role { font-size: 12px; font-weight: 400; }
.pools { display: flex; flex-direction: column; }
.pool-block { display: flex; flex-direction: column; gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.pool-head { display: flex; align-items: baseline; gap: 10px; }
.pool-role { margin: 0; font-family: var(--display); font-weight: 700; font-size: 22px; line-height: 1.1; }

.seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px; padding: 3px; border-radius: 12px; border: 1.5px solid var(--line); }
.seg a, .seg button { display: flex; align-items: center; justify-content: center; min-height: 42px; border: 0; border-radius: 9px; background: transparent; color: var(--chalk); font-size: 15px; text-decoration: none; cursor: pointer; }
.seg .is-active { background: var(--surface); color: var(--yellow); font-weight: 700; }

/* ---------- Tier list et champions ---------- */
.tier-row { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 12px; align-items: start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.tier-letter { display: flex; align-items: center; justify-content: center; width: 52px; height: 56px; border-radius: 8px; border: 1.5px solid; font-family: var(--display); font-weight: 800; font-size: 40px; line-height: 1; }
.tier-letter-sm { width: 40px; height: 40px; font-size: 26px; flex: none; }
.tier-S { background: var(--yellow); border-color: var(--yellow); color: var(--on-yellow); }
.tier-A { border-width: 2px; border-color: var(--yellow); color: var(--yellow); }
.tier-B { border-color: var(--chalk); color: var(--chalk); }
.tier-C { border-color: var(--muted); color: var(--muted); }
.tier-D { border-color: var(--dim); border-style: dashed; color: var(--dim); }
.tier-empty { align-self: center; font-size: 14px; color: var(--muted); }
.tier-choices { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.tier-choices .btn { padding: 0; font-family: var(--display); font-size: 24px; font-weight: 800; }

.tiles { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tile-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 64px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--chalk); cursor: pointer; }
.tile { position: relative; display: flex; align-items: center; justify-content: center; flex: none; width: 56px; height: 56px; overflow: hidden; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); }
.tile img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tile-sm { width: 40px; height: 40px; }
.tile-empty { border-style: dashed; color: var(--muted); }
.tile-abbr { font-family: var(--display); font-weight: 700; font-size: 20px; }
.tile-sm .tile-abbr { font-size: 15px; }
.tile-name { max-width: 64px; font-size: 12px; line-height: 1.2; text-align: center; overflow-wrap: anywhere; }
.tile-add { display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 8px; border: 1.5px dashed var(--muted); color: var(--muted); }

.callout { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: 12px; border: 1.5px dashed var(--blue); }
.callout-title { font-size: 14px; font-weight: 700; color: var(--blue); }
.callout .btn { align-self: flex-start; margin-top: 4px; }

/* ---------- Séance ---------- */
.result { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 16px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.small-label { font-size: 13px; color: var(--muted); }
.big-score { font-family: var(--display); font-weight: 800; font-size: 52px; line-height: 1; color: var(--yellow); }
.obj-status { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.obj-atteint { color: var(--yellow); }
.obj-partiel { color: var(--blue); }
.obj-non { color: var(--muted); }

.people { list-style: none; margin: 0; padding: 0; }
.person { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.avatar { display: flex; align-items: center; justify-content: center; flex: none; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); font-size: 14px; font-weight: 700; }
.person-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.person-role { font-size: 13px; color: var(--muted); }
.status { flex: none; font-size: 14px; color: var(--muted); }
.status-present { color: var(--yellow); font-weight: 700; }
.status-incertain { color: var(--blue); }

.debrief-title { margin: 0; font-size: 15px; font-weight: 700; }
.debrief-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.debrief-list li { display: flex; flex-direction: column; }
.debrief-meta { font-size: 13px; color: var(--muted); }
.inline-radios { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 0; padding: 0; border: 0; }
.inline-radios label { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }
.inline-radios input, .mvp-option input { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--yellow); }

.mvp-options { margin: 0; padding: 0; border: 0; min-width: 0; }
.mvp-options legend { margin-bottom: 8px; padding: 0; font-size: 14px; }
.mvp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.mvp-option { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 6px 10px; border-radius: 10px; border: 1.5px solid var(--line); cursor: pointer; }
.mvp-option:has(input:checked) { border-color: var(--yellow); }
.mvp-winner { display: flex; align-items: center; gap: 8px; margin: 0; font-family: var(--display); font-weight: 800; font-size: 26px; color: var(--yellow); }
.ranking { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.rank-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 8px; align-items: center; }
.rank-bar { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.rank-bar span { display: block; height: 100%; background: var(--yellow); }

/* ---------- Picks ---------- */
.ban-row { display: grid; grid-template-columns: 22px 40px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.ban-num { font-family: var(--display); font-weight: 800; font-size: 24px; color: var(--muted); }
.ban-tools { display: flex; }

/* ---------- Compos ---------- */
.minimap { position: relative; width: 100%; aspect-ratio: 1 / 1; margin: 0; overflow: hidden; border-radius: 12px; background: var(--surface); }
.minimap svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.marker { position: absolute; display: flex; flex-direction: column; align-items: center; gap: 2px; transform: translate(-50%, -23px); }
.marker-circle { display: flex; align-items: center; justify-content: center; width: 46px; height: 46px; overflow: hidden; border-radius: 50%; border: 2px solid var(--yellow); background: var(--ground); font-family: var(--display); font-weight: 800; font-size: 17px; }
.marker-circle img { width: 100%; height: 100%; object-fit: cover; }
.marker-circle .tile-abbr { font-size: 17px; }
.marker-empty { border-style: dashed; border-color: var(--muted); color: var(--muted); }
.marker-label { padding: 1px 6px; border-radius: 6px; background: var(--ground); font-size: 12px; line-height: 1.25; white-space: nowrap; }
.details { margin: 0; display: flex; flex-direction: column; gap: 12px; }
.details dt { font-size: 13px; color: var(--muted); }
.details dd { margin: 2px 0 0; white-space: pre-line; }
.slots { margin: 0; padding: 0; border: 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.field-legend { padding: 0; margin-bottom: 6px; font-size: 14px; color: var(--muted); }
.slot-list { list-style: none; margin: 0; padding: 0; }
.slot { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 8px; align-items: center; min-height: 56px; border-bottom: 1px solid var(--line); }
.slot-role { font-size: 14px; color: var(--muted); }
.slot-btn { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 0; border: 0; background: none; color: var(--chalk); text-align: left; cursor: pointer; }
.slot-status { display: flex; align-items: center; gap: 6px; }

/* ---------- Formulaires ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 14px; color: var(--muted); }
.field input, .field select, .field textarea { width: 100%; min-height: 48px; padding: 10px 12px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); color: var(--chalk); font-size: 16px; }
.field textarea { resize: vertical; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
details.more { padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--line); }
details.more summary { display: flex; align-items: center; min-height: 48px; font-weight: 700; cursor: pointer; }
details.more[open] { padding-bottom: 14px; }

/* ---------- Fenêtre du bas et sélecteur ---------- */
#sheet-root[hidden] { display: none; }
.sheet-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(8, 20, 16, .65); }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-width: 560px; max-height: 85vh; max-height: 85dvh; margin: 0 auto; padding: 8px 20px calc(24px + env(safe-area-inset-bottom)); overflow-y: auto; overscroll-behavior: contain; border-radius: 18px 18px 0 0; border-top: 1.5px solid var(--line); background: var(--ground); }
.sheet-grip { width: 40px; height: 4px; margin: 4px auto 12px; border-radius: 2px; background: var(--line); }
.sheet-body { display: flex; flex-direction: column; gap: 14px; }
.sheet-title { margin: 0; font-family: var(--display); font-weight: 800; font-size: 26px; line-height: 1.1; }
.sheet-champ { display: flex; align-items: center; gap: 12px; }
.search-field { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 12px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); color: var(--muted); }
.search-field input { flex: 1; min-width: 0; min-height: 44px; border: 0; outline: none; background: transparent; color: var(--chalk); font-size: 16px; }
.search-field:focus-within { outline: 2px solid var(--blue); outline-offset: 2px; }
.picker-group { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.picker-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)); gap: 10px 6px; }
.picker-item { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; padding: 4px 0; border: 0; border-radius: 10px; background: none; color: var(--chalk); cursor: pointer; }
.picker-item.is-highlight .tile { border: 2px solid var(--yellow); }

/* ---------- Barre d’onglets et messages ---------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); max-width: 560px; margin: 0 auto; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--nav); }
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 52px; color: var(--muted); font-size: 12px; text-decoration: none; }
.tab.is-active { color: var(--yellow); font-weight: 700; }
#toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 60; max-width: calc(100% - 40px); padding: 12px 16px; border-radius: 12px; background: var(--chalk); color: var(--ground); font-size: 15px; font-weight: 700; opacity: 0; pointer-events: none; transform: translate(-50%, 16px); transition: opacity .2s, transform .2s; }
#toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Entrée ---------- */
.auth { display: flex; flex-direction: column; gap: 24px; max-width: 480px; margin: 0 auto; padding: calc(40px + env(safe-area-inset-top)) 20px calc(40px + env(safe-area-inset-bottom)); }
.brand { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.brand-tag { display: inline-flex; align-items: center; justify-content: center; width: 72px; height: 72px; border-radius: 16px; background: var(--yellow); color: var(--on-yellow); font-family: var(--display); font-weight: 800; font-size: 30px; }
.brand h1 { margin: 8px 0 0; font-family: var(--display); font-weight: 800; font-size: 48px; line-height: 1; }
.legal { margin: 0; font-size: 12px; line-height: 1.5; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  #toast { transition: none; }
}
