:root {
  /* Museum brand tokens (light) */
  --color-bg: #f3ebdd;
  --color-surface: #e6d8c4;
  --color-surface-2: #dccab2;
  --color-text: #2e261f;
  --color-muted: #6f6254;
  --color-border: #c9b79e;

  --color-accent: #8a5820;
  --color-accent-hover: #734717;
  --color-accent-active: #5f3812;
  --color-accent-disabled: #bda58a;

  --color-accent-2: #2e5a44;
  --color-accent-2-hover: #244b39;
  --color-accent-2-active: #1b3a2c;
  --color-accent-2-disabled: #7f9b8d;

  --color-link: #2d5f85;
  --color-visited: #5b4c7d;
  --color-danger: #a33a2b;
  --color-success: #3f6b46;
  --color-warning: #8a5820;
  --color-focus-ring: #1f6e8c;
  --color-overlay: rgba(33, 25, 17, 0.36);

  --shadow-soft: 0 10px 28px rgba(68, 44, 20, 0.18);
  --shadow-elev: 0 18px 45px rgba(68, 44, 20, 0.24);

  --tile-fallback-1: linear-gradient(135deg, #6d7b70, #465346);
  --tile-fallback-2: linear-gradient(135deg, #7a6551, #4d3f35);
  --tile-fallback-3: linear-gradient(135deg, #6a675f, #47443c);
  --tile-fallback-4: linear-gradient(135deg, #5d7368, #3f544b);

  /* Compatibility mapping for existing styles */
  --bg: var(--color-bg);
  --bg-soft: var(--color-surface);
  --card-border: color-mix(in srgb, var(--color-border) 75%, #ffffff 25%);
  --text: var(--color-text);
  --muted: var(--color-muted);
  --accent: var(--color-accent);
  --shadow: var(--shadow-elev);
  --radius-xl: 24px;
  --radius-lg: 18px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #1e1711;
    --color-surface: #2b2118;
    --color-surface-2: #3a2b1f;
    --color-text: #f3e7d7;
    --color-muted: #b9a792;
    --color-border: #4d3a2a;
    --color-accent: #c28a45;
    --color-accent-hover: #d39a55;
    --color-accent-active: #a97539;
    --color-accent-disabled: #7b634b;
    --color-accent-2: #6f9c84;
    --color-accent-2-hover: #82ae97;
    --color-accent-2-active: #587b67;
    --color-accent-2-disabled: #4d6859;
    --color-link: #8db6d6;
    --color-visited: #b39ed0;
    --color-danger: #ce675a;
    --color-success: #7cb387;
    --color-warning: #c28a45;
    --color-focus-ring: #f0b35c;
    --color-overlay: rgba(8, 6, 4, 0.54);
    --shadow-soft: 0 10px 28px rgba(0, 0, 0, 0.34);
    --shadow-elev: 0 18px 45px rgba(0, 0, 0, 0.42);
    --tile-fallback-1: linear-gradient(135deg, #4a5b52, #2b342f);
    --tile-fallback-2: linear-gradient(135deg, #5a4a3a, #2f271f);
    --tile-fallback-3: linear-gradient(135deg, #4f4c45, #2b2924);
    --tile-fallback-4: linear-gradient(135deg, #446055, #283b34);
  }
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  font-family: "Sora", "Manrope", "Segoe UI", "Trebuchet MS", Verdana, Arial, sans-serif;
  background: radial-gradient(circle at 10% 20%, #1f2d3f 0%, var(--bg) 55%, #090c12 100%);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--accent);
}

img,
canvas,
video {
  max-width: 100%;
  display: block;
}

.viewer-container {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.panorama-transition-overlay {
  position: fixed;
  inset: 0;
  z-index: 14;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(circle at 50% 45%, rgba(24, 20, 16, 0.7), rgba(8, 7, 6, 0.9)),
    color-mix(in srgb, var(--color-bg) 64%, #000000 36%);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  transition: opacity var(--panorama-transition-duration, 640ms) cubic-bezier(.22, .72, .2, 1);
}

.panorama-transition-overlay.is-visible {
  opacity: 1;
}

.home-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: stretch;
  justify-content: center;
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
  transition: opacity 220ms ease, visibility 220ms ease;
}

.home-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.home-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 78% 12%, rgba(65, 196, 255, 0.2), transparent 42%),
    radial-gradient(circle at 8% 84%, rgba(255, 168, 86, 0.12), transparent 38%),
    linear-gradient(128deg, rgba(7, 14, 23, 0.88), rgba(10, 18, 31, 0.7));
  backdrop-filter: blur(8px);
}

.home-content {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  padding: 0;
  display: grid;
  grid-template-rows: minmax(154px, clamp(184px, 27vh, 280px)) minmax(0, 1fr);
  gap: 0;
}

.hero {
  background: linear-gradient(140deg, rgba(11, 19, 28, 0.84), rgba(15, 26, 39, 0.65));
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  padding: clamp(16px, 2.8vw, 28px);
  box-shadow: var(--shadow);
}

.hero-kicker {
  margin: 0;
  font-size: clamp(12px, 2vw, 14px);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero-title {
  margin: 8px 0 6px;
  font-size: clamp(36px, 5.2vw, 76px);
  line-height: 0.98;
  font-weight: 800;
  overflow-wrap: anywhere;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  margin: 0;
  max-width: 900px;
  color: var(--muted);
  font-size: clamp(15px, 1.5vw, 22px);
}

.hero-actions {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
}

.home-hero-strip {
  background:
    linear-gradient(120deg, rgba(10, 95, 168, 0.96), rgba(16, 169, 227, 0.94)),
    radial-gradient(circle at 82% 18%, rgba(255, 255, 255, 0.24), transparent 34%);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: clamp(18px, 2.4vw, 30px) clamp(18px, 3.2vw, 52px);
  display: grid;
  align-content: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
}

.home-hero-strip .hero-kicker {
  color: #e8f6ff;
}

.home-hero-strip .hero-title {
  color: #f6fbff;
  text-shadow: 0 5px 22px rgba(0, 0, 0, 0.24);
}

.home-hero-strip .hero-subtitle {
  color: rgba(235, 246, 255, 0.95);
}

.lang-toggle,
.back-btn,
.btn,
input,
select,
textarea {
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(16, 24, 33, 0.92);
  color: var(--text);
  border-radius: 10px;
}

.lang-toggle {
  min-width: 62px;
  padding: 8px 14px;
  font-weight: 600;
  border-radius: 999px;
  cursor: pointer;
}

.category-grid {
  min-height: 0;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: clamp(10px, 1.8vw, 16px);
  padding-right: 2px;
  align-content: start;
}

.home-slanted-grid {
  --cut: 10%;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-flow: row;
  grid-auto-columns: auto;
  grid-auto-rows: minmax(220px, 1fr);
  gap: clamp(10px, 1.1vw, 18px);
  align-items: stretch;
  overflow-x: hidden;
  overflow-y: auto;
  border-radius: 0;
  border: 0;
  background:
    linear-gradient(180deg, rgba(173, 181, 193, 0.92), rgba(156, 165, 179, 0.9));
  box-shadow: none;
  padding: clamp(12px, 1.2vw, 18px) clamp(10px, 1.2vw, 20px) clamp(16px, 1.6vw, 24px);
}

.category-card {
  position: relative;
  min-height: 150px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-align: left;
  color: var(--text);
  background: #182230;
  box-shadow: var(--shadow);
  cursor: pointer;
  isolation: isolate;
}

.slanted-card {
  position: relative;
  height: 100%;
  min-height: 220px;
  border: 0;
  margin-left: 0;
  border-radius: 0;
  cursor: pointer;
  color: var(--text);
  text-align: left;
  overflow: hidden;
  background: #131c2b;
  isolation: isolate;
  clip-path: polygon(var(--cut) 0, 100% 0, calc(100% - var(--cut)) 100%, 0 100%);
  transition: filter 160ms ease, transform 180ms ease, box-shadow 180ms ease;
  box-shadow: 0 12px 28px rgba(3, 8, 15, 0.32);
}

.slanted-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(3, 8, 15, 0.88), rgba(8, 14, 26, 0.22)),
    linear-gradient(110deg, rgba(0, 0, 0, 0.24), transparent 56%);
  z-index: 0;
}

.slanted-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(7, 16, 30, 0.58);
  pointer-events: none;
}

.slanted-card:hover,
.slanted-card:focus-visible {
  filter: brightness(1.08) saturate(1.06);
  transform: translateY(-4px);
  box-shadow: 0 18px 34px rgba(2, 8, 14, 0.42);
}

.slanted-card:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(95, 200, 255, 0.76), 0 18px 34px rgba(2, 8, 14, 0.42);
}

.slanted-card-inner {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 1;
  padding: 20px 18px 18px 20px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.38), transparent 58%);
}

.category-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(7, 11, 17, 0.88), rgba(10, 15, 22, 0.06));
  z-index: 0;
}

.category-card-content {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 1;
  padding: 14px;
}

.category-card-title {
  margin: 0;
  font-size: clamp(30px, 2.2vw, 44px);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.015em;
}

.category-card-label {
  margin-top: 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.empty-state {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 2;
  max-width: min(560px, calc(100vw - 32px));
  background: rgba(13, 20, 31, 0.8);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 14px 16px;
}

.back-btn {
  position: fixed;
  z-index: 30;
  top: 14px;
  left: 14px;
  padding: 10px 16px;
  font-weight: 600;
  border-radius: 999px;
  display: none;
  cursor: pointer;
}

.back-btn.visible {
  display: inline-flex;
}

.hotspot-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 68, 68, 0.94);
  border: 2px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 0 3px rgba(255, 68, 68, 0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  line-height: 1;
  color: #ffffff;
  user-select: none;
}

.hotspot-dot.size-sm {
  width: 14px;
  height: 14px;
  border-width: 1px;
}

.hotspot-dot.size-md {
  width: 18px;
  height: 18px;
}

.hotspot-dot.size-lg {
  width: 24px;
  height: 24px;
  border-width: 2px;
}

.hotspot-dot.icon-default::before {
  content: "";
}

.hotspot-dot.icon-arrow::before {
  content: ">";
  font-size: 11px;
  transform: translateX(0.5px);
}

.hotspot-dot.target-main::before {
  content: "" !important;
}

.hotspot-dot.target-back {
  background: linear-gradient(180deg, #5a9ee8, #2d6fc4) !important;
  border: 2px solid rgba(220, 240, 255, 0.95) !important;
  box-shadow: 0 0 0 4px rgba(90, 158, 232, 0.5), 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

.hotspot-dot.target-back::before {
  content: "" !important;
}

.hotspot-dot.target-back:hover {
  transform: scale(1.12);
  box-shadow: 0 0 0 6px rgba(90, 158, 232, 0.6), 0 6px 16px rgba(0, 0, 0, 0.4) !important;
}

.hotspot-dot.icon-info::before {
  content: "i";
  font-size: 12px;
  font-weight: 800;
}

.hotspot-dot.target-main {
  width: 26px !important;
  height: 26px !important;
  background: linear-gradient(180deg, #5cd660, #2ba040) !important;
  border: 2px solid rgba(240, 255, 240, 0.95) !important;
  box-shadow: 0 0 0 4px rgba(92, 214, 96, 0.5), 0 4px 14px rgba(0, 0, 0, 0.3) !important;
}

.hotspot-dot.target-main:hover {
  transform: scale(1.12);
  box-shadow: 0 0 0 6px rgba(92, 214, 96, 0.6), 0 6px 18px rgba(0, 0, 0, 0.4) !important;
}

/* Admin */
.admin-root {
  display: grid;
  grid-template-rows: auto auto 1fr;
  height: 100dvh;
  overflow: hidden;
}

.admin-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--card-border);
  background: rgba(8, 13, 20, 0.95);
  position: sticky;
  top: 0;
  z-index: 5;
}

.admin-topbar strong {
  font-size: 15px;
  white-space: nowrap;
}

.publish-info {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.admin-topbar-actions {
  margin-left: auto;
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

.admin-topbar-actions .btn {
  width: auto;
  font-size: 13px;
  padding: 6px 12px;
}

.btn-save {
  background: rgba(34, 60, 82, 0.56);
  border-color: var(--accent);
}

.btn-publish {
  background: rgba(63, 107, 70, 0.56);
  border-color: var(--color-success);
}

.btn-logout {
  color: var(--color-danger);
}

.btn-danger {
  color: var(--color-danger);
  border-color: var(--color-danger);
  background: transparent;
  font-size: 12px;
  padding: 5px 10px;
}

.btn-danger:hover {
  background: rgba(163, 58, 43, 0.15);
}

.dirty-dot {
  color: var(--color-warning);
  font-size: 18px;
  margin-left: 4px;
  vertical-align: middle;
}

.dirty-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 6px 16px;
  background: rgba(194, 138, 69, 0.18);
  border-bottom: 1px solid rgba(194, 138, 69, 0.4);
  font-size: 13px;
  color: var(--color-warning);
  animation: dirty-slide 0.2s ease;
}

@keyframes dirty-slide {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.btn-undo {
  font-size: 12px;
  padding: 3px 10px;
  border-color: var(--color-warning);
  color: var(--color-warning);
  background: transparent;
  border-radius: 4px;
  width: auto;
}

.btn-undo:hover {
  background: rgba(194, 138, 69, 0.2);
}

.btn-save.btn-dirty,
.btn-publish.btn-dirty {
  box-shadow: 0 0 0 2px var(--color-warning);
}

.publish-info {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.admin-shell {
  display: grid;
  grid-template-columns: clamp(220px, 22vw, 300px) minmax(0, 1fr);
  gap: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.admin-sidebar,
.admin-workspace {
  min-height: 0;
}

.admin-sidebar {
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 6px;
  padding: 10px;
  border-right: 1px solid var(--card-border);
  overflow: hidden;
}

.admin-section-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.section-tab,
.scene-tab {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: 6px;
  padding: 6px 4px;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.section-tab:hover {
  color: var(--text);
  background: rgba(39, 73, 96, 0.15);
}

.section-tab.active,
.scene-tab.active {
  border-color: var(--accent);
  background: rgba(34, 60, 82, 0.35);
  color: var(--text);
  font-weight: 600;
}

.admin-sidebar-tools {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
}

.btn-add {
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  padding: 4px 10px;
  border-radius: 6px;
}

.admin-nav-list {
  display: grid;
  gap: 2px;
  min-height: 0;
  overflow: auto;
  align-content: start;
  grid-auto-rows: min-content;
}

.nav-group-header {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 6px 8px;
  margin-top: 6px;
  border: 0;
  border-top: 1px solid var(--card-border);
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: left;
  cursor: pointer;
  transition: color 0.12s, background 0.12s;
}

.nav-group-header:first-child {
  margin-top: 0;
}

.nav-group-header:hover {
  color: var(--text);
  background: rgba(39, 73, 96, 0.12);
}

.nav-group-arrow {
  font-size: 10px;
  flex-shrink: 0;
}

.nav-group-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-group-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  opacity: 0.7;
  flex-shrink: 0;
}

.group-name-input {
  border: 1px solid transparent !important;
  background: transparent !important;
  padding: 4px 6px !important;
  font-size: 13px !important;
  border-radius: 4px !important;
}

.group-name-input:focus {
  border-color: var(--accent) !important;
  background: rgba(34, 60, 82, 0.2) !important;
}

.admin-item,
.nav-item {
  padding: 5px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.12s, border-color 0.12s;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.nav-item-dot {
  width: 8px;
  height: 8px;
  min-width: 8px;
  border-radius: 50%;
  background: rgba(54, 197, 216, 0.6);
  flex-shrink: 0;
}

.nav-item-dot.is-main {
  background: #5cd660;
  box-shadow: 0 0 4px rgba(92, 214, 96, 0.5);
}

.nav-item-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-item-type {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--ui-primary, #b08a5a);
}

.nav-item-type.is-main {
  color: #5cd660;
}

.nav-item:hover {
  background: rgba(39, 73, 96, 0.15);
}

.admin-item.active,
.nav-item.active {
  border-color: var(--accent);
  background: rgba(34, 60, 82, 0.35);
  font-weight: 600;
}

.admin-nav-list .nav-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px;
  align-items: center;
}

.admin-nav-list .nav-row .nav-item {
  width: 100%;
}

.nav-row-actions {
  display: flex;
  gap: 2px;
}

.nav-row-action {
  width: 24px;
  min-width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.4;
  transition: opacity 0.15s, color 0.15s, background 0.15s;
}

.nav-row:hover .nav-row-action {
  opacity: 1;
}

.nav-row-action:hover {
  background: rgba(39, 73, 96, 0.25);
  color: var(--text);
}

.nav-row-action.nav-row-action-delete:hover {
  color: var(--color-danger);
}

.nav-row-action.nav-row-action-up:hover,
.nav-row-action.nav-row-action-down:hover {
  color: var(--ui-primary, #b08a5a);
}

.admin-workspace {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  overflow: hidden;
  padding: 12px 16px;
}

.editor-card {
  min-height: 0;
  overflow: auto;
  height: 100%;
  padding: 14px 16px;
}

.editor-card h2 {
  margin: 0 0 12px;
  font-size: 16px;
  color: var(--muted);
  font-weight: 600;
}

.start-view-info {
  font-size: 12px;
  color: var(--muted);
  align-self: center;
  white-space: nowrap;
}

.file-picker-trigger {
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  min-height: 0;
}

.settings-content {
  min-width: 0;
  min-height: 0;
}

.settings-panel {
  display: grid;
  gap: 8px;
}

.form-grid {
  gap: 8px;
}

.form-row {
  display: grid;
  gap: 6px;
}

.form-row > div {
  display: grid;
  gap: 3px;
  min-width: 0;
  align-content: start;
}

.form-row label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-row.two {
  grid-template-columns: 1fr 1fr;
}

.form-row.three {
  grid-template-columns: repeat(3, 1fr);
}

.form-grid.compact label {
  font-size: 11px;
  color: var(--muted);
}

input,
select,
textarea,
.btn {
  padding: 6px 8px;
  font-size: 13px;
  width: 100%;
  min-width: 0;
  border-radius: 6px;
}

input[readonly],
textarea[readonly],
select[disabled] {
  opacity: 0.6;
}

textarea {
  min-height: 58px;
  resize: vertical;
}

.btn {
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.12s, border-color 0.12s;
}

.btn:hover {
  filter: brightness(1.1);
}

.top-space {
  margin-top: 8px;
}

.btn-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.btn-row .btn {
  width: auto;
}

.details-block {
  margin-top: 10px;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: rgba(12, 18, 28, 0.7);
}

.details-block summary {
  cursor: pointer;
  list-style: none;
  padding: 8px 10px;
  font-size: 13px;
  color: var(--muted);
}

.details-block summary::-webkit-details-marker {
  display: none;
}

.details-content {
  padding: 0 10px 10px;
}

.check-list {
  display: grid;
  gap: 4px;
  max-height: 200px;
  overflow: auto;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 6px;
}

.check-list-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.12s;
}

.check-list-item:hover {
  background: rgba(39, 73, 96, 0.15);
}

.check-list-item input {
  width: auto;
  flex-shrink: 0;
}

.category-panorama-item {
  justify-content: space-between;
  gap: 8px;
}

.category-panorama-label {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.category-panorama-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-panorama-usage-state {
  flex-shrink: 0;
  color: var(--color-link);
  font-size: 11px;
  font-weight: 700;
}

.category-panorama-view-state {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 11px;
}

.category-panorama-view-state.custom {
  color: var(--color-success);
  font-weight: 700;
}

.category-panorama-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.btn-small {
  min-height: 28px;
  padding: 5px 8px;
  font-size: 12px;
  border-radius: 6px;
}

.category-view-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--color-warning) 55%, var(--card-border));
  border-radius: 8px;
  background: color-mix(in srgb, var(--color-warning) 12%, var(--color-surface));
}

.category-view-panel p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.scene-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.scene-panel {
  display: grid;
  gap: 8px;
}

.hotspot-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 10px;
  height: clamp(360px, 58dvh, 720px);
}

.hotspot-viewer-shell {
  position: relative;
  min-height: 0 !important;
  height: 100% !important;
}

#adminViewer {
  width: 100%;
  height: 100%;
  min-height: 0 !important;
}

.hotspot-link-panel {
  display: block;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 10px;
}

#linkListView {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  min-height: 0;
}

#linkListView[hidden] { display: none !important; }

.link-editor-panel {
  height: 100%;
  overflow-y: auto;
  display: grid;
  gap: 10px;
  align-content: start;
}

.link-editor-panel[hidden] { display: none !important; }

.link-editor-back {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 0;
  border-radius: 6px;
  background: rgba(34, 60, 82, 0.3);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  width: fit-content;
  transition: background 0.15s;
}

.link-editor-back:hover {
  background: rgba(34, 60, 82, 0.5);
}

.link-editor-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(34, 60, 82, 0.35);
  border: 1px solid var(--card-border);
}

