/* Notre carte — feuille de style principale (jetons, composants partagés, mise en page, carte, vues, connexion). */

/* ---------- Jetons ---------- */

:root {
  --bg: #fffaf7;  --surface: #ffffff;  --surface-2: #fdf2f4;  --surface-3: #f7e8ec;
  --text: #2b2024;  --muted: #7a6a70;  --border: #eedde2;
  --primary: #e11d48;  --primary-hover: #be123c;  --primary-soft: #ffe4ea;  --on-primary: #ffffff;
  --danger: #dc2626;  --success: #15803d;  --warning: #b45309;
  --radius: 16px;  --radius-sm: 10px;  --radius-pill: 999px;
  --shadow: 0 12px 32px rgba(76, 24, 40, .14);  --shadow-sm: 0 2px 8px rgba(76, 24, 40, .10);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-title: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --topbar-h: 60px;  --panel-w: 420px;  --tabbar-h: 64px;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ring: 0 0 0 3px rgba(225, 29, 72, .22);
  --wish: #d97706;
  --wish-soft: #fff4e0;
  color-scheme: light;
}

@media (max-width: 767.98px) {
  :root { --topbar-h: 52px; }
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-title);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: .005em;
}

p, figure, ul, ol { margin: 0; }
img { max-width: 100%; }
a { color: var(--primary); text-underline-offset: 2px; }
a:hover { color: var(--primary-hover); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
small { font-size: .85em; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; }

/* Anneau au clavier seulement ; sans :focus-visible (Safari < 15.4), l'anneau par défaut reste. */
:focus:not(:focus-visible) { outline: none; }
:focus-visible {
  outline: 3px solid rgba(225, 29, 72, .5);
  outline-offset: 2px;
}

[hidden] { display: none !important; }

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.icon { flex: none; display: inline-block; vertical-align: middle; }

/* ---------- Utilitaires partagés ---------- */

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

.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------- Boutons ---------- */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--text);
  font-size: .95rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: background-color .15s, color .15s, border-color .15s, box-shadow .15s, transform .12s;
}
.btn:hover { background: var(--surface-3); color: var(--text); }
.btn:active { transform: scale(.97); }
.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: 0 4px 14px rgba(225, 29, 72, .28);
}
.btn-primary:hover { background: var(--primary-hover); color: var(--on-primary); }
.btn-primary:disabled { box-shadow: none; }

.btn-ghost {
  background: transparent;
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--surface-2); border-color: var(--surface-3); }

.btn-danger {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 4px 14px rgba(220, 38, 38, .25);
}
.btn-danger:hover { background: #b91c1c; color: #fff; }

.btn-sm {
  min-height: 36px;
  padding: 6px 14px;
  gap: 6px;
  font-size: .875rem;
}

.btn-block { display: flex; width: 100%; }

.btn-icon {
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 50%;
  flex: none;
}
.btn-icon.btn-sm { width: 36px; height: 36px; min-height: 36px; }
.btn-ghost.btn-icon { border-color: transparent; }

/* Bouton occupé : le libellé s'efface derrière un petit indicateur */
.btn.is-busy {
  color: transparent !important;
  pointer-events: none;
}
.btn.is-busy::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border-radius: 50%;
  border: 2.5px solid rgba(43, 32, 36, .18);
  border-top-color: var(--text);
  animation: spin .7s linear infinite;
}
.btn-primary.is-busy::after,
.btn-danger.is-busy::after {
  border-color: rgba(255, 255, 255, .35);
  border-top-color: #fff;
}

@media (pointer: coarse) {
  .btn-sm { min-height: 44px; }
  .btn-icon.btn-sm { width: 44px; height: 44px; min-height: 44px; }
}

/* ---------- Champs ---------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.field > span,
.field > legend {
  font-size: .875rem;
  font-weight: 600;
  color: var(--text);
}
.field > legend { margin-bottom: 6px; }

.field input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="hidden"]),
.field select,
.field textarea,
.search-field input {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 16px; /* évite le zoom automatique de Safari iOS */
  line-height: 1.4;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea {
  min-height: 88px;
  resize: vertical;
  line-height: 1.5;
}
.field select {
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%237a6a70' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.field input::placeholder,
.field textarea::placeholder,
.search-field input::placeholder { color: #b3a3a9; }

.field input:focus,
.field select:focus,
.field textarea:focus,
.search-field input:focus {
  border-color: var(--primary);
  box-shadow: var(--ring);
  outline: none;
}
.field [aria-invalid="true"] {
  border-color: var(--danger) !important;
}
.field [aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(220, 38, 38, .2); }

.field-error {
  color: var(--danger);
  font-size: .85rem;
  font-weight: 500;
}
.field-hint { font-size: .85rem; }

/* ---------- Pastilles de choix ---------- */

.chips { gap: 8px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text);
  font-size: .9rem;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: background-color .15s, border-color .15s, color .15s;
}
.chip:hover { border-color: rgba(225, 29, 72, .45); }
.chip:has(input:focus-visible) {
  outline: 3px solid rgba(225, 29, 72, .5);
  outline-offset: 2px;
}
.chip-active {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-hover);
  font-weight: 600;
}
.chip .icon { color: currentColor; }
.chip-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px rgba(43, 32, 36, .1);
}

/* Deux règles : un navigateur sans :has() ignorerait la liste entière. */
.chip:disabled { cursor: default; opacity: .65; }
.chip:has(input:disabled) { cursor: default; opacity: .65; }
.chip-count {
  min-width: 22px;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--muted);
  font-size: .76rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.chip-active .chip-count { background: rgba(255, 255, 255, .75); color: var(--primary-hover); }

/* Puces de personne (avatar + nom) et de filtre : pastille grisée tant que la puce est inactive. */
.person-chip { padding-left: 7px; }
.person-chip .avatar,
.filter-chip .avatar { box-shadow: none; }
.person-chip .avatar,
.filter-chip .avatar,
.filter-chip .legend-pin { transition: filter .15s, opacity .15s; }
.person-chip:not(.chip-active) .avatar,
.filter-chip:not(.chip-active) .avatar,
.filter-chip:not(.chip-active) .legend-pin { filter: grayscale(1); opacity: .5; }

@media (pointer: coarse) {
  .chip { min-height: 44px; }
}

/* Douze mois à bascule (J F M A M J J A S O N D), le mois en cours souligné */
.months {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 4px;
}
.month-chip {
  min-width: 0;
  height: 36px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  font-size: .82rem;
  font-weight: 700;
  transition: background-color .15s, border-color .15s, color .15s, transform .12s;
}
.month-chip:hover { border-color: rgba(225, 29, 72, .45); color: var(--text); }
.month-chip:active { transform: scale(.93); }
.month-chip.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}
.month-chip.is-current { box-shadow: inset 0 -3px 0 var(--wish); }
.month-chip.is-active.is-current { box-shadow: inset 0 -3px 0 rgba(255, 255, 255, .8); }
.month-chip:disabled { cursor: default; opacity: .6; }

@media (pointer: coarse) {
  .months { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
  .month-chip { height: 44px; font-size: .9rem; }
}

/* ---------- Badges ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1.5;
  white-space: nowrap;
}
.badge .icon { width: 14px; height: 14px; }
.badge-visited { background: var(--primary-soft); color: var(--primary-hover); }
.badge-visited .icon { fill: currentColor; }
.badge-wish { background: var(--wish-soft); color: #92400e; }
.badge-wish .icon { fill: currentColor; }
.badge-upcoming { background: #e0f2fe; color: #075985; }
/* Voyage prévu : petit avion plein */
.badge-planned { background: #0369a1; color: #fff; }
.badge-planned svg { fill: currentColor; stroke-width: 0; }
.badge-season { background: #ecfccb; color: #3f6212; }

/* ---------- Cartes ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
a.card,
button.card {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: transform .15s var(--ease), box-shadow .15s, border-color .15s;
}
a.card:hover,
button.card:hover {
  color: inherit;
  border-color: var(--surface-3);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
a.card:active,
button.card:active { transform: scale(.99); }

/* ---------- État vide ---------- */

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 32px 12px;
  text-align: center;
}
.empty-icon {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin-bottom: 6px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #fff 0%, var(--primary-soft) 70%);
  color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--border), 0 8px 20px rgba(225, 29, 72, .12);
}
.empty-title {
  font-family: var(--font-title);
  font-size: 1.3rem;
  font-weight: 600;
}
.empty .muted { max-width: 34ch; }
.empty .btn { margin-top: 8px; }

/* ---------- Pastilles personne et pays ---------- */

.avatar {
  --avatar-size: 28px;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: var(--avatar-size);
  height: var(--avatar-size);
  border-radius: 50%;
  font-size: calc(var(--avatar-size) * .44);
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 0 0 2px var(--surface);
  user-select: none;
  -webkit-user-select: none;
}

.avatar-stack { display: inline-flex; align-items: center; }
.avatar-stack .avatar + .avatar { margin-left: -8px; }

.cc {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  min-width: 28px;
  height: 20px;
  padding: 0 5px;
  border-radius: 6px;
  background: var(--surface-3);
  color: var(--text);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .06em;
  line-height: 1;
}
.cc-unknown { color: var(--muted); }

/* ---------- Sections de panneau ---------- */

.panel-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.panel-actions > .btn { flex: 1 1 auto; }

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.1rem;
}
.section-title > .icon { color: var(--primary); }
.section-count {
  margin-left: auto;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--muted);
  font-family: var(--font);
  font-size: .8rem;
  font-weight: 700;
}

