/* Mapt test site styles
   Calm, clean travel-journal look. One color per mode. */

:root {
  --been: #e8735f;        /* warm coral: memories */
  --been-soft: #fbe5e0;
  --want: #e2b13c;        /* soft gold: dreams */
  --want-soft: #faf0d6;
  --going: #2a9d9a;       /* ocean teal: plans */
  --going-soft: #dcf0ef;

  --paper: #fbfaf7;
  --card: #ffffff;
  --ink: #2d3436;
  --ink-soft: #66706f;
  --line: #ebe7df;
  --water: #d8e8ef;

  --radius: 14px;
  --shadow: 0 6px 24px rgba(45, 52, 54, 0.12);
  --side-w: 400px;
  --top-h: 56px;
  --tabs-h: 64px;

  --font-head: "Nunito", ui-rounded, "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { font-family: var(--font-head); margin: 0; letter-spacing: -0.01em; }
[hidden] { display: none !important; }

/* ---------- Layout (desktop first) ---------- */
#app {
  display: grid;
  grid-template-columns: var(--side-w) 1fr;
  height: 100vh;
  height: 100dvh;
}
.side {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--paper);
  border-right: 1px solid var(--line);
  z-index: 3;
}
.map-wrap { position: relative; min-width: 0; }
#map { position: absolute; inset: 0; background: var(--water); }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px 10px;
}
.logo { width: 30px; height: 30px; flex: none; }
.brand-name { font-family: var(--font-head); font-weight: 800; font-size: 22px; line-height: 1; }
.brand-tag { font-size: 12px; color: var(--ink-soft); }
.test-badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--going-soft);
  color: #1d6f6d;
}

.tabs {
  display: flex;
  gap: 2px;
  padding: 4px 10px 8px;
  border-bottom: 1px solid var(--line);
}
.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 0;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 500;
}
.tab svg {
  width: 22px; height: 22px;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.tab.active { color: var(--ink); background: #f1eee7; }

.panel {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px 28px;
  -webkit-overflow-scrolling: touch;
}

/* ---------- Map tools ---------- */
.map-tools {
  position: absolute;
  top: 14px; left: 14px; right: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 460px;
  z-index: 2;
  pointer-events: none;
}
.map-tools > * { pointer-events: auto; }
.search {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--card);
  border-radius: 999px;
  box-shadow: var(--shadow);
}
.search > svg {
  width: 20px; height: 20px; margin-left: 14px; flex: none;
  fill: none; stroke: var(--ink-soft); stroke-width: 2; stroke-linecap: round;
}
.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: none;
  padding: 13px 16px 13px 10px;
  font-size: 16px; /* 16px stops iPhone from zooming in */
}
.results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-height: 60vh;
  overflow-y: auto;
}
.results li button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: none;
  padding: 9px 10px;
  border-radius: 10px;
}
.results li button:hover, .results li button:focus { background: #f4f1ea; outline: 0; }
.results .r-name { font-weight: 600; }
.results .r-sub { font-size: 13px; color: var(--ink-soft); }
.results .r-note { padding: 10px; color: var(--ink-soft); font-size: 14px; }

.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(45, 52, 54, 0.06);
}
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot.been { background: var(--been); }
.dot.want { background: var(--want); }
.dot.going { background: var(--going); }

.map-hint {
  position: absolute;
  left: 14px; bottom: 10px;
  margin: 0;
  font-size: 12px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.85);
  padding: 4px 10px;
  border-radius: 999px;
  z-index: 1;
}

