/* Quiet guesthouse: linen paper, wood, sage. Serif headings, thin rules,
   lots of air, nothing loud. */
:root {
  --bg: #f5f1ea;
  --paper: #fbf9f4;
  --ink: #3b332b;
  --muted: #8a7f73;
  --line: #e4dccf;
  --wood: #a47551;
  --wood-deep: #8a5f40;
  --wood-ink: #fffaf3;
  --wood-soft: #f1e6da;
  --sage: #7d9a7e;
  --sage-deep: #5f7d61;
  --sage-soft: #e7eee5;
  --radius: 14px;
  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", Georgia, serif;
  --sans: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1f1b17;
    --paper: #27221d;
    --ink: #ece4d8;
    --muted: #a89c8d;
    --line: #3a332b;
    --wood: #c9976f;
    --wood-deep: #d8a882;
    --wood-ink: #1f1b17;
    --wood-soft: #3a2e24;
    --sage: #9db99e;
    --sage-deep: #b4ccb4;
    --sage-soft: #26302a;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.75 var(--sans);
  letter-spacing: .01em;
}
a { color: var(--sage-deep); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.35; margin: 0 0 .4em; letter-spacing: .02em; }
.muted { color: var(--muted); }

.top {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 960px; margin: 0 auto; padding: 22px 20px;
  border-bottom: 1px solid var(--line);
}
.brand { font-family: var(--serif); font-weight: 600; font-size: 1.15rem; color: var(--ink); letter-spacing: .04em; }
.brand:hover { text-decoration: none; }
.mark { margin-right: 4px; }
.lang {
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  border-radius: 999px; padding: 5px 14px; cursor: pointer; font: inherit; font-size: .85rem;
}
.lang:hover { color: var(--ink); border-color: var(--wood); }

main { max-width: 960px; margin: 0 auto; padding: 0 20px 64px; }
.card {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* ---------- hero & form ---------- */
.hero { padding-top: 56px; }
.hero h1 { font-size: clamp(1.7rem, 4.2vw, 2.5rem); max-width: 16em; }
.hero h1::after {
  content: ""; display: block; width: 44px; height: 2px;
  background: var(--wood); margin-top: 18px; border-radius: 2px;
}
.lede { color: var(--muted); max-width: 36em; margin: 18px 0 36px; }

.form { padding: 32px; display: grid; gap: 26px; }
.row.two { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.field { display: grid; gap: 10px; }
.field > span { font-family: var(--serif); font-weight: 600; font-size: .95rem; color: var(--ink); }
input, select {
  font: inherit; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; width: 100%;
}
input::placeholder { color: var(--muted); opacity: .8; }
input:focus, select:focus, .chip:focus-visible, button:focus-visible { outline: 2px solid var(--sage); outline-offset: 1px; }

.stepper { display: inline-flex; align-items: center; gap: 6px; }
.stepper button {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line);
  background: transparent; color: var(--ink); font-size: 1.2rem; cursor: pointer;
}
.stepper button:hover { border-color: var(--wood); color: var(--wood-deep); }
.stepper output { min-width: 48px; text-align: center; font-family: var(--serif); font-size: 1.4rem; font-weight: 600; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font: inherit; font-size: .9rem; cursor: pointer;
  padding: 6px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; color: var(--ink);
  transition: background .2s, border-color .2s, color .2s;
}
.chip:hover { border-color: var(--sage); }
.chip.on { background: var(--sage-soft); border-color: var(--sage); color: var(--sage-deep); font-weight: 600; }

.go {
  font: inherit; font-family: var(--serif); font-weight: 600; font-size: 1.05rem; letter-spacing: .1em; cursor: pointer;
  padding: 14px; border: 0; border-radius: 999px; margin-top: 6px;
  background: var(--wood); color: var(--wood-ink);
  transition: background .2s;
}
.go:hover { background: var(--wood-deep); }
.error { color: var(--wood-deep); margin: 0; text-align: center; }

/* ---------- loading ---------- */
.loading { margin-top: 72px; padding: 52px 24px; text-align: center; }
.spinner { font-size: 2.2rem; animation: steam 3s ease-in-out infinite; }
@keyframes steam { 50% { transform: translateY(-5px); opacity: .75; } }
.bar { height: 4px; background: var(--line); border-radius: 99px; overflow: hidden; max-width: 360px; margin: 22px auto 14px; }
.bar i { display: block; height: 100%; width: 3%; background: var(--sage); transition: width .6s ease; }
#loadingText { font-family: var(--serif); font-size: 1.15rem; margin: 12px 0 0; }

/* ---------- result ---------- */
.notice { background: var(--wood-soft); border-radius: 10px; padding: 10px 16px; margin: 28px 0 0; font-size: .92rem; }
.notice.soft { background: var(--sage-soft); }
.summary {
  margin-top: 28px; padding: 32px;
  display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: start;
}
.summary h2 { font-size: 2rem; }
.summary p { margin: 0; }
.eyebrow { color: var(--muted); font-size: .85rem; letter-spacing: .08em; margin: 0 0 6px; }
.pill-col { display: grid; gap: 12px; justify-items: end; }
.pill { background: var(--sage-soft); color: var(--sage-deep); padding: 6px 14px; border-radius: 999px; font-size: .88rem; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.ghost {
  font: inherit; font-size: .88rem; cursor: pointer; color: var(--muted);
  background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px;
}
.ghost:hover { color: var(--ink); border-color: var(--wood); }

/* The baseline is an inset shadow rather than a border, so the active tab's
   underline can sit on it without a negative margin (which made the
   overflow container grow a vertical scrollbar). */
.tabs {
  display: flex; gap: 6px; margin: 32px 0 20px;
  overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
  box-shadow: inset 0 -1px var(--line);
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  font: inherit; font-family: var(--serif); cursor: pointer; white-space: nowrap; color: var(--muted);
  background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 14px;
}
.tab:hover { color: var(--ink); }
.tab.on { color: var(--ink); font-weight: 600; border-bottom-color: var(--wood); }

.panel { display: grid; gap: 20px; }
.day { padding: 28px 28px 14px; }
.day-head { display: flex; gap: 18px; align-items: baseline; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px dashed var(--line); }
.day-head h3 { font-size: 1.25rem; }
.day-head p { margin: 0; font-size: .88rem; }
.day-num {
  flex: none; font-family: var(--serif); color: var(--wood-deep);
  font-weight: 600; font-size: 1rem; letter-spacing: .06em;
}

.timeline { list-style: none; margin: 0; padding: 0; }
.stop {
  display: grid; grid-template-columns: 54px 30px 1fr; gap: 10px;
  position: relative; padding-bottom: 18px;
}
.stop::before {
  content: ""; position: absolute; left: 78px; top: 32px; bottom: 2px;
  border-left: 1px solid var(--line);
}
.stop:last-child::before { display: none; }
.stop time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .88rem; padding-top: 4px; }
.dot {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--bg); border: 1px solid var(--line); font-size: .85rem;
}
.k-sight .dot { background: var(--sage-soft); border-color: transparent; }
.k-food .dot { background: var(--wood-soft); border-color: transparent; }
.stop-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding-top: 3px; }
.stop-title strong { font-weight: 600; }
.stop-body p { margin: 3px 0 0; color: var(--muted); font-size: .92rem; }
.k-transit .stop-title strong, .k-rest .stop-title strong { font-weight: 400; color: var(--muted); }

