/* ============================================================
   MRJ3.0 — Mr. Jealousy Interior Intelligence Tool
   Design System & Page Styles
   ============================================================ */

/* ── FONTS ─────────────────────────────────────────────────── */

@font-face {
  font-family: 'MrGintoNord';
  src: url('fonts/MrGintoNord-Black.woff2') format('woff2');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'MrGintoNord';
  src: url('fonts/MrGintoNord-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'MrGintoNord';
  src: url('fonts/MrGintoNord-Ultra.woff2') format('woff2');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Poppins';
  src: url('fonts/font-poppins-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Poppins';
  src: url('fonts/font-poppins-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Poppins';
  src: url('fonts/font-poppins-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ── DESIGN TOKENS ─────────────────────────────────────────── */

:root {
  --bg:            #F1D4D0;
  --bg-card:       #FFFFFF;
  --text-dark:     #111111;
  --text-mid:      #3D3D3D;
  --text-muted:    #6B6B6B;
  --accent:        #111111;
  --pink-light:    #F5F5F5;
  --pink-border:   #E5E5E5;
  --pink-bubble:   #E8D0CD;
  --overlay:       rgba(0, 0, 0, 0.45);

  --radius-card:   16px;
  --radius-btn:    4px;
  --radius-input:  12px;

  --shadow-card:   0 2px 16px rgba(0,0,0,0.08);
  --shadow-btn:    0 2px 8px rgba(2, 2, 2, 0.12);

  --font-heading:  'MrGintoNord', serif;
  --font-body:     'Poppins', sans-serif;
}

/* ── RESET & BASE ───────────────────────────────────────────── */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  color: var(--text-dark);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-user-select: none;
  user-select: none;
}

/* Anti-copy selection block above must not disable normal form input use */
input, textarea {
  -webkit-user-select: text;
  user-select: text;
}

a {
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
}

button {
  cursor: pointer;
  font-family: var(--font-body);
  border: none;
  background: none;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

:where(button, [role="radio"]):focus-visible {
  outline: 3px solid rgba(17, 17, 17, 0.82);
  outline-offset: 3px;
}

img {
  display: block;
  max-width: 100%;
}

/* ── LAYOUT ─────────────────────────────────────────────────── */

.app {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 1440px;
  margin: 0 auto;
  overflow: hidden;
}

/* Each page is a full-screen section */
.page {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.28s ease;
  overflow: hidden;
}

.page.active {
  opacity: 1;
  pointer-events: all;
  visibility: visible;
}

/* Top bar shared across pages */
.topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 20px 24px 0;
  flex-shrink: 0;
}

.btn-close {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  color: var(--text-dark);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 0;
}

.btn-close svg {
  width: 18px;
  height: 18px;
  stroke: var(--text-dark);
  stroke-width: 2;
}

/* ── SPEECH BUBBLE AVATAR ───────────────────────────────────── */

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-mj {
  background: transparent;
}

.avatar-mj img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.avatar-dots {
  background: var(--pink-bubble);
}

.avatar-dots span {
  display: flex;
  gap: 3px;
  align-items: center;
}

.avatar-dots span i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-dark);
  display: block;
  transform-origin: center;
  animation: avatar-dot-wave 1.05s cubic-bezier(0.45, 0, 0.55, 1) infinite;
  will-change: transform, opacity;
}

.avatar-dots span i:nth-child(2) {
  animation-delay: 140ms;
}

.avatar-dots span i:nth-child(3) {
  animation-delay: 280ms;
}

@keyframes avatar-dot-wave {
  0%, 60%, 100% {
    opacity: 0.52;
    transform: translate3d(0, 1px, 0) scale(0.78);
  }
  30% {
    opacity: 1;
    transform: translate3d(0, -2px, 0) scale(1);
  }
}

.chat-line {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-dark);
}

.chat-sequence {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-msg {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-dark);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.chat-msg.visible {
  opacity: 1;
  transform: none;
}

/* ── LOADING CAROUSEL ───────────────────────────────────────── */

.chat-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-text-carousel {
  position: relative;
  height: 1.5em;
  overflow: hidden;
  flex: 1;
}

.carousel-item {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-dark);
  transform: translateY(110%);
  opacity: 0;
  transition: transform 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              opacity 1.2s ease;
}

.carousel-item.active {
  transform: translateY(0);
  opacity: 1;
}

.carousel-item.leaving {
  transform: translateY(-110%);
  opacity: 0;
  transition: transform 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              opacity 0.8s ease;
}

/* ── PAGE 1: LANDING ────────────────────────────────────────── */

#page-landing {
  justify-content: flex-start;
  cursor: pointer;
}
#page-landing {
  z-index: 1;
}