/* ---------- Map pins ---------- */
.pin {
  width: 26px; height: 26px;
  cursor: pointer;
}
.pin span {
  display: block;
  width: 22px; height: 22px;
  margin: 2px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s;
}
.pin:hover span { transform: rotate(-45deg) scale(1.15); }
.pin.been span { background: var(--been); }
.pin.want span { background: var(--want); }
.pin.going span { background: var(--going); }
.pin.preview span { background: #fff; border-color: var(--ink); border-style: dashed; }
.pin.selected span { transform: rotate(-45deg) scale(1.25); }
.pin.dim { opacity: 0.25; }

/* ---------- Panel content ---------- */
.panel h2 { font-size: 24px; margin-bottom: 4px; }
.panel .lead { color: var(--ink-soft); margin: 0 0 16px; }
.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-head);
  font-size: 17px;
  margin: 22px 0 8px;
}
.section-title .actions { margin-left: auto; display: flex; gap: 4px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}
.welcome { background: var(--going-soft); border-color: #c7e6e4; margin-bottom: 14px; }
.welcome p { margin: 6px 0 10px; }

.place-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.place-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
}
.place-row:hover { border-color: #d8d2c5; }
.place-row .badge { flex: none; }
.place-row .info { flex: 1; min-width: 0; }
.place-row .name, .place-row .sub { display: block; }
.place-row .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.place-row .sub { font-size: 13px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.place-row .meta { font-size: 13px; color: var(--ink-soft); flex: none; }

.badge {
  width: 34px; height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 16px;
}
.badge.been { background: var(--been-soft); color: var(--been); }
.badge.want { background: var(--want-soft); color: #b98a1c; }
.badge.going { background: var(--going-soft); color: var(--going); }

.empty { color: var(--ink-soft); font-size: 14px; padding: 6px 2px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 500;
  font-size: 14px;
}
.btn:hover { border-color: #d3ccbe; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.going { background: var(--going); border-color: var(--going); color: #fff; }
.btn.danger { color: #b8402c; }
.btn.link { border: 0; background: none; padding: 4px 6px; color: var(--ink-soft); text-decoration: underline; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
/* Two buttons side by side, the same width (Stats › Your data). */
.btn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.btn-grid .btn { padding-left: 8px; padding-right: 8px; text-align: center; }

/* Map name */
.map-title { display: flex; align-items: center; gap: 8px; }
.map-title .icon-btn { font-size: 15px; color: var(--ink-soft); }
.brand-tag { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.name-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.name-row strong { font-family: var(--font-head); font-size: 18px; }

/* Stats */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.stat .num { font-family: var(--font-head); font-size: 30px; font-weight: 800; line-height: 1.1; }
.stat .label { font-size: 13px; color: var(--ink-soft); }
.stat.been .num { color: var(--been); }
.stat.want .num { color: #b98a1c; }
.stat.going .num { color: var(--going); }
.progress { height: 10px; background: #efebe3; border-radius: 999px; overflow: hidden; margin: 8px 0 4px; }
.progress > div { height: 100%; background: var(--been); border-radius: 999px; }
.cheer {
  font-family: var(--font-head);
  font-size: 18px;
  margin: 4px 0 14px;
}
.continents { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.continent {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #f4f1ea;
  color: var(--ink-soft);
  font-size: 14px;
}
.continent.done { background: var(--been-soft); color: var(--ink); font-weight: 500; }
.milestone {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.milestone:last-child { border-bottom: 0; }
.milestone .icon {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: #efebe3; color: var(--ink-soft); flex: none; font-size: 14px;
}
.milestone.done .icon { background: var(--been); color: #fff; }
.milestone .m-sub { font-size: 13px; color: var(--ink-soft); }

/* Timeline (Been) */
.year { font-family: var(--font-head); font-size: 15px; color: var(--ink-soft); margin: 18px 0 8px; }

/* Trips */
.trip-card {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 5px solid var(--going);
  border-radius: 12px;
  padding: 12px 14px;
}
.trip-card.done { border-left-color: var(--been); }
.trip-card .t-name { font-weight: 600; font-size: 16px; }
.trip-card .t-sub { font-size: 13px; color: var(--ink-soft); }
.day {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.day-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.day-head strong { font-family: var(--font-head); font-size: 16px; }
.day-head span { font-size: 13px; color: var(--ink-soft); }
.stop {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-top: 1px dashed var(--line);
}
.stop:first-of-type { border-top: 0; }
.stop .s-name { flex: 1; min-width: 0; border: 0; background: none; text-align: left; padding: 0; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stop select { font-size: 13px; padding: 4px; border-radius: 8px; border: 1px solid var(--line); background: #fff; max-width: 120px; }
.icon-btn {
  width: 30px; height: 30px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  display: grid; place-items: center;
  font-size: 13px;
  flex: none;
}
.icon-btn:disabled { opacity: 0.35; cursor: default; }

/* ---------- Sheet (place page, trip editor, previews) ---------- */
.backdrop {
  position: fixed; inset: 0;
  background: rgba(30, 36, 38, 0.25);
  z-index: 20;
}
.sheet {
  position: fixed;
  top: 16px; right: 16px; bottom: 16px;
  width: 400px;
  max-width: calc(100vw - 32px);
  background: var(--paper);
  border-radius: 18px;
  box-shadow: 0 12px 40px rgba(30, 36, 38, 0.25);
  overflow-y: auto;
  z-index: 21;
  -webkit-overflow-scrolling: touch;
}
.sheet-head {
  position: sticky; top: 0;
  padding: 16px 16px 12px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  z-index: 1;
}
.head-row { display: flex; align-items: flex-start; gap: 10px; }
.head-text { flex: 1; min-width: 0; }
.sheet-head h2 { font-size: 22px; line-height: 1.2; }
.sheet-head .sub { font-size: 14px; color: var(--ink-soft); }
.sheet-head .close {
  margin-left: auto; flex: none;
  width: 34px; height: 34px; border-radius: 50%;
  border: 0; background: #efebe3; font-size: 18px; line-height: 1;
}
.sheet-head .close.back { margin-left: 0; font-size: 24px; }
.sheet-body { padding: 14px 16px 28px; }

.hero {
  height: 110px;
  border-radius: var(--radius);
  margin-bottom: 14px;
  display: flex;
  align-items: flex-end;
  padding: 12px 14px;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 15px;
  color: #fff;
}
.hero.been { background: linear-gradient(135deg, #f3a08f, var(--been)); }
.hero.want { background: linear-gradient(135deg, #f0cf7c, var(--want)); }
.hero.going { background: linear-gradient(135deg, #6cc4bf, var(--going)); }
.hero.none { background: linear-gradient(135deg, #c9d8de, #9fb6bf); }

.status-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.status-switch button {
  border: 2px solid var(--line);
  background: var(--card);
  border-radius: 12px;
  padding: 10px 4px;
  font-weight: 600;
  font-size: 14px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.status-switch button small { font-weight: 400; font-size: 11px; color: var(--ink-soft); }
.status-switch button.been.on { border-color: var(--been); background: var(--been-soft); }
.status-switch button.want.on { border-color: var(--want); background: var(--want-soft); }
.status-switch button.going.on { border-color: var(--going); background: var(--going-soft); }

.field { margin-bottom: 14px; }
.field label, .field .label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-bottom: 5px; }
.field input, .field textarea, .field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--card);
  font-size: 16px;
}
.field textarea { min-height: 90px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { outline: 2px solid var(--going-soft); border-color: var(--going); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.stars { display: flex; gap: 4px; }
.stars button {
  border: 0; background: none; padding: 2px;
  font-size: 28px; line-height: 1; color: #ddd6c8;
}
.stars button.on { color: var(--want); }

.list-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.list-chips button {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
}
.list-chips button.on { background: var(--want-soft); border-color: var(--want); font-weight: 600; }

.note-box {
  background: var(--want-soft);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  margin-bottom: 14px;
}
.note-box.going { background: var(--going-soft); }
.note-box.been { background: var(--been-soft); }
.saved-hint { font-size: 12px; color: var(--ink-soft); text-align: center; margin-top: 18px; }

.choice-grid { display: grid; gap: 8px; }
.choice {
  display: flex; align-items: center; gap: 12px;
  border: 2px solid var(--line);
  background: var(--card);
  border-radius: 14px;
  padding: 12px 14px;
  text-align: left;
}
.choice:hover { border-color: #d3ccbe; }
.choice .badge { width: 40px; height: 40px; }
.choice strong { display: block; }
.choice span { font-size: 13px; color: var(--ink-soft); }

/* ---------- Categories, photos, exact location ---------- */
.search .locate {
  flex: none;
  width: 40px; height: 40px;
  margin-right: 5px;
  border: 0;
  border-radius: 50%;
  background: var(--going-soft);
  display: grid; place-items: center;
}
.search .locate svg { width: 20px; height: 20px; margin: 0; fill: none; stroke: var(--going); stroke-width: 2; stroke-linecap: round; }
.cat-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 26px;
  max-width: 170px;
  background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5 6 7.5 9 4.5' fill='none' stroke='%2366706f' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 9px center / 12px;
}
.cat-select.active { background-color: var(--want-soft); border-color: var(--want); }

.hero.has-photo {
  height: 190px;
  background-size: cover;
  background-position: center;
  cursor: pointer;
  position: relative;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
.hero-count {
  position: absolute;
  top: 10px; right: 10px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 12px;
  background: rgba(0, 0, 0, 0.45);
  padding: 3px 9px;
  border-radius: 999px;
  text-shadow: none;
}
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.photo-thumb, .photo-add {
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  background: #efebe3;
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-add {
  border: 2px dashed #d8d1c3;
  background: var(--card);
  color: var(--ink-soft);
  font-size: 13px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.photo-add b { font-size: 24px; line-height: 1; color: var(--going); }

.coords {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 6px 6px 12px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 14px;
}
.toggle {
  display: flex; gap: 10px; align-items: flex-start;
  margin-top: 12px;
  padding: 10px 12px;
  background: #f4f1ea;
  border-radius: 12px;
  cursor: pointer;
}
.toggle input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--going); flex: none; }
.toggle small { display: block; color: var(--ink-soft); font-size: 12px; margin-top: 2px; }

.adjust-bar {
  position: absolute;
  left: 14px; right: 14px; bottom: 34px;
  max-width: 460px;
  margin: 0 auto;
  display: flex; align-items: center; gap: 12px; justify-content: space-between;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 14px;
  font-size: 14px;
  z-index: 3;
}
.adjust-bar span { font-size: 12px; color: var(--ink-soft); }
.pin.adjusting { cursor: grab; }
.pin.adjusting span { transform: rotate(-45deg) scale(1.4); box-shadow: 0 0 0 6px rgba(42, 157, 154, 0.25), 0 3px 8px rgba(0, 0, 0, 0.3); }

/* Full-screen photo viewer */
.viewer {
  position: fixed; inset: 0;
  background: rgba(15, 18, 19, 0.94);
  z-index: 30;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  touch-action: none; /* the page handles pinch and drag itself here */
  overscroll-behavior: contain;
}
#viewer-img {
  max-width: 100%;
  max-height: calc(100% - 120px);
  object-fit: contain;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  cursor: zoom-in;
}
#viewer-img.ease { transition: transform 0.2s ease; }
.viewer.zoomed #viewer-img { cursor: grab; }
.viewer.zoomed.dragging #viewer-img { cursor: grabbing; }
.viewer button { color: #fff; }
/* Buttons stay above a zoomed photo, and stay readable over bright photos. */
.v-zoom, .v-close, .v-nav, .v-bar { z-index: 1; }
.v-zoom button, .v-close, .v-nav, .viewer .v-bar .btn, .v-bar span {
  background: rgba(30, 33, 35, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.28);
}
.v-zoom {
  position: absolute; top: calc(12px + env(safe-area-inset-top)); left: 12px;
  display: flex; gap: 8px;
}
.v-zoom button {
  width: 42px; height: 42px; border-radius: 50%;
  font-size: 24px; line-height: 1;
}
.v-zoom button:disabled { color: rgba(255, 255, 255, 0.35); }
.v-close {
  position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 12px;
  width: 42px; height: 42px; border-radius: 50%;
  font-size: 24px; line-height: 1;
}
.v-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 46px; height: 46px; border-radius: 50%;
  font-size: 30px; line-height: 1;
}
.v-prev { left: 12px; }
.v-next { right: 12px; }
.v-bar {
  position: absolute; left: 0; right: 0; bottom: calc(14px + env(safe-area-inset-bottom));
  display: flex; align-items: center; justify-content: center; gap: 14px;
  color: #e9e6df; font-size: 14px;
  padding: 0 16px;
}
.v-bar .btn { color: #fff; }
.v-bar span {
  padding: 5px 12px; border-radius: 999px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}

/* ---------- Map texture ---------- */
/* A very light paper grain over the map. Pins sit above it. */
.grain {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: multiply;
  opacity: 0.55;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.35 0 0 0 0 0.33 0 0 0 0 0.28 0 0 0 0.12 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.maplibregl-marker { z-index: 2; }

/* ---------- Trip planner ---------- */
.seg {
  display: flex; gap: 4px;
  margin: 12px -4px 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.seg::-webkit-scrollbar { display: none; }
.seg button {
  flex: 1 0 auto;
  border: 0; border-radius: 999px;
  background: #efebe3;
  padding: 6px 11px;
  font-size: 13px; font-weight: 600;
  color: var(--ink-soft);
  white-space: nowrap;
}
.seg button.on { background: var(--going); color: #fff; }
.seg i {
  font-style: normal; font-size: 11px;
  margin-left: 5px; padding: 0 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
}
.seg button.on i { background: rgba(255, 255, 255, 0.25); }

.tip, .hint { font-size: 13px; color: var(--ink-soft); }
.tip { background: var(--going-soft); border-radius: 12px; padding: 10px 12px; color: var(--ink); margin: 0 0 12px; }
.hint { margin: -6px 0 14px; }
.warn { color: #b8402c; font-size: 13px; }
.t-sub.warn { color: #b8402c; }
.pill {
  display: inline-block;
  font-size: 11px; font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--going-soft); color: #1d6f6d;
  white-space: nowrap;
}
.pill.tobook { background: var(--want-soft); color: #946d10; }
.pill.cancelled { background: #efebe3; color: var(--ink-soft); }
.plan-toggle { margin: 0 0 14px; }
.card .plan-toggle { margin: 4px 0 0; }

.plan-day { padding: 10px 12px 12px; }
.plan-day .day-head { align-items: center; flex-wrap: wrap; }
.day-edit { margin-left: auto; width: 28px; height: 28px; color: var(--ink-soft); }
.day-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 2px 0 6px; font-size: 13px; color: var(--ink-soft); }
.day-meta label { display: flex; align-items: center; gap: 6px; }
.day-meta input { border: 1px solid var(--line); border-radius: 8px; padding: 3px 6px; background: #fff; font-size: 14px; }
.day-meta .sleep {
  border: 1px dashed #d8d1c3; background: none; border-radius: 8px;
  padding: 4px 8px; font-size: 13px; color: var(--ink-soft);
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.prow {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 8px 0;
  border-top: 1px dashed var(--line);
}
.ptime { width: 66px; flex: none; font-size: 13px; line-height: 1.3; }
.ptime b { display: block; font-weight: 600; }
.ptime span { color: var(--ink-soft); font-size: 12px; }
.pmain { flex: 1; min-width: 0; }
.pname {
  display: block; width: 100%;
  border: 0; background: none; padding: 0;
  text-align: left; font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.psub { font-size: 12px; color: var(--ink-soft); margin-top: 1px; }
.pmove { display: flex; gap: 4px; flex: none; }
.pmove .icon-btn { width: 28px; height: 28px; }
.gap-row { font-size: 12px; color: var(--going); padding: 2px 0 2px 76px; border-top: 1px dashed var(--line); }
.day-foot { font-size: 13px; color: var(--ink-soft); border-top: 1px solid var(--line); padding-top: 8px; margin-top: 2px; }
.day-foot:empty { display: none; }

.warn-list { padding: 6px 14px; }
.warn-item, .iti-row, .money-line {
  display: block; width: 100%;
  border: 0; background: none; text-align: left;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.warn-item:last-child, .iti-row:last-child { border-bottom: 0; }
.warn-item { color: #b8402c; }
.warn-item b { color: var(--ink); font-weight: 600; }
.iti { padding: 4px 14px; }
.iti-row { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; }
.iti-day { font-weight: 600; }
.iti-city { text-align: right; color: var(--ink-soft); }
.iti-sub { grid-column: 1 / -1; font-size: 12px; color: var(--ink-soft); }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-weight: 600; color: var(--ink-soft); padding: 0 4px 6px; }
.tbl td { padding: 6px 4px; border-top: 1px solid var(--line); }
.tbl th:not(:first-child), .tbl td:not(:first-child) { text-align: right; }

.label-line { display: block; font-size: 13px; font-weight: 600; color: var(--ink-soft); margin: 2px 0 6px; }
.rate-row {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 8px 0; border-top: 1px solid var(--line);
  font-size: 14px;
}
.rate-row input {
  width: 84px;
  border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 8px; font-size: 16px; background: #fff;
}
.rate-row .btn { margin-left: auto; }
.rate-row small { flex-basis: 100%; color: var(--ink-soft); font-size: 12px; }
.money-line { position: relative; display: flex; align-items: baseline; gap: 10px; }
.money-line span { flex: 1; min-width: 0; }
.money-line small { display: block; font-size: 12px; color: var(--ink-soft); }
.money-line i { position: absolute; left: 0; bottom: -1px; height: 3px; border-radius: 3px; background: var(--going); opacity: 0.55; }
.card .money-line:last-child { border-bottom: 0; }
.all-costs { margin-top: 16px; }
.all-costs summary { cursor: pointer; font-weight: 600; }
.progress.going > div { background: var(--going); }
.progress.over > div { background: #b8402c; }

.check-list { padding: 4px 12px; }
.check-row { display: flex; align-items: flex-start; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.check-row:last-child { border-bottom: 0; }
.check {
  width: 24px; height: 24px; flex: none;
  border-radius: 7px; border: 2px solid #d3ccbe;
  background: #fff; color: #fff;
  font-size: 14px; line-height: 1; padding: 0;
}
.check-row.done .check { background: var(--going); border-color: var(--going); }
.check-text { flex: 1; min-width: 0; border: 0; background: none; padding: 1px 0 0; text-align: left; font-size: 14px; }
.check-row.done .check-text { color: var(--ink-soft); text-decoration: line-through; }
.check-text small { display: block; font-size: 12px; color: var(--ink-soft); text-decoration: none; }
.add-row { display: flex; gap: 6px; }
.add-row input, .add-row select {
  border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 10px; background: #fff; font-size: 16px;
}
.add-row input { flex: 1; min-width: 0; }
.add-row select { max-width: 120px; font-size: 14px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14px;
  z-index: 40;
  box-shadow: var(--shadow);
  max-width: calc(100vw - 32px);
  text-align: center;
}

/* MapLibre tweaks */
.maplibregl-ctrl-attrib { font-size: 11px; }
.maplibregl-ctrl-group { border-radius: 12px !important; box-shadow: var(--shadow) !important; }

/* ---------- Phones and small tablets ---------- */
@media (max-width: 899px) {
  #app { display: block; }
  .side {
    position: fixed;
    inset: 0;
    border-right: 0;
    background: transparent;
    pointer-events: none;
  }
  .side > * { pointer-events: auto; }
  .brand {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: calc(var(--top-h) + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 14px 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    z-index: 5;
  }
  .logo { width: 26px; height: 26px; }
  .brand-name { font-size: 20px; }
  .tabs {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    height: calc(var(--tabs-h) + env(safe-area-inset-bottom));
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: var(--paper);
    border-top: 1px solid var(--line);
    border-bottom: 0;
    z-index: 5;
  }
  .tab.active { background: none; color: var(--ink); }
  .tab.active svg { stroke: var(--going); }
  .panel {
    position: fixed;
    top: calc(var(--top-h) + env(safe-area-inset-top));
    bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom));
    left: 0; right: 0;
    background: var(--paper);
    padding: 16px 16px 28px;
    z-index: 4;
  }
  body.on-map .panel { display: none; }

  .map-wrap {
    position: fixed;
    top: calc(var(--top-h) + env(safe-area-inset-top));
    bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom));
    left: 0; right: 0;
  }
  .map-tools { top: 10px; left: 10px; right: 10px; max-width: none; }
  .map-hint { display: none; }
  .adjust-bar { bottom: 14px; left: 10px; right: 10px; flex-wrap: wrap; }
  .stop { flex-wrap: wrap; justify-content: flex-end; }
  .stop .s-name { flex-basis: 100%; }
  .seg button { padding: 6px 9px; font-size: 12.5px; }

  .sheet {
    top: auto;
    left: 0; right: 0; bottom: 0;
    width: auto;
    max-width: none;
    max-height: 88vh;
    max-height: 88dvh;
    border-radius: 20px 20px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .sheet-head::before {
    content: "";
    position: absolute;
    top: 6px; left: 50%;
    width: 40px; height: 4px;
    margin-left: -20px;
    border-radius: 2px;
    background: #ddd6c8;
  }
  .toast { bottom: calc(var(--tabs-h) + 16px + env(safe-area-inset-bottom)); }
}

@media (min-width: 900px) {
  /* On big screens the map and sidebar stay usable while the place page is open. */
  .backdrop { display: none !important; }
  /* The trip planner gets a little more room. */
  .sheet.wide { width: 540px; }
}

/* ---------- Sharing some places ---------- */
.share-sum {
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--going-soft);
  border-radius: 12px;
}
.share-names { font-size: 13px; color: var(--ink-soft); margin-top: 4px; }

/* ---------- Places grouped by country, then city ---------- */
.group + .group { border-top: 1px solid var(--line); }
.group-head {
  display: flex; align-items: center; gap: 8px;
  width: 100%; text-align: left;
  background: none; border: 0;
  padding: 10px 2px;
  font-family: var(--font-head); font-size: 16px; color: var(--ink);
}
.group-head.city {
  padding: 6px 2px 6px 20px;
  font-family: inherit; font-size: 14px; font-weight: 600; color: var(--ink-soft);
}
.group-head .caret { width: 12px; font-size: 12px; color: var(--ink-soft); flex: none; }
.group-head .flag { font-size: 18px; line-height: 1; flex: none; }
.group-head .g-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-head .g-count {
  margin-left: auto; flex: none;
  font-family: inherit; font-size: 12px; font-weight: 600; color: var(--ink-soft);
  background: #efebe3; border-radius: 999px; padding: 1px 8px;
}
.group-body { padding-bottom: 10px; }
.group-body .place-list + .group-head { margin-top: 6px; }

/* ---------- Where Mapt saves ---------- */
.choice.on { border-color: var(--going); }
.choice:disabled { opacity: 0.6; cursor: default; }
.badge.plain { background: #f4f1ea; font-size: 18px; }
/* After a reload, asks for your OK to open your Mapt folder again. */
.folder-bar {
  position: fixed; top: 12px; left: 12px; right: 12px;
  max-width: 460px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px; justify-content: space-between;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 14px;
  font-size: 14px;
  z-index: 25;
}
.folder-bar span { display: block; font-size: 12px; color: var(--ink-soft); }
.folder-bar .btn { white-space: nowrap; }

/* ---------- Print or save as PDF ---------- */
.toggle.nested { margin: 6px 0 0 30px; background: transparent; border: 1px solid var(--line); padding: 8px 12px; }
.print-help { margin-top: 16px; font-size: 14px; }
.print-help ul { margin: 8px 0 10px; padding-left: 18px; }
.print-help li { margin-bottom: 4px; }

/* The reports are built in #print-area, which only shows when printing. */
.print-area { display: none; }
@page {
  margin: 16mm 13mm 16mm;
  @top-left { font: 8pt "Inter", system-ui, sans-serif; color: #555; }
  @bottom-left { font: 8pt "Inter", system-ui, sans-serif; color: #555; }
  @bottom-right { font: 8pt "Inter", system-ui, sans-serif; color: #555; }
}
@media print {
  html, body { height: auto; overflow: visible; background: #fff; }
  #app { display: none !important; }
  .print-area { display: block; color: #000; font-size: 9.5pt; line-height: 1.35; }
  .print-area h1 { font-size: 20pt; line-height: 1.15; }
  .print-area h2 { font-size: 12.5pt; margin: 14pt 0 4pt; break-after: avoid; }
  .print-area h3 { font-size: 10pt; margin: 8pt 0 3pt; break-after: avoid; }
  .print-area p { margin: 4pt 0; }
  .print-area small { display: block; font-size: 8pt; color: #444; }
  .r-report + .r-report { break-before: page; }
  .r-head { border-bottom: 2px solid #000; padding-bottom: 6pt; margin-bottom: 4pt; }
  .r-kind { font-size: 8pt; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: #444; }
  .r-sub { color: #333; margin-top: 2pt; }
  .r-small { font-size: 8pt; color: #444; }
  .r-empty { color: #444; font-style: italic; }

  .r-tbl { width: 100%; border-collapse: collapse; margin-top: 4pt; }
  .r-tbl th {
    text-align: left; font-size: 7.5pt; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
    color: #333; border-bottom: 1.2pt solid #000; padding: 2pt 6pt 2pt 0;
  }
  .r-tbl td { border-bottom: 0.5pt solid #bbb; padding: 2.5pt 6pt 2.5pt 0; vertical-align: top; }
  .r-tbl tr { break-inside: avoid; }
  .r-tbl tfoot td { border-bottom: 0; border-top: 1.2pt solid #000; }
  .r-num { text-align: right; white-space: nowrap; }
  .r-tbl th.r-num { text-align: right; }
  .r-nowrap { white-space: nowrap; }
  .r-name { font-weight: 600; }
  .r-type { color: #444; }

  /* Itinerary */
  /* A day can run onto the next page, but its heading always stays with its first stops. */
  .r-day h2 { margin-top: 16pt; }
  .r-meta { color: #333; margin-bottom: 2pt; break-after: avoid; }
  .r-plan { font-size: 9pt; line-height: 1.25; }
  .r-plan td { padding-top: 1.8pt; padding-bottom: 1.8pt; }
  .r-plan td:first-child { width: 18%; }
  .r-plan td:nth-child(3) { width: 10%; }
  .r-plan td:nth-child(4) { width: 20%; }
  .r-step td { color: #444; font-size: 8pt; padding-top: 1.2pt; padding-bottom: 1.2pt; }
  .r-step .r-name { font-weight: 400; }
  .r-gap td { color: #555; font-size: 8pt; font-style: italic; padding: 1pt 0; border-bottom-style: dotted; }
  .r-more { font-size: 8pt; color: #333; margin-top: 1pt; }
  .r-note { white-space: pre-line; font-style: italic; }
  .r-foot { margin-top: 3pt; font-size: 8.5pt; font-style: italic; color: #333; }
  .r-foot b { display: block; font-style: normal; color: #000; }

  /* Bookings */
  .r-attn { border: 1.5pt solid #000; border-radius: 4pt; padding: 6pt 9pt; margin: 10pt 0; break-inside: avoid; }
  .r-attn-title { font-weight: 700; margin-bottom: 2pt; }
  .r-book { font-size: 8.5pt; margin-top: 10pt; }
  .r-book th:nth-child(1) { width: 13%; }
  .r-book th:nth-child(2) { width: 25%; }
  .r-book th:nth-child(3) { width: 17%; }
  .r-book th:nth-child(4) { width: 14%; }
  .r-book th:nth-child(5) { width: 10%; }
  .r-book th:nth-child(6) { width: 10%; }
  .r-book td { overflow-wrap: anywhere; }
  .r-cancelled td { color: #666; text-decoration: line-through; }
  .r-notes-row td { font-size: 8pt; color: #333; font-style: italic; padding-top: 0; }
  .r-tbl tr:has(+ .r-notes-row) td { border-bottom: 0; }
  .r-stats { display: flex; gap: 8pt; margin: 12pt 0 6pt; break-inside: avoid; }
  .r-stat { flex: 1; border: 1pt solid #000; border-radius: 4pt; padding: 5pt 8pt; }
  .r-stat span { display: block; font-size: 7.5pt; text-transform: uppercase; letter-spacing: 0.06em; color: #333; }
  .r-stat b { font-size: 14pt; }

  /* To do and to buy */
  .r-cols { columns: 2; column-gap: 18pt; }
  .r-group { break-inside: avoid; }
  .r-check { display: flex; gap: 6pt; align-items: flex-start; padding: 2.5pt 0; break-inside: avoid; }
  .r-box { flex: none; width: 9pt; height: 9pt; border: 1pt solid #000; border-radius: 1.5pt; margin-top: 1.5pt; }
  .r-late { font-weight: 700; color: #000; }

  /* Budget */
  .r-bar { height: 8pt; border: 1pt solid #000; border-radius: 4pt; overflow: hidden; margin-top: 8pt; }
  .r-bar div { height: 100%; background: #555; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .r-money { max-width: 100%; }
}
