/* ============================================================================
 *  SCANIA 8×4 · LEGO 3D 模型馆 — viewer design
 *  ---------------------------------------------------------------------------
 *  Dark museum studio.  Thin hairlines, soft glass, orange accent #F57C1F,
 *  system font stack, large negative space.  The truck is the hero.
 * ==========================================================================*/

:root {
  --bg: #0a0c0e;
  --accent: #f57c1f;
  --accent-soft: rgba(245, 124, 31, 0.14);
  --text: #eef1f3;
  --muted: rgba(238, 241, 243, 0.56);
  --faint: rgba(238, 241, 243, 0.32);
  --hair: rgba(255, 255, 255, 0.09);
  --hair-strong: rgba(255, 255, 255, 0.16);
  --glass: rgba(13, 16, 19, 0.52);
  --glass-strong: rgba(10, 12, 14, 0.72);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.16, 0.84, 0.32, 1);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

#app { position: fixed; inset: 0; }

#scene {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
  outline: none;
}
#scene:active { cursor: grabbing; }

/* ------------------------------------------------------------------ ui root */
#ui-root {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

.ui-layer {
  position: absolute;
  inset: 0;
}

.ui-layer button,
.ui-layer input,
.ui-layer a {
  pointer-events: auto;
  font-family: var(--font);
}

/* ------------------------------------------------------------ atmosphere layers */
.stage-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(115% 88% at 50% 42%, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.18) 66%, rgba(0, 0, 0, 0.56) 100%),
    radial-gradient(60% 42% at 50% 44%, rgba(255, 236, 214, 0.045) 0%, rgba(255, 236, 214, 0) 70%);
}

.stage-shade {
  position: absolute;
  left: 0;
  right: 0;
  pointer-events: none;
}
.stage-shade-top {
  top: 0;
  height: 30vh;
  background: linear-gradient(to bottom, rgba(4, 5, 6, 0.52), rgba(4, 5, 6, 0));
}
.stage-shade-bottom {
  bottom: 0;
  height: 38vh;
  background: linear-gradient(to top, rgba(4, 5, 6, 0.62), rgba(4, 5, 6, 0) 78%);
}

/* ---------------------------------------------------------------------- brand */
.brand {
  position: absolute;
  left: clamp(18px, 2.8vw, 42px);
  top: clamp(16px, 3.2vh, 32px);
  max-width: 320px;
  z-index: 25;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: 0.08s;
  pointer-events: auto;
}

.brand-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.kicker-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(245, 124, 31, 0.9), 0 0 22px rgba(245, 124, 31, 0.45);
}

.car-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.brand-title {
  margin: 0;
  font-size: clamp(20px, 2.2vw, 28px);
  font-weight: 640;
  line-height: 1.1;
  letter-spacing: 0.04em;
  color: #f5f7f8;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.5);
}
.brand-title span {
  font-weight: 300;
  letter-spacing: 0.04em;
  color: rgba(238, 241, 243, 0.52);
}

.showroom-toggle-btn {
  appearance: none;
  border: 1px solid var(--hair-strong);
  background: var(--glass);
  color: var(--text);
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 12px;
  cursor: pointer;
  margin-top: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  backdrop-filter: blur(12px);
  transition: all 0.2s var(--ease);
  white-space: nowrap;
}
.showroom-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--accent);
  color: #fff;
}
.arrow-dn {
  font-size: 9px;
  opacity: 0.6;
}

.brand-sub {
  margin: 6px 0 0;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--muted);
  line-height: 1.4;
  max-width: 280px;
  white-space: normal;
}

.brand-rule {
  margin-top: 10px;
  width: 36px;
  height: 1px;
  background: linear-gradient(90deg, var(--accent) 0%, rgba(245, 124, 31, 0.05) 100%);
}

