/*
VOICE: a railway operator's corporate site: orderly, precise, trustworthy; reference depth for enthusiasts.
IDEA: the "rolling stock" pages of a rail company website, extended into a world encyclopedia.
PICTURE: large technical side-elevation drawings on pale drafting plates, with callouts and dimensions.
COLOUR and TYPE: white ground, deep rail blue nav stripe, grey spec tables, Doctor Yellow accent; Noto Sans JP.
LAYOUT: utility bar, header, global nav bar, breadcrumbs, content to 1200px, sitemap footer; stacks below 900px.
*/
:root {
  color-scheme: light dark;
  --bg: light-dark(#ffffff, #10141b);
  --bg-2: light-dark(#f3f5f8, #171c25);
  --plate: light-dark(#f2f5f9, #e9eef5);
  --ink: light-dark(#1a1f27, #e8ecf2);
  --ink-2: light-dark(#4a5466, #b1bac8);
  --muted: light-dark(#6b7588, #8c96a8);
  --line: light-dark(#d9dee6, #2b323e);
  --th: light-dark(#eef1f5, #1d232d);
  --blue: light-dark(#0b3d91, #7fa2ff);
  --blue-2: light-dark(#1f5fc9, #9db8ff);
  --accent: #ffd400;
  --fs: 16px;
}
:root[data-theme=light] { color-scheme: light; }
:root[data-theme=dark] { color-scheme: dark; }
:root.lg { --fs: 18.5px; }
* { box-sizing: border-box; min-width: 0; }
html { scroll-padding-top: 20px; }
body { margin: 0; background: var(--bg); color: var(--ink); overflow-x: clip;
       font: var(--fs)/1.7 "Noto Sans JP", "Segoe UI", system-ui, "Hiragino Sans", "Yu Gothic UI", sans-serif; }
a { color: var(--blue-2); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input { font: inherit; }
:focus-visible { outline: 2px solid var(--blue-2); outline-offset: 2px; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 max(3vw, 16px); }

/* utility bar */
.utility { background: var(--bg-2); border-bottom: 1px solid var(--line); font-size: 12.5px; color: var(--ink-2); }
.utility .wrap { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; min-height: 34px; }
.size { display: inline-flex; align-items: center; gap: 6px; }
.size button { border: 1px solid var(--line); background: var(--bg); color: var(--ink-2); padding: 2px 10px; font-size: 12px; cursor: pointer; min-height: 28px; }
.size button + button { margin-left: -7px; }
.size button[aria-pressed=true] { background: var(--blue); border-color: var(--blue); color: #fff; }

/* header */
.gh { background: var(--bg); }
.gh-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-block: 14px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand b { display: block; font-size: 1.2rem; font-weight: 900; line-height: 1.2; letter-spacing: .01em; }
.brand small { display: block; color: var(--muted); font-size: .78rem; letter-spacing: .08em; }
.mark { width: 44px; height: 44px; border-radius: 4px; background: var(--blue); position: relative; overflow: hidden; flex: none; }
.mark i { position: absolute; left: 0; right: 0; height: 4px; background: #fff; }
.mark i:first-child { top: 24px; } .mark i:last-child { top: 31px; }
.search { position: relative; flex: 1 1 280px; max-width: 420px; }
.search input { width: 100%; min-height: 44px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 4px;
                background: var(--bg); color: var(--ink); font-size: 16px; }
#results { position: absolute; left: 0; right: 0; top: 48px; margin: 0; padding: 4px; list-style: none; background: var(--bg); z-index: 20;
           border: 1px solid var(--line); border-radius: 4px; box-shadow: 0 10px 28px rgba(0,0,0,.16); max-height: 60vh; overflow: auto; }
#results a { display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; color: var(--ink); }
#results a:hover, #results a.sel { background: var(--bg-2); text-decoration: none; }
#results small { color: var(--muted); }

/* global nav */
.gnav { border-top: 1px solid var(--line); }
.gnav .wrap { display: flex; flex-wrap: wrap; }
.gnav a, .gnav button { display: flex; align-items: center; min-height: 52px; padding: 0 22px; color: var(--ink); font-weight: 700; font-size: .95rem;
       border: 0; background: none; cursor: pointer; border-bottom: 4px solid transparent; position: relative; }
.gnav a + a::before, .gnav button::before { content: ""; position: absolute; left: 0; top: 16px; bottom: 16px; width: 1px; background: var(--line); }
.gnav a:hover, .gnav button:hover { color: var(--blue-2); text-decoration: none; background: var(--bg-2); }
.gnav a.on { border-bottom-color: var(--blue); color: var(--blue); }
.stripe { height: 7px; background: linear-gradient(var(--blue) 0 4px, var(--bg) 4px 5px, var(--blue) 5px 7px); }

.crumbs { background: var(--bg-2); border-bottom: 1px solid var(--line); font-size: .8rem; color: var(--muted); }
.crumbs .wrap { padding-block: 9px; }
.crumbs a { color: var(--ink-2); }
.crumbs .sep { margin: 0 8px; }

main { padding-block: 28px 56px; display: block; }

/* headings */
h1 { font-size: clamp(1.9rem, 3.6vw, 2.6rem); line-height: 1.15; margin: 0; font-weight: 900; text-wrap: balance; }
h2.sec { font-size: 1.3rem; line-height: 1.35; margin: 40px 0 14px; padding: 4px 0 4px 14px; border-left: 6px solid var(--blue); font-weight: 700; }
.title-block { border-bottom: 1px solid var(--line); padding-bottom: 14px; margin-bottom: 20px; display: flex; gap: 16px; align-items: stretch; }
.title-block .bar { width: 8px; border-radius: 2px; background: var(--co, var(--blue)); flex: none; }
.title-block .ja { color: var(--ink-2); font-size: 1rem; }
.title-block .meta { color: var(--muted); font-size: .85rem; margin-top: 2px; }
sup.verify { font-size: .66em; font-weight: 700; color: #6b5200; background: #fff3b0; border-radius: 2px; padding: 0 4px;
             margin-left: 2px; cursor: help; vertical-align: super; }

.body p { margin: 0 0 14px; max-width: 72ch; }
.body ul { max-width: 72ch; padding-left: 1.2em; margin: 0 0 14px; }
.body li { margin-bottom: 6px; }
.lead { font-size: 1.05em; }

/* drawings */
.plate { background: var(--plate); border: 1px solid var(--line); padding: 10px 10px 6px; margin: 0 0 6px; color-scheme: light; }
.plate svg.el { display: block; width: 100%; height: auto; }
.plate .callout text, .plate .dim text { font: 600 22px "Noto Sans JP", sans-serif; fill: #3a4352; }
.plate.nolabels .callout { display: none; }
.figcap { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: .82rem; margin-bottom: 22px; }
.btn { border: 1px solid var(--blue); color: var(--blue); background: var(--bg); border-radius: 3px; padding: 6px 16px; min-height: 38px; cursor: pointer; font-size: .85rem; font-weight: 700; }
.btn:hover { background: var(--blue); color: #fff; }

.article { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 36px; align-items: start; }
@media (max-width: 1060px) { .article { grid-template-columns: minmax(0, 1fr); } .infobox { order: -1; max-width: 560px; } }

/* spec table (infobox) */
.infobox { border: 1px solid var(--line); background: var(--bg); font-size: .88rem; }
.infobox .ib-head { background: var(--co, var(--blue)); color: #fff; padding: 10px 14px; font-weight: 700; }
.infobox .ib-head small { display: block; font-weight: 400; opacity: .9; }
.infobox .ib-img { background: var(--plate); padding: 6px; border-bottom: 1px solid var(--line); color-scheme: light; }
.infobox .ib-img svg { display: block; width: 100%; height: auto; }
.ib-photo { margin: 0; border-bottom: 1px solid var(--line); }
.ib-photo img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; background: var(--plate); }
.ib-photo figcaption { padding: 6px 10px 8px; font-size: .74rem; line-height: 1.45; color: var(--muted); }
.ib-photo figcaption a { color: inherit; text-decoration: underline; }
table.spec { width: 100%; border-collapse: collapse; }
table.spec th, table.spec td { text-align: left; vertical-align: top; padding: 8px 12px; border-top: 1px solid var(--line); }
table.spec th { width: 40%; background: var(--th); color: var(--ink-2); font-weight: 700; }
table.spec .grp td { background: var(--blue); color: #fff; font-weight: 700; font-size: .78rem; letter-spacing: .04em; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.status { display: inline-block; padding: 0 8px; font-size: .78rem; font-weight: 700; border: 1px solid; border-radius: 2px; }
.status.on { color: #146c35; border-color: #8fd1a6; background: #eaf7ef; }
.status.off { color: #4a5466; border-color: #c9d0da; background: #f1f3f6; }

.toc { border: 1px solid var(--line); background: var(--bg-2); padding: 12px 20px 12px 16px; font-size: .9rem; margin: 6px 0; display: inline-block; }
.toc b { display: block; margin-bottom: 4px; }
.toc ol { margin: 0; padding-left: 1.3em; }

.consist-wrap { padding: 8px 0 4px; }
svg.consist { display: block; width: 100%; height: auto; }
svg.consist .no { font: 600 12px "Noto Sans JP", sans-serif; fill: var(--ink-2); }
svg.consist .cls { font: 700 11px "Noto Sans JP", sans-serif; fill: #fff; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .82rem; color: var(--ink-2); margin-top: 4px; }
.legend i { display: inline-block; width: 22px; height: 12px; vertical-align: -1px; margin-right: 5px; }

.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); padding: 5px 10px 5px 5px; font-size: .82rem; }
.swatch i { width: 28px; height: 28px; border: 1px solid rgba(0,0,0,.15); }
.swatch code { color: var(--ink-2); }

.bars { display: grid; gap: 3px; max-width: 680px; }
.bar { display: grid; grid-template-columns: 12em minmax(0, 1fr) 5.5em; align-items: center; gap: 10px; font-size: .84rem; padding: 2px 6px; color: var(--ink-2); }
.bar:hover { background: var(--bg-2); }
.bar .t { height: 10px; }
.bar .f { display: block; height: 100%; border-radius: 0 3px 3px 0; background: light-dark(#b9c3d3, #4a5568); }
.bar.me { color: var(--ink); font-weight: 700; }
.bar.me .f { background: var(--blue); }
.bar .v { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar a { color: inherit; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* link cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.card { display: flex; flex-direction: column; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.card:hover { text-decoration: none; border-color: var(--blue-2); box-shadow: 0 6px 18px rgba(11,61,145,.12); }
.card .pic { background: var(--plate); color-scheme: light; border-bottom: 1px solid var(--line); }
.card .pic svg { display: block; width: 100%; height: auto; }
.card .cap { padding: 9px 12px 11px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card .cap b { display: block; font-size: .95rem; line-height: 1.35; }
.card .cap small { color: var(--muted); font-size: .78rem; }
.chev { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--blue); color: #fff; display: inline-grid; place-items: center; font-size: 14px; line-height: 1; }
.more { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }

/* home */
.banner { background: linear-gradient(120deg, #0b3d91, #1f5fc9); color: #fff; margin-top: -28px; }
.banner-in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 32px; align-items: center; padding-block: 34px; }
.banner h1 { color: #fff; font-size: clamp(2rem, 4vw, 3rem); }
.banner p { color: #dbe6ff; max-width: 52ch; }
.banner .plate { border: 0; box-shadow: 0 18px 40px rgba(0,0,0,.25); margin: 0; }
.banner .stats { display: flex; gap: 26px; margin-top: 14px; flex-wrap: wrap; }
.banner .stats b { display: block; font-size: 1.7rem; line-height: 1.1; }
.banner .stats span { font-size: .8rem; color: #c8d6f5; }
.banner .cap { color: #c8d6f5; font-size: .8rem; margin-top: 6px; }
.banner .cap a { color: #fff; font-weight: 700; }
@media (max-width: 900px) { .banner-in { grid-template-columns: minmax(0, 1fr); } }
.info { border: 1px solid var(--line); }
.info h2 { margin: 0; font-size: 1rem; padding: 10px 16px; background: var(--th); border-bottom: 2px solid var(--blue); }
.info ul { list-style: none; margin: 0; padding: 0; }
.info li { display: grid; grid-template-columns: 7.5em minmax(0, 1fr); gap: 12px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: .92rem; }
.info li:first-child { border-top: 0; }
.info time { color: var(--muted); font-variant-numeric: tabular-nums; }
.two { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 24px; margin-top: 28px; }
@media (max-width: 900px) { .two { grid-template-columns: minmax(0, 1fr); } }
.regions { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.region { border: 1px solid var(--line); padding: 14px 16px; color: var(--ink); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.region:hover { border-color: var(--blue-2); text-decoration: none; }
.region b { display: block; }
.region small { color: var(--muted); }

.jump { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.jump a { border: 1px solid var(--line); padding: 6px 14px; font-size: .85rem; color: var(--ink); font-weight: 700; }
.jump a:hover { border-color: var(--blue-2); text-decoration: none; }
.country { font-size: 1rem; margin: 22px 0 10px; padding-bottom: 6px; border-bottom: 2px solid var(--line); }

/* timeline */
.g-axis, .g-row { display: grid; grid-template-columns: 14em minmax(0, 1fr); gap: 12px; align-items: center; }
.g-row { min-height: 26px; font-size: .84rem; }
.g-row:hover { background: var(--bg-2); }
.g-row a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-track { position: relative; height: 26px; }
.g-bar { position: absolute; top: 8px; height: 10px; border-radius: 0 3px 3px 0; background: var(--blue-2); }
.g-bar.off { background: light-dark(#9aa5b6, #5a6578); }
.g-ticks { position: relative; height: 24px; font-size: .75rem; color: var(--muted); }
.g-ticks span { position: absolute; transform: translateX(-50%); font-variant-numeric: tabular-nums; }
.g-grid { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); }
.g-now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent); }
.g-head { font-weight: 700; color: var(--blue); margin: 18px 0 4px; font-size: .9rem; border-bottom: 1px solid var(--line); padding-bottom: 2px; }

/* compare */
.scroll { overflow-x: auto; }
table.cmp { border-collapse: collapse; width: 100%; font-size: .88rem; min-width: 860px; }
table.cmp th, table.cmp td { padding: 6px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
table.cmp thead th { background: var(--th); font-size: .78rem; color: var(--ink-2); white-space: nowrap; border-top: 2px solid var(--blue); }
table.cmp th button { background: none; border: 0; color: inherit; font-weight: 700; cursor: pointer; padding: 4px 0; min-height: 32px; }
table.cmp .r { text-align: right; }
table.cmp .nose { width: 200px; background: var(--plate); color-scheme: light; }
table.cmp .nose svg { display: block; width: 100%; height: auto; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 14px; }
.filters button { border: 1px solid var(--line); background: var(--bg); color: var(--ink); padding: 5px 14px; min-height: 36px; cursor: pointer; font-size: .85rem; }
.filters button[aria-pressed=true] { background: var(--blue); border-color: var(--blue); color: #fff; }

/* footer */
.gf { background: #23272e; color: #c5ccd6; font-size: .85rem; padding: 34px 0 30px; border-top: 6px solid #0b3d91; }
.gf-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 22px; }
.gf h4 { color: #fff; margin: 0 0 8px; font-size: .88rem; padding-bottom: 6px; border-bottom: 1px solid #3a404a; }
.gf ul { list-style: none; margin: 0; padding: 0; }
.gf li { margin: 4px 0; }
.gf a { color: #c5ccd6; }
.gf a:hover { color: #fff; }
.gf-note { margin: 26px 0 0; padding-top: 16px; border-top: 1px solid #3a404a; color: #9aa3b0; font-size: .78rem; max-width: 110ch; }

@media (max-width: 700px) {
  .gnav a, .gnav button { padding: 0 12px; min-height: 46px; font-size: .88rem; }
  .brand small { display: none; }
  .plate .callout text, .plate .dim text { font-size: 30px; }
  .bar { grid-template-columns: 8em minmax(0, 1fr) 5em; }
  .g-axis, .g-row { grid-template-columns: 8.5em minmax(0, 1fr); }
  .info li { grid-template-columns: minmax(0, 1fr); gap: 0; }
}
