:root {
  --bg: #f3ead3;
  --panel: rgba(255, 250, 240, 0.84);
  --panel-strong: rgba(255, 252, 246, 0.96);
  --ink: #2a241b;
  --muted: #655a4d;
  --line: rgba(88, 64, 24, 0.14);
  --line-strong: rgba(88, 64, 24, 0.22);
  --saffron: #cc7d2f;
  --saffron-deep: #9f531a;
  --forest: #1f4a40;
  --forest-soft: #4c7168;
  --cream: #fff7ea;
  --shadow: 0 28px 90px rgba(76, 49, 12, 0.12);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --font-heading: "Fraunces", Georgia, serif;
  --font-body: "Manrope", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 10%, rgba(216, 178, 83, 0.24), transparent 22%),
    radial-gradient(circle at 88% 14%, rgba(31, 74, 64, 0.14), transparent 20%),
    linear-gradient(180deg, #f8f0df 0%, var(--bg) 52%, #ebddb9 100%);
  overflow: auto;
}

button,
input,
textarea,
select {
  font: inherit;
}

iframe {
  border: 0;
}

.ambient {
  position: fixed;
  border-radius: 50%;
  filter: blur(44px);
  pointer-events: none;
  opacity: 0.42;
}

.ambient-a {
  width: 280px;
  height: 280px;
  top: -60px;
  right: -40px;
  background: rgba(204, 125, 47, 0.24);
}

.ambient-b {
  width: 320px;
  height: 320px;
  left: -100px;
  bottom: -120px;
  background: rgba(31, 74, 64, 0.18);
}

.shell {
  position: relative;
  width: min(1880px, calc(100% - 12px));
  margin: 0 auto;
  padding: 6px;
}

.experience-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  border-radius: var(--radius-xl);
}

.panel-card,
.message .bubble,
.composer-card,
.card-grid article,
.info-strip,
.quick-replies button,
.site-stage-card,
.site-browser {
  background: var(--panel-strong);
  border: 1px solid rgba(88, 64, 24, 0.1);
  box-shadow: 0 14px 30px rgba(76, 53, 16, 0.08);
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--saffron-deep);
}

.chat-header h2,
.stage-title,
.panel-card h3,
.card-grid h4 {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1;
}

.panel-card p,
.message p,
.card-grid p,
.info-strip,
.quick-replies button,
label,
input,
textarea,
select,
.stage-topline p,
.browser-address {
  color: var(--muted);
}

.status-pill {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(31, 74, 64, 0.1);
  color: var(--forest);
  font-size: 13px;
  font-weight: 700;
}

.panel-root {
  display: grid;
  gap: 12px;
}

.panel-root:empty {
  display: none;
}

.guide-root {
  display: grid;
  gap: 12px;
}

.guide-root:empty {
  display: none;
}

.panel-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 22px;
}

.panel-card img {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: 18px;
}

.stats-grid,
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.parallel-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.stat-tile,
.field-shell {
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(88, 64, 24, 0.08);
}

.stat-tile strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 20px;
}

.panel-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.experience-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 8px;
  border-radius: 34px;
  padding: 10px;
  min-height: calc(100dvh - 12px);
}

.experience-panel.has-messages {
  grid-template-rows: auto auto auto auto auto;
}

.chat-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 4px 0 8px;
  border-bottom: 1px solid var(--line);
}

.chat-header h2 {
  grid-column: 2;
  justify-self: center;
  font-size: clamp(28px, 3.2vw, 48px);
  white-space: nowrap;
  line-height: 1.04;
}

.header-actions {
  grid-column: 3;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.site-stage-card {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 10px;
  border-radius: 28px;
  --preview-height: clamp(320px, 44dvh, 580px);
}

.experience-panel:not(.has-messages) .site-stage-card {
  --preview-height: clamp(380px, calc(100dvh - 320px), 640px);
}

.mobile-intro-card {
  display: none;
}

.site-browser {
  display: grid;
  gap: 0;
  border-radius: 24px;
  overflow: hidden;
  min-height: 0;
}

.browser-chrome {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding: 10px 14px;
  background: linear-gradient(180deg, rgba(255, 247, 234, 0.98), rgba(250, 241, 224, 0.92));
  border-bottom: 1px solid var(--line);
}

.browser-dots {
  display: inline-flex;
  gap: 8px;
}

.browser-dots span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: rgba(130, 102, 58, 0.22);
}

