/* co-arising.github.io — page-specific layouts (explorer, dissolve, compare) */

/* ---------- home hero — the deep band ---------- */
.home-hero {
  position: relative;
  margin: 0 -20px;
  padding: 72px 20px 48px;
  border-bottom: 3px double var(--line-strong);
  background:
    repeating-linear-gradient(135deg, transparent 0 22px, rgba(92, 179, 161, .07) 22px 24px),
    linear-gradient(160deg, var(--hero-bg-1) 0%, var(--hero-bg-2) 58%, var(--hero-bg-3) 100%);
  color: var(--hero-ink-dim);
}
.home-hero .kicker { color: color-mix(in srgb, #5cb3a1 80%, #fff); }
.home-hero h1 { font-size: var(--fs-hero); font-weight: 800; letter-spacing: -.035em; line-height: 1.04; margin: 0 0 20px; max-width: 900px; color: var(--hero-ink); }
.home-hero h1 .accent { color: #ff9c7a; }
.home-hero .lede { font-size: clamp(17px, 2.1vw, 21px); color: var(--hero-ink-dim); max-width: 46em; margin: 0 0 22px; }
.home-hero .lede strong { color: var(--hero-ink); }
.home-hero .cta-row { margin-top: 26px; }
.home-hero .btn { background: var(--button-bg); border-color: #ff9c7a; color: var(--button-ink); }
.home-hero .btn.ghost { background: transparent; color: var(--hero-ink); border-color: var(--hero-line); }
.home-hero .btn.ghost:hover { background: rgba(243, 239, 228, .12); }
/* stat strip sits on the dark band — inverted cells */
.home-hero .stat-strip { background: rgba(243, 239, 228, .07); border-color: var(--hero-line); }
.home-hero .stat { border-right-color: var(--hero-line); }
.home-hero .stat .num { color: #8ed0b3; }
.home-hero .stat .lbl { color: var(--hero-ink-faint); }
.home-hero .stat .badge.verified { background: rgba(92, 179, 161, .25); color: #b8e3cf; }
/* terminal on the band */
.home-hero .term { box-shadow: 0 14px 40px rgba(0, 0, 0, .45), 0 0 0 1px rgba(140, 208, 186, .25); }

/* ---------- community artwork and invitation ---------- */
.community-grid { display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); align-items: center; gap: clamp(28px, 5vw, 72px); }
.community-art { margin: 0; width: 100%; max-width: 400px; }
.community-art img { display: block; width: 100%; height: auto; border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow); }
.community-art figcaption { margin-top: 10px; font-size: 12px; color: var(--ink-3); text-align: center; }
.community-copy h2 { margin-bottom: 18px; }
.community-copy p:not(.kicker) { max-width: 52ch; color: var(--ink-2); }
@media (max-width: 900px) {
  .community-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .community-art { justify-self: center; }
}

/* ---------- section rhythm: alternating bands + strong rules ---------- */
main.wrap > section { padding: 64px 0 10px; }
main.wrap > section + section::before {
  content: ""; display: block; height: 1px; margin: -28px 0 34px;
  background: linear-gradient(90deg, var(--line-strong), var(--line) 40%, transparent);
}
.sec-head { padding-top: 14px; border-top: 3px solid var(--ink); }

/* ---------- page hero (below injected site nav) — lighter version of the band ---------- */
.page-hero {
  position: relative;
  margin: 0 -20px 8px;
  padding: 56px 20px 30px;
  border-bottom: 3px double var(--line-strong);
  background:
    repeating-linear-gradient(135deg, transparent 0 22px, color-mix(in srgb, var(--teal) 4%, transparent) 22px 24px),
    linear-gradient(165deg, var(--bg-sink), var(--bg) 70%);
}

/* ---------- explorer page ---------- */
.xp-workbench-bar { display: contents; }
.xp-workbench-controls { display: none; }
.xp-view-tabs { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0 12px; }
.xp-view-tabs [aria-pressed="true"] { background: var(--teal-soft); border-color: var(--teal); color: var(--ink); }
#xp-snapshot-status { overflow-wrap: anywhere; }
#xp-advanced > section { padding: 10px 0; }
#code[hidden], #nodes[hidden], #xp-advanced[hidden] { display: none; }
.xp-identity { border-bottom: 1px solid var(--line); padding-bottom: 14px; margin-bottom: 14px; }
.xp-code-location { border: 1px solid var(--line); background: var(--bg-raised); color: var(--ink); text-align: left; padding: 8px; margin: 4px 0; width: 100%; font: inherit; overflow-wrap: anywhere; cursor: pointer; }
.xp-locations ul { padding-left: 14px; }

/* Code owns the viewport; Graph and reading pages keep their existing measure. */
body[data-explorer-view="code"] { height: 100vh; height: 100dvh; overflow: hidden; }
body[data-explorer-view="code"] main.wrap { max-width: none; width: 100%; margin: 0; padding: 0 20px 12px; height: calc(100vh - var(--nav-height, 78px)); height: calc(100dvh - var(--nav-height, 78px)); display: grid; grid-template-rows: auto minmax(0, 1fr); }
body[data-explorer-view="code"] .page-hero,
body[data-explorer-view="code"] #rebuild,
body[data-explorer-view="code"] #site-footer { display: none; }
body[data-explorer-view="code"] .xp-workbench-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px; min-height: 58px; padding: 7px 0; }
body[data-explorer-view="code"] .xp-view-tabs { margin: 0; gap: 4px; }
body[data-explorer-view="code"] #xp-tour { display: none; }
body[data-explorer-view="code"] .xp-workbench-controls { display: flex; gap: 4px; }
body[data-explorer-view="code"] .btn { min-height: 36px; padding: 6px 10px; font-size: 13px; white-space: nowrap; }
body[data-explorer-view="code"] .xp-workbench-controls [aria-expanded="true"],
body[data-explorer-view="code"] #xp-focus[aria-pressed="true"] { background: var(--teal-soft); border-color: var(--teal); }
body[data-explorer-view="code"] .xp-snapshot-details { margin: 0 0 0 auto; font-size: 12px; }
body[data-explorer-view="code"] .xp-snapshot-details > summary { padding: 7px 10px; }
body[data-explorer-view="code"] .xp-snapshot-details[open] { position: absolute; top: calc(var(--nav-height, 78px) + 8px); right: 20px; z-index: 25; width: min(460px, calc(100vw - 40px)); max-height: 60vh; overflow: auto; box-shadow: var(--shadow); }
body[data-explorer-view="code"] #code { min-height: 0; padding: 0; margin: 0; position: relative; }
body[data-explorer-view="code"] #code::before { display: none; }
body[data-explorer-view="code"] .xp-code-layout { position: relative; height: 100%; min-height: 0; display: grid; grid-template-columns: var(--xp-files-width, 270px) minmax(0, 1fr) 320px; gap: 12px; align-items: stretch; }
body[data-explorer-view="code"][data-files-open="false"] .xp-code-layout { grid-template-columns: minmax(0, 1fr) 320px; }
body[data-explorer-view="code"][data-knowledge-open="false"] .xp-code-layout { grid-template-columns: var(--xp-files-width, 270px) minmax(0, 1fr); }
body[data-explorer-view="code"][data-files-open="false"][data-knowledge-open="false"] .xp-code-layout { grid-template-columns: minmax(0, 1fr); }
body[data-explorer-view="code"] .xp-code-layout > * { min-width: 0; min-height: 0; }
body[data-explorer-view="code"] .xp-files-resizer { position: absolute; top: 0; bottom: 0; left: var(--xp-files-width, 270px); width: 12px; z-index: 5; cursor: col-resize; touch-action: none; border-radius: 3px; }
body[data-explorer-view="code"] .xp-files-resizer::after { content: ""; position: absolute; top: 0; bottom: 0; left: 5px; width: 2px; background: var(--line); }
body[data-explorer-view="code"] .xp-files-resizer:hover::after,
body[data-explorer-view="code"] .xp-files-resizer:focus-visible::after,
body[data-explorer-view="code"][data-resizing-files="true"] .xp-files-resizer::after { background: var(--teal); }
body[data-explorer-view="code"] .xp-files-resizer[hidden] { display: none; }
body[data-explorer-view="code"][data-resizing-files="true"] { cursor: col-resize; user-select: none; }
body[data-explorer-view="code"] .xp-panel { padding: 12px; border-radius: 6px; }
body[data-explorer-view="code"] .xp-panel[hidden] { display: none; }
body[data-explorer-view="code"] .xp-files-panel { display: grid; grid-template-rows: auto auto auto minmax(0, 1fr); }
body[data-explorer-view="code"] .xp-knowledge-panel { display: flex; flex-direction: column; }
body[data-explorer-view="code"] .xp-panel-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
body[data-explorer-view="code"] .xp-panel-title h2 { font-size: 15px; letter-spacing: 0; }
body[data-explorer-view="code"] .xp-panel-title button { min-width: 36px; font-size: 20px; padding: 0; }
body[data-explorer-view="code"] .xp-filters { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
body[data-explorer-view="code"] .xp-filters label { font-size: 12px; gap: 3px; }
body[data-explorer-view="code"] .xp-filters input,
body[data-explorer-view="code"] .xp-filters select { padding: 6px 8px; height: 34px; }
body[data-explorer-view="code"] .xp-tree-status { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; padding: 9px 0; gap: 6px; }
body[data-explorer-view="code"] .xp-tree-status .btn { font-size: 11px; min-height: 28px; padding: 3px 6px; }
body[data-explorer-view="code"] .xp-file-tree { min-height: 0; overflow: auto; font: 12px/1.6 var(--font-mono); overscroll-behavior: contain; }
body[data-explorer-view="code"] .xp-file-tree ul { list-style: none; padding-left: 12px; margin: 0; }
body[data-explorer-view="code"] .xp-file-tree > ul { padding: 0; }
body[data-explorer-view="code"] .xp-file-tree details { border: 0; margin: 0; padding: 0; background: transparent; }
body[data-explorer-view="code"] .xp-file-tree details > :not(summary) { margin: 0; }
body[data-explorer-view="code"] .xp-file-tree summary { display: flex; align-items: center; gap: 5px; padding: 5px 3px; min-width: 0; font-weight: 500; }
body[data-explorer-view="code"] .xp-file-tree summary::before { content: "▸"; flex: 0 0 10px; color: var(--ink-3); }
body[data-explorer-view="code"] .xp-file-tree details[open] > summary::before { content: "▾"; }
body[data-explorer-view="code"] .xp-file-tree summary::-webkit-details-marker { display: none; }
body[data-explorer-view="code"] .xp-file-link { display: flex; align-items: center; gap: 5px; padding: 5px 6px; min-width: 0; min-height: 30px; border: 0; border-radius: 4px; color: var(--ink-2); }
body[data-explorer-view="code"] .xp-file-link:hover { background: var(--bg-sink); }
body[data-explorer-view="code"] .xp-file-link[aria-current="true"] { background: var(--teal-soft); color: var(--ink); box-shadow: inset 3px 0 var(--teal); }
body[data-explorer-view="code"] .xp-tree-label { display: block; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
body[data-explorer-view="code"] .xp-tree-withheld { font-size: 10px; color: var(--ink-3); flex: none; }
body[data-explorer-view="code"] .xp-code-main { display: grid; min-height: 0; grid-template-rows: auto auto auto minmax(0, 1fr) auto; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--bg-raised); }
body[data-explorer-view="code"] .xp-file-header { min-width: 0; padding: 8px 14px 4px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: baseline; gap: 4px 12px; }
body[data-explorer-view="code"] .xp-code-quality-notice { grid-column: 1 / -1; margin: 0; padding: 3px 8px; border-left: 3px solid var(--amber); background: var(--amber-soft); color: var(--ink-2); font-size: 12px; line-height: 18px; overflow-wrap: anywhere; }
body[data-explorer-view="code"] .xp-code-quality-notice strong { color: var(--ink); }
body[data-explorer-view="code"] #xp-code-heading { font: 600 15px/22px var(--font-mono); margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body[data-explorer-view="code"] #xp-code-path { font: 11px/18px var(--font-mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 2px 0 0; }
body[data-explorer-view="code"] .xp-file-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 4px 14px 8px; font-size: 12px; position: relative; }
body[data-explorer-view="code"] .xp-find-label { display: flex; align-items: center; gap: 8px; flex: 1 1 230px; min-width: 0; white-space: nowrap; color: var(--ink-3); }
body[data-explorer-view="code"] #xp-code-find { width: 100%; min-width: 0; max-width: 360px; height: 32px; border: 1px solid var(--line-strong); border-radius: 4px; background: var(--bg); color: var(--ink); padding: 4px 8px; }
body[data-explorer-view="code"] #xp-file-details { margin: 0; font-size: 12px; }
body[data-explorer-view="code"] #xp-file-details > summary { padding: 5px 8px; }
body[data-explorer-view="code"] #xp-file-details[open] { position: absolute; top: 4px; right: 12px; z-index: 10; width: min(500px, calc(100% - 24px)); max-height: 50vh; overflow: auto; box-shadow: var(--shadow); }
body[data-explorer-view="code"] #xp-file-evidence { font: 12px/1.6 var(--font-mono); overflow-wrap: anywhere; }
body[data-explorer-view="code"] #xp-file-evidence dt { color: var(--ink-3); margin-top: 8px; }
body[data-explorer-view="code"] #xp-file-evidence dd { margin: 0; }
body[data-explorer-view="code"] #xp-code-find-result { margin: 0; padding: 0 14px; max-height: 64px; overflow: auto; overflow-wrap: anywhere; font-size: 12px; }
body[data-explorer-view="code"] #xp-code-viewer { min-height: 0; max-height: none; overflow: auto; background: var(--bg); border-top: 1px solid var(--line); overscroll-behavior: contain; position: relative; }
body[data-explorer-view="code"] .xp-source-lines { min-width: 100%; width: max-content; padding: 8px 0; }
body[data-explorer-view="code"] .xp-source-line { display: flex; min-height: 24px; font: 14px/24px var(--font-mono); }
body[data-explorer-view="code"] .xp-source-line.selected { background: var(--teal-soft); box-shadow: inset 3px 0 var(--teal); }
body[data-explorer-view="code"] .xp-source-line code { white-space: pre; font: inherit; background: transparent; padding: 0 16px 0 10px; }
body[data-explorer-view="code"] .xp-line-number { display: block; flex: 0 0 52px; width: 52px; padding: 0 8px; text-align: right; position: sticky; left: 0; border: 0; border-right: 1px solid var(--line); background: var(--bg-raised); color: var(--ink-3); }
body[data-explorer-view="code"] .xp-source-status { border-top: 1px solid var(--line); padding: 6px 12px; display: flex; flex-wrap: wrap; gap: 3px 10px; }
body[data-explorer-view="code"] .xp-source-status p { margin: 0; font-size: 11px; overflow-wrap: anywhere; }
body[data-explorer-view="code"] #xp-code-knowledge { overflow: auto; min-height: 0; overscroll-behavior: contain; font-size: 13px; overflow-wrap: anywhere; }
body[data-explorer-view="code"] #xp-code-knowledge > h3 { display: none; }
body[data-explorer-view="code"] #xp-code-knowledge h4 { font: 600 14px/1.4 var(--font-sans); text-transform: none; letter-spacing: 0; color: var(--ink); margin: 8px 0; }
body[data-explorer-view="code"] #xp-code-knowledge h5 { margin: 12px 0 4px; }
body[data-explorer-view="code"] #xp-code-knowledge details { margin: 8px 0; }
body[data-explorer-view="code"] #xp-code-knowledge details > summary { padding: 8px; font-size: 12px; }
body[data-explorer-view="code"] #xp-code-knowledge details > :not(summary) { margin-left: 8px; margin-right: 8px; }
body[data-explorer-view="code"] #xp-code-knowledge ul { padding-left: 16px; }
body[data-explorer-view="code"] .xp-short-path { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body[data-explorer-view="code"] .xp-pointer-hint { display: block; color: var(--ink-3); font: 11px/1.5 var(--font-mono); overflow-wrap: anywhere; }
@media (max-width: 1439px) {
  body[data-explorer-view="code"] .xp-code-layout,
  body[data-explorer-view="code"][data-knowledge-open="false"] .xp-code-layout { grid-template-columns: var(--xp-files-width, 270px) minmax(0, 1fr); }
  body[data-explorer-view="code"][data-files-open="false"] .xp-code-layout { grid-template-columns: minmax(0, 1fr); }
  body[data-explorer-view="code"] .xp-knowledge-panel { position: absolute; right: 0; top: 0; bottom: 0; width: min(360px, 100%); z-index: 20; box-shadow: var(--shadow); }
}
@media (max-width: 899px) {
  body[data-explorer-view="code"] main.wrap { padding: 0 8px 8px; }
  body[data-explorer-view="code"] .xp-code-layout,
  body[data-explorer-view="code"][data-knowledge-open="false"] .xp-code-layout { grid-template-columns: minmax(0, 1fr); }
  body[data-explorer-view="code"] .xp-files-panel { position: absolute; left: 0; top: 0; bottom: 0; width: min(320px, 100%); z-index: 20; box-shadow: var(--shadow); }
  body[data-explorer-view="code"] .xp-workbench-bar { gap: 4px 8px; min-height: 52px; }
  body[data-explorer-view="code"] .xp-workbench-bar .btn { font-size: 12px; padding: 5px 8px; min-height: 40px; }
  body[data-explorer-view="code"] .xp-snapshot-details { margin-left: 0; }
  body[data-explorer-view="code"] .xp-file-header { grid-template-columns: minmax(0, 1fr); }
  body[data-explorer-view="code"] .xp-file-tools { gap: 4px 8px; }
  body[data-explorer-view="code"] .xp-find-label { flex-basis: 100%; }
  body[data-explorer-view="code"] .xp-file-link, body[data-explorer-view="code"] .xp-file-tree summary { min-height: 36px; }
}
.xp-layout { display: grid; grid-template-columns: 280px 1fr; gap: 18px; margin-top: 22px; }
@media (max-width: 900px) { .xp-layout { grid-template-columns: 1fr; } }
.xp-side { display: flex; flex-direction: column; gap: 12px; }
.xp-panel { background: var(--bg-raised); border: 1px solid var(--line); padding: 16px 18px; }
.xp-panel h4 { margin: 0 0 10px; font-size: 13px; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }
.xp-query-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.xp-query-list button {
  text-align: left; width: 100%; border: 1px solid var(--line); background: var(--bg);
  color: var(--ink); font-size: 13px; padding: 9px 11px; border-radius: 7px; cursor: pointer;
}
.xp-query-list button:hover { border-color: var(--teal); }
.xp-query-list button.active { border-color: var(--red); background: var(--red-soft); color: var(--red-ink); font-weight: 600; }
.xp-status { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-3); line-height: 1.7; word-break: break-all; }
.xp-main { min-width: 0; }
.xp-result { background: var(--bg-raised); border: 1px solid var(--line); padding: 18px 20px; }
.xp-result h3 { margin-top: 0; }
.xp-result .answer { font-size: 13.5px; color: var(--ink-2); }
.xp-table-wrap { overflow-x: auto; margin-top: 10px; }
.xp-table-wrap table { font-size: 12.5px; }
.xp-table-wrap td, .xp-table-wrap th { padding: 8px 10px; }
.xp-sql { width: 100%; min-height: 110px; font-family: var(--font-mono); font-size: 12.5px; background: var(--bg-sink); color: var(--ink); border: 1px solid var(--line); padding: 12px; border-radius: 8px; resize: vertical; }
.xp-sql:focus { outline: 2px solid color-mix(in srgb, var(--teal) 45%, transparent); }
.xp-actions { display: flex; gap: 8px; align-items: center; margin: 10px 0; flex-wrap: wrap; }
.xp-actions button, .xp-actions .btn { font-size: 13px; padding: 8px 14px; margin: 0; }
.xp-radial { margin-top: 14px; }
.xp-radial svg { width: 100%; height: auto; display: block; }

/* ---------- dissolve demo (why-co-arising) ---------- */
.dissolve-stage { background: var(--bg-raised); border: 1px solid var(--line-strong); border-radius: 12px; padding: 10px; margin: 22px 0; box-shadow: var(--shadow); }
.dissolve-svg { width: 100%; height: auto; display: block; }
.dissolve-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 10px 4px; }
.dissolve-controls .mode { font-family: var(--font-mono); font-size: 12px; font-weight: 600; }
.dissolve-controls button { border: 1px solid var(--line-strong); background: var(--bg); color: var(--ink); font-size: 12.5px; padding: 7px 12px; border-radius: 7px; cursor: pointer; }
.dissolve-controls button:hover { border-color: var(--red); color: var(--red); }
.dissolve-caption { padding: 8px 12px 10px; font-size: 14px; color: var(--ink-2); min-height: 48px; }
.dissolve-caption strong { color: var(--ink); }
.dissolve-caption em { color: var(--red); font-style: normal; font-weight: 600; }
.dv-node { cursor: pointer; }
.dv-node text { font-family: var(--font-mono); font-size: 11px; pointer-events: none; }
.dv-edge { stroke: var(--line-strong); stroke-width: 2.5; transition: opacity .2s ease; }
#dz-svg .dv-edge { cursor: pointer; pointer-events: stroke; }
.dz-edge-list { display: grid; gap: 8px; padding: 12px; }
.dz-edge-list label { display: flex; align-items: flex-start; gap: 10px; padding: 8px; background: var(--bg-sink); overflow-wrap: anywhere; }
.dz-edge-list input { flex: none; width: 20px; height: 20px; }
.dz-edge-list small { display: block; font-family: var(--font-mono); color: var(--ink-2); }
.dz-coverage-list { display: flex; flex-wrap: wrap; gap: 8px 26px; padding-left: 24px; }
.dissolve-stage > p, .dissolve-stage > details { padding: 8px 12px; }
.xp-status { white-space: pre-line; }
.xp-table-wrap td { max-width: 28rem; overflow-wrap: anywhere; }
button:disabled { opacity: .6; cursor: not-allowed; }
.dv-edge.removed { opacity: .12; stroke-dasharray: 4 4; }
.dv-edge.dimmed { opacity: .3; }

/* ---------- compare two-column versus ---------- */
.versus { display: grid; grid-template-columns: 1fr 60px 1fr; gap: 0; align-items: stretch; margin: 24px 0; }
.versus .side { background: var(--bg-raised); border: 1px solid var(--line); padding: 20px 22px; }
.versus .mid { display: grid; place-items: center; font-family: var(--font-mono); font-weight: 600; color: var(--ink-3); }
@media (max-width: 760px) { .versus { grid-template-columns: 1fr; } .versus .mid { height: 44px; } }

/* ---------- bank projections figure grid ---------- */
.proj-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); margin: 18px 0; }
.proj { background: var(--bg-raised); border: 1px solid var(--line); padding: 14px 16px; }
.proj h4 { margin: 0 0 4px; font-size: 15px; }
.proj p { font-size: 12.5px; color: var(--ink-3); margin: 0 0 10px; }
.proj figure { margin: 0; overflow-x: auto; background: var(--bg-sink); border: 1px solid var(--line); padding: 10px; }
.proj svg { width: 100%; height: auto; }
.proj svg .node rect, .proj svg .node polygon, .proj svg .node circle { fill: var(--bg-raised); }
@media (max-width: 760px) { .proj-grid { grid-template-columns: 1fr; } }