/* ---------- Indicateur de chargement ---------- */

.spinner {
  display: inline-block;
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2.5px solid var(--primary-soft);
  border-top-color: var(--primary);
  vertical-align: middle;
  animation: spin .75s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Coquille de l'application ---------- */

/* Deux règles distinctes : un navigateur sans :has() ignorerait la liste entière. */
html:has(body.app-page) { height: 100%; }
body.app-page { height: 100%; }
body.app-page {
  overflow: hidden;
  overscroll-behavior: none;
}
body.app-page > noscript {
  display: block;
  padding: 32px 16px;
  text-align: center;
}
html.modal-open body { overflow: hidden; }

.app-fatal {
  padding: 48px 16px;
  text-align: center;
  color: var(--muted);
}

/* ---------- Barre du haut ---------- */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 16px;
  height: calc(var(--topbar-h) + var(--safe-top));
  padding: var(--safe-top) calc(16px + var(--safe-right)) 0 calc(16px + var(--safe-left));
  background: rgba(255, 250, 247, .9);
  border-bottom: 1px solid var(--border);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--text);
  text-decoration: none;
  flex: none;
}
.brand:hover { color: var(--text); }
.brand-logo {
  width: 32px;
  height: 32px;
  flex: none;
  transition: transform .3s var(--ease);
}
.brand:hover .brand-logo { transform: rotate(-8deg) scale(1.06); }
.brand-name {
  font-family: var(--font-title);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: .01em;
}

.topbar-stats {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  min-width: 0;
  padding-left: 16px;
  border-left: 1px solid var(--border);
  color: var(--muted);
  font-size: .88rem;
  white-space: nowrap;
  overflow: hidden;
}
.topbar-stats:empty { display: none; }
.stat { font-variant-numeric: tabular-nums; }
.stat-sep { margin: 0 7px; opacity: .55; }

.topnav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.topnav-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  color: var(--text);
  font-size: .95rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color .15s, color .15s;
}
.topnav-link:hover { background: var(--surface-2); color: var(--text); }
.topnav-link[aria-current="page"] { background: var(--primary-soft); color: var(--primary-hover); }
.topnav-add { margin: 0 4px 0 6px; }
/* « Nous » : nos deux pastilles et le mot, comme l'onglet du téléphone */
.topnav-profile {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 4px 14px 4px 5px;
  border-radius: var(--radius-pill);
  color: var(--text);
  font-size: .95rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color .15s, color .15s;
}
.topnav-profile:hover { background: var(--surface-2); color: var(--text); }
.topnav-profile[aria-current="page"] { background: var(--primary-soft); color: var(--primary-hover); }
.topnav-avatar { display: inline-flex; transition: transform .15s var(--ease); }
.topnav-avatar .avatar { box-shadow: 0 0 0 2px var(--bg); }
.topnav-profile:hover .topnav-avatar { transform: scale(1.05); }

/* « ♥ N jours » à côté du nom de l'app (bureau) */
.topbar-days {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  min-height: 32px;
  padding: 4px 10px;
  margin-left: -6px;
  border-radius: var(--radius-pill);
  color: var(--primary-hover);
  font-size: .86rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color .15s;
}
.topbar-days:hover { background: var(--primary-soft); color: var(--primary-hover); }
.topbar-days-heart { display: inline-block; color: var(--primary); }
.topbar-days:hover .topbar-days-heart { animation: heart-pop .5s var(--ease); }

/* ---------- Zone de carte ---------- */

.map-area {
  position: fixed;
  top: calc(var(--topbar-h) + var(--safe-top));
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
  isolation: isolate;
}
.map {
  position: absolute;
  inset: 0;
  z-index: 0;
}

/* ---------- Panneau (bureau : à gauche) ---------- */

.panel {
  position: fixed;
  top: calc(var(--topbar-h) + var(--safe-top));
  left: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  width: var(--panel-w);
  max-width: 100vw;
  background: var(--surface);
  border-right: 1px solid var(--border);
  box-shadow: var(--shadow);
  visibility: hidden;
  transform: translateX(-104%);
  transition: transform .34s var(--ease), visibility 0s linear .34s;
}
.panel.is-open {
  visibility: visible;
  transform: none;
  transition: transform .34s var(--ease), visibility 0s;
}

.panel-grip { display: none; }

.panel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 12px 12px calc(20px + var(--safe-left));
  border-bottom: 1px solid var(--border);
}
.panel-title {
  flex: 1;
  min-width: 0;
  font-size: 1.5rem;
  overflow-wrap: anywhere;
}
.panel-title:focus { outline: none; }
.panel-close { color: var(--muted); }
.panel-close:hover { color: var(--text); }

.panel-body {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 18px 20px 36px calc(20px + var(--safe-left));
  scrollbar-width: thin;
  scrollbar-color: var(--surface-3) transparent;
}
.panel-body > * { animation: content-in .28s var(--ease) both; }

/* ---------- Barre d'onglets (mobile) ---------- */

.tabbar { display: none; }

/* Tablette, petit portable : la barre du haut s'allège (les jours restent dans « Nous »). */
@media (min-width: 768px) and (max-width: 1099.98px) {
  .topbar-days,
  .stat-places,
  .stat-sep-places { display: none; }
  .topnav-profile { padding-right: 5px; }
  .topnav-profile-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

/* ---------- Mobile : barre compacte, feuille du bas, onglets ---------- */

@media (max-width: 767.98px) {
  .topbar {
    gap: 10px;
    padding-left: calc(12px + var(--safe-left));
    padding-right: calc(12px + var(--safe-right));
  }
  .brand { gap: 8px; }
  .brand-logo { width: 28px; height: 28px; }
  .brand-name { font-size: 1.12rem; }
  .topbar-stats {
    margin-left: auto;
    padding-left: 0;
    border-left: 0;
    font-size: .8rem;
  }
  .stat-places,
  .stat-sep-places { display: none; }
  .topnav,
  .topbar-days { display: none; }

  .map-area { bottom: calc(var(--tabbar-h) + var(--safe-bottom)); }

  .panel {
    top: auto;
    right: 0;
    bottom: calc(var(--tabbar-h) + var(--safe-bottom));
    width: auto;
    height: var(--sheet-h, 62vh);
    border-right: 0;
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -10px 34px rgba(76, 24, 40, .18);
    transform: translateY(calc(100% + var(--tabbar-h) + var(--safe-bottom)));
    transition: transform .36s var(--ease), height .3s var(--ease), visibility 0s linear .36s;
  }
  .panel.is-open {
    transform: none;
    transition: transform .36s var(--ease), height .3s var(--ease), visibility 0s;
  }
  .panel.is-dragging { transition: none; }

  .panel-grip {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: none;
    width: 100%;
    height: 22px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: grab;
    touch-action: none;
  }
  .panel-grip:focus-visible { outline-offset: -4px; border-radius: 12px; }
  .panel-handle {
    width: 42px;
    height: 5px;
    border-radius: var(--radius-pill);
    background: #dcc9cf;
    transition: background-color .15s, width .2s var(--ease);
  }
  .panel-grip:hover .panel-handle,
  .panel.is-dragging .panel-handle { background: #c4aab2; width: 52px; }

  .panel-header {
    padding: 2px 8px 10px 20px;
    border-bottom: 0;
    touch-action: none;
  }
  .panel-title { font-size: 1.28rem; }
  .panel[data-snap="peek"] .panel-body { overflow: hidden; }

  .panel-body {
    padding: 4px 16px calc(24px + var(--safe-bottom)) 16px;
  }

  .tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: stretch;
    height: calc(var(--tabbar-h) + var(--safe-bottom));
    padding: 0 var(--safe-right) var(--safe-bottom) var(--safe-left);
    background: rgba(255, 255, 255, .94);
    border-top: 1px solid var(--border);
    -webkit-backdrop-filter: saturate(1.4) blur(14px);
    backdrop-filter: saturate(1.4) blur(14px);
  }
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  min-height: 44px;
  color: var(--muted);
  font-size: .7rem;
  font-weight: 600;
  text-decoration: none;
  user-select: none;
  -webkit-user-select: none;
}
.tab:hover { color: var(--text); }
.tab-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 30px;
  border-radius: var(--radius-pill);
  transition: background-color .2s, color .2s, transform .15s;
}
.tab:active .tab-icon { transform: scale(.92); }
.tab[aria-current="page"] { color: var(--primary-hover); }
.tab[aria-current="page"] .tab-icon { background: var(--primary-soft); }