.link-editor-row {
  display: grid;
  gap: 4px;
}

.link-editor-row-two {
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.link-editor-row-two > div {
  display: grid;
  gap: 4px;
}

.link-editor-row label {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.link-editor-row select,
.link-editor-row input {
  padding: 7px 10px;
  font-size: 13px;
  border: 1px solid var(--card-border);
  border-radius: 6px;
  background: rgba(16, 24, 33, 0.92);
  color: var(--text);
  width: 100%;
  min-width: 0;
}

.link-editor-category-list {
  display: grid;
  gap: 2px;
  max-height: 168px;
  overflow: auto;
  border: 1px solid var(--card-border);
  border-radius: 6px;
  padding: 6px;
  background: rgba(16, 24, 33, 0.6);
}

.link-editor-category-hint {
  font-size: 11px;
  color: var(--muted);
  padding: 2px 4px 4px;
  border-bottom: 1px solid var(--card-border);
  margin-bottom: 4px;
}

.link-editor-category-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.12s;
}

.link-editor-category-item:hover {
  background: rgba(39, 73, 96, 0.15);
}

.link-editor-category-item input {
  width: auto;
}

.link-editor-toggles {
  display: flex;
  gap: 6px;
}

.link-editor-toggle {
  flex: 1;
  height: 36px;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: rgba(16, 24, 33, 0.6);
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 700;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.link-editor-toggle:hover {
  border-color: var(--accent);
  color: var(--text);
}

.link-editor-toggle.active {
  border-color: var(--accent);
  background: rgba(34, 60, 82, 0.35);
  color: var(--text);
}

.link-editor-toggle-circle {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: currentColor;
}

.link-editor-toggle-circle.sm { width: 9px; height: 9px; }
.link-editor-toggle-circle.lg { width: 15px; height: 15px; }

.link-editor-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.link-editor-actions .btn {
  flex: 1;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 8px;
}

.link-editor-actions .btn-danger {
  border-color: var(--color-danger);
  color: var(--color-danger);
}

.link-editor-actions .btn-danger:hover {
  background: rgba(163, 58, 43, 0.15);
}

.hotspot-link-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--card-border);
}

.hotspot-link-header .btn-add {
  width: 32px;
  min-width: 32px;
  height: 32px;
  padding: 0;
  font-size: 18px;
  display: grid;
  place-items: center;
  border-radius: 8px;
}

.hotspot-link-cards {
  display: grid;
  gap: 8px;
  overflow-y: auto;
  min-height: 0;
  align-content: start;
  flex: 1;
}

.link-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  position: relative;
  background: rgba(16, 24, 33, 0.4);
}

.link-card:hover {
  border-color: var(--accent);
  background: rgba(34, 60, 82, 0.2);
}

.link-card.active {
  border-color: var(--accent);
  background: rgba(34, 60, 82, 0.35);
  box-shadow: 0 0 0 1px var(--accent);
}

.link-card-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(180deg, #36c5d8, #0d8ba8);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.link-card-icon.icon-arrow {
  background: linear-gradient(180deg, #5cd660, #2ba040);
}

.link-card-icon.icon-info {
  background: linear-gradient(180deg, #6f9c84, #4a7a64);
}

.link-card-body {
  flex: 1;
  min-width: 0;
}

.link-card-target {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}

.link-card-meta {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2px;
}

.link-card-delete {
  width: 26px;
  min-width: 26px;
  height: 26px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s, background 0.15s;
  flex-shrink: 0;
}

.link-card:hover .link-card-delete,
.link-card.active .link-card-delete {
  opacity: 1;
}

.link-card-delete:hover {
  color: var(--color-danger);
  background: rgba(163, 58, 43, 0.15);
}

.link-card-empty {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  padding: 20px 10px;
}

.hotspot-popover {
  position: absolute;
  z-index: 50;
  width: 240px;
  background: rgba(10, 18, 31, 0.96);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.44);
  padding: 14px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transform: translate(-50%, calc(-100% - 14px));
  transition: opacity 160ms ease;
}

.hotspot-popover[hidden] {
  display: none !important;
}

.hotspot-popover::after {
  content: "";
  position: absolute;
  bottom: -7px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 12px;
  height: 12px;
  background: rgba(10, 18, 31, 0.96);
  border-right: 1px solid var(--card-border);
  border-bottom: 1px solid var(--card-border);
}

.hotspot-popover-arrow {
  position: absolute;
  bottom: -14px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
}

.popover-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 10px;
}

.popover-field {
  margin-bottom: 10px;
}

.popover-field:last-child {
  margin-bottom: 0;
}

.popover-field label {
  display: block;
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.popover-field select,
.popover-field input {
  width: 100%;
  padding: 6px 8px;
  font-size: 13px;
  border: 1px solid var(--card-border);
  border-radius: 6px;
  background: rgba(16, 24, 33, 0.92);
  color: var(--text);
}

.popover-toggles {
  display: flex;
  gap: 6px;
}

.popover-toggle {
  flex: 1;
  height: 34px;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.popover-toggle:hover {
  border-color: var(--accent);
  color: var(--text);
}

.popover-toggle.active {
  border-color: var(--accent);
  background: rgba(34, 60, 82, 0.4);
  color: var(--text);
  box-shadow: 0 0 0 1px var(--accent);
}

.popover-toggle-circle {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: currentColor;
}

.popover-toggle-circle.sm { width: 10px; height: 10px; }
.popover-toggle-circle.lg { width: 18px; height: 18px; }

.popover-divider {
  height: 1px;
  background: var(--card-border);
  margin: 10px 0;
}

.popover-actions {
  display: flex;
  gap: 8px;
}

.popover-actions .btn {
  flex: 1;
  font-size: 12px;
  padding: 6px 10px;
}

.popover-actions .btn-danger {
  border-color: var(--color-danger);
  color: var(--color-danger);
}

.psv-marker.marker-highlight {
  transform: scale(1.35) !important;
  filter: brightness(1.3) drop-shadow(0 0 8px rgba(176, 138, 90, 0.8)) !important;
  z-index: 10 !important;
}

.checks-col {
  display: grid;
  gap: 8px;
  align-content: start;
  padding-top: 18px;
}

.viewer-shell {
  position: relative;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  overflow: hidden;
  min-height: clamp(200px, 36vh, 460px);
  height: clamp(200px, 36vh, 460px);
}

.viewer-shell.compact-view {
  min-height: clamp(200px, 36vh, 460px);
}

#adminViewer {
  width: 100%;
  height: 100%;
  min-height: clamp(200px, 36vh, 460px);
}

.viewer-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 0.02em;
  background: linear-gradient(180deg, rgba(13, 20, 30, 0.92), rgba(8, 12, 18, 0.96));
  z-index: 2;
}

#scenePanelHotspots #adminViewer {
  min-height: 240px;
}

.login-screen {
  height: 100%;
  display: grid;
  place-items: center;
}

.login-card {
  width: min(420px, 92vw);
  padding: 18px;
  border-radius: 14px;
  border: 1px solid var(--card-border);
  background: rgba(8, 13, 20, 0.88);
}

@media (max-width: 1440px) {
  .admin-shell {
    grid-template-columns: clamp(200px, 24vw, 280px) minmax(0, 1fr);
  }
}

@media (max-width: 1280px) {
  .hero-title {
    font-size: clamp(32px, 4.4vw, 56px);
  }

  .home-slanted-grid {
    grid-auto-rows: minmax(200px, 1fr);
  }

  .hotspot-split {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(220px, 45dvh) auto;
    height: auto;
  }

  #scenePanelHotspots {
    grid-template-rows: auto minmax(220px, 34dvh);
  }

  #scenePanelHotspots .viewer-shell {
    min-height: 220px;
    max-height: 36dvh;
  }
}

@media (max-width: 1100px) {
  .home-content {
    grid-template-rows: minmax(130px, clamp(160px, 24vh, 220px)) minmax(0, 1fr);
  }

  .home-slanted-grid {
    --cut: 8%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: minmax(190px, 1fr);
    gap: 10px;
  }

  .home-slanted-grid > .slanted-card {
    grid-column: auto !important;
  }

  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    max-height: 36dvh;
  }

  .admin-topbar {
    flex-wrap: wrap;
  }

  .admin-topbar-actions .btn {
    width: auto;
  }

  .hotspot-split {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(220px, 45dvh) auto;
    height: auto;
  }

  .settings-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-height: 780px) {
  .hero {
    padding: clamp(12px, 2vw, 18px);
  }

  .home-content {
    gap: 0;
  }

  .home-slanted-grid {
    grid-auto-rows: minmax(170px, 1fr);
  }

  .admin-sidebar {
    max-height: 32dvh;
  }

  .viewer-shell.compact-view {
    min-height: clamp(200px, 34vh, 340px);
  }
}

@media (max-width: 760px) {
  .home-content {
    padding: 0;
    gap: 0;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .home-hero-strip {
    border-radius: 0;
    padding: 14px 12px;
  }

  .home-slanted-grid,
  .category-grid {
    --cut: 0%;
    grid-template-columns: 1fr;
    grid-auto-flow: row;
    grid-auto-columns: auto;
    grid-auto-rows: minmax(156px, auto);
    overflow-y: auto;
    overflow-x: hidden;
    gap: 9px;
    padding: 10px 10px 14px;
    background: rgba(223, 227, 232, 0.92);
  }

  .slanted-card,
  .category-card {
    min-height: 156px;
    transform: none;
    border-radius: 12px;
    border: 1px solid var(--card-border);
    margin-left: 0;
    clip-path: none;
  }

  .home-slanted-grid > .slanted-card {
    grid-column: auto !important;
  }

  .slanted-card:hover,
  .slanted-card:focus-visible {
    transform: translateY(-2px);
  }

  .slanted-card::before {
    background: linear-gradient(to top, rgba(7, 11, 17, 0.88), rgba(10, 15, 22, 0.1));
  }

  .slanted-card-inner {
    transform: none;
    padding: 14px 12px 12px;
  }

  .category-card-title {
    font-size: clamp(26px, 8.2vw, 36px);
    line-height: 1.05;
  }

  .empty-state {
    left: 10px;
    right: 10px;
    bottom: 10px;
    max-width: none;
  }

  .form-row.two,
  .form-row.three {
    grid-template-columns: 1fr;
  }

  .scene-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .admin-section-tabs {
    grid-template-columns: 1fr;
  }

  .admin-sidebar-tools {
    grid-template-columns: 1fr;
  }

  .admin-sidebar-tools .btn {
    width: 100%;
  }

  #scenePanelHotspots {
    grid-template-rows: auto minmax(200px, 30dvh);
  }

  #scenePanelHotspots .viewer-shell {
    min-height: 200px;
    max-height: 32dvh;
  }

  .hotspot-link-panel {
    max-height: 240px;
  }

  .admin-topbar-actions {
    flex-wrap: wrap;
  }

  .admin-topbar-actions .btn {
    width: auto;
  }
}

@media (max-width: 420px) {
  .hero-title {
    font-size: clamp(22px, 8.8vw, 32px);
  }

  .hero-subtitle {
    font-size: 13px;
  }

  .lang-toggle,
  .back-btn {
    min-height: 38px;
    padding: 8px 12px;
  }

  .admin-topbar .btn-row {
    grid-template-columns: 1fr;
  }
}

/* Home Redesign V2 */
.home-overlay .lang-toggle,
.home-overlay .back-btn,
.home-overlay .empty-state,
.home-overlay .slanted-card,
.home-overlay .slanted-card::after,
.home-overlay .category-card,
.home-overlay .category-card::after {
  border-radius: 0 !important;
}

.home-content {
  grid-template-rows: minmax(160px, 28vh) minmax(0, 1fr);
  gap: 0;
}

