/* norikata — station-signage look: paper white, ink black, one signal yellow; operator line colours carry the rest.
   Mobile first: 390px phone width, 16px gutter, 44px touch targets. */
:root {
  --ground: #F6F6F3;
  --card: #FFFFFF;
  --sunk: #EFEFEA;
  --ink: #15171A;
  --ink-2: #5A6069;
  --ink-3: #8B9199;
  --line: #E3E3DD;
  --line-2: #CACAC2;
  --accent: #15171A;
  --accent-ink: #FFFFFF;
  --signal: #FFC400;
  --signal-ink: #15171A;
  --bar: #15171A;
  --bar-ink: #F2F2EE;
  --bar-ink-2: #A9AEB5;
  --link: #15171A;
  --chip-ok-bg: #E6F2EA;
  --chip-ok-ink: #0E6A36;
  --chip-warn-bg: #FBEAE3;
  --chip-warn-ink: #A2330B;
  --chip-neutral-bg: #EFEFEA;
  --chip-neutral-ink: #3B4048;
  --notice-bg: #FFF8DB;
  --notice-ink: #3A2F00;
  --notice-border: #E9C640;
  --ok: #138A47;
  --warn: #D2481A;
  --mid: #C99A06;
  --mark-p: #6B47A8;
  --mark-e: #0E6A36;
  --focus: #FFC400;
  --shadow: 0 1px 2px rgba(20, 22, 26, .05), 0 8px 24px -12px rgba(20, 22, 26, .18);
  --r: 8px;
  --r-s: 5px;
  --font: "IBM Plex Sans", "Zen Kaku Gothic New", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-ja: "Zen Kaku Gothic New", "IBM Plex Sans", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #0F1012;
    --card: #17191C;
    --sunk: #1D2023;
    --ink: #ECECE7;
    --ink-2: #A4A9B0;
    --ink-3: #7A8088;
    --line: #2A2D31;
    --line-2: #3B3F45;
    --accent: #FFC400;
    --accent-ink: #15171A;
    --bar: #08090A;
    --link: #ECECE7;
    --chip-ok-bg: #16301F;
    --chip-ok-ink: #9EDDB5;
    --chip-warn-bg: #3A1D12;
    --chip-warn-ink: #F7B89C;
    --chip-neutral-bg: #23262A;
    --chip-neutral-ink: #CDD1D6;
    --notice-bg: #2B2508;
    --notice-ink: #F3E3A6;
    --notice-border: #7A6312;
    --ok: #3DBE74;
    --warn: #F07A4B;
    --mark-p: #C3A8F2;
    --mark-e: #9EDDB5;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -12px rgba(0, 0, 0, .6);
  }
}
:root[data-theme="dark"] {
  --ground: #0F1012;
  --card: #17191C;
  --sunk: #1D2023;
  --ink: #ECECE7;
  --ink-2: #A4A9B0;
  --ink-3: #7A8088;
  --line: #2A2D31;
  --line-2: #3B3F45;
  --accent: #FFC400;
  --accent-ink: #15171A;
  --bar: #08090A;
  --link: #ECECE7;
  --chip-ok-bg: #16301F;
  --chip-ok-ink: #9EDDB5;
  --chip-warn-bg: #3A1D12;
  --chip-warn-ink: #F7B89C;
  --chip-neutral-bg: #23262A;
  --chip-neutral-ink: #CDD1D6;
  --notice-bg: #2B2508;
  --notice-ink: #F3E3A6;
  --notice-border: #7A6312;
  --ok: #3DBE74;
  --warn: #F07A4B;
  --mark-p: #C3A8F2;
  --mark-e: #9EDDB5;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -12px rgba(0, 0, 0, .6);
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
/* Korean and Chinese pages: the system CJK fonts first, so Chinese text does not get Japanese glyph shapes. */
:lang(ko) body, body:lang(ko) { font-family: "IBM Plex Sans", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif; }
:lang(zh-Hant) body, body:lang(zh-Hant) { font-family: "IBM Plex Sans", "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", system-ui, sans-serif; }
:lang(zh-Hans) body, body:lang(zh-Hans) { font-family: "IBM Plex Sans", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif; }
:lang(ja), .ja { font-family: var(--font-ja); }
a { color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: var(--ink-3); }
a:hover { text-decoration-color: currentColor; text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
img, svg { max-width: 100%; height: auto; }
.ic { width: 20px; height: 20px; flex: none; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px 56px; }
main.full { padding: 0; }
::selection { background: var(--signal); color: var(--signal-ink); }

h1 { font-size: 28px; line-height: 1.15; font-weight: 600; letter-spacing: -.015em; margin: 20px 0 10px; }
h2 { font-size: 21px; line-height: 1.25; font-weight: 600; letter-spacing: -.01em; margin: 36px 0 12px; }
h3 { font-size: 16px; line-height: 1.3; font-weight: 600; margin: 20px 0 6px; }
p { margin: 8px 0; }
.muted { color: var(--ink-2); }
.small { font-size: 13.5px; }
.more { font-weight: 500; margin-left: 8px; }
.lead { font-size: 18px; line-height: 1.55; color: var(--ink-2); max-width: 44em; }
.crumbs { font-size: 13px; color: var(--ink-3); margin-top: 18px; }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; margin: 14px 0; }
.card > h2:first-child, .card > h3:first-child { margin-top: 2px; }
.card > h2 { font-size: 18px; }
.sr { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* ---------- Header ---------- */
header.site { background: var(--bar); color: var(--bar-ink); position: sticky; top: 0; z-index: 1000; }
header.site .bar { max-width: 1120px; margin: 0 auto; padding: 0 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 0 20px; min-height: 56px; }
body.wide header.site .bar { max-width: none; }
header.site .brand { color: var(--bar-ink); text-decoration: none; font-size: 17px; font-weight: 600; letter-spacing: -.01em; display: inline-flex; align-items: center; gap: 10px; min-height: 56px; }
header.site .brand .ja { font-weight: 400; color: var(--bar-ink-2); font-size: 13px; }
.logo { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 4px; background: var(--signal); color: var(--signal-ink); font-family: var(--font-ja); font-weight: 700; font-size: 18px; line-height: 1; }
header.site .mainnav { display: flex; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
header.site .mainnav a { position: relative; display: inline-flex; align-items: center; min-height: 56px; padding: 0 10px; color: var(--bar-ink-2); text-decoration: none; font-size: 14.5px; font-weight: 500; white-space: nowrap; }
header.site .mainnav a:hover { color: var(--bar-ink); }
header.site .mainnav a[aria-current="page"] { color: var(--bar-ink); }
header.site .mainnav a[aria-current="page"]::before { content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 3px; background: var(--signal); }
header.site .mainnav a[data-tripnav][data-n]:not([data-n=""])::after { content: attr(data-n); display: inline-block; margin-left: 6px; min-width: 18px; height: 18px; line-height: 18px; border-radius: 9px; background: var(--signal); color: var(--signal-ink); font-size: 11px; font-weight: 700; text-align: center; padding: 0 5px; }

/* Language menu: a small drop-down at the end of the header. */
.langs { position: relative; margin-left: auto; font-size: 14px; }
.langs > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 10px; border: 1px solid #3A3E44; border-radius: 6px; color: var(--bar-ink); cursor: pointer; white-space: nowrap; }
.langs > summary::-webkit-details-marker { display: none; }
.langs > summary:hover { border-color: var(--bar-ink-2); }
.langs > summary .ic { width: 16px; height: 16px; color: var(--bar-ink-2); }
.langs-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 170px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 6px; display: grid; z-index: 1100; }
.langs-menu a, .langs-menu strong { display: block; padding: 8px 10px; border-radius: 5px; color: var(--ink); text-decoration: none; font-weight: 400; }
.langs-menu a:hover { background: var(--sunk); }
.langs-menu strong { font-weight: 600; background: var(--sunk); }
.i18n-note { margin-top: 14px; }

/* ---------- Chips, labels, marks ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 4px; padding: 2px 8px; font-size: 12.5px; font-weight: 500; line-height: 1.5; border: 1px solid transparent; }
.chip.ok { background: var(--chip-ok-bg); color: var(--chip-ok-ink); }
.chip.warn { background: var(--chip-warn-bg); color: var(--chip-warn-ink); }
.chip.neutral { background: transparent; color: var(--ink-2); border-color: var(--line-2); }
.chip.line { background: var(--c, var(--accent)); color: #fff; font-weight: 600; }
.chip.lineref { background: transparent; color: var(--ink); border: 1px solid var(--line-2); }
.chip.lineref::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--accent)); }
.swatch { display: inline-block; width: 4px; height: 16px; border-radius: 2px; background: var(--c, var(--accent)); margin-right: 10px; vertical-align: -3px; }
.mode, .aud, .topic { display: inline-block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; line-height: 1.6; padding: 1px 7px; border-radius: 3px; background: var(--sunk); color: var(--ink-2); }
.mode-tram { background: #E3ECFB; color: #1E3F86; }
.mode-dmv { background: #FBE6EF; color: #8A1D4D; }
.mode-rail { background: var(--sunk); color: var(--ink-2); }
.aud { background: transparent; border: 1px solid var(--line-2); color: var(--ink-2); padding: 0 6px; }
.aud-foreign_visitors { background: var(--signal); border-color: var(--signal); color: var(--signal-ink); }
.aud-residents, .aud-seniors, .aud-students, .aud-other { border-color: transparent; background: var(--chip-warn-bg); color: var(--chip-warn-ink); }
.topic { margin-right: 8px; }
.origin { display: inline-grid; place-items: center; min-width: 17px; height: 17px; font-size: 10px; font-weight: 700; border-radius: 3px; padding: 0 3px; margin-right: 4px; vertical-align: 2px; border: 1px solid currentColor; line-height: 1; }
.origin.e { color: var(--mark-e); }
.origin.p { color: var(--mark-p); }
.chips > .origin { align-self: center; }
.cite { font-size: 11.5px; font-weight: 600; text-decoration: none; vertical-align: 2px; color: var(--ink-3); padding: 0 1px; }
.cite:hover { color: var(--ink); text-decoration: underline; }
.draft { font-size: 13px; color: var(--chip-warn-ink); background: var(--chip-warn-bg); border-radius: 4px; padding: 6px 10px; display: inline-block; }
.alert-mark { font-size: .78em; font-weight: 600; color: var(--chip-warn-ink); background: var(--chip-warn-bg); border-radius: 3px; padding: 0 .4em; white-space: nowrap; }

/* ---------- Notices ---------- */
.notice { background: var(--notice-bg); color: var(--notice-ink); border: 0; border-left: 3px solid var(--notice-border); border-radius: 0 var(--r-s) var(--r-s) 0; padding: 12px 16px; margin: 14px 0; }
.notice > strong:first-child { display: block; margin-bottom: 2px; }
.notice a { color: inherit; }
.notice.alert { background: var(--chip-warn-bg); color: var(--chip-warn-ink); border-left-color: var(--warn); }
.ok-notice { background: var(--chip-ok-bg); color: var(--chip-ok-ink); border-left-color: var(--ok); }
.ok-notice a { color: inherit; font-weight: 600; }
.i18n-note { background: var(--sunk); color: var(--ink-2); border-left-color: var(--line-2); }
.src { font-size: 13px; color: var(--ink-2); margin-top: 6px; }
.sources li { word-break: break-word; }
.status { font-size: 13px; color: var(--ink-2); }

/* ---------- Buttons and inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 6px; background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent); text-decoration: none; font-weight: 600; font-size: 15px; margin: 6px 8px 6px 0; line-height: 1.2; }
.btn:hover { text-decoration: none; filter: brightness(1.15); }
.btn.secondary { background: var(--card); color: var(--ink); border-color: var(--line-2); }
.btn.secondary:hover { border-color: var(--ink); filter: none; }
.btn.signal { background: var(--signal); color: var(--signal-ink); border-color: var(--signal); }
button.btn { font: inherit; font-weight: 600; cursor: pointer; }
.btn.save { cursor: pointer; font: inherit; font-weight: 600; }
.btn.save[aria-pressed="true"] { background: var(--chip-ok-bg); color: var(--chip-ok-ink); border-color: transparent; }
.linkbtn { all: unset; cursor: pointer; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--ink-3); min-height: 24px; }
.linkbtn:hover { text-decoration-color: currentColor; }
.linkbtn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
input[type=search], input[type=text], input[type=number], input[type=date], select, textarea { font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line-2); border-radius: 6px; }
input[type=search]:focus, input[type=text]:focus, input[type=number]:focus, input[type=date]:focus, select:focus, textarea:focus { outline: 3px solid var(--focus); outline-offset: 0; border-color: var(--ink); }
input[type=checkbox], input[type=radio] { accent-color: var(--ink); width: 16px; height: 16px; }
.search input { width: 100%; min-height: 46px; padding: 8px 14px 8px 40px; background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238B9199' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='m20 20-4.4-4.4'/%3E%3C/svg%3E") 12px 50% / 18px no-repeat; }
select { padding: 6px 30px 6px 10px; min-height: 36px; appearance: none; background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238B9199' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E") right 8px center / 16px no-repeat; }
details summary { cursor: pointer; min-height: 32px; }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--ink-2); font-size: 13px; }
thead th { border-bottom-color: var(--line-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.timetable td { font-variant-numeric: tabular-nums; }
.facts th { width: 40%; }
.matrix-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); }
.matrix td, .matrix th { font-size: 12px; padding: 5px 7px; white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.matrix tbody tr:hover td, .matrix tbody tr:hover th { background: var(--sunk); }
.hours td { color: var(--ink-2); text-align: center; }
.hourly th { width: 3em; }
.hourly td { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.grid th, .grid td { font-size: 12px; }
.grid tbody th { position: sticky; left: 0; background: var(--card); z-index: 1; min-width: 9em; white-space: normal; }
.cols { columns: 2 220px; padding-left: 18px; }
.cols li { break-inside: avoid; margin: 4px 0; }

/* ---------- Home ---------- */
.hero { display: grid; gap: 24px; padding: 28px 0 8px; align-items: center; }
.hero h1 { font-size: 34px; line-height: 1.08; letter-spacing: -.025em; margin: 10px 0 14px; max-width: 14em; }
.hero .eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); margin: 0; }
.hero .eyebrow::before { content: ""; width: 18px; height: 3px; background: var(--signal); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.hero-actions .btn { margin: 0; }
.hero .map { margin: 0; height: 320px; border-radius: var(--r); }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); margin: 28px 0 8px; border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line); }
.stats > div { padding: 16px 16px 14px 0; }
.stats > div + div { padding-left: 16px; border-left: 1px solid var(--line); }
.stats > div:nth-child(3) { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); }
.stats > div:nth-child(4) { border-top: 1px solid var(--line); }
.stats a { text-decoration: none; color: inherit; display: block; }
.stats a:hover span { text-decoration: underline; }
.stats strong { display: block; font-size: 30px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stats span { font-size: 13px; color: var(--ink-2); }
.section-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 44px 0 14px; }
.section-h h2 { margin: 0; }
.section-h a { font-size: 14px; font-weight: 500; }
.qgroups { display: grid; gap: 14px; }
.qgroup { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 6px 0; }
.qgroup h3 { margin: 8px 16px 4px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.quick { display: grid; margin: 0; }
.quick a { display: grid; grid-template-columns: 36px 1fr 16px; align-items: center; column-gap: 12px; padding: 11px 16px; text-decoration: none; color: var(--ink); min-height: 56px; }
.quick a + a { border-top: 1px solid var(--line); }
.quick a:hover { background: var(--sunk); }
.quick a:hover .qarrow { color: var(--ink); transform: translateX(2px); }
.quick .qi { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 6px; background: var(--sunk); color: var(--ink); }
.quick .qtext { display: flex; flex-direction: column; min-width: 0; }
.quick strong { font-size: 15px; font-weight: 600; }
.quick .qtext span { font-size: 13px; color: var(--ink-2); line-height: 1.4; }
.quick .qarrow { width: 16px; height: 16px; color: var(--ink-3); transition: transform .15s; }
.region-h { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); margin: 28px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.opgrid { display: grid; gap: 12px; grid-template-columns: 1fr; }
.opcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: flex; flex-direction: column; }
.opcard:hover { border-color: var(--line-2); }
.opcard h3 { margin: 10px 0 2px; font-size: 17px; }
.opcard h3 a { color: var(--ink); text-decoration: none; }
.opcard h3 a:hover { text-decoration: underline; }
.opcard h3 .ja { font-size: 13px; font-weight: 400; }
.opcard-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.opcard .chips { margin: 8px 0; }
.opcard > p:last-child { margin: auto 0 0; padding-top: 8px; color: var(--ink-3); }
.linelist { list-style: none; padding: 0; margin: 4px 0; }
.linelist li { padding: 7px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.linelist a { font-weight: 600; text-decoration: none; color: var(--ink); }
.linelist a:hover { text-decoration: underline; }
.marks { margin-top: 40px; }
.marks h2 { font-size: 16px; }

/* ---------- Page head, in-page nav, key facts ---------- */
.pagehead { margin: 12px 0 8px; }
.pagehead h1 { margin: 6px 0 8px; }
.pagehead .kicker { margin: 0; font-size: 13px; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.pagehead .kicker .chip { margin: 0; text-decoration: none; }
.pagehead .kicker a { color: var(--ink-2); }
.pagenav { position: sticky; top: 56px; z-index: 900; display: flex; gap: 0; overflow-x: auto; padding: 0; margin: 12px 0 8px; background: var(--ground); border-bottom: 1px solid var(--line-2); scrollbar-width: none; }
.pagenav a { flex: none; padding: 12px 14px 10px; color: var(--ink-2); text-decoration: none; font-size: 14px; font-weight: 500; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.pagenav a:hover { color: var(--ink); border-bottom-color: var(--signal); }
section[id], h2[id] { scroll-margin-top: 120px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin: 14px 0; align-items: start; }
.tile { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tile .k { font-size: 11.5px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.tile .v { font-size: 16px; font-weight: 600; line-height: 1.3; }
.tile .v .origin { font-weight: 700; vertical-align: 2px; margin-left: 2px; }
.tile .sub { font-size: 12.5px; color: var(--ink-2); overflow-wrap: anywhere; line-height: 1.45; }
.tile.ok .v::before, .tile.warn .v::before, .tile.mid .v::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; }
.tile.ok .v::before { background: var(--ok); }
.tile.warn .v::before { background: var(--warn); }
.tile.mid .v::before { background: var(--mid); }
.tile.unk .v { color: var(--ink-2); font-weight: 500; }
details.more { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 8px 16px; margin: 10px 0; }
details.more > summary, details.card > summary { font-weight: 600; color: var(--ink); min-height: 36px; line-height: 36px; }
details.card { padding-top: 8px; padding-bottom: 8px; }
details[open].card > summary { margin-bottom: 6px; }
.howcard { margin: 12px 0; }
.twocol { display: grid; gap: 14px; grid-template-columns: 1fr; }
.twocol > .card { margin: 0; }
.screen { border-top: 1px solid var(--line-2); padding-top: 8px; margin-top: 32px; }
.screen > h2 { margin-top: 14px; }
.tab { display: none; }
.footer { font-size: 13px; color: var(--ink-2); }

/* ---------- Line page ---------- */
.linehead { border-left: 6px solid var(--c, var(--accent)); padding-left: 16px; margin-top: 12px; }
.linehead h1 { margin-top: 8px; }
.stations { padding-left: 0; margin: 0; }
.stations li { list-style: none; border-bottom: 1px solid var(--line); padding: 10px 0; }
.stations a { display: block; min-height: 40px; text-decoration: none; color: var(--ink); padding-top: 6px; font-weight: 600; }
.stations a:hover { text-decoration: underline; }
.stations .chips { margin: 4px 0; }
.diagram { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 4px 16px; }
.diagram li { position: relative; padding-left: 34px; border-bottom: none; }
.diagram li::before { content: ""; position: absolute; left: 9px; top: 0; bottom: 0; width: 6px; background: var(--c, var(--accent)); }
.diagram li:first-child::before { top: 22px; }
.diagram li:last-child::before { bottom: calc(100% - 22px); }
.diagram li::after { content: ""; position: absolute; left: 4px; top: 14px; width: 10px; height: 10px; border-radius: 50%; background: var(--card); border: 3px solid var(--c, var(--accent)); }
.diagram li + li { border-top: 1px solid var(--line); }
.steps ol { list-style: none; counter-reset: step; padding: 0; margin: 0; }
.steps h3 { margin: 2px 0 10px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }
.steps li { counter-increment: step; position: relative; padding: 2px 0 12px 38px; margin: 0; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 4px; background: var(--ink); color: var(--card); font-weight: 600; font-size: 13px; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.steps li + li::after { content: ""; position: absolute; left: 12px; top: -12px; height: 12px; border-left: 2px solid var(--line); }
.twocol > .steps, section > .steps { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.sign { display: inline-block; background: var(--ink); color: var(--card); border-radius: 4px; padding: 10px 18px; font-size: 22px; font-weight: 700; margin: 8px 0; }
.ticket { display: inline-block; border: 2px dashed var(--ink-2); border-radius: 6px; padding: 10px 16px; font-weight: 700; font-size: 22px; margin: 8px 0; }
.toggle { display: flex; gap: 0; margin: 14px 0; border: 1px solid var(--line-2); border-radius: 6px; padding: 3px; background: var(--card); }
.toggle label { flex: 1; display: flex; align-items: center; justify-content: center; text-align: center; min-height: 40px; padding: 6px 10px; line-height: 1.3; border-radius: 4px; color: var(--ink-2); cursor: pointer; font-weight: 600; font-size: 14.5px; }
.toggle input { margin-right: 6px; }
.glossary { display: grid; gap: 12px; grid-template-columns: 1fr; }
.glossary .card { margin: 0; }
.glossary .term { font-size: 18px; font-weight: 700; }
.phrase { font-size: 17px; margin: 8px 0; }
.timeline { border-left: 3px solid var(--c, var(--accent)); margin: 8px 0 8px 8px; padding-left: 16px; }
.timeline li { list-style: none; position: relative; min-height: 44px; padding: 6px 0; }
.timeline li::before { content: ""; position: absolute; left: -23px; top: 14px; width: 11px; height: 11px; border-radius: 50%; background: var(--c, var(--accent)); }
.timeline ul { margin: 0; padding: 0; }
.dash { display: inline-block; width: 22px; border-top: 3px dashed #7C3AED; vertical-align: 4px; }
.linetree details { border-top: 1px solid var(--line); padding: 6px 0; }
.linetree ul { list-style: none; padding: 0 0 0 4px; margin: 4px 0; }
.linetree li a { display: block; min-height: 36px; line-height: 36px; text-decoration: none; color: var(--ink); }
.linetree li a:hover { text-decoration: underline; }
.rules { margin: 0; }
.rules > div { display: grid; grid-template-columns: 1fr; gap: 2px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.rules > div:last-child { border-bottom: 0; }
.rules dt { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.rules dd { margin: 0; }
.covers { padding-left: 18px; }
.covers > li { margin: 6px 0; }

/* ---------- Maps ---------- */
.map { height: 340px; border-radius: var(--r); border: 1px solid var(--line); margin: 14px 0; background: #DADDD8; overflow: hidden; z-index: 0; }
.map.tall { height: calc(100vh - 56px); border-radius: 0; border: 0; margin: 0; }
.map[data-focus="ferries"] { height: min(72vh, 620px); }
.map noscript p { padding: 16px; }
.map .leaflet-popup-content { margin: 14px 16px 12px; font-family: var(--font); font-size: 14px; line-height: 1.45; }
.map .leaflet-popup-content-wrapper, .map .leaflet-popup-tip { background: var(--card); color: var(--ink); box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.map .leaflet-popup-content-wrapper { border-radius: var(--r); border: 1px solid var(--line); }
.map .leaflet-container a.leaflet-popup-close-button, .map a.leaflet-popup-close-button { color: var(--ink-2); font-size: 20px; width: 28px; height: 28px; line-height: 26px; }
.map .leaflet-tooltip { font: 600 12px var(--font); }
.map .leaflet-bar { border: 1px solid var(--line-2); box-shadow: none; border-radius: 6px; overflow: hidden; }
.map .leaflet-bar a { background: var(--card); color: var(--ink); border-bottom-color: var(--line); }
.map .leaflet-control-attribution { font-size: 10.5px; }
.pop h3 { margin: 2px 0 2px; font-size: 18px; line-height: 1.25; padding-right: 14px; }
.pop h3 span { font-weight: 400; color: var(--ink-2); font-size: 15px; }
.pop .chips { margin: 6px 0; gap: 4px; }
.pop .chip { font-size: 12px; padding: 1px 7px; }
.pop ol { padding-left: 18px; margin: 2px 0 6px; }
.pop li { margin: 2px 0; }
.pop-kicker { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 2px; padding-right: 18px; }
.pop-sub { font-size: 13px; color: var(--ink-2); margin: 0 0 6px; }
.pop-h { font-weight: 600; margin: 10px 0 2px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.pop-warn { background: var(--chip-warn-bg); color: var(--chip-warn-ink); border-radius: 4px; padding: 6px 10px; font-size: 13px; }
.pop-ok { display: inline-block; background: var(--chip-ok-bg); color: var(--chip-ok-ink); border-radius: 4px; padding: 2px 8px; font-size: 12px; font-weight: 600; margin: 2px 0 4px; }
.pop-note { font-size: 12px; color: var(--ink-2); margin: 4px 0; }
.pop-facts { margin: 8px 0; border-top: 1px solid var(--line); }
.pop-facts > div { display: grid; grid-template-columns: 92px 1fr; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.pop-facts dt { font-size: 12px; color: var(--ink-2); }
.pop-facts dd { margin: 0; font-weight: 600; font-size: 13px; }
.pop-facts dd span { display: block; font-weight: 400; font-size: 12px; color: var(--ink-2); }
.v-ok { color: var(--chip-ok-ink); } .v-warn { color: var(--chip-warn-ink); } .v-unk { color: var(--ink-2); font-weight: 400 !important; }
.pop-more summary { font-size: 13px; font-weight: 600; color: var(--ink); min-height: 28px; }
.pop-links { margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.pop-links .btn { min-height: 34px; padding: 0 12px; font-size: 13.5px; margin: 0; color: var(--accent-ink); }
.pop-links .btn.secondary { color: var(--ink); }
.pop-links .trip-add { font: inherit; font-size: 13.5px; cursor: pointer; }
.pop .muted { color: var(--ink-2); }
.pop-lines { list-style: none; padding: 0; margin: 6px 0; max-height: 180px; overflow-y: auto; }
.pop-lines li { margin: 3px 0; }
.airport span { display: inline-block; white-space: nowrap; transform: translate(-50%, -50%); background: #15171A; color: #fff; border: 1.5px solid #fff; border-radius: 4px; padding: 1px 7px; font: 600 11.5px var(--font); letter-spacing: .03em; box-shadow: 0 1px 3px rgba(0,0,0,.3); cursor: pointer; }
.map-note { background: rgba(255,255,255,.94); color: #15171A; border-radius: 4px; padding: 4px 8px; font-size: 12px; }
.netkey { display: inline-block; width: 26px; height: 7px; vertical-align: 2px; border-radius: 2px; background: repeating-linear-gradient(90deg, #1F2937 0 6px, #fff 6px 9px) center / 100% 2px no-repeat, #1F2937; box-shadow: 0 0 0 2px #fff; }
.paykey { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; margin: -4px 0 8px; }
.paykey span::before { content: ""; display: inline-block; width: 18px; height: 5px; border-radius: 3px; background: var(--c); margin-right: 5px; vertical-align: 2px; }

/* Full-screen map: side panel + map */
.mapapp { display: grid; grid-template-columns: 1fr; }
.mapside { padding: 6px 16px 20px; background: var(--card); border-bottom: 1px solid var(--line); max-height: 45vh; overflow-y: auto; }
.mapside h1 { font-size: 22px; margin: 12px 0 10px; }
.mapside > details, .mapside > section, .mapside > fieldset { border-top: 1px solid var(--line); }
.mapapp .map.tall { height: 60vh; }
.results { list-style: none; padding: 0; margin: 6px 0; border: 1px solid var(--line-2); border-radius: 6px; max-height: 260px; overflow-y: auto; background: var(--card); box-shadow: var(--shadow); }
.results li + li { border-top: 1px solid var(--line); }
.results button { all: unset; display: block; width: 100%; box-sizing: border-box; padding: 8px 12px; cursor: pointer; min-height: 44px; }
.results button:hover, .results button:focus-visible { background: var(--sunk); }
.modes { border: 0; padding: 10px 0 0; margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 2px 14px; }
.modes legend { display: block; width: 100%; padding: 0; margin-bottom: 2px; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.modes label { min-height: 32px; display: inline-flex; align-items: center; gap: 7px; font-size: 14.5px; }
.trip { background: var(--card); border: 1px solid var(--line-2); border-radius: var(--r); padding: 4px 14px 12px; margin: 14px 0; box-shadow: inset 0 3px 0 var(--signal); }
.trip h2 { font-size: 17px; margin: 12px 0 6px; }
.trip h3 { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin: 14px 0 4px; }
.trip-items { list-style: none; padding: 0; margin: 6px 0; }
.trip-items li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.trip-items button { all: unset; cursor: pointer; padding: 4px 8px; border-radius: 4px; color: var(--ink-3); min-height: 28px; }
.trip-items button:hover { background: var(--chip-warn-bg); color: var(--chip-warn-ink); }
.trip-aud { display: block; margin: 8px 0; }
.trip-aud select, .trip-aud input, #pass-sort, .calc select { font: inherit; font-size: 14px; margin-left: 6px; }
.trip-aud input { width: 110px; margin-left: 4px; padding: 4px 8px; min-height: 34px; }
.trip-passes { list-style: none; padding: 0; margin: 4px 0; }
.trip-passes li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.trip-passes a { font-weight: 600; }
.trip-samples { margin: 8px 0; }
.trip-samples ul { list-style: none; padding: 0; margin: 4px 0; }
.trip-samples li { padding: 7px 0; border-bottom: 1px solid var(--line); }
.trip-dates { border: 0; padding: 0; margin: 8px 0; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.trip-dates legend { padding: 0; margin-bottom: 4px; }
.trip-dates input { padding: 4px 8px; min-height: 36px; }
.lead-list { font-size: 1.05em; line-height: 1.55; }
.lead-list li { margin: 6px 0; }
.showlink { text-decoration: none; font-size: 15px; margin-left: 2px; }

/* ---------- Passes ---------- */
.browse { display: grid; gap: 18px; grid-template-columns: 1fr; margin-top: 18px; }
.filterbox { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 4px 16px 12px; }
.filterbox > summary { list-style: none; display: flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 600; }
.filterbox > summary::-webkit-details-marker { display: none; }
.filterbox > summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: rotate(45deg); margin-top: -4px; }
.filterbox[open] > summary::after { transform: rotate(-135deg); margin-top: 4px; }
.filterbox fieldset { border: 0; box-shadow: inset 0 1px 0 var(--line); padding: 10px 0 8px; margin: 0; min-width: 0; }
.filterbox legend { display: block; padding: 12px 0 0; margin-bottom: -4px; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.check { display: flex; align-items: center; gap: 9px; min-height: 34px; font-size: 14.5px; cursor: pointer; }
.listbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 0 0 10px; }
.listbar .search { flex: 1 1 260px; }
.listbar #pass-count { margin: 0; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.filters .chips { margin: 8px 0 0; }
.chipbox { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 4px; border: 1px solid var(--line-2); background: var(--card); color: var(--ink); font-size: 13.5px; min-height: 34px; cursor: pointer; }
.passgrid { display: grid; grid-template-columns: 1fr; margin: 12px 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.passcard { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 16px; padding: 14px 16px; border-top: 1px solid var(--line); }
.passcard:first-child { border-top: 0; }
.passcard > * { grid-column: 1; }
.passcard[hidden] { display: none; }
.passcard:hover { background: color-mix(in srgb, var(--sunk) 55%, transparent); }
.passcard h3 { margin: 6px 0 0; font-size: 16.5px; line-height: 1.3; }
.passcard h3 a { color: var(--ink); text-decoration: none; }
.passcard h3 a::after { content: ""; position: absolute; inset: 0; }
.passcard { position: relative; }
.passcard h3 a:hover { text-decoration: underline; }
.passcard p { margin: 2px 0; }
.passcard > p.small:not(.muted) { color: var(--ink-2); max-width: 60em; }
.passcard-top { display: flex; justify-content: space-between; gap: 6px 10px; flex-wrap: wrap; align-items: center; }
.passcard-top > span:first-child { display: inline-flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.passcard .price { grid-column: 2; grid-row: 1 / span 3; text-align: right; align-self: start; margin-top: 2px; max-width: 15rem; line-height: 1.35; }
.passcard .cmp { position: relative; z-index: 1; }
.price { font-size: 19px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.price span { font-size: 12px; font-weight: 400; color: var(--ink-2); letter-spacing: 0; }
.perday { display: block; font-style: normal; font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.recurs { color: var(--ink-2); }
.offnote { display: none; font-weight: 600; color: var(--chip-warn-ink); }
.passcard.off { opacity: .7; }
.passcard.off .offnote { display: inline; }
.cmp { justify-self: start; display: inline-flex; gap: 7px; align-items: center; margin-top: 6px; color: var(--ink-2); cursor: pointer; min-height: 30px; font-size: 13px; }
.cmpbar { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 1500; background: var(--bar); color: var(--bar-ink); border-radius: var(--r); box-shadow: 0 10px 30px rgba(0,0,0,.3); padding: 6px 8px 6px 16px; display: flex; align-items: center; gap: 8px; max-width: calc(100vw - 32px); }
.cmpbar[hidden] { display: none; }
.cmpbar .btn { margin: 0; min-height: 38px; }
.cmpbar .btn:not(.secondary) { background: var(--signal); color: var(--signal-ink); border-color: var(--signal); }
.cmpbar .btn.secondary { background: transparent; color: var(--bar-ink); border-color: #3A3E44; }
table.compare { min-width: 640px; }
table.compare th, table.compare td { vertical-align: top; font-size: 13px; }
table.compare tbody th { width: 120px; }
table.compare ul { margin: 0; padding-left: 16px; }

/* ---------- Trains, airports, tips ---------- */
.traincard .price span { font-size: 12px; }
.option h3 { margin-top: 2px; font-size: 18px; }
.option .kicker { margin: 0; }
.option ol { padding-left: 20px; }
.tiplist { list-style: none; padding: 0; margin: 0; }
.tiplist li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.tiplist li:last-child { border-bottom: 0; }
.tiplist a { font-weight: 600; }
.guidegrid { display: grid; gap: 10px; grid-template-columns: 1fr; }
.guidegrid li { position: relative; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.guidegrid li:last-child { border-bottom: 1px solid var(--line); }
.guidegrid li:hover { border-color: var(--ink-3); }
.guidegrid a { color: var(--ink); text-decoration: none; font-size: 16px; }
.guidegrid a::after { content: ""; position: absolute; inset: 0; }
.guidegrid .small { display: block; margin-top: 3px; line-height: 1.45; }
.points { padding-left: 20px; }
.points li { margin: 8px 0; }
.points li::marker { color: var(--ink-3); }
.svc table { font-size: 13px; }
.svc th, .svc td { padding: 5px 6px; }
.svc .few { color: var(--chip-warn-ink); font-weight: 700; }

/* Long-form guide: contents rail + text column */
.doc { display: grid; gap: 8px; grid-template-columns: 1fr; margin-top: 12px; }
.toc { font-size: 14px; }
.toc p { margin: 0 0 6px; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.toc ol { list-style: none; padding: 0; margin: 0; border-left: 1px solid var(--line-2); }
.toc a { display: block; padding: 5px 12px; margin-left: -1px; border-left: 2px solid transparent; color: var(--ink-2); text-decoration: none; line-height: 1.35; }
.toc a:hover { color: var(--ink); border-left-color: var(--signal); }
.doc-body { min-width: 0; max-width: 46em; }
.docsec { padding: 6px 0 10px; border-top: 1px solid var(--line); }
.docsec:first-child { border-top: 0; }
.docsec h2 { margin: 18px 0 8px; font-size: 20px; }
.docsec .points li { line-height: 1.6; }

/* ---------- Show the driver, phrases ---------- */
.showform input[type=text] { width: 100%; min-height: 50px; font-size: 20px; padding: 8px 14px; margin: 6px 0; }
.phrases { list-style: none; padding: 0; display: grid; gap: 8px; }
.phrase-btn { all: unset; box-sizing: border-box; display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 12px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); cursor: pointer; min-height: 56px; }
.phrase-btn:hover, .phrase-btn:focus-visible { border-color: var(--ink); }
.phrase-btn span[lang] { font-size: 18px; font-weight: 700; }
.showcard { position: fixed; inset: 0; z-index: 2000; background: #FFFFFF; color: #111; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 24px; gap: 12px; }
.showcard[hidden] { display: none; }
.show-ja { font-size: clamp(32px, 9vw, 72px); font-weight: 700; line-height: 1.3; margin: 0; font-family: var(--font-ja); }
.show-place { font-size: clamp(18px, 5vw, 32px); color: #333; margin: 0; }
.show-en { font-size: 16px; color: #555; margin: 8px 0 16px; }
body.showing { overflow: hidden; }

/* ---------- My trip, offline, calculator ---------- */
.savedlist { list-style: none; padding: 0; margin: 0; }
.savedlist li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.savedlist button, .calc-rides button { all: unset; cursor: pointer; padding: 2px 8px; color: var(--ink-3); }
.savedlist button:hover, .calc-rides button:hover { color: var(--chip-warn-ink); }
#trip-notes { width: 100%; padding: 10px 12px; }
.calc-rides { padding-left: 20px; }
.calc-rides li { display: flex; gap: 6px; align-items: center; margin: 6px 0; }
.calc-rides input { min-height: 40px; padding: 4px 10px; min-width: 0; }
.calc-rides input[type=text] { flex: 2; } .calc-rides input[type=number] { flex: 1; max-width: 120px; }
.calc-out { font-size: 15px; }
.offlist { list-style: none; padding: 0; }
.offlist li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.offlist .btn { margin: 0; font: inherit; font-weight: 600; cursor: pointer; }
.offlist .btn.done { background: var(--chip-ok-bg); color: var(--chip-ok-ink); border-color: transparent; }

/* ---------- Footer ---------- */
footer.site-foot { border-top: 1px solid var(--line-2); margin-top: 56px; background: var(--card); }
body.wide footer { display: none; }
.foot-in { max-width: 1120px; margin: 0 auto; padding: 28px 16px 36px; display: grid; gap: 20px; font-size: 13.5px; color: var(--ink-2); }
.foot-brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 600; font-size: 16px; }
.foot-in p { margin: 0 0 6px; max-width: 52em; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.foot-links a { color: var(--ink); }

/* ---------- Wider screens ---------- */
@media (min-width: 720px) {
  h1 { font-size: 34px; }
  .hero h1 { font-size: 46px; }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .stats > div:nth-child(3) { border-left: 1px solid var(--line); padding-left: 16px; border-top: 0; }
  .stats > div:nth-child(4) { border-top: 0; }
  .glossary { grid-template-columns: 1fr 1fr; }
  .opgrid { grid-template-columns: 1fr 1fr; }
  .twocol { grid-template-columns: 1fr 1fr; }
  .guidegrid { grid-template-columns: 1fr 1fr; }
  .map { height: 420px; }
  .mapapp { grid-template-columns: clamp(360px, 36vw, 520px) 1fr; }
  .mapside { max-height: calc(100vh - 56px); border-bottom: 0; border-right: 1px solid var(--line); }
  .mapapp .map.tall { height: calc(100vh - 56px); }
  .rules > div { grid-template-columns: 170px 1fr; gap: 14px; }
  .foot-in { grid-template-columns: 220px 1fr; }
  .foot-in > :not(.foot-brand) { grid-column: 2; }
}
@media (min-width: 960px) {
  .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 40px; padding-top: 40px; }
  .hero .map { height: 400px; }
  .qgroups { grid-template-columns: repeat(3, 1fr); align-items: start; }
  .browse { grid-template-columns: 260px minmax(0, 1fr); gap: 28px; align-items: start; }
  .filterpane { position: sticky; top: 72px; max-height: calc(100vh - 88px); overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; }
  .filterbox > summary { pointer-events: none; }
  .filterbox > summary::after { display: none; }
  .doc { grid-template-columns: 200px minmax(0, 1fr); gap: 40px; }
  .toc { position: sticky; top: 76px; align-self: start; padding-top: 22px; }
}
@media (min-width: 1100px) {
  .opgrid { grid-template-columns: 1fr 1fr 1fr; }
}
/* Phones: brand and language on one row, then one scrolling row of navigation. */
@media (max-width: 899px) {
  header.site .bar { gap: 0 12px; }
  header.site .brand { min-height: 50px; }
  header.site .mainnav { order: 3; flex: 0 0 calc(100% + 32px); margin: 0 -16px; padding: 0 8px; overflow-x: auto; scrollbar-width: none; border-top: 1px solid #2A2D31; }
  header.site .mainnav a { min-height: 42px; padding: 0 9px; font-size: 14px; }
  .pagenav { top: 93px; }
  .langs > summary span { display: none; }
}
@media (max-width: 420px) {

  .hero h1 { font-size: 31px; }
  .passcard { grid-template-columns: minmax(0, 1fr) auto; column-gap: 10px; }
  .price { font-size: 17px; }
}
/* Dark theme: darken the OSM tiles so the map does not glare. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.85) contrast(.9); }
  :root:not([data-theme="light"]) .mode-tram { background: #1F2F4F; color: #C7D7FF; }
  :root:not([data-theme="light"]) .mode-dmv { background: #4A1F33; color: #FFC7DE; }
  :root:not([data-theme="light"]) .map { background: #24272B; }
}
:root[data-theme="dark"] .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.85) contrast(.9); }
:root[data-theme="dark"] .mode-tram { background: #1F2F4F; color: #C7D7FF; }
:root[data-theme="dark"] .mode-dmv { background: #4A1F33; color: #FFC7DE; }
@media print {
  header.site, footer, .noprint, .btn, .map, .pagenav, .cmpbar, .toc, .filterpane { display: none !important; }
  body { background: #fff; color: #000; }
  .card { border-color: #999; break-inside: avoid; }
  .doc { display: block; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media (min-width: 900px) and (max-width: 1180px) {
  header.site .mainnav a { padding: 0 7px; font-size: 14px; }
  header.site .brand .ja { display: none; }
}
.trip-samples .linkbtn { text-decoration: none; font-size: 15px; }
.trip-samples .linkbtn:hover strong { text-decoration: underline; }
.trip-samples > summary, .mapside details > summary { font-weight: 600; font-size: 14px; }
@media (max-width: 599px) {
  .passcard { grid-template-columns: minmax(0, 1fr); }
  .passcard .price { grid-column: 1; grid-row: auto; text-align: left; max-width: none; margin-top: 4px; }
  .passcard-top { justify-content: flex-start; }
}
.ic.inl { width: 1.1em; height: 1.1em; vertical-align: -.18em; margin-right: 2px; }
h2 .ic.inl { width: 22px; height: 22px; vertical-align: -3px; margin-right: 6px; }
/* Disclosure rows: a chevron on the right instead of the browser's triangle. */
details.card > summary, details.more > summary, .pop-more > summary, .trip-samples > summary, .linetree details > summary { list-style: none; display: flex; align-items: center; gap: 8px; }
details.card > summary::-webkit-details-marker, details.more > summary::-webkit-details-marker, .pop-more > summary::-webkit-details-marker, .trip-samples > summary::-webkit-details-marker, .linetree details > summary::-webkit-details-marker { display: none; }
details.card > summary::after, details.more > summary::after, .pop-more > summary::after, .trip-samples > summary::after, .linetree details > summary::after { content: ""; margin-left: auto; flex: none; width: 7px; height: 7px; border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: rotate(45deg); margin-top: -3px; margin-right: 4px; transition: transform .15s; }
details[open].card > summary::after, details[open].more > summary::after, .pop-more[open] > summary::after, .trip-samples[open] > summary::after, .linetree details[open] > summary::after { transform: rotate(-135deg); margin-top: 3px; }
@media (min-width: 720px) {
  .mapside { padding: 8px 24px 24px; }
  .trip-dates { flex-wrap: nowrap; }
}

/* ---- ferries ---- */
.dash.ferry { border-top-color: #0E7490; }
.ferrysearch { display: block; margin: 16px 0 4px; max-width: 560px; }
.ferryregion > h2 { margin-top: 32px; padding-top: 12px; border-top: 3px solid var(--ink); }
.island > h3 { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; margin: 20px 0 8px; font-size: 18px; }
.island > h3 .ic { align-self: center; color: #0E7490; }
.island > h3 .ja { font-size: 14px; font-weight: 400; }
.ferrygrid { display: grid; gap: 10px; grid-template-columns: 1fr; margin: 8px 0 12px; }
@media (min-width: 720px) { .ferrygrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .ferrygrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ferrycard { position: relative; background: var(--card); border: 1px solid var(--line); border-left: 4px solid #0E7490; border-radius: var(--r); padding: 12px 14px; min-width: 0; }
.ferrycard[hidden], .island[hidden], .ferryregion[hidden] { display: none; }
.ferrycard h4 { margin: 4px 0 2px; font-size: 16px; line-height: 1.3; }
.ferrycard h4 a { color: var(--ink); text-decoration: none; }
.ferrycard h4 a::after { content: ""; position: absolute; inset: 0; }
.ferrycard h4 a:hover { text-decoration: underline; }
.ferrycard p { margin: 0; }
.ferrycard-kinds { display: flex; flex-wrap: wrap; gap: 4px; }
.ferrycard-kinds span { font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: #0E7490; }
.ferrycard-kinds span + span::before { content: "·"; margin-right: 4px; color: var(--ink-3); }
.ferrycard-kinds .season { color: var(--warn); }
.ferryfacts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; margin: 10px 0 0; }
.ferryfacts div { min-width: 0; }
.ferryfacts dt { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.ferryfacts dd { margin: 0; overflow-wrap: anywhere; }
.ferryfacts .bk-required { color: var(--warn); font-weight: 600; }
.ferryfacts .bk-not_needed { color: var(--ok); }
ol.ports { padding-left: 22px; }
ol.ports li { margin: 0 0 10px; }
