/* ==== デザインB「路線図」: 白と紺、丸ノ内線の赤は"線"だけに使う ==== */
:root{
  --bg:#ffffff; --paper:#f3f5f8; --ink:#0f1c2e; --muted:#566273; --line:#e1e6ec;
  --accent:#f62e36; --chip:#e9edf2; --grid:#eef1f5; --link:#1f4f8f;
}
@media (prefers-color-scheme: dark){
  :root{
    color-scheme:dark;
    --bg:#0d1420; --paper:#151f2d; --ink:#edf1f6; --muted:#a2b0c2; --line:#253244;
    --accent:#ff5a60; --chip:#1d2939; --grid:#131c29; --link:#8db8f0;
  }
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;background:var(--bg);color:var(--ink);
  font-family:"Hiragino Kaku Gothic ProN","Hiragino Sans","Noto Sans JP",Meiryo,sans-serif;
  line-height:1.9;font-size:17px;-webkit-font-smoothing:antialiased}
a{color:var(--link);text-underline-offset:3px}
h1,h2,h3{text-wrap:balance}
h1,h2,h3,h4,.siteid,.chno,.big,.tile b,.toc a,.branch,.fold .ft{font-family:"Murecho","Hiragino Kaku Gothic ProN","Hiragino Sans","Noto Sans JP",Meiryo,sans-serif}
/* progress */
.progress{position:fixed;left:0;top:0;height:3px;background:var(--ink);width:0;z-index:11}

/* hero: 方眼の上に、方南町支線の路線図 */
.hero{padding:40px 16px 36px;position:relative;
  background:linear-gradient(var(--grid) 1px,transparent 1px) 0 0/28px 28px,
             linear-gradient(90deg,var(--grid) 1px,transparent 1px) 0 0/28px 28px,var(--bg)}
.hero-in{max-width:720px;margin:0 auto}
.siteid{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px}
.siteid .name{font-size:20px;font-weight:800;letter-spacing:.04em}
.badge{display:inline-block;font-size:13px;font-weight:600;padding:2px 10px;border-radius:4px;border:1.5px solid var(--ink);background:var(--bg);color:var(--ink)}
.hero h1{font-size:clamp(34px,8.4vw,60px);line-height:1.3;margin:22px 0 10px;font-weight:800;letter-spacing:.01em}
/* 主役は地名。「丸ノ内線の終点、」は小さく添え、「方南町」を大きく（会長: 方南町の文字を目立たせたい） */
.hero h1 .lead{display:block;font-size:clamp(18px,4.6vw,28px);line-height:1.5;font-weight:600;letter-spacing:.04em}
.hero h1 .place{display:block;font-size:clamp(52px,15vw,96px);line-height:1.15;letter-spacing:.06em}
.hero p{color:var(--muted);margin:0}
/* 支線図: 赤は方南町〜中野坂上の支線だけ。中野坂上から先は本線（灰色）へ続く */
.branch{margin:34px 0 0;position:relative;padding:26px 0 30px}
.branch .cap{position:absolute;top:0;left:0;font-size:13px;font-weight:600;color:var(--muted)}
.branch .rail{position:absolute;left:18px;width:calc(78% - 31px);top:35px;height:8px;border-radius:4px;background:var(--accent)}
.branch .main{position:absolute;left:78%;right:0;top:37px;height:4px;border-radius:2px;background:var(--muted)}
.branch .mainlbl{position:absolute;right:0;top:2px;font-size:13px;font-weight:600;color:var(--muted);white-space:nowrap}
.branch ol{list-style:none;margin:0;padding:0;display:flex;justify-content:space-between;position:relative;width:78%}
.branch li{position:relative;width:26px;height:26px;font-size:14px;font-weight:600;color:var(--ink)}
.branch li i{display:block;width:26px;height:26px;border-radius:50%;background:var(--bg);border:5px solid var(--accent);box-sizing:border-box}
/* 主役の方南町は丸を大きく太く。中野坂上の乗り換えの輪は細くして目立たせすぎない */
.branch li:first-child i{width:36px;height:36px;margin:-5px 0 0 0;border-width:11px}
.branch li:first-child span{top:38px}
.branch li:first-child b{font-size:19px;font-weight:800}
.branch li:last-child i{box-shadow:0 0 0 2px var(--bg),0 0 0 4px var(--muted)}
.branch li span{position:absolute;top:34px;left:50%;transform:translateX(-50%);white-space:nowrap}
.branch li:first-child span{left:0;transform:none}
.branch li b{font-size:15px}
@media (max-width:420px){.branch li span{font-size:12px}.branch li b{font-size:14px}.branch li:first-child b{font-size:17px}}

