/* Public knowledge graph preview. Site tokens, header, hero and footer come from /1/chapter.css. */
.kx-page { --content: 1180px; }
.kx-graph { --content: 1320px; --site-subbar-width: calc(var(--content) + 48px); }
[hidden] { display: none !important; }
button { font: inherit; }

[data-kind=textbook], [data-kind=chapter] { --kc: #5d7280; --kg: #a9bccb; }
[data-kind=section] { --kc: #3f7a70; --kg: #9fd3c7; }
[data-kind=knowledge] { --kc: #087f79; --kg: #2dd4bf; }
[data-kind=skill] { --kc: #3b6fb0; --kg: #7cb8ff; }
[data-kind=method] { --kc: #a8650f; --kg: #f5b54a; }
[data-kind=problem_type] { --kc: #b4534a; --kg: #ff8f7a; }
[data-kind=judgment_rule] { --kc: #7d5aa8; --kg: #c4a1ff; }
[data-family=org] { --ec: #8aa3b6; }
[data-family=know] { --ec: #2dd4bf; }
[data-family=solve] { --ec: #f5b54a; }
[data-family=rule] { --ec: #c4a1ff; }

.preview-tag { margin-left: 2px; padding: 0 8px; border: 1px solid #cfe3de; border-radius: 999px; background: #fff; color: var(--teal-dark); font-size: 11px; letter-spacing: .04em; }

/* Hero */
.kg-heading { display: flex; align-items: center; gap: 14px; }
.kg-heading-icon { display: grid; flex: none; place-items: center; width: 48px; height: 48px; border: 1px solid #cfe3de; border-radius: 14px; background: var(--paper); color: var(--teal); box-shadow: 0 8px 18px -14px rgba(8, 127, 121, .7); }
.kx-hero { padding-bottom: 26px; }
.kx-hero .lead { max-width: 780px; }
.kx-hero .kg-heading + .formula-strip { margin-top: 20px; }
.kx-hero .formula-strip { display: flex; gap: 8px 18px; padding: 10px 12px 10px 10px; border-radius: 14px; background: #fff; box-shadow: 0 14px 30px -26px rgba(4, 18, 27, .55); }
.kx-hero .formula-strip .formula-label { padding: 4px 10px; }
.kx-hero .formula-tips { margin-left: auto; }
.kx-stats { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; color: var(--ink-soft); font-size: 14px; }
.kx-stats span { display: inline-flex; align-items: center; gap: 6px; }
.kx-stats i { width: 7px; height: 7px; border-radius: 50%; background: var(--kc); }
.kx-stats b { color: var(--kc, var(--teal)); font-size: 17px; font-weight: 750; font-variant-numeric: tabular-nums; }
.formula-tips { transition: color .15s; }
.formula-tips:hover { color: var(--teal); }

/* Scope and search */
.kx-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.scope-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.scope-tabs button { display: inline-flex; align-items: baseline; gap: 8px; padding: 8px 16px; border: 1px solid #cfe3de; border-radius: 999px; background: #fff; color: var(--ink-soft); font-size: 13.5px; cursor: pointer; transition: background .15s, border-color .15s, color .15s, box-shadow .15s; }
.scope-tabs b { color: var(--teal-dark); font-weight: 750; font-variant-numeric: tabular-nums; }
.scope-tabs button:hover { border-color: var(--teal); }
.scope-tabs button[aria-pressed=true] { border-color: var(--teal); background: var(--teal); color: #dff7f2; box-shadow: 0 10px 22px -14px rgba(8, 127, 121, .8); }
.scope-tabs button[aria-pressed=true] b { color: #fff; }
.scope-tabs button:focus-visible, .kx-search input:focus-visible { outline: 3px solid #82cfc7; outline-offset: 2px; }
.kx-search { position: relative; flex: 0 1 300px; }
.kx-search input { width: 100%; padding: 9px 16px 9px 38px; border: 1px solid #cfe3de; border-radius: 999px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23687a75' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m11 11 3.5 3.5'/%3E%3C/svg%3E") no-repeat 14px center; color: var(--ink); font: inherit; font-size: 13.5px; }
.kx-search input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(8, 127, 121, .12); }
.search-results { position: absolute; z-index: 8; top: calc(100% + 6px); right: 0; left: 0; max-height: 340px; overflow: auto; margin: 0; padding: 6px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 18px 40px -20px rgba(20, 60, 55, .45); list-style: none; }
.search-results button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 0; border-radius: 9px; background: none; color: var(--ink); font-size: 13.5px; text-align: left; cursor: pointer; }
.search-results button:hover, .search-results button:focus-visible { background: var(--teal-soft); outline: none; }
.search-results i { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--kc); }
.search-results span { flex: 1; }
.search-results small { color: var(--muted); font-size: 12px; }
.search-empty { padding: 8px 10px; color: var(--muted); font-size: 13px; }

/* Dark star-map board */
.kx-board {
  --sky: #07111d; --sky-ink: #e3eef5; --sky-muted: #8ea5b5; --sky-line: rgba(130, 200, 190, .18);
  position: relative; overflow: hidden; border: 1px solid #13283a; border-radius: 22px; color: var(--sky-ink);
  background: radial-gradient(110% 80% at 12% 0%, #12304a 0%, rgba(7, 17, 29, 0) 55%), radial-gradient(70% 70% at 92% 100%, rgba(109, 91, 214, .2), rgba(7, 17, 29, 0) 60%), var(--sky);
  box-shadow: 0 30px 60px -36px rgba(3, 12, 24, .75);
}
.kx-canvas-head { position: relative; z-index: 4; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 14px 16px 12px; border-bottom: 1px solid var(--sky-line); }
.view-tabs { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--sky-line); border-radius: 15px; background: rgba(255, 255, 255, .04); }
.view-tabs button { display: grid; padding: 6px 14px; border: 0; border-radius: 11px; background: none; color: var(--sky-muted); text-align: left; cursor: pointer; transition: background .15s, color .15s, box-shadow .15s; }
.view-tabs b { color: var(--sky-ink); font-size: 13.5px; font-weight: 700; }
.view-tabs span { font-size: 11px; white-space: nowrap; }
.view-tabs button:hover { background: rgba(255, 255, 255, .07); }
.view-tabs button[aria-pressed=true] { background: linear-gradient(135deg, #14b8a6, #0b8a80); color: #d3faf2; box-shadow: 0 8px 20px -10px rgba(20, 184, 166, .8); }
.view-tabs button[aria-pressed=true] b { color: #fff; }
.view-tabs button:focus-visible, .kx-tools :focus-visible, .kx-drawer :focus-visible { outline: 2px solid #5eead4; outline-offset: 2px; }
.kind-chips { display: flex; flex: 1; flex-wrap: wrap; gap: 6px; }
.kind-chip { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border: 1px solid color-mix(in srgb, var(--kg) 32%, transparent); border-radius: 999px; background: color-mix(in srgb, var(--kg) 7%, transparent); font-size: 12.5px; cursor: pointer; transition: opacity .15s, background .15s, border-color .15s; }
.kind-chip input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.kind-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--kg); box-shadow: 0 0 8px var(--kg); }
.kind-chip span { color: var(--sky-muted); font-variant-numeric: tabular-nums; }
.kind-chip:hover { border-color: var(--kg); }
.kind-chip:has(input:checked) { border-color: var(--kg); background: color-mix(in srgb, var(--kg) 22%, transparent); }
.kind-chips:has(input:checked) .kind-chip:not(:has(input:checked)) { opacity: .42; }
.kind-chip:has(input:focus-visible) { outline: 2px solid var(--kg); outline-offset: 2px; }
.kx-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.kx-more { position: relative; }
.kx-more summary, .zoom-buttons button, .kx-more-panel button { padding: 6px 12px; border: 1px solid var(--sky-line); border-radius: 999px; background: rgba(255, 255, 255, .05); color: var(--sky-ink); font-size: 12.5px; font-weight: 600; cursor: pointer; list-style: none; transition: background .15s; }
.kx-more summary::-webkit-details-marker { display: none; }
.kx-more summary:hover, .zoom-buttons button:hover, .kx-more-panel button:hover, .kx-more[open] summary { background: rgba(255, 255, 255, .12); }
.filters-active { display: inline-block; width: 7px; height: 7px; margin-left: 6px; border-radius: 50%; background: #f5b54a; box-shadow: 0 0 6px #f5b54a; vertical-align: middle; }
.kx-more-panel { position: absolute; z-index: 6; top: calc(100% + 8px); right: 0; width: 230px; padding: 12px 14px; border: 1px solid var(--sky-line); border-radius: 14px; background: #0c1a28; box-shadow: 0 20px 40px -18px rgba(0, 0, 0, .7); }
.kx-more-panel p { margin: 0 0 6px; color: var(--sky-muted); font-size: 12px; }
.kx-more-panel button { width: 100%; margin-top: 8px; }
.filter { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 13px; cursor: pointer; }
.filter input { accent-color: #2dd4bf; }
.zoom-buttons { display: flex; gap: 4px; }

.canvas-wrap {
  position: relative;
  background-image: radial-gradient(1px 1px at 24px 36px, rgba(255, 255, 255, .4), transparent 60%), radial-gradient(1px 1px at 110px 140px, rgba(255, 255, 255, .25), transparent 60%), radial-gradient(1.5px 1.5px at 180px 64px, rgba(180, 255, 244, .4), transparent 60%), radial-gradient(1px 1px at 246px 196px, rgba(255, 255, 255, .22), transparent 60%), radial-gradient(1px 1px at 62px 210px, rgba(196, 161, 255, .35), transparent 60%);
  background-size: 280px 240px;
}
#graph { display: block; width: 100%; height: clamp(560px, calc(100vh - 220px), 880px); cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
#graph.is-dragging { cursor: grabbing; }
#graph:focus-visible { outline: 2px solid #2dd4bf; outline-offset: -2px; }
.canvas-help { position: absolute; bottom: 12px; left: 16px; margin: 0; color: rgba(200, 220, 230, .5); font-size: 12px; pointer-events: none; }
.kx-canvas-foot { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--sky-line); color: var(--sky-muted); font-size: 12.5px; }
#graph-status { flex: 1; margin: 0; }
#retry-graph { padding: 5px 12px; border: 1px solid var(--sky-line); border-radius: 999px; background: rgba(255, 255, 255, .06); color: var(--sky-ink); cursor: pointer; }
.link-button { padding: 0; border: 0; background: none; color: #7ff3e4; font-size: 12.5px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* Canvas content */
.lane-band { fill: rgba(255, 255, 255, .025); stroke: rgba(130, 200, 190, .1); }
.lane-label { fill: #cfe3ec; font-size: 13px; font-weight: 700; letter-spacing: .08em; }
.lane-count { fill: #6f8799; font-size: 12px; font-variant-numeric: tabular-nums; }
.frame { fill: rgba(255, 255, 255, .03); stroke: rgba(159, 211, 199, .22); stroke-width: 1.2; transition: stroke .25s, fill .25s; }
.frame.dashed { fill: none; stroke-dasharray: 6 6; }
.frame.lit { fill: rgba(45, 212, 191, .05); stroke: rgba(159, 211, 199, .6); }
.frame-title { fill: #cfe3ec; font-size: 14px; font-weight: 700; }
.row-label { fill: var(--kg, #8ea5b5); font-size: 11.5px; font-weight: 700; letter-spacing: .1em; opacity: .85; }
.crumb-sep { fill: #6f8799; font-size: 20px; }
.jump-chip { cursor: pointer; }
.jump-chip rect { fill: rgba(255, 255, 255, .04); stroke: color-mix(in srgb, var(--kg) 45%, transparent); stroke-dasharray: 3 3; transition: fill .15s; }
.jump-chip circle { fill: var(--kg); }
.jump-chip text { fill: #b9cad6; font-size: 12px; }
.jump-chip:hover rect, .jump-chip:focus rect { fill: color-mix(in srgb, var(--kg) 16%, transparent); }
.jump-chip:focus { outline: none; }

.edge { opacity: .5; transition: opacity .25s; }
.edge-line { fill: none; stroke: var(--ec); stroke-width: 1.4; transition: stroke-width .25s; }
.edge-label { opacity: 0; pointer-events: none; transition: opacity .2s; }
.edge-label rect { fill: #0b1a27; stroke: var(--ec); stroke-opacity: .6; }
.edge-label text { fill: var(--ec); font-size: 11px; font-weight: 600; }
.has-focus .edge { opacity: .07; }
.edge.lit { opacity: 1; }
.edge.lit .edge-line, .edge.path-on .edge-line { stroke-width: 2; stroke-dasharray: 7 7; animation: flow 1s linear infinite; }
.edge.lit .edge-label, .edge.path-current .edge-label { opacity: 1; }
@keyframes flow { to { stroke-dashoffset: -14; } }
.layer-surfaced { pointer-events: none; }
.layer-surfaced .edge { animation: surface .3s ease-out both; }
@keyframes surface { from { opacity: 0; } }

.graph-node { cursor: pointer; transition: opacity .25s; }
.graph-node:focus { outline: none; }
.node-body { animation: node-in .5s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i) * 14ms); transform-box: fill-box; transform-origin: center; }
@keyframes node-in { from { opacity: 0; transform: scale(.86); } }
.node-box { fill: rgba(13, 29, 43, .94); stroke: color-mix(in srgb, var(--kg) 42%, transparent); stroke-width: 1.2; transition: fill .2s, stroke .2s, stroke-width .2s; }
.icon-halo { fill: var(--kg); opacity: .14; }
.node-icon > :last-child { fill: var(--kg); filter: drop-shadow(0 0 4px var(--kg)); }
.node-icon .stroke-icon { fill: none; stroke: var(--kg); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.node-label { fill: #e3eef5; font-size: 13px; font-weight: 600; }
.graph-node.org .node-box { fill: rgba(20, 38, 54, .94); }
.graph-node[data-kind=section] .node-label { font-size: 14px; font-weight: 750; }
.graph-node.related .node-box, .graph-node.extends .node-box { stroke-dasharray: 5 4; }
.node-tag-bg { fill: #0b1a27; stroke: color-mix(in srgb, var(--kg) 55%, transparent); }
.node-tag { fill: var(--kg); font-size: 10.5px; font-weight: 700; }
.graph-node:hover .node-box, .graph-node:focus-visible .node-box { fill: color-mix(in srgb, var(--kg) 16%, #0d1d2b); stroke: var(--kg); }
.graph-node:focus-visible .node-box { stroke-width: 2.4; }
.has-focus .graph-node { opacity: .2; }
.has-focus .graph-node.lit, .graph-node.selected { opacity: 1; }
.graph-node.lit .node-box { fill: color-mix(in srgb, var(--kg) 10%, #0d1d2b); stroke: var(--kg); }
.graph-node.selected .node-box { fill: var(--kg); stroke: var(--kg); filter: drop-shadow(0 0 14px color-mix(in srgb, var(--kg) 70%, transparent)); }
.graph-node.selected .node-label, .graph-node.selected .node-tag { fill: #04121b; }
.graph-node.selected .icon-halo { fill: #04121b; opacity: .12; }
.graph-node.selected .node-icon > :last-child { fill: #04121b; filter: none; }
.graph-node.selected .node-icon .stroke-icon { fill: none; stroke: #04121b; }
.graph-node.search-match .node-box { stroke: #fcd34d; stroke-width: 2.4; }
.is-playing .graph-node:not(.path-on) { opacity: .12; }
.is-playing .edge:not(.path-on) { opacity: .04; }
.is-playing .edge.path-on { opacity: 1; }
.graph-node.path-current .node-box { fill: color-mix(in srgb, var(--kg) 24%, #0d1d2b); stroke: var(--kg); stroke-width: 2.4; filter: drop-shadow(0 0 12px var(--kg)); }
.graph-node.path-current .node-body { animation: pulse 1.2s ease-out; }
@keyframes pulse { 30% { transform: scale(1.07); } }

/* Floating drawer over the canvas */
.kx-drawer { position: absolute; z-index: 3; top: 14px; right: 14px; bottom: 14px; width: 340px; overflow: auto; padding: 20px 20px 18px; border: 1px solid rgba(130, 200, 190, .22); border-radius: 18px; background: linear-gradient(180deg, rgba(14, 30, 45, .95), rgba(8, 19, 31, .97)); box-shadow: 0 24px 50px -24px rgba(0, 0, 0, .7); backdrop-filter: blur(10px); animation: drawer-in .3s ease-out both; scrollbar-width: thin; scrollbar-color: rgba(130, 200, 190, .3) transparent; }
@keyframes drawer-in { from { opacity: 0; transform: translateX(16px); } }
.drawer-close { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid var(--sky-line); border-radius: 50%; background: rgba(255, 255, 255, .05); color: var(--sky-ink); font-size: 19px; line-height: 1; cursor: pointer; }
.drawer-close:hover { background: rgba(255, 255, 255, .12); }
.drawer-kind { display: inline-flex; align-items: center; gap: 7px; margin: 0 0 10px; padding: 2px 10px; border-radius: 999px; background: color-mix(in srgb, var(--kg) 15%, transparent); color: var(--kg); font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.drawer-kind i { width: 7px; height: 7px; border-radius: 50%; background: var(--kg); box-shadow: 0 0 6px var(--kg); }
.kx-drawer h2 { margin: 0 34px 8px 0; color: #fff; font-size: 20px; line-height: 1.4; }
.drawer-summary { margin: 0 0 14px; color: #b9cad6; font-size: 13.5px; line-height: 1.75; }
.drawer-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.drawer-primary { display: inline-flex; align-items: center; padding: 7px 14px; border: 0; border-radius: 999px; background: #14b8a6; color: #03201c; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; transition: background .15s; }
.drawer-primary:hover { background: #2dd4bf; }
.drawer-play { padding: 7px 14px; border: 1px solid rgba(245, 181, 74, .5); border-radius: 999px; background: rgba(245, 181, 74, .12); color: #ffd58a; font-size: 13px; font-weight: 700; cursor: pointer; transition: background .15s; }
.drawer-play:hover { background: rgba(245, 181, 74, .24); }
.drawer-note { margin: 12px 0 0; padding: 10px 12px; border: 1px dashed rgba(245, 181, 74, .45); border-radius: 12px; color: #ffd58a; font-size: 12.5px; }
.drawer-note button { margin-left: 6px; padding: 0; border: 0; background: none; color: #7ff3e4; text-decoration: underline; cursor: pointer; }
.kx-drawer h3 { display: flex; align-items: center; gap: 8px; margin: 20px 0 10px; color: #cfe3ec; font-size: 12.5px; font-weight: 700; letter-spacing: .1em; }
.kx-drawer h3 span { color: var(--sky-muted); font-weight: 500; }
.rel-groups { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.rel-groups li { display: grid; gap: 6px; }
.rel-type { color: var(--ec); font-size: 11.5px; font-weight: 600; letter-spacing: .04em; }
.rel-targets { display: flex; flex-wrap: wrap; gap: 6px; }
.rel-item { display: inline-flex; max-width: 100%; }
.rel-item.has-note { display: grid; flex-basis: 100%; gap: 3px; justify-items: start; }
.rel-item small { padding-left: 4px; color: var(--sky-muted); font-size: 11.5px; line-height: 1.5; }
.rel-node { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 10px; border: 1px solid color-mix(in srgb, var(--kg) 40%, transparent); border-radius: 999px; background: color-mix(in srgb, var(--kg) 8%, transparent); color: #e3eef5; font-size: 12.5px; text-align: left; cursor: pointer; transition: background .15s, border-color .15s; }
.rel-node i { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--kg); }
.rel-node:hover { border-color: var(--kg); background: color-mix(in srgb, var(--kg) 22%, transparent); }
.drawer-path ol { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.drawer-path li { display: grid; grid-template-columns: 24px 1fr; gap: 10px; padding: 8px 10px; border: 1px solid transparent; border-radius: 12px; transition: background .25s, border-color .25s; }
.drawer-path li div { display: flex; flex-wrap: wrap; gap: 5px; }
.drawer-path li b { flex-basis: 100%; color: #e3eef5; font-size: 13px; }
.step-dot { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: rgba(245, 181, 74, .14); color: #ffd58a; font-size: 12px; font-weight: 700; transition: background .25s, color .25s, box-shadow .25s; }
.drawer-path li.is-current { border-color: rgba(245, 181, 74, .5); background: rgba(245, 181, 74, .08); }
.drawer-path li.is-current .step-dot { background: #f5b54a; color: #2a1a02; box-shadow: 0 0 12px rgba(245, 181, 74, .7); }
.drawer-path li.is-done .step-dot { background: rgba(45, 212, 191, .2); color: #7ff3e4; }
.drawer-expand { width: 100%; margin-top: 20px; padding: 8px; border: 1px dashed var(--sky-line); border-radius: 12px; background: none; color: var(--sky-muted); font-size: 12.5px; cursor: pointer; transition: color .15s, border-color .15s; }
.drawer-expand:hover { border-color: #5eead4; color: #e3eef5; }

/* Light sections below the board */
.count { margin-left: 4px; padding: 0 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 12px; font-weight: 500; }
.fallback-directory { margin-top: 14px; padding: 14px 20px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); }
.fallback-directory > summary { color: var(--muted); font-size: 13px; cursor: pointer; }
.kx-graph-page .fallback-directory { margin-top: 18px; }
.kx-graph-page .fallback-directory > summary { color: var(--ink); font-size: 18px; font-weight: 750; }
.dir-section h2 b { margin-right: 4px; color: var(--teal-dark); font-variant-numeric: tabular-nums; }
.dir-shared { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: -2px 0 12px; font-size: 12.5px; }
.dir-shared > span { margin-right: 2px; color: var(--muted); font-weight: 600; }
.dir-shared a { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 1px solid #d3e2dd; border-radius: 999px; background: #fff; color: var(--ink-soft); transition: border-color .15s, color .15s; }
.dir-shared a:hover { border-color: var(--teal); color: var(--teal); }
.dir-shared i { width: 6px; height: 6px; border-radius: 50%; background: var(--kc); }
.fallback-directory section, .node-list-page > section[id] { margin-top: 24px; }
.fallback-directory h2, .node-list-page > section[id] h2 { margin-bottom: 12px; font-size: 18px; }
.node-directory { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.node-directory li { min-width: 0; padding: 16px 18px; border: 1px solid #d3e2dd; border-radius: 14px; background: #fff; box-shadow: 0 1px 2px rgba(20, 50, 45, .05), 0 6px 16px -12px rgba(20, 60, 55, .3); transition: border-color .15s, box-shadow .15s, transform .15s; }
.node-directory li:hover { border-color: #8fc8bc; box-shadow: 0 14px 28px -18px rgba(8, 127, 121, .6); transform: translateY(-1px); }
.node-directory a { display: block; margin: 8px 0 4px; color: var(--ink); font-size: 15px; font-weight: 700; }
.node-directory a:hover { color: var(--teal); }
.node-directory p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.node-directory li:has(.dir-locate) { position: relative; }
.dir-locate { position: absolute; top: 12px; right: 12px; padding: 2px 10px; border: 1px solid #cfe3de; border-radius: 999px; background: #f4faf8; color: var(--teal-dark); font-size: 12px; font-weight: 600; cursor: pointer; transition: background .15s, border-color .15s; }
.dir-locate:hover { border-color: var(--teal); background: var(--teal-soft); }
.kind-badge { display: inline-block; padding: 1px 9px; border-radius: 999px; background: color-mix(in srgb, var(--kc) 10%, white); color: var(--kc); font-size: 11.5px; font-weight: 700; letter-spacing: .04em; }
.kind-nav { display: flex; flex-wrap: wrap; gap: 8px; }
.kind-nav a { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 1px solid #cfe3de; border-radius: 999px; background: #fff; color: var(--ink-soft); font-size: 13px; transition: border-color .15s; }
.kind-nav a:hover { border-color: var(--kc); }
.kind-nav i { width: 7px; height: 7px; border-radius: 50%; background: var(--kc); }
.kind-nav span { color: var(--muted); font-variant-numeric: tabular-nums; }

/* Detail pages */
.detail-hero { padding-bottom: 28px; }
.detail-hero h1 { display: inline; padding: 0 2px; font-size: clamp(28px, 4vw, 38px); background: linear-gradient(transparent 64%, #cfe9e2 64%, #cfe9e2 92%, transparent 92%); -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.detail-hero .lead { max-width: 800px; margin-top: 14px; font-size: 16px; line-height: 1.85; }
.kind-text { color: var(--kc); font-weight: 700; }
.aliases { margin: -8px 0 16px; color: var(--muted); font-size: 13px; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.primary-link { display: inline-flex; align-items: center; padding: 9px 18px; border-radius: 999px; background: var(--teal); color: #fff; font-size: 14px; font-weight: 650; box-shadow: 0 14px 30px -18px rgba(8, 127, 121, .7); transition: background .15s; }
.primary-link:hover { background: var(--teal-dark); }
.detail-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); align-items: start; gap: 28px; }
.detail-toc { position: sticky; top: 20px; max-height: calc(100vh - 40px); overflow: auto; font-size: 13px; }
.detail-toc summary { margin-bottom: 10px; color: var(--ink); font-weight: 700; cursor: pointer; }
.detail-toc ul { margin: 0; padding: 0 0 0 14px; border-left: 1px solid var(--line); list-style: none; }
.detail-toc li { margin-bottom: 10px; }
.detail-toc li a { color: var(--muted); transition: color .15s; }
.detail-toc li a:hover { color: var(--teal); }
.detail-body { min-width: 0; padding: 30px 36px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); box-shadow: 0 18px 40px -32px rgba(20, 60, 55, .35); }
.detail-body > section { margin: 0 0 36px; scroll-margin-top: 16px; }
.detail-body [id] { scroll-margin-top: 16px; }
.detail-body h2 { margin: 0 0 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.detail-body h3 { margin: 0 0 8px; font-size: 16px; font-weight: 700; }
.detail-body p, .detail-body li { font-size: 15px; line-height: 1.9; }
.detail-body p { margin: 0 0 10px; }
.detail-body a { color: var(--teal-dark); text-decoration: underline; text-decoration-color: #b9dcd3; text-underline-offset: 3px; }
.detail-body a:hover { color: var(--teal); text-decoration-color: currentColor; }
.muted { color: var(--muted); }
.detail-body .source { margin-top: 20px; color: var(--muted); font-size: 12.5px; }
.entry { margin: 16px 0; padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: #fbfdfc; }
.entry .eyebrow { margin-bottom: 6px; font-size: 12px; }
.hero .eyebrow { flex-wrap: wrap; row-gap: 4px; }
.hero .eyebrow > * { white-space: nowrap; }
.entry p:last-child { margin-bottom: 0; }
.condition { margin: 10px 0 0; padding: 9px 14px; border-left: 3px solid var(--amber); border-radius: 0 10px 10px 0; background: #fdf6e9; color: #6b5320; font-size: 13.5px !important; }
.contract { padding: 18px 22px 20px; border: 1px solid #cfe6de; border-radius: 16px; background: linear-gradient(180deg, #eef8f4, #f7fbfa); }
.detail-body .contract h2 { padding-bottom: 0; border-bottom: 0; color: var(--teal-dark); }
.contract dl { display: grid; grid-template-columns: 124px minmax(0, 1fr); gap: 12px; margin: 0; font-size: 14.5px; }
.contract dt { color: var(--muted); font-weight: 600; }
.contract dd { margin: 0; }
.contract dt:first-of-type { color: var(--teal-dark); }
.contract dd:first-of-type { font-size: 15.5px; font-weight: 550; }
.contract dt:last-of-type { color: #8a6418; }
.choose-when { padding: 8px 12px; border-radius: 10px; background: #eef8f4; }
.detail-body .anchor { margin-left: 4px; color: var(--faint); font-size: 13px; text-decoration: none; }
.operations { padding-left: 22px; }
.operations li { padding: 6px 0; }
.example { margin: 14px 0; padding: 18px 22px; border: 1px solid #d9e8e2; border-radius: 14px; background: linear-gradient(180deg, #f6fbf9, #fff); }
.example .problem { font-weight: 600; }
.example ol { margin-bottom: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.detail-body .chips a { display: inline-flex; padding: 4px 12px; border: 1px solid #cfe3de; border-radius: 999px; background: #fff; color: var(--teal-dark); font-size: 13px; font-weight: 600; text-decoration: none; transition: background .15s, color .15s, border-color .15s; }
.detail-body .chips a:hover { border-color: var(--teal); background: var(--teal); color: #fff; }
.method-path { display: flex; flex-direction: column; gap: 14px; margin: 0; padding: 0; list-style: none; }
.method-path > li { position: relative; margin: 0; padding: 14px 18px; border: 1px solid #cfe3de; border-radius: 14px; background: #fbfdfc; }
.method-path > li:not(:last-child)::after { content: ""; position: absolute; bottom: -15px; left: 30px; width: 2px; height: 14px; background: linear-gradient(#9fd0c6, #e2a43b); }
.method-path > li > p { margin: 0 0 6px 36px; font-size: 14.5px; }
.step-title { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.step-title h3 { margin: 0; }
.step-number { display: grid; flex: none; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--teal); color: #fff; font-size: 13px; font-weight: 700; }
.step-calls, .step-rule { margin: 8px 0 0 36px; }
.rel-label { margin: 0 0 6px !important; color: var(--muted); font-size: 12.5px !important; font-weight: 650; letter-spacing: .02em; line-height: 1.5 !important; }
.step-calls ul { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.step-calls li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin: 0; font-size: 13.5px; line-height: 1.6; }
.step-calls small { color: var(--muted); font-size: 12.5px; }
.step-calls .call-example { flex-basis: 100%; margin: 0 0 4px 8px; padding: 3px 10px; border-left: 3px solid #b9dcd3; border-radius: 0 8px 8px 0; background: #f4faf8; color: #33504a; font-size: 13px; line-height: 1.7; }
.call-example > span { margin-right: 8px; color: var(--teal-dark); font-size: 12px; font-weight: 700; }
.step-calls.is-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.step-calls.is-inline .rel-label { margin: 0 !important; }
.step-calls.is-inline ul { flex-direction: row; flex-wrap: wrap; }
.detail-body .node-chip, .detail-hero .node-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 3px 11px; border: 1px solid #d3e2dd; border-radius: 14px; background: #fff; color: var(--ink); font-size: 13px; font-weight: 600; line-height: 1.5; text-decoration: none; transition: border-color .15s, color .15s; }
.detail-body .node-chip:hover, .detail-hero .node-chip:hover { border-color: var(--kg); color: var(--kc); }
.node-chip i { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--kc); }
.node-chip small { flex: none; white-space: nowrap; padding: 0 6px; border-radius: 999px; background: #eef4f2; color: var(--muted); font-size: 11px; font-weight: 600; }
.branch-list { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.branch-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; margin: 0; padding: 8px 12px; border: 1px solid #e3d9ee; border-radius: 10px; background: #fff; font-size: 13.5px; line-height: 1.6; }
.branch-list b { color: #8b6bb5; }
.branch-target { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 0 !important; }
.branch-target > span { color: var(--muted); font-size: 13px; }
.feature-tag { margin: 0 0 6px !important; color: var(--teal-dark); font-size: 12.5px; font-weight: 700; letter-spacing: .04em; }
.feature-sample { margin: 0 0 10px; padding: 14px 18px; border: 1px solid #d9e8e2; border-radius: 14px; background: linear-gradient(180deg, #f6fbf9, #fff); }
.feature-sample .problem { margin: 0; font-size: 15.5px; font-weight: 600; }
.feature-cues { display: flex; flex-direction: column; gap: 8px; margin: 0 0 16px; padding-left: 1.5em; }
.feature-cues li > p { margin: 0; }
.feature-cues .cue-example { margin-top: 4px !important; padding: 6px 10px; border-left: 3px solid #b9dcd3; border-radius: 0 8px 8px 0; background: #f4faf8; color: #33504a; font-size: 13.5px; line-height: 1.7; }
.cue-example > span { margin-right: 8px; color: var(--teal-dark); font-size: 12px; font-weight: 700; }
.feature-confuse ul { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.feature-confuse li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; margin: 0; padding: 8px 12px; border: 1px solid #f0dcc0; border-radius: 10px; background: #fffaf2; font-size: 13.5px; line-height: 1.6; }
.feature-confuse b { color: #b6782c; }
.feature-confuse .feature-tag { color: #8a6418; }
.choose-rule { margin-bottom: 20px; }
.choose-methods { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.choose-method { padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: #fbfdfc; }
.choose-method h4 { margin: 0 0 8px; }
.choose-method > p { font-size: 13.5px; line-height: 1.75; }
.detail-body table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.detail-body th, .detail-body td { min-width: 90px; padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.detail-body th { background: #f4f8f6; white-space: nowrap; }
.appears { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: -6px 0 16px; font-size: 13px; }
.appears > span { color: var(--muted); }
.appears a { color: var(--teal-dark); font-weight: 600; text-decoration: underline; text-decoration-color: #b9dcd3; text-underline-offset: 3px; }
.appears small { margin-left: 4px; padding: 0 6px; border-radius: 999px; background: #eef4f2; color: var(--muted); font-size: 11px; }
.math-tail { white-space: nowrap; }
.math-tail > .katex { white-space: normal; }
.region-map, .region-block { display: grid; gap: 8px; }
.region-map { margin: 0 0 18px; }
.region { display: grid; grid-template-columns: 10em minmax(0, 1fr); align-items: center; gap: 6px 14px; padding: 8px 14px; border: 1px solid color-mix(in srgb, var(--kg) 30%, #e2ebe8); border-left: 4px solid var(--kc); border-radius: 12px; background: color-mix(in srgb, var(--kg) 7%, white); font-size: 13px; }
.region-label { margin: 0 !important; color: var(--kc); font-size: 13px !important; font-weight: 750; line-height: 1.5 !important; }
.region-label .count { margin-left: 2px; color: color-mix(in srgb, var(--kc) 70%, white); font-weight: 650; }
.region-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.region-empty { color: var(--muted); }
.entry-users { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 10px 0 0 !important; font-size: 13px; }
.entry-users > span { color: var(--kc); font-weight: 700; }
.detail-body .katex { font-size: 1.04em; }
.katex-display { max-width: 100%; overflow-x: auto; overflow-y: hidden; padding: 4px 0; }
.resource-section .explain-inline { max-width: 680px; margin: auto; }
.resource-section .explain-inline svg { max-width: 100%; }
.resource-section .explain-inline a { cursor: pointer; }
.resource-section.is-placed { margin: -6px 0 16px; padding: 14px 20px 16px; border: 1px dashed #cfe0da; border-radius: 14px; background: #fff; }
.resource-section.is-placed .condition { margin-bottom: 12px; }
.resource-section.is-placed .explain-inline { max-width: 480px; }
.resource-section.is-placed [role=status] { margin: 8px 0 0; font-size: 12px; text-align: center; }
.drill-open { padding: 9px 18px; border: 0; border-radius: 999px; background: #a8650f; color: #fff; font: inherit; font-size: 14px; font-weight: 650; cursor: pointer; box-shadow: 0 14px 30px -18px rgba(168, 101, 15, .8); transition: background .15s; }
.drill-open:hover { background: #8a5208; }
.drill-open[hidden] { display: none; }
.drill-open:focus-visible { outline: 3px solid #f2c57c; outline-offset: 2px; }
.pitfall { margin: 16px 0; padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: #fbfdfc; }
.pitfall-wrong, .pitfall-fix { margin-top: 10px; padding: 10px 14px; border-radius: 0 10px 10px 0; font-size: 14px; }
.pitfall-wrong { border-left: 3px solid #c2410c; background: #fdf3ed; }
.pitfall-fix { border-left: 3px solid var(--teal); background: #eef8f5; }
.pitfall-wrong p, .pitfall-fix p { margin: 0 0 6px; }
.pitfall-wrong > :last-child, .pitfall-fix > :last-child { margin-bottom: 0; }
.pitfall-tag { font-size: 12px !important; font-weight: 750; letter-spacing: .04em; }
.pitfall-wrong .pitfall-tag { color: #b23a0b; }
.pitfall-fix .pitfall-tag { color: var(--teal-dark); }
.pitfall-why { color: #7a3d24; font-size: 13.5px !important; }
.pitfall-see { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 0 !important; font-size: 13px; }
.pitfall-see > span { color: var(--muted); }

@media (max-width: 1000px) {
  .kx-drawer { width: 300px; }
  .detail-layout { grid-template-columns: 180px minmax(0, 1fr); gap: 20px; }
  .detail-body { padding: 24px; }
}
@media (max-width: 760px) {
  .kx-controls { flex-direction: column; align-items: stretch; }
  .scope-tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .scope-tabs button { flex: none; }
  .scope-tabs button span { display: none; }
  .kx-search { flex-basis: auto; }
  .kx-board { border-radius: 18px; }
  .kx-canvas-head { padding: 12px; }
  .view-tabs { width: 100%; }
  .view-tabs button { flex: 1; text-align: center; }
  .view-tabs span { display: none; }
  .kind-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
  .kind-chip { flex: none; }
  .kx-tools { justify-content: space-between; width: 100%; margin-left: 0; }
  #graph { height: 520px; }
  .canvas-help { font-size: 0; }
  .canvas-help::after { content: "单指拖动查看全图 · 点选节点看说明"; font-size: 11px; }
  .kx-drawer { position: static; width: auto; margin: 0 12px 12px; animation: none; }
  .kx-drawer:not([hidden]) ~ .canvas-help { display: none; }
  .detail-layout { display: block; }
  .detail-toc { position: static; max-height: none; margin-bottom: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
  .region { grid-template-columns: minmax(0, 1fr); }
  .method-path > li > p, .step-calls, .step-rule { margin-left: 0; }
  .branch-list li, .feature-confuse li { grid-template-columns: 1fr auto; }
  .branch-list li > span, .feature-confuse li > span { grid-column: 1 / -1; }
  .detail-toc summary { margin-bottom: 0; }
  .detail-toc details[open] summary { margin-bottom: 10px; }
  .detail-body { padding: 22px 16px; border-radius: 14px; }
  .detail-hero h1 { font-size: 26px; }
  .detail-body p, .detail-body li { font-size: 14.5px; }
  .contract dl { display: block; }
  .contract dd { margin: 4px 0 12px; }
  .entry, .example { padding: 14px; }
  .method-path > li { padding: 14px; }
}

/* 3D knowledge tower: a full-height night sky with glass HUD panels in the corners */
.tower-entry { margin-left: 10px; padding: 3px 12px; border-radius: 999px; background: #0b1a28; color: #bff7ee; font-size: 12.5px; font-weight: 700; box-shadow: 0 0 0 1px rgba(45, 212, 191, .35), 0 8px 18px -12px rgba(8, 127, 121, .9); transition: background .15s; }
.tower-entry:hover { background: #12304a; }
.kx-tower { background: #050c16; }
.tower-stage {
  --sky-ink: #e3eef5; --sky-muted: #8ea5b5; --sky-line: rgba(130, 200, 190, .2);
  position: relative; height: max(600px, calc(100svh - var(--site-header-h, 61px) - var(--site-subbar-h, 0px))); overflow: hidden; color: var(--sky-ink);
  background: radial-gradient(60% 50% at 50% 42%, rgba(31, 181, 168, .16), transparent 70%), radial-gradient(50% 45% at 85% 80%, rgba(109, 91, 214, .18), transparent 70%), radial-gradient(45% 40% at 10% 90%, rgba(194, 84, 122, .1), transparent 70%), #050c16;
}
.tower-canvas { position: absolute; z-index: 0; inset: 0; }
.tower-canvas canvas { display: block; width: 100%; height: 100%; outline: none; touch-action: none; }
.tower-labels { position: absolute; inset: 0; pointer-events: none; }
.tower-hud { position: absolute; z-index: 2; }
.tower-panel, .tower-legend, .tower-sections, .tower-tools, .tower-search input { border: 1px solid var(--sky-line); background: rgba(8, 19, 31, .62); backdrop-filter: blur(10px); }

.tower-head { top: 22px; left: 26px; max-width: 420px; pointer-events: none; }
.tower-head .eyebrow { color: var(--sky-muted); pointer-events: auto; }
.tower-head .eyebrow a { color: #9fe9dd; text-decoration-color: rgba(159, 233, 221, .4); }
.tower-head .eyebrow-sep { color: #3d566a; }
.tower-head .preview-tag { border-color: rgba(159, 233, 221, .3); background: transparent; color: #9fe9dd; }
.tower-head h1 { display: flex; align-items: baseline; gap: 12px; margin: 0 0 8px; color: #fff; font-size: 34px; letter-spacing: .02em; text-shadow: 0 0 24px rgba(45, 212, 191, .35); }
.tower-head .title-mark { background: linear-gradient(transparent 66%, rgba(45, 212, 191, .35) 66%, rgba(45, 212, 191, .35) 92%, transparent 92%); }
.tower-head small { color: var(--sky-muted); font-size: 15px; font-weight: 600; letter-spacing: .08em; }
.tower-lead { margin: 0; color: #a9bccb; font-size: 13.5px; line-height: 1.7; }

.tower-search { top: 24px; right: 26px; width: 280px; }
.tower-search input { width: 100%; padding: 10px 16px 10px 38px; border-radius: 999px; color: var(--sky-ink); font: inherit; font-size: 13.5px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238ea5b5' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m11 11 3.5 3.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: 14px center; }
.tower-search input::placeholder { color: #6f879a; }
.tower-search input:focus { border-color: #5eead4; outline: none; box-shadow: 0 0 0 3px rgba(45, 212, 191, .18); }
.tower-search .search-results { border-color: var(--sky-line); background: rgba(10, 22, 36, .97); }
.tower-search .search-results button { color: var(--sky-ink); }
.tower-search .search-results button:hover, .tower-search .search-results button:focus-visible { background: rgba(45, 212, 191, .14); }
.tower-search .search-results i { background: var(--kg); box-shadow: 0 0 6px var(--kg); }
.tower-search .search-results small, .tower-search .search-empty { color: var(--sky-muted); }

.tower-legend { left: 26px; bottom: 74px; display: grid; gap: 2px; width: 236px; padding: 12px 12px 10px; border-radius: 16px; }
.tower-legend p { margin: 6px 4px 4px; color: var(--sky-muted); font-size: 11px; font-weight: 700; letter-spacing: .14em; }
.tower-legend p:first-child { margin-top: 0; }
.tower-check { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 8px; color: var(--sky-ink); font-size: 13px; cursor: pointer; transition: background .15s, opacity .15s; }
.tower-check:hover { background: rgba(255, 255, 255, .06); }
.tower-check input { position: absolute; opacity: 0; pointer-events: none; }
.tower-check i { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--kg, var(--ec)); box-shadow: 0 0 8px var(--kg, var(--ec)); }
.tower-check[data-family] i { width: 16px; height: 3px; border-radius: 2px; }
.tower-check span { margin-left: auto; color: var(--sky-muted); font-size: 11px; white-space: nowrap; }
.tower-check:has(input:not(:checked)) { opacity: .38; }
.tower-check:has(input:not(:checked)) i { box-shadow: none; }
.tower-check:has(input:focus-visible) { outline: 2px solid #5eead4; }

.tower-sections { left: 50%; bottom: 22px; display: flex; gap: 4px; max-width: calc(100% - 560px); padding: 5px; border-radius: 999px; transform: translateX(-50%); }
.tower-sections button { display: inline-flex; align-items: baseline; gap: 7px; padding: 8px 15px; border: 0; border-radius: 999px; background: none; color: var(--sky-muted); font-size: 13px; white-space: nowrap; cursor: pointer; transition: background .15s, color .15s; }
.tower-sections button b { color: var(--sky-ink); font-weight: 750; }
.tower-sections button:hover { background: rgba(255, 255, 255, .07); }
.tower-sections button[aria-pressed=true] { background: linear-gradient(180deg, #19a99b, #0f8a7f); color: #e6fffb; box-shadow: 0 0 18px rgba(45, 212, 191, .4); }
.tower-sections button[aria-pressed=true] b { color: #fff; }

.tower-tools { right: 26px; bottom: 22px; display: flex; align-items: center; gap: 4px; padding: 5px; border-radius: 999px; }
.tower-tools button, .tower-tools a { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border: 0; border-radius: 999px; background: none; color: var(--sky-ink); font-size: 12.5px; cursor: pointer; transition: background .15s; }
.tower-tools button:hover, .tower-tools a:hover { background: rgba(255, 255, 255, .08); }
.tower-tools i { width: 8px; height: 8px; border-radius: 50%; background: #4b5b70; transition: background .2s, box-shadow .2s; }
#tower-spin[aria-pressed=true] i { background: #5eead4; box-shadow: 0 0 8px #5eead4; }
.tower-sections :focus-visible, .tower-tools :focus-visible { outline: 2px solid #5eead4; outline-offset: 2px; }

.tower-status { position: absolute; z-index: 2; top: 72px; right: 30px; display: flex; align-items: center; gap: 10px; margin: 0; color: rgba(190, 210, 222, .55); font-size: 12px; white-space: nowrap; pointer-events: none; }
.tower-stage:has(.tower-drawer:not([hidden])) .tower-status { visibility: hidden; }
.tower-status button { padding: 3px 12px; border: 1px solid #5eead4; border-radius: 999px; background: none; color: #bff7ee; cursor: pointer; pointer-events: auto; }
.tower-failed .tower-status { bottom: 50%; color: #e3eef5; font-size: 14px; white-space: normal; text-align: center; }

.tower-drawer { top: 92px; right: 26px; bottom: 74px; width: 350px; }
.drawer-secondary { display: inline-flex; align-items: center; padding: 7px 14px; border: 1px solid var(--sky-line); border-radius: 999px; color: #cfe3ec; font-size: 13px; transition: background .15s; }
.drawer-secondary:hover { background: rgba(255, 255, 255, .08); }
.tower-home { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 10px; color: var(--sky-muted); font-size: 12.5px; }
.tower-home button { padding: 1px 9px; border: 1px solid rgba(94, 234, 212, .4); border-radius: 999px; background: rgba(45, 212, 191, .08); color: #bff7ee; font-size: 12px; font-weight: 700; cursor: pointer; }
.tower-home button:hover { background: rgba(45, 212, 191, .2); }

/* Names over the canvas */
.tower-label button { display: block; max-width: 8.5em; padding: 2px 7px; border: 1px solid transparent; border-radius: 7px; background: rgba(5, 12, 22, .55); color: #e8f4f8; font: inherit; font-size: 12px; font-weight: 600; line-height: 1.3; text-align: center; text-shadow: 0 0 6px rgba(0, 0, 0, .9); transform: scale(var(--tw-label-scale, 1)); transform-origin: center top; cursor: pointer; pointer-events: auto; transition: background .2s, color .2s, border-color .2s, opacity .35s; }
.tower-label button span { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.tower-label[data-kind=method] button { color: #ffe7b8; }
.tower-label[data-kind=problem_type] button { color: #ffd2c8; }
.tower-label[data-kind=judgment_rule] button { color: #e6d6ff; }
.tower-label[data-kind=chapter] button, .tower-label[data-kind=textbook] button { max-width: 12em; color: #fff3d1; font-size: 13.5px; font-weight: 750; }
.tower-label[data-kind=section] button { max-width: 11em; color: #d8fbf5; font-size: 12.5px; }
.tower-label button:hover, .tower-label.is-hover button { border-color: rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .12); }
.tower-label button:focus-visible { outline: 2px solid #82cfc7; outline-offset: 2px; }
.tower-label.is-related button { border-color: color-mix(in srgb, var(--kg) 60%, transparent); background: color-mix(in srgb, var(--kg) 16%, rgba(5, 12, 22, .85)); color: #fff; }
.tower-label.is-selected button { border-color: var(--kg); background: var(--kg); color: #04161a; text-shadow: none; font-weight: 750; box-shadow: 0 0 18px color-mix(in srgb, var(--kg) 70%, transparent); }
.tower-label.is-back button { opacity: .14; pointer-events: none; }
.tower-label.is-back.is-related button, .tower-label.is-back.is-selected button { opacity: .75; pointer-events: auto; }
.tower-label.is-dim button { opacity: .14; }
.tower-label.is-out { visibility: hidden; }
.tower-canvas.is-far .tower-label:not(.is-selected):not(.is-related):not(.is-hover):not([data-kind=chapter]):not([data-kind=section]) { visibility: hidden; }
.tower-floor { display: flex; align-items: center; gap: 7px; padding-right: 10px; color: var(--kg); font-size: 12px; white-space: nowrap; pointer-events: none; transition: opacity .3s; }
.tower-floor i { width: 22px; height: 1px; background: linear-gradient(90deg, transparent, var(--kg)); order: 3; }
.tower-floor b { font-size: 14px; letter-spacing: .1em; text-shadow: 0 0 10px color-mix(in srgb, var(--kg) 60%, transparent); }
.tower-floor span { color: var(--sky-muted); }
.tower-floor.is-out { opacity: .2; }
.tower-canvas.is-near .tower-floor { opacity: 0; }
/* Knowledge city: levels, tower cards, districts, portals */
.city-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 10px; color: var(--sky-muted); font-size: 12.5px; pointer-events: auto; }
.city-crumbs button { padding: 2px 10px; border: 1px solid var(--sky-line); border-radius: 999px; background: rgba(8, 19, 31, .6); color: #9fe9dd; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.city-crumbs button:hover { background: rgba(45, 212, 191, .14); }
.city-crumbs button[aria-current=page] { border-color: rgba(94, 234, 212, .5); color: #fff; cursor: default; }
.city-crumbs [aria-current=page]:not(button) { color: #e3eef5; font-weight: 700; }
.tower-key { display: flex; align-items: center; gap: 8px; padding: 3px 6px; color: var(--sky-ink); font-size: 13px; }
.tower-key i { flex: none; width: 12px; height: 12px; border-radius: 3px; }
.tower-key.is-built i { background: linear-gradient(180deg, #ffe3a3, #2dd4bf); box-shadow: 0 0 10px rgba(45, 212, 191, .7); }
.tower-key.is-ghost i { border: 1px dashed #9fb7c9; }
.tower-key.is-link i { height: 0; border-top: 2px dashed #cfe0ee; border-radius: 0; }
.tower-key.is-partial i { border: 1px dashed #9fb7c9; background: radial-gradient(circle, #2dd4bf 0 2px, transparent 3px); }
.tower-key.is-cross i { height: 7px; border: 2px solid #2dd4bf; border-bottom: 0; border-radius: 8px 8px 0 0; }
.city-tower.is-partial .city-tower-card { border-color: color-mix(in srgb, var(--sc) 60%, transparent); border-style: dashed; }
.city-tower.is-partial span { color: #9fe9dd; }
.tower-key span { margin-left: auto; color: var(--sky-muted); font-size: 11px; }

.city-tower-card { min-width: 8em; max-width: 12em; padding: 6px 12px 7px; border: 1px solid color-mix(in srgb, var(--sc) 40%, transparent); border-radius: 12px; background: rgba(5, 12, 22, .66); color: var(--sky-ink); font: inherit; text-align: center; pointer-events: auto; backdrop-filter: blur(4px); transition: opacity .35s, transform .35s, background .2s, box-shadow .2s; }
.city-tower [data-chapter] { display: grid; justify-items: center; gap: 1px; width: 100%; padding: 0; border: 0; border-radius: 3px; background: transparent; color: inherit; font: inherit; text-align: center; cursor: pointer; }
.city-tower button:focus-visible { outline: 2px solid var(--sc); outline-offset: 3px; }
.city-tower small { color: var(--sc); font-size: 11px; font-weight: 700; letter-spacing: .06em; }
.city-tower b { font-size: 13.5px; line-height: 1.35; }
.city-tower span { color: var(--sky-muted); font-size: 11px; }
.city-tower.is-built .city-tower-card { border-color: color-mix(in srgb, var(--sc) 80%, transparent); box-shadow: 0 0 24px -6px var(--sc); }
.city-tower.is-built span { color: #9fe9dd; }
.city-tower-card:hover, .city-tower.is-hover .city-tower-card { background: color-mix(in srgb, var(--sc) 20%, rgba(5, 12, 22, .85)); box-shadow: 0 0 26px -4px var(--sc); }
.city-tower.is-dim .city-tower-card { opacity: .3; }
.city-tower.is-current { visibility: hidden; }
.city-tower.is-small .city-tower-card { min-width: 0; padding: 3px 8px; border-radius: 8px; }
.city-tower.is-small small, .city-tower.is-small [data-chapter] span, .city-tower.is-small [data-progress-scope] { display: none; }
.city-tower.is-small b { font-size: 11.5px; font-weight: 600; }
.city-tower.is-crowded .city-tower-card, .city-district.is-crowded, .city-portal.is-crowded { visibility: hidden; opacity: 0; }
.legend-tower { display: contents; }
.tower-stage:has(.level-city) .legend-tower { display: none; }
.level-tower .city-tower-card { transform: scale(.82); transform-origin: center bottom; }
.city-district { display: grid; justify-items: center; color: var(--sc); pointer-events: none; text-shadow: 0 0 16px color-mix(in srgb, var(--sc) 70%, transparent); transition: opacity .4s; }
.city-district b { font-size: 22px; letter-spacing: .3em; }
.city-district span { color: var(--sky-muted); font-size: 11px; letter-spacing: .2em; }
.city-portal button { display: grid; justify-items: start; gap: 1px; max-width: 12em; padding: 5px 10px; border: 1px dashed rgba(207, 224, 238, .55); border-radius: 10px; background: rgba(5, 12, 22, .72); color: var(--sky-ink); font: inherit; font-size: 12px; text-align: left; cursor: pointer; pointer-events: auto; transition: background .2s; }
.city-portal button span { color: #9fe9dd; font-size: 11px; font-weight: 700; }
.city-portal button b { color: var(--sky-muted); font-size: 10.5px; font-weight: 600; }
.city-portal button:hover { background: rgba(45, 212, 191, .16); }
.ghost-section span { display: inline-flex; gap: 5px; max-width: 10em; padding: 2px 7px; border-radius: 7px; background: rgba(5, 12, 22, .6); color: #b9cad6; font-size: 11.5px; line-height: 1.35; white-space: normal; text-align: center; transition: opacity .3s; }
.ghost-section b { color: #e3eef5; }
.ghost-section.is-back span { opacity: .18; }
.tower-label.is-away, .tower-floor.is-away, .ghost-section.is-away, .city-portal.is-away, .city-district.is-away { visibility: hidden; }
.bar-back { color: #9fe9dd !important; font-weight: 700; }
.bar-note { align-self: center; padding: 0 14px 0 6px; color: var(--sky-muted); font-size: 12.5px; white-space: nowrap; }
.chapter-chip { font-size: 12px; }

.tower-below { padding-top: 26px; padding-bottom: 40px; }
.kx-tower .tower-below .fallback-directory { border-color: #1b3346; background: #0a1724; color: #cfe3ec; }
.tower-failed .tower-legend, .tower-failed .tower-sections, .tower-failed .tower-tools { display: none; }

@media (max-width: 1000px) {
  .tower-sections { left: 26px; right: auto; bottom: 22px; max-width: calc(100% - 330px); overflow-x: auto; transform: none; scrollbar-width: none; }
  .tower-sections button span { display: none; }
  .tower-legend { bottom: 76px; }
  .tower-drawer { width: 310px; }
}
@media (max-width: 760px) {
  .tower-stage { height: calc(100svh - var(--site-header-h, 57px) - var(--site-subbar-h, 0px)); min-height: 520px; }
  .tower-head { top: 14px; left: 16px; right: 16px; }
  .tower-head h1 { font-size: 24px; }
  .tower-lead, .tower-head .eyebrow { display: none; }
  .tower-search { top: 56px; left: 16px; right: 16px; width: auto; }
  .tower-legend { top: 108px; left: 12px; bottom: auto; display: flex; flex-wrap: nowrap; width: auto; max-width: calc(100% - 24px); padding: 4px; overflow-x: auto; border-radius: 999px; scrollbar-width: none; }
  .tower-legend p, .tower-check span, .tower-check[data-family] { display: none; }
  .tower-check { flex: none; font-size: 12px; }
  .tower-sections { left: 12px; bottom: 64px; max-width: calc(100% - 24px); }
  .tower-tools { left: 12px; right: 12px; bottom: 14px; justify-content: space-between; }
  .tower-status { display: none; }
  .tower-failed .tower-status { display: flex; left: 16px; right: 16px; }
  .kx-drawer.tower-drawer { position: absolute; top: auto; right: 8px; bottom: 8px; left: 8px; width: auto; max-height: 48%; margin: 0; border-radius: 18px; animation: sheet-in .3s ease-out both; }
  .tower-label button { max-width: 6.5em; font-size: 11px; }
  .tower-floor { display: none; }
  .tower-key { flex: none; font-size: 12px; white-space: nowrap; }
  .tower-key span { display: none; }
  .city-crumbs { display: none; }
  .city-tower-card { min-width: 0; max-width: 8em; padding: 4px 8px; }
  .city-tower small, .city-tower [data-chapter] span { display: none; }
  .city-tower b { font-size: 11.5px; }
  .city-district b { font-size: 16px; }
  .city-portal button b { display: none; }
}
@keyframes sheet-in { from { opacity: 0; transform: translateY(24px); } }

/* Whole-curriculum overview and chapter pages */
.kg-sub { margin: 6px 0 0 4px; padding: 2px 0 2px 14px; border-left: 2px solid #cfe3de; color: var(--muted); font-size: 14px; font-weight: 600; line-height: 1.3; letter-spacing: .04em; }
.kx-chapter-link { display: inline-flex; align-items: center; padding: 3px 11px; border: 1px solid #cfe3de; border-radius: 999px; background: #fff; color: var(--ink-soft); font-size: 12.5px; transition: border-color .15s, color .15s; }
a.kx-chapter-link:hover { border-color: var(--teal); color: var(--teal-dark); }
.chapter-cross { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 12px 0 0; font-size: 12.5px; }
.chapter-cross > span:first-child { color: var(--muted); font-weight: 650; letter-spacing: .04em; }
.strand-nav { display: flex; flex-wrap: wrap; gap: 8px; }
.strand-nav a { display: inline-flex; align-items: center; gap: 7px; padding: 7px 15px; border: 1px solid #cfe3de; border-radius: 999px; background: #fff; color: var(--ink-soft); font-size: 13.5px; transition: border-color .15s; }
.strand-nav a:hover { border-color: var(--kg); }
.strand-nav i { width: 9px; height: 9px; border-radius: 50%; background: var(--kg); }

.kx-map { overflow: hidden; border: 1px solid #13283a; border-radius: 22px; color: #e3eef5; background: radial-gradient(110% 80% at 12% 0%, #12304a 0%, rgba(7, 17, 29, 0) 55%), radial-gradient(70% 70% at 92% 100%, rgba(109, 91, 214, .2), rgba(7, 17, 29, 0) 60%), #07111d; box-shadow: 0 30px 60px -36px rgba(3, 12, 24, .75); }
.map-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 20px; padding: 16px 20px 0; }
.map-head h2 { margin: 0; color: #fff; font-size: 17px; }
.map-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0; color: #8ea5b5; font-size: 12px; }
.map-legend .key { display: inline-flex; align-items: center; gap: 6px; }
.map-legend i { display: inline-block; width: 18px; height: 11px; border-radius: 4px; }
.map-legend .is-built i { border: 1.5px solid #fbbf24; background: rgba(251, 191, 36, .22); }
.map-legend .is-partial i { border: 1.5px dashed #fbbf24; background: rgba(251, 191, 36, .08); }
.map-legend .is-ghost i { border: 1px solid rgba(160, 185, 200, .35); }
.map-legend .is-relation i { height: 0; border-top: 2.5px solid #2dd4bf; border-radius: 0; }
.map-legend .is-outline i { height: 0; border-top: 1.5px dashed #6f8799; border-radius: 0; }
.map-body { padding: 4px 8px 0; }
.map-svg { display: block; width: 100%; height: auto; margin: auto; }
.map-svg.is-narrow, .map-help .is-narrow { display: none; }
.map-svg.is-narrow .map-label { font-size: 12px; }
.map-svg.is-narrow .map-meta { font-size: 10.5px; }
.map-strand { fill: var(--kg); font-size: 14px; font-weight: 750; letter-spacing: .12em; }
.map-chapter rect { fill: rgba(255, 255, 255, .03); stroke: rgba(160, 185, 200, .28); stroke-width: 1; transition: fill .2s, stroke .2s, opacity .2s; }
.map-chapter .map-meta { fill: #7f97a8; font-size: 11px; }
.map-chapter .map-label { fill: #a9bccb; font-size: 13px; font-weight: 650; }
.map-chapter.is-built rect { fill: color-mix(in srgb, var(--kg) 20%, #0b1a28); stroke: var(--kg); stroke-width: 1.6; filter: drop-shadow(0 0 10px color-mix(in srgb, var(--kg) 45%, transparent)); }
.map-chapter.is-partial rect { fill: color-mix(in srgb, var(--kg) 8%, #0b1a28); stroke: var(--kg); stroke-width: 1.4; stroke-dasharray: 5 4; }
.map-chapter.is-built .map-label, .map-chapter.is-partial .map-label { fill: #fff; }
.map-chapter.is-built .map-meta, .map-chapter.is-partial .map-meta { fill: var(--kg); }
.map-chapter:hover rect, .map-chapter:focus rect { stroke: var(--kg); stroke-width: 2; }
.map-chapter:focus { outline: none; }
.map-link path { fill: none; stroke: #6f8799; stroke-width: 1.2; stroke-dasharray: 4 4; opacity: .45; transition: opacity .2s, stroke-width .2s; }
.map-link.is-relation path { stroke: #2dd4bf; stroke-width: 2.6; stroke-dasharray: none; opacity: .85; filter: drop-shadow(0 0 4px rgba(45, 212, 191, .6)); }
.map-count circle { fill: #07111d; stroke: #2dd4bf; stroke-width: 1.5; }
.map-count text { fill: #7ff3e4; font-size: 11.5px; font-weight: 750; }
.map-svg.has-focus .map-link, .map-svg.has-focus .map-chapter { opacity: .25; transition: opacity .2s; }
.map-svg.has-focus .map-link.lit, .map-svg.has-focus .map-chapter.lit { opacity: 1; }
.map-svg.has-focus .map-link.lit path { opacity: 1; stroke-width: 2.2; }
.map-help { margin: 0; padding: 4px 20px 14px; color: #6f8799; font-size: 12px; }

.kx-strands { display: grid; gap: 30px; margin-top: 30px; }
.strand-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 14px; padding-left: 14px; border-left: 4px solid var(--kg); }
.strand-head h2 { margin: 0; font-size: 20px; }
.strand-head p { margin: 0; color: var(--muted); font-size: 13px; }
.chapter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.chapter-card { display: flex; flex-direction: column; min-width: 0; padding: 18px 20px; border: 1px solid #d3e2dd; border-top: 4px solid color-mix(in srgb, var(--kg) 55%, #d3e2dd); border-radius: 16px; background: #fff; box-shadow: 0 1px 2px rgba(20, 50, 45, .05), 0 6px 16px -12px rgba(20, 60, 55, .3); }
.chapter-card.is-built { border-top-color: var(--kg); box-shadow: 0 18px 36px -24px color-mix(in srgb, var(--kg) 80%, transparent); }
.chapter-card.is-ghost { background: color-mix(in srgb, var(--paper) 60%, white); border-top-style: dashed; }
.chapter-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 6px; color: var(--muted); font-size: 12.5px; }
.chapter-status { padding: 1px 9px; border-radius: 999px; background: #eef3f1; color: var(--muted); font-size: 11.5px; font-weight: 700; }
.is-built .chapter-status { background: color-mix(in srgb, var(--kg) 22%, white); color: #5c4305; }
.is-partial .chapter-status { border: 1px dashed color-mix(in srgb, var(--kg) 80%, #888); background: none; color: var(--ink-soft); }
.chapter-card h3 { margin: 0 0 8px; font-size: 18px; line-height: 1.4; }
.chapter-card h3 a:hover { color: var(--teal); }
.is-ghost h3 { color: var(--ink-soft); }
.chapter-counts { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0 0 10px; color: var(--ink-soft); font-size: 13px; }
.chapter-counts > b { color: var(--teal-dark); font-size: 17px; }
.chapter-kinds { display: inline-flex; flex-wrap: wrap; gap: 4px 10px; color: var(--muted); font-size: 12px; }
.chapter-kinds span { display: inline-flex; align-items: center; gap: 4px; }
.chapter-kinds i { width: 6px; height: 6px; border-radius: 50%; background: var(--kc); }
.chapter-sections { display: grid; gap: 3px; margin: 0 0 4px; padding: 0; color: var(--muted); font-size: 13px; list-style: none; }
.chapter-sections b { display: inline-block; min-width: 2.6em; font-weight: 650; font-variant-numeric: tabular-nums; }
.chapter-sections .is-recorded a { color: var(--teal-dark); font-weight: 650; }
.chapter-sections .is-recorded a:hover { text-decoration: underline; text-underline-offset: 3px; }
.chapter-card .chapter-cross { margin-top: 10px; }
.chapter-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: auto; padding-top: 14px; }
.chapter-actions .primary-link { padding: 7px 16px; font-size: 13px; }
.chapter-3d { color: var(--muted); font-size: 12.5px; transition: color .15s; }
.chapter-3d:hover { color: var(--teal); }

.scope-pending { align-self: center; padding: 0 6px; color: var(--muted); font-size: 12.5px; }
.chapter-pager { display: flex; justify-content: space-between; gap: 14px; margin-top: 18px; font-size: 13.5px; }
.chapter-pager a { padding: 8px 14px; border: 1px solid #cfe3de; border-radius: 999px; background: #fff; color: var(--ink-soft); transition: border-color .15s, color .15s; }
.chapter-pager a:hover { border-color: var(--teal); color: var(--teal-dark); }
.home-tag { display: inline-block; margin-left: 6px; padding: 1px 8px; border: 1px solid #d3e2dd; border-radius: 999px; color: var(--muted); font-size: 11px; }
.graph-node.external .node-box { stroke-dasharray: 2 4; stroke-width: 1.6; }
.graph-node.external .node-tag-bg { stroke-dasharray: 2 2; }
.graph-node.selected .node-tag-bg { fill: color-mix(in srgb, var(--kg) 35%, white); stroke: #04121b; }
.rel-home { margin-left: 2px; color: var(--sky-muted); font-size: 10.5px; }
.drawer-home { margin: 0 0 12px; padding: 9px 12px; border: 1px dashed rgba(127, 243, 228, .35); border-radius: 12px; color: #b9cad6; font-size: 12.5px; line-height: 1.7; }
.drawer-home b { color: #e3eef5; }
.drawer-home a { margin-left: 4px; color: #7ff3e4; text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 760px) {
  .kg-sub { display: none; }
  .strand-nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .strand-nav a { flex: none; }
  .map-legend { font-size: 11px; }
  .map-legend .is-outline { display: none; }
  .map-body { padding: 0 2px; }
  .map-svg.is-wide, .map-help .is-wide { display: none; }
  .map-svg.is-narrow { display: block; max-width: 520px; }
  .map-help .is-narrow { display: inline; }
  .chapter-grid { grid-template-columns: 1fr; }
  .chapter-pager { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  .kx-drawer.tower-drawer { animation: none; }
  .node-body, .kx-drawer, .graph-node.path-current .node-body, .layer-surfaced .edge { animation: none; }
  .edge.lit .edge-line, .edge.path-on .edge-line { animation: none; }
}
