/* JaoJom AI — Ultra-luxury minimalist qualification funnel */

:root {
  --stone-50: #fafafa;
  --stone-100: #f5f5f4;
  --stone-200: #e7e5e4;
  --stone-300: #d6d3d1;
  --stone-400: #a8a29e;
  --stone-500: #78716c;
  --stone-700: #44403c;
  --stone-800: #292524;
  --stone-900: #1c1917;
  --white: #ffffff;
  --amber-400: #fbbf24;
  --amber-500: #f59e0b;
  --amber-600: #d97706;
  --ok: #16a34a;
  --danger: #dc2626;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font: "Vazirmatn", "Tahoma", sans-serif;
  --glass: rgba(255, 255, 255, 0.8);
  --glass-border: rgba(231, 229, 228, 0.6);
  --shadow-xl: 0 20px 50px rgba(28, 25, 23, 0.08), 0 2px 8px rgba(28, 25, 23, 0.03);
}

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

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--stone-50);
  color: var(--stone-800);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.scrollbar-none {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.scrollbar-none::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

/* ── Ambient depth ──────────────────────────────────── */
.app {
  position: relative;
  height: 100dvh;
  width: 100%;
  overflow: hidden;
  background: var(--stone-50);
}

.ambient {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background: var(--stone-100);
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(72px);
  will-change: transform, opacity;
  opacity: 0.55;
}

.orb-a {
  width: min(52vw, 420px);
  height: min(52vw, 420px);
  top: -8%;
  right: -6%;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.45) 0%, rgba(245, 158, 11, 0) 70%);
  animation: orbDriftA 14s ease-in-out infinite alternate;
}

.orb-b {
  width: min(60vw, 480px);
  height: min(60vw, 480px);
  bottom: 8%;
  left: -12%;
  background: radial-gradient(circle, rgba(217, 119, 6, 0.28) 0%, rgba(217, 119, 6, 0) 72%);
  animation: orbDriftB 18s ease-in-out infinite alternate;
}

.orb-c {
  width: min(40vw, 320px);
  height: min(40vw, 320px);
  top: 42%;
  left: 48%;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.22) 0%, rgba(251, 191, 36, 0) 70%);
  animation: orbDriftC 12s ease-in-out infinite alternate;
}

@keyframes orbDriftA {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-6%, 10%, 0) scale(1.08); }
}

@keyframes orbDriftB {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(10%, -8%, 0) scale(1.12); }
}

@keyframes orbDriftC {
  from { transform: translate3d(0, 0, 0) scale(0.95); opacity: 0.4; }
  to { transform: translate3d(-12%, 6%, 0) scale(1.15); opacity: 0.65; }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Phase 1: Intro ─────────────────────────────────── */
.intro {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 2rem;
  background: transparent;
  transition: transform 0.85s var(--ease), opacity 0.85s var(--ease);
  will-change: transform, opacity;
}

.intro.is-exit {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

.intro-inner {
  max-width: 36rem;
  text-align: center;
  position: relative;
  z-index: 1;
}

.intro-kicker {
  margin: 0 0 1rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--amber-600);
}

.intro-title {
  margin: 0;
  font-size: clamp(1.85rem, 5vw, 3rem);
  font-weight: 800;
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: var(--stone-800);
  min-height: 1.45em;
}

.intro-sub {
  margin: 1rem 0 0;
  font-size: clamp(1rem, 2.6vw, 1.15rem);
  font-weight: 500;
  line-height: 2;
  letter-spacing: 0.01em;
  color: var(--stone-500);
  min-height: 2em;
}

.intro-cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  margin-inline-start: 2px;
  background: var(--amber-500);
  vertical-align: -0.15em;
  animation: blink 0.9s step-end infinite;
}

.intro.is-done .intro-cursor {
  display: none;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* ── Funnel shell ───────────────────────────────────── */
.funnel {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  grid-template-rows: auto 1fr auto;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s var(--ease) 0.15s, transform 0.55s var(--ease) 0.15s;
}

.funnel.is-visible {
  opacity: 1;
  transform: none;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: calc(1rem + var(--safe-t)) 1.25rem 0.95rem;
  background: rgba(250, 250, 250, 0.55);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  border-bottom: 1px solid rgba(231, 229, 228, 0.45);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-mark {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 0.95rem;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--amber-500), var(--amber-600));
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  box-shadow: 0 10px 28px rgba(217, 119, 6, 0.28);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.brand-name {
  display: block;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--stone-800);
  line-height: 1.2;
}

.brand-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--stone-500);
  letter-spacing: 0.01em;
}

.status-dot {
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 50%;
  background: var(--amber-500);
  box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.55);
  animation: pulseGold 2s ease-out infinite;
}

@keyframes pulseGold {
  0% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.55);
    opacity: 1;
  }
  70% {
    box-shadow: 0 0 0 8px rgba(245, 158, 11, 0);
    opacity: 0.85;
  }
  100% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
    opacity: 1;
  }
}

/* ── Chat stream ────────────────────────────────────── */
.chat {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1.25rem 1.1rem 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  z-index: 1;
}

.msg {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-width: min(100%, 34rem);
  animation: fadeInUp 0.55s var(--ease) both;
}

