:root {
  --bg: #101216;
  --panel: #181b22;
  --panel-2: #202530;
  --text: #f3f5f7;
  --muted: #a8b0bd;
  --line: #303744;
  --accent: #d99a2b;
  --accent-dark: #a86f13;
  --danger: #d9534f;
  --success: #42b883;
  --input: #0e1117;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: Arial, Helvetica, sans-serif;
  background: radial-gradient(circle at top left, #242936 0, var(--bg) 42%);
  color: var(--text);
  line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--line);
  background: rgba(16, 18, 22, .88);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand-area {
  justify-self: start;
  display: flex;
  align-items: baseline;
  gap: .85rem;
  min-width: 0;
}
.brand {
  color: var(--text);
  font-weight: 800;
  letter-spacing: .04em;
  white-space: nowrap;
}
.signed-in-user {
  color: var(--muted);
  font-size: .92rem;
  white-space: nowrap;
}
.signed-in-user strong { color: var(--text); font-weight: 800; }
.topnav {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: .35rem;
  color: var(--muted);
  font-size: .95rem;
}
.topnav .nav-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  min-height: 36px;
  padding: .42rem .68rem;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}
.topnav .nav-link:hover {
  background: rgba(217, 154, 43, .10);
  border-color: rgba(217, 154, 43, .22);
  text-decoration: none;
}
.topnav .nav-link.active {
  background: rgba(217, 154, 43, .17);
  border-color: rgba(217, 154, 43, .42);
  color: var(--text);
}
.topnav .admin-nav-text { color: inherit; }

.page { width: min(1180px, calc(100% - 2rem)); margin: 2rem auto; }
.page > * + * { margin-top: 1.5rem; }
.hero {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 1.5rem;
  align-items: center;
  margin-bottom: 1.5rem;
}
.card, .panel {
  background: linear-gradient(180deg, var(--panel), #131720);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.25rem;
  box-shadow: 0 18px 48px rgba(0,0,0,.22);
}
.page > .panel + .panel, .page > .card + .card { margin-top: 1.5rem; }

h1, h2, h3 { line-height: 1.15; margin: 0 0 .75rem; }
h1 { font-size: clamp(2rem, 4vw, 3.8rem); }
h2 { font-size: clamp(1.45rem, 2vw, 2rem); }
h3 { font-size: 1.1rem; }
p { color: var(--muted); margin: 0 0 1rem; }
.muted { color: var(--muted); }
.small-text { font-size: .88rem; }

.grid { display: grid; gap: 1rem; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.actions { display: flex; flex-wrap: wrap; gap: .7rem; align-items: center; margin-top: 1rem; }
.actions.no-margin { margin-top: 0; }

.button, button, input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: .65rem 1rem;
  border: 1px solid var(--accent-dark);
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent), var(--accent-dark));
  color: #18120a;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
}
.button:hover, button:hover, input[type="submit"]:hover { text-decoration: none; filter: brightness(1.06); }
.button.secondary, button.secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}
.button.danger, button.danger {
  background: transparent;
  color: #ff9b98;
  border-color: rgba(217, 83, 79, .55);
}
.button.small { min-height: 32px; padding: .35rem .7rem; font-size: .85rem; }

form { margin: 0; }
.form-grid { display: grid; gap: 1rem; }
label { display: block; color: var(--text); font-weight: 700; margin-bottom: .35rem; }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--input);
  color: var(--text);
  padding: .75rem .85rem;
  font: inherit;
}
input[type="checkbox"] { width: auto; }
textarea { min-height: 110px; resize: vertical; }
.help { color: var(--muted); font-size: .88rem; margin-top: .25rem; }

.notice {
  padding: .8rem 1rem;
  border-radius: 14px;
  margin-bottom: 1rem;
  border: 1px solid var(--line);
  background: var(--panel-2);
}
.notice-success { border-color: rgba(66, 184, 131, .45); }
.notice-error { border-color: rgba(217, 83, 79, .55); }
.notice-centered { text-align: center; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; min-width: 680px; }
th, td { padding: .85rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; }
tr:last-child td { border-bottom: 0; }