.home-hero-strip {
  background:
    linear-gradient(135deg, rgba(12, 86, 145, 0.94), rgba(20, 154, 210, 0.92)),
    radial-gradient(circle at 78% 18%, rgba(255, 255, 255, 0.22), transparent 34%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  padding: clamp(18px, 2.2vw, 30px) clamp(16px, 3vw, 52px);
}

.home-hero-strip .hero-kicker {
  letter-spacing: 0.12em;
  font-weight: 600;
}

.home-hero-strip .hero-title {
  margin-top: 6px;
  font-size: clamp(34px, 4.8vw, 72px);
  line-height: 1;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.home-hero-strip .hero-subtitle {
  margin-top: 8px;
  font-size: clamp(15px, 1.25vw, 21px);
  max-width: 860px;
}

.hero-actions {
  margin-top: 14px;
}

.home-slanted-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: minmax(220px, 1fr);
  gap: clamp(10px, 1.1vw, 16px);
  padding: clamp(12px, 1.2vw, 18px);
  background:
    radial-gradient(circle at 20% 15%, rgba(255, 255, 255, 0.08), transparent 35%),
    linear-gradient(180deg, rgba(124, 133, 149, 0.9), rgba(104, 114, 132, 0.9));
}

.home-slanted-grid > .slanted-card {
  clip-path: none;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 16px 34px rgba(3, 10, 18, 0.34);
  min-height: 220px;
  transform: none;
}

.home-slanted-grid > .slanted-card::before {
  background:
    linear-gradient(to top, rgba(2, 8, 15, 0.86), rgba(9, 15, 26, 0.22)),
    linear-gradient(120deg, rgba(0, 0, 0, 0.18), transparent 58%);
}

.home-slanted-grid > .slanted-card::after {
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.home-slanted-grid > .slanted-card:hover,
.home-slanted-grid > .slanted-card:focus-visible {
  transform: translateY(-4px);
  filter: brightness(1.08) saturate(1.05);
  box-shadow: 0 22px 38px rgba(2, 8, 14, 0.42);
}

.home-slanted-grid > .slanted-card:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(95, 200, 255, 0.7), 0 22px 38px rgba(2, 8, 14, 0.42);
}

.home-slanted-grid > .slanted-card .slanted-card-inner {
  padding: 18px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.42), transparent 62%);
}

.home-slanted-grid > .slanted-card .category-card-title {
  font-size: clamp(24px, 2.1vw, 36px);
  line-height: 1.08;
  font-weight: 700;
}

.home-slanted-grid > .slanted-card .category-card-label {
  margin-top: 10px;
  font-size: 12px;
  letter-spacing: 0.12em;
}

@media (max-width: 1100px) {
  .home-slanted-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: minmax(190px, 1fr);
  }
}

@media (max-width: 760px) {
  .home-content {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .home-hero-strip {
    padding: 14px 12px 16px;
  }

  .home-hero-strip .hero-title {
    font-size: clamp(30px, 9vw, 44px);
  }

  .home-slanted-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: minmax(156px, auto);
    gap: 10px;
    padding: 10px 10px 14px;
  }

  .home-slanted-grid > .slanted-card {
    min-height: 156px;
  }

  .home-slanted-grid > .slanted-card .slanted-card-inner {
    padding: 14px 12px;
  }

  .home-slanted-grid > .slanted-card .category-card-title {
    font-size: clamp(26px, 8vw, 34px);
  }
}

/* Home Redesign V3 - Bold */
.home-overlay {
  color: #ecf4ff;
}

.home-backdrop {
  background:
    radial-gradient(circle at 82% 14%, rgba(65, 196, 255, 0.26), transparent 38%),
    radial-gradient(circle at 10% 78%, rgba(255, 153, 61, 0.18), transparent 38%),
    linear-gradient(120deg, rgba(6, 12, 23, 0.94), rgba(10, 18, 33, 0.88));
}

.home-backdrop::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.45), transparent 72%);
  pointer-events: none;
}

.home-hero-strip {
  position: relative;
  background:
    linear-gradient(112deg, rgba(10, 96, 173, 0.95), rgba(24, 164, 222, 0.9));
  border-bottom: 2px solid rgba(255, 255, 255, 0.16);
}

.home-hero-strip::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -2px;
  width: min(36vw, 540px);
  height: 2px;
  background: linear-gradient(to left, rgba(255, 255, 255, 0.7), transparent);
}

.home-hero-strip .hero-kicker {
  color: rgba(225, 244, 255, 0.95);
  font-size: clamp(11px, 1vw, 13px);
  letter-spacing: 0.18em;
}

.home-hero-strip .hero-title {
  font-weight: 800;
  font-size: clamp(38px, 5vw, 84px);
  line-height: 0.96;
  letter-spacing: -0.03em;
  text-shadow: 0 8px 26px rgba(0, 0, 0, 0.25);
}

.home-hero-strip .hero-subtitle {
  font-size: clamp(15px, 1.25vw, 22px);
  color: rgba(235, 247, 255, 0.92);
}

.lang-toggle {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(10, 18, 31, 0.7);
  backdrop-filter: blur(6px);
}

.home-slanted-grid {
  counter-reset: museum-card;
  background:
    linear-gradient(180deg, rgba(116, 125, 141, 0.92), rgba(98, 108, 126, 0.9));
}

.home-slanted-grid > .slanted-card {
  counter-increment: museum-card;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background-color: #0c1422;
}

.home-slanted-grid > .slanted-card::before {
  background:
    linear-gradient(to top, rgba(5, 9, 15, 0.9), rgba(8, 15, 27, 0.2)),
    linear-gradient(125deg, rgba(0, 0, 0, 0.18), transparent 56%);
}

.home-slanted-grid > .slanted-card::after {
  border-color: rgba(255, 255, 255, 0.2);
}

.home-slanted-grid > .slanted-card .slanted-card-inner::before {
  content: counter(museum-card, decimal-leading-zero);
  display: block;
  margin-bottom: 12px;
  font-size: 12px;
  letter-spacing: 0.2em;
  color: rgba(129, 213, 255, 0.95);
  font-weight: 700;
}

.home-slanted-grid > .slanted-card .category-card-title {
  font-size: clamp(26px, 2.2vw, 40px);
  line-height: 1.04;
}

.home-slanted-grid > .slanted-card .category-card-label {
  color: #75d1ff;
  margin-top: 10px;
  font-size: 11px;
  letter-spacing: 0.18em;
}

.home-slanted-grid > .slanted-card {
  animation: card-in 460ms ease both;
}

.home-slanted-grid > .slanted-card:nth-child(2) { animation-delay: 50ms; }
.home-slanted-grid > .slanted-card:nth-child(3) { animation-delay: 100ms; }
.home-slanted-grid > .slanted-card:nth-child(4) { animation-delay: 150ms; }
.home-slanted-grid > .slanted-card:nth-child(5) { animation-delay: 200ms; }
.home-slanted-grid > .slanted-card:nth-child(6) { animation-delay: 250ms; }

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 760px) {
  .home-hero-strip .hero-title {
    font-size: clamp(32px, 9.2vw, 46px);
  }

  .home-slanted-grid > .slanted-card .category-card-title {
    font-size: clamp(24px, 8vw, 34px);
  }
}

/* Home Redesign V4 - Art Direction */
.home-overlay {
  font-family: "Sora", "Oswald", "Segoe UI", sans-serif;
}

.home-backdrop {
  background:
    radial-gradient(circle at 86% 10%, rgba(0, 198, 255, 0.28), transparent 35%),
    radial-gradient(circle at 14% 86%, rgba(255, 128, 64, 0.2), transparent 38%),
    linear-gradient(128deg, rgba(6, 12, 23, 0.95), rgba(10, 18, 32, 0.92));
}

.home-content {
  grid-template-rows: minmax(180px, 30vh) minmax(0, 1fr);
}

.home-hero-strip {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 20px;
  padding: clamp(20px, 2.8vw, 38px) clamp(18px, 3.4vw, 64px);
  background:
    linear-gradient(112deg, rgba(11, 88, 162, 0.95), rgba(25, 160, 220, 0.93));
  border-bottom: 1px solid rgba(255, 255, 255, 0.24);
}

.home-hero-strip .hero-kicker {
  font-size: 11px;
  letter-spacing: 0.22em;
  font-weight: 700;
  text-transform: uppercase;
  color: rgba(215, 240, 255, 0.94);
}

.home-hero-strip .hero-title {
  margin: 10px 0 0;
  font-size: clamp(44px, 5.8vw, 92px);
  line-height: 0.92;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.home-hero-strip .hero-subtitle {
  margin-top: 12px;
  max-width: 900px;
  font-size: clamp(15px, 1.25vw, 22px);
  color: rgba(231, 246, 255, 0.95);
}

.hero-actions {
  margin-top: 0;
}

.lang-toggle {
  min-width: 78px;
  height: 40px;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: rgba(8, 16, 28, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.34);
}

.home-slanted-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: minmax(180px, 22vh);
  gap: 12px;
  padding: clamp(12px, 1.3vw, 20px);
  background:
    linear-gradient(180deg, rgba(129, 139, 156, 0.9), rgba(106, 116, 135, 0.92));
}

.home-slanted-grid > .slanted-card {
  grid-column: span 4;
  min-height: 180px;
  clip-path: polygon(8% 0, 100% 0, 92% 100%, 0 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 16px 34px rgba(3, 9, 16, 0.36);
}

.home-slanted-grid > .slanted-card:nth-child(5n + 4),
.home-slanted-grid > .slanted-card:nth-child(5n + 5) {
  grid-column: span 6;
}

.home-slanted-grid > .slanted-card::before {
  background:
    linear-gradient(to top, rgba(3, 8, 15, 0.9), rgba(9, 16, 28, 0.24)),
    linear-gradient(125deg, rgba(0, 0, 0, 0.22), transparent 56%);
}

.home-slanted-grid > .slanted-card:nth-child(4n + 1)::before {
  background:
    linear-gradient(to top, rgba(3, 8, 15, 0.9), rgba(13, 41, 35, 0.26)),
    linear-gradient(125deg, rgba(0, 0, 0, 0.22), transparent 56%);
}

.home-slanted-grid > .slanted-card:nth-child(4n + 2)::before {
  background:
    linear-gradient(to top, rgba(3, 8, 15, 0.9), rgba(42, 24, 11, 0.24)),
    linear-gradient(125deg, rgba(0, 0, 0, 0.22), transparent 56%);
}

.home-slanted-grid > .slanted-card:nth-child(4n + 3)::before {
  background:
    linear-gradient(to top, rgba(3, 8, 15, 0.9), rgba(20, 18, 52, 0.24)),
    linear-gradient(125deg, rgba(0, 0, 0, 0.22), transparent 56%);
}

.home-slanted-grid > .slanted-card:hover,
.home-slanted-grid > .slanted-card:focus-visible {
  transform: translateY(-5px);
  filter: brightness(1.1) saturate(1.08);
  box-shadow: 0 24px 42px rgba(2, 8, 14, 0.45);
}

.home-slanted-grid > .slanted-card .slanted-card-inner {
  padding: 18px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.44), transparent 60%);
}

.home-slanted-grid > .slanted-card .category-card-title {
  font-family: "Sora", "Oswald", "Segoe UI", sans-serif;
  font-size: clamp(24px, 2.1vw, 42px);
  font-weight: 700;
  line-height: 1.03;
  letter-spacing: -0.02em;
}

.home-slanted-grid > .slanted-card .category-card-label {
  margin-top: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: #7ad5ff;
}

@media (max-width: 1280px) {
  .home-hero-strip .hero-title {
    font-size: clamp(40px, 5.6vw, 78px);
  }
}

@media (max-width: 1100px) {
  .home-hero-strip {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .hero-actions {
    margin-top: 4px;
  }

  .home-slanted-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: minmax(170px, 21vh);
  }

  .home-slanted-grid > .slanted-card,
  .home-slanted-grid > .slanted-card:nth-child(5n + 4),
  .home-slanted-grid > .slanted-card:nth-child(5n + 5) {
    grid-column: span 1;
    clip-path: polygon(6% 0, 100% 0, 94% 100%, 0 100%);
  }
}

@media (max-width: 760px) {
  .home-content {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .home-hero-strip {
    padding: 14px 12px 16px;
    gap: 10px;
  }

  .home-hero-strip .hero-title {
    font-size: clamp(32px, 9.4vw, 50px);
  }

  .home-hero-strip .hero-subtitle {
    font-size: 15px;
  }

  .home-slanted-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: minmax(150px, auto);
    gap: 10px;
    padding: 10px;
  }

  .home-slanted-grid > .slanted-card,
  .home-slanted-grid > .slanted-card:nth-child(5n + 4),
  .home-slanted-grid > .slanted-card:nth-child(5n + 5) {
    clip-path: none;
    min-height: 150px;
  }

  .home-slanted-grid > .slanted-card .slanted-card-inner {
    padding: 14px 12px;
  }
}

/* Home Stabilize - single source of truth */
.home-content {
  grid-template-rows: minmax(150px, 24vh) minmax(0, 1fr) !important;
}

.home-hero-strip {
  display: block !important;
  padding: clamp(16px, 2vw, 26px) clamp(16px, 3vw, 36px) !important;
  background: linear-gradient(112deg, rgba(10, 97, 168, 0.95), rgba(16, 155, 216, 0.92)) !important;
}

.home-hero-strip .hero-kicker {
  margin: 0 0 8px 0;
  font-size: 12px;
  letter-spacing: 0.16em;
}

.home-hero-strip .hero-title {
  margin: 0;
  max-width: 1100px;
  font-size: clamp(40px, 4.6vw, 72px) !important;
  line-height: 0.96 !important;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.home-hero-strip .hero-subtitle {
  margin-top: 10px;
  max-width: 820px;
  font-size: clamp(15px, 1.15vw, 20px);
}

.hero-actions {
  margin-top: 14px !important;
  display: flex !important;
  justify-content: flex-end !important;
}

.home-slanted-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  grid-auto-rows: minmax(210px, 1fr) !important;
  gap: 12px !important;
  padding: 12px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  background: linear-gradient(180deg, rgba(128, 137, 152, 0.92), rgba(106, 116, 133, 0.92)) !important;
}

.home-slanted-grid > .slanted-card,
.home-slanted-grid > .slanted-card:nth-child(5n + 4),
.home-slanted-grid > .slanted-card:nth-child(5n + 5) {
  grid-column: auto !important;
  min-height: 210px !important;
  clip-path: polygon(7% 0, 100% 0, 93% 100%, 0 100%) !important;
  border-radius: 0 !important;
  transform: none !important;
}

.home-slanted-grid > .slanted-card:hover,
.home-slanted-grid > .slanted-card:focus-visible {
  transform: translateY(-3px) !important;
}

.home-slanted-grid > .slanted-card .slanted-card-inner::before {
  content: none !important;
}

.home-slanted-grid > .slanted-card .slanted-card-inner {
  padding: 16px !important;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.42), transparent 60%);
}

.home-slanted-grid > .slanted-card .category-card-title {
  font-size: clamp(22px, 2vw, 34px) !important;
  line-height: 1.06 !important;
}

.home-slanted-grid > .slanted-card .category-card-label {
  margin-top: 8px;
  font-size: 12px;
  letter-spacing: 0.12em;
}

@media (max-width: 1100px) {
  .home-slanted-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-auto-rows: minmax(190px, 1fr) !important;
  }
}

@media (max-width: 760px) {
  .home-content {
    grid-template-rows: auto minmax(0, 1fr) !important;
  }

  .home-hero-strip {
    padding: 14px 12px 16px !important;
  }

  .home-hero-strip .hero-title {
    font-size: clamp(32px, 9vw, 46px) !important;
  }

  .home-slanted-grid {
    grid-template-columns: 1fr !important;
    grid-auto-rows: minmax(150px, auto) !important;
    gap: 10px !important;
    padding: 10px !important;
  }

  .home-slanted-grid > .slanted-card {
    clip-path: none !important;
    min-height: 150px !important;
  }

  .home-slanted-grid > .slanted-card .slanted-card-inner {
    padding: 14px 12px !important;
  }
}

/* Home Glass FX */
.home-hero-strip {
  background:
    linear-gradient(118deg, rgba(24, 118, 178, 0.52), rgba(31, 154, 213, 0.44)) !important;
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.28) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 18px 34px rgba(3, 10, 18, 0.3);
}

