:root {
  --bg: #090c12;
  --surface: #11151d;
  --surface-soft: #171c26;
  --surface-subtle: #1c222d;
  --sidebar: #080b10;
  --topbar: rgba(11, 14, 20, 0.94);
  --panel: #11151d;
  --panel-2: #171c26;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.17);
  --text: #f4f7fb;
  --muted: #a8b0bf;
  --soft: #788292;
  --brand: #39d9c5;
  --brand-2: #8b7cff;
  --brand-soft: rgba(57, 217, 197, 0.1);
  --cyan: #39d9c5;
  --purple: #8b7cff;
  --purple-2: #7565f4;
  --orange: #ffad66;
  --blue: #64a8ff;
  --green: #4ade80;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  --shadow-soft: 0 10px 28px rgba(0, 0, 0, 0.2);
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  min-height: 100dvh;
  background: var(--bg);
}

button,
input,
select,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}

.skip-to-content {
  position: fixed;
  top: 10px;
  left: 12px;
  z-index: 200;
  padding: 9px 13px;
  color: #07110f;
  background: var(--brand);
  border-radius: 6px;
  font-weight: 800;
  transform: translateY(-160%);
  transition: transform 0.16s ease;
}

.skip-to-content:focus {
  transform: translateY(0);
}

.app-shell {
  grid-template-columns: 232px minmax(0, 1fr);
  background: var(--bg);
}

.sidebar {
  background: var(--sidebar);
  border-right-color: var(--line);
}

.brand-block {
  height: 64px;
  padding: 0 18px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  background: #8b5cf6;
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.3);
}

.brand-block span {
  color: #8f98a8;
}

.side-nav {
  padding: 12px 10px 24px;
}

.nav-caption {
  margin-top: 18px;
  color: #697383;
  font-size: 11px;
  text-transform: uppercase;
}

.group-title,
.side-link {
  border: 1px solid transparent;
}

.group-title:hover,
.side-link:hover,
.side-link.active {
  color: var(--text);
  background: #141a22;
  border-color: rgba(255, 255, 255, 0.06);
}

.side-link.active {
  color: var(--brand);
  background: rgba(57, 217, 197, 0.09);
  border-color: rgba(57, 217, 197, 0.18);
}

.side-link.active:after {
  width: 5px;
  height: 5px;
  background: var(--brand);
  box-shadow: 0 0 12px rgba(57, 217, 197, 0.7);
}

.page-topbar {
  min-height: 58px;
  padding: 0 22px;
  background: var(--topbar);
  border-bottom-color: var(--line);
  box-shadow: 0 1px rgba(0, 0, 0, 0.26);
}

.topbar-title strong {
  font-size: 18px;
}

.workspace {
  width: min(1440px, 100%);
  padding: 22px 24px 40px;
}

.compose-form-page,
.home-page,
.content-stack {
  gap: 14px;
}

.home-hero-panel {
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 28px;
  padding: 28px 30px;
  background: #11151d;
  border-color: var(--line);
  box-shadow: none;
}

.home-hero-panel h1 {
  max-width: 740px;
  font-size: 32px;
  line-height: 1.22;
}

.home-hero-panel p:not(.eyebrow) {
  max-width: 620px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.home-hero-actions {
  margin-top: 20px;
}

.home-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: start;
  gap: 8px;
}

.home-stats article {
  min-width: 0;
  padding: 14px 12px;
  background: #171c26;
  border-color: var(--line);
  box-shadow: none;
}

.home-stats strong {
  font-size: 22px;
}

.home-stats span {
  margin-top: 7px;
  font-size: 11px;
  white-space: nowrap;
}

.home-tool-grid {
  gap: 10px;
}

.home-tool-grid button {
  min-height: 118px;
  gap: 8px;
  padding: 16px;
  background: #11151d;
  box-shadow: none;
}

.home-tool-grid button:hover {
  border-color: rgba(57, 217, 197, 0.38);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
  transform: translateY(-1px);
}

.home-tool-grid svg,
.eyebrow {
  color: var(--brand);
}

.primary-button,
.start-button,
.capture-view-button,
.settings-save-button,
.primary-action,
.share-box button,
.editor-save-button,
.login-button {
  color: #06110f;
  background: var(--brand);
  box-shadow: 0 9px 24px rgba(57, 217, 197, 0.18);
}

