/* ── Sphere warp ── */

.sphere-defs { position: absolute; width: 0; height: 0; }

#sphere-backdrop {
  position: fixed; inset: 0;
  background: rgba(245, 240, 235, 0.6);
  backdrop-filter: blur(6px);
  z-index: 30;
  transition: opacity 0.35s;
}

#sphere-backdrop.hidden { opacity: 0; pointer-events: none; }

#sphere-warp {
  position: fixed;
  top: 2vh; bottom: 2vh; left: 3vw; right: 3vw;
  z-index: 31;
  display: grid;
  grid-template-columns: 170px 1fr 170px;
  clip-path: url(#sphere-clip);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s;
}

#sphere-warp.hidden {
  opacity: 0; pointer-events: none;
  transform: scale(0.01);
}

.sphere-side {
  padding: 28px 14px 28px 20px;
  overflow-y: auto;
  font-size: 12px; line-height: 1.6;
}

#sphere-right { padding: 28px 20px 28px 14px; }

#sphere-center {
  padding: 32px 28px;
  overflow-y: auto;
  border-left: 1px solid rgba(0, 0, 0, 0.06);
  border-right: 1px solid rgba(0, 0, 0, 0.06);
}

.sphere-panel-title {
  font-size: 10px; text-transform: uppercase;
  letter-spacing: 1.2px; color: #aaa;
  margin-bottom: 16px;
}

.sphere-title {
  font-size: 22px; font-weight: 600;
  color: #1a1a1a; margin-bottom: 8px; line-height: 1.3;
}

.sphere-cluster { font-size: 11px; color: #8a8a8a; margin-bottom: 16px; }

.sphere-weight {
  height: 3px; background: rgba(0, 0, 0, 0.06);
  border-radius: 2px; margin-bottom: 20px; overflow: hidden;
}

.sphere-weight-fill {
  height: 100%; background: rgba(120, 100, 40, 0.4); border-radius: 2px;
}

.sphere-dim { margin-bottom: 14px; }

.sphere-dim-label {
  font-size: 10px; text-transform: uppercase;
  letter-spacing: 1px; color: #aaa; margin-bottom: 6px;
}

.sphere-dim-tags { display: flex; flex-wrap: wrap; gap: 4px; }

.sphere-tag {
  display: inline-block; padding: 3px 10px;
  border-radius: 4px; background: rgba(0, 0, 0, 0.04);
  color: #555; cursor: pointer; font-size: 12px;
  transition: background 0.15s, color 0.15s;
}

.sphere-tag:hover { background: rgba(80, 120, 200, 0.12); color: #2a5aaa; }

.sphere-action {
  padding: 8px 12px; margin-bottom: 4px;
  border-radius: 6px; cursor: pointer; color: #4a4a4a;
  transition: background 0.15s, color 0.15s;
}

.sphere-action:hover { background: rgba(0, 0, 0, 0.05); color: #1a1a1a; }
.sphere-danger { color: #a05040; }
.sphere-danger:hover { background: rgba(200, 80, 60, 0.1); color: #803828; }
.sphere-collected { color: #7a6a20; pointer-events: none; }

.sphere-warp-input {
  padding: 8px 12px; display: flex; gap: 6px;
}

.sphere-warp-input.hidden { display: none; }

.sphere-warp-input input {
  flex: 1; padding: 4px 8px;
  font-family: inherit; font-size: 11px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 4px; outline: none;
}

.sphere-warp-input button {
  padding: 4px 10px; font-family: inherit; font-size: 11px;
  border: 1px solid rgba(0, 0, 0, 0.1); border-radius: 4px;
  background: rgba(160, 140, 40, 0.1); color: #7a6a20; cursor: pointer;
}

.sphere-warp-badge {
  padding: 8px 12px; color: #6a5a20;
  font-weight: 600; font-size: 12px;
}

.sphere-neighbor {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: 4px;
  cursor: pointer; transition: background 0.15s;
}

.sphere-neighbor:hover { background: rgba(0, 0, 0, 0.05); }

.sphere-neighbor-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}

.sphere-neighbor-name {
  color: #4a6a9a; font-size: 12px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.sphere-empty { color: #bbb; font-size: 11px; font-style: italic; }

.sphere-abstract {
  font-size: 13px; line-height: 1.7; color: #3a3a3a;
  margin-bottom: 18px; padding-bottom: 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  white-space: pre-wrap;
}

.sphere-source {
  font-size: 10px; margin-bottom: 14px;
}

.sphere-origin { font-size: 11px; color: #8a7a50; margin: -6px 0 14px; }
.sphere-lede { font-size: 13px; line-height: 1.6; color: #3a3a3a; margin-bottom: 6px; }

.sphere-source a {
  color: #8a8a8a; text-decoration: none;
  transition: color 0.15s;
}

.sphere-source a:hover { color: #4a6a9a; text-decoration: underline; }

.sphere-ai-context { margin-bottom: 14px; min-height: 20px; }

.sphere-ai-loading {
  font-size: 11px; color: #bbb; font-style: italic;
}

.sphere-ai-text p { margin: 0 0 10px; }
.sphere-ai-text p:last-child { margin-bottom: 0; }

.sphere-ai-text {
  font-size: 13px; line-height: 1.7; color: #3a3a3a;
  padding: 8px 10px; border-radius: 6px;
  background: rgba(120, 100, 40, 0.05);
  border-left: 2px solid rgba(120, 100, 40, 0.2);
}

@media (max-width: 900px) {
  #sphere-warp { grid-template-columns: 120px 1fr 120px; left: 1vw; right: 1vw; }
}

@media (max-width: 600px) {
  #sphere-warp { grid-template-columns: 1fr; grid-template-rows: auto 1fr auto; }
  .sphere-side { padding: 16px; }
  #sphere-center { border: none; border-top: 1px solid rgba(0,0,0,0.06); border-bottom: 1px solid rgba(0,0,0,0.06); }
}
