:root {
  color-scheme: dark;
  --bg: #0b0c0f;
  --panel: #151619;
  --panel-strong: #1e2024;
  --panel-soft: #111216;
  --text: #f5f1ea;
  --muted: #a9a29a;
  --line: #34312d;
  --accent: #6ea8d7;
  --accent-strong: #a9d2f2;
  --clay: #4f8fc7;
  --danger: #b8423f;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #0b0c0f;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  overflow-x: hidden;
  overflow-y: auto;
  background:
    radial-gradient(circle at top left, rgba(110, 168, 215, 0.12), transparent 34vw),
    linear-gradient(135deg, #0b0c0f 0%, #121418 55%, #0b0c0f 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.auth-view {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom));
  background: rgba(2, 4, 8, 0.7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.auth-view.is-open {
  display: grid;
}

.auth-view[hidden] {
  display: none !important;
  visibility: hidden;
  pointer-events: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.auth-card {
  position: relative;
  width: min(460px, 100%);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  display: grid;
  gap: 22px;
  padding: 24px;
  border: 1px solid rgba(110, 168, 215, 0.22);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(110, 168, 215, 0.12), rgba(255, 255, 255, 0.025)),
    rgba(16, 18, 23, 0.88);
  box-shadow: var(--shadow);
}

.auth-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(110, 168, 215, 0.22);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 24px;
  line-height: 1;
}

.auth-brand {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

.auth-brand img {
  width: 58px;
  height: 58px;
  object-fit: cover;
  border-radius: 12px;
  background: #050608;
}

.auth-brand strong {
  display: block;
  font-size: 24px;
  line-height: 1.05;
}

.auth-brand span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 700;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form[hidden] {
  display: none;
}

.auth-form h1 {
  margin: 0;
  font-size: 22px;
}

.auth-form p {
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
}

.auth-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.plan-options {
  display: grid;
  gap: 8px;
}

.plan-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(110, 168, 215, 0.22);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
}

.plan-option input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
}

.plan-option strong,
.plan-option small {
  display: block;
}

.plan-option small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.card-row {
  display: grid;
  grid-template-columns: 1fr 0.68fr;
  gap: 10px;
}

.auth-form input {
  min-height: 44px;
  width: 100%;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--text);
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 48px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--accent-strong);
}

.password-toggle::before {
  content: "";
  width: 20px;
  height: 12px;
  border: 2px solid currentColor;
  border-radius: 999px / 70%;
}

.password-toggle::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
}

.password-toggle.is-visible::before {
  transform: rotate(-18deg);
}

.password-toggle.is-visible::after {
  width: 22px;
  height: 2px;
  border-radius: 999px;
  transform: rotate(-35deg);
}

.auth-link {
  min-height: 36px;
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  font-weight: 800;
}

.app-shell {
  --sidebar-width: min(86vw, 340px);
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
  overflow: visible;
  transition: grid-template-columns 220ms ease;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 3;
  width: var(--sidebar-width);
  min-height: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(110, 168, 215, 0.16), rgba(110, 168, 215, 0.035) 32%, rgba(5, 6, 8, 0.18)),
    rgba(9, 10, 13, 0.72);
  border-right: 1px solid rgba(255, 255, 255, 0.13);
  color: var(--text);
  overflow: hidden;
  box-shadow:
    18px 0 44px rgba(0, 0, 0, 0.48),
    inset -1px 0 0 rgba(110, 168, 215, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(22px) saturate(1.32);
  -webkit-backdrop-filter: blur(22px) saturate(1.32);
  transform: none;
  transition: opacity 220ms ease;
}

.sidebar-particles {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.75;
  mix-blend-mode: screen;
}

.sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.11), transparent 28%),
    radial-gradient(circle at 20% 12%, rgba(255, 255, 255, 0.16), transparent 26%);
  opacity: 0.55;
}

.sidebar > :not(.sidebar-particles) {
  position: relative;
  z-index: 1;
}

.sidebar > .sidebar-particles {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.sidebar-collapsed .app-shell {
  grid-template-columns: 0 minmax(0, 1fr);
}

.sidebar-collapsed .sidebar {
  width: 0;
  padding-inline: 0;
  border-right: 0;
  opacity: 0;
  pointer-events: none;
}

.sidebar-collapsed .sidebar > :not(.sidebar-shell-toggle) {
  pointer-events: none;
}

.sidebar-shell-toggle {
  display: none;
}

.sidebar-toggle-icon {
  position: relative;
  width: 14px;
  height: 18px;
  border-left: 2px solid currentColor;
}

.sidebar-toggle-icon::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 5px;
  width: 9px;
  height: 9px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: translateY(-50%) rotate(-135deg);
}