.viewer {
  width: 100%;
  height: 70vh;
  min-height: 420px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #000;
}
.viewer.embed { height: 100vh; min-height: 100vh; border: 0; border-radius: 0; }
.editor-viewer,
.public-viewer {
  height: clamp(620px, 78vh, 820px);
  min-height: 620px;
}

.codebox {
  width: 100%;
  min-height: 80px;
  font-family: Consolas, Monaco, monospace;
  font-size: .9rem;
}
.badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 999px;
  padding: .2rem .55rem;
  font-size: .8rem;
}
.kv {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: .5rem;
  font-size: .95rem;
}
.kv strong { color: var(--muted); }

.public-body, .embed-body { background: #050608; }
.public-shell { width: min(1320px, calc(100% - 2rem)); margin: 1rem auto; }
.public-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .8rem; }
.public-title { margin: 0; font-size: clamp(1.4rem, 2vw, 2.2rem); }
.embed-body { margin: 0; overflow: hidden; }
.embed-body .page { width: 100%; margin: 0; }

.empty {
  border: 1px dashed var(--line);
  border-radius: 18px;
  padding: 2rem;
  text-align: center;
  color: var(--muted);
}

@media (max-width: 820px) {
  .hero, .grid.two, .grid.three { grid-template-columns: 1fr; }
  .topbar {
    grid-template-columns: 1fr;
    align-items: start;
  }
  .brand-area,
  .topnav {
    justify-self: start;
  }
  .brand-area {
    flex-direction: column;
    align-items: flex-start;
    gap: .2rem;
  }
  .signed-in-user {
    white-space: normal;
  }
  .topnav { flex-wrap: wrap; }
  .viewer { height: 62vh; }
  .kv { grid-template-columns: 1fr; }
}
.embed-body .topbar { display: none; }
.embed-body main.page { width: 100%; margin: 0; }



/* Dashboard project card layout */
.dashboard-project-grid {
  align-items: stretch;
  grid-auto-rows: 1fr;
}

/* Keep cards/panels aligned when they are children of a row/grid layout.
   This prevents the global stacked-card spacing from pushing the second item lower. */
.grid > .card,
.grid > .panel,
.dashboard-project-grid > .dashboard-project-card,
.project-editor-forms > .panel,
.scene-editor-forms > .panel,
.settings-grid > .panel {
  margin-top: 0;
}

.dashboard-project-card {
  display: grid;
  grid-template-rows: 38px 22px 54px 38px;
  gap: .55rem;
  height: 100%;
  min-height: 184px;
  padding: .9rem;
  align-items: stretch;
}

.project-card-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: .75rem;
  min-height: 38px;
  margin: 0;
}

