:root {
  color-scheme: light;
  --paper: #f3f6fa;
  --paper-deep: #e8eef5;
  --surface: #fbfcfe;
  --ink: #152840;
  --muted: #546b83;
  --faint: #73879b;
  --line: #cbd6e2;
  --line-strong: #9cadbe;
  --blue: #2459b9;
  --blue-deep: #183f8c;
  --blue-soft: #e1ebfa;
  --teal: #176c5a;
  --teal-soft: #e2f2ed;
  --amber: #89500f;
  --amber-soft: #fff1d8;
  --radius: 14px;
  --sans: "Avenir Next", "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  font-family: var(--sans);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { min-width: 320px; margin: 0; color: var(--ink); background: var(--paper); font-size: 16px; line-height: 1.55; }
a { color: var(--blue-deep); text-decoration-color: #819ac2; text-underline-offset: .18em; }
a:hover { color: #17386f; text-decoration-color: currentColor; }
a:focus-visible, button:focus-visible { outline: 3px solid #3373d1; outline-offset: 3px; border-radius: 4px; }
button { font: inherit; }
img { max-width: 100%; height: auto; }

.page-frame { width: min(1220px, 100%); margin: 0 auto; padding: 0 38px 64px; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 76px; border-bottom: 1px solid var(--line); background: var(--paper); }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; font-size: 17px; font-weight: 650; letter-spacing: -.025em; }
.brand-title { max-width: 34ch; margin: 0; color: var(--ink); font-size: 22px; font-weight: 650; line-height: 1.2; letter-spacing: -.025em; text-wrap: balance; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid #a9bdd9; border-radius: 10px 10px 10px 3px; color: var(--blue-deep); background: var(--blue-soft); font-size: 16px; font-weight: 750; }
.top-actions { display: flex; align-items: center; gap: 16px; color: var(--muted); font-size: 13px; }
.top-actions a { text-decoration: none; }
.page-main { min-height: calc(100vh - 160px); }
.page-title { max-width: 850px; margin: 0; color: var(--ink); font-size: clamp(2rem, 4.4vw, 3.35rem); font-weight: 610; line-height: 1.08; letter-spacing: -.04em; text-wrap: balance; overflow-wrap: anywhere; }
.page-subtitle { max-width: 72ch; margin: 15px 0 0; color: var(--muted); font-size: 17px; line-height: 1.55; }
.route-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 20px; color: var(--muted); font-size: 13px; }
.route-kicker span { display: inline-flex; align-items: center; gap: 7px; }
.route-kicker .bullet { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); }
.route-kicker strong { color: var(--ink); font-weight: 600; }
.current-callout { display: flex; align-items: flex-start; gap: 14px; max-width: 740px; margin: 25px 0 0; padding: 17px 20px; border: 1px solid #b8cbe5; border-radius: 13px; background: var(--blue-soft); }
.callout-pin { flex: 0 0 12px; width: 12px; height: 12px; margin-top: 7px; border: 3px solid #fff; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.current-callout strong { display: block; color: var(--blue-deep); font-size: 15px; font-weight: 650; }
.current-callout p { margin: 3px 0 0; color: #29486d; font-size: 14px; }
.route-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 9px 19px; margin: 26px 0 6px; color: var(--muted); font-size: 13px; }
.legend-item { display: inline-flex; align-items: center; gap: 7px; }
.legend-dot { width: 9px; height: 9px; border: 2px solid var(--line-strong); border-radius: 50%; background: var(--surface); }
.legend-dot.done { border-color: var(--teal); background: var(--teal); }
.legend-dot.review { border-color: var(--amber); background: var(--amber-soft); }
.legend-dot.current { width: 12px; height: 12px; border: 3px solid #fff; background: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.route-stage { margin: 0; padding: 0; color: var(--faint); font-size: 12px; }
.route-stage span { display: inline-block; padding: 14px 0 3px 10px; background: transparent; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; }
.route-map { position: relative; margin: 0; padding: 0 0 4px; list-style: none; isolation: isolate; }
.route-list { position: relative; z-index: 1; margin: 0; padding: 0; list-style: none; pointer-events: none; }
.route-region { margin: 0 0 8px; padding: 0 4px 5px; border-radius: 12px; }
.route-region.region-0 { background: rgba(36, 89, 185, .055); }
.route-region.region-1 { background: rgba(23, 108, 90, .06); }
.route-region.region-2 { background: rgba(74, 94, 146, .045); }
.route-region.region-3 { background: rgba(137, 80, 15, .05); }
.route-group-list { margin: 0; padding: 0; list-style: none; pointer-events: none; }
.route-drawing { position: absolute; z-index: -1; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.route-hit-layer { position: absolute; z-index: 2; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.route-line { fill: none; stroke: var(--line-strong); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.route-line.done { stroke: var(--teal); stroke-width: 2.6; }
.route-line.review { stroke: var(--amber); stroke-width: 2.6; stroke-dasharray: 3 5; }
.route-line.current { stroke: var(--blue); stroke-width: 3.5; }
.route-line.planned { stroke: var(--line-strong); stroke-width: 2; stroke-dasharray: 3 7; }
.route-hits { pointer-events: none; }
.route-hit { fill: none; stroke: transparent; stroke-width: 30; stroke-linecap: round; stroke-linejoin: round; pointer-events: stroke; cursor: help; touch-action: manipulation; }
.route-tooltip { position: fixed; z-index: 100; max-width: min(240px, calc(100vw - 16px)); padding: 8px 11px; border: 1px solid #36516c; border-radius: 8px; color: #f5f8fc; background: #172b42; box-shadow: 0 5px 16px #10263c2b; font-size: 13px; font-weight: 600; line-height: 1.35; pointer-events: none; }
.route-tooltip[hidden] { display: none; }
.route-row { position: relative; display: grid; grid-template-columns: minmax(0,1fr) 148px minmax(0,1fr); align-items: center; min-height: 126px; pointer-events: none; }
.route-node { position: relative; z-index: 1; grid-column: 2; justify-self: center; width: 19px; height: 19px; border: 2px solid var(--line-strong); border-radius: 50%; background: var(--paper); transform: translateX(var(--route-offset, 0px)); transition: box-shadow .25s cubic-bezier(.16,1,.3,1); pointer-events: none; }
.route-row.done .route-node { border-color: var(--teal); background: var(--teal); box-shadow: inset 0 0 0 4px var(--paper); }
.route-row.review .route-node { border-color: var(--amber); background: var(--amber-soft); box-shadow: inset 0 0 0 4px var(--paper); }
.route-row.current .route-node { width: 24px; height: 24px; border: 4px solid var(--paper); outline: 2px solid var(--blue); background: var(--blue); box-shadow: 0 0 0 7px #2459b91c; }
.station-link { position: relative; display: block; max-width: 480px; padding: 16px 18px 14px; border: 1px solid transparent; border-radius: 14px; color: var(--ink); background: transparent; text-decoration: none; transition: background-color .2s ease, border-color .2s ease, transform .3s cubic-bezier(.16,1,.3,1); pointer-events: auto; }
.route-row.left .station-link { grid-column: 1; justify-self: end; text-align: right; }
.route-row.right .station-link { grid-column: 3; justify-self: start; }
.station-link:hover { border-color: var(--line); background: #ffffffa8; transform: translateY(-2px); }
.route-row.done .station-link { color: var(--teal); }
.route-row.review .station-link { color: var(--ink); }
.route-row.review .station-number { color: var(--amber); }
.route-row.current .station-link { border-color: #b4c9e8; background: var(--surface); box-shadow: 0 9px 25px #172c4212; }
.route-row.current .station-title { color: var(--blue-deep); }
.station-top { display: flex; align-items: baseline; gap: 10px; }
.route-row.left .station-top { justify-content: flex-end; }
.station-number { flex: none; color: var(--faint); font-size: 12px; font-weight: 650; letter-spacing: .04em; }
.station-title { color: var(--ink); font-size: 21px; font-weight: 610; line-height: 1.22; letter-spacing: -.025em; text-wrap: balance; }
.station-summary { display: block; max-width: 46ch; margin-top: 5px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.route-row.left .station-summary { margin-left: auto; }
.station-meta { display: flex; flex-wrap: wrap; gap: 5px 12px; margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.route-row.left .station-meta { justify-content: flex-end; }
.station-meta b { color: var(--ink); font-weight: 600; }
.route-row.done .station-meta .fact-value { color: var(--teal); }
.route-row.review .station-meta .fact-value { color: var(--amber); }
.route-row.current .station-meta .fact-value { color: var(--blue-deep); font-weight: 650; }
.station-badge { display: inline-flex; align-items: center; margin-top: 7px; padding: 3px 8px; border: 1px solid #b8cbe5; border-radius: 20px; color: var(--blue-deep); background: var(--blue-soft); font-size: 11px; font-weight: 650; letter-spacing: .015em; }
.route-row.review .station-badge { border-color: #e7cc9b; color: var(--amber); background: var(--amber-soft); }
.branch { width: min(470px, 48%); margin: 10px 0 20px auto; padding: 13px 0 13px 19px; border-left: 1px dashed var(--line-strong); }
.branch-label { margin: 0 0 8px; color: var(--muted); font-size: 12px; }
.branch .station-link { max-width: none; padding: 14px 16px; border: 1px solid var(--line); background: #f8fafc; }
.branch .station-title { font-size: 18px; }
.route-note { max-width: 70ch; margin: 12px 0 0; color: var(--faint); font-size: 12px; }

.phase-heading { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 20px; margin: 0 0 28px; padding-bottom: 23px; border-bottom: 1px solid var(--line); }
.phase-heading .page-title { max-width: 900px; }
.phase-mark { display: flex; align-items: center; gap: 9px; padding-bottom: 5px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.phase-mark strong { color: var(--ink); font-weight: 600; }
.phase-status { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: #ffffff7a; font-size: 13px; }
.phase-status .legend-dot { width: 8px; height: 8px; }
.phase-status.current { border-color: #b8cbe5; color: var(--blue-deep); background: var(--blue-soft); }
.phase-status.review { border-color: #e8cea1; color: var(--amber); background: var(--amber-soft); }
.phase-status.done { border-color: #b7d8cf; color: var(--teal); background: var(--teal-soft); }
.date-detail { display: flex; flex-wrap: wrap; gap: 11px 26px; margin: 16px 0 0; color: var(--muted); font-size: 13px; }
.date-detail strong { color: var(--ink); font-weight: 600; }
.date-note { max-width: 75ch; margin-top: 14px; color: var(--muted); font-size: 13px; }
.section-heading { margin: 30px 0 8px; font-size: 20px; font-weight: 620; letter-spacing: -.025em; }
.section-intro { max-width: 70ch; margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.section-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.section-link { display: grid; grid-template-columns: 36px minmax(0,1fr) 24px; align-items: center; gap: 12px; min-height: 77px; padding: 12px 6px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; transition: color .2s ease; }
.section-link:hover { color: var(--blue-deep); }
.section-index { color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.section-title { display: block; font-size: 16px; font-weight: 600; line-height: 1.3; }
.section-summary { display: block; max-width: 72ch; margin-top: 3px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.section-arrow { color: var(--line-strong); font-size: 20px; transition: transform .2s ease, color .2s ease; }
.section-link:hover .section-arrow { transform: translateX(3px); color: var(--blue); }
.content-reading { max-width: none; margin: 28px 0 0; }
.content-reading h2 { margin: 34px 0 10px; font-size: 24px; font-weight: 620; line-height: 1.25; letter-spacing: -.03em; text-wrap: balance; }
.content-reading h3 { margin: 27px 0 8px; font-size: 19px; font-weight: 620; line-height: 1.3; letter-spacing: -.02em; }
.content-reading h4 { margin: 22px 0 7px; font-size: 16px; font-weight: 650; }
.content-reading p { margin: 0 0 15px; color: #304963; line-height: 1.78; }
.content-reading ul, .content-reading ol { margin: 5px 0 18px; padding-left: 24px; color: #304963; }
.content-reading li { padding-left: 4px; margin: 5px 0; line-height: 1.65; }
.content-reading li::marker { color: var(--blue); }
.content-reading strong { color: #1c3550; font-weight: 650; }
.content-reading blockquote { margin: 21px 0; padding: 2px 0 2px 17px; border-left: 1px solid var(--line-strong); color: var(--muted); }
.content-reading blockquote p { color: var(--muted); }
.content-reading a { text-decoration-thickness: 1px; }
.content-reading code { padding: .13em .36em; border: 1px solid #d7e1eb; border-radius: 5px; color: #264367; background: #eaf0f6; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em; overflow-wrap: anywhere; }
.content-reading pre { max-width: 100%; margin: 19px 0 22px; padding: 16px 18px; overflow-x: auto; border: 1px solid #cbd7e3; border-radius: 11px; color: #e8eff9; background: #172b42; font-size: 13px; line-height: 1.62; tab-size: 2; }
.content-reading pre code { padding: 0; border: 0; border-radius: 0; color: inherit; background: none; font-size: inherit; overflow-wrap: normal; }
.content-reading table { width: 100%; margin: 19px 0 22px; border-collapse: collapse; color: #304963; font-size: 14px; }
.content-reading th { color: var(--ink); background: var(--paper-deep); text-align: left; font-weight: 650; }
.content-reading th, .content-reading td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table-wrap { max-width: 100%; margin: 18px 0 22px; overflow-x: auto; }
.table-wrap table { min-width: 520px; margin: 0; }
.content-reading hr { margin: 28px 0; border: 0; border-top: 1px solid var(--line); }
.stage-layout { display: block; }
.stage-sidebar { min-width: 0; }
.desktop-course-tree { display: none; }
.mobile-course-tree { display: block; }
.tree-map-link { display: flex; align-items: center; min-height: 46px; padding: 7px 2px; border-bottom: 1px solid var(--line); color: var(--blue-deep); font-size: 14px; font-weight: 650; text-decoration: none; }
.phase-tree, .tree-children { margin: 0; padding: 0; list-style: none; }
.phase-tree { border-top: 1px solid var(--line); }
.tree-phase { border-bottom: 1px solid var(--line); }
.tree-phase > summary { display: grid; grid-template-columns: 34px minmax(0, 1fr) 18px; align-items: center; gap: 7px; min-height: 43px; padding: 6px 2px; color: var(--ink); font-size: 14px; font-weight: 560; line-height: 1.35; cursor: pointer; list-style: none; }
.tree-phase > summary::-webkit-details-marker { display: none; }
.tree-phase > summary::after { content: "⌄"; color: var(--faint); text-align: center; font-size: 15px; }
.tree-phase[open] > summary::after { content: "⌃"; }
.tree-phase.is-viewed > summary { color: var(--blue-deep); font-weight: 650; }
.tree-phase-number { color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.tree-phase.is-viewed > summary .tree-phase-number { color: var(--blue); }
.tree-children { margin: 0 0 9px 12px; padding: 2px 0 1px 12px; border-left: 1px solid var(--line); }
.tree-link { display: grid; grid-template-columns: 24px minmax(0, 1fr); align-items: start; gap: 7px; min-height: 35px; padding: 7px 2px; color: var(--muted); font-size: 13px; line-height: 1.35; text-decoration: none; overflow-wrap: anywhere; }
.tree-link:hover { color: var(--blue-deep); }
.tree-link.is-current { color: var(--blue-deep); font-weight: 650; }
.tree-index { color: var(--faint); font-size: 10px; font-variant-numeric: tabular-nums; }
.tree-link.is-current .tree-index { color: var(--blue); }
@media (pointer: coarse) {
  .tree-link { min-height: 44px; }
}
.mobile-course-tree summary { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 8px 2px; border-bottom: 1px solid var(--line); color: var(--ink); font-size: 14px; font-weight: 620; cursor: pointer; }
.mobile-course-tree summary span { color: var(--muted); font-size: 12px; font-weight: 500; }
.mobile-course-tree .tree-map-link { margin-top: 4px; }
.stage-main { min-width: 0; padding-top: 26px; }
.section-page-heading { margin-bottom: 22px; }
.not-found { max-width: 62ch; padding: 90px 0; }
.not-found p { color: var(--muted); }

@media (max-width: 760px) {
  .page-frame { padding: 0 22px 42px; }
  .topbar { min-height: 66px; }
  .brand { min-width: 0; gap: 9px; }
  .brand-title { max-width: 26ch; font-size: clamp(15px, 4.7vw, 17px); line-height: 1.2; }
  .top-actions { gap: 9px; font-size: 12px; }
  .top-actions .quiet { display: none; }
  .stage-layout { display: block; }
  .stage-sidebar { position: static; }
  .stage-main { padding-top: 20px; }
  .page-subtitle { margin-top: 10px; font-size: 15px; }
  .route-kicker { margin-top: 11px; gap: 6px 12px; font-size: 12px; }
  .route-kicker span:nth-child(n+2) { display: none; }
  .current-callout { margin-top: 12px; padding: 11px 12px; gap: 10px; }
  .current-callout p { font-size: 13px; }
  .current-callout a { font-size: 13px; }
  .route-legend { gap: 6px 12px; margin-top: 13px; font-size: 12px; }
  .route-stage span { padding-top: 10px; padding-bottom: 5px; }
  .route-row { grid-template-columns: 38px minmax(0,1fr); min-height: 128px; }
  .route-node { grid-column: 1; justify-self: start; margin-left: 5px; }
  .station-link, .route-row.left .station-link, .route-row.right .station-link { grid-column: 2; justify-self: stretch; max-width: none; padding: 13px 9px 13px 13px; text-align: left; }
  .route-row.left .station-top { justify-content: flex-start; }
  .route-row.left .station-summary { margin-left: 0; }
  .route-row.left .station-meta { justify-content: flex-start; }
  .station-title { font-size: 18px; }
  .station-summary { font-size: 13px; }
  .station-meta { gap: 3px 10px; font-size: 11px; }
  .route-stage span { padding-left: 47px; }
  .branch { width: auto; margin: 9px 0 17px 46px; padding-left: 13px; }
  .phase-heading { display: block; margin-bottom: 22px; }
  .phase-mark { margin-top: 13px; white-space: normal; }
  .date-detail { gap: 8px 18px; }
  .content-reading { margin-top: 20px; }
  .content-reading h2 { font-size: 22px; }
  .content-reading p { line-height: 1.7; }
  .content-reading th, .content-reading td { padding: 8px 10px; }
}

@media (min-width: 1560px) {
  .stage-sidebar { position: fixed; top: 24px; right: calc(50vw + 596px); z-index: 25; width: min(250px, calc(50vw - 620px)); max-height: calc(100vh - 48px); overflow-y: auto; }
  .desktop-course-tree { display: block; }
  .mobile-course-tree { display: none; }
  .stage-main { padding-top: 24px; }
}

@media (max-width: 380px) {
  .page-frame { padding-right: 15px; padding-left: 15px; }
  .station-title { font-size: 17px; }
  .station-link, .route-row.left .station-link, .route-row.right .station-link { padding-left: 10px; }
  .route-row { grid-template-columns: 32px minmax(0,1fr); }
  .route-stage span { padding-left: 40px; }
  .branch { margin-left: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