.sidebar-collapsed .sidebar-toggle-icon::before {
  transform: translateY(-50%) rotate(45deg);
}

.mobile-menu-button,
.side-menu-backdrop {
  display: none;
}

.mobile-menu-button {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--accent);
}

.mobile-menu-button span,
.mobile-menu-button span::before,
.mobile-menu-button span::after {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.mobile-menu-button span {
  position: relative;
}

.mobile-menu-button span::before,
.mobile-menu-button span::after {
  content: "";
  position: absolute;
  left: 0;
}

.mobile-menu-button span::before {
  top: -7px;
}

.mobile-menu-button span::after {
  top: 7px;
}

.side-menu-backdrop {
  display: none !important;
}

.side-menu-backdrop[hidden] {
  display: none;
}

@supports (-webkit-touch-callout: none) {
  .sidebar {
    background:
      linear-gradient(180deg, rgba(23, 33, 43, 0.96), rgba(12, 15, 20, 0.96)),
      rgba(9, 10, 13, 0.96);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .auth-view:not(.is-open),
  .dialog-backdrop[hidden],
  .side-menu-backdrop[hidden] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
}

.eye-icon {
  position: relative;
  width: 23px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 999px / 70%;
}

.eye-icon::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
  transform: translate(-50%, -50%);
}

.eye-icon.eye-closed {
  height: 2px;
  border-width: 0;
  border-radius: 0;
  background: currentColor;
}

.eye-icon.eye-closed::before {
  top: 50%;
  left: 50%;
  width: 24px;
  height: 2px;
  border-radius: 0;
  background: currentColor;
  transform: translate(-50%, -50%) rotate(-18deg);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(110, 168, 215, 0.2);
}

.brand-lockup {
  display: grid;
  justify-items: center;
  gap: 6px;
  min-width: 62px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.brand-lockup:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 10px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 8px;
  overflow: hidden;
  background: #050608;
  font-weight: 800;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-name {
  max-width: 76px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  color: var(--text);
  font-size: 15px;
  line-height: 1.15;
}

.brand small {
  max-width: 210px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.language-switch {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.language-switch select {
  min-height: 38px;
  border: 1px solid rgba(110, 168, 215, 0.22);
  border-radius: 8px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  text-transform: none;
  font-weight: 700;
}

.sidebar-footer {
  display: grid;
  gap: 14px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(110, 168, 215, 0.18);
}

.account-panel {
  display: grid;
  gap: 8px;
}

.account-panel > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.account-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.account-actions .tool-button {
  min-height: 38px;
  padding: 8px 10px;
  font-size: 12px;
}

.ad-slot {
  display: grid;
  place-items: center;
  min-height: 72px;
  margin: 12px;
  border: 2px dashed rgba(255, 74, 74, 0.78);
  border-radius: 8px;
  background:
    repeating-linear-gradient(135deg, rgba(255, 74, 74, 0.16) 0 10px, rgba(255, 74, 74, 0.08) 10px 20px),
    rgba(90, 0, 0, 0.24);
  color: #ffb3b3;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.ad-slot span {
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(20, 0, 0, 0.55);
}

.ad-slot-side {
  min-height: 96px;
  margin: 0 0 14px;
}

body.plan-pro .ad-slot,
body.plan-paid .ad-slot {
  display: none;
}

.maker-credit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-decoration: none;
}

.maker-credit:hover {
  color: var(--accent-strong);
}

.maker-mark {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 4px;
  overflow: hidden;
  background: #050608;
}

.maker-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.new-project {
  display: grid;
  gap: 8px;
  flex: 0 0 auto;
}

.new-project input,
.new-project button,
.upload-button,
.tool-button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
}

.new-project input {
  width: 100%;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-color: rgba(110, 168, 215, 0.22);
}

.new-project input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.new-project button,
.upload-button,
.tool-button {
  padding: 0 14px;
  background: var(--accent);
  color: #12100d;
  font-weight: 700;
}

.file-tool {
  display: inline-grid;
  place-items: center;
}

.file-tool input,
#replaceImage[hidden] {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.project-list {
  min-height: 0;
  flex: 1 1 auto;
  display: grid;
  align-content: start;
  gap: 10px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 12px 2px 0;
  margin-right: -12px;
}

.project-item,
.image-item {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  text-align: left;
}

.project-item {
  position: relative;
  padding: 12px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
}

.project-item.active {
  background: rgba(110, 168, 215, 0.16);
  color: var(--text);
  border-color: rgba(110, 168, 215, 0.38);
}

.project-item.locked {
  opacity: 0.64;
  border-color: rgba(255, 255, 255, 0.08);
  filter: saturate(0.72);
}

.project-item.locked .project-open {
  color: var(--muted);
  cursor: not-allowed;
}

.project-item.locked .mini-action:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.project-lock-note {
  margin-top: 10px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.project-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.project-actions {
  display: flex;
  gap: 6px;
  padding-right: 20px;
}

.project-tree-toggle {
  position: absolute;
  top: -9px;
  right: -9px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(110, 168, 215, 0.28);
  border-radius: 999px;
  background: var(--panel);
  color: var(--accent);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.32);
}

.project-tree-toggle .eye-icon {
  width: 17px;
  height: 10px;
  border-width: 1.8px;
}

.project-tree-toggle .eye-icon::before {
  width: 4px;
  height: 4px;
}

.project-tree-toggle .eye-icon.eye-closed {
  height: 2px;
  border-width: 0;
}

.project-tree-toggle .eye-icon.eye-closed::before {
  width: 18px;
  height: 2px;
}

.project-item.tree-collapsed .project-images {
  display: none;
}

.project-open,
.image-open,
.mini-action {
  border: 0;
  background: transparent;
}

.project-open {
  min-width: 0;
  padding: 0;
  color: inherit;
  text-align: left;
  font-weight: 800;
}

.mini-action {
  min-height: 28px;
  min-width: 28px;
  padding: 0 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.09);
  color: inherit;
  font-size: 11px;
  font-weight: 800;
}

