
:root {
  --color-bg: #f6f4f0;
  --color-surface: #ffffff;
  --color-surface-2: #fbfaf7;
  --color-border: #e7e2d9;
  --color-text: #211d1a;
  --color-text-muted: #7a7268;
  --color-text-faint: #a49c8f;

  --color-primary: #0f6e6a;
  --color-primary-dark: #0a4f4c;
  --color-primary-light: #e3f1ef;
  --color-accent: #ee7c4c;
  --color-accent-dark: #d4602f;
  --color-accent-light: #fdece1;

  --color-success: #1e8e5a;
  --color-success-bg: #e8f6ee;
  --color-danger: #c8452f;
  --color-danger-bg: #fdedea;
  --color-warning: #b7791f;
  --color-warning-bg: #fcf3e0;
  --color-info: #2f6fb0;
  --color-info-bg: #eaf3fb;

  --shadow-sm: 0 1px 2px rgba(33, 29, 26, 0.06);
  --shadow-md: 0 6px 16px -4px rgba(33, 29, 26, 0.12), 0 2px 6px -2px rgba(33, 29, 26, 0.08);
  --shadow-lg: 0 20px 40px -12px rgba(33, 29, 26, 0.22);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Fraunces", Georgia, serif;

  --navbar-h: 61px;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
/* Without this, any element that both has [hidden] and matches a rule
   setting its own `display` (e.g. `form.stacked-form { display: flex }`)
   stays visible: author-origin rules beat the UA stylesheet's plain
   `[hidden] { display: none }` regardless of specificity. The trip hub's
   panel toggles multiple sibling forms via .hidden in JS and depends on
   this actually hiding them. */
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: var(--font-body);
  background:
    radial-gradient(1200px 500px at 100% -10%, rgba(15, 110, 106, 0.07), transparent),
    radial-gradient(900px 400px at -10% 0%, rgba(238, 124, 76, 0.08), transparent),
    var(--color-bg);
  color: var(--color-text);
  line-height: 1.55;
  min-height: 100vh;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.2; margin: 0 0 0.5rem; letter-spacing: -0.01em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.35rem; margin-top: 2rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 0.75rem; color: var(--color-text); }
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Navbar ---------- */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.75rem;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.navbar .brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--color-text);
  text-decoration: none;
}
.navbar .brand:hover { text-decoration: none; }
.brand-mark {
  width: 34px; height: 34px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--shadow-sm);
}

.nav-toggle, .nav-restore {
  display: none; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-text-muted);
  font-size: 0.7rem; line-height: 1; box-shadow: var(--shadow-sm);
}
.nav-restore { position: fixed; top: 0.4rem; right: 0.5rem; z-index: 60; opacity: 0.85; }
@media (max-width: 640px) { .nav-restore:not([hidden]) { display: grid; } }
.nav-links { display: flex; align-items: center; gap: 0.4rem; }
.nav-links a {
  color: var(--color-text-muted);
  font-weight: 500;
  font-size: 0.92rem;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-pill);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-links a:hover { background: var(--color-primary-light); color: var(--color-primary-dark); }
.nav-user {
  color: var(--color-text-faint);
  font-size: 0.82rem;
  padding: 0 0.5rem;
  border-left: 1px solid var(--color-border);
  margin-left: 0.25rem;
}

.link-button {
  -webkit-appearance: none; appearance: none;
  background: none; border: none; padding: 0.45rem 0.9rem; color: var(--color-text-muted);
  cursor: pointer; font: inherit; font-size: 0.92rem; font-weight: 500; border-radius: var(--radius-pill);
  transition: background 0.15s ease, color 0.15s ease;
}
.link-button:hover { background: var(--color-danger-bg); color: var(--color-danger); }

/* ---------- Layout ---------- */
.container { max-width: 980px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }

/* ---------- Flashes ---------- */
.flashes { list-style: none; padding: 0; margin: 0 0 1.25rem; display: flex; flex-direction: column; gap: 0.5rem; }
.flash {
  padding: 0.7rem 1.1rem; border-radius: var(--radius-sm); font-size: 0.92rem; font-weight: 500;
  box-shadow: var(--shadow-sm);
}
.flash-success { background: var(--color-success-bg); color: var(--color-success); }
.flash-error { background: var(--color-danger-bg); color: var(--color-danger); }
.flash-info { background: var(--color-info-bg); color: var(--color-info); }

/* ---------- Buttons ---------- */
.btn {
  -webkit-appearance: none; appearance: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.55rem 1.15rem; border-radius: var(--radius-pill); border: none;
  background: var(--color-primary); color: white; cursor: pointer; font: inherit;
  font-weight: 600; font-size: 0.92rem; text-decoration: none; line-height: 1.3;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease;
}
.btn:hover { background: var(--color-primary-dark); text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }
.btn-accent { background: var(--color-accent); }
.btn-accent:hover { background: var(--color-accent-dark); }
.btn-danger { background: var(--color-danger); }
.btn-danger:hover { background: #a83a26; }
.btn-secondary { background: var(--color-surface); color: var(--color-text); border: 1px solid var(--color-border); box-shadow: none; }
.btn-secondary:hover { background: var(--color-surface-2); box-shadow: none; }
.btn-sm { padding: 0.35rem 0.8rem; font-size: 0.82rem; }

/* ---------- Cards ---------- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}

/* ---------- Forms ---------- */
form.stacked-form { display: flex; flex-direction: column; gap: 1rem; max-width: 520px; }
form.stacked-form label {
  display: block; font-weight: 600; font-size: 0.82rem; color: var(--color-text-muted);
  text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.35rem;
}
form.stacked-form input[type]:not([type="submit"]):not([type="checkbox"]):not([type="file"]),
form.stacked-form input:not([type]),
form.stacked-form select, form.stacked-form textarea {
  -webkit-appearance: none; appearance: none;
  width: 100%; padding: 0.65rem 0.85rem; border: 1px solid var(--color-border);
  border-radius: var(--radius-sm); font: inherit; font-size: 0.95rem;
  background: var(--color-surface-2); color: var(--color-text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
form.stacked-form input[type="file"] {
  padding: 0.5rem 0; border: none; font: inherit; font-size: 0.9rem; color: var(--color-text-muted);
}
form.stacked-form select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%237a7268'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.75rem center; background-size: 1.1em;
  padding-right: 2.25rem;
}
form.stacked-form input[type="checkbox"] { width: auto; margin-right: 0.4rem; }
form.stacked-form input:not([type="submit"]):focus,
form.stacked-form select:focus, form.stacked-form textarea:focus {
  outline: none; border-color: var(--color-primary); background: var(--color-surface);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}
.field-errors { color: var(--color-danger); font-size: 0.82rem; margin: 0.3rem 0 0; padding: 0; list-style: none; }
.field-error { color: var(--color-danger); font-size: 0.82rem; margin: 0.3rem 0 0; }
.field-hint { color: var(--color-text-muted); font-size: 0.82rem; margin: 0 0 0.9rem; line-height: 1.4; }

/* ---------- Categories admin ---------- */
.categorie-form input[type="color"] {
  width: 4.5rem; padding: 0.25rem; height: 2.5rem; cursor: pointer; background: var(--color-surface);
}
.categorie-swatch {
  display: inline-block; width: 12px; height: 12px; border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.15); vertical-align: middle; margin-right: 0.3rem;
}
.inline-form { display: inline; }

/* ---------- Emoji/icon picker ---------- */
.icon-picker { position: relative; display: flex; align-items: center; gap: 0.4rem; }
.icon-picker input { flex: 1 1 auto; min-width: 0; }
.icon-picker-btn {
  flex: none; width: 2.6rem; height: 2.6rem; font-size: 1.2rem; line-height: 1;
  border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  background: var(--color-surface-2); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.icon-picker-btn:hover { background: var(--color-surface); border-color: var(--color-primary); }
.icon-picker-popover {
  position: absolute; top: calc(100% + 0.4rem); left: 0; z-index: 30; width: min(320px, 92vw);
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-lg); padding: 0.6rem;
}
.icon-picker-search {
  width: 100%; padding: 0.4rem 0.6rem; margin-bottom: 0.5rem; border: 1px solid var(--color-border);
  border-radius: var(--radius-sm); font: inherit; font-size: 0.85rem; background: var(--color-surface-2);
}
.icon-picker-tabs {
  display: flex; gap: 0.15rem; overflow-x: auto; margin-bottom: 0.4rem;
  padding-bottom: 0.3rem; border-bottom: 1px solid var(--color-border);
}
.icon-picker-tab {
  flex: none; width: 2.1rem; height: 2.1rem; font-size: 1.05rem; line-height: 1;
  border: none; background: none; border-radius: var(--radius-sm); cursor: pointer;
  display: flex; align-items: center; justify-content: center; opacity: 0.55;
}
.icon-picker-tab:hover { opacity: 0.85; background: var(--color-surface-2); }
.icon-picker-tab.is-active { opacity: 1; background: var(--color-primary-light); }
.icon-picker-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.2rem;
  max-height: 240px; overflow-y: auto;
}
.icon-picker-cell {
  border: none; background: none; font-size: 1.25rem; line-height: 1; padding: 0.35rem 0;
  border-radius: var(--radius-sm); cursor: pointer;
}
.icon-picker-cell:hover { background: var(--color-primary-light); }
.icon-picker-empty {
  grid-column: 1 / -1; margin: 0.6rem 0; text-align: center; font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* ---------- Address autocomplete (Nominatim search suggestions) ---------- */
.field-autocomplete { position: relative; }
.addr-ac-dropdown {
  position: absolute; top: calc(100% + 0.3rem); left: 0; right: 0; z-index: 30;
  margin: 0; padding: 0.35rem; list-style: none;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
  max-height: 260px; overflow-y: auto;
}
.addr-ac-item {
  padding: 0.55rem 0.7rem; border-radius: var(--radius-sm); font-size: 0.88rem;
  color: var(--color-text); cursor: pointer;
}
.addr-ac-item:hover, .addr-ac-item.active { background: var(--color-primary-light); color: var(--color-primary-dark); }

/* ---------- Inline selects (outside .stacked-form, e.g. sharing table) ---------- */
select {
  -webkit-appearance: none; appearance: none;
  font: inherit; font-size: 0.88rem; color: var(--color-text);
  padding: 0.4rem 2rem 0.4rem 0.75rem; border: 1px solid var(--color-border);
  border-radius: var(--radius-pill); background-color: var(--color-surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%237a7268'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.7rem center; background-size: 1.05em;
  cursor: pointer;
}

/* ---------- Tables ---------- */
.table-wrap { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-sm); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.75rem 1rem; border-bottom: 1px solid var(--color-border); font-size: 0.92rem; }
th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-text-faint); background: var(--color-surface-2); font-weight: 600; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--color-surface-2); }