.lang-toggle {
  background: rgba(6, 16, 28, 0.42) !important;
  border-color: rgba(255, 255, 255, 0.42) !important;
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.home-slanted-grid {
  background:
    linear-gradient(180deg, rgba(141, 154, 174, 0.34), rgba(116, 129, 149, 0.28)) !important;
  backdrop-filter: blur(10px) saturate(115%);
  -webkit-backdrop-filter: blur(10px) saturate(115%);
}

.home-slanted-grid > .slanted-card {
  background-color: rgba(8, 16, 28, 0.34) !important;
  border: 1px solid rgba(255, 255, 255, 0.34) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 16px 26px rgba(3, 10, 18, 0.34);
}

.home-slanted-grid > .slanted-card::before {
  background:
    linear-gradient(to top, rgba(4, 10, 18, 0.62), rgba(8, 15, 26, 0.22)),
    linear-gradient(125deg, rgba(255, 255, 255, 0.08), transparent 44%) !important;
}

.home-slanted-grid > .slanted-card::after {
  border-color: rgba(255, 255, 255, 0.28) !important;
}

.home-slanted-grid > .slanted-card:hover,
.home-slanted-grid > .slanted-card:focus-visible {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    0 24px 36px rgba(2, 8, 14, 0.4) !important;
}

.empty-state {
  background: rgba(8, 17, 30, 0.46) !important;
  border-color: rgba(255, 255, 255, 0.32) !important;
  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
}

/* Home Glass FX Boost (visible even without native blur) */
.home-hero-strip,
.home-slanted-grid > .slanted-card,
.lang-toggle,
.empty-state {
  position: relative;
  overflow: hidden;
}

.home-hero-strip::before,
.home-slanted-grid > .slanted-card::before,
.lang-toggle::before,
.empty-state::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.24) 0%,
    rgba(255, 255, 255, 0.08) 34%,
    rgba(255, 255, 255, 0.02) 62%,
    rgba(255, 255, 255, 0.14) 100%
  );
  pointer-events: none;
  z-index: 0;
}

.home-hero-strip > *,
.home-slanted-grid > .slanted-card > *,
.lang-toggle > *,
.empty-state > * {
  position: relative;
  z-index: 1;
}

.home-hero-strip,
.home-slanted-grid > .slanted-card,
.lang-toggle,
.empty-state {
  border: 1px solid rgba(255, 255, 255, 0.42) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    inset 0 -1px 0 rgba(255, 255, 255, 0.08),
    0 14px 28px rgba(2, 8, 14, 0.34) !important;
}

.home-slanted-grid > .slanted-card::before {
  background:
    linear-gradient(to top, rgba(4, 10, 18, 0.48), rgba(8, 15, 26, 0.08)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.22), transparent 52%) !important;
}

@supports not ((backdrop-filter: blur(2px)) or (-webkit-backdrop-filter: blur(2px))) {
  .home-hero-strip,
  .home-slanted-grid > .slanted-card,
  .lang-toggle,
  .empty-state {
    background-color: rgba(20, 34, 52, 0.58) !important;
  }
}

#homeOverlay .home-content {
  --hero-h: clamp(150px, 24vh, 240px);
  position: relative;
  grid-template-rows:
    var(--hero-h)
    minmax(calc(100vh - var(--hero-h)), calc(100vh - var(--hero-h)))
    auto !important;
  min-height: 100vh !important;
  height: auto !important;
}

.home-footer {
  position: relative;
  top: auto;
  left: auto;
  right: auto;
  bottom: auto;
  transform: none;
  z-index: 1;
  width: 100%;
  margin-top: 0;
  border-top: 1px solid rgba(150, 197, 233, 0.24);
  background: linear-gradient(180deg, rgba(9, 18, 32, 0.88), rgba(7, 14, 26, 0.95));
  color: rgba(227, 239, 253, 0.88);
}

#homeOverlay {
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

.home-footer-top {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(420px, 1fr) minmax(260px, 320px);
  gap: clamp(24px, 3vw, 54px);
  padding: clamp(16px, 2.2vw, 28px) clamp(48px, 8vw, 160px);
  max-width: 1680px;
  margin: 0 auto;
  align-items: start;
}

.home-footer-logo {
  width: 90px;
  height: 90px;
  padding: 8px;
  /* border: 1px solid rgba(173, 215, 247, 0.42); */
  display: grid;
  place-items: center;
  /* background: rgba(14, 30, 52, 0.65); */
  overflow: hidden;
}

.home-footer-logo-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.home-footer-logo-fallback {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #dbf0ff;
}

.home-footer-brand-text {
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: rgba(203, 224, 244, 0.84);
}

.home-footer-about h3,
.home-footer-contacts h3 {
  margin: 0 0 10px;
  font-size: 28px;
  font-size: clamp(18px, 1.25vw, 24px);
  line-height: 1.1;
  color: #f2f8ff;
}

.home-footer-about p {
  margin: 0 0 10px;
  font-size: clamp(14px, 1vw, 18px);
  line-height: 1.5;
  color: rgba(212, 230, 248, 0.88);
}

.home-footer-contacts ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.home-footer-contacts li {
  font-size: clamp(14px, 0.96vw, 17px);
  line-height: 1.4;
  color: rgba(220, 236, 251, 0.9);
}

.home-footer-bottom {
  border-top: 1px solid rgba(148, 194, 231, 0.18);
  padding: 14px clamp(18px, 2.8vw, 40px) 16px;
  text-align: center;
}

.home-footer-links {
  display: flex;
  justify-content: center;
  gap: 22px;
  margin-bottom: 10px;
}

.home-footer-links a {
  color: rgba(178, 214, 242, 0.94);
  font-size: 14px;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 160ms ease, border-color 160ms ease;
}

.home-footer-links a:hover {
  color: #dcf1ff;
  border-color: rgba(220, 241, 255, 0.85);
}

.home-footer-bottom p {
  margin: 0;
  font-size: 13px;
  color: rgba(195, 220, 244, 0.84);
}

@media (max-width: 1380px) {
  .home-footer-top {
    grid-template-columns: minmax(220px, 260px) minmax(0, 1fr) minmax(220px, 280px);
    padding-left: clamp(32px, 5vw, 72px);
    padding-right: clamp(32px, 5vw, 72px);
  }
}

@media (max-width: 1024px) {
  .home-footer-top {
    grid-template-columns: 1fr;
    gap: 14px;
    padding-left: clamp(16px, 4vw, 28px);
    padding-right: clamp(16px, 4vw, 28px);
  }
}

/* Final lock: keep previous stretched card size, do not let legacy blocks override it */
.home-content {
  grid-template-rows: minmax(154px, clamp(184px, 27vh, 280px)) auto auto !important;
  height: auto !important;
  min-height: 100dvh;
  min-width: 0 !important;
}

.category-shell {
  position: relative;
  min-height: 520px;
  height: 100%;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow: visible !important;
}

.home-slanted-grid {
  display: grid !important;
  grid-template-columns: none !important;
  grid-template-rows: 1fr !important;
  grid-auto-flow: column !important;
  grid-auto-columns: minmax(420px, 42vw) !important;
  gap: 0 !important;
  padding: 0 !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  scroll-snap-type: x mandatory;
  height: 100% !important;
  min-height: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

.home-slanted-grid::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
}

.home-slanted-grid > .slanted-card,
.home-slanted-grid > .slanted-card:nth-child(6n + 4),
.home-slanted-grid > .slanted-card:nth-child(6n + 5),
.home-slanted-grid > .slanted-card:nth-child(4n + 3),
.home-slanted-grid > .slanted-card:nth-child(5n + 4),
.home-slanted-grid > .slanted-card:nth-child(5n + 5) {
  height: 100% !important;
  min-height: 100% !important;
  max-height: 100% !important;
  clip-path: polygon(8% 0, 100% 0, 92% 100%, 0 100%) !important;
  margin-left: -26px !important;
  border-radius: 0 !important;
  scroll-snap-align: start;
}

.home-slanted-grid > .slanted-card:first-child {
  margin-left: 0 !important;
}

.home-footer {
  position: relative !important;
  margin-top: 0 !important;
}

/* Stable carousel arrows: hard-pin both sides */
#carouselPrev,
#carouselNext {
  all: unset;
  position: absolute !important;
  top: 0 !important;
  bottom: 0 !important;
  width: 42px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 60 !important;
  cursor: pointer !important;
  pointer-events: auto !important;
  opacity: 1 !important;
  visibility: visible !important;
  color: #e9f5ff !important;
  font-size: 0 !important;
  line-height: 1 !important;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
  user-select: none;
  background: linear-gradient(180deg, rgba(14, 26, 46, 0.42), rgba(8, 17, 31, 0.52)) !important;
  border-left: 1px solid rgba(134, 179, 246, 0.3);
  border-right: 1px solid rgba(134, 179, 246, 0.3);
  transition: background-color 180ms ease, color 180ms ease, text-shadow 180ms ease;
}

#carouselPrev {
  left: 0 !important;
  right: auto !important;
}

#carouselNext {
  right: 0 !important;
  left: auto !important;
}

#carouselPrev::before,
#carouselNext::before {
  content: "" !important;
  display: block;
  width: 18px;
  height: 18px;
  background: currentColor;
  -webkit-mask-position: center;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: contain;
}

#carouselPrev::before {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M15 4L7 12l8 8' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M15 4L7 12l8 8' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}

#carouselNext::before {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M9 4l8 8-8 8' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M9 4l8 8-8 8' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}

#carouselPrev:hover,
#carouselNext:hover {
  color: #9cd8ff !important;
  background: linear-gradient(180deg, rgba(23, 44, 76, 0.58), rgba(12, 25, 44, 0.64)) !important;
  text-shadow: 0 0 18px rgba(136, 199, 255, 0.52), 0 2px 10px rgba(0, 0, 0, 0.44) !important;
}

/* Cards: toned + centered text by default, clear image on hover */
.home-slanted-grid > .slanted-card::before {
  opacity: 1 !important;
  transition: opacity 220ms ease !important;
  background: rgba(7, 11, 17, 0.56) !important;
}

.home-slanted-grid > .slanted-card .slanted-card-inner {
  inset: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  padding: 24px !important;
  background: transparent !important;
  opacity: 1 !important;
  transition: opacity 220ms ease !important;
}

.home-slanted-grid > .slanted-card .category-card-title,
.home-slanted-grid > .slanted-card .category-card-label {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.home-slanted-grid > .slanted-card .category-card-description {
  margin: 10px 0 0 !important;
  max-width: min(86%, 560px);
  color: rgba(214, 233, 252, 0.92) !important;
  font-size: clamp(14px, 1.05vw, 18px) !important;
  line-height: 1.35 !important;
  text-wrap: balance;
}

.home-slanted-grid > .slanted-card:hover::before,
.home-slanted-grid > .slanted-card:hover .slanted-card-inner {
  opacity: 0 !important;
}

/* =========================
   2026 MUSEUM IMMERSIVE SKIN
   (Visual layer only: no layout/DOM changes)
   ========================= */

:root {
  --ui-bg-0: #131518;
  --ui-bg-1: #1a1f26;
  --ui-surface-0: #1d232b;
  --ui-surface-1: #242c36;
  --ui-surface-2: #2c3643;
  --ui-border-0: #3f4a58;
  --ui-border-1: #5a6676;

  --ui-text-0: #ece4d7;
  --ui-text-1: #cdc1af;
  --ui-text-2: #9b8f7f;

  --ui-primary: #b08a5a;
  --ui-primary-hover: #c29a66;
  --ui-primary-active: #946f44;
  --ui-secondary: #9f785d;
  --ui-success: #58765f;
  --ui-warning: #b08a5a;
  --ui-danger: #ad6656;
  --ui-link: #8ea8bc;
  --ui-visited: #9f91af;
  --ui-focus: #d7b176;

  --ui-overlay-strong: rgba(18, 16, 14, 0.68);
  --ui-overlay-soft: rgba(25, 31, 38, 0.52);

  --ui-shadow-xs: 0 2px 10px rgba(0, 0, 0, 0.22);
  --ui-shadow-sm: 0 10px 30px rgba(0, 0, 0, 0.34);
  --ui-shadow-md: 0 16px 40px rgba(0, 0, 0, 0.44);
  --ui-shadow-lg: 0 24px 56px rgba(0, 0, 0, 0.56);

  --font-display: "Cormorant Garamond", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --font-body: "Manrope", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --fs-title-xl: clamp(38px, 5.2vw, 78px);
  --fs-title-lg: clamp(24px, 2.1vw, 36px);
  --fs-body-lg: clamp(16px, 1.08vw, 19px);
  --fs-body-md: 14px;
  --fs-body-sm: 12px;
}

@media (prefers-color-scheme: light) {
  :root {
    --ui-bg-0: #e8dfd0;
    --ui-bg-1: #dfd3c0;
    --ui-surface-0: #f0e7d8;
    --ui-surface-1: #eadfce;
    --ui-surface-2: #e1d4c1;
    --ui-border-0: #c9bca8;
    --ui-border-1: #b9a98f;
    --ui-text-0: #2a241d;
    --ui-text-1: #5f5548;
    --ui-text-2: #7e7468;
    --ui-overlay-strong: rgba(39, 31, 22, 0.48);
    --ui-overlay-soft: rgba(70, 58, 43, 0.24);
    --ui-link: #5e7d94;
    --ui-visited: #706383;
    --ui-shadow-xs: 0 2px 10px rgba(58, 38, 22, 0.12);
    --ui-shadow-sm: 0 10px 30px rgba(58, 38, 22, 0.18);
    --ui-shadow-md: 0 16px 40px rgba(58, 38, 22, 0.24);
    --ui-shadow-lg: 0 24px 56px rgba(58, 38, 22, 0.3);
  }
}

html,
body {
  font-family: var(--font-body) !important;
  color: var(--ui-text-0) !important;
  background:
    radial-gradient(1080px 620px at 84% -12%, rgba(176, 138, 90, 0.14), transparent 62%),
    radial-gradient(760px 520px at -8% 110%, rgba(109, 130, 152, 0.14), transparent 66%),
    linear-gradient(158deg, var(--ui-bg-0), var(--ui-bg-1) 55%, #202730 100%) !important;
}

a {
  color: var(--ui-link) !important;
  text-underline-offset: 2px;
}

a:visited {
  color: var(--ui-visited) !important;
}

:focus-visible {
  outline: none !important;
  box-shadow: 0 0 0 2px rgba(18, 16, 14, 0.84), 0 0 0 4px var(--ui-focus) !important;
}

.viewer-container {
  position: relative;
  isolation: isolate;
}

.viewer-container::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  opacity: 0.68;
  background:
    radial-gradient(circle at center, transparent 46%, rgba(0, 0, 0, 0.4) 100%),
    linear-gradient(180deg, rgba(10, 10, 10, 0.22), rgba(10, 10, 10, 0.36));
  transition: opacity 620ms ease;
}

.viewer-container::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  opacity: 0.16;
  background:
    repeating-linear-gradient(
      32deg,
      transparent 0 60px,
      rgba(230, 212, 184, 0.06) 60px 61px,
      transparent 61px 112px
    );
  mix-blend-mode: soft-light;
  transition: opacity 620ms ease;
}

.home-overlay.is-loading-tour .home-content {
  opacity: 0.45;
  pointer-events: none;
  transition: opacity 300ms ease;
}

.home-overlay.is-loading-tour::after {
  content: "";
  position: fixed;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  animation: tour-loader-spin 0.7s linear infinite;
  z-index: 50;
}

@keyframes tour-loader-spin {
  to { transform: rotate(360deg); }
}

.viewer-container.is-loading-tour::before {
  opacity: 1 !important;
  background: var(--color-bg) !important;
  transition: none !important;
}

.viewer-container.is-loading-tour canvas {
  opacity: 0 !important;
  transition: none !important;
}

.viewer-container.is-loading-tour::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  animation: tour-loader-spin 0.7s linear infinite;
  z-index: 10;
  opacity: 1 !important;
  mix-blend-mode: normal;
  background: none;
}

.viewer-container.is-revealing::before {
  opacity: 1 !important;
  background: var(--color-bg) !important;
  transition: opacity 600ms ease !important;
}

.viewer-container.is-revealing canvas {
  opacity: 0 !important;
  transition: opacity 600ms ease !important;
}

