:root {
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "PingFang SC",
    sans-serif;
  color: #24332f;
  background: #f5f7f6;
  font-synthesis: none;
  --bg: #f5f7f6;
  --panel: #fff;
  --soft: #f2f5f3;
  --line: #e3e9e6;
  --text: #24332f;
  --muted: #77837e;
  --accent: #24785a;
  --active: #eaf4ee;
  --shadow: 0 10px 35px #1e44300c;
  --node: #fff;
  --edge: #b9c8c0;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  overflow: hidden;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  outline-offset: 4px;
}
button {
  color: inherit;
  cursor: pointer;
}
button {
  border: 0;
  background: transparent;
}
button:hover {
  background: var(--soft);
}
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
}
a {
  color: var(--accent);
  text-decoration: none;
}
svg {
  display: block;
}
button svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}
h1,
h2,
h3,
p {
  margin: 0;
}
small {
  font-size: 11px;
}
button:disabled {
  opacity: 0.35;
  cursor: default;
}
button:disabled:hover {
  background: transparent;
}
code {
  font:
    11px ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
  overflow-wrap: anywhere;
}
kbd {
  font: 10px inherit;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px 5px;
  color: var(--muted);
}
.app-header {
  height: 66px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 25px;
  gap: 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  letter-spacing: -0.6px;
  font-weight: 700;
  white-space: nowrap;
}
.brand-mark {
  display: grid;
  grid-template-columns: repeat(2, 7px);
  gap: 3px;
  padding: 10px;
  background: var(--accent);
  border-radius: 9px;
  transform: rotate(-4deg);
}
.brand-mark i {
  width: 7px;
  height: 7px;
  background: white;
  border-radius: 1px;
}
.brand-mark i:last-child {
  opacity: 0.45;
}
.header-divider {
  height: 24px;
  width: 1px;
  background: var(--line);
}
.project-name {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.project-name b {
  font-weight: 550;
}
.badge {
  font-size: 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 3px 6px;
  color: var(--muted);
  white-space: nowrap;
}
.spacer {
  flex: 1;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 12px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: var(--panel);
  white-space: nowrap;
}
.btn.primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.btn.primary:hover {
  filter: brightness(1.1);
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
}
.workspace {
  display: grid;
  grid-template-columns: 234px minmax(300px, 1fr) 326px;
  height: calc(100dvh - 96px);
}
.sidebar {
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: auto;
}
.sidebar-top {
  padding: 22px 18px 15px;
}
.eyebrow {
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 1.5px;
  color: var(--muted);
  text-transform: uppercase;
}
.project-card {
  margin-top: 12px;
  border: 1px solid var(--line);
  padding: 12px;
  border-radius: 8px;
}
.project-card strong {
  display: block;
  font-size: 12px;
  margin-bottom: 5px;
}
.project-card p {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.5;
}
.project-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #52a879;
  margin-right: 5px;
}
.search-wrap {
  position: relative;
  margin: 0 14px 18px;
  display: flex;
  align-items: center;
}
.search-wrap > svg {
  position: absolute;
  left: 10px;
  width: 14px;
  color: var(--muted);
}
.search-wrap input {
  width: 100%;
  height: 34px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 30px;
  font-size: 11px;
  color: var(--text);
}
.search-wrap kbd {
  position: absolute;
  right: 8px;
}
.nav-heading {
  display: flex;
  align-items: center;
  padding: 0 19px;
  margin-bottom: 8px;
  gap: 6px;
}
.nav-heading span:last-child {
  margin-left: auto;
  font-size: 10px;
  color: var(--muted);
}
.tree {
  padding: 0 10px 15px;
}
.tree-row {
  display: flex;
  align-items: center;
  min-height: 32px;
  border-radius: 5px;
  margin: 2px 0;
  gap: 4px;
}
.tree-row.active {
  background: var(--active);
  color: var(--accent);
}
.tree-row .tree-select {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  text-align: left;
  font-size: 11px;
  min-width: 0;
  padding: 7px 3px;
  border-radius: 4px;
}
.tree-select span.name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tree-select small {
  margin-left: auto;
  color: var(--muted);
  font-size: 9px;
  padding-right: 5px;
}
.tree-row .caret {
  width: 20px;
  flex-shrink: 0;
  padding: 4px;
  display: flex;
}
.caret svg {
  width: 12px;
  height: 12px;
}
.dot {
  height: 7px;
  width: 7px;
  border-radius: 2px;
  background: var(--tone, var(--accent));
  flex-shrink: 0;
}
.tree-children {
  margin-left: 11px;
  border-left: 1px solid var(--line);
  padding-left: 5px;
}
.tree-leaf .tree-select {
  font-size: 10px;
}
.tree-leaf .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}
.sidebar-section {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
.flow-button {
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  width: calc(100% - 22px);
  margin: 3px 11px;
  padding: 9px 10px;
  border-radius: 6px;
  font-size: 11px;
}
.flow-button svg {
  width: 14px;
  height: 14px;
  color: var(--muted);
}
.flow-button.active {
  background: var(--active);
  color: var(--accent);
}
.navigation-hint, .guide-footnote {
  margin: 0 18px 12px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}
#tree-content .tree { max-height: 24vh; overflow: auto; scrollbar-width: thin; }
.sidebar:has(.guide-navigation) .sidebar-top { padding: 14px 14px 10px; }
.sidebar:has(.guide-navigation) .project-card { margin-top: 8px; padding: 9px; }
.sidebar:has(.guide-navigation) .search-wrap { margin-bottom: 10px; }
.tree-row.in-guide { box-shadow: inset 2px 0 var(--accent); }
.tree-row.in-guide .name { color: var(--accent); }
.guide-tree-count {
  margin-left: auto;
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--active);
  color: var(--accent);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}
