:root {
  color-scheme: light;
  --paper: #FAF3E7;
  --paper-2: #F2E7D2;
  --ink: #1C1A17;
  --ink-2: #332c25;
  --ink-soft: #51493F;
  --primary: #FF5233;
  --teal: #138F84;
  --gold: #FFC53D;
  --white: #FFFFFF;
  --cream: #FFF9EF;
  --primary-soft: #FFE1D9;
  --teal-soft: #DFF3EF;
  --gold-soft: #FFF2BF;
  --radius: 22px;
  --button-radius: 16px;
  --shadow: 0 26px 60px -22px rgba(20, 17, 15, .6);
  --soft-shadow: 0 18px 42px -28px rgba(20, 17, 15, .6);
  --tomato-shadow: 0 20px 42px -18px rgba(255, 82, 51, .72);
  --tomato-shadow-strong: 0 18px 58px -12px rgba(255, 82, 51, .95);
  --focus: 0 0 0 4px rgba(255, 82, 51, .18);
  --result-gradient: linear-gradient(145deg, var(--ink), var(--ink-2));
  --tomato-glow: radial-gradient(circle at 82% 12%, rgba(255, 82, 51, .45), transparent 34%);
  --page-gold-glow: radial-gradient(circle at top left, rgba(255, 197, 61, .28), transparent 30rem);
  --glass: rgba(255, 255, 255, .08);
  --pulse-start: 0 0 0 0 rgba(255, 82, 51, .32);
  --pulse-end: 0 0 0 8px rgba(255, 82, 51, 0);
  --display: "Fraunces", Georgia, serif;
  --body: "Hanken Grotesk", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 0;
  background: var(--paper);
}

body {
  min-width: 0;
  min-height: 100vh;
  margin: 0;
  background:
    var(--page-gold-glow),
    linear-gradient(180deg, var(--cream), var(--paper));
  color: var(--ink);
  font-family: var(--body);
  overflow-x: hidden;
}

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

button {
  border: 0;
  cursor: pointer;
}

button:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: .58;
}

input,
select,
textarea {
  width: 100%;
  border: 1.5px solid var(--paper-2);
  border-radius: var(--button-radius);
  background: var(--white);
  color: var(--ink);
  outline: none;
}

input,
select {
  min-height: 46px;
  padding: 0 14px;
}

textarea {
  min-height: 110px;
  padding: 13px 14px;
  resize: vertical;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: var(--focus);
}

