@import url('https://fonts.googleapis.com/css2?family=Exo+2:wght@400;500;600;700&family=Raleway:wght@400;500;600;700&display=swap');

*, *::before, *::after {
  box-sizing: border-box;
}

:root {
  --cream:      #F5EFE4;
  --espresso:   #18140E;
  --warm-grey:  #C8C2B8;
}

body {
  background: var(--cream);
  color: var(--espresso);
  font-family: 'Raleway', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  margin: 0;
  overflow: hidden;
}

/* ───────────────────────────── LANDING VIEW ───────────────────────────── */

/* Scroll container — same height as viewport, scrolls internally like catalog */
#landing-view {
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--cream);
}

/* ── Landing nav ── */

#landing-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 64px;
  background: rgba(245, 239, 228, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 0.5px solid rgba(24, 20, 14, 0.06);
  flex-shrink: 0;
}

#landing-nav-inner {
  padding: 0 clamp(40px, 10vw, 160px);
  height: 100%;
  display: flex;
  align-items: center;
  gap: 32px;
}

#landing-nav-logo {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  transition: opacity 0.15s;
}

#landing-nav-logo:hover { opacity: 0.55; }

.landing-nav-logo-img {
  height: 34px;
  width: auto;
  display: block;
}

#landing-nav-links {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 4px;
  flex: 1;
}

.landing-nav-link {
  background: none;
  border: none;
  padding: 8px 14px;
  font-family: 'Raleway', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: rgba(24, 20, 14, 0.5);
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
}

.landing-nav-link:hover {
  background: rgba(24, 20, 14, 0.05);
  color: var(--espresso);
}

.landing-nav-cta {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--espresso);
  text-decoration: none;
  letter-spacing: 0.01em;
  opacity: 0.55;
  transition: opacity 0.15s;
}

.landing-nav-cta:hover { opacity: 1; }

/* Hero — fills remaining viewport below nav */
#scene-hero-explode {
  height: 250vh;
  position: relative;
}

#landing-hero {
  height: calc(100vh - 64px);
  position: sticky;
  top: 64px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 0 clamp(40px, 10vw, 160px);
  overflow: hidden;
}

/* Background 3D canvas — desktop only */
#hero-explode-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

/* Mobile hero video — hidden on desktop */
#hero-video {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

/* Mobile: 3D canvas shown, video hidden */
@media (max-width: 768px) {
  #hero-video { display: none; }
}

/* Gradient overlay — opaque cream on left to let text read, fades right to reveal 3D */
#landing-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(245, 239, 228, 0.97) 0%,
    rgba(245, 239, 228, 0.90) 30%,
    rgba(245, 239, 228, 0.50) 60%,
    rgba(245, 239, 228, 0.10) 100%
  );
  z-index: 1;
}

/* Hero loading bar — full-width at bottom of hero */
#hero-loader {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 3;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
#hero-loader.hidden { opacity: 0; }
#hero-loader-bar {
  width: 100%;
  height: 3px;
  background: rgba(24, 20, 14, 0.10);
}
#hero-loader-fill {
  height: 100%;
  width: 0%;
  background: var(--espresso);
  transition: width 0.3s ease;
}

/* Vertical scrub — right edge of hero */
#hero-scrub {
  position: absolute;
  right: clamp(32px, 6vw, 80px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.7s ease 0.6s;
}
#hero-scrub.loaded { opacity: 1; }
#hero-scrub-track {
  width: 2px;
  height: 160px;
  background: rgba(24, 20, 14, 0.12);
  border-radius: 2px;
  position: relative;
  cursor: pointer;
}
#hero-scrub-thumb {
  width: 10px;
  height: 10px;
  background: var(--espresso);
  border-radius: 50%;
  position: absolute;
  left: 50%;
  top: 0%;
  transform: translate(-50%, -50%);
  cursor: grab;
  transition: box-shadow 0.2s;
}
#hero-scrub-thumb:hover {
  box-shadow: 0 0 0 5px rgba(24, 20, 14, 0.10);
}
#hero-scrub-thumb.dragging {
  cursor: grabbing;
  box-shadow: 0 0 0 7px rgba(24, 20, 14, 0.08);
}

/* Content sits above video + overlay */
#landing-inner {
  position: relative;
  z-index: 2;
}

@keyframes landing-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

#landing-inner {
  max-width: 560px;
  animation: landing-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

#landing-wordmark {
  margin-bottom: -10px;
}

.landing-wm-img {
  height: 160px;
  width: auto;
  display: block;
}

#landing-tagline {
  font-size: clamp(28px, 4vw, 52px);
  font-weight: 500;
  color: rgba(24, 20, 14, 0.55);
  margin: 0 0 14px;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

#landing-descriptor {
  font-family: 'Raleway', sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: rgba(24, 20, 14, 0.38);
  margin: 0 0 28px;
  text-transform: lowercase;
}

#landing-rule {
  width: 36px;
  height: 1.5px;
  background: var(--warm-grey);
  margin-bottom: 44px;
}

#landing-body {
  font-size: 16px;
  line-height: 1.75;
  color: rgba(24, 20, 14, 0.5);
  margin: 0 0 44px;
  max-width: 420px;
}

#landing-cta {
  background: var(--espresso);
  color: var(--cream);
  border: none;
  border-radius: 28px;
  padding: 14px 28px;
  font-family: 'Raleway', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: opacity 0.15s;
}

#landing-cta:hover {
  opacity: 0.82;
}

/* Two-CTA row ─ explore + something's broken */
#landing-cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

#landing-cta-diagnose {
  background: rgba(24, 20, 14, 0.55);
  color: var(--cream);
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  border-radius: 28px;
  padding: 13px 26px;
  font-family: 'Raleway', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: opacity 0.15s, background 0.15s;
}

#landing-cta-diagnose:hover {
  background: rgba(24, 20, 14, 0.7);
  opacity: 1;
}

@media (max-width: 600px) {
  #landing-cta-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

/* ── Mobile hero: one viewport tall, gradient flips to bottom-to-top,
      text pinned at the bottom, 3D model visible above ── */
@media (max-width: 768px) {
  /* No scroll-jacking dead space — hero is just one viewport */
  #scene-hero-explode {
    height: calc(100vh - 64px);
  }

  /* Text + CTAs sit at the bottom; model is visible above */
  #landing-hero {
    justify-content: flex-end;
    padding: 0 24px 40px;
  }

  /* Gradient flips: cream rises from the bottom, fades out above the text */
  #landing-hero::before {
    background: linear-gradient(
      to top,
      rgba(245, 239, 228, 0.97) 0%,
      rgba(245, 239, 228, 0.85) 28%,
      rgba(245, 239, 228, 0.22) 58%,
      rgba(245, 239, 228, 0.0) 100%
    );
  }

  /* Scrub handle not needed — model auto-animates on mobile */
  #hero-scrub { display: none; }
}

@media (max-width: 600px) {
  #landing-hero {
    padding: 0 24px 36px;
  }
  .landing-wm-img {
    height: 28px; /* tighter on small screens */
  }
  #landing-about,
  #landing-enterprise {
    padding: 60px 24px;
    min-height: 0; /* let content determine height on mobile */
  }
  #feature-symptoms {
    padding: 60px 24px;
    min-height: 0;
  }
  #landing-page-footer {
    padding: 28px 24px 36px;
  }
}

/* ───────────────────────────── LANDING SCROLL SECTIONS ────────────────── */

#landing-about {
  min-height: calc(100vh - 64px);
  padding: 80px clamp(40px, 10vw, 160px);
  display: flex;
  align-items: center;
  border-top: 0.5px solid rgba(24, 20, 14, 0.06);
  position: relative;
}

#about-inner {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

#about-text {
  max-width: 480px;
}

/* ── About visual ── */
.about-visual {
  display: none;
}

.about-visual.av-visible {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ── Book titles ── */
.av-book {
  font-size: clamp(22px, 2.8vw, 38px);
  font-weight: 700;
  font-style: italic;
  color: rgba(24, 20, 14, 0.12);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 20px;
  transition: color 0.2s;
}

.av-book:last-child { margin-bottom: 0; }

#about-v1:hover .av-book { color: rgba(24, 20, 14, 0.2); }


#landing-enterprise {
  min-height: calc(100vh - 64px);
  padding: 80px clamp(40px, 10vw, 160px);
  display: flex;
  align-items: center;
  background: #EAE3D5;
}

#landing-enterprise .enterprise-inner {
  width: 100%;
}

.landing-section-inner {
  max-width: 560px;
}

.landing-section-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: rgba(24, 20, 14, 0.35);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 20px;
}

.landing-section-headline {
  font-size: clamp(30px, 3.8vw, 52px);
  font-weight: 700;
  color: var(--espresso);
  letter-spacing: -0.028em;
  line-height: 1.12;
  margin: 0 0 28px;
}

.landing-section-text {
  font-size: 18px;
  line-height: 1.8;
  color: rgba(24, 20, 14, 0.55);
  margin: 0;
}

.landing-section-text em {
  font-style: italic;
  color: rgba(24, 20, 14, 0.75);
}

/* ── Enterprise layout ── */

.enterprise-inner {
  /* no max-width — fills the section's padded area so the use-case grid spans full width */
}

.enterprise-intro {
  max-width: 560px;
  margin-bottom: 60px;
  margin-left: auto;
  text-align: right;
}