/* legacy plain table fallback (kept for any unstyled table) */
table:not(.plain) { margin: 0; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.22rem 0.65rem; border-radius: var(--radius-pill);
  font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
  white-space: nowrap;
}
.badge-neutral { background: var(--color-surface-2); color: var(--color-text-muted); border: 1px solid var(--color-border); }
.badge-primary { background: var(--color-primary-light); color: var(--color-primary-dark); }
.badge-accent { background: var(--color-accent-light); color: var(--color-accent-dark); }
.badge-success { background: var(--color-success-bg); color: var(--color-success); }
.badge-danger { background: var(--color-danger-bg); color: var(--color-danger); }
.badge-warning { background: var(--color-warning-bg); color: var(--color-warning); }
.badge-info { background: var(--color-info-bg); color: var(--color-info); }

/* ---------- Sensitive fields ---------- */
.sensitive-field { margin: 0 0 0.6rem; }
.sensitive-hidden {
  color: var(--color-text-faint); font-style: italic; font-size: 0.88rem;
  display: inline-flex; align-items: center; gap: 0.35rem;
}

/* ---------- Alerts ---------- */
.alert-box {
  padding: 0.8rem 1rem; border-radius: var(--radius-sm); margin-bottom: 0.6rem;
  background: var(--color-warning-bg); color: #8a5a12; border-left: 4px solid var(--color-warning);
  font-size: 0.92rem;
}

/* ---------- Page header ---------- */
.page-header { margin-bottom: 1.75rem; }
.page-header .eyebrow {
  display: inline-block; font-size: 0.76rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--color-primary); margin-bottom: 0.3rem;
}
.page-header .meta { color: var(--color-text-muted); font-size: 0.95rem; margin: 0.2rem 0 0; }
.back-link { display: inline-flex; align-items: center; gap: 0.3rem; color: var(--color-text-muted); font-size: 0.88rem; font-weight: 500; margin-bottom: 1rem; }
.back-link:hover { color: var(--color-primary); text-decoration: none; }

.actions-row { display: flex; gap: 0.6rem; flex-wrap: wrap; margin: 1rem 0; align-items: center; }

/* ---------- Stat tiles ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.75rem; margin: 1.25rem 0; }
.stat-tile {
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md);
  padding: 0.9rem 1rem; box-shadow: var(--shadow-sm);
}
.stat-tile .stat-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-text-faint); font-weight: 700; }
.stat-tile .stat-value { font-size: 1.15rem; font-weight: 700; margin-top: 0.15rem; }
.stat-sub { display: block; font-size: 0.72rem; font-weight: 600; color: var(--color-text-muted); margin-top: 0.1rem; }
.stat-sub.over { color: var(--color-danger); }
/* Tighter fit for the place panel (narrower than a full page), and its
   own gap before the actions row that follows immediately. */
.panel-stay { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); margin: 0.8rem 0; }
.panel-stay .stat-tile { padding: 0.6rem 0.75rem; }
.panel-stay .stat-value { font-size: 0.98rem; }

/* ---------- Infos tab (editorial: hairlines, serif figures) ---------- */
.inf-head-top { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.5rem; }
.inf-head h1 { font-size: 1.9rem; line-height: 1.1; margin: 0; word-break: break-word; }
.inf-dest { margin: 0.35rem 0 0; color: var(--color-text-muted); font-size: 0.92rem; }
.inf-edit {
  display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.76rem; font-weight: 600;
  color: var(--color-text-faint); padding: 0.15rem 0.4rem; border-radius: var(--radius-pill);
  transition: color 0.15s ease, background 0.15s ease;
}
.inf-edit:hover { color: var(--color-accent-dark); background: var(--color-accent-light); text-decoration: none; }
.inf-facts { display: grid; grid-template-columns: 1fr 1fr; margin: 1.3rem 0 0; border-top: 1px solid var(--color-border); }
.inf-fact { padding: 0.8rem 0.2rem; border-bottom: 1px solid var(--color-border); min-width: 0; }
.inf-fact:nth-child(odd) { padding-right: 0.8rem; border-right: 1px dashed var(--color-border); }
.inf-fact:nth-child(even) { padding-left: 0.9rem; }
.inf-fact dt { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.07em; font-weight: 700; color: var(--color-text-faint); }
.inf-fact dd, .inf-fact .stat-value {
  margin: 0.2rem 0 0; font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; line-height: 1.2;
}
.inf-fact dd small { font-family: var(--font-body); font-size: 0.72rem; font-weight: 700; color: var(--color-text-muted); }
.inf-sub, .inf-fact .stat-sub {
  display: block; font-family: var(--font-body); font-size: 0.74rem; font-weight: 500;
  color: var(--color-text-muted); margin-top: 0.15rem;
}
.inf-sub.over { color: var(--color-danger); font-weight: 600; }
.inf-notes {
  margin: 1.3rem 0 0; padding: 0 0 0 0.9rem; border-left: 2px solid var(--color-accent);
  font-family: var(--font-display); font-style: italic; color: var(--color-text-muted); line-height: 1.55;
}

/* ---------- Trip cards (dashboard) ---------- */
.trip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; margin-top: 1.25rem; }
.trip-card {
  display: block; background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); padding: 1.25rem; box-shadow: var(--shadow-sm);
  text-decoration: none; color: var(--color-text);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  position: relative; overflow: hidden;
}
.trip-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 5px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
}
.trip-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); text-decoration: none; border-color: transparent; }
.trip-card h3 { margin: 0.4rem 0 0.2rem; font-size: 1.15rem; }
.trip-card .trip-dest { color: var(--color-text-muted); font-size: 0.88rem; margin-bottom: 0.6rem; }
.trip-card .trip-dates { color: var(--color-text-faint); font-size: 0.82rem; display: flex; align-items: center; gap: 0.3rem; }

/* ---------- Empty states ---------- */
.empty-state {
  text-align: center; padding: 2.5rem 1.5rem; color: var(--color-text-muted);
  background: var(--color-surface-2); border: 1px dashed var(--color-border); border-radius: var(--radius-md);
}
.empty-state .empty-emoji { font-size: 2rem; display: block; margin-bottom: 0.5rem; }

/* ---------- Filters ---------- */
.filters { display: flex; gap: 0.6rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.filters select {
  -webkit-appearance: none; appearance: none;
  padding: 0.5rem 2.1rem 0.5rem 0.9rem; border-radius: var(--radius-pill); border: 1px solid var(--color-border);
  background: var(--color-surface); font: inherit; font-size: 0.88rem; color: var(--color-text);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%237a7268'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.85rem center; background-size: 1.1em;
}

/* ---------- Auth pages ---------- */
.auth-wrap { display: flex; justify-content: center; padding-top: 2rem; }
.auth-card {
  width: 100%; max-width: 400px; background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); padding: 2.25rem; box-shadow: var(--shadow-md);
}
.auth-card h1 { text-align: center; margin-bottom: 0.25rem; }
.auth-subtitle { text-align: center; color: var(--color-text-muted); font-size: 0.9rem; margin-bottom: 1.5rem; }
.auth-card form.stacked-form { max-width: none; }
.auth-card .btn { width: 100%; justify-content: center; margin-top: 0.25rem; }
.auth-footer { text-align: center; margin-top: 1.25rem; font-size: 0.88rem; color: var(--color-text-muted); }

/* ---------- Map ---------- */
#map { height: 500px; border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); border: 1px solid var(--color-border); }

/* ---------- Timeline (jours) ---------- */
.day-list { list-style: none; padding: 0; margin: 1.25rem 0; display: flex; flex-direction: column; gap: 0.6rem; }
.day-list li a {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md);
  padding: 0.9rem 1.1rem; text-decoration: none; color: var(--color-text);
  box-shadow: var(--shadow-sm); transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.day-list li a:hover { transform: translateX(3px); box-shadow: var(--shadow-md); text-decoration: none; }
.day-list .day-date { font-weight: 700; text-transform: capitalize; }
.day-list .day-meta { color: var(--color-text-muted); font-size: 0.85rem; }

/* ---------- Places: quick add ---------- */
.quick-add-card { padding: 1rem 1.25rem; }
.quick-add-form { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.quick-add-form input[type="text"],
.quick-add-form input:not([type]) {
  flex: 1 1 260px;
  -webkit-appearance: none; appearance: none;
  padding: 0.6rem 0.9rem; border: 1px solid var(--color-border); border-radius: var(--radius-pill);
  font: inherit; font-size: 0.92rem; background: var(--color-surface-2); color: var(--color-text);
}
.quick-add-form input:focus {
  outline: none; border-color: var(--color-primary); background: var(--color-surface);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}
.quick-add-form select { flex: 0 0 auto; padding: 0.5rem 2rem 0.5rem 0.8rem; }
.quick-add-form .btn { flex: 0 0 auto; }
.quick-add-form .quick-add-address { flex: 1 1 220px; }
.quick-add-form .quick-add-address input[type="text"] { width: 100%; }

/* ---------- Places: grouped card list ---------- */
.lieu-group { margin-bottom: 1.5rem; }
.lieu-group-title {
  display: flex; align-items: center; gap: 0.5rem; font-family: var(--font-body);
  font-size: 0.95rem; font-weight: 700; color: var(--color-text-muted); text-transform: capitalize;
  margin: 0 0 0.6rem;
}
.lieu-group-title a { color: var(--color-text); }
.lieu-group-count {
  background: var(--color-surface-2); border: 1px solid var(--color-border); color: var(--color-text-faint);
  font-size: 0.72rem; font-weight: 700; border-radius: var(--radius-pill); padding: 0.05rem 0.55rem;
}
.lieu-card-list { display: flex; flex-direction: column; gap: 0.5rem; }
.lieu-card {
  display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap;
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md);
  padding: 0.7rem 1rem; box-shadow: var(--shadow-sm); transition: box-shadow 0.15s ease;
}
.lieu-card:hover { box-shadow: var(--shadow-md); }
.lieu-card-name {
  flex: 1 1 200px; display: flex; align-items: center; gap: 0.5rem;
  font-weight: 600; color: var(--color-text); text-decoration: none;
}
.lieu-card-name:hover { color: var(--color-primary); text-decoration: none; }
.lieu-cat-icon { font-size: 1.1rem; }
.lieu-card-actions { display: flex; align-items: center; gap: 0.5rem; flex: 0 0 auto; margin-left: auto; }