.sr-only,
.mic-btn span:not([aria-hidden="true"]) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  width: min(1180px, calc(100vw - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 22px 0 34px;
}

.topbar {
  display: grid;
  gap: 30px;
  margin-bottom: 22px;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-wordmark {
  color: var(--ink);
  font-family: var(--display);
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  text-decoration: none;
  white-space: nowrap;
}

.brand-wordmark span {
  color: var(--primary);
}

.top-controls {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.status-pill,
.language-pill,
.login-btn {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
}

.status-pill {
  padding: 0 14px;
  background: var(--ink);
  color: var(--paper);
}

.status-pill.busy {
  background: var(--gold);
  color: var(--ink);
}

.status-pill.error {
  background: var(--primary);
  color: var(--white);
}

.language-pill {
  position: relative;
  background: var(--paper-2);
  color: var(--ink);
}

.language-pill::before {
  content: "LANG";
  padding-left: 14px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
}

.language-select {
  width: 78px;
  min-height: 42px;
  padding: 0 28px 0 9px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-weight: 700;
}

.login-btn {
  padding: 0 17px;
  border: 1.5px solid var(--paper-2);
  background: transparent;
  color: var(--ink);
}

.brand-copy {
  min-width: 0;
  width: 100%;
  max-width: 690px;
}

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

h1,
h2,
h3 {
  margin: 0;
  color: var(--ink);
  font-family: var(--display);
  letter-spacing: 0;
}

h1 {
  max-width: 720px;
  font-size: clamp(48px, 8vw, 92px);
  font-weight: 650;
  line-height: .92;
}

h1 em {
  color: var(--primary);
  font-style: italic;
}

h2 {
  font-size: clamp(34px, 5vw, 58px);
  font-weight: 650;
  line-height: .98;
}

h3 {
  font-size: 31px;
  font-weight: 650;
  line-height: 1.05;
}

.brand-subtitle,
.step-copy,
.challenge-intro {
  max-width: 560px;
  margin: 14px 0 0;
  color: var(--ink-soft);
  font-size: 18px;
  line-height: 1.5;
}

.consumer-layout {
  display: block;
}

.step-panel {
  animation: fade .35s ease both;
}

body[data-step="setup"] .conversation-panel,
body[data-step="setup"] .result-panel,
body[data-step="interview"] .story-setup,
body[data-step="interview"] .result-panel,
body[data-step="result"] .story-setup,
body[data-step="result"] .conversation-panel {
  display: none;
}

body[data-step="setup"] .story-setup,
body[data-step="interview"] .conversation-panel,
body[data-step="result"] .result-panel {
  display: grid;
}

.story-setup {
  grid-template-columns: minmax(300px, .92fr) minmax(0, 1.08fr);
  gap: 28px;
  align-items: start;
}

.hero-photo {
  position: relative;
  min-height: 540px;
  display: grid;
  place-items: center;
  padding: 34px;
  overflow: hidden;
  border: 1.5px solid var(--paper-2);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 68% 20%, var(--gold-soft), transparent 34%),
    radial-gradient(circle at 18% 72%, var(--teal-soft), transparent 35%),
    linear-gradient(150deg, var(--white), var(--paper-2));
  box-shadow: var(--soft-shadow);
}

.hero-photo::before,
.hero-photo::after {
  content: none;
}

.share-preview-card {
  width: min(100%, 420px);
  min-height: 470px;
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 28px;
  border-radius: calc(var(--radius) + 8px);
  background:
    var(--tomato-glow),
    var(--result-gradient);
  color: var(--paper);
  box-shadow: var(--shadow);
}

.share-preview-tag {
  width: fit-content;
  margin: 0;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.share-preview-name {
  color: var(--paper);
  font-family: var(--display);
  font-size: clamp(34px, 4vw, 52px);
  font-weight: 650;
  line-height: .98;
}

.share-preview-qa {
  display: grid;
  gap: 7px;
  padding: 13px 14px;
  border-left: 5px solid var(--primary);
  border-radius: 0 16px 16px 0;
  background: var(--glass);
}

.share-preview-qa span {
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.share-preview-qa strong {
  color: var(--paper);
  font-family: var(--display);
  font-size: 19px;
  line-height: 1.1;
}

.share-preview-qa p {
  margin: 0;
  color: var(--paper-2);
  line-height: 1.4;
}

.share-preview-foot {
  align-self: end;
  margin-top: auto;
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.panel-body,
.challenge-card {
  min-width: 0;
}

.setup-body {
  display: grid;
  gap: 18px;
}

.compact-heading {
  display: grid;
  gap: 6px;
}

.setup-body .compact-heading h2 {
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.04;
}

.setup-body .step-copy {
  max-width: 520px;
  font-size: 16px;
}

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

.template-btn {
  min-width: 0;
  min-height: 132px;
  padding: 17px;
  border: 1.5px solid var(--paper-2);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 0 0 0 transparent;
  transition:
    transform .18s ease,
    border-color .18s ease,
    box-shadow .18s ease,
    background .18s ease;
}

.template-btn:hover,
.template-btn:focus-visible {
  transform: translateY(-3px);
  border-color: var(--ink);
  box-shadow: var(--shadow);
}

.template-btn.active {
  border-color: var(--ink);
  background: var(--cream);
  box-shadow: var(--soft-shadow);
}

.template-card-inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 13px;
  align-items: start;
}

.pemoji {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: var(--primary-soft);
  color: var(--ink);
  font-size: 24px;
}

.template-btn[data-template="roast"] .pemoji,
.template-btn[data-template="partychaos"] .pemoji {
  background: var(--gold-soft);
}

.template-btn[data-template="firstdate"] .pemoji,
.template-btn[data-template="partner"] .pemoji {
  background: var(--teal-soft);
}

.template-copy h3 {
  margin: 0;
  color: var(--ink);
  font-family: var(--display);
  font-size: 20px;
  line-height: 1.05;
}

.template-copy p {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.35;
}

.template-cta {
  width: fit-content;
  display: inline-flex;
  margin-top: 13px;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--white);
  font-size: 12px;
  font-weight: 700;
}

.template-arrow {
  color: var(--primary);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}

.mic-permission-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border: 1.5px solid var(--paper-2);
  border-radius: var(--radius);
  background: var(--cream);
}

.mic-permission-box strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 16px;
}

.mic-permission-box p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.4;
}

.mic-permission-box[data-permission="granted"] {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.advanced-settings {
  overflow: hidden;
  border: 1.5px solid var(--paper-2);
  border-radius: var(--radius);
  background: var(--white);
}

.advanced-settings summary {
  min-height: 56px;
  display: flex;
  align-items: center;
  padding: 0 18px;
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 0 18px 18px;
}

.field-stack,
.settings-range {
  display: grid;
  gap: 8px;
}

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

.settings-focus {
  grid-column: 1 / -1;
}

.range-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 10px;
  align-items: center;
}