.enterprise-use-cases {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
  margin-bottom: 56px;
}

.enterprise-use-case {
  border-top: 0.5px solid rgba(24, 20, 14, 0.12);
  padding: 24px 28px 24px 0;
}

.euc-number {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: rgba(24, 20, 14, 0.22);
  margin-bottom: 16px;
}

.euc-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--espresso);
  margin: 0 0 10px;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.euc-desc {
  font-size: 14px;
  line-height: 1.75;
  color: rgba(24, 20, 14, 0.48);
  margin: 0;
}

.enterprise-cta {
  display: block;
  width: fit-content;
  margin-left: auto;
  background: var(--espresso);
  color: var(--cream);
  border-radius: 28px;
  padding: 14px 28px;
  font-family: 'Raleway', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: opacity 0.15s;
}

.enterprise-cta:hover {
  opacity: 0.8;
}

@media (max-width: 860px) {
  .enterprise-use-cases {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .enterprise-use-case {
    padding: 20px 0;
  }
}

#landing-page-footer {
  padding: 52px clamp(40px, 10vw, 160px) 64px;
  border-top: 0.5px solid rgba(24, 20, 14, 0.08);
}

#footer-inner {
  width: 100%;
}

#footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 40px;
}

.footer-logo {
  height: 26px;
  width: auto;
  display: block;
  opacity: 0.4;
}

#footer-social {
  display: flex;
  align-items: center;
  gap: 20px;
}

.footer-social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(24, 20, 14, 0.28);
  text-decoration: none;
  transition: color 0.15s;
}

.footer-social-link:hover {
  color: var(--espresso);
}

.footer-social-link svg {
  width: 17px;
  height: 17px;
  display: block;
}

#footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

#footer-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
}

.footer-nav-link {
  font-size: 12px;
  font-weight: 500;
  color: rgba(24, 20, 14, 0.38);
  text-decoration: none;
  background: none;
  border: none;
  font-family: 'Raleway', sans-serif;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 6px;
  letter-spacing: 0.01em;
  transition: color 0.15s, background 0.15s;
}

.footer-nav-link:hover {
  color: var(--espresso);
  background: rgba(24, 20, 14, 0.05);
}

#footer-copy {
  font-size: 12px;
  color: rgba(24, 20, 14, 0.2);
}

@media (max-width: 600px) {
  #landing-page-footer {
    padding: 40px 24px 52px;
  }
  #footer-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 32px;
  }
  #footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ───────────────────────────── SCROLL SCENES ──────────────────────────── */

/* Outer wrapper: extra height gives the scroll-driver room to animate.
   150vh = ~0.5 viewport of scroll to complete the full animation — quick taste,
   not a forced march. */
.scroll-scene {
  height: 150vh;
  position: relative;
}

/* Inner panel: sticky, fills the viewport below the nav */
.scroll-scene-panel {
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  background: var(--cream);
  overflow: hidden;
  display: flex;
  align-items: stretch;  /* children (landing-feature) fill full panel height */
}

.scroll-scene-panel--alt {
  background: #EAE3D5;
}

.scroll-scene-panel--dark {
  background: var(--espresso);
}

/* Feature sections inside a scroll-scene: fill the sticky panel height so the
   demo canvas can stretch vertically instead of being boxed by a fixed aspect ratio */
.scroll-scene .landing-feature {
  padding-top: 0;
  padding-bottom: 0;
  background: transparent !important;
  width: 100%;
  height: 100%;
}

.scroll-scene .feature-inner {
  height: 100%;
  align-items: stretch;  /* both columns grow to the same height */
  padding: 52px 0;       /* breathing room top/bottom inside the full-height grid */
  box-sizing: border-box;
}

/* Text column: vertically centered within its stretched cell */
.scroll-scene .feature-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Demo card: drop the fixed aspect ratio and fill the available height */
.scroll-scene .feature-demo-wrap {
  aspect-ratio: unset;
  height: 100%;
}

/* ───────────────────────────── FEATURE SECTIONS ───────────────────────── */

.landing-feature {
  padding: 96px clamp(40px, 10vw, 160px);
  background: var(--cream);
}

.landing-feature.feature--alt {
  background: #EAE3D5;
}

.landing-feature.feature--dark {
  background: var(--espresso);
}

.feature-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.landing-feature.feature--reverse .feature-text { order: 2; }
.landing-feature.feature--reverse .feature-visual { order: 1; }

/* ── Feature text ── */

.feature-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(24, 20, 14, 0.35);
  margin: 0 0 18px;
}

.feature-label--badge {
  display: inline-block;
  background: rgba(245, 239, 228, 0.08);
  border: 0.5px solid rgba(245, 239, 228, 0.22);
  border-radius: 20px;
  padding: 4px 12px;
  letter-spacing: 0.08em;
  color: rgba(245, 239, 228, 0.45);
  margin-bottom: 20px;
}

.landing-feature.feature--dark .feature-label {
  color: rgba(245, 239, 228, 0.35);
}

.feature-headline {
  font-size: clamp(28px, 3.2vw, 44px);
  font-weight: 700;
  color: var(--espresso);
  margin: 0 0 22px;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.landing-feature.feature--dark .feature-headline {
  color: var(--cream);
}

.feature-body {
  font-size: 16px;
  line-height: 1.8;
  color: rgba(24, 20, 14, 0.5);
  margin: 0;
}

.landing-feature.feature--dark .feature-body {
  color: rgba(245, 239, 228, 0.45);
}

/* ── Feature visual (card wrapper) ── */

.feature-visual {
  background: var(--espresso);
  border-radius: 20px;
  padding: 36px;
  min-height: 300px;
  display: flex;
  align-items: stretch;
}

.landing-feature.feature--dark .feature-visual {
  background: rgba(245, 239, 228, 0.05);
  border: 0.5px solid rgba(245, 239, 228, 0.1);
}

/* ── Explode visual ── */

.fv-explode {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
}

.fv-explode-parts {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.fv-ep {
  background: rgba(245, 239, 228, 0.1);
  border: 0.5px solid rgba(245, 239, 228, 0.18);
  border-radius: 12px;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  transition: transform 0.3s;
}

.fv-ep--sm  { width: 36px; height: 36px; border-radius: 8px; }
.fv-ep--md  { width: 48px; height: 56px; }
.fv-ep--lg  {
  width: 64px; height: 72px; border-radius: 16px;
  background: rgba(245, 239, 228, 0.2);
  border-color: rgba(245, 239, 228, 0.38);
}

.fv-slider-mock {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fv-slider-track {
  height: 1.5px;
  border-radius: 2px;
  background: linear-gradient(
    to right,
    transparent 0%,
    rgba(245, 239, 228, 0.3) 12%,
    rgba(245, 239, 228, 0.3) 88%,
    transparent 100%
  );
  position: relative;
}

.fv-slider-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--cream);
  position: absolute;
  top: 50%;
  left: 58%;
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}

.fv-slider-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(245, 239, 228, 0.2);
  text-align: center;
}

/* ── Narrative visual ── */

.fv-narrative {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.fv-beat-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fv-beat-counter {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(245, 239, 228, 0.3);
}

.fv-beat-name {
  font-size: 17px;
  font-weight: 600;
  color: rgba(245, 239, 228, 0.85);
}

.fv-prompt-bubble {
  flex: 1;
  background: rgba(245, 239, 228, 0.06);
  border: 0.5px solid rgba(245, 239, 228, 0.09);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 12px;
  line-height: 1.65;
  color: rgba(245, 239, 228, 0.5);
  font-style: italic;
}

.fv-beat-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.fv-nav-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 0.5px solid rgba(245, 239, 228, 0.18);
  background: rgba(245, 239, 228, 0.06);
  color: rgba(245, 239, 228, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}

.fv-beat-dots {
  display: flex;
  align-items: center;
  flex: 1;
}

.fv-bd {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid rgba(245, 239, 228, 0.18);
  flex-shrink: 0;
}

.fv-bd--past {
  background: rgba(245, 239, 228, 0.2);
  border-color: transparent;
}

.fv-bd--active {
  background: var(--cream);
  border-color: var(--cream);
}

.fv-bd--future { opacity: 0.28; }

.fv-bd-connector {
  height: 1px;
  background: rgba(245, 239, 228, 0.1);
  flex: 1;
  min-width: 4px;
}

/* ── Detail card visual ── */

.fv-detail-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fv-dc-handle {
  width: 30px;
  height: 3px;
  background: rgba(245, 239, 228, 0.12);
  border-radius: 2px;
  margin: 0 auto 6px;
}

.fv-dc-ref {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(245, 239, 228, 0.28);
}

.fv-dc-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--cream);
  letter-spacing: -0.3px;
  line-height: 1.2;
}

.fv-dc-what {
  font-size: 12px;
  line-height: 1.65;
  color: rgba(245, 239, 228, 0.48);
}

.fv-dc-features {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 0.5px solid rgba(245, 239, 228, 0.07);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fv-dc-features li {
  font-size: 11px;
  color: rgba(245, 239, 228, 0.32);
  padding-left: 14px;
  position: relative;
  line-height: 1.4;
}

.fv-dc-features li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: rgba(245, 239, 228, 0.14);
}

/* ── Symptom visual ── */

.fv-symptoms {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.fv-sym-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(245, 239, 228, 0.06);
  border: 0.5px solid rgba(245, 239, 228, 0.16);
  border-radius: 12px;
  padding: 12px 16px;
}

