:root {
  --bg: #fff5df;
  --paper: #fffdf5;
  --ink: #3b3228;
  --muted: #746858;
  --brand: #78b7ad;
  --brand-dark: #3f8178;
  --blue: #bde3f0;
  --sun: #ffc56e;
  --danger: #d47463;
  --brick: #d98a6f;
  --line: #ecd8b8;
  --card: #fffdf5;
  --soft: #eff8e9;
  --shadow: 0 10px 20px rgba(127, 86, 34, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 12% 8%, rgba(185, 212, 222, .35), transparent 24%),
    radial-gradient(circle at 88% 18%, rgba(233, 182, 107, .2), transparent 22%),
    radial-gradient(circle at 45% 0%, rgba(255, 197, 110, .26), transparent 28%),
    linear-gradient(180deg, #fffaf0, var(--bg));
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", sans-serif;
}

body.large-text {
  font-size: 26.67px;
}

body.large-text p,
body.large-text li,
body.large-text a,
body.large-text button,
body.large-text input,
body.large-text textarea,
body.large-text label,
body.large-text span,
body.large-text .note,
body.large-text .eyebrow,
body.large-text .day-city,
body.large-text .must-kind,
body.large-text .meta,
body.large-text .sync-status {
  font-size: max(26.67px, 1em);
  line-height: 1.45;
}

body.large-text h1 {
  font-size: 36px;
}

body.large-text h2 {
  font-size: 34px;
}

body.large-text h3,
body.large-text .day-title,
body.large-text .event-title {
  font-size: 30px;
}

body.large-text #app {
  max-width: 860px;
}

body.large-text .topbar {
  align-items: flex-start;
  gap: 12px;
}

body.large-text .top-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

body.large-text .icon-button,
body.large-text .icon-button.small {
  width: 56px;
  height: 56px;
}

body.large-text .tool-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.large-text .day-button {
  width: 160px;
  min-height: 86px;
}

body.large-text .tabs {
  top: 94px;
  overflow-x: auto;
}

body.large-text .tab {
  min-height: 56px;
  padding: 8px 16px;
  white-space: nowrap;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

#app {
  max-width: 720px;
  min-height: 100vh;
  margin: 0 auto;
  padding: env(safe-area-inset-top) 16px calc(92px + env(safe-area-inset-bottom));
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0 10px;
  background: rgba(247, 240, 223, 0.92);
  backdrop-filter: blur(16px);
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-family: Georgia, "Times New Roman", "Noto Serif TC", serif;
  font-size: 29px;
  letter-spacing: 0;
}

.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid #6f8e82;
  border-radius: 14px;
  background: linear-gradient(180deg, #a8c7ba, var(--brand));
  color: #fffaf0;
  font-size: 26px;
  line-height: 1;
}

.icon-button.active {
  border-color: #d99b3d;
  background: linear-gradient(180deg, #ffd989, var(--sun));
  color: var(--ink);
}

.top-actions {
  display: flex;
  gap: 8px;
}

.icon-button.small {
  width: 42px;
  font-size: 16px;
  font-weight: 900;
}

.today-hero {
  position: relative;
  overflow: hidden;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(255,250,240,.9), rgba(237,243,232,.82)), url("./assets/illustrations/vienna.png");
  background-size: cover;
  background-position: center;
  box-shadow: var(--shadow);
}

.hero-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}

.day-title {
  margin-bottom: 6px;
  font-size: 24px;
  font-family: Georgia, "Times New Roman", "Noto Serif TC", serif;
}

