* { box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background: #fada61;
  font-family: Arial, Helvetica, sans-serif;
}

.page {
  position: relative;
  width: 100vw;
  height: 100vh;

  /* Keep the world layers in one isolated stacking context. */
  isolation: isolate;
  overflow: hidden;
}

/*
 * V31 WORLD-SPACE GRADIENT
 * ------------------------
 * The gradient remains visually identical to the established background,
 * but its centre is anchored to a fixed WORLD coordinate supplied by JS.
 * As the camera pans, --world-gradient-x/y move across the viewport.
 *
 * This is not a translated viewport-sized bitmap: the CSS conic-gradient
 * is mathematically evaluated for the full viewport around a world-space
 * origin, so no finite background edges can be exposed by panning.
 */
.world-background {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;

  --world-gradient-x: 50vw;
  --world-gradient-y: 50vh;

  background: conic-gradient(
    from 60deg at var(--world-gradient-x) var(--world-gradient-y),
    #fada61 0deg,
    #ff9188 180deg,
    #ff5acd 60deg
  );
}

#shadowCanvas,
#canvas,
#threeCanvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100vw;
  height: 100vh;
}

#shadowCanvas {
  z-index: 1;
  pointer-events: none;
}

#canvas {
  z-index: 2;
  cursor: grab;

  /*
   * Required for the dedicated pointer pan controller.
   * Browser touch scrolling/zooming must not consume canvas pan gestures.
   */
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

#canvas.is-panning,
#canvas:active {
  cursor: grabbing;
}

#threeCanvas {
  z-index: 3;
  pointer-events: none;
}

.controls {
  position: fixed;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 10;
  max-height: 190px;
  overflow: auto;
  padding: 10px;
  background: rgba(255,255,255,.88);
  border-radius: 10px;
  backdrop-filter: blur(8px);
}

.controls__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.filters button,
#showAll {
  border: 1px solid rgba(0,0,0,.18);
  border-radius: 6px;
  background: white;
  padding: 5px 8px;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
}

.filters button.is-active,
#showAll.is-active {
  background: #111;
  color: #fff;
}

#status,
.hint {
  font-size: 12px;
  opacity: .72;
}


.zoom-ui {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 9;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  background: rgba(255,255,255,.88);
  border-radius: 10px;
  backdrop-filter: blur(8px);
  box-shadow: 0 6px 24px rgba(0,0,0,.12);
}