.msg.ai { align-self: flex-start; }
.msg.user { align-self: flex-end; }

.bubble {
  padding: 1.05rem 1.2rem;
  border-radius: 1.5rem;
  line-height: 2;
  letter-spacing: 0.015em;
  font-size: 0.96rem;
  font-weight: 500;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--stone-800);
}

.msg.ai .bubble {
  background: var(--glass);
  backdrop-filter: blur(24px) saturate(1.25);
  -webkit-backdrop-filter: blur(24px) saturate(1.25);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-xl);
  border-bottom-right-radius: 0.55rem;
}

.msg.user .bubble {
  background: linear-gradient(145deg, rgba(245, 158, 11, 0.95), rgba(217, 119, 6, 0.98));
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-bottom-left-radius: 0.55rem;
  box-shadow: 0 16px 36px rgba(217, 119, 6, 0.22);
  letter-spacing: 0.02em;
}

.msg .meta {
  font-size: 0.66rem;
  color: var(--stone-400);
  padding-inline: 0.45rem;
  letter-spacing: 0.02em;
}

.msg.ai .meta { text-align: right; }
.msg.user .meta { text-align: left; }

.bubble .tip {
  display: block;
  margin-top: 0.85rem;
  padding: 0.85rem 0.95rem;
  border-radius: 1rem;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.16);
  color: var(--stone-700);
  font-size: 0.88rem;
  line-height: 1.9;
  letter-spacing: 0.01em;
}

/* Typing */
.thinking {
  display: inline-flex;
  gap: 0.38rem;
  align-items: center;
  padding: 0.95rem 1.15rem;
}

.thinking span {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--amber-500);
  animation: bounce 1.1s infinite ease-in-out;
}
.thinking span:nth-child(2) { animation-delay: 0.15s; }
.thinking span:nth-child(3) { animation-delay: 0.3s; }

@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-5px); opacity: 1; }
}

.bubble.is-streaming::after {
  content: "";
  display: inline-block;
  width: 0.42em;
  height: 1.05em;
  margin-inline-start: 0.12em;
  vertical-align: -0.12em;
  background: var(--amber-500);
  border-radius: 2px;
  animation: caretBlink 0.9s steps(1) infinite;
}

@keyframes caretBlink {
  0%, 45% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* In-stream action pills */
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  max-width: min(100%, 34rem);
  align-self: flex-start;
  padding-inline-start: 0.15rem;
  animation: fadeInUp 0.5s var(--ease) both;
}

.action-btn {
  appearance: none;
  border: 1px solid rgba(231, 229, 228, 0.9);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--stone-800);
  border-radius: 999px;
  padding: 0.72rem 1.15rem;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(28, 25, 23, 0.04);
  transition:
    transform 0.22s var(--ease),
    background 0.22s var(--ease),
    border-color 0.22s var(--ease),
    box-shadow 0.22s var(--ease),
    color 0.22s var(--ease);
}

.action-btn:hover {
  transform: translateY(-2px) scale(1.02);
  border-color: rgba(245, 158, 11, 0.55);
  box-shadow: 0 12px 28px rgba(245, 158, 11, 0.18), 0 0 0 4px rgba(245, 158, 11, 0.08);
  color: var(--amber-600);
}

.action-btn:active {
  transform: scale(0.96);
}

.action-btn.primary {
  background: linear-gradient(145deg, var(--amber-500), var(--amber-600));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 14px 30px rgba(217, 119, 6, 0.28);
}

.action-btn.primary:hover {
  color: #fff;
  box-shadow: 0 16px 34px rgba(217, 119, 6, 0.35), 0 0 0 4px rgba(245, 158, 11, 0.12);
}

.action-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.action-row.is-spent {
  opacity: 0.35;
  pointer-events: none;
}

/* Branch results block: carousel + actions below (never overlapping) */
.branch-block {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: min(100%, 36rem);
  max-width: 100%;
  align-self: stretch;
  animation: fadeInUp 0.55s var(--ease) both;
}

.branches-carousel {
  display: flex;
  overflow-x: auto;
  gap: 12px;
  padding: 8px 0;
  width: 100%;
  min-height: 180px;
  align-items: stretch;
  flex-wrap: nowrap;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  direction: ltr; /* critical: RTL scroll offset was hiding cards */
  scrollbar-width: thin;
  scrollbar-color: rgba(245, 158, 11, 0.45) transparent;
}

.branches-carousel::-webkit-scrollbar {
  height: 4px;
}

.branches-carousel::-webkit-scrollbar-thumb {
  background: rgba(245, 158, 11, 0.45);
  border-radius: 999px;
}

.branch-card {
  min-width: 230px;
  max-width: 260px;
  width: 240px;
  flex-shrink: 0;
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e0e0e0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  scroll-snap-align: start;
  direction: rtl;
  color: #292524;
  min-height: 280px;
  height: auto;
  opacity: 1;
  visibility: visible;
}

.branch-card-media {
  position: relative;
  width: 100%;
  height: 140px;
  min-height: 140px;
  background: linear-gradient(145deg, #fef3c7, #f5f5f4);
  overflow: hidden;
  flex-shrink: 0;
}

.branch-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 1;
  visibility: visible;
}

