/* ──────────────────────────────────────────────────────────
   Parker Family Trip · v2 — Region-tabbed travel guide
   Fonts: Lora (serif headlines) + DM Sans (body)
   ────────────────────────────────────────────────────────── */

:root {
  --cream: #f9f7f3;
  --cream-deep: #f1ede4;
  --paper: #ffffff;
  --ink: #1a1814;
  --ink-2: #2e2823;
  --muted: #6b6459;
  --muted-2: #948c80;
  --rule: #e8e4dd;
  --rule-strong: #d8d3c8;
  --love: #c14a3a;
  --signed-r: #2a5f8f;
  --signed-m: #8b4a8b;

  /* Region accents */
  --accent-cph: #2a5f8f;       /* Copenhagen — Nyhavn blue */
  --accent-aero: #4a7c59;      /* Skåne — meadow green */
  --accent-visby: #8b4a3c;     /* Gotland — limestone rust */
  --accent-sthlm: #5a4a8a;     /* Stockholm — twilight purple */
  --accent-bklyn: #c17d2a;     /* Brooklyn — brick / brownstone */
  --accent-transit: #8a847a;   /* Travel days — slate */

  /* Region tints (background washes) */
  --tint-cph: #eef3f8;
  --tint-aero: #eef4ee;
  --tint-visby: #f6ece7;
  --tint-sthlm: #f0edf5;
  --tint-bklyn: #faf2e6;
  --tint-transit: #f0eeea;

  --hover-bg: #f3f0ea;
  --drop-shadow: 0 1px 3px rgba(0,0,0,0.05);
  --card-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.04);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.65;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

button {
  font-family: inherit;
  cursor: pointer;
  background: none;
  border: none;
  color: inherit;
}
input, textarea { font-family: inherit; font-size: inherit; color: inherit; }

/* ── Top brand bar ──────────────────────────────── */
.brandbar {
  background: var(--ink);
  color: var(--cream);
  padding: 22px 32px 20px;
  display: flex;
  align-items: center;
  gap: 18px;
  position: relative;
}
.brandbar .crest {
  font-family: 'Lora', serif;
  font-weight: 500;
  font-size: 19px;
  letter-spacing: -0.005em;
  line-height: 1.1;
}
.brandbar .crest em { font-style: italic; color: rgba(249,247,243,0.65); font-weight: 400; }
.brandbar .crest-meta {
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(249,247,243,0.45);
  font-weight: 500;
  margin-top: 4px;
}
.brandbar .spacer { flex: 1; }

/* Toolbar buttons live on brandbar now */
.brandbar .who {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 14px 6px 6px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  background: rgba(255,255,255,0.04);
  color: var(--cream);
  transition: background 0.15s, border-color 0.15s;
}
.brandbar .who:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.28); }
.brandbar button.tb-btn {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  color: rgba(249,247,243,0.7);
  border: 1px solid transparent;
  transition: background 0.15s, color 0.15s;
}
.brandbar button.tb-btn:hover { background: rgba(255,255,255,0.08); color: var(--cream); }
.brandbar button.tb-btn .icn { margin-right: 4px; opacity: 0.85; }
.brandbar .activity-dot {
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--love);
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

.avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 12px;
}
.avatar.raphael { background: var(--signed-r); }
.avatar.morgan { background: var(--signed-m); }
.who-name { color: var(--cream); }
.who-caret { color: rgba(249,247,243,0.5); font-size: 10px; margin-left: 2px; }

