/* One canvas surface; controls and an optional flat inspector sit above it. */
#views:has(#view-graph:not(.hidden)) { padding: 0; }
#view-graph { height: auto; max-width: none; }
#graph-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 22px; border-bottom: 1px solid var(--border); }
#graph-toolbar h2 { font-size: 16px; font-weight: 600; letter-spacing: -.25px; margin: 0; }
.gx-title { display: flex; align-items: center; gap: 20px; }
#gx-arrange { font-size: 12px; min-height: 36px; }
.gx-controls { display: flex; align-items: center; gap: 8px; }
#gx-search { width: 240px; font-size: 12px; min-height: 36px; background: transparent; border-color: transparent; }
#gx-search:focus { border-color: var(--accent); }
#gx-mode { width: 195px; min-height: 36px; font-size: 12px; background-color: transparent; border-color: transparent; }
.gx-controls .btn { font-size: 12px; min-height: 36px; white-space: nowrap; }
.gx-body { position: relative; }
#graph-viewport { position: relative; min-width: 0; height: max(400px, calc(100dvh - 124px)); }
#view-graph #graph-canvas { border: 0; border-radius: 0; background: radial-gradient(circle, var(--border) .7px, transparent .9px) 0 0 / 24px 24px, var(--bg); cursor: grab; }
#graph-canvas:active { cursor: grabbing; }
#graph-canvas:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
#graph-inspector { position: absolute; z-index: 4; right: 16px; top: 16px; width: 320px; max-height: calc(100% - 90px); overflow: auto; background: var(--bg2); border: 1px solid var(--border); box-shadow: 0 8px 28px #0002; border-radius: 8px; padding: 16px 20px; }
#graph-inspector[hidden] { display: none; }
.gx-panel-head { display: flex; justify-content: space-between; align-items: center; color: var(--text-dim); font-size: 12px; margin: -7px -8px 10px 0; }
.gx-panel-head .btn { min-height: 36px; min-width: 36px; }
#graph-inspector h3 { font-size: 17px; line-height: 1.4; margin: 0 0 8px; overflow-wrap: anywhere; }
.gx-muted, .gx-scope { color: var(--text-dim); font-size: 12px; line-height: 1.6; margin: 8px 0 12px; }
.gx-ticket { display: grid; grid-template-columns: 35px minmax(0, 1fr) 12px; align-items: start; width: 100%; gap: 9px; text-align: left; padding: 12px 0; border-radius: 0; border: 0; border-bottom: 1px solid var(--border); background: transparent; }
.gx-ticket-id, .gx-ticket > span:last-child { font-size: 10px; color: var(--text-dim); padding-top: 2px; }
.gx-ticket strong { display: block; font-size: 12px; font-weight: 500; line-height: 1.5; overflow-wrap: anywhere; }
.gx-ticket small { display: block; font-size: 10px; color: var(--text-dim); margin-top: 4px; }
.gx-ticket:focus-visible, .gx-navigation button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.gx-open { padding-left: 0; color: var(--accent); font-size: 12px; }
.gx-section h4 { font-size: 12px; font-weight: 500; margin: 22px 0 3px; }
.gx-section h4 span { color: var(--text-dim); margin-left: 5px; }
.gx-scope { margin: 20px 0 0; font-size: 10px; }
#view-graph #gn-add { display: none; }
#view-graph .gn-editor { top: 16px; left: 20px; }
#view-graph #graph-legend { max-width: calc(100% - 40px); top: auto; right: 20px; bottom: 58px; }
#view-graph #graph-hint { left: 22px; bottom: 72px; font-size: 10px; background: var(--bg); }
#gx-status { position: absolute; right: 22px; bottom: 22px; pointer-events: none; font-size: 11px; color: var(--text-dim); }
.gx-navigation { position: absolute; left: 20px; bottom: 16px; display: flex; align-items: center; padding: 3px; border: 1px solid var(--border); border-radius: 7px; background: var(--bg2); }
.gx-navigation button { font-size: 12px; min-width: 36px; min-height: 36px; padding: 5px 10px; }
#gx-zoom { min-width: 46px; text-align: center; font-size: 11px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.gx-divider { height: 16px; width: 1px; background: var(--border); margin: 0 4px; }
@media (hover: hover) and (pointer: fine) { .gx-ticket:hover { background: transparent; color: var(--accent); } }
@media (max-width: 760px) {
  #graph-toolbar { flex-wrap: wrap; padding: 10px 14px; gap: 8px; }
  .gx-title { width: 100%; justify-content: space-between; }
  .gx-controls { flex-wrap: wrap; width: 100%; gap: 2px; }
  #gx-search { flex: 1 1 100%; width: 100%; }
  #gx-mode { flex: 1; width: 170px; }
  #graph-viewport { height: max(440px, calc(100dvh - 230px)); }
  #graph-inspector { right: 10px; left: 10px; top: auto; bottom: 112px; width: auto; max-height: 48%; padding: 12px 16px; }
  #view-graph #graph-hint { left: 14px; right: 14px; bottom: 100px; font-size: 9px; }
  .gx-navigation { left: 12px; bottom: 42px; }
  #gx-status { right: auto; left: 14px; bottom: 14px; }
  #view-graph #graph-legend { right: 12px; bottom: 48px; max-width: calc(100% - 24px); }
}