.branch-card-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
  background: rgba(255, 255, 255, 0.95);
  color: #292524;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  border: 1px solid #e7e5e4;
}

.branch-card-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 auto;
  min-height: 140px;
  background: #ffffff;
  color: #292524;
}

.branch-card-title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 800;
  color: #1c1917;
  line-height: 1.45;
}

.branch-card-meta {
  margin: 0;
  color: #78716c;
  font-size: 0.72rem;
  line-height: 1.5;
}

.branch-card-price {
  margin: 6px 0 0;
  font-weight: 800;
  color: #1c1917;
  font-size: 0.82rem;
}

.branch-card-price span {
  color: #d97706;
}

.branch-card-beds {
  margin: 0;
  color: #78716c;
  font-size: 0.7rem;
}

.branch-card-cta {
  margin-top: auto;
  width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 0.55rem 0.7rem;
  font-weight: 800;
  font-size: 0.75rem;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(145deg, #f59e0b, #d97706);
  box-shadow: 0 10px 22px rgba(217, 119, 6, 0.22);
}

.branch-card-cta:hover {
  filter: brightness(1.03);
}

.branch-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
}

.branch-actions .action-row {
  max-width: 100%;
  padding-inline-start: 0;
}

/* Legacy aliases (older markup) */
.cards,
.branch-carousel {
  display: flex;
  overflow-x: auto;
  gap: 12px;
  padding: 8px 0;
  width: 100%;
  min-height: 180px;
  align-items: stretch;
  direction: ltr;
}

.cards .card,
.branch-carousel .card {
  min-width: 230px;
  max-width: 260px;
  flex-shrink: 0;
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e0e0e0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  direction: rtl;
}

/* Success card */
.success-card {
  width: min(100%, 34rem);
  align-self: flex-start;
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(22, 163, 74, 0.18);
  border-radius: 1.5rem;
  padding: 1.35rem;
  box-shadow: var(--shadow-xl);
  animation: fadeInUp 0.55s var(--ease) both;
}

.success-card .ok-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(22, 163, 74, 0.12);
  color: var(--ok);
  font-size: 1.25rem;
  margin-bottom: 0.8rem;
}

.success-card h3 {
  margin: 0;
  font-size: 1.08rem;
  color: var(--stone-800);
  letter-spacing: 0.01em;
}

.success-card p {
  margin: 0.5rem 0 0;
  color: var(--stone-500);
  line-height: 1.95;
  font-size: 0.92rem;
}

/* Dock */
.dock {
  padding: 0.65rem 1.1rem calc(0.95rem + var(--safe-b));
  background: rgba(250, 250, 250, 0.62);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid rgba(231, 229, 228, 0.5);
  z-index: 2;
}

.composer {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  padding: 0.35rem 0.4rem 0.35rem 1rem;
  box-shadow: var(--shadow-xl);
  backdrop-filter: blur(12px);
}

.composer input {
  flex: 1;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--stone-800);
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  min-width: 0;
}

.composer input::placeholder {
  color: var(--stone-400);
}

.send {
  width: 2.55rem;
  height: 2.55rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(145deg, var(--amber-500), var(--amber-600));
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.2s, transform 0.22s var(--ease);
}

.send:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.send:not(:disabled):hover {
  transform: scale(1.04);
}

.dock-hint {
  margin: 0.5rem 0.35rem 0;
  font-size: 0.7rem;
  color: var(--stone-400);
  text-align: center;
  letter-spacing: 0.01em;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(1.25rem + var(--safe-b));
  transform: translateX(-50%) translateY(12px);
  background: var(--stone-800);
  color: #fff;
  padding: 0.75rem 1.15rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 50;
  opacity: 0;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
  max-width: min(92vw, 24rem);
  text-align: center;
}

.toast.is-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.is-error {
  background: var(--danger);
}

/* ── Booking bottom sheet (Phase 3) ─────────────────── */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.sheet[hidden] {
  display: none !important;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28, 25, 23, 0.42);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeInUp 0.3s var(--ease) both;
}

.sheet-panel {
  position: relative;
  width: min(100%, 480px);
  max-height: min(92dvh, 720px);
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(28px) saturate(1.25);
  -webkit-backdrop-filter: blur(28px) saturate(1.25);
  border: 1px solid rgba(231, 229, 228, 0.7);
  border-bottom: 0;
  border-radius: 1.75rem 1.75rem 0 0;
  box-shadow: 0 -20px 60px rgba(28, 25, 23, 0.16);
  padding: 0.65rem 1.25rem calc(1.35rem + var(--safe-b));
  animation: sheetUp 0.42s var(--ease) both;
}

@keyframes sheetUp {
  from { transform: translateY(110%); opacity: 0.6; }
  to { transform: translateY(0); opacity: 1; }
}

.sheet.is-closing .sheet-panel {
  animation: sheetDown 0.28s var(--ease) both;
}

.sheet.is-closing .sheet-backdrop {
  opacity: 0;
  transition: opacity 0.28s var(--ease);
}

@keyframes sheetDown {
  to { transform: translateY(110%); opacity: 0; }
}