.guide-range { display: flex; gap: 4px; margin: 0 12px 12px; }
.guide-range button {
  flex: 1;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 10px;
}
.guide-range button[aria-pressed="true"] { background: var(--active); color: var(--accent); border-color: var(--accent); }
.guide-range small { margin-left: 5px; opacity: .7; }
.guide-scope-label { display: flex; gap: 6px; margin: 0 15px 10px; font-size: 10px; color: var(--muted); }
.guide-scope-label svg { width: 13px; height: 13px; flex-shrink: 0; }
.guide-card-list { padding: 0 11px; }
.guide-category-label { display: flex; justify-content: space-between; padding: 8px 4px; color: var(--muted); font-size: 10px; }
.guide-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  padding: 12px;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
  text-align: left;
}
.guide-card:hover, .guide-card:focus-visible { background: var(--soft); border-color: var(--accent); }
.guide-card.active { background: var(--active); border-color: var(--accent); }
.guide-card-purpose { display: flex; align-items: center; gap: 5px; color: var(--accent); font-size: 10px; width: 100%; }
.guide-card-purpose svg { width: 12px; height: 12px; }
.guide-current { margin-left: auto; font-size: 9px; }
.guide-card strong { font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.guide-card-context { font-size: 10px; line-height: 1.5; color: var(--muted); overflow-wrap: anywhere; }
.guide-card-counts { display: flex; align-items: center; gap: 5px; width: 100%; color: var(--muted); font-size: 9px; }
.guide-card-counts svg { margin-left: auto; width: 12px; height: 12px; }
.guide-footnote { margin-top: 10px; }
.guide-story { padding: 10px 20px; background: var(--active); border-bottom: 1px solid var(--line); }
.guide-story-context { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 8px; }
.guide-story-context > span { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 11px; min-width: 0; }
.guide-story-context > span svg { width: 14px; height: 14px; color: var(--accent); }
.guide-story-context b, .guide-story-context small { overflow-wrap: anywhere; }
.guide-story-context small { color: var(--muted); }
.guide-story-actions { display: flex; gap: 6px; margin-left: auto; }
.guide-story-actions .btn { padding: 6px 8px; font-size: 10px; min-height: 32px; }
.guide-reader { display: flex; align-items: center; gap: 7px; }
.guide-reader label { font-size: 10px; white-space: nowrap; }
.guide-reader label span { color: var(--muted); margin-left: 4px; }
.guide-reader select { flex: 1; width: 0; min-width: 70px; padding: 7px; border: 1px solid var(--line); border-radius: 5px; color: var(--text); background: var(--panel); font-size: 11px; }
.guide-reader-count { white-space: nowrap; color: var(--muted); font-size: 10px; }
.guide-reading-note { margin: 5px 0 0; font-size: 9px; color: var(--muted); }
@media (max-width: 750px) {
  .guide-story { padding: 8px 12px; }
  .guide-reader-count { display: none; }
  .guide-story-actions { margin-left: 0; }
  .guide-story-actions .btn, .guide-reader .icon-btn, .guide-reader select, .guide-range button { min-height: 44px; }
}
.sidebar-bottom {
  margin-top: auto;
  padding: 20px 17px 15px;
  font-size: 10px;
  line-height: 1.6;
  color: var(--muted);
}
.sidebar-bottom a {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}
.sidebar-bottom svg {
  width: 12px;
  height: 12px;
}
.main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}
.canvas-header {
  background: var(--panel);
  padding: 20px 27px 15px;
  border-bottom: 1px solid var(--line);
}
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 15px;
  flex-wrap: wrap;
}
.breadcrumbs button {
  padding: 2px 0;
}
.breadcrumbs svg {
  width: 10px;
  height: 10px;
}
.page-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.page-title h1 {
  font-size: 22px;
  letter-spacing: -0.7px;
  font-weight: 650;
}
.live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2d9562;
}
.subtitle {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.7;
}
.canvas-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  min-height: 56px;
}
.segmented {
  display: flex;
  padding: 3px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 7px;
  gap: 2px;
}
.segmented button {
  padding: 6px 9px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  white-space: nowrap;
}
.segmented button svg {
  width: 13px;
  height: 13px;
}
.segmented button.active {
  background: var(--panel);
  box-shadow: 0 1px 4px #20342812;
  color: var(--accent);
}
.toolbar-select {
  font-size: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: var(--panel);
  padding: 7px;
  max-width: 130px;
}
.toolbar-label {
  font-size: 10px;
  color: var(--muted);
}
.canvas {
  flex: 1;
  position: relative;
  overflow: hidden;
  background-image: radial-gradient(var(--edge) 0.65px, transparent 0.65px);
  background-size: 19px 19px;
  touch-action: none;
  cursor: grab;
  min-height: 180px;
}
.canvas.dragging {
  cursor: grabbing;
}
.canvas-world {
  position: absolute;
  transform-origin: 0 0;
  top: 0;
  left: 0;
}
.edges {
  position: absolute;
  overflow: visible;
  pointer-events: none;
  left: 0;
  top: 0;
}
.edge {
  fill: none;
  stroke: var(--edge);
  stroke-width: 1.4;
}
.edge.emphasis {
  stroke: var(--accent);
  stroke-width: 2.3;
}
.edge.muted {
  opacity: 0.15;
}
.edge-label {
  font-size: 9px;
  fill: var(--muted);
  paint-order: stroke;
  stroke: var(--bg);
  stroke-width: 5px;
  stroke-linejoin: round;
}
.group-boundary {
  position: absolute;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: color-mix(in srgb, var(--panel) 65%, transparent);
  pointer-events: none;
}
.boundary-title {
  position: absolute;
  top: 12px;
  left: 15px;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.4px;
  pointer-events: auto;
}
.boundary-title:hover {
  color: var(--accent);
}
.boundary-title svg {
  height: 12px;
  width: 12px;
}
.graph-node {
  position: absolute;
  border: 1px solid var(--line);
  background: var(--node);
  border-radius: 9px;
  box-shadow: 0 3px 10px #263e2c05;
  padding: 15px;
  text-align: left;
  cursor: pointer;
  transition:
    box-shadow 0.15s,
    border-color 0.15s,
    opacity 0.15s;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}
.graph-node:hover {
  border-color: var(--tone);
  box-shadow: 0 5px 17px #1e443012;
  transform: translateY(-1px);
}
.graph-node.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 10%, transparent);
}
.graph-node.dimmed {
  opacity: 0.28;
}
.node-top {
  display: flex;
  align-items: center;
  gap: 8px;
}
.node-icon {
  height: 28px;
  width: 28px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: var(--tone);
  background: color-mix(in srgb, var(--tone) 9%, var(--panel));
}
.node-icon svg {
  width: 15px;
  height: 15px;
}
.node-label {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: -0.15px;
  line-height: 1.3;
}
.node-kind {
  font-size: 8px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 3px;
}
.node-description {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.node-footer {
  display: flex;
  align-items: center;
  font-size: 8px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 9px;
  margin-top: auto;
  gap: 6px;
}
.node-footer span:last-child {
  margin-left: auto;
}
.node-footer svg {
  height: 10px;
  width: 10px;
}
.node-port {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--tone);
  border: 1px solid var(--panel);
  top: 50%;
}
.port-in {
  left: -3px;
}
.port-out {
  right: -3px;
}
.canvas-note {
  position: absolute;
  top: 16px;
  left: 20px;
  display: flex;
  gap: 6px;
  font-size: 10px;
  color: var(--muted);
  padding: 7px 9px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 5px;
  max-width: 85%;
  pointer-events: none;
}
.canvas-note svg {
  height: 12px;
  width: 12px;
  flex-shrink: 0;
}
.canvas-controls {
  position: absolute;
  bottom: 20px;
  left: 20px;
  display: flex;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 3px;
  box-shadow: var(--shadow);
}
.canvas-controls span {
  min-width: 40px;
  text-align: center;
  font-size: 10px;
  color: var(--muted);
}
.minimap {
  position: absolute;
  right: 20px;
  bottom: 20px;
  width: 145px;
  height: 93px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.minimap svg {
  width: 100%;
  height: 100%;
}
.canvas-legend {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 10px 24px;
  background: var(--panel);
  border-top: 1px solid var(--line);
  font-size: 9px;
  color: var(--muted);
  min-height: 35px;
}
.canvas-legend span {
  display: flex;
  align-items: center;
  gap: 5px;
}
.legend-line {
  width: 16px;
  border-top: 1px solid var(--edge);
}
.legend-line.accent {
  border-color: var(--accent);
}
.inspector {
  background: var(--panel);
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.inspector-top {
  padding: 20px 20px 0;
}
.inspector-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.inspector-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.inspector-title .node-icon {
  width: 36px;
  height: 36px;
}
.inspector-title h2 {
  font-size: 17px;
  letter-spacing: -0.5px;
  line-height: 1.3;
}
.inspector-title p {
  font-size: 10px;
  color: var(--muted);
  margin-top: 5px;
}
.inspect-actions {
  display: flex;
  gap: 6px;
  margin: 17px 0;
}
.inspect-actions .btn {
  font-size: 10px;
  flex: 1;
  padding: 7px 5px;
}
.inspect-actions svg {
  width: 13px;
  height: 13px;
}
.inspector-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  padding: 0 15px;
}
.inspector-tabs button {
  padding: 11px 9px;
  font-size: 10px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
}
.inspector-tabs button.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.inspector-content {
  padding: 20px;
  overflow: auto;
  flex: 1;
}
.section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 650;
  margin-bottom: 10px;
}
.section-label span {
  font-weight: 400;
  letter-spacing: 0;
}
.detail-text {
  font-size: 11px;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 20px;
  white-space: pre-line;
}
.file-path {
  background: var(--soft);
  border: 1px solid var(--line);
  padding: 11px;
  border-radius: 6px;
  line-height: 1.65;
  margin-bottom: 7px;
  color: var(--text);
}
.micro {
  font-size: 9px;
  line-height: 1.6;
  color: var(--muted);
}
.stats-row {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 7px;
  margin: 20px 0;
}
.stat {
  padding: 12px 6px;
  text-align: center;
  flex: 1;
}
.stat + .stat {
  border-left: 1px solid var(--line);
}
.stat b {
  display: block;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}