/* 目次: 章を駅に見立てた縦の線（紺）。行全体を押せる */
.toc{max-width:720px;margin:0 auto;padding:28px 16px 8px}
.toc ol{list-style:none;margin:0;padding:0;position:relative}
.toc ol:before{content:"";position:absolute;left:10px;top:22px;bottom:22px;width:4px;border-radius:2px;background:var(--ink)}
.toc li{position:relative}
.toc a{display:flex;align-items:center;min-height:46px;padding:4px 0 4px 38px;position:relative;text-decoration:none;color:var(--ink);font-weight:600;font-size:16px}
.toc a:before{content:"";position:absolute;left:3px;top:50%;margin-top:-9px;width:18px;height:18px;border-radius:50%;background:var(--bg);border:4px solid var(--ink);box-sizing:border-box}
.toc a small{display:inline-block;min-width:4.4em;color:var(--muted);font-weight:400;font-size:12px}
.toc a:hover{text-decoration:underline}
.toc a:focus-visible{outline:3px solid var(--link);outline-offset:2px;border-radius:6px}

/* chapters */
.chapter{max-width:720px;margin:0 auto;padding:88px 16px 40px}
.chno{display:inline-flex;align-items:center;gap:8px;font-size:12px;letter-spacing:.16em;color:var(--muted);font-weight:800}
.chno:before{content:"";width:16px;height:16px;border-radius:50%;border:4px solid var(--ink);box-sizing:border-box}
.chapter h2{font-size:clamp(28px,6vw,40px);line-height:1.35;margin:8px 0 22px;font-weight:800}
.chapter h3{font-weight:800}
.big{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 10px;margin:28px 0;padding:18px 20px;background:var(--paper);border-radius:12px}
.big .num{font-size:clamp(56px,15vw,104px);font-weight:800;line-height:1;color:var(--ink);font-variant-numeric:tabular-nums;letter-spacing:-.02em}
.big .unit{font-size:22px;font-weight:800}
.big .cap{font-size:15px;color:var(--muted);flex-basis:100%}
.panel{background:var(--paper);border-radius:12px;padding:22px;margin:24px 0}
.src{font-size:12px;color:var(--muted);margin-top:10px;line-height:1.6}
.pending{border:2px dashed var(--line);border-radius:12px;padding:22px;color:var(--muted);margin:24px 0}
.pending strong{color:var(--ink)}
.chips{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0 0}
.chips span{background:var(--bg);border:1px solid var(--line);border-radius:6px;padding:3px 10px;font-size:14px}
.grid2{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:12px;margin:20px 0}
.spot{background:var(--paper);border-radius:12px;padding:16px}
.spot b{display:block;font-size:17px;margin-bottom:4px}
.spot span{font-size:14px;color:var(--muted);line-height:1.7}

/* route diagram */
.route{width:100%;height:auto;display:block;margin:8px 0}
.route .track{stroke:var(--accent);stroke-width:6;stroke-linecap:round;fill:none}
.js .route .track{stroke-dasharray:600;stroke-dashoffset:600;transition:stroke-dashoffset 1.6s ease}
.in .route .track{stroke-dashoffset:0}
.route text{fill:var(--ink);font-size:26px;font-weight:bold}
.route .sub{fill:var(--muted);font-size:12px;font-weight:normal}
.route circle{fill:var(--paper);stroke:var(--accent);stroke-width:5}
.route .mainline{stroke:var(--muted);stroke-width:4;stroke-linecap:round;fill:none}
.route circle.xfer{stroke:var(--ink)}
.route .xferlbl{fill:var(--muted);font-size:20px;font-weight:bold}
.routecap{font-size:14px;color:var(--muted);margin:4px 0 0}

/* timeline */
.timeline{position:relative;margin:24px 0;padding-left:28px}
.timeline:before{content:"";position:absolute;left:6px;top:10px;bottom:10px;width:4px;background:var(--ink);border-radius:2px}
.tl{position:relative;margin:0 0 22px}
.tl:before{content:"";position:absolute;left:-28px;top:8px;width:16px;height:16px;border-radius:50%;background:var(--bg);border:4px solid var(--ink);box-sizing:border-box}
.tl .when{font-weight:bold}
.tl .what{color:var(--muted);font-size:15px}

/* reveal */
.js .reveal{opacity:0;transform:translateY(24px);transition:opacity .8s ease,transform .8s ease}
.js .reveal.in{opacity:1;transform:none}
@media (prefers-reduced-motion: reduce){
  .js .reveal{opacity:1;transform:none;transition:none}
  .js .route .track{stroke-dashoffset:0;transition:none}
  .scrollcue{animation:none}
}

