/* LocalRoute — printed route-leaflet style.
   Palette (roles, not decoration):
   ink   — text, primary actions, stop markers
   paper — background
   rule  — hairlines
   mute  — secondary text
   line6 — the route itself (Seoul Subway Line 6, Mangwon Stn.) — used ONLY for route/position */
:root {
  --ink: #141414;
  --paper: #ffffff;
  --rule: #d9d9d6;
  --mute: #6b6b66;
  --line6: #cd7c2f;
  --sans: "IBM Plex Sans", "IBM Plex Sans KR", "IBM Plex Sans JP", "PingFang SC", "Microsoft YaHei", "Malgun Gothic", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}
:lang(ja) body { --sans: "IBM Plex Sans", "IBM Plex Sans JP", "Hiragino Sans", "Yu Gothic", sans-serif; }
:lang(zh-Hans) body { --sans: "IBM Plex Sans", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif; }

* { box-sizing: border-box; }
body { margin: 0; font-family: var(--sans); background: var(--paper); color: var(--ink);
  line-height: 1.55; -webkit-font-smoothing: antialiased; }
main { max-width: 560px; margin: 0 auto; padding: 0 20px 56px; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 1000; display: flex; justify-content: space-between; align-items: center;
  max-width: 560px; margin: 0 auto; padding: 14px 20px; background: var(--paper); border-bottom: 2px solid var(--ink); }
.brand { font-weight: 700; font-size: 17px; letter-spacing: -0.01em; text-decoration: none; }
.brand b { color: var(--line6); font-weight: 700; }
.lang { font: 600 14px var(--sans); border: 1px solid var(--ink); background: var(--paper); color: var(--ink);
  border-radius: 0; padding: 8px 10px; min-height: 40px; cursor: pointer; }

/* Intro */
.intro { padding: 28px 0 20px; }
.eyebrow { font-size: 13px; font-weight: 600; color: var(--mute); margin: 0 0 10px; }
.intro h1 { font-size: 30px; line-height: 1.18; letter-spacing: -0.02em; font-weight: 700; margin: 0 0 12px; }
.lede { margin: 0; color: var(--ink); font-size: 16px; max-width: 34em; }
.meta { font-size: 14px; font-variant-numeric: tabular-nums; color: var(--mute); margin: 16px 0 0; padding-top: 12px; border-top: 1px solid var(--rule); }
.meta span + span::before { content: " / "; color: var(--rule); }

#map { height: 300px; border: 1px solid var(--ink); margin: 4px 0 32px; }

/* Section heading */
h2 { font-size: 15px; font-weight: 700; margin: 0 0 4px; }

/* Route diagram — vertical line with stops, like a subway line map */
.route { list-style: none; margin: 0; padding: 0; position: relative; }
.route::before { content: ""; position: absolute; left: 15px; top: 28px; bottom: 28px; width: 4px; background: var(--line6); }
.stop { position: relative; display: flex; align-items: center; gap: 16px; padding: 14px 0; min-height: 64px;
  text-decoration: none; border-bottom: 1px solid var(--rule); }
.route li:last-child .stop { border-bottom: 0; }
.no { flex: none; position: relative; z-index: 1; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  font: 500 13px var(--mono); background: var(--paper); border: 2px solid var(--ink); }
.stop .body { flex: 1; min-width: 0; }
.stop .name { display: block; font-weight: 600; font-size: 17px; line-height: 1.3; }
.stop .cat { display: block; color: var(--mute); font-size: 13px; }
.stop .go { font-size: 14px; white-space: nowrap; color: var(--mute); }
.stop:hover .name { text-decoration: underline; text-underline-offset: 3px; }
.stop:hover .go { color: var(--ink); }
.stop.active .no { background: var(--ink); color: var(--paper); }

/* Map markers */
.pin { width: 26px; height: 26px; display: flex; align-items: center; justify-content: center;
  background: var(--paper); color: var(--ink); border: 2px solid var(--ink); font: 600 12px var(--mono); }
.pin.active { background: var(--ink); color: var(--paper); }

/* Detail */
.back { display: inline-block; margin: 18px 0 0; padding: 6px 0; font-size: 14px; color: var(--mute); text-decoration: none; }
.back:hover { color: var(--ink); }
.stopline { font-size: 13px; font-weight: 600; color: var(--mute); margin: 22px 0 8px; display: flex; gap: 10px; align-items: center; }
.stopline .cur, .stopline .tot { font-family: var(--mono); }
.stopline .cur { color: var(--paper); background: var(--ink); padding: 1px 6px; }
.progress { display: flex; gap: 4px; margin: 0 0 18px; }
.progress i { flex: 1; height: 4px; background: var(--rule); }
.progress i.on { background: var(--line6); }
.detail h1 { font-size: 30px; line-height: 1.18; letter-spacing: -0.02em; margin: 0 0 10px; }
.detail .lede { margin-bottom: 28px; }