input[type="range"] {
  min-height: auto;
  padding: 0;
  accent-color: var(--primary);
}

#questionCount {
  min-height: 40px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--ink);
  font-weight: 700;
}

.toggle-row {
  display: flex;
  gap: 10px;
  align-items: center;
  align-self: end;
  min-height: 46px;
  color: var(--ink);
  font-weight: 700;
}

.toggle-row input {
  width: 20px;
  min-height: 20px;
  accent-color: var(--primary);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.primary-btn,
.secondary-btn,
.ghost-btn {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: var(--button-radius);
  padding: 0 20px;
  font-weight: 700;
  transition:
    transform .18s ease,
    box-shadow .18s ease,
    background .18s ease;
}

.primary-btn {
  background: var(--primary);
  color: var(--white);
  box-shadow: var(--tomato-shadow);
}

.secondary-btn {
  background: var(--teal);
  color: var(--white);
}

.ghost-btn {
  background: transparent;
  color: var(--ink);
  box-shadow: none;
}

.primary-btn:not(:disabled):hover,
.secondary-btn:not(:disabled):hover,
.ghost-btn:not(:disabled):hover {
  transform: translateY(-2px);
}

.setup-actions .primary-btn {
  width: 100%;
  min-height: 56px;
}

.conversation-panel {
  min-height: calc(100vh - 152px);
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  grid-template-areas:
    "head head"
    "state transcript"
    "caption transcript"
    "wave transcript"
    "composer transcript"
    "actions transcript";
  gap: 18px 18px;
  align-items: start;
}

.interview-head {
  grid-area: head;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 260px) auto;
  align-items: end;
  gap: 20px;
}

.interview-status {
  align-self: end;
}

.progress-wrap {
  width: min(260px, 40vw);
  display: grid;
  gap: 8px;
}

.progress-wrap span {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
  text-align: right;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--paper-2);
}

#progressBar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  transition: width .25s ease;
}

.voice-state-card {
  grid-area: state;
  width: fit-content;
  max-width: 100%;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 17px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
}

.voice-state-card::before {
  content: "";
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--primary);
  animation: pulse 1.35s ease-in-out infinite;
}

.caption-panel {
  grid-area: caption;
  max-width: 610px;
  display: grid;
  gap: 14px;
}

.caption-panel span {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.caption-panel p {
  margin: 0;
  color: var(--ink);
  font-family: var(--display);
  font-size: clamp(34px, 6vw, 62px);
  font-weight: 650;
  line-height: 1;
}

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

.interview-wave {
  grid-area: wave;
  min-height: 72px;
}

.wave span {
  width: 9px;
  height: 44px;
  display: block;
  border-radius: 999px;
  background: var(--primary);
  transform-origin: center;
  animation: bounce 1s ease-in-out infinite;
}

.wave span:nth-child(2) {
  animation-delay: .1s;
}

.wave span:nth-child(3) {
  animation-delay: .2s;
}

.wave span:nth-child(4) {
  animation-delay: .3s;
}

.wave span:nth-child(5) {
  animation-delay: .4s;
}

.messages {
  grid-area: transcript;
  align-self: stretch;
  max-height: calc(100vh - 180px);
  min-height: 520px;
  overflow: auto;
  padding: 16px;
  border: 1.5px solid var(--paper-2);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--soft-shadow);
}

.empty-state {
  min-height: 100%;
  display: grid;
  place-items: center;
  color: var(--ink-soft);
  text-align: center;
}

.message {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.bubble {
  display: grid;
  gap: 7px;
  padding: 12px;
  border-radius: 17px;
  border: 1.5px solid var(--paper-2);
  background: var(--cream);
}

.message.assistant .bubble {
  background: var(--white);
}

.message.user .bubble {
  background: var(--paper-2);
}

.bubble strong {
  color: var(--ink-soft);
  font-size: 11px;
  text-transform: uppercase;
}

.bubble p {
  margin: 0;
  color: var(--ink);
  line-height: 1.42;
}

.typing .bubble {
  border-color: var(--primary);
}

.composer {
  grid-area: composer;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
  gap: 12px;
  align-items: center;
  max-width: 720px;
}

.voice-input {
  min-width: 0;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.voice-toolbar {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.mic-btn {
  position: relative;
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--primary);
  color: var(--white);
  box-shadow: var(--tomato-shadow);
  transition: transform .12s ease, box-shadow .18s ease;
}

.mic-btn:active {
  transform: scale(.93);
}

.mic-btn span[aria-hidden="true"] {
  width: 22px;
  height: 30px;
  display: block;
  border: 3px solid var(--white);
  border-radius: 999px;
  background: transparent;
}

.mic-btn span[aria-hidden="true"]::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 24px;
  width: 28px;
  height: 14px;
  border-bottom: 3px solid var(--white);
  border-left: 3px solid var(--white);
  border-right: 3px solid var(--white);
  border-radius: 0 0 999px 999px;
  transform: translateX(-50%);
}

.mic-btn.listening {
  animation: micGlow 1.1s ease-in-out infinite;
}

#micStatus {
  max-width: 94px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.2;
  text-align: center;
}