.status-toggle { display: inline-flex; border: 1px solid var(--color-border); border-radius: var(--radius-pill); overflow: hidden; }
.status-btn {
  -webkit-appearance: none; appearance: none; border: none; background: var(--color-surface-2);
  color: var(--color-text-faint);
  padding: 0.3rem 0.65rem; font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.02em; line-height: 1.4; cursor: pointer; white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
.status-btn + .status-btn { border-left: 1px solid var(--color-border); }
.status-btn:hover { background: var(--color-surface); color: var(--color-text); }
.status-btn.active[data-value="prevu"] { background: var(--color-info-bg); color: var(--color-info); }
.status-btn.active[data-value="fait"] { background: var(--color-success-bg); color: var(--color-success); }
.status-btn.active[data-value="abandonne"] { background: var(--color-danger-bg); color: var(--color-danger); }

.day-assign { font-size: 0.82rem; padding: 0.3rem 1.8rem 0.3rem 0.6rem; background-size: 0.9em; background-position: right 0.55rem center; }

/* ---------- Day view: drag-to-reorder "Lieux du jour" ---------- */
.day-lieu-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.day-lieu-list li {
  display: flex; align-items: center; gap: 0.6rem;
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md);
  padding: 0.55rem 0.8rem; box-shadow: var(--shadow-sm); will-change: transform;
}
.day-lieu-list li.dragging {
  box-shadow: var(--shadow-lg); opacity: 0.92; position: relative; z-index: 1;
  transition: box-shadow 0.15s ease, opacity 0.15s ease;
}
.day-lieu-handle {
  flex: none; border: none; background: none; padding: 0.2rem 0.3rem; margin: -0.2rem -0.3rem -0.2rem 0;
  font-size: 1.1rem; line-height: 1; color: var(--color-text-faint); cursor: grab;
  touch-action: none; user-select: none;
}
.day-lieu-handle:active { cursor: grabbing; }
.day-reorder-hint { font-size: 0.76rem; margin-top: 0.4rem; }

/* ---------- Checklist ---------- */
/* Two views in one tab: an overview list and one checklist at a time.
   Deliberately un-boxed: hairlines, serif numerals, no cards-in-cards.
   Without JS (standalone page) the overview is hidden and every
   checklist shows stacked. */
.cl-root:not(.cl-js) .cl-overview { display: none; }
.cl-root:not(.cl-js) .cl-back { display: none; }
.cl-root:not(.cl-js) .cl-detail + .cl-detail { margin-top: 2.5rem; }
.cl-root.cl-js .cl-detail { display: none; }
.cl-root.cl-js .cl-detail.is-open { display: block; animation: cl-in 0.22s ease; }
.cl-root.cl-js.has-open .cl-overview { display: none; }
@keyframes cl-in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }

.cl-rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--color-border); }
.cl-rows li { border-bottom: 1px dashed var(--color-border); }
.cl-row {
  width: 100%; display: flex; align-items: center; gap: 0.95rem; padding: 0.95rem 0.1rem;
  background: none; border: none; font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.cl-ring {
  --size: 3.2rem;
  flex: none; width: var(--size); height: var(--size); border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--color-accent) calc(var(--p) * 1%), var(--color-border) 0);
  position: relative; transition: transform 0.2s ease;
}
.cl-ring::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--color-surface); }
.cl-ring-num { position: relative; font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; }
.cl-ring-num small { font-size: 0.6rem; margin-left: 1px; color: var(--color-text-muted); }
.cl-row:hover .cl-ring { transform: rotate(-8deg) scale(1.05); }
.cl-row-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.cl-row-name { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; line-height: 1.2; word-break: break-word; }
.cl-row-meta { font-size: 0.78rem; color: var(--color-text-muted); letter-spacing: 0.01em; }
.cl-chevron { font-size: 1.6rem; line-height: 1; color: var(--color-text-faint); transition: transform 0.15s ease, color 0.15s ease; }
.cl-row:hover .cl-chevron { transform: translateX(3px); color: var(--color-accent-dark); }
.cl-row.is-complete .cl-ring { background: var(--color-success); }
.cl-row.is-complete .cl-ring-num { color: var(--color-success); font-size: 1.2rem; }
.cl-row.is-complete .cl-row-meta { color: var(--color-success); }

.cl-empty { margin: 1.6rem 0; text-align: center; color: var(--color-text-muted); font-size: 0.9rem; line-height: 1.6; font-family: var(--font-display); font-style: italic; }

/* "+ label ....... action" -- the same underlined input for both forms. */
.cl-new, .cl-add { display: flex; align-items: center; gap: 0.6rem; margin-top: 1.1rem; border-bottom: 1.5px solid var(--color-border); transition: border-color 0.15s ease; }
.cl-new:focus-within, .cl-add:focus-within { border-color: var(--color-accent); }
.cl-new-plus { color: var(--color-accent-dark); font-size: 1.4rem; font-weight: 300; line-height: 1; width: 1.4rem; text-align: center; }
.cl-new input[type="text"], .cl-add input[type="text"] {
  flex: 1 1 auto; min-width: 0; border: none; background: none; box-shadow: none; border-radius: 0;
  padding: 0.65rem 0; font-size: 0.95rem;
}
.cl-new input[type="text"]:focus, .cl-add input[type="text"]:focus { outline: none; box-shadow: none; }
.cl-new-go {
  flex: none; border: none; background: none; font: inherit; font-size: 0.82rem; font-weight: 700;
  color: var(--color-accent-dark); cursor: pointer; padding: 0.4rem 0.2rem; letter-spacing: 0.02em;
}
.cl-new-go:hover { text-decoration: underline; text-underline-offset: 3px; }

.cl-back {
  border: none; background: none; font: inherit; font-size: 0.85rem; font-weight: 600;
  color: var(--color-text-muted); cursor: pointer; padding: 0.2rem 0; margin-bottom: 0.9rem;
}
.cl-back:hover { color: var(--color-accent-dark); }
.cl-head { margin-bottom: 1.2rem; }
.cl-head h2 { margin: 0; font-family: var(--font-display); font-size: 1.7rem; font-weight: 600; line-height: 1.15; word-break: break-word; }
.cl-head-sub { margin-top: 0.3rem; font-size: 0.85rem; color: var(--color-text-muted); }
.cl-head-sub b { color: var(--color-text); font-family: var(--font-display); font-size: 1.05rem; }
.cl-line { height: 3px; background: var(--color-border); border-radius: 3px; margin-top: 0.8rem; overflow: hidden; }
.cl-line span { display: block; height: 100%; background: var(--color-accent); border-radius: 3px; transition: width 0.4s ease; }
.cl-detail.is-complete .cl-line span { background: var(--color-success); }

.checklist-items { list-style: none; margin: 0; padding: 0; }
.checklist-item { display: flex; align-items: center; gap: 0.85rem; padding: 0.7rem 0.1rem; border-bottom: 1px solid var(--color-border); }
.checklist-item-label { flex: 1 1 auto; min-width: 0; font-size: 1rem; word-break: break-word; transition: color 0.2s ease; }
.checklist-item.done .checklist-item-label { color: var(--color-text-faint); text-decoration: line-through; text-decoration-color: var(--color-text-faint); }
.checklist-toggle-form { display: flex; }
.checklist-check { border: none; background: none; padding: 0; cursor: pointer; display: flex; }
.cl-box {
  width: 1.5rem; height: 1.5rem; border-radius: 7px; display: grid; place-items: center;
  border: 1.5px solid var(--color-text-faint); color: transparent; transition: all 0.18s ease;
}
.checklist-check:hover .cl-box { border-color: var(--color-accent); background: var(--color-accent-light); }
.done .cl-box { background: var(--color-accent); border-color: var(--color-accent); color: #fff; }
.checklist-item-delete {
  flex: none; border: none; background: none; font-size: 0.75rem; line-height: 1;
  color: var(--color-text-faint); padding: 0.3rem; cursor: pointer;
}
.checklist-item-delete:hover { color: var(--color-danger); }
/* Hover-to-reveal only where hovering is actually a thing -- touch
   devices (no persistent hover) always show it. */
@media (hover: hover) {
  .checklist-item-delete { opacity: 0; transition: opacity 0.15s ease; }
  .checklist-item:hover .checklist-item-delete, .checklist-item-delete:focus-visible { opacity: 1; }
}
.checklist-item { background: var(--color-surface); will-change: transform; }
.checklist-item.dragging { box-shadow: var(--shadow-lg); position: relative; z-index: 1; background: var(--color-surface); border-radius: var(--radius-md); }
.cl-handle {
  flex: none; margin: 0 -0.3rem 0 -0.35rem; padding: 0.2rem 0.25rem; font-size: 1rem; line-height: 1;
  color: var(--color-text-faint); cursor: grab; touch-action: none; user-select: none; opacity: 0.55;
}
.cl-handle:active { cursor: grabbing; }
@media (hover: hover) {
  .cl-handle { opacity: 0; transition: opacity 0.15s ease; }
  .checklist-item:hover .cl-handle, .checklist-item.dragging .cl-handle { opacity: 0.8; }
}
.cl-personal {
  display: inline-block; margin-left: 0.35rem; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.02em;
  color: var(--color-accent-dark); background: var(--color-accent-light); border-radius: var(--radius-pill);
  padding: 0.05rem 0.5rem; vertical-align: 0.1em; text-decoration: none;
}
.cl-scope { flex: none; cursor: pointer; user-select: none; }
.cl-scope input { position: absolute; opacity: 0; width: 0; height: 0; }
.cl-scope span {
  display: inline-block; font-size: 0.75rem; font-weight: 600; color: var(--color-text-muted);
  border: 1px solid var(--color-border); border-radius: var(--radius-pill); padding: 0.15rem 0.6rem;
  transition: all 0.15s ease;
}
.cl-scope:hover span { border-color: var(--color-accent); }
.cl-scope input:checked + span { background: var(--color-accent-light); border-color: var(--color-accent); color: var(--color-accent-dark); }
.cl-scope input:focus-visible + span { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.cl-delete { margin-top: 2rem; }
.checklist-delete-btn {
  border: none; background: none; font: inherit; font-size: 0.78rem; cursor: pointer;
  color: var(--color-text-faint); padding: 0; text-decoration: underline; text-underline-offset: 3px;
}
.checklist-delete-btn:hover { color: var(--color-danger); }

/* ---------- Dépenses ---------- */
.dep-h2 { font-size: 1.05rem; margin: 1.6rem 0 0.6rem; }

/* Hero total, echoing .fx-input/.fx-result's big serif figure rather than
   a bordered summary box -- the number IS the content here. */
.dep-hero { margin-top: 0.6rem; padding-bottom: 1rem; border-bottom: 1px solid var(--color-border); }
.dep-hero-figure { display: flex; align-items: baseline; gap: 0.5rem; }
.dep-hero-label { font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-text-muted); font-weight: 700; }
.dep-hero-value {
  font-family: var(--font-display); font-weight: 600; font-size: 2.4rem; line-height: 1.1;
  letter-spacing: -0.01em; color: var(--color-text);
}
.dep-hero-value small { font-size: 1rem; font-weight: 600; color: var(--color-text-muted); margin-left: 0.2rem; }
.dep-line { height: 3px; background: var(--color-border); border-radius: 3px; margin-top: 0.9rem; overflow: hidden; }
.dep-line span { display: block; height: 100%; background: var(--color-accent); border-radius: 3px; transition: width 0.4s ease; }
.dep-line span.over { background: var(--color-danger); }
.dep-hero-sub { margin: 0.4rem 0 0; font-size: 0.82rem; color: var(--color-text-muted); }
.dep-hero-sub.over { color: var(--color-danger); font-weight: 600; }
.dep-warn { margin: 0.6rem 0 0; padding: 0.5rem 0.65rem; border-radius: 8px; background: var(--color-warning-bg); color: var(--color-warning); font-size: 0.78rem; line-height: 1.4; }

.dep-balances { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--color-border); }
.dep-balance {
  display: flex; justify-content: space-between; align-items: center; gap: 0.5rem;
  padding: 0.55rem 0; border-bottom: 1px dashed var(--color-border); font-size: 0.9rem;
}
.dep-balance-amount { font-weight: 700; font-variant-numeric: tabular-nums; }
.dep-balance.credit .dep-balance-amount { color: var(--color-success); }
.dep-balance.debit .dep-balance-amount { color: var(--color-danger); }
.dep-balance.even .dep-balance-amount { color: var(--color-text-faint); font-weight: 500; }
.dep-transactions {
  list-style: none; margin: 0.7rem 0 0; padding: 0; font-size: 0.86rem;
  display: flex; flex-direction: column; gap: 0.5rem;
}
.dep-transactions li { display: flex; align-items: baseline; gap: 0.4rem; flex-wrap: wrap; }
.dep-tx-name { font-weight: 600; }
.dep-tx-arrow { color: var(--color-text-faint); }
.dep-tx-amount { margin-left: auto; font-weight: 700; color: var(--color-accent-dark); font-variant-numeric: tabular-nums; }