.tab-add .tab-icon {
  width: 48px;
  height: 48px;
  margin-top: -18px;
  border-radius: 50%;
  background: linear-gradient(145deg, #f43f5e, var(--primary) 55%, var(--primary-hover));
  color: #fff;
  box-shadow: 0 6px 16px rgba(225, 29, 72, .38), 0 0 0 4px rgba(255, 255, 255, .95);
}
.tab-add[aria-current="page"] .tab-icon { background: var(--primary-hover); }
.tab-add .tab-label { margin-top: 1px; }

/* « Nous » : nos deux pastilles dans la même pilule que les icônes des autres onglets */
.tab-avatar {
  display: grid;
  place-items: center;
  width: 52px;
  height: 30px;
  border-radius: var(--radius-pill);
  transition: background-color .2s, transform .15s;
}
.tab:active .tab-avatar { transform: scale(.92); }
.tab-avatar .avatar { box-shadow: 0 0 0 2px #fff; }
.tab[aria-current="page"] .tab-avatar { background: var(--primary-soft); }
.tab[aria-current="page"] .tab-avatar .avatar { box-shadow: 0 0 0 2px var(--primary-soft); }

@media (max-width: 359.98px) {
  .brand-name { display: none; }
}

@keyframes content-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Carte Leaflet ---------- */

.map.leaflet-container {
  background: #ebe6df;
  font-family: var(--font);
  font-size: .85rem;
}
.map.is-satellite.leaflet-container { background: #1f2a2e; }
/* Fond « Plan » (OpenStreetMap, très coloré) adouci pour laisser ressortir les marqueurs. */
.map:not(.is-satellite) .leaflet-tile-pane { filter: saturate(.62) brightness(1.04); }
.map.leaflet-grab.is-picking,
.map.is-picking .leaflet-interactive:not(.place-marker):not(.cluster-marker),
.map.leaflet-grab.is-moving-marker { cursor: crosshair; }

.leaflet-container a { color: var(--primary-hover); }

.leaflet-bar {
  border: 0 !important;
  border-radius: 14px !important;
  overflow: hidden;
  box-shadow: var(--shadow-sm), 0 0 0 1px var(--border) !important;
}
.leaflet-bar a,
.leaflet-touch .leaflet-bar a {
  width: 40px;
  height: 40px;
  line-height: 40px;
  border-bottom-color: var(--border);
  color: var(--text);
  font-size: 1.2rem;
}
.leaflet-bar a:hover { background: var(--surface-2); color: var(--text); }
.leaflet-control-zoom { margin-right: 12px !important; margin-bottom: 14px !important; }

.leaflet-control-attribution {
  border-radius: 8px 0 0 0;
  background: rgba(255, 255, 255, .78) !important;
  color: var(--muted);
  font-size: 10px;
}

@media (hover: none) and (pointer: coarse) {
  .leaflet-control-zoom { display: none; }
}

/* Infobulle d'un marqueur (survol, bureau) */
.leaflet-tooltip.marker-tooltip {
  display: flex;
  flex-direction: column;
  padding: 7px 12px;
  border: 0;
  border-radius: 12px;
  background: var(--text);
  color: #fff;
  box-shadow: var(--shadow);
  font-family: var(--font);
  line-height: 1.3;
  white-space: nowrap;
}
.leaflet-tooltip-top.marker-tooltip::before { border-top-color: var(--text); }
.marker-tooltip-name { font-weight: 700; font-size: .88rem; }
.marker-tooltip-country { font-size: .75rem; opacity: .75; }

/* Bulle « Ajouter un lieu ici » (clic droit / appui long) */
.add-here-popup .leaflet-popup-content-wrapper {
  padding: 0;
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.add-here-popup .leaflet-popup-content { margin: 8px; }
.add-here-popup .leaflet-popup-tip { box-shadow: none; }
.add-here .btn { box-shadow: none; }

/* ---------- Marqueurs ---------- */

.place-marker {
  background: none;
  border: 0;
}
.place-marker .pin {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  transform-origin: 50% 95%;
  filter: drop-shadow(0 2px 2px rgba(60, 20, 30, .35));
  transition: transform .2s var(--ease), filter .2s;
  animation: pin-in .4s var(--ease) backwards;
}
.pin-svg {
  display: block;
  width: 100%;
  height: 100%;
}
/* Calque des battements (lieu fait à deux, pulse) : n'interfère pas avec l'agrandissement de .pin */
.pin-beat {
  position: relative;
  width: 100%;
  height: 100%;
  transform-origin: 50% 95%;
}
/* Emoji de la catégorie, au centre de la tête de l'épingle (y = 18,2 sur 46) */
.pin-emoji {
  position: absolute;
  left: 50%;
  top: 39.6%;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", var(--font);
  font-size: 15px;
  line-height: 1;
  transform: translate(-50%, -50%);
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}
.place-marker-wish .pin-emoji { font-size: 12.5px; }
.place-marker-visited .pin-emoji { filter: drop-shadow(0 0 1.5px rgba(255, 255, 255, .95)); }
/* Lieux faits à deux : un cœur qui bat, au survol et quand ils sont sélectionnés */
.place-marker-together.is-selected .pin-beat { animation: pin-heartbeat 1.3s ease-in-out infinite; }
@media (hover: hover) {
  .place-marker-together:hover .pin-beat { animation: pin-heartbeat 1.3s ease-in-out infinite; }
}
.place-marker:hover .pin { transform: scale(1.12); }
.place-marker:focus-visible {
  outline: 3px solid rgba(225, 29, 72, .55);
  outline-offset: 2px;
  border-radius: 10px;
}
.place-marker.is-selected .pin {
  transform: scale(1.3);
  filter: drop-shadow(0 5px 6px rgba(60, 20, 30, .4));
}
.place-marker.is-selected::after,
.temp-marker-pulse {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -3px;
  width: 26px;
  height: 9px;
  margin-left: -13px;
  border-radius: 50%;
  background: rgba(225, 29, 72, .45);
  animation: halo 1.6s ease-out infinite;
}
.place-marker.is-moving .pin {
  cursor: grab;
  animation: pin-bob 1.3s ease-in-out infinite;
}
.place-marker.is-moving:active .pin { cursor: grabbing; }
.temp-marker .pin {
  cursor: grab;
  animation: pin-drop .45s var(--ease) backwards;
}

/* Groupes de marqueurs : pastille ronde aux couleurs du couple */
.cluster-marker {
  background: none;
  border: 0;
}
.cluster {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border: 3px solid #fff;
  border-radius: 50%;
  background: linear-gradient(90deg, var(--c1) 50%, var(--c2) 50%);
  color: var(--cluster-text, #fff);
  font-size: .95rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 3px 10px rgba(60, 20, 30, .32), 0 0 0 5px rgba(255, 255, 255, .45);
  transition: transform .18s var(--ease);
  animation: pin-in .35s var(--ease) backwards;
}
.cluster span { text-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
.cluster-marker:hover .cluster { transform: scale(1.08); }
.cluster-marker-wish .cluster {
  border: 4px solid transparent;
  background-image: linear-gradient(#fff, #fff), linear-gradient(90deg, var(--c1) 50%, var(--c2) 50%);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  color: var(--text);
}
.cluster-marker-wish .cluster span { text-shadow: none; }

@keyframes pin-in {
  from { opacity: 0; transform: translateY(-8px) scale(.55); }
  to { opacity: 1; transform: none; }
}
@keyframes pin-drop {
  0% { opacity: 0; transform: translateY(-26px); }
  65% { opacity: 1; transform: translateY(2px); }
  100% { transform: none; }
}
@keyframes pin-bob {
  0%, 100% { transform: translateY(0) scale(1.15); }
  50% { transform: translateY(-5px) scale(1.15); }
}
@keyframes halo {
  0% { opacity: .9; transform: scale(.5); }
  100% { opacity: 0; transform: scale(2.2); }
}
@keyframes pin-heartbeat {
  0%, 30%, 60%, 100% { transform: scale(1); }
  15% { transform: scale(1.1); }
  45% { transform: scale(1.06); }
}

/* ---------- Contrôles de carte ---------- */

.map-controls {
  position: absolute;
  top: 14px;
  right: calc(14px + var(--safe-right));
  z-index: 13; /* le panneau « Calques » passe au-dessus de la pastille du voyage et de l'accueil */
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
/* Panneau « Calques » ouvert : au-dessus aussi de la carte « Où partir ? » */
.map-controls.is-open { z-index: 26; }
.map-ctrl {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 16px 0 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, .96);
  color: var(--text);
  font-size: .88rem;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: background-color .15s, color .15s, transform .12s, box-shadow .15s;
}
.map-ctrl:hover { background: #fff; box-shadow: var(--shadow); }
.map-ctrl:active { transform: scale(.96); }
.map-ctrl.is-active { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-hover); }
/* Un filtre masque des lieux : petit point sur le bouton « Calques ». */
.map-ctrl.is-filtered { position: relative; }
.map-ctrl.is-filtered::after {
  content: '';
  position: absolute;
  top: 7px;
  right: 9px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 2px #fff;
}

.map-popover {
  position: absolute;
  top: 0;
  right: calc(100% + 10px);
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 300px;
  max-width: calc(100vw - 92px);
  max-height: calc(100vh - var(--topbar-h) - 140px);
  overflow-y: auto;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  transform-origin: top right;
  animation: pop-in .2s var(--ease) both;
}
.map-popover-title {
  margin-top: 4px;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.map-popover-title + .segmented { margin-bottom: 6px; }

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 3px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
}
.segmented-option {
  min-height: 40px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--muted);
  font-size: .88rem;
  font-weight: 600;
  transition: background-color .15s, color .15s, box-shadow .15s;
}
.segmented-option:hover { color: var(--text); }
.segmented-option.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.segmented-count {
  margin-left: 3px;
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  background: rgba(122, 106, 112, .12);
  font-size: .78rem;
  font-variant-numeric: tabular-nums;
}
.segmented-option.is-active .segmented-count { background: var(--primary-soft); color: var(--primary-hover); }

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: .92rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color .15s;
}
.check:hover { background: var(--surface-2); }
.check input {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--primary);
  cursor: pointer;
}
.legend-pin {
  display: grid;
  place-items: center;
  flex: none;
  width: 24px;
  height: 30px;
}
.legend-pin svg {
  width: auto;
  height: 28px;
  filter: drop-shadow(0 1px 1px rgba(60, 20, 30, .3));
}
.legend-country {
  flex: none;
  width: 24px;
  height: 16px;
  border-radius: 4px;
  opacity: .5;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .2);
}
.filter-chips { gap: 6px; }
.filter-chip { padding-left: 9px; }
.filter-chip .legend-pin { width: 18px; height: 24px; }
.filter-chip .legend-pin svg { height: 23px; }
.filter-cats .filter-chip { padding: 6px 12px; font-size: .85rem; }
.chip-emoji {
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", var(--font);
  font-size: 1rem;
  line-height: 1;
}
/* Pastilles de légende des calques */
.legend-scratch {
  flex: none;
  width: 24px;
  height: 16px;
  border-radius: 4px;
  background: linear-gradient(135deg, #fbe7a6 0%, #d9a62e 42%, #fff4cc 58%, #b98a1c 100%);
  box-shadow: inset 0 0 0 1px rgba(120, 80, 0, .25);
}
.legend-photos {
  display: grid;
  place-items: center;
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--border);
}
.map-ctrl-emoji {
  width: 20px;
  font-size: 1.1rem;
  line-height: 1;
  text-align: center;
}

/* Pastille du prochain voyage : en haut, au centre de la partie visible de la carte */
.map-chips {
  position: absolute;
  top: 14px;
  left: 50%;
  z-index: 11;
  display: flex;
  justify-content: center;
  max-width: calc(100% - 340px);
  transform: translateX(-50%);
  pointer-events: none;
}
.map-chips:empty { display: none; }
.map-chips > * { pointer-events: auto; }
@media (min-width: 768px) {
  .panel-open .map-chips {
    left: calc(50% + var(--panel-w) / 2);
    max-width: calc(100% - var(--panel-w) - 340px);
  }
}
/* Tablette, panneau ouvert : trop peu de place entre le panneau et les boutons de la carte. */
@media (min-width: 768px) and (max-width: 1099.98px) {
  .panel-open .map-chips { display: none; }
}
@media (max-width: 767.98px) {
  .map-chips { top: 10px; max-width: calc(100% - 128px); }
}
.map-popover-count {
  margin-top: 2px;
  padding: 10px 8px 0;
  border-top: 1px solid var(--border);
  font-size: .82rem;
}

/* Message de chargement / d'erreur au-dessus de la carte */
.map-status {
  position: absolute;
  top: 16px;
  left: 50%;
  z-index: 15;
  transform: translateX(-50%);
  pointer-events: none;
}
.map-status.is-visible > * { pointer-events: auto; }
.map-status-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: .92rem;
  font-weight: 500;
  white-space: nowrap;
  animation: pop-in .25s var(--ease) both;
}
.map-status-card.is-error {
  flex-direction: column;
  max-width: min(320px, calc(100vw - 32px));
  padding: 18px 20px;
  border-radius: var(--radius);
  text-align: center;
  white-space: normal;
}

/* Bureau : le message reste centré sur la partie visible de la carte */
@media (min-width: 768px) {
  .panel-open .map-status { left: calc(50% + var(--panel-w) / 2); }
}

@media (max-width: 767.98px) {
  .map-controls { top: 10px; right: calc(10px + var(--safe-right)); }
  .map-ctrl {
    justify-content: center;
    width: 44px;
    padding: 0;
  }
  .map-ctrl-label { display: none; }
  .map-popover { right: calc(100% + 8px); }
}

@keyframes pop-in {
  from { opacity: 0; transform: scale(.94); }
  to { opacity: 1; transform: none; }
}

/* ---------- Modales ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(43, 32, 36, .45);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  animation: fade-in .2s ease both;
}
.modal {
  display: flex;
  flex-direction: column;
  width: min(480px, 100%);
  max-height: min(88vh, 760px);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 24px 60px rgba(76, 24, 40, .3);
  outline: none;
  animation: modal-in .26s var(--ease) both;
}
.modal-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 18px 12px 6px 22px;
}
.modal-title {
  flex: 1;
  min-width: 0;
  font-size: 1.35rem;
  overflow-wrap: anywhere;
}
.modal-close { color: var(--muted); }
.modal-body {
  flex: 1;
  min-height: 0;
  padding: 8px 22px 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.modal-subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px 18px;
  border-top: 1px solid var(--border);
}
.confirm-message { font-size: 1rem; }

/* Pendant le fondu de fermeture, la modale ne doit plus intercepter les clics. */
.modal-backdrop.is-closing { animation: fade-out .18s ease both; pointer-events: none; }
.modal-backdrop.is-closing .modal { animation: modal-out .18s ease both; }

@media (max-width: 767.98px) {
  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }
  .modal {
    width: 100%;
    max-height: 92vh;
    border-radius: 24px 24px 0 0;
    padding-bottom: var(--safe-bottom);
    animation-name: sheet-in;
  }
  .modal-backdrop.is-closing .modal { animation-name: sheet-out; }
  .modal-actions > .btn { flex: 1 1 auto; }
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px) scale(.97); }
  to { opacity: 1; transform: none; }
}
@keyframes modal-out {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: translateY(8px) scale(.98); }
}
@keyframes sheet-in {
  from { transform: translateY(100%); }
  to { transform: none; }
}
@keyframes sheet-out {
  from { transform: none; }
  to { transform: translateY(100%); }
}