.alt-map {
  font-family: var(--sans); font-weight: 400; font-size: .75rem; white-space: nowrap;
  color: var(--muted); border: 1px solid var(--line); border-radius: 999px;
  padding: 0 8px; margin-left: 6px; vertical-align: middle;
}
.alt-map:hover { color: var(--sage-deep); border-color: var(--sage); text-decoration: none; }

.badge {
  font-size: .78rem; padding: 1px 10px; border-radius: 999px;
  background: transparent; border: 1px solid var(--line); color: var(--muted); white-space: nowrap;
}
.badge.cost { background: var(--wood-soft); border-color: transparent; color: var(--wood-deep); }
.badges { display: flex; gap: 6px; flex-wrap: wrap; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 20px; }
.tile { padding: 22px; display: grid; gap: 10px; align-content: start; }
.tile h3 { font-size: 1.05rem; margin: 0; }
.tile p { margin: 0; font-size: .94rem; }
.tile .meta { font-size: .88rem; color: var(--muted); }
.tile .badge { justify-self: start; }
.tips { padding: 24px 28px; }
.tips ul { margin: 0; padding-left: 1.2em; }
.tips li { padding-left: .2em; }
.tips li::marker { color: var(--sage); }
.tips li + li { margin-top: 8px; }

.foot {
  max-width: 960px; margin: 0 auto; text-align: center; font-size: .82rem;
  padding: 24px 20px 40px; border-top: 1px solid var(--line);
}

@media (max-width: 640px) {
  .hero { padding-top: 36px; }
  .row.two { grid-template-columns: 1fr; }
  .form { padding: 22px; gap: 22px; }
  .summary { grid-template-columns: 1fr; padding: 24px; }
  .pill-col, .actions { justify-items: start; justify-content: flex-start; }
  .day { padding: 22px 18px 10px; }
  .day-head { flex-direction: column; gap: 4px; }
  .stop { grid-template-columns: 44px 28px 1fr; gap: 8px; }
  .stop::before { left: 65px; }
  .dot { width: 28px; height: 28px; }
}

@media print {
  .top, .tabs, .actions, .notice, .foot, #hero { display: none !important; }
  body { background: #fff; }
  .card { break-inside: avoid; }
}
