.paper-notes-3d {
  width: 100%;
  margin: 2.25rem 0 0;
  padding: 1rem;
  border: 1px solid #d8e1ea;
  border-radius: 8px;
  background: linear-gradient(180deg, #fbfcfe 0%, #f8fbff 100%);
  color: #172033;
}

.paper-notes-3d__header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 0 0.85rem;
  border-bottom: 1px solid #d8e1ea;
}

.paper-notes-3d__eyebrow {
  margin: 0 0 0.2rem;
  color: #607086;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

.paper-notes-3d h2 {
  margin: 0;
  padding: 0;
  border-bottom: 0;
  font-size: clamp(1.1rem, 1.7vw, 1.45rem);
  line-height: 1.18;
  letter-spacing: 0;
}

.paper-notes-3d__stats {
  padding: 0.28rem 0.5rem;
  border: 1px solid #dbe4ee;
  border-radius: 8px;
  background: #fff;
  color: #40516a;
  font-size: 0.9rem;
  white-space: nowrap;
}

.paper-notes-3d__workspace {
  margin-top: 1rem;
}

.paper-notes-3d__stage {
  position: relative;
  min-height: 620px;
  border-radius: 8px;
  background:
    radial-gradient(circle at 48% 34%, rgba(58, 72, 92, 0.34), rgba(24, 29, 39, 0.72) 38%, rgba(14, 17, 24, 0.96) 100%),
    linear-gradient(180deg, #1c222d 0%, #10141c 100%);
  border: 1px solid #263140;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 14px 36px rgba(16, 20, 28, 0.08);
}

.paper-notes-3d__stage canvas {
  display: block;
  width: 100%;
  height: 620px;
}

.paper-notes-3d__status {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  max-width: calc(100% - 2rem);
  padding: 0.38rem 0.55rem;
  background: rgba(17, 24, 35, 0.72);
  border: 1px solid rgba(139, 154, 176, 0.28);
  border-radius: 6px;
  color: #d8e2ef;
  font-size: 0.76rem;
  backdrop-filter: blur(8px);
}

.paper-notes-3d__tooltip {
  position: absolute;
  z-index: 2;
  max-width: 320px;
  padding: 0.55rem 0.7rem;
  background: rgba(17, 24, 39, 0.94);
  color: #fff;
  border-radius: 6px;
  font-size: 0.78rem;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 14px 32px rgba(17, 24, 39, 0.18);
}

.paper-notes-3d__tooltip strong {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.82rem;
}

.paper-notes-3d__clusters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.55rem;
  margin-top: 0.85rem;
  padding: 0.6rem;
  border: 1px solid #dde6f0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 26px rgba(28, 45, 67, 0.05);
}

.paper-notes-3d__cluster {
  appearance: none;
  display: block;
  min-width: 0;
  width: 100%;
  padding: 0.52rem 0.58rem;
  border: 1px solid #e1e9f2;
  border-radius: 7px;
  background: rgba(252, 254, 255, 0.86);
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: border-color 160ms ease, box-shadow 160ms ease, opacity 160ms ease, transform 160ms ease;
}

.paper-notes-3d__cluster:hover,
.paper-notes-3d__cluster:focus-visible,
.paper-notes-3d__cluster.is-active {
  border-color: var(--cluster-color, #94a3b8);
  box-shadow: 0 8px 22px var(--cluster-glow, rgba(37, 99, 235, 0.12));
  outline: 0;
  transform: translateY(-1px);
}

.paper-notes-3d__cluster.is-muted {
  opacity: 0.46;
}

.paper-notes-3d__cluster-title {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  margin: 0 0 0.26rem;
  color: #172033;
  font-size: 0.78rem;
  line-height: 1.25;
  letter-spacing: 0;
}

.paper-notes-3d__swatch {
  width: 0.62rem;
  height: 0.62rem;
  flex: 0 0 auto;
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--cluster-glow, rgba(148, 163, 184, 0.14));
}

.paper-notes-3d__count {
  margin-left: auto;
  color: #52627a;
  font-weight: 600;
  font-size: 0.72rem;
}

.paper-notes-3d__keywords {
  display: -webkit-box;
  margin: 0 0 0 1.04rem;
  color: #667085;
  font-size: 0.66rem;
  line-height: 1.32;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

@media (max-width: 900px) {
  .paper-notes-3d {
    padding: 0.85rem;
  }

  .paper-notes-3d__header {
    align-items: start;
    flex-direction: column;
  }

  .paper-notes-3d__stage,
  .paper-notes-3d__stage canvas {
    min-height: 520px;
    height: 520px;
  }

  .paper-notes-3d__clusters {
    grid-template-columns: 1fr;
  }
}