/* Choix d'un voyage (« On y est allés ! ») */
.trip-pick-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.trip-pick {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 56px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-align: left;
  transition: background-color .15s, border-color .15s;
}
.trip-pick:hover { background: var(--surface-2); border-color: rgba(225, 29, 72, .4); }
.trip-pick:disabled { cursor: default; opacity: .6; }
.trip-pick.is-busy { opacity: 1; }
.trip-pick-title { font-weight: 600; overflow-wrap: anywhere; }
.trip-pick-meta { grid-row: 2; font-size: .85rem; }
.trip-pick > .icon {
  grid-column: 2;
  grid-row: 1 / span 2;
  color: var(--primary);
}
.trip-pick.is-busy > .icon { visibility: hidden; }
.trip-pick.is-busy::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 16px;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  border-radius: 50%;
  border: 2.5px solid var(--primary-soft);
  border-top-color: var(--primary);
  animation: spin .7s linear infinite;
}

/* ---------- Toasts ---------- */

.toasts {
  position: fixed;
  left: 50%;
  bottom: calc(24px + var(--safe-bottom));
  z-index: 3000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: calc(100vw - 32px);
  transform: translateX(-50%);
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  padding: 10px 16px 10px 10px;
  border-radius: 14px;
  background: var(--text);
  color: #fff;
  box-shadow: var(--shadow);
  font-size: .92rem;
  font-weight: 500;
  line-height: 1.35;
  cursor: pointer;
  pointer-events: auto;
  animation: toast-in .3s var(--ease) both;
}
.toast-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .16);
}
.toast-text {
  min-width: 0;
  overflow-wrap: anywhere;
}
.toast-success .toast-icon { background: var(--success); }
.toast-error .toast-icon { background: var(--danger); }
.toast-info .toast-icon { background: var(--primary); }
.toast.is-leaving { animation: toast-out .22s ease both; }