.landing-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 24px 40px 40px;
  width: 100%;
  max-width: 640px;
  align-self: center;
}

.landing-content .avatar-mj {
  margin-bottom: 24px;
}

.landing-headline {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.05;
  color: var(--text-dark);
  margin-bottom: 32px;
  letter-spacing: -0.01em;
}

.file-input-hidden {
  display: none;
}

.upload-actions {
  width: 100%;
}

.photo-source-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  width: 100%;
  padding: 32px 20px 24px;
  background: var(--bg-card);
  border: 2px solid var(--pink-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.upload-actions.drag-over .photo-source-card {
  border-color: #E03E52;
  background: #fdf5f5;
  box-shadow: 0 4px 24px rgba(224, 62, 82, 0.15);
}

.photo-source-icon {
  width: 64px;
  height: 64px;
  line-height: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.photo-source-icon img {
  display: block;
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.photo-source-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  width: 100%;
}

.photo-source-action {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border: 2px solid var(--text-dark);
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-dark);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  transition: background 0.2s, color 0.2s, transform 0.15s, box-shadow 0.2s;
}

.photo-source-action--upload {
  background: var(--text-dark);
  color: #fff;
}

.photo-source-action--camera {
  background: #fff;
}

.photo-source-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(18, 18, 18, 0.12);
}

.photo-source-action:active {
  transform: translateY(0);
}


.landing-disclaimer {
  margin-top: 32px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  text-align: center;
}

/* ── PAGE 2: LOADING (ALTERNATIVE) ─────────────────────────── */

#page-loading {
  --loading-inline: clamp(16px, 4vw, 28px);
  --loading-block: clamp(10px, 2.2svh, 20px);
  --loading-gap: clamp(12px, 1.8svh, 20px);
  justify-content: flex-start;
  align-items: stretch;
  min-height: 100svh;
  overflow: hidden;
}

#page-loading .topbar {
  width: 100%;
  flex-shrink: 0;
  min-height: max(48px, calc(40px + env(safe-area-inset-top)));
  padding: max(8px, env(safe-area-inset-top)) var(--loading-inline) 0;
}

#page-loading .btn-close {
  min-width: 44px;
  min-height: 44px;
  justify-content: flex-end;
}

#page-loading .loading-inner-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: var(--loading-block) var(--loading-inline)
    max(var(--loading-block), env(safe-area-inset-bottom));
}

.loading-inner {
  width: 100%;
  max-width: 600px;
  min-width: 0;
  margin: auto;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "chat"
    "title"
    "visual"
    "progress"
    "legal";
  gap: var(--loading-gap);
  align-content: center;
}

#page-loading .chat-row {
  grid-area: chat;
  min-width: 0;
}

#page-loading .chat-text-carousel {
  min-width: 0;
}

.progress-card {
  grid-area: progress;
  background: var(--bg-card);
  border-radius: var(--radius-card);
  padding: clamp(12px, 2svh, 20px) clamp(16px, 4vw, 28px);
  box-shadow: var(--shadow-card);
}

.progress-track {
  height: 8px;
  background: #E8D0CD;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: #E03E52;
  border-radius: 999px;
  width: 0%;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Slide title, moved above the TV frame so it reads directly under the
   chat header. Reuses .tv-explainer-slide for slide-sync (see script.js
   _setTvSlide) so no JS changes are needed. */
.tv-title-row {
  grid-area: title;
  position: relative;
  min-height: 22px;
}

.tv-title-row .tv-explainer-title {
  margin-bottom: 0;
}

/* ── PROGRESS TV (loading page slideshow) ──────────────────── */

.progress-tv {
  grid-area: visual;
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.4svh, 12px);
}

.tv-frame {
  position: relative;
  width: 100%;
  height: clamp(176px, min(56vw, 34svh), 340px);
  border-radius: clamp(14px, 4vw, 20px);
  overflow: hidden;
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
  border: 2px solid rgba(255, 255, 255, 0.72);
}

.tv-slides {
  position: relative;
  width: 100%;
  height: 100%;
}

.tv-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}

.tv-slide.active {
  opacity: 1;
  pointer-events: all;
}

.tv-slide-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tv-slide-meetgarantie {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 2svh, 12px);
  padding: clamp(18px, 5vw, 32px);
  text-align: center;
  background: linear-gradient(135deg, #F1D4D0 0%, #f9e8e5 100%);
  width: 100%;
  height: 100%;
}

.meetgarantie-icon {
  font-size: clamp(36px, 10vw, 48px);
  line-height: 1;
}

.tv-slide-meetgarantie h3 {
  font-family: var(--font-heading);
  font-size: clamp(18px, 5vw, 22px);
  font-weight: 900;
  color: var(--text-dark);
}

