/**
 * Surface Compiler Lab — glTF INDICES · Three.js r170
 */

.doc-gltf-isc {
  --isc-copper: #e8a040;
  --isc-violet: #b56cff;
  --isc-cyan: #5ec8ff;
  --isc-n0: #c9a0ff;
  --isc-n1: #5ec8ff;
  --isc-n2: #e8a040;
  --isc-n3: #5ecf9a;
  --isc-border: rgba(255, 255, 255, 0.08);
  --isc-surface: rgba(255, 255, 255, 0.025);
  margin: 1rem 0 1.25rem;
  padding: 0.95rem;
  border-radius: 12px;
  border: 1px solid rgba(181, 108, 255, 0.14);
  background: linear-gradient(165deg, #060810 0%, #0a0c18 38%, #0c1020 100%);
  box-shadow: 0 0 56px rgba(181, 108, 255, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.doc-gltf-isc__hud {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.55rem;
  margin-bottom: 0.8rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--isc-border);
}

.doc-gltf-isc__tag {
  display: inline-flex;
  padding: 0.16rem 0.48rem;
  border-radius: 4px;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--isc-violet);
  background: rgba(181, 108, 255, 0.12);
  border: 1px solid rgba(181, 108, 255, 0.34);
}

.doc-gltf-isc__hint {
  margin: 0;
  font-size: 0.8rem;
  color: rgba(160, 172, 190, 0.82);
}

.doc-gltf-isc__grid {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.doc-gltf-isc__col {
  border-radius: 10px;
  border: 1px solid var(--isc-border);
  background: var(--isc-surface);
  overflow: hidden;
  width: 100%;
}

.doc-gltf-isc__col-title {
  margin: 0;
  padding: 0.52rem 0.62rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(160, 172, 190, 0.85);
  border-bottom: 1px solid var(--isc-border);
  background: rgba(0, 0, 0, 0.22);
}

.doc-gltf-isc__modes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.65rem 0.75rem;
}

.doc-gltf-isc__mode {
  flex: 1 1 calc(20% - 0.4rem);
  min-width: 6.5rem;
  margin: 0;
  padding: 0.48rem 0.5rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
  font: 0.66rem/1.35 "JetBrains Mono", ui-monospace, monospace;
  color: rgba(180, 195, 220, 0.88);
  background: rgba(0, 0, 0, 0.22);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.doc-gltf-isc__mode strong {
  display: block;
  font-size: 0.72rem;
  color: rgba(220, 230, 245, 0.95);
  margin-bottom: 0.08rem;
}

.doc-gltf-isc__mode-sub {
  display: block;
  font-size: 0.58rem;
  color: rgba(160, 172, 190, 0.62);
}

.doc-gltf-isc__mode.is-active {
  color: #f4ecff;
  border-color: rgba(181, 108, 255, 0.5);
  background: rgba(181, 108, 255, 0.12);
}

.doc-gltf-isc__body {
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  gap: 0.85rem;
  align-items: stretch;
}

.doc-gltf-isc__data-stack {
  padding: 0.65rem 0.75rem 0.75rem;
}

.doc-gltf-isc__panel-title {
  margin: 0 0 0.35rem;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(154, 126, 200, 0.9);
}

.doc-gltf-isc__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
  margin-bottom: 0.55rem;
}

.doc-gltf-isc__stat {
  padding: 0.38rem 0.4rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.28);
  text-align: center;
}

.doc-gltf-isc__stat-val {
  display: block;
  font: 600 1rem/1 "JetBrains Mono", ui-monospace, monospace;
  color: #f0f8ff;
}

.doc-gltf-isc__stat-label {
  display: block;
  margin-top: 0.12rem;
  font-size: 0.54rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(160, 172, 190, 0.68);
}

.doc-gltf-isc__stat.is-hi .doc-gltf-isc__stat-val {
  color: var(--isc-copper);
  text-shadow: 0 0 12px rgba(232, 160, 64, 0.35);
}

.doc-gltf-isc__connection {
  margin-bottom: 0.55rem;
  padding: 0.42rem 0.48rem;
  border-radius: 6px;
  border: 1px solid rgba(232, 160, 64, 0.32);
  background: rgba(232, 160, 64, 0.06);
  font: 0.62rem/1.5 "JetBrains Mono", ui-monospace, monospace;
}

