/* =========================================================
   Ridearound — affichage condensé (dernière feuille chargée), même logique que GolfTrack :
   plus d'informations à l'écran, texte plus petit, marges réduites.
   À garder : 16 px dans les champs de saisie (en dessous, l'iPhone zoome tout seul)
   et des zones d'appui d'au moins 36 px.
   ========================================================= */
:root { --tabs-h: 52px; --radius: 12px; }
body { font-size: 13px; line-height: 1.4; }
.small { font-size: 11.5px; }
.h2 { font-size: 16px; }
.ico { width: 18px; height: 18px; }

/* ---------- Barres ---------- */
.tabs button { font-size: 10px; gap: 1px; font-weight: 600; }
.tabs button .ico { width: 20px; height: 20px; }
.tabs button.on::before { width: 28px; }
.app-brand { height: 38px; padding: 0 12px 0 9px; border-radius: 11px; gap: 6px; }
.app-brand img { width: 17px; }
.app-brand .wordmark { font-size: 17px; }
.map-ctrls { top: calc(10px + var(--safe-t)); right: 10px; }
.app-brand { top: calc(10px + var(--safe-t)); left: 10px; }
.fab { width: 38px; height: 38px; border-radius: 11px; }
.layers button { padding: 8px 12px; font-size: 13px; }
.toast { font-size: 13px; padding: 9px 14px; border-radius: 11px; top: calc(56px + var(--safe-t)); }

/* ---------- Panneau Recherche ---------- */
.grip { padding: 7px 0 4px; }
.grip span { width: 34px; height: 4px; }
.view { padding: 0 12px 12px; }
.start-row { padding: 8px 10px; margin: 0 0 10px; border-radius: 12px; gap: 10px; }
.start-row .dot { width: 10px; height: 10px; box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); }
.start-label { font-size: 14px; }
.start-edit { font-size: 12.5px; }
.field { margin-bottom: 12px; }
.lbl { font-size: 10.5px; margin-bottom: 6px; letter-spacing: .07em; }
.seg { gap: 6px; }
.seg button { min-height: 50px; border-radius: 11px; font-size: 13px; gap: 2px; border-width: 1.5px; }
.seg button .ico { width: 20px; height: 20px; }
.seg button small { font-size: 10.5px; }
.seg-sm button { min-height: 38px; font-size: 12.5px; }
.seg-sm button .ico { width: 16px; height: 16px; }
.chips { gap: 6px; }
.chips button { min-height: 36px; padding: 6px 10px; border-radius: 10px; font-size: 13px; border-width: 1.5px; }
.chips button small { font-size: 10.5px; }
.stepper { margin-bottom: 2px; }
.step { width: 38px; height: 38px; font-size: 20px; }
.big { font-size: 28px; }
.big small { font-size: 13px; }
.range { height: 28px; }
.range::-webkit-slider-thumb { width: 22px; height: 22px; margin-top: -8px; border-width: 2.5px; }
.range::-webkit-slider-runnable-track, .range::-moz-range-track { height: 5px; }
.presets { margin-top: 4px; }
.elev-hint { margin-top: 6px; font-size: 11.5px; }
.cta { height: 46px; border-radius: 13px; font-size: 15px; gap: 8px; }
.btn { height: 38px; padding: 0 12px; border-radius: 10px; font-size: 13px; gap: 6px; }
.btn.sm { height: 32px; font-size: 12px; padding: 0 10px; }
.icon-btn { width: 36px; height: 36px; }

/* recherche en cours */
.searching { padding: 8px 0 12px; gap: 12px; }
.spinner { width: 32px; height: 32px; border-width: 3px; }

/* résultats */
.res-head { margin-bottom: 6px; }
.res-head .h2 { font-size: 16px; }
.card { padding: 10px; border-radius: 12px; border-width: 1.5px; }
.card-head { margin-bottom: 4px; font-size: 13px; }
.badge { font-size: 10.5px; padding: 2px 7px; }
.stat b { font-size: 16px; }
.stat span { font-size: 10.5px; }
.surfbar { height: 5px; margin: 6px 0 3px; }
.legend { font-size: 11px; gap: 2px 10px; }
.profile svg { height: 46px; }
.miss-list { font-size: 11.5px; margin-top: 6px; }
.dots { margin: 6px 0 8px; }
.actions { gap: 8px; margin-bottom: 8px; }
.actions .cta, .actions .gmaps { height: 42px; font-size: 14px; }
.actions3 { gap: 6px; }
.actions3 .btn { height: 36px; font-size: 12px; }
.note { margin-top: 8px; font-size: 11px; }

/* ---------- Pages ---------- */
.page { padding: calc(56px + var(--safe-t)) 10px 16px; }
.page-head { padding: 2px 2px 10px; }
.page-head h1 { font-size: 22px; }
.page-sub { font-size: 12px; margin-top: 2px; }
.empty { padding: 24px 12px; font-size: 13px; gap: 6px; }
.empty > .ico { width: 40px; height: 40px; }
.empty-t { font-size: 16px; }

