:root {
  color-scheme: light;

  /* Unicast brand palette (sampled from unicast.ca). RGB triplets are kept
     alongside each hex so we can compose rgba() values for translucent
     UI surfaces (tooltips, glows, etc.) without losing the brand color. */
  --unicast-orange: #f15a29;
  --unicast-orange-rgb: 241, 90, 41;
  --unicast-orange-soft: #f7922f;
  --unicast-orange-soft-rgb: 247, 146, 47;
  --unicast-dark: #3b3b3c;
  --unicast-dark-rgb: 59, 59, 60;
  --unicast-dark-deep: #2d2e2f;
  --unicast-dark-deep-rgb: 45, 46, 47;
}

html,
body {
  height: 100%;
  margin: 0;
  background: #ffffff;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto,
    Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

model-viewer {
  width: 100vw;
  height: 100vh;
  background: #ffffff;
  --min-hotspot-opacity: 0.25;
}

.picker-panel {
  position: fixed;
  left: 16px;
  top: 16px;
  z-index: 20;
  width: min(360px, calc(100vw - 32px));
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(12, 18, 28, 0.9);
  backdrop-filter: blur(10px);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(0, 0, 0, 0.2) inset;
  color: #d6dee7;
}

.picker-panel[hidden] {
  display: none;
}

.picker-row {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.picker-row + .picker-row {
  margin-top: 10px;
}

.picker-title {
  font-size: 13px;
  letter-spacing: 0.02em;
  color: rgba(214, 222, 231, 0.9);
}

.picker-btn,
.picker-toggle {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #eaf1fb;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
}

.picker-btn:focus-visible,
.picker-toggle:focus-visible {
  outline: 2px solid rgba(99, 179, 237, 0.8);
  outline-offset: 2px;
}

.picker-toggle[aria-pressed="true"] {
  border-color: rgba(99, 179, 237, 0.55);
  background: rgba(99, 179, 237, 0.16);
}

.axis-group {
  display: flex;
  gap: 6px;
  align-items: center;
}

.axis-btn {
  width: 38px;
  justify-content: center;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 8px 0;
}

.axis-btn[data-axis="x"] .axis-dot {
  background: #ff4d4d;
}
.axis-btn[data-axis="y"] .axis-dot {
  background: #3dff87;
}
.axis-btn[data-axis="z"] .axis-dot {
  background: #4da3ff;
}

.axis-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3) inset;
}

.axis-btn[aria-pressed="true"] {
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(255, 255, 255, 0.22);
}

.picker-output {
  width: 100%;
  box-sizing: border-box;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.25);
  color: #eaf1fb;
  padding: 10px;
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  resize: vertical;
  min-height: 56px;
}

.picker-hint {
  font-size: 12px;
  color: rgba(214, 222, 231, 0.75);
}

/* Probe hotspot */
.probe-hotspot {
  position: relative;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  background: transparent;
  pointer-events: auto;
  touch-action: none;
}

.probe-dot {
  position: absolute;
  left: 0;
  top: 0;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.9);
  box-shadow:
    0 0 0 2px rgba(0, 0, 0, 0.5),
    0 0 20px rgba(99, 179, 237, 0.55);
  pointer-events: none;
}

.probe-gizmo {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(12px, -12px);
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  pointer-events: auto;
}

.probe-axis {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
  color: #eaf1fb;
  font-size: 12px;
  line-height: 1;
  padding: 7px 10px;
  width: 46px;
  cursor: grab;
  user-select: none;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  touch-action: none;
}

.probe-axis:active {
  cursor: grabbing;
}

.probe-axis[data-axis="x"] {
  border-color: rgba(255, 77, 77, 0.45);
}
.probe-axis[data-axis="y"] {
  border-color: rgba(61, 255, 135, 0.4);
}
.probe-axis[data-axis="z"] {
  border-color: rgba(77, 163, 255, 0.45);
}

.probe-axis .probe-axis-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.55));
}

.probe-axis .probe-axis-arrow svg {
  display: block;
}

.probe-axis[data-axis="x"] .probe-axis-arrow {
  color: #ff4d4d;
}
.probe-axis[data-axis="y"] .probe-axis-arrow {
  color: #3dff87;
}
.probe-axis[data-axis="z"] .probe-axis-arrow {
  color: #4da3ff;
}

/* Annotation hotspots */
.annot-hotspot {
  position: relative;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  background: transparent;
  pointer-events: auto;
  touch-action: none;
  cursor: pointer;
}

.annot-pulse {
  position: absolute;
  left: 0;
  top: 0;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  transform: translate(-50%, -50%);
  background: rgba(var(--unicast-orange-soft-rgb), 0.5);
  pointer-events: none;
  animation: annot-pulse 2s ease-out infinite;
}

@keyframes annot-pulse {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.7;
  }
  100% {
    transform: translate(-50%, -50%) scale(2.6);
    opacity: 0;
  }
}