.icon-action {
  display: inline-grid;
  place-items: center;
  padding: 0;
}

.icon-action svg {
  width: 15px;
  height: 15px;
  pointer-events: none;
}

.icon-action.danger {
  background: rgba(143, 47, 47, 0.16);
  color: #d24b4b;
}

.project-item.active .mini-action {
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

.project-item.active .icon-action.danger {
  background: rgba(143, 47, 47, 0.12);
  color: #a42d2d;
}

.project-images {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(110, 168, 215, 0.18);
}

.project-image-section,
.project-image-list {
  display: grid;
  gap: 8px;
}

.project-images-empty {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.workspace {
  min-width: 0;
  min-height: 100vh;
  display: block;
  overflow: visible;
}

.upload-button {
  display: inline-grid;
  place-items: center;
}

.upload-button.secondary {
  background: var(--clay);
}

.upload-button input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.editor-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 1fr) 290px;
  gap: 16px;
  padding: 16px;
  overflow: visible;
}

.stage-panel,
.inspector {
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.inspector {
  max-height: none;
  padding: 16px;
  overflow: visible;
}

.stage-panel {
  grid-column: 1;
  display: grid;
  grid-template-rows: auto auto auto;
  overflow: visible;
}

.inspector {
  grid-column: 2;
}

.panel-heading {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

#initialViewTitle,
#initialViewTitle + label,
#initialViewTitle + label + label,
#initialViewTitle + label + label + label {
  display: none;
}

.panel-heading h2,
.control-group h3 {
  margin: 0;
  font-size: 15px;
}

.panel-heading span {
  display: grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--panel-strong);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.image-item {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 8px;
  background: var(--panel-strong);
  color: var(--text);
}

.image-section-title {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.image-item img {
  width: 48px;
  height: 38px;
  object-fit: cover;
  border-radius: 6px;
}

.image-video-thumb {
  display: grid;
  place-items: center;
  width: 48px;
  height: 38px;
  border-radius: 6px;
  background: rgba(110, 168, 215, 0.16);
  color: var(--accent);
}

.image-video-thumb svg {
  width: 22px;
  height: 22px;
}

.image-item span {
  display: grid;
  gap: 3px;
  overflow: hidden;
}

.image-item strong,
.image-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-item strong {
  font-size: 13px;
}

.image-item small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.image-item.active {
  outline: 2px solid var(--accent);
  background: rgba(110, 168, 215, 0.12);
}

.image-open {
  position: absolute;
  inset: 0;
  z-index: 1;
  cursor: pointer;
}

.image-actions {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 6px;
  grid-column: 2;
}

.image-item .mini-action {
  position: relative;
  z-index: 2;
  justify-self: start;
}

.stage-panel {
  display: grid;
  grid-template-rows: auto auto auto;
  align-content: start;
  overflow: visible;
}

.stage-toolbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  padding: 16px;
  background: var(--panel);
}

.stage-toolbar h1 {
  margin: 0;
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.05;
}

.stage-toolbar p {
  margin: 6px 0 0;
  color: var(--muted);
}

.tool-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
}

.icon-tool,
.tool-strip .icon-tool {
  width: 100%;
  min-width: 64px;
  max-width: 112px;
  min-height: 58px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  padding: 7px 6px 6px;
  line-height: 1;
}

