:root {
  --paper: #f6f3eb;
  --panel: #fbfaf6;
  --ink: #18332e;
  --muted: #68736e;
  --line: #dedfd8;
  --soft: #ecece5;
  --moss: #174c42;
  --sage: #6f8e7f;
  --mint: #dfeae3;
  --amber: #c87338;
  --blue: #416d91;
  --shadow: 0 18px 50px rgba(24, 51, 46, 0.13);
  --radius: 18px;
  --font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.skip-link {
  position: fixed;
  z-index: 9999;
  left: 12px;
  top: -60px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--ink);
  color: white;
  transition: top 160ms ease;
}
.skip-link:focus { top: 12px; }

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 430px;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
}

.map-pane { position: relative; min-width: 0; background: #dfe6df; }
#map { width: 100%; height: 100%; z-index: 1; }

.leaflet-control-attribution {
  padding: 3px 7px !important;
  background: rgba(251, 250, 246, 0.86) !important;
  color: #64716b !important;
  font-size: 10px !important;
}
.leaflet-control-attribution a { color: var(--moss) !important; }
.leaflet-control-zoom { border: 0 !important; box-shadow: 0 6px 18px rgba(24, 51, 46, .12) !important; }
.leaflet-control-zoom a { border-color: var(--line) !important; color: var(--ink) !important; background: rgba(251, 250, 246, .95) !important; }

.glass {
  background: rgba(251, 250, 246, 0.91);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 30px rgba(24, 51, 46, 0.12);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.map-header {
  position: absolute;
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  top: 18px;
  left: 18px;
  padding: 10px 15px 10px 10px;
  border-radius: 16px;
}
.trip-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--moss);
  color: #f9f3e6;
  font-family: Georgia, serif;
  font-size: 21px;
}
.map-header h1 { margin: 1px 0 0; font-family: Georgia, "Times New Roman", serif; font-weight: 500; font-size: 19px; letter-spacing: -.2px; }
.eyebrow { margin: 0; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }

.map-actions {
  position: absolute;
  z-index: 500;
  top: 18px;
  right: 18px;
  display: flex;
  gap: 5px;
  padding: 5px;
  border-radius: 14px;
}
.icon-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease, transform 150ms ease;
}
.icon-button:hover { background: var(--soft); }
.icon-button:active { transform: scale(.95); }
.icon-button svg { width: 18px; height: 18px; }

.route-legend {
  position: absolute;
  z-index: 500;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  display: flex;
  gap: 3px;
  padding: 5px;
  border-radius: 14px;
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 11px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}
.legend-item.active { background: white; color: var(--ink); box-shadow: 0 2px 8px rgba(24,51,46,.08); }
.legend-line { display: block; width: 16px; height: 2px; border-radius: 2px; background: var(--ink); }
.legend-line.train { background: var(--amber); }
.legend-line.car { background: var(--moss); }
.legend-line.walk { border-top: 2px dotted var(--sage); background: transparent; }
.legend-line.flight { border-top: 2px dashed var(--blue); background: transparent; }
.legend-line.all { background: var(--sage); }

.mobile-sheet-handle { display: none; }
.mobile-map-jump { display: none; }
.mobile-map-expand { display: none; }
.map-mode-bar {
  position: absolute;
  z-index: 650;
  top: 76px;
  left: 50%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(380px, calc(100% - 32px));
  padding: 8px 8px 8px 12px;
  border-radius: 14px;
  transform: translateX(-50%);
}
.map-mode-bar[hidden] { display: none; }
.map-mode-copy { display: grid; min-width: 0; }
.map-mode-copy small { color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.map-mode-copy strong { overflow: hidden; margin-top: 1px; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.optional-choice-bar {
  position: absolute;
  z-index: 640;
  top: 138px;
  left: 50%;
  display: flex;
  gap: 5px;
  width: min(380px, calc(100% - 32px));
  padding: 5px;
  border-radius: 14px;
  transform: translateX(-50%);
}
.optional-choice-bar[hidden] { display: none; }
.optional-choice-bar button { display: inline-flex; flex: 1; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 9px; border: 0; border-radius: 10px; background: white; color: var(--moss); font-size: 10px; font-weight: 800; cursor: pointer; }
.optional-choice-bar button:first-child { background: var(--moss); color: white; }
.optional-choice-bar svg { width: 14px; height: 14px; }

.side-panel {
  position: relative;
  z-index: 600;
  display: flex;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  flex-direction: column;
  background: var(--panel);
  border-left: 1px solid rgba(24, 51, 46, .1);
  box-shadow: -18px 0 50px rgba(24,51,46,.07);
}

.panel-head { position: relative; z-index: 5; flex: none; padding: 24px 24px 0; border-bottom: 1px solid var(--line); background: var(--panel); }
.panel-title-row { display: flex; align-items: center; justify-content: space-between; }
.panel-title-row h2 { margin: 2px 0 0; font-family: Georgia, "Times New Roman", serif; font-size: 30px; font-weight: 500; letter-spacing: -.5px; }
.panel-head-actions { display: flex; align-items: center; gap: 4px; }
.panel-settings { color: var(--muted); }
.panel-settings:hover, .panel-settings.active { background: var(--mint); color: var(--moss); }
.mobile-close { display: none; }

.view-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; margin-top: 20px; }
.tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 7px 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  min-width: 0;
}
.tab::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; border-radius: 2px; background: transparent; }
.tab.active { color: var(--moss); }
.tab.active::after { background: var(--moss); }
.tab svg { width: 16px; height: 16px; }
.tab b { min-width: 18px; padding: 1px 5px; border-radius: 99px; background: var(--mint); font-size: 10px; }