.sheet-grab {
  width: 2.5rem;
  height: 0.28rem;
  border-radius: 999px;
  background: var(--stone-300);
  margin: 0.2rem auto 0.85rem;
}

.sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.sheet-kicker {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--amber-600);
  letter-spacing: 0.06em;
}

.sheet-head h2 {
  margin: 0.2rem 0 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--stone-800);
}

.sheet-branch {
  margin: 0.35rem 0 0;
  font-size: 0.84rem;
  color: var(--stone-500);
  line-height: 1.7;
}

.ghost-btn {
  width: 2.4rem;
  height: 2.4rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--stone-700);
  box-shadow: 0 8px 20px rgba(28, 25, 23, 0.06);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.2s var(--ease), background 0.2s;
}

.ghost-btn:hover {
  transform: translateY(-1px);
  background: var(--stone-100);
}

.sheet-close {
  flex-shrink: 0;
}

.sheet-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  margin-bottom: 1.15rem;
}

.sheet-step {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--stone-400);
}

.sheet-step.is-active {
  color: var(--amber-700);
}

.sheet-step.is-done {
  color: var(--ok);
}

.sheet-step-num {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  background: var(--stone-100);
  border: 1px solid var(--stone-200);
}

.sheet-step.is-active .sheet-step-num {
  background: linear-gradient(145deg, var(--amber-500), var(--amber-600));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.16);
}

.sheet-step.is-done .sheet-step-num {
  background: rgba(22, 163, 74, 0.12);
  color: var(--ok);
  border-color: rgba(22, 163, 74, 0.25);
}

.sheet-step-line {
  width: 2.2rem;
  height: 2px;
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.55), rgba(231, 229, 228, 0.9));
  border-radius: 999px;
}

.sheet-form {
  display: grid;
  gap: 0.85rem;
  animation: fadeInUp 0.4s var(--ease) both;
}

.field {
  display: grid;
  gap: 0.4rem;
}

.field > span {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--stone-700);
}

.field input {
  width: 100%;
  border: 1px solid var(--stone-200);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 1rem;
  padding: 0.85rem 1rem;
  font-size: 0.95rem;
  color: var(--stone-800);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field input:focus {
  border-color: rgba(245, 158, 11, 0.65);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.12);
}

.otp-input {
  letter-spacing: 0.45em;
  text-align: center;
  font-size: 1.35rem !important;
  font-weight: 800;
}

.otp-hint {
  margin: 0;
  font-size: 0.86rem;
  color: var(--stone-500);
  line-height: 1.8;
  text-align: center;
}

.sheet-cta {
  border: 0;
  border-radius: 999px;
  padding: 0.95rem 1.1rem;
  font-weight: 800;
  font-size: 0.95rem;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(145deg, var(--amber-500), var(--amber-600));
  box-shadow: 0 14px 32px rgba(217, 119, 6, 0.28);
  transition: transform 0.2s var(--ease), opacity 0.2s;
}

.sheet-cta:hover {
  transform: translateY(-1px);
}

.sheet-cta:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.sheet-resend {
  border: 0;
  background: transparent;
  color: var(--amber-700);
  font-weight: 700;
  font-size: 0.84rem;
  cursor: pointer;
  padding: 0.35rem;
}

.sheet-resend:disabled {
  color: var(--stone-400);
  cursor: not-allowed;
}

.dev-otp {
  margin: 0;
  text-align: center;
  font-size: 0.78rem;
  color: var(--amber-700);
  background: rgba(245, 158, 11, 0.08);
  border-radius: 0.75rem;
  padding: 0.55rem 0.7rem;
}

.sheet-loading {
  display: grid;
  place-items: center;
  gap: 0.75rem;
  padding: 1.5rem 0.5rem 1.75rem;
  animation: fadeInUp 0.35s var(--ease) both;
}

.sheet-loading[hidden] {
  display: none !important;
}

.sheet-spinner {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  border: 3px solid rgba(245, 158, 11, 0.18);
  border-top-color: var(--amber-500);
  animation: spinGold 0.8s linear infinite;
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.25);
}

@keyframes spinGold {
  to { transform: rotate(360deg); }
}

.sheet-loading p {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--stone-600);
}

.success-card a {
  color: var(--amber-600);
  font-weight: 700;
  text-decoration: none;
}

.success-card a:hover {
  text-decoration: underline;
}

.success-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.9rem;
}

.success-actions a,
.success-actions button {
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid var(--stone-200);
  background: #fff;
  color: var(--stone-800);
  cursor: pointer;
}

.success-actions a.primary {
  background: linear-gradient(145deg, var(--amber-500), var(--amber-600));
  color: #fff;
  border-color: transparent;
}

@media (min-width: 900px) {
  .funnel {
    max-width: 720px;
    margin: 0 auto;
  }

  .chat {
    padding: 1.6rem 1.5rem 1.85rem;
  }

  .dock {
    padding-inline: 1.5rem;
  }

  .topbar {
    padding-inline: 1.5rem;
  }
}

/* ── Puzzle action widget ───────────────────────────── */
.composer-wrap {
  position: relative;
}

.composer {
  padding-inline-start: 0.35rem;
}