/* Mes parcours : filtres + tri */
.saved-tools { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.saved-tools .filter { flex: 1; padding-bottom: 0; gap: 5px; min-width: 0; }
.filter button { height: 30px; padding: 0 11px; font-size: 12px; border-width: 1px; }
.sort { flex: none; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 12px; padding: 0 6px; }

/* Mes parcours : une carte par parcours, toutes les actions visibles */
.saved { gap: 8px; }
.ritem {
  display: grid; grid-template-columns: 56px 1fr; gap: 4px 10px; padding: 8px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line);
}
.r-thumb { grid-row: 1; width: 56px; height: 56px; border-radius: 9px; background: var(--surface-2); padding: 0; overflow: hidden; }
.r-thumb svg.thumb { width: 56px; height: 56px; }
.r-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; justify-content: center; }
.r-name { font-weight: 700; font-size: 13.5px; line-height: 1.25; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r-input { width: 100%; height: 32px; font-size: 16px; font-weight: 600; border: 1.5px solid var(--accent); border-radius: 8px; padding: 0 8px; background: var(--surface-2); color: var(--ink); outline: 0; }
.r-kpis { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 10px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.r-kpis b { font-weight: 700; }
.r-kpis .up { color: var(--up); }
.r-kpis span { color: var(--muted); font-size: 11px; }
.r-meta { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); min-width: 0; white-space: nowrap; overflow: hidden; }
.r-meta .ico { width: 14px; height: 14px; flex: none; }
.r-acts { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; padding-top: 6px; border-top: 1px solid var(--line); }
.r-acts > * {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 40px; border-radius: 8px;
  font-size: 9.5px; font-weight: 600; color: var(--muted); text-decoration: none; background: transparent;
}
.r-acts .ico { width: 17px; height: 17px; color: var(--ink); }
.r-acts > *:active { background: var(--surface-2); }
.r-acts .r-go { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.r-acts .r-go .ico { color: var(--accent); }
.r-acts .r-del .ico, .r-acts .r-del { color: var(--up); }
@media (hover: hover) { .r-acts > *:hover { background: var(--surface-2); } }

/* Toast avec « Annuler » */
.toast.with-act { display: flex; align-items: center; gap: 12px; }
.toast-act { color: #FFB27A; font-weight: 800; padding: 4px 2px; text-transform: uppercase; font-size: 12px; letter-spacing: .04em; }

/* ---------- Profil ---------- */
.profile-head { gap: 12px; }
.avatar { width: 46px; height: 46px; font-size: 19px; }
.profile-head h1 { font-size: 20px; }
.admin-link { padding: 9px 12px; margin-bottom: 10px; border-radius: 12px; gap: 10px; }
.admin-link b { font-size: 14px; }
.admin-link small { font-size: 11.5px; }
.group { margin-bottom: 10px; border-radius: 12px; }
.group-title { font-size: 10.5px; padding: 9px 12px 3px; }
.item { min-height: 42px; padding: 5px 12px; font-size: 13.5px; gap: 10px; }
.item input { height: 34px; }
.item.col { padding: 8px 12px; gap: 6px; }
.item.col small { font-size: 11.5px; }
.item b { font-size: 14px; }
.group .seg button { min-height: 36px; font-size: 12.5px; }
.sec-form .field { font-size: 11.5px; }
.sec-form input { height: 40px; }
.fb-row { gap: 6px; }
.legal-links { font-size: 11px; }

/* ---------- Choix du départ ---------- */
.picker .search { height: 44px; border-radius: 12px; }
.plist li { min-height: 48px; padding: 7px 4px; gap: 10px; }
.plist b { font-size: 14px; }
.plist small { font-size: 11.5px; }
.pico { width: 34px; height: 34px; }
.plist-title { font-size: 10.5px; }
.mappick { padding: 10px; }
.mappick-t { font-size: 14px; margin-bottom: 8px; }
.mappick .cta, .mappick .row .btn { height: 44px; }

/* ---------- Connexion ---------- */
.auth { padding: calc(14px + var(--safe-t)) 14px calc(16px + var(--safe-b)); }
.auth-step { gap: 16px; }
.hero { gap: 10px; }
.hero-mark { width: 84px; }
.wordmark.xl { font-size: 34px; }
.hero-tag { font-size: 15px; }
.hero-list { font-size: 13px; gap: 7px; }
.hl-dot { width: 10px; height: 10px; }
.auth-card { padding: 16px; gap: 10px; border-radius: 18px; }
.auth-card h2 { font-size: 21px; }
.auth-btn { height: 44px; font-size: 14.5px; }
.auth-note, .auth-link { font-size: 13px; }
.auth-legal, .form-hint { font-size: 11.5px; }
.auth .field { font-size: 12.5px; gap: 4px; }
.auth .field input { height: 44px; border-radius: 11px; }
.auth form { gap: 10px; }
.auth .seg button { min-height: 40px; }
.check { font-size: 13px; gap: 10px; }
.check input { width: 20px; height: 20px; }
.consent-list { font-size: 13px; gap: 3px; }
.eyebrow { font-size: 11px; }

dialog { padding: 16px; border-radius: 16px; }
dialog p { font-size: 13px; }

@media (min-width: 900px) {
  .page { padding-top: 70px; }
  .app-brand { top: 16px; }
  body[data-tab="plan"] .app-brand { left: 440px; }
}

/* Type de parcours : toujours sur une seule ligne (4 en vélo, 2 en course et marche) */
#kind { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 5px; }
#kind button { min-width: 0; padding: 6px 6px; text-align: center; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 1px; }
#kind button small { font-size: 9.5px; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Bouton retour des résultats : « ‹ Mes parcours » quand on vient de la liste */
.back-btn { display: inline-flex; align-items: center; gap: 2px; height: 34px; padding: 0 8px 0 2px; border-radius: 9px; color: var(--accent); font-weight: 700; font-size: 13.5px; }
.back-btn .ico { width: 20px; height: 20px; }
.back-btn:active { background: var(--surface-2); }
a.cta { text-decoration: none; }

/* ---------- Journal d'un parcours ---------- */
.r-log {
  display: inline-flex; align-items: center; gap: 5px; align-self: flex-start; max-width: 100%;
  margin: 2px 0 1px; padding: 3px 9px 3px 7px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
  background: var(--surface-2); color: var(--muted); border: 1px dashed var(--line); text-align: left;
}
.r-log span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-log .ico { width: 13px; height: 13px; flex: none; }
.r-log.done { background: color-mix(in srgb, var(--ok) 13%, transparent); color: var(--ok); border: 1px solid color-mix(in srgb, var(--ok) 30%, transparent); }
.r-log:active { transform: scale(.98); }
.ritem { grid-template-rows: auto auto; }

.logp {
  position: fixed; z-index: 29; left: 0; right: 0; top: 0; bottom: calc(var(--tabs-h) + var(--safe-b));
  background: var(--bg); overflow-y: auto; overscroll-behavior: contain;
  padding: calc(10px + var(--safe-t)) 10px 16px; display: flex; flex-direction: column; gap: 10px;
}
body.logp-open .app-brand, body.logp-open .lang-wrap { display: none; }
.logp-bar { display: flex; align-items: center; min-height: 36px; }
.logp-head { display: flex; flex-direction: column; gap: 3px; padding: 0 2px; }
.logp-name { font-size: 19px; font-weight: 800; letter-spacing: -.01em; line-height: 1.2; }
.logp-sub { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); }
.logp-sub .ico { width: 14px; height: 14px; }
.logp-sum { font-size: 12.5px; font-weight: 600; color: var(--ok); }
.logp .cta { position: static; }
.log-list { display: flex; flex-direction: column; gap: 8px; }
.log-item { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.log-top { display: flex; align-items: center; gap: 8px; }
.log-date { height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); padding: 0 8px; font: 600 16px/1 inherit; font-family: inherit; }
.log-ago { flex: 1; font-size: 11.5px; color: var(--muted); }
.log-del { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; color: var(--up); }
.log-del .ico { width: 17px; height: 17px; }
.log-del:active { background: var(--surface-2); }
.log-note {
  width: 100%; min-height: 54px; resize: vertical; border-radius: 9px; border: 1px solid var(--line); background: var(--surface-2);
  color: var(--ink); padding: 7px 9px; font: 16px/1.35 inherit; font-family: inherit; outline: 0;
}
.log-note:focus, .log-date:focus { border-color: var(--accent); }
.log-empty { margin: 4px 2px; font-size: 12.5px; color: var(--muted); }
@media (min-width: 900px) {
  .logp { left: 16px; right: auto; top: 16px; bottom: 90px; width: 410px; border-radius: 22px; box-shadow: var(--shadow); padding-top: 14px; }
}
#savedSummary:empty { display: none; }

/* Sorties : bouton d'ajout bien visible, enregistrement de la note explicite */
.r-log { border-style: solid; border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: color-mix(in srgb, var(--accent) 9%, transparent); color: var(--accent); }
.r-log .ico:last-child:not(:first-child) { margin-left: 1px; opacity: .7; }
.log-save { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-height: 0; }
.log-save:has(.log-save-btn[hidden]):has(.log-saved[hidden]) { display: none; }
.log-saved { display: inline-flex; align-items: center; gap: 4px; margin-right: auto; font-size: 11.5px; font-weight: 600; color: var(--ok); }
.log-saved .ico { width: 13px; height: 13px; }
.log-saved.pop { animation: pop .5s ease; }
@keyframes pop { 30% { transform: scale(1.08); } }
.log-save-btn { background: var(--accent); color: #fff; }