.browser-dots span:nth-child(1) {
  background: rgba(222, 98, 72, 0.48);
}

.browser-dots span:nth-child(2) {
  background: rgba(222, 177, 72, 0.48);
}

.browser-dots span:nth-child(3) {
  background: rgba(76, 167, 100, 0.48);
}

.site-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.site-actions {
  padding-top: 2px;
}

.browser-frame {
  position: relative;
  min-height: var(--preview-height);
  background: #ffffff;
}

.site-preview {
  display: block;
  width: 100%;
  height: var(--preview-height);
  min-height: var(--preview-height);
  background: #ffffff;
}

.site-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.site-tab:hover,
.site-tab:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(159, 83, 26, 0.18);
}

.site-tab.active {
  background: linear-gradient(135deg, rgba(204, 125, 47, 0.18), rgba(216, 178, 83, 0.24));
  border-color: rgba(159, 83, 26, 0.22);
  color: var(--ink);
}

.ghost-button,
.send-button,
.card-action,
.handoff-button {
  border: none;
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease, opacity 140ms ease;
}

.ghost-button,
.card-action,
.handoff-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(31, 74, 64, 0.1);
  color: var(--forest);
  font-weight: 700;
  text-decoration: none;
}

.send-button {
  padding: 16px 28px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--saffron) 0%, var(--saffron-deep) 100%);
  color: white;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.01em;
  box-shadow: 0 6px 20px rgba(159, 83, 26, 0.32);
}

.ghost-button:hover,
.card-action:hover,
.handoff-button:hover,
.send-button:hover,
.quick-replies button:hover {
  transform: translateY(-1px);
}

.handoff-button:disabled,
.send-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.handoff-button:disabled:hover,
.send-button:disabled:hover {
  transform: none;
}

.composer-actions {
  display: none;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.composer-actions.is-visible {
  display: flex;
}

.composer-actions .ghost-button {
  min-height: 44px;
}

.messages {
  padding: 8px 6px 0;
  display: grid;
  gap: 18px;
}

.messages.is-hidden {
  display: none;
}

.message {
  display: grid;
  gap: 10px;
  animation: rise-in 220ms ease;
}

.message.user {
  justify-items: end;
}

.message .bubble {
  max-width: min(860px, 100%);
  padding: 18px 20px;
  border-radius: 22px;
}

.message.assistant .bubble {
  border-top-left-radius: 8px;
}

.message.assistant.is-answer .bubble {
  background: linear-gradient(135deg, rgba(255, 244, 223, 0.96), rgba(255, 252, 246, 0.98));
  border-color: rgba(204, 125, 47, 0.26);
  box-shadow: 0 18px 36px rgba(139, 88, 23, 0.12);
}

.message.assistant.is-answer p,
.message.assistant.is-answer li {
  font-weight: 560;
}

.message.assistant.is-answer strong {
  color: var(--saffron-deep);
  font-weight: 750;
}

.message.user .bubble {
  border-top-right-radius: 8px;
  background: linear-gradient(135deg, rgba(204, 125, 47, 0.14), rgba(216, 178, 83, 0.22));
}

.message p,
.message li {
  margin: 0;
  line-height: 1.65;
}

.message p + p,
.message ul + p,
.message p + ul,
.message ol + p,
.message p + ol {
  margin-top: 10px;
}

.message ul,
.message ol {
  margin: 0;
  padding-left: 20px;
}

.attachments {
  display: grid;
  gap: 12px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.card-grid.card-carousel {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(280px, 360px);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: rgba(159, 83, 26, 0.3) transparent;
  padding: 0 2px 6px;
  scroll-padding-inline: 2px;
}

.card-grid.card-carousel article {
  scroll-snap-align: start;
}

.card-grid article {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(88, 64, 24, 0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(250, 244, 234, 0.92));
}

.choice-card.is-highlighted {
  border-color: rgba(159, 83, 26, 0.28);
  box-shadow: 0 18px 34px rgba(159, 83, 26, 0.12);
}

.choice-card .eyebrow {
  margin-bottom: 2px;
}

.card-grid h4 {
  font-size: 22px;
  line-height: 1.12;
}

.choice-card.is-compact {
  gap: 8px;
  padding: 14px;
}

.choice-card.is-compact .eyebrow {
  margin-bottom: 0;
  font-size: 11px;
}

.choice-card.is-compact h4 {
  font-size: 18px;
  line-height: 1.08;
}

.choice-card.is-compact .card-meta {
  margin-top: -2px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
  font-weight: 600;
}

.choice-card.is-compact .card-facts {
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
}

.choice-card.is-compact .fact-item {
  padding: 10px 11px;
  gap: 3px;
}

.choice-card.is-compact .fact-label {
  font-size: 10px;
}

.choice-card.is-compact .fact-value {
  font-size: 14px;
  line-height: 1.35;
}

.choice-card.is-compact .card-action {
  margin-top: 2px;
}

.card-description {
  margin: 0;
  color: var(--ink);
  line-height: 1.55;
}

.card-copy {
  color: var(--muted);
}

.card-copy p,
.card-copy ul,
.card-copy ol {
  margin: 0;
}

.card-copy p + p,
.card-copy ul + p,
.card-copy p + ul,
.card-copy ol + p,
.card-copy p + ol {
  margin-top: 8px;
}

.card-copy ul,
.card-copy ol {
  padding-left: 18px;
}

.card-meta {
  font-size: 13px;
  color: var(--forest-soft);
  font-weight: 700;
}

.card-facts,
.panel-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.fact-item {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(88, 64, 24, 0.08);
}

.fact-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--saffron-deep);
}