.fv-sym-icon {
  color: rgba(245, 239, 228, 0.28);
  font-size: 17px;
  font-style: normal;
  line-height: 1;
}

.fv-sym-text {
  font-size: 13px;
  color: rgba(245, 239, 228, 0.62);
  flex: 1;
}

@keyframes fv-cursor-blink {
  0%, 48%  { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.fv-sym-cursor {
  display: inline-block;
  width: 1.5px;
  height: 14px;
  background: rgba(245, 239, 228, 0.5);
  animation: fv-cursor-blink 1.1s step-end infinite;
}

.fv-sym-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fv-sym-result {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 16px;
  background: rgba(245, 239, 228, 0.03);
  border-radius: 10px;
  border: 0.5px solid transparent;
}

.fv-sym-r--high {
  background: rgba(245, 239, 228, 0.09);
  border-color: rgba(245, 239, 228, 0.14);
}

.fv-sym-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.fv-sym-r--high .fv-sym-dot { background: var(--cream); }
.fv-sym-r--med  .fv-sym-dot { background: rgba(245, 239, 228, 0.4); }
.fv-sym-r--low  .fv-sym-dot { background: rgba(245, 239, 228, 0.18); }

.fv-sym-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.fv-sym-part {
  font-size: 13px;
  font-weight: 600;
  color: rgba(245, 239, 228, 0.6);
}

.fv-sym-r--high .fv-sym-part { color: var(--cream); }

.fv-sym-prob {
  font-size: 10px;
  color: rgba(245, 239, 228, 0.28);
  letter-spacing: 0.02em;
}

.fv-sym-r--high .fv-sym-prob { color: rgba(245, 239, 228, 0.48); }

/* Symptoms section: full-viewport-height block to match scroll-scene rhythm */
#feature-symptoms {
  min-height: calc(100vh - 64px);
  padding-top: 60px;
  padding-bottom: 60px;
  display: flex;
  align-items: center;
}

#feature-symptoms .feature-inner {
  width: 100%;
}

/* ── Responsive: feature sections ── */

@media (max-width: 900px) {
  .feature-inner {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .landing-feature.feature--reverse .feature-text  { order: 1; }
  .landing-feature.feature--reverse .feature-visual { order: 2; }

  .landing-feature { padding: 72px 7vw; }
}

/* On touch/small screens: disable scroll-jacking to avoid 3-viewport-tall sections */
@media (max-width: 768px) {
  .scroll-scene {
    height: auto;
  }
  .scroll-scene-panel {
    position: relative;
    top: auto;
    height: auto;
    overflow: visible;
    display: block;
  }
  .scroll-scene .landing-feature {
    padding-top: 64px;
    padding-bottom: 64px;
    height: auto;
  }
  .scroll-scene .feature-inner {
    height: auto;
    padding: 0;
  }
  /* Hide 3D demo canvases — replaced by static screenshots on mobile */
  .feature-demo-wrap { display: none; }

  /* Show screenshot images on mobile */
  .demo-screenshot {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 16px;
    background: var(--espresso);
    order: 2; /* always below the text, regardless of feature--reverse */
  }
  .demo-screenshot--alt  { background: #EAE3D5; }
  .demo-screenshot--dark { background: var(--espresso); }
}

/* ── Mobile layout fixes: About, Enterprise ── */
@media (max-width: 768px) {
  /* About: collapse two-column grid to single column */
  #about-inner {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  #about-text { max-width: 100%; }
  /* Book-titles visual is a hover effect that makes no sense on touch — hide it */
  .about-visual { display: none !important; }

  /* Enterprise: left-align the intro copy (right-align is a desktop-only treatment) */
  .enterprise-intro {
    margin-left: 0;
    text-align: left;
    margin-bottom: 36px;
  }
}

@media (max-width: 600px) {
  #landing-nav-links { display: flex; gap: 2px; }   /* restore links */
  #landing-nav-inner { padding: 0 16px; gap: 12px; } /* tighter padding & gap */
  .landing-nav-link { padding: 6px 10px; font-size: 13px; } /* compact tap targets */
  .landing-nav-cta { display: none; }               /* email CTA hidden — no room on mobile */
  .landing-feature { padding: 56px 24px; }
}

/* Screenshot fallbacks — desktop only shows the live canvas, never the static img */
.demo-screenshot { display: none; }

/* ───────────────────────────── FEATURE DEMOS ───────────────────────────── */

/* Override the CSS-mockup card styles for sections with a live canvas */
.feature-demo-wrap {
  padding: 0;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  min-height: unset;
  position: relative;
  background: var(--cream);
  display: block;
}

.demo-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* Demo card with darker cream background (used when section bg is light cream) */
.feature-demo-wrap--alt {
  background: #EAE3D5;
}

.feature-demo-wrap--alt .demo-loader {
  background: #EAE3D5;
}

/* Demo card with dark espresso background (used when section bg is dark) */
.feature-demo-wrap--dark {
  background: var(--espresso);
}

.feature-demo-wrap--dark .demo-loader,
.demo-loader--dark {
  background: var(--espresso);
}

.demo-loader-fill--dark {
  background: rgba(245, 239, 228, 0.6);
}

.feature-demo-wrap--dark .demo-loader-bar {
  background: rgba(245, 239, 228, 0.1);
}

/* Overlay: floats above the canvas */
.demo-ui {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 14px 18px 16px;
  gap: 8px;
}

.demo-ui--narrative {
  justify-content: space-between;
}

/* ── Symptom diagnosis demo ── */

.demo-sym-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 12, 8, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 0.5px solid rgba(245, 239, 228, 0.14);
  border-radius: 10px;
  padding: 9px 13px;
}

.demo-sym-icon {
  color: rgba(245, 239, 228, 0.32);
  font-size: 15px;
  line-height: 1;
  flex-shrink: 0;
}

.demo-sym-query {
  font-size: 12px;
  color: rgba(245, 239, 228, 0.78);
  flex: 1;
  min-width: 0;
  min-height: 1em;
}

.demo-sym-cursor {
  display: inline-block;
  width: 1.5px;
  height: 12px;
  background: rgba(245, 239, 228, 0.55);
  animation: fv-cursor-blink 1.1s step-end infinite;
  flex-shrink: 0;
  vertical-align: middle;
  margin-left: 1px;
}

.demo-sym-results {
  display: flex;
  flex-direction: column;
  gap: 4px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.demo-sym-results.visible {
  opacity: 1;
  transform: translateY(0);
}

.demo-sym-result {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(15, 12, 8, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 0.5px solid rgba(245, 239, 228, 0.08);
  border-radius: 8px;
  padding: 7px 12px;
}

.demo-sym-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.demo-sym-dot--high   { background: rgb(255, 127, 20); }
.demo-sym-dot--medium { background: rgb(255, 199, 77); }
.demo-sym-dot--low    { background: rgba(245, 239, 228, 0.28); border: 1px solid rgba(245, 239, 228, 0.22); }

.demo-sym-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1;
  gap: 8px;
  min-width: 0;
}

.demo-sym-part-name {
  font-size: 11px;
  font-weight: 600;
  color: rgba(245, 239, 228, 0.82);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.demo-sym-likelihood {
  font-size: 10px;
  color: rgba(245, 239, 228, 0.36);
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

/* ── Explode slider ── */

.demo-explode-row {
  pointer-events: all;
}

.demo-slider {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 20px;
  background: transparent;
  outline: none;
  cursor: pointer;
  padding: 0;
  margin: 0;
}

.demo-slider::-webkit-slider-runnable-track {
  height: 1.5px;
  border-radius: 2px;
  background: linear-gradient(
    to right,
    transparent 0%,
    rgba(24, 20, 14, 0.25) 12%,
    rgba(24, 20, 14, 0.25) 88%,
    transparent 100%
  );
}

.demo-slider::-moz-range-track {
  height: 1.5px;
  border-radius: 2px;
  background: linear-gradient(
    to right,
    transparent 0%,
    rgba(24, 20, 14, 0.25) 12%,
    rgba(24, 20, 14, 0.25) 88%,
    transparent 100%
  );
}

.demo-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--espresso);
  cursor: pointer;
  margin-top: -7px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.22);
  transition: transform 0.12s;
}

.demo-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.demo-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--espresso);
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.22);
}

/* ── Narrative: beat header (top) ── */

.demo-beat-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
  pointer-events: none;
}

.demo-beat-counter {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(24, 20, 14, 0.38);
}

.demo-beat-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--espresso);
  min-height: 1.2em;
}

/* ── Narrative: beat nav (bottom) ── */

.demo-beat-ctrl {
  pointer-events: all;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.demo-nav-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(245, 239, 228, 0.75);
  border: 0.5px solid rgba(24, 20, 14, 0.1);
  color: var(--espresso);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.15s;
}

.demo-nav-btn:hover:not(:disabled) {
  background: rgba(245, 239, 228, 0.97);
}

.demo-nav-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.demo-dots-row {
  display: flex;
  align-items: center;
  flex: 1;
  overflow: hidden;
  gap: 3px;
}

/* Fill-width bar segments — each beat gets equal space */
.demo-dot {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: rgba(24, 20, 14, 0.12);
  border: none;
  transition: background 0.2s, opacity 0.2s;
}

.demo-dot.past {
  background: rgba(24, 20, 14, 0.3);
}

.demo-dot.active {
  background: var(--espresso);
}

