/* Cartesian 3D Explorer Overlay & Embedding Styles */
#cartesian-3d-container.cartesian-3d-wrapper {
  position: fixed;
  left: var(--deck-left);
  top: auto;
  bottom: clamp(74px, 7vh, 90px);
  width: var(--deck-width);
  height: min(34vh, 360px);
  z-index: 15;
  display: flex;
  flex-direction: column;
  background: rgba(6, 17, 24, 0.94);
  backdrop-filter: blur(20px);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(56, 189, 248, 0.3);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8), 0 0 24px rgba(56, 189, 248, 0.15);
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px) scale(0.98);
  transition: opacity 320ms cubic-bezier(0.2, 0.8, 0.2, 1),
              transform 320ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

#cartesian-3d-container.cartesian-3d-wrapper.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.c3d-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: rgba(8, 27, 36, 0.95);
  border-bottom: 1px solid rgba(56, 189, 248, 0.22);
  gap: 10px;
  flex-shrink: 0;
  height: 38px;
}

.c3d-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.c3d-badge {
  padding: 3px 6px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid #38bdf8;
  border-radius: 4px;
  color: #38bdf8;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.c3d-scene-select {
  background: rgba(14, 38, 50, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 4px;
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  outline: none;
  cursor: pointer;
  max-width: min(36vw, 500px);
}

.c3d-scene-select:focus {
  border-color: #38bdf8;
}

.c3d-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.c3d-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: rgba(15, 33, 44, 0.85);
  border: 1px solid rgba(205, 225, 222, 0.2);
  border-radius: 4px;
  color: #cbd5e1;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: all 180ms ease;
}

.c3d-btn:hover {
  background: rgba(28, 52, 68, 0.95);
  border-color: #38bdf8;
  color: #38bdf8;
}

.c3d-btn.is-active {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
  color: #38bdf8;
}

.c3d-btn-close {
  border-color: rgba(244, 63, 94, 0.4);
  color: #fda4af;
  font-size: 12px;
  padding: 3px 8px;
}

.c3d-btn-close:hover {
  background: rgba(244, 63, 94, 0.25);
  border-color: #f43f5e;
  color: #fff;
}

.c3d-viewport {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow: hidden;
}

.c3d-disclaimer {
  position: absolute;
  right: 12px;
  bottom: 8px;
  z-index: 2;
  max-width: 48%;
  color: rgba(226, 232, 240, 0.58);
  font-size: 9px;
  font-style: italic;
  letter-spacing: 0.025em;
  line-height: 1.2;
  text-align: right;
  pointer-events: none;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.75);
}

.c3d-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}

.c3d-canvas:active {
  cursor: grabbing;
}

@media (max-width: 1100px) and (min-width: 901px) {
  #cartesian-3d-container.cartesian-3d-wrapper {
    width: var(--deck-width);
    height: min(34vh, 340px);
  }
}

@media (max-width: 900px) {
  #cartesian-3d-container.cartesian-3d-wrapper {
    left: 4vw;
    width: min(92vw, 760px);
    height: min(34vh, 300px);
  }
}