/* Add-expense form: underline inputs in the checklist's "+ …  go" idiom
   instead of a bordered card, with the payeur/répartition detail tucked
   behind a plain-text disclosure rather than another box. */
.dep-new { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.5rem; }
.dep-new-row {
  display: flex; align-items: center; gap: 0.6rem; border-bottom: 1.5px solid var(--color-border);
  transition: border-color 0.15s ease; padding-bottom: 0.3rem;
}
.dep-new-row:focus-within { border-color: var(--color-accent); }
.dep-new-plus { color: var(--color-accent-dark); font-size: 1.4rem; font-weight: 300; line-height: 1; width: 1.4rem; text-align: center; flex: none; }
.dep-new-row input[name="libelle"] {
  flex: 1 1 auto; min-width: 0; border: none; background: none; box-shadow: none; border-radius: 0;
  padding: 0.3rem 0; font: inherit; font-size: 0.95rem;
}
.dep-new-row input[name="libelle"]:focus { outline: none; box-shadow: none; }
.dep-new-montant {
  flex: none; width: 5.5rem; border: none; background: none; box-shadow: none; border-radius: 0;
  padding: 0.3rem 0; font: inherit; font-size: 0.95rem; font-variant-numeric: tabular-nums; text-align: right;
}
.dep-new-montant:focus { outline: none; box-shadow: none; }
.dep-new-devise {
  flex: none; border: none; background: none; box-shadow: none; border-radius: 0;
  padding: 0.3rem 0; font: inherit; font-size: 0.78rem; font-weight: 700; color: var(--color-text-muted);
  cursor: pointer;
}
.dep-new-devise:focus { outline: none; box-shadow: none; }
.dep-new-meta { display: flex; gap: 0.6rem; }
.dep-new-meta > * { flex: 1 1 0; min-width: 0; }

.dep-advanced { margin-top: 0.1rem; }
.dep-advanced summary {
  font-size: 0.8rem; font-weight: 600; color: var(--color-text-muted); padding: 0.3rem 0; cursor: pointer;
  list-style: none;
}
.dep-advanced summary::-webkit-details-marker { display: none; }
.dep-advanced summary::before { content: "› "; }
.dep-advanced[open] summary { color: var(--color-text); }
.dep-advanced[open] summary::before { content: "⌄ "; }
.dep-adv-body { padding: 0.4rem 0 0.2rem; }
.dep-field { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.78rem; font-weight: 600; color: var(--color-text-muted); }
.dep-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--color-text-muted); margin: 0.6rem 0 0.3rem; }
.dep-checks { display: flex; flex-wrap: wrap; gap: 0.4rem 0.9rem; margin-bottom: 0.4rem; }
.dep-check { display: flex; align-items: center; gap: 0.3rem; font-size: 0.85rem; }
.dep-check input[type="checkbox"] { width: auto; }
.dep-check input[type="text"] { width: 5.5rem; font-size: 0.85rem; padding: 0.25rem 0.45rem; }
.dep-repart { display: flex; gap: 1rem; font-size: 0.85rem; margin-bottom: 0.3rem; }
.dep-repart label { display: flex; align-items: center; gap: 0.3rem; }
.dep-repart input[type="radio"] { width: auto; }
.dep-custom-amounts { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 0.4rem; }

/* Historique -- same hairline-row idiom as .checklist-item, hover-reveal
   affordances instead of everything sitting bordered and boxed. */
.dep-list { list-style: none; margin: 0.4rem 0 0; padding: 0; border-top: 1px solid var(--color-border); }
.dep-list > li { border-bottom: 1px solid var(--color-border); }
.dep-row summary {
  display: flex; align-items: center; gap: 0.7rem; padding: 0.65rem 0.1rem; cursor: pointer;
  list-style: none; font-size: 0.9rem;
}
.dep-row summary::-webkit-details-marker { display: none; }
.dep-cat {
  flex: none; width: 2rem; height: 2rem; border-radius: 50%; background: var(--color-surface-2);
  border: 1px solid var(--color-border); display: grid; place-items: center; font-size: 1rem;
}
.dep-lib { flex: 1 1 auto; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dep-auto-badge { font-size: 0.8rem; opacity: 0.75; }
.dep-date { flex: none; font-size: 0.78rem; color: var(--color-text-faint); }
.dep-amount { flex: none; font-weight: 700; font-variant-numeric: tabular-nums; }
.dep-row.is-auto .dep-lib, .dep-row.is-auto .dep-amount { color: var(--color-text-muted); }
.dep-detail { padding: 0 0.1rem 0.9rem 2.65rem; display: flex; flex-direction: column; gap: 0.4rem; }
.dep-parts { list-style: none; margin: 0; padding: 0; font-size: 0.84rem; color: var(--color-text-muted); }
.dep-auto-note { font-size: 0.8rem; color: var(--color-text-muted); line-height: 1.5; }
.dep-auto-note a { color: var(--color-primary); font-weight: 600; }
.dep-edit { margin-top: 0.4rem; }
.dep-edit-summary { font-size: 0.78rem; font-weight: 600; color: var(--color-primary); cursor: pointer; list-style: none; }
.dep-edit-summary::-webkit-details-marker { display: none; }
.dep-edit-actions { margin-top: 0.2rem; }
.dep-form-error { color: var(--color-danger); font-size: 0.82rem; }
.dep-form { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.5rem; }
.dep-form-row { display: flex; gap: 0.5rem; }
.dep-form-row > * { flex: 1 1 0; min-width: 0; }
.dep-form textarea { font: inherit; font-size: 0.88rem; }

/* ---------- Change (taux de change) ---------- */
.fx { display: flex; flex-direction: column; align-items: stretch; gap: 0; position: relative; }
.fx-box {
  display: flex; align-items: baseline; gap: 0.9rem; padding: 1rem 0.2rem 0.8rem;
  border-bottom: 1.5px solid var(--color-border);
}
.fx-from { transition: border-color 0.15s ease; }
.fx-from:focus-within { border-color: var(--color-accent); }
.fx-code {
  flex: none; min-width: 3.4rem; font-size: 0.78rem; font-weight: 800; letter-spacing: 0.12em;
  color: var(--color-text-muted);
}
.fx-input, .fx-result {
  flex: 1 1 auto; min-width: 0; width: 100%; font-family: var(--font-display); font-weight: 600;
  font-size: 2.2rem; line-height: 1.1; letter-spacing: -0.01em; text-align: right;
}
.fx-input {
  border: none; background: none; box-shadow: none; border-radius: 0; padding: 0; color: var(--color-text);
}
.fx-input:focus { outline: none; box-shadow: none; }
.fx-input::placeholder { color: var(--color-text-faint); }
.fx-result { color: var(--color-accent-dark); word-break: break-all; }
.fx-swap {
  align-self: center; margin: -0.85rem 0; z-index: 1; position: relative;
  width: 2.6rem; height: 2.6rem; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  border: 1.5px solid var(--color-border); background: var(--color-surface); color: var(--color-accent-dark);
  box-shadow: var(--shadow-sm); transition: transform 0.25s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.fx-swap:hover { border-color: var(--color-accent); box-shadow: var(--shadow-md); }
.fx.swapped .fx-swap { transform: rotate(180deg); }
.fx-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1.2rem; }
.fx-chip {
  border: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-text);
  font: inherit; font-size: 0.85rem; font-weight: 600; padding: 0.3rem 0.85rem; border-radius: var(--radius-pill); cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.fx-chip:hover { border-color: var(--color-accent); background: var(--color-accent-light); }
.fx-note { margin: 1.1rem 0 0; font-size: 0.78rem; line-height: 1.5; color: var(--color-text-muted); }
.fx-note.fx-error { color: var(--color-danger); }

/* ---------- Admin ---------- */
.admin-group { margin-top: 1.2rem; }
.admin-group h2 { margin: 0 0 0.25rem; }
.admin-rows { margin-top: 0.8rem; display: flex; flex-direction: column; }
.admin-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 11rem 9rem; align-items: center; gap: 0.4rem 1rem;
  padding: 0.7rem 0; border-top: 1px solid var(--color-border);
}
.admin-row label { display: flex; flex-direction: column; gap: 0.1rem; }
.admin-label { font-weight: 600; font-size: 0.93rem; }
.admin-help { font-size: 0.78rem; color: var(--color-text-muted); }
.admin-field { display: flex; align-items: center; gap: 0.5rem; }
.admin-field input {
  width: 6rem; text-align: right; font: inherit; font-variant-numeric: tabular-nums; padding: 0.45rem 0.7rem;
  background: var(--color-surface-2); border: 1px solid var(--color-border); border-radius: var(--radius-sm);
}
.admin-field input:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-primary-light); }
.admin-unit { font-size: 0.78rem; color: var(--color-text-muted); white-space: nowrap; }
.admin-meta { font-size: 0.75rem; text-align: right; }
.admin-default { color: var(--color-text-faint); }
.admin-changed { color: var(--color-accent-dark); font-weight: 600; }
.admin-row.has-error .admin-field input { border-color: var(--color-danger); }
.admin-actions { display: flex; gap: 0.6rem; margin-top: 1.4rem; }
@media (max-width: 640px) {
  .admin-row { grid-template-columns: 1fr auto; }
  .admin-row label { grid-column: 1 / -1; }
  .admin-meta { text-align: left; }
}