.project-card-header h2 {
  margin: 0;
  min-width: 0;
  font-size: clamp(1.15rem, 1.55vw, 1.45rem);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-card-header .badge {
  justify-self: end;
  white-space: nowrap;
}

.project-card-description {
  height: 22px;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-card-links {
  align-self: start;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: .28rem .5rem;
  font-size: .88rem;
  line-height: 1.25;
  margin: 0;
}

.project-card-links strong,
.project-card-links a {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-card-actions {
  align-self: end;
  margin-top: 0;
  padding-top: 0;
}

.project-card-actions .button {
  flex: 1 1 135px;
  min-height: 36px;
  padding: .45rem .8rem;
}

/* Project edit layout */
.project-editor-forms {
  align-items: stretch;
  gap: 1.25rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.project-editor-forms > .panel + .panel {
  margin-top: 0;
}

.project-editor-panel {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  height: 100%;
}

.project-editor-panel > .form-grid,
.project-editor-panel > form.form-grid {
  display: grid;
  flex: 1;
  align-content: start;
}

.project-editor-panel .codebox {
  min-height: 110px;
}

/* Scene editor navigation */
.panorama-editor-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.panorama-editor-heading > div:first-child {
  min-width: 0;
}

.scene-step-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: .55rem;
  margin-left: auto;
  white-space: nowrap;
}

.scene-step-nav .button {
  width: 158px;
  text-align: center;
}

.button.disabled,
button.disabled {
  cursor: not-allowed;
  opacity: .45;
  pointer-events: none;
}

/* Scene editor layout */
.scene-editor-forms {
  align-items: stretch;
  gap: 1.25rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* Override the global .panel + .panel spacing when panels sit side-by-side in the editor grid.
   Without this, the second panel starts lower than the first one. */
.scene-editor-forms > .panel + .panel {
  margin-top: 0;
}

.scene-editor-forms > .scene-editor-panel {
  height: 100%;
  min-height: 0;
}

.scene-editor-panel {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.scene-editor-panel form {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.scene-settings-form,
.hotspot-form {
  height: 100%;
}

.scene-settings-form .form-actions,
.hotspot-form .form-actions {
  margin-top: auto;
}

.section-heading {
  margin-bottom: 1rem;
}

.section-heading p {
  margin-bottom: 0;
}

.form-section {
  display: grid;
  gap: .85rem;
  padding: 1rem;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  background: rgba(255,255,255,.025);
}

.form-section h3 {
  margin: 0;
  color: var(--muted);
  font-size: .86rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
  align-items: center;
}

.form-actions.vertical {
  align-items: stretch;
  flex-direction: column;
}

.form-actions.vertical > .button,
.form-actions.vertical > button {
  width: 100%;
}

.range-readout {
  display: inline-flex;
  margin-top: .4rem;
  padding: .18rem .5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: .8rem;
}

input[type="range"] {
  padding: .45rem 0;
  accent-color: var(--success);
}

/* Hotspot editor + custom public hotspot rings */
.editor-viewer-wrap {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  isolation: isolate;
}

.hotspot-placement-status {
  margin-top: .75rem;
}

.pnlm-hotspot-base.tour-hotspot-shell {
  background: transparent !important;
  background-image: none !important;
  padding: 0 !important;
  border: 0 !important;
  box-shadow: none !important;
}

.tour-hotspot-shell {
  background: transparent !important;
  border: 0 !important;
  cursor: pointer;
  overflow: visible !important;
  perspective: 220px;
  transition: opacity .16s ease;
}

.tour-hotspot-shell[style*="pointer-events: none"] .tour-hotspot-label {
  opacity: 0 !important;
}


.tour-hotspot-ring {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, var(--marker-color-wash, rgba(64,240,113,.12)) 0 42%, var(--marker-color-faint, rgba(64,240,113,.04)) 43% 56%, transparent 57%);
  border: var(--marker-border, 4px) solid var(--marker-color, #39f06d);
  box-shadow:
    0 0 0 2px rgba(214,255,225,.35),
    0 0 18px var(--marker-color-soft, rgba(37, 235, 98, .55)),
    inset 0 0 12px var(--marker-color-wash, rgba(64,240,113,.32)),
    0 12px 24px rgba(0,0,0,.45);
  transform: perspective(220px) rotateX(var(--marker-tilt, 43deg)) scaleY(var(--marker-scale-y, .45));
  transform-origin: center center;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}

.tour-hotspot-arrow {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--marker-color, #39f06d);
  clip-path: polygon(50% 0, 100% 58%, 69% 58%, 69% 100%, 31% 100%, 31% 58%, 0 58%);
  filter:
    drop-shadow(0 0 2px rgba(214,255,225,.72))
    drop-shadow(0 0 12px var(--marker-color-soft, rgba(37,235,98,.55)))
    drop-shadow(0 12px 18px rgba(0,0,0,.45));
  transform: perspective(220px) rotateX(var(--marker-tilt, 43deg)) scaleY(var(--marker-scale-y, .45)) translateY(-4%) scale(.92);
  transform-origin: center center;
  transition: transform .12s ease, filter .12s ease;
}

.tour-hotspot-icon {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter:
    drop-shadow(0 0 2px rgba(255,255,255,.7))
    drop-shadow(0 0 12px var(--marker-color-soft, rgba(37,235,98,.4)))
    drop-shadow(0 10px 18px rgba(0,0,0,.45));
  transform: perspective(220px) rotateX(var(--marker-tilt, 43deg)) scaleY(var(--marker-scale-y, .45));
  transform-origin: center center;
  transition: transform .12s ease, filter .12s ease;
}

.tour-hotspot-shell:hover .tour-hotspot-ring,
.tour-hotspot-shell:focus .tour-hotspot-ring,
.tour-hotspot-shell:focus-within .tour-hotspot-ring {
  border-color: var(--marker-color, #75ff99);
  box-shadow:
    0 0 0 3px rgba(214,255,225,.48),
    0 0 24px var(--marker-color-soft, rgba(37, 235, 98, .72)),
    inset 0 0 14px var(--marker-color-wash, rgba(64,240,113,.42)),
    0 14px 28px rgba(0,0,0,.52);
}

.tour-hotspot-shell:hover .tour-hotspot-arrow,
.tour-hotspot-shell:focus .tour-hotspot-arrow,
.tour-hotspot-shell:focus-within .tour-hotspot-arrow {
  transform: perspective(220px) rotateX(var(--marker-tilt, 43deg)) scaleY(var(--marker-scale-y, .45)) translateY(-8%) scale(1);
  filter:
    drop-shadow(0 0 3px rgba(214,255,225,.85))
    drop-shadow(0 0 18px var(--marker-color-soft, rgba(37,235,98,.72)))
    drop-shadow(0 14px 22px rgba(0,0,0,.52));
}

.tour-hotspot-shell:hover .tour-hotspot-icon,
.tour-hotspot-shell:focus .tour-hotspot-icon,
.tour-hotspot-shell:focus-within .tour-hotspot-icon {
  transform: perspective(220px) rotateX(var(--marker-tilt, 43deg)) scaleY(var(--marker-scale-y, .45)) scale(1.06);
  filter:
    drop-shadow(0 0 3px rgba(255,255,255,.85))
    drop-shadow(0 0 18px var(--marker-color-soft, rgba(37,235,98,.65)))
    drop-shadow(0 14px 22px rgba(0,0,0,.52));
}

.tour-hotspot-shell .tour-hotspot-label {
  position: absolute;
  left: 50%;
  top: calc(100% + 10px);
  transform: translateX(-50%);
  white-space: nowrap;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: .25rem .55rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(5, 6, 8, .78);
  color: #fff;
  font-size: 13px;
  line-height: 1.2;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}

.tour-hotspot-shell:hover .tour-hotspot-label,
.tour-hotspot-shell:focus .tour-hotspot-label,
.tour-hotspot-shell:focus-within .tour-hotspot-label {
  opacity: 1;
}

.tour-hotspot-shell.new-hotspot-preview {
  z-index: 10000 !important;
  cursor: grab;
  pointer-events: auto;
}

.tour-hotspot-shell.new-hotspot-preview.dragging,
.tour-hotspot-shell.new-hotspot-preview:active {
  cursor: grabbing;
}

.tour-hotspot-shell.new-hotspot-preview .tour-hotspot-ring {
  border-color: var(--marker-color, #76ff9f);
  box-shadow:
    0 0 0 4px rgba(214,255,225,.7),
    0 0 28px var(--marker-color-soft, rgba(37, 235, 98, .82)),
    inset 0 0 16px var(--marker-color-wash, rgba(64,240,113,.52)),
    0 16px 32px rgba(0,0,0,.58);
}

.tour-hotspot-shell.new-hotspot-preview .tour-hotspot-arrow,
.tour-hotspot-shell.new-hotspot-preview .tour-hotspot-icon {
  filter:
    drop-shadow(0 0 4px rgba(214,255,225,.88))
    drop-shadow(0 0 26px var(--marker-color-soft, rgba(37,235,98,.82)))
    drop-shadow(0 16px 30px rgba(0,0,0,.58));
}

.tour-hotspot-shell.new-hotspot-preview .tour-hotspot-label {
  opacity: 1;
  background: rgba(5, 6, 8, .92);
}

.tour-hotspot-shell.existing-hotspot-editor {
  cursor: grab;
  pointer-events: auto;
}

.tour-hotspot-shell.existing-hotspot-editor.dragging,
.tour-hotspot-shell.existing-hotspot-editor:active {
  z-index: 10001 !important;
  cursor: grabbing;
}

.tour-hotspot-shell.existing-hotspot-editor.dragging .tour-hotspot-ring {
  box-shadow:
    0 0 0 4px rgba(214,255,225,.68),
    0 0 28px var(--marker-color-soft, rgba(37,235,98,.82)),
    inset 0 0 16px var(--marker-color-wash, rgba(64,240,113,.52)),
    0 16px 32px rgba(0,0,0,.58);
}

.tour-hotspot-shell.existing-hotspot-editor.dragging .tour-hotspot-arrow,
.tour-hotspot-shell.existing-hotspot-editor.dragging .tour-hotspot-icon {
  filter:
    drop-shadow(0 0 4px rgba(214,255,225,.88))
    drop-shadow(0 0 26px var(--marker-color-soft, rgba(37,235,98,.82)))
    drop-shadow(0 16px 30px rgba(0,0,0,.58));
}

.inline-style-form {
  display: grid;
  grid-template-columns: 78px 92px 70px auto;
  gap: .5rem;
  align-items: end;
  min-width: 290px;
}

.inline-style-form label {
  margin: 0;
  font-size: .8rem;
  color: var(--muted);
}

.inline-style-form input {
  padding: .45rem .55rem;
  border-radius: 10px;
}

@media (max-width: 820px) {
  .panorama-editor-heading {
    display: grid;
    gap: .85rem;
  }

  .scene-step-nav {
    justify-content: flex-start;
    margin-left: 0;
    white-space: normal;
  }

  .editor-viewer,
  .public-viewer {
    height: 68vh;
    min-height: 460px;
  }

  .scene-editor-forms,
  .project-editor-forms {
    grid-template-columns: 1fr;
  }

  .inline-style-form { grid-template-columns: 1fr; }
  .scene-editor-panel,
  .project-editor-panel { display: block; }
}

/* Hotspot target landing view controls */
.target-scene-wrap {
  display: grid;
  gap: .85rem;
}

.target-view-fields {
  display: grid;
  gap: .75rem;
  padding: .85rem;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  background: rgba(0,0,0,.16);
}

.target-view-heading {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  align-items: center;
  justify-content: space-between;
}

.hotspot-target-cell {
  display: grid;
  gap: .55rem;
  min-width: 320px;
}

.inline-target-view-form {
  display: grid;
  grid-template-columns: 125px repeat(3, minmax(78px, 1fr)) auto;
  gap: .5rem;
  align-items: end;
}

.inline-target-view-form label {
  margin: 0;
  font-size: .8rem;
  color: var(--muted);
}

.inline-target-view-form input {
  padding: .45rem .55rem;
  border-radius: 10px;
}


.inline-info-text-form {
  display: grid;
  gap: .5rem;
  margin-top: .45rem;
  min-width: 320px;
}

.inline-info-text-form label {
  margin: 0;
  font-size: .8rem;
  color: var(--muted);
}

.inline-info-text-form textarea {
  min-height: 78px;
  padding: .55rem .65rem;
  border-radius: 10px;
}

.inline-info-text-form button {
  justify-self: start;
}

@media (max-width: 820px) {
  .inline-target-view-form {
    grid-template-columns: 1fr;
  }
}


/* Settings and defaults layout */
.page-heading-row {
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.settings-form {
  display: grid;
  gap: 1.25rem;
}

.settings-grid {
  align-items: stretch;
  gap: 1.25rem;
}

.settings-grid > .settings-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  margin-top: 0;
}

.settings-panel .form-section + .form-section {
  margin-top: 1rem;
}

.compact-options {
  align-content: start;
}

.check-row {
  display: flex;
  gap: .55rem;
  align-items: center;
  margin: 0;
  color: var(--text);
}

.check-row input[type="checkbox"] {
  flex: 0 0 auto;
}

input[type="color"] {
  min-height: 42px;
  padding: .3rem;
}

.color-swatch {
  display: inline-block;
  width: .9rem;
  height: .9rem;
  border-radius: 50%;
  background: var(--swatch, #39f06d);
  border: 1px solid rgba(255,255,255,.45);
  vertical-align: -1px;
  margin-right: .35rem;
}

.project-default-summary {
  margin-top: .5rem;
  padding: 1rem;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  background: rgba(255,255,255,.025);
}

.project-default-summary h3 {
  margin-bottom: .8rem;
}

.settings-save-actions {
  margin-top: auto;
}

@media (max-width: 820px) {
  .settings-grid { grid-template-columns: 1fr; }
  .settings-grid > .settings-panel { display: block; }
  .inline-target-view-form { grid-template-columns: 1fr; }
}

/* Admin settings spacing */
.admin-settings-form {
  gap: 1.4rem;
}

.admin-settings-panel {
  gap: .5rem;
}

.admin-settings-panel .form-section + .form-section {
  margin-top: .5rem;
}

.admin-settings-panel .section-heading {
  margin-bottom: 0;
}

.admin-settings-panel .form-section h3 + label {
  margin-top: .1rem;
}

.admin-default-limit-notice {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .75rem;
  align-items: center;
  justify-content: space-between;
}

.admin-default-limit-text {
  display: inline-flex;
  align-items: baseline;
  gap: .25rem;
}

/* Super admin layout */
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.notice-info { border-color: rgba(90, 155, 255, .45); }

.admin-hero,
.admin-grid,
.admin-stat-grid,
.align-row-panels {
  align-items: stretch;
}

.admin-grid > .panel,
.align-row-panels > .panel,
.admin-stat-grid > .card {
  margin-top: 0;
  height: 100%;
}

.admin-panel,
.admin-quick-card,
.stat-card {
  display: flex;
  flex-direction: column;
}

.stat-card {
  gap: .35rem;
  min-height: 105px;
  justify-content: center;
}

.stat-card span {
  color: var(--muted);
  font-size: .86rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.stat-card strong {
  font-size: clamp(1.55rem, 2.4vw, 2.35rem);
}

.actions.vertical {
  align-items: stretch;
  flex-direction: column;
}

.compact-actions {
  margin-top: 0;
}

.inline-admin-form {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(120px, 1fr) auto;
  gap: .5rem;
  align-items: center;
}

.inline-admin-form select {
  min-width: 130px;
}

button.small,
input[type="submit"].small {
  min-height: 32px;
  padding: .35rem .7rem;
  font-size: .85rem;
}

@media (max-width: 1000px) {
  .grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .grid.four { grid-template-columns: 1fr; }
  .inline-admin-form { grid-template-columns: 1fr; }
}


/* Pending user approval badges */
.admin-nav-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}

.nav-badge,
.button-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 .38rem;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: .74rem;
  font-weight: 800;
  line-height: 1;
}

.button-badge {
  margin-left: .35rem;
  min-width: 1.25rem;
  height: 1.25rem;
  font-size: .72rem;
}

.stat-link {
  color: var(--text);
  text-decoration: none;
}

.stat-link:hover {
  text-decoration: none;
  filter: brightness(1.08);
}

.stat-card.needs-attention {
  border-color: rgba(217, 83, 79, .72);
  box-shadow: 0 18px 48px rgba(217, 83, 79, .12);
}

.stat-card.needs-attention span {
  color: #ffb2af;
}

/* Admin user account deletion */
.delete-user-form {
  margin: 0;
}

.delete-user-form button {
  white-space: nowrap;
}

/* Per-user panorama image limits */
.user-admin-form {
  grid-template-columns: minmax(115px, 1fr) minmax(115px, 1fr) minmax(140px, 1fr) auto;
}

.inline-field {
  display: grid;
  gap: .2rem;
  margin: 0;
}

.inline-field span {
  color: var(--muted);
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.inline-field input {
  min-width: 130px;
}

.usage-line {
  font-weight: 700;
  white-space: nowrap;
}

.badge.warning {
  display: inline-flex;
  align-items: center;
  margin-top: .3rem;
  padding: .18rem .45rem;
  border-radius: 999px;
  background: rgba(217, 154, 43, .18);
  color: #f7c86a;
  font-size: .75rem;
  font-weight: 800;
}

.notice-compact {
  margin-top: .35rem;
  padding: .7rem .8rem;
}

@media (max-width: 1100px) {
  .user-admin-form {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 820px) {
  .user-admin-form {
    grid-template-columns: 1fr;
  }
}

/* Admin users table layout fix */
.admin-users-wrap {
  overflow-x: auto;
}

.admin-users-table {
  min-width: 1120px;
  table-layout: fixed;
}

.admin-users-col-user { width: 23%; }
.admin-users-col-projects { width: 8%; }
.admin-users-col-images { width: 14%; }
.admin-users-col-login { width: 15%; }
.admin-users-col-controls { width: 31%; }
.admin-users-col-delete { width: 9%; }

.admin-user-management-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .55rem;
  align-items: end;
  max-width: 420px;
}

.admin-user-management-form .inline-field {
  min-width: 0;
}

.admin-user-management-form .wide-field,
.admin-user-management-form button {
  grid-column: 1 / -1;
}

.admin-user-management-form select,
.admin-user-management-form input {
  min-width: 0;
  width: 100%;
}

.admin-user-management-form button {
  justify-self: start;
  min-width: 90px;
}

@media (max-width: 820px) {
  .admin-users-table {
    min-width: 980px;
  }
}


/* Admin projects table alignment fix */
.admin-project-actions-cell {
  vertical-align: middle;
}

.admin-project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
  margin: 0;
}

.admin-project-actions .button {
  white-space: nowrap;
}

/* Existing hotspots card layout */
.hotspot-card-list {
  display: grid;
  gap: 1rem;
}

.hotspot-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.035);
  padding: 1rem;
}

.hotspot-card-header {
  display: flex;
  flex-wrap: wrap;
  gap: .85rem;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: .85rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1rem;
}

.hotspot-card-title-wrap {
  min-width: min(100%, 320px);
}

.hotspot-card h3 {
  margin: 0 0 .35rem;
  font-size: 1.02rem;
}

.hotspot-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .75rem;
  color: var(--muted);
  font-size: .86rem;
}

.hotspot-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  align-items: start;
}

.hotspot-card-section {
  display: grid;
  gap: .65rem;
  min-width: 0;
  height: 100%;
  padding: .85rem;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  background: rgba(0,0,0,.14);
}

.hotspot-card-section h4 {
  margin: 0;
  color: var(--muted);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.hotspot-card-form {
  display: grid;
  gap: .6rem;
  align-content: start;
}

.hotspot-card-form label {
  margin: 0;
  font-size: .82rem;
  color: var(--muted);
  text-align: center;
}

.hotspot-card-form input,
.hotspot-card-form select,
.hotspot-card-form textarea {
  margin-top: .28rem;
  padding: .55rem .65rem;
  border-radius: 10px;
  text-align: left;
}

.hotspot-card-form input[type="number"] {
  text-align: center;
}

.hotspot-card-form textarea {
  min-height: 92px;
}

.hotspot-card-form button {
  justify-self: start;
}

.hotspot-appearance-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
}

.hotspot-appearance-form button {
  grid-column: 1 / -1;
}

.hotspot-target-name {
  font-weight: 700;
}

.mini-grid {
  display: grid;
  gap: .6rem;
}

.mini-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mini-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hotspot-position-form button {
  justify-self: start;
}

@media (max-width: 700px) {
  .hotspot-card {
    padding: .85rem;
  }

  .hotspot-card-header {
    display: grid;
  }

  .hotspot-card-grid,
  .hotspot-appearance-form,
  .mini-grid.two,
  .mini-grid.three {
    grid-template-columns: 1fr;
  }
}

.scene-panel-actions {
  justify-content: flex-end;
}

.bulk-upload-card .form-section {
  gap: .65rem;
}

.bulk-upload-form .notice {
  margin-top: 0;
}

@media (max-width: 700px) {
  .scene-panel-actions {
    width: 100%;
    justify-content: stretch;
  }

  .scene-panel-actions .button,
  .scene-panel-actions button {
    width: 100%;
  }
}

.inline-save-status {
  min-height: 1.35rem;
  font-weight: 700;
  font-size: .92rem;
}

.inline-save-status.is-success {
  color: #1f8a4c;
}

.inline-save-status.is-error {
  color: #b42318;
}

.inline-save-status.is-saving {
  color: #6f5a22;
}

/* Hotspot appearance alignment + centered scene edit confirmations */
.hotspot-color-icon-row {
  display: grid;
  grid-template-columns: minmax(110px, .75fr) minmax(0, 1.25fr);
  gap: .6rem;
  align-items: start;
  grid-column: 1 / -1;
}

.hotspot-inline-field {
  display: grid;
  grid-template-rows: auto auto auto;
  gap: .28rem;
  min-width: 0;
  align-content: start;
}

.hotspot-inline-field label {
  margin: 0;
  min-height: 1.15rem;
  font-size: .82rem;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
}

.hotspot-inline-field input {
  margin-top: 0;
}

.hotspot-color-field input[type="color"] {
  width: 100%;
  min-height: 2.55rem;
}

.hotspot-icon-current {
  display: block;
  margin-top: 0;
  min-height: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.inline-save-status {
  text-align: center;
}

@media (max-width: 640px) {
  .hotspot-color-icon-row {
    grid-template-columns: 1fr;
  }
}

/* Bulk scene deletion controls */
.scenes-table .select-col {
  width: 44px;
  text-align: center;
  vertical-align: middle;
}

.scenes-table .select-col input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0 auto;
}

.scene-row-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: .45rem;
}

.scene-bulk-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.scene-bulk-actions .help {
  margin: 0;
  text-align: right;
}

@media (max-width: 760px) {
  .scene-bulk-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .scene-bulk-actions .help {
    text-align: left;
  }
}

/* Viewer zoom lock */
.viewer.zoom-disabled .pnlm-zoom-controls {
  display: none !important;
}

/* Project watermark controls */
.watermark-controls {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  background: rgba(255,255,255,.025);
}

.watermark-controls h4 {
  margin: 0 0 .85rem;
  color: var(--text);
}

.watermark-size-position {
  align-items: start;
}

.watermark-position-field {
  grid-column: 1 / -1;
}

.viewer-checkbox-grid {
  margin-top: 1rem;
  gap: .75rem 1rem;
}

.viewer-checkbox-grid .check-row {
  min-height: 42px;
}

.small-check {
  margin-top: .5rem;
  font-size: .9rem;
  color: var(--muted);
}

.viewer {
  position: relative;
}

.tour-watermark {
  position: absolute;
  z-index: 30;
  max-width: min(55%, 500px);
  height: auto;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.45));
}

.watermark-bottom-right { right: 18px; bottom: 18px; }
.watermark-bottom-left { left: 18px; bottom: 18px; }
.watermark-top-right { right: 18px; top: 18px; }
.watermark-top-left { left: 18px; top: 18px; }
.watermark-center { left: 50%; top: 50%; transform: translate(-50%, -50%); }

@media (max-width: 760px) {
  .viewer-checkbox-grid {
    grid-template-columns: 1fr;
  }

  .watermark-controls .grid.two,
  .watermark-size-position {
    grid-template-columns: 1fr;
  }

  .tour-watermark {
    max-width: min(65%, 360px);
  }
}
