/* Annotation overlays live inside viewer-shell, so iframe and fullscreen share them. */
.annotation-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 4;
  pointer-events: none;
  contain: layout paint;
}
.annotation-pin {
  position: absolute;
  pointer-events: auto;
  touch-action: none;
  max-width: min(220px, 65%);
  background: rgba(12, 20, 27, 0.88);
  color: #fff;
  border: 1px solid #ffffff70;
  border-radius: 8px;
  padding: 9px 12px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  box-shadow: 0 2px 12px #0005;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.annotation-pin:focus-visible,
.annotation-pin.is-selected {
  outline: 3px solid #ff962e;
  outline-offset: 3px;
}
.annotation-pin.is-disabled {
  opacity: 0.45;
}
.annotation-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
}
.annotation-plane {
  display: none;
}
.annotation-pin.is-plane {
  max-width: none;
  transform-origin: 0 0;
  border-radius: 3px;
  padding: 0;
  border: 1px solid #ffffff90;
  background: #13222e;
  box-shadow: 0 3px 12px #0005;
}
.is-plane .annotation-label {
  display: none;
}
.is-plane .annotation-plane {
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
  border-radius: inherit;
}
.annotation-plane img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}
.annotation-plane small {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 3px 5px;
  background: #000b;
  color: #fff;
  text-align: left;
  font: 11px/1.4 sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.annotation-toolbar {
  position: absolute;
  right: 14px;
  top: 14px;
  display: flex;
  gap: 6px;
  z-index: 6;
  max-width: calc(100% - 28px);
}
.annotation-toolbar button {
  background: #101b25cf;
  border: 1px solid #ffffff50;
  border-radius: 6px;
  color: #fff;
  padding: 8px 10px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.annotation-card {
  position: absolute;
  z-index: 8;
  right: 16px;
  top: 64px;
  width: min(350px, calc(100% - 32px));
  max-height: calc(100% - 88px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 22px;
  background: #101b25f5;
  color: #fff;
  border: 1px solid #ffffff40;
  border-radius: 12px;
  box-shadow: 0 10px 40px #0007;
  font-size: 16px;
  line-height: 1.75;
  pointer-events: auto;
  text-align: left;
}
.annotation-card h2 {
  font-size: 1.15rem;
  margin: 0 24px 12px 0;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.annotation-card p {
  white-space: pre-wrap;
  margin: 12px 0;
  overflow-wrap: anywhere;
}
.annotation-close {
  position: absolute;
  right: 7px;
  top: 5px;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 26px;
  cursor: pointer;
}
.annotation-card-image {
  display: block;
  max-width: 100%;
  max-height: 200px;
  object-fit: contain;
  border-radius: 5px;
}
.annotation-link {
  display: inline-block;
  background: #fc8d26;
  color: #101211;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 700;
  margin-top: 8px;
}
.annotation-list {
  display: grid;
  gap: 8px;
}
.annotation-list button {
  text-align: left;
  background: #ffffff0d;
  color: #fff;
  padding: 10px;
  border: 1px solid #ffffff30;
  border-radius: 5px;
  font: inherit;
  cursor: pointer;
}
.annotation-edit-link {
  display: block;
  color: #ffad62;
  padding: 6px 0;
  font-size: 0.85rem;
}
.annotation-editor {
  max-width: 1600px;
  margin: 0 auto;
  padding: 24px clamp(12px, 3vw, 44px);
  overflow-wrap: anywhere;
}
.annotation-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.annotation-editor h1 {
  font-size: clamp(1.25rem, 2vw, 1.8rem);
  margin: 0;
}
.annotation-editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  align-items: start;
}
.annotation-editor .viewer-shell {
  height: clamp(360px, 65vh, 800px);
  min-height: 0;
  border-radius: 10px;
  overflow: hidden;
}
.annotation-editor .viewer-shell #panorama {
  height: 100%;
  width: 100%;
}
.annotation-editor-panel {
  padding: 18px;
  background: #18201a;
  border: 1px solid #ffffff25;
  border-radius: 8px;
  min-width: 0;
}
.annotation-editor-panel label {
  display: block;
  margin: 10px 0;
  font-size: 0.88rem;
}
.annotation-editor-panel input,
.annotation-editor-panel textarea,
.annotation-editor-panel select {
  display: block;
  width: 100%;
  max-width: 100%;
  padding: 8px;
  background: #0d1514;
  color: #fff;
  border: 1px solid #72816e;
  border-radius: 4px;
  font: inherit;
}
.annotation-editor-panel textarea {
  min-height: 100px;
}
.annotation-editor-panel input[type="checkbox"] {
  display: inline;
  width: auto;
}
.annotation-editor-panel input[type="range"] {
  padding: 0;
  accent-color: #ff982e;
}
.annotation-editor-panel .annotation-fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.annotation-editor-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0;
}
.annotation-editor button {
  cursor: pointer;
}
.annotation-editor-actions button,
.annotation-editor-panel > button {
  background: #243831;
  color: #fff;
  border: 1px solid #8eac9c;
  padding: 9px 12px;
  border-radius: 5px;
  font: inherit;
  font-size: 0.9rem;
}
.annotation-editor .annotation-save {
  background: #ff962e;
  color: #101211;
  font-weight: 700;
  border: 0;
  padding: 11px 20px;
  border-radius: 6px;
}
.annotation-editor-hint {
  font-size: 0.9rem;
  color: #c1cbbc;
  line-height: 1.7;
  margin: 12px 0;
}
.annotation-editor-status {
  min-height: 1.7em;
  color: #ffd0a5;
  font-size: 0.95rem;
}
.annotation-editor-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.annotation-editor-list button {
  background: #26352d;
  color: #fff;
  padding: 9px;
  border: 1px solid #93a88d;
  border-radius: 5px;
}
.annotation-editor-list [aria-pressed="true"] {
  border-color: #ff962e;
  color: #ffc085;
}
.annotation-editor-panel [data-delete] {
  color: #ffb6a7;
}
.annotation-editor [data-place][aria-pressed="true"] {
  background: #ff962e;
  color: #111;
}
.annotation-editor .viewer-shell.is-placing #panorama {
  cursor: crosshair;
}
.annotation-editor .viewer-shell.is-placing .annotation-layer {
  pointer-events: none;
}
.annotation-editor .viewer-shell.is-placing .annotation-pin {
  pointer-events: none;
}
@media (max-width: 900px) {
  .annotation-editor-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .annotation-editor .viewer-shell {
    height: 55dvh;
    min-height: 300px;
  }
  .annotation-editor-panel {
    max-width: 100%;
  }
  .annotation-editor-panel .annotation-fields-grid {
    grid-template-columns: 1fr 1fr;
  }
  .annotation-label {
    font-size: 12px;
  }
  .annotation-pin {
    padding: 8px 10px;
  }
  .annotation-card {
    font-size: 15px;
    top: 58px;
    padding: 18px;
  }
  .annotation-toolbar {
    right: 10px;
    top: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .annotation-card {
    scroll-behavior: auto;
  }
}
.annotation-editor .viewer-shell:fullscreen,
.annotation-editor .viewer-shell.fullscreen-fallback {
  height: 100dvh;
  border-radius: 0;
}
.annotation-editor .viewer-shell:-webkit-full-screen {
  height: 100%;
  border-radius: 0;
}
/* Vector name frames: the endpoint is the spherical anchor, the box can be offset. */
.annotation-pin:not(.is-plane) {
  color: var(--annotation-text, #fff);
  background: rgba(12, 20, 27, var(--annotation-bg, 0.88));
  border-color: var(--annotation-text, #ffffff70);
}
.annotation-pin .annotation-label {
  font-size: var(--annotation-font, 14px);
  color: var(--annotation-text, #fff);
}
.annotation-label-frame {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  overflow: visible;
  pointer-events: none;
  color: var(--annotation-text, #fff);
}
.annotation-pin.is-framed {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  pointer-events: none;
  overflow: visible;
}
.annotation-pin.is-framed .annotation-label {
  position: relative;
  padding: 8px 12px;
  pointer-events: auto;
  min-height: 32px;
  line-height: 1.4;
}
.annotation-pin.is-framed .annotation-label-frame rect {
  pointer-events: all;
}
.annotation-pin.is-framed .annotation-label-frame path,
.annotation-pin.is-framed .annotation-label-frame circle {
  pointer-events: visiblePainted;
}
.annotation-pin.is-framed.is-selected {
  outline: none;
}
.annotation-pin.is-framed.is-selected .annotation-label {
  outline: 2px solid #ff962e;
  border-radius: 7px;
}
.annotation-pin.is-framed:focus-visible .annotation-label {
  outline: 3px solid #ff962e;
  border-radius: 7px;
}
.annotation-corner-controls {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}
.annotation-corner-outline {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
}
.annotation-corner {
  position: absolute;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
  border: 0;
  background: transparent;
  padding: 0;
  pointer-events: auto;
  touch-action: none;
  cursor: nwse-resize;
  border-radius: 50%;
}
.annotation-corner:nth-last-child(3),
.annotation-corner:last-child {
  cursor: nesw-resize;
}
.annotation-corner svg {
  display: block;
  width: 44px;
  height: 44px;
  filter: drop-shadow(0 1px 2px #000);
}
.annotation-anchor {
  position: absolute;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  touch-action: none;
  cursor: move;
  z-index: 3;
}
.annotation-anchor svg {
  display: block;
  width: 44px;
  height: 44px;
  filter: drop-shadow(0 1px 3px #000);
}
.annotation-anchor:focus-visible {
  outline: 2px solid #ffb769;
  outline-offset: -2px;
}
.annotation-corner:focus-visible {
  outline: 2px solid #ffb769;
  outline-offset: -3px;
  background: #1117;
}
.annotation-frame-presets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin: 12px 0;
}
.annotation-frame-presets button {
  min-width: 0;
  padding: 6px 3px;
  background: #0c1517;
  color: #ddd;
  border: 1px solid #72816e;
  border-radius: 5px;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}
.annotation-frame-presets button[aria-pressed="true"] {
  border-color: #ff962e;
  color: #ffc383;
  background: #48301c;
}
.annotation-frame-presets svg {
  width: 100%;
  height: 65px;
  display: block;
  margin-bottom: 5px;
}
.annotation-editor-panel fieldset {
  min-width: 0;
  margin: 14px 0;
  padding: 12px;
  border: 1px solid #657461;
  border-radius: 6px;
}
.annotation-editor-panel legend {
  font-size: 0.9rem;
  padding: 0 5px;
}
.annotation-editor-panel input[type="color"] {
  height: 42px;
  width: 100%;
  padding: 3px;
}
.annotation-editor-panel input:disabled {
  opacity: 0.45;
}
.annotation-editor-panel #annotation-reset-corners,
.annotation-editor-panel #annotation-reset-label {
  padding: 9px;
  background: #263e41;
  color: #fff;
  border: 1px solid #78989b;
  border-radius: 5px;
  max-width: 100%;
  white-space: normal;
}
.annotation-editor-panel label:has(input[type="checkbox"]) {
  line-height: 1.6;
}
.annotation-editor-panel output {
  float: right;
  color: #ffbf83;
  font-variant-numeric: tabular-nums;
}
.annotation-pin:not(.is-plane) {
  width: max-content;
}
/* A tall button otherwise vertically centers its text across the entire leader. */
.annotation-pin.is-framed {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
}
.annotation-pin.is-framed .annotation-label {
  flex: none;
}