.stat span {
  font-size: 9px;
  color: var(--muted);
}
.function {
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-bottom: 8px;
  background: var(--panel);
  overflow: hidden;
}
.function summary {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px;
  cursor: pointer;
  font:
    10px ui-monospace,
    monospace;
  overflow-wrap: anywhere;
  line-height: 1.6;
}
.function summary::before {
  content: "ƒ";
  color: var(--accent);
  font-style: italic;
  font-weight: 700;
}
.function[open] summary {
  background: var(--soft);
  border-bottom: 1px solid var(--line);
}
.function-body {
  padding: 11px;
  font-size: 10px;
  line-height: 1.8;
}
.function-body .io {
  padding: 7px 0;
  border-top: 1px solid var(--line);
  margin-top: 7px;
}
.io b {
  display: block;
  font-size: 8px;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 3px;
}
.connection {
  padding: 11px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  margin-bottom: 7px;
  font-size: 11px;
}
.connection span {
  min-width: 0;
}
.connection small {
  font-size: 9px;
  color: var(--muted);
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
}
.connection svg {
  height: 13px;
  width: 13px;
  flex-shrink: 0;
  margin-left: auto;
  color: var(--muted);
}
.connection-type {
  font-size: 8px !important;
  padding: 3px 5px;
  background: var(--soft);
  border-radius: 4px;
  margin-left: auto;
  color: var(--muted);
}
.evidence-card {
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
}
.evidence-card pre {
  font:
    10px/1.65 ui-monospace,
    monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 250px;
  overflow: auto;
  color: var(--text);
  padding-top: 9px;
  border-top: 1px solid var(--line);
}
.evidence-card small {
  display: block;
  font-size: 9px;
  color: var(--muted);
  margin: 6px 0;
}
.evidence-card button {
  font-size: 10px;
  color: var(--accent);
  padding: 4px 0;
}
.empty-state {
  padding: 25px 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.8;
}
.inspector-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 9px;
  color: var(--muted);
}
.inspector-footer svg {
  width: 12px;
  height: 12px;
}
.statusbar {
  height: 30px;
  display: flex;
  align-items: center;
  padding: 0 18px;
  gap: 18px;
  background: var(--panel);
  border-top: 1px solid var(--line);
  font-size: 9px;
  color: var(--muted);
}
.statusbar span {
  display: flex;
  align-items: center;
  gap: 5px;
}
.statusbar svg {
  height: 11px;
  width: 11px;
}
.statusbar .spacer {
  margin: 0;
}
.story-strip {
  padding: 12px 22px;
  background: var(--active);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
}
.story-strip strong {
  font-size: 11px;
}
.story-strip p {
  font-size: 9px;
  line-height: 1.5;
  color: var(--muted);
}
.story-progress {
  display: flex;
  gap: 4px;
}
.story-progress button {
  height: 5px;
  width: 20px;
  background: var(--line);
  padding: 0;
  border-radius: 2px;
}
.story-progress button.active {
  background: var(--accent);
}
#peek {
  position: fixed;
  width: 282px;
  padding: 16px;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: 0 14px 40px #152e2520;
  z-index: 50;
  pointer-events: none;
}
#peek h3 {
  font-size: 13px;
  margin-bottom: 7px;
}
#peek p {
  font-size: 11px;
  line-height: 1.6;
  margin-bottom: 8px;
  color: var(--muted);
}
#peek code {
  font-size: 10px;
}
#peek .peek-counts {
  display: flex;
  gap: 12px;
  font-size: 9px;
  padding-top: 10px;
  margin-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--accent);
}
#toast {
  position: fixed;
  left: 50%;
  bottom: 52px;
  transform: translate(-50%, 15px);
  background: var(--text);
  color: var(--panel);
  font-size: 12px;
  line-height: 1.6;
  padding: 11px 18px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: 0.2s;
  z-index: 100;
  max-width: 85vw;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
dialog {
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 0;
  width: min(760px, 90vw);
  max-height: 85vh;
  box-shadow: 0 25px 100px #0c221e33;
}
dialog::backdrop {
  background: #162b2340;
  backdrop-filter: blur(3px);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}
.modal-header h2 {
  font-size: 18px;
}
.modal-content {
  padding: 24px;
  overflow: auto;
}
.modal-content label {
  display: block;
  font-size: 11px;
  margin-bottom: 10px;
}
.modal-content input,
.modal-content select {
  width: 100%;
  padding: 11px;
  background: var(--soft);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 6px;
  margin: 6px 0 16px;
}
.modal-content p {
  font-size: 12px;
  line-height: 1.8;
  color: var(--muted);
  margin-bottom: 18px;
}
.modal-content pre {
  white-space: pre-wrap;
  font:
    11px/1.9 ui-monospace,
    monospace;
  overflow-wrap: anywhere;
  max-height: 58vh;
  overflow: auto;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 15px;
}
.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.compare-grid h3 {
  font-size: 15px;
  margin-bottom: 10px;
}
.compare-grid p {
  font-size: 11px;
}
.compare-grid ul {
  font-size: 11px;
  padding-left: 15px;
  line-height: 1.9;
}
.export-option {
  display: flex;
  align-items: center;
  gap: 15px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  width: 100%;
  margin-bottom: 10px;
}
.export-option svg {
  width: 22px;
  height: 22px;
  color: var(--accent);
}
.export-option b {
  font-size: 12px;
  display: block;
  margin-bottom: 4px;
}
.export-option small {
  font-size: 10px;
  color: var(--muted);
}
.bookmark {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 5px 12px;
  font-size: 10px;
}
.bookmark .saved-load {
  flex: 1;
  text-align: left;
  padding: 8px;
  border-radius: 5px;
}
.search-results {
  padding: 0 14px;
}
.result {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 8px;
  border-radius: 5px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
}
.result small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
  overflow-wrap: anywhere;
}
.compare-float {
  position: absolute;
  top: 18px;
  right: 18px;
  background: var(--panel);
  border: 1px solid var(--accent);
  padding: 10px;
  border-radius: 7px;
  z-index: 5;
  max-width: 240px;
  font-size: 10px;
}
.compare-float button {
  color: var(--accent);
  padding: 4px;
  font-size: 10px;
}
.compare-float p {
  line-height: 1.6;
  margin-bottom: 6px;
}
.hidden {
  display: none !important;
}
body.dark {
  --bg: #151c19;
  --panel: #1b2520;
  --soft: #232e27;
  --line: #344239;
  --text: #dde8df;
  --muted: #9daea2;
  --accent: #80c8a2;
  --active: #283e31;
  --node: #202c25;
  --edge: #4a6052;
  background: var(--bg);
  color: var(--text);
}
body.dark .btn.primary {
  color: #17251c;
}
body.dark .brand-mark {
  background: #3a8962;
}
.mobile-toggle {
  display: none;
}
@media (min-width: 1650px) {
  .workspace {
    grid-template-columns: 250px minmax(300px, 1fr) 360px;
  }
  .inspector-content {
    padding: 24px;
  }
  .inspector-top {
    padding: 24px 24px 0;
  }
  .graph-node {
    box-shadow: 0 4px 15px #203f2708;
  }
}
@media (max-width: 1200px) {
  .workspace {
    grid-template-columns: 200px minmax(240px, 1fr) 290px;
  }
  .project-name .badge {
    display: none;
  }
  .app-header {
    padding: 0 16px;
    gap: 14px;
  }
  .canvas-header {
    padding: 18px;
  }
  .canvas-toolbar {
    padding: 10px;
    gap: 5px;
  }
  .toolbar-label {
    display: none;
  }
  .segmented button {
    padding: 6px;
  }
  .tree-select span.name {
    font-size: 10px;
  }
  .inspector-top {
    padding: 17px 15px 0;
  }
  .inspector-content {
    padding: 16px;
  }
  .inspector-tabs {
    padding: 0 6px;
  }
  .inspector-tabs button {
    padding: 10px 8px;
  }
}
@media (max-width: 950px) {
  .workspace {
    grid-template-columns: 190px minmax(260px, 1fr);
  }
  .inspector {
    position: absolute;
    right: 0;
    top: 66px;
    bottom: 30px;
    width: 315px;
    z-index: 15;
    box-shadow: -10px 0 30px #14281c10;
    display: none;
  }
  .inspector.open {
    display: flex;
  }
  .mobile-toggle {
    display: inline-flex;
  }
  .project-name {
    display: none;
  }
  .main {
    min-width: 0;
  }
  .header-actions {
    gap: 5px;
  }
  .canvas-toolbar {
    padding: 10px 16px;
  }
}
@media (max-width: 620px) {
  .workspace {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none;
    position: absolute;
    left: 0;
    top: 66px;
    bottom: 30px;
    width: 245px;
    z-index: 20;
    box-shadow: 10px 0 30px #14281c20;
  }
  .sidebar.open {
    display: flex;
  }
  .app-header {
    gap: 7px;
    padding: 0 10px;
  }
  .header-divider {
    display: none;
  }
  .brand {
    font-size: 15px;
    gap: 6px;
  }
  .brand-mark {
    padding: 8px;
  }
  .header-actions .hide-mobile {
    display: none;
  }
  .header-actions .btn {
    font-size: 10px;
    padding: 7px 9px;
  }
  .page-title h1 {
    font-size: 19px;
  }
  .canvas-toolbar {
    padding: 9px 10px;
    gap: 4px;
    flex-wrap: wrap;
  }
  .canvas-toolbar .spacer {
    display: none;
  }
  .toolbar-select {
    margin-left: auto;
  }
  .canvas-header {
    padding: 15px;
  }
  .canvas-legend {
    padding: 10px;
    font-size: 8px;
    gap: 9px;
  }
  .minimap {
    width: 105px;
    height: 72px;
    right: 12px;
    bottom: 14px;
  }
  .canvas-controls {
    left: 12px;
    bottom: 14px;
  }
  .statusbar {
    font-size: 8px;
    padding: 0 10px;
    gap: 10px;
  }
  .statusbar .status-extra {
    display: none;
  }
  .inspector {
    width: min(345px, 100vw);
  }
  .story-strip {
    padding: 10px;
  }
  .compare-grid {
    grid-template-columns: 1fr;
  }
  .modal-content {
    padding: 18px;
  }
  .canvas-note {
    font-size: 9px;
    left: 12px;
    top: 12px;
  }
  .compare-float {
    top: 47px;
    right: 12px;
  }
  .search-wrap input {
    font-size: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}

.project-name > svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}
.project-name {
  white-space: nowrap;
}
.project-name b {
  white-space: nowrap;
}
.btn > svg {
  width: 15px;
  height: 15px;
}
.compare-float p > svg {
  width: 13px;
  height: 13px;
  display: inline-block;
  vertical-align: middle;
}
.graph-node.dimmed {
  opacity: 0.63;
}
.group-boundary {
  z-index: 0;
}
.edges {
  z-index: 1;
}
.graph-node {
  z-index: 2;
}
.boundary-title {
  z-index: 3;
}
.node-label {
  font-size: 13px;
}
.node-description {
  font-size: 11px;
}
.node-footer {
  font-size: 9px;
}