/* ---------------------------------------------------------------- view toolbar */
.views {
  position: absolute;
  top: clamp(18px, 4vh, 40px);
  right: clamp(18px, 3.4vw, 50px);
  display: flex;
  align-items: stretch;
  gap: 2px;
  padding: 5px;
  border-radius: 14px;
  background: var(--glass);
  border: 1px solid var(--hair);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  backdrop-filter: blur(20px) saturate(150%);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: 0.2s;
}

.view-btn {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  line-height: 1;
  padding: 10px 11px 10px 9px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  white-space: nowrap;
  transition: color 0.22s ease, background 0.22s ease, border-color 0.22s ease;
}
.view-btn .k {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0;
  color: rgba(238, 241, 243, 0.26);
  transform: translateY(-2px);
  transition: color 0.22s ease;
}
.view-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
}
.view-btn.is-active {
  color: #fff;
  background: var(--accent-soft);
  border-color: rgba(245, 124, 31, 0.32);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.view-btn.is-active .k { color: var(--accent); }
.view-btn:focus-visible { outline: 1px solid var(--accent); outline-offset: 1px; }

/* ---------------------------------------------------------------------- stats */
.stats {
  position: absolute;
  left: clamp(20px, 3.6vw, 54px);
  bottom: clamp(22px, 3.6vh, 40px);
  display: flex;
  align-items: flex-end;
  gap: 20px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: 0.34s;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.stat + .stat {
  padding-left: 20px;
  border-left: 1px solid var(--hair);
}
.stat .v {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: rgba(238, 241, 243, 0.88);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.stat .l {
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.26em;
  color: var(--faint);
  text-transform: uppercase;
  white-space: nowrap;
}

/* ------------------------------------------------------------------------ dock */
.dock {
  position: absolute;
  left: 50%;
  bottom: clamp(18px, 3.2vh, 34px);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  border-radius: 18px;
  background: var(--glass);
  border: 1px solid var(--hair);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.055);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  backdrop-filter: blur(22px) saturate(160%);
  opacity: 0;
  transition: opacity 0.9s var(--ease);
  transition-delay: 0.42s;
  white-space: nowrap;
}

.dock-main {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dock-sep {
  width: 1px;
  height: 22px;
  background: var(--hair);
  flex: none;
}

.icon-btn {
  width: 36px;
  height: 36px;
  flex: none;
  display: grid;
  place-items: center;
  appearance: none;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.22s ease, background 0.22s ease, border-color 0.22s ease;
}
.icon-btn svg { width: 17px; height: 17px; display: block; }
.icon-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}
.icon-btn.is-on {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: rgba(245, 124, 31, 0.3);
}
.icon-btn:focus-visible { outline: 1px solid var(--accent); outline-offset: 1px; }

.explode {
  display: flex;
  align-items: center;
  gap: 10px;
}

.explode-btn {
  appearance: none;
  border: 1px solid var(--hair);
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  padding: 7px 10px;
  border-radius: 9px;
  cursor: pointer;
  transition: color 0.22s ease, background 0.22s ease, border-color 0.22s ease;
}
.explode-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.explode-btn.is-on {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: rgba(245, 124, 31, 0.32);
}

.explode-val {
  width: 34px;
  font-family: var(--mono);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  color: var(--faint);
  text-align: right;
}

.range {
  -webkit-appearance: none;
  appearance: none;
  width: 118px;
  height: 22px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
}
.range::-webkit-slider-runnable-track {
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg,
    rgba(245, 124, 31, 0.92) 0,
    rgba(245, 124, 31, 0.92) var(--p, 0%),
    rgba(255, 255, 255, 0.14) var(--p, 0%),
    rgba(255, 255, 255, 0.14) 100%);
}
.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  margin-top: -5px;
  border-radius: 50%;
  background: #f5f7f8;
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 4px rgba(245, 124, 31, 0.14), 0 2px 8px rgba(0, 0, 0, 0.5);
  transition: box-shadow 0.2s ease;
}
.range:hover::-webkit-slider-thumb {
  box-shadow: 0 0 0 6px rgba(245, 124, 31, 0.18), 0 2px 10px rgba(0, 0, 0, 0.55);
}
.range::-moz-range-track {
  height: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.14);
}
.range::-moz-range-progress {
  height: 2px;
  background: rgba(245, 124, 31, 0.92);
}
.range::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f5f7f8;
  border: 2px solid var(--accent);
}

