@font-face {
  font-family: "Figtree";
  src: url("/media/figtree-variable.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --ground: #fbf1e4;
  --card: #ffffff;
  --surface: #f4e7d6;
  --line: #e8d9c6;
  --line-strong: #d6c3ad;
  --ink: #2a211c;
  --ink-2: #6b5e55;
  --action: #c43e12;
  --action-press: #a33a12;
  --action-tint: #fce6dc;
  --error: #9f1d14;
  --error-tint: #fbe4e1;
  --wa: #0e7a4f;          /* vert WhatsApp foncé : texte blanc à 5,4:1 */
  --wa-press: #0b6340;

  --radius: 14px;
  --radius-control: 12px;
  --radius-input: 10px;
  --gutter: 16px;
  --col: 34rem;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --bar-h: 84px;

  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 72px;
  scroll-padding-bottom: calc(var(--bar-h) + 16px);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: var(--app-h, 100svh);
  display: flex; flex-direction: column;
  background: var(--ground);
  color: var(--ink);
  font-family: "Figtree", -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

::selection { background: var(--action-tint); color: var(--ink); }

h1, h2, h3, p, dl, dd, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }

a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
  border-radius: 6px;
}

[hidden] { display: none !important; }

.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;
}

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 50;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--radius-control);
  font-weight: 600; text-decoration: none;
}
.skip:focus { top: 12px; }

.icon { width: 1.25em; height: 1.25em; flex: none; }

.muted { color: var(--ink-2); }

/* Barre du haut ------------------------------------------------------ */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: calc(var(--col) + 2 * var(--gutter)); width: 100%;
  margin: 0 auto; padding: 14px var(--gutter) 6px;
  min-height: 60px;
}
.wordmark { display: inline-flex; align-items: center; min-height: 44px; }
.wordmark img { height: 22px; width: auto; }
.topbar-back {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; min-width: 0;
  color: var(--ink); text-decoration: none; font-weight: 600;
}
.topbar-back span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60vw; }
.topbar-back:hover span { text-decoration: underline; }
.topbar-link {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px;
  color: var(--ink-2); font-weight: 600; text-decoration: none;
}
.topbar-link:hover { color: var(--ink); text-decoration: underline; }
.topbar-back span { max-width: 50vw; }
.topbar-nav { display: flex; align-items: center; gap: 10px; flex: none; }
.topbar-lang {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 32px;
  color: var(--ink-2); font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.04em; text-decoration: none;
}
.topbar-lang:hover { color: var(--ink); text-decoration: underline; }

main {
  display: block;
  max-width: calc(var(--col) + 2 * var(--gutter));
  margin: 0 auto; width: 100%; flex: 1 0 auto;
  padding: 8px var(--gutter) 16px;
}
main:focus { outline: none; }

/* Messages flash ----------------------------------------------------- */
.flash {
  display: flex; gap: 10px; align-items: flex-start;
  max-width: var(--col); margin: 4px auto 8px; width: calc(100% - 2 * var(--gutter));
  padding: 12px 14px; border-radius: var(--radius-control);
  background: var(--ink); color: #fff; font-weight: 500;
}
.flash .icon { margin-top: 2px; }
.flash-wrap {
  display: grid; grid-template-rows: minmax(0, 1fr);
  transition: grid-template-rows 0.3s var(--ease), opacity 0.25s var(--ease);
}
.flash-wrap > .flash { min-height: 0; overflow: hidden; }
.flash-wrap.is-leaving { grid-template-rows: minmax(0, 0fr); opacity: 0; }
.flash-ok { cursor: pointer; }
.flash-error { background: var(--error-tint); color: var(--error); border: 1px solid #f0c3bd; }

/* Cartes ------------------------------------------------------------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* Boutons ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px;
  border-radius: var(--radius-control); border: 1px solid transparent;
  font-weight: 650; font-size: 1rem; line-height: 1.2; text-decoration: none;
  cursor: pointer; user-select: none;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease), border-color 0.15s var(--ease), transform 0.15s var(--ease);
}
.btn:active { transform: scale(0.98); }
.btn-block { display: flex; width: 100%; }
.btn-primary { background: var(--action); color: #fff; }
.btn-primary:hover { background: var(--action-press); }
.btn-outline { background: var(--card); color: var(--action); border-color: var(--action); }
.btn-outline:hover { background: var(--action); color: #fff; }
.btn-quiet {
  background: var(--surface); color: var(--ink); border-color: transparent;
  min-height: 44px; padding: 0 14px; font-weight: 600;
}
.btn-quiet:hover { border-color: var(--line-strong); background: #efdfca; }
.btn-small {
  min-height: 44px; padding: 0 14px; font-size: 0.9375rem;
  background: var(--card); color: var(--action); border-color: var(--line-strong);
}
.btn-small:hover { border-color: var(--action); }
.btn-small .icon { width: 1.1em; height: 1.1em; }

.link-action {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px;
  color: var(--action); font-weight: 650; text-decoration: none;
}
.link-action:hover { text-decoration: underline; }
.link-action .icon { width: 1.1em; height: 1.1em; }
.link-quiet, .link-danger {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--ink-2); font-weight: 600; text-decoration: underline; text-decoration-color: var(--line-strong);
}
.link-quiet:hover { color: var(--ink); text-decoration-color: currentColor; }
.link-danger { color: var(--error); text-decoration-color: currentColor; }
.btn-danger { background: var(--error); color: #fff; }
.btn-danger:hover { background: #7f1710; }

/* Suppression du profil */
.profile-delete { margin-top: 8px; text-align: center; }
.delete-list { margin-top: 16px; display: grid; gap: 8px; padding-left: 1.1em; list-style: disc; }
.delete-none { margin-top: 16px; }
.check-danger:has(input:checked) { border-color: var(--error); background: var(--error-tint); }
.check-danger input { accent-color: var(--error); }

/* Barre basse -------------------------------------------------------- */
.bottombar {
  position: sticky; bottom: 0; z-index: 20; margin-top: auto;
  background: color-mix(in srgb, var(--ground) 94%, transparent);
  border-top: 1px solid var(--line);
  padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom));
}
.bottombar-inner { max-width: var(--col); margin: 0 auto; }
body:has(details.join[open]) .bottombar { display: none; }