@media (max-width: 767.98px) {
  .toasts { bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 12px); }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px) scale(.96); }
  to { opacity: 1; transform: none; }
}
@keyframes toast-out {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: translateY(6px) scale(.97); }
}

/* ---------- Vues du panneau ---------- */

.place-view,
.add-view,
.places-view,
.profile-view { min-width: 0; }

.field-choices .chips { margin-top: 2px; }
.place-edit .panel-actions,
.add-form .panel-actions { margin-top: 4px; }

/* ---------- Fiche lieu ---------- */

.place-hero {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  margin: 0 0 16px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius);
  background: var(--surface-2);
  box-shadow: var(--shadow-sm);
}
.place-hero img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s var(--ease);
}
button.place-hero { cursor: zoom-in; }
button.place-hero:hover img { transform: scale(1.03); }

.place-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.place-country {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 500;
}

.place-visits { gap: 10px; }
.place-visit-text { font-weight: 500; }
.place-wish { gap: 14px; }
.place-trips .muted,
.place-photos .muted { font-size: .92rem; }

.place-wishers {
  display: flex;
  align-items: center;
  gap: 10px;
}
.place-wish-text { font-weight: 500; }
.wish-toggle {
  align-self: flex-start;
  border-color: var(--border);
  background: var(--surface);
}
.wish-toggle .icon {
  color: var(--primary);
  transition: transform .2s var(--ease);
}
.wish-toggle:hover .icon { transform: scale(1.12); }
.wish-toggle.is-pressed {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-hover);
}
.wish-toggle.is-pressed .icon {
  fill: currentColor;
  animation: heart-pop .35s var(--ease);
}

.place-view > .panel-actions { margin-top: 16px; }
.place-view .panel-actions .icon-sparkle { fill: rgba(255, 255, 255, .35); }

.place-notes .field textarea { min-height: 76px; }
.place-notes-actions { justify-content: flex-end; }
.place-notes-actions:not(:has(.btn:not([hidden]))) { display: none; }

.place-trip-list { gap: 8px; }
.card.place-trip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 10px 10px;
}
.place-trip > .icon { color: var(--muted); }
.place-trip-cover {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 56px;
  height: 56px;
  overflow: hidden;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--c1), var(--c2));
  color: #fff;
  font-family: var(--font-title);
  font-size: 1.4rem;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .25);
}
.place-trip-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.place-trip-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.place-trip-title {
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.place-trip-meta { font-size: .85rem; }

.place-photos-empty { font-size: .92rem; }
.place-photos-error { justify-content: space-between; }

.place-danger { align-items: flex-start; }
.place-delete {
  border-color: transparent;
  color: var(--danger);
}
.place-delete:hover { background: #fef2f2; color: var(--danger); }

.place-edit-intro { margin-bottom: 14px; }
.place-move {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 12px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.place-move.is-active {
  border-color: var(--primary);
  border-style: solid;
  background: var(--primary-soft);
}
.place-move-hint {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--primary-hover);
  font-weight: 600;
}
.place-move-coords {
  font-size: .85rem;
  font-variant-numeric: tabular-nums;
}

/* « Prévu : Rome ✈ » */
.place-planned {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
}
.place-planned-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 8px 14px 8px 8px;
  border: 1px solid #bae6fd;
  border-radius: var(--radius-sm);
  background: #f0f9ff;
  color: #075985;
  font-size: .92rem;
  text-decoration: none;
  transition: background-color .15s, border-color .15s;
}
.place-planned-link:hover { background: #e0f2fe; border-color: #7dd3fc; color: #075985; }
.place-planned-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #0369a1;
  color: #fff;
}
.place-planned-icon .icon { fill: currentColor; stroke-width: 0; }
.place-planned-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.place-planned-when {
  flex: none;
  font-size: .8rem;
  font-weight: 700;
  white-space: nowrap;
}

/* Coups de cœur : cinq cœurs par personne, à sa couleur */
.place-ratings { gap: 10px; }
.rating-rows { gap: 4px; }
.rating-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}
.rating-name { flex: 1; min-width: 0; font-weight: 500; }
.rating-none { font-size: .88rem; }
.rating-hearts {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  color: var(--rating-color, var(--primary));
}
.rating-heart {
  display: inline-grid;
  place-items: center;
  color: inherit;
}
.rating-heart .icon { transition: fill .15s, transform .18s var(--ease); }
.rating-heart.is-on .icon { fill: currentColor; }
.rating-hearts:not(.is-input) .rating-heart:not(.is-on) { color: #d9c5cb; }
.rating-hearts.is-input .rating-heart {
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #d9c5cb;
}
.rating-hearts.is-input .rating-heart.is-on { color: var(--rating-color, var(--primary)); }
.rating-hearts.is-input .rating-heart:active .icon { transform: scale(.85); }
@media (hover: hover) {
  /* Survol : les cœurs se remplissent jusqu'à celui pointé */
  .rating-hearts.is-input:hover .rating-heart { color: var(--rating-color, var(--primary)); }
  .rating-hearts.is-input:hover .rating-heart .icon { fill: currentColor; }
  .rating-hearts.is-input .rating-heart:hover ~ .rating-heart { color: #d9c5cb; }
  .rating-hearts.is-input .rating-heart:hover ~ .rating-heart .icon { fill: none; }
  .rating-hearts.is-input .rating-heart:hover .icon { transform: scale(1.15); }
}
@media (pointer: coarse) {
  .rating-hearts.is-input .rating-heart { width: 44px; height: 44px; }
}
.place-rating-shared {
  color: var(--primary-hover);
  font-weight: 600;
}

/* Catégorie et saison */
.place-facts { gap: 12px; }
.place-category select.has-value { font-weight: 600; }
.place-months {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.place-months-head {
  /* Contient le texte .sr-only (absolu) du badge « De saison ». */
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 26px;
}
.place-months-label { font-size: .875rem; font-weight: 600; }

/* Conseil de l'app sur les puces : contour pointillé tant qu'aucun mois n'est choisi */
.month-chip.is-suggested {
  border: 1.5px dashed rgba(225, 29, 72, .55);
  background: #fff7f9;
  color: var(--primary-hover);
}
.month-chip.is-suggested:hover { border-color: var(--primary); }

.place-advice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  min-height: 36px;
}
.place-advice-text {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: .875rem;
}
.place-advice.is-suggestion .place-advice-text { color: var(--primary-hover); font-weight: 600; }
.place-advice-swatch {
  flex: none;
  width: 16px;
  height: 16px;
  border: 1.5px dashed rgba(225, 29, 72, .55);
  border-radius: 5px;
  background: #fff7f9;
}
.place-advice-adopt { background: var(--primary-soft); color: var(--primary-hover); }
.place-advice-adopt:hover { background: #ffd3dd; color: var(--primary-hover); }

/* ---------- Climat moyen (fiche lieu : meilleurs mois) ---------- */

.climate {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 12px 12px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(165deg, #fff8f1 0%, #ffffff 55%, #faf5ff 100%);
}
.climate-summary {
  font-family: var(--font-title);
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.35;
  transition: opacity .2s;
}
/* Autre catégorie en cours de chargement : le conseil d'avant s'estompe */
.climate.is-refreshing .climate-summary,
.climate.is-refreshing .climate-runs { opacity: .4; }

.climate-plot { min-width: 0; }
.climate-chart {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 0 3px;
  margin: 0;
  padding: 0;
  list-style: none;
  /* Le doigt glisse de mois en mois ; le défilement vertical du panneau reste libre. */
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}
.climate-month {
  /* Contient sa phrase .sr-only (absolue). */
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  border-radius: 9px;
}
.climate-month::before {
  content: "";
  position: absolute;
  inset: -4px -1px -2px;
  border-radius: 9px;
  background: rgba(225, 29, 72, .07);
  opacity: 0;
  transition: opacity .15s;
}
.climate-month.is-active::before { opacity: 1; }
.climate-col {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
  height: 86px;
  /* place de la valeur au-dessus de la plus haute barre */
  padding-top: 22px;
}
.climate-bar {
  position: relative;
  width: min(100%, 18px);
  height: calc(var(--h) * 100%);
  border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, var(--c), var(--c-soft));
  transform-origin: 50% 100%;
}
.climate-value {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  z-index: 1;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  font-size: .7rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 3px);
  transition: opacity .15s, transform .15s var(--ease);
}
.climate-month.is-active .climate-value { opacity: 1; transform: translate(-50%, 0); }
.climate-snow {
  position: absolute;
  bottom: 3px;
  left: 50%;
  color: #fff;
  font-size: .62rem;
  line-height: 1;
  text-shadow: 0 0 2px rgba(30, 64, 175, .45);
  transform: translateX(-50%);
}
.climate-rain {
  position: relative;
  display: flex;
  justify-content: center;
  gap: 2.5px;
  height: 13px;
  padding-top: 6px;
}
.climate-drop {
  width: 5px;
  height: 5px;
  border-radius: 0 50% 50% 50%;
  background: #5aa5e0;
  transform: rotate(45deg);
}
.climate-letter {
  position: relative;
  margin-top: 2px;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
  line-height: 1.4;
}
/* Ce mois-ci : l'ambre des envies, en plus foncé pour le texte (contraste d'au moins 4,5:1) */
.climate-month.is-current .climate-letter { color: var(--warning); }
.climate-month.is-active .climate-letter { color: var(--text); }

/* Mois conseillés : un trait aux couleurs du couple sous chaque série */
.climate-runs {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 0 3px;
  height: 4px;
  margin-top: 5px;
  transition: opacity .2s;
}
.climate-run {
  grid-row: 1;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--c1), var(--c2));
}