.icon-tool svg {
  width: 21px;
  height: 21px;
  pointer-events: none;
}

.icon-tool span {
  max-width: 100%;
  overflow: hidden;
  color: var(--text);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.1;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-tool.is-loading {
  color: var(--accent-strong);
}

.icon-tool.is-loading svg {
  animation: iconPulse 900ms ease-in-out infinite alternate;
}

@keyframes iconPulse {
  from { opacity: 0.48; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}

.tool-button.active {
  background: var(--clay);
}

.tool-button.secondary {
  background: var(--panel-strong);
  color: var(--accent-strong);
  border-color: var(--line);
}

.tool-button.ghost {
  background: transparent;
  color: var(--accent-strong);
  border-color: var(--line);
}

.tool-button.danger {
  background: var(--danger);
  color: #fff;
}

.tool-button.danger:disabled {
  background: var(--danger);
}

.property-toggle {
  width: 100%;
}

.route-mode-switch {
  width: 100%;
  min-height: 50px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 54px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--muted);
  font-weight: 900;
}

.route-mode-switch span:not(.route-mode-track) {
  overflow: hidden;
  line-height: 1.1;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-mode-track {
  position: relative;
  display: block;
  width: 54px;
  height: 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px var(--line);
}

.route-mode-track::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 7px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 16px rgba(110, 168, 215, 0.72);
  transform: translateY(-50%);
  transition: left 180ms ease;
}

.route-mode-switch.active [data-mode="edit"],
.route-mode-switch.navigate-active [data-mode="navigate"] {
  color: var(--accent-strong);
  text-shadow: 0 0 14px rgba(110, 168, 215, 0.38);
}

.route-mode-switch.navigate-active .route-mode-track::before {
  left: 33px;
}

.tool-button:disabled {
  opacity: 0.46;
  cursor: not-allowed;
}

@media (max-width: 1120px) {
  .stage-toolbar {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
  }

  .tool-strip .tool-button,
  .tool-strip .icon-tool {
    max-width: none;
  }
}

.hotspot-band {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.hotspot-band[hidden] {
  display: none;
}

.hotspot-band-title {
  grid-column: 1 / -1;
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
}

.route-add-button {
  position: sticky;
  left: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid rgba(110, 168, 215, 0.36);
  border-radius: 8px;
  background: var(--accent);
  color: #12100d;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: 12px 0 24px rgba(21, 22, 25, 0.72);
}

.route-add-button.active {
  background: var(--clay);
}

.route-add-button:disabled {
  opacity: 0.46;
  cursor: not-allowed;
}

.hotspot-band-list {
  min-width: 0;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 2px;
}

.hotspot-band-item {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--text);
  text-align: left;
}

.hotspot-band-item.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(110, 168, 215, 0.16);
}

.hotspot-band-item.editing-active {
  border-color: #df8536;
  background: rgba(223, 133, 54, 0.16);
  box-shadow: 0 0 0 2px rgba(223, 133, 54, 0.24), 0 10px 26px rgba(223, 133, 54, 0.12);
}