.doc-gltf-isc__connection[hidden],
.doc-gltf-isc__winding-toggle[hidden] {
  display: none;
}

.doc-gltf-isc__connection-head {
  margin: 0 0 0.3rem;
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(232, 180, 100, 0.95);
}

.doc-gltf-isc__connection-meta {
  margin: 0 0 0.35rem;
  color: rgba(180, 195, 220, 0.78);
  font-size: 0.58rem;
}

.doc-gltf-isc__connection-vals {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
}

.doc-gltf-isc__connection-vals li {
  padding: 0.18rem 0.38rem;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 220, 140, 0.95);
}

.doc-gltf-isc__connection-vals li.is-dim {
  opacity: 0.35;
  border-style: dashed;
}

.doc-gltf-isc__connection-vals li.is-shared {
  border-color: rgba(232, 160, 64, 0.55);
  box-shadow: 0 0 8px rgba(232, 160, 64, 0.22);
}

.doc-gltf-isc__stream-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem 0.35rem;
  margin-bottom: 0.55rem;
  padding: 0.38rem 0.45rem;
  border-radius: 6px;
  border: 1px solid rgba(232, 160, 64, 0.28);
  background: rgba(232, 160, 64, 0.05);
  font: 0.62rem "JetBrains Mono", ui-monospace, monospace;
}

.doc-gltf-isc__stream-label {
  font-size: 0.56rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(160, 200, 210, 0.8);
  margin-right: 0.25rem;
}

.doc-gltf-isc__stream-arrow {
  color: rgba(232, 160, 64, 0.8);
  font-weight: 600;
}

.doc-gltf-isc__stream-node {
  padding: 0.12rem 0.32rem;
  border-radius: 4px;
  color: rgba(200, 210, 230, 0.55);
  border: 1px solid transparent;
  transition: color 0.15s, background 0.15s, box-shadow 0.15s;
}

.doc-gltf-isc__stream-node.is-on {
  color: #fff4e0;
  background: rgba(232, 160, 64, 0.18);
  border-color: rgba(232, 160, 64, 0.42);
  box-shadow: 0 0 10px rgba(232, 160, 64, 0.22);
}

.doc-gltf-isc__winding-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.55rem;
}