.puzzle-btn {
  width: 2.55rem;
  height: 2.55rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(145deg, #fff7ed, #ffedd5);
  color: #9a3412;
  font-size: 1.2rem;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.35);
  transition: transform 0.2s var(--ease), box-shadow 0.2s;
}

.puzzle-btn:hover {
  transform: scale(1.05);
}

.puzzle-btn.is-pulse {
  animation: puzzlePulse 1.1s ease-in-out 2;
}

@keyframes puzzlePulse {
  0%, 100% { box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.35), 0 0 0 0 rgba(245, 158, 11, 0.35); }
  50% { box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.5), 0 0 0 8px rgba(245, 158, 11, 0); transform: scale(1.08); }
}

.puzzle-hint {
  position: absolute;
  bottom: calc(100% + 10px);
  right: 0.15rem;
  max-width: min(86vw, 16.5rem);
  background: #1c1917;
  color: #fff;
  border-radius: 14px;
  padding: 0.7rem 1.85rem 0.7rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.45;
  box-shadow: 0 10px 28px rgba(28, 25, 23, 0.22);
  z-index: 8;
  animation: hintIn 0.28s var(--ease);
}

.puzzle-hint[hidden] { display: none !important; }

.puzzle-hint p { margin: 0; }

.puzzle-hint-arrow {
  position: absolute;
  bottom: -6px;
  right: 1.05rem;
  width: 12px;
  height: 12px;
  background: #1c1917;
  transform: rotate(45deg);
  border-radius: 2px;
}

.puzzle-hint-close {
  position: absolute;
  top: 0.25rem;
  left: 0.35rem;
  border: 0;
  background: transparent;
  color: rgba(255,255,255,0.7);
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.2rem;
}

@keyframes hintIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.puzzle-sheet .puzzle-panel {
  max-height: min(92dvh, 860px);
  height: min(92dvh, 860px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0.65rem 0 calc(0.5rem + var(--safe-b));
}

.puzzle-sheet .puzzle-head {
  flex-shrink: 0;
  padding: 0 1.25rem;
}

.puzzle-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.puzzle-scroll {
  display: contents;
}

.puzzle-block {
  background: #fff;
  border: 1px solid rgba(231, 229, 228, 0.95);
  border-radius: 18px;
  padding: 0.95rem 1rem;
  box-shadow: 0 2px 10px rgba(28, 25, 23, 0.03);
}

.puzzle-block-title {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--stone-800);
}

.puzzle-branch-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.puzzle-branch-item {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.7rem 0.75rem;
  border-radius: 14px;
  border: 1px solid #e7e5e4;
  background: #fafaf9;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s;
}

.puzzle-branch-item.is-selected {
  border-color: #f59e0b;
  background: #fffbeb;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.12);
}

.puzzle-branch-item input {
  margin-top: 0.2rem;
  accent-color: #d97706;
  width: 1.05rem;
  height: 1.05rem;
}

.puzzle-branch-meta strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 800;
}

.puzzle-branch-meta span {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.78rem;
  color: var(--stone-500);
}

.puzzle-empty {
  margin: 0;
  font-size: 0.85rem;
  color: var(--stone-400);
}

.puzzle-rooms {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.puzzle-room-card {
  border: 1px solid #e7e5e4;
  border-radius: 12px;
  padding: 0.7rem 0.8rem;
  background: #fafaf9;
}

.puzzle-room-card h4 {
  margin: 0 0 0.35rem;
  font-size: 0.88rem;
  font-weight: 800;
}

.puzzle-room-card ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.puzzle-room-card li {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--stone-600);
  padding: 0.35rem 0.45rem;
  border-radius: 8px;
  background: #fff;
}

.puzzle-room-card li strong {
  color: var(--stone-800);
  font-weight: 700;
}

.puzzle-mortgage {
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--stone-600);
}

.puzzle-mortgage p {
  margin: 0 0 0.45rem;
}

.puzzle-mortgage strong {
  color: var(--stone-800);
}

.puzzle-check {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--stone-700);
  cursor: pointer;
  margin: 0.25rem 0 0.5rem;
}

.puzzle-check input {
  margin-top: 0.15rem;
  accent-color: #d97706;
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
}

.puzzle-support-block {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.puzzle-support-btn {
  width: 100%;
  border: 1px solid #e7e5e4;
  background: #fff;
  border-radius: 14px;
  padding: 0.95rem 1rem;
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--stone-800);
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s;
}

.puzzle-support-btn:hover {
  background: #fafaf9;
  border-color: #d6d3d1;
}

/* Support modal */
.support-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.support-modal[hidden] { display: none !important; }

.support-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28, 25, 23, 0.45);
  backdrop-filter: blur(6px);
}

.support-card {
  position: relative;
  width: min(100%, 22rem);
  background: #fff;
  border-radius: 22px;
  padding: 1.35rem 1.25rem 1.2rem;
  box-shadow: 0 24px 60px rgba(28, 25, 23, 0.22);
  z-index: 1;
  animation: hintIn 0.25s var(--ease);
}

.support-close {
  position: absolute;
  top: 0.65rem;
  left: 0.7rem;
  font-size: 1.35rem;
  line-height: 1;
  border: 0;
  background: transparent;
  color: var(--stone-400);
  cursor: pointer;
}