.primary-button:hover,
.start-button:hover,
.capture-view-button:hover,
.settings-save-button:hover,
.primary-action:hover,
.editor-save-button:hover {
  color: #06110f;
  background: #63e5d5;
}

.primary-button:disabled,
.start-button:disabled,
.capture-view-button:disabled,
.settings-save-button:disabled,
.primary-action:disabled,
.editor-save-button:disabled {
  color: #737c8a;
  background: #222832;
  box-shadow: none;
  opacity: 1;
}

.secondary-button,
.ghost-button,
.scene-methods button,
.scene-upload-button,
.header-icon,
.icon-button {
  color: #d6dce7;
  background: #171c26;
  border-color: var(--line);
}

.secondary-button:hover,
.ghost-button:hover,
.scene-methods button:hover,
.scene-upload-button:hover,
.header-icon:hover,
.icon-button:hover {
  color: var(--brand);
  background: rgba(57, 217, 197, 0.08);
  border-color: rgba(57, 217, 197, 0.32);
}

.white-panel,
.empty-board,
.coming-soon,
.work-card,
.recycle-card,
.tour-scenes,
.recent-card,
.scene-thumb-card,
.tour-scene-card {
  background: #11151d;
  border-color: var(--line);
  box-shadow: none;
}

.work-info-panel {
  min-height: auto;
  padding: 20px;
}

.form-grid {
  grid-template-columns: minmax(320px, 560px) minmax(0, 1fr);
  margin-top: 12px;
}

.form-row input,
.form-row select,
.work-name-editor input,
.panel-scene-main input,
.settings-section input[type="number"],
.range-number-row input {
  background: #171c26;
  border-color: var(--line-strong);
}

.form-row input:focus,
.form-row select:focus,
.work-name-editor input:focus,
.panel-scene-main input:focus {
  border-color: rgba(57, 217, 197, 0.7);
  box-shadow: 0 0 0 3px rgba(57, 217, 197, 0.11);
}

.scene-upload-panel {
  padding: 20px;
}

.scene-title-row {
  margin-bottom: 12px;
}

.scene-dropzone {
  position: relative;
  min-height: 330px;
  overflow: hidden;
  background: #0c1017;
  border: 1px dashed rgba(168, 176, 191, 0.35);
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}

.scene-dropzone:hover,
.scene-dropzone:focus-visible,
.scene-dropzone.dragging {
  background: rgba(57, 217, 197, 0.04);
  border-color: rgba(57, 217, 197, 0.68);
  box-shadow: inset 0 0 0 1px rgba(57, 217, 197, 0.08);
}

.scene-dropzone:before {
  position: absolute;
  inset: 14px;
  z-index: 0;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.025);
  border-radius: 6px;
  content: "";
}

.scene-dropzone > * {
  position: relative;
  z-index: 1;
}

.upload-empty-state {
  max-width: 620px;
}

.upload-empty-state > svg {
  color: var(--brand);
  opacity: 0.9;
}

.upload-empty-state ul {
  color: #8f98a8;
  line-height: 1.75;
}

.scene-methods {
  gap: 8px;
}

.scene-methods button,
.scene-upload-button {
  min-height: 36px;
}

.compose-actions {
  position: static;
  margin: 14px 0 0;
  padding: 14px 0 0;
  background: transparent;
  border-top: 1px solid var(--line);
}

.panorama-editor-page {
  background: #070a0f;
}

.editor-viewer:before {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.48), transparent 20%, transparent 76%, rgba(0, 0, 0, 0.5));
}