.panel-body { min-height: 0; height: 0; flex: 1 1 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #bdc5bf transparent; -webkit-overflow-scrolling: touch; touch-action: pan-y; }
.panel-body:focus-visible { outline: 2px solid rgba(23,76,66,.28); outline-offset: -2px; }
.view { display: none; padding: 18px 22px 40px; }
.view.active { display: block; }

.overview-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
}
.overview-copy { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.overview-copy span + span::before { content: "·"; margin-right: 7px; color: #a5afa9; }
.overview-copy .status-dot { width: 7px; height: 7px; border-radius: 50%; background: #82a38d; }
.overview-copy .status-dot::before { content: none; }
.text-button { display: inline-flex; align-items: center; gap: 5px; padding: 0; border: 0; background: transparent; color: var(--moss); font-size: 11px; font-weight: 750; cursor: pointer; white-space: nowrap; }
.text-button svg { width: 14px; height: 14px; }
.text-button.muted { color: var(--muted); }

.day-strip {
  display: flex;
  gap: 7px;
  margin: 18px -22px 0;
  padding: 0 22px 10px;
  overflow-x: auto;
  scrollbar-width: none;
}
.day-strip::-webkit-scrollbar { display: none; }
.day-button {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 48px;
  height: 55px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: white;
  color: var(--muted);
  cursor: pointer;
  transition: 150ms ease;
}
.day-button span { font-size: 9px; font-weight: 750; text-transform: uppercase; }
.day-button b { font-size: 15px; font-weight: 700; }
.day-button:hover { border-color: #b6c8bc; }
.day-button.active { border-color: var(--moss); background: var(--moss); color: white; box-shadow: 0 6px 16px rgba(23,76,66,.2); }

.timeline { padding-top: 14px; }
.day-header { display: flex; align-items: flex-end; justify-content: space-between; margin: 5px 2px 17px; }
.day-header h3 { margin: 1px 0 0; font-family: Georgia, serif; font-size: 21px; font-weight: 500; }
.day-city { padding: 5px 8px; border-radius: 8px; background: var(--mint); color: var(--moss); font-size: 10px; font-weight: 750; }
.timeline-entry { display: grid; grid-template-columns: 52px 24px minmax(0,1fr); min-height: 86px; }
.entry-time { padding-top: 2px; color: var(--muted); font-size: 10px; font-weight: 700; line-height: 1.3; }
.entry-time span { display: block; font-weight: 500; }
.timeline-track { position: relative; display: flex; justify-content: center; }
.timeline-track::after { content: ""; position: absolute; z-index: 0; top: 22px; bottom: 0; width: 1px; background: var(--line); }
.timeline-entry:last-child .timeline-track::after { display: none; }
.entry-icon { position: relative; z-index: 1; display: grid; place-items: center; width: 22px; height: 22px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); color: var(--moss); }
.entry-icon svg { width: 12px; height: 12px; }
.entry-icon.train { color: var(--amber); border-color: #e8c5a8; background: #fff8f2; }
.entry-icon.flight { color: var(--blue); border-color: #bfd0de; background: #f4f8fb; }
.entry-icon.stay { color: var(--moss); border-color: #b7cfc2; background: var(--mint); }
.entry-icon.optional { color: #7a6c61; background: #f6f1ec; }
.entry-card { position: relative; margin: 0 0 12px 8px; padding: 0 34px 14px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.timeline-entry:last-child .entry-card { border-bottom: 0; }
.entry-title { display: flex; align-items: center; gap: 7px; margin: 0; font-size: 13px; font-weight: 760; }
.entry-card p { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.entry-badge { display: inline-block; padding: 2px 6px; border-radius: 6px; background: var(--mint); color: var(--moss); font-size: 8px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.entry-badge.optional { background: #eee8e2; color: #78695f; }
.entry-badge.target { background: #edf3f0; color: #4e7468; }
.entry-badge.policy { background: #e4f0ea; color: #356354; }
.entry-badge.covered { background: #e8edf5; color: #496583; }
.entry-badge.confirm { background: #f8e7d8; color: #9a5526; }
.entry-map-link { position: absolute; top: -8px; right: -7px; display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; }
.entry-map-link:hover { color: var(--moss); background: var(--soft); }
.entry-map-link svg { width: 15px; height: 15px; }

.pitstop-panel { margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--line); cursor: default; }
.pitstop-head { display: grid; grid-template-columns: 29px minmax(0,1fr); gap: 8px; align-items: center; margin-bottom: 4px; }
.pitstop-head > span { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 9px; background: #eef3e8; color: #58713d; }
.pitstop-head svg { width: 14px; height: 14px; }
.pitstop-head div { display: grid; }
.pitstop-head b { font-size: 10px; }
.pitstop-head small { color: var(--muted); font-size: 8px; }
.pitstop-list { display: grid; }
.pitstop-item { position: relative; display: grid; grid-template-columns: 29px minmax(0,1fr) auto; gap: 8px; align-items: center; min-height: 58px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.pitstop-item:last-child { border-bottom: 0; }
.pitstop-item.is-added { margin: 3px -5px; padding: 8px 5px; border: 1px solid #c9d8ce; border-radius: 10px; background: #f2f7f3; }
.pitstop-symbol { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 9px; background: #eef3e8; color: #58713d; }
.pitstop-symbol.cafe { background: #f1e6d9; color: #8b5c32; }
.pitstop-symbol.mart { background: #e8eef5; color: #4e6985; }
.pitstop-symbol.food.veg { background: #e7f0e6; color: #3f7044; }
.pitstop-symbol.food.local { background: #f7e7e1; color: #a24e38; }
.pitstop-symbol svg { width: 13px; height: 13px; }
.pitstop-copy { display: grid; min-width: 0; }
.pitstop-copy > small { color: var(--sage); font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.pitstop-diet { display: inline-block; margin-left: 3px; padding: 2px 5px; border-radius: 999px; font-size: 7px; font-style: normal; letter-spacing: .03em; vertical-align: 1px; }
.pitstop-diet.veg { background: #edf3ec; color: #346538; }
.pitstop-diet.local { background: #f7e7e1; color: #984932; }
.pitstop-copy > b { overflow: hidden; margin-top: 1px; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.pitstop-copy > span { display: -webkit-box; overflow: hidden; margin-top: 2px; color: var(--muted); font-size: 8px; line-height: 1.35; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pitstop-open-hit, .place-open-hit { position: absolute; z-index: 1; inset: 0; border: 0; border-radius: inherit; background: transparent; cursor: pointer; }
.pitstop-open-hit:focus-visible, .place-open-hit:focus-visible { outline: 2px solid var(--moss); outline-offset: 2px; }
.pitstop-action { position: relative; z-index: 2; display: inline-flex; align-items: center; justify-content: center; gap: 3px; min-width: 49px; min-height: 30px; padding: 0 7px; border: 1px solid var(--moss); border-radius: 7px; background: var(--moss); color: white; font-size: 9px; font-weight: 800; cursor: pointer; }
.pitstop-action.added { border-color: #bfd0c6; background: white; color: var(--moss); }
.pitstop-action svg { width: 11px; height: 11px; }
.pitstop-note { margin: 4px 0 0 !important; color: #8a918d !important; font-size: 7px !important; }
.optional-panel { display: grid; gap: 7px; }
.optional-pick {
  display: grid;
  grid-template-columns: 32px minmax(0,1fr) 18px;
  gap: 9px;
  align-items: center;
  width: 100%;
  min-height: 66px;
  padding: 9px 8px;
  border: 1px dashed #91aa9a;
  border-radius: 11px;
  background: #f8faf7;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.optional-pick:hover { border-color: var(--moss); background: var(--mint); }
.optional-pick-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: white; color: var(--moss); }
.optional-pick-icon svg, .optional-pick-arrow svg { width: 14px; height: 14px; }
.optional-pick-copy { display: grid; min-width: 0; }
.optional-pick-copy small { color: var(--sage); font-size: 8px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.optional-pick-copy b { margin-top: 2px; font-size: 10px; }
.optional-pick-copy em { margin-top: 2px; color: var(--muted); font-size: 8px; font-style: normal; }
.optional-pick-arrow { color: var(--moss); }
.pitstop-added { display: grid; }
.pitstop-added-label { margin: 3px 0 0; color: var(--muted); font-size: 8px; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }

.travel-connector { display: grid; grid-template-columns: 27px minmax(0,1fr) auto; gap: 8px; align-items: center; margin: -4px 0 10px 60px; padding: 7px 9px; border-left: 1px dashed #b9c6bf; color: var(--muted); }
.travel-connector > span { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 8px; background: var(--soft); color: var(--moss); }
.travel-connector svg { width: 13px; height: 13px; }
.travel-connector div { display: grid; }
.travel-connector b { color: var(--ink); font-size: 9px; }
.travel-connector small { font-size: 8px; }
.travel-connector a { padding: 6px 0 6px 6px; color: var(--moss); font-size: 8px; font-weight: 800; text-decoration: none; }

.stay-bridge {
  display: grid;
  grid-template-columns: 36px minmax(0,1fr) auto 16px;
  gap: 10px;
  align-items: center;
  width: calc(100% - 60px);
  margin: 6px 0 4px 60px;
  padding: 11px;
  border: 1px solid #bfd0c6;
  border-radius: 14px;
  background: #f3f7f3;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}
.stay-bridge:hover { border-color: var(--sage); transform: translateY(-1px); box-shadow: 0 7px 18px rgba(24,51,46,.07); }
.stay-bridge-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: white; color: var(--moss); }
.stay-bridge-icon svg { width: 17px; height: 17px; }
.stay-bridge-copy { display: grid; gap: 2px; min-width: 0; }
.stay-bridge-kicker { color: var(--sage); font-size: 8px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.stay-bridge-copy strong { overflow: hidden; font-size: 12px; font-weight: 760; text-overflow: ellipsis; white-space: nowrap; }
.stay-bridge-copy small { color: var(--muted); font-size: 9px; line-height: 1.35; }
.stay-bridge-status { padding: 3px 6px; border-radius: 6px; background: white; color: var(--moss); font-size: 8px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.stay-bridge-status.confirm { background: #f8e7d8; color: #9a5526; }
.stay-bridge-arrow { color: var(--moss); }
.stay-bridge-arrow svg { display: block; width: 15px; height: 15px; }

.food-plan { margin: 10px 0 14px 60px; padding: 13px; border: 1px solid var(--line); border-radius: 15px; background: #fffefa; }
.food-plan-head { display: grid; grid-template-columns: 32px minmax(0,1fr) auto; gap: 9px; align-items: center; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.food-plan-head > span { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: #eef3e8; color: #58713d; }
.food-plan-head svg { width: 15px; height: 15px; }
.food-plan-head h4 { margin: 1px 0 0; font-size: 12px; }
.food-plan-head small { color: var(--muted); font-size: 9px; }
.food-plan-list { display: grid; }
.food-plan-item { position: relative; display: grid; grid-template-columns: 48px 28px minmax(0,1fr) 25px; gap: 7px; align-items: center; min-height: 54px; padding: 8px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.food-plan-item:last-child { border-bottom: 0; }
.food-plan-item time { color: var(--muted); font-size: 9px; font-weight: 750; line-height: 1.2; }
.food-plan-symbol { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: #eef3e8; color: #58713d; }
.food-plan-symbol.cafe { background: #f1e6d9; color: #8b5c32; }
.food-plan-symbol.mart { background: #e8eef5; color: #4e6985; }
.food-plan-symbol.stay, .food-plan-symbol.transport { background: #e7efed; color: var(--moss); }
.food-plan-symbol svg { width: 13px; height: 13px; }
.food-plan-copy { display: grid; gap: 2px; min-width: 0; }
.food-plan-copy b { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.food-plan-copy small { color: var(--muted); font-size: 9px; line-height: 1.35; }
.food-save, .food-remove { display: grid; place-items: center; width: 25px; height: 25px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.food-save.saved { color: var(--amber); }
.food-save svg, .food-remove svg { width: 13px; height: 13px; }
.food-remove { position: absolute; top: 2px; right: -9px; width: 20px; height: 20px; background: white; color: #92786a; box-shadow: 0 2px 6px rgba(24,51,46,.08); }
.food-plan-item:has(.food-remove) { padding-right: 13px; }
.food-plan-note { margin: 7px 0 0; padding-top: 8px; border-top: 1px solid var(--line); color: var(--muted); font-size: 8px; line-height: 1.4; }

.search-box {
  display: grid;
  grid-template-columns: 20px minmax(0,1fr) 30px;
  align-items: center;
  gap: 6px;
  height: 46px;
  padding: 0 10px 0 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: white;
}
.search-box:focus-within { border-color: var(--sage); box-shadow: 0 0 0 3px rgba(111,142,127,.12); }
.search-box > svg { width: 17px; height: 17px; color: var(--muted); }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12px; }
.search-box input::-webkit-search-cancel-button { display: none; }
.clear-search { display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; opacity: 0; pointer-events: none; }
.clear-search.visible { opacity: 1; pointer-events: auto; }
.clear-search svg { width: 14px; height: 14px; }

.city-chips, .category-chips { display: flex; gap: 7px; margin-top: 12px; overflow-x: auto; scrollbar-width: none; }
.city-chips::-webkit-scrollbar, .category-chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; padding: 7px 11px; border: 1px solid var(--line); border-radius: 999px; background: white; color: var(--muted); font-size: 10px; font-weight: 700; cursor: pointer; }
.chip.active { border-color: var(--moss); background: var(--moss); color: white; }
.category-chips { margin-top: 8px; }
.category-chips .chip { border-color: transparent; background: var(--soft); }
.category-chips .chip.active { background: var(--mint); color: var(--moss); }

.explore-intro, .saved-heading { display: flex; align-items: center; justify-content: space-between; margin: 22px 2px 11px; }
.explore-intro h3, .saved-heading h3 { margin: 2px 0 0; font-family: Georgia, serif; font-size: 20px; font-weight: 500; }
.round-add { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; background: white; color: var(--moss); font-size: 21px; line-height: 1; cursor: pointer; }
.round-add:hover { border-color: var(--sage); background: var(--mint); }

.place-list { display: grid; gap: 9px; }
.place-card {
  position: relative;
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0,1fr) 36px;
  gap: 10px;
  align-items: start;
  padding: 13px 11px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  cursor: pointer;
  transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}
.place-open-hit { border-radius: 14px; }
.place-card .heart-button { position: relative; z-index: 2; }
.place-card:hover { border-color: #bdcbbf; transform: translateY(-1px); box-shadow: 0 7px 18px rgba(24,51,46,.06); }
.place-category { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--mint); color: var(--moss); }
.place-category.cafe { background: #f1e6d9; color: #8b5c32; }
.place-category.food { background: #e8eee0; color: #58713d; }
.place-category.shopping { background: #ece8f2; color: #65577c; }
.place-category.mart { background: #e8eef5; color: #4e6985; }
.place-category.sight { background: #dfece9; color: #34675e; }
.place-category svg { width: 17px; height: 17px; }
.place-copy { min-width: 0; }
.place-copy h4 { margin: 0; font-size: 12px; font-weight: 780; }
.place-copy .zh { margin-left: 3px; color: var(--muted); font-size: 10px; font-weight: 500; }
.place-copy p { display: -webkit-box; margin: 4px 0 0; overflow: hidden; color: var(--muted); font-size: 10px; line-height: 1.45; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.place-meta { display: flex; align-items: center; gap: 6px; margin-top: 7px; color: #87918c; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.place-meta span + span::before { content: "·"; margin-right: 6px; }
.heart-button { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: #87918c; cursor: pointer; }
.heart-button:hover { background: var(--soft); color: var(--moss); }
.heart-button.saved { color: #a45448; background: #f5e9e5; }
.heart-button svg { width: 17px; height: 17px; }

.empty-state { display: none; padding: 54px 24px; text-align: center; }
.empty-state.visible { display: block; }
.empty-icon { display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 16px; background: var(--mint); color: var(--moss); }
.empty-icon svg { width: 22px; height: 22px; }
.empty-state h3 { margin: 0; font-family: Georgia, serif; font-size: 20px; font-weight: 500; }
.empty-state p { max-width: 270px; margin: 7px auto 18px; color: var(--muted); font-size: 11px; }
.primary-button, .secondary-button { min-height: 40px; padding: 0 15px; border-radius: 10px; font-size: 11px; font-weight: 750; cursor: pointer; }
.primary-button { border: 1px solid var(--moss); background: var(--moss); color: white; }
.secondary-button { border: 1px solid var(--line); background: white; color: var(--ink); }

.place-dialog { width: min(420px, calc(100% - 28px)); padding: 0; border: 1px solid rgba(24,51,46,.12); border-radius: 20px; background: var(--panel); color: var(--ink); box-shadow: var(--shadow); }
.place-dialog::backdrop { background: rgba(15, 30, 26, .38); backdrop-filter: blur(3px); }
.place-dialog form { padding: 22px; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.dialog-head h2 { margin: 2px 0 0; font-family: Georgia, serif; font-size: 25px; font-weight: 500; }
.place-dialog label { display: grid; gap: 6px; margin-top: 13px; color: var(--muted); font-size: 10px; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
.place-dialog input, .place-dialog select, .place-dialog textarea { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; outline: 0; background: white; color: var(--ink); font-size: 12px; font-weight: 500; text-transform: none; letter-spacing: 0; resize: vertical; }
.place-dialog input:focus, .place-dialog select:focus, .place-dialog textarea:focus { border-color: var(--sage); box-shadow: 0 0 0 3px rgba(111,142,127,.12); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.dialog-help { margin: -6px 0 14px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.form-error { margin: 12px 0 0; padding: 9px 10px; border-radius: 9px; background: #f9e9e4; color: #94452f; font-size: 10px; line-height: 1.45; }
.diet-field[hidden], .form-error[hidden] { display: none; }

.settings-hero { padding: 3px 2px 6px; }
.settings-hero h3 { margin: 3px 0 7px; font-family: Georgia, serif; font-size: 23px; font-weight: 500; }
.settings-hero > p:last-child { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.settings-card { margin-top: 13px; padding: 14px; border: 1px solid var(--line); border-radius: 15px; background: white; }
.settings-card-head { display: grid; grid-template-columns: 32px minmax(0,1fr); gap: 9px; align-items: center; }
.settings-card-head > span { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--mint); color: var(--moss); }
.settings-card-head svg { width: 15px; height: 15px; }
.settings-card-head div { display: grid; }
.settings-card-head b { font-size: 11px; }
.settings-card-head small { color: var(--muted); font-size: 8px; }
.pdf-drop { display: grid; place-items: center; min-height: 118px; margin-top: 13px; padding: 14px; border: 1px dashed #91aa9a; border-radius: 12px; background: #f8faf7; color: var(--moss); text-align: center; cursor: pointer; }
.pdf-drop:hover { border-color: var(--moss); background: var(--mint); }
.pdf-drop > svg { width: 20px; height: 20px; margin-bottom: 5px; }
.pdf-drop b { font-size: 11px; }
.pdf-drop small { max-width: 100%; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.pdf-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.settings-wide { width: 100%; margin-top: 10px; }
.settings-note { margin: 10px 0 0; color: var(--muted); font-size: 8px; line-height: 1.5; }
.settings-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 13px; }
.settings-actions.stacked { justify-content: flex-start; align-items: center; flex-wrap: wrap; }
.detected-list { display: grid; gap: 7px; margin-top: 12px; }
.detected-item { display: grid; grid-template-columns: 24px minmax(0,1fr); gap: 8px; align-items: start; padding: 9px; border-radius: 10px; background: var(--soft); }
.detected-item > span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: white; color: var(--moss); }
.detected-item svg { width: 12px; height: 12px; }
.detected-item div { display: grid; }
.detected-item b { font-size: 9px; }
.detected-item small { margin-top: 2px; color: var(--muted); font-size: 8px; line-height: 1.4; }
.import-review[hidden] { display: none; }
.settings-back { display: inline-flex; align-items: center; gap: 5px; margin: -2px 0 12px; padding: 0; border: 0; background: transparent; color: var(--moss); font-size: 10px; font-weight: 800; cursor: pointer; }
.settings-back svg { width: 13px; height: 13px; transform: rotate(180deg); }

.toast { position: fixed; z-index: 9999; left: 50%; bottom: 24px; transform: translate(-50%, 18px); padding: 10px 14px; border-radius: 10px; background: var(--ink); color: white; font-size: 11px; font-weight: 700; opacity: 0; pointer-events: none; transition: 180ms ease; box-shadow: var(--shadow); }
.toast.visible { transform: translate(-50%, 0); opacity: 1; }

.guide-hero { position: relative; padding: 4px 112px 14px 2px; }
.guide-hero h3 { margin: 3px 0 4px; font-family: Georgia, serif; font-size: 23px; font-weight: 500; }
.guide-hero > p:last-child { margin: 0; max-width: 330px; color: var(--muted); font-size: 11px; }
.guide-settings { position: absolute; top: 4px; right: 2px; display: inline-flex; align-items: center; gap: 5px; min-height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--moss); font-size: 9px; font-weight: 800; cursor: pointer; }
.guide-settings svg { width: 14px; height: 14px; }
.guide-jumps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-bottom: 16px; }
.guide-jumps button { display: grid; place-items: center; gap: 5px; min-height: 62px; padding: 8px 4px; border: 1px solid var(--line); border-radius: 12px; background: white; color: var(--moss); font-size: 9px; font-weight: 750; cursor: pointer; }
.guide-jumps button:hover { border-color: var(--sage); background: var(--mint); }
.guide-jumps svg { width: 18px; height: 18px; }
.guide-section { margin-top: 9px; border: 1px solid var(--line); border-radius: 15px; background: white; overflow: hidden; scroll-margin-top: 16px; }
.guide-section summary { display: grid; grid-template-columns: 35px minmax(0,1fr) 18px; align-items: center; gap: 10px; min-height: 62px; padding: 10px 13px; list-style: none; cursor: pointer; }
.guide-section summary::-webkit-details-marker { display: none; }
.guide-section summary > span:nth-child(2) { display: grid; }
.guide-section summary b { font-size: 12px; }
.guide-section summary small { margin-top: 2px; color: var(--muted); font-size: 9px; font-weight: 500; }
.guide-section summary > i { position: relative; width: 16px; height: 16px; }
.guide-section summary > i::before, .guide-section summary > i::after { content: ""; position: absolute; left: 3px; right: 3px; top: 7px; height: 1px; background: var(--muted); }
.guide-section summary > i::after { transform: rotate(90deg); transition: transform 150ms ease; }
.guide-section[open] summary > i::after { transform: rotate(0); }
.guide-section-icon { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 10px; background: var(--mint); color: var(--moss); }
.guide-section-icon svg { width: 17px; height: 17px; }
.guide-section-body { padding: 2px 13px 16px; border-top: 1px solid var(--line); }
.guide-label { margin: 16px 0 8px; color: var(--muted); font-size: 9px; letter-spacing: .09em; text-transform: uppercase; }
.booking-card { margin-top: 9px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.booking-top { display: flex; align-items: center; justify-content: space-between; }
.booking-top b { color: var(--moss); font-size: 11px; letter-spacing: .06em; }
.booking-top span { padding: 2px 6px; border-radius: 6px; background: var(--mint); color: var(--moss); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.booking-card > h4 { margin: 6px 0 9px; font-family: Georgia, serif; font-size: 16px; font-weight: 500; }
.booking-route { display: grid; grid-template-columns: minmax(0,1fr) 48px minmax(0,1fr); align-items: center; gap: 6px; }
.booking-route > div { display: grid; }
.booking-route > div:last-child { text-align: right; }
.booking-route b { margin-top: 2px; font-size: 10px; }
.booking-route small { color: var(--muted); font-size: 8px; }
.booking-route > span { display: grid; place-items: center; color: var(--blue); }
.booking-route > span svg { width: 16px; }
.booking-route > span small { margin-top: 2px; color: var(--muted); }
.booking-card > p { margin: 9px 0 0; color: var(--muted); font-size: 9px; }
.compact-table { border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.compact-row { display: grid; grid-template-columns: minmax(0,1.55fr) .8fr .55fr; align-items: center; gap: 7px; min-height: 40px; padding: 8px 9px; border-bottom: 1px solid var(--line); font-size: 9px; }
.compact-row:last-child { border-bottom: 0; }
.compact-row span:nth-child(n+2) { text-align: right; }
.compact-row b { display: block; font-size: 10px; }
.compact-row small { display: block; margin-top: 2px; color: var(--muted); font-size: 8px; line-height: 1.35; }
.compact-row.table-head { min-height: 30px; background: var(--soft); color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.compact-row.subtotal { background: #f5f6f2; font-weight: 700; }
.compact-row.total-row { background: var(--moss); color: white; font-weight: 800; }
.stay-list { display: grid; gap: 7px; }
.stay-list > div { display: grid; grid-template-columns: 30px minmax(0,1fr); gap: 9px; align-items: start; padding: 9px; border-radius: 10px; background: var(--panel); }
.stay-list > div > span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--mint); color: var(--moss); }
.stay-list svg { width: 15px; height: 15px; }
.stay-list p { display: grid; margin: 0; }
.stay-list b { font-size: 10px; }
.stay-list small { margin-top: 2px; color: var(--muted); font-size: 8px; line-height: 1.45; }
.guide-note { margin: 10px 0 0; padding: 9px 10px; border-radius: 9px; background: #f1efe7; color: var(--muted); font-size: 9px; line-height: 1.5; }
.budget-total { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.budget-total > div { display: grid; padding: 12px; border-radius: 11px; background: var(--panel); }
.budget-total small { color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .07em; }
.budget-total strong { margin-top: 2px; font-family: Georgia, serif; font-size: 18px; font-weight: 500; }
.cost-bar { display: flex; height: 7px; margin-top: 12px; overflow: hidden; border-radius: 99px; }
.cost-bar span:nth-child(1) { background: var(--blue); }
.cost-bar span:nth-child(2) { background: var(--sage); }
.cost-bar span:nth-child(3) { background: var(--amber); }
.cost-legend { display: flex; justify-content: space-between; gap: 5px; margin: 6px 0 11px; color: var(--muted); font-size: 7px; }
.cost-legend span { display: inline-flex; align-items: center; gap: 3px; }
.cost-legend i { width: 6px; height: 6px; border-radius: 50%; }
.flight-cost { background: var(--blue); }.hotel-cost { background: var(--sage); }.train-cost { background: var(--amber); }
.cost-table .compact-row { grid-template-columns: minmax(0,1.5fr) .65fr .65fr; }
.guide-bullets { margin: 12px 0 0; padding: 0; list-style: none; }
.guide-bullets li { position: relative; margin-top: 7px; padding-left: 13px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.guide-bullets li::before { content: ""; position: absolute; left: 1px; top: 6px; width: 4px; height: 4px; border-radius: 50%; background: var(--sage); }
.weather-grid { display: grid; gap: 8px; margin-top: 12px; }
.weather-grid article { padding: 11px; border-radius: 11px; background: var(--panel); }
.weather-grid h4 { margin: 2px 0; font-family: Georgia, serif; font-size: 16px; font-weight: 500; }
.weather-grid strong { color: var(--moss); font-size: 11px; }
.weather-grid article > p:not(.eyebrow) { margin: 7px 0 5px; color: var(--muted); font-size: 9px; }
.weather-grid article > small { color: var(--muted); font-size: 8px; }
.guide-checklist { display: grid; gap: 5px; }
.guide-check { display: grid; grid-template-columns: 22px minmax(0,1fr); align-items: center; gap: 8px; min-height: 38px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); font-size: 9px; cursor: pointer; }
.guide-check input { position: absolute; opacity: 0; pointer-events: none; }
.check-box { display: grid; place-items: center; width: 21px; height: 21px; border: 1px solid var(--line); border-radius: 6px; color: transparent; }
.check-box svg { width: 13px; height: 13px; }
.guide-check.done { color: var(--muted); text-decoration: line-through; background: #f4f6f2; }
.guide-check.done .check-box { border-color: var(--moss); background: var(--moss); color: white; }
.transfer-list { display: grid; gap: 7px; margin-top: 12px; }
.transfer-list article { padding: 10px; border-left: 2px solid var(--sage); background: var(--panel); }
.transfer-list h4 { margin: 0; font-size: 10px; }
.transfer-list p { margin: 3px 0 0; color: var(--muted); font-size: 8px; line-height: 1.5; }
.phrase-list { display: grid; gap: 7px; margin-top: 12px; }
.phrase, .search-term-list button { display: grid; width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); text-align: left; cursor: pointer; }
.phrase:hover, .search-term-list button:hover { border-color: var(--sage); background: var(--mint); }
.phrase b, .search-term-list b { font-size: 12px; }
.phrase span, .search-term-list span { margin-top: 2px; color: var(--muted); font-size: 8px; }
.search-term-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.guide-explore { margin-top: 14px; }

.map-marker { position: relative; display: grid; place-items: center; width: 28px; height: 28px; border: 3px solid white; border-radius: 50% 50% 50% 6px; background: var(--moss); color: white; box-shadow: 0 4px 11px rgba(24,51,46,.3); transform: rotate(-45deg); }
.map-marker span { display: grid; place-items: center; font-size: 11px; font-weight: 800; transform: rotate(45deg); }
.map-marker span svg { width: 15px; height: 15px; stroke-width: 2; }
.map-marker span b { font-size: 10px; }
.map-marker.stay { background: #6e5e87; }
.map-marker.transport { background: var(--blue); }
.map-marker.mart { background: #57728d; }
.map-marker.cafe { background: #9a643a; }
.map-marker.food.diet-veg { background: #4f7c51; }
.map-marker.food.diet-local { background: #b85f45; }
.map-marker.shopping { background: #92703e; }
.map-marker.optional { background: #9a8271; }
.map-marker.saved { box-shadow: 0 0 0 4px rgba(200,115,56,.28), 0 4px 11px rgba(24,51,46,.3); }
.map-marker.mode-day:not(.stay) { background: var(--moss); }
.map-marker.mode-overall { width: 20px; height: 20px; border-width: 2px; opacity: .88; }
.map-marker.mode-overall span { font-size: 8px; }
.map-marker.mode-nearby.anchor { background: #7b8580; box-shadow: 0 0 0 5px rgba(255,255,255,.75), 0 4px 11px rgba(24,51,46,.24); }
.map-marker.mode-nearby.food.diet-veg { background: #4f7c51; }
.map-marker.mode-nearby.food.diet-local { background: #b85f45; }
.map-marker.mode-nearby.cafe { background: #9a643a; }
.map-marker.mode-nearby.mart { background: #4f7298; }
.place-legend { position: absolute; z-index: 500; bottom: 22px; left: 50%; display: flex; gap: 5px; align-items: center; max-width: calc(100% - 32px); padding: 5px; border-radius: 13px; transform: translateX(-50%); overflow-x: auto; scrollbar-width: none; }
.place-legend[hidden] { display: none !important; }
.place-legend-item { display: inline-flex; flex: none; gap: 5px; align-items: center; min-height: 28px; padding: 0 8px; border-radius: 9px; background: rgba(255,255,255,.82); color: var(--muted); font-size: 8px; font-weight: 750; white-space: nowrap; }
.place-legend-item i { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 6px; color: white; font-style: normal; }
.place-legend-item svg { width: 11px; height: 11px; }
.place-legend-item.veg i { background: #4f7c51; }
.place-legend-item.local i { background: #b85f45; }
.place-legend-item.coffee i { background: #9a643a; }
.place-legend-item.mart i { background: #4f7298; }
.place-legend-item.stay i { background: #6e5e87; }
.leaflet-div-icon { border: 0 !important; background: transparent !important; }
.leaflet-popup-content-wrapper { border-radius: 14px !important; box-shadow: 0 12px 32px rgba(24,51,46,.17) !important; }
.leaflet-popup-content { width: 218px !important; margin: 12px !important; }
.popup-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.popup h4 { margin: 0; font-size: 13px; }
.popup .zh { margin: 2px 0 0; color: var(--muted); font-size: 10px; }
.popup p { display: -webkit-box; overflow: hidden; margin: 7px 0 9px; color: var(--muted); font-size: 9px; line-height: 1.4; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.popup-badge { flex: none; padding: 3px 5px; border-radius: 999px; font-size: 7px; font-weight: 800; white-space: nowrap; }
.popup-badge.veg { background: #edf3ec; color: #346538; }
.popup-badge.local { background: #f7e7e1; color: #984932; }
.popup-policy { display: grid; gap: 2px; margin: 8px 0; padding: 8px; border-radius: 9px; background: var(--soft); }
.popup-policy b { color: var(--moss); font-size: 9px; }
.popup-policy small { display: -webkit-box; overflow: hidden; color: var(--muted); font-size: 8px; line-height: 1.35; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.popup-policy small + small { margin-top: 4px; }
.popup-policy small strong { color: var(--ink); }
.popup-policy .policy-source { display: block; overflow: visible; -webkit-line-clamp: unset; }
.popup-policy a { color: var(--moss); font-weight: 750; }
.popup-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.popup-actions a, .popup-actions button { flex: 1; display: inline-flex; align-items: center; justify-content: center; min-height: 30px; padding: 0 7px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--moss); font-size: 9px; font-weight: 800; text-decoration: none; cursor: pointer; }
.popup-actions a { background: var(--moss); border-color: var(--moss); color: white; }
.popup-journey-status { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 30px; border: 1px solid #bfd0c6; border-radius: 8px; background: #f2f7f3; color: var(--moss); font-size: 9px; font-weight: 800; }
.popup-journey-status svg { width: 12px; height: 12px; }
.popup-nearby { margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--line); }
.popup-nearby-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 4px; }
.popup-nearby-head b { font-size: 10px; }
.popup-nearby-head span { color: var(--muted); font-size: 8px; }
.popup-rec { display: grid; grid-template-columns: minmax(0,1fr) 26px; gap: 5px; align-items: center; }
.popup-rec > button:first-child { display: grid; grid-template-columns: 24px minmax(0,1fr); gap: 6px; align-items: center; min-width: 0; padding: 5px 0; border: 0; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.popup-rec > button:first-child > span:first-child { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: var(--soft); color: var(--moss); }
.popup-rec svg { width: 12px; height: 12px; }
.popup-rec b, .popup-rec small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.popup-rec b { font-size: 9px; }
.popup-rec small { color: var(--muted); font-size: 8px; text-transform: capitalize; }
.popup-add { display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--moss); font-size: 15px; cursor: pointer; }
.policy-time { color: var(--moss); font-weight: 750; }
.breakfast-time { color: #8b5c32; font-weight: 750; }
.stay-list a { color: var(--moss); font-weight: 700; }

@media (max-width: 980px) {
  .app-shell { grid-template-columns: minmax(0, 1fr) 390px; }
}

@media (max-width: 760px) {
  html, body { height: auto; min-height: 100%; scroll-behavior: smooth; }
  body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .app-shell { display: flex; min-height: 100svh; height: auto; overflow: visible; flex-direction: column; }
  .map-pane {
    position: relative;
    flex: none;
    order: 1;
    width: 100%;
    height: 48svh;
    min-height: 340px;
    max-height: 460px;
    border-bottom: 1px solid var(--line);
  }
  .map-pane.map-expanded { position: fixed; z-index: 1300; inset: 0; width: 100%; height: 100svh; min-height: 0; max-height: none; border: 0; }
  body.map-expanded-open { overflow: hidden; }
  body.map-choice-open .mobile-sheet-handle { display: none; }
  body.place-popup-open .mobile-sheet-handle { display: none; }
  .map-mode-bar { top: 58px; right: 10px; left: 10px; width: auto; transform: none; }
  .optional-choice-bar { top: 111px; right: 10px; left: 10px; width: auto; transform: none; }
  .map-mode-bar .icon-button { flex: none; width: 36px; height: 36px; background: var(--soft); }
  .map-header { top: 10px; left: 10px; max-width: calc(100% - 152px); padding: 7px 10px 7px 7px; border-radius: 13px; box-shadow: 0 4px 14px rgba(24,51,46,.07); }
  .map-header h1 { display: none; }
  .map-header .eyebrow { overflow: hidden; max-width: 145px; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
  .trip-mark { width: 34px; height: 34px; border-radius: 10px; font-size: 18px; }
  .map-actions { top: 10px; right: 10px; padding: 3px; border-radius: 12px; box-shadow: 0 4px 14px rgba(24,51,46,.07); }
  .map-actions .icon-button { width: 34px; height: 34px; }
  .mobile-map-expand { display: inline-grid; }
  .leaflet-control-zoom { display: none; }
  .leaflet-control-attribution { max-width: 58%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .route-legend { display: none; }
  .map-pane.map-expanded .route-legend {
    bottom: 78px;
    display: flex;
    width: max-content;
    max-width: calc(100% - 24px);
    overflow-x: auto;
    border-color: rgba(24,51,46,.1);
    box-shadow: 0 4px 14px rgba(24,51,46,.07);
    scrollbar-width: none;
  }
  .map-pane.map-expanded .place-legend { bottom: 18px; width: max-content; }
  .mobile-sheet-handle {
    position: absolute;
    z-index: 500;
    right: 12px;
    bottom: 12px;
    left: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
    padding: 7px 10px 7px 13px;
    border: 1px solid rgba(24,51,46,.1);
    border-radius: 14px;
    background: rgba(251,250,246,.96);
    box-shadow: 0 4px 14px rgba(24,51,46,.08);
    color: var(--ink);
    text-align: left;
  }
  .mobile-guide-copy { display: grid; gap: 1px; min-width: 0; }
  .mobile-guide-copy small { color: var(--muted); font-size: 8px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
  .mobile-guide-copy strong { overflow: hidden; font-family: Georgia, serif; font-size: 14px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-sheet-handle > svg { width: 17px; height: 17px; color: var(--moss); }
  .side-panel {
    position: relative;
    z-index: 2;
    order: 2;
    inset: auto;
    min-height: calc(100svh - 340px);
    height: auto;
    overflow: visible;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    transform: none;
  }
  .side-panel.open { transform: none; }
  .panel-head { padding: 0; border: 0; }
  .panel-title-row { display: none; }
  .view-tabs {
    position: fixed;
    z-index: 1200;
    right: 10px;
    bottom: max(8px, env(safe-area-inset-bottom));
    left: 10px;
    gap: 2px;
    margin: 0;
    padding: 5px;
    border: 1px solid rgba(24,51,46,.11);
    border-radius: 14px;
    background: rgba(251,250,246,.96);
    box-shadow: 0 7px 24px rgba(24,51,46,.13);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }
  .tab { gap: 3px; min-height: 48px; padding: 0 2px; border-radius: 10px; font-size: 9px; }
  .tab::after { display: none; }
  .tab.active { background: var(--mint); }
  .tab svg { width: 17px; height: 17px; }
  .mobile-close { display: none; }
  .panel-body { height: auto; flex: none; overflow: visible; overscroll-behavior: auto; }
  .view { padding: 13px 16px 30px; }
  .overview-card { gap: 8px; padding: 11px 12px; border-radius: 12px; }
  .overview-copy { gap: 5px; font-size: 10px; }
  .overview-copy span + span::before { margin-right: 5px; }
  .day-strip {
    position: sticky;
    z-index: 800;
    top: 0;
    margin: 10px -16px 0;
    padding: 10px 16px 11px;
    border-bottom: 1px solid rgba(24,51,46,.08);
    background: rgba(251,250,246,.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    scroll-padding-inline: 16px;
  }
  .day-button { width: 50px; height: 56px; border-radius: 12px; }
  .day-button.active { box-shadow: none; }
  .timeline { padding-top: 15px; }
  .day-header { align-items: flex-start; margin: 3px 1px 18px; scroll-margin-top: 78px; }
  .day-header h3 { max-width: 270px; font-size: 22px; line-height: 1.16; }
  .day-city { margin-top: 2px; }
  .timeline-entry { grid-template-columns: 49px 25px minmax(0,1fr); min-height: 92px; }
  .entry-card { margin-left: 7px; padding-right: 38px; }
  .entry-title { font-size: 13px; line-height: 1.35; }
  .entry-card p { font-size: 11px; }
  .entry-map-link { width: 42px; height: 42px; }
  .pitstop-item { min-height: 64px; }
  .optional-pick { min-height: 72px; padding: 10px; }
  .pitstop-action { min-width: 58px; min-height: 40px; }
  .travel-connector { margin-left: 49px; padding-block: 8px; }
  .travel-connector a { min-height: 38px; display: inline-flex; align-items: center; }
  .stay-bridge { width: 100%; margin-left: 0; }
  .food-plan { margin-left: 0; }
  .food-plan-item { grid-template-columns: 47px 30px minmax(0,1fr) 34px; min-height: 60px; }
  .food-save { width: 34px; height: 34px; }
  .place-card { min-height: 70px; }
  .heart-button { width: 42px; height: 42px; }
  .chip { min-height: 38px; padding-inline: 13px; }
  .guide-jumps button { min-height: 68px; }
  .guide-section summary { min-height: 66px; }
  .primary-button, .secondary-button { min-height: 44px; }
  .mobile-map-jump {
    position: fixed;
    z-index: 1150;
    right: 14px;
    bottom: calc(74px + env(safe-area-inset-bottom));
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 42px;
    padding: 0 13px;
    border: 1px solid rgba(24,51,46,.13);
    border-radius: 12px;
    background: var(--moss);
    box-shadow: 0 5px 18px rgba(24,51,46,.18);
    color: white;
    font-size: 10px;
    font-weight: 800;
    transition: opacity 150ms ease, transform 150ms ease;
  }
  .mobile-map-jump svg { width: 15px; height: 15px; }
  .mobile-map-jump.map-visible { opacity: 0; pointer-events: none; transform: translateY(8px); }
  .toast { bottom: calc(132px + env(safe-area-inset-bottom)); max-width: calc(100% - 32px); text-align: center; }
  .place-dialog form { padding: 19px; }
  .optional-choice-bar button { min-height: 40px; font-size: 9px; }
  .guide-hero { padding-right: 108px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
