/* 붉은 기와 지붕과 황해의 색. 중국 망에서도 뜨도록 웹폰트 없이 시스템 글꼴만 쓴다. */
:root {
  color-scheme: light;
  --roof: #b5412c;
  --sea: #123a4b;
  --amber: #d99a1c;
  --paper: #f4f7f4;
  --card: #ffffff;
  --ink: #17262c;
  --muted: #5c6f76;
  --line: #d6e0dc;
  --tint: #fbeee9;
  --ko: "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
  --zh: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--paper); color: var(--ink); font: 15px/1.55 var(--ko); }
[lang="zh"] { font-family: var(--zh); }
[hidden] { display: none !important; }
button, a { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--roof); outline-offset: 2px; }

.app {
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template: "top" auto "map" 38% "panel" minmax(0, 1fr) / minmax(0, 1fr);
  padding-top: env(safe-area-inset-top, 0px);
}

/* 머리글 */
.top {
  grid-area: top;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 10px 16px;
  background: var(--sea);
  color: #fff;
}
.brand { min-width: 0; }
.brand h1 { margin: 0; font-size: 20px; line-height: 1.2; letter-spacing: -0.01em; }
.brand h1 span { font-weight: 400; opacity: 0.75; margin-left: 2px; }
.brand p { margin: 0; font-size: 12px; opacity: 0.8; font-variant-numeric: tabular-nums; }
.views { display: flex; gap: 2px; background: rgb(255 255 255 / 0.12); border-radius: 8px; padding: 2px; }
.views button {
  border: 0; background: transparent; color: #fff;
  padding: 6px 8px; border-radius: 6px; font-size: 13.5px; white-space: nowrap;
}
.views button.on { background: #fff; color: var(--sea); font-weight: 700; }

/* 지도 */
.mapwrap { grid-area: map; position: relative; min-height: 0; background: #dfe9e6; }
#map { position: absolute; inset: 0; }
.tile-toggle {
  position: absolute; right: 10px; top: 10px; z-index: 500;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 8px; padding: 5px 10px; font-size: 12px;
}
.toast {
  position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 500;
  width: max-content; max-width: calc(100% - 32px);
  background: var(--sea); color: #fff; border-radius: 8px; padding: 6px 12px; font-size: 13px;
}
.pin {
  display: flex; align-items: center; justify-content: center;
  height: 28px; min-width: 28px; padding: 0 7px;
  border: 2px solid #fff; border-radius: 14px;
  background: var(--roof); color: #fff;
  font: 700 13px/1 var(--ko); font-variant-numeric: tabular-nums;
  box-shadow: 0 1px 4px rgb(0 0 0 / 0.4);
  width: max-content; transform: translate(-50%, -50%);
}
.pin.hotel { background: var(--sea); }
.pin.air { background: var(--amber); color: var(--ink); }
.pin.sel { outline: 3px solid var(--amber); }
.leaflet-div-icon-reset { background: none; border: 0; }
.leaflet-tooltip { font: 600 12px/1.3 var(--ko); }

/* 일정 패널 */
.panel { grid-area: panel; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: env(safe-area-inset-bottom, 0px); }
.days {
  position: sticky; top: 0; z-index: 10;
  display: flex; gap: 4px;
  padding: 10px 16px; background: var(--paper); border-bottom: 1px solid var(--line);
}
.days button {
  flex: 1 1 0; min-width: 0; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 8px; padding: 5px 2px; text-align: center; line-height: 1.25; white-space: nowrap;
}
.days b { display: block; font-size: 13px; font-variant-numeric: tabular-nums; }
.days small { font-size: 10.5px; color: var(--muted); }
.days button.on { background: var(--roof); border-color: var(--roof); color: #fff; }
.days button.on small { color: #fff; }

.body { padding: 14px 16px 28px; display: grid; gap: 14px; }
.intro h2 { margin: 0; font-size: 19px; line-height: 1.3; text-wrap: balance; }
.intro p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.stay {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px;
  background: var(--sea); color: #fff; border-radius: 8px; padding: 8px 12px; font-size: 13px;
}
.stay b { font-weight: 700; }

.budget { display: flex; flex-wrap: wrap; gap: 2px 12px; border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: 8px 12px; font-size: 13px; }
.budget b { color: var(--roof); }
.sec > .fine { margin: 0; font-size: 13px; color: var(--muted); }
.pass[data-go] { cursor: pointer; }
.alert { background: var(--tint); border-radius: 8px; padding: 10px 12px; font-size: 14px; }
.alert b { color: var(--roof); }

.stops { list-style: none; margin: 0; padding: 0; }
.stop {
  display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 0 10px;
  padding: 10px 8px; border-radius: 8px; border-bottom: 1px solid var(--line);
}
.stop:last-child { border-bottom: 0; }
.stop[data-i] { cursor: pointer; }
.stop.sel { background: var(--tint); border-bottom-color: transparent; }
.time { font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; padding-top: 1px; }
.stop h3 { margin: 0; font-size: 16px; line-height: 1.35; }
.stop h3 .n {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; margin-right: 6px; border-radius: 50%;
  background: var(--roof); color: #fff; font-size: 12px; vertical-align: 1px;
}
.stop.hotel h3 .n { background: var(--sea); }
.stop.air h3 .n { background: var(--amber); color: var(--ink); }
.stop h3 .opt { margin-left: 6px; padding: 1px 6px; border: 1px solid var(--roof); border-radius: 4px; color: var(--roof); font-size: 11px; font-weight: 700; vertical-align: 2px; }
.stop .zh { font-size: 13px; color: var(--muted); }
.stop p { margin: 3px 0 0; font-size: 14px; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px; font-size: 13px; color: var(--muted); }
.acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.acts button, .acts a {
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 6px; padding: 4px 10px; font-size: 13px; text-decoration: none;
}

/* 예약·준비 */
.sec { display: grid; gap: 8px; }
.sec h2 { margin: 0; font-size: 17px; }
.pass { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.pass .date { font-size: 13px; color: var(--muted); }
.legs { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; margin: 4px 0; }
.legs div:last-child { text-align: right; }
.legs b { display: block; font-size: 24px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.legs small { color: var(--muted); font-size: 12px; }
.legs span { color: var(--muted); }
.pass .fine { margin: 0; font-size: 13px; color: var(--muted); }
.pass h3 { margin: 0; font-size: 16px; }
.pass p { margin: 2px 0 0; font-size: 14px; }
.tips { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 14px; }
.check { list-style: none; margin: 0; padding: 0; }
.check label { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; flex: none; accent-color: var(--roof); }
.check input:checked + span { color: var(--muted); text-decoration: line-through; }
.count { font-size: 13px; color: var(--muted); font-weight: 400; margin-left: 6px; }

/* 택시 카드 */
.taxi { border: 0; padding: 24px 20px; width: min(560px, calc(100vw - 24px)); border-radius: 12px; background: var(--card); color: var(--ink); }
.taxi::backdrop { background: rgb(18 58 75 / 0.75); }
.taxi p { margin: 0; }
.taxi-ko { color: var(--muted); font-size: 14px; }
.taxi-ask { font-size: 18px; margin-top: 10px !important; }
.taxi-zh { font-size: clamp(32px, 10vw, 46px); font-weight: 700; line-height: 1.2; margin-top: 10px !important; overflow-wrap: anywhere; }
.taxi-addr { font-size: 20px; margin-top: 8px !important; }
.taxi-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.taxi-actions button, .taxi-actions a {
  flex: 1 1 auto; text-align: center; border: 1px solid var(--line); background: var(--card);
  color: var(--ink); border-radius: 8px; padding: 10px; text-decoration: none; font-size: 14px;
}
.taxi-actions #taxiClose { background: var(--sea); border-color: var(--sea); color: #fff; }

@media (min-width: 860px) {
  .app { grid-template: "top top" auto "panel map" minmax(0, 1fr) / 440px minmax(0, 1fr); }
  .panel { border-right: 1px solid var(--line); }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
