.asp-graph-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
}

.asp-graph-shell:fullscreen,
.asp-graph-shell:-webkit-full-screen {
  background: #05070b;
  padding: 12px;
  box-sizing: border-box;
}

.asp-graph-shell:fullscreen .asp-graph-host--fullscreen,
.asp-graph-shell:-webkit-full-screen .asp-graph-host--fullscreen {
  flex: 1;
  min-height: 0;
}

.asp-graph-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 10px 12px;
  margin-bottom: 8px;
  border: 1px solid rgba(199, 206, 216, 0.14);
  border-radius: 12px;
  background: rgba(8, 16, 29, 0.88);
}

.asp-graph-toolbar--fullscreen {
  z-index: 3;
}

.asp-graph-search-wrap {
  position: relative;
  flex: 1 1 220px;
  min-width: 180px;
  max-width: 420px;
}

.asp-graph-search-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.asp-graph-search-input {
  width: 100%;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid rgba(199, 206, 216, 0.22);
  background: rgba(5, 7, 11, 0.72);
  color: #e2e7ee;
  font: inherit;
  font-size: 0.82rem;
}

.asp-graph-search-input:focus {
  outline: 2px solid rgba(53, 99, 179, 0.55);
  outline-offset: 1px;
}

.asp-graph-search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 240px;
  overflow-y: auto;
  border-radius: 8px;
  border: 1px solid rgba(199, 206, 216, 0.22);
  background: rgba(8, 16, 29, 0.96);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  z-index: 6;
}

.asp-graph-search-result {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-bottom: 1px solid rgba(199, 206, 216, 0.08);
  background: transparent;
  color: #e2e7ee;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.asp-graph-search-result:last-child {
  border-bottom: 0;
}

.asp-graph-search-result:hover,
.asp-graph-search-result:focus-visible {
  background: rgba(35, 74, 134, 0.28);
  outline: none;
}

.asp-graph-search-result-title {
  font-size: 0.84rem;
}

.asp-graph-search-result-type {
  font-size: 0.72rem;
  color: var(--muted, #aeb7c4);
}

.asp-graph-search-empty {
  margin: 0;
  padding: 10px;
  font-size: 0.82rem;
  color: var(--muted, #aeb7c4);
}

.asp-graph-btn {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(199, 206, 216, 0.45);
  background:
    linear-gradient(135deg, rgba(35, 74, 134, 0.95), rgba(13, 47, 109, 0.76)),
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.28), transparent 35%);
  color: #f3f6fb;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 10px 28px rgba(13, 47, 109, 0.34);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.asp-graph-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(226, 231, 238, 0.75);
  background:
    linear-gradient(135deg, rgba(53, 99, 179, 0.98), rgba(35, 74, 134, 0.86)),
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.3), transparent 35%);
}

.asp-graph-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.asp-graph-host {
  position: relative;
  width: 100%;
  height: 100%;
  background: #0c0b14;
  overflow: hidden;
  cursor: grab;
}

.asp-graph-host:active {
  cursor: grabbing;
}

.asp-graph-host canvas {
  display: block;
}

/* Hero card graph — compact square card matching the former static preview */
.hero-aside .asp-graph-host {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: none;
  border-radius: 0;
}

.asp-graph-host--fullscreen {
  flex: 1 1 0;
  min-height: 0;
  max-height: 100%;
  height: auto;
  border: 1px solid var(--line, rgba(199, 206, 216, 0.16));
  border-radius: 12px;
}

/* Graph page: fixed viewport shell — canvas fills bounded panel only */
.graph-page-body .asp-graph-toolbar {
  flex-shrink: 0;
}

.graph-page-body .asp-graph-shell {
  flex: 1 1 0;
  min-height: 0;
  max-height: none;
  height: auto;
  overflow: hidden;
}

.graph-page-body .asp-graph-host--fullscreen {
  flex: 1 1 0;
  min-height: 0;
  max-height: 100%;
}

.asp-graph-host--fullscreen.asp-graph-booting {
  opacity: 0;
}

.asp-graph-host--fullscreen.asp-graph-ready {
  opacity: 1;
  transition: opacity 0.18s ease;
}

.asp-graph-loading,
.asp-graph-error {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  color: var(--muted, #aeb7c4);
  font-size: 0.95rem;
  pointer-events: none;
  z-index: 2;
}

.asp-graph-error {
  color: #e2e7ee;
}

.asp-graph-toast {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%) translateY(12px);
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid rgba(199, 206, 216, 0.32);
  background: rgba(8, 16, 29, 0.92);
  color: #e2e7ee;
  font-size: 0.88rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 5;
  white-space: nowrap;
}

.asp-graph-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.graph-cta {
  padding: clamp(30px, 5vw, 56px);
  text-align: center;
}

.graph-cta h3 {
  margin: 0 0 12px;
  font-size: clamp(1.2rem, 2.2vw, 1.6rem);
  letter-spacing: -0.02em;
}

.graph-cta p {
  margin: 0 auto 20px;
  max-width: 52ch;
  color: var(--muted, #aeb7c4);
  line-height: 1.65;
}

.graph-cta .button {
  display: inline-flex;
}

.graph-page-main > .asp-graph-shell {
  flex: 1 1 0;
  min-height: 0;
  max-height: none;
  overflow: hidden;
}

.graph-page-body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}

.graph-page-body .nav {
  flex-shrink: 0;
  padding: 8px 0 6px;
}

.graph-page-main {
  position: relative;
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
  width: min(1400px, calc(100% - 40px));
  margin: 0 auto;
  padding: 0 0 0;
}

.graph-page-header {
  flex-shrink: 0;
  padding: 4px 0 2px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.graph-page-header h1 {
  margin: 0;
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  letter-spacing: -0.02em;
}

.graph-page-header p {
  margin: 6px 0 0;
  color: var(--muted, #aeb7c4);
  max-width: 52ch;
  line-height: 1.55;
}

.graph-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.graph-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 0 0 4px;
  flex-shrink: 0;
  padding: 0;
  list-style: none;
  color: var(--muted, #aeb7c4);
  font-size: 0.85rem;
}

.graph-legend li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.graph-legend-swatch {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
}

.graph-legend-swatch--page {
  background: rgba(196, 202, 209, 0.82);
}

.graph-legend-swatch--unpublished {
  background: rgba(53, 99, 179, 0.47);
}

.graph-legend-swatch--tag {
  background: #5fae8a;
  box-shadow: 0 0 10px rgba(95, 174, 138, 0.4);
}

.graph-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6px;
  margin: 0;
  flex-shrink: 0;
  color: var(--muted, #aeb7c4);
  font-size: 0.78rem;
  text-align: center;
  pointer-events: none;
  z-index: 4;
}

@media (max-width: 900px) {
  .hero-aside::before {
    max-height: min(72vw, 340px);
  }

  .asp-graph-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .asp-graph-search-wrap {
    max-width: none;
  }

  .asp-graph-toolbar-actions {
    align-self: flex-start;
  }
}