.dock-themes {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 14px;
  border-left: 1px solid var(--hair);
}

.theme-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--faint);
}

.themes {
  display: flex;
  align-items: center;
  gap: 7px;
}

.swatch {
  appearance: none;
  position: relative;
  width: 21px;
  height: 21px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: var(--sw, #fff);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.24), inset 0 -2px 4px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s ease;
}
.swatch span {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
}
.swatch:hover { transform: scale(1.14); }
.swatch.is-active {
  box-shadow:
    0 0 0 2px #0d1012,
    0 0 0 3px var(--accent),
    0 0 14px rgba(245, 124, 31, 0.4),
    inset 0 1px 2px rgba(255, 255, 255, 0.24);
}
.swatch::after {
  content: attr(data-label);
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(3px);
  padding: 5px 8px;
  border-radius: 7px;
  background: rgba(10, 12, 14, 0.9);
  border: 1px solid var(--hair);
  color: var(--text);
  font-size: 9px;
  letter-spacing: 0.14em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.swatch:hover::after { opacity: 1; transform: translateX(-50%) translateY(0); }

.theme-name {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: rgba(238, 241, 243, 0.66);
  min-width: 42px;
}

/* ----------------------------------------------------------------------- hints */
.hints {
  position: absolute;
  right: clamp(18px, 3.4vw, 50px);
  bottom: clamp(22px, 3.6vh, 40px);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--faint);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: 0.5s;
  white-space: nowrap;
}
.hint-sep {
  width: 18px;
  height: 1px;
  background: var(--hair-strong);
}

/* -------------------------------------------------------------------- tooltip */
.tooltip {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 40;
  min-width: 170px;
  max-width: 260px;
  padding: 11px 13px;
  border-radius: 12px;
  background: var(--glass-strong);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.14s ease;
  will-change: transform;
}
.tooltip.is-visible { opacity: 1; }
.tooltip[hidden] { display: none; }

.tt-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text);
}
.tt-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 6px;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.tt-dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.28);
}
.tt-dim {
  margin-top: 5px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.02em;
  color: rgba(238, 241, 243, 0.42);
}
.tt-hint {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--hair);
  font-size: 9px;
  letter-spacing: 0.14em;
  color: rgba(238, 241, 243, 0.34);
}
.tooltip.is-pinned .tt-hint { color: var(--accent); }
.tooltip.is-pinned { border-color: rgba(245, 124, 31, 0.35); }

/* ---------------------------------------------------------------------- toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 108px;
  transform: translateX(-50%);
  z-index: 45;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--glass-strong);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: rgba(238, 241, 243, 0.85);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.toast.is-visible { opacity: 1; }
.toast[hidden] { display: none; }

/* ---------------------------------------------------------------- photo drawer */
.photo-panel {
  position: fixed;
  top: 50%;
  right: 24px;
  width: 340px;
  transform: translateY(-50%) translateX(14px);
  z-index: 35;
  padding: 16px;
  border-radius: 18px;
  background: var(--glass);
  border: 1px solid var(--hair);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  -webkit-backdrop-filter: blur(26px) saturate(160%);
  backdrop-filter: blur(26px) saturate(160%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.38s var(--ease), transform 0.38s var(--ease);
}
.photo-panel.is-open {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
  pointer-events: auto;
}

.photo-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 2px 14px;
}
.photo-kicker {
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
}
.photo-title {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.photo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  max-height: min(56vh, 460px);
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}
.photo-item {
  margin: 0;
  position: relative;
  border-radius: 9px;
  overflow: hidden;
  background: #111417;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.photo-item img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  filter: saturate(0.92) contrast(0.96) brightness(0.94);
  transition: transform 0.5s var(--ease), filter 0.3s ease;
}
.photo-item:hover img {
  transform: scale(1.045);
  filter: saturate(1) contrast(1) brightness(1);
}
.photo-item figcaption {
  position: absolute;
  left: 8px;
  bottom: 7px;
  padding: 3px 6px;
  border-radius: 5px;
  background: rgba(8, 10, 12, 0.66);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  font-size: 8px;
  letter-spacing: 0.16em;
  color: rgba(238, 241, 243, 0.82);
}