.hotspot-band-focus {
  display: grid;
  grid-template-columns: 32px minmax(72px, 132px);
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 4px 0 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.hotspot-band-delete {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 6px;
  background: rgba(143, 47, 47, 0.14);
  color: #d24b4b;
}

.hotspot-band-delete svg {
  width: 15px;
  height: 15px;
  pointer-events: none;
}

.hotspot-band-symbol {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: rgba(110, 168, 215, 0.16);
  color: var(--accent);
}

.hotspot-band-symbol svg {
  width: 18px;
  height: 18px;
}

.hotspot-band-label {
  overflow: hidden;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-wrap {
  position: relative;
  min-height: 0;
  display: block;
  padding: 28px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(110, 168, 215, 0.06) 1px, transparent 1px),
    linear-gradient(rgba(110, 168, 215, 0.04) 1px, transparent 1px),
    radial-gradient(circle at center, rgba(110, 168, 215, 0.06), transparent 42%),
    #0f1013;
  background-size: 28px 28px;
}

body.view-extended {
  overflow: hidden;
}

body.view-extended .app-shell,
body.view-extended .workspace,
body.view-extended .editor-layout,
body.view-extended .stage-panel {
  position: fixed;
  inset: 0;
  z-index: 70;
  width: 100vw;
  height: 100vh;
  min-height: 0;
  display: block;
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background: #111;
}

body.view-extended .stage-toolbar,
body.view-extended .hotspot-band,
body.view-extended .inspector,
body.view-extended .sidebar,
body.view-extended .side-menu-backdrop {
  display: none !important;
}

.stage-wrap.extended-view,
.stage-wrap:fullscreen {
  position: fixed;
  inset: 0;
  z-index: 80;
  width: 100vw;
  height: 100vh;
  padding: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #111;
}

.stage-wrap.extended-view .stage,
.stage-wrap:fullscreen .stage {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

.stage-wrap.extended-view .image-plane,
.stage-wrap:fullscreen .image-plane {
  width: 100%;
  height: 100%;
  min-height: 0;
  aspect-ratio: auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 0;
  background: #111;
  filter: none;
}

.stage-wrap.extended-view .panorama-viewer,
.stage-wrap:fullscreen .panorama-viewer {
  border-radius: 0;
}

.stage-wrap.extended-view .image-plane img,
.stage-wrap.extended-view .image-plane video,
.stage-wrap:fullscreen .image-plane img,
.stage-wrap:fullscreen .image-plane video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 0;
  filter: none;
}

.stage-wrap.extended-view .image-plane iframe,
.stage-wrap:fullscreen .image-plane iframe {
  width: 100%;
  height: 100%;
  min-height: 0;
  border-radius: 0;
  filter: none;
}

.stage-wrap.extended-view .hotspot-layer,
.stage-wrap:fullscreen .hotspot-layer {
  inset: 0;
}

.extended-exit-button {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  z-index: 90;
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  padding: 0 14px;
  background: rgba(17, 17, 17, 0.72);
  color: #fff;
  font-weight: 900;
  backdrop-filter: blur(8px);
}

.stage-wrap.extended-view .extended-exit-button,
.stage-wrap:fullscreen .extended-exit-button {
  display: inline-grid;
  place-items: center;
}

.empty-state {
  display: grid;
  gap: 6px;
  max-width: 320px;
  margin: 48px auto;
  justify-items: center;
  text-align: center;
  color: var(--muted);
}

.empty-state[hidden] {
  display: none;
}

.empty-state strong {
  color: var(--text);
  font-size: 18px;
}

.empty-state .tool-button {
  margin-top: 8px;
  min-width: 190px;
}

.stage {
  width: min(100%, 980px);
  margin: 0 auto;
  perspective: 1200px;
}

.stage.plan-stage {
  perspective: none;
}

.image-plane {
  position: relative;
  width: 100%;
  transform-style: preserve-3d;
  filter: drop-shadow(var(--shadow));
}

.scene-stage .image-plane {
  aspect-ratio: 16 / 9;
  min-height: 320px;
}

.plan-stage .image-plane {
  filter: drop-shadow(0 14px 36px rgba(0, 0, 0, 0.26));
}

.pdf-stage .image-plane,
.video-stage .image-plane {
  filter: drop-shadow(0 14px 36px rgba(0, 0, 0, 0.26));
}

.pdf-stage .image-plane {
  overflow: hidden;
  background: #f7f7f5;
}

.panorama-viewer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 8px;
  background: #08090b;
  cursor: grab;
  touch-action: none;
}

.panorama-viewer[hidden],
.image-plane img[hidden],
.image-plane video[hidden] {
  display: none;
}

.image-plane iframe[hidden] {
  display: none;
}

.pdf-fallback[hidden] {
  display: none;
}

.pdf-fallback {
  display: grid;
  padding: 12px;
  background: #111216;
}

.pdf-fallback .tool-button {
  width: 100%;
}

.panorama-viewer:active {
  cursor: grabbing;
}

.panorama-viewer canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.image-plane img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  user-select: none;
}

.image-plane video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  background: #08090b;
  filter: drop-shadow(0 14px 36px rgba(0, 0, 0, 0.26));
}

.image-plane iframe {
  display: block;
  width: 100%;
  height: min(820px, calc(100dvh - 220px));
  min-height: 520px;
  border: 0;
  border-radius: 8px;
  background: #17181b;
  filter: drop-shadow(0 14px 36px rgba(0, 0, 0, 0.26));
  -webkit-overflow-scrolling: touch;
}

.hotspot-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hotspot {
  position: absolute;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.82);
  border-radius: 999px;
  background: rgba(110, 168, 215, 0.72);
  color: white;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.24);
  transform: translate(-50%, -50%);
  pointer-events: auto;
  cursor: pointer;
  touch-action: none;
}

.hotspot-symbol {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  rotate: var(--hotspot-rotation, 0deg);
  pointer-events: none;
}

.hotspot-label {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  max-width: 160px;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(8, 9, 11, 0.88);
  color: white;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.15;
  overflow: hidden;
  pointer-events: none;
  text-align: center;
  text-overflow: ellipsis;
  transform: translateX(-50%);
  white-space: nowrap;
}

.hotspot-layer.edit-mode .hotspot {
  cursor: grab;
}