/* Phrase — the one thing a traveler actually reads aloud, so it gets the size */
.phrase { border-top: 2px solid var(--ink); border-bottom: 1px solid var(--rule); padding: 16px 0 18px; margin-bottom: 8px; }
.label { font-size: 13px; font-weight: 600; color: var(--mute); margin: 0 0 6px; }
.phrase .ko { font-family: "IBM Plex Sans KR", var(--sans); font-size: 28px; font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; }
.phrase .roman { font: 400 15px var(--mono); color: var(--ink); margin-top: 4px; }
.phrase .tr { color: var(--mute); margin-top: 6px; }

/* Facts — label/value rows */
.facts { margin: 0; }
.facts div { display: grid; grid-template-columns: 9.5em 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.facts dt { font-size: 13px; font-weight: 600; color: var(--mute); padding-top: 2px; }
.facts dd { margin: 0; }
@media (max-width: 380px) { .facts div { grid-template-columns: 1fr; gap: 2px; } }

/* Audio */
.audio { margin: 28px 0 0; padding: 16px 0 0; border-top: 2px solid var(--ink); }
.audio .t { font-weight: 600; margin-bottom: 10px; }
.audio audio { width: 100%; }
.credit { font-size: 12px; color: var(--mute); margin-top: 6px; }

/* Actions */
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 28px; }
.btn { display: flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 14px; text-align: center;
  font-weight: 600; text-decoration: none; border: 2px solid var(--ink); background: var(--paper); color: var(--ink); }
.btn:hover { background: #f2f2f0; }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.primary:hover { background: #333; }
.mapnote { font-size: 13px; color: var(--mute); }
.mapnote a { text-underline-offset: 3px; }

/* ---------- Landing / planner ---------- */
.intro-tight { padding-top: 8px; }
.plan-cta { display: block; margin: 0 0 32px; padding: 18px 20px; background: var(--ink); color: var(--paper); text-decoration: none; }
.plan-cta-t { display: block; font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.plan-cta-s { display: block; margin-top: 4px; font-size: 14px; color: #c9c9c4; }
.plan-cta:hover .plan-cta-t { text-decoration: underline; text-underline-offset: 4px; }
.stop .themes { display: block; font-size: 12px; color: var(--mute); margin-top: 2px; }
.tag { font-weight: 600; color: var(--line6); }
.daytag { font-family: var(--mono); color: var(--paper); background: var(--line6); padding: 1px 6px; margin-right: 4px; }
.fallback { font-size: 13px; color: var(--mute); border-left: 3px solid var(--rule); padding-left: 10px; margin: 12px 0 0; }

.quiz fieldset { border: 0; margin: 0; padding: 18px 0; border-top: 1px solid var(--rule); }
.quiz legend { float: left; width: 100%; font-weight: 700; font-size: 16px; padding: 0; margin-bottom: 10px; }
.quiz legend + * { clear: both; }
.opts { display: flex; flex-wrap: wrap; gap: 6px; }
.opt { position: relative; }
.opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.opt span { display: flex; align-items: center; min-height: 44px; min-width: 44px; justify-content: center; padding: 0 14px;
  border: 2px solid var(--ink); font-weight: 600; font-size: 15px; cursor: pointer; user-select: none; }
.opt input:checked + span { background: var(--ink); color: var(--paper); }
.opt input:focus-visible + span { outline: 2px solid var(--line6); outline-offset: 2px; }
.err { color: #b42318; font-weight: 600; font-size: 14px; margin: 10px 0 0; }
.btn.wide { width: 100%; margin-top: 20px; font-size: 16px; cursor: pointer; font-family: inherit; }

.days { list-style: none; margin: 8px 0 0; padding: 0; }
.dayrow { padding: 20px 0; border-top: 2px solid var(--ink); }
.dayno { font: 500 13px var(--mono); color: var(--mute); margin: 0 0 4px; }
.dayno .tag { font-family: var(--sans); }
.dayrow h2 { font-size: 22px; margin: 0; letter-spacing: -0.01em; }
.dtitle { margin: 2px 0 8px; color: var(--mute); }
.why { margin: 0 0 10px; font-size: 14px; border-left: 3px solid var(--line6); padding-left: 10px; }
.mini { margin: 0 0 14px; padding-left: 1.4em; font-size: 15px; }
.mini li { padding: 2px 0; }
.mini li::marker { font-family: var(--mono); color: var(--mute); }
.dayrow .btn { display: inline-flex; min-height: 44px; }

/* Recently viewed routes */
.recent { list-style: none; margin: 0 0 32px; padding: 0; border-top: 1px solid var(--rule); }
.recent li { display: flex; align-items: stretch; border-bottom: 1px solid var(--rule); }
.recent a { flex: 1; min-width: 0; padding: 12px 0; text-decoration: none; }
.recent .rt { display: block; font-weight: 600; }
.recent .rs { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent .rd { display: block; font: 400 12px var(--mono); color: var(--mute); margin-top: 2px; }
.recent a:hover .rt { text-decoration: underline; text-underline-offset: 3px; }
.rdel { flex: none; width: 44px; border: 0; background: none; color: var(--mute); font-size: 22px; cursor: pointer; }
.rdel:hover { color: var(--ink); }
