:root {
  --ink: #17364a;
  --muted: #66797e;
  --teal: #166e70;
  --teal-soft: #dcefeb;
  --paper: #fffdf7;
  --nav-h: 72px;
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { background: #b8d7d6; color: var(--ink); }
button, a { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.app { position: relative; width: 100%; height: 100dvh; min-height: 560px; overflow: hidden; background: #d5ebea; }
.topbar { position: absolute; z-index: 30; top: 0; left: 0; right: 0; display: flex; align-items: stretch; justify-content: space-between; gap: 10px; padding: calc(9px + env(safe-area-inset-top)) 9px 6px; pointer-events: none; }
.trip-title, .itinerary-button { pointer-events: auto; border: 1px solid rgba(255,255,255,.82); background: rgba(255,253,247,.92); box-shadow: 0 8px 24px rgba(23,54,74,.13); backdrop-filter: blur(16px); }
.trip-title { display: flex; min-width: 0; height: 44px; align-items: center; padding: 0 10px; border-radius: 13px; }
.trip-title h1 { margin: 0; font-size: clamp(14px, 4vw, 16px); line-height: 1.15; white-space: nowrap; }
.itinerary-button { display: flex; flex: 0 0 auto; height: 44px; align-items: center; justify-content: center; gap: 5px; min-width: 69px; padding: 0 10px; border-radius: 13px; color: var(--teal); cursor: pointer; }
.itinerary-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.itinerary-button span { font-size: 12px; font-weight: 850; line-height: 1; white-space: nowrap; }

.day-switcher { position: absolute; z-index: 29; top: calc(59px + env(safe-area-inset-top)); left: 8px; right: 8px; display: flex; height: 43px; gap: 5px; padding: 4px; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; overscroll-behavior-y: none; touch-action: pan-x; border: 1px solid rgba(255,255,255,.75); border-radius: 14px; background: rgba(255,253,247,.9); box-shadow: 0 7px 20px rgba(23,54,74,.1); scrollbar-width: none; backdrop-filter: blur(15px); }
.day-switcher::-webkit-scrollbar { display: none; }
.day-switcher a { display: grid; flex: 0 0 auto; width: 61px; height: 35px; align-content: center; gap: 0; padding: 0 2px; overflow: visible; border-radius: 10px; color: var(--muted); text-align: center; text-decoration: none; white-space: nowrap; }
.day-switcher a[aria-pressed="true"] { background: var(--teal); color: #fff; }
.day-switcher b { font-size: 12px; line-height: 15px; }
.day-switcher span { display: block; justify-self: center; font-size: 9px; line-height: 11px; letter-spacing: 0; white-space: nowrap; }
.swipe-hint { position: sticky; z-index: 3; left: 0; display: grid !important; flex: 0 0 25px; align-self: stretch; min-width: 25px; height: auto; place-items: center; border-radius: 8px; background: linear-gradient(90deg, #fffdf7 62%, rgba(255,253,247,.55)); color: var(--teal); font-size: 16px !important; font-weight: 900; line-height: 1 !important; opacity: 1; overflow: hidden; pointer-events: none; transition: opacity .24s ease; }
.swipe-hint.is-fading { opacity: 0; }
.swipe-hint[hidden] { display: none !important; }

.day-transport[hidden], .day-transport-detail[hidden] { display: none !important; }
.day-transport { position: absolute; z-index: 28; top: calc(109px + env(safe-area-inset-top)); left: 9px; display: flex; max-width: calc(100% - 18px); align-items: flex-start; gap: 7px; }
.day-transport-toggle { display: grid; flex: 0 0 40px; width: 40px; height: 40px; place-items: center; padding: 0; border: 1px solid rgba(255,255,255,.82); border-radius: 50%; background: rgba(255,253,247,.88); box-shadow: 0 7px 20px rgba(23,54,74,.16); color: var(--teal); cursor: pointer; backdrop-filter: blur(14px); }
.day-transport-toggle svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.day-transport-toggle .plane-icon { fill: currentColor; stroke: none; }
.day-transport-detail { display: grid; min-width: 0; max-width: 285px; gap: 2px; padding: 7px 10px; border: 1px solid rgba(255,255,255,.72); border-radius: 12px; background: rgba(255,253,247,.76); box-shadow: 0 7px 20px rgba(23,54,74,.13); color: var(--ink); backdrop-filter: blur(13px); }
.day-transport-detail strong { font-size: 11px; line-height: 1.2; }
.day-transport-detail span, .day-transport-detail b { overflow: hidden; color: #516970; font-size: 9px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }

.map-shell, .country-overview, .detail-map { position: absolute; inset: 0; }
.country-overview { z-index: 1; display: grid; place-items: center; padding: 102px 0 calc(var(--nav-h) + 4px); background: #b9dcdf; }
.overview-stage { position: relative; flex: none; width: calc(100% - 16px); width: min(calc(100% - 16px), max(280px, calc((100vh - 178px - env(safe-area-inset-bottom)) * .85714))); width: min(calc(100% - 16px), max(280px, calc((100svh - 178px - env(safe-area-inset-bottom)) * .85714))); max-width: calc(100% - 16px); aspect-ratio: 6 / 7; }
.country-overview img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; }
.overview-overlay { position: absolute; z-index: 2; inset: 0; font-family: inherit; pointer-events: none; }
.overview-place, .overview-route { position: absolute; display: grid; place-items: center; border: 1px solid rgba(82,132,134,.48); background: rgba(255,253,247,.72); box-shadow: 0 4px 10px rgba(23,71,90,.16); color: var(--ink); text-align: center; white-space: nowrap; backdrop-filter: blur(4px); }
.overview-place { width: 76px; padding: 5px 4px; border-radius: 12px; }
.overview-place strong { font-size: 14px; line-height: 1; }
.overview-place span { margin-top: 3px; color: var(--teal); font-size: 10px; font-weight: 800; }
.overview-route { width: max-content; max-width: 58%; padding: 5px 6px; border-radius: 10px; background: rgba(255,253,247,.8); }
.overview-route strong { font-size: 11px; line-height: 1.05; }
.overview-route span { margin-top: 3px; color: #526b70; font-size: 9px; font-weight: 750; line-height: 1.05; }
.overview-place.is-shanghai { top: 37%; left: 10%; background: rgba(255,253,247,.5); }
.overview-place.is-seoul { top: 14%; left: 40%; background: rgba(255,253,247,.5); }
.overview-place.is-busan { top: 52%; left: 79%; }
.overview-place.is-jeju { top: 82%; left: 33%; background: rgba(255,253,247,.5); }
.overview-route.is-shanghai-seoul { top: 26%; left: 15%; }
.overview-route.is-seoul-busan { top: 31%; right: 0; }
.overview-route.is-seoul-busan span { font-size: 9px; letter-spacing: 0; }
.overview-route.is-busan-jeju { top: 64%; right: 0; }
.overview-route.is-jeju-shanghai { top: 66%; left: 1%; }
.detail-map { z-index: 2; background: #cfe6e7; }
.app[data-view="korea"] .detail-map, .app[data-view="korea"] .label-lines, .app[data-view="korea"] .marker-label-layer { display: none; }
.app:not([data-view="korea"]) .country-overview { display: none; }
.leaflet-container { font-family: inherit; touch-action: none; }
.leaflet-control-zoom { margin-right: 9px !important; margin-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 46px) !important; overflow: hidden; border: 0 !important; border-radius: 12px !important; box-shadow: 0 7px 20px rgba(23,54,74,.17) !important; }
.leaflet-control-zoom a { width: 34px !important; height: 34px !important; line-height: 32px !important; color: var(--teal) !important; border-color: #e4e9e3 !important; background: rgba(255,253,247,.94) !important; }
.leaflet-image-layer.local-map-image { image-rendering: auto; }
.leaflet-marker-icon.trip-marker-wrap { border: 0; background: transparent; }
.trip-marker { display: grid; width: 32px; height: 32px; place-items: center; border: 3px solid #fff; border-radius: 50%; background: conic-gradient(var(--point-color) 0 50%, var(--point-color-2) 0 100%); box-shadow: 0 3px 9px rgba(20,45,58,.33); color: #fff; }
.trip-marker.is-airport { background: var(--point-color); }
.trip-marker.is-station { border-radius: 9px; background: var(--point-color); }
.trip-marker.is-hotel { border-radius: 10px 10px 10px 3px; background: var(--point-color); }
.trip-marker b { font-size: 11px; line-height: 1; }
.trip-marker.is-multi-date b { font-size: 7.5px; letter-spacing: -.05em; }
.trip-marker svg { width: 19px; height: 19px; overflow: visible; fill: #fff; stroke: none; }
.trip-marker.is-station svg, .trip-marker.is-hotel svg { fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.marker-label-layer { position: absolute; z-index: 9; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.map-label { position: absolute; z-index: 1; display: block; width: max-content; max-width: 116px; min-height: 18px; padding: 0; border: 0; outline: none; background: transparent; color: #102d3d; font-size: 11px; font-weight: 900; line-height: 1.05; text-align: center; white-space: nowrap; pointer-events: auto; cursor: pointer; transform: translate(-50%, -100%); text-shadow: -2px -2px 0 #fff, 2px -2px 0 #fff, -2px 2px 0 #fff, 2px 2px 0 #fff, 0 2px 4px #fff; }
.map-label:focus-visible { border-radius: 4px; outline: 2px solid var(--point-color); outline-offset: 2px; }
.map-label.is-hidden { display: none; }

.map-legend { position: absolute; z-index: 12; left: 9px; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 9px); display: flex; max-width: 240px; flex-wrap: wrap; gap: 6px 9px; padding: 6px 8px; border-radius: 10px; background: rgba(255,253,247,.9); color: var(--muted); font-size: 8px; backdrop-filter: blur(10px); }
.app[data-view="korea"] .map-legend { display: none; }
.map-legend span { display: flex; align-items: center; gap: 4px; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }
.map-attribution { position: absolute; z-index: 12; right: 7px; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 7px); display: grid; justify-items: end; gap: 2px; padding: 3px 5px; border-radius: 6px; background: rgba(255,255,255,.82); color: #637477; font-size: 6.5px; }
.map-attribution a { color: var(--teal); font-size: 7px; font-weight: 850; }

.loading-state { position: absolute; z-index: 60; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; background: #d8eeee; transition: opacity .3s, visibility .3s; }
.app[data-ready="true"] .loading-state { opacity: 0; visibility: hidden; }
.loading-mark { width: 38px; height: 38px; border: 4px solid rgba(16,95,97,.15); border-top-color: var(--teal); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.view-switcher { position: absolute; z-index: 25; left: 0; right: 0; bottom: 0; display: grid; height: calc(var(--nav-h) + env(safe-area-inset-bottom)); grid-template-columns: 1.15fr repeat(3, 1fr); padding: 7px 7px calc(7px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(23,54,74,.08); background: rgba(255,253,247,.96); box-shadow: 0 -10px 30px rgba(23,54,74,.12); backdrop-filter: blur(18px); }
.view-switcher button { display: grid; place-content: center; justify-items: center; gap: 2px; padding: 0; border: 0; border-radius: 13px; background: transparent; color: #718184; font-size: 13px; font-weight: 750; line-height: 1; white-space: nowrap; cursor: pointer; }
.view-switcher button[aria-pressed="true"] { background: var(--teal-soft); color: var(--teal); }
.view-switcher svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.view-day { font-size: 11px; font-weight: 850; letter-spacing: .03em; }

.place-sheet { position: absolute; z-index: 21; left: 8px; right: 8px; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 7px); max-height: 61vh; padding: 21px 16px 17px; overflow-y: auto; border: 1px solid rgba(255,255,255,.85); border-radius: 22px; background: rgba(255,253,247,.98); box-shadow: 0 20px 46px rgba(23,54,74,.24); opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(calc(100% + 100px)); transition: transform .3s cubic-bezier(.2,.8,.2,1), opacity .2s, visibility .3s; backdrop-filter: blur(18px); }
.place-sheet.is-open { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0); }
.sheet-handle { position: absolute; top: 7px; left: 50%; width: 38px; height: 4px; border-radius: 4px; background: #c9d2d0; transform: translateX(-50%); }
.sheet-close, .drawer-close { position: absolute; top: 10px; right: 10px; display: grid; width: 34px; height: 34px; place-items: center; padding: 0; border: 0; border-radius: 50%; background: #edf2ee; color: var(--ink); cursor: pointer; }
.sheet-close svg, .drawer-close svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.place-meta { display: flex; gap: 6px; padding-right: 42px; }
.place-meta span { padding: 4px 7px; border-radius: 999px; background: #e8f1ec; color: var(--teal); font-size: 9px; font-weight: 850; }
.place-sheet h2 { margin: 9px 0 6px; font-size: 24px; }
.place-sheet > p { margin: 0; color: #52686e; font-size: 13px; line-height: 1.72; white-space: pre-line; }
.place-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 13px; }
.place-gallery figure { min-width: 0; margin: 0; overflow: hidden; border-radius: 12px; background: #e8ece7; }
.place-gallery img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; }
.place-gallery figcaption { padding: 5px 7px 6px; color: var(--muted); font-size: 7px; line-height: 1.35; }
.place-gallery a { color: inherit; }

.drawer-backdrop { position: absolute; z-index: 40; inset: 0; background: rgba(14,34,44,.45); opacity: 0; transition: opacity .28s; }
.drawer-backdrop.is-visible { opacity: 1; }
.itinerary-drawer { position: absolute; z-index: 41; top: 0; right: 0; bottom: 0; left: 0; display: flex; width: 100%; max-width: 100%; overflow: hidden; flex-direction: column; background: #fffdf7; box-shadow: -20px 0 50px rgba(14,34,44,.25); transform: translate3d(100%,0,0); transition: transform .3s cubic-bezier(.2,.8,.2,1); }
.itinerary-drawer.is-open { transform: translateX(0); }
.drawer-header { position: relative; padding: calc(18px + env(safe-area-inset-top)) 54px 15px 19px; border-bottom: 1px solid #e9ebe4; }
.drawer-kicker { color: var(--teal); font-size: 14px; font-weight: 850; letter-spacing: .08em; }
.drawer-header h2 { margin: 5px 0 0; font-size: 26px; }
.drawer-close { top: calc(18px + env(safe-area-inset-top)); right: 15px; }
.drawer-scroll { min-height: 0; flex: 1; padding: 15px 16px calc(30px + env(safe-area-inset-bottom)); overflow-y: auto; }
.drawer-jump { position: sticky; z-index: 5; top: -15px; display: flex; gap: 6px; margin: -15px -16px 14px; padding: 8px 16px; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; overscroll-behavior-y: none; touch-action: pan-x; border-bottom: 1px solid #e1e7e1; background: rgba(255,253,247,.97); box-shadow: 0 5px 12px rgba(23,54,74,.08); scrollbar-width: none; }
.drawer-jump::-webkit-scrollbar { display: none; }
.drawer-jump button { flex: 0 0 auto; padding: 7px 9px; border: 0; border-radius: 9px; background: #e9f0ec; color: var(--muted); font-size: 13px; font-weight: 850; white-space: nowrap; cursor: pointer; }
.drawer-jump button[aria-current="true"] { background: var(--teal); color: #fff; }
.timeline { margin: 18px 0 22px; padding: 0; list-style: none; }
.timeline-item { display: grid; grid-template-columns: 72px 1fr; gap: 14px; padding-bottom: 28px; }
.timeline-date { position: relative; display: grid; align-content: start; gap: 2px; text-align: center; }
.timeline-date select { position: absolute; inset: 0; width: 100%; height: 48px; opacity: 0; cursor: pointer; }
.timeline-date::after { content: ""; position: absolute; z-index: -1; top: 42px; bottom: -19px; left: 50%; width: 1px; background: #d9dfd9; }
.timeline-item:last-child .timeline-date::after { display: none; }
.timeline-date span { color: var(--day-color); font-size: 12px; font-weight: 900; letter-spacing: .08em; }
.timeline-date strong { font-size: 17px; }
.timeline-city { color: var(--teal); font-size: 14px; font-weight: 850; }
.timeline-content h3 { margin: 4px 0 8px; font-size: 22px; line-height: 1.25; }
.timeline-content > p { margin: 0 0 14px; color: var(--muted); font-size: 16px; line-height: 1.65; }
.timeline-transport { display: grid; grid-template-columns: 35px minmax(0, 1fr); gap: 9px; align-items: center; margin: -2px 0 13px; padding: 10px; border: 1px solid rgba(22,110,112,.17); border-radius: 12px; background: #edf6f2; color: var(--teal); }
.timeline-transport > span { display: grid; width: 35px; height: 35px; place-items: center; border-radius: 50%; background: var(--teal); color: #fff; }
.timeline-transport svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.timeline-transport .plane-icon { fill: currentColor; stroke: none; }
.timeline-transport div { display: grid; min-width: 0; gap: 2px; }
.timeline-transport strong { color: var(--ink); font-size: 14px; }
.timeline-transport small, .timeline-transport b { overflow: hidden; color: var(--muted); font-size: 12px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.day-places { display: grid; gap: 7px; margin: 0 0 9px; padding: 0; list-style: none; }
.day-places li { padding: 12px; border: 1px solid #e5e9e2; border-radius: 12px; background: #fff; }
.day-places button { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 8px; padding: 0; border: 0; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.day-places button span { font-size: 17px; font-weight: 850; }
.day-places button i { color: var(--teal); font-size: 12px; font-style: normal; white-space: nowrap; }
.day-places p { margin: 9px 0 0; color: #617277; font-size: 15px; line-height: 1.68; white-space: pre-line; }
.timeline-map { padding: 9px 0; border: 0; background: transparent; color: var(--teal); font-size: 15px; font-weight: 850; cursor: pointer; }
.timeline-item, .travel-section { scroll-margin-top: 58px; }
.travel-section { margin-top: 21px; }
.travel-section > h3 { padding-bottom: 10px; border-bottom: 1px solid #e4e8e1; font-size: 22px; }
.travel-row { display: grid; grid-template-columns: 54px 1fr; gap: 10px; align-items: start; padding: 14px 0; border-bottom: 1px solid #eef0eb; }
.travel-date { color: #e85d5d; font-size: 14px; font-weight: 900; }
.travel-row div { display: grid; gap: 2px; }
.travel-row strong { font-size: 16px; }
.travel-row div span, .travel-row > b { color: var(--muted); font-size: 14px; line-height: 1.45; }
.travel-row > b { grid-column: 2; white-space: nowrap; }
.hotel-row { display: grid; gap: 5px; padding: 14px 0; border-bottom: 1px solid #eef0eb; }
.hotel-row strong { font-size: 17px; }
.hotel-row span, .hotel-row address { color: var(--muted); font-size: 14px; line-height: 1.5; font-style: normal; }

@media (min-width: 700px) {
  .app { width: min(100%, 390px); margin: 0 auto; box-shadow: 0 0 60px rgba(23,54,74,.22); }
  body { display: grid; place-items: center; }
}
@media (max-height: 680px) {
  :root { --nav-h: 64px; }
  .trip-title h1 { font-size: 17px; }
  .itinerary-button { min-height: 45px; }
  .day-switcher { top: calc(59px + env(safe-area-inset-top)); }
  .day-transport { top: calc(109px + env(safe-area-inset-top)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
