/* Layout: one mobile column styled like a Japanese station board; a sticky fare-slip bar at the bottom carries the verdict. */
:root {
  --paper: #f2f4f8;
  --card: #ffffff;
  --ink: #16213b;
  --muted: #5b6478;
  --line: #d9dee8;
  --accent: #e3ac00;
  --accent-ink: #1b1400;
  --good: #17784a;
  --good-bg: #e3f4ea;
  --bad: #b83d28;
  --bad-bg: #fbe8e4;
  --chip: #eef1f6;
  --font-display: "Black Han Sans", "IBM Plex Sans KR", "Apple SD Gothic Neo", sans-serif;
  --font-body: "IBM Plex Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --font-num: "IBM Plex Mono", ui-monospace, "SFMono-Regular", monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0e1423; --card: #161f34; --ink: #e7ebf3; --muted: #9aa3b8; --line: #2a3551;
    --accent: #f0c23a; --accent-ink: #1b1400; --good: #55c98f; --good-bg: #13301f;
    --bad: #f08068; --bad-bg: #3a1a14; --chip: #1f2a44; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0e1423; --card: #161f34; --ink: #e7ebf3; --muted: #9aa3b8; --line: #2a3551;
  --accent: #f0c23a; --accent-ink: #1b1400; --good: #55c98f; --good-bg: #13301f;
  --bad: #f08068; --bad-bg: #3a1a14; --chip: #1f2a44; color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font-body); font-size: 15px; line-height: 1.55;
  padding-inline: 16px; padding-block: 20px 120px;
}
.wrap { max-width: 560px; margin-inline: auto; display: grid; gap: 22px; }
h1, h2 { text-wrap: balance; margin: 0; }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Station board hero */
.board { background: var(--card); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.board-top { padding: 18px 18px 12px; text-align: center; display: grid; gap: 2px; }
.board-kana { font-size: 12px; letter-spacing: .18em; color: var(--muted); }
.board h1 { font-family: var(--font-display); font-weight: 400; font-size: clamp(30px, 8vw, 40px); line-height: 1.15; letter-spacing: -.01em; }
.board-en { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.board-band { background: var(--accent); color: var(--accent-ink); display: flex; justify-content: space-between; padding: 7px 14px; font-weight: 700; font-size: 13px; }
.board-lede { margin: 0; padding: 12px 18px 16px; color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); }

/* Sections */
section { display: grid; gap: 12px; }
.sec-head { display: flex; align-items: baseline; gap: 10px; }
.sec-no { font-family: var(--font-num); font-size: 12px; color: var(--accent-ink); background: var(--accent); border-radius: 3px; padding: 1px 6px; }
h2 { font-size: 17px; font-weight: 700; }
.hint { font-size: 13px; color: var(--muted); margin: 0; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 14px; display: grid; gap: 14px; }

.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg button {
  border: 1.5px solid var(--line); background: var(--card); border-radius: 6px; padding: 10px 8px;
  display: grid; gap: 2px; text-align: center; cursor: pointer;
}
.seg button b { font-size: 15px; }
.seg button span { font-size: 13px; color: var(--muted); }
.seg button[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--card); }
.seg button[aria-pressed="true"] span { color: inherit; opacity: .8; }

