:root {
  --bg: #ffffff;
  --bg-2: #f5f5f2;
  --text: #1a1b19;
  --muted: #6a6c66;
  --faint: #9a9c95;
  --line: #e8e8e3;
  --line-2: #d2d2ca;
  --accent: #17604d;
  --accent-soft: #e3efe9;
  --warn: #9a5b13;
  --ext: #8a8c85;
  --code-bg: #f6f6f3;
  --kw: #7b2f8f;
  --str: #2f6b1f;
  --num: #a2481b;
  --com: #8b8d86;
  --fn: #1c4fa0;

  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "JetBrains Mono", "SF Mono", "Cascadia Code", Menlo, Consolas, "Liberation Mono", monospace;
  --side-w: 288px;
  --top-h: 52px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
code, pre, .mono { font-family: var(--mono); font-size: 0.86em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  height: var(--top-h);
  display: flex; align-items: center; gap: 20px;
  padding: 0 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.brand-name { font-weight: 650; letter-spacing: -0.01em; white-space: nowrap; }
.brand-sub { color: var(--muted); font-size: 13px; }

.branch {
  display: flex; align-items: center; gap: 6px;
  padding: 0 4px 0 10px; height: 32px;
  border: 1px solid var(--line-2); border-radius: 6px;
  color: var(--muted);
}
.branch select {
  appearance: none; border: 0; background: transparent; color: var(--text);
  font: 13px var(--mono); padding: 0 22px 0 2px; height: 30px; max-width: 260px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 11px) 13px, calc(100% - 7px) 13px;
  background-size: 4px 4px; background-repeat: no-repeat;
  cursor: pointer; outline: none;
}
.branch:focus-within { border-color: var(--accent); }
.branch select option { background: var(--bg); color: var(--text); }

.commit {
  flex: 1; min-width: 0;
  display: flex; align-items: baseline; gap: 10px;
  color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden;
}
.commit .sha { font-family: var(--mono); color: var(--text); }
.commit .msg { overflow: hidden; text-overflow: ellipsis; }

.live { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.live .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.live.busy .dot { animation: pulse 0.9s ease-in-out infinite; }
.live.error .dot { background: var(--warn); }
@keyframes pulse { 50% { opacity: 0.25; } }

.icon-btn { display: none; background: none; border: 0; color: var(--text); padding: 6px; cursor: pointer; }

/* ---------- layout ---------- */
.layout { display: flex; min-height: calc(100vh - var(--top-h)); }
.side {
  position: sticky; top: var(--top-h);
  width: var(--side-w); flex: none;
  height: calc(100vh - var(--top-h));
  overflow-y: auto;
  border-right: 1px solid var(--line);
  padding: 14px 0 40px;
  font-size: 14px;
}
main { flex: 1; min-width: 0; outline: none; }

.search { padding: 0 14px 10px; }
.search input {
  width: 100%; height: 32px; padding: 0 10px;
  border: 1px solid var(--line-2); border-radius: 6px;
  background: var(--bg); color: var(--text); font: 13px var(--sans);
  outline: none;
}
.search input:focus { border-color: var(--accent); }

.side-links { display: flex; flex-direction: column; padding: 4px 8px 12px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.side-links a, .tree a {
  display: block; padding: 3px 10px; border-radius: 5px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.side-links a:hover, .tree a:hover { color: var(--text); background: var(--bg-2); }
.side-links a.active, .tree a.active { color: var(--accent); background: var(--accent-soft); }

.tree { padding: 0 8px; }
.tree .pkg { margin: 12px 0 2px; padding: 0 10px; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); }
.tree .mod { font-family: var(--mono); font-size: 12.5px; color: var(--text); }
.tree .cls { font-family: var(--mono); font-size: 12.5px; padding-left: 24px; }
.tree .fn { font-family: var(--mono); font-size: 12.5px; padding-left: 24px; color: var(--faint); }
.tree .hit small { color: var(--faint); margin-left: 6px; font-family: var(--sans); }
.tree .empty { padding: 6px 10px; color: var(--faint); }

/* ---------- content ---------- */
.page { max-width: 900px; padding: 36px 48px 120px; }
.page.wide { max-width: none; }
.state { padding: 60px 48px; color: var(--muted); }
.state.error { color: var(--warn); white-space: pre-wrap; font-family: var(--mono); font-size: 13px; }

.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 6px; font-family: var(--mono); }
.crumbs a:hover { color: var(--accent); }
.crumbs .sep { color: var(--faint); margin: 0 4px; }

h1 { font-size: 28px; line-height: 1.25; margin: 0 0 6px; letter-spacing: -0.02em; font-weight: 650; }
h1 code { font-size: 0.92em; font-weight: 600; letter-spacing: -0.01em; }
h1 .kind { font-family: var(--sans); font-weight: 400; color: var(--faint); font-size: 0.62em; margin-right: 10px; letter-spacing: 0; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); font-weight: 600; margin: 44px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
h3 { font-size: 16px; margin: 0; font-weight: 600; }

.meta { display: flex; flex-wrap: wrap; gap: 4px 18px; color: var(--muted); font-size: 13px; margin: 8px 0 22px; }
.meta a { color: var(--accent); }
.meta a:hover { text-decoration: underline; }

.lead { font-size: 17px; line-height: 1.55; margin: 18px 0 10px; }
.doc p { margin: 0 0 12px; }
.doc code, .lead code, td code, .member-doc code { background: var(--code-bg); padding: 1px 5px; border-radius: 4px; }
.nodoc { color: var(--faint); font-style: italic; font-size: 14px; }

.doc-section { margin: 18px 0 0; }
.doc-section > .t { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.doc-section dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 4px 18px; }
.doc-section dt { font-family: var(--mono); font-size: 13px; color: var(--accent); padding-top: 1px; }
.doc-section dt .type { color: var(--muted); }
.doc-section dd { margin: 0; }
.doc-section pre { margin: 0; }

.sig {
  font-family: var(--mono); font-size: 13.5px; line-height: 1.7;
  background: var(--code-bg); border-radius: 6px; padding: 12px 16px;
  overflow-x: auto; white-space: pre;
}
.sig .k { color: var(--kw); }
.sig .n { color: var(--fn); font-weight: 600; }
.sig .p { color: var(--text); }
.sig .a { color: var(--muted); }
.sig .d { color: var(--num); }
.sig a { color: var(--accent); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); text-underline-offset: 2px; }
.sig a.ext { color: var(--muted); text-decoration: none; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-family: var(--mono); font-size: 12.5px;
  padding: 2px 8px; border-radius: 5px;
  border: 1px solid var(--line-2); color: var(--text);
}
a.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.ext { color: var(--muted); border-style: dashed; }

.badge { display: inline-block; font-size: 11px; padding: 0 6px; border-radius: 4px; line-height: 18px; vertical-align: 2px; margin-left: 6px; font-family: var(--sans); font-weight: 500; }
.badge.over { background: var(--accent-soft); color: var(--accent); }
.badge.deco { background: var(--bg-2); color: var(--muted); font-family: var(--mono); }
.badge.warn { color: var(--warn); border: 1px solid currentColor; }

/* tables */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 6px 12px 6px 0; border-bottom: 1px solid var(--line); }
td { padding: 8px 12px 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
td.name { font-family: var(--mono); font-size: 13px; white-space: nowrap; }
td.name a { color: var(--accent); }
td.name a:hover { text-decoration: underline; }
td .sub { color: var(--muted); font-size: 13px; }
td.val { font-family: var(--mono); font-size: 12.5px; color: var(--muted); max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* members */
.member { padding: 26px 0; border-bottom: 1px solid var(--line); scroll-margin-top: calc(var(--top-h) + 16px); }
.member:first-of-type { padding-top: 6px; }
.member-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.member-head h3 { font-family: var(--mono); font-size: 15px; }
.member-head h3 a:hover { color: var(--accent); }
.member-head .line { margin-left: auto; font-size: 12px; color: var(--faint); font-family: var(--mono); white-space: nowrap; }
.member-head .line:hover { color: var(--accent); }
.member-doc { margin-top: 12px; }
.inherited-doc { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.inherited-doc a { color: var(--accent); }

details.src { margin-top: 14px; }
details.src summary { cursor: pointer; font-size: 13px; color: var(--muted); list-style: none; user-select: none; display: inline-flex; gap: 6px; align-items: center; }
details.src summary::-webkit-details-marker { display: none; }
details.src summary::before { content: ""; width: 0; height: 0; border-left: 4px solid currentColor; border-top: 4px solid transparent; border-bottom: 4px solid transparent; transition: transform 0.12s; }
details.src[open] summary::before { transform: rotate(90deg); }
details.src summary:hover { color: var(--text); }

pre.code {
  margin: 10px 0 0; padding: 12px 0; border-radius: 6px; background: var(--code-bg);
  font-size: 12.5px; line-height: 1.6; overflow-x: auto; counter-reset: ln;
}
pre.code .l { display: block; padding: 0 16px 0 0; white-space: pre; }
pre.code .l::before {
  content: attr(data-n); display: inline-block; width: 3.6em; padding-right: 1.2em; margin-right: 4px;
  text-align: right; color: var(--faint); user-select: none;
}
.t-k { color: var(--kw); } .t-s { color: var(--str); } .t-n { color: var(--num); } .t-c { color: var(--com); font-style: italic; } .t-f { color: var(--fn); } .t-d { color: var(--warn); }

.index-list { columns: 2; column-gap: 32px; font-family: var(--mono); font-size: 13px; margin: 0; padding: 0; list-style: none; }
.index-list li { break-inside: avoid; padding: 2px 0; }
.index-list a:hover { color: var(--accent); }
.index-list .inh { color: var(--muted); }

.inh-group { margin: 14px 0; }
.inh-group .from { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.inh-group .from a { color: var(--accent); font-family: var(--mono); }

/* stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: 8px; margin: 26px 0 8px; }
.stat { padding: 14px 18px; border-left: 1px solid var(--line); }
.stat:first-child { border-left: 0; }
.stat .v { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat .k { font-size: 12px; color: var(--muted); }
.bar { height: 3px; background: var(--line); border-radius: 2px; margin-top: 8px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--accent); }

.modlist { display: grid; grid-template-columns: 1fr; }
.modrow { display: grid; grid-template-columns: 260px 1fr; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.modrow:hover .mname { color: var(--accent); }
.modrow .mname { font-family: var(--mono); font-size: 13.5px; }
.modrow .mdesc { color: var(--muted); font-size: 14px; }
.modrow .mdesc .cls { font-family: var(--mono); font-size: 12.5px; color: var(--faint); display: block; margin-top: 2px; }

/* ---------- graph ---------- */
.graph-wrap { position: relative; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--bg); }
.graph-wrap.full { height: calc(100vh - var(--top-h) - 150px); min-height: 420px; }
.graph-wrap.inline { height: 440px; }
.graph-wrap svg { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.graph-wrap svg.dragging { cursor: grabbing; }
.graph-tools { position: absolute; right: 10px; top: 10px; display: flex; gap: 4px; }
.graph-tools button {
  width: 28px; height: 28px; border: 1px solid var(--line-2); background: var(--bg); color: var(--muted);
  border-radius: 5px; cursor: pointer; font: 14px var(--sans); display: grid; place-items: center;
}
.graph-tools button:hover { color: var(--text); border-color: var(--muted); }
.graph-legend { position: absolute; left: 12px; bottom: 10px; display: flex; gap: 16px; font-size: 12px; color: var(--muted); background: color-mix(in srgb, var(--bg) 85%, transparent); padding: 4px 8px; border-radius: 5px; }
.graph-legend span { display: inline-flex; align-items: center; gap: 6px; }
.graph-legend i { display: inline-block; width: 14px; height: 10px; border: 1px solid var(--text); border-radius: 2px; }
.graph-legend i.e { border-style: dashed; border-color: var(--ext); }

.g-node rect { fill: var(--bg); stroke: var(--line-2); stroke-width: 1; }
.g-node text { font-family: var(--mono); font-size: 12.5px; fill: var(--text); }
.g-node text.sub { font-family: var(--sans); font-size: 10.5px; fill: var(--faint); }
.g-node.int { cursor: pointer; }
.g-node.int:hover rect, .g-node.hl rect { stroke: var(--accent); }
.g-node.cur rect { stroke: var(--accent); stroke-width: 1.5; fill: var(--accent-soft); }
.g-node.ext rect { stroke: var(--ext); stroke-dasharray: 3 3; fill: transparent; }
.g-node.ext text { fill: var(--muted); }
.g-edge { fill: none; stroke: var(--line-2); stroke-width: 1.2; }
.g-edge.hl { stroke: var(--accent); }
.g-arrow { fill: var(--bg); stroke: var(--line-2); stroke-width: 1.2; }
.g-arrow-dep { fill: var(--line-2); }
svg.dim .g-node:not(.hl):not(.cur) { opacity: 0.35; }
svg.dim .g-edge:not(.hl) { opacity: 0.2; }
.g-cluster-label { font-family: var(--sans); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; fill: var(--faint); }

.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 6px; overflow: hidden; margin-bottom: 14px; }
.seg a { padding: 4px 12px; font-size: 13px; color: var(--muted); }
.seg a + a { border-left: 1px solid var(--line-2); }
.seg a.on { background: var(--bg-2); color: var(--text); }

.toast {
  position: fixed; bottom: 18px; right: 18px; z-index: 50;
  background: var(--text); color: var(--bg); font-size: 13px;
  padding: 9px 14px; border-radius: 6px; max-width: 420px;
  opacity: 0; transform: translateY(6px); pointer-events: none; transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: none; }

/* ---------- small screens ---------- */
@media (max-width: 900px) {
  .icon-btn { display: block; }
  .brand-sub, .commit .msg, .live-text { display: none; }
  .side { position: fixed; left: 0; z-index: 30; background: var(--bg); transform: translateX(-100%); transition: transform 0.18s; }
  body.nav-open .side { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,0.25); }
  .page { padding: 24px 20px 80px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .modrow { grid-template-columns: 1fr; gap: 2px; }
  .index-list { columns: 1; }
  .top { gap: 10px; padding: 0 12px; }
  .branch select { max-width: 150px; }
}

/* ================= v2: compact layout, UML graph ================= */
.side { background: #fafaf8; }
.tree .mod { font-family: var(--sans); font-size: 13.5px; color: var(--text); margin-top: 2px; }
.tree .cls { padding-left: 22px; color: var(--muted); }
.tree .hit { font-family: var(--mono); font-size: 12.5px; color: var(--text); }
.tree .hit small { color: var(--faint); margin-left: 6px; font-family: var(--sans); }

.page { max-width: 860px; padding: 32px 48px 120px; }
.page.wide { max-width: 1280px; }
.narrow { max-width: 860px; }
.head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.head-row .meta { margin: 4px 0 0; }
.btn { font-size: 13px; padding: 5px 12px; border: 1px solid var(--line-2); border-radius: 6px; color: var(--text); white-space: nowrap; }
.btn:hover { border-color: var(--accent); color: var(--accent); }
.cov { display: inline-flex; align-items: center; gap: 8px; }
.cov .bar { width: 60px; margin: 0; display: inline-block; }

.crumbs { font-family: var(--mono); font-size: 12.5px; }
.crumbs .gl { color: var(--faint); margin-left: 8px; font-family: var(--sans); }
.crumbs .gl:hover { color: var(--accent); }
h1 { font-size: 26px; }
h1 code { font-size: 1em; background: none; padding: 0; }
.lead { font-size: 16.5px; margin: 14px 0 8px; }
h2 { display: flex; align-items: baseline; gap: 10px; margin-top: 36px; }
h2 .count { color: var(--faint); font-weight: 500; }
button.link { margin-left: auto; background: none; border: 0; color: var(--accent); font: 500 12px var(--sans); text-transform: none; letter-spacing: 0; cursor: pointer; padding: 0; }
button.link:hover { text-decoration: underline; }

.lineage { font-family: var(--mono); font-size: 13px; color: var(--muted); margin-top: 6px; }
.lineage a { color: var(--accent); }
.lineage a:hover { text-decoration: underline; }
.lineage b { color: var(--text); font-weight: 600; }
.lineage .arrow { color: var(--faint); margin: 0 7px; }
.lineage .ext { color: var(--faint); }
.lineage .also { margin-left: 12px; font-family: var(--sans); font-size: 12.5px; }
.lineage .subs { font-family: var(--sans); font-size: 13px; margin-top: 3px; }
.lineage .subs a { font-family: var(--mono); font-size: 12.5px; }

table.list td { padding: 7px 14px 7px 0; }
table.list td.name { width: 1%; }
table.list td.type { font-family: var(--mono); font-size: 12.5px; color: var(--muted); white-space: nowrap; width: 1%; }
table.list td.type a { color: var(--accent); }
table.list tr.grp td { padding-top: 20px; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); border-bottom: 1px solid var(--line); }
table.list .sub.mono { font-family: var(--mono); font-size: 12px; margin-top: 2px; }
table.list .sub.mono a { color: var(--muted); }
table.list .sub.mono a:hover { color: var(--accent); }

dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 22px 0 0; font-size: 14px; align-items: baseline; }
dl.facts dt { color: var(--muted); font-size: 13px; }
dl.facts dd { margin: 0; }

/* collapsible member rows */
.rows { border-top: 1px solid var(--line); }
details.row { border-bottom: 1px solid var(--line); scroll-margin-top: calc(var(--top-h) + 12px); }
details.row > summary {
  list-style: none; cursor: pointer;
  display: grid; grid-template-columns: minmax(200px, 300px) 1fr auto; gap: 16px; align-items: baseline;
  padding: 8px 6px 8px 18px; position: relative;
}
details.row > summary::-webkit-details-marker { display: none; }
details.row > summary::before {
  content: ""; position: absolute; left: 4px; top: 15px;
  border-left: 4px solid var(--faint); border-top: 4px solid transparent; border-bottom: 4px solid transparent;
  transition: transform 0.12s;
}
details.row[open] > summary::before { transform: rotate(90deg); }
details.row > summary:hover { background: var(--bg-2); }
.rname { font-family: var(--mono); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rname b { font-weight: 600; color: var(--text); }
.rparams, .rret { color: var(--faint); }
.rdesc { font-size: 14px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
details.row[open] .rdesc { white-space: normal; color: var(--text); }
.rbadges { white-space: nowrap; }
.rbadges .badge { margin-left: 4px; }
.row-body { padding: 4px 6px 18px 18px; }
.row-body .doc { margin-top: 10px; }
.row-foot { margin: 12px 0 0; font-size: 12px; font-family: var(--mono); }
.row-foot a { color: var(--faint); }
.row-foot a:hover { color: var(--accent); }
.row-body pre.code { margin-top: 6px; max-height: 420px; overflow: auto; }

.inh { font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--line); line-height: 1.8; }
.inh .from { color: var(--muted); margin-right: 8px; }
.inh .from a { color: var(--accent); font-family: var(--mono); }
.inh a.mono { font-family: var(--mono); font-size: 12.5px; }
.inh a.mono:hover { color: var(--accent); }

/* graph v2 */
.graph-wrap { background: #fcfcfb; background-image: radial-gradient(#e6e6e0 1px, transparent 1px); background-size: 18px 18px; }
.graph-tools button.txt { width: auto; padding: 0 10px; font-size: 12px; }
.graph-tools button.txt.on { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.g-node rect { fill: #fff; stroke: #c9c9c0; }
.g-node text.name { font-family: var(--mono); font-size: 13px; font-weight: 600; fill: var(--text); }
.g-node text.sub { font-family: var(--sans); font-size: 10.5px; fill: var(--faint); }
.g-node text.item { font-family: var(--mono); font-size: 11.5px; fill: #44463f; }
.g-node text.item.meth { fill: #2f5f9e; }
.g-node text.more { font-family: var(--sans); font-size: 11px; fill: var(--faint); font-style: italic; }
.g-node line.sep { stroke: #e2e2da; }
.g-node.cur rect { fill: #f2f8f5; }
.g-node.ext rect { fill: #fcfcfb; }
.g-link { fill: none; stroke: #b9a27a; stroke-width: 1.1; stroke-dasharray: 4 3; }
.g-link.hl { stroke: #8a6a2f; stroke-width: 1.5; }
.g-arrow-open { fill: none; stroke: #b9a27a; stroke-width: 1.2; }
.g-link-label { font-family: var(--mono); font-size: 10.5px; fill: #9a8357; paint-order: stroke; stroke: #fcfcfb; stroke-width: 4px; }
.g-link-label.hl { fill: #6b5020; }
svg.dim .g-link:not(.hl), svg.dim .g-link-label:not(.hl) { opacity: 0.15; }
.graph-legend { background: rgba(255,255,255,0.92); border: 1px solid var(--line); }
.graph-legend .lg-tri { font-weight: 400; color: var(--muted); font-size: 11px; }
.graph-legend .lg-dash { display: inline-block; width: 18px; border-top: 1.5px dashed #b9a27a; }
.graph-wrap.full { height: calc(100vh - var(--top-h) - 110px); }

@media (max-width: 900px) {
  details.row > summary { grid-template-columns: 1fr; gap: 2px; }
  .rbadges { display: none; }
}

/* graph bar above the canvas */
.graph-wrap { display: flex; flex-direction: column; }
.graph-wrap svg { flex: 1; min-height: 0; }
.graph-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 10px 7px 14px; border-bottom: 1px solid var(--line); background: #fff; flex: none; }
.graph-bar .graph-tools { position: static; display: flex; gap: 4px; align-items: center; }
.graph-bar .graph-tools .gap { width: 8px; }
.graph-bar .graph-legend { position: static; background: none; border: 0; padding: 0; }

.run-btn { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 14px; border-radius: 6px; background: var(--accent); color: #fff; font-size: 13px; font-weight: 500; white-space: nowrap; }
.run-btn:hover { background: #124d3e; }
