/* ==========================================================================
   JAPAN TRAVEL PLANNER — UX layer (loaded last)
   Mobile-first layout fixes, Planning day cards, map overlays.
   ========================================================================== */

/* ---------- Global layout ---------- */

/* The trip hero (title + countdown) only belongs to the home tab */
body[data-tab]:not([data-tab="dashboard"]) .top-header {
  display: none;
}

@media (max-width: 768px) {
  /* Section headers: compact, never sticky (they used to cover half the screen) */
  .filter-bar {
    position: static !important;
    flex-direction: row !important;
    flex-wrap: wrap;
    align-items: center !important;
    gap: 0.5rem !important;
    margin: 0 0 0.75rem 0 !important;
    padding: 0.25rem 0 !important;
    background: none !important;
    border: 0 !important;
  }
  .filter-bar h2 { font-size: 1.35rem; margin: 0; }
  .filter-bar > div:first-child { flex: 1 1 100%; }
  .filter-bar > div:first-child p { display: none; }
  .filter-bar .btn,
  .filter-bar > div:last-child .btn {
    width: auto !important;
    padding: 0.5rem 0.85rem;
    font-size: 0.85rem;
  }

  /* Toasts: bottom-centred above the tab bar */
  #toast-container {
    top: auto;
    right: 0.75rem;
    left: 0.75rem;
    bottom: calc(84px + env(safe-area-inset-bottom));
    align-items: center;
  }
  .toast { max-width: 100%; }
}

/* ---------- Helpers ---------- */
[hidden] { display: none !important; }
@media (max-width: 768px) { .hide-mobile { display: none !important; } }
@media (hover: none) { .hide-touch { display: none !important; } }

/* ==========================================================================
   PLANNING
   ========================================================================== */