/* First-class relations and explicit nested hierarchy. */
.structure-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 20px;
  min-height: 38px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  font-size: 10px;
  color: var(--muted);
}
.structure-toolbar button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 7px;
  border-radius: 5px;
  font-size: 10px;
}
.structure-toolbar button svg {
  width: 12px;
  height: 12px;
}
.structure-control[aria-pressed="true"] {
  background: var(--active);
  color: var(--accent);
}
.structure-up {
  color: var(--accent);
}
.node-wrap {
  position: absolute;
  z-index: 3;
}
.node-wrap .graph-node {
  left: 0;
  top: 0;
  position: absolute;
}
.node-wrap .graph-node:hover {
  transform: none;
}
.node-wrap .graph-node {
  gap: 6px;
  padding: 13px;
}
.node-wrap .node-footer {
  padding-top: 7px;
}
.node-wrap .node-description {
  -webkit-line-clamp: 2;
  font-size: 10px;
}
.node-wrap .node-label {
  font-size: 12px;
}
.node-wrap .node-footer {
  font-size: 8px;
  padding-right: 22px;
}
.child-preview {
  display: flex;
  flex-direction: column;
  gap: 5px;
  overflow: hidden;
  font-size: 9px;
  color: var(--muted);
}
.child-preview > span {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.child-preview svg {
  width: 11px;
  height: 11px;
}
.node-expand {
  position: absolute;
  z-index: 4;
  bottom: 7px;
  right: 8px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  color: var(--accent);
}
.node-expand svg {
  width: 13px;
  height: 13px;
}
.nested-boundary {
  background: color-mix(in srgb, var(--panel) 45%, transparent);
  border-style: dashed;
  border-color: color-mix(in srgb, var(--muted) 35%, var(--line));
  border-radius: 8px;
}
.nested-boundary .boundary-title {
  top: 10px;
  font-size: 10px;
  color: var(--text);
  background: var(--panel);
  padding: 4px 5px;
  left: 10px;
  pointer-events: auto;
}
.boundary-collapse {
  position: absolute;
  top: 11px;
  right: 10px;
  pointer-events: auto;
  z-index: 3;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
}
.boundary-collapse svg {
  height: 12px;
  width: 12px;
}
.edges {
  pointer-events: none;
  z-index: 2;
}
.edge {
  stroke-width: 1.4;
  stroke-linejoin: miter;
  stroke-linecap: butt;
}
.edge.emphasis {
  stroke-width: 1.9;
}
.wire-halo {
  fill: none;
  stroke: var(--bg);
  stroke-width: 5;
  pointer-events: none;
  stroke-linejoin: miter;
}
.edge-hit {
  fill: none;
  stroke: transparent;
  stroke-width: 12;
  pointer-events: stroke;
  cursor: pointer;
  outline: none;
}
.edge-hit:focus {
  stroke: color-mix(in srgb, var(--accent) 20%, transparent);
}
.relation-wire:hover .edge {
  stroke: var(--accent);
  stroke-width: 2.5;
}
.relation-hub {
  position: absolute;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  border-radius: 4px;
  font-size: 9px;
  padding: 5px 7px;
  box-shadow: 0 2px 5px #1e443008;
  cursor: pointer;
}
.relation-hub > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  text-align: left;
}
.relation-hub b {
  font-size: 9px;
  font-weight: 600;
  padding-left: 4px;
  border-left: 1px solid var(--line);
  color: var(--accent);
}
.relation-hub.active {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
  color: var(--accent);
}
.relation-hub.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
  background: var(--active);
}
.relation-diamond {
  width: 7px;
  height: 7px;
  display: inline-block;
  transform: rotate(45deg);
  border: 1px solid currentColor;
  background: var(--panel);
  flex-shrink: 0;
  border-radius: 1px;
}
.relation-icon {
  color: var(--accent);
  background: var(--active);
}
.connection-row {
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-bottom: 9px;
  overflow: hidden;
}
.connection-row > .connection {
  border: 0;
  margin: 0;
  border-radius: 0;
  padding: 10px;
}
.edge-detail-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--soft);
  width: 100%;
  font-size: 9px;
  color: var(--accent);
  padding: 6px 10px;
  border-top: 1px solid var(--line);
}
.edge-detail-button svg {
  width: 12px;
  height: 12px;
}
.inspector-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  line-height: 1.8;
  margin-bottom: 8px;
  color: var(--muted);
}
.inspector-breadcrumbs svg {
  width: 9px;
  height: 9px;
}
.inspector-breadcrumbs button {
  padding: 2px 3px;
  border-radius: 3px;
  text-align: left;
}
.parent-button {
  font-size: 9px;
  padding: 6px 8px;
  margin-bottom: 21px;
  white-space: normal;
  text-align: left;
}
.parent-button svg {
  width: 12px;
  height: 12px;
}
.return-relation {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  width: 100%;
  margin-bottom: 19px;
  font-size: 10px;
  color: var(--accent);
  text-align: left;
}
.return-relation svg {
  width: 12px;
  height: 12px;
}
.relation-description {
  padding: 12px;
  background: var(--soft);
  border-radius: 6px;
  border: 1px solid var(--line);
}
.relation-description strong {
  font-size: 12px;
}
.relation-description p {
  font-size: 10px;
  line-height: 1.8;
  color: var(--muted);
  margin: 7px 0 10px;
}
.relation-parent-scope {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 10px;
  font-size: 11px;
}
.relation-parent-scope svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.relation-parent-scope svg:last-child {
  margin-left: auto;
}
.relation-member {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-align: left;
  padding: 11px 25px 11px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-bottom: 8px;
}
.relation-member small {
  font:
    9px ui-monospace,
    monospace;
  color: var(--accent);
}
.relation-member b {
  font-size: 10px;
  font-weight: 550;
  line-height: 1.7;
}
.relation-member span {
  font-size: 10px;
  color: var(--muted);
}
.relation-member svg {
  position: absolute;
  right: 8px;
  top: 40%;
  width: 12px;
  height: 12px;
  color: var(--muted);
}
.endpoint-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-bottom: 9px;
  overflow: hidden;
}
.endpoint-card > .connection {
  margin: 0;
  border: 0;
  border-radius: 0;
}
.endpoint-ancestors {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  align-items: center;
  padding: 6px 8px;
  background: var(--soft);
  border-top: 1px solid var(--line);
  font-size: 8px;
  color: var(--muted);
}
.endpoint-ancestors button {
  font-size: 8px;
  text-align: left;
  padding: 2px;
  line-height: 1.5;
}
@media (max-width: 1200px) {
  .structure-toolbar {
    padding: 7px 12px;
    gap: 5px;
  }
  .structure-caption {
    display: none;
  }
}
@media (max-width: 620px) {
  .structure-toolbar {
    gap: 2px;
    padding: 6px 7px;
  }
  .structure-toolbar button {
    font-size: 9px;
  }
  .canvas-legend {
    gap: 7px;
  }
  .canvas-legend > span:last-child {
    display: none;
  }
}