.demo-dot.future {
  opacity: 0.4;
}

/* Connectors not needed — bars fill space directly */
.demo-dot-connector {
  display: none;
}

/* ── Parts: detail info card ── */

.demo-part-info {
  background: rgba(245, 239, 228, 0.94);
  border: 0.5px solid rgba(24, 20, 14, 0.08);
  border-radius: 12px;
  padding: 12px 14px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: none;
  pointer-events: none;
}

.demo-part-info.visible {
  display: block;
}

.demo-part-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--espresso);
  margin-bottom: 4px;
  letter-spacing: -0.2px;
}

.demo-part-what {
  font-size: 11px;
  line-height: 1.55;
  color: rgba(24, 20, 14, 0.5);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.demo-tap-hint {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: rgba(24, 20, 14, 0.28);
  text-align: center;
  padding: 4px 0;
  pointer-events: none;
}

/* ── Shared loading overlay ── */

.demo-loader {
  position: absolute;
  inset: 0;
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  transition: opacity 0.4s;
  border-radius: 20px;
}

.demo-loader.hidden {
  opacity: 0;
  pointer-events: none;
}

.demo-loader-bar {
  width: 100px;
  height: 1.5px;
  background: rgba(24, 20, 14, 0.08);
  border-radius: 2px;
  overflow: hidden;
}

.demo-loader-fill {
  height: 100%;
  width: 0%;
  background: var(--espresso);
  border-radius: 2px;
  transition: width 0.2s;
}

/* ───────────────────────────── CATALOG VIEW ───────────────────────────── */

#catalog-view {
  overflow-y: auto;
  overflow-x: hidden;
  height: 100vh;
}

/* ── Nav ── */

#site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 64px;
  background: rgba(245, 239, 228, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 0.5px solid rgba(24, 20, 14, 0.06);
  flex-shrink: 0;
}

#nav-inner {
  padding: 0 clamp(40px, 10vw, 160px);
  height: 100%;
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-spacer {
  flex: 1;
}

#catalog-nav-links {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 4px;
}

#nav-wordmark {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: opacity 0.15s;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.nav-wm-img {
  height: 34px;
  width: auto;
  display: block;
}

#nav-wordmark:hover { opacity: 0.55; }

/* ── Hero ── */

#catalog-hero {
  padding: 40px clamp(40px, 10vw, 160px) 28px;
}

#catalog-mode-toggle {
  display: block;
  background: none;
  border: none;
  padding: 0;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 500;
  color: rgba(24, 20, 14, 0.38);
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: color 0.15s;
}
#catalog-mode-toggle:hover {
  color: rgba(24, 20, 14, 0.7);
}

#catalog-headline {
  font-size: 11px;
  font-weight: 600;
  color: rgba(24, 20, 14, 0.35);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  margin: 0;
}

#catalog-subtitle {
  display: none;
  font-size: 13px;
  color: rgba(24, 20, 14, 0.45);
  margin: 5px 0 0;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

#catalog-subtitle.visible {
  display: block;
}

/* ── Diagnose entry overlay ── */

#diagnose-overlay {
  position: fixed;
  inset: 0;
  background: rgba(245, 239, 228, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
#diagnose-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}
#diagnose-overlay-inner {
  width: 100%;
  max-width: 580px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}
.diagnose-overlay-prompt {
  font-family: 'Raleway', sans-serif;
  font-size: clamp(26px, 4vw, 42px);
  font-weight: 700;
  color: var(--espresso);
  text-align: center;
  margin: 0;
  letter-spacing: -0.02em;
}
#diagnose-overlay-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1.5px solid rgba(24, 20, 14, 0.14);
  border-radius: 16px;
  padding: 6px 6px 6px 20px;
  position: relative;
  box-shadow: 0 4px 32px rgba(24, 20, 14, 0.09);
}
#diagnose-overlay-input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: 'Raleway', sans-serif;
  font-size: 16px;
  color: var(--espresso);
  outline: none;
  padding: 14px 0;
  min-width: 0;
}
#diagnose-overlay-input::placeholder { color: rgba(24, 20, 14, 0.33); }
#diagnose-overlay-btn {
  background: var(--espresso);
  color: var(--cream);
  border: none;
  border-radius: 11px;
  padding: 13px 26px;
  font-family: 'Raleway', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.15s;
}
#diagnose-overlay-btn:hover { opacity: 0.82; }
#diagnose-overlay-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--cream);
  border: 1px solid rgba(24, 20, 14, 0.10);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(24, 20, 14, 0.13), 0 2px 8px rgba(24, 20, 14, 0.06);
  overflow: hidden;
  z-index: 10;
}
#diagnose-overlay-results:empty { display: none; }
#diagnose-overlay-browse {
  background: none;
  border: none;
  color: rgba(24, 20, 14, 0.40);
  font-family: 'Raleway', sans-serif;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.15s;
  letter-spacing: 0.01em;
}
#diagnose-overlay-browse:hover { color: var(--espresso); }

/* ── Cross-appliance diagnose search ── */

#diagnose-search-wrap {
  display: none;
  padding: 0 clamp(40px, 10vw, 160px) 32px;
}

#diagnose-search-wrap.visible {
  display: block;
}

#diagnose-search-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(24, 20, 14, 0.04);
  border: 1px solid rgba(24, 20, 14, 0.12);
  border-radius: 14px;
  padding: 4px 4px 4px 18px;
  position: relative; /* anchors the floating results dropdown */
}

#diagnose-search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: 'Raleway', sans-serif;
  font-size: 16px; /* 16px minimum — prevents iOS Safari auto-zoom on focus */
  color: var(--espresso);
  outline: none;
  padding: 12px 0;
  min-width: 0;
}

#diagnose-search-input::placeholder {
  color: rgba(24, 20, 14, 0.35);
}

#diagnose-search-btn {
  background: var(--espresso);
  color: var(--cream);
  border: none;
  border-radius: 10px;
  padding: 11px 22px;
  font-family: 'Raleway', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.15s;
}

#diagnose-search-btn:hover {
  opacity: 0.82;
}

/* ── Search results: floating dropdown ── */

#diagnose-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--cream);
  border: 1px solid rgba(24, 20, 14, 0.1);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(24, 20, 14, 0.13), 0 2px 8px rgba(24, 20, 14, 0.06);
  overflow: hidden;
  z-index: 100;
}

#diagnose-search-results:empty { display: none; }

/* Status line (loading / no match) */
.dsr-status {
  padding: 16px 20px;
  font-size: 13px;
  color: rgba(24, 20, 14, 0.45);
  margin: 0;
}

/* Compact clickable result rows */
.dsr-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 20px;
  background: none;
  border: none;
  border-top: 0.5px solid rgba(24, 20, 14, 0.06);
  cursor: pointer;
  text-align: left;
  font-family: 'Raleway', sans-serif;
  transition: background 0.1s;
}

.dsr-row:first-child { border-top: none; }

.dsr-row:hover { background: rgba(24, 20, 14, 0.04); }

.dsr-row-icon {
  font-size: 22px;
  flex-shrink: 0;
  line-height: 1;
}

.dsr-row-body {
  flex: 1;
  min-width: 0;
}

.dsr-row-appliance {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: rgba(24, 20, 14, 0.38);
  margin: 0 0 3px;
}

.dsr-row-symptom {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--espresso);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dsr-row-arrow {
  font-size: 15px;
  color: rgba(24, 20, 14, 0.25);
  flex-shrink: 0;
  transition: color 0.1s, transform 0.1s;
}

.dsr-row:hover .dsr-row-arrow {
  color: var(--espresso);
  transform: translateX(3px);
}

@media (max-width: 600px) {
  #diagnose-search-wrap {
    padding: 0 20px 28px;
  }
  /* #diagnose-search-input stays 16px — no mobile override needed */
  .dsr-card {
    flex-wrap: wrap;
  }
  /* Dropdown rows get slightly less padding on small screens */
  .dsr-row { padding: 13px 16px; }
}

/* ── Grid ── */

#catalog-grid-wrap {
  padding: 0 clamp(40px, 10vw, 160px);
}

#appliance-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* ── Footer ── */

#catalog-footer {
  padding: 40px clamp(40px, 10vw, 160px);
  margin-top: 80px;
  border-top: 0.5px solid rgba(24, 20, 14, 0.08);
}

#catalog-footer-copy {
  font-size: 12px;
  color: rgba(24, 20, 14, 0.35);
}

#catalog-footer-home {
  background: none;
  border: none;
  font-family: 'Raleway', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: rgba(24, 20, 14, 0.38);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

#catalog-footer-home:hover {
  color: var(--espresso);
  background: rgba(24, 20, 14, 0.05);
}

@media (max-width: 1024px) {
  #appliance-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  #catalog-hero {
    padding: 48px 20px 36px;
  }
  #catalog-grid-wrap {
    padding: 0 20px;
  }
  #nav-inner {
    padding: 0 20px;
  }
  #appliance-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* ── Cards ── */

.appliance-card {
  position: relative;
  background: #FDFAF5;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  border: 0.5px solid rgba(24, 20, 14, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.appliance-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(24, 20, 14, 0.12);
  border-color: rgba(24, 20, 14, 0.15);
}

.card-image {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #DDD8CF, #C8C2B8);
}

.card-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-icon {
  font-size: 52px;
  user-select: none;
  position: relative;
  z-index: 1;
}

.card-body {
  padding: 20px 24px 24px;
}