.tv-slide-meetgarantie p {
  font-size: clamp(12px, 3.4vw, 14px);
  color: var(--text-mid);
  max-width: 320px;
  line-height: 1.5;
}

/* Explainer text */
.tv-explainer {
  position: relative;
  min-height: clamp(82px, 13svh, 108px);
  min-width: 0;
}

.tv-explainer-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.tv-explainer-slide.active {
  opacity: 1;
  position: relative;
  pointer-events: all;
}

.tv-explainer-title {
  font-family: var(--font-heading);
  font-size: clamp(15px, 4vw, 18px);
  font-weight: 900;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.tv-explainer-steps {
  list-style: none;
  counter-reset: step;
  display: flex;
  flex-direction: column;
  gap: clamp(4px, 0.8svh, 7px);
  padding: 0;
}

.tv-explainer-steps li {
  counter-increment: step;
  font-size: clamp(12px, 3.1vw, 13px);
  color: var(--text-mid);
  line-height: 1.42;
  padding-left: 22px;
  position: relative;
}

.tv-explainer-steps li::before {
  content: counter(step) ".";
  position: absolute;
  left: 0;
  font-weight: 700;
  color: #E03E52;
}

.tv-explainer-steps li strong {
  color: var(--text-dark);
}

/* Dot indicators */
.tv-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2px;
}

.tv-dot {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
}

.tv-dot::before {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 50%;
  background: #E8D0CD;
  transition: background 0.2s, transform 0.2s;
}

.tv-dot.active::before {
  background: #E03E52;
  transform: scale(1.25);
}

.loading-disclaimer {
  grid-area: legal;
  max-width: 66ch;
  font-size: clamp(11.5px, 3vw, 13px);
  color: var(--text-muted);
  line-height: 1.5;
}

/* Fold-unfolded, tablet and laptop: keep the visual and its explanation
   together horizontally so viewport height is no longer the bottleneck. */
@media (min-width: 720px) {
  #page-loading {
    --loading-inline: clamp(24px, 4vw, 48px);
    --loading-block: clamp(10px, 2svh, 20px);
    --loading-gap: clamp(10px, 1.8svh, 18px);
  }

  .loading-inner {
    max-width: 1100px;
  }

  .progress-tv {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
    grid-template-areas:
      "frame explainer"
      "frame dots";
    column-gap: clamp(20px, 3vw, 36px);
    row-gap: 4px;
    align-items: center;
  }

  .tv-frame {
    grid-area: frame;
    height: auto;
    aspect-ratio: 16 / 9;
    align-self: center;
  }

  .tv-explainer {
    grid-area: explainer;
    min-height: 0;
    align-self: end;
  }

  .tv-dots {
    grid-area: dots;
    align-self: start;
  }

  .tv-explainer-steps li {
    font-size: clamp(11.5px, 1.2vw, 13px);
  }

  .loading-disclaimer {
    justify-self: start;
  }
}

/* Low-height laptop and landscape Fold: compress rhythm, preserve every
   element, and let the inner region scroll instead of clipping the top. */
@media (min-width: 600px) and (max-height: 700px) {
  #page-loading {
    --loading-block: 6px;
    --loading-gap: 8px;
  }

  #page-loading .topbar {
    min-height: 42px;
    padding-top: max(2px, env(safe-area-inset-top));
  }

  #page-loading .avatar {
    width: 34px;
    height: 34px;
  }

  .tv-title-row {
    min-height: 20px;
  }

  .tv-frame {
    max-height: 46svh;
  }

  .progress-card {
    padding-block: 10px;
  }

  .loading-disclaimer {
    font-size: 11px;
    line-height: 1.4;
  }
}

@media (prefers-reduced-motion: reduce) {
  .carousel-item,
  .tv-slide,
  .tv-explainer-slide,
  .tv-dot::before,
  .progress-fill {
    transition-duration: 0.01ms !important;
  }
}

/* ── PAGE 3: RESULT ─────────────────────────────────────────── */

#page-result {
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(241, 212, 208, 0.88);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
  backdrop-filter: blur(18px) saturate(145%);
  padding: 10px 12px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.result-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.result-header-title {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dark);
}

.result-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.avatar-mj--white {
  background: white;
  padding: 6px;
}

.result-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: visible;
  min-height: 0;
  padding: 8px;
  gap: 10px;
}

