/* Graph pages are full-screen tools: hide the share-line blockquote that
   pushes the canvas below the fold (it stays in the HTML for LinkedIn
   manifest generation, just not visually). */
main.site-main:has(.graph-page) > blockquote {
  display: none;
}

main.site-main:has(.graph-page),
main.site-main.graph-active {
  max-width: none !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.graph-page {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.graph-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.6rem;
  padding: 0.5rem 0.75rem;
}

.graph-header h1 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.graph-stats {
  color: var(--text-muted);
  font-size: 0.72rem;
}

.graph-controls {
  margin-left: auto;
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.graph-controls button,
.graph-controls a {
  font: inherit;
  font-size: 0.72rem;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.50);
  background: rgba(255, 255, 255, 0.28);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.16s ease;
}

.graph-controls button:hover,
.graph-controls a:hover {
  background: rgba(255, 255, 255, 0.62);
  border-color: rgba(255, 255, 255, 0.90);
  color: var(--farshid-blue);
}

.graph-tabs {
  display: flex;
  gap: 0;
  padding: 0 0.75rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--glass-border);
}

.graph-tabs::-webkit-scrollbar { display: none; }

.graph-tab {
  font: inherit;
  font-size: 0.72rem;
  padding: 0.45rem 0.8rem;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.graph-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.graph-tab.active {
  color: #0a84ff;
  border-bottom-color: #0a84ff;
  font-weight: 600;
}

.graph-tab .dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}

#graph-wrap {
  flex: 1;
  min-height: 250px;
  height: calc(100dvh - 16rem);
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 30% 20%, rgba(90, 200, 250, 0.06), transparent 40%),
    radial-gradient(circle at 70% 80%, rgba(52, 199, 89, 0.04), transparent 45%);
}

#graph-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}

.graph-tooltip {
  display: none;
  position: fixed;
  z-index: 100;
  padding: 8px 12px;
  background: var(--glass-bg, rgba(30,30,30,0.95));
  border: 1px solid var(--glass-border, rgba(255,255,255,0.15));
  border-radius: 8px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  pointer-events: none;
  max-width: 220px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.gt-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.gt-cat {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.gt-hint {
  font-size: 0.6rem;
  color: var(--text-muted);
  margin-top: 3px;
  opacity: 0.6;
}

.graph-legend {
  display: flex;
  gap: 0.6rem;
  padding: 0.4rem 0.75rem;
  font-size: 0.65rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.graph-legend span {
  white-space: nowrap;
  flex-shrink: 0;
}

.graph-legend span::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 3px;
  vertical-align: middle;
}

.legend-hub::before { background: #0a84ff; }
.legend-cv::before { background: #30d158; }
.legend-ai::before { background: #bf5af2; }
.legend-cuda::before { background: #ff9f0a; }
.legend-paper::before { background: #5ac8fa; }
.legend-journal::before { background: #64d2ff; }
.legend-book::before { background: #ffd60a; }
.legend-patent::before { background: #ff375f; }
.legend-keynote::before { background: #ff6482; }
.legend-course::before { background: #00c7be; }
.legend-pkm::before { background: #ac8e68; }
.legend-business::before { background: #8e8e93; }

.graph-hint {
  padding: 0 0.75rem 0.4rem;
  font-size: 0.68rem;
  color: var(--text-muted);
}

.graph-bottom-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
}

.graph-open-btn {
  display: none;
  padding: 0.4rem 0.8rem !important;
  font-weight: 600;
  color: var(--farshid-blue) !important;
  background: rgba(10, 132, 255, 0.10) !important;
  border: 1px solid rgba(10, 132, 255, 0.30) !important;
  border-radius: 999px !important;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.16s ease;
  font-size: 0.75rem;
}

.graph-open-btn:hover {
  background: rgba(10, 132, 255, 0.20) !important;
  border-color: rgba(10, 132, 255, 0.50) !important;
}

.graph-open-btn strong {
  font-weight: 700;
}

@media (min-width: 768px) {
  .graph-header { padding: 0.75rem 1rem; }
  .graph-header h1 { font-size: 1.1rem; }
  .graph-controls { gap: 0.4rem; }
  .graph-controls button, .graph-controls a { font-size: 0.82rem; padding: 0.35rem 0.7rem; }
  .graph-filters { padding: 0 1rem; gap: 0.3rem; }
  .graph-filter-btn { font-size: 0.72rem; padding: 0.25rem 0.6rem; }
  .graph-filter-btn .dot { width: 6px; height: 6px; }
  #graph-wrap { height: calc(100dvh - 18rem); min-height: 300px; }
  .graph-legend { gap: 1rem; font-size: 0.78rem; padding: 0.5rem 1rem; }
  .graph-legend span::before { width: 8px; height: 8px; }
  .graph-hint { font-size: 0.78rem; }
}
