:root {
  color-scheme: light;
  --paper: #fffcf2;
  --ink: #2f2f2f;
  --muted: #64615d;
  --line: #d8d3c8;
  --topic: #d8ccf0;
  --topic-stroke: #7b68a8;
  --word: #f6e96b;
  --word-stroke: #a89f2d;
  --link: #b7a4e0;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-width: 0; }
body { background: var(--paper); color: var(--ink); font-family: "Manrope", sans-serif; }
.network-page { width: 100%; max-width: 1500px; margin: 0 auto; padding: 18px clamp(12px, 2vw, 28px) 24px; }
.instruction { max-width: 810px; margin: 0 0 18px; color: #55514e; font-size: 0.94rem; line-height: 1.5; }
.explorer-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(275px, 335px); gap: 18px; align-items: start; }
.network-area { min-width: 0; overflow: hidden; border: 1px solid var(--line); background: var(--paper); }
#topic-network { display: block; width: 100%; font-family: "Manrope", sans-serif; touch-action: pan-y; }
.network-link { stroke: var(--link); stroke-opacity: .36; pointer-events: none; transition: opacity 130ms ease, stroke-opacity 130ms ease; }
.network-node { cursor: pointer; transition: opacity 130ms ease; }
.network-node text { fill: var(--ink); font-size: 12px; font-weight: 500; text-anchor: middle; dominant-baseline: middle; pointer-events: none; user-select: none; }
.network-node.topic text { font-size: 12px; font-weight: 600; }
.network-node .topic-shape { fill: var(--topic); fill-opacity: .75; stroke: var(--topic-stroke); stroke-width: 1; }
.network-node .word-shape { fill: var(--word); fill-opacity: .75; stroke: var(--word-stroke); stroke-width: 1; }
.network-node .shared-rim { fill: none; stroke: var(--word-stroke); stroke-width: 1; stroke-dasharray: 2.5 3; opacity: .68; }
.network-node.is-selected .topic-shape, .network-node.is-selected .word-shape { stroke-width: 3; }
.network-node:focus-visible { outline: none; }
.network-node:focus-visible .topic-shape, .network-node:focus-visible .word-shape { stroke: #34313a; stroke-width: 3; }
.network-node:focus-visible .shared-rim { stroke: #34313a; stroke-width: 2; }
.network-node.is-dimmed, .network-link.is-dimmed { opacity: .13; }
.network-link.is-active { stroke-opacity: .85; }
.network-legend { margin: 0; padding: 10px 14px 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: .76rem; line-height: 1.4; }
.detail-panel { min-width: 0; padding: 18px; border: 1px solid var(--line); background: rgba(255,255,255,.45); line-height: 1.45; }
.panel-top { display: flex; align-items: start; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.panel-kicker { margin: 2px 0 0; color: var(--topic-stroke); font-size: .75rem; font-weight: 700; letter-spacing: .055em; text-transform: uppercase; }
#reset-selection { padding: 5px 0; border: 0; border-bottom: 1px solid currentColor; background: none; color: #514a69; font: inherit; font-size: .79rem; cursor: pointer; }
#reset-selection:hover { color: #211c32; }
#reset-selection:focus-visible { outline: 2px solid var(--topic-stroke); outline-offset: 3px; }
.detail-panel h2 { margin: 0 0 12px; font-size: clamp(1.22rem, 1.7vw, 1.5rem); line-height: 1.2; }
.detail-panel p { margin: 0 0 15px; font-size: .89rem; }
.detail-panel .count { margin: 0 0 16px; font-size: .83rem; font-weight: 700; }
.detail-panel h3 { margin: 19px 0 8px; color: #4f4a49; font-size: .73rem; letter-spacing: .065em; text-transform: uppercase; }
.term-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.term-list li { padding: 4px 7px; border: 1px solid #d8d0ad; background: rgba(246,233,107,.23); font-size: .78rem; }
.example-list, .topic-list { margin: 0; padding: 0 0 0 20px; }
.example-list li, .topic-list li { margin-bottom: 9px; font-size: .82rem; overflow-wrap: anywhere; }
.example-list time { color: var(--muted); white-space: nowrap; }
.method-note { margin-top: 17px !important; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: .76rem !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 850px) {
  .explorer-layout { grid-template-columns: minmax(0, 1fr); }
  .detail-panel { margin-top: 0; }
}
@media (max-width: 480px) {
  .network-page { padding: 13px 8px 20px; }
  .instruction { padding: 0 4px; font-size: .86rem; }
  .network-node text { font-size: 10.5px; }
  .network-node.topic text { font-size: 10.5px; }
  .network-legend { font-size: .7rem; }
  .detail-panel { padding: 15px; }
}