/* Détail du mois survolé ou touché (ce mois-ci au départ) */
.climate-readout {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 9px;
  border-top: 1px dashed var(--border);
}
.climate-readout-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 22px;
  font-size: .92rem;
}
.climate-readout-now { color: var(--warning); font-size: .78rem; font-weight: 600; }
.climate-readout-tag {
  margin-left: auto;
  padding: 1px 9px;
  border: 1px solid var(--c1-soft);
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--c1-soft), var(--c2-soft));
  color: var(--text);
  font-size: .72rem;
  font-weight: 700;
}
.climate-stats {
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  gap: 6px;
}
.climate-stat {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.climate-stat-value {
  font-size: .9rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.climate-stat-value small { color: var(--muted); font-size: .8rem; font-weight: 600; }
.climate-stat-label { color: var(--muted); font-size: .72rem; line-height: 1.3; }
.climate-source { color: var(--muted); font-size: .72rem; }

/* En attendant : douze barres pâles qui respirent */
.climate.is-loading { gap: 4px; }
.climate-wait { color: var(--muted); font-size: .86rem; }
.climate-skeleton {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 64px;
  margin-top: 16px;
}
.climate-skeleton-bar {
  flex: 1;
  height: calc(var(--h) * 100%);
  border-radius: 6px 6px 3px 3px;
  background: var(--surface-3);
  animation: weather-breathe 1.4s ease-in-out infinite;
}

.climate.is-error {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  padding: 6px 6px 6px 14px;
  background: var(--surface-2);
}
.climate-error-text { color: var(--muted); font-size: .88rem; }

/* Très petits écrans (320 px) : des colonnes de 19 px, des gouttes plus fines, un détail plus serré (« −13° −21° » et sa colonne de neige) */
@media (max-width: 359.98px) {
  .climate-rain { gap: 1.5px; }
  .climate-drop { width: 4px; height: 4px; }
  .climate-stat-value { font-size: .84rem; }
}
@media (min-width: 768px) {
  .climate-col { height: 96px; }
}

/* ---------- Météo (fiche lieu, fiche voyage, « Où partir ce week-end ? ») ---------- */

.weather { min-width: 0; }
.weather[hidden] { display: none; }

/* « En ce moment », puis les trois jours suivants, sur un ciel très doux */
.weather-now {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #dcecf9;
  border-radius: var(--radius);
  background: linear-gradient(120deg, #eff8ff 0%, #f7f9ff 55%, #fff5f7 100%);
}
.weather-now.is-error {
  padding: 8px 14px;
  border-color: var(--border);
  background: var(--surface-2);
}
.weather-current {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding-left: 2px;
}
.weather-current-emoji {
  flex: none;
  font-size: 2.1rem;
  line-height: 1;
}
.weather-current-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.weather-kicker {
  color: #0369a1;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.weather-current-line { font-size: .95rem; }
.weather-temp {
  font-family: var(--font-title);
  font-size: 1.45rem;
  font-variant-numeric: tabular-nums;
}
.weather-wind { color: var(--muted); font-size: .85rem; }

.weather-days {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.weather-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 0;
  padding: 6px 4px 5px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .78);
  font-size: .78rem;
  line-height: 1.3;
  text-align: center;
}
.weather-day-name { color: var(--muted); font-weight: 600; white-space: nowrap; }
.weather-day-emoji { font-size: 1.3rem; line-height: 1.25; }
.weather-day-label { color: var(--muted); font-size: .74rem; line-height: 1.25; }
.weather-day-temps { display: flex; gap: 6px; font-variant-numeric: tabular-nums; }
.weather-max { font-weight: 700; }
.weather-min { color: var(--muted); }
.weather-day-rain { color: #0369a1; font-size: .72rem; white-space: nowrap; }

/* Prévisions jour par jour : une rangée qui défile quand le voyage est long */
.weather-forecast-list {
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 2px 0 4px;
  overflow-x: auto;
  list-style: none;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-3) transparent;
}
.weather-forecast .weather-day {
  /* Contient son texte .sr-only (absolu) : sinon il échappe au défilement de la rangée et élargit tout le panneau. */
  position: relative;
  flex: 0 0 auto;
  width: 92px;
  padding: 8px 6px;
  border: 1px solid #dcecf9;
  background: linear-gradient(180deg, #f3f9ff, #fff);
  scroll-snap-align: start;
}
.weather-wait,
.weather-error { color: var(--muted); font-size: .86rem; }

/* En attendant la réponse : quelques pavés qui respirent */
.weather-skeleton { display: flex; flex-wrap: wrap; gap: 8px; }
.weather-skeleton-cell {
  flex: 1;
  height: 66px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .8);
  animation: weather-breathe 1.4s ease-in-out infinite;
}
/* « En ce moment » sur toute la largeur, les jours en dessous */
.weather-now .weather-skeleton-cell:first-child { flex-basis: 100%; height: 40px; }
.weather-forecast .weather-skeleton-cell {
  flex: 0 0 92px;
  height: 108px;
  background: var(--surface-2);
}

@keyframes weather-breathe {
  50% { opacity: .45; }
}

/* ---------- Mots doux ---------- */

.love-notes { gap: 12px; }
.love-notes-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0;
  list-style: none;
}
.love-notes-list:empty,
.love-notes-status:empty { display: none; }
.love-notes-empty { font-size: .92rem; }
.love-note {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 88%;
}
.love-note.is-mine {
  flex-direction: row-reverse;
  align-self: flex-end;
}
.love-note.is-new { animation: note-in .35s var(--ease) both; }
.love-note > .avatar { margin-bottom: 2px; }
.love-note-bubble {
  min-width: 0;
  padding: 8px 13px 6px;
  border: 1px solid var(--note-edge, var(--border));
  border-radius: 16px 16px 16px 5px;
  background: var(--note-tint, var(--surface-2));
}
.love-note.is-mine .love-note-bubble { border-radius: 16px 16px 5px 16px; }
.love-note-body {
  line-height: 1.45;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.love-note-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
  color: var(--muted);
  font-size: .75rem;
}
.love-note.is-mine .love-note-meta { justify-content: flex-end; }
.love-note-delete {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin: -7px -9px -7px 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  transition: background-color .15s, color .15s;
}
.love-note-delete:hover { background: rgba(255, 255, 255, .8); color: var(--danger); }
@media (pointer: coarse) {
  .love-note-delete { width: 44px; height: 44px; margin: -13px -14px -13px -6px; }
}
.love-notes-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.love-notes-input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  max-height: 168px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  color: var(--text);
  font-size: 16px; /* évite le zoom automatique de Safari iOS */
  line-height: 1.4;
  resize: none;
  transition: border-color .15s, box-shadow .15s;
}
.love-notes-input::placeholder { color: #b3a3a9; }
.love-notes-input:focus {
  border-color: var(--primary);
  box-shadow: var(--ring);
  outline: none;
}
.love-notes-send .icon { margin-left: -2px; }

@keyframes note-in {
  from { opacity: 0; transform: translateY(8px) scale(.97); }
  to { opacity: 1; transform: none; }
}

/* ---------- Ajout d'un lieu ---------- */

.add-search,
.add-step-form { gap: 14px; }
.add-search-input::-webkit-search-decoration { -webkit-appearance: none; }

.search-field {
  position: relative;
  display: flex;
  align-items: center;
}
.search-field > .icon {
  position: absolute;
  left: 15px;
  color: var(--muted);
  pointer-events: none;
}
.search-field input {
  min-height: 50px;
  padding-left: 44px;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
}
.search-field input::-webkit-search-cancel-button { cursor: pointer; }

.add-results:empty { display: none; }
.add-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 4px;
}
.add-result-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0;
  list-style: none;
}
.add-result {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  text-align: left;
  transition: background-color .15s;
}
.add-result:hover,
.add-result:focus-visible { background: var(--surface-2); }
.add-result .cc { margin-top: 2px; }
.add-result-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.add-result-name { font-weight: 600; }
.add-result-detail {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: .82rem;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.add-alt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 18px 12px;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}
.add-alt-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}
.add-alt-hint .icon { color: var(--primary); }

