.profile-live-graph {
  margin-bottom: 1rem;
  border: 1px solid var(--color-border);
  border-radius: 1.25rem;
  background: linear-gradient(180deg, var(--color-card), var(--color-background));
  box-shadow: var(--shadow-card);
  padding: 1.1rem;
  overflow: hidden;
}

.profile-live-graph-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
  margin-top: .85rem;
}

.profile-live-graph-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 15rem;
  gap: .85rem;
  margin-top: 1rem;
}

.profile-live-graph-stage {
  aspect-ratio: 1 / 1;
  width: 100%;
  max-height: 500px;
  border: 1px solid var(--color-border);
  border-radius: 1rem;
  overflow: hidden;
  position: relative;
  background:
    radial-gradient(circle at 50% 35%, oklch(0.25 0.025 280), transparent 44%),
    linear-gradient(135deg, oklch(0.14 0.012 275), oklch(0.09 0.01 275));
}

.profile-live-graph-stage canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}

.profile-live-graph-inspector {
  border: 1px solid var(--color-border);
  border-radius: 1rem;
  background: var(--color-card);
  padding: 1rem;
  min-width: 0;
}

.profile-live-graph-inspector h3 {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: .35rem;
}

.profile-live-graph-inspector p,
.profile-live-graph-muted {
  color: var(--color-muted-foreground);
  font-size: .9rem;
  line-height: 1.55;
}

.profile-live-graph-inspector a {
  display: inline-flex;
  margin-top: .85rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: .45rem .7rem;
  background: var(--color-tag);
  color: var(--color-tag-foreground);
  font-size: .88rem;
  font-weight: 700;
}

.profile-live-graph-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-top: .75rem;
}

.profile-live-graph-meta span {
  border-radius: 999px;
  background: var(--color-tag);
  color: var(--color-tag-foreground);
  font-size: .76rem;
  padding: .24rem .5rem;
}

.profile-live-graph-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-top: .85rem;
}

.profile-live-graph-legend span {
  display: inline-flex;
  align-items: center;
  gap: .38rem;
  border-radius: 999px;
  background: var(--color-tag);
  color: var(--color-tag-foreground);
  font-size: .78rem;
  padding: .3rem .58rem;
}

.profile-live-graph-legend-item {
  display: inline-flex;
  align-items: center;
  gap: .38rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--color-tag);
  color: var(--color-tag-foreground);
  font-size: .78rem;
  padding: .3rem .58rem;
  cursor: pointer;
  transition: opacity .15s ease, border-color .15s ease, transform .15s ease;
}

.profile-live-graph-legend-item:hover {
  transform: translateY(-1px);
}

.profile-live-graph-legend-item.is-dim {
  opacity: .35;
}

.profile-live-graph-legend-item.is-active {
  border-color: var(--color-border);
}

.profile-live-graph-legend i,
.profile-live-graph-legend-item i {
  width: .7rem;
  height: .7rem;
  border-radius: 999px;
  display: inline-block;
}

@media (max-width: 820px) {
  .profile-live-graph-stage {
    max-height: none;
  }
}

/* Insights (merged profile + tags) */
.insights-tags {
  margin-bottom: 1rem;
}

.insights-count {
  color: var(--color-muted-foreground);
  font-size: .9rem;
  font-weight: 500;
  letter-spacing: 0;
}

.insights-tag-link {
  text-decoration: none;
  transition: all .15s ease;
}

.insights-tag-link:hover {
  background: var(--color-border);
  transform: translateY(-1px);
}

/* Quality filter (index) */
.quality-filter {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-bottom: 1rem;
}

.quality-pill {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-tag);
  color: var(--color-tag-foreground);
  font-size: .85rem;
  font-weight: 600;
  padding: .42rem .8rem;
  text-decoration: none;
  transition: all .15s ease;
}

.quality-pill span {
  opacity: .55;
  font-weight: 500;
}

.quality-pill:hover {
  background: var(--color-border);
  transform: translateY(-1px);
}

.quality-pill.is-active {
  border-color: var(--color-accent);
  color: var(--color-foreground);
  box-shadow: 0 0 0 1px var(--color-accent) inset;
}

.quality-pill-issues.is-active {
  border-color: oklch(0.7 0.16 60);
  box-shadow: 0 0 0 1px oklch(0.7 0.16 60) inset;
}