/* bus hub */
:root{--r030:#1f4e9c;--r33:#e4007f;--r71:#e9713f;--r70:#e5a800;--r66:#0092d8}
@media (prefers-color-scheme: dark){:root{--r030:#6f9cf0;--r33:#ff5fae;--r71:#ff9a6b;--r70:#ffcc33;--r66:#4cc3ff}}
.hub{width:100%;height:auto;display:block}
.hub .lines path{fill:none;stroke-width:6;stroke-linecap:round;stroke-linejoin:round}
.js .hub .lines path{stroke-dasharray:1;stroke-dashoffset:1;transition:stroke-dashoffset 1.6s ease}
.in .hub .lines path{stroke-dashoffset:0}
.hub .r030{stroke:var(--r030)} .hub .r33{stroke:var(--r33)} .hub .r71{stroke:var(--r71)} .hub .r70{stroke:var(--r70)} .hub .r66{stroke:var(--r66)}
.hub .hubc{fill:var(--ink)}
.hub .hubt{fill:var(--bg);font-size:22px;font-weight:bold}
.hub .q{fill:var(--paper);stroke:var(--r66);stroke-width:4}
.hub .dest circle{fill:var(--paper);stroke:var(--ink);stroke-width:3}
.hub .dest text{fill:var(--ink);font-size:24px;font-weight:bold}
.hub .dest .rt{fill:var(--muted);font-size:22px;font-weight:bold}
.hub .dest .sub2{fill:var(--muted);font-size:12px;font-weight:normal}
.chip{display:inline-block;width:14px;height:5px;border-radius:3px;margin-right:6px;vertical-align:middle}
.chip.r030{background:var(--r030)} .chip.r33{background:var(--r33)} .chip.r71{background:var(--r71)} .chip.r70{background:var(--r70)} .chip.r66{background:var(--r66)}
@media (prefers-reduced-motion: reduce){.js .hub .lines path{stroke-dashoffset:0;transition:none}}
table.bus{border-collapse:collapse;width:100%;font-size:15px;margin-top:12px}
table.bus th,table.bus td{border-bottom:1px solid var(--line);padding:8px 6px;text-align:left;vertical-align:top}
table.bus th{white-space:nowrap;width:7.5em}
@media (prefers-reduced-motion: reduce){.hub .spokes path{stroke-dashoffset:0;transition:none}}
/* ch5 */
:root{--w1:#f7e948;--w2:#c6dc3c;--w3:#8fcdf0}
.depth{width:100%;height:auto;display:block}
.depth .ground{stroke:var(--ink);stroke-width:2}
.depth rect.lv1{fill:var(--w1)} .depth rect.lv2{fill:var(--w2)} .depth rect.lv3{fill:var(--w3)}
.js .depth rect:not(.person rect){transform-origin:0 300px;transform:scaleY(0);transition:transform 1s ease}
.in .depth rect{transform:scaleY(1)!important}
.depthnote{font-size:15px;margin:10px 0 0;padding-left:1.2em}
.depth .person *{fill:var(--muted);transform:none;transition:none}
.depth .lbl{fill:var(--ink);font-size:24px}
.depth .hint{fill:var(--muted);font-size:20px}
.depth .mark line{stroke:var(--ink);stroke-width:1.5;stroke-dasharray:3 4}
.depth .mark circle{fill:var(--ink)}
.depth .mark text{fill:var(--ink);font-size:24px;font-weight:bold}
.depth .mark text.hint{font-weight:normal;font-size:12px;fill:var(--muted)}
.js .depth .mark{opacity:0;transition:opacity .8s ease 1s}
.in .depth .mark{opacity:1!important}
.rank{margin:0 0 18px}
.rname{font-weight:bold;font-size:17px;margin-bottom:6px}
.rrow{display:grid;grid-template-columns:5em 1fr 1.5em;align-items:center;gap:10px;font-size:14px;margin:4px 0}
.rrow b{font-size:16px}
.meter{display:grid;grid-template-columns:repeat(5,1fr);gap:4px}
.meter i{height:12px;border-radius:3px;background:var(--line)}
.meter[data-rank="2"] i:nth-child(-n+2),.meter[data-rank="3"] i:nth-child(-n+3),.meter[data-rank="4"] i:nth-child(-n+4){background:var(--ink)}
@media (prefers-reduced-motion: reduce){.js .depth rect:not(.person rect){transform:none;transition:none}.js .depth .mark{opacity:1;transition:none}}
.ward{margin:0 0 14px}.ward b{display:block;font-size:15px;margin-bottom:2px}
.rrow2{display:grid;grid-template-columns:8.5em 1fr 1.2em 4.5em;align-items:center;gap:10px;font-size:14px;margin:6px 0}
.rrow2 small{display:block;font-size:11px;color:var(--muted);line-height:1.2}
.rrow2 b{font-size:15px}.rrow2 em{font-style:normal;font-size:12px;color:var(--muted);text-align:right}
.meter[data-rank="1"] i:nth-child(-n+1){background:var(--ink)}
.fold{background:var(--paper);border-radius:12px;margin:20px 0;overflow:hidden}
.fold summary{list-style:none;cursor:pointer;padding:20px 52px 20px 22px;position:relative;display:block}
.fold summary::-webkit-details-marker{display:none}
.fold .ft{display:block;font-size:20px;font-weight:bold;margin-bottom:4px}
.fold .fl{display:block;font-size:15px;color:var(--muted);line-height:1.7}
.fold .fc{position:absolute;right:22px;top:26px;width:12px;height:12px;border-right:3px solid var(--muted);border-bottom:3px solid var(--muted);transform:rotate(45deg);transition:transform .3s ease}
.fold[open] .fc{transform:rotate(-135deg);top:32px}
.fold summary:hover .ft{text-decoration:underline}
.fold .fbody{padding:0 22px 8px;border-top:1px solid var(--line)}
.fold .fbody .panel{background:var(--bg)}
.fold summary:focus-visible{outline:3px solid var(--link);outline-offset:-3px;border-radius:12px}
table.schools{border-collapse:collapse;width:100%;font-size:14px}
table.schools th,table.schools td{border-bottom:1px solid var(--line);padding:8px 6px;text-align:left;vertical-align:top}
table.schools thead th{color:var(--muted);font-weight:normal;font-size:12px}
table.schools tbody th{white-space:nowrap;font-weight:bold}
table.schools small{display:block;font-size:11px;color:var(--muted);font-weight:normal}
table.schools .note2{font-size:12px;color:var(--muted);white-space:nowrap}
@media (max-width:560px){
  table.schools thead{display:none}
  table.schools,table.schools tbody{display:block}
  table.schools tr{display:grid;grid-template-columns:3.6em 1fr;gap:2px 10px;padding:10px 0;border-bottom:1px solid var(--line)}
  table.schools th,table.schools td{border:0;padding:0}
  table.schools tbody th{grid-column:1/-1;white-space:normal;display:flex;gap:8px;align-items:baseline;flex-wrap:wrap}
  table.schools tbody th small{display:inline}
  table.schools td:nth-of-type(1),table.schools td:nth-of-type(2){display:contents}
  table.schools td:nth-of-type(1)::before{content:"小学校"}
  table.schools td:nth-of-type(2)::before{content:"中学校"}
  table.schools td:nth-of-type(1)::before,table.schools td:nth-of-type(2)::before{font-size:12px;color:var(--muted);padding-top:3px}
  table.schools .note2{grid-column:1/-1;white-space:normal}
}
.timeline.past{opacity:.7}
.timeline.past:before{background:var(--muted)}
.timeline.past .tl:before{border-color:var(--muted)}
.tiles{display:grid;grid-template-columns:repeat(auto-fill,minmax(130px,1fr));gap:10px;margin:18px 0 6px}
.tile{background:var(--paper);border-radius:10px;padding:14px 14px 12px}
.tile b{display:block;font-size:34px;line-height:1.1;font-variant-numeric:tabular-nums}
.tile span{font-size:14px;color:var(--muted)}
.clists h4{font-size:16px;margin:18px 0 6px}.clists h4 span{font-size:12px;color:var(--muted);font-weight:normal;margin-left:8px}
.clist{list-style:none;padding:0;margin:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:2px 16px}
.clist li{font-size:14px;padding:5px 0;border-bottom:1px dashed var(--line)}
.clist li small{margin-left:8px;font-size:11px;color:var(--muted)}
footer{max-width:720px;margin:48px auto 0;padding:48px 16px 80px;font-size:14px;color:var(--muted);border-top:1px solid var(--line)}
footer h3{color:var(--ink);font-size:16px}
footer ul{padding-left:1.2em}
/* 章ページの下は2行だけ（会長: このサイトについての存在感が強すぎる）。詳しい説明はトップの一番下（#about）にまとめる */
footer.slim{margin-top:40px;padding:20px 16px 48px;font-size:13px;line-height:1.7}
footer.slim p{margin:0 0 6px}
footer.slim .links{display:flex;flex-wrap:wrap;gap:2px 16px}

/* ==== ページ分け: 上に固定するサイト名と章メニュー、下の前後リンク ==== */
.bar{position:sticky;top:0;z-index:10;background:var(--bg);border-bottom:1px solid var(--line)}
.bar-in{max-width:720px;margin:0 auto;padding:10px 16px 0;display:flex;align-items:center;gap:10px}
.bar .home{font-family:"Murecho","Hiragino Kaku Gothic ProN","Hiragino Sans","Noto Sans JP",Meiryo,sans-serif;font-weight:800;font-size:17px;color:var(--ink);text-decoration:none;letter-spacing:.04em}
.bar .home:hover{text-decoration:underline}
.badge.sm{font-size:11px;padding:0 6px;border-width:1px}
.chnav{max-width:720px;margin:0 auto}
.chnav ol{list-style:none;margin:0;padding:8px 16px 10px;display:flex;gap:6px;overflow-x:auto;scrollbar-width:none}
.chnav ol::-webkit-scrollbar{display:none}
.chnav a{flex:none;display:inline-flex;align-items:center;gap:6px;min-height:36px;padding:2px 12px;border:1px solid var(--line);border-radius:999px;font-size:14px;font-weight:600;color:var(--ink);text-decoration:none;white-space:nowrap;background:var(--bg)}
.chnav a small{font-size:11px;color:var(--muted);font-weight:600}
.chnav a:hover{border-color:var(--ink)}
.chnav a[aria-current="page"]{background:var(--ink);border-color:var(--ink);color:var(--bg)}
.chnav a[aria-current="page"] small{color:var(--bg);opacity:.75}
.chnav a:focus-visible,.pager a:focus-visible,.bar .home:focus-visible,.toc a:focus-visible{outline:3px solid var(--link);outline-offset:2px}
.page .chapter{padding-top:36px}
.pager{max-width:720px;margin:24px auto 0;padding:0 16px;display:grid;grid-template-columns:1fr 1fr;gap:10px}
.pager a{display:flex;flex-direction:column;gap:2px;padding:14px 16px;border:1px solid var(--line);border-radius:12px;color:var(--ink);text-decoration:none;font-weight:600;min-height:64px}
.pager a small{font-size:12px;color:var(--muted);font-weight:400}
.pager a.next{grid-column:2;text-align:right}
.pager a:hover{border-color:var(--ink)}
/* トップの章の入口: 駅に見立てた縦の線に、章の中身を1行ずつ */
.toc a.entry{flex-direction:column;align-items:flex-start;justify-content:center;padding:10px 0 10px 38px;min-height:64px;gap:0}
.toc a.entry:before{top:22px;margin-top:0}
.toc a.entry .t{font-size:18px;font-weight:800;line-height:1.5}
.toc a.entry .t small{min-width:0;margin-right:8px}
.toc a.entry .d{font-family:"Hiragino Kaku Gothic ProN","Hiragino Sans","Noto Sans JP",Meiryo,sans-serif;font-size:14px;font-weight:400;color:var(--muted);line-height:1.6}
.toc ol:before{top:30px;bottom:30px}
.toc h2{font-size:15px;color:var(--muted);margin:0 0 6px;font-weight:600}
/* パソコンの幅では章メニューを折り返して全部見せる（スマホは横にスクロール） */
@media (min-width:721px){.chnav ol{flex-wrap:wrap}}

/* マーク（K2 電車と車止め）。サイト名の左に置く */
.logo{display:block;flex:none;height:22px;width:auto;color:var(--ink)}
.bar .home{display:inline-flex;align-items:center;gap:8px}
.siteid .name{display:inline-flex;align-items:center;gap:10px}
.logo.lg{height:34px}

/* トップの章の入口: 押せることが一目でわかるよう、1章ずつカードにして右に「›」をつける（会長: 初めての人がリンクだと気づきにくい） */
.toc li{padding-left:36px}
.toc li:before{content:"";position:absolute;left:3px;top:50%;margin-top:-9px;width:18px;height:18px;border-radius:50%;background:var(--bg);border:4px solid var(--ink);box-sizing:border-box;z-index:1}
.toc a.entry{padding:12px 44px 12px 16px;margin:6px 0;background:var(--paper);border:1px solid var(--line);border-radius:12px;min-height:0}
.toc a.entry:before{display:none}
.toc a.entry:after{content:"";position:absolute;right:18px;top:50%;width:10px;height:10px;margin-top:-5px;border-top:3px solid var(--ink);border-right:3px solid var(--ink);transform:rotate(45deg)}
.toc a.entry:hover{border-color:var(--ink);text-decoration:none}
.toc a.entry:hover .t{text-decoration:underline}
.toc a.entry:active{background:var(--chip)}