.add-move-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .85rem;
}
.add-picked {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
}
.add-picked-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
}
.add-picked-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 4px;
  min-width: 0;
}
.add-picked-text > .muted:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
}
.add-picked-detail {
  font-size: .92rem;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.add-picked-retry { align-self: flex-start; }
.add-picked-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: .82rem;
  font-variant-numeric: tabular-nums;
}

/* ---------- Lieux (envies et faits) ---------- */

.places-head {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}
.places-types .segmented-option { min-height: 44px; font-size: .92rem; }
.places-chips { gap: 6px; }
.places-search { margin-bottom: 14px; }
.places-none { padding: 4px 0 8px; }
.places-again { margin-top: 22px; }
.places-list {
  gap: 10px;
  padding: 0;
  list-style: none;
}

/* Faits : un groupe par pays */
.places-country + .places-country { margin-top: 20px; }
.places-country-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 1.05rem;
}
.places-country-name { min-width: 0; overflow-wrap: anywhere; }

.card.place-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 10px 10px;
}
.place-card.is-together {
  border-color: #f9c4d2;
  background: linear-gradient(120deg, var(--surface) 55%, var(--primary-soft));
}
.place-card-thumb {
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: var(--surface-2);
  object-fit: cover;
}
.place-card-thumb-star,
.place-card-thumb-heart {
  display: grid;
  place-items: center;
}
.place-card-thumb-star { background: var(--wish-soft); color: var(--wish); }
.place-card-thumb-heart { background: var(--primary-soft); color: var(--primary); }
.place-card-thumb .icon { fill: currentColor; opacity: .85; }
.place-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 4px;
  min-width: 0;
}
.place-card-name,
.place-card-trips {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.place-card-name { font-weight: 600; }
.place-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: .85rem;
}
.place-card-who {
  display: flex;
  align-items: center;
  flex: none;
  gap: 6px;
}
.place-card-heart {
  color: var(--primary);
  font-size: 1.1rem;
  line-height: 1;
}
.place-card-thumb-emoji::before {
  content: attr(data-emoji);
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", var(--font);
  font-size: 1.55rem;
  line-height: 1;
}
.place-card-country {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.place-card-planned,
.place-card-notes {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: none;
  font-size: .78rem;
  font-weight: 700;
}
.place-card-planned { color: #0369a1; }
.place-card-planned .icon { fill: currentColor; stroke-width: 0; }
.place-card-notes { color: var(--primary-hover); }
.place-card-rating {
  color: var(--primary);
  font-size: .9rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Bandeau de filtres qui défile : « De saison » ou « Coups de cœur », puis les catégories */
.places-filters {
  display: flex;
  gap: 6px;
  margin: -2px -20px 12px calc(-20px - var(--safe-left));
  padding: 2px 20px 4px calc(20px + var(--safe-left));
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.places-filters::-webkit-scrollbar { display: none; }
/* À la souris : une fine barre de défilement montre qu'il y a d'autres puces (la molette fait défiler). */
@media (hover: hover) and (pointer: fine) {
  .places-filters {
    padding-bottom: 8px;
    scrollbar-width: thin;
    scrollbar-color: var(--surface-3) transparent;
  }
  .places-filters::-webkit-scrollbar { display: block; height: 6px; }
  .places-filters::-webkit-scrollbar-thumb { border-radius: 3px; background: var(--surface-3); }
}
.places-filters .chip {
  flex: none;
  padding: 6px 12px;
  font-size: .86rem;
}
.chip-heart { color: var(--primary); }
.chip-active .chip-heart { color: inherit; }
@media (max-width: 767.98px) {
  .places-filters { margin-inline: -16px; padding-inline: 16px; }
}

/* ---------- Profil ---------- */

.profile-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  background: linear-gradient(135deg, var(--surface) 45%, var(--surface-2));
}
.profile-head {
  display: flex;
  align-items: center;
  gap: 16px;
}
.profile-identity { min-width: 0; }
.profile-name {
  font-family: var(--font-title);
  font-size: 1.35rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.profile-username { font-size: .85rem; }

/* Petites stats de la personne : lieux faits, pays, envies */
.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.profile-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 0;
  padding: 10px 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  text-align: center;
  text-decoration: none;
}
a.profile-stat { transition: border-color .15s, box-shadow .15s, transform .15s var(--ease); }
a.profile-stat:hover {
  border-color: rgba(225, 29, 72, .4);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  transform: translateY(-1px);
}
.profile-stat-value {
  font-family: var(--font-title);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.profile-stat-label {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 600;
}

.profile-name-form {
  flex-wrap: nowrap;
  align-items: flex-start;
}
.profile-name-field { flex: 1; }

.swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 10px;
}
.swatch {
  position: relative;
  display: grid;
  place-items: center;
  justify-self: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--swatch);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08);
  cursor: pointer;
  transition: transform .15s var(--ease), box-shadow .15s;
}
.swatch:hover { transform: scale(1.08); }
.swatch:disabled { cursor: wait; opacity: .7; }
.swatch.is-selected { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--swatch); }
.swatch .icon { filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .35)); }
.swatch-custom {
  background: conic-gradient(#ef4444, #f59e0b, #84cc16, #10b981, #06b6d4, #3b82f6, #8b5cf6, #ec4899, #ef4444);
}
.swatch-custom:has(input:focus-visible) {
  outline: 3px solid rgba(225, 29, 72, .5);
  outline-offset: 3px;
}
.swatch-custom input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
}