.composer textarea {
  min-height: 86px;
  max-height: 160px;
  border-radius: var(--radius);
  background: var(--white);
}

.send-btn {
  width: 58px;
  min-width: 58px;
  height: 58px;
  padding: 0;
  border-radius: var(--button-radius);
  background: var(--ink);
  color: var(--white);
  box-shadow: none;
  font-size: 0;
}

.send-btn::before {
  content: ">";
  font-size: 24px;
  font-weight: 700;
}

.interview-actions {
  grid-area: actions;
  max-width: 720px;
}

.finish-hint {
  flex-basis: 100%;
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.finish-hint[data-ready="true"] {
  color: var(--teal);
}

.result-panel {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 20px;
  align-items: start;
}

.result-panel > .panel-heading,
.memory-metrics {
  grid-column: 1 / -1;
}

.memory-metrics {
  display: none;
}

.result-card {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 17px;
  min-height: 590px;
  padding: clamp(24px, 4vw, 40px);
  border-radius: calc(var(--radius) + 8px);
  background:
    var(--tomato-glow),
    var(--result-gradient);
  color: var(--paper);
  box-shadow: var(--shadow);
}

.result-card .eyebrow {
  color: var(--gold);
}

.result-card h3 {
  max-width: 520px;
  color: var(--paper);
  font-size: clamp(42px, 7vw, 76px);
}

.result-highlights {
  display: grid;
  gap: 12px;
}

.result-highlight {
  display: grid;
  gap: 8px;
  padding: 14px 15px;
  border-left: 5px solid var(--primary);
  border-radius: 0 16px 16px 0;
  background: var(--glass);
}

.result-highlight strong {
  color: var(--paper);
  font-family: var(--display);
  font-size: 20px;
  line-height: 1.16;
}

.result-highlight p,
.result-empty {
  margin: 0;
  color: var(--paper-2);
  line-height: 1.45;
}

.report {
  display: grid;
  gap: 12px;
  color: var(--paper-2);
  line-height: 1.5;
}

.report h3 {
  color: var(--gold);
  font-size: 20px;
}

.report p,
.report ul,
.report ol {
  margin: 0;
}

.report ul,
.report ol {
  padding-left: 22px;
}

.result-watermark {
  align-self: end;
  margin: 10px 0 0;
  color: var(--gold);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.invite-box {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1.5px solid var(--paper-2);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--soft-shadow);
}

.invite-box > p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.invite-box textarea {
  min-height: 86px;
  resize: none;
  background: var(--cream);
  color: var(--ink-soft);
  font-size: 13px;
}

.share-box .primary-btn,
.share-box .secondary-btn,
.share-box .ghost-btn {
  width: 100%;
}

.share-box .primary-btn {
  background: var(--teal);
  box-shadow: none;
}

.share-box .secondary-btn {
  background: var(--primary);
  box-shadow: var(--tomato-shadow);
}

.social-row {
  display: flex;
  gap: 8px;
}

.social-row span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

body.is-challenge-mode .story-setup,
body.is-challenge-mode .conversation-panel,
body.is-challenge-mode .archive-panel {
  display: none;
}

body.is-challenge-mode .consumer-layout {
  display: grid;
  justify-content: center;
}

.challenge-panel {
  width: min(920px, 100%);
  margin: 0 auto;
}

.challenge-panel[hidden] {
  display: none;
}

.challenge-card {
  display: grid;
  gap: 18px;
  padding: clamp(22px, 4vw, 42px);
  border: 1.5px solid var(--paper-2);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
}

.challenge-questions {
  display: grid;
  gap: 14px;
}

.challenge-question {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1.5px solid var(--paper-2);
  border-radius: var(--radius);
  background: var(--cream);
}

.challenge-question h3 {
  color: var(--ink);
  font-size: 22px;
}

.challenge-answer {
  padding: 12px 14px;
  border-left: 5px solid var(--primary);
  border-radius: 0 14px 14px 0;
  background: var(--white);
  color: var(--ink);
}

.challenge-answer strong {
  display: block;
  margin-bottom: 5px;
  color: var(--primary);
}

.score-toggle {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--ink-soft);
  font-weight: 700;
}