/* Left panel: before/after */
.result-left {
  --photo-ambient-left: rgba(225, 193, 190, 0.62);
  --photo-ambient-centre: rgba(211, 198, 192, 0.46);
  --photo-ambient-right: rgba(194, 203, 211, 0.58);
  --photo-ambient-shadow: rgba(79, 67, 66, 0.22);
  flex: none;
  position: relative;
  height: clamp(330px, 62svh, 560px);
  min-width: 0;
  padding: clamp(8px, 2.4vw, 14px);
  gap: 8px;
  background:
    radial-gradient(90% 120% at -5% 5%, var(--photo-ambient-left), transparent 68%),
    radial-gradient(78% 115% at 105% 10%, var(--photo-ambient-right), transparent 70%),
    radial-gradient(85% 95% at 52% 112%, var(--photo-ambient-centre), transparent 72%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.18));
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-card);
  border: 1px solid rgba(255, 255, 255, 0.62);
  box-shadow:
    0 18px 44px var(--photo-ambient-shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(20px) saturate(145%);
  backdrop-filter: blur(20px) saturate(145%);
}

.before-after-container {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
  cursor: col-resize;
  -webkit-user-select: none;
  user-select: none;
  border-radius: calc(var(--radius-card) - 5px);
  border: 1px solid rgba(255, 255, 255, 0.55);
  background:
    radial-gradient(85% 130% at 0 50%, var(--photo-ambient-left), transparent 72%),
    radial-gradient(85% 130% at 100% 50%, var(--photo-ambient-right), transparent 72%),
    rgba(255, 255, 255, 0.18);
  box-shadow:
    0 12px 30px var(--photo-ambient-shadow),
    inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.ba-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  background: transparent;
}

.ba-before {
  z-index: 1;
}

.ba-after {
  z-index: 2;
  clip-path: inset(0 50% 0 0);
  transition: opacity 180ms ease;
}

.ba-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: white;
  z-index: 3;
  transform: translateX(-50%);
}

.ba-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: white;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.ba-handle svg {
  width: 20px;
  height: 20px;
  stroke: var(--text-dark);
  stroke-width: 2;
}

/* Before / After labels */
.ba-label {
  position: absolute;
  top: 14px;
  bottom: unset;
  z-index: 5;
  background: rgba(255, 255, 255, 0.45);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  color: var(--text-dark);
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 2px 10px rgba(0,0,0,0.12);
}

.ba-label--before {
  left: 14px;
}

.ba-label--after {
  right: 14px;
}

.result-actions {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.55);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  flex-shrink: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.45);
}

.btn-outline {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border: 1.5px solid var(--text-dark);
  border-radius: var(--radius-btn);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dark);
  background: transparent;
  transition: background 0.18s, color 0.18s;
}

.btn-outline:hover {
  background: var(--text-dark);
  color: white;
}

/* Shared 44px circular icon-only action button — Opnieuw, Roteer and the
   Opslaan/share trigger all use this base so they stay identical in size
   and proportion; modifiers only change color. */
.btn-circle-action {
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.75);
  transition: background 0.18s;
}

.btn-circle-action:hover {
  background: var(--text-dark);
}

.btn-circle-action img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: filter 0.18s;
}

/* Hover inverts: white circle/black icon → dark circle/white icon */
.btn-circle-action:hover img {
  filter: invert(1);
}

/* ── SHARE MENU (Opslaan → deel-CTA) ─────────────────────────
   .share-menu is position:fixed and anchored via JS to the trigger
   button's screen position, so it can float above the (overflow:hidden)
   result card instead of being clipped by it. */

.share-wrap {
  flex: none;
  position: relative;
}

.btn-share-circle {
  transition: background 0.18s, transform 0.18s;
}

.share-wrap.open .btn-share-circle {
  transform: rotate(45deg);
  background: var(--text-dark);
}

.share-wrap.open .btn-share-circle img {
  filter: invert(1);
}

.share-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, background 0.25s ease;
}

.share-backdrop.open {
  background: rgba(20, 12, 12, 0.25);
  opacity: 1;
  pointer-events: auto;
}

.share-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  z-index: 41;
  pointer-events: none;
}

.share-option {
  position: absolute;
  top: 0;
  left: 0;
  width: 42px;
  height: 42px;
  margin: -21px 0 0 -21px; /* center the button on the anchor point */
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  color: white;
  background: var(--text-dark);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  transform: translate(0, 0) scale(0.3);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
  pointer-events: none;
}

.share-menu.open .share-option {
  opacity: 1;
  pointer-events: auto;
}

/* Quarter-circle fan, straight left to straight down, radius ~85px —
   trigger now sits in the top header, so the fan opens down-left to stay
   on screen instead of the old up-left sweep used when it sat under the image. */