.home-backdrop {
  background:
    radial-gradient(circle at 80% 10%, #2b3440 0%, #252d37 42%),
    radial-gradient(circle at 12% 86%, #313b46 0%, #252d37 40%),
    linear-gradient(132deg, #1b2027, #232b35) !important;
  backdrop-filter: none !important;
}

.home-hero-strip {
  background:
    linear-gradient(130deg, rgba(22, 30, 40, 0.88), rgba(28, 36, 46, 0.78)),
    radial-gradient(circle at 86% 22%, rgba(176, 138, 90, 0.16), transparent 42%) !important;
  border-bottom: 1px solid rgba(201, 175, 136, 0.3) !important;
  box-shadow: var(--ui-shadow-md) !important;
  animation: hero-enter 700ms cubic-bezier(.2, .72, .2, 1) both;
}

.hero-kicker {
  font-size: var(--fs-body-sm) !important;
  color: var(--ui-primary) !important;
  letter-spacing: 0.18em !important;
}

.hero-title {
  font-family: var(--font-display) !important;
  font-size: var(--fs-title-xl) !important;
  font-weight: 700 !important;
  letter-spacing: -0.01em !important;
  line-height: 0.95 !important;
  color: var(--ui-text-0) !important;
  text-shadow: 0 8px 28px rgba(0, 0, 0, 0.45) !important;
}

.hero-subtitle {
  font-size: var(--fs-body-lg) !important;
  color: var(--ui-text-1) !important;
}

.home-footer {
  background:
    linear-gradient(180deg, #1b2027, #151c24) !important;
  border-top: 1px solid #5c4d39 !important;
  box-shadow: 0 -12px 34px rgba(0, 0, 0, 0.36);
}

.home-footer-about h3,
.home-footer-contacts h3 {
  font-family: var(--font-display) !important;
  font-weight: 600 !important;
  color: var(--ui-text-0) !important;
  letter-spacing: 0.01em;
}

.home-footer-about p,
.home-footer-brand-text,
.home-footer-contacts li,
.home-footer-bottom p {
  color: var(--ui-text-1) !important;
}

.home-footer-links a {
  color: var(--ui-link) !important;
  transition: color 220ms ease, text-decoration-color 220ms ease;
}

.home-footer-links a:hover,
.home-footer-links a:focus-visible {
  color: var(--ui-text-0) !important;
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

.lang-toggle,
.back-btn,
.btn,
.section-tab,
.scene-tab,
.nav-item,
input,
select,
textarea {
  border-color: var(--ui-border-0) !important;
  background: linear-gradient(180deg, rgba(31, 40, 49, 0.92), rgba(25, 33, 42, 0.94)) !important;
  color: var(--ui-text-0) !important;
  box-shadow: var(--ui-shadow-xs) !important;
  transition:
    transform 220ms cubic-bezier(.2, .72, .2, 1),
    border-color 220ms ease,
    box-shadow 220ms ease,
    background-color 220ms ease,
    color 220ms ease;
}

input::placeholder,
textarea::placeholder {
  color: var(--ui-text-2) !important;
}

input:focus,
select:focus,
textarea:focus {
  border-color: color-mix(in srgb, var(--ui-focus) 70%, var(--ui-border-1) 30%) !important;
  box-shadow: 0 0 0 1px rgba(215, 177, 118, 0.52), 0 0 0 3px rgba(215, 177, 118, 0.22), var(--ui-shadow-sm) !important;
}

.btn:hover,
.lang-toggle:hover,
.back-btn:hover,
.section-tab:hover,
.scene-tab:hover,
.nav-item:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--ui-primary) 70%, var(--ui-border-1) 30%) !important;
  box-shadow: var(--ui-shadow-sm) !important;
}

.btn:active,
.lang-toggle:active,
.back-btn:active,
.section-tab:active,
.scene-tab:active,
.nav-item:active {
  transform: translateY(0);
}

.section-tab.active,
.scene-tab.active,
.nav-item.active {
  border-color: color-mix(in srgb, var(--ui-primary) 72%, var(--ui-border-1) 28%) !important;
  background: linear-gradient(180deg, rgba(62, 50, 36, 0.78), rgba(46, 38, 29, 0.84)) !important;
  box-shadow: 0 0 0 1px rgba(176, 138, 90, 0.24), var(--ui-shadow-sm) !important;
}

.admin-topbar {
  background: linear-gradient(180deg, rgba(21, 27, 34, 0.95), rgba(18, 23, 30, 0.97)) !important;
  border-bottom: 1px solid rgba(186, 157, 113, 0.22) !important;
  box-shadow: var(--ui-shadow-sm);
  backdrop-filter: blur(10px) saturate(0.95);
}

.admin-sidebar,
.admin-workspace,
.editor-card,
.hotspot-link-panel,
.viewer-shell {
  border-color: rgba(97, 109, 124, 0.46) !important;
  background: linear-gradient(180deg, rgba(28, 35, 44, 0.9), rgba(23, 29, 37, 0.92)) !important;
}

.editor-card,
.hotspot-link-panel,
.viewer-shell {
  box-shadow: var(--ui-shadow-sm) !important;
}

.publish-info,
.form-row label,
.viewer-placeholder {
  color: var(--ui-text-2) !important;
}

.category-card-title {
  font-family: var(--font-display) !important;
  font-size: var(--fs-title-lg) !important;
  font-weight: 650 !important;
  letter-spacing: 0.005em !important;
  color: var(--ui-text-0) !important;
  text-shadow: 0 6px 20px rgba(0, 0, 0, 0.58);
}

.category-card-description,
.category-card-label {
  color: color-mix(in srgb, var(--ui-text-1) 78%, var(--ui-primary) 22%) !important;
  font-size: var(--fs-body-md) !important;
}

.home-slanted-grid > .slanted-card {
  border-color: rgba(115, 126, 140, 0.34) !important;
  box-shadow: var(--ui-shadow-md) !important;
  transform: translateY(0) !important;
  transform-origin: center center;
  transition:
    transform 240ms cubic-bezier(.2, .72, .2, 1),
    filter 240ms ease,
    box-shadow 240ms ease !important;
  animation: tile-enter 620ms cubic-bezier(.2, .72, .2, 1) both;
}

.home-slanted-grid > .slanted-card::before {
  background: linear-gradient(180deg, rgba(20, 20, 20, 0.22), rgba(20, 20, 20, 0.72)) !important;
}

.home-slanted-grid > .slanted-card:hover,
.home-slanted-grid > .slanted-card:focus-visible {
  filter: saturate(1.03) brightness(1.04) !important;
  box-shadow: var(--ui-shadow-lg) !important;
  z-index: 100;
}

#carouselPrev,
#carouselNext {
  color: var(--ui-text-0) !important;
  background: linear-gradient(180deg, rgba(17, 22, 28, 0.32), rgba(17, 22, 28, 0.5)) !important;
  border-left: 1px solid rgba(186, 157, 113, 0.2);
  border-right: 1px solid rgba(186, 157, 113, 0.2);
}

#carouselPrev:hover,
#carouselNext:hover {
  color: var(--ui-primary) !important;
  background: linear-gradient(180deg, rgba(26, 34, 43, 0.56), rgba(26, 34, 43, 0.68)) !important;
  text-shadow: 0 0 14px rgba(176, 138, 90, 0.42), 0 2px 10px rgba(0, 0, 0, 0.44) !important;
}

.psv-marker {
  animation: marker-fade-in 400ms ease both;
}

@keyframes marker-fade-in {
  from {
    opacity: 0;
    transform: scale(0.6);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.hotspot-dot {
  background: linear-gradient(180deg, #36c5d8, #0d8ba8) !important;
  border: 2px solid rgba(255, 255, 255, 0.95) !important;
  box-shadow: 0 0 0 3px rgba(54, 197, 216, 0.45), 0 4px 10px rgba(0, 0, 0, 0.35) !important;
  transition: transform 220ms ease, box-shadow 220ms ease, filter 220ms ease;
}

.psv-marker:hover .hotspot-dot,
.psv-marker--hover .hotspot-dot {
  background: linear-gradient(180deg, #4adfee, #139fc0) !important;
  box-shadow: 0 0 0 5px rgba(54, 197, 216, 0.55), 0 6px 16px rgba(0, 0, 0, 0.4) !important;
  transform: scale(1.1);
}

.hotspot-dot.icon-info {
  background: linear-gradient(180deg, #5f796b, #3f554a) !important;
}

.psv-tooltip {
  background: linear-gradient(180deg, rgba(30, 37, 45, 0.95), rgba(24, 31, 39, 0.96)) !important;
  border: 1px solid rgba(176, 138, 90, 0.34) !important;
  color: var(--ui-text-0) !important;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.46) !important;
  border-radius: 8px;
}

.psv-tooltip-content {
  color: var(--ui-text-0) !important;
}

.psv-loader-container {
  background: radial-gradient(circle at center, rgba(28, 34, 40, 0.92), rgba(19, 23, 28, 0.95)) !important;
}

@keyframes hero-enter {
  from {
    opacity: 0;
    transform: translateY(14px);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes tile-enter {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.988);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 760px) {
  .home-slanted-grid > .slanted-card {
    transform: none !important;
  }
}

/* Card Stack: 4 visible cards + right/left history stacks */
.home-slanted-grid {
  position: relative !important;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
  overscroll-behavior: auto !important;
  padding: 0 !important;
  --stack-edge: 5%;
  --stack-visible-count: 4;
  --stack-gap: clamp(10px, 0.8vw, 14px);
  --stack-visible-w: calc((100% - (var(--stack-edge) * 2) - ((var(--stack-visible-count) - 1) * var(--stack-gap))) / var(--stack-visible-count));
  --stack-step: var(--stack-gap);
}

.home-slanted-grid > .slanted-card,
.home-slanted-grid > .slanted-card:nth-child(6n + 4),
.home-slanted-grid > .slanted-card:nth-child(6n + 5),
.home-slanted-grid > .slanted-card:nth-child(4n + 3),
.home-slanted-grid > .slanted-card:nth-child(5n + 4),
.home-slanted-grid > .slanted-card:nth-child(5n + 5) {
  position: absolute !important;
  top: var(--stack-gap) !important;
  bottom: var(--stack-gap) !important;
  width: var(--stack-visible-w) !important;
  min-height: 0 !important;
  max-height: none !important;
  margin-left: 0 !important;
  clip-path: none !important;
  border-radius: 0 !important;
  transform: translateY(0) scale(1) !important;
  background-size: cover !important;
  background-position: center !important;
  transition:
    left 320ms cubic-bezier(.2, .72, .2, 1),
    opacity 240ms ease,
    filter 240ms ease,
    box-shadow 240ms ease !important;
}

.home-slanted-grid > .slanted-card[data-stack-state="visible"] {
  left: calc(var(--stack-edge) + (var(--stack-slot) * (var(--stack-visible-w) + var(--stack-gap)))) !important;
  z-index: calc(90 - var(--stack-slot));
  filter: none !important;
  opacity: 1 !important;
}

.home-slanted-grid > .slanted-card[data-stack-state="left"] {
  left: calc(var(--stack-edge) - (var(--stack-left-order) * var(--stack-step))) !important;
  z-index: calc(58 - var(--stack-left-order));
  filter: brightness(0.62) saturate(0.84) !important;
  opacity: 1 !important;
  cursor: w-resize !important;
}

.home-slanted-grid > .slanted-card[data-stack-state="right"] {
  left: calc(
    var(--stack-edge) + ((var(--stack-visible-count) - 1) * (var(--stack-visible-w) + var(--stack-gap))) +
    (var(--stack-right-order) * var(--stack-step))
  ) !important;
  z-index: calc(56 - var(--stack-right-order));
  filter: brightness(0.62) saturate(0.84) !important;
  opacity: 1 !important;
  cursor: e-resize !important;
}

.home-slanted-grid > .slanted-card[data-stack-state="left"] .slanted-card-inner,
.home-slanted-grid > .slanted-card[data-stack-state="right"] .slanted-card-inner {
  opacity: 0 !important;
}

.home-slanted-grid > .slanted-card[data-stack-state="left-hidden"],
.home-slanted-grid > .slanted-card[data-stack-state="right-hidden"] {
  opacity: 0 !important;
  pointer-events: none !important;
}

.home-slanted-grid > .slanted-card[data-stack-state="visible"]:hover,
.home-slanted-grid > .slanted-card[data-stack-state="visible"]:focus-visible {
  transform: translateY(-8px) !important;
  filter: saturate(1.04) brightness(1.05) !important;
  box-shadow: var(--ui-shadow-lg) !important;
}

#carouselPrev,
#carouselNext {
  all: unset;
  position: absolute !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 42px !important;
  height: 86px !important;
  z-index: 120 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 12px !important;
  cursor: pointer !important;
  user-select: none !important;
  line-height: 1 !important;
  color: rgba(244, 249, 255, 0.92) !important;
  background: linear-gradient(180deg, rgba(10, 17, 28, 0.56), rgba(8, 14, 22, 0.68)) !important;
  border: 1px solid rgba(173, 204, 235, 0.34) !important;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.36) !important;
  transition:
    transform 180ms ease,
    background-color 180ms ease,
    color 180ms ease,
    opacity 180ms ease !important;
}

#carouselPrev {
  left: 8px !important;
}

#carouselNext {
  right: 8px !important;
}

#carouselPrev:hover,
#carouselNext:hover {
  color: #ffffff !important;
  background: linear-gradient(180deg, rgba(20, 34, 52, 0.72), rgba(15, 26, 40, 0.78)) !important;
  transform: translateY(-50%) scale(1.03) !important;
}

#carouselPrev:disabled,
#carouselNext:disabled {
  opacity: 0.2 !important;
  pointer-events: none !important;
}

#carouselPrev::before,
#carouselNext::before {
  content: "" !important;
}

@media (max-width: 1200px) {
  .home-slanted-grid {
    --stack-step: clamp(10px, 1vw, 14px);
  }
}

@media (max-width: 760px) {
  #carouselPrev,
  #carouselNext {
    display: none !important;
  }
}

/* =========================
   Custom Scrollbars (global)
   ========================= */
:root {
  --scroll-track: #1b2430;
  --scroll-thumb: var(--ui-text-0);
}

html,
body,
* {
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) var(--scroll-track);
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

*::-webkit-scrollbar-track {
  background: var(--scroll-track);
  border: 0;
  border-radius: 0;
}

*::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
  border-radius: 999px;
  border: 0;
  min-height: 34px;
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--scroll-thumb);
}

*::-webkit-scrollbar-thumb:active {
  background: var(--scroll-thumb);
}

*::-webkit-scrollbar-corner {
  background: transparent;
}

/* Home mode: panorama must not be visible behind any UI/scrollbar */
body.home-mode .viewer-container {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

body.home-mode .viewer-container::before,
body.home-mode .viewer-container::after {
  opacity: 0 !important;
}

#homeOverlay {
  scrollbar-color: var(--scroll-thumb) var(--scroll-track) !important;
}

#homeOverlay::-webkit-scrollbar-track {
  background: var(--scroll-track) !important;
}

/* =========================
   Footer Legal Modals
   ========================= */
.file-picker-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
}

.file-picker-modal[hidden] { display: none !important; }

.file-picker-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 8, 14, 0.7);
  backdrop-filter: blur(4px);
}

.file-picker-dialog {
  position: relative;
  z-index: 1;
  width: min(800px, calc(100vw - 40px));
  max-height: min(80vh, 700px);
  display: grid;
  grid-template-rows: auto 1fr;
  background: rgba(10, 16, 24, 0.98);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.file-picker-header {
  display: flex;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--card-border);
}

.file-picker-header input {
  flex: 1;
  padding: 8px 12px;
  font-size: 14px;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: rgba(16, 24, 33, 0.92);
  color: var(--text);
}

.file-picker-header .btn {
  width: auto;
  padding: 8px 12px;
  font-size: 16px;
}

.file-picker-grid {
  overflow-y: auto;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  align-content: start;
}

.file-picker-item {
  border: 2px solid transparent;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  background: rgba(16, 24, 33, 0.6);
  transition: border-color 0.15s, transform 0.15s;
}

.file-picker-item:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.file-picker-item.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.file-picker-thumb {
  width: 100%;
  aspect-ratio: 2 / 1;
  object-fit: cover;
  display: block;
  background: rgba(255, 255, 255, 0.05);
}

.file-picker-name {
  padding: 6px 8px;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-picker-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px;
  color: var(--muted);
  font-size: 14px;
}

.legal-modal {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: grid;
  place-items: center;
  padding: clamp(12px, 2vw, 28px);
}

.legal-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 8, 14, 0.62);
  backdrop-filter: blur(4px);
}

.legal-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(860px, calc(100vw - 28px));
  max-height: min(82vh, 860px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: rgba(10, 16, 24, 0.96);
  border: 1px solid rgba(179, 212, 244, 0.32);
  border-radius: 14px;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.legal-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(179, 212, 244, 0.24);
  background: linear-gradient(180deg, rgba(23, 36, 52, 0.88), rgba(14, 24, 37, 0.86));
}

.legal-modal-header h2 {
  margin: 0;
  font-size: clamp(20px, 2.4vw, 28px);
  font-weight: 700;
  line-height: 1.12;
}