.hotspot-layer.edit-mode .hotspot.dragging {
  cursor: grabbing;
}

.hotspot.selected {
  background: rgba(79, 143, 199, 0.82);
  outline: 3px solid rgba(110, 168, 215, 0.28);
}

.hotspot-layer.edit-mode .hotspot.selected {
  background: rgba(223, 133, 54, 0.88);
  outline-color: rgba(223, 133, 54, 0.36);
  box-shadow: 0 10px 30px rgba(223, 133, 54, 0.26);
}

.hotspot-symbol svg {
  width: 58%;
  height: 58%;
  pointer-events: none;
}

.control-group {
  display: grid;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.control-group[hidden] {
  display: none !important;
}

.control-group:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.control-group label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

#infoTextWrap[hidden] {
  display: none !important;
}

.control-group input,
.control-group textarea,
.control-group select {
  min-height: 36px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--text);
}

.control-group input[type="text"],
.control-group textarea,
.control-group select {
  padding: 0 10px;
}

.control-group textarea {
  min-height: 110px;
  padding-top: 10px;
  resize: vertical;
}

.hint {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: grid;
  align-items: start;
  justify-items: center;
  padding: max(20px, env(safe-area-inset-top)) 20px 20px;
  background: rgba(0, 0, 0, 0.64);
  backdrop-filter: blur(8px);
}

.dialog-backdrop[hidden] {
  display: none;
}

.dialog-card {
  width: min(420px, 100%);
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 28px;
  border: 1px solid rgba(110, 168, 215, 0.22);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.48);
  text-align: center;
}

.dialog-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 999px;
  background: rgba(110, 168, 215, 0.16);
  color: var(--accent);
  font-size: 28px;
  font-weight: 900;
}

.dialog-icon.danger {
  background: rgba(143, 47, 47, 0.14);
  color: #b43d3d;
}

.dialog-card h2 {
  max-width: 100%;
  margin: 0;
  font-size: 22px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.dialog-card p {
  max-width: 100%;
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  word-break: break-word;
}

.dialog-card p a {
  color: var(--accent);
  display: inline;
  font-weight: 900;
  overflow-wrap: anywhere;
  text-decoration: underline;
  word-break: break-all;
}

.dialog-card input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--text);
}

.dialog-actions {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}

.dialog-button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 900;
  overflow-wrap: anywhere;
  padding: 8px 12px;
  white-space: normal;
}

.dialog-button.primary {
  background: var(--accent);
  color: #12100d;
}

.dialog-button.primary.danger {
  background: var(--danger);
  color: #fff;
}

.dialog-button.secondary {
  background: var(--panel-strong);
  color: var(--muted);
  border-color: var(--line);
}

.upload-dialog-card {
  text-align: left;
}

.upload-dialog-card h2,
.upload-dialog-card p {
  text-align: center;
}

.upload-kind-label {
  width: 100%;
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.upload-kind-label select {
  min-height: 42px;
  width: 100%;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--text);
}

.upload-drop-zone {
  width: 100%;
  min-height: 150px;
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 22px;
  border: 2px dashed rgba(110, 168, 215, 0.36);
  border-radius: 8px;
  background: rgba(110, 168, 215, 0.08);
  color: var(--accent);
  text-align: center;
}

.upload-drop-zone strong,
.upload-drop-zone span {
  display: block;
}

.upload-drop-zone span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.upload-drop-zone.drag-over {
  border-color: var(--accent);
  background: rgba(110, 168, 215, 0.16);
}

.upload-progress {
  width: 100%;
  display: grid;
  gap: 10px;
}

.upload-progress[hidden] {
  display: none;
}

.upload-progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.upload-progress-row strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-progress-track {
  width: 100%;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
}

.upload-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 160ms ease;
}

.upload-progress-track.indeterminate span {
  width: 42%;
  animation: export-progress-pulse 1.1s ease-in-out infinite;
}

@keyframes export-progress-pulse {
  0% {
    transform: translateX(-110%);
  }

  100% {
    transform: translateX(250%);
  }
}

.upload-dialog-card .dialog-actions {
  grid-template-columns: 1fr;
}

.history-dialog-card {
  width: min(620px, 100%);
  justify-items: stretch;
  text-align: left;
}

.history-dialog-card h2 {
  text-align: center;
}

.history-list {
  width: 100%;
  display: grid;
  gap: 10px;
}