.share-menu.open .share-option[data-action="download"]  { transform: translate(-85px, 0px)  scale(1); transition-delay: 0s; }
.share-menu.open .share-option[data-action="copy"]       { transform: translate(-79px, 33px) scale(1); transition-delay: 0.04s; }
.share-menu.open .share-option[data-action="whatsapp"]   { transform: translate(-60px, 60px) scale(1); transition-delay: 0.08s; background: #25D366; }
.share-menu.open .share-option[data-action="facebook"]   { transform: translate(-33px, 79px) scale(1); transition-delay: 0.12s; background: #1877F2; }
.share-menu.open .share-option[data-action="pinterest"]  { transform: translate(0px, 85px)   scale(1); transition-delay: 0.16s; background: #E60023; }

.share-toast {
  position: absolute;
  top: -110px;
  left: -70px;
  min-width: 140px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--text-dark);
  color: white;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.share-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Right panel: config */
.result-right {
  width: 100%;
  flex-shrink: 0;
  background: #FFFFFF;
  overflow: visible;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-card);
  border: 1px solid rgba(17, 17, 17, 0.06);
  box-shadow: 0 12px 36px rgba(49, 35, 37, 0.10);
}

.result-right::-webkit-scrollbar {
  width: 4px;
}

.result-right::-webkit-scrollbar-track {
  background: transparent;
}

.result-right::-webkit-scrollbar-thumb {
  background: var(--pink-border);
  border-radius: 999px;
}

.result-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 0;
  flex-shrink: 0;
}

.config-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.config-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 4px 2px 14px;
}

.config-eyebrow {
  margin-bottom: 4px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  line-height: 1.35;
  text-transform: uppercase;
}

.config-title {
  color: var(--text-dark);
  font-family: var(--font-body);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.18;
}

.config-help {
  max-width: 40rem;
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}

.config-choice-count {
  flex: 0 0 auto;
  padding: 6px 9px;
  border: 1px solid var(--pink-border);
  border-radius: 999px;
  background: rgba(241, 212, 208, 0.46);
  color: var(--text-dark);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

/* Section dividers */
.config-section {
  padding: 14px 0;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.config-section:last-child {
  border-bottom: none;
}

.config-section--no-border  { border-bottom: none; }
.config-section--cta-top    { border-bottom: none; padding-top: 6px; padding-bottom: 6px; }
.config-section--cta-bottom { border-bottom: none; padding-top: 12px; }

.config-options-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  padding-top: 8px;
}

.config-options-grid .config-section {
  min-width: 0;
  padding: 13px;
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 14px;
  background: rgba(248, 245, 244, 0.72);
}

.config-section-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 0 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-mid, #888);
}
.config-section-divider::before,
.config-section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(0, 0, 0, 0.12);
}

.color-cta-links--spaced { margin-top: 14px; }

.section-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dark);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 9px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Selected color hero */
.color-hero {
  position: relative;
  border-radius: var(--radius-card);
  overflow: hidden;
  aspect-ratio: 16 / 7;
  background: #000000;
  margin-bottom: 0;
}

.color-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left center;
}

/* Full-product JPEG photos: zoom in and anchor to the left tip of the slats.
   Slats run right→left; the left tip sits at ~28% from the image edge.
   Scale up to crop out the black background on both sides. */
.color-hero img.hero-img--product {
  object-fit: cover;
  object-position: 28% center;
  transform: scale(1.65);
  transform-origin: 28% center;
}

.color-hero-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px 14px;
  background: linear-gradient(transparent, rgba(0,0,0,0.55));
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.color-hero-name {
  color: white;
  font-size: 15px;
  font-weight: 700;
}

.color-hero-material {
  color: rgba(255,255,255,0.8);
  font-size: 12px;
  font-weight: 400;
}

.btn-kleuren {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 0 10px 10px;
  gap: 4px;
  color: white;
  font-size: 13px;
  font-weight: 600;
  background: none;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

.btn-kleuren svg {
  width: 14px;
  height: 14px;
  stroke: white;
  stroke-width: 2.5;
}

.color-cta-links {
  display: flex;
  gap: 20px;
  margin-top: 4px;
}

.color-cta-links a {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dark);
  text-decoration: underline;
}

/* Suggestion cards — 2×2 grid of square product-photo tiles */
.suggestion-list {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(132px, 43vw);
  grid-template-columns: none;
  gap: 10px;
  margin: 0;
  padding: 2px 2px 9px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  scroll-snap-type: inline mandatory;
  scrollbar-width: thin;
  scrollbar-color: var(--pink-border) transparent;
}

.suggestion-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 44px;
  padding: 0;
  border: 1.5px solid var(--pink-border);
  border-radius: var(--radius-input);
  cursor: pointer;
  transition: border-color 0.18s;
  background: var(--bg-card);
  overflow: hidden;
  scroll-snap-align: start;
  text-align: left;
}

.suggestion-card:hover {
  border-color: var(--text-dark);
}

.suggestion-card.selected {
  border-color: var(--text-dark);
  box-shadow: 0 0 0 1px var(--text-dark);
}

.suggestion-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--pink-light);
}