.fact-value {
  color: var(--ink);
  line-height: 1.5;
}

.card-tags,
.panel-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(204, 125, 47, 0.12);
  color: var(--saffron-deep);
  font-size: 12px;
  font-weight: 800;
}

.card-grid .card-action {
  width: 100%;
  margin-top: 4px;
}

.choice-card.is-highlighted .card-action {
  background: linear-gradient(135deg, var(--saffron) 0%, var(--saffron-deep) 100%);
  color: white;
}

.quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

/* Quick reply buttons — clearly saffron so users know to tap */
.quick-replies button {
  padding: 9px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--saffron);
  background: rgba(204, 125, 47, 0.08);
  color: var(--saffron-deep);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.quick-replies button:hover {
  background: rgba(204, 125, 47, 0.18);
  transform: translateY(-1px);
}

/* Primary quick replies (first button if only one option) */
.quick-replies button:only-child {
  background: linear-gradient(135deg, var(--saffron) 0%, var(--saffron-deep) 100%);
  color: white;
  border-color: transparent;
}

/* "Type your answer" nudge below the quick-replies row */
.quick-replies-hint {
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
  letter-spacing: 0.01em;
}

.composer-card {
  border-radius: 24px;
  padding: 14px 16px;
  border-color: rgba(159, 83, 26, 0.22) !important;
  box-shadow: 0 8px 36px rgba(159, 83, 26, 0.13), 0 0 0 1.5px rgba(204, 125, 47, 0.18);
  background: rgba(255, 252, 246, 0.98) !important;
  transition: box-shadow 0.25s, border-color 0.25s;
}

.composer-card.is-guided {
  border-color: var(--saffron) !important;
  box-shadow: 0 0 0 2.5px rgba(204, 125, 47, 0.25), 0 12px 36px rgba(159, 83, 26, 0.18);
}

.composer {
  display: grid;
  gap: 10px;
}

.composer-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.composer-prompt-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.composer-chat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--saffron) 0%, var(--saffron-deep) 100%);
  flex-shrink: 0;
  font-size: 13px;
  box-shadow: 0 3px 10px rgba(159, 83, 26, 0.3);
}

.composer-chat-icon::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--saffron);
  top: -2px;
  right: -2px;
  border: 2px solid var(--cream);
  animation: chat-ping 2s ease-in-out infinite;
}

.composer-heading {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1;
}

.composer-sub {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
  transition: color 0.2s;
}

/* In guided mode — sub text turns saffron as a nudge */
.composer-card.is-guided .composer-sub {
  color: var(--saffron-deep);
  font-weight: 600;
}