.support-kicker {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 800;
  color: #d97706;
  letter-spacing: 0.04em;
}

.support-card h3 {
  margin: 0.25rem 0 0.35rem;
  font-size: 1.15rem;
  font-weight: 800;
}

.support-hours {
  margin: 0 0 1rem;
  font-size: 0.8rem;
  color: var(--stone-500);
}

.support-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.support-action {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 0.9rem;
  border-radius: 14px;
  border: 1px solid #e7e5e4;
  text-decoration: none;
  color: inherit;
  background: #fafaf9;
  transition: border-color 0.18s, background 0.18s;
}

.support-action:hover {
  border-color: #f59e0b;
  background: #fffbeb;
}

.support-action-icon {
  font-size: 1.35rem;
  line-height: 1;
}

.support-action strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 800;
}

.support-action small {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.78rem;
  color: var(--stone-500);
  direction: ltr;
  text-align: right;
}

@media (min-width: 900px) {
  .puzzle-sheet .puzzle-panel {
    max-width: 480px;
    margin-inline: auto;
    border-radius: 24px 24px 0 0;
  }
}

/* ── Puzzle action widget ───────────────────────────── */
.composer-wrap {
  position: relative;
}

.composer {
  padding-inline-start: 0.35rem;
}

.puzzle-btn {
  width: 2.55rem;
  height: 2.55rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(145deg, #fff7ed, #ffedd5);
  color: #9a3412;
  font-size: 1.2rem;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.35);
  transition: transform 0.2s var(--ease), box-shadow 0.2s;
}

.puzzle-btn:hover {
  transform: scale(1.05);
}

.puzzle-btn.is-pulse {
  animation: puzzlePulse 1.1s ease-in-out 2;
}

@keyframes puzzlePulse {
  0%, 100% { box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.35), 0 0 0 0 rgba(245, 158, 11, 0.35); }
  50% { box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.5), 0 0 0 8px rgba(245, 158, 11, 0); transform: scale(1.08); }
}

.puzzle-hint {
  position: absolute;
  bottom: calc(100% + 10px);
  right: 0.15rem;
  max-width: min(86vw, 16.5rem);
  background: #1c1917;
  color: #fff;
  border-radius: 14px;
  padding: 0.7rem 1.85rem 0.7rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.45;
  box-shadow: 0 10px 28px rgba(28, 25, 23, 0.22);
  z-index: 8;
  animation: hintIn 0.28s var(--ease);
}

.puzzle-hint[hidden] { display: none !important; }

.puzzle-hint p { margin: 0; }

.puzzle-hint-arrow {
  position: absolute;
  bottom: -6px;
  right: 1.05rem;
  width: 12px;
  height: 12px;
  background: #1c1917;
  transform: rotate(45deg);
  border-radius: 2px;
}

.puzzle-hint-close {
  position: absolute;
  top: 0.25rem;
  left: 0.35rem;
  border: 0;
  background: transparent;
  color: rgba(255,255,255,0.7);
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.2rem;
}

@keyframes hintIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.puzzle-sheet .puzzle-panel {
  max-height: min(92dvh, 860px);
  height: min(92dvh, 860px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0.65rem 0 calc(0.5rem + var(--safe-b));
}

.puzzle-sheet .puzzle-head {
  flex-shrink: 0;
  padding: 0 1.25rem;
}

.puzzle-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.puzzle-scroll {
  display: contents;
}

.puzzle-block {
  background: #fff;
  border: 1px solid rgba(231, 229, 228, 0.95);
  border-radius: 18px;
  padding: 0.95rem 1rem;
  box-shadow: 0 2px 10px rgba(28, 25, 23, 0.03);
}

.puzzle-block-title {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--stone-800);
}

.puzzle-branch-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.puzzle-branch-item {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.7rem 0.75rem;
  border-radius: 14px;
  border: 1px solid #e7e5e4;
  background: #fafaf9;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s;
}

.puzzle-branch-item.is-selected {
  border-color: #f59e0b;
  background: #fffbeb;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.12);
}

.puzzle-branch-item input {
  margin-top: 0.2rem;
  accent-color: #d97706;
  width: 1.05rem;
  height: 1.05rem;
}

.puzzle-branch-meta strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 800;
}

.puzzle-branch-meta span {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.78rem;
  color: var(--stone-500);
}

.puzzle-empty {
  margin: 0;
  font-size: 0.85rem;
  color: var(--stone-400);
}

.puzzle-rooms {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.puzzle-room-card {
  border: 1px solid #e7e5e4;
  border-radius: 12px;
  padding: 0.7rem 0.8rem;
  background: #fafaf9;
}

.puzzle-room-card h4 {
  margin: 0 0 0.35rem;
  font-size: 0.88rem;
  font-weight: 800;
}

.puzzle-room-card ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.puzzle-room-card li {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--stone-600);
  padding: 0.35rem 0.45rem;
  border-radius: 8px;
  background: #fff;
}

.puzzle-room-card li strong {
  color: var(--stone-800);
  font-weight: 700;
}