/* ---------- guide step list ---------- */
.steps { counter-reset: step; display: grid; gap: 10px; margin: 18px 0; }
.step-item { counter-increment: step; background: var(--bg-raised); border: 1px solid var(--line); padding: 16px 20px; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 14px; box-shadow: var(--shadow); }
.step-item::before { content: counter(step, decimal-leading-zero); font-family: var(--font-mono); font-size: 20px; font-weight: 600; color: var(--teal); }
.step-item h4 { margin: 0 0 6px; font-size: 16px; }
.step-item code { overflow-wrap: break-word; word-break: break-all; }
.step-item .meta { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); margin-bottom: 8px; }

/* ---------- guided reading: one question, then evidence ---------- */
.home-intro { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; gap: 36px; }
.home-intro h1 { font-size: clamp(34px, 4.5vw, 56px); line-height: 1.12; }
.home-intro .lede { font-size: 18px; line-height: 1.7; }
.causal-preview { background: var(--bg-raised); color: var(--ink-2); border-top: 4px solid var(--teal); border-radius: 10px; }
.causal-preview h2 { color: var(--ink); font-size: 24px; margin: 12px 0 18px; }
.causal-preview ol { padding-left: 22px; margin: 0 0 18px; font-size: 14.5px; }
.causal-preview li + li { margin-top: 12px; }
.causal-preview strong { color: var(--ink); }
.causal-preview .evidence-note { font-size: 13px; color: var(--ink-3); }
.page-outline { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 0; font-size: 14px; }
.prose { max-width: 70ch; margin: 20px 0; }
.evidence-note { font-size: 13.5px; color: var(--ink-2); line-height: 1.75; }
.next-step { margin: 28px 0 8px; padding: 18px 20px; border-left: 4px solid var(--teal); background: var(--teal-soft); color: var(--ink-2); }
.next-step strong { display: block; color: var(--ink); margin-bottom: 5px; }
.reader-paths .card { border-radius: 8px; transition: border-color .15s ease; }
.reader-paths a.card:hover { border-color: var(--teal); }
.scenario-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.scenario-card { padding: 22px; border: 1px solid var(--line); border-top: 3px solid var(--teal); background: var(--bg-raised); border-radius: 8px; }
.scenario-card h3 { margin: 10px 0 14px; }
.scenario-card p, .scenario-card li { font-size: 14.5px; }
.scenario-card ul, .scenario-card ol { padding-left: 22px; }
.scenario-card .foot { padding-top: 14px; border-top: 1px solid var(--line); margin-top: 18px; }
main details { margin: 18px 0; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-raised); }
main details > summary { cursor: pointer; padding: 14px 18px; font-weight: 600; color: var(--ink); }
main details > :not(summary) { margin-left: 18px; margin-right: 18px; }
main details[open] { padding-bottom: 12px; }
@media (max-width: 900px) {
  .home-intro { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .home-hero { padding-top: 44px; }
}
@media (max-width: 640px) {
  .scenario-grid { grid-template-columns: minmax(0, 1fr); }
  .home-intro h1 { font-size: 35px; }
  .causal-preview { padding: 18px; }
  main.wrap > section { padding-top: 48px; }
}

/* ---------- real graph directory and inspector ---------- */
.xp-directory { margin-top: 20px; }
.xp-filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; margin: 18px 0; }
.xp-filters label { display: grid; gap: 6px; min-width: 0; font-size: 13.5px; color: var(--ink-2); flex: 1 1 200px; }
.xp-filters input, .xp-filters select { width: 100%; min-width: 0; font: inherit; color: var(--ink); background: var(--bg-raised); padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 6px; }
.xp-filters button, .xp-node-pagination button, .xp-node-edges button { color: var(--ink-2); background: var(--bg-raised); border: 1px solid var(--line-strong); border-radius: 6px; padding: 10px 12px; font: inherit; cursor: pointer; }
.xp-node-layout { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 20px; align-items: start; }
.xp-node-list { display: grid; gap: 6px; list-style: none; padding: 0; margin: 0; max-height: 620px; overflow-y: auto; scrollbar-gutter: stable; }
.xp-node-button { display: block; width: 100%; text-align: left; padding: 12px 14px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: var(--bg-raised); cursor: pointer; overflow-wrap: anywhere; }
.xp-node-button:hover { border-color: var(--teal); }
.xp-node-button[aria-pressed="true"] { border-color: var(--teal); background: var(--teal-soft); box-shadow: inset 3px 0 var(--teal); }
.xp-node-name { display: block; font-weight: 600; font-size: 14px; }
.xp-node-kind { display: inline-block; font: 11.5px var(--font-mono); color: var(--ink-3); margin: 4px 0; }
.xp-node-id { display: block; font: 12px var(--font-mono); color: var(--ink-2); overflow-wrap: anywhere; }
.xp-node-detail { min-width: 0; padding: 20px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--bg-raised); overflow-wrap: anywhere; }
.xp-node-detail h3 { margin-top: 0; font-size: 20px; }
.xp-node-detail h4 { margin: 22px 0 10px; }
.xp-node-fields { display: grid; grid-template-columns: minmax(80px, auto) minmax(0, 1fr); gap: 8px 12px; font-size: 13.5px; }
.xp-node-fields dt { color: var(--ink-3); }
.xp-node-fields dd { margin: 0; }
.xp-node-share { display: inline-block; margin: 8px 0 16px; font-size: 13px; }
.xp-node-anchors { padding: 12px 14px; background: var(--amber-soft); border-left: 3px solid var(--amber); font-size: 13.5px; }
.xp-node-edges { padding-left: 0; list-style: none; display: grid; gap: 8px; }
.xp-node-edges li { display: grid; gap: 4px; min-width: 0; }
.xp-node-edges button { width: 100%; text-align: left; font-size: 12.5px; overflow-wrap: anywhere; }
.xp-node-relation { font: 11.5px var(--font-mono); color: var(--ink-3); }
.xp-node-atom { max-height: 320px; overflow: auto; font: 12px/1.65 var(--font-mono); padding: 12px; background: var(--bg-sink); white-space: pre-wrap; overflow-wrap: anywhere; }
.xp-node-pagination { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 14px 0; font-size: 13px; }
.xp-empty { color: var(--ink-2); padding: 20px; border: 1px dashed var(--line-strong); border-radius: 6px; }
@media (max-width: 820px) {
  .xp-node-layout { grid-template-columns: minmax(0, 1fr); }
  .xp-node-list { max-height: 400px; }
  .xp-node-detail { padding: 16px; }
}