.suggestion-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Name/material overlaid on the image, same treatment as .color-hero-overlay */
.suggestion-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px 10px;
  background: linear-gradient(transparent, rgba(0,0,0,0.55));
}

.suggestion-name {
  color: white;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.suggestion-material {
  color: rgba(255,255,255,0.8);
  font-size: 11px;
  font-weight: 400;
  margin-top: 2px;
}

/* Primary action button */
.btn-primary {
  width: 100%;
  padding: 15px 24px;
  background: var(--text-dark);
  color: white;
  border-radius: var(--radius-btn);
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity 0.18s, transform 0.1s;
  margin: 4px 0;
}

.btn-primary:hover {
  opacity: 0.88;
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ── RADIO GROUPS ───────────────────────────────────────────── */

.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}

.radio-group.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 0;
}

/* Ensure dot + label sit at the same baseline across all grid-2 groups */
.radio-group.grid-2 .radio-item {
  padding: 5px 2px;
}

.radio-item {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  min-width: 0;
  min-height: 44px;
  padding: 6px 2px;
  border-radius: 8px;
}

.radio-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #C0B8B6;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s;
  background: white;
}

.radio-dot::after {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-dark);
  opacity: 0;
  transition: opacity 0.15s;
}

.radio-item.selected .radio-dot {
  border-color: var(--text-dark);
}

.radio-item.selected .radio-dot::after {
  opacity: 1;
}

.radio-item.disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

/* Constraint toast notification */
.constraint-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--text-dark, #1a1a1a);
  color: #fff;
  font-size: 13px;
  padding: 10px 18px;
  border-radius: 8px;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  white-space: nowrap;
}
.constraint-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.radio-label {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-dark);
  overflow-wrap: normal;
  word-break: normal;
}

.radio-icon-svg {
  width: 36px;
  height: 20px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* Technical check data */
.tech-check-table {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 16px;
  font-size: 13px;
}

.tech-check-table dt {
  color: var(--text-muted);
  font-weight: 400;
  white-space: nowrap;
}

.tech-check-table dd {
  color: var(--text-dark);
  font-weight: 500;
}

/* Special considerations */
.special-text {
  font-size: 13px;
  color: var(--text-mid);
  line-height: 1.65;
}

/* Style description block */
.style-description {
  font-size: 13px;
  color: var(--text-mid);
  line-height: 1.75;
  padding-top: 4px;
}

/* ── COLOR FLYOUT ────────────────────────────────────────────── */

.flyout-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.flyout-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.flyout-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 380px;
  max-width: 100vw;
  background: var(--bg-card);
  z-index: 101;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
}

.flyout-overlay.open .flyout-panel {
  transform: translateX(0);
}

.flyout-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
  flex-shrink: 0;
}

.flyout-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

.flyout-material-toggle {
  display: flex;
  gap: 0;
  padding: 12px 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
  flex-shrink: 0;
}

.flyout-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px 20px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 12px;
  align-content: start;
}

.flyout-list::-webkit-scrollbar {
  width: 4px;
}

.flyout-list::-webkit-scrollbar-thumb {
  background: var(--pink-border);
  border-radius: 999px;
}

.flyout-item {
  width: 100%;
  min-width: 0;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 1.5px solid var(--pink-border);
  border-radius: 12px;
  background: var(--bg-card);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.flyout-item:hover {
  border-color: var(--text-dark);
}

.flyout-item.selected {
  border-color: var(--text-dark);
  box-shadow: 0 0 0 1px var(--text-dark);
}

.flyout-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--pink-light);
  flex-shrink: 0;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  border-radius: 0;
}

.flyout-thumb {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
  display: block !important;
  border-radius: 0 !important;
}

.flyout-name-overlay {
  position: absolute;
  bottom: 0;
  right: 0;
  left: 0;
  padding: 18px 8px 7px;
  text-align: right;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
  background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.45));
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.flyout-info {
  padding: 9px 10px 11px;
  min-width: 0;
  background: var(--bg-card);
}

.flyout-material {
  font-size: 11px;
  line-height: 1.3;
  color: var(--text-muted);
  margin-top: 3px;
}

@media (max-width: 480px) {
  .flyout-panel {
    width: 100vw;
  }

  .flyout-list {
    gap: 10px;
    padding: 10px 12px 20px;
  }
}

/* Material toggle — segmented pill, strict separation */
.mat-toggle {
  display: flex;
  gap: 0;
  width: 100%;
  background: var(--pink-light);
  border: 1px solid var(--pink-border);
  border-radius: 999px;
  padding: 4px;
  position: relative;
}

.mat-toggle .radio-item {
  flex: 1;
  justify-content: center;
  gap: 0;
  padding: 8px 14px;
  border-radius: 999px;
  background: transparent;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
  position: relative;
}