.puzzle-mortgage {
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--stone-600);
}

.puzzle-mortgage p {
  margin: 0 0 0.45rem;
}

.puzzle-mortgage strong {
  color: var(--stone-800);
}

.puzzle-check {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--stone-700);
  cursor: pointer;
  margin: 0.25rem 0 0.5rem;
}

.puzzle-check input {
  margin-top: 0.15rem;
  accent-color: #d97706;
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
}

.puzzle-support-block {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.puzzle-support-btn {
  width: 100%;
  border: 1px solid #e7e5e4;
  background: #fff;
  border-radius: 14px;
  padding: 0.95rem 1rem;
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--stone-800);
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s;
}

.puzzle-support-btn:hover {
  background: #fafaf9;
  border-color: #d6d3d1;
}

/* Support modal */
.support-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.support-modal[hidden] { display: none !important; }

.support-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28, 25, 23, 0.45);
  backdrop-filter: blur(6px);
}

.support-card {
  position: relative;
  width: min(100%, 22rem);
  background: #fff;
  border-radius: 22px;
  padding: 1.35rem 1.25rem 1.2rem;
  box-shadow: 0 24px 60px rgba(28, 25, 23, 0.22);
  z-index: 1;
  animation: hintIn 0.25s var(--ease);
}

.support-close {
  position: absolute;
  top: 0.65rem;
  left: 0.7rem;
  font-size: 1.35rem;
  line-height: 1;
  border: 0;
  background: transparent;
  color: var(--stone-400);
  cursor: pointer;
}

.support-kicker {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 800;
  color: #d97706;
  letter-spacing: 0.04em;
}

.support-card h3 {
  margin: 0.25rem 0 0.35rem;
  font-size: 1.15rem;
  font-weight: 800;
}

.support-hours {
  margin: 0 0 1rem;
  font-size: 0.8rem;
  color: var(--stone-500);
}

.support-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.support-action {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 0.9rem;
  border-radius: 14px;
  border: 1px solid #e7e5e4;
  text-decoration: none;
  color: inherit;
  background: #fafaf9;
  transition: border-color 0.18s, background 0.18s;
}

.support-action:hover {
  border-color: #f59e0b;
  background: #fffbeb;
}

.support-action-icon {
  font-size: 1.35rem;
  line-height: 1;
}

.support-action strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 800;
}

.support-action small {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.78rem;
  color: var(--stone-500);
  direction: ltr;
  text-align: right;
}

@media (min-width: 900px) {
  .puzzle-sheet .puzzle-panel {
    max-width: 480px;
    margin-inline: auto;
    border-radius: 24px 24px 0 0;
  }
}

/* -- Puzzle wizard layout fix (view isolation + sticky footer) -- */
.puzzle-view {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
  flex: 1 1 auto;
  height: 100%;
  overflow: hidden;
}

.puzzle-view[hidden],
.puzzle-step[hidden],
.puzzle-guidance[hidden],
.puzzle-visit-form[hidden],
.puzzle-form-guidance[hidden],
.puzzle-visit-success[hidden],
.puzzle-form-error[hidden],
.puzzle-form-branch[hidden] {
  display: none !important;
}

.puzzle-view-menu {
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0.5rem 1.25rem 1rem;
}

.puzzle-view-wizard {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.puzzle-menu-cards {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 0.25rem 0 0.5rem;
}

.puzzle-menu-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  text-align: right;
  border: 1px solid #e7e5e4;
  background: #fff;
  border-radius: 18px;
  padding: 1.05rem 1rem;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(28, 25, 23, 0.03);
  transition: border-color 0.18s, background 0.18s, transform 0.18s, box-shadow 0.18s;
}

.puzzle-menu-card:hover {
  border-color: #f59e0b;
  background: #fffbeb;
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.12);
  transform: translateY(-1px);
}

.puzzle-menu-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  background: linear-gradient(145deg, #fff7ed, #ffedd5);
  flex-shrink: 0;
}

.puzzle-menu-body {
  flex: 1;
  min-width: 0;
}

.puzzle-menu-body strong {
  display: block;
  font-size: 1rem;
  font-weight: 800;
  color: var(--stone-800);
}

.puzzle-menu-body small {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.78rem;
  color: var(--stone-500);
  line-height: 1.45;
}

.puzzle-menu-chevron {
  font-size: 1.4rem;
  color: var(--stone-400);
  flex-shrink: 0;
}

.puzzle-stepper {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.35rem;
  margin: 0;
  padding: 0.35rem 1.25rem 0.85rem;
  background: #fff;
  border-bottom: 1px solid #f1f5f9;
  z-index: 2;
}

.puzzle-step-dot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  min-width: 4.2rem;
  position: relative;
  z-index: 1;
}

.puzzle-step-dot span {
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 800;
  background: #f8fafc;
  color: var(--stone-500);
  border: 1px solid #e2e8f0;
}

.puzzle-step-dot small {
  font-size: 0.68rem;
  color: var(--stone-400);
  font-weight: 700;
  text-align: center;
  line-height: 1.3;
  max-width: 4.8rem;
}