.city-pill {
  flex: 0 0 auto;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(95, 127, 115, .45);
  background: rgba(255, 250, 240, .82);
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 700;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.quick {
  padding: 10px;
  border-radius: 12px;
  border: 1px dashed rgba(119, 109, 96, .22);
  background: rgba(255, 250, 240, 0.8);
  font-size: 14px;
}

.quick strong {
  display: block;
  margin-bottom: 3px;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.connection-banner,
.update-banner {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 10px 16px;
  background: #8f4c3d;
  color: white;
  text-align: center;
  font-weight: 800;
}

.update-banner { background: #286f68; }
.update-banner button { margin-left: 10px; padding: 7px 12px; border: 0; border-radius: 999px; background: white; color: #286f68; font-weight: 900; }

.prep-progress {
  position: sticky;
  top: 74px;
  z-index: 3;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 250, 240, .96);
}

.prep-progress progress { width: 100%; accent-color: var(--brand); }

.tool-card {
  display: grid;
  min-height: 72px;
  place-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  color: var(--brand-dark);
  box-shadow: var(--shadow);
  font-weight: 900;
  font-size: 22px;
  padding: 8px 4px;
}

.tool-card span {
  font-size: 15px;
}

.now-panel,
.section {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.now-kicker {
  margin-bottom: 8px;
  color: var(--danger);
  font-size: 13px;
  font-weight: 800;
}

.now-title {
  margin-bottom: 8px;
  font-size: 22px;
}

.meta-list {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.meta-item {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px dashed rgba(95, 127, 115, .25);
  background: var(--soft);
  font-size: 15px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.button-link,
.ghost-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border: 1px solid rgba(95, 127, 115, .35);
  border-radius: 999px;
  text-decoration: none;
  font-weight: 800;
}

.button-link {
  background: linear-gradient(180deg, #92d2c8, var(--brand));
  color: #fffaf0;
}

.ghost-button {
  background: var(--soft);
  color: var(--brand-dark);
}

.voice-controls {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.voice-button {
  min-height: 40px;
  border: 1px solid rgba(184, 123, 67, 0.28);
  border-radius: 999px;
  font: inherit;
  font-weight: 900;
}

.voice-button {
  padding: 0 14px;
  background: linear-gradient(180deg, #ffe6ad, #ffc779);
  color: #68431f;
  box-shadow: 0 8px 14px rgba(99, 68, 28, 0.1);
}

.voice-status {
  flex-basis: 100%;
  color: #a95348;
  font-size: 13px;
  line-height: 1.4;
}

.tabs {
  position: sticky;
  top: 72px;
  z-index: 4;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin: 14px 0;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 250, 240, 0.9);
  backdrop-filter: blur(16px);
}

.tab {
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  font-size: 16px;
}

.tab.active {
  background: var(--brand);
  color: #fffaf0;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.timeline {
  display: grid;
  gap: 12px;
}

.event-card {
  position: relative;
  overflow: hidden;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
}

.event-card::before,
.simple-card.illustrated::before {
  position: absolute;
  inset: 0;
  content: "";
  background-image: var(--art);
  background-size: cover;
  background-position: center;
  opacity: 0.2;
}

.event-card > *,
.simple-card.illustrated > * {
  position: relative;
  z-index: 1;
}

.event-card.current {
  border-color: var(--sun);
  box-shadow: 0 0 0 3px rgba(243, 182, 62, 0.18);
}

.event-time {
  color: var(--brand);
  font-weight: 900;
}

.event-title {
  margin: 4px 0 8px;
  font-size: 18px;
}

.note {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.story {
  margin-top: 10px;
  padding: 10px;
  border-left: 4px solid var(--sun);
  border-radius: 10px;
  background: #fff8e7;
  line-height: 1.55;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.chip {
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 700;
}

.must-grid,
.map-list,
.rescue-list {
  display: grid;
  gap: 10px;
}

.must-card.compact {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 2px 12px;
  align-items: start;
}

.must-card.compact h3,
.must-card.compact .note,
.must-card.compact .story,
.must-card.compact .must-kind {
  grid-column: 2;
}

.must-icon {
  grid-row: 1 / span 4;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px dashed rgba(185, 120, 103, .35);
  border-radius: 16px;
  background: #fff2d5;
  font-size: 25px;
}

.must-kind {
  display: inline-block;
  margin-bottom: 8px;
  padding: 5px 9px;
  border: 1px solid rgba(185, 120, 103, .35);
  border-radius: 999px;
  background: #fff3df;
  color: var(--brick);
  font-size: 12px;
  font-weight: 900;
}

.prep-board {
  display: grid;
  gap: 12px;
}

.prep-card {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.prep-card h3 {
  margin-bottom: 10px;
  color: var(--brand-dark);
}

.check-item {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 9px 0;
  border-top: 1px dashed rgba(116, 104, 88, .18);
}

.check-item:first-of-type {
  border-top: 0;
}

.energy-icon {
  font-size: 22px;
}

.floating-close {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  right: 12px;
  z-index: 20;
  width: 46px !important;
  height: 46px;
  min-height: 46px !important;
  padding: 0 !important;
  border: 1px solid rgba(95, 127, 115, .35) !important;
  border-radius: 50% !important;
  background: #fffdf5 !important;
  color: var(--brand-dark) !important;
  font-size: 28px;
  line-height: 1 !important;
  box-shadow: var(--shadow);
}

.simple-card {
  position: relative;
  overflow: hidden;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.simple-card h3 {
  margin-bottom: 6px;
  font-size: 18px;
}

.day-picker {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 8;
  display: flex;
  gap: 8px;
  max-width: 720px;
  margin: 0 auto;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  overflow-x: auto;
  background: rgba(255, 250, 240, 0.95);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.day-button {
  flex: 0 0 auto;
  width: 118px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 800;
}

.map-box {
  min-height: 360px;
  border-radius: 16px;
  overflow: hidden;
  background: #dde8e5;
  box-shadow: var(--shadow);
}

.map-box iframe {
  width: 100%;
  height: 360px;
  border: 0;
}

.storybook-map {
  position: relative;
  overflow: hidden;
  padding: 18px 16px 20px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    radial-gradient(circle at 18% 16%, rgba(189, 227, 240, 0.7), transparent 18%),
    radial-gradient(circle at 86% 20%, rgba(255, 197, 110, 0.36), transparent 18%),
    linear-gradient(135deg, #fff9e8, #eff8e9);
  box-shadow: var(--shadow);
}

.storybook-map::before {
  content: "";
  position: absolute;
  inset: 76px 42px 88px;
  border-left: 4px dashed rgba(120, 183, 173, 0.55);
  transform: rotate(-2deg);
}

.map-ribbon {
  display: inline-block;
  margin-bottom: 16px;
  padding: 8px 14px;
  border: 1px solid rgba(184, 123, 67, 0.35);
  border-radius: 999px;
  background: rgba(255, 253, 245, 0.9);
  color: var(--brand-dark);
  font-weight: 900;
}

.drawn-route {
  position: relative;
  display: grid;
  gap: 14px;
}

.map-node {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(236, 216, 184, 0.9);
  border-radius: 20px;
  background: rgba(255, 253, 245, 0.92);
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(127, 86, 34, 0.08);
}

.map-node:nth-child(even) {
  margin-left: 26px;
}

.map-node-icon {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border: 2px solid rgba(63, 129, 120, 0.28);
  border-radius: 18px;
  background: #fff2d5;
  font-size: 26px;
}

.map-node-body {
  display: grid;
  gap: 3px;
}

.map-node-body strong {
  line-height: 1.35;
}

.map-node-body span,
.map-node-body small {
  color: var(--muted);
  line-height: 1.45;
}

.map-hint {
  position: relative;
  z-index: 1;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.tourist-map {
  position: relative;
  min-height: 560px;
  overflow: hidden;
  border: 1px solid rgba(184, 123, 67, 0.35);
  border-radius: 24px;
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 253, 245, 0.9) 0 13%, transparent 14%),
    radial-gradient(circle at 73% 36%, rgba(255, 253, 245, 0.82) 0 17%, transparent 18%),
    radial-gradient(circle at 42% 72%, rgba(255, 253, 245, 0.78) 0 18%, transparent 19%),
    linear-gradient(135deg, #e7c985, #f3d99b 55%, #e5c073);
  box-shadow: var(--shadow);
}

.real-map {
  background: #e5d7ad;
}

.real-map-frame {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  border: 0;
  filter: saturate(0.72) contrast(0.92) brightness(1.08);
}

.map-soft-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(236, 201, 133, 0.2), rgba(255, 250, 240, 0.28)),
    radial-gradient(circle at 18% 18%, rgba(255, 253, 245, 0.55), transparent 23%),
    radial-gradient(circle at 82% 78%, rgba(255, 253, 245, 0.48), transparent 22%);
}

.real-map .map-landmark:not(.compass) {
  display: none;
}

.tourist-map::before {
  content: "✦ ✧ ✦";
  position: absolute;
  z-index: 2;
  right: 18px;
  top: 16px;
  color: rgba(185, 76, 88, 0.5);
  font-size: 26px;
  letter-spacing: 8px;
}

.tourist-map::after {
  content: "";
  position: absolute;
  z-index: 1;
  left: -10%;
  bottom: 8%;
  width: 120%;
  height: 90px;
  background: rgba(255, 253, 245, 0.3);
  transform: rotate(-8deg);
  filter: blur(1px);
}

.map-title {
  position: absolute;
  z-index: 4;
  left: 18px;
  top: 18px;
  display: grid;
  gap: 2px;
  max-width: 58%;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 253, 245, 0.82);
  color: #4e3a27;
  box-shadow: 0 8px 16px rgba(99, 68, 28, 0.12);
}

.map-title strong {
  font-family: Georgia, "Times New Roman", "Noto Serif TC", serif;
  font-size: 28px;
  line-height: 1.05;
}

.map-title span {
  color: #4e3a27;
  font-weight: 900;
}

.map-landmark {
  position: absolute;
  pointer-events: none;
}

.map-landmark.river {
  left: 9%;
  top: 28%;
  width: 82%;
  height: 42%;
  border: 18px solid rgba(255, 253, 245, 0.6);
  border-left-color: transparent;
  border-right-color: transparent;
  border-radius: 50%;
  transform: rotate(-24deg);
}

.map-landmark.road {
  left: 18%;
  top: 30%;
  width: 68%;
  height: 48%;
  border-top: 4px dashed rgba(120, 86, 52, 0.35);
  border-radius: 50%;
  transform: rotate(18deg);
}

.map-landmark.hill {
  width: 140px;
  height: 72px;
  border-radius: 50% 50% 20% 20%;
  background: rgba(125, 161, 118, 0.28);
}

.hill-one {
  right: 8%;
  bottom: 12%;
}

.hill-two {
  left: 8%;
  bottom: 22%;
  transform: scale(0.75);
}

.map-landmark.compass {
  z-index: 4;
  right: 18px;
  bottom: 18px;
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  border: 2px solid rgba(78, 58, 39, 0.45);
  border-radius: 50%;
  color: rgba(78, 58, 39, 0.72);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 900;
}

.map-landmark.compass::before,
.map-landmark.compass::after {
  content: "";
  position: absolute;
  background: rgba(78, 58, 39, 0.35);
}

.map-landmark.compass::before {
  width: 2px;
  height: 92px;
}

.map-landmark.compass::after {
  width: 92px;
  height: 2px;
}

.map-spots {
  position: absolute;
  inset: 0;
  z-index: 5;
}

.map-spot {
  position: absolute;
  display: grid;
  justify-items: center;
  gap: 6px;
  width: min(34vw, 170px);
  color: var(--ink);
  text-align: center;
  text-decoration: none;
  transform: translate(-50%, -50%) scale(var(--spot-scale, 1));
}

.spot-icon {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 2px solid rgba(78, 58, 39, 0.22);
  border-radius: 20px 20px 20px 8px;
  background: #fffaf0;
  box-shadow: 0 8px 16px rgba(99, 68, 28, 0.16);
  font-size: 30px;
}

.map-spot.sight .spot-icon,
.map-spot.reserved .spot-icon {
  background: #fff0d3;
}

.map-spot.food .spot-icon {
  background: #ffe3d4;
}

.map-spot.traffic .spot-icon {
  background: #dff0f3;
}

.map-spot.hotel .spot-icon {
  background: #e6f4dc;
}

.spot-label {
  display: grid;
  gap: 2px;
  padding: 7px 8px;
  border: 1px solid rgba(184, 123, 67, 0.28);
  border-radius: 12px;
  background: rgba(255, 253, 245, 0.88);
  box-shadow: 0 8px 14px rgba(99, 68, 28, 0.08);
}

.spot-label strong {
  font-size: 13px;
  line-height: 1.25;
}

.spot-label small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.tourist-map .map-hint {
  position: absolute;
  left: 16px;
  right: 108px;
  bottom: 16px;
  z-index: 6;
  margin: 0;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 253, 245, 0.82);
}

.daily-map-book {
  display: grid;
  gap: 14px;
}

.map-book-title,
.map-section-copy {
  display: grid;
  gap: 4px;
  color: var(--ink);
}

.map-book-title {
  padding: 12px 14px;
  border: 1px dashed rgba(184, 123, 67, 0.42);
  border-radius: 18px;
  background: rgba(255, 250, 238, 0.9);
}

.map-book-title strong {
  font-family: Georgia, "Times New Roman", "Noto Serif TC", serif;
  font-size: 24px;
}

.map-book-title span,
.map-section-copy span {
  color: var(--muted);
  line-height: 1.55;
}

.map-section-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(184, 123, 67, 0.28);
  border-radius: 22px;
  background:
    radial-gradient(circle at 10% 10%, rgba(255, 224, 166, 0.32), transparent 24%),
    linear-gradient(180deg, rgba(255, 253, 245, 0.95), rgba(255, 247, 229, 0.9));
  box-shadow: 0 14px 28px rgba(99, 68, 28, 0.08);
}

.map-section-copy {
  padding: 0 4px;
}

.map-section-copy strong {
  font-size: 20px;
}

.mini-tourist-map {
  min-height: 430px;
  border-radius: 20px;
  box-shadow: none;
}

.mini-tourist-map::before {
  content: "TRAVEL";
  right: 14px;
  top: 12px;
  color: rgba(160, 94, 44, 0.42);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  letter-spacing: 3px;
}

.mini-tourist-map::after {
  height: 66px;
  opacity: 0.55;
}

.mini-tourist-map .map-soft-overlay {
  background:
    linear-gradient(180deg, rgba(245, 215, 154, 0.2), rgba(255, 250, 240, 0.34)),
    radial-gradient(circle at 25% 20%, rgba(255, 253, 245, 0.48), transparent 20%),
    radial-gradient(circle at 80% 72%, rgba(255, 253, 245, 0.42), transparent 24%);
}

.mini-tourist-map .map-spot {
  width: min(38vw, 142px);
}

.mini-tourist-map .spot-icon {
  width: 50px;
  height: 50px;
  border-radius: 18px 18px 18px 7px;
  font-size: 26px;
}

.mini-tourist-map .spot-label {
  max-width: 142px;
  padding: 6px 7px;
  backdrop-filter: blur(2px);
}

.mini-tourist-map .spot-label strong {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.map-transfer-line {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  margin: -2px 12px;
  padding: 10px 14px;
  border: 1px solid rgba(91, 135, 128, 0.28);
  border-radius: 999px;
  background: #eef8f4;
  color: #2f6d65;
}

.map-transfer-line span {
  display: inline-grid;
  min-width: 46px;
  min-height: 32px;
  place-items: center;
  border-radius: 999px;
  background: #7fc8ba;
  color: #fffaf0;
  font-weight: 900;
}

.map-transfer-line strong {
  line-height: 1.4;
}

.single-map-book {
  gap: 12px;
}

.interactive-map-card {
  overflow: hidden;
  border: 1px solid rgba(184, 123, 67, 0.35);
  border-radius: 24px;
  background: #f2dcaa;
  box-shadow: var(--shadow);
}

.leaflet-tour-map {
  position: relative;
  width: 100%;
  height: min(68dvh, 620px);
  min-height: 470px;
  background: #edd7a7;
}

.leaflet-tour-map .leaflet-tile {
  filter: saturate(0.62) contrast(0.9) brightness(1.08) sepia(0.18);
}

.leaflet-tour-map::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 450;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 14%, rgba(255, 253, 245, 0.22), transparent 22%),
    linear-gradient(180deg, rgba(255, 248, 228, 0.12), rgba(235, 190, 118, 0.18));
  mix-blend-mode: multiply;
}

.leaflet-trip-marker {
  position: relative;
  display: grid;
  place-items: center;
}

.leaflet-trip-link {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(92px, 132px);
  gap: 6px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.leaflet-trip-pin {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 2px solid rgba(78, 58, 39, 0.25);
  border-radius: 17px 17px 17px 6px;
  background: #fffaf0;
  box-shadow: 0 8px 16px rgba(99, 68, 28, 0.18);
  color: #68431f;
  font-size: 18px;
  font-weight: 900;
}

.leaflet-trip-pin.sight,
.leaflet-trip-pin.reserved {
  background: #fff0d3;
}

.leaflet-trip-pin.food {
  background: #ffe3d4;
}

.leaflet-trip-pin.traffic {
  background: #dff0f3;
}

.leaflet-trip-pin.hotel {
  background: #e6f4dc;
}

.leaflet-trip-number {
  position: absolute;
  left: 29px;
  top: -6px;
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 2px solid #fffaf0;
  border-radius: 999px;
  background: #c95f4d;
  color: #fffaf0;
  font-size: 12px;
  font-weight: 900;
}

.leaflet-trip-label {
  display: grid;
  gap: 1px;
  max-width: 132px;
  padding: 5px 7px;
  border: 1px solid rgba(184, 123, 67, 0.3);
  border-radius: 12px;
  background: rgba(255, 250, 238, 0.94);
  box-shadow: 0 6px 14px rgba(99, 68, 28, 0.16);
  color: var(--ink);
  line-height: 1.2;
}

.leaflet-trip-label strong {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 13px;
}

.leaflet-trip-label small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.map-stop-strip {
  display: grid;
  gap: 8px;
}

.map-stop-strip a {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(184, 123, 67, 0.25);
  border-radius: 14px;
  background: rgba(255, 250, 238, 0.92);
  color: var(--ink);
  text-decoration: none;
  line-height: 1.4;
}

.map-stop-strip span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  background: #c95f4d;
  color: #fffaf0;
  font-weight: 900;
}

.location-line {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.route-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.route-stop {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 8px;
  align-items: start;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.stop-number {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  background: var(--brand);
  color: #fffaf0;
  font-size: 13px;
  font-weight: 900;
}

.supplement {
  margin-top: 10px;
  padding: 10px;
  border-radius: 12px;
  background: #edf6ff;
  color: #23465f;
  line-height: 1.5;
}

textarea,
input[type="file"] {
  width: 100%;
  margin: 8px 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font: inherit;
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.secondary-dialog-button {
  background: var(--soft);
  color: var(--brand-dark);
}

.dialog-note {
  margin: 8px 0 14px;
  padding: 10px 12px;
  border: 1px dashed rgba(184, 123, 67, 0.45);
  border-radius: 14px;
  background: rgba(255, 244, 218, 0.72);
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.55;
}

.field-label {
  display: block;
  margin: 10px 0 6px;
  color: var(--brand-dark);
  font-weight: 900;
}

.text-input {
  width: 100%;
  min-height: 46px;
  margin-bottom: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffdf5;
  color: var(--ink);
  font: inherit;
}

.sync-status {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.sync-status[data-tone="ok"] {
  color: var(--brand-dark);
  font-weight: 800;
}

.sync-status[data-tone="error"] {
  color: var(--danger);
  font-weight: 800;
}

.sync-status[data-tone="loading"] {
  color: #9a6a20;
  font-weight: 800;
}

.phrase-card {
  display: grid;
  min-height: 58vh;
  place-items: center;
  gap: 18px;
  text-align: center;
}

.phrase-actions {
  position: sticky;
  bottom: 0;
  padding-top: 10px;
  background: linear-gradient(180deg, rgba(255,253,245,0), #fffdf5 38%);
}

.detail-image {
  display: block;
  width: calc(100% + 44px);
  height: 230px;
  margin: -22px -22px 16px;
  object-fit: cover;
  border-bottom: 1px solid var(--line);
}

.dish-box {
  margin: 8px 0;
  padding: 10px 12px;
  border: 1px dashed rgba(95, 127, 115, .28);
  border-radius: 14px;
  background: #fff8e7;
  color: var(--ink);
  line-height: 1.6;
}

.detail-text {
  color: var(--ink);
  font-size: 16px;
  line-height: 1.75;
}

.read-story-button {
  width: auto;
  margin: 0 0 14px;
  padding: 10px 16px;
}

.phrase-main {
  font-size: clamp(30px, 8vw, 64px);
  font-weight: 950;
  line-height: 1.2;
}

.phrase-sub {
  color: var(--muted);
  font-size: clamp(20px, 5vw, 34px);
  line-height: 1.35;
}

.day-button.active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fffaf0;
}

.day-label,
.day-city {
  display: block;
  white-space: nowrap;
}

.day-label {
  font-size: 17px;
}

.day-city {
  margin-top: 2px;
  font-size: 11px;
}

.phrase-zh {
  margin: 16px auto 22px;
  max-width: 760px;
  color: var(--muted);
  font-size: clamp(18px, 4.5vw, 30px);
  line-height: 1.45;
}

.inline-map-link {
  display: inline-block;
  margin-top: 6px;
  color: var(--brand-dark);
  font-weight: 900;
}

.detail-link {
  grid-column: 2;
  justify-self: start;
  margin-top: 10px;
  padding: 8px 12px;
  border: 1px solid rgba(95, 127, 115, .35);
  border-radius: 999px;
  background: #fff8e7;
  color: var(--brand-dark);
  font-weight: 900;
}

.tappable {
  cursor: pointer;
}

.tappable:active {
  transform: translateY(1px);
}

.tap-hint {
  grid-column: 2;
  margin-top: 8px;
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 900;
}

dialog {
  width: min(92vw, 420px);
  border: 0;
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow);
}

#rescueDialog {
  max-height: 86dvh;
  overflow-y: auto;
  padding-top: 58px;
}

#phraseDialog {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  border-radius: 0;
  padding: calc(18px + env(safe-area-inset-top)) 18px calc(18px + env(safe-area-inset-bottom));
}

#detailDialog {
  width: min(92vw, 560px);
  max-height: 86dvh;
  overflow-y: auto;
}

#toolDialog {
  width: min(92vw, 560px);
  max-height: 86dvh;
  overflow-y: auto;
  padding-top: 58px;
}

.tool-list {
  display: grid;
  gap: 10px;
}

#phraseDialog .phrase-card {
  min-height: calc(100dvh - 120px);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.35);
}

dialog button {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 12px;
  background: var(--brand);
  color: white;
  font-weight: 900;
}

@media (max-width: 390px) {
  #app {
    padding-right: 12px;
    padding-left: 12px;
  }

  h1 {
    font-size: 25px;
  }

  .quick-grid {
    grid-template-columns: 1fr;
  }

  .tool-grid { grid-template-columns: repeat(3, 1fr); }
  .prep-progress { grid-template-columns: 1fr; }
}