.editor-tools-panel,
.view-settings-panel,
.editor-side-panel,
.editor-tool-toast,
.editor-return-button,
.editor-floating-top,
.editor-bottom-center,
.editor-small-button {
  background: rgba(13, 17, 24, 0.9);
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.editor-tool-item.active,
.panel-scene.active,
.display-mode-grid button.active {
  color: var(--brand);
  background: rgba(57, 217, 197, 0.11);
  border-color: rgba(57, 217, 197, 0.32);
}

.editor-bottom-center {
  bottom: 18px;
  min-height: 38px;
}

.editor-bottom-actions {
  right: 22px;
  bottom: 20px;
}

.has-right-panel .editor-bottom-actions {
  right: 358px;
}

.tour-studio .tour-preview-panel,
.tour-studio .tour-scenes,
.tour-studio .tour-project-head,
.tour-studio .tour-metrics article,
.tour-studio .tour-empty-state {
  background: #11151d;
  border-color: var(--line);
}

.tour-studio .tour-scene-card.active,
.tour-studio .tour-route-strip button.active {
  color: var(--brand);
  background: rgba(57, 217, 197, 0.1);
  border-color: rgba(57, 217, 197, 0.35);
}

.tour-studio .tour-map-nodes button.active {
  color: #07110f;
  background: var(--brand);
  border-color: var(--brand);
}

.tour-studio .tour-project-head {
  gap: 14px;
  padding: 14px 16px;
}

.tour-studio .tour-project-head h2 {
  margin-top: 3px;
  font-size: 20px;
  line-height: 1.15;
}

.tour-studio .tour-project-head span {
  margin-top: 5px;
  font-size: 12px;
}

.tour-studio .tour-head-actions {
  gap: 8px;
}

.tour-studio .tour-head-actions button {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.tour-studio .tour-metrics {
  gap: 8px;
}

.tour-studio .tour-metrics article {
  gap: 4px;
  padding: 10px 12px;
}

.tour-studio .tour-metrics span,
.tour-studio .tour-metrics small {
  font-size: 11px;
}

.tour-studio .tour-metrics strong {
  font-size: 18px;
  line-height: 1.05;
}

.tour-studio .tour-workbench {
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 10px;
  min-height: clamp(560px, calc(100vh - 290px), 720px);
}

.tour-studio .tour-preview-toolbar {
  min-height: 52px;
  padding: 0 12px;
}

.tour-studio .tour-preview {
  min-height: 560px;
}

.tour-studio .tour-route-strip {
  gap: 6px;
  padding: 7px 8px;
}

.tour-studio .tour-map-panel {
  gap: 10px;
  padding: 9px 12px;
}

.tour-studio .tour-scenes {
  padding: 12px;
}

.tour-studio .tour-scenes-head {
  padding: 0 0 8px;
}

.pnlm-container {
  background-color: #080b10;
}

.pnlm-controls {
  overflow: hidden;
  background: rgba(13, 17, 24, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  box-shadow: 0 7px 22px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
}

.pnlm-control:hover {
  background-color: rgba(57, 217, 197, 0.15);
}

.pnlm-panorama-info,
.pnlm-load-box,
.pnlm-load-button,
.pnlm-info-box {
  background: rgba(9, 12, 18, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  backdrop-filter: blur(10px);
}

.shared-panorama-page,
.shared-page-state {
  background: #070a0f;
}

.shared-topbar,
.shared-scene-strip,
.shared-music-control {
  background: rgba(13, 17, 24, 0.86);
  border-color: var(--line-strong);
  backdrop-filter: blur(14px);
}

.shared-scene-strip button.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(57, 217, 197, 0.18);
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .home-hero-panel {
    grid-template-columns: 1fr;
  }

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

  .tour-studio .tour-workbench {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
  }
}

@media (max-width: 760px) {
  .page-topbar {
    min-height: 56px;
    padding: 8px 14px;
  }

  .workspace {
    padding: 14px 12px 28px;
  }

  .home-hero-panel {
    gap: 20px;
    padding: 20px;
  }

  .home-hero-panel h1 {
    font-size: 27px;
  }

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

  .home-stats article {
    padding: 12px 9px;
  }

  .home-stats strong {
    font-size: 20px;
  }

  .scene-upload-panel,
  .work-info-panel {
    padding: 16px;
  }

  .scene-dropzone {
    min-height: 380px;
  }

  .compose-actions {
    margin-top: 12px;
    padding: 12px 0 0;
  }

  .view-settings-panel,
  .editor-side-panel {
    top: 62px;
    right: 8px;
    bottom: 8px;
    left: 46px;
  }

  .has-right-panel .editor-bottom-actions {
    right: 10px;
  }

  .editor-bottom-center {
    bottom: calc(14px + env(safe-area-inset-bottom));
    max-width: calc(100vw - 130px);
    overflow: hidden;
    padding: 0 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .tour-studio .tour-project-head h2 {
    font-size: 20px;
  }

  .tour-studio .tour-preview {
    min-height: 420px;
  }
}

@media (max-width: 460px) {
  .home-hero-panel h1 {
    font-size: 25px;
  }

  .home-stats {
    grid-template-columns: 1fr;
  }

  .home-stats article {
    display: grid;
    grid-template-columns: 42px 1fr;
    align-items: center;
  }

  .home-stats span {
    margin-top: 0;
  }

  .scene-dropzone {
    min-height: 410px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