.puzzle-step-dot.is-active span {
  background: linear-gradient(145deg, #f59e0b, #d97706);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18);
}

.puzzle-step-dot.is-active small {
  color: #b45309;
}

.puzzle-step-dot.is-done span {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.puzzle-step-line {
  flex: 1;
  height: 2px;
  background: #e2e8f0;
  border-radius: 99px;
  margin-top: 0.9rem;
  align-self: flex-start;
}

.puzzle-wizard-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.puzzle-guidance-option {
  margin-top: 0.35rem;
  border-style: dashed;
  background: #fff7ed;
}

.puzzle-guidance-option.is-selected {
  border-style: solid;
}

.puzzle-guidance {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 14px;
  padding: 0.95rem 1rem;
  margin-bottom: 0.75rem;
}

.puzzle-guidance p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--stone-700);
  font-weight: 600;
}

.puzzle-room-branch {
  margin: 0 0 0.35rem;
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--stone-800);
}

.puzzle-soldout-banner {
  margin: 0 0 0.65rem;
  padding: 0.7rem 0.8rem;
  border-radius: 12px;
  background: #f5f5f4;
  border: 1px solid #e7e5e4;
  font-size: 0.82rem;
  line-height: 1.65;
  color: var(--stone-600);
}

.puzzle-room-card {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.75rem 0.8rem;
  border-radius: 14px;
  border: 1px solid #e7e5e4;
  background: #fafaf9;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
}

.puzzle-room-card input {
  margin-top: 0.2rem;
  accent-color: #d97706;
  width: 1.05rem;
  height: 1.05rem;
}

.puzzle-room-card.is-selected {
  border-color: #f59e0b;
  background: #fffbeb;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.12);
}

.puzzle-room-card.is-soldout {
  cursor: not-allowed;
  opacity: 0.62;
  background: #f5f5f4;
  border-color: #e7e5e4;
  box-shadow: none;
}

.puzzle-room-card.is-soldout input {
  pointer-events: none;
}

.puzzle-room-meta {
  flex: 1;
  min-width: 0;
}

.puzzle-room-meta strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--stone-800);
}

.puzzle-room-meta span {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.78rem;
  color: var(--stone-500);
}

.puzzle-urgency-badge {
  display: inline-block;
  margin-top: 0.4rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.4;
}

.puzzle-urgency-badge.is-high {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fdba74;
  animation: puzzleUrgencyPulse 1.8s ease-in-out infinite;
}

.puzzle-urgency-badge.is-moderate {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.puzzle-urgency-badge.is-soldout {
  background: #e7e5e4;
  color: #57534e;
  border: 1px solid #d6d3d1;
}

@keyframes puzzleUrgencyPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.28); }
  50% { box-shadow: 0 0 0 5px rgba(245, 158, 11, 0); }
}

.puzzle-form-hint {
  margin: 0 0 0.65rem;
  font-size: 0.82rem;
  color: var(--stone-500);
  line-height: 1.55;
}

.puzzle-form-branch {
  margin: 0 0 0.85rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--stone-700);
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 12px;
  padding: 0.65rem 0.8rem;
}

.puzzle-visit-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.puzzle-visit-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--stone-700);
}

.puzzle-visit-form input,
.puzzle-visit-form select,
.puzzle-visit-form textarea {
  width: 100%;
  border: 1px solid #e7e5e4;
  background: #fff;
  border-radius: 12px;
  padding: 0.7rem 0.8rem;
  font: inherit;
  font-weight: 500;
  color: var(--stone-800);
}

.puzzle-visit-form input:focus,
.puzzle-visit-form select:focus,
.puzzle-visit-form textarea:focus {
  outline: none;
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.14);
}

.puzzle-visit-form textarea {
  resize: vertical;
  min-height: 4.5rem;
}

.puzzle-form-error {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: #b45309;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
}

.puzzle-form-guidance {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 14px;
  padding: 0.95rem 1rem;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--stone-700);
  font-weight: 600;
}

.puzzle-visit-success {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 14px;
  padding: 1rem;
  color: #065f46;
}

.puzzle-visit-success p {
  margin: 0 0 0.4rem;
  line-height: 1.65;
}

.puzzle-visit-success-title {
  font-weight: 800;
}

.puzzle-wizard-nav {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 1.25rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.95);
  border-top: 1px solid #f1f5f9;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 3;
}

.puzzle-nav-back {
  flex: 0 0 auto;
  border: 1px solid #e7e5e4;
  background: #fff;
  border-radius: 14px;
  padding: 0.85rem 1rem;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--stone-700);
  cursor: pointer;
}

.puzzle-nav-back:hover {
  background: #fafaf9;
}

.puzzle-nav-next {
  flex: 1;
  margin: 0;
}

.puzzle-nav-next:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.puzzle-step-form {
  padding-bottom: 0.5rem;
}

.puzzle-sheet[data-puzzle-view="menu"] .puzzle-view-wizard {
  display: none !important;
}

.puzzle-sheet[data-puzzle-view="wizard"] .puzzle-view-menu {
  display: none !important;
}

@media (min-width: 900px) {
  .puzzle-sheet .puzzle-panel {
    max-width: 480px;
    margin-inline: auto;
    border-radius: 24px 24px 0 0;
  }
}