.card-tag {
  font-size: 11px;
  font-weight: 600;
  color: rgba(24, 20, 14, 0.35);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 8px;
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--espresso);
  margin: 0 0 8px;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.card-desc {
  font-size: 13px;
  color: rgba(24, 20, 14, 0.5);
  margin: 0 0 4px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* In diagnose mode the choice is already made — suppress the explore/diagnose overlay */
#appliance-grid.diagnose-mode .card-overlay {
  display: none;
}

/* Diagnose mode: single "Fix this →" hover CTA replaces the two-option overlay */
.card-fix-cta {
  display: none; /* hidden in explore mode */
  position: absolute;
  inset: 0;
  z-index: 2;
  align-items: center;
  justify-content: center;
  background: rgba(18, 14, 9, 0.58);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  color: var(--cream);
  font-family: 'Raleway', sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  border-radius: inherit;
}

#appliance-grid.diagnose-mode .appliance-card:hover .card-fix-cta {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}



/* Hover overlay — two-option mode selector */
.card-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: stretch;
  background: rgba(20, 16, 10, 0.78);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.appliance-card:hover .card-overlay {
  opacity: 1;
  pointer-events: auto;
}

.card-overlay-option {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 22px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: background 0.15s;
  border-radius: 0;
}

.card-overlay-option:hover {
  background: rgba(245, 239, 228, 0.07);
}

.card-overlay-divider {
  width: 0.5px;
  background: rgba(245, 239, 228, 0.12);
  flex-shrink: 0;
  margin: 24px 0;
}

.coo-label {
  display: block;
  font-size: 19px;
  font-weight: 700;
  color: var(--cream);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.coo-desc {
  display: block;
  font-size: 13px;
  color: rgba(245, 239, 228, 0.55);
  line-height: 1.5;
}


/* ───────────────────────────── VIEWER VIEW ───────────────────────────── */

#viewer-view {
  position: fixed;
  inset: 0;
  background: var(--cream);
}

#viewer-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

#viewer-top-left {
  position: absolute;
  top: 60px;
  left: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 10;
}

#btn-back {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(245, 239, 228, 0.7);
  border: 0.5px solid rgba(24, 20, 14, 0.12);
  color: var(--espresso);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

#btn-back:hover {
  background: rgba(245, 239, 228, 0.95);
}

#beat-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

#beat-counter-text {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  color: rgba(24, 20, 14, 0.45);
  text-transform: uppercase;
}

#beat-name-text {
  font-size: 15px;
  font-weight: 500;
  color: var(--espresso);
}

/* ───────────────────────────── LOADING OVERLAY ───────────────────────── */

#viewer-loading {
  position: absolute;
  inset: 0;
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  flex-direction: column;
  gap: 16px;
  transition: opacity 0.4s;
}

#viewer-loading.hidden {
  opacity: 0;
  pointer-events: none;
}

#loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

#loading-appliance-name {
  font-size: 22px;
  font-weight: 700;
  color: var(--espresso);
  letter-spacing: -0.3px;
}

#loading-bar-wrap {
  width: 200px;
  height: 2px;
  background: rgba(24, 20, 14, 0.08);
  border-radius: 2px;
  overflow: hidden;
}

#loading-bar {
  height: 100%;
  background: var(--espresso);
  width: 0%;
  transition: width 0.2s;
  border-radius: 2px;
}

#loading-progress-text {
  font-size: 12px;
  color: rgba(24, 20, 14, 0.35);
}

/* ─────────────────────────── VIEWER DIAGNOSE OVERLAY ──────────────── */

#viewer-diagnose-overlay {
  position: absolute;
  inset: 0;
  background: rgba(245, 239, 228, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
#viewer-diagnose-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}
#viewer-diagnose-back {
  position: absolute;
  top: 24px;
  left: 28px;
  background: none;
  border: none;
  font-family: 'Raleway', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: rgba(24, 20, 14, 0.45);
  cursor: pointer;
  padding: 6px 4px;
  letter-spacing: 0.01em;
  transition: color 0.15s;
}
#viewer-diagnose-back:hover { color: var(--espresso); }
#viewer-diagnose-inner {
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}
.viewer-diagnose-heading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.viewer-diagnose-prompt {
  font-family: 'Raleway', sans-serif;
  font-size: clamp(14px, 2vw, 18px);
  font-weight: 500;
  color: rgba(24, 20, 14, 0.50);
  text-align: center;
  margin: 0;
  letter-spacing: 0;
  text-transform: lowercase;
}
#viewer-diagnose-appliance-name {
  font-family: 'Raleway', sans-serif;
  font-size: clamp(26px, 4vw, 42px);
  font-weight: 700;
  color: var(--espresso);
  text-align: center;
  margin: 0;
  letter-spacing: -0.02em;
}
#viewer-diagnose-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1.5px solid rgba(24, 20, 14, 0.14);
  border-radius: 16px;
  padding: 6px 6px 6px 20px;
  position: relative;
  box-shadow: 0 4px 32px rgba(24, 20, 14, 0.09);
}
#viewer-diagnose-input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: 'Raleway', sans-serif;
  font-size: 16px;
  color: var(--espresso);
  outline: none;
  padding: 14px 0;
  min-width: 0;
}
#viewer-diagnose-input::placeholder { color: rgba(24, 20, 14, 0.33); }
#viewer-diagnose-btn {
  background: var(--espresso);
  color: var(--cream);
  border: none;
  border-radius: 11px;
  padding: 13px 26px;
  font-family: 'Raleway', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.15s;
}
#viewer-diagnose-btn:hover { opacity: 0.82; }
#viewer-diagnose-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--cream);
  border: 1px solid rgba(24, 20, 14, 0.10);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(24, 20, 14, 0.13), 0 2px 8px rgba(24, 20, 14, 0.06);
  overflow: hidden;
  z-index: 10;
}
#viewer-diagnose-results:empty { display: none; }
#viewer-diagnose-skip {
  background: none;
  border: none;
  color: rgba(24, 20, 14, 0.40);
  font-family: 'Raleway', sans-serif;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.15s;
  letter-spacing: 0.01em;
}
#viewer-diagnose-skip:hover { color: var(--espresso); }

/* ───────────────────────────── PARTS PANEL ──────────────────────────── */

/* Outer container — slides as a unit; toggle tab always peeks at right edge */
#parts-panel-container {
  position: absolute;
  top: 70px;
  right: 0;
  max-height: calc(100vh - 160px);
  display: none;
  flex-direction: row;
  align-items: flex-start;
  z-index: 10;
  transform: translateX(clamp(240px, 28vw, 320px)); /* closed: only toggle tab visible */
  transition: transform 0.36s cubic-bezier(0.22, 1, 0.36, 1);
}

#parts-panel-container.visible {
  display: flex;
}

#parts-panel-container.open {
  transform: translateX(0);
}

/* Toggle tab — left edge of the container, always reachable */
#parts-panel-toggle {
  width: 28px;
  height: 38px; /* matches parts-panel-header height */
  flex-shrink: 0;
  background: var(--espresso);
  border: none;
  border-radius: 10px 0 0 10px;
  cursor: pointer;
  color: rgba(245, 239, 228, 0.75);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}

#parts-panel-toggle:hover {
  color: var(--cream);
}

/* Panel body */
#parts-panel {
  width: clamp(240px, 28vw, 320px);
  max-height: calc(100vh - 160px); /* must match container max-height so panel can't overflow it */
  display: flex;
  flex-direction: column;
  background: rgba(245, 239, 228, 0.88);
  border: 0.5px solid rgba(24, 20, 14, 0.08);
  border-right: none;
  border-radius: 16px 0 0 16px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow: hidden;
}

#parts-list {
  list-style: none;
  padding: 4px 0;
  margin: 0;
  overflow-y: hidden;
}

#parts-list li {
  padding: 6px 18px;
  font-size: 12px;
  font-weight: 500;
  color: rgba(24, 20, 14, 0.7);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  line-height: 1.3;
}

#parts-list li:hover:not(.selected) {
  background: rgba(24, 20, 14, 0.05);
  color: var(--espresso);
}

#parts-list li.selected {
  background: var(--espresso);
  color: var(--cream);
}

/* ── Parts panel handle (drag indicator, desktop hidden) ── */
#parts-panel-handle {
  display: none;
  width: 36px;
  height: 4px;
  background: rgba(24, 20, 14, 0.15);
  border-radius: 2px;
  margin: 10px auto 6px;
  flex-shrink: 0;
  cursor: pointer;
}

/* ── Mobile parts trigger — top-right, mirrors back button position ── */
#parts-mobile-trigger {
  display: none; /* JS shows this on mobile when panel is .visible */
  position: absolute;
  top: 60px;
  right: 16px;
  align-items: center;
  background: rgba(245, 239, 228, 0.7);
  border: 0.5px solid rgba(24, 20, 14, 0.12);
  border-radius: 20px;
  color: var(--espresso);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  cursor: pointer;
  z-index: 12;
  letter-spacing: 0.01em;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.15s;
}

#parts-mobile-trigger:active {
  background: rgba(245, 239, 228, 0.95);
}