.history-item {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.history-item strong,
.history-item small,
.history-item a {
  min-width: 0;
  overflow-wrap: anywhere;
}

.history-item strong {
  color: var(--text);
  font-size: 14px;
}

.history-item small {
  color: var(--muted);
  font-weight: 800;
}

.history-item a {
  color: var(--accent);
  font-weight: 900;
  text-decoration: underline;
  word-break: break-all;
}

.history-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.history-empty {
  margin: 0;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 820px) {
  .editor-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }

  .stage-panel {
    grid-column: 1;
    grid-row: 1;
  }

  .inspector {
    grid-column: 1;
    grid-row: 2;
    max-height: none;
  }
}

@media (max-width: 680px) {
  .stage-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .tool-strip {
    justify-content: stretch;
  }

  .tool-button {
    width: 100%;
  }
}

@media (max-width: 820px) {
  body {
    min-height: 100vh;
    overflow-y: auto;
  }

  .app-shell {
    position: relative;
    --sidebar-width: min(86vw, 340px);
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, calc(100vw - var(--sidebar-width)));
    width: 100%;
    max-width: 100vw;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    overflow-x: hidden;
    overflow-y: visible;
  }

  .sidebar {
    position: sticky;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    height: 100dvh;
    height: 100svh;
    padding: max(18px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
    gap: 14px;
    overflow: hidden;
    box-shadow:
      18px 0 44px rgba(0, 0, 0, 0.48),
      inset -1px 0 0 rgba(110, 168, 215, 0.18),
      inset 0 1px 0 rgba(255, 255, 255, 0.14);
    transform: none;
    transition: opacity 220ms ease;
    z-index: 3;
  }

  .side-menu-backdrop {
    display: none !important;
  }

  .side-menu-backdrop[hidden] {
    display: none;
  }

  .sidebar-collapsed .app-shell {
    grid-template-columns: 0 minmax(0, 1fr);
  }

  .sidebar-collapsed .sidebar {
    width: 0;
    padding-inline: 0;
    opacity: 0;
    pointer-events: none;
  }

  .sidebar-collapsed .sidebar > :not(.sidebar-shell-toggle) {
    pointer-events: none;
  }

  .sidebar-shell-toggle {
    display: none;
  }

  .mobile-menu-button {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-strong);
    color: var(--accent);
  }

  .mobile-menu-button span,
  .mobile-menu-button span::before,
  .mobile-menu-button span::after {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
  }

  .mobile-menu-button span {
    position: relative;
  }

  .mobile-menu-button span::before,
  .mobile-menu-button span::after {
    content: "";
    position: absolute;
    left: 0;
  }

  .mobile-menu-button span::before {
    top: -7px;
  }

  .mobile-menu-button span::after {
    top: 7px;
  }

  .brand-mark {
    width: 54px;
    height: 54px;
  }

  .language-switch select,
  .new-project button,
  .upload-button,
  .tool-button,
  .dialog-button,
  .dialog-card input,
  .upload-kind-label select,
  .control-group input,
  .control-group select {
    min-height: 46px;
  }

  .project-list {
    gap: 8px;
    padding-right: 8px;
    margin-right: -8px;
  }

  .project-item {
    padding: 10px;
  }

  .project-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .project-actions,
  .image-actions {
    justify-content: flex-start;
    padding-right: 0;
  }

  .mini-action {
    min-width: 38px;
    min-height: 38px;
    border-radius: 8px;
  }

  .workspace,
  .editor-layout {
    min-height: 100vh;
  }

  .editor-layout {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    gap: 8px;
    padding: max(28px, calc(env(safe-area-inset-top) + 8px)) 8px max(8px, env(safe-area-inset-bottom));
    padding-left: 8px;
  }

  .stage-panel,
  .inspector {
    border-radius: 8px;
  }

  .stage-panel {
    grid-row: 1;
  }

  .inspector {
    grid-row: 2;
    padding: 12px;
    max-height: none;
    overflow: visible;
  }

  .panel-heading {
    position: sticky;
    top: -12px;
    z-index: 2;
    margin: -12px -12px 10px;
    padding: 12px;
    border-bottom: 1px solid var(--line);
    background: var(--panel);
  }

  .control-group {
    gap: 10px;
    padding: 12px 0;
  }

  .stage-toolbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
    align-items: center;
  }

  .stage-toolbar h1 {
    font-size: clamp(22px, 8vw, 30px);
    overflow-wrap: anywhere;
  }

  .stage-toolbar p {
    display: -webkit-box;
    overflow: hidden;
    font-size: 13px;
    line-height: 1.25;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .tool-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 10px 12px;
  }

  .tool-button {
    width: auto;
    padding: 0 10px;
    font-size: 13px;
  }

  .tool-strip .icon-tool {
    width: 100%;
    min-width: 64px;
    max-width: none;
    padding: 7px 6px 6px;
  }

  .hotspot-band {
    margin-top: 22px;
    padding: 8px 12px;
  }

  .hotspot-band-focus {
    grid-template-columns: 30px minmax(56px, 108px);
  }

  .stage-wrap {
    padding: 10px;
    background-size: 22px 22px;
  }

  .stage {
    width: 100%;
  }

  .scene-stage .image-plane {
    min-height: 240px;
    max-height: none;
  }

  .hotspot {
    min-width: 36px;
    min-height: 36px;
  }

  .hotspot-label {
    max-width: 112px;
    font-size: 11px;
  }

  .dialog-backdrop {
    align-items: start;
    padding: 12px;
    padding-top: max(12px, env(safe-area-inset-top));
    padding-bottom: 12px;
  }

  .dialog-card {
    width: 100%;
    max-height: calc(100dvh - 24px);
    overflow: auto;
    padding: 20px;
  }

  .dialog-actions {
    grid-template-columns: 1fr;
  }

  .upload-drop-zone {
    min-height: 118px;
    padding: 16px;
  }
}