/* ---------- Trip hub (carte centrale) ---------- */
.container:has(.trip-hub) { max-width: none; padding: 0; }
.container:has(.trip-hub) > .flashes { padding: 0.75rem 1rem 0; margin: 0; }

.trip-hub {
  position: relative;
  height: calc(100dvh - var(--navbar-h));
  overflow: hidden;
  overflow: clip; /* hidden still lets focus()/scrollIntoView shift it sideways */
  background: var(--color-surface-2);
}
#hub-map { position: absolute; inset: 0; background: #e9e6e0; }

/* The search bar and the style/satellite/relief/filter controls live in
   one flex row so they always stay vertically aligned with each other --
   the row wraps (controls drop to their own line) only if a narrow
   viewport can't fit both, rather than ever overlapping. Alerts are
   deliberately NOT in this row: they sit on their own line below it. */
.map-top-bar {
  position: absolute; top: 0.75rem; left: 0.75rem; right: 0.75rem; z-index: 12;
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem;
}
.map-search {
  flex: 1 1 200px; min-width: 0; max-width: 480px;
}
.map-search-box {
  position: relative; display: flex; align-items: center; gap: 0.5rem;
  height: 44px; padding: 0 0.9rem; border-radius: var(--radius-pill);
  background: var(--color-surface); border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
}
.map-search-icon { flex: none; font-size: 1rem; opacity: 0.6; }
.map-search-input {
  flex: 1 1 auto; min-width: 0; border: none; background: none; font: inherit;
  font-size: 0.9rem; color: var(--color-text); padding: 0;
}
.map-search-input:focus { outline: none; }
.map-search-clear {
  flex: none; border: none; background: none; font-size: 1rem; line-height: 1;
  color: var(--color-text-muted); cursor: pointer; padding: 0.2rem;
}

.map-controls {
  flex: none; display: flex; gap: 0.4rem; align-items: center; font: inherit;
  margin-left: auto; /* flush to the right edge of the bar, like before */
}

/* The alert chip sits BELOW the sheet's z-index on purpose: on mobile the
   sheet can expand to cover most of the hub, and when it does it should
   win over this small floating control rather than it awkwardly floating
   on top of the open panel. It's on its own row below the search/controls
   bar, out of everything else's way. */
.alert-chip {
  position: absolute; top: 4rem; z-index: 12;
  font: inherit; cursor: pointer;
}

.map-control-select, .map-control-cell {
  border: 1px solid var(--color-border); box-shadow: var(--shadow-md);
  background: var(--color-surface); cursor: pointer;
}
.map-control-select {
  -webkit-appearance: none; appearance: none;
  border-radius: var(--radius-pill); font: inherit; font-size: 0.78rem; font-weight: 600;
  color: var(--color-text); padding: 0.42rem 1.7rem 0.42rem 0.75rem; height: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%237a7268'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.55rem center; background-size: 0.95em;
}
.map-control-cell {
  width: 36px; height: 36px; border-radius: 50%; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
}
.map-control-cell:hover { background: var(--color-surface-2); }
.map-control-cell.active { background: var(--color-primary); border-color: var(--color-primary); }
.map-control-cell.active:hover { background: var(--color-primary-dark); }

.alert-chip {
  left: 0.75rem; border-radius: var(--radius-pill); padding: 0.5rem 1rem;
  border: 1px solid var(--color-warning); box-shadow: var(--shadow-md);
  background: var(--color-warning-bg); color: #8a5a12;
  font-weight: 700; font-size: 0.82rem;
}
.alert-popover {
  position: absolute; top: 6.75rem; left: 0.75rem; z-index: 13; max-width: min(320px, 80vw);
  max-height: 260px; overflow-y: auto; background: var(--color-surface);
  border: 1px solid var(--color-border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); padding: 0.5rem;
}
.alert-row {
  padding: 0.5rem 0.65rem; border-left: 3px solid var(--color-warning);
  background: var(--color-warning-bg); color: #6b4712; border-radius: 6px;
  font-size: 0.82rem; margin-bottom: 0.4rem; line-height: 1.4;
}

.category-filter-popover {
  position: absolute; top: 4.35rem; right: 0.75rem; z-index: 13; width: 190px;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-lg); padding: 0.6rem 0.75rem;
}
.cf-row {
  display: flex; align-items: center; gap: 0.5rem; padding: 0.3rem 0;
  font-size: 0.85rem; color: var(--color-text); cursor: pointer;
}
.cf-row input[type="checkbox"] { width: auto; margin: 0; flex: none; }
.cf-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; border: 1px solid rgba(0, 0, 0, 0.15); }
.cf-sep { border: none; border-top: 1px solid var(--color-border); margin: 0.35rem 0; }
.cf-manage-link { display: block; font-size: 0.8rem; color: var(--color-text-muted); text-align: center; padding: 0.2rem 0; }
.alert-row:last-child { margin-bottom: 0; }

/* ---- Bottom sheet ---- */
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; height: 92%;
  background: var(--color-surface); border-radius: 20px 20px 0 0;
  box-shadow: var(--shadow-lg); z-index: 15;
  display: flex; flex-direction: column; touch-action: none;
  transition: transform 0.25s cubic-bezier(0.32, 0.72, 0, 1);
}
.sheet[data-state="peek"] { transform: translateY(calc(100% - 118px)); }
.sheet[data-state="half"] { transform: translateY(48%); }
.sheet[data-state="full"] { transform: translateY(0); }
.sheet.dragging { transition: none; }

.sheet-handle {
  flex: none; width: 40px; height: 5px; border-radius: 999px; margin: 0.65rem auto 0.35rem;
  background: var(--color-border); border: none; padding: 0; cursor: grab;
}
.sheet-header { flex: none; padding: 0 1.15rem 0.5rem; }
.sheet-header h1 { font-size: 1.1rem; margin: 0; }
.sheet-dates { color: var(--color-text-muted); font-size: 0.8rem; }

.sheet-tabs {
  flex: none; display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0.5rem 1.15rem;
  border-bottom: 1px solid var(--color-border);
}
.sheet-tab {
  flex: none; padding: 0.4rem 0.85rem; border-radius: var(--radius-pill);
  border: 1px solid var(--color-border); background: var(--color-surface-2);
  color: var(--color-text-muted); font-weight: 600; font-size: 0.82rem;
  cursor: pointer; white-space: nowrap; transition: background 0.15s ease, color 0.15s ease;
}
.sheet-tab.active { background: var(--color-primary); color: white; border-color: var(--color-primary); }

.sheet-content {
  flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 1rem 1.15rem calc(2rem + env(safe-area-inset-bottom, 0px));
}
.sheet-content .page-header { margin-bottom: 1.1rem; }
.sheet-content h1 { font-size: 1.3rem; }

/* ---- Place / reservation detail panel (marker click) ---- */
.place-panel {
  position: absolute; left: 0; right: 0; bottom: 0; height: var(--place-h, 72%);
  background: var(--color-surface); border-radius: 20px 20px 0 0;
  box-shadow: var(--shadow-lg); z-index: 25; overflow-y: auto;
  transform: translateY(100%); transition: transform 0.22s ease;
}
.place-panel.open { transform: translateY(0); }
.place-panel-close, .place-panel-edit-fab {
  position: absolute; top: 0.6rem; width: 34px; height: 34px; border-radius: 50%;
  border: none; background: rgba(255, 255, 255, 0.92); box-shadow: var(--shadow-sm);
  font-size: 1rem; line-height: 1; cursor: pointer; z-index: 2;
}
.place-panel-close { right: 0.6rem; }
.place-panel-edit-fab { left: 0.6rem; font-size: 0.9rem; }
.place-panel-edit-fab:hover { background: rgba(255, 255, 255, 1); }
.place-panel-media {
  width: 100%; height: 150px; flex: none; background-size: cover; background-position: center;
  background-color: var(--color-primary-light);
  display: flex; align-items: center; justify-content: center; font-size: 2.6rem;
}
.place-panel-body { padding: 1rem 1.15rem calc(1.5rem + env(safe-area-inset-bottom, 0px)); }
.place-panel-body h2 { margin: 0.3rem 0 0.4rem; font-size: 1.2rem; }
.panel-badge-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; }
.panel-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.35rem; }
.panel-badges .badge {
  font-size: 0.72rem; font-weight: 600; text-transform: none; letter-spacing: normal;
  padding: 0.2rem 0.6rem;
}
.panel-badge-day { font: inherit; cursor: pointer; }
.panel-badge-day:hover { background: var(--color-border); }
.place-panel-body .weather-card {
  display: flex; align-items: flex-start; gap: 0.7rem; background: var(--color-surface-2);
  border: 1px solid var(--color-border); border-radius: 10px; padding: 0.7rem 0.85rem; margin-top: 0.85rem;
}
.place-panel-body .weather-card .emoji { font-size: 1.6rem; line-height: 1; }
.place-panel-body .weather-card .temp { font-size: 1.05rem; font-weight: 700; }
.place-panel-body .weather-card .meta { font-size: 0.76rem; color: var(--color-text-muted); margin: 0; }
.weather-body { flex: 1 1 auto; min-width: 0; }
.weather-top { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.35rem; }
.drone-badge {
  font-size: 0.7rem; font-weight: 700; padding: 0.15rem 0.55rem; border-radius: var(--radius-pill);
  white-space: nowrap;
}
.drone-badge-go { background: var(--color-success-bg); color: var(--color-success); }
.drone-badge-caution { background: var(--color-warning-bg); color: var(--color-warning); }
.drone-badge-no-go { background: var(--color-danger-bg); color: var(--color-danger); }
.weather-facts {
  list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.15rem;
  font-size: 0.76rem; color: var(--color-text-muted);
}
.weather-reasons { font-size: 0.74rem; color: var(--color-danger); margin: 0.3rem 0 0; }
.place-panel-body #place-panel-edit-form { max-width: none; }