/* User popover */
.user-popover {
  position: absolute;
  top: 100%;
  right: 32px;
  margin-top: 8px;
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.12);
  padding: 6px;
  min-width: 220px;
  z-index: 100;
}
.user-popover .opt {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 14px;
  text-align: left;
  color: var(--ink);
}
.user-popover .opt:hover { background: var(--hover-bg); }
.user-popover .opt.active { background: var(--cream); }
.user-popover .opt .check { margin-left: auto; color: var(--accent-aero); font-weight: 600; }
.user-popover .divider { height: 1px; background: var(--rule); margin: 4px 2px; }
.user-popover .meta {
  padding: 8px 10px 6px;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ── Region tabs ─────────────────────────────── */
.tabs {
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  box-shadow: 0 1px 0 rgba(0,0,0,0.02);
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 1 1 0;
  min-width: 150px;
  padding: 18px 20px 14px;
  text-align: left;
  border-bottom: 3px solid transparent;
  transition: background 0.15s, border-color 0.2s, color 0.15s;
  position: relative;
  color: var(--muted);
  cursor: pointer;
  display: block;
}
.tab:hover { background: var(--cream); color: var(--ink); }
.tab.active { color: var(--ink); background: var(--cream); }
.tab.active .tab-name { color: var(--ink); }
.tab-name {
  font-family: 'Lora', serif;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.15;
  display: flex; align-items: center; gap: 8px;
}
.tab-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  background: currentColor;
  opacity: 0.45;
  transition: opacity 0.15s, transform 0.15s;
}
.tab.active .tab-dot { opacity: 1; transform: scale(1.2); }
.tab-meta {
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--muted-2);
  margin-top: 3px;
  font-weight: 400;
}
.tab.active .tab-meta { color: var(--muted); }
.tab.cph { color: var(--accent-cph); }
.tab.aero { color: var(--accent-aero); }
.tab.visby { color: var(--accent-visby); }
.tab.sthlm { color: var(--accent-sthlm); }
.tab.bklyn { color: var(--accent-bklyn); }
.tab.active.cph { border-bottom-color: var(--accent-cph); }
.tab.active.aero { border-bottom-color: var(--accent-aero); }
.tab.active.visby { border-bottom-color: var(--accent-visby); }
.tab.active.sthlm { border-bottom-color: var(--accent-sthlm); }
.tab.active.bklyn { border-bottom-color: var(--accent-bklyn); }

/* ── Region hero ─────────────────────────────────── */
.region {
  max-width: 880px;
  margin: 0 auto;
  padding: 56px 32px 100px;
}
.region-hero {
  margin-bottom: 40px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--rule);
}
.region-eyebrow {
  font-size: 11.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.region-eyebrow .stripe {
  display: inline-block;
  width: 32px;
  height: 2px;
}
.region-eyebrow.cph .stripe { background: var(--accent-cph); }
.region-eyebrow.aero .stripe { background: var(--accent-aero); }
.region-eyebrow.visby .stripe { background: var(--accent-visby); }
.region-eyebrow.sthlm .stripe { background: var(--accent-sthlm); }
.region-eyebrow.bklyn .stripe { background: var(--accent-bklyn); }

.region-title {
  font-family: 'Lora', serif;
  font-size: 56px;
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.012em;
  color: var(--ink);
  margin-bottom: 10px;
}
.region-subtitle-line {
  font-family: 'Lora', serif;
  font-style: italic;
  font-size: 16px;
  color: var(--muted);
  margin-bottom: 14px;
  letter-spacing: 0.01em;
}
.region-subtitle {
  font-size: 16px;
  font-weight: 400;
  color: var(--ink-2);
  line-height: 1.55;
  margin-bottom: 26px;
  max-width: 620px;
}
.region-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin-top: 4px;
}
.region-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.region-stat .stat-num {
  font-family: 'Lora', serif;
  font-size: 26px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1;
}
.region-stat .stat-num .love-glyph { color: var(--love); }
.region-stat .stat-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}

/* ── Stay cards ───────────────────────────────────── */
.stays {
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.stay-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  position: relative;
}
.stay-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--accent-transit);
}
.stay-card.color-cph::before { background: var(--accent-cph); }
.stay-card.color-aero::before { background: var(--accent-aero); }
.stay-card.color-visby::before { background: var(--accent-visby); }
.stay-card.color-sthlm::before { background: var(--accent-sthlm); }
.stay-card.color-bklyn::before { background: var(--accent-bklyn); }
.stay-card.color-transit::before { background: var(--accent-transit); }