.note-card-side {
  display: inline-flex;
  align-items: flex-start;
  gap: .5rem;
  flex-shrink: 0;
}

.quality-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 999px;
  background: oklch(0.7 0.16 60 / .16);
  color: oklch(0.72 0.16 60);
  font-size: .8rem;
  line-height: 1;
  cursor: help;
}

/* Login page */
.login-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
}

.login-card {
  max-width: 24rem;
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: 1.5rem;
  background: var(--color-card);
  box-shadow: var(--shadow-card);
  padding: 2rem;
  text-align: center;
}

.login-title {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -.05em;
  margin-bottom: .75rem;
}

.login-muted {
  color: var(--color-muted-foreground);
  line-height: 1.6;
  font-size: .95rem;
}

.login-note {
  margin-top: 1rem;
  font-size: .85rem;
  opacity: .6;
}

/* 3-column profile grid */
.profile-col-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  grid-column: 1 / -1;
}

/* Pagination */
.pagination-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  margin-top: 2rem;
  padding: .75rem 0;
}

.pagination-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.2rem;
  height: 2.2rem;
  padding: 0 .55rem;
  border-radius: .6rem;
  font-size: .9rem;
  font-weight: 500;
  color: var(--color-muted-foreground);
  background: var(--color-card);
  border: 1px solid var(--color-border);
  transition: all .15s ease;
  text-decoration: none;
  line-height: 1;
}

.pagination-link:hover {
  border-color: var(--color-accent);
  color: var(--color-foreground);
  box-shadow: 0 0 0 1px var(--color-accent/0.3);
}

.pagination-link.is-current {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
  font-weight: 700;
  cursor: default;
}

.pagination-gap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  color: var(--color-muted-foreground);
  font-size: .85rem;
  letter-spacing: .1em;
  user-select: none;
}

/* Tag cloud */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: .5rem .65rem;
  padding: .5rem 0;
  line-height: 1.2;
}

.tag-cloud-cluster {
  margin-bottom: 1rem;
}

.tag-cloud-cluster-label {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--color-accent);
  font-weight: 700;
  margin-bottom: .5rem;
  text-align: center;
}

.tag-cloud a {
  display: inline-block;
  text-decoration: none;
  color: var(--color-tag-foreground);
  background: var(--color-tag);
  border-radius: 999px;
  padding: .3rem .65rem;
  transition: all .15s ease;
  white-space: nowrap;
  line-height: 1.3;
}

.tag-cloud a:hover {
  background: var(--color-accent);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px oklch(0.68 0.19 295 / .25);
}

.tag-cloud a em {
  font-style: normal;
  opacity: .55;
  margin-left: .2em;
  font-size: .85em;
}

.tag-cloud a:hover em {
  opacity: .8;
}

/* Note graph — compact ego-graph on note page */
.note-graph-section {
  margin-top: 2rem;
  border: 1px solid var(--color-border);
  border-radius: 1.25rem;
  background: linear-gradient(180deg, var(--color-card), var(--color-background));
  box-shadow: var(--shadow-card);
  padding: 1.1rem;
  overflow: hidden;
}

.note-graph-section h2 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -.03em;
}

.note-graph-stage {
  min-height: 360px;
  border: 1px solid var(--color-border);
  border-radius: 1rem;
  overflow: hidden;
  margin-top: .75rem;
  background:
    radial-gradient(circle at 50% 40%, oklch(0.22 0.018 275), transparent 40%),
    linear-gradient(135deg, oklch(0.14 0.012 275), oklch(0.09 0.01 275));
}

.note-graph-stage canvas {
  width: 100%;
  height: 360px;
  display: block;
  touch-action: none;
  cursor: grab;
}

.note-graph-cosmos {
  width: 100%;
  height: 360px;
  position: relative;
  cursor: grab;
}

.note-graph-cosmos canvas {
  display: block;
}

.note-graph-tooltip {
  max-width: 260px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity .12s ease;
  line-height: 1.4;
  pointer-events: none;
}

/* Tag cloud tooltip */
.tag-tooltip {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: .65rem;
  padding: .35rem .65rem;
  font-size: .85rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
  transition: opacity .12s ease;
  line-height: 1.4;
}

/* Tag cloud D3 */
.tag-cloud-d3 {
  position: relative;
  width: 100%;
  height: 340px;
  cursor: default;
}

.tag-cloud-d3 svg {
  display: block;
}