.legal-modal-close {
  all: unset;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(179, 212, 244, 0.28);
  background: rgba(15, 24, 36, 0.9);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.legal-modal-close:hover {
  background: rgba(25, 38, 57, 0.96);
  border-color: rgba(199, 228, 255, 0.42);
  transform: translateY(-1px);
}

.legal-modal-close:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 1px;
}

.legal-modal-body {
  overflow: auto;
  padding: clamp(14px, 2vw, 22px);
  color: var(--text);
  white-space: pre-wrap;
  line-height: 1.58;
  font-size: 15px;
}

/* Hard fix: prevent panorama bleed-through behind home scrollbars */
#homeOverlay {
  background-color: #1f2937 !important;
}

body.home-mode #viewer.viewer-container {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

body.home-mode #viewer.viewer-container canvas {
  opacity: 0 !important;
}

.tour-description-card {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 26;
  max-width: min(380px, calc(100vw - 80px));
  padding: 16px 18px;
  background: rgba(10, 18, 31, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 14px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.32);
  transition: transform 320ms cubic-bezier(.2, .72, .2, 1), opacity 320ms ease;
}

.tour-description-card.is-collapsed {
  transform: translateX(calc(100% + 20px));
  pointer-events: none;
  opacity: 0;
}

.tour-description-close {
  position: absolute;
  top: 8px;
  right: 8px;
  all: unset;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(15, 24, 36, 0.9);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.tour-description-text {
  margin: 0;
  font-size: clamp(14px, 0.92vw, 16px);
  line-height: 1.62;
  white-space: pre-wrap;
  color: var(--text);
}

.tour-description-open {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 25;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  background: rgba(10, 18, 31, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--text);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 140ms ease;
}

.tour-description-open:hover {
  background: rgba(20, 32, 52, 0.95);
}

.tour-description-card:not(.is-collapsed) + .tour-description-open {
  opacity: 0;
  pointer-events: none;
}

.tour-panorama-title {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  padding: 8px 18px;
  background: rgba(10, 18, 31, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: clamp(14px, 1vw, 18px);
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  max-width: calc(100vw - 120px);
  overflow: hidden;
  text-overflow: ellipsis;
}

.tour-nav-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 27;
  width: 97%;
  max-width: 97%;
  background: rgba(10, 18, 31, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-bottom: 0;
  border-radius: 14px 14px 0 0;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.36);
  overflow: hidden;
  transition: opacity 400ms ease, max-height 400ms cubic-bezier(.2, .72, .2, 1), box-shadow 400ms ease;
  max-height: 120px;
  opacity: 1;
}

.tour-nav-bar[hidden] { display: none !important; }

.tour-nav-bar.idle {
  max-height: 42px;
  opacity: 0.5;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.tour-nav-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  padding: 10px 14px;
}

.tour-nav-scroll::-webkit-scrollbar { height: 4px; }
.tour-nav-scroll::-webkit-scrollbar-track { background: transparent; }
.tour-nav-scroll::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.18); border-radius: 999px; }

.tour-nav-list {
  display: flex;
  gap: 12px;
  align-items: stretch;
  justify-content: center;
}

.tour-nav-card {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(16, 24, 33, 0.55);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.15s, box-shadow 0.15s;
  min-width: 0;
}

.tour-nav-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.tour-nav-card:active { transform: translateY(0); }

.tour-nav-card.main {
  padding: 10px 18px;
  border-color: rgba(176, 138, 90, 0.5);
  background: linear-gradient(135deg, rgba(176, 138, 90, 0.22), rgba(148, 111, 68, 0.14));
}

.tour-nav-card.main:hover {
  border-color: rgba(176, 138, 90, 0.8);
  background: linear-gradient(135deg, rgba(176, 138, 90, 0.35), rgba(148, 111, 68, 0.25));
  box-shadow: 0 10px 26px rgba(176, 138, 90, 0.28);
}

.tour-nav-card.detail:hover {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(34, 60, 82, 0.45);
}

.tour-nav-card.back {
  border-color: rgba(110, 160, 200, 0.4);
  background: linear-gradient(135deg, rgba(60, 100, 140, 0.18), rgba(40, 70, 100, 0.12));
}

.tour-nav-card.back:hover {
  border-color: rgba(110, 160, 200, 0.7);
  background: linear-gradient(135deg, rgba(60, 100, 140, 0.3), rgba(40, 70, 100, 0.2));
  box-shadow: 0 10px 26px rgba(60, 100, 140, 0.25);
}