/* --------------------------------------------------------------- intro reveal */
body.viewer-ready .brand,
body.viewer-ready .views,
body.viewer-ready .stats,
body.viewer-ready .dock,
body.viewer-ready .hints {
  opacity: 1;
}
body.viewer-ready .brand,
body.viewer-ready .views,
body.viewer-ready .stats,
body.viewer-ready .hints {
  transform: translateY(0);
}

/* hide chrome for clean shots */
body.ui-hidden .brand,
body.ui-hidden .views,
body.ui-hidden .stats,
body.ui-hidden .dock,
body.ui-hidden .hints,
body.ui-hidden .photo-panel,
body.ui-hidden .tooltip,
body.ui-hidden .toast,
body.ui-hidden .stage-shade {
  display: none !important;
}

/* ============================================================================
 *  Loading overlay (markup lives in index.html)
 * ==========================================================================*/
#loading {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background:
    radial-gradient(70% 60% at 50% 42%, #12161b 0%, #0a0c0f 54%, #060708 100%);
  transition: opacity 0.95s var(--ease), visibility 0.95s var(--ease);
}
#loading.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-card {
  text-align: center;
  transform: translateY(-6px);
}

.loading-logo {
  display: grid;
  grid-template-columns: repeat(3, 15px);
  gap: 6px;
  justify-content: center;
  margin-bottom: 30px;
}
.brick-stud {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: radial-gradient(circle at 34% 28%,
    rgba(255, 255, 255, 0.26) 0%,
    rgba(255, 255, 255, 0.07) 55%,
    rgba(255, 255, 255, 0.02) 100%);
  animation: studPulse 1.7s ease-in-out infinite;
}
.brick-stud:nth-child(2) { animation-delay: 0.08s; }
.brick-stud:nth-child(3) { animation-delay: 0.16s; }
.brick-stud:nth-child(4) { animation-delay: 0.24s; }
.brick-stud:nth-child(5) { animation-delay: 0.32s; }
.brick-stud:nth-child(6) { animation-delay: 0.4s; }

@keyframes studPulse {
  0%, 100% { opacity: 0.32; transform: translateY(0); }
  45% { opacity: 1; transform: translateY(-2px); border-color: rgba(245, 124, 31, 0.6); }
}