/* Page événement ----------------------------------------------------- */
.event { padding: 22px 20px 18px; }
.event-title {
  font-size: clamp(1.625rem, 6.4vw, 2.125rem);
  line-height: 1.12; font-weight: 650; letter-spacing: -0.015em;
  text-wrap: balance; overflow-wrap: anywhere;
}
.event-date { margin-top: 6px; color: var(--ink-2); font-weight: 500; }

.event-facts {
  display: grid; grid-template-columns: auto 1fr; gap: 0 20px;
  margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line);
}
.fact dt { font-size: 0.875rem; color: var(--ink-2); font-weight: 500; }
.fact-time { font-size: 2.75rem; line-height: 1; font-weight: 750; letter-spacing: -0.03em; margin-top: 6px; }
.fact-place { margin-top: 4px; }
.fact-place-body { display: flex; flex-direction: column; text-decoration: none; min-width: 0; }
.fact-place-name { font-weight: 650; line-height: 1.25; overflow-wrap: anywhere; }
.fact-place-addr { color: var(--ink-2); font-size: 0.9375rem; line-height: 1.35; margin-top: 2px; }
.fact-place-cta {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 6px;
  color: var(--action); font-weight: 650; font-size: 0.9375rem;
}
.fact-place-cta .icon { width: 1.05em; height: 1.05em; }
.fact-place a:hover .fact-place-cta { text-decoration: underline; }

.event-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.event-past {
  margin-top: 14px; padding: 10px 12px; border-radius: var(--radius-input);
  background: var(--surface); color: var(--ink-2); font-weight: 500;
}

/* Bascule aller / retour */
.seg {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  margin: 20px 0 12px; padding: 4px;
  background: var(--surface); border-radius: var(--radius-control);
  position: sticky; top: 8px; z-index: 10;
}
.seg-item {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; border-radius: 9px;
  color: var(--ink-2); font-weight: 650; text-decoration: none;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}
.seg-item:hover { color: var(--ink); }
.seg-item[aria-current] { background: var(--card); color: var(--action); box-shadow: 0 1px 2px rgba(42, 33, 28, 0.08); }
.seg-count { font-weight: 500; color: var(--ink-2); }

.trips { display: grid; gap: 10px; }
.trips[hidden] { display: none; }

/* Carte trajet */
.trip { padding: 16px; scroll-margin-top: 72px; }
.trip-main {
  display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: 2px 12px;
  grid-template-areas: "time driver seats" "where where gauge";
}
.trip-main .trip-time { grid-area: time; }
.trip-main .trip-driver { grid-area: driver; font-weight: 600; color: var(--ink); font-size: 1rem; }
.trip-main .seat-text { grid-area: seats; text-align: right; }
.trip-where { grid-area: where; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; min-width: 0; }
.trip-main .seat-gauge { grid-area: gauge; justify-self: end; align-self: center; }
.help-dot {
  width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--ink-2); background: none;
  color: var(--ink-2); font: 700 0.75rem/1 inherit; display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0; align-self: center;
}
.help-dot:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; }
.help-bubble {
  position: fixed; inset: auto; margin: 0; max-width: min(300px, calc(100vw - 32px)); padding: 12px 14px; border: 0; border-radius: 12px;
  background: var(--ink); color: #fff; font-size: 0.9375rem; line-height: 1.4; box-shadow: 0 8px 24px rgba(0,0,0,.18);
}
.help-bubble::backdrop { background: transparent; }
.trip-time {
  font-size: 1.625rem; line-height: 1.05; font-weight: 750; letter-spacing: -0.02em;
  padding-top: 1px;
}
.trip-time-end { font-size: 1.125rem; }
.trip-place {
  font-size: 1.0625rem; line-height: 1.3; font-weight: 650; overflow-wrap: anywhere;
}
.trip-place-prefix { color: var(--ink-2); font-weight: 500; }
.trip-driver { color: var(--ink-2); font-size: 0.9375rem; }
.seat-text { font-size: 0.875rem; font-weight: 600; color: var(--ink); white-space: nowrap; }