/* ── Mobile: right-side diagnosis window ─────────────────────────────────
 *
 * The toggle physically moves between two positions:
 *
 *   Hidden (.visible, no .open):
 *     Container shifted right by (100% - 36px).
 *     Toggle: absolute at left:0 → visible as the 36px tab at screen right.
 *     Panel:  absolute at left:36px → starts exactly at viewport edge, fully off-screen.
 *     Nothing bleeds through — no content visible, just the tab.
 *
 *   Open (.visible.open):
 *     Container translateX(0) → fills full screen.
 *     Toggle: still at left:0 → now overlays the top-left of the full-screen panel.
 *     Panel:  shifts to left:0 → fills true 100% width.
 *     Toggle moves "inside" the window, panel is edge-to-edge.
 */
@media (max-width: 768px) {
  #parts-panel-container {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    transform: translateX(calc(100% - 36px));
    z-index: 25;
  }

  #parts-panel-container.visible {
    display: block;                       /* children are absolute — block is fine */
    transform: translateX(calc(100% - 36px));
  }

  #parts-panel-container.visible.open {
    transform: translateX(0);
  }

  /* Toggle: absolute at top-left of container.
   * Closed → the 36px espresso tab at the right screen edge, offset 70px from the top
   *          to mirror the desktop panel's top: 70px container position.
   * Open   → moves to top-right corner of the panel as a circular × close button. */
  #parts-panel-toggle {
    position: absolute;
    top: 70px;
    left: 0;
    width: 36px;
    height: 52px;
    z-index: 2;
    background: var(--espresso);
    border: none;
    border-radius: 12px 0 0 12px;
    cursor: pointer;
    color: rgba(245, 239, 228, 0.75);
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, border-radius 0.2s, color 0.2s;
  }

  #parts-panel-toggle:hover {
    color: var(--cream);
  }

  /* Open: reposition to top-right of the full-screen panel as a × close button.
   * top: 8px gives ~8px gap to the top edge and ~11px gap to the search bar. */
  #parts-panel-container.visible.open #parts-panel-toggle {
    top: 8px;
    left: auto;
    right: 16px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(24, 20, 14, 0.07);
    border: 0.5px solid rgba(24, 20, 14, 0.12);
    color: rgba(24, 20, 14, 0.5);
    font-size: 16px;
  }

  #parts-panel-container.visible.open #parts-panel-toggle:hover {
    background: rgba(24, 20, 14, 0.12);
    color: var(--espresso);
  }

  /* Handle not needed */
  #parts-panel-handle {
    display: none;
  }

  /* Floating trigger pill not needed */
  #parts-mobile-trigger {
    display: none !important;
  }

  /* Panel: absolute, starts at left:36px when closed (fully off-screen).
   * Shifts to left:0 when open so it fills true 100% width.
   * width:auto is required to override the desktop width:280px rule. */
  #parts-panel {
    position: absolute;
    top: 0;
    left: 36px;                          /* closed: starts at viewport edge = off-screen */
    right: 0;
    bottom: 0;
    width: auto;                         /* let left+right control width, not desktop's 280px */
    max-height: 100%;
    border: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: left 0.36s cubic-bezier(0.22, 1, 0.36, 1);
  }

  #parts-panel-container.visible.open #parts-panel {
    left: 0;                             /* open: fills full 100% width */
  }

  /* Parts list fills remaining space and scrolls */
  #parts-list {
    overflow-y: auto;
    flex: 1;
    max-height: unset;
    -webkit-overflow-scrolling: touch;
  }

  /* Prevent iOS auto-zoom on input focus */
  #panel-symptom-input {
    font-size: 16px;
  }

  /* Suppress separate detail card overlay — detail rendered inside panel instead */
  #detail-card {
    display: none !important;
  }

  /* Keep the header label from sliding under the × close button.
   * Extra bottom padding also creates breathing room between the header and search bar,
   * so the close button (top: 8px, 34px tall → bottom edge at 42px) sits comfortably
   * above the search wrap (which starts at header-height + 10px padding = ~53px). */
  #parts-panel-container.visible.open #parts-panel-header {
    padding-right: 58px;
    padding-bottom: 16px;
  }
}

/* ── Mobile part detail view (rendered inside #parts-list) ── */

.mobile-detail-back {
  display: block;
  width: 100%;
  background: none;
  border: none;
  border-bottom: 0.5px solid rgba(24, 20, 14, 0.06);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: rgba(24, 20, 14, 0.45);
  padding: 14px 18px 14px;
  cursor: pointer;
  text-align: left;
  transition: color 0.15s, background 0.15s;
}

.mobile-detail-back:hover,
.mobile-detail-back:active {
  color: var(--espresso);
  background: rgba(24, 20, 14, 0.03);
}

.mobile-detail-ref {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  color: rgba(24, 20, 14, 0.38);
  text-transform: uppercase;
  padding: 20px 20px 4px;
  margin: 0;
}

.mobile-detail-name {
  font-size: 24px;
  font-weight: 700;
  color: var(--espresso);
  padding: 0 20px 14px;
  margin: 0;
  letter-spacing: -0.4px;
  line-height: 1.2;
}

.mobile-detail-what {
  font-size: 15px;
  line-height: 1.7;
  color: rgba(24, 20, 14, 0.58);
  padding: 0 20px 20px;
  margin: 0;
}

.mobile-detail-features {
  list-style: none;
  padding: 16px 20px 48px;
  margin: 0;
  border-top: 0.5px solid rgba(24, 20, 14, 0.08);
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.mobile-detail-features li {
  font-size: 14px;
  color: rgba(24, 20, 14, 0.48);
  line-height: 1.55;
  padding-left: 18px;
  position: relative;
}

.mobile-detail-features li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: rgba(24, 20, 14, 0.18);
}

/* ── Card overlay: tap-to-toggle on touch devices ── */
@media (hover: none) {
  .appliance-card:hover .card-overlay {
    opacity: 0;
    pointer-events: none;
  }
  .appliance-card.overlay-open .card-overlay {
    opacity: 1;
    pointer-events: auto;
  }
}

/* ───────────────────────────── EXPLODE SLIDER ───────────────────────── */

#explode-slider-wrap {
  position: absolute;
  bottom: 76px; /* sits just above beat-nav (bottom:30px + 36px height + 10px gap) */
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 80px);
  max-width: 640px;
  display: none;
  align-items: center;
  z-index: 10;
}

#explode-slider-wrap.visible {
  display: flex;
}

#explode-slider-label {
  display: none;
}

#explode-slider {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 20px;      /* full thumb height as hit area */
  background: transparent;
  outline: none;
  cursor: pointer;
  padding: 0;
  margin: 0;
}

/* Track — fades at both ends */
#explode-slider::-webkit-slider-runnable-track {
  height: 1.5px;
  border-radius: 2px;
  background: linear-gradient(
    to right,
    transparent 0%,
    rgba(24, 20, 14, 0.3) 14%,
    rgba(24, 20, 14, 0.3) 86%,
    transparent 100%
  );
}

#explode-slider::-moz-range-track {
  height: 1.5px;
  border-radius: 2px;
  background: linear-gradient(
    to right,
    transparent 0%,
    rgba(24, 20, 14, 0.3) 14%,
    rgba(24, 20, 14, 0.3) 86%,
    transparent 100%
  );
}

/* Thumb */
#explode-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--espresso);
  cursor: pointer;
  margin-top: -8px;
  transition: transform 0.12s;
}

#explode-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

#explode-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--espresso);
  border: none;
  cursor: pointer;
}

/* ───────────────────────────── PROMPT BUBBLE ────────────────────────── */

#prompt-bubble {
  position: absolute;
  bottom: 110px; /* sits above the slider (bottom:76px + ~20px slider height + 14px gap) */
  left: 50%;
  transform: translateX(-50%);
  max-width: 420px;
  width: calc(100% - 60px);
  background: rgba(245, 239, 228, 0.88);
  border: 0.5px solid rgba(24, 20, 14, 0.1);
  border-radius: 16px;
  padding: 16px 20px;
  color: var(--espresso);
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
  z-index: 10;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: none;
  transition: opacity 0.4s ease;
}

/* ──────────────────────── SYMPTOM CHECKER (in parts panel) ──────────── */

/* Header: label + optional clear button */
#parts-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 10px;
  border-bottom: 0.5px solid rgba(24, 20, 14, 0.06);
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  color: rgba(24, 20, 14, 0.35);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

#panel-symptom-clear {
  background: none;
  border: none;
  color: rgba(24, 20, 14, 0.45);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  line-height: 1;
  transition: color 0.15s;
  flex-shrink: 0;
}

#panel-symptom-clear:hover { color: var(--espresso); }

#parts-panel-footer {
  padding: 14px 20px 20px;
  border-top: 1px solid rgba(24, 20, 14, 0.07);
  flex-shrink: 0; /* always visible — never squeezed off the bottom */
}
#viewer-switch-diagnose {
  width: 100%;
  background: none;
  border: 1px solid rgba(24, 20, 14, 0.2);
  color: rgba(24, 20, 14, 0.6);
  border-radius: 100px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
#viewer-switch-diagnose:hover {
  background: rgba(24, 20, 14, 0.05);
  color: var(--espresso);
  border-color: rgba(24, 20, 14, 0.35);
}

/* Search input row — hidden until symptoms load */
#panel-symptom-wrap {
  display: none;
  padding: 10px 12px;
  border-bottom: 0.5px solid rgba(24, 20, 14, 0.06);
  flex-shrink: 0;
}