.annot-dot {
  position: absolute;
  left: 0;
  top: 0;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  transform: translate(-50%, -50%);
  background: rgba(var(--unicast-orange-soft-rgb), 0.95);
  box-shadow:
    0 0 0 2px rgba(0, 0, 0, 0.55),
    0 0 0 6px rgba(var(--unicast-orange-soft-rgb), 0.22),
    0 0 28px rgba(var(--unicast-orange-soft-rgb), 0.6);
  pointer-events: auto;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease,
    box-shadow 0.18s ease;
}

.annot-hotspot:hover .annot-dot,
.annot-hotspot:focus-visible .annot-dot {
  transform: translate(-50%, -50%) scale(1.25);
}

.annot-hotspot.active .annot-dot {
  background: #fff;
  box-shadow:
    0 0 0 2px rgba(0, 0, 0, 0.7),
    0 0 0 6px rgba(255, 255, 255, 0.3),
    0 0 28px rgba(var(--unicast-orange-soft-rgb), 0.95);
}

.annot-hotspot.active .annot-pulse {
  animation-play-state: paused;
  opacity: 0;
}

.annot-hotspot:focus-visible {
  outline: none;
}

.annot-tooltip {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(22px, -50%);
  min-width: 200px;
  max-width: 280px;
  padding: 10px 12px;
  background: rgba(var(--unicast-dark-deep-rgb), 0.95);
  border: 1px solid rgba(var(--unicast-orange-rgb), 0.5);
  border-radius: 10px;
  color: #f3f3f3;
  font-size: 13px;
  line-height: 1.4;
  text-align: left;
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(0, 0, 0, 0.25) inset;
  backdrop-filter: blur(8px);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, visibility 0.18s ease;
}

.annot-hotspot[data-side="left"] .annot-tooltip {
  transform: translate(calc(-100% - 22px), -50%);
}

.annot-hotspot.active .annot-tooltip {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.annot-hotspot:hover .annot-tooltip,
.annot-hotspot:focus-visible .annot-tooltip {
  opacity: 1;
  visibility: visible;
}

.annot-tooltip::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -7px;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-right: 7px solid rgba(var(--unicast-orange-rgb), 0.5);
}

.annot-hotspot[data-side="left"] .annot-tooltip::before {
  left: auto;
  right: -7px;
  border-right: 0;
  border-left: 7px solid rgba(var(--unicast-orange-rgb), 0.5);
}

/* Picker panel collapsed state */
.picker-collapse-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #eaf1fb;
  border-radius: 8px;
  width: 26px;
  height: 26px;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex: 0 0 auto;
}

.picker-collapse-btn:focus-visible {
  outline: 2px solid rgba(99, 179, 237, 0.8);
  outline-offset: 2px;
}

.picker-panel.collapsed {
  width: auto;
  padding: 8px 10px;
}

.picker-panel.collapsed .picker-body {
  display: none;
}

.fallback {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  color: #d6dee7;
}

.fallback a {
  color: inherit;
}

/* Orbit HUD (upper right) */
.orbit-hud {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 20;
  width: min(280px, calc(100vw - 32px));
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(12, 18, 28, 0.9);
  backdrop-filter: blur(10px);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(0, 0, 0, 0.2) inset;
  color: #d6dee7;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.orbit-hud[hidden] {
  display: none;
}

.orbit-hud-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.orbit-hud-title {
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(214, 222, 231, 0.7);
}

.orbit-hud-copy {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #eaf1fb;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 11px;
  cursor: pointer;
}

.orbit-hud-copy:focus-visible {
  outline: 2px solid rgba(99, 179, 237, 0.8);
  outline-offset: 2px;
}

.orbit-hud-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  color: #eaf1fb;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 8px 10px;
  user-select: text;
  cursor: text;
  word-break: break-all;
}

.orbit-hud-sub {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 11px;
  color: rgba(214, 222, 231, 0.7);
  word-break: break-all;
}

/* Fullscreen toggle (lower right) */
.fullscreen-btn {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 20;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(12, 18, 28, 0.9);
  backdrop-filter: blur(10px);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(0, 0, 0, 0.2) inset;
  color: #eaf1fb;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s ease, transform 0.12s ease;
}

.fullscreen-btn:hover {
  background: rgba(20, 30, 45, 0.95);
}

.fullscreen-btn:active {
  transform: scale(0.96);
}

.fullscreen-btn:focus-visible {
  outline: 2px solid rgba(99, 179, 237, 0.8);
  outline-offset: 2px;
}

.fullscreen-btn .fs-icon {
  display: block;
}

.fullscreen-btn .fs-icon-exit {
  display: none;
}

.fullscreen-btn[data-fs="true"] .fs-icon-enter {
  display: none;
}

.fullscreen-btn[data-fs="true"] .fs-icon-exit {
  display: block;
}