@media (max-width: 480px) {
  .editor-layout {
    grid-template-rows: auto auto;
    gap: 6px;
    padding: max(34px, calc(env(safe-area-inset-top) + 10px)) 6px max(6px, env(safe-area-inset-bottom));
    padding-left: 6px;
  }

  .stage-toolbar {
    padding: 10px;
    gap: 8px;
  }

  .stage-toolbar h1 {
    font-size: clamp(20px, 7vw, 24px);
  }

  .tool-strip {
    gap: 6px;
    overflow-x: auto;
    justify-content: space-between;
    padding: 8px 10px;
  }

  .tool-strip .icon-tool {
    flex: 1 1 0;
    width: auto;
    min-width: 58px;
    min-height: 54px;
  }

  .hotspot-band {
    gap: 6px;
    margin-top: 20px;
    padding: 7px 10px;
  }

  .hotspot-band-item {
    min-height: 40px;
  }

  .hotspot-band-focus {
    grid-template-columns: 28px minmax(48px, 86px);
  }

  .hotspot-band-delete {
    width: 32px;
    height: 32px;
  }

  .stage-wrap {
    padding: 8px;
  }

  .scene-stage .image-plane {
    min-height: 210px;
  }

  .inspector {
    padding: 10px;
  }

  .panel-heading {
    top: -10px;
    margin: -10px -10px 8px;
    padding: 10px;
  }

  .control-group label {
    font-size: 12px;
  }

  .control-group textarea {
    min-height: 82px;
  }
}

body.view-extended,
body.view-extended .app-shell,
body.view-extended .workspace,
body.view-extended .editor-layout,
body.view-extended .stage-panel,
body.view-extended .stage-wrap.extended-view {
  position: fixed !important;
  inset: 0 !important;
  z-index: 9999 !important;
  width: 100vw !important;
  width: 100dvw !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-width: none !important;
  max-height: none !important;
  min-width: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  overflow: hidden !important;
  background: #111 !important;
}

body.view-extended .stage-wrap.extended-view {
  display: block !important;
}

body.view-extended .stage,
body.view-extended .image-plane,
body.view-extended .panorama-viewer {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  min-width: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 0 !important;
  aspect-ratio: auto !important;
  overflow: hidden !important;
  transform: none !important;
  filter: none !important;
}

body.view-extended .panorama-viewer canvas,
body.view-extended .image-plane img,
body.view-extended .image-plane video,
body.view-extended .image-plane iframe {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  min-width: 0 !important;
  min-height: 0 !important;
  border-radius: 0 !important;
  filter: none !important;
}

body.view-extended .panorama-viewer[hidden],
body.view-extended .image-plane img[hidden],
body.view-extended .image-plane video[hidden],
body.view-extended .image-plane iframe[hidden] {
  display: none !important;
}

body.view-extended .image-plane img,
body.view-extended .image-plane video {
  object-fit: contain !important;
}

body.view-extended .hotspot-layer {
  position: absolute !important;
  inset: 0 !important;
}

body.view-extended.extended-pdf .stage-wrap.extended-view,
body.view-extended.extended-pdf .stage,
body.view-extended.extended-pdf .image-plane {
  overflow: auto !important;
  -webkit-overflow-scrolling: touch;
}

body.view-extended.extended-pdf .image-plane {
  display: block !important;
  padding: 72px 0 0 !important;
}

body.view-extended.extended-pdf .image-plane iframe:not([hidden]) {
  position: relative !important;
  display: block !important;
  width: 100% !important;
  height: max(100dvh, 1400px) !important;
  min-height: 100dvh !important;
  pointer-events: auto !important;
  touch-action: pan-x pan-y !important;
  background: #333 !important;
}