#panel-symptom-row {
  display: flex;
  align-items: center;
  background: rgba(24, 20, 14, 0.05);
  border: 0.5px solid rgba(24, 20, 14, 0.1);
  border-radius: 8px;
  overflow: hidden;
}

#panel-symptom-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  padding: 8px 12px;
  font-size: 12px;
  font-family: inherit;
  color: var(--espresso);
  min-width: 0;
}

#panel-symptom-input::placeholder {
  color: rgba(24, 20, 14, 0.32);
}

#panel-symptom-submit {
  background: none;
  border: none;
  border-left: 0.5px solid rgba(24, 20, 14, 0.1);
  padding: 0 12px;
  height: 34px;
  font-size: 14px;
  color: rgba(24, 20, 14, 0.6);
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.15s;
}

#panel-symptom-submit:hover { color: var(--espresso); }

/* Parts list — fills remaining panel height and scrolls when content overflows */
#parts-list {
  flex: 1;
  min-height: 0; /* required: flex items default to min-height:auto, which prevents shrinking */
  overflow-y: auto;
}

/* Symptom result items inside #parts-list */
#parts-list li.symptom-result {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 18px;
}

#parts-list li.symptom-result .sr-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-top: 4px;
  flex-shrink: 0;
}

.sr-dot--high   { background: #c0392b; }
.sr-dot--medium { background: #e07b22; }
.sr-dot--low    { background: rgba(24, 20, 14, 0.22); }

/* "Most likely first" hint above symptom result list */
.sr-rank-hint {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(24, 20, 14, 0.35);
  padding: 10px 18px 6px;
  display: block;
}

#parts-list li.symptom-result .sr-name {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--espresso);
  margin-bottom: 2px;
}

#parts-list li.symptom-result .sr-reason {
  display: block;
  font-size: 11px;
  color: rgba(24, 20, 14, 0.48);
  line-height: 1.4;
}

#parts-list li.symptom-result.selected .sr-name {
  color: var(--cream);
}

#parts-list li.symptom-result.selected .sr-reason {
  color: rgba(245, 239, 228, 0.6);
}

#parts-list li.symptom-result.selected .sr-dot {
  outline: 1.5px solid rgba(245, 239, 228, 0.5);
  outline-offset: 1px;
}

/* ── Symptom no-match fallback chip UI ──────────────────────────────── */

.symptom-nomatch-msg {
  font-size: 12px;
  color: rgba(24, 20, 14, 0.45);
  padding: 12px 16px 6px;
  margin: 0;
  font-style: italic;
}

.symptom-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 6px 14px 16px;
}

.symptom-chip {
  background: rgba(24, 20, 14, 0.06);
  border: 1px solid rgba(24, 20, 14, 0.15);
  border-radius: 20px;
  color: rgba(24, 20, 14, 0.7);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  text-align: left;
}

.symptom-chip:hover {
  background: rgba(24, 20, 14, 0.1);
  border-color: rgba(24, 20, 14, 0.3);
  color: var(--espresso);
}

/* ───────────────────────────── BEAT NAVIGATION ──────────────────────── */

#beat-nav {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 10;
  max-width: calc(100% - 20px);
}

#btn-prev,
#btn-next {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(245, 239, 228, 0.7);
  border: 0.5px solid rgba(24, 20, 14, 0.12);
  color: var(--espresso);
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, opacity 0.15s, border-color 0.15s;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

#btn-prev:hover:not(:disabled),
#btn-next:hover:not(:disabled) {
  background: rgba(245, 239, 228, 0.95);
  border-color: rgba(24, 20, 14, 0.25);
}

#btn-prev:disabled,
#btn-next:disabled {
  opacity: 0.25;
  cursor: default;
}

#beat-dots {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: nowrap;
  overflow: hidden;
}

.beat-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(24, 20, 14, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: rgba(24, 20, 14, 0.45);
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
  user-select: none;
}

.beat-dot:hover:not(.future) {
  border-color: rgba(24, 20, 14, 0.5);
  color: var(--espresso);
}

.beat-dot.active {
  background: var(--espresso);
  border-color: var(--espresso);
  color: var(--cream);
}

.beat-dot.past {
  background: rgba(24, 20, 14, 0.2);
  border-color: transparent;
  color: var(--espresso);
}

.beat-dot.future {
  opacity: 0.3;
  cursor: default;
}

.beat-dot-connector {
  height: 1px;
  background: rgba(24, 20, 14, 0.15);
  flex: 1;
  min-width: 4px;
  max-width: 20px;
}

/* ─── Explore guide button — pill shown on free-roam beat in explore mode ─── */

#explore-guide-btn {
  display: none;
  position: absolute;
  bottom: 30px;
  left: 20px;
  background: rgba(245, 239, 228, 0.85);
  border: 0.5px solid rgba(24, 20, 14, 0.15);
  color: var(--espresso);
  border-radius: 100px;
  padding: 10px 26px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 10;
  transition: background 0.15s, border-color 0.15s;
}
#explore-guide-btn.visible {
  display: block;
}
#explore-guide-btn:hover {
  background: rgba(245, 239, 228, 0.98);
  border-color: rgba(24, 20, 14, 0.3);
}

/* Hide beat chrome while in explore free-roam state */
#beat-label.explore-hidden {
  visibility: hidden;   /* keep space so back button doesn't shift */
  pointer-events: none;
}
#beat-nav.explore-hidden {
  display: none;
}

/* ───────────────────────────── DETAIL CARD ──────────────────────────── */

#detail-card {
  position: absolute;
  top: 120px; /* clears back button (top:60px + 40px height + 20px gap) */
  left: 0;
  right: auto;
  bottom: auto;
  transform: translateX(-400px); /* hidden: slide off to left; -400px exceeds max width */
  width: clamp(280px, 32vw, 360px);
  max-width: none;
  max-height: calc(100% - 220px); /* top offset + bottom margin for slider */
  background: rgba(245, 239, 228, 0.88);
  border: 0.5px solid rgba(24, 20, 14, 0.08);
  border-left: none;
  border-radius: 0 16px 16px 0;
  padding: 20px 20px 32px;
  z-index: 10;
  transition: transform 0.36s cubic-bezier(0.22, 1, 0.36, 1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  pointer-events: none;
  overflow-y: auto;
}

#detail-card.visible {
  transform: translateX(0);
  pointer-events: all;
}

/* Handle only used in mobile bottom-sheet mode */
#detail-card-handle {
  display: none;
}

/* ── Mobile: restore bottom-sheet layout ── */
@media (max-width: 768px) {
  #detail-card {
    top: auto;
    right: auto;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    width: 100%;
    max-width: 520px;
    max-height: 70vh;
    border-right: 0.5px solid rgba(24, 20, 14, 0.1);
    border-radius: 24px 24px 0 0;
    border-bottom: none;
    padding: 8px 24px 44px;
    z-index: 30;
  }
  #detail-card.visible {
    transform: translateX(-50%) translateY(0);
  }
  #detail-card-handle {
    display: block;
    width: 36px;
    height: 4px;
    background: rgba(24, 20, 14, 0.12);
    border-radius: 2px;
    margin: 12px auto 20px;
    flex-shrink: 0;
  }
}

#detail-card-close {
  position: absolute;
  top: 18px;
  right: 20px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(24, 20, 14, 0.06);
  border: 0.5px solid rgba(24, 20, 14, 0.12);
  color: rgba(24, 20, 14, 0.45);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

#detail-card-close:hover {
  background: rgba(24, 20, 14, 0.1);
  color: var(--espresso);
}

#detail-card-ref {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  color: rgba(24, 20, 14, 0.4);
  text-transform: uppercase;
  margin: 0 0 6px;
  min-height: 1em;
}

#detail-card-name {
  font-size: 21px;
  font-weight: 700;
  color: var(--espresso);
  margin: 0 0 12px;
  letter-spacing: -0.3px;
  line-height: 1.25;
  padding-right: 32px;
}

#detail-card-what {
  font-size: 14px;
  line-height: 1.65;
  color: rgba(24, 20, 14, 0.6);
  margin: 0 0 16px;
}

#detail-card-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 0.5px solid rgba(24, 20, 14, 0.08);
  padding-top: 14px;
}

#detail-card-features:empty {
  display: none;
}

#detail-card-features li {
  font-size: 13px;
  color: rgba(24, 20, 14, 0.5);
  line-height: 1.5;
  padding-left: 18px;
  position: relative;
}

#detail-card-features li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: rgba(24, 20, 14, 0.2);
}

/* ── Mobile panel: diagnosis section padding ──────────────────────────────
   dcd-* elements are appended as bare block nodes to #parts-list on mobile,
   so they miss the 18px horizontal padding that li elements get.          */
#parts-list .dcd-reason,
#parts-list .dcd-divider,
#parts-list .dcd-verify,
#parts-list .dcd-meta,
#parts-list .dcd-notes,
#parts-list .dcd-part-link,
#parts-list .dcd-section-label {
  padding-left: 18px;
  padding-right: 18px;
}

/* ── Detail card: diagnosis section ── */

#detail-card-diagnosis {
  display: none;
  margin-top: 16px;
}

#detail-card-diagnosis.visible {
  display: block;
}

.dcd-section-label {
  display: block;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: rgba(24, 20, 14, 0.35);
  margin: 14px 0 5px;
}

.dcd-reason {
  font-size: 14px;
  line-height: 1.65;
  color: rgba(24, 20, 14, 0.82);
  margin: 0 0 14px;
}

.dcd-reason:empty { display: none; }

