/* Pickleball Longueuil — player app.
   Muted club blue (structure, primary actions) with soft yellow and orange as small accents, white cards on warm off-white.
   Colours sampled from the club logo: blue #0552A3, orange #FE7A10, yellow #FED003. Atkinson Hyperlegible (designed for low-vision readers) for text,
   Bricolage Grotesque for headings. Base 18px, touch targets 56px+.
   Status colours app-wide: green = present / playing / open spot, red family = absent (incl. replaced), yellow = "go play". */
:root {
  /* club blue: header accents, primary actions, links, focus (white on --brand 5.9:1) */
  --brand: #3e6794;
  --brand-deep: #30527a;
  --brand-soft: #e6edf5;
  /* club yellow (always with dark ink text) and club orange (accent only; orange text uses --accent-ink) */
  --sun: #f1d67e;
  --sun-deep: #e6c55a;
  --sun-edge: #9c7f22;
  --accent: #fe7a10;
  --accent-ink: #b8520a;
  --paper: #faf8f4;
  --card: #ffffff;
  --ink: #0f1e33;
  --muted: #4b5a70;
  --line: #d6d2c6;
  --control-line: #7f8fa8;
  /* green: --open is a fill (bullets, borders, pills with ink text: 5.7:1); white or small text on it fails AA,
     so green text uses --open-ink (6.5:1 on white, 5.5:1 on --open-soft) */
  --open: #39aa75;
  --open-ink: #146c42;
  --open-soft: #dff2e7;
  --open-pill: #36a370; /* --open darkened just enough for white large text (3.17:1); the Play tab spot pills only */
  /* absent (and replaced): muted red family; danger keeps a stronger red plus an icon */
  --absent: #9b3328;
  --absent-soft: #fae1da;
  /* Absence tab (Martin's softer palette): big status card and selected chip, and the two action buttons.
     Button text is 24px bold in the tab (19px bold in sheets), both large text: white on --go 3.7:1, on --stop 4.3:1. */
  --present-card: #e9f3ed;
  --present-card-line: #97c0ad;
  --absent-card: #feefeb;
  --absent-card-line: #edd0ca;
  --go: #559175;
  --go-deep: #477d64;
  --stop: #a96861;
  --stop-deep: #94574f;
  --danger: #b42318;
  --danger-soft: #fde8e6;
  --grey: #5a6678;
  --grey-soft: #e8e5dc;
  --on-brand-sub: #e3ebf4;
  --radius-lg: 22px;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 0 rgba(15, 30, 51, .06), 0 6px 18px -10px rgba(15, 30, 51, .25);
  --font: 'Atkinson Hyperlegible', 'Segoe UI', system-ui, sans-serif;
  --font-display: 'Bricolage Grotesque', 'Atkinson Hyperlegible', system-ui, sans-serif;
  --nav-h: 72px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 18px/1.5 var(--font); min-height: 100vh;
}
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; margin: 0; letter-spacing: -.01em; }
h1 { font-size: 30px; font-weight: 800; }
h2 { font-size: 23px; font-weight: 700; }
h3 { font-size: 19px; font-weight: 700; }
p { margin: 0; }
a { color: var(--brand); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; box-shadow: 0 0 0 6px var(--brand-soft); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { display: inline-flex; flex: none; }
.icon svg { display: block; }
.muted { color: var(--muted); }
.stack > * + * { margin-top: 12px; }

/* ---------------------------------------------------------------- shell */
.topbar {
  position: sticky; top: 0; z-index: 20; background: var(--card); color: var(--ink);
  border-bottom: 4px solid var(--accent);
}
.topbar-in { max-width: 600px; margin: 0 auto; display: flex; align-items: center; gap: 12px; padding: 10px 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; margin-right: auto; }
.brand-logo { display: block; width: 123px; height: 38px; }
/* App title next to the logo ("Présences" / "Attendance"); the logo already says Pickleball Longueuil. */
.brand-title { font-family: var(--font-display); font-weight: 800; font-size: 21px; line-height: 1; color: var(--brand); white-space: nowrap; letter-spacing: -.01em; }
.brand-logo + .brand-title { border-left: 2px solid var(--line); padding: 6px 0 6px 12px; }
@media (max-width: 400px) {
  .topbar-in { gap: 8px; padding: 8px 12px; }
  .brand { gap: 8px; }
  .brand-logo { width: 100px; height: 31px; }
  .brand-title { font-size: 18px; }
  .brand-logo + .brand-title { padding-left: 8px; }
  .topbar .icon-btn { min-width: 48px; height: 48px; }
}
.login-logo { display: block; width: 300px; max-width: 80%; height: auto; aspect-ratio: 720 / 223; margin: 8px auto 20px; }
.icon-btn {
  position: relative; min-width: 52px; height: 52px; border-radius: 14px; border: 0; background: var(--brand-soft); color: var(--brand);
  display: inline-grid; place-items: center; padding: 0 10px; font-weight: 700;
}
.icon-btn:hover { background: #d5e0ec; }
.badge-count {
  position: absolute; top: 4px; right: 3px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
  background: var(--accent); color: var(--ink); font-size: 14px; font-weight: 700; line-height: 22px; text-align: center;
}
.demo-pill {
  display: flex; justify-content: center; padding: 6px 16px; background: var(--sun); color: var(--ink);
  font-size: 15px; font-weight: 700; text-align: center;
}
main { max-width: 600px; margin: 0 auto; padding: 20px 16px calc(var(--nav-h) + 40px); }
.bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; background: var(--card); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottomnav-in { max-width: 600px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); }
.bottomnav a {
  height: var(--nav-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  text-decoration: none; color: var(--muted); font-size: 15px; font-weight: 700; border-top: 4px solid transparent;
}
.bottomnav a[aria-current="page"] { color: var(--brand); border-top-color: var(--accent); background: var(--brand-soft); }

.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.page-head h1 { flex: 1; }
.back-btn {
  height: 52px; min-width: 52px; border-radius: 14px; border: 2px solid var(--line); background: var(--card);
  display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 0 12px 0 8px; font-weight: 700;
}
.intro { color: var(--muted); margin-bottom: 18px; max-width: 60ch; }

/* ---------------------------------------------------------------- buttons */
.btn {
  min-height: 58px; padding: 12px 22px; border-radius: var(--radius); border: 2px solid transparent;
  font-weight: 700; font-size: 19px; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  text-decoration: none; width: 100%; text-align: center; transition: transform .08s ease;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-deep); }
.btn-ball { background: var(--sun); color: var(--ink); border-color: var(--sun-edge); }
.btn-ball:hover { background: var(--sun-deep); }
.btn-ghost { background: var(--card); color: var(--brand); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--brand); }
.btn-danger { background: var(--card); color: var(--danger); border-color: #eab3ad; }
.btn-link { background: none; border: 0; color: var(--brand); text-decoration: underline; font-weight: 700; min-height: 52px; padding: 8px 4px; width: auto; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-row { display: grid; gap: 10px; }
@media (min-width: 480px) { .btn-row.two { grid-template-columns: 1fr 1fr; } }

/* ---------------------------------------------------------------- home: the two court buttons */
.hello { font-size: 32px; margin: 4px 0 18px; }
.court-btns { display: grid; gap: 14px; margin-bottom: 30px; }
.court-btn {
  position: relative; display: flex; align-items: center; gap: 14px; min-height: 136px; padding: 22px 16px 22px 18px;
  border-radius: var(--radius-lg); border: 0; text-align: left; text-decoration: none; overflow: hidden; isolation: isolate;
  box-shadow: var(--shadow);
}
/* subtle inner outline (no court lines: they competed with the titles) */
.court-btn::before {
  content: ''; position: absolute; inset: 10px; border: 2px solid var(--lines); border-radius: 12px; z-index: -1;
}
.court-btn .cb-icon { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.court-btn .cb-title { display: block; font-family: var(--font-display); font-weight: 800; font-size: 28px; line-height: 1.1; text-wrap: balance; }
.court-btn .cb-sub { display: block; font-size: 17px; margin-top: 6px; font-weight: 700; }
.court-btn.absent { --lines: rgba(255, 255, 255, .28); background: var(--brand); color: #fff; }
.court-btn.absent .cb-icon { background: rgba(255, 255, 255, .12); color: #fff; }
.court-btn.absent .cb-sub { color: var(--on-brand-sub); }
.court-btn.play { --lines: rgba(15, 30, 51, .22); background: var(--sun); color: var(--ink); }
.court-btn.play .cb-icon { background: var(--brand); color: var(--sun); }
.court-btn:hover { filter: brightness(1.04); }
.court-btn .cb-go { margin-left: auto; margin-right: -4px; opacity: .8; flex: none; display: flex; }
/* narrow phones: tighter gaps so the 28px titles keep as much width as possible */
@media (max-width: 400px) { .court-btn { gap: 10px; padding-left: 16px; padding-right: 12px; } }

.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 26px 0 12px; }
.list { display: grid; gap: 10px; }
.row {
  display: flex; align-items: center; gap: 14px; background: var(--card); border-radius: var(--radius); padding: 14px 16px;
  min-height: 72px; border: 1px solid var(--line); text-decoration: none; color: inherit; width: 100%; text-align: left;
}
button.row:hover, a.row:hover { border-color: var(--brand); }
/* Big date square (home "Mes prochaines séances"): weekday + day number fill a 90×90 tile.
   Grey #949494 with white text (3.03:1, passes 3:1 for large text): both lines stay bold and >= 20px. */
.row .when {
  flex: none; width: 90px; height: 90px; border-radius: var(--radius); background: #949494; color: #ffffff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; line-height: 1;
}
.row .when span { font-size: 20px; font-weight: 700; }
.row .when b { display: block; font-size: 44px; font-family: var(--font-display); font-weight: 800; line-height: .95; margin-top: 2px; }
.row:has(.when) { padding: 10px 14px 10px 10px; gap: 12px; }
.row .what { flex: 1; min-width: 0; }
.row .what strong { display: block; font-size: 18px; }
.row .what small { display: block; color: var(--muted); font-size: 16px; }
.row.is-cancelled { background: repeating-linear-gradient(-45deg, #f6f4ef 0 10px, #ebe8e0 10px 20px); color: var(--grey); }

.status { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 700; padding: 3px 10px; border-radius: 12px; margin-top: 4px; }
.status.present { background: var(--open-soft); color: var(--open-ink); }
.status.absent { background: var(--absent-soft); color: var(--absent); }
.status.replaced { background: var(--absent-soft); color: var(--absent); }
.status.cancelled { background: var(--grey-soft); color: var(--grey); }
.status.claim { background: var(--open-soft); color: var(--open-ink); }

/* ---------------------------------------------------------------- availability badges */
.spots {
  flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 96px; min-height: 44px;
  padding: 6px 12px; border-radius: 12px; font-weight: 700; font-size: 18px; white-space: nowrap;
}
/* "1 place" pill: white text, so large (19px bold) on a green a shade darker than --open: 3.17:1 (large-text AA) */
.spots.open { background: var(--open-pill); color: #fff; font-size: 19px; font-weight: 700; }
.spots.full { background: var(--grey-soft); color: var(--grey); }
.spots.cancelled { background: repeating-linear-gradient(-45deg, #e6e2d9 0 6px, #f5f3ee 6px 12px); color: var(--grey); text-decoration: line-through; }
.spots.mine { background: var(--brand-soft); color: var(--brand); }
.spots.claimed { background: var(--open-soft); color: var(--open-ink); border: 2px solid var(--open); }
.level { display: inline-block; font-size: 14px; font-weight: 700; padding: 2px 8px; border-radius: 6px; border: 1.5px solid currentColor; color: var(--brand); white-space: nowrap; }
.level.avance, .level.avance35 { color: #7a2e8c; }
.level.intermediaire { color: #0b6b70; }

/* tabs + filters */
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--grey-soft); border-radius: 16px; padding: 5px; margin-bottom: 10px; }
.tabs button { min-height: 56px; border: 0; border-radius: 12px; background: none; font-weight: 700; font-size: 18px; color: var(--muted); line-height: 1.15; padding: 6px 8px; }
.tabs button[aria-selected="true"] { background: var(--card); color: var(--brand); box-shadow: var(--shadow); }
/* "Filtres (n)": one toggle; the filter chips stay hidden until it is opened. */
.filter-bar { display: flex; justify-content: flex-end; margin-bottom: 10px; }
.filter-toggle {
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 6px 16px; border-radius: 999px;
  border: 2px solid var(--control-line); background: var(--card); color: var(--ink); font-weight: 700; font-size: 16px;
}
.filter-toggle.has-active { border-color: var(--brand); color: var(--brand); }
.filter-toggle .chev { transition: transform .15s; }
.filter-toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.filters[hidden] { display: none; }
.chip {
  min-height: 48px; padding: 8px 16px; border-radius: 999px; border: 2px solid var(--line); background: var(--card);
  font-weight: 700; font-size: 16px; color: var(--ink);
}
.chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip-group { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.select {
  min-height: 48px; padding: 8px 40px 8px 14px; border-radius: 999px; border: 2px solid var(--control-line); background: var(--card);
  font-weight: 700; font-size: 16px; appearance: none; max-width: 100%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%230f1e33' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.day-group + .day-group { margin-top: 22px; }
.day-head { font-size: 19px; margin: 0 0 10px; display: flex; gap: 8px; align-items: baseline; }
.day-head small { font-family: var(--font); font-weight: 400; color: var(--muted); font-size: 16px; }
.open-row .time { font-family: var(--font-display); font-weight: 800; font-size: 21px; display: block; }
.open-row .where { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; color: var(--muted); font-size: 16px; margin-top: 2px; }

/* all slots view */
.weekday-block + .weekday-block { margin-top: 26px; }
/* Slot card: a blue header bar (time, venue, level, notes, bell) and a 2px outline of the same blue. */
.slot-card { background: var(--card); border: 2px solid var(--brand); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); }
.slot-card + .slot-card { margin-top: 14px; }
.slot-head { display: flex; gap: 10px; align-items: flex-start; background: var(--brand); color: #fff; padding: 12px 12px 12px 14px; }
.slot-head .t { flex: 1; min-width: 0; }
.slot-head .t strong { font-family: var(--font-display); font-size: 21px; display: block; }
.slot-head .t span { color: #fff; font-size: 16px; display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; margin-top: 4px; }
.slot-head .level { color: #fff; border-color: #fff; }
.slot-head .note { display: inline-flex; align-items: center; gap: 4px; font-size: 15px; font-weight: 700; padding: 2px 10px; border-radius: 999px; }
.slot-head .note.mine { background: #fff; color: var(--brand); }
.slot-head .note.alert { background: var(--sun); color: var(--ink); }
.slot-head :focus-visible { outline: 3px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 8px var(--ink); }
.slot-body { padding: 12px; }
.bell-btn {
  flex: none; width: 56px; height: 56px; border-radius: 14px; border: 2px solid #fff; background: #fff; color: var(--brand);
  display: grid; place-items: center;
}
.bell-btn:hover { background: var(--brand-soft); }
.bell-btn[aria-pressed="true"] { background: var(--sun); border-color: #fff; color: var(--ink); }
/* Three dates across. Open = yellow and raised (tap me), full = flat grey, cancelled = hatched, mine = blue tint, playing = green. */
.strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.seance {
  position: relative; border: 2px solid var(--line); border-radius: 12px; background: var(--card); padding: 10px 2px; min-height: 84px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; line-height: 1.15;
  color: var(--ink); text-decoration: none;
}
.seance .d { font-weight: 700; font-size: clamp(15px, 4.4vw, 18px); white-space: nowrap; letter-spacing: -.01em; }
.seance .b { font-size: 15px; font-weight: 700; padding: 2px 8px; border-radius: 8px; }
.seance.open { background: var(--sun); border-color: var(--sun-edge); box-shadow: 0 3px 0 var(--sun-edge), 0 6px 12px -6px rgba(15, 30, 51, .45); }
.seance.open:hover { background: var(--sun-deep); }
.seance.open:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--sun-edge); }
.seance.open .b { background: #fff; color: var(--open-ink); }
.seance.full { background: #eeece6; border-color: transparent; color: var(--grey); }
.seance.full .d { font-weight: 400; }
.seance.full .b { color: var(--grey); padding: 0; }
.seance.cancelled { background: repeating-linear-gradient(-45deg, #f6f4ef 0 8px, #e8e5dc 8px 16px); border-color: transparent; color: var(--grey); }
.seance.cancelled .b { text-decoration: line-through; padding: 0; }
.seance.mine { background: var(--brand-soft); border-color: transparent; }
.seance.mine .b { color: var(--brand); padding: 0; }
.seance.claimed { border-color: var(--open); background: var(--open-soft); }
.seance.claimed .b { background: var(--open); color: var(--ink); }
.seance .alert-dot { position: absolute; top: 4px; right: 4px; color: var(--ink); }
.more-btn { margin-top: 6px; display: inline-flex; align-items: center; gap: 8px; }
.more-count {
  display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 8px; border-radius: 999px;
  background: var(--sun); color: var(--ink); border: 2px solid var(--sun-edge); font-size: 16px; text-decoration: none;
}

/* empty state */
.empty { text-align: center; background: var(--card); border: 2px dashed var(--line); border-radius: var(--radius-lg); padding: 28px 18px; }
.empty .icon { color: var(--brand); margin-bottom: 8px; }
.empty h2 { margin-bottom: 8px; }
.empty p { color: var(--muted); margin-bottom: 18px; }

/* ---------------------------------------------------------------- absent flow */
.my-slot { background: var(--card); border-radius: var(--radius-lg); border: 1px solid var(--line); padding: 16px; box-shadow: var(--shadow); }
.my-slot + .my-slot { margin-top: 16px; }
.my-slot h2 { font-size: 21px; }
.my-slot .sub { color: var(--muted); font-size: 16px; margin: 2px 0 14px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
/* Absence tab: green and red only. The selected date's card and chip share one soft background:
   green when present, salmon when absent or replaced. */
.absent-page .level { color: var(--muted); }
.absent-page :focus-visible { outline-color: var(--ink); box-shadow: 0 0 0 6px #fff; }
.abs-card { border-radius: var(--radius); padding: 16px; margin-bottom: 12px; border: 2px solid transparent; }
.abs-card.is-present { background: var(--present-card); border-color: var(--present-card-line); }
.abs-card.is-absent, .abs-card.is-replaced { background: var(--absent-card); border-color: var(--absent-card-line); }
.abs-card.is-cancelled { background: repeating-linear-gradient(-45deg, #f6f4ef 0 10px, #ebe8e0 10px 20px); border-color: var(--line); color: var(--grey); }
.abs-card .lbl { font-size: 16px; font-weight: 700; color: var(--muted); }
.abs-card .dt { font-family: var(--font-display); font-weight: 800; font-size: 26px; line-height: 1.15; margin: 2px 0 2px; text-wrap: balance; }
/* "Ma présence : [status]" — the key line of the card, always one row (short badge); the detail
   (place offerte, remplacé(e) par…, reprise, raison d'annulation) sits on its own line below */
.abs-card .state { display: flex; align-items: center; gap: 10px; margin: 10px 0 14px; }
.abs-card .state.has-detail { margin-bottom: 4px; }
.abs-card .state-lbl { font-size: 19px; font-weight: 700; color: #5d5d5d; white-space: nowrap; }
.abs-card .state .status { font-size: 19px; font-weight: 700; line-height: 1.25; padding: 6px 14px; margin: 0; border-radius: 14px; white-space: nowrap; }
.abs-card .state-detail { font-size: 16px; font-weight: 600; line-height: 1.35; color: #5d5d5d; margin: 0 0 14px; }
.abs-card.is-present .status.present, .abs-card.is-absent .status, .abs-card.is-replaced .status { background: #fff; }
.abs-card .btn { min-height: 64px; font-size: 24px; white-space: nowrap; }
.btn-absent { background: var(--stop); color: #fff; }
.btn-absent:hover { background: var(--stop-deep); }
.btn-back { background: var(--go); color: #fff; }
.btn-back:hover { background: var(--go-deep); }
.date-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
/* paging through the season under the chips: neutral ink/grey, never blue on this tab */
.pager { margin-top: 12px; }
.pager-range { text-align: center; font-size: 17px; font-weight: 700; color: #5d5d5d; margin-bottom: 8px; }
.pager-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pager-btn { min-height: 52px; padding: 8px 10px; font-size: 18px; gap: 8px; background: var(--card); color: var(--ink); border-color: var(--line); white-space: nowrap; }
.pager-btn span[aria-hidden] { font-size: 26px; line-height: 1; margin-top: -3px; }
.pager-btn:hover { border-color: var(--ink); }
.pager-btn[aria-disabled="true"] { color: #8a8a8a; background: transparent; border-style: dashed; cursor: default; }
.pager-btn[aria-disabled="true"]:hover { border-color: var(--line); }
.pager-btn[aria-disabled="true"]:active { transform: none; }
.date-card {
  position: relative;
  border: 2px solid var(--line); border-radius: var(--radius); background: var(--card); padding: 10px 12px; min-height: 84px; text-align: left;
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 4px; color: var(--ink);
}
.date-card .d { font-weight: 700; font-size: clamp(16px, 4.7vw, 18px); white-space: nowrap; }
.date-card .status { margin-top: 0; }
.date-card.is-cancelled { background: repeating-linear-gradient(-45deg, #f6f4ef 0 10px, #ebe8e0 10px 20px); color: var(--grey); }
/* selected chip: same colours as the card above, thicker border, and a check badge on its corner
   (outside the text, so the date stays on one line at 360px) */
.date-card[aria-pressed="true"] { border-width: 3px; padding: 9px 11px; }
.date-card[aria-pressed="true"].is-present { background: var(--present-card); border-color: var(--present-card-line); }
.date-card[aria-pressed="true"].is-absent, .date-card[aria-pressed="true"].is-replaced { background: var(--absent-card); border-color: var(--absent-card-line); }
.date-card[aria-pressed="true"].is-cancelled { border-color: var(--grey); }
.date-card[aria-pressed="true"] .status { background: #fff; }
.date-card[aria-pressed="true"]::after {
  content: '✓'; position: absolute; top: -9px; right: -9px; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; font-size: 15px; font-weight: 700; line-height: 1; color: #fff; background: var(--grey);
  box-shadow: 0 0 0 2px var(--card);
}
.date-card[aria-pressed="true"].is-present::after { background: var(--go); }
.date-card[aria-pressed="true"].is-absent::after, .date-card[aria-pressed="true"].is-replaced::after { background: var(--stop); }
/* narrow phones: tighter card padding so the 24px button labels and chip dates fit on one line */
@media (max-width: 400px) {
  .absent-page .my-slot { padding: 14px 8px; }
  .absent-page .abs-card { padding: 14px 8px; }
  .abs-card .btn { padding: 10px 8px; gap: 5px; letter-spacing: -.01em; }
  .abs-card .btn .icon svg { width: 20px; height: 20px; }
  .date-card { padding: 10px 9px; }
  .date-card[aria-pressed="true"] { padding: 9px 8px; }
}
@media (max-width: 350px) { .abs-card .btn .icon { display: none; } }

/* success screen */
.success { text-align: center; padding: 26px 8px 8px; }
.success .big-check {
  width: 104px; height: 104px; border-radius: 50%; margin: 0 auto 18px; display: grid; place-items: center;
  background: var(--sun); color: var(--ink); animation: pop .35s cubic-bezier(.2, 1.4, .4, 1) both;
}
.success h1 { font-size: 34px; margin-bottom: 10px; }
.success p { font-size: 20px; max-width: 30ch; margin: 0 auto 6px; }
.success .btn-row { margin-top: 26px; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------------------------------------------------------------- sheet + toast */
.backdrop { position: fixed; inset: 0; background: rgba(15, 30, 51, .55); z-index: 40; animation: fade .18s ease both; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-width: 600px; margin: 0 auto; background: var(--card);
  border-radius: 26px 26px 0 0; padding: 10px 20px calc(24px + env(safe-area-inset-bottom)); max-height: 92vh; overflow: auto;
  animation: up .24s cubic-bezier(.2, .9, .3, 1) both; box-shadow: 0 -10px 40px rgba(15, 30, 51, .3);
}
.sheet .grab { width: 48px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 10px; }
.sheet-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.sheet-head h2 { flex: 1; font-size: 26px; padding-top: 6px; }
.sheet-close { width: 52px; height: 52px; border-radius: 14px; border: 2px solid var(--line); background: var(--card); display: grid; place-items: center; flex: none; }
.sheet .facts { background: var(--paper); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 18px; display: grid; gap: 8px; }
.sheet .facts div { display: flex; gap: 10px; align-items: center; }
.sheet .facts .icon { color: var(--brand); }
/* neutral sheet (absence flow): no club blue, ink icons and a neutral "Annuler" */
.sheet.neutral .facts .icon { color: var(--ink); }
.sheet.neutral .btn-ghost { color: var(--ink); }
.sheet.neutral .btn-ghost:hover { border-color: var(--ink); }
.sheet.neutral :focus-visible { outline-color: var(--ink); box-shadow: 0 0 0 6px #fff; }
.sheet .divider { border: 0; border-top: 1px solid var(--line); margin: 20px 0 14px; }
.sheet .alert-choices { display: grid; gap: 10px; }
.sheet .note { color: var(--muted); font-size: 16px; margin-top: 10px; }
.big-spots { display: inline-flex; align-items: center; gap: 8px; background: var(--open); color: var(--ink); border-radius: 12px; padding: 4px 12px; font-weight: 700; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } }
.toast-wrap { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + 14px); z-index: 60; display: flex; justify-content: center; pointer-events: none; padding: 0 16px; }
/* club orange with dark ink (6.4:1); errors stay red with white text (6.6:1) */
.toast {
  pointer-events: auto; max-width: 560px; width: 100%; background: var(--accent); color: var(--ink); border-radius: 16px; padding: 14px 16px;
  display: flex; align-items: center; gap: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); animation: up .2s ease both; font-weight: 700;
}
.toast .icon { color: var(--ink); }
.toast.error { background: var(--danger); color: #fff; }
.toast.error .icon { color: #fff; }
.toast span.msg { flex: 1; }
.toast button { min-height: 44px; border-radius: 10px; border: 2px solid var(--ink); background: none; color: var(--ink); padding: 0 14px; font-weight: 700; }
.toast.error button { border-color: rgba(255, 255, 255, .6); color: #fff; }

/* ---------------------------------------------------------------- forms */
.card { background: var(--card); border-radius: var(--radius-lg); border: 1px solid var(--line); padding: 18px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.card h2 { margin-bottom: 12px; font-size: 21px; }
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label { font-weight: 700; }
.field small { color: var(--muted); font-size: 16px; }
.input {
  min-height: 58px; padding: 12px 16px; border-radius: var(--radius); border: 2px solid var(--control-line); background: #fff; font-size: 20px; width: 100%;
}
.input:focus { border-color: var(--brand); }
.input.code { font-size: 34px; letter-spacing: .35em; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
/* Errors: stronger red than the "absent" status, a left bar and a "!" badge so they never read as a status. */
.form-error {
  color: var(--danger); background: var(--danger-soft); border-left: 5px solid var(--danger); border-radius: var(--radius-sm);
  padding: 10px 14px; font-weight: 700; margin-bottom: 14px; display: flex; gap: 10px; align-items: flex-start;
}
.form-error[hidden] { display: none; }
.form-error::before {
  content: '!'; flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--danger); color: #fff;
  display: grid; place-items: center; font-size: 16px; line-height: 1; margin-top: 1px;
}
.switch-row { display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 6px 0; border-top: 1px solid var(--line); }
.switch-row:first-of-type { border-top: 0; }
.switch-row .txt { flex: 1; }
.switch-row .txt small { display: block; color: var(--muted); font-size: 16px; }
.switch { position: relative; width: 68px; height: 40px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch .track { position: absolute; inset: 0; border-radius: 20px; background: #7b8aa3; transition: background .15s; }
.switch .track::after { content: ''; position: absolute; top: 4px; left: 4px; width: 32px; height: 32px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.switch input:checked + .track { background: var(--open-ink); }
.switch input:checked + .track::after { transform: translateX(28px); }
.switch input:focus-visible + .track { outline: 3px solid var(--brand); outline-offset: 2px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg button { min-height: 54px; border-radius: var(--radius); border: 2px solid var(--control-line); background: var(--card); font-weight: 700; }
.seg button[aria-pressed="true"] { border-color: var(--brand); background: var(--brand); color: #fff; }

/* ---------------------------------------------------------------- login */
.login-wrap { max-width: 480px; margin: 0 auto; padding: 8px 0 40px; }
.login-hero { background: var(--brand); color: #fff; border-radius: var(--radius-lg); padding: 24px 22px; margin-bottom: 18px; position: relative; overflow: hidden; isolation: isolate; }
.login-hero::before {
  content: ''; position: absolute; inset: 10px; border: 2px solid rgba(255, 255, 255, .28); border-radius: 12px; z-index: -1;
}
.login-hero h1 { font-size: 34px; }
.login-hero p { color: var(--on-brand-sub); margin-top: 8px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); margin: 18px 0; font-size: 16px; }
.or::before, .or::after { content: ''; flex: 1; border-top: 1px solid var(--line); }
/* Google first: Google's own button (iframe, 40px tall at size large), centred, as wide as the card up to 400px.
   The slot keeps its height while the script loads so nothing jumps. */
.login-card { padding: 22px 18px 10px; }
.gsi-slot { min-height: 44px; display: flex; justify-content: center; }
.gsi-wait { text-align: center; font-size: 16px; margin-top: 8px; }
.gsi-wait:empty { display: none; }
/* Google sign-in not offered yet: greyed and inert (disabled: no hover, focus or pointer cue). */
.g-soon { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 48px; padding: 6px 16px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--grey-soft); color: var(--grey); font: inherit; font-size: 17px; font-weight: 700; cursor: default; }
.g-soon .icon { opacity: .75; }
.g-soon-note { text-align: center; color: var(--muted); font-size: 15px; margin-top: 6px; }
/* Turnstile (flexible width, 65px tall); the slot keeps its height while the script loads. */
.ts-box { margin-top: 16px; }
.ts-slot { min-height: 65px; }
.ts-note { color: var(--muted); font-size: 16px; text-align: center; }
.ts-note:empty { display: none; }
.alt-toggle { display: block; width: 100%; text-align: center; margin-top: 10px; font-size: 18px; }
.alt-login { border-top: 1px solid var(--line); margin-top: 6px; padding: 18px 0 8px; }
.alt-login[hidden] { display: none; }
.alt-intro { color: var(--muted); margin-bottom: 14px; }
.input[readonly] { background: var(--grey-soft); color: var(--muted); border-color: var(--line); }
.demo-banner { background: var(--sun); color: var(--ink); border: 2px dashed var(--brand); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px; font-weight: 700; }
.demo-banner b { font-size: 28px; letter-spacing: .2em; display: block; font-variant-numeric: tabular-nums; }
/* Profile: an email not proven yet, and a new email or phone waiting for its code. */
.unverified-note { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: -6px 0 14px; color: var(--ink); font-size: 16px; }
.unverified-note .btn-link { min-height: 44px; }
.pending-contact { border-color: var(--brand); margin-bottom: 16px; }
.pending-contact p { margin: 0 0 12px; }
/* Profile: push notifications on this device, and the test's results. */
.push-card { margin-top: 16px; }
.push-card > p { margin: 0 0 12px; }
.push-state { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.push-state.on { color: var(--open-ink); }
.push-state.no { color: var(--absent); }
.push-steps { margin: 0 0 12px; padding-left: 1.4em; }
.push-steps li { margin-bottom: 8px; }
.push-results:empty { display: none; }
.push-results { margin-top: 14px; }
.push-results ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.push-results li { display: flex; align-items: flex-start; gap: 8px; }
.push-results li .icon { flex: none; margin-top: 3px; }
.push-results li.ok .icon { color: var(--open-ink); }
.push-results li.no .icon { color: var(--absent); }
/* Demo list: always open on the login page (under the Google button and the email/phone link). */
.demo { margin-top: 22px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.demo h2 { font-size: 18px; padding: 16px 16px 8px; color: var(--brand); }
.demo .list { padding: 0 12px 12px; }
.demo .row { min-height: 60px; padding: 10px 14px; }
.login-foot { text-align: center; margin-top: 24px; font-size: 16px; }
.login-foot a { color: var(--muted); }
.lang-toggle { display: flex; justify-content: flex-end; margin-bottom: 8px; }

/* ---------------------------------------------------------------- notifications */
.notif { align-items: flex-start; }
.notif .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--open); margin-top: 8px; flex: none; }
.notif.read .dot { background: transparent; }
.notif.read { background: #f8fafd; }
.notif time { display: block; color: var(--muted); font-size: 15px; margin-top: 4px; }
.notif .ntype { color: var(--brand); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* refinements after visual check */
[tabindex="-1"]:focus { outline: none; box-shadow: none; }
.nowrap { white-space: nowrap; }
.open-row .time, .slot-head .t strong { text-wrap: balance; }
.open-row .time { white-space: nowrap; }
.icon-btn { min-width: 56px; height: 56px; }
.date-card .status { align-self: flex-start; }
html { scrollbar-gutter: stable; }

/* Remove button in list rows: label beside the icon on wide screens, icon only on phones. */
.btn-remove { width: auto; min-height: 52px; padding: 8px 14px; flex-shrink: 0; }
@media (max-width: 480px) {
  .btn-remove { min-width: 56px; min-height: 56px; padding: 8px; }
  .btn-remove .btn-label { display: none; }
}