.score-toggle input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--teal);
}

.challenge-result {
  min-height: 24px;
  color: var(--teal);
  font-weight: 700;
}

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

@keyframes bounce {
  0%,
  100% {
    transform: scaleY(.4);
  }
  50% {
    transform: scaleY(1);
  }
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: var(--pulse-start);
  }
  50% {
    box-shadow: var(--pulse-end);
  }
}

@keyframes micGlow {
  0%,
  100% {
    box-shadow: var(--tomato-shadow);
  }
  50% {
    box-shadow: var(--tomato-shadow-strong);
  }
}

@media (max-width: 900px) {
  .app-shell {
    width: min(100vw - 24px, 760px);
    padding-top: 16px;
  }

  .status-pill {
    display: none;
  }

  h1 {
    font-size: clamp(46px, 14vw, 70px);
  }

  .story-setup,
  .conversation-panel,
  .result-panel {
    grid-template-columns: 1fr;
  }

  .story-setup {
    gap: 20px;
  }

  .hero-photo {
    min-height: auto;
    padding: 24px;
  }

  .share-preview-card {
    min-height: 380px;
  }

  .conversation-panel {
    min-height: auto;
    grid-template-areas:
      "head"
      "state"
      "caption"
      "wave"
      "composer"
      "actions";
  }

  .messages {
    display: none;
  }

  .interview-head {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  .progress-wrap {
    width: 100%;
  }

  .progress-wrap span {
    text-align: left;
  }

  .caption-panel {
    text-align: center;
  }

  .caption-panel p {
    margin: 0 auto;
  }

  .interview-wave {
    justify-content: center;
  }

  .composer {
    max-width: none;
  }

  .result-panel > .panel-heading,
  .memory-metrics {
    grid-column: auto;
  }
}

@media (max-width: 680px) {
  .app-shell {
    width: min(100vw - 20px, 420px);
    padding-bottom: 22px;
  }

  .topbar {
    gap: 22px;
  }

  .site-nav {
    gap: 10px;
  }

  .brand-wordmark {
    font-size: 23px;
  }

  .login-btn {
    display: none;
  }

  .language-pill::before {
    content: "";
    padding-left: 0;
  }

  .language-select {
    width: 66px;
    padding-left: 13px;
  }

  .brand-subtitle,
  .step-copy,
  .challenge-intro {
    font-size: 16px;
  }

  h1 {
    font-size: clamp(38px, 9vw, 52px);
    line-height: .98;
    max-width: 100%;
  }

  h2 {
    font-size: clamp(30px, 8vw, 40px);
  }

  .hero-photo {
    display: none;
  }

  .memory-template-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .template-btn {
    min-height: 104px;
    padding: 14px;
  }

  .template-card-inner {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .template-arrow {
    display: none;
  }

  .mic-permission-box {
    align-items: stretch;
    flex-direction: column;
  }

  .settings-focus {
    grid-column: auto;
  }

  .caption-panel p {
    font-size: clamp(32px, 10vw, 46px);
  }

  .wave span {
    width: 8px;
    height: 38px;
  }

  .composer {
    grid-template-columns: minmax(0, 1fr) 54px;
    gap: 10px;
  }

  .voice-input {
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 10px;
  }

  .mic-btn {
    width: 76px;
    height: 76px;
  }

  #micStatus {
    max-width: 82px;
    font-size: 11px;
  }

  .composer textarea {
    min-height: 76px;
    padding: 12px;
  }

  .send-btn {
    width: 54px;
    min-width: 54px;
    height: 54px;
  }

  .action-row {
    flex-direction: column;
  }

  .primary-btn,
  .secondary-btn,
  .ghost-btn {
    width: 100%;
  }

  .result-card {
    min-height: 520px;
    border-radius: var(--radius);
  }
}

@media (max-width: 390px) {
  .app-shell {
    width: calc(100vw - 24px);
  }

  .brand-wordmark {
    font-size: 20px;
  }

  .top-controls {
    gap: 6px;
  }

  h1 {
    font-size: 40px;
    line-height: .98;
    max-width: 100%;
  }

  h2 {
    font-size: 32px;
  }

  .brand-subtitle,
  .step-copy {
    max-width: 100%;
    font-size: 15px;
    overflow-wrap: break-word;
  }

  .template-copy h3 {
    font-size: 18px;
  }

  .voice-input {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .mic-btn {
    width: 70px;
    height: 70px;
  }

  #micStatus {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