.doc-gltf-isc__wind-btn {
  flex: 1;
  margin: 0;
  padding: 0.42rem 0.5rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font: 0.62rem "JetBrains Mono", ui-monospace, monospace;
  color: rgba(180, 195, 220, 0.85);
  background: rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.doc-gltf-isc__wind-btn.is-active {
  border-color: rgba(154, 126, 200, 0.5);
  background: rgba(154, 126, 200, 0.14);
  color: #f0e8ff;
}

.doc-gltf-isc__vertex-list {
  margin: 0 0 0.55rem;
  padding: 0;
  list-style: none;
  font: 0.66rem/1.5 "JetBrains Mono", ui-monospace, monospace;
}

.doc-gltf-isc__vertex-list li {
  padding: 0.28rem 0.4rem;
  margin: 0.12rem 0;
  border-radius: 5px;
  border-left: 3px solid transparent;
  transition: background 0.12s, box-shadow 0.12s;
}

.doc-gltf-isc__vertex-item--n0 { color: var(--isc-n0); border-left-color: rgba(201, 160, 255, 0.38); }
.doc-gltf-isc__vertex-item--n1 { color: var(--isc-n1); border-left-color: rgba(94, 200, 255, 0.35); }
.doc-gltf-isc__vertex-item--n2 { color: var(--isc-n2); border-left-color: rgba(232, 160, 64, 0.38); }
.doc-gltf-isc__vertex-item--n3 { color: var(--isc-n3); border-left-color: rgba(94, 207, 154, 0.35); }

.doc-gltf-isc__vertex-list li.is-shared {
  background: rgba(232, 160, 64, 0.1);
  box-shadow: 0 0 0 1px rgba(232, 160, 64, 0.24);
}

.doc-gltf-isc__vertex-list li.is-matrix {
  background: rgba(181, 108, 255, 0.06);
}

.doc-gltf-isc__vertex-list li.is-hovered {
  background: rgba(61, 184, 196, 0.14);
}

.doc-gltf-isc__flow {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  font: 0.64rem "JetBrains Mono", ui-monospace, monospace;
}

.doc-gltf-isc__flow-node {
  padding: 0.22rem 0.42rem;
  border-radius: 4px;
  color: rgba(140, 155, 180, 0.55);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.doc-gltf-isc__flow-node.is-active {
  color: rgba(244, 236, 255, 0.92);
  border-color: rgba(181, 108, 255, 0.38);
  background: rgba(181, 108, 255, 0.08);
  animation: isc-flow-pulse 2.2s ease-in-out infinite;
  animation-delay: var(--isc-delay, 0s);
}

.doc-gltf-isc__flow-node.is-hi {
  color: #f4ecff;
  border-color: rgba(181, 108, 255, 0.52);
  box-shadow: 0 0 12px rgba(181, 108, 255, 0.16);
}

.doc-gltf-isc__flow-node.is-dim { opacity: 0.42; }

.doc-gltf-isc__flow-arrow {
  color: rgba(160, 172, 190, 0.4);
  padding: 0.05rem 0 0.05rem 0.35rem;
}

@keyframes isc-flow-pulse {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 1; box-shadow: 0 0 14px rgba(181, 108, 255, 0.2); }
}

.doc-gltf-isc__scene-wrap {
  position: relative;
  min-height: 420px;
  height: 100%;
  background:
    radial-gradient(ellipse 80% 60% at 50% 100%, rgba(181, 108, 255, 0.08), transparent 70%),
    rgba(4, 6, 14, 0.88);
}

.doc-gltf-isc__scene-wrap [data-isc-mount] {
  position: absolute;
  inset: 0;
}

.doc-gltf-isc__label-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 2;
}

.doc-gltf-isc__vertex-label {
  position: absolute;
  transform: translate(-50%, -100%);
  padding: 0.12rem 0.35rem;
  border-radius: 4px;
  font: 600 0.62rem "JetBrains Mono", ui-monospace, monospace;
  white-space: nowrap;
  background: rgba(0, 0, 0, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: opacity 0.12s, box-shadow 0.12s;
}

.doc-gltf-isc__vertex-label--n0 { color: var(--isc-n0); }
.doc-gltf-isc__vertex-label--n1 { color: var(--isc-n1); }
.doc-gltf-isc__vertex-label--n2 { color: var(--isc-n2); }
.doc-gltf-isc__vertex-label--n3 { color: var(--isc-n3); }

.doc-gltf-isc__vertex-label.is-shared {
  box-shadow: 0 0 14px rgba(232, 160, 64, 0.45);
  border-color: rgba(232, 160, 64, 0.55);
}

.doc-gltf-isc__mount {
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
}

.doc-gltf-isc__scene-hud {
  position: absolute;
  left: 0.55rem;
  bottom: 0.55rem;
  padding: 0.28rem 0.45rem;
  border-radius: 5px;
  font: 0.62rem "JetBrains Mono", ui-monospace, monospace;
  color: rgba(201, 180, 255, 0.92);
  background: rgba(0, 0, 0, 0.68);
  border: 1px solid rgba(181, 108, 255, 0.24);
  pointer-events: none;
  z-index: 3;
}

.doc-gltf-isc__caption {
  margin: 0.75rem 0 0;
  font-size: 0.82rem;
  line-height: 1.55;
  color: rgba(160, 172, 190, 0.88);
}

@media (min-width: 900px) {
  .doc-gltf-isc__scene-wrap { min-height: 440px; }
}

@media (max-width: 900px) {
  .doc-gltf-isc__body { grid-template-columns: 1fr; }
  .doc-gltf-isc__mode { flex: 1 1 calc(50% - 0.4rem); }
  .doc-gltf-isc__scene-wrap { min-height: 360px; }
}

@media (prefers-reduced-motion: reduce) {
  .doc-gltf-isc__flow-node.is-active { animation: none; opacity: 1; }
}