.map-add-popup { display: flex; gap: 0.4rem; align-items: center; }
.map-add-popup input {
  padding: 0.35rem 0.6rem; border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  font: inherit; font-size: 0.85rem; width: 160px;
}

/* Mobile default: the sheet/place-panel is full width, nothing to resize.
   Declared before the desktop media query below so its own `display: block`
   can actually win there -- a same-specificity rule placed *after* a media
   query overrides it regardless of viewport (this used to sit after the
   block and silently disabled the handle at every width). */
.panel-resize-handle { display: none; }

@media (min-width: 900px) {
  .sheet, .place-panel {
    top: 0; bottom: 0; left: auto; right: 0; width: var(--panel-w, 420px); height: auto;
    border-radius: 0; box-shadow: -8px 0 24px -8px rgba(33, 29, 26, 0.18);
  }
  .sheet { transform: none !important; }
  .sheet-handle { display: none; }
  .place-panel { transform: translateX(100%); }
  .place-panel.open { transform: translateX(0); }
  /* The top bar (search + controls) and the filter popover need to dodge
     the permanent side panel; the alert chip stays on the left, out of
     its way. */
  .map-top-bar, .category-filter-popover { right: calc(var(--panel-w, 420px) + 20px); }

  .panel-resize-handle {
    display: block; position: absolute; top: 0; bottom: 0; left: -6px; width: 12px;
    cursor: col-resize; z-index: 30; background: transparent;
    /* It's a <button> (for a11y/focus), but a plain UA button border/
       padding traced the panel's full height as a stray black rectangle --
       reset it to the bare invisible drag strip it's meant to be. */
    border: none; padding: 0; margin: 0; appearance: none;
  }
  .panel-resize-handle:focus-visible {
    outline: 2px solid var(--color-primary); outline-offset: -2px;
  }
  /* A plain seam line, flush with the panel's own edge -- no floating
     shape hanging over the map (an earlier "grip pill" read as a stray
     box, not a resize handle). Widens and switches to accent colour on
     hover/drag; that plus the native col-resize cursor and the tooltip
     is what carries discoverability, deliberately without any decoration
     when idle. */
  .panel-resize-handle::after {
    content: ""; position: absolute; top: 0; bottom: 0; left: 5px; width: 1px;
    background: var(--color-border); transition: background 0.15s ease, width 0.15s ease;
  }
  .panel-resize-handle:hover::after, .panel-resize-handle.dragging::after {
    width: 3px; left: 4px; background: var(--color-primary);
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .navbar { padding: 0.6rem 1rem; flex-wrap: wrap; row-gap: 0.3rem; }
  .navbar .brand { order: 1; }
  .nav-toggle { display: grid; order: 2; margin-left: auto; }
  /* One row: Mes voyages · (Admin) · 👤 pseudo (takes what's left, ellipsis) · Déconnexion */
  .nav-links { order: 3; width: 100%; flex-wrap: nowrap; gap: 0.1rem; }
  .nav-links a, .nav-links .link-button { padding: 0.35rem 0.55rem; font-size: 0.84rem; white-space: nowrap; }
  .nav-links .inline-form { flex: none; }
  .nav-user { flex: 1 1 0; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 0.25rem; border-left: none; margin-left: 0; color: var(--color-primary-dark); font-weight: 600; }
  .nav-user-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  html.nav-collapsed .navbar { display: none; }
  .container { padding: 1.25rem 1rem 3rem; }
  h1 { font-size: 1.6rem; }
  .auth-card { padding: 1.5rem; }

  .lieu-card { position: relative; }
  .lieu-card-actions { margin-left: 0; width: 100%; justify-content: space-between; }
}

/* ---------- Itinéraires (static/js/routing.js) ---------- */
#hub-map.route-mode .maplibregl-canvas { cursor: crosshair; }

/* Floating planner (route mode) -- top-left, under the search bar. The
   alert chip lives at the same spot, so shift down when it's there. */
.route-planner {
  position: absolute; top: 4.1rem; left: 0.75rem; z-index: 14;
  width: 310px; max-width: calc(100% - 1.5rem); max-height: calc(100% - 5rem); overflow-y: auto;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-lg); padding: 0.75rem 0.85rem;
}
.route-planner[hidden] { display: none; }
.alert-chip ~ .route-planner { top: 7.4rem; max-height: calc(100% - 8.3rem); }

.place-route-box {
  margin: 0.2rem 0 0.9rem; padding: 0.7rem 0.8rem;
  background: var(--color-surface-2); border: 1px solid var(--color-border); border-radius: var(--radius-md);
}
.place-route-box[hidden] { display: none; }

.rp-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.55rem; font-size: 0.9rem; }
.rp-close { border: none; background: none; cursor: pointer; font-size: 1rem; color: var(--color-text-muted); padding: 0.1rem 0.3rem; }
.rp-close:hover { color: var(--color-text); }

