:root {
  --bg: #f2f2f7;
  --card: #ffffff;
  --text: #1c1c1e;
  --muted: #8a8a8e;
  --sep: rgba(60, 60, 67, 0.16);
  --accent: #2563c9;
  --accent-soft: rgba(37, 99, 201, 0.12);
  --pos: #1f9d55;
  --neg: #d7372f;
  --warn: #b26a00;
  --warn-bg: #fff4de;
  --chip: #e9e9ee;
  --seg-on: #ffffff;
  --bar: rgba(242, 242, 247, 0.86);
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
  --radius: 12px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

/* Mode sombre : automatique (réglage de l'appareil) sauf si « Clair » est choisi dans les Réglages… */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --card: #1c1c1e;
    --text: #f2f2f7;
    --muted: #8e8e93;
    --sep: rgba(84, 84, 88, 0.6);
    --accent: #5b9bff;
    --accent-soft: rgba(91, 155, 255, 0.18);
    --pos: #3ecf7a;
    --neg: #ff6a5f;
    --warn: #ffb340;
    --warn-bg: #2e2412;
    --chip: #2c2c2e;
    --seg-on: #636366;
    --bar: rgba(0, 0, 0, 0.8);
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}

/* …ou forcé si « Sombre » est choisi */
:root[data-theme="dark"] {
  --bg: #000000;
  --card: #1c1c1e;
  --text: #f2f2f7;
  --muted: #8e8e93;
  --sep: rgba(84, 84, 88, 0.6);
  --accent: #5b9bff;
  --accent-soft: rgba(91, 155, 255, 0.18);
  --pos: #3ecf7a;
  --neg: #ff6a5f;
  --warn: #ffb340;
  --warn-bg: #2e2412;
  --chip: #2c2c2e;
  --seg-on: #636366;
  --bar: rgba(0, 0, 0, 0.8);
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.35 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
}
body.sheet-open { overflow: hidden; }

a { color: var(--accent); text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }

.muted { color: var(--muted); }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.grow { flex: 1; min-width: 0; }

/* ---------- Barre de navigation ---------- */

.bar {
  position: sticky; top: 0; z-index: 10;
  display: grid; grid-template-columns: minmax(80px, 1fr) auto minmax(80px, 1fr); align-items: center;
  gap: 8px;
  padding: calc(var(--safe-top) + 6px) 12px 8px;
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--sep);
}
/* Titre sur 2 lignes au maximum s'il est trop long */
.bar-title {
  margin: 0; font-size: 17px; line-height: 1.2; font-weight: 600; text-align: center; max-width: 56vw;
  overflow: hidden; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.bar-btn { min-height: 36px; display: inline-flex; align-items: center; color: var(--accent); }
.bar > :last-child { justify-self: end; }
.bar-btn.icon { width: 36px; justify-content: center; }
.bar-btn.text { font-size: 17px; }
.bar-btn.strong { font-weight: 600; }
.bar-btn.back { gap: 6px; }

.content {
  max-width: 720px; margin: 0 auto;
  padding: 16px 16px calc(var(--safe-bottom) + 110px);
}

/* ---------- Listes ---------- */

.list {
  list-style: none; margin: 0 0 20px; padding: 0;
  background: var(--card); border-radius: var(--radius); overflow: hidden;
}
.row {
  position: relative; display: flex; align-items: center; gap: 12px;
  min-height: 48px; padding: 10px 16px;
}
.row + .row::before {
  content: ""; position: absolute; top: 0; right: 0; left: 16px;
  border-top: 0.5px solid var(--sep);
}
.row[data-act], .row-link { cursor: pointer; }
.row[data-act]:active, .row-link:active { background: var(--chip); }
.chev { color: var(--muted); opacity: 0.6; flex: none; }

/* Monuments (SVG) : même encombrement qu'un emoji */
.mon-svg { display: inline-block; width: 1.15em; height: 1.15em; vertical-align: -0.2em; }
/* Drapeaux de régions (SVG) : même encombrement qu'un emoji */
.flag-svg {
  display: inline-block; width: 1.25em; height: 0.84em; vertical-align: -0.08em;
  border-radius: 2px; box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.25);
}

.title-icon { font-weight: 400; }

/* En tête du voyage : icône, nom et destination ; titre compact dans la barre une fois qu'il a défilé */
.trip-heading {
  display: flex; align-items: center; gap: 12px; margin: -2px 0 14px; padding-bottom: 14px;
  border-bottom: 0.5px solid var(--sep); text-align: left;
}
.heading-icon {
  flex: none; width: 48px; height: 48px; display: grid; place-items: center;
  border-radius: 13px; background: var(--chip); font-size: 28px; line-height: 1;
}
.heading-text { min-width: 0; }
.heading-text h2 { margin: 0; font-size: 28px; line-height: 1.15; font-weight: 700; overflow-wrap: break-word; }
.heading-text p { margin: 2px 0 0; font-size: 16px; color: var(--muted); }
.bar-title.compact { opacity: 0; transition: opacity 0.2s; }
.bar-title.compact.show { opacity: 1; }

.author-note { margin: 0 16px 12px; font-size: 13px; color: var(--muted); }
.small-muted { font-size: 12px; color: var(--muted); }

.section-title {
  display: flex; justify-content: space-between; margin: 20px 16px 6px;
  font-size: 13px; font-weight: 500; letter-spacing: 0.02em; text-transform: uppercase; color: var(--muted);
}
.section-title span:last-child { font-variant-numeric: tabular-nums; text-transform: none; }
.section-title .pos, .section-title .neg { opacity: 0.85; }

/* Liste des voyages : bandeaux photo (format 2:1), infos en bas sur fond opaque */
.trip-cards { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 14px; }
.trip-card a {
  position: relative; display: block; overflow: hidden; border-radius: 16px; color: #fff;
  background: var(--card); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}