/* Guided mode heading shrinks slightly to be less dominant */
.composer-card.is-guided .composer-heading {
  font-size: 14px;
  color: var(--muted);
  font-weight: 500;
  font-family: var(--font-body);
}

/* The answer-label that replaces the heading in guided mode */
.composer-card.is-guided .composer-label {
  font-size: 15px;
  font-weight: 700;
  color: var(--saffron-deep);
  font-family: var(--font-heading);
}

@keyframes chat-ping {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(1.4); }
}

.composer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

textarea,
input,
select {
  width: 100%;
  border: 1px solid rgba(88, 64, 24, 0.12);
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.78);
  resize: none;
}

textarea.is-invalid,
input.is-invalid,
select.is-invalid {
  border-color: rgba(180, 59, 43, 0.72);
  background: rgba(255, 244, 242, 0.95);
}

textarea {
  min-height: 58px;
  max-height: 180px;
}

.field-shell {
  display: grid;
  gap: 8px;
}

.field-shell label {
  font-size: 13px;
  font-weight: 700;
}

.parallel-field-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.field-error {
  min-height: 18px;
  margin: 0;
  color: #b43b2b;
  font-size: 12px;
  font-weight: 700;
}

.parallel-form {
  display: grid;
  gap: 12px;
}

.parallel-form.is-submitting {
  opacity: 0.8;
}

.parallel-form-header {
  display: grid;
  gap: 8px;
}

.parallel-form-header h3 {
  font-size: 28px;
  line-height: 1.08;
}

.parallel-form-header p:last-child {
  margin: 0;
}

.parallel-form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.guide-card {
  background: linear-gradient(180deg, rgba(255, 252, 247, 0.98), rgba(247, 238, 221, 0.94));
  border-color: rgba(159, 83, 26, 0.14);
}

.review-actions {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.review-pay-button {
  width: 100%;
  font-size: 16px;
  min-height: 52px;
}

.composer-card.is-review-action .composer-row {
  grid-template-columns: 1fr;
}

.composer-card.is-review-action textarea {
  display: none;
}

.composer-card.is-review-action .send-button {
  width: 100%;
  min-height: 56px;
}

.guide-header {
  display: grid;
  gap: 8px;
}

.guide-header p:last-child {
  margin: 0;
}

.info-strip {
  padding: 12px 14px;
  border-radius: 16px;
  font-size: 14px;
}

.current-question-card {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(204, 125, 47, 0.12), rgba(216, 178, 83, 0.18));
  border: 1px solid rgba(159, 83, 26, 0.18);
}

.current-question-card h4 {
  margin: 0;
  font-size: 24px;
  line-height: 1.16;
}

.current-question-detail {
  margin: 0;
  color: var(--ink);
  line-height: 1.55;
}

.current-question-meta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 30px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--saffron-deep);
  font-size: 12px;
  font-weight: 800;
}

.question-flow {
  display: grid;
  gap: 10px;
}

.question-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.question-item {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(88, 64, 24, 0.1);
}

.question-item.is-current {
  background: linear-gradient(180deg, rgba(255, 249, 240, 0.96), rgba(248, 236, 213, 0.9));
  border-color: rgba(159, 83, 26, 0.18);
}

.question-item.is-done {
  background: rgba(242, 249, 245, 0.9);
  border-color: rgba(31, 74, 64, 0.14);
}

.question-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.question-prompt {
  display: grid;
  gap: 4px;
}

.question-step {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--saffron-deep);
}

.question-label {
  color: var(--ink);
  line-height: 1.45;
}

.question-detail {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  word-break: break-word;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-chip.is-current {
  background: rgba(159, 83, 26, 0.14);
  color: var(--saffron-deep);
}

.status-chip.is-done {
  background: rgba(31, 74, 64, 0.12);
  color: var(--forest);
}

.status-chip.is-upcoming,
.status-chip.is-optional {
  background: rgba(88, 64, 24, 0.08);
  color: var(--muted);
}

.review-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.selection-panel {
  background: linear-gradient(180deg, rgba(255, 251, 245, 0.98), rgba(248, 240, 225, 0.95));
  border-color: rgba(159, 83, 26, 0.16);
}

.typing {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.typing span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--saffron);
  animation: pulse 900ms infinite ease-in-out;
}