.loading-title {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.48em;
  margin-left: 0.48em;
  color: #f0f3f5;
}
.loading-sub {
  margin-top: 16px;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.34em;
  color: rgba(238, 241, 243, 0.4);
  animation: subFade 2.4s ease-in-out infinite;
}
@keyframes subFade {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

/* ============================================================================
 *  Error overlay (wired to window.__dshShowError in index.html)
 * ==========================================================================*/
#error-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-start;
  padding: 56px clamp(24px, 5vw, 80px);
  background: rgba(8, 4, 3, 0.94);
  color: #ffb9a6;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow: auto;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
#error-overlay[hidden] { display: none; }

/* ============================================================================
 *  Responsive
 * ==========================================================================*/
@media (max-width: 1240px) {
  .hints { display: none; }
  .range { width: 96px; }
  .theme-name { display: none; }
  .view-btn { padding: 10px 9px 10px 8px; letter-spacing: 0.1em; }
}

@media (max-width: 1020px) {
  .brand-title { font-size: 34px; }
  .stats { gap: 14px; }
  .stat + .stat { padding-left: 14px; }
  .dock { gap: 10px; padding: 9px 12px; }
  .view-btn { font-size: 10px; padding: 9px 7px; }
  .view-btn .k { display: none; }
}

@media (max-width: 860px) {
  .brand { left: 16px; top: 14px; }
  .brand-kicker { font-size: 8px; letter-spacing: 0.24em; gap: 8px; }
  .brand-title { margin-top: 9px; font-size: 24px; letter-spacing: 0.06em; }
  .brand-sub, .brand-rule { display: none; }

  /* compact one-line spec strip under the brand */
  .stats {
    left: 16px;
    top: 70px;
    bottom: auto;
    gap: 0;
    align-items: center;
  }
  .stat { flex-direction: row; align-items: baseline; gap: 5px; }
  .stat + .stat {
    padding-left: 10px;
    margin-left: 10px;
    border-left: 1px solid var(--hair);
  }
  .stat .v { font-size: 9px; letter-spacing: 0.04em; }
  .stat .l { font-size: 7px; letter-spacing: 0.14em; }

  .views {
    top: auto;
    left: 10px;
    right: 10px;
    bottom: 118px;
    padding: 4px;
    border-radius: 12px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2px;
    overflow: hidden;
  }
  .view-btn {
    flex: none;
    justify-content: center;
    min-width: 0;
    padding: 10px 2px;
    font-size: 10px;
    letter-spacing: 0.06em;
    overflow: hidden;
  }
  .view-btn .k { display: none; }

  .dock {
    left: 8px;
    right: 8px;
    bottom: 8px;
    transform: none;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 16px;
    white-space: normal;
  }
  .dock-main {
    display: flex;
    align-items: center;
    gap: 7px;
    width: 100%;
    min-width: 0;
  }
  .dock-sep { display: none; }
  .explode { flex: 1; gap: 7px; min-width: 0; }
  .range { flex: 1; width: auto; min-width: 44px; }
  .explode-val { width: 28px; font-size: 9px; }
  .explode-btn { padding: 6px 7px; letter-spacing: 0.1em; font-size: 9px; }
  .icon-btn { width: 32px; height: 32px; }
  .icon-btn svg { width: 15px; height: 15px; }

  .dock-themes {
    width: 100%;
    justify-content: center;
    gap: 8px;
    padding-left: 0;
    padding-top: 7px;
    border-left: 0;
    border-top: 1px solid var(--hair);
  }
  .swatch { width: 20px; height: 20px; }
  .theme-label { font-size: 9px; letter-spacing: 0.16em; }
  .theme-name { display: inline; font-size: 9px; min-width: 34px; }

  .hints { display: none; }
  .toast { bottom: 170px; }

  .photo-panel {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: auto;
    max-height: 78vh;
    border-radius: 20px 20px 0 0;
    transform: translateY(16px);
  }
  .photo-panel.is-open { transform: translateY(0); }
  .photo-grid { max-height: 52vh; }
}

@media (max-width: 430px) {
  .brand-title { font-size: 25px; }
  .stat .l { letter-spacing: 0.16em; }
  .view-btn { padding: 11px 8px; letter-spacing: 0.06em; }
}

/* ============================================================================
 *  V2.0 Showroom, Photo Builder & RC Driving HUD Additions
 * ==========================================================================*/
[hidden] {
  display: none !important;
}

.is-hidden {
  display: none !important;
}

/* Top Central Mode Bar */
.top-mode-bar {
  position: absolute;
  top: clamp(18px, 4vh, 40px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  background: var(--glass);
  border: 1px solid var(--hair);
  border-radius: 30px;
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  z-index: 20;
  pointer-events: auto;
}

.mode-pill {
  appearance: none;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.25s var(--ease);
}
.mode-pill:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}
.mode-pill.is-active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}
.mode-pill.special-pill {
  background: linear-gradient(135deg, rgba(245, 124, 31, 0.22), rgba(245, 124, 31, 0.08));
  border-color: rgba(245, 124, 31, 0.35);
  color: #ffb066;
}
.mode-pill.special-pill:hover {
  background: linear-gradient(135deg, rgba(245, 124, 31, 0.35), rgba(245, 124, 31, 0.16));
  color: #fff;
  box-shadow: 0 0 16px rgba(245, 124, 31, 0.3);
}