.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.row label { font-weight: 500; }
.row .sub { font-size: 12.5px; color: var(--muted); font-weight: 400; display: block; }
input[type="date"], select, input[type="number"] {
  border: 1px solid var(--line); background: var(--paper); border-radius: 6px; padding: 8px 10px; min-height: 40px;
}
input[type="number"] { width: 90px; text-align: right; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.stepper button { width: 40px; height: 40px; border: 0; background: var(--chip); cursor: pointer; font-size: 18px; }
.stepper output { min-width: 48px; text-align: center; font-family: var(--font-num); font-size: 16px; }
.day-note { font-size: 13px; color: var(--muted); }

/* Presets */
.presets { display: flex; gap: 8px; flex-wrap: wrap; }
.presets button {
  border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer;
}
.presets button:hover { border-color: var(--ink); }

/* Facility list */
.area { background: var(--card); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.area summary {
  list-style: none; cursor: pointer; padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 700;
}
.area summary::-webkit-details-marker { display: none; }
.area summary .cnt { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.area summary .cnt.on { color: var(--good); }
.area summary::after { content: "▾"; color: var(--muted); transition: transform .15s; }
.area[open] summary::after { transform: rotate(180deg); }
.fac { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: start; padding: 11px 14px; border-top: 1px solid var(--line); cursor: pointer; }
.fac input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--ink); cursor: pointer; }
.fac-main { min-width: 0; display: grid; gap: 4px; }
.fac-name { font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { font-size: 11.5px; padding: 1px 7px; border-radius: 4px; background: var(--chip); color: var(--muted); }
.chip.warn { background: var(--bad-bg); color: var(--bad); font-weight: 500; }
.fac-price { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-size: 14px; text-align: right; white-space: nowrap; }
.fac.off { cursor: not-allowed; }
.fac.off .fac-name, .fac.off .fac-price { color: var(--muted); text-decoration: line-through; }

/* Result */
.verdict { border-radius: 6px; padding: 16px; display: grid; gap: 6px; border: 1.5px solid var(--line); background: var(--card); }
.verdict.good { border-color: var(--good); background: var(--good-bg); }
.verdict.bad { border-color: var(--bad); background: var(--bad-bg); }
.verdict-label { font-size: 13px; font-weight: 700; letter-spacing: .04em; }
.verdict.good .verdict-label, .verdict.good .verdict-amt { color: var(--good); }
.verdict.bad .verdict-label, .verdict.bad .verdict-amt { color: var(--bad); }
.verdict-amt { font-family: var(--font-display); font-weight: 400; font-size: 34px; line-height: 1.1; }
.verdict p { margin: 0; font-size: 14px; }
.receipt { width: 100%; border-collapse: collapse; font-size: 14px; }
.receipt td { padding: 7px 0; border-bottom: 1px dashed var(--line); }
.receipt td:last-child { text-align: right; font-family: var(--font-num); font-variant-numeric: tabular-nums; white-space: nowrap; }
.receipt tr.total td { font-weight: 700; border-bottom: 0; border-top: 1.5px solid var(--ink); }
.receipt .muted { color: var(--muted); font-size: 12.5px; }
.alt { font-size: 13.5px; padding: 10px 12px; background: var(--chip); border-radius: 6px; }
.warnbox { font-size: 13.5px; padding: 10px 12px; background: var(--bad-bg); color: var(--bad); border-radius: 6px; }
.cta {
  display: block; text-align: center; background: var(--ink); color: var(--card); text-decoration: none;
  padding: 14px; border-radius: 6px; font-weight: 700;
}
.cta small { display: block; font-weight: 400; opacity: .75; font-size: 12px; }

.fineprint { font-size: 12.5px; color: var(--muted); display: grid; gap: 6px; }
.fineprint p { margin: 0; }
.fineprint a { color: inherit; }

/* Sticky fare slip */
.slip {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  background: var(--card); border-top: 1px solid var(--line);
  box-shadow: 0 -6px 18px rgba(10, 20, 40, .08);
}
.slip-inner { max-width: 560px; margin-inline: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.slip-l { font-size: 12.5px; color: var(--muted); line-height: 1.35; min-width: 0; }
.slip-l b { color: var(--ink); font-weight: 500; }
.slip-r { text-align: right; white-space: nowrap; }
.slip-amt { font-family: var(--font-display); font-size: 24px; line-height: 1.1; }
.slip-amt.good { color: var(--good); } .slip-amt.bad { color: var(--bad); }
.slip-krw { font-size: 12px; color: var(--muted); }
.slip a { color: inherit; text-decoration: none; display: block; }

/* Site nav + guide content */
.topnav { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.topnav a { color: var(--ink); text-decoration: none; }
.brand { font-family: var(--font-display); font-size: 18px; letter-spacing: -.01em; }
.brand span { background: var(--accent); color: var(--accent-ink); padding: 0 5px; border-radius: 3px; margin-right: 3px; }
.guide { display: grid; gap: 14px; }
.guide h2 { font-size: 19px; }
.guide h3 { font-size: 15.5px; margin: 0; }
.guide p, .guide ul { margin: 0; max-width: 65ch; }
.guide ul { padding-left: 1.2em; display: grid; gap: 4px; }
.price-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.price-table th, .price-table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.price-table td.num { text-align: right; }
.faq { display: grid; gap: 8px; }
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; }
.faq summary { cursor: pointer; font-weight: 500; }
.faq details p { margin-top: 8px; color: var(--muted); font-size: 14px; }
.disclose { font-size: 12px; color: var(--muted); text-align: center; margin: 0; }
.sitefoot { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; }
.sitefoot a { color: var(--muted); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* Tax-free calculator: item rows */
.items { display: grid; gap: 0; background: var(--card); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.item { display: grid; grid-template-columns: 1fr auto; gap: 8px 10px; padding: 12px 14px; border-top: 1px solid var(--line); }
.item:first-child { border-top: 0; }
.item-name { min-width: 0; width: 100%; border: 0; background: transparent; padding: 0; font-weight: 500; min-height: 28px; }
.item-name:focus { outline: none; box-shadow: inset 0 -2px 0 var(--accent); }
.item-del { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 13px; padding: 4px 6px; }
.item-ctrl { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.item-ctrl input[type="number"] { width: 96px; }
.item-ctrl .qty { width: 64px; }
.item-ctrl select { min-height: 40px; }
.item-ctrl .x { color: var(--muted); font-size: 13px; }
.item-sum { margin-left: auto; font-family: var(--font-num); font-variant-numeric: tabular-nums; font-size: 14px; }
.items-empty { padding: 18px 14px; color: var(--muted); font-size: 14px; text-align: center; }
.add-row { display: flex; gap: 8px; }
.add-row button { flex: 1; border: 1.5px dashed var(--line); background: transparent; border-radius: 6px; padding: 10px; cursor: pointer; font-weight: 500; }
.add-row button:hover { border-color: var(--ink); }
.shop-group { display: grid; gap: 8px; }
.shop-group h3 { font-size: 13px; color: var(--muted); font-weight: 500; margin: 0; }
.meter { height: 8px; background: var(--chip); border-radius: 999px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width .2s; }
.meter.full i { background: var(--good); }
.banner { font-size: 13.5px; padding: 10px 12px; border-radius: 6px; background: var(--chip); }
.steps { counter-reset: s; list-style: none; padding: 0; display: grid; gap: 10px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; }
.steps li::before { content: counter(s); font-family: var(--font-num); font-size: 13px; background: var(--ink); color: var(--card); border-radius: 50%; width: 24px; height: 24px; display: grid; place-items: center; }
.shoplist { width: 100%; border-collapse: collapse; font-size: 14px; }
.shoplist th, .shoplist td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.shoplist td:nth-child(2) { white-space: nowrap; font-family: var(--font-num); }
.table-scroll { overflow-x: auto; }

/* Kansai pass: route rows with steppers */
.route { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; padding: 12px 14px; border-top: 1px solid var(--line); }
.route:first-child { border-top: 0; }
.route-name { font-weight: 500; min-width: 0; }
.route-meta { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.route-meta input { width: 84px; min-height: 34px; padding: 4px 8px; }
.route .stepper button { width: 36px; height: 36px; }
.route .stepper output { min-width: 36px; }
.options { display: grid; gap: 8px; }
.opt { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 6px; background: var(--card); }
.opt b { font-size: 15px; }
.opt .opt-sub { font-size: 12.5px; color: var(--muted); grid-column: 1; }
.opt .opt-price { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-family: var(--font-num); font-variant-numeric: tabular-nums; font-size: 16px; font-weight: 600; }
.opt.best { border-color: var(--good); background: var(--good-bg); }
.opt.best b::after { content: " 추천"; font-size: 11.5px; color: var(--good); font-weight: 700; margin-left: 4px; }
.opt.na { opacity: .6; }

/* Guide articles */
body.article { padding-block: 20px 56px; }
.crumbs { font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); }
.art-head { display: grid; gap: 8px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .06em; color: var(--accent-ink); background: var(--accent); justify-self: start; padding: 2px 8px; border-radius: 3px; }
.art-head h1 { font-family: var(--font-display); font-weight: 400; font-size: clamp(26px, 6.6vw, 34px); line-height: 1.25; }
.art-meta { font-size: 13px; color: var(--muted); }
.article-body { display: grid; gap: 16px; font-size: 15.5px; line-height: 1.75; }
.article-body > * { margin: 0; max-width: 68ch; }
.article-body h2 { font-size: 20px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.article-body h3 { font-size: 16px; margin-top: 4px; }
.article-body ul { padding-left: 1.2em; display: grid; gap: 6px; }
.article-body .lede { font-size: 16.5px; }
.article-body .table-scroll, .article-body .price-table { max-width: 100%; }
.article-body .price-table th { background: var(--chip); font-weight: 500; }
.summary { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 6px; padding: 14px 16px; display: grid; gap: 8px; }
.summary ul { margin: 0; }
.note-small { font-size: 13px; color: var(--muted); }
.cta-box { background: var(--ink); color: var(--card); border-radius: 8px; padding: 18px; display: grid; gap: 8px; }
.cta-box p { margin: 0; opacity: .85; font-size: 14.5px; }
.cta-box a { justify-self: start; background: var(--accent); color: var(--accent-ink); font-weight: 700; text-decoration: none; padding: 10px 14px; border-radius: 6px; }
.related { display: grid; gap: 8px; }
.related h2 { font-size: 17px; }
.related a { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; color: var(--ink); text-decoration: none; font-weight: 500; }
.related a:hover { border-color: var(--ink); }
.related a span { display: block; font-size: 12.5px; color: var(--muted); font-weight: 400; }
.guide-list { display: grid; gap: 22px; }
.guide-list section { display: grid; gap: 8px; }
.guide-list h2 { font-size: 17px; }
.howto { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.howto li { counter-increment: s; display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; }
.howto li::before { content: counter(s); font-family: var(--font-num); font-size: 13px; background: var(--accent); color: var(--accent-ink); border-radius: 50%; width: 24px; height: 24px; display: grid; place-items: center; font-weight: 600; }