.tour-nav-card.back .tour-nav-card-icon {
  background: linear-gradient(180deg, #5a9ee8, #2d6fc4);
}

.tour-nav-card-arrow {
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
  line-height: 1;
}

.tour-nav-card.main .tour-nav-card-arrow {
  color: rgba(194, 154, 102, 0.9);
}

.tour-nav-card-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  position: relative;
  background: linear-gradient(180deg, #36c5d8, #0d8ba8);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.tour-nav-card-icon::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  background: #fff;
  -webkit-mask-position: center;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: contain;
}

.tour-nav-card-icon.icon-default::after {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><circle cx='12' cy='12' r='5' fill='black'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><circle cx='12' cy='12' r='5' fill='black'/></svg>");
}

.tour-nav-card-icon.icon-arrow::after,
.tour-nav-card-icon.target-main::after {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M4 12h14M13 6l6 6-6 6' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M4 12h14M13 6l6 6-6 6' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}

.tour-nav-card-icon.icon-back::after {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M20 12H6M11 6L5 12l6 6' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M20 12H6M11 6L5 12l6 6' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}

.tour-nav-card-icon.icon-info::after {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><circle cx='12' cy='8' r='1.5' fill='black'/><rect x='10.5' y='11' width='3' height='9' rx='1' fill='black'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><circle cx='12' cy='8' r='1.5' fill='black'/><rect x='10.5' y='11' width='3' height='9' rx='1' fill='black'/></svg>");
}

.tour-nav-card-icon.icon-arrow {
  background: linear-gradient(180deg, #5cd660, #2ba040);
}

.tour-nav-card-icon.target-main {
  background: linear-gradient(180deg, #5cd660, #2ba040);
}

.tour-nav-card-icon.icon-info {
  background: linear-gradient(180deg, #6f9c84, #4a7a64);
}

.tour-nav-card-body {
  min-width: 0;
}

.tour-nav-card-name {
  font-size: 13px;
  font-weight: 600;
  color: rgba(244, 249, 255, 0.92);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

.tour-nav-card.main .tour-nav-card-name {
  font-size: 14px;
  font-weight: 700;
  max-width: 180px;
}

.tour-nav-card-group {
  font-size: 10px;
  color: rgba(180, 200, 220, 0.55);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2px;
}

.tour-nav-card.main .tour-nav-card-group {
  color: rgba(194, 154, 102, 0.7);
}

@media (max-width: 760px) {
  .tour-nav-bar {
    bottom: 0;
    width: calc(100vw);
    border-radius: 12px 12px 0 0;
    left: 0;
    transform: none;
  }

  .tour-nav-bar.idle {
    max-height: 34px;
  }

  .tour-nav-card-name { max-width: 100px; }
  .tour-nav-card.main .tour-nav-card-name { max-width: 120px; }
  .tour-nav-card { padding: 6px 10px; gap: 8px; }
  .tour-nav-card.main { padding: 8px 14px; }
  .tour-nav-card-icon { width: 24px; height: 24px; font-size: 12px; }
  .tour-nav-card-arrow { font-size: 15px; }
  .tour-nav-list { gap: 8px; }
  .tour-nav-cards { gap: 6px; }
}

html[data-theme="light"] .tour-nav-bar {
  background: rgba(243, 233, 219, 0.94);
  border-color: rgba(142, 114, 78, 0.3);
  box-shadow: 0 12px 36px rgba(74, 54, 31, 0.12);
}

html[data-theme="light"] .tour-nav-bar.idle {
  box-shadow: 0 4px 14px rgba(74, 54, 31, 0.06);
}

html[data-theme="light"] .tour-nav-card {
  background: rgba(255, 255, 255, 0.5);
  border-color: rgba(142, 114, 78, 0.16);
}

html[data-theme="light"] .tour-nav-card:hover {
  background: rgba(220, 203, 178, 0.5);
  border-color: rgba(142, 114, 78, 0.4);
}

html[data-theme="light"] .tour-nav-card.main {
  border-color: rgba(176, 138, 90, 0.4);
  background: linear-gradient(135deg, rgba(176, 138, 90, 0.14), rgba(148, 111, 68, 0.08));
}

html[data-theme="light"] .tour-nav-card.main:hover {
  border-color: rgba(176, 138, 90, 0.7);
  background: linear-gradient(135deg, rgba(176, 138, 90, 0.25), rgba(148, 111, 68, 0.15));
  box-shadow: 0 10px 26px rgba(176, 138, 90, 0.18);
}

html[data-theme="light"] .tour-nav-card.back {
  border-color: rgba(80, 120, 160, 0.3);
  background: linear-gradient(135deg, rgba(60, 100, 140, 0.1), rgba(40, 70, 100, 0.06));
}

html[data-theme="light"] .tour-nav-card.back:hover {
  border-color: rgba(80, 120, 160, 0.55);
  background: linear-gradient(135deg, rgba(60, 100, 140, 0.2), rgba(40, 70, 100, 0.12));
}

html[data-theme="light"] .tour-nav-card.back .tour-nav-card-icon {
  background: linear-gradient(180deg, #5a9ee8, #2d6fc4);
}

html[data-theme="light"] .tour-nav-card-name {
  color: #2e261f;
}

html[data-theme="light"] .tour-nav-card.main .tour-nav-card-name {
  color: #5a3f1e;
}

html[data-theme="light"] .tour-nav-card-group {
  color: rgba(95, 85, 72, 0.55);
}

html[data-theme="light"] .tour-nav-card.main .tour-nav-card-group {
  color: rgba(142, 100, 50, 0.6);
}

html[data-theme="light"] .tour-nav-card.main .tour-nav-card-arrow {
  color: rgba(142, 100, 50, 0.8);
}

/* =========================
   Native Select Readability
   ========================= */
select option,
select optgroup {
  color: #1b1f27 !important;
  background-color: #ffffff !important;
}

select option:disabled {
  color: #8b94a3 !important;
}

/* =========================
   Theme Toggle Controls
   ========================= */
.hero-actions {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 10px !important;
  flex-wrap: wrap !important;
}

#themeToggle,
#themeToggleAdmin,
#themeToggleLogin {
  min-width: 44px !important;
  width: 44px !important;
  height: 40px !important;
  padding: 0 !important;
  text-align: center !important;
  font-size: 20px !important;
  line-height: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* =========================
   Manual Theme Overrides
   ========================= */
html[data-theme="light"] {
  color-scheme: light;
  --color-bg: #f3ebdd;
  --color-surface: #e6d8c4;
  --color-surface-2: #dccab2;
  --color-text: #2e261f;
  --color-muted: #6f6254;
  --color-border: #c9b79e;
  --color-accent: #8a5820;
  --color-accent-hover: #734717;
  --color-accent-active: #5f3812;
  --color-accent-disabled: #bda58a;
  --color-accent-2: #2e5a44;
  --color-accent-2-hover: #244b39;
  --color-accent-2-active: #1b3a2c;
  --color-accent-2-disabled: #7f9b8d;
  --color-link: #2d5f85;
  --color-visited: #5b4c7d;
  --color-danger: #a33a2b;
  --color-success: #3f6b46;
  --color-warning: #8a5820;
  --color-focus-ring: #1f6e8c;
  --color-overlay: rgba(33, 25, 17, 0.36);
  --shadow-soft: 0 10px 28px rgba(68, 44, 20, 0.18);
  --shadow-elev: 0 18px 45px rgba(68, 44, 20, 0.24);

  --ui-bg-0: #e8dfd0;
  --ui-bg-1: #dfd3c0;
  --ui-surface-0: #f0e7d8;
  --ui-surface-1: #eadfce;
  --ui-surface-2: #e1d4c1;
  --ui-border-0: #c9bca8;
  --ui-border-1: #b9a98f;
  --ui-text-0: #2a241d;
  --ui-text-1: #5f5548;
  --ui-text-2: #7e7468;
  --ui-primary: #b08a5a;
  --ui-primary-hover: #c29a66;
  --ui-primary-active: #946f44;
  --ui-secondary: #9f785d;
  --ui-success: #58765f;
  --ui-warning: #b08a5a;
  --ui-danger: #ad6656;
  --ui-link: #5e7d94;
  --ui-visited: #706383;
  --ui-focus: #d7b176;
  --ui-overlay-strong: rgba(39, 31, 22, 0.48);
  --ui-overlay-soft: rgba(70, 58, 43, 0.24);
  --ui-shadow-xs: 0 2px 10px rgba(58, 38, 22, 0.12);
  --ui-shadow-sm: 0 10px 30px rgba(58, 38, 22, 0.18);
  --ui-shadow-md: 0 16px 40px rgba(58, 38, 22, 0.24);
  --ui-shadow-lg: 0 24px 56px rgba(58, 38, 22, 0.3);

  --bg: var(--color-bg);
  --bg-soft: var(--color-surface);
  --card-border: color-mix(in srgb, var(--color-border) 75%, #ffffff 25%);
  --text: var(--color-text);
  --muted: var(--color-muted);
  --accent: var(--color-accent);
  --shadow: var(--shadow-elev);
  --scroll-track: #d8cab6;
  --scroll-thumb: #2a241d;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --color-bg: #1e1711;
  --color-surface: #2b2118;
  --color-surface-2: #3a2b1f;
  --color-text: #f3e7d7;
  --color-muted: #b9a792;
  --color-border: #4d3a2a;
  --color-accent: #c28a45;
  --color-accent-hover: #d39a55;
  --color-accent-active: #a97539;
  --color-accent-disabled: #7b634b;
  --color-accent-2: #6f9c84;
  --color-accent-2-hover: #82ae97;
  --color-accent-2-active: #587b67;
  --color-accent-2-disabled: #4d6859;
  --color-link: #8db6d6;
  --color-visited: #b39ed0;
  --color-danger: #ce675a;
  --color-success: #7cb387;
  --color-warning: #c28a45;
  --color-focus-ring: #f0b35c;
  --color-overlay: rgba(8, 6, 4, 0.54);
  --shadow-soft: 0 10px 28px rgba(0, 0, 0, 0.34);
  --shadow-elev: 0 18px 45px rgba(0, 0, 0, 0.42);

  --ui-bg-0: #131518;
  --ui-bg-1: #1a1f26;
  --ui-surface-0: #1d232b;
  --ui-surface-1: #242c36;
  --ui-surface-2: #2c3643;
  --ui-border-0: #3f4a58;
  --ui-border-1: #5a6676;
  --ui-text-0: #ece4d7;
  --ui-text-1: #cdc1af;
  --ui-text-2: #9b8f7f;
  --ui-primary: #b08a5a;
  --ui-primary-hover: #c29a66;
  --ui-primary-active: #946f44;
  --ui-secondary: #9f785d;
  --ui-success: #58765f;
  --ui-warning: #b08a5a;
  --ui-danger: #ad6656;
  --ui-link: #8ea8bc;
  --ui-visited: #9f91af;
  --ui-focus: #d7b176;
  --ui-overlay-strong: rgba(18, 16, 14, 0.68);
  --ui-overlay-soft: rgba(25, 31, 38, 0.52);
  --ui-shadow-xs: 0 2px 10px rgba(0, 0, 0, 0.22);
  --ui-shadow-sm: 0 10px 30px rgba(0, 0, 0, 0.34);
  --ui-shadow-md: 0 16px 40px rgba(0, 0, 0, 0.44);
  --ui-shadow-lg: 0 24px 56px rgba(0, 0, 0, 0.56);

  --bg: var(--color-bg);
  --bg-soft: var(--color-surface);
  --card-border: color-mix(in srgb, var(--color-border) 75%, #ffffff 25%);
  --text: var(--color-text);
  --muted: var(--color-muted);
  --accent: var(--color-accent);
  --shadow: var(--shadow-elev);
  --scroll-track: #1b2430;
  --scroll-thumb: var(--ui-text-0);
}

/* =========================
   Light Theme Visual Fixes
   ========================= */
html[data-theme="light"] body {
  background:
    radial-gradient(1180px 680px at 84% -14%, rgba(128, 162, 196, 0.16), transparent 62%),
    radial-gradient(820px 560px at -10% 108%, rgba(174, 136, 92, 0.14), transparent 66%),
    linear-gradient(160deg, #f5efe3 0%, #e9dfcf 56%, #dfd2bf 100%) !important;
}

html[data-theme="light"] .home-backdrop {
  background:
    radial-gradient(circle at 82% 10%, rgba(98, 132, 167, 0.18), transparent 44%),
    radial-gradient(circle at 8% 88%, rgba(180, 142, 96, 0.16), transparent 40%),
    linear-gradient(132deg, rgba(242, 234, 221, 0.96), rgba(231, 221, 206, 0.94)) !important;
  backdrop-filter: none !important;
}

html[data-theme="light"] .home-hero-strip {
  background:
    linear-gradient(132deg, rgba(236, 226, 209, 0.96), rgba(226, 213, 194, 0.95)),
    radial-gradient(circle at 86% 22%, rgba(171, 131, 83, 0.16), transparent 42%) !important;
  border-bottom: 1px solid rgba(142, 114, 78, 0.34) !important;
  box-shadow: 0 10px 24px rgba(74, 54, 31, 0.12) !important;
}

html[data-theme="light"] .home-hero-strip .hero-kicker {
  color: #85623c !important;
}

html[data-theme="light"] .home-hero-strip .hero-title {
  color: #2d2319 !important;
  text-shadow: none !important;
}

html[data-theme="light"] .home-hero-strip .hero-subtitle {
  color: #5d4f3e !important;
}

html[data-theme="light"] .home-slanted-grid {
  background:
    linear-gradient(132deg, rgba(236, 226, 209, 0.94), rgba(226, 213, 194, 0.92)),
    radial-gradient(circle at 84% 18%, rgba(171, 131, 83, 0.1), transparent 44%) !important;
}

html[data-theme="light"] .home-slanted-grid > .slanted-card::before {
  background:
    linear-gradient(to top, rgba(11, 17, 27, 0.74), rgba(11, 17, 27, 0.22)),
    linear-gradient(110deg, rgba(0, 0, 0, 0.22), transparent 56%) !important;
}

html[data-theme="light"] .home-slanted-grid > .slanted-card .category-card-title {
  color: #f6f9fd !important;
  text-shadow: 0 4px 14px rgba(0, 0, 0, 0.56) !important;
}

html[data-theme="light"] .home-slanted-grid > .slanted-card .category-card-description,
html[data-theme="light"] .home-slanted-grid > .slanted-card .category-card-label {
  color: rgba(226, 239, 252, 0.95) !important;
}

html[data-theme="light"] .lang-toggle,
html[data-theme="light"] #themeToggle {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(248, 243, 235, 0.92)) !important;
  color: #2d2319 !important;
  border-color: rgba(125, 100, 71, 0.34) !important;
}

html[data-theme="light"] #carouselPrev,
html[data-theme="light"] #carouselNext {
  background: linear-gradient(180deg, rgba(33, 46, 64, 0.58), rgba(24, 35, 50, 0.68)) !important;
  color: #f5f9ff !important;
  border-color: rgba(242, 247, 255, 0.34) !important;
}

html[data-theme="light"] .home-footer {
  background: linear-gradient(180deg, #ebe0cf, #e1d2bc) !important;
  border-top: 1px solid rgba(132, 103, 71, 0.34) !important;
  color: #3a2f24 !important;
  box-shadow: 0 -10px 22px rgba(74, 54, 31, 0.1) !important;
}

html[data-theme="light"] .home-footer-bottom {
  border-top: 1px solid rgba(132, 103, 71, 0.24) !important;
}

html[data-theme="light"] .home-footer-about h3,
html[data-theme="light"] .home-footer-contacts h3 {
  color: #2f261c !important;
}

html[data-theme="light"] .home-footer-brand-text,
html[data-theme="light"] .home-footer-about p,
html[data-theme="light"] .home-footer-contacts li,
html[data-theme="light"] .home-footer-bottom p {
  color: #5c4e3d !important;
}

html[data-theme="light"] .home-footer-logo-fallback {
  color: #6c4f2e !important;
}

html[data-theme="light"] .home-footer-links a {
  color: #355f80 !important;
}

html[data-theme="light"] .home-footer-links a:hover,
html[data-theme="light"] .home-footer-links a:focus-visible {
  color: #1f3f58 !important;
}

/* =========================
   Unified Home Surface Concept
   Header + cards background = one solid plane
   Footer = slightly darker
   ========================= */
html[data-theme="light"] {
  --home-main-surface: #e7dbc8;
  --home-footer-surface: #d9c9b1;
  --home-surface-border: rgba(124, 95, 63, 0.34);
  --home-title-color: #2e2419;
  --home-kicker-color: #7f5f3a;
  --home-subtitle-color: #5f4f3c;
  --home-footer-text: #564633;
  --home-footer-link: #365f80;
  --home-footer-link-hover: #1f3f58;
}

html[data-theme="dark"] {
  --home-main-surface: #1c2430;
  --home-footer-surface: #141b24;
  --home-surface-border: rgba(196, 168, 126, 0.28);
  --home-title-color: #ebe3d7;
  --home-kicker-color: #c6a677;
  --home-subtitle-color: #cfc1ad;
  --home-footer-text: #cfc2af;
  --home-footer-link: #9ebad1;
  --home-footer-link-hover: #d7e8f8;
}

html[data-theme] .home-backdrop {
  background: var(--home-main-surface) !important;
  backdrop-filter: none !important;
}

html[data-theme] #homeOverlay .home-content {
  background: var(--home-main-surface) !important;
  gap: 0 !important;
}

html[data-theme] .home-hero-strip {
  background: var(--home-main-surface) !important;
  border: 0 !important;
  border-bottom: 0 !important;
  box-shadow: none !important;
}

html[data-theme] .home-hero-strip::before,
html[data-theme] .home-hero-strip::after {
  content: none !important;
  display: none !important;
}

html[data-theme] .category-shell {
  background: var(--home-main-surface) !important;
  border: 0 !important;
  box-shadow: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

html[data-theme] .home-slanted-grid {
  background: var(--home-main-surface) !important;
  border: 0 !important;
  box-shadow: none !important;
  margin: 0 !important;
  padding-top: 0 !important;
}

html[data-theme] .home-slanted-grid > .slanted-card {
  border-top: 1 !important;
}

html[data-theme] .home-hero-strip .hero-kicker {
  color: var(--home-kicker-color) !important;
}

html[data-theme] .home-hero-strip .hero-title {
  color: var(--home-title-color) !important;
  text-shadow: none !important;
}

html[data-theme] .home-hero-strip .hero-subtitle {
  color: var(--home-subtitle-color) !important;
}

html[data-theme] .home-footer {
  background: var(--home-footer-surface) !important;
  border-top: 1px solid var(--home-surface-border) !important;
  color: var(--home-footer-text) !important;
}

html[data-theme] .home-footer-bottom {
  border-top: 1px solid color-mix(in srgb, var(--home-surface-border) 75%, transparent) !important;
}

html[data-theme] .home-footer-brand-text,
html[data-theme] .home-footer-about p,
html[data-theme] .home-footer-contacts li,
html[data-theme] .home-footer-bottom p {
  color: var(--home-footer-text) !important;
}

html[data-theme] .home-footer-about h3,
html[data-theme] .home-footer-contacts h3 {
  color: var(--home-title-color) !important;
}

html[data-theme] .home-footer-links a {
  color: var(--home-footer-link) !important;
}

html[data-theme] .home-footer-links a:hover,
html[data-theme] .home-footer-links a:focus-visible {
  color: var(--home-footer-link-hover) !important;
}

/* Final light-theme card tone: same visual family as header text/surface */
html[data-theme="light"] .home-slanted-grid > .slanted-card::before {
  background: linear-gradient(
    180deg,
    rgba(235, 223, 206, 0.5),
    rgba(226, 212, 192, 0.6)
  ) !important;
  opacity: 1 !important;
}

html[data-theme="light"] .home-slanted-grid > .slanted-card:hover::before,
html[data-theme="light"] .home-slanted-grid > .slanted-card:focus-visible::before {
  opacity: 0 !important;
}

html[data-theme="light"] .home-slanted-grid > .slanted-card .category-card-title {
  color: var(--home-title-color) !important;
  text-shadow: none !important;
}

html[data-theme="light"] .home-slanted-grid > .slanted-card .category-card-description,
html[data-theme="light"] .home-slanted-grid > .slanted-card .category-card-label {
  color: var(--home-subtitle-color) !important;
  text-shadow: none !important;
}

html[data-theme="light"] .home-slanted-grid > .slanted-card[data-stack-state="visible"] {
  filter: saturate(1) brightness(1) !important;
}

html[data-theme="light"] .home-slanted-grid > .slanted-card[data-stack-state="left"],
html[data-theme="light"] .home-slanted-grid > .slanted-card[data-stack-state="right"] {
  filter: brightness(0.9) saturate(0.92) !important;
}

/* Legal modal: light theme */
html[data-theme="light"] .legal-modal-backdrop {
  background: rgba(82, 66, 46, 0.28) !important;
  backdrop-filter: blur(3px);
}

html[data-theme="light"] .legal-modal-dialog {
  background: linear-gradient(180deg, #f2e8d8, #eadfcd) !important;
  border: 1px solid rgba(126, 98, 64, 0.34) !important;
  box-shadow: 0 18px 44px rgba(74, 54, 31, 0.2) !important;
}

html[data-theme="light"] .legal-modal-header {
  background: linear-gradient(180deg, #e8dbc4, #deceb5) !important;
  border-bottom: 1px solid rgba(126, 98, 64, 0.3) !important;
}

html[data-theme="light"] .legal-modal-header h2 {
  color: #2f251a !important;
}

html[data-theme="light"] .legal-modal-close {
  border: 1px solid rgba(126, 98, 64, 0.36) !important;
  background: rgba(243, 233, 219, 0.95) !important;
  color: #2f251a !important;
}

html[data-theme="light"] .legal-modal-close:hover {
  background: rgba(236, 224, 207, 0.98) !important;
  border-color: rgba(106, 81, 52, 0.5) !important;
}

html[data-theme="light"] .legal-modal-body {
  color: #413425 !important;
}

/* =========================
   Light Theme: Panorama Viewer Elements
   ========================= */
html[data-theme="light"] .tour-description-card {
  background: rgba(243, 233, 219, 0.92) !important;
  border: 1px solid rgba(142, 114, 78, 0.34) !important;
  box-shadow: 0 10px 28px rgba(74, 54, 31, 0.18) !important;
}

html[data-theme="light"] .tour-description-text {
  color: #2e261f !important;
}

html[data-theme="light"] .tour-description-close {
  background: rgba(236, 224, 207, 0.95) !important;
  border: 1px solid rgba(142, 114, 78, 0.36) !important;
  color: #2e261f !important;
}

html[data-theme="light"] .tour-description-open {
  background: rgba(243, 233, 219, 0.92) !important;
  border: 1px solid rgba(142, 114, 78, 0.34) !important;
  color: #2e261f !important;
  box-shadow: 0 6px 18px rgba(74, 54, 31, 0.16) !important;
}

html[data-theme="light"] .tour-description-open:hover {
  background: rgba(236, 224, 207, 0.98) !important;
}

html[data-theme="light"] .psv-tooltip {
  background: linear-gradient(180deg, rgba(243, 233, 219, 0.96), rgba(234, 223, 206, 0.97)) !important;
  border: 1px solid rgba(142, 114, 78, 0.34) !important;
  color: #2e261f !important;
  box-shadow: 0 12px 28px rgba(74, 54, 31, 0.2) !important;
}

html[data-theme="light"] .psv-tooltip-content {
  color: #2e261f !important;
}

html[data-theme="light"] .psv-loader-container {
  background: radial-gradient(circle at center, rgba(234, 223, 206, 0.92), rgba(220, 207, 188, 0.95)) !important;
}

html[data-theme="light"] .lang-toggle,
html[data-theme="light"] .back-btn,
html[data-theme="light"] #themeToggle,
html[data-theme="light"] .scene-tab {
  background: linear-gradient(180deg, rgba(243, 233, 219, 0.92), rgba(231, 221, 206, 0.94)) !important;
  color: #2e261f !important;
  border-color: rgba(142, 114, 78, 0.34) !important;
}

html[data-theme="light"] .scene-tab.active {
  background: linear-gradient(180deg, rgba(220, 203, 178, 0.9), rgba(210, 192, 165, 0.92)) !important;
  border-color: rgba(142, 114, 78, 0.5) !important;
  color: #2e261f !important;
}

html[data-theme="light"] .hotspot-dot {
  background: linear-gradient(180deg, #36c5d8, #0d8ba8) !important;
  border: 2px solid rgba(255, 255, 255, 0.95) !important;
  box-shadow: 0 0 0 3px rgba(54, 197, 216, 0.45), 0 4px 10px rgba(0, 0, 0, 0.25) !important;
}

html[data-theme="light"] .hotspot-dot.target-main {
  background: linear-gradient(180deg, #5cd660, #2ba040) !important;
  border: 2px solid rgba(240, 255, 240, 0.95) !important;
  box-shadow: 0 0 0 4px rgba(92, 214, 96, 0.5), 0 4px 14px rgba(0, 0, 0, 0.2) !important;
}

html[data-theme="light"] .hotspot-dot.target-back {
  background: linear-gradient(180deg, #5a9ee8, #2d6fc4) !important;
  border: 2px solid rgba(220, 240, 255, 0.95) !important;
  box-shadow: 0 0 0 4px rgba(90, 158, 232, 0.5), 0 4px 12px rgba(0, 0, 0, 0.2) !important;
}

html[data-theme="light"] .hotspot-dot.icon-info {
  background: linear-gradient(180deg, #6f9c84, #4a7a64) !important;
}

html[data-theme="light"] .tour-panorama-title {
  background: rgba(243, 233, 219, 0.92) !important;
  border: 1px solid rgba(142, 114, 78, 0.34) !important;
  color: #2e261f !important;
  box-shadow: 0 6px 18px rgba(74, 54, 31, 0.16) !important;
}

html[data-theme="light"] .psv-marker:hover .hotspot-dot,
html[data-theme="light"] .psv-marker--hover .hotspot-dot {
  background: linear-gradient(180deg, #4adfee, #139fc0) !important;
  box-shadow: 0 0 0 5px rgba(54, 197, 216, 0.55), 0 6px 16px rgba(0, 0, 0, 0.3) !important;
}

html[data-theme="light"] .psv-marker:hover .hotspot-dot.target-main,
html[data-theme="light"] .psv-marker--hover .hotspot-dot.target-main {
  background: linear-gradient(180deg, #6ce670, #3ab050) !important;
  box-shadow: 0 0 0 6px rgba(92, 214, 96, 0.6), 0 6px 18px rgba(0, 0, 0, 0.3) !important;
}

html[data-theme="light"] .psv-marker:hover .hotspot-dot.target-back,
html[data-theme="light"] .psv-marker--hover .hotspot-dot.target-back {
  background: linear-gradient(180deg, #6ab0f0, #3d80d4) !important;
  box-shadow: 0 0 0 6px rgba(90, 158, 232, 0.6), 0 6px 16px rgba(0, 0, 0, 0.3) !important;
}

/* =========================
   Splash Screen
   ========================= */
.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: var(--color-bg);
  transition: opacity 400ms ease;
}

.splash-screen.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.splash-content {
  display: grid;
  gap: 24px;
  justify-items: center;
  text-align: center;
  padding: 24px;
}

.splash-title {
  margin: 0;
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: 0.01em;
  max-width: min(640px, 90vw);
}

.splash-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid color-mix(in srgb, var(--color-text) 15%, transparent);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: tour-loader-spin 0.7s linear infinite;
}

/* =========================
   Panorama Loading Dots
   ========================= */
.tour-loader {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 30;
  pointer-events: none;
}

.tour-loader[hidden] {
  display: none;
}

.tour-loader-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-accent);
  animation: dot-pulse 1.2s ease-in-out infinite;
}

.tour-loader-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.tour-loader-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes dot-pulse {
  0%, 100% {
    opacity: 0.3;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}

/* Splash: light theme */
html[data-theme="light"] .splash-screen {
  background: linear-gradient(160deg, #f5efe3 0%, #e9dfcf 56%, #dfd2bf 100%);
}

/* Splash: dark theme */
html[data-theme="dark"] .splash-screen {
  background: #1e1711;
}

/* =========================
   Mobile Responsive Fixes
   ========================= */

/* Tablet & small desktop */
@media (max-width: 760px) {
  /* Splash */
  .splash-title {
    font-size: clamp(24px, 7vw, 36px);
  }

  .splash-spinner {
    width: 32px;
    height: 32px;
  }

  /* Tour description card */
  .tour-description-card {
    top: 8px;
    right: 8px;
    left: 8px;
    max-width: none;
    padding: 12px 14px;
    border-radius: 10px;
  }

  .tour-description-text {
    font-size: 14px;
    line-height: 1.55;
    max-height: 40dvh;
    overflow-y: auto;
  }

  .tour-description-open {
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    font-size: 16px;
    border-radius: 8px;
  }

  /* Panorama title */
  .tour-panorama-title {
    top: 8px;
    padding: 6px 14px;
    font-size: clamp(13px, 3.5vw, 16px);
    max-width: calc(100vw - 24px);
  }

  /* Tour loader dots */
  .tour-loader {
    bottom: 60px;
  }

  /* Footer */
  .home-footer-top {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    padding: 18px 14px !important;
  }

  .home-footer-logo {
    width: 64px;
    height: 64px;
  }

  .home-footer-brand-text {
    font-size: 12px;
  }

  .home-footer-about h3,
  .home-footer-contacts h3 {
    font-size: 18px !important;
  }

  .home-footer-bottom {
    flex-direction: column;
    gap: 6px;
    padding: 12px 14px !important;
    text-align: center;
  }

  .home-footer-bottom p {
    font-size: 12px;
  }

  /* Hero strip */
  .home-hero-strip {
    padding: 12px 12px !important;
  }

  .hero-title {
    font-size: clamp(24px, 8vw, 38px) !important;
  }

  .hero-subtitle {
    font-size: 13px !important;
  }

  .hero-actions {
    gap: 6px;
  }

  .lang-toggle,
  #themeToggle {
    min-height: 36px;
    min-width: 36px;
    padding: 6px 10px;
    font-size: 13px;
  }

  /* Category cards on mobile */
  .category-shell {
    min-height: 0 !important;
    height: auto !important;
    overflow: visible !important;
  }

  #homeOverlay,
  .home-overlay {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    display: block !important;
    align-items: flex-start !important;
  }

  #homeOverlay .home-content,
  .home-content {
    min-height: 0 !important;
    height: auto !important;
    grid-template-rows: auto auto auto !important;
    overflow: visible !important;
  }

  .home-slanted-grid {
    min-height: 0 !important;
    height: auto !important;
  }

  .category-card-title {
    font-size: clamp(22px, 7vw, 32px) !important;
  }

  .category-card-description {
    font-size: 13px !important;
  }

  /* Viewer container */
  .viewer-container {
    height: 100dvh !important;
  }

  /* Back button */
  .back-btn {
    min-height: 36px;
    padding: 6px 12px;
    font-size: 13px;
  }

  /* Scene tabs (panorama navigation inside tour) */
  .scene-tabs {
    grid-template-columns: 1fr 1fr !important;
    gap: 4px !important;
    padding: 4px !important;
  }

  .scene-tab {
    padding: 5px 6px;
    font-size: 12px;
  }

  /* Legal modal */
  .legal-modal-dialog {
    margin: 12px !important;
    max-width: none !important;
    width: calc(100vw - 24px) !important;
    max-height: 80dvh !important;
    overflow-y: auto;
  }

  .legal-modal-body {
    padding: 14px !important;
    font-size: 14px !important;
  }
}

/* Small phones */
@media (max-width: 420px) {
  .splash-title {
    font-size: clamp(20px, 8vw, 28px);
  }

  .tour-description-card {
    top: 6px;
    right: 6px;
    left: 6px;
    padding: 10px 12px;
  }

  .tour-description-text {
    font-size: 13px;
    max-height: 35dvh;
  }

  .tour-panorama-title {
    bottom: 8px;
    padding: 5px 10px;
    font-size: 13px;
  }

  .tour-loader {
    bottom: 50px;
  }

  .tour-loader-dot {
    width: 8px;
    height: 8px;
  }

  .hero-title {
    font-size: clamp(20px, 9vw, 28px) !important;
  }

  .home-footer-logo {
    width: 52px;
    height: 52px;
  }

  .home-footer-about h3,
  .home-footer-contacts h3 {
    font-size: 16px !important;
  }

  .scene-tabs {
    grid-template-columns: 1fr !important;
  }

  .lang-toggle,
  #themeToggle,
  .back-btn {
    min-height: 34px;
    min-width: 34px;
    padding: 5px 8px;
    font-size: 12px;
  }
}

/* Landscape phones */
@media (max-height: 500px) and (orientation: landscape) {
  .splash-title {
    font-size: 24px;
  }

  .splash-content {
    gap: 14px;
  }

  .tour-description-card {
    max-height: 50dvh;
  }

  .tour-description-text {
    max-height: 24dvh;
  }

  .home-hero-strip {
    padding: 8px 12px !important;
  }

  .hero-title {
    font-size: clamp(20px, 5vw, 28px) !important;
  }

  .home-slanted-grid > .slanted-card {
    min-height: 160px !important;
  }
}

/* Ultra-wide & 4K */
@media (min-width: 2560px) {
  .home-footer-top {
    max-width: 1920px;
    padding-left: clamp(80px, 10vw, 200px);
    padding-right: clamp(80px, 10vw, 200px);
  }

  .home-content {
    max-width: 1920px;
    margin: 0 auto;
  }

  .splash-title {
    font-size: 56px;
  }

  .splash-spinner {
    width: 48px;
    height: 48px;
  }
}

/* =========================
   Mobile Card Carousel — Final Override
   Overrides ALL desktop stack rules
   ========================= */
@media (max-width: 760px) {
  .home-slanted-grid {
    display: flex !important;
    position: relative !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    gap: 10px !important;
    padding: 10px 12px 14px !important;
    min-height: 340px !important;
    height: auto !important;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .home-slanted-grid > .slanted-card,
  .home-slanted-grid > .slanted-card:nth-child(6n + 4),
  .home-slanted-grid > .slanted-card:nth-child(6n + 5),
  .home-slanted-grid > .slanted-card:nth-child(4n + 3),
  .home-slanted-grid > .slanted-card:nth-child(5n + 4),
  .home-slanted-grid > .slanted-card:nth-child(5n + 5) {
    position: relative !important;
    top: auto !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    width: min(82vw, 400px) !important;
    flex: 0 0 min(82vw, 400px) !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    aspect-ratio: 2 / 3 !important;
    margin-left: 0 !important;
    clip-path: none !important;
    border-radius: 14px !important;
    filter: none !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: none !important;
    scroll-snap-align: center;
    animation: none !important;
  }

  .home-slanted-grid > .slanted-card:first-child {
    scroll-snap-align: start;
  }

  .home-slanted-grid > .slanted-card[data-stack-state="left-hidden"],
  .home-slanted-grid > .slanted-card[data-stack-state="right-hidden"],
  .home-slanted-grid > .slanted-card[data-stack-state="left"],
  .home-slanted-grid > .slanted-card[data-stack-state="right"],
  .home-slanted-grid > .slanted-card[data-stack-state="visible"] {
    opacity: 1 !important;
    pointer-events: auto !important;
    filter: none !important;
    left: auto !important;
    z-index: auto !important;
  }

  .home-slanted-grid > .slanted-card[data-stack-state="left"] .slanted-card-inner,
  .home-slanted-grid > .slanted-card[data-stack-state="right"] .slanted-card-inner,
  .home-slanted-grid > .slanted-card[data-stack-state="left-hidden"] .slanted-card-inner,
  .home-slanted-grid > .slanted-card[data-stack-state="right-hidden"] .slanted-card-inner,
  .home-slanted-grid > .slanted-card[data-stack-state="visible"] .slanted-card-inner,
  .home-slanted-grid > .slanted-card .slanted-card-inner {
    opacity: 1 !important;
  }

  .home-slanted-grid > .slanted-card .category-card-description {
    display: block !important;
  }

  #carouselPrev,
  #carouselNext {
    display: none !important;
  }
}

@media (max-width: 420px) {
  .home-slanted-grid > .slanted-card,
  .home-slanted-grid > .slanted-card:nth-child(6n + 4),
  .home-slanted-grid > .slanted-card:nth-child(6n + 5),
  .home-slanted-grid > .slanted-card:nth-child(4n + 3),
  .home-slanted-grid > .slanted-card:nth-child(5n + 4),
  .home-slanted-grid > .slanted-card:nth-child(5n + 5) {
    width: 88vw !important;
    flex: 0 0 88vw !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    aspect-ratio: 2 / 3 !important;
  }
}

/* =========================
   Design Enhancements
   ========================= */

/* 1. Card hover: gold top border accent */
.home-slanted-grid > .slanted-card[data-stack-state="visible"] {
  border-top: 2px solid transparent;
  transition: left 320ms cubic-bezier(.2, .72, .2, 1), filter 160ms ease, transform 180ms ease, box-shadow 180ms ease, border-top-color 300ms ease !important;
}

.home-slanted-grid > .slanted-card[data-stack-state="visible"]:hover,
.home-slanted-grid > .slanted-card[data-stack-state="visible"]:focus-visible {
  border-top-color: var(--ui-primary) !important;
}

/* 2. Hotspot pulse (radar effect) */
.hotspot-dot {
  position: relative;
}

.hotspot-dot::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid #36c5d8;
  animation: hotspot-pulse 2.5s ease-out infinite;
  pointer-events: none;
}

.hotspot-dot.target-main::before {
  border-color: #5cd660 !important;
}

.hotspot-dot.target-back::before {
  border-color: #5a9ee8 !important;
}

.hotspot-dot.icon-info::before {
  border-color: var(--ui-success);
}

@keyframes hotspot-pulse {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }
  100% {
    transform: scale(2.8);
    opacity: 0;
  }
}

/* 3. Smooth tour transition (crossfade + blur) */
.home-overlay {
  transition: opacity 600ms ease, filter 600ms ease, visibility 600ms ease !important;
}

.home-overlay.is-transitioning-out {
  opacity: 0;
  filter: blur(8px);
  pointer-events: none;
}

.home-overlay.is-transitioning-in {
  opacity: 0;
  filter: blur(8px);
  pointer-events: none;
}

.viewer-container {
  transition: opacity 600ms ease !important;
}

/* 4. Enhanced splash */
.splash-title {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 600ms ease, transform 600ms ease;
}

.splash-screen.is-ready .splash-title {
  opacity: 1;
  transform: translateY(0);
}

.splash-logo {
  max-width: 120px;
  max-height: 120px;
  object-fit: contain;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 600ms ease, transform 600ms ease;
}

.splash-screen.is-ready .splash-logo {
  opacity: 1;
  transform: scale(1);
}

.splash-spinner {
  border-color: color-mix(in srgb, var(--color-text) 15%, transparent);
  border-top-color: var(--color-accent);
}

/* 5. Footer gradient line */
.home-footer {
  border-top: none !important;
  position: relative !important;
}

.home-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 15%;
  right: 15%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--ui-primary), transparent);
  opacity: 0.5;
}

.home-footer-contacts li {
  transition: color 200ms ease;
  cursor: default;
}

#footerContactPhone,
#footerContactEmail {
  cursor: pointer;
}

#footerContactPhone:hover,
#footerContactEmail:hover {
  color: var(--ui-primary) !important;
}

/* 6. Glassmorphism tour description */
.tour-description-card {
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

html[data-theme="light"] .tour-description-card {
  border: 1px solid rgba(142, 114, 78, 0.18) !important;
  box-shadow: 0 10px 28px rgba(74, 54, 31, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* 7. Back button with icon + glassmorphism */
.back-btn {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(10, 18, 31, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.14);
  transition: transform 200ms ease, background-color 200ms ease !important;
}

.back-btn:hover {
  transform: translateX(-4px);
  background: rgba(10, 18, 31, 0.86);
}

.back-btn .back-btn-arrow {
  display: inline-block;
  transition: transform 200ms ease;
  margin-right: 4px;
}

.back-btn:hover .back-btn-arrow {
  transform: translateX(-3px);
}

html[data-theme="light"] .back-btn {
  background: rgba(243, 233, 219, 0.82);
  border: 1px solid rgba(142, 114, 78, 0.24);
  color: #2e261f;
}

html[data-theme="light"] .back-btn:hover {
  background: rgba(236, 224, 207, 0.92);
}

/* 8. Modern carousel arrows */
#carouselPrev,
#carouselNext {
  all: unset;
  position: absolute !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 36px !important;
  height: 56px !important;
  border-radius: 8px !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05)) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  z-index: 10;
  transition: width 200ms ease, background 200ms ease, opacity 200ms ease !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: rgba(244, 249, 255, 0.85) !important;
}

#carouselPrev {
  left: 8px !important;
}

#carouselNext {
  right: 8px !important;
}

#carouselPrev:not(:disabled):hover,
#carouselNext:not(:disabled):hover {
  width: 40px !important;
  background: linear-gradient(180deg, var(--ui-primary), var(--ui-primary-active)) !important;
  color: #ffffff !important;
}

#carouselPrev:disabled,
#carouselNext:disabled {
  opacity: 0.15 !important;
  pointer-events: none !important;
}

html[data-theme="light"] #carouselPrev,
html[data-theme="light"] #carouselNext {
  background: linear-gradient(180deg, rgba(142, 114, 78, 0.2), rgba(142, 114, 78, 0.08)) !important;
  color: #2d2319 !important;
}

/* Reduced motion: disable all enhancements */
@media (prefers-reduced-motion: reduce) {
  .home-slanted-grid > .slanted-card {
    transition: none !important;
  }

  .hotspot-dot::before {
    animation: none !important;
    display: none !important;
  }

  .home-overlay {
    transition: opacity 200ms ease !important;
    filter: none !important;
  }

  .splash-title,
  .splash-logo {
    transition: none !important;
  }

  .back-btn,
  .back-btn .back-btn-arrow {
    transition: none !important;
  }

  #carouselPrev,
  #carouselNext {
    transition: none !important;
  }
}

/* Practical polish layer: calmer home, clearer tour context, denser admin feedback */
.hero-title {
  letter-spacing: 0 !important;
}

html[data-theme] .home-hero-strip {
  min-height: 0 !important;
  padding-block: clamp(18px, 3vh, 28px) !important;
  border-bottom: 1px solid var(--home-surface-border) !important;
}

html[data-theme] .home-hero-strip .hero-title {
  max-width: 980px;
  font-size: clamp(32px, 4.4vw, 68px) !important;
  line-height: 1.04 !important;
}

html[data-theme] .home-hero-strip .hero-subtitle {
  max-width: 760px;
}

.tour-context-bar {
  position: fixed;
  z-index: 32;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: min(760px, calc(100vw - 190px));
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid rgba(242, 247, 255, 0.26);
  border-radius: 8px;
  background: rgba(10, 18, 31, 0.72);
  color: #f5f9ff;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

.tour-context-category,
.tour-context-links {
  min-width: 0;
  color: rgba(232, 242, 252, 0.72);
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
}

.tour-context-panorama {
  min-width: 0;
  max-width: 34ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  line-height: 1.2;
}

.tour-context-separator {
  color: rgba(232, 242, 252, 0.38);
}

.tour-context-links {
  padding-left: 8px;
  border-left: 1px solid rgba(232, 242, 252, 0.2);
}

html[data-theme="light"] .tour-context-bar {
  background: rgba(243, 233, 219, 0.92);
  color: #2e261f;
  border-color: rgba(142, 114, 78, 0.34);
  box-shadow: 0 10px 28px rgba(74, 54, 31, 0.16);
}

html[data-theme="light"] .tour-context-category,
html[data-theme="light"] .tour-context-links {
  color: rgba(46, 38, 31, 0.66);
}

.save-status {
  min-width: 150px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.save-status[data-status="pending"] {
  color: var(--color-warning);
}

.save-status[data-status="saving"] {
  color: var(--color-link);
}

.save-status[data-status="saved"] {
  color: var(--color-success);
}

.save-status[data-status="error"] {
  color: var(--color-danger);
}

@media (max-width: 760px) {
  html[data-theme] .home-hero-strip {
    padding: 18px 16px 14px !important;
  }

  html[data-theme] .home-hero-strip .hero-title {
    font-size: clamp(26px, 8vw, 40px) !important;
  }

  .tour-context-bar {
    top: 64px;
    left: 10px;
    right: 10px;
    transform: none;
    max-width: none;
    min-height: 0;
    flex-wrap: wrap;
    gap: 5px 8px;
  }

  .tour-context-panorama {
    max-width: calc(100vw - 34px);
    flex-basis: 100%;
    order: 3;
  }

  .tour-context-links {
    margin-left: auto;
  }

  .admin-topbar {
    align-items: flex-start !important;
  }

  .save-status {
    order: 3;
    width: 100%;
  }
}