.zoom-ui button {
  border: 1px solid rgba(0,0,0,.16);
  background: #fff;
  border-radius: 6px;
  min-width: 34px;
  height: 30px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.zoom-ui input[type="range"] {
  width: 150px;
}

@media (max-width: 700px) {
  .zoom-ui {
    right: 10px;
    bottom: 10px;
  }

  .zoom-ui input[type="range"] {
    width: 110px;
  }
}


.shadow-calibrator {
  position: absolute;
  left: 18px;
  bottom: 18px;
  z-index: 9;
  width: min(330px, calc(100vw - 36px));
  max-height: min(70vh, 620px);
  overflow: auto;
  padding: 12px;
  background: rgba(255,255,255,.92);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  box-shadow: 0 6px 24px rgba(0,0,0,.14);
  font-size: 12px;
}

.shadow-calibrator__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.shadow-calibrator__header strong {
  font-size: 13px;
}

.shadow-calibrator button {
  border: 1px solid rgba(0,0,0,.16);
  background: #fff;
  border-radius: 6px;
  min-height: 30px;
  padding: 5px 9px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.shadow-control {
  margin: 8px 0;
}

.shadow-control label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 3px;
}

.shadow-control output {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.shadow-control input[type="range"] {
  width: 100%;
}

.shadow-calibrator__values {
  margin-top: 10px;
  padding: 8px;
  border-radius: 7px;
  background: rgba(0,0,0,.055);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.copy-shadow-values {
  width: 100%;
  margin-top: 8px;
}

.copy-status {
  display: block;
  min-height: 16px;
  margin-top: 5px;
  opacity: .7;
}

@media (max-width: 700px) {
  .shadow-calibrator {
    left: 10px;
    bottom: 58px;
    max-height: 56vh;
  }
}


.bearing-inspector,
.profile-picker {
  padding: 9px;
  margin: 8px 0 10px;
  border: 1px solid rgba(0,0,0,.10);
  border-radius: 8px;
  background: rgba(255,255,255,.48);
}

.bearing-inspector__title,
.profile-picker__title {
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  opacity: .62;
}

.selected-asset {
  margin-bottom: 7px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.bearing-readout {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 4px;
  margin-bottom: 8px;
  font-size: 10px;
}

.bearing-readout span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.bearing-readout strong {
  font-size: 12px;
}

.bearing-override,
.profile-tabs {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: 4px;
}

.profile-tabs {
  grid-template-columns: repeat(3,1fr);
}

.bearing-override button,
.profile-tabs button {
  min-width: 0;
  padding: 5px 4px;
  font-size: 11px;
}

.bearing-override button.is-active,
.profile-tabs button.is-active {
  background: #111;
  color: #fff;
}




/* V23 full calibrator: allow the expanded control set to scroll independently. */
.shadow-calibrator {
  max-height: min(78vh, 760px);
  overflow-y: auto;
}

.proxy-calibration{margin:0 0 12px;padding:10px;border:1px solid rgba(0,0,0,.12);border-radius:9px;background:rgba(255,255,255,.46)}
.proxy-calibration__title{margin-bottom:7px;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.04em;opacity:.65}
.proxy-selected{display:flex;flex-direction:column;gap:2px;margin-bottom:8px;font-size:10px}
.proxy-selected strong{font-size:12px;overflow-wrap:anywhere}
.proxy-mode-row{display:grid;grid-template-columns:repeat(2,1fr);gap:4px;margin-bottom:9px}
.proxy-mode-row button.is-active{background:#111;color:#fff}

.profile-persistence{margin:8px 0 10px;padding-top:8px;border-top:1px solid rgba(0,0,0,.1)}
.profile-persistence__row{display:grid;grid-template-columns:1fr 1fr;gap:4px;margin-bottom:4px}
.profile-persistence button{min-height:30px;font-size:11px;padding:5px 6px}


/* ============================================================
   V42 T3D GLOVE CURSOR — ELEVATED / CONTACT DEPTH STATES
   Supplied PNGs are used verbatim; no regeneration or pixel edits.
   ============================================================ */
#canvas,
#canvas.is-panning,
#canvas:active {
  cursor: none !important;
}

.t3d-cursor {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 9;
  width: 220px;
  height: auto;
  max-width: none;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  transform-origin: 0 0;
  will-change: transform, opacity;
  /* V42: shadow is rendered by the dedicated alpha-silhouette canvas.
     The script switches between elevated (+80/+80) and contact (+40/+40)
     distance calibrations while preserving the same penumbra recipe. */
  filter: none;
  opacity: 0;
  visibility: hidden;
}


.t3d-cursor-shadow {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 8;
  pointer-events: none;
  user-select: none;
  opacity: 0;
  visibility: hidden;
  will-change: transform, opacity;
}

.t3d-cursor-shadow.is-visible {
  opacity: 1;
  visibility: visible;
}

.t3d-cursor.is-visible {
  opacity: 1;
  visibility: visible;
}

/* ============================================================
 * V43 MANIPULATOR MODES
 * Shadow calibration is now locked and no longer exposed as UI.
 * ============================================================ */
.shadow-calibrator[hidden] {
  display: none !important;
}

.manipulator-ui {
  position: absolute;
  left: 18px;
  bottom: 18px;
  z-index: 9;
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 250px;
  padding: 10px;
  background: rgba(255,255,255,.90);
  border-radius: 10px;
  backdrop-filter: blur(8px);
  box-shadow: 0 6px 24px rgba(0,0,0,.12);
}

.manipulator-ui__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  opacity: .65;
}

.manipulator-ui__buttons {
  display: flex;
  gap: 6px;
}

.manipulator-ui button {
  border: 1px solid rgba(0,0,0,.16);
  background: #fff;
  border-radius: 6px;
  min-height: 30px;
  padding: 5px 9px;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
}

.manipulator-ui button.is-active {
  background: #111;
  color: #fff;
}

.manipulator-ui__hint {
  font-size: 11px;
  opacity: .65;
}

@media (max-width: 700px) {
  .manipulator-ui {
    left: 10px;
    bottom: 10px;
    min-width: 220px;
  }

  .manipulator-ui__buttons {
    flex-direction: column;
  }
}


/* ============================================================
 * V44 MANIPULATOR ARRIVAL EFFECTS
 * ============================================================ */
.gripper-wire {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 7;
  width: 1px;
  height: 0;
  pointer-events: none;
  user-select: none;
  opacity: 0;
  visibility: hidden;
  background-image: url("cursors/Master_Gripper_Wire.png");
  background-repeat: repeat-y;
  background-position: center top;
  background-size: 1px 1px;
  transform-origin: top center;
  will-change: left, height, opacity;
}
.gripper-wire.is-visible { opacity: 1; visibility: visible; }


/* V57: reusable TISO manifestation-cloud overlay. */
.manifestation-smoke-layer {
  position: fixed;
  inset: 0;
  z-index: 9;
  pointer-events: none;
  overflow: hidden;
}
.manifestation-smoke {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.glove-smoke {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 10;
  width: 1px;
  height: 1px;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
}
.glove-smoke.is-active { opacity: 1; visibility: visible; }
.glove-smoke__puff {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--size);
  height: var(--size);
  margin-left: calc(var(--size) * -0.5);
  margin-top: calc(var(--size) * -0.5);
  border-radius: 50%;
  background: radial-gradient(circle at 42% 38%, rgba(255,255,255,.94) 0 24%, rgba(235,235,235,.78) 40%, rgba(185,185,185,.32) 66%, rgba(150,150,150,0) 76%);
  filter: blur(2px);
  opacity: 0;
  transform: translate(0,0) scale(.25);
  animation: gloveSmokePuff 620ms cubic-bezier(.18,.72,.18,1) forwards;
  animation-delay: var(--delay);
}
@keyframes gloveSmokePuff {
  0% { opacity: 0; transform: translate(0,0) scale(.25); }
  18% { opacity: .92; }
  58% { opacity: .72; }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1.35); }
}
@media (prefers-reduced-motion: reduce) {
  .glove-smoke__puff { animation-duration: 1ms; animation-delay: 0ms; }
}

/* V52: calibration panel intentionally restored for definitive Tall-profile tuning. */
.shadow-calibrator { z-index: 30; }


/* V64 grouping controls, inside the established toolbar. */
#groupNavigator {max-width:240px;} #groupingStatus {font-size:11px;}
.semantic-settings {font-size:12px;} .semantic-settings summary {cursor:pointer;}
.semantic-panel {position:absolute;z-index:100;top:100%;left:12px;width:min(560px,calc(100vw - 24px));max-height:65vh;overflow:auto;background:#fffbea;border:1px solid #333;padding:16px;box-shadow:0 6px 20px #0003;}
.semantic-panel label {display:block;margin:10px 0;} .semantic-panel select {max-width:100%;}
#semanticRecord {max-height:260px;overflow:auto;white-space:pre-wrap;font-size:11px;background:#fff;padding:10px;}

#canvasView{font-size:11px;font-weight:bold;} .semantic-panel fieldset{margin:12px 0;border:1px solid #b9aa90;} .semantic-panel input{max-width:100%;}

/* Keep the object inspector outside the toolbar's scrollable Master list. */
.controls{max-height:none;overflow:visible;}
.filters{max-height:90px;overflow:auto;}
.semantic-panel{top:calc(100% + 8px);max-height:min(65vh,calc(100vh - 240px));}

/* V66 human authorship is visible without opening a data inspector. */
.worldview-studio[hidden],.gathering-indicator[hidden]{display:none;}
.worldview-studio{position:fixed;z-index:11;left:50%;bottom:18px;transform:translateX(-50%);width:min(700px,calc(100vw - 600px));min-width:310px;background:#f4fffcf5;color:#153d36;border:2px solid #087f70;border-radius:12px;padding:12px 16px;box-shadow:0 8px 24px #06483b30;font-size:12px;}
.worldview-studio__heading{display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:15px;}
.worldview-marker{width:10px;height:10px;border-radius:50%;background:#087f70;}
#worldviewCounts{font-size:11px;margin-left:auto;}
.worldview-studio p{margin:7px 0;line-height:1.4;}
#worldviewSelection{padding:8px 0;border-top:1px solid #087f7033;font-size:11px;line-height:1.5;}
.worldview-compose{display:flex;gap:6px;align-items:center;flex-wrap:wrap;}
.worldview-compose label{font-weight:bold;}
.worldview-compose input{flex:1;min-width:160px;padding:7px;border:1px solid #73a99d;border-radius:5px;}
.worldview-compose button{padding:7px 10px;color:white;background:#076d60;border:0;border-radius:5px;cursor:pointer;}
.worldview-compose button:disabled{opacity:.45;cursor:default;}
.worldview-studio__footer{display:grid;gap:4px;margin-top:8px;font-size:10px;}
#worldviewFeedback{font-weight:bold;}
body.is-worldview .page{box-shadow:inset 0 0 0 4px #087f70;}
.gathering-indicator{position:fixed;z-index:12;left:50%;top:220px;transform:translateX(-50%);padding:10px 16px;border-radius:20px;background:#fff9e8ee;box-shadow:0 3px 12px #0002;display:flex;gap:12px;align-items:center;font-size:12px;pointer-events:none;}
.gathering-indicator progress{width:100px;accent-color:#087f70;}
@media(max-width:1050px){.worldview-studio{width:calc(100vw - 36px);bottom:98px;min-width:0;}.worldview-studio__footer{font-size:9px;}}

/* The startup camera owns framing until the complete collection is ready. */
body.is-loading .controls button,body.is-loading .controls select,body.is-loading .controls input,body.is-loading .zoom-ui,body.is-loading .manipulator-ui{pointer-events:none;opacity:.55;}

.spacing-control{display:inline-flex;align-items:center;gap:6px;font-size:12px;} .spacing-control input{width:105px;} .spacing-control output{min-width:34px;font-variant-numeric:tabular-nums;}

#selectionOutlineCanvas{position:absolute;inset:0;display:block;width:100vw;height:100vh;z-index:4;pointer-events:none;}