/* Header Car Switcher */
.car-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.showroom-toggle-btn {
  appearance: none;
  border: 1px solid var(--hair-strong);
  background: var(--glass);
  color: var(--text);
  font-size: 11px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 14px;
  cursor: pointer;
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  backdrop-filter: blur(12px);
  transition: all 0.2s var(--ease);
}
.showroom-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent);
  color: #fff;
}
.arrow-dn {
  font-size: 9px;
  opacity: 0.6;
}

/* RC Driving Cockpit HUD */
.drive-hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 15;
}
.hud-top-card {
  position: absolute;
  top: clamp(18px, 4vh, 40px);
  left: clamp(18px, 3.4vw, 50px);
  padding: 16px 20px;
  border-radius: 18px;
  background: var(--glass-strong);
  border: 1px solid rgba(245, 124, 31, 0.35);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  min-width: 200px;
  pointer-events: auto;
}
.hud-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--muted);
  text-transform: uppercase;
}
.hud-speed-gauge {
  margin-top: 8px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.hud-speed-val {
  font-size: 44px;
  font-weight: 700;
  font-family: var(--mono);
  color: #fff;
  line-height: 1;
}
.hud-speed-unit {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--accent);
}
.hud-gear-row {
  margin-top: 10px;
  display: flex;
  gap: 6px;
}
.gear-tag {
  flex: 1;
  text-align: center;
  padding: 3px 0;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--faint);
  background: rgba(255, 255, 255, 0.04);
}
.gear-tag.is-on {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(245, 124, 31, 0.6);
}
.hud-rpm-bar {
  margin-top: 10px;
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
}
.hud-rpm-fill {
  height: 100%;
  background: linear-gradient(90deg, #44cc44, #ffbb00, #ff3322);
  transition: width 0.08s linear;
}

.hud-actions {
  position: absolute;
  bottom: 90px;
  right: clamp(18px, 3.4vw, 50px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: auto;
}
.hud-btn {
  appearance: none;
  border: 1px solid var(--hair-strong);
  background: var(--glass);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  padding: 10px 16px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  backdrop-filter: blur(14px);
  transition: all 0.2s;
}
.hud-btn svg { width: 16px; height: 16px; }
.hud-btn:hover { background: rgba(255, 255, 255, 0.14); border-color: #fff; }
.hud-btn.is-exit { border-color: rgba(255, 80, 80, 0.4); color: #ff8888; }
.hud-btn.is-exit:hover { background: rgba(255, 80, 80, 0.2); color: #fff; }

.drive-touch-pad {
  position: absolute;
  bottom: 85px;
  left: clamp(18px, 3.4vw, 50px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: auto;
}
.pad-row { display: flex; justify-content: center; gap: 8px; }
.pad-steer-row { gap: 8px; }
.pad-btn {
  appearance: none;
  border: 1px solid var(--hair-strong);
  background: var(--glass-strong);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 14px 18px;
  border-radius: 12px;
  cursor: pointer;
  touch-action: none;
  backdrop-filter: blur(12px);
  user-select: none;
  transition: all 0.15s;
}
.pad-btn:hover, .pad-btn.is-down {
  background: rgba(245, 124, 31, 0.35);
  border-color: var(--accent);
  transform: scale(0.96);
}
.drive-hints {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
  background: var(--glass);
  padding: 8px 18px;
  border-radius: 20px;
  border: 1px solid var(--hair);
  backdrop-filter: blur(10px);
}
.hint-orbit {
  color: #38bdf8;
  font-weight: 600;
  text-shadow: 0 0 10px rgba(56, 189, 248, 0.45);
}

/* Floating Stockholm Street Notification Banner */
.street-banner {
  position: absolute;
  top: clamp(68px, 10vh, 88px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 22px;
  background: rgba(14, 22, 32, 0.85);
  border: 1px solid rgba(0, 180, 255, 0.35);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.55), 0 0 24px rgba(0, 180, 255, 0.18);
  border-radius: 30px;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  z-index: 20;
  pointer-events: none;
  animation: bannerSlideDown 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes bannerSlideDown {
  from { opacity: 0; transform: translate(-50%, -14px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
.street-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  padding: 3px 8px;
  border-radius: 6px;
  background: #005293;
  color: #fecb00;
  border: 1px solid rgba(254, 203, 0, 0.4);
}
.street-content {
  display: flex;
  flex-direction: column;
}
.street-name {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.04em;
}
.street-desc {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 1px;
}

/* Stockholm GPS Radar Minimap */
.stockholm-gps {
  position: absolute;
  top: clamp(18px, 4vh, 40px);
  right: clamp(18px, 3.4vw, 50px);
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(11, 18, 26, 0.88);
  border: 1px solid rgba(56, 189, 248, 0.38);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  pointer-events: auto;
  z-index: 18;
}
.gps-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #38bdf8;
}
.gps-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #00f0ff;
  box-shadow: 0 0 8px #00f0ff;
  display: inline-block;
  animation: pulseDot 1.4s infinite;
}
@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.65); }
}
.gps-title { flex: 1; }
.gps-coords {
  font-family: var(--mono);
  font-size: 9px;
  color: #94a3b8;
}
.gps-map-wrap {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.gps-canvas {
  display: block;
  width: 180px;
  height: 140px;
}
.gps-landmarks {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  gap: 4px;
}
.gps-badge {
  font-size: 9px;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 5px;
  border-radius: 4px;
}

/* Modals (Showroom & Builder) */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 9, 0.76);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  pointer-events: auto;
  animation: fadeIn 0.25s var(--ease);
}
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

.modal-card {
  background: #111418;
  border: 1px solid var(--hair-strong);
  border-radius: 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
  width: 100%;
  max-width: 820px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}
.modal-head {
  padding: 24px 28px;
  border-bottom: 1px solid var(--hair);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-kicker {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.24em;
  color: var(--accent);
  text-transform: uppercase;
}
.modal-title {
  margin: 6px 0 0;
  font-size: 20px;
  font-weight: 600;
  color: #fff;
}
.modal-foot {
  padding: 18px 28px;
  border-top: 1px solid var(--hair);
  display: flex;
  justify-content: flex-end;
  background: rgba(0, 0, 0, 0.2);
}

/* Showroom Grid */
.showroom-grid {
  padding: 24px 28px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  overflow-y: auto;
}
.showroom-card-item {
  border: 1px solid var(--hair);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 16px;
  padding: 18px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: all 0.2s var(--ease);
}
.showroom-card-item:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-2px);
}
.showroom-card-item.is-active {
  border-color: var(--accent);
  background: rgba(245, 124, 31, 0.08);
  box-shadow: 0 0 20px rgba(245, 124, 31, 0.25);
}
.card-badge {
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 6px;
}
.card-name {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 8px;
}
.card-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
  flex: 1;
  margin-bottom: 14px;
}
.card-btn {
  appearance: none;
  border: 1px solid var(--hair-strong);
  background: transparent;
  color: var(--text);
  font-size: 11px;
  font-weight: 500;
  padding: 8px 0;
  border-radius: 8px;
  cursor: pointer;
  width: 100%;
}
.showroom-card-item.is-active .card-btn {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Builder Modal Layout */
.builder-body {
  padding: 24px 28px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  overflow-y: auto;
}
.upload-dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.2s;
  position: relative;
}
.upload-dropzone:hover, .upload-dropzone.is-hover {
  border-color: var(--accent);
  background: rgba(245, 124, 31, 0.06);
}
.file-input { display: none; }
.drop-icon svg { width: 34px; height: 34px; color: var(--accent); }
.drop-title { font-size: 14px; font-weight: 600; color: #fff; margin-top: 10px; }
.drop-sub { font-size: 11px; color: var(--muted); margin-top: 4px; }

.sample-pack-wrap {
  margin-top: 16px;
}
.sample-label {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 8px;
}
.sample-chips {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sample-chip {
  appearance: none;
  border: 1px solid var(--hair);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 12px;
  text-align: left;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.18s;
}
.sample-chip:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: var(--hair-strong);
  color: #fff;
}

.preview-strip {
  margin-top: 16px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
}
.preview-empty {
  font-size: 11px;
  color: var(--faint);
  padding: 8px 0;
}
.thumb-wrap {
  position: relative;
  width: 72px;
  height: 54px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--hair);
  flex-shrink: 0;
}
.thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.thumb-tag {
  position: absolute;
  bottom: 2px;
  right: 2px;
  font-size: 8px;
  background: rgba(0, 0, 0, 0.7);
  padding: 1px 4px;
  border-radius: 4px;
  color: #fff;
}

/* Builder Right Side */
.builder-right {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.analysis-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--hair);
  border-radius: 16px;
  padding: 18px;
}
.analysis-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 14px;
}
.form-row {
  margin-bottom: 12px;
}
.form-row label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px;
}
.form-select, .form-input {
  width: 100%;
  background: #090b0d;
  border: 1px solid var(--hair-strong);
  color: #fff;
  font-size: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  outline: none;
}
.form-select:focus, .form-input:focus {
  border-color: var(--accent);
}
.color-picker-row {
  display: flex;
  gap: 8px;
}
.form-color-swatch {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s;
}
.form-color-swatch.is-active {
  border-color: #fff;
  transform: scale(1.15);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
}
.analysis-status {
  margin-top: 14px;
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #666;
}
.status-dot.ready { background: #44cc44; box-shadow: 0 0 8px #44cc44; }
.status-dot.spin { background: var(--accent); animation: pulse 0.8s infinite; }
@keyframes pulse { 0% { opacity: 0.3; } 50% { opacity: 1; } 100% { opacity: 0.3; } }

.primary-btn {
  appearance: none;
  background: linear-gradient(135deg, #f57c1f 0%, #d95e09 100%);
  color: #fff;
  border: 0;
  font-size: 13px;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(245, 124, 31, 0.4);
  transition: all 0.2s;
}
.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(245, 124, 31, 0.55);
}
.build-btn {
  width: 100%;
  margin-top: 18px;
  padding: 14px 0;
  font-size: 14px;
}

/* Assembly Progress Overlay */
.build-progress-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 12, 14, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  backdrop-filter: blur(10px);
}
.progress-box {
  width: 320px;
  text-align: center;
}
.progress-studs {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}
.progress-title {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 16px;
}
.progress-bar-wrap {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.35s ease-out;
}

@media (max-width: 768px) {
  .top-mode-bar {
    top: auto;
    bottom: 80px;
    padding: 3px;
  }
  .mode-pill {
    padding: 6px 10px;
    font-size: 11px;
  }
  .builder-body {
    grid-template-columns: 1fr;
  }
  .hud-top-card {
    top: 10px;
    left: 10px;
    right: auto;
    padding: 10px 14px;
    min-width: 130px;
  }
  .stockholm-gps {
    top: 10px;
    right: 10px;
    transform: scale(0.82);
    transform-origin: top right;
  }
  .street-banner {
    top: 60px;
    padding: 6px 14px;
  }
  .hud-speed-val { font-size: 32px; }
  .hud-actions { bottom: 120px; right: 14px; }
  .drive-touch-pad { bottom: 120px; left: 14px; }
  .drive-hints { display: none; }
}