.typing span:nth-child(2) {
  animation-delay: 120ms;
}

.typing span:nth-child(3) {
  animation-delay: 240ms;
}

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

@keyframes pulse {
  0%,
  80%,
  100% {
    transform: scale(0.8);
    opacity: 0.45;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ── Scroll-margin so targets don't land flush at the viewport edge ── */
.card-action,
.quick-replies {
  scroll-margin-top: 80px;
  scroll-margin-bottom: 80px;
}

/* ── Attention animation — applied by JS after auto-scroll completes ── */
@keyframes attention-ring {
  0%   { box-shadow: 0 0 0 0 rgba(204, 125, 47, 0.6); }
  40%  { box-shadow: 0 0 0 10px rgba(204, 125, 47, 0.25); }
  100% { box-shadow: 0 0 0 14px rgba(204, 125, 47, 0); }
}

@keyframes attention-scale {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.03); }
}

/* Buttons: ring + subtle scale bounce */
.card-action.has-attention {
  animation: attention-ring 0.8s ease-out, attention-scale 0.6s ease-in-out 0.1s;
}

/* Quick-replies container: animate each child button with stagger */
.quick-replies.has-attention button {
  animation: attention-ring 0.7s ease-out, attention-scale 0.5s ease-in-out;
}
.quick-replies.has-attention button:nth-child(2) { animation-delay: 0.1s; }
.quick-replies.has-attention button:nth-child(3) { animation-delay: 0.2s; }

/* Composer: expanding glow ring */
.composer-card.has-attention {
  animation: attention-ring 0.8s ease-out 2;
}

/* Also keep the static saffron glow on guided composer so it's always visible */
.composer-card.is-guided {
  box-shadow: 0 0 0 2.5px rgba(204, 125, 47, 0.25), 0 12px 36px rgba(159, 83, 26, 0.18);
}

@media (max-width: 1200px) {
  .experience-panel:not(.has-messages) .site-stage-card {
    --preview-height: clamp(360px, calc(100dvh - 320px), 580px);
  }

  .site-preview,
  .browser-frame {
    height: 380px;
    min-height: 380px;
  }
}

@media (max-width: 1024px) {
  .experience-panel {
    min-height: calc(100dvh - 12px);
  }

  .experience-panel:not(.has-messages) .site-stage-card {
    --preview-height: clamp(340px, calc(100dvh - 300px), 520px);
  }

  .site-preview,
  .browser-frame {
    height: 360px;
    min-height: 360px;
  }
}