.stay-header {
  padding: 22px 28px 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--rule);
  flex-wrap: wrap;
}
.stay-header-main { flex: 1; min-width: 200px; }
.stay-flag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 6px;
}
.stay-flag .country-glyph { font-size: 14px; letter-spacing: 0; }
.stay-name {
  font-family: 'Lora', serif;
  font-size: 26px;
  font-weight: 500;
  line-height: 1.15;
  color: var(--ink);
  margin-bottom: 4px;
  letter-spacing: -0.005em;
}
.stay-tagline {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.5;
  max-width: 480px;
}
.stay-dates {
  text-align: right;
  flex-shrink: 0;
  padding-top: 2px;
}
.stay-dates .nights {
  font-family: 'Lora', serif;
  font-size: 22px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.05;
}
.stay-dates .nights-label {
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  display: block;
  margin-top: 3px;
}
.stay-dates .daterange {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 4px;
}

.stay-body {
  padding: 16px 28px 24px;
  background: var(--paper);
}

/* Transit / travel-day card variant (smaller, less visual weight) */
.stay-card.is-transit .stay-header {
  background: var(--tint-transit);
}
.stay-card.is-transit .stay-name {
  font-size: 20px;
}
.stay-card.is-transit .stay-flag {
  color: var(--accent-transit);
}

/* ── Section details inside stay cards ─────────────── */
details.section {
  border: 1px solid var(--rule);
  border-radius: 10px;
  margin-bottom: 8px;
  overflow: hidden;
  background: var(--cream);
  transition: box-shadow 0.15s;
}
details.section[open] {
  background: var(--paper);
  box-shadow: var(--drop-shadow);
  border-color: var(--rule-strong);
}
details.section summary {
  padding: 12px 16px;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
  font-size: 14px;
  user-select: none;
  outline: none;
}
details.section summary::-webkit-details-marker { display: none; }
details.section summary::after {
  content: '';
  width: 8px; height: 8px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.18s;
  flex-shrink: 0;
  margin-left: auto;
}
details.section[open] summary::after {
  transform: rotate(-135deg) translate(-2px,-2px);
}
details.section summary:hover { background: rgba(0,0,0,0.02); }
.section-icon { font-size: 16px; flex-shrink: 0; width: 22px; text-align: center; }
.section-label { font-weight: 500; }
.section-count {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 400;
  letter-spacing: 0.02em;
  padding: 2px 8px;
  background: var(--cream-deep);
  border-radius: 100px;
}
details.section[open] .section-count { background: var(--cream); }

.detail-body {
  padding: 6px 18px 18px 50px;
  border-top: 1px solid var(--rule);
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.7;
}
.detail-body p { margin-bottom: 8px; }
.detail-body p:last-child { margin-bottom: 0; }
.detail-body strong { color: var(--ink); font-weight: 500; }

/* ── Basic travel details — merged subsections ───────── */
.basic-details-body {
  padding: 16px 24px 20px 50px;
}
.subsection {
  padding: 6px 0 4px;
}
.subsection-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 8px;
}
.subsection-icon {
  font-size: 14px;
  letter-spacing: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  text-align: center;
}
.subsection-body {
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink-2);
  padding-left: 30px;
}
.subsection-body p { margin-bottom: 6px; }
.subsection-body p:last-child { margin-bottom: 0; }
.subsection-divider {
  height: 1px;
  background: var(--rule);
  margin: 14px 0 14px 30px;
}

/* ── Ideas view toggle (List / Map) ──────────────────── */
.ideas-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.toolbar-spacer { flex: 1; min-width: 0; }
.ideas-view-toggle {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: var(--cream-deep);
  border-radius: 100px;
  border: 1px solid var(--rule);
}
.view-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 14px;
  border-radius: 100px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
}
.view-btn .icn { font-size: 13px; line-height: 1; }
.view-btn:hover:not(.active) { color: var(--ink); }
.view-btn.active {
  background: var(--ink);
  color: var(--cream);
}

/* Refresh-ideas hint inside Ideas section */
.ideas-hint {
  font-size: 12.5px;
  color: var(--muted);
  background: var(--cream);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.45;
}
.ideas-hint .hint-icon {
  color: var(--love);
  font-size: 14px;
  flex-shrink: 0;
}
.ideas-hint a {
  color: var(--ink);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--rule-strong);
  transition: text-decoration-color 0.15s;
}
.ideas-hint a:hover { text-decoration-color: var(--ink); }

/* Composer label inside Notes */
.composer-label {
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 2px;
}

