:root {
  color-scheme: dark;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  --bg: #0c1119;
  --panel: #111924;
  --line: #293545;
  --line-soft: #202c3a;
  --ink: #edf3f9;
  --muted: #a3b2c4;
  --quiet: #8395aa;
  --green: #c2f77a;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  background: var(--bg);
  color: var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: radial-gradient(ellipse at 24% 0%, #162231 0, transparent 37rem), var(--bg); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, summary:focus-visible, .map-scroll:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.shell { width: min(100% - 72px, 1392px); margin-inline: auto; }
.topbar { border-bottom: 1px solid #253140; background: #0c1119cc; }
.top-inner { min-height: 67px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { display: block; }
.brand strong { font-size: 17px; letter-spacing: .105em; }
.brand > span { border-left: 1px solid var(--line); margin-left: 3px; padding-left: 13px; color: var(--muted); font-size: 13px; }
.access-badge { display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; border: 1px solid #3a5140; border-radius: 5px; color: #d0efb4; background: #18241f; font: 11px var(--mono); white-space: nowrap; }
.access-badge span { color: var(--green); font-size: 9px; }

.intro { padding: 36px 0 27px; }
.eyebrow, .section-kicker, .trace-label { font: 600 10px/1.4 var(--mono); letter-spacing: .135em; }
.eyebrow { display: flex; align-items: center; gap: 9px; color: #c8d7e4; }
.status-dot { display: inline-block; width: 7px; height: 7px; flex: 0 0 auto; background: var(--green); border-radius: 50%; box-shadow: 0 0 10px #baf77a50; }
.slash { color: #708397; }
h1, h2, h3, p { margin: 0; }
.intro h1 { font-size: clamp(32px, 4.15vw, 61px); line-height: 1.04; font-weight: 690; letter-spacing: -.067em; margin: 12px 0 11px; }
.intro h1 > span { color: var(--green); margin-left: 2px; }
.intro > p { color: var(--muted); font-size: 15px; line-height: 1.6; max-width: 650px; }

.system-switch { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 14px; }
.system-switch button { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; min-height: 38px; border: 1px solid var(--line); border-radius: 7px; background: #131c28; color: #c2cfdb; font-size: 13px; font-weight: 600; }
.system-switch button span { display: flex; }
.system-switch button small { color: var(--quiet); font: 500 10.5px var(--mono); }
.system-switch button:hover { border-color: #6a7c8d; color: var(--ink); }
.system-switch button[aria-pressed="true"] { border-color: #8f7be0; color: #d9ceff; background: #211d33; }
.system-switch button[aria-pressed="true"] small { color: #b7a8ef; }
.view-tabs { display: flex; align-items: end; gap: 6px; border-bottom: 1px solid var(--line); overflow-x: auto; padding: 3px 3px 0; }
.view-tabs button { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px 11px; border: 0; border-bottom: 2px solid transparent; border-radius: 6px 6px 0 0; background: transparent; color: var(--muted); font-weight: 600; font-size: 13px; white-space: nowrap; }
.view-tabs button span { display: flex; }
.view-tabs button:hover { color: var(--ink); background: #182332; }
.view-tabs button[aria-selected="true"] { color: var(--green); background: #1d2b20; border-bottom-color: var(--green); }
.view-tabs button:focus-visible { outline-offset: -2px; }

.tracebar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 15px 0; flex-wrap: wrap; }
.scenario-list { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.trace-label { margin-right: 6px; color: var(--quiet); }
.scenario, .utility { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 7px 10px; min-height: 34px; border: 1px solid var(--line); border-radius: 6px; background: #131c28; color: #c2cfdb; font-size: 12px; font-weight: 600; }
.utility span { display: flex; }
.scenario:hover, .utility:hover { border-color: #6a7c8d; color: var(--ink); }
.scenario[aria-pressed="true"], .utility[aria-pressed="true"] { border-color: #779e51; color: var(--green); background: #202d20; }

.workspace-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(285px, 324px); gap: 14px; align-items: start; }
.tracebar[hidden] + .workspace-grid { margin-top: 15px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 11px; min-width: 0; }
.view-panel { overflow: hidden; }
.panel-head { display: flex; align-items: start; justify-content: space-between; gap: 12px; padding: 18px 20px 14px; }
.section-kicker { color: var(--green); margin-bottom: 5px; }
.panel-head h2 { font-size: 24px; line-height: 1.15; letter-spacing: -.034em; }
.panel-subtitle { color: var(--muted); font-size: 12.5px; margin-top: 5px; line-height: 1.5; }
.panel-badge { padding: 5px 8px; border: 1px solid var(--line); border-radius: 5px; color: #b8c8d8; font: 10px var(--mono); white-space: nowrap; }

.map-scroll { overflow: auto; overscroll-behavior-inline: contain; margin: 0 13px; border: 1px solid #26364a; border-radius: 8px; scrollbar-color: #44556a #101722; }
.map-scroll:focus-visible { outline-offset: -2px; }
.map-canvas { position: relative; width: 100%; min-width: 760px; aspect-ratio: 900 / 500; background-color: #0c141f; background-image: radial-gradient(circle, #314259 1px, transparent 1px); background-size: 16px 16px; isolation: isolate; }
.lane { position: absolute; top: 2%; bottom: 2%; width: 22.9%; border: 1px solid color-mix(in srgb, var(--accent) 15%, #192431); border-radius: 7px; background: color-mix(in srgb, var(--accent) 4%, #101823e0); pointer-events: none; }
.lane-label { display: flex; align-items: center; gap: 6px; padding: 8px 8px 0; color: var(--accent); font-size: clamp(9px, .88vw, 12px); font-weight: 650; white-space: nowrap; }
.lane-label span { border: 1px solid color-mix(in srgb, var(--accent) 30%, #243044); border-radius: 4px; padding: 2px 4px; font: 9px var(--mono); }
.wires { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.wire, .marker, .legend-line, .edge-dot { --wire: #90bfe8; }
.wire.event, .marker.event, .legend-line.event, .edge-dot.event { --wire: #ffc983; }
.wire.learn, .marker.learn, .legend-line.learn, .edge-dot.learn { --wire: #c4aeff; }
.wire { fill: none; stroke: var(--wire); stroke-width: 1.45; opacity: .38; }
.wire.event, .wire.learn { stroke-dasharray: 5 3; }
.wire.learn { stroke-dasharray: 2 3; }
.wire.related { stroke-width: 1.85; opacity: .83; }
.wire.muted { opacity: .1; }
.wire.current { stroke-width: 2.8; opacity: 1; filter: drop-shadow(0 0 3px var(--wire)); }
.marker { fill: var(--wire); }
.map-node { position: absolute; display: flex; align-items: center; gap: 8px; text-align: left; width: 20.8889%; height: 11.2%; min-height: 43px; padding: 5px 7px; background: #152130; color: var(--ink); border: 1px solid color-mix(in srgb, var(--accent) 28%, #2b3c51); border-radius: 7px; z-index: 1; }
.map-node[aria-pressed="true"], .map-node.endpoint { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, #122032); z-index: 2; }
.map-node[aria-pressed="true"] { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 20%, transparent); }
.map-node:hover, .map-node:focus-visible { border-color: var(--accent); opacity: 1; z-index: 3; }
.map-node.dimmed { opacity: .38; }
.component-icon { display: inline-grid; flex: 0 0 auto; place-items: center; width: 32px; height: 32px; border-radius: 6px; color: var(--accent); background: color-mix(in srgb, var(--accent) 13%, #152030); }
.map-node-text { display: grid; gap: 4px; min-width: 0; }
.map-node-text strong { font-size: clamp(10.5px, 1.04vw, 14px); line-height: 1.08; white-space: nowrap; }
.map-node-text small { font-size: clamp(8px, .74vw, 10.5px); color: #afc0d3; white-space: nowrap; line-height: 1.05; }
.legend { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding: 11px 18px 13px; color: var(--muted); font-size: 11px; }
.legend > span { display: inline-flex; align-items: center; gap: 6px; }
.legend-line { display: inline-block; width: 17px; border-top: 2px solid var(--wire); }
.legend-line.event { border-top-style: dashed; }
.legend-line.learn { border-top-style: dotted; }
.legend .pan-hint { display: none; margin-left: auto; color: #a8bad0; }
.playback { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 10px; padding: 12px 17px 14px; border-top: 1px solid var(--line); background: #101925; }
.step-heading { display: flex; align-items: center; gap: 8px; grid-column: 1; color: var(--ink); font-size: 13px; }
.step-heading strong span { color: var(--green); }
.step-number { display: inline-block; padding: 3px 5px; border: 1px solid #40543b; border-radius: 4px; color: var(--green); font: 10px var(--mono); white-space: nowrap; }
.playback > p { grid-column: 1; color: var(--muted); font-size: 12px; line-height: 1.5; }
.playback-actions { display: flex; gap: 5px; grid-area: 1 / 2 / 3; }
.square { display: inline-grid; width: 32px; height: 32px; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 5px; background: #182333; color: var(--ink); }
.square:hover:enabled { border-color: var(--green); }
.square:disabled { opacity: .4; }
.square.play { border-color: #4b653e; color: var(--green); background: #223421; }

.inspector { overflow: hidden; }
.inspector-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); color: #b8c8d9; font: 600 10px var(--mono); letter-spacing: .12em; }
.inspector-head > span:first-child { display: flex; align-items: center; gap: 7px; }
.inspector-head svg { color: var(--green); }
.inspector-body { padding: 14px; max-height: 566px; overflow: auto; scrollbar-color: #44556a #141d29; }
.inspector-identity { display: flex; align-items: center; gap: 10px; }
.inspector-identity .component-icon { width: 40px; height: 40px; }
.inspector-identity p { margin-bottom: 2px; color: var(--accent); font: 600 10px var(--mono); }
.inspector-identity h2 { font-size: 21px; line-height: 1.05; letter-spacing: -.035em; }
.inspector-summary { margin: 12px 0; color: #c4d0de; font-size: 12.5px; line-height: 1.56; }
.io { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.io > div { padding: 8px; border: 1px solid var(--line-soft); border-radius: 6px; background: #0e1621; }
.io span { color: var(--quiet); font: 600 9px var(--mono); letter-spacing: .12em; }
.io p { margin-top: 3px; color: #c6d1de; font-size: 11px; line-height: 1.43; }
.connections { margin: 12px 0; }
.connection-group + .connection-group { margin-top: 10px; }
.connection-group h3 { margin-bottom: 4px; color: #d0dbe7; font-size: 11px; }
.connection { display: grid; width: 100%; grid-template-columns: 7px minmax(0, 1fr) 12px; align-items: center; gap: 7px; padding: 5px 4px; border: 0; border-bottom: 1px solid #253041; background: transparent; color: var(--quiet); text-align: left; }
.connection:hover { color: var(--ink); background: #1d2a3a; }
.edge-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--wire); }
.connection strong, .connection small { display: block; line-height: 1.34; }
.connection strong { color: #e1e9f0; font-size: 11.5px; }
.connection small { color: var(--muted); font-size: 10.5px; }
.inspector-note { display: grid; gap: 3px; border-left: 2px solid color-mix(in srgb, var(--accent) 65%, #273142); padding: 4px 7px; color: #aebed0; font-size: 11px; line-height: 1.5; }
.inspector-note strong { color: #e0e9f1; font-size: 11px; }
.source-link { margin-top: 12px; width: 100%; display: grid; grid-template-columns: 16px minmax(0, 1fr) 14px; gap: 7px; align-items: center; padding: 8px; color: var(--accent); background: #141f2c; border: 1px solid var(--line); border-radius: 6px; text-align: left; }
.source-link code { overflow-wrap: anywhere; font: 11px var(--mono); }
.source-link:hover { border-color: var(--accent); }

.catalog-controls { display: flex; gap: 8px; padding: 2px 18px 13px; flex-wrap: wrap; }
.search { flex: 1 1 185px; display: flex; align-items: center; gap: 8px; padding: 0 9px; color: var(--quiet); border: 1px solid var(--line); background: #0d1520; border-radius: 6px; }
.search input, .group-filter select { width: 100%; color: var(--ink); font-size: 13px; min-height: 37px; }
.search input { border: 0; outline: 0; background: transparent; }
.search:focus-within, .group-filter:focus-within { outline: 2px solid var(--green); outline-offset: 2px; }
.search input::placeholder { color: var(--quiet); }
.group-filter select { padding: 0 9px; border: 1px solid var(--line); border-radius: 6px; background: #0d1520; outline: none; }
.catalog-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 0 18px 18px; }
.catalog-card { position: relative; min-height: 103px; display: flex; flex-direction: column; align-items: start; padding: 10px; gap: 5px; text-align: left; border: 1px solid var(--line); background: #131e2b; border-radius: 7px; color: var(--ink); }
.catalog-card:hover, .catalog-card[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, #131e2b); }
.catalog-top { display: flex; align-items: center; gap: 7px; color: var(--accent); font: 10px var(--mono); }
.catalog-top .component-icon { height: 28px; width: 28px; }
.catalog-card > strong { font-size: 14px; }
.catalog-tech { padding-right: 17px; color: var(--muted); font-size: 11px; }
.card-arrow { position: absolute; right: 9px; bottom: 8px; color: var(--accent); }
.empty { padding: 15px 0; grid-column: 1 / -1; color: var(--muted); font-size: 13px; }

.zones { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; padding: 0 18px 12px; }
.zone { min-width: 0; border: 1px solid color-mix(in srgb, var(--accent) 27%, var(--line)); border-radius: 7px; padding: 11px; background: #131e2b; }
.zone-top { display: flex; align-items: center; gap: 8px; }
.zone-top p { color: var(--accent); font: 9px var(--mono); letter-spacing: .1em; margin-bottom: 2px; }
.zone-top h3 { font-size: 16px; }
.zone-sub { display: block; margin: 7px 0; color: var(--muted); font-size: 11px; }
.zone-items { display: flex; flex-wrap: wrap; gap: 5px; }
.zone-items button { display: inline-flex; align-items: center; gap: 5px; background: #111a26; color: var(--ink); padding: 6px; border: 1px solid var(--line); border-radius: 4px; font-size: 11px; }
.zone-items button svg { color: var(--accent); }
.zone-items button:hover, .zone-items button[aria-pressed="true"] { border-color: var(--accent); }
.zone-boundary { margin-top: 10px; color: #b9c8d9; font-size: 12px; line-height: 1.5; }
.deployment-note { display: flex; align-items: start; gap: 8px; margin: 0 18px 16px; padding: 9px; background: #0f1722; border: 1px solid var(--line); border-radius: 6px; color: var(--green); }
.deployment-note svg { flex: 0 0 auto; }
.deployment-note p { display: grid; gap: 3px; color: #b8c8d8; font-size: 12px; line-height: 1.5; }
.deployment-note strong { color: var(--ink); }

.repo-layout { display: grid; grid-template-columns: minmax(155px, .9fr) minmax(0, 1.6fr); gap: 10px; padding: 0 18px 18px; }
.repo-tree, .folder-details { background: #0f1722; border: 1px solid var(--line); border-radius: 7px; padding: 10px; }
.repo-tree { font: 12px var(--mono); }
.repo-root { display: flex; align-items: center; gap: 6px; margin: 1px 0 6px; color: var(--green); }
.repo-tree summary { list-style: none; display: flex; align-items: center; gap: 5px; padding: 6px 3px; color: #d2dce8; cursor: pointer; border-radius: 3px; }
.repo-tree summary::-webkit-details-marker { display: none; }
.repo-tree summary:hover { background: #1a2938; }
.repo-tree summary > svg:first-child { transition: transform .14s ease; }
.repo-tree details[open] summary > svg:first-child { transform: rotate(90deg); }
.branch { margin: 0 0 2px 8px; padding: 0 0 0 8px; border-left: 1px solid var(--line); }
.branch button { display: flex; align-items: center; gap: 5px; padding: 5px 4px; width: 100%; border: 0; border-radius: 4px; background: transparent; color: var(--muted); text-align: left; overflow-wrap: anywhere; }
.branch button:hover, .branch button[aria-pressed="true"] { background: #213222; color: var(--green); }
.folder-details h3 { color: var(--ink); font: 600 clamp(13px, 1.6vw, 20px) var(--mono); overflow-wrap: anywhere; }
.folder-details > p:not(.section-kicker) { margin: 9px 0 15px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.file-label { color: var(--quiet); }
.folder-details ul { list-style: none; padding: 0; margin: 0; }
.folder-details li { display: flex; align-items: center; gap: 7px; padding: 7px 0; border-bottom: 1px solid var(--line-soft); color: #c4d5e6; font-size: 11px; }
.folder-details li svg { flex: 0 0 auto; color: #8fb9df; }
.folder-details li code { overflow-wrap: anywhere; }
.footer { display: flex; justify-content: space-between; gap: 10px; padding: 14px 1px 20px; color: var(--quiet); font: 10px var(--mono); }
.footer strong { color: #b2c2d1; letter-spacing: .09em; }

@media (max-width: 1190px) { .legend .pan-hint { display: inline-flex; } }
@media (max-width: 1040px) {
  .shell { width: calc(100% - 40px); }
  .workspace-grid { grid-template-columns: minmax(0, 1fr) minmax(240px, 275px); }
  .map-node-text strong { font-size: 12px; }
  .map-node-text small { font-size: 9px; }
  .lane-label { font-size: 10px; }
  .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 790px) {
  .workspace-grid { grid-template-columns: minmax(0, 1fr); }
  .inspector-body { max-height: none; }
}
@media (max-width: 540px) {
  .shell { width: calc(100% - 24px); }
  .top-inner { min-height: 56px; }
  .brand > span { display: none; }
  .intro { padding: 25px 0 18px; }
  .intro > p { font-size: 13px; }
  .view-tabs { gap: 2px; }
  .view-tabs button { gap: 5px; padding: 8px 8px 9px; font-size: 12px; }
  .view-tabs button svg { width: 14px; height: 14px; }
  .tracebar { gap: 7px; }
  .trace-label { flex: 1 0 100%; }
  .scenario { padding-inline: 6px; font-size: 11px; }
  .panel-head { padding: 14px 12px 11px; }
  .panel-head h2 { font-size: 21px; }
  .panel-badge { padding-inline: 5px; }
  .map-scroll { margin-inline: 8px; }
  .legend { gap: 7px 9px; padding-inline: 10px; }
  .legend .pan-hint { margin-left: 0; }
  .playback { grid-template-columns: minmax(0, 1fr); padding-inline: 10px; }
  .playback-actions { grid-area: auto; margin-top: 4px; }
  .zones, .repo-layout { grid-template-columns: minmax(0, 1fr); }
  .catalog-controls, .catalog-grid, .zones, .repo-layout { padding-inline: 10px; }
  .footer { line-height: 1.4; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

.playback { margin: 0 13px 10px; border: 1px solid var(--line); border-radius: 7px; }
.mobile-inspect { display: none; }
@media (max-width: 790px) {
  .mobile-inspect { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: calc(100% - 26px); margin: 0 13px 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 5px; background: #162334; color: var(--green); font-size: 12px; text-align: left; }
}
@media (max-width: 540px) {
  .playback, .mobile-inspect { margin-inline: 8px; }
  .mobile-inspect { width: calc(100% - 16px); }
}

.guide-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 13px; }
.guide-link { display: inline-flex; align-items: center; gap: 7px; min-height: 33px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink); background: #172232; font-size: 12px; font-weight: 650; }
.guide-link:hover { border-color: var(--green); }
.guide-link.primary { background: var(--green); border-color: var(--green); color: #142118; }
.guide-link.primary:hover { background: #d9ff9b; }
.guide-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.guide-card { min-width: 0; padding: 17px; }
.guide-card h2 { margin: 5px 0 11px; font-size: 21px; }
.guide-card p:not(.section-kicker), .guide-card li, .guide-card dd, .copy-status { color: var(--muted); font-size: 13px; line-height: 1.55; }
.guide-card p + p { margin-top: 9px; }
.guide-card p a, .folder-details li a:hover { color: var(--green); text-decoration: underline; }
.guide-card pre, .guide-card textarea { width: 100%; background: #0c141f; border: 1px solid var(--line); color: var(--ink); border-radius: 6px; padding: 10px; font: 12px/1.6 var(--mono); }
.guide-card pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.guide-card textarea { resize: vertical; }
.guide-card ol { padding-left: 18px; }
.guide-card li + li { margin-top: 7px; }
.guide-models dt { margin-top: 8px; font-weight: 650; font-size: 13px; }
.guide-models dd { margin: 2px 0 0; }
@media (max-width: 790px) { .guide-grid { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------ Security view (security.js) */
.sec-guide { color: var(--green); }
.sec-guide:hover { border-color: var(--green); }
.sec-topics { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 20px 14px; border-bottom: 1px solid var(--line-soft); }
.sec-topics button { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; min-height: 34px; border: 1px solid var(--line); border-radius: 6px; background: #131c28; color: #c2cfdb; font-size: 12.5px; }
.sec-topics button:hover { border-color: #6a7c8d; color: var(--ink); }
.sec-topics button[aria-pressed="true"] { border-color: #779e51; color: var(--green); background: #202d20; }
.sec-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.sec-dot.impl, .sec-chip.impl { --tone: #c2f77a; }
.sec-dot.demo, .sec-chip.demo { --tone: #ffc983; }
.sec-dot.teach, .sec-chip.teach { --tone: #c4aeff; }
.sec-dot { background: var(--tone); }
.sec-dot.host, .sec-chip.host { --tone: #7fd8d0; }
.sec-ctl-ok { color: var(--green); border-color: #4a6b34; }
.sec-ctl-warn { color: #ffc983; border-color: #6b5434; }
.sec-ctl-fail { color: #ff8f86; border-color: #6b3434; }
.sec-status.sec-ctl-ok, .sec-status.sec-ctl-warn, .sec-status.sec-ctl-fail { font-size: 15px; line-height: 1.3; }
.sec-chip { display: inline-flex; align-items: center; padding: 3px 7px; border-radius: 4px; border: 1px solid color-mix(in srgb, var(--tone) 45%, transparent); background: color-mix(in srgb, var(--tone) 12%, transparent); color: var(--tone); font: 600 9.5px/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.sec-body { padding: 16px 20px 20px; display: grid; gap: 16px; min-width: 0; }
.sec-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sec-title-row h3 { font-size: 19px; letter-spacing: -.02em; }
.sec-intro p, .sec-text { color: #c4d0de; font-size: 13px; line-height: 1.62; max-width: 820px; }
.sec-intro strong { color: var(--ink); }
.sec-intro code, .sec-text code, .sec-note code, .sec-check code, .sec-table code { font: 11.5px var(--mono); color: #d7e3ee; background: #0d141e; border: 1px solid var(--line-soft); border-radius: 3px; padding: 1px 4px; overflow-wrap: anywhere; }
.sec-legend { display: flex; flex-wrap: wrap; gap: 12px 18px; margin-top: 12px; }
.sec-legend span { display: inline-flex; align-items: center; gap: 7px; }
.sec-legend small { color: var(--quiet); font-size: 11px; }
.sec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 9px; }
.sec-card { display: grid; gap: 6px; align-content: start; text-align: left; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #131e2b; color: var(--ink); }
.sec-card:hover { border-color: #6a7c8d; background: #162231; }
.sec-card-top { display: flex; justify-content: space-between; align-items: center; color: var(--green); }
.sec-card strong { font-size: 14px; }
.sec-card > span:not(.sec-card-top) { color: var(--muted); font-size: 12px; line-height: 1.5; }
.sec-card code { color: var(--quiet); font: 10.5px var(--mono); overflow-wrap: anywhere; }
.sec-section { display: grid; gap: 9px; padding-top: 14px; border-top: 1px solid var(--line-soft); min-width: 0; }
.sec-section h3 { font-size: 15.5px; }
.sec-section .section-kicker { color: var(--quiet); }
.sec-row, .sec-actions { display: flex; flex-wrap: wrap; align-items: end; gap: 9px; }
.sec-field { display: grid; gap: 5px; flex: 1 1 220px; min-width: 0; max-width: 380px; }
.sec-field.compact { flex: 0 1 300px; }
.sec-field span { color: var(--quiet); font: 600 9.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.sec-field input, .sec-field select { width: 100%; min-height: 36px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; background: #0d141e; color: var(--ink); font: 13px var(--mono); }
.sec-field input:focus-visible, .sec-field select:focus-visible { outline: 2px solid var(--green); outline-offset: 1px; }
.sec-btn { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 6px; background: #172232; color: var(--ink); font-size: 12.5px; }
.sec-btn:hover:not(:disabled) { border-color: #6a7c8d; }
.sec-btn.primary { background: var(--green); border-color: var(--green); color: #142118; font-weight: 600; }
.sec-btn.primary:hover:not(:disabled) { background: #d9ff9b; }
.sec-btn:disabled { opacity: .55; }
.sec-btn svg { flex: 0 0 auto; }
.sec-code { margin: 0; padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: 6px; background: #0b111a; color: #cfe0ee; font: 11.5px/1.6 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; max-width: 100%; overflow-x: auto; }
.sec-label { color: var(--quiet); font-size: 11.5px; }
.sec-note { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; color: var(--muted); font-size: 12px; line-height: 1.55; }
.sec-note svg { color: var(--green); flex: 0 0 auto; }
.sec-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.sec-check { display: flex; align-items: start; gap: 8px; font-size: 12.5px; line-height: 1.5; color: #d2dde8; }
.sec-check svg { flex: 0 0 auto; margin-top: 2px; padding: 2px; border-radius: 50%; width: 18px; height: 18px; }
.sec-check.ok svg { color: #142118; background: var(--green); }
.sec-check.fail svg { color: #2a1010; background: #ff8f86; }
.sec-check.fail { color: #ffd2cd; }
.sec-check span { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.sec-check small { color: var(--quiet); font-size: 11.5px; }
.sec-file { display: flex; align-items: center; gap: 7px; padding: 7px 9px; margin-top: 4px; border: 1px solid var(--line); border-radius: 5px; background: #0f1722; color: #c6d3e0; font-size: 11.5px; min-width: 0; }
.sec-file code { font: 11px var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.sec-file svg { flex: 0 0 auto; color: var(--green); }
.sec-file:hover { border-color: var(--green); }
.sec-inline-link { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }
.sec-table-wrap { overflow-x: auto; border: 1px solid var(--line-soft); border-radius: 6px; max-width: 100%; }
.sec-table { width: 100%; border-collapse: collapse; font-size: 12px; min-width: 520px; }
.sec-table th, .sec-table td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--line-soft); line-height: 1.5; }
.sec-table thead th { color: var(--quiet); font: 600 9.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; background: #0f1722; }
.sec-table tbody th { color: var(--ink); font-weight: 600; }
.sec-table td { color: #c4d0de; }
.sec-table tr:last-child > * { border-bottom: 0; }
.sec-table small { color: var(--quiet); font-weight: 400; }
.sec-keys td { text-align: center; }
.sec-yes { color: var(--green); display: inline-flex; }
.sec-no { color: #8395aa; display: inline-flex; }
.sec-dim { color: #5d6e80; }
.sec-flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; }
.sec-flow li { display: grid; gap: 4px; align-content: start; padding: 10px; border: 1px solid var(--line); border-radius: 7px; background: #131e2b; position: relative; min-width: 0; }
.sec-flow-n { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: #202d20; color: var(--green); font: 600 10px var(--mono); }
.sec-flow strong { font-size: 13px; }
.sec-flow code { font: 10.5px var(--mono); color: #d7e3ee; overflow-wrap: anywhere; }
.sec-flow small { color: var(--muted); font-size: 11.5px; line-height: 1.45; }
.sec-two { display: grid; grid-template-columns: minmax(0, 1fr) 160px; gap: 10px; }
.sec-status { font: 600 22px var(--mono); padding: 12px; border-radius: 6px; border: 1px solid var(--line); background: #0f1722; text-align: center; }
.sec-http-ok { color: var(--green); border-color: #4a6b34; }
.sec-http-fail { color: #ff8f86; border-color: #6b3434; }
.sec-status-row { display: flex; flex-wrap: wrap; gap: 7px; }
.sec-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 999px; background: #0f1722; color: #c4d0de; font: 11px var(--mono); }
.sec-pill svg { color: var(--green); }
.sec-pill.bad { border-color: #6b3434; color: #ffb3ab; }
.sec-pill.good { border-color: #4a6b34; color: var(--green); }
.sec-log { display: grid; gap: 8px; }
.sec-log-entry { padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: 6px; background: #0f1722; display: grid; gap: 7px; }
.sec-log-entry > p { color: #c4d0de; font-size: 12px; }
.sec-log-entry code { font: 11px var(--mono); color: #d7e3ee; }
.sec-msgs { display: grid; gap: 10px; }
.sec-msg { border: 1px solid var(--line); border-left: 3px solid #90bfe8; border-radius: 7px; background: #111b27; padding: 11px 12px; display: grid; gap: 8px; min-width: 0; animation: sec-in .25s ease-out; }
.sec-msg.failed { border-left-color: #ff8f86; }
.sec-msg header { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.sec-msg header strong { font-size: 13.5px; }
.sec-msg header span { color: var(--quiet); font: 11px var(--mono); }
@keyframes sec-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.sec-facts { margin: 0 0 12px; display: grid; gap: 1px; border: 1px solid var(--line-soft); border-radius: 6px; overflow: hidden; }
.sec-facts div { display: grid; grid-template-columns: 105px minmax(0, 1fr); gap: 8px; padding: 6px 9px; background: #0f1722; }
.sec-facts dt { color: var(--quiet); font: 10px var(--mono); letter-spacing: .04em; }
.sec-facts dd { margin: 0; color: #d2dde8; font-size: 11.5px; overflow-wrap: anywhere; }
.sec-questions { margin: 4px 0 12px; padding-left: 18px; display: grid; gap: 5px; color: #c4d0de; font-size: 12px; line-height: 1.5; }
@media (max-width: 790px) {
  .sec-topics { padding: 0 12px 12px; }
  .sec-body { padding: 14px 12px 16px; }
  .sec-two { grid-template-columns: 1fr; }
  .sec-field { max-width: none; }
}
@media (prefers-reduced-motion: reduce) { .sec-msg { animation: none; } }

/* ------------------------------------------------------------------ Cryptography view (crypto.js) */
.sec-field.wide { flex: 1 1 280px; max-width: 520px; }
.cr-bad { color: #ffb3ab; }
.cr-ok { color: #c2f77a; }
.cr-bitgrid { display: grid; grid-template-columns: repeat(32, minmax(0, 1fr)); gap: 2px; max-width: 520px; padding: 6px; border: 1px solid var(--line-soft); border-radius: 6px; background: #0b111a; }
.cr-bitgrid i { aspect-ratio: 1; border-radius: 2px; background: #1c2735; }
.cr-bitgrid i.on { background: #ffc983; }
.cr-bitgrid.lam i.one { background: #6f86a3; }
.cr-bitgrid.lam i.both { background: #ff8f86; }
.cr-key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: middle; }
.cr-key.one { background: #6f86a3; }
.cr-key.both { background: #ff8f86; }
.cr-key.pk { background: #90bfe8; }
.cr-key.sg { background: #c4aeff; }
.cr-drop { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px; border: 1px dashed #4a5b70; border-radius: 8px; background: #0f1722; color: #c4d0de; font-size: 13px; cursor: pointer; }
.cr-drop:hover { border-color: var(--green); }
.cr-drop svg { color: var(--green); }
.cr-drop input { font: 12px var(--mono); color: var(--muted); max-width: 100%; }
.cr-bars { display: grid; gap: 8px; }
.cr-bar-row { display: grid; grid-template-columns: minmax(150px, 220px) minmax(0, 1fr) minmax(0, 1fr); gap: 10px; align-items: center; font-size: 12px; color: #c4d0de; }
.cr-bar-track { position: relative; display: flex; align-items: center; gap: 6px; height: 18px; min-width: 0; }
.cr-bar { display: block; height: 12px; border-radius: 3px; flex: 0 0 auto; }
.cr-bar.pk { background: #90bfe8; }
.cr-bar.sg { background: #c4aeff; }
.cr-bar.sg.bad { background: #ff8f86; }
.cr-bar-track b { font: 500 10.5px var(--mono); color: var(--muted); white-space: nowrap; }
@media (max-width: 790px) {
  .cr-bar-row { grid-template-columns: 1fr; gap: 3px; }
  .cr-bitgrid { grid-template-columns: repeat(16, minmax(0, 1fr)); }
}

/* ------------------------------------------------------------------ UML catalogue links */
.uml-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 7px; border: 1px solid #3e4f66; border-radius: 4px; background: #131e2b; color: #90bfe8; font: 600 10px/1.3 var(--mono); letter-spacing: .04em; white-space: nowrap; }
.uml-chip:hover { border-color: #90bfe8; color: #c9e3f8; }
.uml-chip svg { flex: 0 0 auto; }
.sec-title-row .uml-chip { margin-left: auto; }
.uml-table td:nth-child(3), .uml-table td:nth-child(4) { white-space: nowrap; }
.uml-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 6px; padding: 6px 8px; margin-top: 3px; border: 1px solid var(--line-soft); border-radius: 5px; background: #0f1722; color: #c6d3e0; font-size: 11.5px; }
.uml-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uml-row code { color: #90bfe8; font: 10.5px var(--mono); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uml-row svg { color: #90bfe8; }
.uml-row:hover { border-color: #90bfe8; }

/* ------------------------------------------------------------------ ML & optimisation view (ml.js) */
.sec-dot.paper, .sec-chip.paper { --tone: #90bfe8; }
.ml-range { flex: 1 1 240px; }
.ml-range span b { color: var(--green); font-weight: 600; letter-spacing: 0; text-transform: none; margin-left: 6px; }
.ml-range input[type="range"] { padding: 0; min-height: 28px; accent-color: var(--green); background: transparent; border: 0; }
.ml-modules { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.ml-module { display: grid; gap: 3px; padding: 8px; border: 1px solid var(--line); border-radius: 7px; background: #131e2b; font-size: 12.5px; color: var(--ink); text-align: center; min-width: 0; overflow-wrap: anywhere; }
.ml-module b { font: 600 9px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--quiet); }
.ml-module.loose { border-color: #4f6f8f; background: #142334; }
.ml-module.loose b { color: #90bfe8; }
.ml-module.tight b { color: #ffc983; }
.ml-module.moved { box-shadow: 0 0 0 2px #c4aeff inset; }
.ml-terms { display: flex; gap: 3px; min-height: 34px; max-width: 640px; }
.ml-term { flex-basis: 0; min-width: 62px; display: grid; align-content: center; padding: 4px 7px; border-radius: 4px; font: 11px var(--mono); color: #0d141e; }
.ml-term b { font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }
.ml-term.latency { background: #90bfe8; } .ml-term.cost { background: #ffc983; } .ml-term.risk { background: #ff8f86; } .ml-term.switching { background: #c4aeff; }
.ml-chart, .ml-heat { width: 100%; max-width: 640px; height: auto; display: block; border: 1px solid var(--line-soft); border-radius: 6px; background: #0b111a; }
.ml-chart .grid { stroke: #1c2735; stroke-width: 1; }
.ml-chart .tick, .ml-heat .tick { fill: var(--quiet); font: 9.5px var(--mono); }
.ml-chart .axis, .ml-heat .axis { fill: var(--muted); font: 10px var(--mono); }
.ml-chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; }
.ml-chart .line.s0 { stroke: #a3b2c4; stroke-width: 1.4; }
.ml-chart .line.s1 { stroke: #ffc983; } .ml-chart .line.s2 { stroke: #c4aeff; } .ml-chart .line.s3 { stroke: var(--green); }
.ml-chart .ref, .ml-heat .ref { stroke-width: 1.2; stroke-dasharray: 4 4; }
.ml-chart .ref.bad { stroke: #ff8f86; } .ml-chart .ref.good { stroke: #90bfe8; } .ref.now { stroke: #edf3f9; }
.ml-chart .ref-label { font: 9.5px var(--mono); } .ml-chart .ref-label.bad { fill: #ff8f86; } .ml-chart .ref-label.good { fill: #90bfe8; }
.ml-chart circle.ok { fill: #6f86a3; } .ml-chart circle.flag { fill: #ff8f86; } .ml-chart circle.odd { stroke: #edf3f9; stroke-width: .6; }
.ml-heat rect.tight { fill: #3a3426; } .ml-heat rect.loose { fill: #90bfe8; }
.ml-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: 11.5px; }
.ml-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ml-swatch { width: 14px; height: 4px; border-radius: 2px; display: inline-block; }
.ml-swatch.s0 { background: #a3b2c4; } .ml-swatch.s1 { background: #ffc983; } .ml-swatch.s2 { background: #c4aeff; } .ml-swatch.s3 { background: var(--green); }
.ml-swatch.tight { background: #3a3426; height: 10px; } .ml-swatch.loose { background: #90bfe8; height: 10px; }
.ml-swatch.ok { background: #6f86a3; height: 8px; width: 8px; border-radius: 50%; } .ml-swatch.flag { background: #ff8f86; height: 8px; width: 8px; border-radius: 50%; }
.ml-swatch.odd { background: transparent; border: 1px solid #edf3f9; height: 9px; width: 9px; border-radius: 50%; }
.ml-qtable { display: flex; align-items: flex-end; gap: 3px; padding: 10px; border: 1px solid var(--line-soft); border-radius: 6px; background: #0b111a; max-width: 640px; overflow-x: auto; }
.ml-qtable span { display: grid; justify-items: center; gap: 2px; min-width: 22px; }
.ml-qtable b { width: 14px; border-radius: 2px 2px 0 0; background: var(--green); }
.ml-qtable small { color: #c4d0de; font: 9.5px var(--mono); }
.ml-qtable code { color: var(--quiet); font: 9.5px var(--mono); }
.ml-table td:nth-child(n+3) { font-family: var(--mono); font-size: 11.5px; }
.ml-abl { grid-template-columns: minmax(150px, 210px) minmax(0, 1fr) minmax(0, 1fr); }
.ml-abl small { color: var(--muted); font-size: 11px; }
@media (max-width: 790px) {
  .ml-modules { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------------------------------------------------------------- Data structures & algorithms view */
.dsa-bad { color: #ff8f86; font-weight: 600; }
.dsa-canvas { overflow-x: auto; border: 1px solid var(--line-soft); border-radius: 6px; background: #0b111a; padding: 6px; max-width: 100%; }
.dsa-canvas.small { max-width: 280px; }
.dsa-svg { display: block; width: 100%; height: auto; min-width: 0; }
.dsa-list { min-width: 520px; }
.dsa-floyd { max-width: 560px; min-width: 360px; }
.dsa-svg .dsa-node rect { fill: #152130; stroke: #4f6f8f; stroke-width: 1.2; }
.dsa-svg .dsa-node line { stroke: #2d4157; stroke-width: 1; }
.dsa-svg .dsa-node.sentinel rect { fill: #101823; stroke: #c4aeff; stroke-dasharray: 4 3; }
.dsa-svg .dsa-node.hot rect { stroke: var(--green); stroke-width: 2; fill: #1a2a1f; }
.dsa-svg .dsa-node.tomb rect { stroke: #ff8f86; stroke-dasharray: 3 3; fill: #1d1418; }
.dsa-svg .dsa-val { fill: var(--ink); font: 600 12px var(--mono); }
.dsa-svg .dsa-key { fill: var(--ink); font: 11px var(--mono); }
.dsa-svg .dsa-idx { fill: var(--quiet); font: 9.5px var(--mono); }
.dsa-svg .dsa-null { fill: var(--quiet); font: 12px var(--mono); }
.dsa-svg .dsa-note { fill: var(--quiet); font: 10px var(--mono); }
.dsa-svg .dsa-ptr { fill: var(--green); font: 600 10.5px var(--mono); }
.dsa-svg .dsa-ptr.dim { fill: var(--quiet); font-weight: 400; }
.dsa-svg .dsa-ptr.front { fill: var(--green); } .dsa-svg .dsa-ptr.back { fill: #ffc983; }
.dsa-svg .dsa-ptr.slow { fill: #c2f77a; } .dsa-svg .dsa-ptr.fast { fill: #ffc983; }
.dsa-svg .dsa-wrap-label { fill: #c2f77a; font: 9.5px var(--mono); } .dsa-svg .dsa-wrap-label.prev { fill: #ffc983; }
.dsa-svg .dsa-edge { stroke: #90bfe8; stroke-width: 1.5; fill: none; }
.dsa-svg .dsa-edge.prev, .dsa-svg .dsa-edge.back { stroke: #ffc983; }
.dsa-svg .dsa-edge.wrap, .dsa-svg .dsa-edge.ptr, .dsa-svg .dsa-edge.front { stroke: #c2f77a; }
.dsa-svg .dsa-edge.ptr { stroke-width: 1.2; }
.dsa-svg .dsa-orbit { fill: none; stroke: #1c2735; stroke-dasharray: 3 4; }
.dsa-svg .dsa-person circle { fill: #152130; stroke: #4f6f8f; stroke-width: 1.4; }
.dsa-svg .dsa-person text { fill: var(--ink); font: 600 11px var(--mono); }
.dsa-svg .dsa-person.out circle { fill: #0f1520; stroke: #33404f; stroke-dasharray: 3 3; } .dsa-svg .dsa-person.out text { fill: #55667a; }
.dsa-svg .dsa-person.prev circle { stroke: var(--green); stroke-width: 2.4; }
.dsa-svg .dsa-person.last circle { stroke: #ff8f86; stroke-width: 2.4; }
.dsa-svg .dsa-person.slow circle { stroke: #c2f77a; stroke-width: 2.4; } .dsa-svg .dsa-person.fast circle { fill: #2b2617; }
.dsa-svg .dsa-person.entry circle { stroke-dasharray: 2 2; }
.dsa-svg .dsa-out-n { fill: #ff8f86; font: 9.5px var(--mono); }
.dsa-svg .dsa-center { fill: var(--ink); font: 600 13px var(--mono); } .dsa-svg .dsa-center.dim { fill: var(--quiet); font: 10px var(--mono); }
.dsa-svg .dsa-cell { fill: #121b27; stroke: #2a3a4d; } .dsa-svg .dsa-cell.used { fill: #17283a; stroke: #4f6f8f; } .dsa-svg .dsa-cell.front { stroke: var(--green); stroke-width: 2; }
.dsa-svg .dsa-bucket rect { fill: #0f1722; stroke: #2a3a4d; }
.dsa-svg .dsa-tedge { stroke: #3b5168; stroke-width: 1.3; }
.dsa-svg .dsa-tnode circle, .dsa-svg .dsa-tnode rect { fill: #152130; stroke: #4f6f8f; stroke-width: 1.3; }
.dsa-svg .dsa-tnode text { fill: var(--ink); font: 600 10px var(--mono); }
.dsa-svg .dsa-tnode .dsa-idx { fill: var(--quiet); font: 8.5px var(--mono); }
.dsa-svg .dsa-tnode.hot circle, .dsa-svg .dsa-tnode.hot rect { stroke: var(--green); stroke-width: 2.2; }
.dsa-heap { min-width: 520px; }
.dsa-svg .dsa-gedge { stroke: #263547; stroke-width: 1.4; }
.dsa-svg .dsa-gedge.tree { stroke: #90bfe8; stroke-width: 2.2; }
.dsa-svg .dsa-gedge.path { stroke: var(--green); stroke-width: 3.4; }
.dsa-svg .dsa-gnode circle { fill: #152130; stroke: #4f6f8f; stroke-width: 1.4; }
.dsa-svg .dsa-gnode.front circle { stroke: #ffc983; stroke-width: 2; fill: #2b2617; }
.dsa-svg .dsa-gnode.done circle { fill: #90bfe8; stroke: #90bfe8; }
.dsa-svg .dsa-gnode.cur circle { fill: var(--green); stroke: var(--green); }
.dsa-svg .dsa-gnode.src circle { stroke: #edf3f9; stroke-width: 2.4; }
.dsa-svg .dsa-gnode.dst circle { stroke: #ff8f86; stroke-width: 2.4; }
.dsa-svg .dsa-gname { fill: #c4d0de; font: 10px Inter, "Segoe UI", system-ui, sans-serif; }
.dsa-svg .dsa-glabel { fill: #ffc983; font: 600 9.5px var(--mono); }
.dsa-svg .dsa-w { fill: #6f86a3; font: 8.5px var(--mono); }
.dsa-graph { min-width: 520px; }
.dsa-svg .dsa-bar rect { fill: #4f6f8f; } .dsa-svg .dsa-bar.cmp rect { fill: #ffc983; } .dsa-svg .dsa-bar.swap rect { fill: #ff8f86; } .dsa-svg .dsa-bar.done rect { fill: var(--green); }
.ml-swatch.cmp { background: #ffc983; height: 10px; } .ml-swatch.swap { background: #ff8f86; height: 10px; }
.dsa-two { display: grid; grid-template-columns: minmax(200px, 280px) minmax(0, 1fr); gap: 12px; align-items: start; }
.dsa-two.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dsa-two .sec-label { margin-bottom: 6px; }
.dsa-ops { margin: 0; }
.dsa-log { list-style: none; display: grid; gap: 4px; margin: 0; padding: 0; }
.dsa-log li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; padding: 6px 9px; border: 1px solid var(--line-soft); border-radius: 5px; background: #0f1722; font-size: 12px; color: #c4d0de; }
.dsa-log li:first-child { border-color: #3c5640; }
.dsa-log code { font: 11px var(--mono); color: var(--green); }
.dsa-log b { margin-left: auto; font: 600 10.5px var(--mono); color: #90bfe8; }
.dsa-link { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border: 1px solid var(--line); border-radius: 999px; background: #131e2b; color: #c4d0de; font-size: 11.5px; white-space: nowrap; }
.dsa-link:hover { border-color: var(--green); color: var(--ink); }
.dsa-link svg { color: var(--green); }
.dsa-hbars { display: grid; gap: 5px; max-width: 640px; }
.dsa-hbar { display: grid; grid-template-columns: minmax(150px, 190px) minmax(0, 1fr) 76px; gap: 8px; align-items: center; font-size: 12px; color: #c4d0de; }
.dsa-hbar i { display: block; height: 12px; border-radius: 3px; background: linear-gradient(90deg, #90bfe8, #c4aeff); }
.dsa-hbar b { font: 600 11px var(--mono); color: var(--ink); text-align: right; }
.dsa-cells { display: flex; flex-wrap: wrap; gap: 4px; }
.dsa-cells span { display: grid; justify-items: center; min-width: 32px; padding: 5px 4px; border: 1px solid var(--line); border-radius: 5px; background: #0f1722; }
.dsa-cells b { font: 600 13px var(--mono); color: var(--ink); } .dsa-cells small { font: 9px var(--mono); color: var(--quiet); }
.dsa-cells span.probe { border-color: #ffc983; } .dsa-cells span.hit { border-color: var(--green); background: #1a2a1f; }
.dsa-board { display: grid; grid-template-columns: repeat(var(--n), 1fr); width: min(100%, 260px); aspect-ratio: 1; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.dsa-board span { display: grid; place-items: center; background: #1b2735; color: var(--green); font-size: clamp(12px, 3vw, 20px); line-height: 1; }
.dsa-board span.dark { background: #111a25; }
.dsa-dp { min-width: 0; font-size: 11px; }
.dsa-dp td { font: 10.5px var(--mono); padding: 4px 5px; text-align: right; }
.dsa-dp th { white-space: nowrap; padding: 4px 6px; }
.dsa-dp tr.take th, .dsa-dp tr.take td { background: #18261a; color: var(--green); }
@media (max-width: 760px) {
  .dsa-two, .dsa-two.even { grid-template-columns: minmax(0, 1fr); }
  .dsa-canvas.small { max-width: none; }
  .dsa-canvas.small .dsa-svg { max-width: 300px; margin-inline: auto; }
  .dsa-hbar { grid-template-columns: minmax(110px, 130px) minmax(0, 1fr) 64px; font-size: 11px; }
}
.sec-note > .dsa-t, .sec-note > .ml-t { flex: 1 1 0; min-width: 0; }

/* Foundations topics (foundations.js): standalone units with what / why / how and live labs */
.fd-units { display: grid; gap: 10px; margin: 4px 0 14px; }
.fd-group > div { display: flex; flex-wrap: wrap; gap: 6px; }
.fd-group .sec-label { margin: 0 0 5px; }
.fd-units button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 6px; background: #131e2b; color: #c4d0de; font-size: 12px; text-align: left; }
.fd-units button b { font: 600 10.5px var(--mono); color: var(--muted); }
.fd-units button:hover { border-color: #6a7c8d; background: #162231; }
.fd-units button[aria-pressed="true"] { border-color: #779e51; background: #202d20; color: var(--ink); }
.fd-units button[aria-pressed="true"] b { color: var(--green); }
.fd-live { color: var(--green); font-style: normal; font-size: 8px; }
.fd-unit-card { padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px; background: #111a26; margin-bottom: 14px; }
.fd-unit-card h3 { color: var(--ink); font-size: 17px; margin: 0 0 10px; }
.fd-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.fd-steps, .fd-pitfalls { margin: 4px 0 10px 20px; color: #c4d0de; font-size: 13px; line-height: 1.6; max-width: 860px; }
.fd-steps li { margin-bottom: 4px; padding-left: 3px; }
.fd-pitfalls li::marker { color: #ff9f8f; }
.fd-mult { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 4px; margin: 8px 0 12px; }
.fd-mult span { display: flex; justify-content: space-between; gap: 6px; padding: 4px 7px; border: 1px solid var(--line-soft, #1f2a38); border-radius: 4px; font: 11px var(--mono); color: #d7e3ee; background: #0d141e; }
.fd-mult b { color: var(--green); font-weight: 600; }
.fd-link { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; text-decoration: underline; }
.sec-check-toggle { display: flex; align-items: center; gap: 7px; margin: 4px 0 10px; color: #c4d0de; font-size: 12.5px; }
.fd-unit-card > .sec-label { margin-top: 12px; }
