:root {
  --canvas: #f6f8fa;
  --surface: #ffffff;
  --text: #24292f;
  --muted: #57606a;
  --border: #d0d7de;
  --line: #8c959f;
  --link: #0969da;
  --topic: #fff3bf;
  --topic-border: #d4b54c;
  --recommended: #dafbe1;
  --recommended-border: #2da44e;
  --selected: #ddf4ff;
  --selected-border: #0969da;
  --code: #f6f8fa;
  --detail: #eef4fb;
  --detail-border: #a8bfdc;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --mono: ui-monospace, 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  color-scheme: light;
}
:root[data-theme='dark'] {
  --canvas: #0d1117;
  --surface: #161b22;
  --text: #e6edf3;
  --muted: #b1bac4;
  --border: #3d444d;
  --line: #768390;
  --link: #8ec5ff;
  --topic: #544b26;
  --topic-border: #c7aa48;
  --recommended: #173b2b;
  --recommended-border: #56bd72;
  --selected: #17365b;
  --selected-border: #79b8ff;
  --code: #0d1117;
  --detail: #101b2b;
  --detail-border: #405573;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--canvas); color: var(--text); font: 15px/1.5 var(--font); }
button, input { font: inherit; }
button { color: inherit; }
a { color: var(--link); text-underline-offset: 2px; }
:focus-visible { outline: 3px solid var(--selected-border); outline-offset: 2px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; top: -50px; left: 12px; z-index: 30; padding: 8px; background: var(--surface); }
.skip:focus { top: 10px; }
.site-head { background: var(--surface); border-bottom: 1px solid var(--border); }
.site-head__inner { display: flex; align-items: center; gap: 18px; min-height: 56px; padding: 0 24px; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--text); text-decoration: none; font-weight: 700; }
.brand b { color: var(--link); }
.brand__mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 5px; background: #24292f; color: #fff; font: 700 13px/1 var(--mono); }
.site-head__label { padding-left: 18px; border-left: 1px solid var(--border); color: var(--muted); font-size: 13px; }
.theme-toggle { margin-left: auto; padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); cursor: pointer; font-size: 13px; }
.theme-toggle:hover { border-color: var(--link); }
.shell { padding: 0 24px; }
.hero { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 20px 0 17px; }
.eyebrow { margin: 0 0 3px; color: var(--muted); font: 600 11px/1.4 var(--mono); letter-spacing: .035em; }
h1, h2, h3, h4, p { overflow-wrap: anywhere; }
h1 { margin: 0; font-size: clamp(26px, 2.8vw, 34px); line-height: 1.18; letter-spacing: -.025em; }
.hero p:last-child { margin: 5px 0 0; color: var(--muted); font-size: 14px; }
.progress { display: flex; align-items: center; gap: 9px; flex: none; padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
.progress > strong { font-size: 21px; line-height: 1; }
.progress > strong small { color: var(--muted); font-size: 12px; }
.progress > span { display: flex; flex-direction: column; font-size: 12px; font-weight: 600; }
.progress > span small { color: var(--muted); font-size: 11px; font-weight: 400; }
.toolbar { position: relative; display: flex; align-items: center; gap: 14px; padding: 10px 0; border-top: 1px solid var(--border); }
.search { position: relative; width: min(340px, 100%); }
.search > span[aria-hidden] { position: absolute; top: 0; left: 11px; color: var(--muted); font-size: 22px; }
.search input { width: 100%; padding: 8px 10px 8px 35px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); font-size: 14px; }
.search input::placeholder { color: var(--muted); }
.toolbar__hint { margin-left: auto; color: var(--muted); font-size: 13px; }
.search-results { position: absolute; top: 48px; left: 0; z-index: 20; width: min(420px, 100%); max-height: 400px; overflow: auto; padding: 8px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); box-shadow: 0 8px 24px rgba(27,31,36,.14); }
.search-results p { margin: 4px 8px 8px; color: var(--muted); font-size: 12px; }
.search-results button { display: flex; gap: 9px; align-items: center; width: 100%; padding: 8px; border: 0; border-radius: 4px; background: transparent; text-align: left; cursor: pointer; font-size: 14px; }
.search-results button:hover { background: var(--selected); }
.search-results button b { color: var(--link); font-size: 12px; }
.search-results button small { margin-left: auto; color: var(--muted); }
.search-results__empty { display: block; padding: 9px; color: var(--muted); }
.jump { display: flex; gap: 5px; overflow-x: auto; align-items: center; padding: 3px 0 13px; }
.jump > span { flex: none; margin-right: 3px; color: var(--muted); font-size: 12px; }
.jump button { flex: none; padding: 5px 8px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface); cursor: pointer; font-size: 12px; }
.jump button:hover { border-color: var(--link); color: var(--link); }
.jump b { margin-right: 3px; color: var(--muted); font: 600 11px/1 var(--mono); }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) clamp(560px, 34vw, 960px); gap: clamp(24px, 1.5vw, 48px); align-items: start; }
.map-panel, .inspector { border: 1px solid var(--border); border-radius: 7px; background: var(--surface); }
.map-panel { min-width: 0; overflow: hidden; }
.map-panel__heading { display: flex; justify-content: space-between; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); color: var(--muted); font-size: 12px; }
.map-panel__heading span:first-child { color: var(--text); font-weight: 700; }
.roadmap-scroll { height: clamp(570px, calc(100vh - 255px), 860px); overflow: auto; overscroll-behavior: contain; scrollbar-color: var(--line) var(--canvas); }
.roadmap { position: relative; display: flex; align-items: flex-start; gap: 38px; width: max-content; min-height: 100%; padding: 24px 24px 36px; }
.roadmap::before { content: ''; position: absolute; z-index: 0; top: 62px; left: 40px; right: 40px; height: 2px; background: var(--line); }
.map-area { position: relative; z-index: 1; flex: none; width: 334px; }
.map-area__head { display: flex; gap: 11px; align-items: center; width: 100%; min-height: 76px; padding: 12px; border: 2px solid var(--border); border-radius: 6px; background: var(--surface); text-align: left; cursor: pointer; }
.map-area__head:hover, .map-area__head.is-selected { border-color: var(--selected-border); background: var(--selected); }
.map-area__number { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border: 1px solid var(--border); border-radius: 4px; background: var(--canvas); font: 600 13px/1 var(--mono); }
.map-area__head strong { display: block; font-size: 16px; line-height: 1.25; }
.map-area__head small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; line-height: 1.3; }
.branches { margin: 23px 0 0 16px; padding-left: 17px; border-left: 2px solid var(--line); }
.branch { position: relative; margin-bottom: 21px; }
.branch::before { content: ''; position: absolute; top: 26px; left: -17px; width: 17px; height: 2px; background: var(--line); }
.topic-node { display: grid; grid-template-columns: 30px 1fr auto; gap: 8px; align-items: center; width: 100%; min-height: 57px; padding: 9px; border: 1.5px solid var(--topic-border); border-radius: 5px; background: var(--topic); color: var(--text); text-align: left; cursor: pointer; }
.topic-node:hover, .topic-node.is-selected { border-color: var(--selected-border); outline: 1px solid var(--selected-border); }
.topic-node__index { display: grid; place-items: center; width: 27px; height: 27px; border: 1px solid var(--topic-border); border-radius: 3px; font: 600 11px/1 var(--mono); }
.topic-node strong { display: block; font-size: 15px; line-height: 1.25; }
.topic-node small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.node-arrow { color: var(--muted); font-size: 15px; }
.tool-nodes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 0 0 0 14px; padding: 10px 0 0 11px; border-left: 2px solid var(--line); }
.tool-node { min-width: 0; min-height: 37px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); text-align: left; cursor: pointer; font-size: 13px; font-weight: 600; line-height: 1.25; }
.tool-node:hover, .tool-node.is-selected { border-color: var(--selected-border); background: var(--selected); }
.tool-node.is-start { border-color: var(--recommended-border); background: var(--recommended); }
.tool-node.is-done { border-color: var(--recommended-border); }
.tool-node span { margin-left: 4px; color: #1a7f37; }
.inspector { position: sticky; top: 14px; min-width: 0; height: max(640px, calc(100dvh - 205px)); overflow-y: auto; overscroll-behavior: contain; border-color: var(--detail-border); border-left: 3px solid var(--selected-border); border-radius: 12px; background: var(--detail); box-shadow: 0 12px 36px rgba(0, 0, 0, .2); scrollbar-color: var(--line) var(--detail); font-size: clamp(17px, calc(.5vw + 8px), 20px); }
.inspector__header { position: relative; padding: 28px 30px 24px; border-bottom: 1px solid var(--detail-border); }
.inspector__header .eyebrow { padding-right: 32px; font-size: .7em; line-height: 1.5; }
.inspector__header h2 { margin: 8px 0 12px; padding-right: 32px; font-size: 1.9em; line-height: 1.15; letter-spacing: -.025em; }
.inspector__header p:last-child { margin: 0; color: var(--muted); font-size: 1em; line-height: 1.65; }
.inspector__close { position: absolute; top: 18px; right: 18px; width: 38px; height: 38px; border: 1px solid var(--detail-border); border-radius: 6px; background: var(--surface); cursor: pointer; font-size: 26px; line-height: 1; }
.inspector__close:hover { border-color: var(--link); }
.inspector__actions { display: flex; flex-wrap: wrap; gap: 10px; padding: 18px 24px; border-bottom: 1px solid var(--detail-border); }
.inspector__actions a, .adopt { display: inline-flex; align-items: center; min-height: 42px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); text-decoration: none; font-size: .8em; font-weight: 600; }
.inspector__actions a:hover, .adopt:hover { border-color: var(--link); }
.inspector__actions .primary-link, .adopt { border-color: var(--selected-border); background: var(--selected); color: var(--text); }
.adopt { cursor: pointer; }
.adopt[aria-pressed='true'] { border-color: var(--recommended-border); background: var(--recommended); }
.info-card { margin: 20px 24px; padding: 24px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.info-card h3 { margin: 0 0 14px; font-size: 1.2em; line-height: 1.3; }
.info-card > strong { font-size: 1em; }
.info-card p { margin: 8px 0 0; color: var(--text); font-size: 1em; line-height: 1.65; }
.info-card .fine { color: var(--muted); font-size: .8em; }
.manual-table { overflow-x: auto; margin-top: 12px; }
.manual-table table { width: 100%; border-collapse: collapse; font-size: .9em; }
.manual-table th, .manual-table td { padding: 8px; border: 1px solid var(--border); text-align: left; vertical-align: top; }
.info-card--small { display: flex; flex-wrap: wrap; gap: 12px 18px; color: var(--muted); font-size: .8em; }
.panel-row { display: flex; justify-content: space-between; gap: 10px; width: 100%; padding: 12px 0; border: 0; border-bottom: 1px solid var(--border); background: transparent; text-align: left; cursor: pointer; font-size: 1em; }
.panel-row:last-child { border-bottom: 0; }
.panel-row:hover { color: var(--link); }
.panel-row span { color: var(--link); }
.panel-row__hint { flex: none; font-size: .8em; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chips span { padding: 5px 8px; border: 1px solid var(--border); border-radius: 4px; color: var(--muted); font-size: .8em; }
.instruction { margin-top: 20px; }
.instruction h4 { margin: 0 0 9px; font-size: .85em; }
.code { position: relative; }
.code pre { margin: 0; padding: 42px 16px 16px; overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 2; border: 1px solid var(--border); border-radius: 6px; background: var(--code); color: var(--text); font: .85em/1.65 var(--mono); }
.copy { position: absolute; top: 8px; right: 8px; padding: 4px 8px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); color: var(--text); cursor: pointer; font-size: 12px; }
.caution { padding: 9px 11px; border-left: 3px solid #d29922; background: var(--canvas); }
.foot { display: flex; justify-content: space-between; gap: 20px; padding: 22px 0 35px; color: var(--muted); font-size: 12px; }
.foot p { max-width: 55ch; margin: 0; }
.scrim { display: none; }
@media (max-width: 1100px) {
  .workspace { display: block; }
  .roadmap-scroll { height: min(70vh, 700px); }
  .inspector { position: fixed; z-index: 22; top: 0; right: 0; bottom: 0; width: min(620px, 100%); height: 100dvh; border-radius: 0; transform: translateX(100%); transition: transform .18s ease; }
  body.has-detail { overflow: hidden; }
  body.has-detail .inspector { transform: translateX(0); }
  body.has-detail .scrim { display: block; position: fixed; z-index: 21; inset: 0; background: rgba(0, 0, 0, .45); }
}
@media (max-width: 650px) {
  .site-head__inner, .shell { padding-left: 14px; padding-right: 14px; }
  .site-head__label, .theme-toggle span { display: none; }
  .hero { align-items: flex-start; flex-direction: column; gap: 12px; }
  .toolbar__hint { font-size: 12px; }
  .map-area { width: 300px; }
  .roadmap { gap: 24px; }
  .inspector__header { padding: 24px 20px 20px; }
  .inspector__actions { padding: 16px; }
  .info-card { margin: 16px; padding: 18px; }
  .foot { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { .inspector { transition: none; } }