.plan-toolbar > div:first-child { flex: 1 1 auto !important; }
.plan-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* Day strip (sticky quick navigation) */
.day-strip {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0.55rem 0.25rem;
  margin: 0 -0.25rem 0.75rem;
  background: rgba(14, 14, 18, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
}
.day-strip::-webkit-scrollbar { display: none; }
.strip-chip {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 58px;
  padding: 0.35rem 0.5rem 0.3rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top: 3px solid var(--city, #888);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  font: inherit;
  line-height: 1.15;
  cursor: pointer;
}
.strip-chip b { font-size: 0.8rem; }
.strip-chip span { font-size: 0.7rem; color: var(--text-muted); white-space: nowrap; }
.strip-chip small { font-size: 0.62rem; color: var(--text-dim); max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.strip-chip.is-past { opacity: 0.55; }
.strip-chip.is-active { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.25); border-top-color: var(--city); }
.strip-chip.is-today { box-shadow: 0 0 0 2px var(--primary); }

/* Day card */
#itinerary-container { display: flex; flex-direction: column; gap: 0.6rem; }
.day-card.itinerary-day-card {
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden;
  border-left: 4px solid var(--city, #888) !important;
  scroll-margin-top: 90px;
}
.day-card .day-card-head {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem !important;
  margin: 0 !important;
  border: 0 !important;
  cursor: pointer;
  user-select: none;
}
.day-card .drag-handle { color: var(--text-dim); cursor: grab; font-size: 1.1rem; }
@media (hover: none) { .day-card .drag-handle { display: none; } }

.day-date {
  flex: 0 0 auto;
  width: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.3rem 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  line-height: 1.05;
}
.dd-wd, .dd-mo { font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.dd-num { font-size: 1.35rem; font-weight: 800; font-family: 'Outfit', sans-serif; }

.day-main { flex: 1 1 auto; min-width: 0; }
.day-kicker { font-size: 0.75rem; color: var(--text-muted); display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }
.day-city { color: var(--city); font-weight: 700; }
.day-today { color: var(--primary); }
.day-weather { margin-left: auto; color: var(--text-main); }
.day-title {
  margin: 0.1rem 0 0.3rem !important;
  font-size: 1rem !important;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.day-menu-btn {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}
.day-chevron {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg);
  margin: 0 0.25rem 0.3rem 0;
  transition: transform 0.2s;
}
.day-card.is-open .day-chevron { transform: rotate(-135deg); margin-bottom: -0.2rem; }
.day-card.is-today { box-shadow: 0 0 0 1px var(--primary), 0 6px 24px rgba(242, 120, 159, 0.15); }
.day-card.is-past { opacity: 0.8; }

/* Day body */
.day-card .day-body { display: none; padding: 0 0.85rem 0.85rem; border-top: 1px solid var(--border-color); }
.day-card.is-open .day-body { display: block; }
.day-empty { color: var(--text-dim); font-size: 0.85rem; text-align: center; padding: 0.75rem 0 0.25rem; margin: 0; }
.day-add {
  display: block;
  width: 100%;
  margin-top: 0.6rem;
  padding: 0.6rem;
  border-radius: 10px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}
.day-add:hover { color: var(--text-main); border-color: rgba(255, 255, 255, 0.35); }

.mini-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 0.35rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  font-size: 0.85rem;
  text-decoration: none;
  cursor: pointer;
}

/* Lodging rows */
.lodge-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.6rem;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  background: rgba(183, 156, 224, 0.1);
  border: 1px solid rgba(183, 156, 224, 0.25);
}
.lodge-ico { font-size: 1.1rem; }
.lodge-main { flex: 1; min-width: 0; }
.lodge-title { font-weight: 700; font-size: 0.88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lodge-sub { font-size: 0.72rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lodge-links { display: flex; gap: 0.3rem; }

/* Activity rows: category = coloured edge + icon, cost on the right, one action */
.act-row {
  --cat: #64748b;
  display: grid;
  grid-template-columns: 50px 1fr auto;
  gap: 0.55rem;
  align-items: start;
  margin-top: 0.45rem;
  padding: 0.55rem 0.6rem 0.55rem 0.55rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-left: 3px solid var(--cat);
  cursor: pointer;
  transition: background 0.15s;
}
.act-row:hover, .act-row:focus-visible { background: rgba(255, 255, 255, 0.07); outline: none; }
.act-row[data-cat="temple"] { --cat: #F0A868; }
.act-row[data-cat="food"] { --cat: #E5737A; }
.act-row[data-cat="shopping"] { --cat: #E8C07D; }
.act-row[data-cat="nature"] { --cat: #8FC9A3; }
.act-row[data-cat="transport"] { --cat: #7CCDB8; }
.act-row[data-cat="culture"] { --cat: #B79CE0; }
.act-time {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  color: #B9D0EA;
  padding-top: 0.1rem;
}
.act-icon { font-size: 0.95rem; line-height: 1; }
.act-main { min-width: 0; }
.act-title { font-weight: 600; font-size: 0.92rem; line-height: 1.3; }
.act-notes {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.act-doc { display: inline-block; margin-top: 0.3rem; font-size: 0.72rem; color: #B9D0EA; text-decoration: none; }
.act-side { display: flex; flex-direction: column; align-items: flex-end; gap: 0.35rem; }
.act-cost { display: flex; flex-direction: column; align-items: flex-end; font-size: 0.82rem; font-weight: 700; color: var(--accent-gold); white-space: nowrap; line-height: 1.2; }
.act-cost small { font-weight: 500; font-size: 0.7rem; }
.act-cost.is-free { color: var(--text-dim); font-weight: 500; }
.act-cost.is-off { color: var(--text-muted); }
.act-off { color: var(--text-dim); }
.act-route { min-width: 32px; height: 32px; }

/* Collapsed day: kicker extras + activity preview */
.day-cost { margin-left: auto; color: var(--accent-gold); font-weight: 700; font-size: 0.75rem; }
.day-weather + .day-cost { margin-left: 0.4rem; }
.day-nohotel, .stay-warn {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  color: #E8C07D;
  cursor: pointer;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}
.day-nohotel::before { content: '· '; color: var(--text-dim); text-decoration: none; display: inline-block; margin-right: 0.2rem; }
.day-preview { display: flex; align-items: flex-end; gap: 0.4rem; font-size: 0.78rem; color: var(--text-muted); line-height: 1.45; }
.pv-text {
  flex: 1 1 auto;
  min-width: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pv-more { flex: 0 0 auto; padding: 0 0.4rem; border-radius: 99px; background: rgba(255, 255, 255, 0.08); }
.day-preview b { color: #B9D0EA; font-weight: 700; }
.pv-sep { color: var(--text-dim); }
.pv-more { color: var(--text-main); font-weight: 600; }
.pv-empty { color: var(--text-dim); font-style: italic; }
.day-card.is-open .day-preview { display: none; }

/* Activity form: danger action */
.btn-danger-ghost { background: transparent; border: 1px solid rgba(229, 115, 122, 0.45); color: #E5737A; margin-right: auto; }

@media (max-width: 768px) {
  .day-card .day-card-head { gap: 0.6rem; padding: 0.65rem 0.7rem !important; }
  .day-date { width: 44px; }
  .act-row { grid-template-columns: 44px 1fr auto; }
}

/* Stay headers (consecutive days in one city) */
.stay-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.6rem;
  margin: 0.9rem 0.15rem 0.1rem;
  padding-left: 0.6rem;
  border-left: 3px solid var(--city, #64748b);
  font-size: 0.8rem;
  color: var(--text-muted);
}
.stay-head:first-child { margin-top: 0.1rem; }
.stay-city { font-family: 'Outfit', sans-serif; font-size: 1.05rem; font-weight: 800; color: var(--text-main); }
.stay-head.is-transit { border-left-color: #64748b; }
.stay-head.is-transit .stay-city { font-size: 0.92rem; color: var(--text-muted); }
.stay-hotel { color: #B79CE0; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Day action menu: popover on desktop, bottom sheet on mobile */
.day-menu {
  position: fixed;
  z-index: 3000;
  min-width: 240px;
  padding: 0.4rem;
  border-radius: 14px;
  background: #1c1c22;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}
.day-menu-title { font-size: 0.75rem; color: var(--text-muted); padding: 0.4rem 0.6rem; }
.day-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.65rem 0.7rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-main);
  font: inherit;
  font-size: 0.92rem;
  cursor: pointer;
}
.day-menu-item:hover { background: rgba(255, 255, 255, 0.07); }
.day-menu-item.danger { color: #E5737A; }
.day-menu-title small { color: var(--text-dim); }
.move-sheet { width: 340px; }
.move-list { max-height: 55vh; overflow-y: auto; }
.move-sheet:not([style*="top"]) { top: 50%; left: 50%; transform: translate(-50%, -50%); }
.day-menu-item.is-current { opacity: 0.5; cursor: default; }
.day-menu-item b { color: #B9D0EA; margin-right: 0.35rem; }
@media (max-width: 768px) {
  .day-menu {
    left: 0.5rem !important;
    right: 0.5rem;
    top: auto !important;
    bottom: calc(76px + env(safe-area-inset-bottom));
    min-width: 0;
  }
  .day-menu-item { padding: 0.8rem 0.75rem; font-size: 1rem; }
  .move-sheet { width: auto; transform: none !important; }
}

/* Shared (read-only) page */
body.shared-mode .day-menu-btn,
body.shared-mode .day-add,
body.shared-mode .act-budget,
body.shared-mode .act-delete,
body.shared-mode .act-people .mini-btn { display: none !important; }
body.shared-mode .act-row { cursor: default; }

/* Print: everything expanded, no navigation chrome */
@media print {
  .day-strip, .day-menu-btn, .day-chevron, .day-add, .act-actions, .act-people .mini-btn { display: none !important; }
  .day-card .day-body { display: block !important; }
  .day-card { break-inside: avoid; }
}

/* ==========================================================================
   MAP
   ========================================================================== */

.map-toolbar { align-items: center !important; }
.map-toolbar > div:first-child { flex: 0 0 auto !important; }
.map-toolbar .map-search-container { flex: 1 1 220px; max-width: 420px; margin-left: auto; }

.map-shell {
  position: relative;
  border-radius: var(--radius-lg, 16px);
  overflow: hidden;
  border: 1px solid var(--border-color);
}
#main-map {
  height: calc(100vh - 150px);
  min-height: 420px;
  background: #1b1b1f;
}
@media (max-width: 768px) {
  .map-toolbar h2 { display: none; }
  .map-toolbar .map-search-container { max-width: none; margin: 0; }
  .map-shell { margin: 0 -0.75rem; border-radius: 0; border-left: 0; border-right: 0; }
  /* full height between the search bar and the bottom tab bar */
  #main-map { height: calc(100dvh - 150px - env(safe-area-inset-bottom)); min-height: 360px; }
}

/* Mode bar (Voyage | J1 … Jn) floating over the map */
.map-modebar {
  position: absolute;
  z-index: 800;
  top: 0.5rem;
  left: 3.4rem;
  right: 3.4rem;
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0.2rem;
}
.map-modebar::-webkit-scrollbar { display: none; }
.map-modebar .strip-chip {
  background: rgba(20, 20, 26, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
.map-modebar .strip-chip.is-active { background: rgba(242, 120, 159, 0.9); border-color: rgba(255, 255, 255, 0.3); }
.map-modebar .strip-chip.is-active span, .map-modebar .strip-chip.is-active small { color: #fff; }
.leaflet-top { margin-top: 3.6rem; }

/* Pins */
.jtp-pin, .jtp-step { background: none !important; border: 0 !important; }
.pin {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45);
  font-size: 15px;
  font-weight: 800;
  color: #fff;
}
.pin-hotel { background: #B79CE0; }
.pin-hotel.is-wish { background: #6b7280; opacity: 0.85; }
.pin-act { background: #F2789F; font-family: 'Outfit', sans-serif; font-size: 14px; }
.pin-spot { background: var(--c, #F2789F); }
.pin-search { background: #F2789F; }
.pin-me { background: #8FB8DE; box-shadow: 0 0 0 6px rgba(143, 184, 222, 0.25); }
.geo-btn { display: flex !important; align-items: center; justify-content: center; font-size: 16px; text-decoration: none; }

.step-pin { position: relative; width: 28px; height: 28px; }
.step-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--city, #F2789F);
  border: 2px solid #fff;
  color: #fff;
  font: 800 12px 'Outfit', sans-serif;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
}
.step-label {
  position: absolute;
  left: 32px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  padding: 0.15rem 0.45rem;
  border-radius: 8px;
  background: rgba(20, 20, 26, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  white-space: nowrap;
  line-height: 1.15;
  pointer-events: none;
}
.step-label b { font-size: 12px; color: #fff; }
.step-label small { font-size: 10px; color: var(--text-muted); }
.map-zoom-low .step-label { display: none; }
#dash-mini-map .step-label { display: none; }

.cluster-marker {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(242, 120, 159, 0.85); border: 2px solid #fff; color: #fff; font-weight: 800;
}

/* Popups */
.leaflet-popup-content-wrapper { background: #1c1c22 !important; color: var(--text-main) !important; border-radius: 14px !important; border: 1px solid rgba(255, 255, 255, 0.12); }
.leaflet-popup-tip { background: #1c1c22 !important; }
.leaflet-popup-content { margin: 0.8rem 0.9rem !important; }
.jtp-popup { min-width: 200px; max-width: 260px; }
.jtp-popup h3 { margin: 0.15rem 0 0.35rem; font-size: 1rem; color: #fff; }
.jtp-popup p { margin: 0.2rem 0; font-size: 0.82rem; line-height: 1.35; }
.popup-kicker { font-size: 0.72rem; color: var(--text-muted); }
.popup-muted { color: var(--text-muted); }
.popup-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.6rem; }
.popup-btn {
  flex: 1 1 auto;
  text-align: center;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  background: #8FB8DE;
  color: #fff !important;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
}
.popup-days { display: flex; flex-direction: column; gap: 0.25rem; max-height: 220px; overflow-y: auto; }
.popup-day {
  text-align: left;
  padding: 0.4rem 0.5rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}
.popup-day b { color: #B9D0EA; margin-right: 0.3rem; }

/* Day panel (list of the day's places) */
.map-day-panel {
  position: absolute;
  z-index: 800;
  left: 0.6rem;
  bottom: 0.6rem;
  width: 320px;
  max-height: 45%;
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  background: rgba(20, 20, 26, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}
.map-day-panel[hidden] { display: none; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; padding: 0.65rem 0.75rem; border-bottom: 1px solid var(--border-color); }
.panel-head b { display: block; font-size: 0.92rem; }
.panel-head small { display: block; font-size: 0.72rem; color: var(--text-muted); }
.panel-close { border: 0; background: rgba(255, 255, 255, 0.08); color: #fff; width: 28px; height: 28px; border-radius: 8px; cursor: pointer; }
.panel-rows { overflow-y: auto; padding: 0.35rem; }
.panel-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.45rem 0.5rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-main);
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.panel-row:hover:not([disabled]) { background: rgba(255, 255, 255, 0.06); }
.panel-row[disabled] { cursor: default; }
.panel-row.is-missing { opacity: 0.55; }
.panel-badge { flex: 0 0 26px; display: flex; justify-content: center; }
.panel-num { width: 22px; height: 22px; border-radius: 50%; background: #F2789F; color: #fff; font: 800 12px 'Outfit', sans-serif; display: flex; align-items: center; justify-content: center; }
.panel-text { min-width: 0; }
.panel-text b { display: block; font-size: 0.85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.panel-text small { font-size: 0.72rem; color: var(--text-muted); }
/* Trip legend variant of the bottom panel */
.map-day-panel.is-trip { width: auto; right: auto; max-width: min(calc(100% - 1.2rem), 980px); background: rgba(20, 20, 26, 0.85); }
.trip-legend { display: flex; gap: 0.35rem; overflow-x: auto; scrollbar-width: none; padding: 0.4rem; }
.trip-legend::-webkit-scrollbar { display: none; }
.legend-chip {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.55rem 0.3rem 0.3rem;
  border-radius: 99px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  font: inherit;
  cursor: pointer;
}
.legend-chip b { font-size: 0.78rem; }
.legend-chip small { font-size: 0.68rem; color: var(--text-muted); }
.legend-num { width: 20px; height: 20px; border-radius: 50%; background: var(--city); color: #fff; font: 800 11px 'Outfit', sans-serif; display: flex; align-items: center; justify-content: center; }

.panel-empty, .panel-hint { font-size: 0.78rem; color: var(--text-muted); padding: 0.5rem 0.75rem; margin: 0; }
@media (max-width: 768px) {
  #main-map .leaflet-control-attribution { font-size: 9px; max-width: 70%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .map-day-panel { left: 0.5rem; right: 0.5rem; width: auto; max-height: 38%; }
  .map-modebar { left: 3.2rem; right: 0.5rem; }
  .leaflet-top.leaflet-right { margin-top: 3.6rem; }
}

/* ==========================================================================
   FINISHING TOUCHES
   ========================================================================== */

/* Grid children must be allowed to shrink (the swipeable weather row would widen the page) */
.dash-premium-grid > * { min-width: 0; }

/* Home: today / first day preview */
.dash-day-link {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  width: 100%;
  margin-bottom: 0.75rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-main);
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.dash-day-link span { font-size: 0.82rem; color: var(--text-muted); }

@media (max-width: 768px) {
  /* Bookings: the status filters already show the same counts */
  #bookings-stats-bar { display: none !important; }

  /* Budget: the three totals side by side instead of three full-height cards */
  #view-budget > .grid-3 { grid-template-columns: repeat(3, 1fr) !important; gap: 0.4rem !important; margin-bottom: 1rem !important; }
  #view-budget > .grid-3 > .card { padding: 0.7rem 0.4rem !important; }
  #view-budget > .grid-3 > .card > span { font-size: 0.6rem !important; letter-spacing: 0.02em !important; }
  #view-budget > .grid-3 > .card > div[id$='-eur'] { font-size: 1.15rem !important; margin-top: 0.25rem !important; }
  #view-budget > .grid-3 > .card > div[id$='-jpy'] { font-size: 0.68rem !important; }
  #view-budget > .grid-3 > .card > div:first-child { display: none; }

  /* Weather: one swipeable row of small cards */
  #dash-weather-grid.premium-weather-grid { display: flex !important; gap: 0.5rem; overflow-x: auto; scrollbar-width: none; padding-bottom: 0.25rem; }
  #dash-weather-grid.premium-weather-grid::-webkit-scrollbar { display: none; }
  #dash-weather-grid .premium-weather-card { flex: 0 0 108px; padding: 0.6rem 0.4rem !important; min-height: 0 !important; }
  #dash-weather-grid .w-city { font-size: 0.78rem; }
  #dash-weather-grid .w-icon { font-size: 1.4rem; margin: 0.2rem 0; }
  #dash-weather-grid .w-temp { font-size: 1.15rem !important; }
  #dash-weather-grid .w-desc { font-size: 0.65rem; }
}

/* ==========================================================================
   FORMS ON MOBILE: full-height sheet, actions always reachable
   ========================================================================== */
@media (max-width: 768px) {
  .modal-overlay.active { align-items: flex-end !important; padding: 0 !important; }
  .modal-overlay .modal-card {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 92dvh !important;
    margin: 0 !important;
    border-radius: 18px 18px 0 0 !important;
    overflow-y: auto !important;
    padding-bottom: 0 !important;
  }
  .modal-overlay .modal-header {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--bg-surface);
  }
  .modal-overlay .modal-actions {
    position: sticky;
    bottom: 0;
    z-index: 2;
    margin: 1rem -1.25rem 0 !important;
    padding: 0.75rem 1.25rem calc(0.75rem + env(safe-area-inset-bottom)) !important;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    display: flex !important;
    gap: 0.5rem;
  }
  .modal-overlay .modal-actions .btn { flex: 1; }
  .modal-overlay .form-row { grid-template-columns: 1fr 1fr !important; gap: 0.6rem !important; }
  .modal-overlay .form-control { font-size: 16px !important; } /* no iOS zoom on focus */
}

/* ==========================================================================
   HOME
   ========================================================================== */
.dash-premium-grid.dash-one { grid-template-columns: 1fr !important; }

.todo-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  margin-top: 0.45rem;
  padding: 0.6rem 0.7rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.todo-row:hover { background: rgba(255, 255, 255, 0.08); }
.todo-row.is-warn { border-color: rgba(240, 168, 104, 0.3); }
.todo-ico { font-size: 1.15rem; }
.todo-text { flex: 1; min-width: 0; }
.todo-text b { display: block; font-size: 0.88rem; }
.todo-text small { font-size: 0.75rem; color: var(--text-muted); }
.todo-cta { font-size: 0.78rem; font-weight: 700; color: #B9D0EA; white-space: nowrap; }
.todo-more { display: block; width: 100%; margin-top: 0.5rem; padding: 0.5rem; border: 0; border-radius: 10px; background: transparent; color: #B9D0EA; font: inherit; font-size: 0.85rem; cursor: pointer; }
.todo-empty { color: var(--text-muted); font-size: 0.88rem; margin: 0.3rem 0 0; }
body.shared-mode .todo-cta { display: none; }

@media (max-width: 768px) {
  /* Three key numbers on one compact row */
  .dash-premium-stats { grid-template-columns: repeat(3, 1fr) !important; gap: 0.45rem !important; margin-bottom: 1rem !important; }
  .premium-stat-card { padding: 0.7rem 0.5rem !important; }
  .premium-stat-card .stat-content { flex-direction: column; align-items: flex-start; gap: 0.3rem; }
  .premium-stat-card .stat-icon-wrapper { width: 30px; height: 30px; }
  .premium-stat-card .stat-icon-wrapper svg { width: 16px; height: 16px; }
  .premium-stat-card .stat-value { font-size: 1.05rem !important; line-height: 1.15; }
  .premium-stat-card .stat-label { font-size: 0.6rem !important; letter-spacing: 0.02em !important; }
  .widget-header h3 { font-size: 1.05rem !important; }
}

/* ==========================================================================
   SHARED: one-line scrollable chip rows (filters)
   ========================================================================== */
.chip-scroll { display: flex; gap: 0.4rem; overflow-x: auto; scrollbar-width: none; padding: 0.15rem 0 0.6rem; margin-bottom: 0.4rem; }
.chip-scroll::-webkit-scrollbar { display: none; }
.chip-scroll .pill { flex: 0 0 auto; white-space: nowrap; }
.chip-scroll .pill small { opacity: 0.7; margin-left: 0.15rem; }
.chip-label { flex: 0 0 auto; align-self: center; font-size: 0.75rem; font-weight: 700; color: var(--text-muted); }

/* ==========================================================================
   LOGEMENTS
   ========================================================================== */
.bk-summary { display: block; width: 100%; margin-bottom: 0.7rem; padding: 0.65rem 0.8rem; border-radius: 12px; border: 1px solid rgba(143, 201, 163, 0.3); background: rgba(143, 201, 163, 0.08); color: #B5DFC3; font: inherit; font-size: 0.88rem; text-align: left; }
.bk-summary.is-warn { border-color: rgba(240, 168, 104, 0.35); background: rgba(240, 168, 104, 0.08); color: #E8C07D; cursor: pointer; }
.bk-group { margin-bottom: 0.4rem; }
.bk-row {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 0.7rem;
  align-items: center;
  margin-top: 0.45rem;
  padding: 0.55rem 0.65rem;
  border-radius: 12px;
  background: rgba(24, 24, 27, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-left: 3px solid #F0A868;
  cursor: pointer;
}
.bk-row:hover { background: rgba(39, 39, 42, 0.95); }
.bk-row.st-fav { border-left-color: #F2789F; }
.bk-row.st-booked { border-left-color: #8FC9A3; }
.bk-row.st-off { border-left-color: #6b7280; opacity: 0.6; }
.bk-thumb { width: 52px; height: 52px; border-radius: 10px; background: rgba(255, 255, 255, 0.06) center / cover no-repeat; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; }
.bk-main { min-width: 0; }
.bk-title { font-weight: 700; font-size: 0.92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-sub { font-size: 0.76rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-side { display: flex; flex-direction: column; align-items: flex-end; gap: 0.3rem; }
.bk-price { font-weight: 800; font-size: 0.92rem; }
.bk-status { border: 1px solid rgba(255, 255, 255, 0.12); background: rgba(255, 255, 255, 0.05); color: var(--text-main); border-radius: 99px; padding: 0.15rem 0.55rem; font: inherit; font-size: 0.72rem; white-space: nowrap; cursor: pointer; }
.st-booked .bk-status { color: #B5DFC3; border-color: rgba(143, 201, 163, 0.4); }
.st-fav .bk-status { color: #F7B3C8; border-color: rgba(242, 120, 159, 0.4); }
.bk-links { display: flex; gap: 0.25rem; }
.bk-empty { text-align: center; padding: 2rem 1rem; }
body.shared-mode .bk-status { pointer-events: none; }
@media (max-width: 768px) {
  .bk-row { grid-template-columns: 44px 1fr auto; gap: 0.55rem; }
  .bk-thumb { width: 44px; height: 44px; font-size: 1.3rem; }
}

/* ==========================================================================
   LIEUX
   ========================================================================== */
.spot-list { display: flex; flex-direction: column; gap: 0.5rem; }
.spot-row {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 0.75rem;
  align-items: start;
  padding: 0.6rem;
  border-radius: 14px;
  background: rgba(24, 24, 27, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.07);
  cursor: pointer;
}
.spot-row:hover { background: rgba(39, 39, 42, 0.95); }
.spot-row.is-visited { opacity: 0.7; }
.spot-thumb { width: 72px; height: 72px; border-radius: 10px; background: rgba(255, 255, 255, 0.06) center / cover no-repeat; display: flex; align-items: center; justify-content: center; font-size: 1.6rem; }
.spot-main { min-width: 0; }
.spot-title { font-weight: 700; font-size: 0.95rem; }
.spot-sub { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.1rem; }
.spot-desc-2 { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.25rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.spot-planned { font-size: 0.72rem; color: #B9D0EA; margin-top: 0.25rem; }
.spot-actions { display: flex; flex-direction: column; gap: 0.3rem; }
.is-visited .spot-visit { color: #8FC9A3; border-color: rgba(143, 201, 163, 0.4); }
body.shared-mode .spot-visit, body.shared-mode .spot-plan { display: none; }
@media (min-width: 1100px) { .spot-list { display: grid; grid-template-columns: 1fr 1fr; } }
@media (max-width: 768px) {
  .spot-row { grid-template-columns: 60px 1fr auto; gap: 0.6rem; }
  .spot-thumb { width: 60px; height: 60px; }
}

/* ==========================================================================
   TRANSPORTS
   ========================================================================== */
.tp-card { margin-bottom: 0.8rem; }
.tp-verdict { padding: 0.75rem 0.9rem; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.1); background: rgba(255, 255, 255, 0.04); font-weight: 700; margin-bottom: 0.8rem; }
.tp-verdict small { display: block; font-weight: 500; color: var(--text-muted); margin-top: 0.25rem; }
.tp-verdict.is-worth { border-color: rgba(143, 201, 163, 0.4); background: rgba(143, 201, 163, 0.08); }
.tp-h { font-size: 0.95rem; margin: 0.4rem 0 0.2rem; }
.tp-muted { color: var(--text-muted); font-size: 0.85rem; margin: 0.3rem 0; }
.tp-small { font-size: 0.75rem; }
.tp-row {
  display: flex; align-items: center; gap: 0.6rem; width: 100%;
  margin-top: 0.4rem; padding: 0.6rem 0.7rem; border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07); background: rgba(255, 255, 255, 0.04);
  color: var(--text-main); text-align: left; font: inherit; cursor: pointer;
}
.tp-row.is-todo { border-color: rgba(240, 168, 104, 0.35); }
.tp-ico { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; background: rgba(255, 255, 255, 0.08); }
.tp-row.is-planned .tp-ico { background: rgba(143, 201, 163, 0.2); color: #B5DFC3; }
.tp-main { flex: 1; min-width: 0; }
.tp-main b { display: block; font-size: 0.9rem; }
.tp-main small { font-size: 0.75rem; color: var(--text-muted); }
.tp-state { font-size: 0.75rem; font-weight: 700; white-space: nowrap; }
.tp-row.is-planned .tp-state { color: #B5DFC3; }
.tp-row.is-todo .tp-state { color: #E8C07D; }
.tp-fold summary { cursor: pointer; font-weight: 700; list-style: none; }
.tp-fold summary::-webkit-details-marker { display: none; }
.tp-fold[open] summary { margin-bottom: 0.8rem; }

/* ==========================================================================
   CHECKLIST, JOURNAL, CONVERTISSEUR
   ========================================================================== */
.phrases-card > summary { cursor: pointer; list-style: none; }
.phrases-card > summary::-webkit-details-marker { display: none; }
.phrases-card > summary::after { content: '⌄'; margin-left: auto; color: var(--text-muted); }
.phrases-card[open] > summary::after { content: '⌃'; }
.journal-day { margin-left: 0.5rem; padding: 0.1rem 0.5rem; border-radius: 99px; border: 1px solid rgba(185, 208, 234, 0.35); background: rgba(185, 208, 234, 0.1); color: #B9D0EA; font: inherit; font-size: 0.72rem; cursor: pointer; }
.converter-rate-display { display: flex !important; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 0.3rem 0.6rem; text-align: center; }
.converter-rate-display > span:first-child { color: var(--text-muted); font-size: 0.85rem; }
.converter-rate-display strong { font-size: 1.15rem; }
@media (max-width: 768px) {
  .converter-rate-display > span:first-child { flex-basis: 100%; }
}

/* Transports: indicative legs + AI advice */
.tp-state em { font-style: normal; font-size: 0.7rem; }
.tp-row .tp-state { text-align: right; line-height: 1.25; }
.tp-h small { font-weight: 500; font-size: 0.75rem; }
.tp-verdict small + small { margin-top: 0.15rem; }
.tp-ai-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.4rem; }
.tp-ai-head h3 { margin: 0; font-size: 1.05rem; }
.tp-ai-btn { white-space: nowrap; }
.tp-ai-summary { font-size: 0.92rem; line-height: 1.45; }
.tp-ai-leg { margin-top: 0.45rem; padding: 0.55rem 0.7rem; border-radius: 12px; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.07); font-size: 0.86rem; }
.tp-ai-leg small { display: block; color: var(--text-muted); font-size: 0.76rem; margin-top: 0.15rem; }
.tp-tips { margin: 0.3rem 0 0; padding-left: 1.1rem; font-size: 0.86rem; color: var(--text-muted); }
.tp-tips li { margin: 0.25rem 0; }
.tp-error { color: #E5737A; font-size: 0.88rem; }

/* Map: must-see stars, candidates of the day, popup buttons */
.pin-star { background: #F0A868; color: #fff; font-size: 13px; }
.pin-star.is-planned { background: #8FC9A3; }
.pin-candidate { background: rgba(20, 20, 26, 0.85); color: #E8C07D; border-color: rgba(232, 192, 125, 0.8); font-size: 11px; opacity: 0.85; }
.popup-btn { border: 0; cursor: pointer; font: inherit; }
.popup-btn.is-primary { background: #F2789F; }
.popup-btn.is-ghost { background: rgba(255, 255, 255, 0.1); }
.popup-hint { font-size: 0.72rem !important; margin-top: 0.5rem !important; }
.panel-gen { display: block; width: calc(100% - 1rem); margin: 0.2rem 0.5rem 0.6rem; padding: 0.55rem; border-radius: 10px; border: 1px dashed rgba(232, 192, 125, 0.5); background: rgba(240, 168, 104, 0.08); color: #E8C07D; font: inherit; font-size: 0.82rem; cursor: pointer; }

.act-paid { color: #B5DFC3; margin-left: 0.3rem; }

/* ==========================================================================
   Budget page (budget-view.js) — status colours validated on #18181B (CVD safe)
   ========================================================================== */
#view-budget { --st-booked: #5E93CC; --st-planned: #D9668F; --st-estimated: #B98A3C; --st-spent: #8A6FC4; }
.bv-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.st-booked { background: var(--st-booked); fill: var(--st-booked); }
.st-planned { background: var(--st-planned); fill: var(--st-planned); }
.st-estimated { background: repeating-linear-gradient(135deg, var(--st-estimated) 0 6px, #CDA25A 6px 9px); fill: var(--st-estimated); }
.st-spent { background: var(--st-spent); fill: var(--st-spent); }

.bv-hero { padding: 1.25rem; margin-bottom: 1rem; }
.bv-hero-top { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; flex-wrap: wrap; margin-bottom: 1rem; }
.bv-kicker { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }
.bv-hero-num { font-family: 'Outfit', sans-serif; font-size: 2.4rem; font-weight: 800; line-height: 1.1; color: #f8fafc; font-variant-numeric: tabular-nums; }
.bv-hero-goal { font-size: 1.1rem; font-weight: 600; color: var(--text-muted); }
.bv-hero-sub { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.25rem; }
.bv-margin { text-align: right; padding: 0.55rem 0.8rem; border-radius: 12px; background: rgba(143, 201, 163, 0.1); border: 1px solid rgba(143, 201, 163, 0.3); }
.bv-margin span { display: block; font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.bv-margin strong { font-size: 1.3rem; color: #B5DFC3; font-variant-numeric: tabular-nums; }
.bv-margin.is-over { background: rgba(229, 115, 122, 0.1); border-color: rgba(229, 115, 122, 0.35); }
.bv-margin.is-over strong { color: #F2A9AC; }

.bv-stack { position: relative; display: flex; gap: 2px; height: 12px; border-radius: 4px; background: rgba(255, 255, 255, 0.06); }
.bv-stack.is-tall { height: 22px; }
.bv-seg { height: 100%; min-width: 2px; }
.bv-seg:first-child { border-radius: 4px 0 0 4px; }
.bv-seg:last-of-type { border-radius: 0 4px 4px 0; }
.bv-seg:only-of-type { border-radius: 4px; }
.bv-goal { position: absolute; top: -5px; bottom: -5px; width: 2px; margin-left: -1px; background: #f8fafc; border-radius: 1px; }
.bv-scale { display: flex; justify-content: space-between; font-size: 0.7rem; color: var(--text-muted); margin-top: 0.35rem; }
.bv-legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1.75rem; margin-top: 0.9rem; }
.bv-legend-item { display: flex; align-items: center; gap: 0.45rem; font-size: 0.82rem; color: var(--text-muted); }
.bv-legend-item strong { margin-left: 0.35rem; color: #f1f5f9; font-variant-numeric: tabular-nums; }
.bv-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.bv-trip-line { margin-top: 0.9rem; padding-top: 0.8rem; border-top: 1px solid rgba(255, 255, 255, 0.08); font-size: 0.88rem; color: var(--text-muted); }
.bv-trip-line strong { color: #f8fafc; }

.bv-alerts { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1rem; }
.bv-alert { display: flex; align-items: center; gap: 0.5rem; width: 100%; text-align: left; padding: 0.6rem 0.8rem; border-radius: 10px; font: inherit; font-size: 0.85rem; color: #e2e8f0; cursor: pointer; border: 1px solid rgba(255, 255, 255, 0.08); background: rgba(255, 255, 255, 0.03); }
.bv-alert.is-warning { border-color: rgba(240, 168, 104, 0.35); background: rgba(240, 168, 104, 0.08); }
.bv-alert.is-ok { cursor: default; border-color: rgba(143, 201, 163, 0.3); background: rgba(143, 201, 163, 0.07); }
.bv-alert-go { margin-left: auto; color: var(--text-muted); font-size: 1.1rem; }

.bv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.bv-card { padding: 1.1rem; margin-bottom: 1rem; }
.bv-grid .bv-card { margin-bottom: 0; }
.bv-h3 { font-size: 1.05rem; margin: 0 0 0.8rem; }
.bv-note { font-size: 0.74rem; color: var(--text-muted); margin: 0.7rem 0 0; line-height: 1.4; }

.bv-cats { display: flex; flex-direction: column; gap: 0.2rem; }
.bv-cat { display: grid; grid-template-columns: 1fr auto; gap: 0.3rem 0.75rem; width: 100%; padding: 0.45rem 0.3rem; background: none; border: 0; border-radius: 8px; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.bv-cat:hover { background: rgba(255, 255, 255, 0.04); }
.bv-cat-name { font-size: 0.88rem; }
.bv-cat-val { font-size: 0.88rem; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.bv-cat-val small { font-weight: 400; color: var(--text-muted); margin-left: 0.4rem; }
.bv-cat-bar { grid-column: 1 / -1; }
.bv-cat-detail { grid-column: 1 / -1; display: none; flex-wrap: wrap; gap: 0.3rem 0.9rem; font-size: 0.76rem; color: var(--text-muted); }
.bv-cat-detail span { display: inline-flex; align-items: center; gap: 0.35rem; }
.bv-cat-detail i { width: 8px; height: 8px; }
.bv-cat.is-open .bv-cat-detail { display: flex; }

.bv-cities { display: flex; flex-direction: column; }
.bv-city { display: grid; grid-template-columns: 1.4fr 0.6fr 1.1fr 1fr; gap: 0.2rem 0.5rem; align-items: baseline; padding: 0.4rem 0; font-size: 0.85rem; font-variant-numeric: tabular-nums; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.bv-city > span:not(:first-child):not(.bv-city-bar) { text-align: right; }
.bv-city-head { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.bv-city-name small { color: var(--text-muted); margin-left: 0.35rem; }
.bv-city em { color: #E8C07D; font-style: normal; font-size: 0.78rem; }
.bv-city-total { font-weight: 700; }
.bv-city-bar { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.05); }
.bv-city-bar span { display: block; height: 100%; border-radius: 2px; background: var(--st-booked); opacity: 0.75; }

.bv-chart-wrap { position: relative; }
.bv-svg { width: 100%; height: auto; display: block; touch-action: pan-y; }
line.bv-grid { stroke: rgba(255, 255, 255, 0.07); stroke-width: 1; }
.bv-axis { fill: #94a3b8; font-size: 10px; font-family: inherit; }
.bv-hit { fill: transparent; }
.bv-col.is-hover .bv-hit { fill: rgba(255, 255, 255, 0.06); }
.bv-today { stroke: #f8fafc; stroke-width: 1.5; stroke-dasharray: 3 3; }
.bv-svg rect.st-estimated { fill: var(--st-estimated); opacity: 0.85; }
.bv-tip { position: absolute; top: 0; z-index: 3; min-width: 170px; padding: 0.55rem 0.7rem; border-radius: 10px; background: #0f0f14; border: 1px solid rgba(255, 255, 255, 0.12); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); font-size: 0.78rem; color: #cbd5e1; pointer-events: none; }
.bv-tip strong { display: block; color: #f8fafc; }
.bv-tip > span { display: block; color: var(--text-muted); margin-bottom: 0.3rem; }
.bv-tip div { display: flex; align-items: center; gap: 0.4rem; }
.bv-tip b { margin-left: auto; color: #f8fafc; font-variant-numeric: tabular-nums; }
.bv-tip i { width: 8px; height: 8px; display: inline-block; border-radius: 2px; }
.bv-tip-total { border-top: 1px solid rgba(255, 255, 255, 0.1); margin-top: 0.3rem; padding-top: 0.3rem; }

.bv-detail-head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.4rem; }
.bv-detail-head .bv-h3 { margin: 0; }
.bv-small { padding: 0.4rem 0.7rem; font-size: 0.8rem; }
.bv-group { border-top: 1px solid rgba(255, 255, 255, 0.06); }
.bv-group summary { display: flex; justify-content: space-between; align-items: center; padding: 0.7rem 0.2rem; cursor: pointer; list-style: none; font-size: 0.92rem; }
.bv-group summary::-webkit-details-marker { display: none; }
.bv-group summary::after { content: '›'; margin-left: 0.6rem; color: var(--text-muted); transition: transform 0.2s; }
.bv-group[open] summary::after { transform: rotate(90deg); }
.bv-group summary > span { flex: 1; }
.bv-group summary small { color: var(--text-muted); margin-left: 0.3rem; }
.bv-group summary strong { font-variant-numeric: tabular-nums; }
.bv-line { display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 0.3rem; border-radius: 8px; cursor: pointer; }
.bv-line:hover { background: rgba(255, 255, 255, 0.04); }
.bv-line-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bv-line-main strong { font-size: 0.86rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bv-line-main small { font-size: 0.74rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bv-line-val { font-size: 0.86rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bv-pill { flex-shrink: 0; width: 62px; text-align: center; font-size: 0.66rem; font-weight: 700; padding: 0.15rem 0; border-radius: 999px; color: #fff; text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35); }
.bv-del { flex-shrink: 0; }

.bv-h3-sub { font-size: 0.72rem; font-weight: 500; color: var(--text-muted); margin-left: 0.4rem; }
@media (max-width: 860px) {
  .bv-grid { grid-template-columns: 1fr; }
  .bv-legend { display: grid; grid-template-columns: 1fr; }
  .bv-legend-item strong { margin-left: auto; }
  .bv-hero-num { font-size: 2rem; }
  .bv-margin { text-align: left; }
}

/* ==========================================================================
   Date fields — native inputs never overflow their column (iOS min-width)
   ========================================================================== */
.form-row > * { min-width: 0; }
input[type="date"].form-control { min-width: 0; max-width: 100%; width: 100%; -webkit-appearance: none; appearance: none; display: block; }
input[type="date"].form-control::-webkit-date-and-time-value { text-align: left; }

/* Range picker (date-range.js) */
.dr-hidden-row { display: none !important; }
.dr { margin-bottom: 1rem; }
.dr-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.dr-tiles.is-single { grid-template-columns: 1fr; }
.dr-tile { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 0.15rem; padding: 0.6rem 0.75rem; border-radius: 12px; border: 1px solid var(--border-color, rgba(255,255,255,0.12)); background: var(--bg-dark, #121212); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.dr-tile.is-active { border-color: #F2789F; box-shadow: 0 0 0 2px rgba(242, 120, 159, 0.25); }
.dr-tile-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.dr-tile-value { font-size: 0.95rem; font-weight: 600; color: #f8fafc; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.dr-tile.is-empty .dr-tile-value { color: var(--text-muted); font-weight: 500; }
.dr-summary { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.35rem; min-height: 1em; }
.dr-error { font-size: 0.82rem; color: #F2A9AC; margin-top: 0.35rem; }
.dr-cal { margin-top: 0.5rem; padding: 0.6rem; border-radius: 14px; background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.08); user-select: none; }
.dr-head { display: flex; align-items: center; justify-content: space-between; padding: 0 0.1rem 0.3rem; }
.dr-head strong { text-transform: capitalize; font-size: 0.95rem; }
.dr-nav { width: 40px; height: 36px; border-radius: 10px; border: 0; background: rgba(255, 255, 255, 0.06); color: #f8fafc; font-size: 1.3rem; cursor: pointer; }
.dr-hint { display: flex; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; font-size: 0.78rem; color: #F7B3C8; padding: 0 0.2rem 0.4rem; }
.dr-legend { color: var(--text-muted); display: inline-flex; align-items: center; gap: 0.3rem; }
.dr-dot { width: 6px; height: 6px; border-radius: 50%; background: #94a3b8; display: inline-block; }
.dr-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px 0; }
.dr-wd { text-align: center; font-size: 0.7rem; color: var(--text-muted); padding: 0.2rem 0; text-transform: uppercase; }
.dr-cell { position: relative; height: 40px; border: 0; background: none; color: #e2e8f0; font: inherit; font-size: 0.9rem; cursor: pointer; border-radius: 10px; font-variant-numeric: tabular-nums; }
.dr-cell.is-empty { cursor: default; }
.dr-cell.is-trip { color: #fff; font-weight: 600; }
.dr-cell:not(.is-trip):not(.is-empty) { color: #94a3b8; }
.dr-cell.is-trip::before { content: ''; position: absolute; left: 0; right: 0; bottom: 3px; height: 2px; background: rgba(242, 120, 159, 0.35); }
.dr-cell.is-busy::after { content: ''; position: absolute; top: 5px; right: 6px; width: 5px; height: 5px; border-radius: 50%; background: #94a3b8; }
.dr-cell.is-in { background: rgba(242, 120, 159, 0.16); border-radius: 0; }
.dr-cell.is-start, .dr-cell.is-end { background: #F2789F; color: #fff; font-weight: 700; }
.dr-cell.is-start { border-radius: 10px 0 0 10px; }
.dr-cell.is-end { border-radius: 0 10px 10px 0; }
.dr-cell.is-solo, .dr-cell.is-start.is-end { border-radius: 10px; }
.dr-cell.is-before { opacity: 0.45; }
.dr-cell:hover:not(.is-empty):not(.is-start):not(.is-end) { background: rgba(255, 255, 255, 0.08); }
.dr-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 0.4rem; }
.dr-link { border: 0; background: none; color: var(--text-muted); font: inherit; font-size: 0.85rem; padding: 0.45rem 0.7rem; border-radius: 8px; cursor: pointer; }
.dr-link.is-strong { color: #fff; background: rgba(242, 120, 159, 0.85); font-weight: 600; }

/* ==========================================================================
   Lodging photos (photos.js)
   ========================================================================== */
.bk-photo-field { margin-bottom: 1rem; }
.bk-photo-preview { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 16 / 7; border-radius: 14px; border: 1px dashed rgba(255, 255, 255, 0.18); background: rgba(255, 255, 255, 0.03) center / cover no-repeat; color: var(--text-muted); font: inherit; cursor: pointer; overflow: hidden; }
.bk-photo-preview.has-photo { border-style: solid; border-color: rgba(255, 255, 255, 0.1); }
.bk-photo-preview.has-photo .bk-photo-empty { display: none; }
.bk-photo-preview.has-photo::after { content: '📷 Changer'; position: absolute; right: 0.6rem; bottom: 0.6rem; padding: 0.25rem 0.6rem; border-radius: 999px; background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 0.75rem; }
.bk-photo-empty { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; font-size: 1.8rem; }
.bk-photo-empty small { font-size: 0.8rem; }
.bk-photo-preview.is-loading, .bk-thumb.is-loading { opacity: 0.5; pointer-events: none; }
.bk-photo-preview.is-loading::before { content: 'Envoi…'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.45); color: #fff; font-size: 0.9rem; z-index: 1; }
.bk-photo-tools { display: flex; gap: 0.5rem; align-items: center; margin-top: 0.5rem; }
.bk-photo-btn { flex-shrink: 0; padding: 0.55rem 0.8rem; }
.bk-photo-tools .form-control { flex: 1; min-width: 0; }
.bk-photo-clear { flex-shrink: 0; width: 40px; height: 40px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.12); background: none; color: var(--text-muted); cursor: pointer; }

.bk-thumb.has-photo { background-size: cover; background-position: center; }
button.bk-thumb.is-add { position: relative; border: 1px dashed rgba(255, 255, 255, 0.2); font: inherit; color: inherit; cursor: pointer; padding: 0; }
button.bk-thumb.is-add span { position: absolute; right: -4px; bottom: -4px; font-size: 0.75rem; background: #F2789F; border-radius: 999px; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px var(--bg-card, #18181b); }

.popup-photo { height: 120px; margin: -0.1rem -0.1rem 0.6rem; border-radius: 10px; background: #222 center / cover no-repeat; }
.lodge-photo { flex-shrink: 0; width: 40px; height: 40px; border-radius: 10px; background: #222 center / cover no-repeat; }
.stay-photo { display: inline-block; width: 22px; height: 22px; border-radius: 6px; margin-right: 0.4rem; vertical-align: -6px; background: #222 center / cover no-repeat; }

/* ==========================================================================
   Home — "À réserver quand" (deadlines.js)
   ========================================================================== */
.dl-row { display: flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.dl-row:last-of-type { border-bottom: 0; }
.dl-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 0.6rem; padding: 0.35rem 0.2rem; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; border-radius: 8px; }
.dl-main:hover { background: rgba(255, 255, 255, 0.04); }
.dl-ico { font-size: 1.15rem; flex-shrink: 0; width: 1.6rem; text-align: center; }
.dl-text { min-width: 0; display: flex; flex-direction: column; }
.dl-text b { font-size: 0.86rem; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dl-text small { font-size: 0.74rem; color: var(--text-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dl-side { display: flex; flex-direction: column; align-items: flex-end; gap: 0.3rem; flex-shrink: 0; }
.dl-chip { font-size: 0.7rem; font-weight: 600; padding: 0.15rem 0.5rem; border-radius: 999px; background: rgba(255, 255, 255, 0.07); color: #cbd5e1; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dl-chip.is-soon { background: rgba(240, 168, 104, 0.15); color: #E8C07D; }
.dl-chip.is-open { background: rgba(143, 201, 163, 0.16); color: #B5DFC3; }
.dl-chip.is-asap { background: rgba(143, 184, 222, 0.16); color: #B9D0EA; }
.dl-chip.is-late { background: rgba(229, 115, 122, 0.16); color: #F2A9AC; }
.dl-done { width: 30px; height: 26px; border-radius: 8px; border: 1px solid rgba(143, 201, 163, 0.4); background: rgba(143, 201, 163, 0.1); color: #B5DFC3; cursor: pointer; font-size: 0.85rem; }
@media (min-width: 1000px) { .dash-premium-grid.dash-one { grid-template-columns: 1fr 1fr !important; align-items: start; } }

/* ==========================================================================
   Home — "Aujourd'hui" (today.js)
   ========================================================================== */
#dash-today { margin-bottom: 1.25rem; }
.td-card { padding: 1.1rem 1.15rem; border: 1px solid rgba(242, 120, 159, 0.35) !important; }
.td-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.75rem; margin-bottom: 0.8rem; }
.td-kicker { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: #F7B3C8; font-weight: 700; }
.td-title { font-size: 1.35rem; margin: 0.1rem 0 0.15rem; }
.td-sub { font-size: 0.85rem; color: var(--text-muted); }
.td-preview-nav { display: flex; gap: 0.35rem; flex-shrink: 0; }
.td-nav { width: 38px; height: 38px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.12); background: rgba(255, 255, 255, 0.05); color: #f8fafc; font-size: 1.1rem; cursor: pointer; }
.td-nav:disabled { opacity: 0.35; cursor: default; }
.td-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); margin-bottom: 0.2rem; }
.td-next { padding: 0.85rem; border-radius: 14px; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.08); }
.td-next.is-empty { color: var(--text-muted); font-size: 0.9rem; }
.td-next-main { display: flex; gap: 0.7rem; align-items: baseline; }
.td-time { font-weight: 800; font-size: 1.15rem; color: #F2789F; font-variant-numeric: tabular-nums; }
.td-next-text { min-width: 0; display: flex; flex-direction: column; }
.td-next-text b { font-size: 1rem; }
.td-next-text small { color: var(--text-muted); font-size: 0.8rem; }
.td-actions { display: flex; gap: 0.5rem; margin-top: 0.7rem; flex-wrap: wrap; }
.td-btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.3rem; min-height: 40px; padding: 0 0.9rem; border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.12); background: rgba(255, 255, 255, 0.06); color: #f8fafc; font: inherit; font-size: 0.88rem; font-weight: 600; text-decoration: none; cursor: pointer; }
.td-btn.is-primary { background: #8FB8DE; border-color: #8FB8DE; }
.td-btn.is-taxi { background: #E8C07D; border-color: #E8C07D; color: #111; }
.td-prog { margin-top: 0.7rem; display: flex; flex-direction: column; }
.td-prog-row { display: flex; gap: 0.7rem; padding: 0.45rem 0.3rem; border: 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.td-prog-row.is-past { opacity: 0.45; }
.td-prog-row.is-next .td-prog-title { color: #fff; font-weight: 700; }
.td-prog-time { width: 3rem; flex-shrink: 0; color: var(--text-muted); font-variant-numeric: tabular-nums; font-size: 0.85rem; }
.td-prog-title { font-size: 0.88rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-hotel { display: flex; align-items: center; gap: 0.7rem; margin-top: 0.8rem; padding: 0.7rem; border-radius: 14px; background: rgba(183, 156, 224, 0.08); border: 1px solid rgba(183, 156, 224, 0.25); }
.td-hotel-photo { width: 52px; height: 52px; flex-shrink: 0; border-radius: 10px; background: rgba(255, 255, 255, 0.06) center / cover no-repeat; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; }
.td-hotel-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.td-hotel-text b { font-size: 0.92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.td-hotel-text small { font-size: 0.74rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.td-hotel-actions { display: flex; gap: 0.35rem; flex-shrink: 0; }
.td-link { margin-top: 0.8rem; border: 0; background: none; color: #B9D0EA; font: inherit; font-size: 0.85rem; cursor: pointer; padding: 0.3rem 0; }

/* Taxi card: black on white, very large, for the driver */
.taxi-overlay { position: fixed; inset: 0; z-index: 3000; display: none; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.75); padding: 1rem; }
.taxi-overlay.active { display: flex; }
.taxi-sheet { width: 100%; max-width: 560px; max-height: 100%; overflow: auto; background: #fff; color: #111; border-radius: 20px; padding: 1.5rem 1.4rem; text-align: center; }
.taxi-phrase { font-size: 1.35rem; font-weight: 700; color: #b91c1c; }
.taxi-phrase-fr { font-size: 0.8rem; color: #666; margin: 0.2rem 0 1.2rem; }
.taxi-name { font-size: 1.6rem; font-weight: 800; line-height: 1.3; }
.taxi-address { font-size: 2rem; font-weight: 800; line-height: 1.35; margin: 0.9rem 0 0.4rem; word-break: break-word; font-family: 'Hiragino Sans', 'Noto Sans JP', 'Yu Gothic', sans-serif; }
.taxi-latin { font-size: 0.85rem; color: #555; margin-top: 0.2rem; }
.taxi-actions { display: flex; gap: 0.6rem; justify-content: center; margin-top: 1.4rem; }
.taxi-edit, .taxi-close { min-height: 44px; padding: 0 1.2rem; border-radius: 12px; border: 1px solid #ddd; background: #f4f4f5; color: #111; font: inherit; font-weight: 600; cursor: pointer; }
.taxi-close { background: #111; color: #fff; border-color: #111; }
.taxi-loading { font-size: 1rem; color: #333; }
.taxi-form { text-align: left; }
.taxi-form label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.8rem; }
.taxi-form .form-control { background: #fff !important; color: #111 !important; border: 1px solid #ccc !important; }
.taxi-hint { font-size: 0.78rem; color: #666; }
.taxi-form-title { font-size: 1.05rem; margin: 0 0 0.6rem; }
.taxi-steps { margin: 0 0 1rem 1.1rem; padding: 0; font-size: 0.88rem; line-height: 1.5; }
.taxi-maps { color: #1d4ed8; font-weight: 700; }
.taxi-latin.is-big { font-size: 1.15rem; color: #111; font-weight: 600; margin: 0.8rem 0; }
.taxi-cancel { display: block; margin: 0.8rem auto 0; border: 0; background: none; color: #666; font: inherit; cursor: pointer; }
.td-hotel-text b { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* ==========================================================================
   Express expense (expense-quick.js)
   ========================================================================== */
.fab-expense { display: none; position: fixed; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); z-index: 900; width: 58px; height: 58px; border-radius: 50%; border: 0; background: #F2789F; color: #fff; font-size: 1.6rem; font-weight: 300; box-shadow: 0 8px 24px rgba(242, 120, 159, 0.45); cursor: pointer; align-items: center; justify-content: center; }
.fab-expense span { position: absolute; right: -2px; bottom: -2px; font-size: 0.9rem; background: #18181b; border-radius: 50%; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; }
body[data-tab="dashboard"] .fab-expense, body[data-tab="budget"] .fab-expense, body.in-trip .fab-expense { display: flex; }
body[data-tab="map"] .fab-expense { display: none !important; }
@media (min-width: 900px) { .fab-expense { bottom: 28px; right: 28px; } }

.qe-overlay { position: fixed; inset: 0; z-index: 2500; display: none; align-items: flex-end; justify-content: center; background: rgba(0, 0, 0, 0.6); }
.qe-overlay.active { display: flex; }
@media (min-width: 700px) { .qe-overlay { align-items: center; } }
.qe-sheet { width: 100%; max-width: 520px; max-height: 92vh; overflow: auto; background: var(--bg-surface, #1e1e1e); border-radius: 20px 20px 0 0; padding: 1rem 1.1rem calc(1rem + env(safe-area-inset-bottom, 0px)); border: 1px solid rgba(255, 255, 255, 0.08); }
@media (min-width: 700px) { .qe-sheet { border-radius: 20px; } }
.qe-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.6rem; }
.qe-head h3 { margin: 0; font-size: 1.1rem; }
.qe-x { width: 38px; height: 38px; border-radius: 10px; border: 0; background: rgba(255, 255, 255, 0.06); color: #f8fafc; cursor: pointer; }
.qe-amount { display: flex; gap: 0.5rem; align-items: stretch; }
.qe-amount input { flex: 1; min-width: 0; font-size: 2.2rem; font-weight: 800; text-align: right; padding: 0.4rem 0.8rem; border-radius: 14px; border: 1px solid rgba(255, 255, 255, 0.14); background: var(--bg-dark, #121212); color: #f8fafc; font-variant-numeric: tabular-nums; font-family: inherit; }
.qe-amount input.is-error { border-color: #E5737A; }
.qe-cur { width: 64px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, 0.14); background: rgba(255, 255, 255, 0.06); color: #f8fafc; font-size: 1.6rem; font-weight: 700; cursor: pointer; }
.qe-conv { text-align: right; font-size: 0.82rem; color: var(--text-muted); min-height: 1.2em; margin: 0.25rem 0.2rem 0.4rem; }
.qe-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); margin: 0.5rem 0 0.35rem; }
.qe-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.qe-chip { min-height: 40px; padding: 0 0.85rem; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.12); background: rgba(255, 255, 255, 0.04); color: #e2e8f0; font: inherit; font-size: 0.88rem; cursor: pointer; }
.qe-chip.is-on { background: rgba(242, 120, 159, 0.18); border-color: #F2789F; color: #fff; font-weight: 600; }
.qe-row { display: grid; grid-template-columns: 1fr auto; gap: 0.5rem; margin-top: 0.8rem; }
.qe-row input[type="date"] { width: auto; }
.qe-save { width: 100%; min-height: 50px; margin-top: 0.9rem; border-radius: 14px; border: 0; background: #F2789F; color: #fff; font: inherit; font-size: 1.05rem; font-weight: 700; cursor: pointer; }
.qe-save:disabled { opacity: 0.6; }

/* Budget: who owes whom */
.bv-bal-row { display: flex; justify-content: space-between; padding: 0.35rem 0; font-size: 0.9rem; border-bottom: 1px solid rgba(255, 255, 255, 0.05); font-variant-numeric: tabular-nums; }
.bv-bal-verdict { margin-top: 0.7rem; padding: 0.65rem 0.8rem; border-radius: 12px; background: rgba(240, 168, 104, 0.1); border: 1px solid rgba(240, 168, 104, 0.3); font-size: 0.92rem; }
.bv-bal-verdict.is-even { background: rgba(143, 201, 163, 0.08); border-color: rgba(143, 201, 163, 0.3); }

/* ==========================================================================
   Urgences (emergency.js)
   ========================================================================== */
.em-card { padding: 1.1rem; margin-bottom: 1rem; }
.em-h3 { font-size: 1.05rem; margin: 0 0 0.7rem; }
.em-h3 small { font-size: 0.72rem; font-weight: 400; color: var(--text-muted); margin-left: 0.4rem; }
.em-head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.em-head .em-h3 { margin: 0; }
.em-small { padding: 0.4rem 0.75rem; font-size: 0.82rem; }
.em-num { display: flex; align-items: center; gap: 0.8rem; padding: 0.7rem 0.4rem; border-bottom: 1px solid rgba(255, 255, 255, 0.06); color: inherit; text-decoration: none; }
.em-num:last-of-type { border-bottom: 0; }
.em-num-tel { font-weight: 800; font-size: 1.15rem; color: #F2A9AC; font-variant-numeric: tabular-nums; }
.em-num-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.em-num-text b { font-size: 0.92rem; }
.em-num-text small { font-size: 0.76rem; color: var(--text-muted); }
.em-call { flex-shrink: 0; padding: 0.35rem 0.7rem; border-radius: 999px; background: rgba(143, 201, 163, 0.15); color: #B5DFC3; font-size: 0.78rem; font-weight: 700; }
.em-note { font-size: 0.78rem; color: var(--text-muted); margin: 0.6rem 0 0; line-height: 1.45; }
.em-note a { color: #B9D0EA; }
.em-info { display: flex; flex-direction: column; padding: 0.45rem 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); font-size: 0.9rem; }
.em-info small { font-size: 0.72rem; color: var(--text-muted); }
.em-info a { color: #B9D0EA; font-weight: 700; }
.em-field { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.82rem; color: var(--text-muted); margin-bottom: 0.7rem; }
.em-actions { display: flex; gap: 0.5rem; justify-content: flex-end; }
.em-doc { display: flex; align-items: center; justify-content: space-between; padding: 0.45rem 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.em-doc a { color: #e2e8f0; text-decoration: none; font-size: 0.9rem; }
.em-phrase { display: flex; flex-direction: column; align-items: flex-start; gap: 0.1rem; width: 100%; padding: 0.6rem 0.4rem; border: 0; border-bottom: 1px solid rgba(255, 255, 255, 0.06); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.em-ja { font-size: 1.05rem; font-weight: 700; font-family: 'Hiragino Sans', 'Noto Sans JP', 'Yu Gothic', sans-serif; }
.em-ro { font-size: 0.8rem; color: #F7B3C8; font-style: italic; }
.em-fr { font-size: 0.8rem; color: var(--text-muted); }
.td-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 0.4rem; }
.td-sos { border: 1px solid rgba(229, 115, 122, 0.4); background: rgba(229, 115, 122, 0.1); color: #F2A9AC; border-radius: 999px; padding: 0.3rem 0.75rem; font: inherit; font-size: 0.8rem; font-weight: 600; cursor: pointer; }

/* Seasons + closures (seasons.js, AI closures) */
.season-row { display: flex; gap: 0.6rem; align-items: flex-start; padding: 0.55rem 0.7rem; margin: 0.2rem 0 0.4rem; border-radius: 12px; background: rgba(240, 168, 104, 0.07); border: 1px solid rgba(240, 168, 104, 0.22); }
.season-row > span { font-size: 1.1rem; }
.season-row div { display: flex; flex-direction: column; min-width: 0; }
.season-row b { font-size: 0.86rem; }
.season-row small { font-size: 0.74rem; color: var(--text-muted); }
.act-closed { margin-top: 0.2rem; font-size: 0.76rem; font-weight: 600; color: #F2A9AC; }
.act-hours { margin-top: 0.2rem; font-size: 0.74rem; color: var(--text-muted); }
.td-closed { color: #F2A9AC; font-size: 0.78rem; }

/* ==========================================================================
   Journal photos + Carnet souvenir (souvenir.js)
   ========================================================================== */
.jp-strip { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.jp-strip.is-loading { opacity: 0.6; pointer-events: none; }
.jp-thumb { position: relative; width: 72px; height: 72px; border-radius: 10px; background: #222 center / cover no-repeat; }
.jp-thumb button { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: #111; color: #fff; font-size: 0.7rem; cursor: pointer; }
.jp-add { width: 72px; height: 72px; border-radius: 10px; border: 1px dashed rgba(255, 255, 255, 0.25); background: rgba(255, 255, 255, 0.03); color: inherit; font-size: 1.3rem; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; }
.jp-add small { font-size: 0.68rem; color: var(--text-muted); }
.jp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 0.4rem; margin-top: 0.7rem; }
.jp-photo { display: block; aspect-ratio: 1; border-radius: 10px; background: #222 center / cover no-repeat; }

.sv-book { max-width: 820px; margin: 0 auto; }
.sv-cover { text-align: center; padding: 1.5rem 1rem 2rem; margin-bottom: 1rem; border-radius: 18px; background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.08); }
.sv-cover-photo { height: 260px; border-radius: 14px; margin-bottom: 1.2rem; background: #222 center / cover no-repeat; }
.sv-cover h1 { font-family: 'Playfair Display', Georgia, serif; font-size: 2rem; margin: 0 0 0.4rem; }
.sv-cover p { margin: 0.2rem 0; color: var(--text-muted); }
.sv-cities { font-weight: 600; color: #F7B3C8 !important; }
.sv-names { font-style: italic; }
.sv-day { padding: 1rem 0.2rem 1.2rem; border-bottom: 1px solid rgba(255, 255, 255, 0.08); break-inside: avoid; }
.sv-day-head { display: flex; gap: 0.8rem; align-items: center; margin-bottom: 0.6rem; }
.sv-num { font-weight: 800; font-size: 1.1rem; color: #F2789F; min-width: 2.6rem; }
.sv-day-head h3 { margin: 0; font-size: 1.15rem; }
.sv-day-head small { color: var(--text-muted); }
.sv-entry h4 { margin: 0.3rem 0; font-size: 1rem; }
.sv-entry p { margin: 0.2rem 0 0.5rem; line-height: 1.6; }
.sv-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.4rem; margin: 0.5rem 0; }
.sv-photos .jp-photo { aspect-ratio: 4 / 3; }
.sv-acts { list-style: none; padding: 0; margin: 0.4rem 0; font-size: 0.86rem; color: var(--text-muted); columns: 2; column-gap: 1.5rem; }
.sv-acts li { break-inside: avoid; padding: 0.1rem 0; }
.sv-acts span { display: inline-block; min-width: 3rem; font-variant-numeric: tabular-nums; }
.sv-hotel { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.3rem; }
@media (max-width: 600px) { .sv-acts { columns: 1; } .sv-cover-photo { height: 180px; } }
@media print {
  #view-souvenir .filter-bar, .fab-expense { display: none !important; }
  .sv-cover, .sv-day { background: #fff !important; border-color: #ddd !important; color: #111 !important; }
  .sv-cover { page-break-after: always; border: 0 !important; }
  .sv-cover p, .sv-day-head small, .sv-acts, .sv-hotel { color: #555 !important; }
  .sv-cities { color: #b91c1c !important; }
  .jp-photo, .sv-cover-photo { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
@media print { html body #mobile-more-sheet, html body #mobile-more-overlay, html body #mobile-nav, html body .mobile-bottom-nav, html body #quick-expense, html body #taxi-card, html body #fab-expense, html body .toast-container { display: none !important; } }
.act-cost .act-eur { color: var(--text-muted); font-weight: 600; font-size: 0.72rem; }

/* Home: real stops of the trip under the title, tap to open them in the planning */
.header-cities-container { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; max-width: 100%; }
.header-cities-container::-webkit-scrollbar { display: none; }
button.city-pill-tag { flex-shrink: 0; min-height: 34px; padding: 0.2rem 0.7rem; font: inherit; font-size: 0.78rem; font-weight: 600; white-space: nowrap; cursor: pointer; }
.city-pill-tag small { font-size: 0.7rem; font-weight: 500; opacity: 0.7; margin-left: 0.15rem; }
.city-pill-tag.is-now { color: #fff; background: rgba(242, 120, 159, 0.2); border-color: #F2789F; }
.city-pill-tag.is-past { opacity: 0.5; }
.header-title-group { min-width: 0; max-width: 100%; }
.header-cities-container { min-width: 0; width: 100%; }

/* Map: the pin and its label are centred on the city; the stops strip is centred on the map */
.step-label { left: 50%; top: calc(100% + 4px); transform: translateX(-50%); align-items: center; text-align: center; }
.map-day-panel.is-trip { left: 50%; right: auto; width: max-content; max-width: calc(100% - 1.2rem); transform: translateX(-50%); }
.legend-chip:first-child { margin-left: auto; }
.legend-chip:last-child { margin-right: auto; }

/* Audit fixes */
.leaflet-control-zoom-fullscreen.fullscreen-icon { background-image: none !important; display: flex !important; align-items: center; justify-content: center; }
.leaflet-control-zoom-fullscreen.fullscreen-icon::before { content: '⛶'; font-size: 16px; line-height: 1; color: #f8fafc; }
.premium-legend-item { gap: 0.75rem; }
.premium-legend-val { white-space: nowrap; }
.bk-status { min-height: 30px; }
#view-dashboard, #view-budget { padding-bottom: 5.5rem; }
body.shared-mode #fab-expense, body.shared-mode #btn-plan-closures, body.shared-mode [onclick*="openImportBookingModal"] { display: none !important; }

/* ==========================================================================
   Palette "Sakura & or": soft colours carry dark text, never white
   ========================================================================== */
:root { --on-accent: #2A1019; }
.btn-primary, .btn-primary *, .fab-expense, .qe-save, .td-btn.is-primary, .popup-btn.is-primary, .popup-btn:not(.is-ghost), .legend-num, .step-num,
.pill.active, .pill.active *, .map-chip.is-active, .map-chip.is-active *, .btn[style*="gradient"], .offline-banner, .offline-banner *,
.dr-cell.is-start, .dr-cell.is-end, .dr-link.is-strong, .bv-pill, .day-today, .nav-badge { color: var(--on-accent) !important; text-shadow: none !important; }
.bv-pill { font-weight: 800; }
.pin-star, .pin-act, .pin-candidate { text-shadow: none; }
.pin-star, .pin-act { color: var(--on-accent); }