/* ---------- Suggestions autour d'un point (nearby.js) ---------- */
.nearby-panel { width: 340px; }
.nb-label { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-text-muted); margin: 0.5rem 0 0.25rem; display: flex; justify-content: space-between; }
.nb-radius-val { color: var(--color-primary); font-weight: 800; letter-spacing: 0; text-transform: none; }
#nearby-radius-slider { width: 100%; accent-color: var(--color-primary); cursor: pointer; }
.nb-radius-ends { display: flex; justify-content: space-between; font-size: 0.68rem; color: var(--color-text-faint); margin-top: 0.1rem; }
#nearby-center { font-size: 0.85rem; font-weight: 600; margin-bottom: 0.3rem; }
.nb-hint { font-weight: 400; color: var(--color-text-muted); }
.nb-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.nb-chips button {
  border: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-text-muted);
  border-radius: 999px; padding: 0.22rem 0.65rem; font: inherit; font-size: 0.76rem; font-weight: 600; cursor: pointer;
}
#nearby-cats button.active { background: var(--c, var(--color-primary)); color: white; border-color: var(--c, var(--color-primary)); }
.nb-sortbar { display: flex; align-items: center; gap: 0.4rem; margin: 0.5rem 0 0.3rem; }
.nb-sortbar[hidden] { display: none; }
.nb-sortbar span { font-size: 0.72rem; color: var(--color-text-muted); margin-right: 0.2rem; }
#nearby-sort button { border: none; background: none; font: inherit; font-size: 0.76rem; font-weight: 600; color: var(--color-text-muted); cursor: pointer; padding: 0.1rem 0.4rem; border-radius: 6px; }
#nearby-sort button.active { background: var(--color-bg); color: var(--color-text); }
#nearby-list { margin: 0 -0.85rem; }
.nb-count { font-size: 0.72rem; color: var(--color-text-muted); padding: 0.3rem 0.9rem; }
.nb-msg { padding: 1rem 0.9rem; font-size: 0.85rem; color: var(--color-text-muted); line-height: 1.5; }
.nb-msg.err { color: var(--color-danger); }
.nb-msg button { margin-top: 0.5rem; border: 1px solid var(--color-border); background: var(--color-surface); border-radius: 999px; padding: 0.3rem 0.9rem; cursor: pointer; font: inherit; font-size: 0.8rem; }
.nb-warn { margin: 0.5rem 0.9rem; padding: 0.5rem 0.65rem; border-radius: 8px; background: var(--color-warning-bg); color: var(--color-warning); font-size: 0.76rem; line-height: 1.4; }
.nb-spinner { display: inline-block; width: 12px; height: 12px; border: 2px solid var(--color-border); border-top-color: var(--color-primary); border-radius: 50%; animation: nbspin 0.8s linear infinite; vertical-align: -2px; }
@keyframes nbspin { to { transform: rotate(360deg); } }
.nb-item { border-bottom: 1px solid var(--color-border); }
.nb-item:last-child { border-bottom: none; }
.nb-item.open { background: var(--color-bg); }
.nb-row { display: flex; gap: 0.65rem; align-items: center; width: 100%; padding: 0.55rem 0.9rem; border: none; background: none; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.nb-row:hover { background: var(--color-bg); }
.nb-ico { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 0.95rem; }
.nb-text { display: flex; flex-direction: column; min-width: 0; }
.nb-name { font-size: 0.88rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nb-star { color: #e8a33d; }
.nb-sub { font-size: 0.74rem; color: var(--color-text-muted); }
.nb-item.added .nb-name { color: var(--color-primary); }
.nb-detail { padding: 0 0.9rem 0.8rem 3.3rem; font-size: 0.82rem; display: flex; flex-direction: column; gap: 0.3rem; }
.nb-thumb { width: 100%; max-height: 130px; object-fit: cover; border-radius: 8px; }
.nb-extract { margin: 0; line-height: 1.45; }
.nb-extract.muted { color: var(--color-text-muted); }
.nb-lang { margin: 0; font-size: 0.72rem; color: var(--color-text-muted); font-style: italic; }
.nb-detail a { color: var(--color-primary); }
.nb-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.3rem; }
.nb-add, .nb-go {
  padding: 0.32rem 0.75rem; border-radius: 999px; font: inherit; font-size: 0.76rem; font-weight: 600; cursor: pointer; text-decoration: none;
  border: 1px solid var(--color-primary); background: var(--color-surface); color: var(--color-primary);
}
.nb-add { background: var(--color-primary); color: white; }
.nb-add:disabled { background: var(--color-bg); color: var(--color-text-muted); border-color: var(--color-border); cursor: default; }
.sugg-marker {
  width: 26px; height: 26px; border-radius: 50%; background: white; border: 2px dashed #888; font-size: 13px; line-height: 22px;
  text-align: center; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.35); transition: transform 0.12s ease;
}
.sugg-marker:hover, .sugg-marker.active { transform: scale(1.3); border-style: solid; z-index: 5; }
.nearby-center-marker {
  width: 18px; height: 18px; border-radius: 50%; background: rgba(15,110,106,.25); border: 3px solid #0f6e6a;
  box-shadow: 0 0 0 4px rgba(15,110,106,.15); cursor: grab;
}
/* Phones: fill the width between the same 0.75rem gutters as .route-planner (a 100% width
   plus its left offset used to push the window off the right edge). */
@media (max-width: 640px) { .nearby-panel { left: 0.75rem; right: 0.75rem; width: auto; max-width: none; } }

.rp-profiles, .day-route-profiles { display: flex; gap: 0.3rem; }
.rp-profiles { margin-bottom: 0.65rem; }
.rp-profiles button, .day-route-profiles button {
  flex: 1; padding: 0.32rem 0.3rem; border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  background: var(--color-surface); font: inherit; font-size: 0.76rem; font-weight: 600; cursor: pointer;
  color: var(--color-text-muted); white-space: nowrap;
}
.rp-profiles button.active, .day-route-profiles button.active { background: #1a73e8; border-color: #1a73e8; color: white; }

.rp-row { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.4rem; }
.rp-badge, .route-end-marker {
  flex: none; width: 22px; height: 22px; border-radius: 50%; color: white; font-weight: 700; font-size: 0.75rem;
  display: inline-flex; align-items: center; justify-content: center;
}
.rp-badge.a, .route-end-marker.a { background: #1e8e5a; }
.rp-badge.b, .route-end-marker.b { background: #d93025; }
.route-end-marker { width: 28px; height: 28px; font-size: 0.85rem; border: 2px solid white; box-shadow: 0 1px 5px rgba(0, 0, 0, 0.5); }
.rp-field { flex: 1; min-width: 0; }
.rp-select {
  width: 100%; padding: 0.4rem 0.5rem; border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  background: var(--color-surface); font: inherit; font-size: 0.8rem; color: var(--color-text);
}
.rp-locked { display: block; font-size: 0.85rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-actions { display: flex; gap: 0.4rem; margin: 0.5rem 0 0.7rem; }
.rp-actions button {
  padding: 0.28rem 0.7rem; border: 1px solid var(--color-border); border-radius: var(--radius-pill);
  background: var(--color-surface); font: inherit; font-size: 0.74rem; cursor: pointer; color: var(--color-text-muted);
}
.rp-actions button:hover { background: var(--color-surface-2); }
.rp-actions button[hidden] { display: none; }

.rp-alt { border: 1px solid var(--color-border); border-radius: 10px; padding: 0.5rem 0.7rem; margin-bottom: 0.4rem; cursor: pointer; background: var(--color-surface); }
.rp-alt:hover { background: var(--color-surface-2); }
.rp-alt.selected { border-color: #1a73e8; background: #e8f0fe; }
.rp-alt-top { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; }
.rp-dur { font-weight: 700; font-size: 1.02rem; }
.rp-dist { color: var(--color-text-muted); font-size: 0.82rem; }
.rp-tags { margin-top: 0.25rem; display: flex; gap: 0.3rem; flex-wrap: wrap; }
.rp-tag { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; padding: 0.1rem 0.45rem; border-radius: var(--radius-pill); background: var(--color-success-bg); color: var(--color-success); }
.rp-tag.short { background: var(--color-warning-bg); color: var(--color-warning); }
.rp-status { font-size: 0.82rem; color: var(--color-text-muted); padding: 0.2rem 0; }
.rp-status.error { color: var(--color-danger); }
.rp-gmaps { display: inline-block; margin-top: 0.2rem; font-size: 0.78rem; color: #1a73e8; }

/* Map overlays drawn by routing.js */
.route-bubble {
  background: white; border: 1px solid #1a73e8; color: #1a73e8; font-weight: 700; font-size: 0.72rem;
  padding: 0.15rem 0.45rem; border-radius: var(--radius-pill); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  cursor: pointer; white-space: nowrap;
}
.route-bubble.alt { border-color: #9aa0a6; color: #5f6368; }
.route-stop-badge {
  min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: #1a73e8; color: white;
  font-size: 0.68rem; font-weight: 700; display: flex; align-items: center; justify-content: center;
  border: 1.5px solid white; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45); pointer-events: none;
}

/* Vue journée: "Trajets du jour" */
.day-route-head { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.7rem; }
.day-route-profiles { flex: 0 1 260px; }
.drl { list-style: none; margin: 0; padding: 0; }
.drl-stop { display: flex; align-items: flex-start; gap: 0.55rem; font-size: 0.88rem; padding: 0.15rem 0; }
.drl-num {
  flex: none; width: 20px; height: 20px; border-radius: 50%; background: #1a73e8; color: white;
  font-size: 0.7rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
}
.drl-name { min-width: 0; }
.drl-role { color: var(--color-text-muted); font-size: 0.78rem; }
.drl-leg {
  margin: 0.05rem 0 0.05rem 9px; padding: 0.15rem 0 0.15rem 1.15rem; border-left: 2px solid #9ec0f7;
  font-size: 0.8rem; color: var(--color-text-muted);
}
.drl-leg.failed { border-left-style: dashed; color: var(--color-warning); }
.drl-total { margin-top: 0.6rem; padding-top: 0.55rem; border-top: 1px solid var(--color-border); font-size: 0.92rem; }
.drl-partial { color: var(--color-text-muted); font-size: 0.76rem; }
.drl-skipped { margin: 0.4rem 0 0; }
.drl-toggle {
  flex: none; margin-left: auto; border: none; background: none; padding: 0.1rem 0.3rem;
  font-size: 0.8rem; line-height: 1; color: var(--color-text-faint); cursor: pointer; border-radius: 6px;
}
.drl-toggle:hover { color: var(--color-text); background: var(--color-bg); }
@media (hover: hover) {
  .drl-stop .drl-toggle { opacity: 0; transition: opacity 0.15s ease; }
  .drl-stop:hover .drl-toggle, .drl-toggle:focus-visible { opacity: 1; }
  .drl-excluded .drl-toggle { opacity: 1; } /* always visible: it's the only way back */
}
.drl-excluded { opacity: 0.55; }
.drl-excluded .drl-num { background: var(--color-text-faint); }
.drl-excluded .drl-name { text-decoration: line-through; }
.drl-linkbtn { border: none; background: none; padding: 0; font: inherit; color: var(--color-primary); cursor: pointer; text-decoration: underline; }

/* On narrow screens the map controls wrap under the search bar (two rows),
   so the floating planner has to start lower to leave them reachable. */
@media (max-width: 640px) {
  .route-planner { top: 7rem; max-height: calc(100% - 15rem); }
  .alert-chip ~ .route-planner { top: 10.4rem; max-height: calc(100% - 18.5rem); }
}
.edit-participants { margin-top: 2rem; }

/* Day overlay: previous/next day arrows under the title */
.day-nav-row { display: flex; align-items: center; gap: 0.7rem; margin-top: 0.4rem; }
.day-nav {
  width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-text);
  font-size: 1.2rem; line-height: 1; transition: border-color 0.15s ease, background 0.15s ease;
}
a.day-nav:hover { border-color: var(--color-accent); background: var(--color-accent-light); text-decoration: none; }
.day-nav.disabled { opacity: 0.3; }
.day-nav-pos { font-size: 0.78rem; font-weight: 600; color: var(--color-text-muted); }

/* Settlement (Tricount-style) */
.dep-transactions li { align-items: center; padding: 0.55rem 0; border-bottom: 1px dashed var(--color-border); }
.dep-settle { margin: 0 0 0 auto; flex: none; }
.dep-settle-btn {
  border: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-success);
  font: inherit; font-size: 0.74rem; font-weight: 700; padding: 0.2rem 0.6rem; border-radius: var(--radius-pill); cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.dep-settle-btn:hover { background: var(--color-success-bg); border-color: var(--color-success); }
.dep-tx-amount { margin-left: 0; }
.dep-allsquare { color: var(--color-success); font-weight: 600; font-size: 0.9rem; margin: 0.3rem 0 0; }
.dep-balance-name small { display: block; font-size: 0.72rem; color: var(--color-text-faint); font-weight: 500; }

/* Add form: category/date as pills, notes as an underline line */
.dep-new-meta { align-items: center; }
.dep-pill {
  appearance: none; -webkit-appearance: none; font: inherit; font-size: 0.84rem; color: var(--color-text);
  background: var(--color-surface-2); border: 1px solid var(--color-border); border-radius: var(--radius-pill);
  padding: 0.4rem 0.9rem; cursor: pointer; min-width: 0; transition: border-color 0.15s ease, background 0.15s ease;
}
.dep-pill:hover, .dep-pill:focus-within { border-color: var(--color-accent); background: var(--color-accent-light); outline: none; }
.dep-date-pill { display: flex; align-items: center; gap: 0.4rem; padding: 0.15rem 0.9rem; }
.dep-date-input {
  border: none; background: none; box-shadow: none; padding: 0.25rem 0; width: 100%; min-width: 0;
  font: inherit; font-size: 0.84rem; color: var(--color-text); cursor: pointer;
}
.dep-date-input:focus { outline: none; box-shadow: none; }
.dep-notes-row { align-items: flex-start; }
.dep-notes-row .dep-new-plus { font-size: 1rem; padding-top: 0.35rem; color: var(--color-text-faint); }
.dep-notes-input {
  flex: 1 1 auto; min-width: 0; border: none; background: none; box-shadow: none; border-radius: 0;
  padding: 0.3rem 0; font: inherit; font-size: 0.9rem; resize: none; field-sizing: content; min-height: 1.8rem;
}
.dep-notes-input:focus { outline: none; box-shadow: none; }

/* ---------- Stations & bornes (stations.js) ---------- */
.stations-panel { width: 350px; }
.stations-panel[hidden] { display: none; }
.stations-panel [hidden] { display: none !important; }
.stations-panel.beside-route { left: calc(0.75rem + 310px + 0.6rem); }
.stations-panel .nb-chips { margin-bottom: 0.15rem; }
.stations-panel .nb-chips button.active { background: var(--c, var(--color-primary)); color: #fff; border-color: var(--c, var(--color-primary)); }
.stations-panel .nb-chips button:disabled { opacity: 0.4; cursor: default; }
#stations-center { font-size: 0.85rem; font-weight: 600; margin: 0.5rem 0 0.35rem; }
.st-centerbtns { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.st-centerbtns button {
  border: 1px solid var(--color-border); background: var(--color-surface); border-radius: 999px; padding: 0.2rem 0.65rem;
  cursor: pointer; font: inherit; font-size: 0.74rem; color: var(--color-text);
}
.st-centerbtns button.active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
#stations-radius-slider { width: 100%; accent-color: #e8892a; cursor: pointer; }
#stations-sort button { border: none; background: none; font: inherit; font-size: 0.76rem; font-weight: 600; color: var(--color-text-muted); cursor: pointer; padding: 0.1rem 0.4rem; border-radius: 6px; }
#stations-sort button.active { background: var(--color-surface-2); color: var(--color-text); }
.stn-marker.fuel { border: 2px solid #e8892a; }
.stn-marker.ev { border: 2px solid #1e8e5a; }
.stn-badges { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.stn-badge { font-size: 0.68rem; font-weight: 700; padding: 0.08rem 0.45rem; border-radius: 999px; background: var(--color-surface-2); color: var(--color-text-muted); border: 1px solid var(--color-border); }
.stn-badge.fast { background: var(--color-success-bg); color: var(--color-success); border-color: #bfe3cf; }
.stn-badge.fuel { background: var(--color-accent-light); color: #b8541f; border-color: #f3cdb4; }
.stn-badge.down { background: var(--color-danger-bg); color: var(--color-danger); border-color: #f2c4bb; }
.stn-line { display: flex; gap: 0.4rem; }
.stn-line b { min-width: 5.2rem; color: var(--color-text-muted); font-weight: 500; }
.stn-note { font-size: 0.72rem; color: var(--color-text-faint); padding: 0.5rem 0.9rem 0; line-height: 1.4; }
@media (max-width: 640px) { .stations-panel, .stations-panel.beside-route { left: 0.75rem; right: 0.75rem; width: auto; max-width: none; } }
#stations-list { margin: 0 -0.85rem; }

/* Tirage au sort des couchages (bed-draw.js) */
.bed-draw { margin: 0.5rem 0 0.8rem; }
.bed-draw-btn {
  border: 1px solid var(--color-border); background: var(--color-surface); border-radius: var(--radius-pill); padding: 0.3rem 0.9rem;
  font: inherit; font-size: 0.82rem; font-weight: 600; color: var(--color-accent-dark); cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.bed-draw-btn:hover { background: var(--color-accent-light); border-color: var(--color-accent); }
.bed-draw-result { margin-top: 0.6rem; display: flex; flex-direction: column; gap: 0.5rem; }
.bed-room { padding: 0.5rem 0.7rem; background: var(--color-surface-2); border: 1px solid var(--color-border); border-radius: var(--radius-md); }
.bed-room.is-empty { opacity: 0.6; }
.bed-room-title { font-family: var(--font-display); font-weight: 600; font-size: 0.95rem; }
.bed-room-title small { font-family: var(--font-body); font-weight: 500; color: var(--color-text-muted); }
.bed-lines { list-style: none; margin: 0.25rem 0 0; padding: 0; }
.bed-line { display: flex; gap: 0.6rem; font-size: 0.86rem; padding: 0.15rem 0; }
.bed-kind { flex: none; min-width: 5.3rem; color: var(--color-text-muted); }
.bed-who { font-weight: 600; }
.bed-line.is-free .bed-who { font-weight: 400; color: var(--color-text-faint); font-style: italic; }
.bed-warn { margin: 0; padding: 0.45rem 0.65rem; border-radius: 8px; background: var(--color-warning-bg); color: var(--color-warning); font-size: 0.8rem; }

/* Chambres et couchages (rooms.js) */
.rooms-field > label { display: block; margin-bottom: 0.3rem; }
.rooms-list { display: flex; flex-direction: column; gap: 0.45rem; }
.room-row {
  display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; padding: 0.45rem 0.65rem;
  background: var(--color-surface-2); border: 1px solid var(--color-border); border-radius: var(--radius-md);
}
.room-name { font-family: var(--font-display); font-weight: 600; min-width: 5.2rem; }
.room-beds { display: flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; color: var(--color-text-muted); }
.room-stepper { display: inline-flex; align-items: center; border: 1px solid var(--color-border); border-radius: var(--radius-pill); background: var(--color-surface); }
.room-stepper button {
  width: 1.7rem; height: 1.7rem; border: none; background: none; cursor: pointer; font-size: 1rem; line-height: 1; color: var(--color-text-muted);
}
.room-stepper button:hover { color: var(--color-accent-dark); }
.room-stepper output { min-width: 1.2rem; text-align: center; font-weight: 700; color: var(--color-text); font-variant-numeric: tabular-nums; }
.room-del { margin-left: auto; border: none; background: none; cursor: pointer; color: var(--color-text-faint); font-size: 0.9rem; }
.room-del:hover { color: var(--color-danger); }
.rooms-add {
  margin-top: 0.5rem; border: 1px dashed var(--color-border); background: none; border-radius: var(--radius-pill); padding: 0.3rem 0.9rem;
  font: inherit; font-size: 0.82rem; font-weight: 600; color: var(--color-accent-dark); cursor: pointer;
}
.rooms-add:hover { border-color: var(--color-accent); background: var(--color-accent-light); }
.rooms-total { margin-top: 0.4rem; font-size: 0.78rem; color: var(--color-text-muted); }
.rooms-detail { list-style: none; margin: 0 0 0.6rem; padding: 0 0 0 1.4rem; font-size: 0.86rem; color: var(--color-text-muted); }

/* Clés d'accès */
.passkey-sep { display: flex; align-items: center; gap: 0.7rem; margin: 1rem 0 0.7rem; color: var(--color-text-faint); font-size: 0.78rem; }
.passkey-sep::before, .passkey-sep::after { content: ""; flex: 1; height: 1px; background: var(--color-border); }
.passkey-btn { width: 100%; justify-content: center; }
.passkey-list { list-style: none; margin: 0.6rem 0; padding: 0; border-top: 1px solid var(--color-border); }
.passkey-item { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; padding: 0.6rem 0.1rem; border-bottom: 1px dashed var(--color-border); }
.passkey-info { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.passkey-rename { display: flex; gap: 0.5rem; align-items: center; }
.passkey-rename input { border: none; border-bottom: 1px solid transparent; background: none; font: inherit; font-weight: 600; padding: 0.1rem 0; border-radius: 0; }
.passkey-rename input:focus { outline: none; border-bottom-color: var(--color-accent); box-shadow: none; }
.passkey-add { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin-top: 0.4rem; }
.passkey-add input { flex: 1 1 12rem; }
.passkey-add input {
  padding: 0.55rem 0.8rem; background: var(--color-surface-2); border: 1px solid var(--color-border);
  border-radius: var(--radius-sm); font: inherit; font-size: 0.9rem; min-width: 0;
}
.passkey-add input:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-primary-light); }
.passkeys { padding-bottom: 2rem; }

/* Ancrage des points (filtre de la carte) */
.cf-anchor { font-weight: 600; }
.cf-anchor small { font-weight: 400; color: var(--color-text-muted); }
.map-control-cell.unlocked { background: var(--color-warning-bg); border-color: var(--color-warning); }
.points-unlocked .maplibregl-marker { cursor: grab; }

/* Mobile: grip to resize the place/day/reservation overlay */
.place-panel-grip {
  position: sticky; top: 0; z-index: 32; display: flex; justify-content: center; align-items: center;
  width: 100%; height: 26px; margin: 0 0 -26px; padding: 0; border: none; background: none; cursor: ns-resize; touch-action: none;
}
.place-panel-grip span { width: 44px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.95); box-shadow: 0 0 0 1px rgba(33, 29, 26, 0.18), 0 1px 3px rgba(0, 0, 0, 0.25); }
.place-panel.resizing { transition: none; }
@media (min-width: 900px) { .place-panel-grip { display: none; } }

/* Mobile: while the place/day/reservation overlay is open, the tabs sheet
   underneath is hidden -- otherwise it shows through when the overlay is
   resized smaller. It comes back (same state) when the overlay closes. */
@media (max-width: 899.98px) {
  .sheet { transition: transform 0.25s cubic-bezier(0.32, 0.72, 0, 1), visibility 0s; }
  .trip-hub:has(.place-panel.open) .sheet { visibility: hidden; transition: transform 0.25s cubic-bezier(0.32, 0.72, 0, 1), visibility 0s 0.22s; }
}

/* Map tool chips: "minimized" = tool still on (its trace/markers stay on the map) but its window is hidden */
.map-control-cell.minimized { background: var(--color-primary-light); border-color: var(--color-primary); position: relative; }
.map-control-cell.minimized::after {
  content: ""; position: absolute; top: 3px; right: 3px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--color-primary); box-shadow: 0 0 0 2px var(--color-surface);
}

/* Suggestion overlay (phones): a suggestion's detail as a resizable bottom sheet */
.suggestion-panel .place-panel-body { padding-top: 2.2rem; }
.suggestion-panel .nb-detail-inline { display: flex; flex-direction: column; gap: 0.5rem; font-size: 0.9rem; }
.suggestion-panel .nb-thumb { max-height: 180px; }
@media (min-width: 900px) { .suggestion-panel { display: none; } }
/* The suggestion sheet fits its content; the shared grip height only caps it. */
.suggestion-panel { height: auto; max-height: var(--place-h, 72%); min-height: 9rem; }

.drl-gmaps { display: inline-flex; margin-top: 0.6rem; }

/* Hors-ligne (pwa.js): a small pill in the header, never over the map or the sheet */
.offline-badge {
  margin-left: auto; padding: 0.2rem 0.65rem; border-radius: var(--radius-pill); white-space: nowrap;
  background: var(--color-text); color: #fff; font-size: 0.74rem; font-weight: 700;
}
.offline-badge[hidden] { display: none; }
@media (max-width: 640px) { .offline-badge { order: 2; margin-left: auto; } .offline-badge:not([hidden]) + .nav-toggle { margin-left: 0.5rem; } }

/* Voyage hors-ligne (offline.js) */
.offline-card { margin-top: 1.8rem; padding-top: 1rem; border-top: 1px solid var(--color-border); }
.offline-card h2 { font-size: 1.05rem; margin: 0 0 0.3rem; }
.offline-card .meta small { color: var(--color-text-muted); }
.offline-progress { margin: 0.6rem 0; }
.offline-bar { height: 5px; border-radius: 3px; background: var(--color-border); overflow: hidden; }
.offline-bar span { display: block; height: 100%; width: 0; background: var(--color-accent); transition: width 0.2s ease; }
.offline-progress small { display: block; margin-top: 0.3rem; font-size: 0.76rem; color: var(--color-text-muted); }

/* File d'attente hors-ligne (outbox.js) */
.outbox-badge {
  border: none; cursor: pointer; padding: 0.2rem 0.6rem; border-radius: var(--radius-pill); white-space: nowrap;
  background: var(--color-accent); color: #fff; font: inherit; font-size: 0.74rem; font-weight: 700;
}
.outbox-badge.has-failed { background: var(--color-danger); }
.outbox-badge[hidden] { display: none; }
.outbox h3 { font-size: 0.92rem; margin: 0.8rem 0 0.3rem; }
.outbox-list { list-style: none; margin: 0 0 0.6rem; padding: 0; border-top: 1px solid var(--color-border); }
.outbox-item { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; padding: 0.45rem 0.1rem; border-bottom: 1px dashed var(--color-border); font-size: 0.86rem; }
.outbox-item.failed { background: var(--color-danger-bg); }
.is-pending { opacity: 0.75; }
.te-toast {
  position: fixed; left: 50%; bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 80;
  max-width: calc(100% - 2rem); padding: 0.55rem 1rem; border-radius: var(--radius-md); background: var(--color-text); color: #fff;
  font-size: 0.84rem; font-weight: 600; box-shadow: var(--shadow-lg); text-align: center;
}
.te-toast[hidden] { display: none; }