.dcd-divider {
  height: 0.5px;
  background: rgba(24, 20, 14, 0.1);
  margin-bottom: 14px;
}

.dcd-verify {
  font-size: 12.5px;
  line-height: 1.6;
  color: rgba(24, 20, 14, 0.65);
  margin: 0 0 12px;
}

.dcd-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.dcd-difficulty,
.dcd-cost,
.dcd-labor {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 3px 8px;
  border-radius: 20px;
  border: 1px solid transparent;
}

/* Difficulty colour tokens */
.dcd-difficulty[data-level="easy"]         { background: #e6f4ea; border-color: #a8d5b0; color: #2a6a3a; }
.dcd-difficulty[data-level="moderate"]     { background: #fef8e7; border-color: #f0d070; color: #7a5e10; }
.dcd-difficulty[data-level="hard"]         { background: #fef0e6; border-color: #f4b080; color: #8a3a10; }
.dcd-difficulty[data-level="professional"] { background: #fde8e8; border-color: #f4a0a0; color: #8a1a1a; }

.dcd-cost,
.dcd-labor {
  background: rgba(24, 20, 14, 0.04);
  border-color: rgba(24, 20, 14, 0.1);
  color: rgba(24, 20, 14, 0.55);
}

.dcd-notes {
  font-size: 12px;
  line-height: 1.6;
  color: rgba(24, 20, 14, 0.5);
  margin: 0 0 10px;
  font-style: italic;
}

.dcd-part-link {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: var(--espresso);
  text-decoration: none;
  border-bottom: 1px solid rgba(24, 20, 14, 0.2);
  padding-bottom: 1px;
  transition: border-color 0.15s;
}

.dcd-part-link:hover {
  border-color: var(--espresso);
}

/* Prev / next cause navigation */
.dcd-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 0.5px solid rgba(24, 20, 14, 0.08);
}

.dcd-nav-btn {
  font-size: 11px;
  font-weight: 600;
  color: var(--espresso);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 0;
  opacity: 0.7;
  transition: opacity 0.15s;
}

.dcd-nav-btn:hover:not(:disabled) { opacity: 1; }
.dcd-nav-btn:disabled { opacity: 0.25; cursor: default; }

.dcd-nav-pos {
  font-size: 10px;
  color: rgba(24, 20, 14, 0.4);
  letter-spacing: 0.04em;
}

/* Hide if no content */
.dcd-verify:empty,
.dcd-difficulty:empty,
.dcd-cost:empty,
.dcd-labor:empty,
.dcd-notes:empty,
.dcd-part-link[href="#"] {
  display: none;
}

/* Symptom result list: inline difficulty + cost metadata */
.sr-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.sr-tag {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 2px 6px;
  border-radius: 10px;
  border: 1px solid transparent;
}

.sr-tag--easy         { background: #e6f4ea; border-color: #a8d5b0; color: #2a6a3a; }
.sr-tag--moderate     { background: #fef8e7; border-color: #f0d070; color: #7a5e10; }
.sr-tag--hard         { background: #fef0e6; border-color: #f4b080; color: #8a3a10; }
.sr-tag--professional { background: #fde8e8; border-color: #f4a0a0; color: #8a1a1a; }
.sr-tag--cost         { background: rgba(24, 20, 14, 0.04); border-color: rgba(24, 20, 14, 0.1); color: rgba(24, 20, 14, 0.55); }

/* When result is selected, invert tags */
#parts-list li.symptom-result.selected .sr-tag {
  background: rgba(245, 239, 228, 0.15);
  border-color: rgba(245, 239, 228, 0.25);
  color: rgba(245, 239, 228, 0.7);
}

/* ───────────────────────────── GUIDED TOUR ─────────────────────────── */

#viewer-tour {
  position: absolute;
  inset: 0;
  display: none;
  z-index: 25;
  pointer-events: none;
}

#viewer-tour.visible {
  display: block;
  pointer-events: none; /* overlay is transparent to events — only #tour-card catches clicks */
}

@keyframes tour-in {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes tour-in-side {
  from { opacity: 0; transform: translate(-50%, calc(-50% + 10px)); }
  to   { opacity: 1; transform: translate(-50%, -50%); }
}

@keyframes tour-out {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* ── Gesture hand animations ── */

@keyframes tour-hand-sweep {
  0%   { transform: translateX(-10px); }
  100% { transform: translateX(10px); }
}

@keyframes tour-hand-scroll {
  0%   { transform: translateY(8px); }
  100% { transform: translateY(-8px); }
}

.tour-icon--drag {
  display: inline-block;
  animation: tour-hand-sweep 0.9s ease-in-out infinite alternate;
}

.tour-icon--scroll {
  display: inline-block;
  animation: tour-hand-scroll 0.85s ease-in-out infinite alternate;
}

#viewer-tour.hiding #tour-card {
  animation: tour-out 0.22s ease-in forwards;
}

#tour-card {
  position: absolute;
  background: rgba(245, 239, 228, 0.97);
  border: 0.5px solid rgba(24, 20, 14, 0.1);
  border-radius: 20px;
  padding: 22px 26px 20px;
  max-width: 240px;
  width: calc(100vw - 48px);
  box-shadow: 0 12px 40px rgba(24, 20, 14, 0.14);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  overflow: visible;
  pointer-events: all; /* card itself must still catch button clicks */
}

/* Step 1: centred above the beat nav, pointer pointing down */
#viewer-tour.step-1 #tour-card {
  bottom: 90px;
  top: auto;
  left: 50%;
  transform: translateX(-50%);
  animation: tour-in 0.32s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Steps 2 & 3: left quarter of screen, vertically centred */
#viewer-tour.step-2 #tour-card,
#viewer-tour.step-3 #tour-card {
  top: 50%;
  bottom: auto;
  left: 25%;
  transform: translate(-50%, -50%);
  animation: tour-in-side 0.32s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* ── Step indicator dots ── */

#tour-step-dots {
  display: flex;
  gap: 5px;
  justify-content: center;
  margin-bottom: 16px;
}

.tour-dot {
  height: 5px;
  width: 5px;
  border-radius: 3px;
  background: rgba(24, 20, 14, 0.15);
  transition: width 0.25s ease, background 0.25s ease;
  flex-shrink: 0;
}

.tour-dot.active {
  width: 16px;
  background: var(--espresso);
}

/* ── Icon ── */

#tour-icon {
  font-size: 26px;
  text-align: center;
  margin-bottom: 10px;
  line-height: 1.3;
  user-select: none;
  letter-spacing: 4px;
}

/* ── Explanatory text ── */

#tour-text {
  font-size: 14px;
  line-height: 1.6;
  color: rgba(24, 20, 14, 0.65);
  text-align: center;
  margin: 0 0 18px;
}

/* ── Next / Got it button ── */

#tour-btn {
  width: 100%;
  padding: 10px;
  background: var(--espresso);
  color: var(--cream);
  border: none;
  border-radius: 12px;
  font-family: 'Raleway', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: opacity 0.15s;
}

#tour-btn:hover:not(:disabled) {
  opacity: 0.85;
}

#tour-btn:disabled {
  opacity: 0.28;
  cursor: default;
}

/* ── Downward pointer triangle (step 1 only) ── */

#tour-pointer {
  display: none;
  position: absolute;
  bottom: -9px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-top: 9px solid rgba(245, 239, 228, 0.97);
}

#viewer-tour.step-1 #tour-pointer {
  display: block;
}

/* ── Beat nav pulse highlight (step 1) ── */

@keyframes tour-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(24, 20, 14, 0.4); }
  65%  { box-shadow: 0 0 0 8px rgba(24, 20, 14, 0); }
  100% { box-shadow: 0 0 0 0 rgba(24, 20, 14, 0); }
}

.tour-highlight {
  animation: tour-pulse 1.5s ease-out infinite !important;
  background: rgba(245, 239, 228, 0.95) !important;
  border-color: rgba(24, 20, 14, 0.35) !important;
}

/* ── iOS Safari: prevent auto-zoom on symptom input focus ──────────────────
 * iOS zooms in whenever a focused <input> has font-size < 16px.
 * The desktop rule sets font-size: 12px and comes earlier in the file than
 * the mobile media block, so the desktop value was winning the cascade.
 * Placing this override last guarantees it beats the desktop rule.
 */
@media (max-width: 768px) {
  #panel-symptom-input {
    font-size: 16px;
  }
}

/* ── Mobile: panel peek animation ─────────────────────────────────────────
 * Shows ~160px of panel content (plus the 36px tab = 196px total) briefly
 * on first load so the user knows the diagnosis panel exists.
 * The container's inherited transition: transform 0.36s handles the animation.
 */
@media (max-width: 768px) {
  #parts-panel-container.visible.peek {
    transform: translateX(calc(100% - 196px));
  }
}

/* ── Mobile: badge dot when a part is selected ─────────────────────────────
 * A small cream dot appears on the left edge of the espresso tab, straddling
 * the tab/viewer boundary for maximum visibility against both backgrounds.
 * Added via JS (.has-badge class); removed when panel opens or part deselects.
 */
@media (max-width: 768px) {
  #parts-panel-toggle.has-badge::after {
    content: '';
    position: absolute;
    top: 10px;
    left: 0;
    transform: translateX(-50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--cream);
    box-shadow: 0 0 0 1.5px var(--espresso);
    pointer-events: none;
  }
}