.marker-preview {
  display: flex;
  align-items: flex-end;
  gap: 22px;
  padding: 14px 18px 10px;
  border-radius: var(--radius);
  background:
    radial-gradient(circle, rgba(122, 106, 112, .14) 1px, transparent 1.5px) 0 0 / 14px 14px,
    var(--surface-2);
}
.marker-preview-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 500;
}
.marker-preview-item svg { filter: drop-shadow(0 2px 2px rgba(60, 20, 30, .3)); }

.profile-color { gap: 14px; }

.profile-partner {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .88rem;
}
.profile-warning {
  padding: 10px 12px;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  background: #fffbeb;
  color: var(--warning);
  font-size: .88rem;
}
.profile-logout .btn { color: var(--muted); }
.profile-logout .btn:hover { color: var(--danger); }

/* Sécurité (connexions à son propre compte) */
.profile-security { display: flex; flex-direction: column; gap: 12px; }
.profile-security .section-title { margin-bottom: 0; }
.security-alert {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: #fff1e6;
  color: #9a3412;
  font-size: .9rem;
  font-weight: 600;
  line-height: 1.4;
}
.security-alert .icon { flex: none; margin-top: 2px; }
.security-facts {
  display: grid;
  gap: 8px;
  margin: 0;
}
.security-fact {
  display: grid;
  grid-template-columns: minmax(0, 9.5em) minmax(0, 1fr);
  gap: 10px;
  font-size: .9rem;
}
.security-fact dt { color: var(--muted); }
.security-fact dd {
  display: flex;
  flex-direction: column;
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.security-detail {
  color: var(--muted);
  font-size: .82rem;
  font-weight: 500;
}
.security-history summary {
  min-height: 40px;
  padding: 8px 0;
  color: var(--primary-hover);
  font-size: .9rem;
  font-weight: 650;
  cursor: pointer;
}
.security-list {
  display: flex;
  flex-direction: column;
  max-height: 320px;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}
.security-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: .85rem;
}
.security-row:last-child { border-bottom: 0; }
.security-status {
  display: grid;
  place-items: center;
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(21, 128, 61, .12);
  color: var(--success);
  font-size: .75rem;
  font-weight: 800;
}
.security-row.is-failure .security-status { background: rgba(220, 38, 38, .12); color: var(--danger); }
.security-row-main { display: flex; flex-direction: column; min-width: 0; }
.security-row-when { font-weight: 600; }
.security-row.is-failure .security-row-when { color: var(--danger); }
.security-row-detail { color: var(--muted); overflow-wrap: anywhere; }
.security-note { margin: 0; font-size: .8rem; }

/* ---------- Nous deux ---------- */

.couple-card {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 22px 16px 18px;
  overflow: hidden;
  border-color: rgba(255, 255, 255, .7);
  background: linear-gradient(135deg, var(--couple-c1, #fff1ec) 0%, #fff8f6 50%, var(--couple-c2, #f7e8ff) 100%);
  text-align: center;
}
.couple-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.couple-avatars .avatar { box-shadow: 0 0 0 3px #fff; }
.couple-avatars .avatar + .avatar { margin-left: -12px; }
.couple-names {
  font-family: var(--font-title);
  font-size: 1.3rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.couple-days {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 4px;
}
.couple-days-value {
  color: var(--primary-hover);
  font-family: var(--font-title);
  font-size: 3.1rem;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.couple-days-label { font-weight: 600; }
.couple-since {
  display: flex;
  align-items: center;
  gap: 2px;
  color: var(--muted);
  font-size: .9rem;
}
.couple-since-edit { color: var(--muted); }
.couple-next {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  margin-top: 6px;
  padding: 8px 14px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .75);
  font-size: .88rem;
  text-align: left;
}
.couple-since-form {
  width: 100%;
  margin-top: 6px;
  text-align: left;
}

.couple-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.couple-link {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  min-height: 68px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s, transform .15s var(--ease);
}
a.couple-link:hover,
button.couple-link:hover {
  border-color: rgba(225, 29, 72, .35);
  box-shadow: var(--shadow);
  color: var(--text);
  transform: translateY(-1px);
}
a.couple-link:active,
button.couple-link:active { transform: scale(.98); }
.couple-link-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary);
}
.couple-link:nth-child(1) .couple-link-icon { background: #e0f2fe; color: #0369a1; }
.couple-link:nth-child(3) .couple-link-icon { background: #f3e8ff; color: #7e22ce; }
.couple-link:nth-child(4) .couple-link-icon { background: var(--wish-soft); color: var(--wish); }
.couple-link-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.couple-link-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .95rem;
  font-weight: 700;
}
.couple-link-detail {
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.35;
}
.couple-link-badge {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  background: var(--primary);
  color: var(--on-primary);
  font-size: .72rem;
  font-weight: 800;
}
.couple-year-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.couple-year {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--primary-hover);
  font-size: .85rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
  transition: background-color .15s;
}
.couple-year:hover { background: var(--primary-soft); color: var(--primary-hover); }
button.couple-year { /* années du livre photo : des boutons habillés comme les liens de « Notre année » */
  border: 0;
  font-family: inherit;
  cursor: pointer;
}
@media (pointer: coarse) {
  .couple-year { min-height: 44px; padding: 8px 14px; }
}
@media (max-width: 359.98px) {
  .couple-links { grid-template-columns: 1fr; }
}

.couple-home-current {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.couple-home-icon { font-size: 1.25rem; line-height: 1; }
.couple-home-name {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.couple-home-search { gap: 10px; }
.profile-me .profile-card { margin-top: 2px; }

@keyframes heart-pop {
  0% { transform: scale(1); }
  45% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

/* ---------- Page de connexion (et pages d'erreur) ---------- */

body.login-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(24px + var(--safe-top)) 16px calc(24px + var(--safe-bottom));
  background:
    radial-gradient(circle, rgba(225, 29, 72, .07) 1px, transparent 1.6px) 0 0 / 22px 22px,
    radial-gradient(900px 520px at 8% -8%, #ffe1e8 0%, transparent 62%),
    radial-gradient(800px 560px at 105% 108%, #ffe8d6 0%, transparent 58%),
    var(--bg);
}
.login-card {
  width: min(400px, 100%);
  padding: 36px 28px 28px;
  border: 1px solid var(--border);
  border-radius: 26px;
  background: rgba(255, 255, 255, .94);
  box-shadow: var(--shadow);
  text-align: center;
  animation: modal-in .45s var(--ease) both;
}
.login-logo {
  display: block;
  width: 72px;
  height: 72px;
  margin: 0 auto 14px;
  filter: drop-shadow(0 6px 12px rgba(225, 29, 72, .25));
}
.login-card h1 {
  font-size: 2.1rem;
  font-weight: 700;
}
.login-tagline {
  margin: 6px 0 26px;
  color: var(--muted);
  font-family: var(--font-title);
  font-size: 1.08rem;
  font-style: italic;
}
.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
}
.login-form .btn,
.login-card > .btn {
  min-height: 50px;
  margin-top: 6px;
  font-size: 1rem;
}
.login-error {
  padding: 10px 12px;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  background: #fef2f2;
  color: var(--danger);
  font-size: .9rem;
  font-weight: 500;
  text-align: center;
  animation: shake .4s ease;
}
.error-detail {
  max-height: 240px;
  margin: 0 0 16px;
  padding: 12px;
  overflow: auto;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: .75rem;
  text-align: left;
  white-space: pre-wrap;
}

@keyframes shake {
  0%, 100% { transform: none; }
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}

/* ---------- Mouvement réduit ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .place-marker.is-selected::after,
  .temp-marker-pulse { display: none; }
}