@media (max-width: 720px) {
  .shell {
    width: calc(100% - 8px);
    padding: 4px;
    gap: 10px;
  }

  .experience-panel,
  .experience-panel.has-messages {
    border-radius: 24px;
    min-height: calc(100dvh - 8px);
    padding: 8px;
    /* header | tabs | messages(fill) | panel | guide | composer */
    grid-template-rows: auto auto 1fr auto auto auto;
  }

  .experience-panel:not(.has-messages) {
    grid-template-rows: auto auto auto auto auto auto;
    align-content: start;
  }

  .chat-header {
    grid-template-columns: 1fr auto;
    row-gap: 4px;
    padding-bottom: 6px;
  }

  .chat-header h2 {
    grid-column: 1;
    font-size: clamp(15px, 4.2vw, 24px);
    white-space: nowrap;
  }

  .header-actions {
    grid-column: 2;
    justify-self: end;
    flex-wrap: wrap;
  }

  /* Status pill is dev info — hide on mobile to save space */
  .status-pill {
    display: none;
  }

  /* Compact reset button on mobile */
  .ghost-button {
    padding: 8px 12px;
    font-size: 12px;
  }

  .composer-actions .ghost-button {
    min-height: 42px;
    padding: 10px 14px;
    font-size: 13px;
  }

  /* Slightly larger tap targets for quick-reply buttons on mobile */
  .quick-replies button {
    min-height: 42px;
    padding: 10px 18px;
    font-size: 14px;
  }

  /* Card action buttons — full-width and taller on mobile */
  .card-grid .card-action {
    min-height: 48px;
    font-size: 15px;
  }

  /* Compact batch cards on mobile — less padding, smaller type */
  .card-grid article {
    padding: 12px;
    gap: 6px;
    border-radius: 14px;
  }

  .card-grid h4 {
    font-size: 17px;
  }

  .card-description {
    font-size: 13px;
    line-height: 1.4;
  }

  .choice-card.is-compact {
    padding: 11px;
    gap: 5px;
  }

  .choice-card.is-compact h4 {
    font-size: 16px;
  }

  .choice-card.is-compact .card-meta {
    font-size: 12px;
    line-height: 1.35;
  }

  .fact-item {
    padding: 8px 10px;
    border-radius: 10px;
    gap: 2px;
  }

  .fact-label {
    font-size: 10px;
  }

  .fact-value {
    font-size: 14px;
  }

  .card-facts,
  .panel-facts {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 6px;
  }

  .choice-card.is-compact .card-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
  }

  .choice-card.is-compact .fact-item {
    padding: 7px 8px;
  }

  .tag-chip {
    min-height: 26px;
    padding: 4px 10px;
    font-size: 11px;
  }

  .card-meta {
    font-size: 12px;
  }

  /* Carousel cards: narrower so user can see there are more */
  .card-grid.card-carousel {
    grid-auto-columns: min(300px, calc(100vw - 48px));
    grid-template-columns: unset;
  }

  /* On mobile: hide the iframe entirely — the BPSS site renders in desktop
     2-column layout and is unusable in a narrow iframe. Keep only the tabs. */
  .site-browser {
    display: none;
  }

  .site-stage-card {
    padding: 4px 4px 0;
    grid-template-rows: auto; /* tabs only, no iframe row */
    align-self: start;        /* don't stretch to fill 1fr */
  }

  .mobile-intro-card {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    align-items: start;
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255, 251, 245, 0.98), rgba(248, 240, 225, 0.94));
    border: 1px solid rgba(159, 83, 26, 0.12);
    box-shadow: 0 10px 24px rgba(90, 63, 19, 0.08);
  }

  .mobile-intro-image {
    width: 100%;
    height: clamp(132px, 22vh, 180px);
    object-fit: cover;
    object-position: center 30%;
    border-radius: 16px;
    display: block;
    box-shadow: 0 8px 18px rgba(80, 58, 18, 0.12);
  }

  .mobile-intro-copy {
    display: grid;
    gap: 8px;
    min-width: 0;
  }

  .mobile-intro-eyebrow {
    margin: 0;
    color: var(--forest);
    font-size: 15px;
    line-height: 1.14;
    font-weight: 800;
    letter-spacing: 0.01em;
  }

  .mobile-intro-text {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.48;
  }

  .experience-panel.has-messages .mobile-intro-card {
    display: none;
  }

  /* Compact, scrollable tab row on mobile */
  .site-tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 6px;
    justify-content: flex-start;
    scrollbar-width: none;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .site-tab {
    flex-shrink: 0;
    font-size: 12px;
    padding: 7px 12px;
    min-height: 34px;
  }

  /* Pin composer to row 6 so it's always at the bottom,
     even when messages/panel/guide are display:none */
  .composer-card {
    grid-row: 6;
  }

  .experience-panel:not(.has-messages) .composer-card {
    grid-row: auto;
    margin-top: 10px;
  }

  /* During registration: hide the tab area entirely — composer takes over */
  .experience-panel.is-registering .site-stage-card {
    display: none;
  }

  /* Extra space below the composer so the page CAN scroll far enough
     to center-align it in the viewport (otherwise it's stuck at the bottom) */
  .experience-panel.is-registering .composer-card {
    margin-bottom: 50vh;
  }

  /* On mobile during registration: hide the guide card, parallel form, and
     selection panel entirely. The chat flow asks questions one-by-one and
     confirms each answer — less clutter, more focus. The panel reappears
     in review mode (handled via .is-reviewing class). */
  .experience-panel.is-registering .guide-root,
  .experience-panel.is-registering .panel-root .selection-panel {
    display: none;
  }

  /* Cards in messages: always single column on mobile */
  .composer-row,
  .stats-grid,
  .form-grid,
  .parallel-form-grid,
  .card-grid,
  .question-grid {
    grid-template-columns: 1fr;
  }

  /* (carousel cards rule moved up near card compact section) */

  .browser-chrome {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}