/* Maintain readable type when fitting a nested diagram. */
.node-wrap .node-label {
  font-size: 14px;
}
.node-wrap .node-description {
  font-size: 11px;
}
.node-wrap .node-footer {
  font-size: 9px;
}
.child-preview {
  font-size: 10px;
}
.relation-hub,
.relation-hub b {
  font-size: 11px;
}
.relation-hub {
  padding: 4px 6px;
  gap: 4px;
}

/* Semantic identity and context: categories stay distinct from relationship types. */
@media (min-width: 1201px) {
  .workspace {
    grid-template-columns: 216px minmax(300px, 1fr) 360px;
  }
}
.node-wrap .graph-node {
  border-top: 3px solid var(--ink);
}
.node-wrap .node-icon {
  color: var(--ink);
  background: color-mix(in srgb, var(--ink) 9%, var(--panel));
}
.node-wrap .node-kind {
  display: block;
  color: var(--ink);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-top: 3px;
}
.node-wrap .node-label {
  font-size: 15px;
  line-height: 1.3;
}
.node-wrap .node-description {
  font-size: 11px;
  line-height: 1.5;
}
.node-wrap.is-boundary .graph-node {
  border: 1.5px dashed color-mix(in srgb, var(--tone) 60%, var(--line));
  border-top: 3px solid var(--tone);
  background: color-mix(in srgb, var(--tone) 4%, var(--panel));
}
.node-wrap .graph-node.selected {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 18%, transparent);
}
.node-wrap .graph-node.dimmed {
  opacity: 0.6;
}
.group-boundary.nested-boundary {
  background: color-mix(in srgb, var(--panel) 40%, transparent);
  border-color: color-mix(in srgb, var(--muted) 35%, transparent);
}
.boundary-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0;
}
.edge,
.edge.emphasis {
  stroke: var(--ink);
  stroke-width: 1.6;
  opacity: 0.6;
}
.relation-wire.active .edge {
  opacity: 1;
  stroke-width: 2.3;
}
.relation-wire:hover .edge {
  stroke: var(--ink);
  opacity: 1;
  stroke-width: 3;
}
.wire-halo {
  stroke-width: 6;
}
.relation-hub {
  color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--ink) 50%, var(--line));
  background: color-mix(in srgb, var(--ink) 5%, var(--panel));
  padding: 5px 7px;
  gap: 7px;
  border-radius: 6px;
  box-shadow: 0 2px 7px #12301909;
  overflow: hidden;
}
.relation-hub.active {
  color: var(--ink);
  border-color: var(--ink);
}
.relation-hub.selected {
  background: color-mix(in srgb, var(--ink) 10%, var(--panel));
  border-color: var(--ink);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 16%, transparent);
}
.relation-hub.shape-single {
  border-radius: 18px;
}
.relation-hub > span {
  flex: initial;
  overflow: visible;
}
.relation-hub .hub-glyph {
  width: 18px;
  height: 24px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.hub-glyph svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
}
.relation-hub .hub-copy {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: left;
  overflow: hidden;
}
.hub-copy strong {
  font-size: 12px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hub-copy small {
  font-size: 9px;
  font-weight: 500;
  white-space: nowrap;
}
.relation-hub b.member-count {
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  color: var(--ink);
  border-radius: 4px;
  font-size: 10px;
  min-width: 17px;
  height: 18px;
  padding: 0 3px;
  align-self: center;
}
.type-badge,
.category-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid color-mix(in srgb, var(--ink) 22%, transparent);
  background: color-mix(in srgb, var(--ink) 6%, var(--panel));
  color: var(--ink);
  border-radius: 5px;
  padding: 4px 6px;
  font-size: 10px;
  line-height: 1.25;
  font-weight: 600;
  white-space: nowrap;
}
.type-badge svg,
.category-badge svg {
  width: 12px;
  height: 12px;
}
.type-badge small {
  font-size: 9px;
  font-weight: 400;
  color: var(--muted);
}
.semantic-legend {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 9px 16px;
  background: var(--panel);
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
  min-height: 44px;
}
.semantic-legend button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  color: var(--ink);
  padding: 4px 5px;
  border: 1px solid transparent;
  border-radius: 5px;
  white-space: nowrap;
}
.semantic-legend button.active {
  border-color: var(--ink);
  background: color-mix(in srgb, var(--ink) 7%, var(--panel));
}
.semantic-legend button svg {
  width: 26px;
  height: 10px;
}
.semantic-legend button b {
  color: var(--muted);
  font-size: 9px;
  font-weight: 400;
}
.semantic-legend .legend-help {
  margin-left: auto;
  color: var(--muted);
}
.semantic-legend .legend-help svg {
  width: 13px;
  height: 13px;
}
.legend-caption {
  font-size: 10px;
  color: var(--muted);
}
.lens-switch {
  display: flex;
  gap: 3px;
  align-items: center;
}
.lens-switch button {
  font-size: 11px;
  padding: 6px 9px;
  border-radius: 5px;
  color: var(--muted);
}
.lens-switch button.active {
  color: var(--text);
  background: var(--soft);
  font-weight: 600;
}
.structure-toolbar {
  padding: 8px 16px;
  gap: 10px;
}
.structure-control {
  font-size: 10px;
}
.outside-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  font-size: 10px;
  color: var(--muted);
}
.outside-strip > span:first-child {
  display: flex;
  gap: 5px;
  align-items: center;
}
.outside-strip svg {
  width: 12px;
  height: 12px;
}
.outside-strip b {
  color: var(--text);
}
.outside-strip button {
  display: flex;
  gap: 6px;
  align-items: center;
  color: var(--accent);
  margin-left: auto;
  font-size: 10px;
}
.inspector-tools {
  display: flex;
  gap: 2px;
}
.inspector-top {
  padding: 20px 20px 15px;
}
.inspector-content {
  padding: 20px;
}
.inspector-title h2 {
  font-size: 19px;
}
.inspector-tabs {
  padding: 0 10px;
}
.inspector-tabs button {
  padding: 12px 10px;
  font-size: 11px;
}
.inspector-breadcrumbs {
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  font-size: 10px;
}
.inspector-breadcrumbs button {
  line-height: 1.5;
}
.object-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
}
.section-label {
  font-size: 10px;
  letter-spacing: 0.07em;
}
.detail-text {
  font-size: 12px;
  line-height: 1.8;
}
.detail-intro {
  margin-bottom: 19px;
}
.detail-intro > b {
  font-size: 14px;
}
.detail-intro p {
  font-size: 11px;
  line-height: 1.8;
  color: var(--muted);
  margin-top: 7px;
}
.empty-hint {
  font-size: 11px;
  line-height: 1.7;
  padding: 12px 0;
  color: var(--muted);
}
.empty-title {
  font-size: 20px;
  margin: 12px 0;
}
.relationship-summary {
  display: grid;
  grid-template-columns: 1fr 1.5fr 1fr;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  margin: 16px 0 10px;
}
.relationship-summary button {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 15px 4px;
  align-items: center;
  border-right: 1px solid var(--line);
}
.relationship-summary button:last-child {
  border: 0;
}
.relationship-summary b {
  font-size: 16px;
  font-weight: 650;
}
.relationship-summary span {
  font-size: 9px;
  color: var(--muted);
}
.context-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 23px;
}
.context-actions .btn {
  flex: 1;
  justify-content: center;
  font-size: 10px;
}
.type-breakdown {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.type-breakdown > button {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  font-size: 10px;
  color: var(--ink);
}
.type-breakdown b {
  font-size: 10px;
  font-weight: 500;
}
.type-breakdown .type-badge small {
  display: none;
}
.connection-row {
  border-left: 3px solid var(--ink);
}
.connection-row > .connection {
  padding: 12px;
}
.connection {
  font-size: 11px;
  align-items: flex-start;
}
.connection > svg {
  color: var(--muted);
  width: 15px;
  height: 15px;
  margin-top: 2px;
}
.connection small {
  font-size: 10px;
  line-height: 1.5;
  margin-top: 5px;
}
.edge-detail-button {
  color: var(--ink);
  padding: 6px 9px;
  background: color-mix(in srgb, var(--ink) 3%, var(--panel));
}
.edge-detail-button > span:last-child {
  display: flex;
  gap: 3px;
  align-items: center;
}
.edge-detail-button .type-badge {
  padding: 0;
  border: 0;
  background: none;
}
.relation-member {
  border-left: 3px solid var(--ink);
  padding: 12px 25px 12px 11px;
  gap: 8px;
}
.relation-member > small {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 9px;
}
.relation-member .type-badge {
  padding: 2px 4px;
}
.relation-member b {
  font-size: 11px;
  font-weight: 550;
}
.relation-member > span {
  font-size: 11px;
}
.relation-member .inline-arrow {
  color: var(--ink);
  font-size: 12px;
}
.relation-member > svg {
  width: 13px;
}
.relation-icon {
  color: var(--ink);
  background: color-mix(in srgb, var(--ink) 8%, var(--panel));
}
.relation-contract {
  padding: 13px;
  background: color-mix(in srgb, var(--ink) 4%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--ink) 22%, var(--line));
  border-radius: 8px;
  margin-bottom: 22px;
}
.relation-contract > div {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--ink);
  font-size: 13px;
}
.relation-contract > div > svg {
  width: 20px;
  height: 20px;
}
.relation-contract > div > span {
  margin-left: auto;
  font:
    12px ui-monospace,
    monospace;
}
.relation-contract p {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin: 12px 0;
}
.relation-contract p > span {
  font-size: 11px;
  color: var(--text);
  border-radius: 3px;
  padding: 3px 5px;
  background: var(--panel);
}
.participant-heading {
  display: flex;
  gap: 5px;
  align-items: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  padding-bottom: 8px;
}
.participant-heading svg {
  width: 13px;
  height: 13px;
}
.participant-section {
  margin-bottom: 16px;
}
.endpoint-card > .connection {
  padding: 10px 11px;
}
.endpoint-ancestors {
  padding: 4px 8px;
  font-size: 9px;
  line-height: 1.4;
}
.endpoint-ancestors button {
  font-size: 9px;
}
.endpoint-card {
  margin-bottom: 7px;
}
.wide-btn {
  width: 100%;
  justify-content: center;
}
.semantic-note {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.8;
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.semantic-note summary {
  cursor: pointer;
}
.semantic-note p {
  margin-top: 8px;
}
.global-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.global-cell {
  display: flex;
  flex-direction: column;
  gap: 7px;
  text-align: left;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 11px 8px;
}
.global-cell > span {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.4;
}
.global-cell strong {
  font-size: 9px;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.4;
}
.global-cell small {
  font-size: 8px;
  color: var(--muted);
}
.global-cell.current {
  border-color: var(--tone);
  box-shadow: inset 3px 0 var(--tone);
  background: color-mix(in srgb, var(--tone) 6%, var(--panel));
}
.global-cell.current strong {
  color: var(--text);
}
.location-details {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  margin: 10px 0 14px;
  font-size: 10px;
}
.location-details summary {
  display: flex;
  gap: 6px;
  cursor: pointer;
  align-items: center;
  color: var(--muted);
}
.location-details svg {
  width: 13px;
  height: 13px;
}
.location-details code {
  display: block;
  margin-top: 10px;
  font-size: 10px;
  line-height: 1.8;
}
.parent-button {
  margin-top: 8px;
}
.evidence-card summary {
  cursor: pointer;
  font-size: 10px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.evidence-card pre {
  font-size: 10px;
  line-height: 1.6;
}
.evidence-card > small {
  display: block;
  margin-top: 10px;
}
.legend-intro {
  font-size: 13px;
  line-height: 1.8;
  margin-bottom: 24px;
}
.legend-categories {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 24px;
}
.legend-categories > div {
  display: flex;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px;
}
.legend-categories svg {
  width: 21px;
  height: 21px;
  flex-shrink: 0;
  color: var(--ink, var(--muted));
}
.legend-categories b {
  font-size: 12px;
  display: block;
}
.legend-categories small {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.7;
  display: block;
  margin-top: 5px;
}
.legend-relation {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.legend-relation p {
  font-size: 11px;
  line-height: 1.7;
}
body.presenting .workspace {
  grid-template-columns: minmax(0, 1fr);
}
body.presenting .sidebar,
body.presenting .inspector {
  display: none;
}
body.presenting .canvas-header {
  padding-top: 16px;
  padding-bottom: 12px;
}
body.presenting .inspector.open {
  display: flex;
  position: absolute;
  top: 66px;
  bottom: 30px;
  right: 0;
  width: 360px;
  max-width: 92vw;
  z-index: 25;
  box-shadow: -10px 0 30px #14281c22;
}
body.presenting .inspector .mobile-toggle,
body.presenting [data-action="toggle-inspector"] {
  display: inline-flex;
}
@media (max-width: 1200px) {
  .outside-counts {
    display: none;
  }
  .structure-toolbar {
    gap: 4px;
    padding: 7px 10px;
  }
  .lens-switch button {
    padding: 5px;
    font-size: 10px;
  }
  .structure-up {
    font-size: 10px;
  }
  .structure-control {
    font-size: 9px;
  }
  .semantic-legend {
    gap: 4px;
    padding: 7px 10px;
  }
  .legend-caption {
    display: none;
  }
}
@media (max-width: 620px) {
  .present-toggle {
    font-size: 0;
    padding: 7px;
  }
  .present-toggle svg {
    width: 16px;
  }
  .structure-toolbar .structure-up {
    display: none;
  }
  .structure-control {
    padding: 4px;
  }
  .outside-strip {
    padding: 7px 12px;
    gap: 4px;
    font-size: 9px;
  }
  .outside-strip button {
    font-size: 9px;
  }
  .semantic-legend {
    gap: 1px;
    justify-content: space-between;
  }
  .semantic-legend button {
    font-size: 9px;
    padding: 4px 2px;
  }
  .semantic-legend button b {
    display: none;
  }
  .semantic-legend button svg {
    width: 16px;
  }
  .semantic-legend .legend-help {
    font-size: 0;
    margin-left: 0;
  }
  .inspector-content {
    padding: 16px;
  }
  .inspector-top {
    padding: 18px 16px 12px;
  }
  .inspector-tabs button {
    padding: 11px 8px;
  }
  .canvas-note {
    font-size: 9px;
    gap: 4px;
  }
  .legend-categories {
    grid-template-columns: 1fr;
  }
  .legend-relation {
    flex-direction: column;
    gap: 6px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}

/* Short desktop windows still need room for a legible graph and detail body. */
@media (min-width: 1201px) and (max-width: 1400px) {
  .workspace {
    grid-template-columns: 196px minmax(300px, 1fr) 326px;
  }
}
@media (min-width: 621px) and (max-height: 800px) {
  .canvas-header {
    padding: 12px 20px 10px;
  }
  .breadcrumbs {
    margin-bottom: 7px;
  }
  .page-title h1 {
    font-size: 20px;
  }
  .subtitle {
    font-size: 10px;
    line-height: 1.5;
  }
  .canvas-toolbar {
    padding: 7px 16px;
    min-height: 48px;
  }
  .structure-toolbar {
    padding-top: 6px;
    padding-bottom: 6px;
  }
  .inspector-top {
    padding: 12px 18px 0;
  }
  .inspector-label {
    margin-bottom: 7px;
  }
  .inspect-actions {
    margin: 12px 0;
  }
  .inspector-tabs button {
    padding-top: 9px;
    padding-bottom: 9px;
  }
  .inspector-content {
    padding-top: 14px;
  }
  .minimap {
    width: 108px;
    height: 64px;
    right: 14px;
    bottom: 12px;
  }
  .canvas-controls {
    left: 14px;
    bottom: 12px;
  }
}

/* Depth spotlight is separate from category color and the active object. */
.level-rail {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 43px;
  padding: 7px 20px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.level-caption {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}
.level-caption svg {
  width: 13px;
  height: 13px;
}
.level-options {
  display: flex;
  align-items: center;
  gap: 4px;
}
.level-options button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  padding: 4px 7px;
  border: 1px solid transparent;
  border-radius: 5px;
  white-space: nowrap;
  color: var(--muted);
}
.level-options button.at-level {
  color: var(--accent);
  background: var(--active);
  border-color: color-mix(in srgb, var(--accent) 28%, var(--line));
  font-weight: 700;
}
.level-options button[aria-pressed="true"] {
  color: var(--accent);
  box-shadow: inset 0 -2px var(--accent);
}
.level-options small {
  font-size: 9px;
  font-weight: 400;
  opacity: 0.75;
}
.level-summary {
  margin-left: auto;
  text-align: right;
  font-size: 9px;
  line-height: 1.5;
  color: var(--muted);
}
.level-summary small {
  display: block;
  font-size: 9px;
}
.tree-level {
  flex-shrink: 0;
  font:
    9px ui-monospace,
    monospace;
  padding: 2px 3px;
  color: var(--muted);
  border-radius: 3px;
}
.tree-select.level-peer {
  background: color-mix(in srgb, var(--accent) 6%, var(--panel));
}
.tree-select.level-peer .tree-level {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--panel));
  font-weight: 700;
}
.tree-select.level-peer .name {
  font-weight: 650;
}
.node-wrap .graph-node.level-peer {
  opacity: 1;
}
.node-wrap .graph-node.level-peer:not(.selected) {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent);
  background: color-mix(in srgb, var(--accent) 4%, var(--panel));
}
.node-wrap .graph-node.level-peer .node-kind {
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
  text-underline-offset: 3px;
}
.node-wrap .graph-node.level-outside:not(.selected) {
  opacity: 0.74;
}
.group-boundary.level-peer-boundary {
  border-color: var(--accent);
  border-style: solid;
  background: color-mix(in srgb, var(--accent) 3%, transparent);
}
.boundary-title.level-peer,
.breadcrumbs button.level-peer,
.inspector-breadcrumbs button.level-peer,
.endpoint-ancestors button.level-peer {
  background: var(--active);
  color: var(--accent);
  border-radius: 4px;
  box-shadow: 0 1px var(--accent);
}
.connection.level-peer,
.result.level-peer {
  background: color-mix(in srgb, var(--accent) 5%, var(--panel));
  box-shadow: inset 3px 0 var(--accent);
}
.level-peers {
  border: 1px solid var(--line);
  border-radius: 7px;
  margin: -4px 0 18px;
  background: var(--panel);
}
.level-peers summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 9px 10px;
  cursor: pointer;
  font-size: 10px;
  list-style: none;
}
.level-peers summary::-webkit-details-marker {
  display: none;
}
.level-peers summary > span:last-child {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
}
.level-peers summary svg {
  width: 12px;
  height: 12px;
}
.level-peers[open] summary svg {
  transform: rotate(90deg);
}
.current-level-label {
  color: var(--accent);
  font-weight: 650;
}
.level-peers > p {
  font-size: 10px;
  line-height: 1.6;
  color: var(--muted);
  padding: 0 10px 9px;
}
.level-peer-list {
  max-height: 240px;
  overflow: auto;
  border-top: 1px solid var(--line);
}
.level-peer-list button {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  font-size: 11px;
  border-bottom: 1px solid var(--line);
}
.level-peer-list button > svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--muted);
}
.level-peer-list small {
  display: block;
  font-size: 9px;
  color: var(--muted);
  margin-top: 3px;
}
.level-peer-list button.current {
  background: var(--active);
}
.level-peer-list b {
  font-size: 9px;
  color: var(--accent);
  margin-left: auto;
}

