:root {
  color-scheme: light;
  --ink: #182940;
  --muted: #637389;
  --line: #dce4ee;
  --paper: #fff;
  --ground: #f4f7fb;
  --navy: #13243b;
  --blue: #315efb;
  --pale-blue: #edf2ff;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--ground); line-height: 1.55; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: wait; opacity: .6; }
a { color: #284fc9; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #f1a84d; outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.shell { width: min(100% - 40px, 1160px); margin-inline: auto; }
h1, h2, h3, p { margin-top: 0; }

.site-header { position: relative; overflow: hidden; color: #fff; background: var(--navy); }
.site-header::after { content: ""; position: absolute; width: 540px; height: 540px; right: -180px; top: -330px; border: 1px solid rgb(255 255 255 / 12%); border-radius: 50%; box-shadow: 0 0 0 72px rgb(255 255 255 / 2%), 0 0 0 145px rgb(255 255 255 / 2%); pointer-events: none; }
.header-content { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: center; min-height: 72px; border-bottom: 1px solid rgb(255 255 255 / 12%); }
.brand { display: flex; align-items: center; gap: 11px; font-size: .95rem; font-weight: 800; letter-spacing: .02em; }
.brand-mark { position: relative; display: block; width: 31px; height: 31px; border-radius: 10px; background: #fff; }
.brand-mark::before { content: ""; position: absolute; width: 16px; height: 16px; left: 7px; top: 7px; border: 3px solid var(--blue); border-radius: 50%; }
.brand-mark::after { content: ""; position: absolute; left: 13px; bottom: 4px; height: 8px; border-left: 3px solid var(--blue); }
.header-badge { border: 1px solid rgb(255 255 255 / 25%); border-radius: 100px; padding: 7px 13px; color: #dce7f6; font-size: .76rem; }
.hero { position: relative; min-height: 280px; padding-block: 40px 92px; }
.hero-copy { position: relative; z-index: 1; max-width: 580px; }
.eyebrow, .step, .pane-kicker { margin: 0 0 8px; color: #75e1cd; font-size: .7rem; font-weight: 900; letter-spacing: .17em; }
h1 { margin-bottom: 12px; font-size: clamp(2.15rem, 4.1vw, 3.6rem); line-height: 1.22; letter-spacing: -.035em; }
.header-copy { margin-bottom: 0; color: #c8d7e8; font-size: .95rem; }
.hero-route { position: absolute; width: 310px; height: 105px; right: 85px; top: 94px; transform: rotate(-13deg); border-top: 5px solid rgb(117 225 205 / 75%); }
.hero-route::after { content: ""; position: absolute; width: 112px; right: -2px; top: -5px; border-top: 5px solid #7a9bff; transform-origin: left; transform: rotate(34deg); }
.hero-route span { position: absolute; top: -13px; width: 21px; height: 21px; border: 5px solid #75e1cd; border-radius: 50%; background: var(--navy); }
.hero-route span:nth-child(1) { left: 0; }
.hero-route span:nth-child(2) { left: 35%; }
.hero-route span:nth-child(3) { left: 65%; }
.hero-route span:nth-child(4) { left: 98%; border-color: #7a9bff; }

main { position: relative; z-index: 2; margin-top: -60px; padding-bottom: 36px; }
.search-panel, .routes-pane, .details-pane, .notice { background: var(--paper); border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 14px 36px rgb(25 48 79 / 6%); }
.search-panel { padding: 26px 30px 28px; border-color: #e8edf5; }
.section-heading, .results-heading, .pane-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.section-heading .step { color: var(--blue); }
h2 { margin: 0; font-size: clamp(1.35rem, 2.5vw, 1.85rem); line-height: 1.35; letter-spacing: -.025em; }
h3 { margin: 0; font-size: 1.08rem; letter-spacing: -.015em; }
.data-status { margin: 0; padding: 7px 12px; border-radius: 100px; background: #eff8f5; color: #24745d; font-size: .76rem; font-weight: 700; text-align: right; }
form { display: grid; gap: 19px; margin-top: 25px; }
.field { min-width: 0; }
.field label, .transfer-field legend { display: block; margin-bottom: 8px; color: #34465f; font-size: .83rem; font-weight: 800; }
.field input, .field select, .sort-label select { width: 100%; min-height: 56px; border: 1px solid #c8d4e3; border-radius: 13px; padding: 11px 15px; color: var(--ink); background: #fff; font-size: 16px; }
.field input:focus, .field select:focus, .sort-label select:focus { border-color: var(--blue); outline: 3px solid rgb(49 94 251 / 13%); }
.suggest-wrap { position: relative; }
.suggest-wrap::before { content: ""; position: absolute; z-index: 1; left: 20px; top: 20px; width: 15px; height: 15px; border: 2px solid #778ca7; border-radius: 50%; pointer-events: none; }
.suggest-wrap::after { content: ""; position: absolute; z-index: 1; left: 34px; top: 35px; width: 8px; border-top: 2px solid #778ca7; transform: rotate(45deg); pointer-events: none; }
.field input[type="search"] { min-height: 62px; padding-left: 52px; }
.field-help { display: block; margin-top: 6px; color: var(--muted); font-size: .76rem; }
.quick-stations { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 11px; }
.quick-stations span { margin-right: 3px; color: var(--muted); font-size: .73rem; }
.quick-stations button, .time-presets button { min-height: 48px; border: 1px solid #dbe3ee; border-radius: 100px; padding: 5px 12px; background: #f8fafe; color: #43536a; font-size: .77rem; font-weight: 750; }
.quick-stations button:hover, .time-presets button:hover { border-color: #91aaf8; color: var(--blue); }
.suggestions { position: absolute; top: calc(100% + 5px); left: 0; right: 0; z-index: 20; max-height: 250px; overflow-y: auto; border: 1px solid #bdccdf; border-radius: 14px; background: #fff; box-shadow: 0 16px 35px rgb(22 44 73 / 17%); }
.suggestion { display: block; width: 100%; min-height: 48px; border: 0; border-bottom: 1px solid #ecf0f5; padding: 10px 16px; background: #fff; color: var(--ink); text-align: left; }
.suggestion:last-child { border-bottom: 0; }
.suggestion:hover, .suggestion[aria-selected="true"] { background: var(--pale-blue); }
.field-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, .8fr); align-items: start; gap: 15px; }
.unit-input { position: relative; }
.unit-input input { padding-right: 62px; }
.unit-input span { position: absolute; top: 50%; right: 14px; transform: translateY(-50%); color: var(--muted); font-size: .82rem; pointer-events: none; }
.time-presets { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.time-presets button { min-height: 48px; padding: 5px 10px; }
.time-presets button[aria-pressed="true"] { border-color: var(--blue); background: var(--pale-blue); color: #254ccb; }
.transfer-field { min-width: 0; margin: 0; padding: 0; border: 0; }
.transfer-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; padding: 4px; border-radius: 14px; background: #edf1f7; }
.transfer-options label { position: relative; margin: 0; cursor: pointer; }
.transfer-options input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.transfer-options span { display: grid; place-items: center; min-height: 48px; border-radius: 10px; color: #54647b; font-size: .79rem; font-weight: 800; white-space: nowrap; }
.transfer-options input:checked + span { background: #fff; color: #284ecb; box-shadow: 0 2px 8px rgb(32 54 91 / 12%); }
.transfer-options input:focus-visible + span { outline: 3px solid #f1a84d; outline-offset: 2px; }
.primary-button { width: min(100%, 310px); min-height: 56px; border: 0; border-radius: 13px; padding: 13px 20px; background: var(--blue); color: #fff; font-size: .95rem; font-weight: 850; box-shadow: 0 8px 18px rgb(49 94 251 / 20%); }
.primary-button:hover:not(:disabled) { background: #244bd7; }
.primary-button span { margin-left: 8px; font-size: 1.18rem; }
.search-disclaimer { margin: -10px 0 0; color: var(--muted); font-size: .76rem; }
.error-message { margin: 16px 0 0; padding: 11px 13px; border-radius: 10px; background: #fff0ee; color: #9a332a; }

.results { margin-top: 39px; }
.results-heading { margin-bottom: 16px; }
.results-heading .step { color: var(--blue); }
.secondary-button { min-height: 48px; border: 1px solid #c7d4e4; border-radius: 11px; padding: 9px 14px; background: #fff; color: #345070; font-size: .82rem; font-weight: 800; white-space: nowrap; }
.secondary-button:hover { background: var(--pale-blue); }
.result-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 17px; }
.stat { display: flex; align-items: baseline; justify-content: center; gap: 6px; min-height: 74px; border: 1px solid var(--line); border-radius: 15px; padding: 14px 9px; background: #fff; }
.stat strong { font-size: 1.55rem; line-height: 1; letter-spacing: -.04em; }
.stat span { color: var(--muted); font-size: .75rem; font-weight: 700; }
.results-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.06fr); align-items: start; gap: 16px; }
.routes-pane, .details-pane { min-width: 0; padding: 22px; }
.pane-kicker { margin-bottom: 2px; color: #6a7e98; font-size: .63rem; }
.pane-note { margin: 9px 0 14px; color: var(--muted); font-size: .79rem; }
.sort-label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: .75rem; font-weight: 750; white-space: nowrap; }
.sort-label select { width: 132px; min-height: 48px; border-radius: 9px; padding: 5px 8px; font-size: .8rem; }
.route-list { display: grid; gap: 9px; }
.route-card { --accent: #4964ab; --accent-soft: #edf1ff; overflow: hidden; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 14px; background: #fff; }
.route-card[data-agency="jr"], .details-pane[data-agency="jr"] { --accent: #17865f; --accent-soft: #e6f5ee; }
.route-card[data-agency="metro"], .details-pane[data-agency="metro"] { --accent: #315efb; --accent-soft: #edf2ff; }
.route-card[data-agency="toei"], .details-pane[data-agency="toei"] { --accent: #784db5; --accent-soft: #f3edfc; }
.route-card[data-agency="tokyu"], .details-pane[data-agency="tokyu"] { --accent: #b52244; --accent-soft: #fff0f2; }
.route-card[data-agency="tobu"], .details-pane[data-agency="tobu"] { --accent: #23669e; --accent-soft: #eaf4fc; }
.route-card[data-agency="seibu"], .details-pane[data-agency="seibu"] { --accent: #a97913; --accent-soft: #fbf3df; }
.route-card[open], .route-card.selected { border-color: #a8bae0; border-left-color: var(--accent); box-shadow: 0 5px 14px rgb(35 64 101 / 7%); }
.route-card summary { display: grid; grid-template-columns: 39px minmax(0, 1fr) auto 17px; align-items: center; gap: 11px; min-height: 76px; padding: 11px 13px; cursor: pointer; list-style: none; }
.route-card summary::-webkit-details-marker { display: none; }
.route-card summary::after { content: "⌄"; color: #7e8da3; font-size: 1.3rem; transition: transform .2s; }
.route-card[open] summary::after { transform: rotate(180deg); }
.route-card summary:hover { background: #f8faff; }
.route-emblem { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); font-size: .73rem; font-weight: 900; }
.route-heading { min-width: 0; display: grid; gap: 1px; }
.agency-name { color: var(--accent); font-size: .63rem; font-weight: 850; letter-spacing: .02em; }
.route-title { font-size: .89rem; font-weight: 850; line-height: 1.35; overflow-wrap: anywhere; }
.route-meta { display: grid; gap: 1px; color: var(--muted); font-size: .67rem; white-space: nowrap; text-align: right; }
.route-meta strong { color: var(--ink); font-size: .97rem; }
.route-content { padding: 0 16px 15px 63px; }
.route-view { min-height: 48px; border: 0; padding: 3px 0 9px; background: transparent; color: var(--accent); font-size: .78rem; font-weight: 850; text-align: left; }
.section-list { display: grid; gap: 6px; border-left: 2px solid #dfe6ef; padding-left: 14px; }
.section-button { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 6px; width: 100%; min-height: 50px; border: 1px solid #e3e9f1; border-radius: 10px; padding: 7px 10px; background: #f9fbfe; color: var(--ink); text-align: left; }
.section-button::before { content: ""; position: absolute; left: -21px; top: 50%; width: 10px; height: 10px; border: 2px solid var(--accent); border-radius: 50%; background: #fff; transform: translateY(-50%); }
.section-button:hover, .section-button[aria-current="true"] { border-color: var(--accent); background: var(--accent-soft); }
.section-info { display: grid; gap: 2px; min-width: 0; }
.section-name { font-size: .76rem; font-weight: 820; }
.section-count { color: var(--muted); font-size: .69rem; }
.section-arrow { color: var(--accent); font-size: 1rem; }
.details-pane { position: sticky; top: 14px; display: flex; flex-direction: column; max-height: calc(100vh - 28px); --accent: #315efb; }
.count-pill { border-radius: 100px; padding: 5px 11px; background: var(--accent-soft, #edf2ff); color: var(--accent); font-size: .76rem; font-weight: 850; white-space: nowrap; }
.station-list { display: grid; gap: 0; min-height: 0; overflow-y: auto; border-left: 2px solid #e5eaf2; margin-left: 8px; padding-left: 17px; }
.station-row { position: relative; border-bottom: 1px solid #edf1f5; padding: 12px 9px 12px 1px; }
.station-row::before { content: ""; position: absolute; left: -24px; top: 19px; width: 10px; height: 10px; border: 2px solid var(--accent); border-radius: 50%; background: #fff; }
.station-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.station-name { font-size: .89rem; font-weight: 850; }
.station-time { color: var(--accent); font-size: .92rem; font-weight: 900; white-space: nowrap; }
.station-route { margin: 4px 0 0; color: #49617c; font-size: .73rem; overflow-wrap: anywhere; }
.station-extra { margin: 3px 0 0; color: var(--muted); font-size: .7rem; }
.back-to-routes { display: none; }
.empty-state { border: 1px dashed #b9c8da; border-radius: 12px; padding: 21px; color: var(--muted); font-size: .85rem; }

.notice { margin-top: 28px; padding: 19px 23px; }
.notice h2 { margin-bottom: 7px; font-size: .99rem; }
.notice p { margin: 6px 0 0; color: var(--muted); font-size: .76rem; }
.source-links { overflow-wrap: anywhere; }
.site-footer { padding: 0 16px 27px; color: var(--muted); font-size: .72rem; text-align: center; }

@media (max-width: 1050px) {
  .hero-route { right: 12px; opacity: .45; }
  .field-row { grid-template-columns: 1fr 1.25fr; }
  .field-row > .field:last-child { grid-column: 1 / -1; max-width: 250px; }
  .route-card summary { grid-template-columns: 39px minmax(0, 1fr) 17px; }
  .route-meta { grid-column: 2; grid-row: 2; text-align: left; }
  .route-card summary::after { grid-column: 3; grid-row: 1 / 3; }
}
@media (max-width: 760px) {
  .shell { width: min(100% - 24px, 580px); }
  .header-content { min-height: 61px; }
  .header-badge { display: none; }
  .hero { min-height: 230px; padding-block: 30px 86px; }
  .hero-route { width: 165px; top: 105px; right: -43px; opacity: .26; }
  h1 { font-size: clamp(2.05rem, 9vw, 2.6rem); }
  .header-copy { max-width: 300px; font-size: .83rem; }
  main { margin-top: -58px; }
  .search-panel, .routes-pane, .details-pane { border-radius: 18px; padding: 19px; }
  .section-heading { align-items: start; flex-direction: column; gap: 9px; }
  .data-status { text-align: left; }
  form { gap: 18px; margin-top: 21px; }
  .field-row { grid-template-columns: 1fr; gap: 17px; }
  .field-row > .field:last-child { grid-column: auto; max-width: none; }
  .primary-button { width: 100%; }
  .results { margin-top: 32px; }
  .results-grid { display: block; }
  .results:not(.show-details) .details-pane { display: none; }
  .results.show-details .routes-pane { display: none; }
  .details-pane { position: static; max-height: none; }
  .station-list { overflow: visible; }
  .back-to-routes { display: block; width: fit-content; min-height: 48px; border: 0; margin: -4px 0 9px -7px; padding: 7px; background: transparent; color: var(--blue); font-size: .83rem; font-weight: 850; }
  .result-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .stat { justify-content: start; min-height: 60px; padding: 12px 14px; }
  .stat strong { font-size: 1.32rem; }
  .notice { padding: 17px; }
}
@media (max-width: 420px) {
  .results-heading { align-items: start; flex-direction: column; gap: 11px; }
  .pane-heading { align-items: start; flex-direction: column; gap: 10px; }
  .sort-label { width: 100%; justify-content: space-between; }
  .route-content { padding-left: 16px; }
  .route-card summary { gap: 8px; }
  .time-presets button { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .route-card summary::after { transition: none; }
}