.seat-gauge { display: inline-flex; gap: 4px; }
.seat-gauge i {
  display: block; width: 12px; height: 16px; border-radius: 4px 4px 3px 3px;
  border: 1.5px solid var(--ink-2);
}
.seat-gauge i.taken { background: var(--ink-2); border-color: var(--ink-2); }

.trip.is-full .trip-time, .trip.is-full .trip-place { color: var(--ink-2); }
.trip.is-full .seat-text { color: var(--ink-2); }
.trip.is-mine { border-color: var(--line-strong); }

.trip-state {
  display: flex; align-items: center; gap: 6px;
  margin-top: 14px; font-weight: 650; font-size: 0.9375rem;
}
.trip-state .icon { color: var(--ink); }

/* Infos privées dépliées */
.trip-private {
  margin-top: 12px; padding-top: 14px; border-top: 1px solid var(--line);
  display: grid; gap: 14px;
}
.trip.just-joined .trip-private { animation: unfold 0.3s var(--ease) both; }
@keyframes unfold { from { opacity: 0; transform: translateY(-4px); } }
.trip-meeting dt { font-size: 0.875rem; color: var(--ink-2); font-weight: 500; }
.trip-meeting dd { font-weight: 600; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.trip-meeting dd a { color: var(--ink); }
.trip-meeting-time { color: var(--ink-2); font-weight: 500; }

.people { display: grid; }
.person {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px;
  padding: 10px 0; border-top: 1px solid var(--line);
}
.person:first-child { border-top: 0; padding-top: 0; }
.person-id { display: flex; flex-direction: column; min-width: 0; }
.person-name { font-weight: 600; overflow-wrap: anywhere; }
.person-role { font-size: 0.875rem; color: var(--ink-2); }
.person-contact { display: flex; gap: 8px; }
.person-none { color: var(--ink-2); font-size: 0.9375rem; }
.trip-hint { font-size: 0.8125rem; color: var(--ink-2); }
.trip-own-actions { display: flex; flex-wrap: wrap; gap: 8px 20px; }

/* Rejoindre : dépliement sur place */
.join { margin-top: 14px; }
.join > summary { list-style: none; width: 100%; }
.join > summary::-webkit-details-marker { display: none; }
.join[open] > summary { background: transparent; color: var(--ink-2); border-color: var(--line-strong); }
.join[open] > summary:hover { color: var(--ink); border-color: var(--ink-2); }
.join:not([open]) .when-open, .join[open] .when-closed { display: none; }
.join::details-content {
  block-size: 0; overflow: hidden;
  transition: block-size 0.25s var(--ease), content-visibility 0.25s allow-discrete;
}
.join[open]::details-content { block-size: auto; }
@supports (interpolate-size: allow-keywords) { :root { interpolate-size: allow-keywords; } }
.join-form { display: grid; gap: 14px; padding-top: 14px; }

.seat-pick { border: 0; margin: 0; padding: 0; min-width: 0; }
.seat-pick legend, .choice legend, .stepper-field legend {
  padding: 0; margin-bottom: 8px; font-weight: 600; font-size: 0.9375rem;
}
.seat-pick-options, .choice-options { display: flex; flex-wrap: wrap; gap: 8px; }
.seat-pick-options label, .choice-options label { position: relative; cursor: pointer; }
.seat-pick-options input, .choice-options input {
  position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer;
}
.seat-pick-options span, .choice-options span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 48px; min-height: 44px; padding: 0 16px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-input);
  background: var(--card); font-weight: 600;
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease);
}
.seat-pick-options input:checked + span, .choice-options input:checked + span {
  border-color: var(--action); background: var(--action-tint); color: var(--action-press);
}
.seat-pick-options input:focus-visible + span, .choice-options input:focus-visible + span {
  outline: 3px solid var(--ink); outline-offset: 2px;
}

/* Vide */
.empty {
  padding: 16px; border: 1px dashed var(--line-strong); border-radius: var(--radius);
  color: var(--ink-2);
}
.empty .link-action { margin-top: 8px; }

/* Formulaires -------------------------------------------------------- */
.sheet { padding: 12px 0 0; }
.sheet-title { font-size: clamp(1.625rem, 6vw, 2rem); line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; text-wrap: balance; }
.sheet-lead { margin-top: 10px; color: var(--ink-2); }
.sheet-context { margin-top: 8px; color: var(--ink-2); font-weight: 500; }
.sheet > .muted { margin-top: 12px; }
.sheet > p:has(.link-action) { margin-top: 16px; }
.sheet > .btn { margin-top: 24px; }
.sheet-foot { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); }