/* One RAF governor moves small marks along the unchanged directed polylines. */
.flow-particle {
  pointer-events: none;
  opacity: 0.76;
}
.particle-aura {
  fill: var(--ink);
  opacity: 0.15;
}
.particle-core {
  fill: var(--ink);
  stroke: var(--panel);
  stroke-width: 1;
}
.particle-glint {
  fill: var(--panel);
}
.relation-wire.active .flow-particle {
  opacity: 1;
}
.relation-wire.active .particle-core {
  r: 3.7px;
}
body:not(.flow-moving) .flow-particle {
  opacity: 0.32;
}
body.flow-reduced .flow-particle {
  display: none;
}
.motion-toggle {
  padding: 6px 8px;
  font-size: 10px;
  gap: 5px;
  color: var(--accent);
}
.motion-toggle svg {
  width: 13px;
  height: 13px;
}
.motion-toggle[aria-pressed="true"] {
  background: var(--active);
  border-color: color-mix(in srgb, var(--accent) 25%, var(--line));
}
.motion-toggle:disabled {
  color: var(--muted);
  background: var(--soft);
  opacity: 0.8;
}
@media (max-width: 1200px) {
  .level-rail {
    padding: 6px 10px;
    gap: 6px;
  }
  .level-caption {
    font-size: 9px;
  }
  .level-options button {
    font-size: 9px;
    padding: 4px;
  }
  .level-summary {
    font-size: 8px;
  }
  .motion-toggle span {
    display: none;
  }
  .motion-toggle {
    padding: 7px;
  }
  .canvas-toolbar {
    gap: 7px;
  }
}
@media (max-width: 620px) {
  .level-caption {
    display: none;
  }
  .level-rail {
    min-height: 38px;
  }
  .level-summary {
    max-width: 120px;
  }
  .tree-level {
    font-size: 9px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .flow-particle {
    display: none !important;
  }
}

.particle-trail {
  fill: var(--ink);
  opacity: 0.5;
}

/* Separate code objects, category regions and relationship annotations. */
.display-options {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  flex-shrink: 0;
}
.display-options button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}
.display-options button svg {
  width: 12px;
  height: 12px;
}
.display-options button[aria-pressed="true"] {
  background: var(--active);
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 20%, var(--line));
}
.display-options button:disabled {
  opacity: 0.4;
  cursor: default;
}
.level-rail {
  flex-wrap: wrap;
  gap: 7px 10px;
}
.level-summary {
  margin-left: 0;
}
.category-frame {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  border: 1px solid color-mix(in srgb, var(--category-ink) 26%, var(--line));
  border-radius: 14px;
  background: color-mix(in srgb, var(--category-ink) 3.5%, var(--bg));
  box-shadow: inset 4px 0
    color-mix(in srgb, var(--category-ink) 36%, transparent);
  transition: opacity 0.18s;
}
.category-heading {
  position: absolute;
  left: 14px;
  top: 9px;
  right: 14px;
  height: 22px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--category-ink);
  font-size: 11px;
  white-space: nowrap;
}
.category-heading svg {
  width: 14px;
  height: 14px;
}
.category-heading strong {
  font-weight: 650;
}
.category-heading span {
  color: var(--muted);
  font-size: 9px;
}
.category-heading b {
  font-size: 9px;
  font-weight: 500;
  margin-left: auto;
  padding: 1px 6px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--category-ink) 9%, var(--panel));
}
.node-wrap,
.group-boundary {
  transition:
    opacity 0.18s,
    filter 0.18s;
}
.node-wrap.focus-muted {
  opacity: 0.25;
  filter: saturate(0.4);
}
.node-wrap.focus-muted:hover,
.node-wrap.focus-muted:focus-within {
  opacity: 0.85;
  filter: none;
}
.node-wrap.focus-related .graph-node,
.node-wrap.focus-selected .graph-node {
  opacity: 1;
}
.node-wrap.focus-muted .graph-node {
  opacity: 1;
}
.node-wrap.focus-muted .graph-node.level-peer {
  box-shadow: none;
  background: var(--panel);
}
.tree-select.focus-muted {
  opacity: 0.45;
}
.tree-select.focus-muted:hover,
.tree-select.focus-muted:focus-visible {
  opacity: 1;
}
.tree-select.focus-muted.level-peer {
  background: none;
}
.group-boundary.focus-muted,
.category-frame.focus-muted {
  opacity: 0.3;
}
.relation-wire {
  transition: opacity 0.18s;
}
.relation-wire.focus-muted {
  opacity: 0.12;
}
.relation-wire.focus-muted:hover,
.relation-wire.focus-muted:focus-within {
  opacity: 1;
}
.relation-hub,
.relation-hub.shape-single {
  border-radius: 999px;
  padding: 4px 7px;
  gap: 5px;
  box-shadow: none;
  border-width: 1px;
  background: var(--panel);
}
.relation-hub .hub-glyph {
  width: 15px;
  height: 18px;
  border-radius: 0;
}
.relation-hub .hub-glyph svg {
  width: 14px;
  height: 14px;
}
.relation-hub .hub-copy {
  display: block;
}
.relation-hub .hub-copy strong {
  display: block;
  font-size: 10px;
  font-weight: 550;
  line-height: 16px;
}
.relation-hub b.member-count {
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  border: 0;
  border-radius: 8px;
  font-size: 9px;
  background: color-mix(in srgb, var(--ink) 10%, var(--panel));
}
.relation-hub.selected {
  background: color-mix(in srgb, var(--ink) 7%, var(--panel));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--ink) 18%, transparent);
}
.relation-hub.focus-muted {
  opacity: 0.26;
}
.relation-hub.focus-muted:hover,
.relation-hub.focus-muted:focus-visible {
  opacity: 1;
}
.relation-hub.focus-related {
  opacity: 0.86;
}
@media (max-width: 1440px) {
  .level-summary {
    display: none;
  }
}
@media (max-width: 650px) {
  .level-rail {
    padding: 7px 10px;
  }
  .display-options {
    gap: 4px;
  }
  .display-options button {
    padding: 5px;
    font-size: 9px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .category-frame,
  .node-wrap,
  .group-boundary,
  .relation-wire {
    transition: none;
  }
}

/* Skylense lens mark; inline SVG also works in the offline build. */
.brand-mark {
  display: block;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  padding: 0;
  overflow: hidden;
  background: #1f7859;
  transform: none;
}
.brand-mark svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Public repository examples share the same complete workbench. */
.example-select { width:100%; margin:10px 0 2px; padding:9px 8px; border:1px solid var(--line); border-radius:7px; background:var(--panel); color:var(--text); font:inherit; font-size:12px; cursor:pointer; }
.example-select:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.source-caption { display:block; margin-top:7px; color:var(--muted); font-size:10px; }
.source-link { display:inline-block; margin:7px 0; color:var(--accent); font-size:11px; }

/* Skylense appearance and workflow dialogs. */
.dialog-lead { color:var(--muted); line-height:1.7; margin-bottom:22px; max-width:65ch; }
.theme-gallery { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; margin:6px 0 20px; }
.theme-card { text-align:left; border:1px solid var(--line); border-radius:var(--radius-card,12px); padding:10px; color:var(--text); background:var(--panel); min-width:0; }
.theme-card.selected { border-color:var(--accent); box-shadow:0 0 0 1px var(--accent); }
.theme-preview { display:flex; height:105px; border-radius:7px; overflow:hidden; border:1px solid var(--sample-line); background:var(--sample-bg); }
.sample-sidebar { width:23px; border-right:1px solid var(--sample-line); background:var(--sample-panel); flex-shrink:0; }
.theme-preview svg { width:100%; }
.theme-card-title { display:flex; align-items:center; justify-content:space-between; margin:11px 0 6px; }
.theme-card-title b { font-size:13px; }
.theme-card-title svg { width:15px; height:15px; color:var(--accent); }
.theme-card small { color:var(--muted); font-size:11px; line-height:1.6; display:block; }
.connect-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.connect-card { padding:20px; border:1px solid var(--line); border-radius:var(--radius-card,12px); background:var(--soft); min-width:0; }
.connect-card h3 { margin:12px 0; font-size:18px; }
.connect-card p { color:var(--muted); font-size:12px; line-height:1.8; }
.connect-code { display:flex; align-items:center; justify-content:space-between; gap:8px; margin:18px 0 10px; padding:9px 11px; background:var(--panel); border:1px solid var(--line); border-radius:8px; }
.connect-code code { font-size:11px; }
.connect-card small { display:block; color:var(--muted); font-size:11px; line-height:1.7; }
.connect-card a { display:flex; gap:6px; margin-top:16px; align-items:center; font-size:12px; }
.connect-card a svg,.connect-boundary svg { width:15px; height:15px; flex-shrink:0; }
.connect-boundary { display:flex; align-items:flex-start; gap:9px; color:var(--muted); font-size:11px; line-height:1.8; margin-top:20px; }
.sidebar-connect { display:flex; align-items:center; gap:7px; margin-top:13px; padding:8px 0; color:var(--accent); font-size:11px; }
@media(max-width:600px){ .theme-gallery { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; } .theme-preview { height:80px; } .connect-grid { grid-template-columns:1fr; } .theme-toggle span { display:none; } .theme-toggle { padding:8px; } .connect-toggle { padding:8px; } }

/* Section icons remain compact in the relationship inspector. */
.section-label > svg { width:14px; height:14px; flex:0 0 14px; vertical-align:middle; }
