/* Architecture graph page */
body { overflow: hidden; }
footer.site { display: none; }
.graph-shell { display: grid; grid-template-columns: 340px minmax(0, 1fr); height: calc(100vh - 56px); }
.graph-panel { overflow-y: auto; border-right: 1px solid var(--border); padding: 20px 18px 40px; font-size: 14px; background: var(--bg); }
.graph-panel h1 { font-size: 1.4rem; margin: 0 0 8px; }
.graph-panel p { margin: 0 0 10px; }
.gp-head p { font-size: 13.5px; }
.gp-section { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.gp-section h4 { margin: 0 0 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.gp-row { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg button { background: var(--surface); border: 0; padding: 6px 14px; cursor: pointer; color: var(--muted); font-weight: 600; font-size: 13px; }
.seg button + button { border-left: 1px solid var(--border); }
.seg button.active { background: var(--accent); color: #fff; }
.btn { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 6px 12px; cursor: pointer; color: var(--text); font-size: 13px; font-weight: 500; }
.btn:hover { border-color: var(--accent); }
.btn.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
#search { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font-size: 13.5px; font-family: var(--font); }
#search:focus { outline: 2px solid color-mix(in srgb, var(--accent) 40%, transparent); border-color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px; cursor: pointer; font-size: 12.5px; color: var(--text); }
.chips button:hover, .chips button.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.legend { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 8px; }
.legend label { display: flex; align-items: center; gap: 7px; padding: 3px 4px; border-radius: 6px; cursor: pointer; font-size: 12.5px; user-select: none; }
.legend label:hover { background: var(--bg-soft); }
.legend label.off { opacity: .45; }
.legend input { display: none; }
.legend .sw { width: 12px; height: 12px; border-radius: 50%; flex: 0 0 12px; box-shadow: 0 0 0 1px rgba(0,0,0,.15) inset; }
.legend .sw.line { height: 3px; border-radius: 2px; width: 16px; flex-basis: 16px; }
.legend .cnt { margin-left: auto; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.opt { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 13px; cursor: pointer; }
.gp-help p { font-size: 12.5px; color: var(--muted); }

.graph-stage { position: relative; background: var(--bg-soft); }
#graph { position: absolute; inset: 0; }
#graph canvas { display: block; }
.panel-toggle { display: none; position: absolute; top: 10px; left: 10px; z-index: 5; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; width: 36px; height: 36px; font-size: 18px; cursor: pointer; color: var(--text); }
.details { position: absolute; right: 14px; top: 14px; width: min(360px, calc(100% - 28px)); max-height: calc(100% - 28px); overflow-y: auto; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(6px); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: 0 8px 30px rgba(0,0,0,.12); font-size: 13.5px; z-index: 4; }
.details .close { position: absolute; top: 6px; right: 8px; background: none; border: 0; font-size: 20px; color: var(--muted); cursor: pointer; }
.details h3 { margin: 2px 0 6px; font-size: 15px; font-family: var(--mono); word-break: break-all; padding-right: 20px; }
.d-kind { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.d-kind .sw { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.d-meta { color: var(--muted); font-size: 12.5px; }
.d-meta div { margin: 2px 0; }
.d-meta code { font-size: 12px; }
.d-links h5 { margin: 12px 0 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.d-links a { display: block; font-family: var(--mono); font-size: 12px; padding: 2px 0; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-links a:hover { color: var(--accent); text-decoration: none; }
.d-links a .rel { color: var(--muted); font-family: var(--font); font-size: 11px; margin-right: 6px; }
.hint { position: absolute; left: 14px; bottom: 12px; font-size: 12px; color: var(--muted); background: color-mix(in srgb, var(--surface) 85%, transparent); padding: 4px 10px; border-radius: 6px; border: 1px solid var(--border); pointer-events: none; }

@media (max-width: 960px) {
  .graph-shell { grid-template-columns: 1fr; }
  .graph-panel { position: absolute; z-index: 6; top: 56px; bottom: 0; left: 0; width: min(340px, 90vw); transform: translateX(-105%); transition: transform .2s; box-shadow: 0 10px 40px rgba(0,0,0,.3); }
  .graph-panel.open { transform: none; }
  .panel-toggle { display: block; }
  .details { top: auto; bottom: 12px; right: 12px; left: 12px; width: auto; max-height: 45%; }
  .hint { display: none; }
}