.form { display: grid; gap: 20px; margin-top: 24px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > label { font-weight: 600; font-size: 0.9375rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-row:empty { display: none; }
.field-row > .field:only-child { grid-column: 1 / -1; }
.field-row .field { align-content: start; }
.field-row > .field > label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

input[type="text"], input[type="email"], input[type="tel"], input[type="url"],
input[type="date"], input[type="time"], input[type="number"] {
  width: 100%; min-height: 50px; padding: 12px 14px;
  background: var(--card); border: 1px solid var(--line-strong); border-radius: var(--radius-input);
  font-size: 1.0625rem; color: var(--ink); caret-color: var(--action);
  appearance: none; -webkit-appearance: none;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
input::placeholder { color: #7a6d63; }
input:hover { border-color: var(--ink-2); }
input:focus { outline: none; border-color: var(--action); box-shadow: 0 0 0 3px var(--action-tint); }
input[aria-invalid="true"] { border-color: var(--error); }
input[type="date"], input[type="time"] { min-width: 0; display: block; }
input::-webkit-date-and-time-value { text-align: left; }

.phone-input { position: relative; }
.phone-prefix {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  font-size: 1.0625rem; color: var(--ink-2); pointer-events: none;
}
.phone-input input { padding-left: 54px; }
.phone-input.is-intl .phone-prefix { display: none; }
.phone-input.is-intl input { padding-left: 14px; }

input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink);
  box-shadow: 0 0 0 100px var(--card) inset;
  caret-color: var(--action);
}

.field-hint { font-size: 0.875rem; color: var(--ink-2); display: flex; gap: 6px; align-items: flex-start; }
.field-hint .icon { width: 1.05em; height: 1.05em; margin-top: 2px; }
.field-link {
  display: inline-flex; align-items: center; gap: 4px; min-height: 32px; justify-self: start;
  color: var(--action); font-weight: 600; font-size: 0.875rem; text-decoration: none;
}
.field-link:hover { text-decoration: underline; }
button.field-link { background: none; border: 0; padding: 0; font-family: inherit; cursor: pointer; }
.field-link:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; border-radius: 4px; }
.field-link .icon { width: 1em; height: 1em; }
.field-error { font-size: 0.9375rem; color: var(--error); font-weight: 600; }
.form-alert {
  margin-top: 18px; padding: 12px 14px; border-radius: var(--radius-input);
  background: var(--error-tint); color: var(--error); font-weight: 600;
}
.field-static { font-size: 0.9375rem; color: var(--ink-2); overflow-wrap: anywhere; }
.field-static span { display: block; font-weight: 600; color: var(--ink); }

.check {
  display: flex; gap: 12px; align-items: flex-start; cursor: pointer;
  padding: 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-input); background: var(--card);
  font-weight: 500; line-height: 1.4;
}
.check small { display: block; margin-top: 4px; font-size: 0.875rem; color: var(--ink-2); font-weight: 400; }
.check input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--action); }
.check:has(input:checked) { border-color: var(--action); background: var(--action-tint); }
textarea {
  width: 100%; min-height: 76px; padding: 12px 14px; resize: vertical;
  background: var(--card); border: 1px solid var(--line-strong); border-radius: var(--radius-input);
  font-size: 1.0625rem; line-height: 1.4; color: var(--ink); caret-color: var(--action);
}
textarea::placeholder { color: #7a6d63; }
textarea:focus { outline: none; border-color: var(--action); box-shadow: 0 0 0 3px var(--action-tint); }
.trip-flex { font-size: 0.9375rem; color: var(--ink-2); }
.trip-rt { font-size: 0.8125rem; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.person-message { font-size: 0.9375rem; color: var(--ink); margin-top: 4px; overflow-wrap: anywhere; }

/* Demande de passage */
.choice-stack { display: grid; gap: 8px; }
.choice-stack .check { padding: 12px 14px; }
.pickup-field { margin-top: 10px; }
.pickup-pick:not(:has(input[value="pickup"]:checked)) .pickup-field { display: none; }
.pickup-state {
  margin-top: 8px; padding: 10px 12px; border-radius: var(--radius-input);
  background: var(--surface); font-size: 0.9375rem; font-weight: 500;
}
.pickup-state.is-pending { background: var(--action-tint); color: var(--action-press); }
.person-pickup { display: flex; gap: 6px; align-items: flex-start; margin-top: 4px; font-size: 0.875rem; color: var(--ink); }
.person-pickup .icon { width: 16px; height: 16px; margin-top: 2px; color: var(--action); }
.person-pickup.is-declined { color: var(--ink-2); }
.pickup-reply { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
.pickup-reply form { flex: 1 1 auto; }
.pickup-reply .btn { width: 100%; }
.btn-small-strong { background: var(--action); color: #fff; border-color: var(--action); }
.btn-small-strong:hover { background: var(--action-press); }

/* WhatsApp vers le conducteur : vert tant que le message n'a pas été ouvert */
.btn-small.btn-wa { background: var(--wa); color: #fff; border-color: var(--wa); }
.btn-small.btn-wa:hover { background: var(--wa-press); border-color: var(--wa-press); }

.choice { border: 0; margin: 0; padding: 0; min-width: 0; }
.choice-options label { flex: 1 1 auto; }
.choice-options span { width: 100%; }

.stepper-field { border: 0; margin: 0; padding: 0; }
.stepper { display: flex; align-items: stretch; gap: 8px; }
.stepper input { width: 88px; text-align: center; font-weight: 700; font-size: 1.25rem; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.stepper-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 50px; min-height: 50px; border-radius: 50%;
  border: 0; background: none; color: var(--action); cursor: pointer; padding: 0;
  transition: border-color 0.15s var(--ease), transform 0.15s var(--ease);
}
.stepper-btn:hover { color: var(--action-press); }
.stepper-btn .icon { width: 44px; height: 44px; }
.stepper-btn:active { transform: scale(0.96); }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.dev-note {
  margin-top: 20px; padding: 14px; border-radius: var(--radius-input);
  border: 1px dashed var(--line-strong); background: var(--card);
  font-size: 0.875rem; color: var(--ink-2); overflow-wrap: anywhere;
}
.dev-note a { color: var(--action); font-weight: 600; }

/* Accueil ------------------------------------------------------------ */
.page-title { font-size: clamp(1.625rem, 6vw, 2rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; margin: 4px 0 18px; }
.list-heading { font-size: 1.125rem; font-weight: 700; margin: 24px 0 8px; }
.event-list { display: grid; gap: 10px; }
.event-row {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center;
  padding: 14px 16px; text-decoration: none;
  transition: border-color 0.15s var(--ease);
}
.event-row:hover { border-color: var(--line-strong); }

/* Balayage vers la gauche sur un événement dont on est l'organisateur : « Supprimer » à droite */
.swipe { position: relative; overflow: hidden; border-radius: var(--radius); }
.swipe-action {
  position: absolute; inset: 0; display: flex; align-items: stretch; justify-content: flex-end;
  background: var(--error); border-radius: var(--radius); overflow: hidden;
}
.swipe-delete {
  width: 96px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background: none; border: 0; color: #fff; font-weight: 650; font-size: 0.875rem; cursor: pointer;
}
.swipe.has-swipe .event-row { position: relative; z-index: 3; touch-action: pan-y; transition: transform 0.2s var(--ease); }
.swipe.has-swipe .event-row.is-dragging { transition: none; }
.swipe.is-open .event-row { transform: translateX(-96px); }
/* Ordinateur (souris) : pas de balayage, « Supprimer » apparaît au survol à droite de la ligne */
@media (hover: hover) and (pointer: fine) {
  .swipe-action {
    inset: 1px 1px 1px auto; z-index: 4; background: var(--card); border-radius: 0 var(--radius) var(--radius) 0;
    opacity: 0; pointer-events: none; transition: opacity 0.15s var(--ease);
  }
  .swipe:hover .swipe-action, .swipe:focus-within .swipe-action { opacity: 1; pointer-events: auto; }
  .swipe-delete { width: auto; flex-direction: row; gap: 6px; padding: 0 18px; color: var(--error); }
  .swipe-delete:hover span { text-decoration: underline; }
}

/* Bouton en cours d'envoi (lien de connexion) */
.btn.is-busy { pointer-events: none; opacity: 0.85; }
.btn.is-busy::before {
  content: ""; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
/* Pas de soulignement : sur mobile, :hover reste « collé » après le toucher. */
@keyframes swipe-peek { 0%, 100% { transform: translateX(0); } 35%, 65% { transform: translateX(-56px); } }
.swipe.is-peek .event-row { animation: swipe-peek 1.4s var(--ease) 0.4s both; }
@media (prefers-reduced-motion: reduce) { .swipe.is-peek .event-row { animation: none; } }
.event-row-date { grid-column: 1; font-size: 0.875rem; font-weight: 600; color: var(--ink-2); }
.event-roles { grid-column: 1; display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.role {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px 3px 7px; border-radius: 999px;
  font-size: 0.8125rem; font-weight: 650; line-height: 1.2;
}
.role .icon { width: 1em; height: 1em; }
.role-owner { background: var(--ink); color: #fff; }
.role-driver { background: var(--action-tint); color: var(--action-press); }
.role-member { background: var(--line); color: var(--ink); }
.event-row-title { grid-column: 1; font-weight: 650; font-size: 1.0625rem; line-height: 1.3; overflow-wrap: anywhere; }
.event-row-meta { grid-column: 1; font-size: 0.875rem; color: var(--ink-2); }
.event-row-alert { grid-column: 1; font-size: 0.875rem; font-weight: 650; color: var(--action-press); }
.event-row-go { grid-column: 2; grid-row: 1 / span 5; align-self: center; color: var(--ink-2); }

.intro { padding-top: 8px; }
.intro-title {
  font-size: clamp(1.5rem, 5.8vw, 2.25rem); line-height: 1.1; font-weight: 750; letter-spacing: -0.03em;
  text-wrap: balance; max-width: 16ch;
}
.intro-points { margin-top: 12px; display: grid; gap: 6px; color: var(--ink-2); max-width: 40ch; }
.intro-points li { position: relative; padding-left: 18px; }
.intro-points li::before {
  content: ""; position: absolute; left: 2px; top: 0.62em; width: 6px; height: 6px; border-radius: 50%; background: var(--action);
}
.intro-points strong { color: var(--ink); font-weight: 650; }
.demo-event { padding: 10px 14px; }
.demo-title { font-weight: 700; line-height: 1.25; }
.demo-meta { color: var(--ink-2); font-size: 0.8125rem; margin-top: 2px; }
.demo-meta strong { color: var(--ink); }
.demo-trip { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 8px 14px; }
.demo-trip .trip-time { font-size: 1.1875rem; }
.demo-who { display: flex; flex-direction: column; line-height: 1.25; }
.demo-who span { color: var(--ink-2); font-size: 0.8125rem; }

/* Étapes de l'accueil : défilement horizontal en boucle, l'étape suivante dépasse à droite */
.how { margin-top: 28px; }
.how-title { margin: 0 0 4px; }
.step-nav { display: flex; gap: 4px; margin-left: -6px; }
.step-dot {
  position: relative; isolation: isolate;
  width: 44px; height: 44px; padding: 0; border: 0; background: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9375rem; color: var(--ink-2);
}
.step-dot::before {
  content: ""; position: absolute; z-index: -1; width: 32px; height: 32px; border-radius: 50%;
  border: 1.5px solid var(--line-strong); background: var(--card);
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.step-dot[aria-current] { color: #fff; }
.step-dot[aria-current]::before { background: var(--ink); border-color: var(--ink); }
.slides {
  position: relative;
  display: grid; grid-auto-flow: column; grid-auto-columns: 86%; gap: var(--gutter);
  margin: 4px calc(-1 * var(--gutter)) 0; padding: 0 var(--gutter);
  scroll-padding-inline: var(--gutter);
  overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  scrollbar-width: none; scroll-behavior: smooth;
}
.slides::-webkit-scrollbar { display: none; }
.slides:focus-visible { outline-offset: -3px; }
.slide { scroll-snap-align: start; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.slide-title { font-size: 1.0625rem; font-weight: 700; line-height: 1.3; }
.slide-text { font-size: 0.875rem; line-height: 1.4; color: var(--ink-2); }
.mock { flex: 1; font-size: 0.875rem; }

.mock-form { display: grid; grid-template-columns: auto auto 1fr; gap: 6px 10px; padding: 12px 14px; align-content: start; }
.mock-field { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 2px; }
.mock-field.mock-third { grid-column: auto; min-width: 0; }
.mock-form-event { grid-column: 1 / -1; font-weight: 700; }
.mock-field span { font-size: 0.75rem; font-weight: 600; color: var(--ink-2); }
.mock-field strong {
  font-weight: 600; padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: 8px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.mock-chat { display: flex; flex-direction: column; gap: 8px; padding: 10px 14px 14px; background: var(--surface); border-color: var(--line); }
.mock-chat-group { font-weight: 700; padding-bottom: 8px; border-bottom: 1px solid var(--line-strong); }
.mock-bubble {
  align-self: flex-start; max-width: 92%; padding: 8px 10px; border-radius: 4px 12px 12px 12px;
  background: var(--card); line-height: 1.35;
}
.mock-bubble-who { font-size: 0.75rem; font-weight: 700; color: var(--action-press); }
.mock-link {
  display: flex; flex-direction: column; margin-top: 6px; padding: 6px 10px;
  border-left: 3px solid var(--action); background: var(--ground); border-radius: 4px; line-height: 1.35;
}
.mock-link span { font-size: 0.75rem; color: var(--ink-2); }
.mock-link .mock-link-host { color: var(--ink); }

.mock-trips { display: grid; gap: 6px; align-content: start; }

/* Cadre de smartphone : effacé sur mobile (le visuel s'affiche seul), dessiné sur desktop */
.phone, .phone-screen { display: contents; }
.phone-time, .phone-logo, .phone-heading, .mock-more { display: none; }
.mock-btn {
  grid-column: 1 / -1; margin-top: 6px; padding: 9px; border-radius: 10px;
  background: var(--action); color: #fff; font-weight: 650; text-align: center;
}
.mock-actions { gap: 8px; margin-top: 8px; }
.mock-actions span {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px;
  border: 1px solid var(--line-strong); border-radius: 10px; color: var(--action); font-weight: 650;
}
.mock-actions .icon { width: 14px; height: 14px; }

.mock-meet { overflow: hidden; display: flex; flex-direction: column; }
.mock-map { position: relative; height: 72px; background: var(--ground); border-bottom: 1px solid var(--line); }
.map-bg { width: 100%; height: 100%; }
.map-lake { fill: var(--line); }
.map-road { fill: none; stroke: var(--card); stroke-width: 5; stroke-linecap: round; }
.map-pin { position: absolute; left: 37%; top: 8px; width: 28px; height: 28px; margin-left: -14px; color: var(--action); }
.mock-meet-body { display: grid; gap: 2px; padding: 8px 14px 12px; }
.mock-meet-label { font-size: 0.75rem; font-weight: 600; color: var(--ink-2); }
.mock-meet-label strong { color: var(--ink); }
.mock-meet-place { font-weight: 650; }
.mock-wa {
  display: flex; gap: 8px; align-items: flex-start; margin-top: 6px; padding: 7px 10px;
  border-radius: 4px 12px 12px 12px; background: var(--surface); font-size: 0.8125rem; line-height: 1.35;
}
.mock-wa .icon { width: 16px; height: 16px; margin-top: 1px; color: var(--ink-2); }
.mock-join {
  grid-column: 1 / -1; margin-top: 4px; padding: 8px; border-radius: 10px;
  background: var(--action); color: #fff; font-weight: 650; text-align: center;
}

.slider-nav { display: none; }
.slider-arrow {
  width: 44px; height: 44px; padding: 0; border: 0; background: none; color: var(--ink); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.slider-arrow .icon { width: 32px; height: 32px; }
.slider-arrow:disabled { opacity: 0.25; cursor: default; }

.how-link { margin-top: 8px; }
.how-link .icon { transform: rotate(90deg); transition: transform 0.15s var(--ease); }
.how-link[aria-expanded="true"] .icon { transform: rotate(-90deg); }

/* Mobile : « Comment ça marche » replié derrière un lien ; déplié, bande blanche limitée aux étapes */
@media (max-width: 959px) {
  .how:not(.is-open):not(:target) { display: none; }
  .how-title {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }
  .intro-points { font-size: 1rem; line-height: 1.45; }
  .intro { padding-bottom: 20px; }
  .how {
    margin-top: 0; padding: 12px 0 24px;
    background: var(--card); box-shadow: 0 0 0 100vmax var(--card); clip-path: inset(0 -100vmax);
  }
}
.slider-arrow:focus-visible { border-radius: 50%; }

/* Pied de page */
.site-footer {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 0 24px;
  max-width: calc(var(--col) + 2 * var(--gutter)); width: 100%; margin: 0 auto; padding: 8px var(--gutter) 16px;
  font-size: 0.875rem;
}
.site-footer a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink-2); text-decoration: none; }
.site-footer a:hover { color: var(--ink); text-decoration: underline; }

/* Administration */
.admin { padding-top: 4px; }
.admin-nav { display: flex; gap: 20px; margin-bottom: 12px; font-weight: 600; }
.admin-nav a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--ink-2); text-decoration: none; }
.admin-nav a[aria-current] { color: var(--ink); text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }
.admin-count { min-width: 22px; padding: 1px 6px; border-radius: 11px; background: var(--action); color: #fff; font-size: 0.8125rem; text-align: center; }
.admin-periods { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.admin-periods a {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-input); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 0.9375rem;
}
.admin-periods a[aria-current] { background: var(--ink); border-color: var(--ink); color: #fff; }
.admin-h { margin-top: 28px; font-size: 1.125rem; font-weight: 700; }
.admin-h small { font-weight: 500; font-size: 0.875rem; color: var(--ink-2); }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 9.5rem), 1fr)); margin-top: 8px; border-top: 1px solid var(--line); }
.kpis > div { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--line); }
.kpis dt { font-size: 0.875rem; color: var(--ink-2); }
.kpis dd { margin: 2px 0 0; font-size: 1.625rem; font-weight: 750; letter-spacing: -0.02em; }
.kpis dd small { font-size: 0.875rem; font-weight: 600; color: var(--ink-2); letter-spacing: 0; }
.admin-note { margin-top: 10px; font-size: 0.8125rem; color: var(--ink-2); max-width: 70ch; }
.admin-cols { display: grid; gap: 0 32px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }
.admin-table { width: 100%; margin-top: 8px; border-collapse: collapse; font-size: 0.9375rem; }
.admin-table th, .admin-table td { padding: 8px 8px 8px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.admin-table th { font-size: 0.8125rem; color: var(--ink-2); font-weight: 600; }
.admin-table td:not(:first-child), .admin-table th:not(:first-child) { text-align: right; }
.admin-empty { margin-top: 12px; }
.admin-reports { display: grid; gap: 10px; margin-top: 12px; }
.admin-report { padding: 14px 16px; }
.admin-report-title { font-weight: 700; }
.admin-report-title a { color: var(--ink); }
.admin-report-meta { margin-top: 4px; font-size: 0.875rem; color: var(--ink-2); }
.admin-report-details { margin-top: 6px; font-size: 0.9375rem; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.btn-small-danger { color: var(--error); border-color: #e5b5ae; }
.btn-small-danger:hover { border-color: var(--error); }
.admin-ban { display: grid; gap: 10px; margin-top: 10px; max-width: 30rem; }
.admin-ban .btn { justify-self: start; }
.profile-admin { margin-top: 8px; text-align: center; }

/* Pages de texte (À propos, Confidentialité) */
.event-report { margin-top: 24px; text-align: center; }
.ended-actions { display: grid; gap: 8px; justify-items: center; margin-top: 24px; }
.event-report .icon { width: 16px; height: 16px; }
.choice-field { border: 0; margin: 0; padding: 0; min-width: 0; }
.choice-field legend { padding: 0; margin-bottom: 8px; font-weight: 600; font-size: 0.9375rem; }
.form-note { font-size: 0.875rem; color: var(--ink-2); text-align: center; }
.form-note a { color: var(--ink); }
.legal h2 { margin-top: 28px; font-size: 1.125rem; font-weight: 700; line-height: 1.3; }
.legal p, .legal ul { margin-top: 8px; color: var(--ink-2); }
.legal ul { display: grid; gap: 6px; padding-left: 1.1em; list-style: disc; }
.legal strong { color: var(--ink); font-weight: 650; }
.legal a { color: var(--action); font-weight: 600; }
.legal code { font-size: 0.875em; background: var(--surface); padding: 1px 5px; border-radius: 4px; color: var(--ink); }
.legal-date { margin-top: 28px !important; font-size: 0.875rem; }
.legal-note { font-size: 0.875rem; color: var(--ink-2); }

/* À propos */
.about-block { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); }
.about-block h2 { font-size: 1.25rem; line-height: 1.25; font-weight: 700; }
.about-block p, .about-block ul { margin-top: 10px; color: var(--ink-2); }
.about-block ul { display: grid; gap: 8px; padding-left: 1.1em; list-style: disc; }
.about-block strong { color: var(--ink); font-weight: 650; }
.about-block p a:not(.link-action) { color: var(--action); font-weight: 600; }
.about-block p:has(.link-action) { margin-top: 12px; }
.about-price { margin-top: 12px !important; font-size: clamp(2.5rem, 12vw, 3.5rem); line-height: 1; font-weight: 800; letter-spacing: -0.03em; color: var(--ink) !important; }
.about-price sup { font-size: 0.45em; vertical-align: super; line-height: 0; margin-left: 2px; }
.about-price-note { margin-top: 6px !important; font-size: 0.8125rem; }
.about-more .btn { margin-top: 20px; }

/* Grand écran -------------------------------------------------------- */
@media (min-width: 960px) {
  :root { --col: 64rem; }
  .flash { max-width: 34rem; }

  main:has(> .event) {
    display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: 32px; align-items: start;
  }
  main:has(> .event) > .event { grid-column: 1; grid-row: 1 / span 20; position: sticky; top: 16px; }
  main:has(> .event) > .seg { grid-column: 2; margin-top: 0; top: 16px; }
  main:has(> .event) > .trips { grid-column: 2; }
  main:has(> .event) > .event-report { grid-column: 2; }
  .fact-time { font-size: 3.25rem; }

  .sheet, .home-list { max-width: 34rem; margin: 0 auto; }
  .admin { max-width: 64rem; margin: 0 auto; }

  main:has(> .intro) {
    display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); column-gap: 56px; align-items: center;
    padding-top: 48px;
  }
  main:has(> .intro) > .intro { display: contents; }
  .intro-title, .intro-points { grid-column: 1; }
  .intro-title { align-self: end; }
  .intro-points { align-self: start; }
  main:has(> .intro) > .how { grid-column: 2; grid-row: 1 / span 2; margin-top: 0; }
  .how-link { display: none; }
  main:has(> .intro) { padding-top: 16px; }
  .how { position: relative; display: grid; grid-template-columns: auto auto; justify-content: center; align-items: center; column-gap: 12px; }
  .how-title { margin: 0; white-space: nowrap; }
  .step-nav { margin: 0; gap: 0; }
  .step-dot { width: 40px; }
  .phone .mock-third:last-of-type { grid-column: 1 / -1; }
  .slides { grid-column: 1 / -1; grid-auto-columns: 100%; gap: 16px; margin: 8px 0 0; padding: 0; scroll-padding-inline: 0; }
  .slide { align-items: center; text-align: center; gap: 12px; }
  .slide-text { max-width: 32ch; min-height: 2.8em; }

  /* Smartphone */
  .phone {
    display: block; width: 264px; height: clamp(400px, 100svh - 340px, 540px); padding: 9px; flex: none;
    background: var(--ink); border-radius: 44px;
  }
  .phone-screen {
    position: relative; display: flex; flex-direction: column; gap: 8px; height: 100%; overflow: hidden;
    padding: 40px 10px 12px; background: var(--ground); border-radius: 35px; text-align: left;
  }
  .phone-screen::before {
    content: ""; position: absolute; top: 10px; left: 50%; width: 76px; height: 22px; margin-left: -38px;
    background: var(--ink); border-radius: 11px;
  }
  .phone-time { display: block; position: absolute; top: 12px; left: 26px; font-size: 0.75rem; font-weight: 700; }
  .phone-logo { display: block; height: 14px; width: auto; margin: 2px 4px 2px; }
  .phone-heading { display: block; padding: 0 4px; font-weight: 750; font-size: 1.125rem; line-height: 1.2; }
  .phone .mock { flex: none; font-size: 0.8125rem; }
  .phone .mock-more { display: block; }
  .phone .mock-actions { display: flex; }
  .phone .demo-trip.mock-more { display: grid; }
  .phone .mock-chat { flex: 1; margin: -40px -10px -12px; padding-top: 44px; border: 0; border-radius: 0; }
  .phone .mock-meet .mock-map { height: 130px; }
  .phone .mock-meet .map-pin { top: 40px; }

  .slider-nav {
    display: flex; justify-content: space-between; position: absolute; left: 0; right: 0; top: 50%;
    pointer-events: none;
  }
  .slider-arrow { pointer-events: auto; }

  .bottombar-inner { max-width: 64rem; display: flex; justify-content: flex-end; }
  .bottombar-inner .btn-block { width: auto; min-width: 16rem; }
}

/* Interrupteur transparent posé sur les contrôles (retour haptique iOS) */
.hx-host { position: relative; }
.hx {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0;
  opacity: 0; -webkit-appearance: none; appearance: none; border: 0; border-radius: inherit;
  cursor: pointer; z-index: 2;
}

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