.trip-card a:active { transform: scale(0.99); }
.trip-cover { display: block; width: 100%; aspect-ratio: 2 / 1; object-fit: cover; }
.trip-cover.no-photo {
  display: grid; place-items: start center; padding-top: 9%; font-size: 48px;
  background: linear-gradient(135deg, #4c8ef0, #1f4fb0);
}
.trip-band {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: flex-end; gap: 10px;
  padding: 8px 14px 9px; background: rgba(18, 18, 20, 0.82);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.trip-band .trip-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
/* Nom et détails sur une ligne chacun : la photo reste visible */
.trip-band .trip-name, .trip-band .trip-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trip-band .trip-name { font-size: 18px; font-weight: 700; line-height: 1.25; color: #fff; }
.trip-band .trip-sub { font-size: 13px; color: rgba(255, 255, 255, 0.78); }
.trip-count { flex: none; font-size: 13px; color: rgba(255, 255, 255, 0.78); }
.trip-card .trip-badge {
  position: absolute; top: 10px; right: 10px; padding: 3px 9px;
  background: rgba(255, 255, 255, 0.94); color: var(--accent); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}
.trip-card .trip-badge.current { background: var(--pos); color: #fff; }
.map-title-cover { width: 30px; height: 30px; border-radius: 8px; object-fit: cover; margin-left: -6px; }

/* Lieux faits : coche sur le marqueur, case à côté du nom sur la carte et dans la fiche */
.pin.done::after {
  content: "✓"; position: absolute; right: -6px; bottom: -4px; width: 16px; height: 16px; border-radius: 50%;
  display: grid; place-items: center; background: var(--pos); color: #fff; font-size: 10px; font-weight: 800;
  border: 1.5px solid #fff;
}
.pin { position: relative; }
.leaflet-tooltip.pin-label { pointer-events: auto; }
.pin-check { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.pin-label.is-done span { text-decoration: line-through; text-decoration-color: rgba(255, 255, 255, 0.6); }
.done-check { display: flex; align-items: flex-start; gap: 8px; }
.done-check input { flex: none; width: 22px; height: 22px; margin: 3px 0 0; accent-color: var(--pos); cursor: pointer; }
.done-mark { color: var(--pos); font-weight: 800; }

/* Suggestions de lieux sous le champ Nom */
.place-suggest { list-style: none; margin: 0; padding: 0 0 4px; border-top: 0.5px solid var(--sep); }
.place-suggest li[data-suggest] { display: flex; flex-direction: column; gap: 1px; padding: 9px 16px; cursor: pointer; }
.place-suggest li[data-suggest]:active, .place-suggest li[data-suggest]:hover { background: var(--accent-soft); }
.place-suggest b { font-size: 16px; font-weight: 600; }
.place-suggest span { font-size: 13px; color: var(--muted); }
.place-suggest .suggest-source {
  padding: 8px 16px 2px; font-size: 11px; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; color: var(--muted);
}
.place-suggest li.mine { cursor: pointer; display: flex; flex-direction: column; gap: 1px; padding: 9px 16px; }
.place-suggest li.mine:active, .place-suggest li.mine:hover { background: color-mix(in srgb, var(--pos) 14%, transparent); }
.place-suggest li.mine small { font-size: 13px; }

.existing-note {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px; margin: 0 0 14px; padding: 12px 14px;
  border-radius: var(--radius); background: color-mix(in srgb, var(--pos) 14%, var(--card)); font-size: 14px;
}
.existing-note span { color: var(--muted); }
.trips-of-place { margin-top: 4px; font-size: 13px; color: var(--muted); }
.pin-rating { font-size: 11px; font-weight: 700; color: #ffc53d; margin-left: 2px; }

/* Note et avis */
.rating-line { display: flex; align-items: baseline; gap: 10px; margin-top: 3px; font-size: 15px; }
.rating-avg { color: #e8a200; font-weight: 700; }
.rating-line .link { font-weight: 600; }
.reviews { margin-top: 8px; }
.review-list { list-style: none; margin: 0 0 12px; padding: 0; }
.review { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; cursor: pointer; }
.review:active .review-bubble { filter: brightness(0.96); }
/* Membre (grande pastille et prénom) et son avis dans une bulle de bande dessinée */
.review-who { flex: none; width: 58px; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.review-who span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 600; color: var(--muted); }
.avatar.review-avatar { width: 52px; height: 52px; font-size: 22px; }
.review-bubble {
  position: relative; flex: 1; min-width: 0; margin-top: 4px; padding: 9px 12px; border-radius: 16px;
  background: var(--chip); border: 1.5px solid var(--sep);
}
.review-bubble::before, .review-bubble::after { /* pointe de la bulle, vers le membre */
  content: ''; position: absolute; top: 16px; border-style: solid; border-color: transparent;
}
.review-bubble::before { left: -11px; border-width: 8px 11px 8px 0; border-right-color: var(--sep); }
.review-bubble::after { left: -8px; top: 17.5px; border-width: 6.5px 9px 6.5px 0; border-right-color: var(--chip); }
.avatar.small { width: 34px; height: 34px; font-size: 15px; }
.review-body { flex: 1; min-width: 0; }
.review-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.review-date { font-size: 13px; color: var(--muted); }
.review-rating { font-weight: 800; color: #e8a200; font-variant-numeric: tabular-nums; }
.review-comment { margin: 3px 0 0; font-size: 15px; line-height: 1.4; white-space: pre-line; overflow-wrap: break-word; }
/* Note : 10 étoiles, remplies jusqu'à celle touchée */
.rating-stars { display: grid; grid-template-columns: repeat(10, 1fr); padding: 0 8px 10px; }
.rating-stars label { position: relative; display: grid; place-items: center; height: 40px; cursor: pointer; }
.rating-stars input { position: absolute; opacity: 0; pointer-events: none; }
.rating-stars span {
  font-size: 30px; line-height: 1; color: transparent; -webkit-text-stroke: 1.5px var(--muted);
  transition: transform 0.12s, color 0.12s;
}
.rating-stars label.on span { color: #ffc53d; -webkit-text-stroke-color: #e8a200; }
.rating-stars input:checked + span { transform: scale(1.15); }
.rating-stars input:focus-visible + span { outline: 2px solid var(--accent); border-radius: 6px; }
.rating-value { color: #e8a200; font-size: 17px; }
.frow select[name=author] { direction: ltr; text-align: right; }

/* Photo du voyage (paramètres) : bandeau à cadrer */
.cover-edit { margin-bottom: 20px; }
.cover-frame {
  position: relative; aspect-ratio: 2 / 1; overflow: hidden; border-radius: 14px; background: var(--card);
  display: grid; place-items: center; color: var(--muted); font-size: 15px; touch-action: none;
}
.cover-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover-frame img.movable { cursor: grab; user-select: none; -webkit-user-drag: none; }
.cover-hint { margin: 6px 4px 0; font-size: 13px; color: var(--muted); text-align: center; }
.cover-actions { display: flex; gap: 6px; margin-top: 8px; }
.cover-actions .tool-btn { flex: 1; }

/* Accueil : tuiles Top de chaque catégorie, sur une ligne qui défile */
.home-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; min-width: 0; }
.home-trips { min-width: 0; }
.top-tiles {
  display: flex; gap: 10px; margin: 0 -16px; padding: 4px 16px 8px; overflow-x: auto; scrollbar-width: none;
  scroll-snap-type: x proximity; scroll-padding-inline: 16px; overscroll-behavior-x: contain;
}
.top-tiles::-webkit-scrollbar { display: none; }
.top-tile {
  flex: none; min-width: 104px; max-width: 170px; height: 104px; scroll-snap-align: start;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 8px; border-radius: 18px; text-align: center; color: #fff;
  background: linear-gradient(145deg, color-mix(in srgb, var(--c) 82%, #fff), var(--c));
  box-shadow: 0 3px 10px color-mix(in srgb, var(--c) 35%, transparent);
}
.top-tile:active { transform: scale(0.97); }
.top-tile-icon { font-size: 32px; line-height: 1; }
.top-tile-label { max-width: 100%; font-size: 13px; font-weight: 700; line-height: 1.15; overflow-wrap: normal; word-break: normal; hyphens: none; }
.top-tile-count { font-size: 11px; opacity: 0.85; }
@media (min-width: 900px) {
  .content.home { max-width: 980px; }
  .home-trips .trip-cards { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
}

/* Pages Top : filtres et classement */
.filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px; margin-bottom: 6px; }
.filter { display: flex; flex-direction: column; gap: 1px; min-width: 0; padding: 6px 10px; border-radius: 10px; background: var(--card); }
.filter span { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); }
.filter select { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 16px; color: var(--accent); padding: 1px 0; text-overflow: ellipsis; }
.filters-reset { margin: 4px 4px 0; font-size: 15px; }
.top-row { align-items: center; gap: 10px; padding-left: 10px; }
.top-rank { flex: none; width: 22px; text-align: center; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.top-row .thumb { width: 56px; height: 56px; }
.top-score { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 1px; font-size: 12px; color: var(--muted); }
.top-score b { font-size: 17px; }

/* Résumé du voyage */
.summary {
  background: var(--card); border-radius: var(--radius); padding: 18px 16px; text-align: center; margin-bottom: 8px;
}

/* Réglages */
.group-title { margin: 22px 16px 6px; font-size: 13px; font-weight: 400; text-transform: uppercase; letter-spacing: 0.02em; color: var(--muted); }
.group-note { margin: -12px 16px 20px; font-size: 13px; color: var(--muted); }
.setting .value { margin-left: auto; color: var(--muted); text-align: right; font-size: 15px; overflow: hidden; text-overflow: ellipsis; }
.setting .value.code { font-family: ui-monospace, Menlo, monospace; letter-spacing: 0.08em; color: var(--text); }
.setting.members { align-items: flex-start; }
.danger-text { color: var(--neg); }
.link { color: var(--accent); }
.link.small, .small { font-size: 15px; }
.link.strong { font-weight: 600; }
.version { text-align: center; color: var(--muted); font-size: 12px; }
.notice { margin-bottom: 16px; padding: 10px 14px; border-radius: 10px; background: var(--accent-soft); font-size: 14px; }
.hint { margin: 0 16px 10px; font-size: 14px; color: var(--muted); }

/* Vides / chargement */
.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty-icon { font-size: 48px; margin-bottom: 8px; }
.center-screen { min-height: 80vh; display: grid; place-content: center; text-align: center; gap: 8px; padding: 24px; }
.spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid var(--chip); border-top-color: var(--accent); animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Boutons */
.btn {
  display: inline-block; padding: 12px 20px; border-radius: 12px;
  background: var(--accent); color: #fff; font-weight: 600;
}
.btn.secondary { background: var(--accent-soft); color: var(--accent); }
.btn.wide { width: 100%; }
.btn:disabled { opacity: 0.5; }
.fab {
  position: fixed; right: max(20px, calc(50vw - 340px)); bottom: calc(var(--safe-bottom) + 24px); z-index: 5;
  width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: #fff; box-shadow: var(--shadow);
}
.fab:active { transform: scale(0.94); }
.action-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin: 0 0 12px;
  padding: 14px; border-radius: var(--radius); background: var(--card); color: var(--accent); font-weight: 500;
}
.danger-btn {
  display: block; width: 100%; margin: 8px 0 12px; padding: 14px; border-radius: var(--radius);
  background: var(--card); color: var(--neg); font-weight: 500;
}

/* ---------- Formulaires ---------- */

.group { background: var(--card); border-radius: var(--radius); margin-bottom: 20px; overflow: hidden; }
.frow {
  position: relative; display: flex; align-items: center; gap: 12px;
  min-height: 48px; padding: 6px 16px; width: 100%;
}
.frow + .frow::before, .frow + [hidden] + .frow::before {
  content: ""; position: absolute; top: 0; right: 0; left: 16px; border-top: 0.5px solid var(--sep);
}
.frow > span:first-child { flex: none; min-width: 88px; }
.frow input, .frow select, .frow textarea {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font-size: 17px; /* ≥16px : pas de zoom automatique sur iOS */
  text-align: right; padding: 6px 0;
}
/* Dates et heures : pastilles toujours visibles et faciles à toucher. Sur iPhone, un champ de date vide n'a ni texte
   ni largeur propre : sans largeur minimale, il disparaît. */
.frow input[type=date], .frow input[type=time] {
  -webkit-appearance: none; appearance: none; flex: 0 0 auto; min-height: 34px; padding: 4px 10px !important;
  border-radius: 8px; background: var(--chip) !important; color: var(--text); text-align: center !important;
  font-variant-numeric: tabular-nums; display: flex; align-items: center; justify-content: center;
}
.frow input[type=date] { min-width: 8.2em; }
.frow input[type=time] { min-width: 4.6em; }
.frow input[type=date]::-webkit-date-and-time-value, .frow input[type=time]::-webkit-date-and-time-value { text-align: center; }
.dt-wrap { position: relative; display: inline-flex; flex: 0 0 auto; }
.frow > .dt-wrap { margin-left: auto; }
.dt-wrap input:invalid { color: transparent !important; }
.dt-wrap:has(input:invalid)::after {
  content: attr(data-ph); position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--muted); font-size: 16px; pointer-events: none; font-variant-numeric: tabular-nums;
}
.frow input::-webkit-date-and-time-value { text-align: right; }
.frow.col { flex-direction: column; align-items: stretch; gap: 2px; padding-top: 10px; }
.frow.col textarea { text-align: left; resize: vertical; }
.frow select { direction: rtl; color: var(--accent); cursor: pointer; }
.frow select option, .frow select optgroup { direction: ltr; }

.segmented {
  display: grid; grid-template-columns: 1fr 1fr; padding: 2px; margin-bottom: 16px;
  background: var(--chip); border-radius: 9px;
}
.segmented input, .chip input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: block; text-align: center; padding: 7px; border-radius: 7px; font-size: 15px; font-weight: 500; cursor: pointer; }
.segmented input:checked + span { background: var(--seg-on); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15); }
.segmented input[value=expense]:checked + span { color: var(--neg); }
.segmented input[value=income]:checked + span { color: var(--pos); }
.segmented input:focus-visible + span, .chip input:focus-visible + span { outline: 2px solid var(--accent); }


.segmented.three { grid-template-columns: 1fr 1fr 1fr; }
.theme-choice { margin-bottom: 20px; }
.theme-note { margin-top: -12px !important; }
.segmented.nav-seg a { display: block; text-align: center; padding: 7px; border-radius: 7px; font-size: 15px; font-weight: 500; color: var(--text); }
.segmented.nav-seg a.on { background: var(--seg-on); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15); }


input.switch {
  flex: none !important; -webkit-appearance: none; appearance: none; position: relative;
  width: 51px; height: 31px; padding: 0 !important; border-radius: 16px; background: var(--chip) !important;
  transition: background 0.2s; cursor: pointer;
}
input.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25); transition: transform 0.2s;
}
input.switch:checked { background: var(--pos) !important; }
input.switch:checked::after { transform: translateX(20px); }
.frow:has(.switch) { justify-content: space-between; }

/* ---------- Voyages ---------- */

.trips .row { padding: 0; }
.row-link {
  flex: 1; display: flex; align-items: center; gap: 12px; min-width: 0;
  min-height: 64px; padding: 12px 16px; color: inherit;
}
.trip-icon {
  flex: none; width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: 11px; background: var(--chip); font-size: 22px; line-height: 1;
}
.trip-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.trip-name { font-size: 18px; font-weight: 600; line-height: 1.25; overflow-wrap: break-word; }
.trip-sub { font-size: 14px; color: var(--muted); overflow-wrap: break-word; }
.trip-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.badge {
  padding: 2px 8px; border-radius: 10px; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums;
  background: var(--accent-soft); color: var(--accent);
}
.badge.current { background: var(--pos); color: #fff; }


/* Étiquettes : référence copiable, « à payer » */
.step-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0; }
.tag {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 8px;
  background: var(--chip); color: var(--text); font-size: 13px; font-weight: 500;
}
.tag.code { font-family: ui-monospace, Menlo, monospace; letter-spacing: 0.04em; color: var(--accent); background: var(--accent-soft); }
.tag.due { background: var(--warn-bg); color: var(--warn); }
.tag:active { filter: brightness(0.9); }
.tag.not-placed { display: block; margin: 8px 0 12px; padding: 8px 12px; line-height: 1.35; }

/* Formulaires : catégorie d'un lieu, dates et heures */
.kind-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 16px; }
.kind-grid input { position: absolute; opacity: 0; pointer-events: none; }
.kind-grid span {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px;
  border-radius: 10px; border: 1.5px solid transparent; background: var(--card);
  font-size: 12px; font-weight: 500; text-align: center; cursor: pointer;
}
.kind-grid i { font-style: normal; font-size: 22px; line-height: 1.2; }
.kind-grid input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.kind-grid input:focus-visible + span { outline: 2px solid var(--accent); }
.date-time { flex: 1; min-width: 0; display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
.date-time input { flex: 0 0 auto !important; }
.frow input[name=price] { font-variant-numeric: tabular-nums; }
.frow select[name=currency] { flex: 0 0 auto; max-width: 7.5em; direction: ltr; text-align: right; }
@media (max-width: 380px) {
  .kind-grid { grid-template-columns: repeat(4, 1fr); }
  .frow > span:first-child { min-width: 76px; }
}

/* ---------- Page d'un voyage : carte et panneau ---------- */

body.map-mode { overflow: hidden; overscroll-behavior: none; }
.trip-page { position: fixed; inset: 0; }
.map { position: absolute; inset: 0; background: #e8e6e1; -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
.map-offline { display: grid; place-items: center; height: 100%; color: var(--muted); }
.leaflet-container { font: inherit; }
/* Fond de carte en mode sombre : couleurs inversées, teintes conservées.
   Par défaut la carte suit l'apparence de l'app ; data-map-theme (Réglages > Carte) la force en clair ou en sombre. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-map-theme]) .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(0.9) contrast(0.9); }
}
:root[data-theme="dark"]:not([data-map-theme]) .leaflet-tile-pane,
:root[data-map-theme="dark"] .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(0.9) contrast(0.9); }
.leaflet-control-attribution { font-size: 10px; }

.map-top {
  position: absolute; z-index: 600; top: calc(var(--safe-top) + 10px); left: 12px; right: 12px;
  display: flex; align-items: center; gap: 8px; pointer-events: none;
}
.map-top > * { pointer-events: auto; }
.map-btn {
  flex: none; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px;
  background: rgba(60, 60, 67, 0.72); color: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.map-btn.off { opacity: 0.5; }
.map-done { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; line-height: 1; padding: 0; text-align: center; }
.map-done b { display: block; font-size: 16px; height: 16px; line-height: 16px; }
.map-done small { font-size: 10px; font-weight: 600; white-space: nowrap; }
.map-done.done { background: rgba(48, 176, 99, 0.92); }
.map-done.todo { background: rgba(232, 137, 12, 0.92); }
.map-title {
  flex: 0 1 auto; min-width: 0; display: flex; align-items: center; gap: 6px; height: 46px; padding: 0 14px;
  margin-right: auto; border-radius: 14px; background: rgba(60, 60, 67, 0.72); color: #fff;
  font-weight: 600; font-size: 15px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.map-title-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 420px) { .map-title { visibility: hidden; flex: 1; } }

/* Marqueurs : icône de la catégorie dans une pastille de sa couleur */
.pin {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: #fff; border: 3px solid var(--c); font-size: 17px; line-height: 1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3); transition: transform 0.15s;
}
.pin.selected { transform: scale(1.3); background: var(--c); box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.85), 0 3px 10px rgba(0, 0, 0, 0.35); }
.pin.suggested { opacity: 0.9; outline: 2px dashed var(--c); outline-offset: 4px; }
.pin.dim { opacity: 0.35; }
.leaflet-tooltip.pin-label {
  display: none; padding: 3px 8px; border: 0; border-radius: 7px; background: rgba(44, 44, 46, 0.85);
  color: #fff; font-size: 13px; font-weight: 500; line-height: 1.25; box-shadow: none;
  white-space: normal; width: max-content; max-width: 170px; /* nom long : sur 2 lignes */
}
.pin-label .pin-check > span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.leaflet-tooltip.pin-label::before { display: none; }
.show-labels .leaflet-tooltip.pin-label, .leaflet-tooltip.pin-label.on { display: block; }
.leaflet-tooltip.pin-label.label-hidden { display: none; } /* pas de place libre autour du point */
.day-pin {
  display: inline-grid; place-items: center; min-width: 44px; height: 26px; padding: 0 8px; border-radius: 13px;
  background: #fff; color: var(--d, var(--accent)); border: 2px solid var(--d, var(--accent)); font-size: 13px; font-weight: 800;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.day-pin.on { background: var(--d, var(--accent)); color: #fff; }
.day-pin.static { flex: none; }
/* Jour prévu, sur le point du lieu (une couleur par jour) */
.pin-day {
  position: absolute; top: -14px; left: 20px; padding: 2px 7px; border-radius: 11px; background: var(--d); color: #fff;
  border: 2px solid #fff; font-size: 13px; font-weight: 800; line-height: 1.25; white-space: nowrap;
  font-variant-numeric: tabular-nums; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35); cursor: pointer;
}
.pin.selected .pin-day { transform: scale(0.77); transform-origin: left bottom; }
.pin-day { padding-right: 10px; }
.pin-slot { /* petit rond blanc avec l'icône du moment de la journée, sur le bord droit de la pastille */
  position: absolute; right: -9px; display: grid; place-items: center; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; color: #444; border: 1px solid var(--d); font-style: normal; font-size: 10px; line-height: 1;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
.pin-slot.s0 { top: -8px; }                              /* matin : en haut à droite */
.pin-slot.s1 { top: 50%; transform: translateY(-50%); }  /* après-midi : au milieu à droite */
.pin-slot.s2 { bottom: -8px; }                           /* soir : en bas à droite */
/* Fond de l'icône : bleu ciel le jour (matin, après-midi), bleu nuit le soir */
.pin-slot.s0, .pin-slot.s1 { background: #8fd3ff; border-color: #fff; }
.pin-slot.s2 { background: #14213d; border-color: #fff; }
/* Heure prévue sans date : l'icône seule, à la place de la pastille du jour */
.pin-day.solo { width: 0; padding: 0; border: 0; background: none; box-shadow: none; top: -10px; left: 24px; }
.pin-day.solo .pin-slot { right: -8px; top: 0; bottom: auto; transform: none; }
/* Dans la fiche d'un lieu, à côté de la catégorie */
.pin-day.inline {
  position: relative; top: auto; left: auto; display: inline-block; margin-left: 8px; vertical-align: 1px;
  font-size: 12px; box-shadow: none; cursor: default;
}
.pin-day.inline.solo { width: 16px; height: 16px; margin-left: 6px; vertical-align: -3px; }
.pin-day.inline.solo .pin-slot { right: 0; }

.pick-banner {
  position: absolute; z-index: 700; left: 12px; right: 12px; top: calc(var(--safe-top) + 66px);
  display: flex; flex-direction: column; gap: 8px; padding: 12px 16px; border-radius: 14px;
  background: var(--card); box-shadow: var(--shadow); font-size: 15px; font-weight: 500;
}
@media (min-width: 900px) { .pick-banner { left: auto; width: 420px; } }
.pick-row { display: flex; align-items: center; gap: 12px; }
.pick-row span { flex: 1; }
.pick-search {
  width: 100%; padding: 9px 12px; border: 0; outline: 0; border-radius: 10px; background: var(--chip);
  font-size: 16px; color: var(--text);
}
.pick-results { list-style: none; margin: 0 -16px -12px; padding: 0 0 6px; max-height: 45vh; overflow-y: auto; border-top: 0.5px solid var(--sep); }
.pick-results li { display: flex; flex-direction: column; gap: 1px; padding: 9px 16px; cursor: pointer; font-weight: 400; }
.pick-results li[data-i]:hover, .pick-results li[data-i]:active { background: var(--accent-soft); }
.pick-results b { font-weight: 600; }
.pick-results span { font-size: 13px; color: var(--muted); }
body.picking .map-fab, body.picking .panel { display: none; }
body.picking .map { cursor: crosshair; }

/* Panneau des lieux : en bas de la carte (téléphone), à gauche (grand écran) */
.panel {
  position: absolute; z-index: 650; left: 0; right: 0; bottom: 0; height: 46%;
  display: flex; flex-direction: column; background: var(--card);
  border-radius: 18px 18px 0 0; box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  transition: height 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.panel[data-size="min"] { height: 120px; }
.panel[data-size="full"] { height: calc(100% - var(--safe-top) - 72px); }
.panel.dragging { transition: none; }
.panel-grip { flex: none; display: grid; place-items: center; height: 26px; cursor: grab; touch-action: none; }
.panel-grip span { width: 40px; height: 5px; border-radius: 3px; background: var(--sep); }
@media (min-width: 900px) {
  .panel, .panel[data-size] {
    top: calc(var(--safe-top) + 70px); bottom: 16px; left: 16px; right: auto; width: var(--panel-w, 400px); height: auto !important;
    border-radius: 18px;
  }
  .panel-grip { display: none; }
  .map-title { margin-left: calc(var(--panel-w, 400px) + 4px); }
  /* Bord droit du panneau : glisser pour changer sa largeur (double-clic : largeur d'origine) */
  .panel-resize {
    position: absolute; top: 18px; bottom: 18px; right: -7px; width: 14px; z-index: 2; cursor: ew-resize; touch-action: none;
  }
  .panel-resize::after {
    content: ''; position: absolute; top: 50%; left: 5px; width: 4px; height: 44px; margin-top: -22px; border-radius: 2px;
    background: var(--sep); transition: background 0.15s;
  }
  .panel-resize:hover::after, .panel.resizing .panel-resize::after { background: var(--accent); }
  .panel.resizing { transition: none; user-select: none; }
}
@media (max-width: 899px) { .panel-resize { display: none; } }
/* Onglets du panneau : Itinéraire, Tout, une pastille colorée par catégorie, puis Rechercher, sur une ligne qui défile */
.tabs { flex: none; border-bottom: 0.5px solid var(--sep); }
.cat-pills {
  display: flex; gap: 2px; padding: 4px 8px 8px; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain;
}
.cat-pills::-webkit-scrollbar { display: none; }
.cat-pill {
  flex: none; width: 66px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0 3px; border-radius: 12px;
  color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: -0.2px;
}
.cat-pill-icon {
  position: relative; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; font-size: 22px;
  background: color-mix(in srgb, var(--c) 18%, var(--card)); border: 2px solid color-mix(in srgb, var(--c) 45%, transparent);
  transition: transform 0.15s;
}
.cat-pill-count {
  position: absolute; top: -4px; right: -8px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  display: grid; place-items: center; background: var(--c); color: #fff; border: 2px solid var(--card);
  font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.cat-pill-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-pill.on { color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); }
.cat-pill.on .cat-pill-icon { background: var(--c); border-color: var(--c); transform: scale(1.06); box-shadow: 0 2px 8px color-mix(in srgb, var(--c) 50%, transparent); }
.cat-pill.on .cat-pill-name { font-weight: 700; }
.cat-pill.ghost:not(.on) .cat-pill-icon { opacity: 0.5; border-style: dashed; }
.panel-body {
  flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  padding: 8px 16px calc(var(--safe-bottom) + 90px);
}
.map-fab { z-index: 660; }
.panel-empty { margin: 16px 0; color: var(--muted); font-size: 15px; }
.panel-title { margin: 18px 0 4px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); }

.trip-summary { padding: 6px 0 4px; font-size: 15px; }
.trip-summary .muted { margin-top: 2px; font-size: 14px; }
.trip-status-inline { font-weight: 600; color: var(--accent); }
.trip-status-inline.current { color: var(--pos); }
.trip-memo { margin: 8px 0 0; font-size: 14px; color: var(--muted); white-space: pre-line; }

/* Listes du panneau : lieux, jours, vols */
.place-list, .day-list { list-style: none; margin: 0; padding: 0; }
.place-row, .day-row, .flight-row {
  position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; cursor: pointer;
}
.flight-row { cursor: default; }
.place-row + .place-row, .day-row + .day-row, .flight-row + .flight-row { border-top: 0.5px solid var(--sep); }
.place-row:active, .day-row:active { background: var(--chip); }
.day-row { align-items: center; }
.thumb { flex: none; width: 64px; height: 64px; border-radius: 12px; object-fit: cover; background: var(--chip); }
.thumb-icon { display: grid; place-items: center; font-size: 28px; background: color-mix(in srgb, var(--c) 18%, var(--card)); }
.flight-icon { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--chip); font-size: 20px; }
.place-text { flex: 1; min-width: 0; }
.place-name { font-size: 17px; font-weight: 600; line-height: 1.25; overflow-wrap: break-word; }
.place-meta { margin-top: 2px; font-size: 14px; color: var(--muted); overflow-wrap: break-word; }
.place-meta sup { font-size: 10px; color: var(--warn); }
.place-dist { color: var(--accent); font-weight: 600; font-variant-numeric: tabular-nums; }
/* Filtre par ville, au-dessus de la liste d'une catégorie */
.city-filter {
  display: flex; gap: 6px; margin: 2px -16px 6px; padding: 2px 16px 4px; overflow-x: auto; scrollbar-width: none;
}
.city-filter::-webkit-scrollbar { display: none; }
.city-chip {
  flex: none; padding: 6px 12px; border-radius: 16px; background: var(--chip); color: var(--text);
  font-size: 14px; font-weight: 600; white-space: nowrap;
}
.city-chip span { margin-left: 2px; color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.city-chip.on { background: var(--accent); color: #fff; }
.city-chip.on span { color: rgba(255, 255, 255, 0.8); }
.done-chip.done { background: var(--pos); color: #fff; }
.done-chip.todo { background: #e8890c; color: #fff; }
.done-chip.done span, .done-chip.todo span { color: rgba(255, 255, 255, 0.85); }
.chip-sep { flex: none; width: 1px; margin: 4px 2px; background: var(--sep); }
.chip-sep:last-child { display: none; }
/* Case « fait » à gauche d'un lieu, dans la liste des lieux */
.row-check { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--pos); cursor: pointer; align-self: center; }
.place-row.is-done .place-name { color: var(--muted); }
.place-desc { margin-top: 3px; font-size: 14px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.place-text .tag { margin-top: 6px; }
.day-head { display: flex; align-items: center; gap: 10px; margin: 10px 0 6px; }
.day-head h2 { margin: 0; font-size: 20px; }

.search-box {
  display: flex; align-items: center; gap: 8px; margin: 6px 0; padding: 0 12px; border-radius: 12px;
  background: var(--chip); color: var(--muted);
}
.search-box input { flex: 1; min-width: 0; padding: 10px 0; border: 0; outline: 0; background: transparent; font-size: 17px; color: var(--text); }


/* Fiche d'un lieu */
.detail-top { display: flex; align-items: center; justify-content: space-between; min-height: 32px; }
.panel-back { display: inline-flex; align-items: center; gap: 6px; padding: 6px 0; color: var(--accent); font-size: 16px; }
.panel-back svg { width: 9px; height: 15px; }
/* Lieux suggérés (autres voyages), en bas de la liste d'une catégorie */
.place-list.suggested .thumb { opacity: 0.85; }
.place-list.suggested .place-name { color: var(--muted); }
.add-to-trip { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin: 4px 0 14px; }
.add-to-trip svg { width: 20px; height: 20px; }
.detail-head { display: flex; gap: 14px; margin: 6px 0 10px; }
.detail-head h2 { margin: 0; font-size: 22px; line-height: 1.2; overflow-wrap: break-word; }
.detail-photo { flex: none; width: 112px; height: 112px; border-radius: 16px; object-fit: cover; background: var(--chip); }
.detail-photo.thumb-icon { font-size: 48px; }
.cat-chip {
  display: inline-block; margin-top: 4px; padding: 2px 9px; border-radius: 8px; font-size: 13px; font-weight: 600;
  color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent);
}
.detail-when { margin-top: 6px; font-size: 14px; font-weight: 600; color: var(--accent); }
.detail-desc { margin: 0 0 10px; font-size: 16px; line-height: 1.45; white-space: pre-line; }
.info-list { list-style: none; margin: 12px 0; padding: 0; }
.info-list li { display: flex; gap: 12px; padding: 9px 0; font-size: 15px; border-top: 0.5px solid var(--sep); }
.info-list li > span { flex: none; width: 22px; text-align: center; }
.info-list li > div { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.info-list .pre { white-space: pre-line; }
.directions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; color: var(--muted); font-size: 14px; }
.directions a {
  padding: 4px 10px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 14px;
}
.info-list .ig { font-weight: 700; color: #d6249f; }
.info-list .g { font-weight: 800; color: #4285f4; }
.info-list .tc { font-weight: 800; color: #287dfa; }
.info-list .yt { font-weight: 800; color: #ff0033; font-size: 13px; }
.info-list .or { font-weight: 800; color: #f5a623; font-size: 11px; }
.panel-body .action-btn { background: var(--chip); }

/* Fiche d'un lieu (formulaire) */
.cat-grid { grid-template-columns: repeat(4, 1fr); }
@media (min-width: 560px) { .cat-grid { grid-template-columns: repeat(6, 1fr); } }
.import-box { margin-bottom: 8px; }
.import-box input { text-align: left !important; }
.sheet-note {
  margin: 0 0 14px; padding: 10px 14px; border-radius: var(--radius);
  background: var(--accent-soft); color: var(--text); font-size: 14px;
}
.photo-box { display: flex; gap: 12px; align-items: center; margin-bottom: 20px; }
.photo-preview {
  flex: none; width: 96px; height: 96px; border-radius: 14px; overflow: hidden; background: var(--card);
  display: grid; place-items: center; color: var(--muted); font-size: 12px; text-align: center;
}
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-actions { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.tool-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 8px;
  border-radius: 10px; background: var(--card); color: var(--accent); font-size: 15px; font-weight: 500; cursor: pointer;
}
.tool-btn.busy { opacity: 0.5; pointer-events: none; }
.position-text { color: var(--muted); font-size: 15px; text-align: right; }
details.booking > summary { cursor: pointer; list-style: revert; }
.country-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px 4px; }
.country-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 16px;
  background: var(--accent-soft); color: var(--text); font-size: 15px;
}
.country-chip small { font-size: 11px; font-weight: 600; color: var(--accent); }
.country-chip span { color: var(--muted); font-size: 12px; }
.frow select[name=country_add] { direction: ltr; text-align: right; }
/* Membres de la famille */
.avatar { flex: none; width: 42px; height: 42px; border-radius: 50%; object-fit: cover; }
.avatar-initial { display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 18px; }
.person-row { align-items: center; }
/* Catégories (Réglages) */
.cat-row { align-items: center; }
.cat-row .grow { line-height: 1.3; }
.cat-dot {
  flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; font-size: 19px;
  background: color-mix(in srgb, var(--c) 18%, var(--card)); border: 2px solid color-mix(in srgb, var(--c) 55%, transparent);
}
.cat-dot.big { width: 72px; height: 72px; font-size: 38px; border-width: 3px; }
.cat-preview { display: grid; place-items: center; margin: 4px 0 14px; }
.icon-input { font-size: 22px; }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 4px; margin: -6px 0 16px; }
.emoji-grid button { height: 40px; border-radius: 10px; font-size: 22px; background: var(--card); }
.color-grid { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 16px 12px; }
.color-grid button { width: 28px; height: 28px; border-radius: 50%; background: var(--c); }
.frow input[type=color] { flex: none; width: 44px; min-width: 0; height: 30px; padding: 0; border: 0; background: none; }
.person-row .grow { line-height: 1.3; }
.row.link { color: var(--accent); }
.person-photo { display: flex; gap: 14px; align-items: center; margin-bottom: 20px; }
.photo-preview.round { border-radius: 50%; }
/* Recadrage d'une photo de membre : cadre carré, partie gardée en rond */
.crop-box { margin-bottom: 16px; }
.crop-frame {
  position: relative; width: min(260px, 100%); aspect-ratio: 1; margin: 0 auto; overflow: hidden; border-radius: 16px;
  background: #000; touch-action: none; cursor: grab;
}
.crop-frame::after { /* assombrit les coins hors du rond */
  content: ''; position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  box-shadow: 0 0 0 200px rgba(0, 0, 0, 0.55); outline: 2px solid rgba(255, 255, 255, 0.85); outline-offset: -2px;
}
.crop-img { position: absolute; left: 0; top: 0; max-width: none; transform-origin: 0 0; user-select: none; -webkit-user-drag: none; }
.crop-zoom { display: flex; align-items: center; gap: 10px; width: min(260px, 100%); margin: 10px auto 0; color: var(--muted); font-size: 20px; }
.crop-zoom input { flex: 1; accent-color: var(--accent); }

/* Villes du voyage */
.destination-text { text-align: right; color: var(--muted); font-size: 16px; }
.city-results { list-style: none; margin: 0; padding: 0 0 6px; border-top: 0.5px solid var(--sep); }
.city-results li { padding: 10px 16px; cursor: pointer; font-size: 16px; }
.city-results li span { font-size: 13px; color: var(--muted); }
.city-results li[data-found]:hover, .city-results li[data-found]:active { background: var(--accent-soft); }
.frow input[name=city_q] { text-align: left; }
.frow select[name=map_lang] { direction: ltr; text-align: right; }

.flight-head { min-height: 40px; font-weight: 600; }
.flights .group { margin-bottom: 12px; }
.choice { cursor: pointer; }
.choice input { flex: none !important; width: 20px; accent-color: var(--accent); }
.trip-icon.small { width: 30px; height: 30px; font-size: 17px; border-radius: 8px; }
.break { word-break: break-all; font-weight: 500; }

/* ---------- Feuille modale ---------- */

.sheet-backdrop {
  position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, 0);
  display: flex; align-items: flex-end; justify-content: center; transition: background 0.25s;
}
.sheet-backdrop.open { background: rgba(0, 0, 0, 0.35); }
.sheet {
  width: 100%; max-width: 640px; max-height: calc(100% - var(--safe-top) - 12px);
  display: flex; flex-direction: column;
  background: var(--bg); border-radius: 14px 14px 0 0; box-shadow: var(--shadow);
  transform: translateY(100%); transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.sheet-backdrop.open .sheet { transform: none; }
@media (min-width: 700px) {
  .sheet-backdrop { align-items: center; }
  .sheet { border-radius: 14px; max-height: 90vh; }
}
.sheet-bar {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px;
  padding: 14px 16px; border-bottom: 0.5px solid var(--sep);
}
.sheet-bar h2 { margin: 0; font-size: 17px; font-weight: 600; text-align: center; }
.sheet-bar .link:first-child { justify-self: start; }
.sheet-bar .link:last-child { justify-self: end; }
.sheet-bar button:disabled { opacity: 0.4; }
.sheet-body {
  overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch;
  padding: 16px 16px calc(var(--safe-bottom) + 16px);
}
.sheet { overflow: hidden; }
.sheet-body { flex: 1 1 auto; min-height: 0; }

.sheet-error {
  margin: 0 0 14px; padding: 12px 14px; border-radius: var(--radius);
  background: var(--warn-bg); color: var(--neg); font-size: 15px; font-weight: 500;
}

/* ---------- Connexion ---------- */

.auth {
  max-width: 420px; margin: 0 auto; padding: calc(var(--safe-top) + 48px) 16px 48px;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px;
}
.auth h1 { margin: 8px 0 0; font-size: 28px; }
.auth-logo { width: 84px; height: 84px; border-radius: 20px; box-shadow: var(--shadow); }
.auth-form { width: 100%; margin: 16px 0 8px; text-align: left; }
.auth-form .group { margin-bottom: 12px; }
.auth-form .frow > span:first-child { min-width: 110px; }
.auth .group-title { margin-left: 16px; }

/* ---------- Toast ---------- */

/* En haut de l'écran : reste visible quand le clavier de l'iPhone est ouvert */
#toast {
  position: fixed; left: 50%; top: calc(var(--safe-top) + 60px); z-index: 100;
  transform: translate(-50%, -20px); opacity: 0; pointer-events: none;
  max-width: min(92vw, 480px); padding: 12px 18px; border-radius: 12px;
  background: rgba(30, 30, 32, 0.94); color: #fff; font-size: 15px; text-align: center;
  transition: opacity 0.2s, transform 0.2s;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

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


/* Accueil : la famille (une pastille par membre) */
.family-pills {
  display: flex; gap: 14px; margin: 0 -16px; padding: 4px 16px 12px; overflow-x: auto; scrollbar-width: none;
}
.family-pills::-webkit-scrollbar { display: none; }
.family-pill { flex: none; width: 78px; display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; color: var(--text); }
.family-pill b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.family-pill span { font-size: 11px; color: var(--muted); }
.family-pill:active { transform: scale(0.96); }
.avatar.big { width: 66px; height: 66px; font-size: 26px; box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--accent); }
.avatar.huge { width: 112px; height: 112px; font-size: 44px; box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.9), 0 6px 20px rgba(0, 0, 0, 0.3); }

/* Page d'un membre */
.member-page { padding-top: 0; }
.mp-hero {
  position: relative; overflow: hidden; margin: 8px 0 18px; padding: 14px; border-radius: 20px; color: #fff;
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(150deg, color-mix(in srgb, var(--accent) 70%, #8e4ec6), color-mix(in srgb, var(--accent) 80%, #000));
  isolation: isolate;
}
.mp-hero[style]::before { /* photo du membre, floutée en fond */
  content: ''; position: absolute; inset: -30px; z-index: -1; background: var(--bg) center / cover; filter: blur(24px) brightness(0.6) saturate(1.3);
}
.mp-hero .avatar.huge { width: 116px; height: 116px; font-size: 44px; }
.mp-hero-text { flex: 1; min-width: 0; }
.mp-hero h2 { margin: 0; font-size: 22px; line-height: 1.2; overflow-wrap: break-word; }
.mp-comment { margin: 2px 0 0; opacity: 0.85; font-size: 14px; }
.mp-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-top: 8px; }
.mp-stats span {
  display: flex; align-items: baseline; gap: 5px; padding: 4px 8px; border-radius: 9px; background: rgba(255, 255, 255, 0.16);
  font-size: 12px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.mp-stats b { font-size: 16px; font-variant-numeric: tabular-nums; }
.mp-favs { display: flex; gap: 12px; margin: 0 -16px 22px; padding: 2px 16px 10px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; scroll-padding-inline: 16px; }
.mp-favs::-webkit-scrollbar { display: none; }
.mp-fav {
  position: relative; flex: none; width: 150px; height: 200px; overflow: hidden; border-radius: 18px; scroll-snap-align: start;
  background: linear-gradient(150deg, color-mix(in srgb, var(--c) 75%, #fff), var(--c)); color: #fff; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}
.mp-fav img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mp-fav-icon { position: absolute; inset: 0 0 40%; display: grid; place-items: center; font-size: 56px; }
.mp-fav::after { content: ''; position: absolute; inset: 40% 0 0; background: linear-gradient(transparent, rgba(0, 0, 0, 0.78)); }
.mp-fav-score {
  position: absolute; top: 8px; right: 8px; z-index: 1; padding: 3px 8px; border-radius: 12px;
  background: rgba(0, 0, 0, 0.55); color: #ffc53d; font-size: 13px; font-weight: 800;
}
.mp-fav-text { position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 1; display: flex; flex-direction: column; gap: 2px; }
.mp-fav-text b { font-size: 15px; line-height: 1.2; overflow-wrap: break-word; }
.mp-fav-text small { font-size: 12px; opacity: 0.9; }

.mp-country { margin-bottom: 26px; }
.mp-country-banner {
  position: relative; height: 130px; overflow: hidden; border-radius: 18px; background: linear-gradient(135deg, #3e63dd, #8e4ec6) center / cover;
  background-size: cover; background-position: center;
}
.mp-country-banner::after { content: ''; position: absolute; inset: 0; background: linear-gradient(transparent 25%, rgba(0, 0, 0, 0.7)); }
.mp-country-title { position: absolute; left: 14px; right: 14px; bottom: 10px; z-index: 1; color: #fff; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.mp-country-title h2 { margin: 0; font-size: 24px; }
.mp-country-title span:last-child { font-size: 13px; opacity: 0.9; }
.mp-flag { font-size: 28px; align-self: center; }
.mp-city-title { display: flex; align-items: center; gap: 8px; margin: 16px 2px 8px; font-size: 17px; }
.mp-city-title img, .mp-city-dot { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; display: grid; place-items: center; background: var(--card); font-size: 15px; }
.mp-city-title small { color: var(--muted); font-weight: 500; font-size: 14px; }
.mp-places { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 10px; }
@media (min-width: 760px) { .mp-places { grid-template-columns: 1fr 1fr; } }
.mp-place { padding: 12px; border-radius: 16px; background: var(--card); cursor: pointer; }
.mp-place-head { display: flex; gap: 12px; }
.mp-rating { margin-top: 4px; color: #e8a200; font-size: 15px; font-weight: 700; }
.mp-reviews { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.mp-reviews li { padding: 8px 10px; border-radius: 12px; background: var(--chip); font-size: 14px; }
.mp-review-meta { display: block; color: var(--muted); font-size: 12px; }
.mp-review-meta b { color: #e8a200; }
.mp-reviews q { display: block; margin-top: 3px; font-style: italic; line-height: 1.4; white-space: pre-line; overflow-wrap: break-word; }
.mp-reviews q::before { content: '« '; } .mp-reviews q::after { content: ' »'; }
.mp-hero .avatar-initial { background: rgba(255, 255, 255, 0.22); color: #fff; }
.family-pill .avatar-initial { background: color-mix(in srgb, var(--accent) 22%, var(--card)); }
.photo-preview[hidden] { display: none; }

/* Fiche d'un lieu : choix rapide du jour (J1, J2…) et du moment (matin, après-midi, soir) */
.day-picker { padding: 10px 0 2px; border-bottom: 0.5px solid var(--sep); }
.day-chips { position: relative; display: flex; gap: 6px; padding: 0 16px 8px; overflow-x: auto; scrollbar-width: none; }
.day-chips::-webkit-scrollbar { display: none; }
.day-chip { min-width: 46px; height: 32px; border-radius: 16px; font-size: 14px; cursor: pointer; }
.slot-chips { display: flex; gap: 6px; padding: 0 16px 8px; }
.slot-chip {
  flex: 1; height: 34px; border-radius: 17px; background: var(--chip); color: var(--text);
  font-size: 14px; font-weight: 600; white-space: nowrap; cursor: pointer;
}
.slot-chip.on { background: var(--accent); color: #fff; }

/* Planning : nom du voyage avec l'accès à ses paramètres ; un lieu par ligne, avec le moment et l'heure */
.trip-summary-head { display: flex; align-items: flex-start; gap: 8px; }
.trip-summary-head > div { flex: 1; min-width: 0; }
.icon-btn { flex: none; display: grid; place-items: center; width: 30px; height: 30px; margin: -4px -4px 0 0; border-radius: 50%; color: var(--accent); }
.icon-btn svg { width: 20px; height: 20px; }
.plan-places { margin-top: 3px; display: grid; gap: 4px; }
.plan-place { display: flex; align-items: center; gap: 4px; font-size: 14px; color: var(--muted); min-width: 0; }
.plan-place small { flex: none; width: 30px; font-size: 11px; font-variant-numeric: tabular-nums; }
.plan-place span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.slot-time { display: inline-flex; align-items: center; gap: 4px; vertical-align: top; }
.pin-slot.inline-slot { position: static; flex: none; transform: none; width: 16px; height: 16px; font-size: 10px; border-color: transparent; box-shadow: none; }
.inline-slot.no-slot { flex: none; width: 16px; } /* sans heure : même alignement */

/* Planning : pastille du jour et date sur la même ligne, puis les lieux alignés à gauche */
.day-row.plan-day { flex-direction: column; align-items: stretch; gap: 6px; }
.plan-day-head { display: flex; align-items: center; gap: 10px; }
.plan-day-head .place-name { flex: 1; min-width: 0; }
.plan-day .plan-places { margin-top: 0; }
.trip-dest { margin-top: 2px; font-size: 14px; }

/* Vols (paramètres du voyage) : aéroport et terminal, suppression d'un vol */
.airport-row input[data-f=from], .airport-row input[data-f=to] { flex: 1; min-width: 0; }
.airport-row .terminal { flex: none; width: 64px; margin-left: 8px; padding: 4px 6px; border-radius: 8px; background: var(--chip); text-align: center !important; }
.flight-remove { color: var(--neg, #e5484d); font-size: 14px; font-weight: 500; }
.terminal-tag { padding: 1px 5px; border-radius: 5px; background: var(--chip); color: var(--muted); font-size: 11px; font-weight: 600; vertical-align: 2px; }
.danger-btn.armed { background: var(--neg, #e5484d); color: #fff; }
.plan-flight-no { width: auto !important; margin-left: 2px; color: var(--muted); font-size: 11px; }

/* Aéroports sur la carte */
.pin.airport { --c: #1d3a6e; background: #1d3a6e; color: #fff; font-size: 16px; }
.pin.airport.selected { background: #1d3a6e; }
.static-pin { flex: none; width: 34px; height: 34px; }

/* Vols : pastille du jour en couleur, date et heures plus foncées */
.flight-when b { color: var(--text); font-weight: 500; }
.day-pin.mini { min-width: 0; height: 20px; padding: 0 7px; border-radius: 10px; font-size: 11px; vertical-align: 1px; }

/* Choix d'un emplacement : point rouge à confirmer */
.pick-confirm { padding: 6px 14px; border-radius: 16px; background: var(--accent); color: #fff; font-weight: 600; }
.pick-confirm:disabled { opacity: 0.4; }
.pick-marker {
  display: block; width: 30px; height: 30px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  background: #e5484d; border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4); cursor: grab;
}
.pick-marker::after { content: ''; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px; border-radius: 50%; background: #fff; }

/* Catégorie seule sur la carte : pastille entourée */
.cat-pill.solo .cat-pill-icon { box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--c); }

/* Photo d'un lieu en plein écran */
.detail-photo.zoomable { cursor: zoom-in; }
.photo-full {
  position: fixed; inset: 0; z-index: 3000; display: grid; place-items: center; background: rgba(0, 0, 0, 0.94);
  padding: var(--safe-top) 0 var(--safe-bottom); cursor: zoom-out; animation: photo-in 0.15s ease-out;
}
.photo-full img { max-width: 100%; max-height: 100%; object-fit: contain; }
@keyframes photo-in { from { opacity: 0; } }

/* Planning : nom du voyage et villes cliquables (cadrent la carte) */

/* Planning : nom du voyage (cadre toutes les villes) et villes en pastilles (centrent la carte) */
.trip-name-link { display: inline-flex; align-items: center; gap: 6px; padding: 0; color: inherit; font: inherit; text-align: left; }
.trip-name-link b { font-size: 17px; }
.fit-icon {
  display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 700;
}
.trip-dest { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.city-link {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 14px;
  background: var(--accent-soft); color: var(--accent); font-size: 14px; font-weight: 600;
}
.city-link:active, .trip-name-link:active .fit-icon { transform: scale(0.95); }
/* Journée : afficher tous les lieux sur la carte, ou seulement ceux du jour */
.day-show-all {
  display: inline-flex; align-items: center; gap: 6px; margin: 0 0 10px; padding: 6px 12px; border-radius: 16px;
  background: var(--chip); color: var(--accent); font-size: 14px; font-weight: 600;
}
.day-show-all.on { background: var(--accent); color: #fff; }

/* Journée : liens vers la journée précédente et la suivante */
.day-nav { display: flex; justify-content: space-between; gap: 10px; margin: 18px 0 4px; padding-top: 14px; border-top: 0.5px solid var(--sep); }
.day-nav-btn {
  display: inline-flex; align-items: center; gap: 6px; max-width: 50%; padding: 8px 12px; border-radius: 14px;
  background: var(--chip); color: var(--text); font-size: 22px; font-weight: 300; line-height: 1;
}
.day-nav-btn.next { margin-left: auto; }
.day-nav-btn .day-pin { flex: none; }
.day-nav-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 500; color: var(--muted); }
.day-nav-btn:active { transform: scale(0.97); }

/* Réglages › Lieux enregistrés */
.pa-row { align-items: flex-start; }
.pa-row .place-meta i { color: var(--warn, #c4710e); font-style: normal; }
.pa-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pa-btn {
  position: relative; display: inline-flex; align-items: center; padding: 5px 11px; border-radius: 14px;
  background: var(--chip); color: var(--accent); font-size: 13px; font-weight: 600; cursor: pointer;
}
.pa-btn.danger { color: var(--neg); }
.pa-btn select { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.places-admin { margin-bottom: 16px; }

/* Planning : météo prévue du jour, à droite de la date */
.weather { flex: none; display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 12px; background: var(--chip); color: var(--text); font-size: 16px; line-height: 1.2; }
.weather:empty { display: none; }
.weather small { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Ordinateur : toutes les pastilles de catégories visibles, sur plusieurs lignes (téléphone : une ligne qui défile) */
@media (min-width: 900px) {
  .cat-pills { flex-wrap: wrap; overflow: visible; row-gap: 4px; }
}

/* Avis : choix du membre en pastilles, photos de l'avis */
.member-pick { display: flex; gap: 12px; overflow-x: auto; padding: 6px 6px 12px; margin-bottom: 8px; scrollbar-width: none; }
.member-pick::-webkit-scrollbar { display: none; }
.member-pill { flex: none; width: 64px; display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; text-align: center; }
.member-pill input { position: absolute; opacity: 0; pointer-events: none; }
.member-pill .avatar { width: 52px; height: 52px; font-size: 22px; box-shadow: 0 0 0 2px var(--card); transition: box-shadow 0.15s, transform 0.15s; }
.member-pill span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--muted); }
.member-pill:has(input:checked) .avatar { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--accent); transform: scale(1.05); }
.member-pill:has(input:checked) span { color: var(--accent); font-weight: 700; }
.review-photos { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.review-photos.strip { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.review-photos.strip::-webkit-scrollbar { display: none; }
.review-thumb { position: relative; flex: none; }
.review-thumb img { display: block; width: 72px; height: 72px; border-radius: 10px; object-fit: cover; cursor: zoom-in; background: var(--chip); }
.review-thumb button {
  position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%;
  background: rgba(0, 0, 0, 0.75); color: #fff; font-size: 15px; line-height: 1;
}
.photo-actions.row { flex-direction: row; margin-bottom: 16px; }
.photo-actions.row .tool-btn { flex: 1; }
.review-photo-count { margin-top: 4px; font-size: 12px; color: var(--muted); }
/* Galerie plein écran */
.photo-full .pf-btn {
  position: absolute; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.18); color: #fff; font-size: 30px; line-height: 1; cursor: pointer;
}
.pf-close { top: calc(var(--safe-top) + 12px); right: 12px; }
.pf-prev { left: 10px; top: 50%; transform: translateY(-50%); }
.pf-next { right: 10px; top: 50%; transform: translateY(-50%); }
.pf-count { position: absolute; bottom: calc(var(--safe-bottom) + 14px); left: 50%; transform: translateX(-50%); color: #fff; font-size: 14px; opacity: 0.8; }
.photo-full { cursor: default; }
/* Panneau : la famille et ses lieux préférés */
.family-cards { list-style: none; margin: 0; padding: 0; }
.family-card { display: flex; align-items: center; gap: 12px; padding: 12px 0; cursor: pointer; }
.family-card + .family-card { border-top: 0.5px solid var(--sep); }
.family-card .avatar.big { width: 52px; height: 52px; font-size: 22px; }
.fav-mini { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 2px; font-size: 13px; color: var(--muted); }
.fav-mini li { display: flex; gap: 4px; min-width: 0; }
.fav-mini span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.fav-mini b { flex: none; color: #e8a200; font-weight: 700; }

.review-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.review-rating.photo-only { color: var(--muted); }

/* Réglages › Lieux : photos d'un lieu */
.pp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; margin-bottom: 12px; }
.pp-item { margin: 0; }
.pp-item .review-thumb img { width: 100%; height: auto; aspect-ratio: 1; }
.pp-item figcaption { margin-top: 3px; font-size: 11px; color: var(--muted); line-height: 1.25; }

/* Pastille de la famille (photo, sinon 👨‍👩‍👧) */
.cat-pill-icon .fam-photo { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.cat-pill-icon .fam-emoji { font-size: 22px; }
.fam-title { display: inline-flex; align-items: center; gap: 8px; }
.fam-mini { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
span.fam-mini { display: inline-grid; place-items: center; font-size: 15px; }
.fam-avatar { flex: none; }
span.fam-avatar { display: grid; place-items: center; font-size: 22px; background: var(--accent-soft); }

/* Galerie : légende (membre et date) en bas de la photo */
.pf-caption {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; gap: 12px;
  padding: 28px 16px calc(var(--safe-bottom) + 14px); background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
  color: #fff; font-size: 15px; font-weight: 600; pointer-events: none;
}
.pf-caption .pf-count { position: static; transform: none; font-weight: 400; opacity: 0.8; }
.mp-photos { margin-bottom: 22px; }
.mp-photos .review-thumb img { width: 86px; height: 86px; }

/* Bulle d'avis : le commentaire, puis la note et la date en dernière ligne */
.review-bubble .review-comment { margin: 0 0 4px; }
.review-bubble .review-head { font-size: 13px; }
.review-bubble .review-photo-count { margin: 0 0 0 auto; }

/* Page d'un membre : ses goûts */
.tastes { margin-bottom: 22px; }
.tastes-list { list-style: none; margin: 0 0 10px; padding: 12px 14px; border-radius: 16px; background: var(--card); display: grid; gap: 6px; font-size: 15px; }
.tastes-ai {
  margin: 0; padding: 12px 14px; border-radius: 16px; font-size: 15px; line-height: 1.5; white-space: pre-line;
  background: linear-gradient(135deg, color-mix(in srgb, #8e4ec6 12%, var(--card)), color-mix(in srgb, #0090ff 10%, var(--card)));
}
.tastes-meta { display: inline; margin: 4px 4px 10px; font-size: 12px; color: var(--muted); }
.redo-summary { margin-left: 6px; padding: 0; font-size: 12px; color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }

/* Restaurants : notes nourriture et service */
.rating-group [data-stars] + [data-stars] { border-top: 0.5px solid var(--sep); }
.rating-total { color: #e8a200; font-size: 17px; }
.review-sub, .rating-sub { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Description d'un lieu : listes avec cases à cocher */
.check-item { display: flex; align-items: flex-start; gap: 9px; padding: 4px 0; font-size: 16px; line-height: 1.35; cursor: pointer; }
.check-item input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--pos); cursor: pointer; }
.check-item.done span { color: var(--muted); text-decoration: line-through; }

/* Fiche d'un lieu : nom en haut, à côté du retour */
.detail-top { align-items: flex-start; gap: 6px; }
.detail-top .panel-back { flex: none; padding: 4px 6px 4px 0; }
.detail-top .panel-back svg { width: 11px; height: 19px; }
.detail-name { flex: 1; min-width: 0; margin: 0; }
.detail-name h2, h2.detail-name { margin: 0; font-size: 21px; line-height: 1.2; overflow-wrap: break-word; }
.detail-top .link.strong { flex: none; padding-top: 2px; }
/* Liste à cocher d'un lieu */
.checklist { margin: 4px 0 12px; }
.checklist .panel-title { display: flex; justify-content: space-between; margin-top: 8px; }
.checklist-count { font-variant-numeric: tabular-nums; }
.cl-row { gap: 10px; }
.cl-row .cl-done { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--pos); }
.cl-row .cl-text { flex: 1; min-width: 0; text-align: left !important; }
.cl-remove { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--chip); color: var(--muted); font-size: 16px; }
.cl-add { justify-content: flex-start; color: var(--accent); font-weight: 600; width: 100%; }

/* Hors ligne */
.offline-btn { margin-top: 8px; padding: 5px 12px; border-radius: 14px; background: var(--chip); color: var(--accent); font-size: 13px; font-weight: 600; }
.offline-box { padding: 12px 16px; }
.offline-status { margin: 0; font-size: 15px; line-height: 1.45; }
.offline-progress { width: 100%; margin-top: 10px; accent-color: var(--accent); }