/* Stack composers in notes */
.note-composer + .refresh-panel { margin-top: 14px; }

/* Refresh ideas button + panel */
.refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
  background: var(--cream-deep);
  border: 1px solid var(--rule-strong);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.refresh-btn .spark { color: var(--love); font-size: 13px; line-height: 1; }
.refresh-btn:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--cream);
}
.refresh-btn:hover .spark { color: var(--cream); }

.refresh-panel {
  background: #fdfbf4;
  border: 1px solid #ead9a3;
  border-radius: 12px;
  padding: 16px 18px 14px;
  margin-bottom: 16px;
  position: relative;
}
.refresh-panel[hidden] { display: none; }
.refresh-panel::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--love);
  border-radius: 12px 0 0 12px;
  opacity: 0.7;
}
.refresh-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
}
.refresh-eyebrow-icon {
  color: var(--love);
  font-size: 14px;
  letter-spacing: 0;
}
.refresh-meta {
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.5;
  margin-bottom: 12px;
}
.refresh-meta strong { color: var(--ink); font-weight: 600; }
.refresh-input {
  width: 100%;
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  padding: 10px 12px;
  background: white;
  outline: none;
  font-size: 14px;
  line-height: 1.5;
  min-height: 68px;
  resize: vertical;
  transition: border-color 0.15s;
}
.refresh-input:focus { border-color: var(--ink); }
.refresh-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 12px;
}
.refresh-actions .btn-primary {
  background: var(--ink);
  color: var(--cream);
}
.refresh-actions .btn-primary:disabled {
  opacity: 0.65;
  cursor: default;
}
.refresh-status {
  margin-top: 12px;
  padding: 8px 12px;
  background: white;
  border: 1px solid var(--rule);
  border-radius: 6px;
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.refresh-status[hidden] { display: none; }
.spinner {
  width: 12px; height: 12px;
  border: 2px solid var(--rule-strong);
  border-top-color: var(--ink);
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Map view ───────────────────────────────────────── */
.map-view {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 14px;
  align-items: stretch;
}
.leaflet-map {
  width: 100%;
  height: 420px;
  border-radius: 10px;
  border: 1px solid var(--rule-strong);
  background: var(--cream-deep);
  overflow: hidden;
}
.map-legend {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 4px;
}
.map-legend-header {
  padding: 4px 4px 8px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 4px;
}
.legend-eyebrow {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.legend-eyebrow strong {
  color: var(--ink);
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: none;
}
.distance-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  transition: background 0.12s;
  border: none;
  font-family: inherit;
}
.distance-row:hover {
  background: var(--cream);
}
.distance-row.loved {
  background: rgba(193, 74, 58, 0.04);
}
.distance-icon {
  font-size: 17px;
  width: 26px;
  text-align: center;
  flex-shrink: 0;
}
.distance-body { flex: 1; min-width: 0; }
.distance-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.distance-tbd {
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.distance-value {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  color: var(--muted);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

/* ── Leaflet markers — custom pin styling ────────────── */
.map-pin-wrap { background: transparent; border: none; }
.map-pin {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 50%;
  font-size: 17px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  position: relative;
  cursor: pointer;
  transition: transform 0.15s;
}
.map-pin:hover { transform: scale(1.1); }
.map-pin.pin-hotel {
  width: 40px; height: 40px;
  background: var(--ink);
  color: var(--cream);
  border-color: var(--cream);
  font-size: 19px;
  font-weight: 600;
  z-index: 1000;
}
.map-pin.pin-idea.accent-cph { border-color: var(--accent-cph); }
.map-pin.pin-idea.accent-aero { border-color: var(--accent-aero); }
.map-pin.pin-idea.accent-visby { border-color: var(--accent-visby); }
.map-pin.pin-idea.accent-sthlm { border-color: var(--accent-sthlm); }
.map-pin.pin-idea.accent-bklyn { border-color: var(--accent-bklyn); }
.map-pin.pin-loved {
  background: var(--love);
  border-color: white;
  color: white;
}
.map-pin.pin-loved::after {
  content: '♥';
  position: absolute;
  top: -6px; right: -6px;
  background: var(--love);
  color: white;
  font-size: 9px;
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--paper);
  display: flex; align-items: center; justify-content: center;
}

/* Leaflet popup overrides */
.leaflet-popup-content-wrapper {
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  border: 1px solid var(--rule-strong);
}
.leaflet-popup-content {
  margin: 12px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  line-height: 1.45;
}
.map-popup-eyebrow {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 3px;
}
.map-popup-title {
  font-family: 'Lora', serif;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 4px;
  line-height: 1.25;
}
.map-popup-desc {
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.5;
  margin-bottom: 4px;
}
.map-popup-meta {
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
}

@media (max-width: 760px) {
  .map-view { grid-template-columns: 1fr; }
  .leaflet-map { height: 320px; }
  .map-legend { max-height: 280px; }
  .basic-details-body { padding: 14px 16px 16px 38px; }
  .subsection-body { padding-left: 24px; }
  .subsection-divider { margin-left: 24px; }
}

.conf-chip {
  display: inline-block;
  font-family: ui-monospace, 'SF Mono', monospace;
  font-size: 12.5px;
  background: var(--cream-deep);
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
  padding: 2px 8px;
  letter-spacing: 0.08em;
  color: var(--ink);
}

.alert-box {
  background: #fff8ec;
  border: 1px solid #f0d89a;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13px;
  color: #7a5a0a;
  margin: 12px 0 4px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  line-height: 1.55;
}
.alert-box .alert-icon { flex-shrink: 0; font-size: 14px; line-height: 1.4; }

/* ── Ideas list ───────────────────────────────────── */
.idea-list { list-style: none; padding: 0; margin: 0; }
.idea-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
  display: flex;
  gap: 14px;
  align-items: flex-start;
  font-size: 14px;
  line-height: 1.5;
  position: relative;
}
.idea-item:last-of-type { border-bottom: none; }
.idea-icon {
  flex-shrink: 0;
  font-size: 17px;
  margin-top: 1px;
  width: 22px;
  text-align: center;
}
.idea-body { flex: 1; min-width: 0; }
.idea-title {
  display: block;
  font-weight: 500;
  color: var(--ink);
  font-size: 14px;
  margin-bottom: 1px;
}
.idea-desc { color: var(--muted); font-size: 13.5px; }
.idea-attribution {
  font-size: 11px;
  color: var(--muted);
  margin-top: 5px;
  letter-spacing: 0.02em;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.idea-attribution .dot { color: var(--rule-strong); }
.added-pill {
  display: inline-block;
  background: var(--cream-deep);
  border: 1px solid var(--rule-strong);
  padding: 1px 8px;
  border-radius: 100px;
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.idea-actions {
  display: flex;
  gap: 2px;
  align-items: center;
  margin-left: auto;
  opacity: 0;
  transition: opacity 0.15s;
  flex-shrink: 0;
}
.idea-item:hover .idea-actions { opacity: 1; }
.idea-item.has-love .idea-actions,
.idea-item.is-editing .idea-actions { opacity: 1; }
.action-btn {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px;
  color: var(--muted);
  font-size: 14px;
  transition: background 0.15s, color 0.15s;
}
.action-btn:hover { background: var(--hover-bg); color: var(--ink); }
.action-btn.love-btn.loved { color: var(--love); }
.action-btn.del:hover { color: var(--love); }

.add-idea-btn {
  margin-top: 12px;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px;
  color: var(--muted);
  padding: 7px 12px;
  border-radius: 6px;
  border: 1px dashed var(--rule-strong);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.add-idea-btn:hover {
  color: var(--ink);
  background: var(--cream);
  border-color: var(--muted);
}

/* Inline edit form */
.idea-edit-form {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.idea-edit-form .row { display: flex; gap: 6px; }
.idea-edit-form input.icon-in {
  width: 44px;
  text-align: center;
  font-size: 17px;
  padding: 6px 4px;
  border: 1px solid var(--rule-strong);
  border-radius: 6px;
  background: var(--cream);
}
.idea-edit-form input.title-in,
.idea-edit-form textarea.desc-in {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--rule-strong);
  border-radius: 6px;
  background: white;
  outline: none;
  transition: border-color 0.15s;
  resize: vertical;
}
.idea-edit-form input.title-in { font-weight: 500; }
.idea-edit-form textarea.desc-in {
  font-size: 13.5px;
  min-height: 60px;
  line-height: 1.5;
}
.idea-edit-form input:focus,
.idea-edit-form textarea:focus { border-color: var(--ink); }
.idea-edit-form .form-actions {
  display: flex; gap: 6px; justify-content: flex-end; margin-top: 2px;
}
.btn-primary, .btn-secondary {
  font-size: 13px;
  padding: 7px 14px;
  border-radius: 6px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.btn-primary { background: var(--ink); color: var(--cream); }
.btn-primary:hover { background: #000; }
.btn-secondary { color: var(--muted); }
.btn-secondary:hover { background: var(--hover-bg); color: var(--ink); }

/* ── Notes section ──────────────────────────────── */
.note-item {
  border-left: 3px solid var(--rule);
  padding: 10px 0 10px 14px;
  margin-bottom: 12px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.note-item.by-raphael { border-left-color: var(--signed-r); }
.note-item.by-morgan { border-left-color: var(--signed-m); }
.note-item .avatar-sm {
  width: 22px; height: 22px;
  border-radius: 50%;
  color: white;
  font-size: 10px;
  font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 1px;
}
.note-item.by-raphael .avatar-sm { background: var(--signed-r); }
.note-item.by-morgan .avatar-sm { background: var(--signed-m); }
.note-body { flex: 1; min-width: 0; }
.note-meta { font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.note-text { font-size: 14px; color: var(--ink); line-height: 1.55; white-space: pre-wrap; }
.note-del {
  color: var(--muted); font-size: 12px;
  opacity: 0; transition: opacity 0.15s;
}
.note-item:hover .note-del { opacity: 1; }
.note-del:hover { color: var(--love); }

.note-composer {
  margin-top: 10px;
  display: flex; flex-direction: column; gap: 8px;
  padding: 12px;
  background: var(--cream);
  border-radius: 10px;
  border: 1px solid var(--rule);
}
.note-composer textarea {
  width: 100%;
  border: 1px solid var(--rule-strong);
  border-radius: 6px;
  padding: 9px 12px;
  background: white;
  outline: none;
  font-size: 14px;
  line-height: 1.5;
  min-height: 60px;
  resize: vertical;
  transition: border-color 0.15s;
}
.note-composer textarea:focus { border-color: var(--ink); }
.note-composer .row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.note-composer .composer-hint { font-size: 11.5px; color: var(--muted); }

/* ── Activity panel ─────────────────────────── */
.activity-panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 360px;
  background: var(--paper);
  border-left: 1px solid var(--rule);
  box-shadow: -8px 0 28px rgba(0,0,0,0.08);
  transform: translateX(110%);
  transition: transform 0.25s ease;
  z-index: 200;
  display: flex; flex-direction: column;
}
.activity-panel.open { transform: translateX(0); }
.activity-header {
  padding: 20px 22px;
  border-bottom: 1px solid var(--rule);
  display: flex; align-items: center; justify-content: space-between;
}
.activity-header h3 {
  font-family: 'Lora', serif;
  font-size: 19px;
  font-weight: 500;
}
.activity-list { flex: 1; overflow-y: auto; padding: 8px 16px 24px; }
.activity-row {
  display: flex; gap: 10px;
  padding: 11px 6px;
  border-bottom: 1px solid var(--rule);
  font-size: 13px;
  align-items: flex-start;
}
.activity-row:last-child { border-bottom: none; }
.activity-row .avatar-sm {
  width: 22px; height: 22px; border-radius: 50%;
  color: white; font-size: 10px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 1px;
}
.activity-row.raphael .avatar-sm { background: var(--signed-r); }
.activity-row.morgan .avatar-sm { background: var(--signed-m); }
.activity-body { flex: 1; min-width: 0; }
.activity-msg { color: var(--ink); line-height: 1.45; }
.activity-msg .it { font-style: italic; color: var(--muted); }
.activity-time { font-size: 11px; color: var(--muted); margin-top: 2px; }
.activity-empty {
  text-align: center; color: var(--muted);
  padding: 40px 20px; font-size: 13.5px;
}

/* ── Floating Claude button ─────────────────── */
.claude-fab {
  position: fixed;
  bottom: 28px; right: 28px;
  background: var(--ink);
  color: var(--cream);
  padding: 13px 20px 13px 16px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 500;
  display: flex; align-items: center; gap: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18), 0 2px 4px rgba(0,0,0,0.1);
  transition: transform 0.15s, box-shadow 0.15s;
  z-index: 150;
}
.claude-fab:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.22), 0 2px 4px rgba(0,0,0,0.1);
}
.claude-fab .spark { font-size: 16px; }
.claude-fab.hidden { display: none; }

/* ── Claude chat panel ─────────────────── */
.chat-panel {
  position: fixed;
  bottom: 0; right: 0;
  width: 440px;
  height: min(720px, 92vh);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 16px 16px 0 0;
  box-shadow: -8px -4px 36px rgba(0,0,0,0.14);
  margin-right: 24px;
  transform: translateY(110%);
  transition: transform 0.28s cubic-bezier(0.2,0.8,0.2,1);
  z-index: 250;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.chat-panel.open { transform: translateY(0); }
.chat-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--rule);
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(180deg, #fdfcf9, var(--paper));
}
.chat-header .claude-avatar {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--ink); color: var(--cream);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.chat-header h3 {
  font-family: 'Lora', serif;
  font-size: 17px; font-weight: 500; margin: 0; line-height: 1.1;
}
.chat-header .sub { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.chat-header .spacer { flex: 1; }
.chat-header button {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px; color: var(--muted); font-size: 18px;
}
.chat-header button:hover { background: var(--hover-bg); color: var(--ink); }

.chat-messages {
  flex: 1; overflow-y: auto;
  padding: 18px 18px 8px;
  display: flex; flex-direction: column; gap: 14px;
}
.chat-msg { font-size: 14px; line-height: 1.55; display: flex; flex-direction: column; }
.chat-msg.user { align-items: flex-end; }
.chat-msg.user .bubble {
  background: var(--ink); color: var(--cream);
  padding: 9px 14px;
  border-radius: 18px 18px 4px 18px;
  max-width: 80%; white-space: pre-wrap;
}
.chat-msg.assistant .bubble {
  background: var(--cream); border: 1px solid var(--rule); color: var(--ink);
  padding: 10px 14px;
  border-radius: 18px 18px 18px 4px;
  max-width: 92%; white-space: pre-wrap;
}
.chat-msg.assistant .bubble p { margin-bottom: 8px; }
.chat-msg.assistant .bubble p:last-child { margin-bottom: 0; }
.chat-msg .who-label { font-size: 11px; color: var(--muted); margin: 0 8px 3px; }

.chat-msg .actions-stack {
  display: flex; flex-direction: column; gap: 6px;
  margin-top: 8px; max-width: 92%;
}
.chat-action-card {
  background: white;
  border: 1px solid var(--rule-strong);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 13px; line-height: 1.45;
}
.chat-action-card .a-icon { font-size: 14px; flex-shrink: 0; margin-top: 1px; width: 18px; text-align: center; }
.chat-action-card .a-body { flex: 1; min-width: 0; }
.chat-action-card .a-verb {
  font-size: 10.5px; color: var(--muted);
  letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 2px;
}
.chat-action-card .a-verb.add { color: var(--accent-aero); }
.chat-action-card .a-verb.remove { color: var(--love); }
.chat-action-card .a-verb.edit { color: var(--accent-cph); }
.chat-action-card .a-verb.note { color: var(--accent-sthlm); }
.chat-action-card .a-title { font-weight: 500; color: var(--ink); margin-bottom: 1px; }
.chat-action-card .a-where { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.chat-action-card .a-buttons {
  display: flex; gap: 4px; flex-shrink: 0; margin-left: auto; align-self: center;
}
.chat-action-card .a-buttons button {
  padding: 5px 12px; font-size: 12px; border-radius: 5px; font-weight: 500;
  transition: background 0.15s;
}
.chat-action-card .a-apply { background: var(--ink); color: var(--cream); }
.chat-action-card .a-apply:hover { background: #000; }
.chat-action-card .a-dismiss { color: var(--muted); }
.chat-action-card .a-dismiss:hover { background: var(--hover-bg); }
.chat-action-card.applied { background: #f0f5ee; border-color: #b8d4b0; }
.chat-action-card.applied .a-buttons {
  font-size: 11.5px; color: var(--accent-aero);
  letter-spacing: 0.04em; padding: 4px 6px; font-weight: 500;
}

.chat-typing {
  color: var(--muted); font-size: 13px; font-style: italic;
  padding: 4px 14px;
}
.chat-typing .dots span {
  display: inline-block;
  width: 4px; height: 4px;
  border-radius: 50%; background: var(--muted);
  margin: 0 1px;
  animation: pulse 1.2s infinite;
}
.chat-typing .dots span:nth-child(2) { animation-delay: 0.15s; }
.chat-typing .dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes pulse { 0%, 80%, 100% { opacity: 0.2; } 40% { opacity: 1; } }

.chat-suggestions {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 0 18px 8px;
}
.chat-suggestion {
  background: var(--cream); border: 1px solid var(--rule-strong);
  padding: 6px 11px;
  border-radius: 100px;
  font-size: 12.5px;
  color: var(--muted);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.chat-suggestion:hover {
  background: var(--ink); border-color: var(--ink); color: var(--cream);
}

.chat-input-row {
  border-top: 1px solid var(--rule);
  padding: 12px 14px;
  display: flex; align-items: flex-end; gap: 8px;
  background: var(--paper);
}
.chat-input-row textarea {
  flex: 1;
  border: 1px solid var(--rule-strong);
  border-radius: 18px;
  padding: 10px 14px;
  background: var(--cream);
  outline: none; font-size: 14px; line-height: 1.45;
  resize: none; max-height: 120px;
  transition: border-color 0.15s;
}
.chat-input-row textarea:focus { border-color: var(--ink); background: white; }
.chat-input-row button.send-btn {
  width: 38px; height: 38px;
  background: var(--ink); color: var(--cream);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
  transition: background 0.15s, opacity 0.15s;
}
.chat-input-row button.send-btn:hover { background: #000; }
.chat-input-row button.send-btn:disabled { opacity: 0.4; cursor: default; }

.chat-empty {
  padding: 32px 24px; text-align: center;
  color: var(--muted); font-size: 13.5px; line-height: 1.6;
}
.chat-empty .glyph { font-size: 22px; margin-bottom: 8px; }
.chat-empty strong { display: block; font-weight: 500; color: var(--ink); font-size: 14px; margin-bottom: 4px; }

/* ── Toast ───────────────────────── */
.toast {
  position: fixed;
  bottom: 32px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: var(--cream);
  padding: 10px 18px;
  border-radius: 100px;
  font-size: 13.5px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  opacity: 0; transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  z-index: 400;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Scrim ──────────────────────── */
.scrim { position: fixed; inset: 0; z-index: 90; background: transparent; }
.scrim.dim { background: rgba(20,18,15,0.18); z-index: 199; }

/* ── Mobile ──────────────────────── */
@media (max-width: 760px) {
  .brandbar { padding: 16px 18px 14px; flex-wrap: wrap; gap: 12px; }
  .brandbar .crest { font-size: 16px; }
  .tabs { gap: 0; }
  .tab { min-width: 130px; padding: 14px 14px 12px; }
  .tab-name { font-size: 15px; }
  .region { padding: 36px 18px 100px; }
  .region-title { font-size: 40px; }
  .region-subtitle { font-size: 17px; }
  .region-stats { gap: 20px; }
  .stay-header { padding: 18px 20px 14px; }
  .stay-name { font-size: 22px; }
  .stay-body { padding: 14px 20px 22px; }
  .detail-body { padding: 6px 14px 16px 38px; }
  .chat-panel { width: 100%; margin-right: 0; border-radius: 14px 14px 0 0; height: 88vh; }
  .activity-panel { width: 86%; }
  .claude-fab { right: 16px; bottom: 16px; padding: 11px 16px 11px 14px; font-size: 13px; }
  .user-popover { right: 12px; }
}