.mat-toggle .radio-dot {
  display: none;
}

.mat-toggle .radio-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.mat-toggle .radio-item.selected {
  background: white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.mat-toggle .radio-item.selected .radio-label {
  color: var(--text-dark);
}

.mat-toggle .radio-item + .radio-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 22%;
  bottom: 22%;
  width: 1px;
  background: var(--pink-border);
  opacity: 1;
  transition: opacity 0.15s;
}

.mat-toggle .radio-item.selected + .radio-item::before,
.mat-toggle .radio-item:has(+ .radio-item.selected)::before,
.mat-toggle .radio-item.selected::before {
  opacity: 0;
}

/* ── ERROR STATE ─────────────────────────────────────────────── */

.error-banner {
  display: none;
  background: #FFF0F0;
  border: 1px solid #FFBBBB;
  border-radius: 12px;
  padding: 14px 18px;
  margin: 0 20px 16px;
  font-size: 13px;
  color: #991111;
  line-height: 1.55;
}

.error-banner.visible {
  display: block;
}

/* ── UTILITY ─────────────────────────────────────────────────── */

.hidden {
  display: none !important;
}

.spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── RENDER LOADER ─────────────────────────────────────────────── */

.render-loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 20% 35%, var(--photo-ambient-left), transparent 58%),
    radial-gradient(circle at 80% 65%, var(--photo-ambient-right), transparent 60%),
    rgba(255, 255, 255, 0.30);
  -webkit-backdrop-filter: blur(14px) saturate(145%);
  backdrop-filter: blur(14px) saturate(145%);
  z-index: 50;
  border-radius: calc(var(--radius-card) - 5px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 160ms ease, visibility 160ms ease;
}

.render-loader.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Translucent glass card holding the restored bouncing heart. */
.mrjl-card {
  position: relative;
  width: clamp(112px, 30vw, 148px);
  height: clamp(112px, 30vw, 148px);
  background: rgba(255, 255, 255, 0.58);
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.74);
  box-shadow:
    0 16px 44px var(--photo-ambient-shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.84);
  -webkit-backdrop-filter: blur(18px) saturate(155%);
  backdrop-filter: blur(18px) saturate(155%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

/* ── Bouncing heart ── */
.mrjl-heart-wrap {
  position: relative;
  width: 50px;
  height: 65px;
}

.mrjl-heart-box {
  position: absolute;
  top: 0;
  left: 0;
  width: 50px;
  height: 50px;
  background:
    radial-gradient(circle at 35% 32%, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0) 55%),
    radial-gradient(circle at 40% 38%, #f07080 0%, #E35465 40%, #c03050 70%, #8a1a2e 100%);
  clip-path: path('M25,46 C14,37 2,28 2,16 C2,8 8,3 16,3 C20,3 23,5 25,7 C27,5 30,3 34,3 C42,3 48,8 48,16 C48,28 36,37 25,46 Z');
  filter: drop-shadow(0px 4px 6px rgba(120,10,25,0.45));
  animation: mrjl-heart-bounce 0.75s ease-in-out infinite;
}

.mrjl-heart-shine {
  position: absolute;
  width: 20px;
  height: 12px;
  background: radial-gradient(ellipse at 50% 40%, rgba(255,255,255,0.82) 0%, rgba(255,255,255,0) 100%);
  border-radius: 50%;
  top: 6px;
  left: 7px;
  transform: rotate(-30deg);
  pointer-events: none;
}

.mrjl-heart-shine2 {
  position: absolute;
  width: 8px;
  height: 5px;
  background: radial-gradient(ellipse, rgba(255,255,255,0.45) 0%, rgba(255,255,255,0) 100%);
  border-radius: 50%;
  top: 20px;
  left: 28px;
  pointer-events: none;
}

.mrjl-heart-shadow {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50px;
  height: 5px;
  background: radial-gradient(ellipse, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0) 100%);
  border-radius: 50%;
  animation: mrjl-heart-shadow-pulse 0.75s ease-in-out infinite;
}

/* ── UTILITY (replaces inline styles) ── */
.result-header-left img { width: 40px; height: 40px; object-fit: contain; }
.ba-handle img          { width: 28px; height: 28px; object-fit: contain; display: block; }
.result-actions--cta    { padding: 10px 0 0 !important; background: transparent !important; gap: 8px !important; }
.btn-outline--pink      {
  min-height: 44px;
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 600;
  border: 1.5px solid var(--pink-bubble);
  border-radius: var(--radius-btn);
  color: var(--text-dark);
  background: var(--pink-bubble);
  letter-spacing: 0.01em;
}
.btn-outline--pink:hover {
  background: #ddbfbb;
  border-color: #ddbfbb;
}

/* ── KEYFRAMES ── */

@keyframes mrjl-heart-bounce {
  0%   { transform: translateY(0px)  scale(1,    1)    rotate(0deg);
         animation-timing-function: cubic-bezier(0.55, 0, 1, 0.45); }
  25%  { transform: translateY(9px)  scale(1,    1)    rotate(90deg);
         animation-timing-function: cubic-bezier(0.55, 0, 1, 0.45); }
  42%  { transform: translateY(16px) scale(0.97, 1.04) rotate(151deg);
         animation-timing-function: cubic-bezier(0.2, 0, 0.4, 1); }
  47%  { transform: translateY(18px) scale(1.2,  0.84) rotate(169deg);
         animation-timing-function: cubic-bezier(0.2, 0, 0.4, 1); }
  50%  { transform: translateY(19px) scale(1.6,  0.72) rotate(180deg);
         animation-timing-function: cubic-bezier(0.2, 0, 0.5, 1); }
  53%  { transform: translateY(18px) scale(1.2,  0.84) rotate(191deg);
         animation-timing-function: cubic-bezier(0.3, 0, 0.7, 1); }
  58%  { transform: translateY(15px) scale(0.94, 1.07) rotate(209deg);
         animation-timing-function: cubic-bezier(0, 0.55, 0.45, 1); }
  75%  { transform: translateY(9px)  scale(1,    1)    rotate(270deg);
         animation-timing-function: cubic-bezier(0, 0.55, 0.45, 1); }
  100% { transform: translateY(0px)  scale(1,    1)    rotate(360deg); }
}

@keyframes mrjl-heart-shadow-pulse {
  0%   { transform: scale(0.7, 1); opacity: 0.4;  }
  50%  { transform: scale(1.6, 1); opacity: 0.18; }
  100% { transform: scale(0.7, 1); opacity: 0.4;  }
}

/* ── RESPONSIVE — TABLET (769px–1199px) ─────────────────────── */

@media (min-width: 600px) {
  .result-body {
    padding: 12px;
    gap: 12px;
  }

  .config-body {
    padding: 18px;
  }

  .color-hero {
    aspect-ratio: 3 / 1;
  }

  .suggestion-list {
    grid-auto-flow: row;
    grid-auto-columns: unset;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow: visible;
    padding-bottom: 2px;
  }

  .config-options-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 960px) {
  #page-result {
    overflow: hidden;
  }

  .result-header {
    position: static;
    padding: 14px 24px;
  }

  .result-header-title {
    font-size: 15px;
  }

  .result-body {
    flex-direction: row;
    overflow: hidden;
  }

  .result-left {
    flex: 1 1 auto;
    height: auto;
  }

  .result-right {
    width: auto;
    flex: 0 0 clamp(320px, 31vw, 390px);
    overflow-y: auto;
  }

  .suggestion-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .config-options-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (min-width: 769px) and (max-width: 1199px) {
  .landing-content {
    padding: 24px 32px 40px;
  }
}

/* ── RESPONSIVE — LARGE SCREEN (≥1200px) ────────────────────── */

@media (min-width: 1200px) {
  .landing-content {
    max-width: 720px;
    padding: 32px 48px 48px;
  }

  .landing-headline {
    font-size: 3.75rem;
    margin-bottom: 40px;
  }

  .flyout-panel {
    width: 420px;
  }
}

/* ── RESPONSIVE — MOBILE ─────────────────────────────────────── */

@media (max-width: 768px) {
  html, body {
    overflow: hidden; /* Zelfde als desktop — pages scrollen intern */
  }

  /* WORTELFIX: alle pages als overlay (zelfde als desktop) */
  .page {
    position: fixed;
    inset: 0;
    min-height: unset;
    overflow-y: auto;
    overflow-x: hidden;
  }

  /* Landing */
  .landing-content {
    padding: 16px 20px 32px;
  }

  .landing-headline {
    font-size: clamp(1.9rem, 9vw, 2.6rem);
  }

  .photo-source-card {
    padding: 26px 16px 20px;
  }

  /* Flyout becomes bottom sheet on mobile */
  .flyout-panel {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 80vh;
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
  }

  .flyout-overlay.open .flyout-panel {
    transform: translateY(0);
  }
}

@media (max-width: 359px) {
  .result-header-title {
    display: none;
  }

  .radio-item {
    gap: 7px;
  }

  .radio-label {
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .avatar-dots span i {
    animation: none !important;
    opacity: 1;
    transform: none;
  }

  .mrjl-heart-box,
  .mrjl-heart-shadow {
    animation: none !important;
  }

  .render-loader,
  .suggestion-card,
  .radio-dot,
  .radio-dot::after {
    transition-duration: 0.01ms !important;
  }
}
