:root {
  --ink: #0c0c0c;
  --coal: #0c0c0c;
  --paper: #f8f8f4;
  --paper-strong: #f8f8f4;
  --muted: #99978a;
  --line: rgba(153, 151, 138, 0.34);
  --gold: #f8f8f4;
  --gold-bright: #f8f8f4;
  --wine: #99978a;
  --green: #99978a;
  --status-blue: #2478ff;
  --font: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --display: "Space Grotesk", "Arial Black", "Helvetica Neue", Arial, sans-serif;
  --ui-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Helvetica, Arial, sans-serif;
  --ui-line: #d9d8d1;
  --ui-stroke: 1px;
}

@media (min-resolution: 2dppx) {
  :root {
    --ui-stroke: 0.5px;
  }
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--ink);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font);
  text-rendering: optimizeLegibility;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 3px;
}

.site-header,
.site-footer {
  display: flex;
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
  align-items: center;
  justify-content: space-between;
}

.site-header {
  min-height: 92px;
  border-bottom: 1px solid var(--line);
}

.brand img {
  display: block;
  width: 142px;
  filter: invert(1);
}

.simulation-label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.simulation-label i,
.chat-persona i {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 999px;
  background: var(--status-blue);
  box-shadow: 0 0 0 3px rgba(36, 120, 255, 0.16);
  animation: ai-status-pulse 1.65s ease-out infinite;
}

@keyframes ai-status-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 3px rgba(36, 120, 255, 0.14);
    opacity: 1;
  }

  50% {
    box-shadow: 0 0 0 7px rgba(36, 120, 255, 0);
    opacity: 0.72;
  }
}

.app-shell {
  width: min(1180px, calc(100% - 40px));
  min-height: calc(100vh - 162px);
  margin-inline: auto;
}

.screen {
  display: none;
  min-height: calc(100vh - 162px);
  animation: enter 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.screen.is-active {
  display: grid;
}

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

.landing-screen {
  align-items: center;
  padding: 72px 0 96px;
}

.landing-copy {
  position: relative;
  z-index: 2;
  max-width: 1040px;
}

.eyebrow {
  margin: 0 0 24px;
  color: var(--gold-bright);
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

h1,
h2 {
  margin: 0;
  font-family: var(--display);
  letter-spacing: -0.055em;
}

h1 {
  max-width: 1040px;
  font-size: clamp(50px, 6.7vw, 92px);
  line-height: 0.92;
}

h1 em {
  display: block;
  color: var(--gold-bright);
  font-style: normal;
}

h2 {
  font-size: clamp(48px, 7vw, 82px);
  line-height: 0.92;
}

.subheadline {
  max-width: 720px;
  margin: 38px 0 12px;
  color: #d6d0c5;
  font-size: clamp(20px, 2vw, 28px);
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.test-lead {
  margin: 0 0 34px;
  color: var(--muted);
  font-size: clamp(16px, 1.5vw, 20px);
}

.primary-button {
  display: inline-flex;
  min-height: 62px;
  min-width: 190px;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  border: 1px solid var(--gold);
  background: var(--gold);
  padding: 0 22px;
  color: var(--ink);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.09em;
  transition: 180ms ease;
}

.primary-button:hover {
  background: var(--gold-bright);
  transform: translateY(-2px);
}

.primary-button span {
  font-size: 22px;
}

.full-button {
  width: 100%;
}

.microcopy {
  max-width: 460px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.match-visual {
  position: absolute;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 30%, rgba(230, 201, 141, 0.38), transparent 16%),
    linear-gradient(145deg, #50212a, #181513 58%, #9b7847);
}

.match-visual > span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.1);
  font-family: var(--display);
  font-size: 280px;
}

.portrait-glow {
  position: absolute;
  width: 220px;
  height: 220px;
  top: 18%;
  left: 50%;
  border: 1px solid rgba(230, 201, 141, 0.45);
  border-radius: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 80px rgba(200, 169, 106, 0.2);
}

.chat-persona {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mini-avatar {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-weight: 900;
  overflow: hidden;
}

.mini-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mini-avatar img + span {
  display: none;
}

.chat-persona > div:last-child {
  display: grid;
  gap: 4px;
}

.chat-persona strong {
  font-size: 14px;
}

.chat-persona span {
  color: var(--muted);
  font-size: 11px;
}

.briefing-screen {
  place-items: center;
  padding: 70px 0 90px;
}

.briefing-content {
  width: min(100%, 860px);
}

.briefing-content h2 {
  max-width: 850px;
}

.briefing-intro {
  margin: 24px 0 42px;
  color: #d6d0c5;
  font-size: clamp(20px, 2vw, 26px);
}

.rules-card {
  margin-bottom: 26px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  padding: clamp(24px, 4vw, 38px);
}

.rules-card .eyebrow {
  margin-bottom: 8px;
}

.rules-card ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.rules-card li {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 18px;
  align-items: baseline;
  border-bottom: 1px solid var(--line);
  padding: 22px 0;
  color: var(--paper);
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.35;
}

.rules-card li:last-child {
  border-bottom: 0;
  padding-bottom: 4px;
}

.rules-card li span {
  color: var(--gold);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.briefing-button {
  width: 100%;
}

.onboarding-screen {
  grid-template-columns: minmax(0, 0.82fr) minmax(420px, 0.7fr);
  gap: clamp(60px, 10vw, 150px);
  align-items: center;
  padding: 70px 0 90px;
}

.screen-intro > p:last-child {
  max-width: 550px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.back-button {
  display: grid;
  width: 42px;
  height: 42px;
  margin-bottom: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  font-size: 19px;
}

.details-form {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  padding: clamp(24px, 4vw, 42px);
}

.field-grid {
  display: grid;
  gap: 24px;
  margin-bottom: 28px;
}

.field-grid label {
  display: grid;
  gap: 9px;
}

.field-grid label > span {
  display: flex;
  justify-content: space-between;
  color: #ded7ca;
  text-transform: uppercase;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.field-grid label b {
  color: var(--muted);
  font-size: 8px;
}

.field-grid input {
  width: 100%;
  height: 56px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #171613;
  padding: 0 16px;
  color: var(--paper);
  font-size: 17px;
}

.height-input {
  position: relative;
}

.height-input span {
  position: absolute;
  top: 50%;
  right: 16px;
  color: var(--muted);
  transform: translateY(-50%);
  font-size: 12px;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin: 14px 0;
  color: #bbb4a8;
  font-size: 12px;
  line-height: 1.45;
}

.check-row input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--gold);
}

.form-error {
  min-height: 18px;
  margin: 12px 0;
  color: #d78188;
  font-size: 12px;
}

.data-note {
  margin: 18px 0 0;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.match-screen {
  grid-template-columns: minmax(360px, 0.82fr) minmax(420px, 0.72fr);
  gap: clamp(60px, 9vw, 130px);
  align-items: center;
  padding: 54px 0 74px;
}

.match-visual {
  position: relative;
  height: min(650px, 68vh);
  min-height: 500px;
  border-radius: 240px 240px 12px 12px;
}

.match-visual small {
  position: absolute;
  right: 20px;
  bottom: 18px;
  color: rgba(255, 255, 255, 0.45);
  text-transform: uppercase;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.profile-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 28px;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.profile-meta i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--gold);
}

.profile-bio {
  max-width: 560px;
  color: #d9d2c6;
  font-size: 19px;
  line-height: 1.5;
}

.prompt-card,
.feedback-card {
  display: grid;
  gap: 10px;
  margin: 30px 0;
  border-left: 2px solid var(--gold);
  background: rgba(255, 255, 255, 0.04);
  padding: 20px 22px;
}

.prompt-card span,
.feedback-card span {
  color: var(--gold-bright);
  text-transform: uppercase;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.prompt-card strong,
.feedback-card strong {
  font-size: 16px;
  line-height: 1.45;
}

.interest-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 34px;
}

.interest-row span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  color: #bbb4a8;
  font-size: 10px;
}

.chat-screen {
  grid-template-rows: auto auto auto 1fr;
  width: min(720px, 100%);
  height: calc(100vh - 120px);
  min-height: 620px;
  margin-inline: auto;
  padding: 24px 0 18px;
}

.chat-header {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  align-items: center;
  border-bottom: var(--ui-stroke) solid var(--ui-line);
  padding-bottom: 16px;
}

.chat-header .back-button {
  margin: 0;
}

.chat-persona {
  justify-self: center;
}

.chat-persona span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.turn-counter {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 2px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.turn-counter strong {
  font-size: 17px;
}

.turn-counter span {
  color: var(--muted);
  font-size: 11px;
}

.chemistry-meter {
  padding: 18px 4px 16px;
}

.chemistry-meter-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  color: var(--ink);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.chemistry-meter-label strong {
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
}

.chemistry-meter-label span {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  text-transform: none;
}

.chemistry-meter-label b {
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.chemistry-meter-track {
  height: 6px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: rgba(12, 12, 12, 0.12);
}

.chemistry-meter-track i {
  display: block;
  width: 30%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #111111 0%, #5f5650 100%);
  box-shadow: none;
  transition: width 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

.messages {
  overflow-y: auto;
  padding: 26px 6px 20px;
  scrollbar-width: thin;
  scrollbar-color: #433b30 transparent;
}

.start-marker {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.start-marker::before,
.start-marker::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.opening-hint {
  margin: 22px auto;
  color: var(--muted);
  text-align: center;
  font-size: 11px;
}

.message-row {
  display: flex;
  margin: 12px 0;
}

.message-row.is-user {
  justify-content: flex-end;
}

.message-bubble {
  max-width: min(70%, 423px);
  border: 1px solid var(--line);
  border-radius: 16px 16px 16px 3px;
  background: #171613;
  padding: 11px 13.5px;
  color: #e7e0d4;
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.is-user .message-bubble {
  border: 0;
  border-radius: 16px 16px 3px 16px;
  background: var(--gold);
  color: var(--ink);
  font-weight: 650;
}

.message-status {
  margin: -7px 4px 10px 0;
  color: var(--muted);
  text-align: right;
  font-size: 9px;
}

.typing-bubble {
  display: flex;
  width: 58px;
  gap: 4px;
  padding-block: 16px;
}

.typing-bubble i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--muted);
  animation: pulse 900ms infinite alternate;
}

.typing-bubble i:nth-child(2) { animation-delay: 180ms; }
.typing-bubble i:nth-child(3) { animation-delay: 360ms; }

@keyframes pulse {
  to { opacity: 0.25; transform: translateY(-3px); }
}

.composer {
  display: grid;
  grid-template-columns: 1fr 52px;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.composer textarea {
  width: 100%;
  min-height: 52px;
  overflow: hidden !important;
  scrollbar-width: none;
  -ms-overflow-style: none;
  overscroll-behavior: none;
  resize: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #171613;
  padding: 15px;
  color: var(--paper);
  line-height: 1.4;
}

.composer textarea::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.composer button {
  width: 52px;
  height: 52px;
  align-self: end;
  justify-self: end;
  border: 1px solid var(--gold);
  border-radius: 8px;
  background: var(--gold);
  color: var(--ink);
  font-size: 23px;
  font-weight: 900;
}

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

.composer-error {
  grid-column: 1 / -1;
  margin: 0;
  color: #8e2731;
  font-size: 11px;
  line-height: 1.3;
}

.composer-error:empty {
  display: none;
}

.seen-recovery {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.seen-recovery > p {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.4;
}

.seen-recovery > p strong {
  display: block;
  font-family: var(--display);
  font-size: 18px;
  letter-spacing: -0.02em;
}

.recovery-composer {
  display: grid;
  grid-template-columns: 1fr 52px;
  gap: 10px;
}

.recovery-composer input {
  width: 100%;
  min-width: 0;
  min-height: 52px;
  border: 1px solid var(--muted);
  border-radius: 8px;
  background: var(--paper);
  padding: 0 15px;
  color: var(--ink);
  font: inherit;
}

.recovery-composer button {
  display: grid;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper);
  font-size: 23px;
  font-weight: 900;
}

.recovery-composer button:disabled,
.recovery-composer input:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.recovery-restart {
  display: flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: transparent;
  padding: 0 14px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.recovery-restart:disabled {
  opacity: 0.5;
  cursor: wait;
}

.result-screen {
  grid-template-columns: minmax(300px, 0.68fr) minmax(410px, 0.72fr);
  gap: clamp(60px, 10vw, 150px);
  align-items: center;
  padding: 70px 0 90px;
}

.result-orbit {
  display: grid;
  aspect-ratio: 1;
  max-width: 480px;
  place-items: center;
  border: 1px solid rgba(200, 169, 106, 0.22);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(111, 37, 45, 0.24), transparent 66%);
  box-shadow: inset 0 0 80px rgba(200, 169, 106, 0.05);
}

.score-ring {
  --score-ring-base: #2c2924;
  --score-ring-active: var(--gold);
  position: relative;
  display: grid;
  grid-template-rows: auto auto;
  width: 62%;
  aspect-ratio: 1;
  align-content: center;
  justify-items: center;
  border: 9px solid var(--score-ring-base);
  border-radius: 50%;
  text-align: center;
}

.score-ring::before {
  content: "";
  position: absolute;
  inset: -9px;
  border: 9px solid transparent;
  border-top-color: var(--score-ring-active);
  border-right-color: var(--score-ring-active);
  border-radius: 50%;
  transform: rotate(16deg);
  pointer-events: none;
}

.score-ring > * {
  position: relative;
  z-index: 1;
  width: 100%;
  transform: none;
}

.score-ring strong {
  font-family: var(--display);
  font-size: clamp(62px, 8vw, 96px);
  line-height: 0.88;
  letter-spacing: -0.06em;
}

.score-ring span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
}

.result-copy > p:not(.eyebrow) {
  max-width: 540px;
  color: #bcb4a7;
  font-size: 17px;
  line-height: 1.6;
}

.text-button {
  width: 100%;
  margin-top: 16px;
  border: 0;
  background: transparent;
  padding: 12px;
  color: var(--gold-bright);
  font-size: 12px;
  font-weight: 800;
}

.automation-dialog {
  position: relative;
  width: min(620px, calc(100% - 32px));
  max-height: min(760px, calc(100dvh - 32px));
  overflow-y: auto;
  border: 1px solid var(--ink);
  border-radius: 22px;
  background: var(--paper);
  padding: clamp(28px, 5vw, 48px);
  color: var(--ink);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.45);
}

.automation-dialog[open] {
  animation: automation-dialog-in 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

.automation-dialog::backdrop {
  background: rgba(8, 8, 7, 0.78);
  backdrop-filter: blur(5px);
}

@keyframes automation-dialog-in {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.automation-dialog [hidden] {
  display: none !important;
}

.automation-close {
  position: absolute;
  top: 18px;
  right: 18px;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
}

.automation-form,
.automation-success {
  display: grid;
  gap: 22px;
}

.automation-form-copy {
  display: grid;
  gap: 12px;
  padding-right: 38px;
}

.automation-form-copy .eyebrow,
.automation-success .eyebrow {
  margin: 0;
  color: var(--muted);
}

.automation-form-copy h2,
.automation-success h2 {
  max-width: 520px;
  font-size: clamp(38px, 7vw, 58px);
  line-height: 0.94;
}

.automation-form-copy > p:last-child,
.automation-success > p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.automation-fields {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr);
  gap: 12px;
}

.automation-fields label {
  display: grid;
  gap: 8px;
}

.automation-fields label > span {
  display: flex;
  justify-content: space-between;
  color: var(--ink);
  text-transform: uppercase;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.automation-fields label b {
  color: var(--muted);
  font-size: 8px;
}

.automation-fields input {
  width: 100%;
  height: 54px;
  border: 1px solid var(--muted);
  border-radius: 10px;
  background: #fff;
  padding: 0 14px;
  color: var(--ink);
}

.automation-check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #4f4e49;
  font-size: 12px;
  line-height: 1.45;
}

.automation-check-row + .automation-check-row {
  margin-top: -12px;
}

.automation-check-row input {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  margin: 0;
  accent-color: var(--ink);
}

.automation-privacy,
.automation-error {
  margin: -10px 0 0;
  font-size: 10px;
  line-height: 1.45;
}

.automation-privacy {
  color: var(--muted);
}

.automation-error {
  min-height: 15px;
  color: #8e2731;
}

.automation-dialog .primary-button {
  min-height: 58px;
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.automation-dialog [data-automation-submit-label] {
  font-size: 12px;
}

.automation-dialog .primary-button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.automation-success {
  min-height: 390px;
  align-content: center;
  text-align: left;
}

.automation-success-mark {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-size: 24px;
}

.automation-success .primary-button {
  text-decoration: none;
}

@media (max-width: 560px) {
  .automation-dialog {
    width: calc(100% - 20px);
    max-height: calc(100dvh - 20px);
    border-radius: 16px;
    padding: 34px 20px 24px;
  }

  .automation-fields {
    grid-template-columns: 1fr;
  }
}

.site-footer {
  min-height: 70px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@media (max-width: 880px) {
  .landing-screen,
  .briefing-screen,
  .onboarding-screen,
  .match-screen,
  .result-screen {
    grid-template-columns: 1fr;
  }

  .landing-screen {
    padding-top: 50px;
  }

  .briefing-screen,
  .onboarding-screen,
  .match-screen,
  .result-screen {
    gap: 42px;
    padding-block: 48px 70px;
  }

  .match-visual {
    height: 520px;
    min-height: 0;
  }

  .result-orbit {
    width: min(100%, 420px);
    margin-inline: auto;
  }
}

@media (max-width: 560px) {
  .site-header,
  .site-footer,
  .app-shell {
    width: min(100% - 28px, 1180px);
  }

  .site-header {
    min-height: 72px;
  }

  .brand img {
    width: 112px;
  }

  .simulation-label {
    font-size: 8px;
  }

  .screen {
    min-height: calc(100vh - 130px);
  }

  h1 {
    font-size: clamp(40px, 11.5vw, 64px);
  }

  .landing-screen {
    padding-block: 46px 72px;
  }

  .briefing-button {
    min-height: 74px;
    text-align: left;
  }

  h2 {
    font-size: clamp(44px, 13vw, 66px);
  }

  .subheadline {
    margin-top: 24px;
  }

  .onboarding-screen {
    padding-top: 32px;
  }

  .details-form {
    margin-inline: -4px;
  }

  .match-visual {
    height: 420px;
    border-radius: 180px 180px 10px 10px;
  }

  .chat-screen {
    height: calc(100dvh - 72px);
    min-height: 560px;
    padding-top: 10px;
  }

  .site-footer {
    display: none;
  }

  .message-bubble {
    max-width: 86%;
  }

  .result-screen {
    padding-top: 36px;
  }
}

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

/* Embeddable challenge shell: only the viewport below the header changes. */
[hidden] {
  display: none !important;
}

.app-shell {
  display: grid;
  place-items: center;
  padding: 48px 0 64px;
}

.challenge-widget {
  width: min(720px, 100%);
  height: min(720px, calc(100dvh - 190px));
  min-height: 620px;
  isolation: isolate;
  overflow: hidden;
  border: var(--ui-stroke) solid var(--ui-line);
  border-radius: 20px;
  background: var(--paper);
  background-clip: padding-box;
  color: var(--ink);
  font-family: var(--ui-font);
  font-kerning: normal;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  box-shadow: 0 28px 100px rgba(0, 0, 0, 0.48);
}

.widget-header {
  display: flex;
  height: 78px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 0 26px;
  background: var(--paper);
}

.widget-persona {
  display: flex;
  align-items: center;
  gap: 12px;
}

.widget-persona > div:last-child {
  display: grid;
  gap: 4px;
}

.widget-persona strong {
  font-size: 18px;
  line-height: 1;
}

.widget-persona span,
.widget-status {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.11em;
}

.widget-persona span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.widget-persona i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(153, 151, 138, 0.16);
}

.widget-status {
  color: var(--green);
}

.challenge-viewport {
  height: calc(100% - 78px);
}

.challenge-widget[data-active-screen="chat"] .widget-header,
.challenge-widget[data-active-screen="result"] .widget-header {
  display: none;
}

.challenge-widget[data-active-screen="chat"] .challenge-viewport,
.challenge-widget[data-active-screen="result"] .challenge-viewport {
  height: 100%;
}

.challenge-widget .screen {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.offer-screen.is-active {
  position: relative;
  grid-template-rows: 1fr auto;
  gap: 24px;
  overflow-y: auto;
  padding: clamp(28px, 6vw, 48px);
}

.rules-screen.is-active {
  padding-top: 76px;
}

.offer-thread {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
}

.offer-intro {
  margin-bottom: auto;
  padding-bottom: 24px;
}

.offer-intro h1 {
  max-width: 680px;
  margin: 0;
  color: var(--ink);
  font-size: clamp(30px, 5vw, 54px);
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.offer-intro p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: clamp(16px, 2vw, 20px);
}

.sequence-message {
  margin: 0;
  animation: message-in 300ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes message-in {
  from { opacity: 0; transform: translateY(7px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.offer-bubble {
  max-width: min(74%, 460px);
  border-color: transparent;
  background: rgba(153, 151, 138, 0.22);
  padding: 13.5px 16px;
  color: var(--ink);
  font-size: clamp(17px, 2.4vw, 21px);
  line-height: 1.35;
  letter-spacing: -0.015em;
}

.accent-bubble {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.rules-bubble {
  display: grid;
  gap: 14px;
  font-size: 15px;
}

.rules-bubble strong {
  color: var(--ink);
  text-transform: uppercase;
  font-size: 9px;
  letter-spacing: 0.14em;
}

.rules-bubble span {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 8px;
  align-items: baseline;
}

.rules-bubble b {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.1em;
}

.sequence-typing {
  margin: 0;
}

.offer-action {
  display: grid;
  justify-items: end;
  gap: 8px;
  animation: message-in 300ms cubic-bezier(0.22, 1, 0.36, 1);
}

.choice-row {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 10px;
  align-items: stretch;
  animation: message-in 300ms cubic-bezier(0.22, 1, 0.36, 1);
}

.choice-button {
  display: flex;
  min-height: 78px;
  align-items: center;
  justify-content: flex-start;
  border-radius: 18px;
  padding: 13px 15px;
  text-align: left;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: 180ms ease;
}

.decline-choice {
  border: 1px solid var(--muted);
  border-bottom-left-radius: 3px;
  background: transparent;
  color: var(--ink);
}

.decline-choice:hover {
  border-color: var(--ink);
  background: rgba(153, 151, 138, 0.16);
}

.score-choice {
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--ink);
  border-bottom-right-radius: 3px;
  background: var(--ink);
  color: var(--paper);
}

.score-choice:hover {
  background: var(--muted);
  transform: translateY(-2px);
}

.score-choice span {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  font-size: 20px;
  line-height: 1;
}

.selected-reply {
  margin-top: 10px;
  animation: message-in 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.offer-action > span {
  margin-right: 6px;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.reply-button {
  display: inline-flex;
  width: min(82%, 470px);
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border: 1px solid var(--ink);
  border-radius: 18px 18px 3px 18px;
  background: var(--ink);
  padding: 13px 18px;
  color: var(--paper);
  text-align: left;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  transition: 180ms ease;
}

.reply-button:hover {
  background: var(--muted);
  transform: translateY(-2px);
}

.reply-button > span {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  font-size: 21px;
  line-height: 1;
}

.widget-back {
  position: absolute;
  top: 20px;
  left: clamp(28px, 6vw, 48px);
  z-index: 2;
  width: 36px;
  height: 36px;
  margin: 0;
  font-size: 16px;
}

.challenge-widget .chat-screen {
  grid-template-rows: auto auto minmax(0, 1fr);
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 20px clamp(18px, 4vw, 34px) 18px;
  background: var(--paper);
  color: var(--ink);
}

.experience-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: var(--ui-stroke) solid var(--ui-line);
}

.experience-tabs button {
  position: relative;
  display: grid;
  min-height: 54px;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.experience-tabs button::after {
  content: "";
  position: absolute;
  bottom: calc(-1 * var(--ui-stroke));
  left: 50%;
  width: min(56%, 182px);
  height: 2px;
  border-radius: 999px;
  background: transparent;
  transform: translateX(-50%);
}

.experience-tabs button[aria-selected="true"] {
  color: var(--ink);
}

.experience-tabs button[aria-selected="true"]::after {
  background: var(--ink);
}

.persona-chat-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  min-height: 0;
}

.persona-profile-panel {
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--muted) transparent;
}

.profile-portrait {
  position: relative;
  display: grid;
  min-height: clamp(280px, 52vw, 430px);
  overflow: hidden;
  place-items: center;
  background:
    linear-gradient(135deg, transparent 0 54%, rgba(248, 248, 244, 0.08) 54% 58%, transparent 58%),
    var(--ink);
  color: var(--paper);
}

.profile-portrait::before,
.profile-portrait::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(248, 248, 244, 0.16);
  border-radius: 50%;
}

.profile-portrait::before {
  width: 210px;
  height: 210px;
}

.profile-portrait::after {
  width: 310px;
  height: 310px;
}

.profile-portrait span {
  position: relative;
  z-index: 1;
  font-family: var(--display);
  font-size: 112px;
  font-weight: 800;
  line-height: 1;
}

.profile-portrait img {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #d9d5ca;
}

.profile-portrait[data-has-avatar="true"]::before,
.profile-portrait[data-has-avatar="true"]::after {
  display: none;
}

.profile-details {
  padding: 24px 4px 12px;
}

.profile-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.profile-heading h2 {
  font-size: clamp(30px, 5vw, 44px);
  letter-spacing: -0.04em;
}

.profile-verified {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-size: 8px;
  font-weight: 900;
}

.profile-prompt-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
}

.profile-prompts {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.profile-prompt-card span {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.profile-prompt-card strong {
  font-size: 17px;
  line-height: 1.42;
}

.profile-chat-button {
  display: flex;
  width: 100%;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--ink);
  border-radius: 12px;
  background: var(--ink);
  padding: 0 18px;
  color: var(--paper);
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  margin-top: 18px;
}

.profile-chat-button > span,
.player-continue-button > span,
.primary-button > span {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  line-height: 1;
}

.offer-bubble strong {
  font-weight: 900;
}

.player-screen.is-active {
  position: relative;
  align-content: start;
  overflow-y: auto;
  padding: 76px clamp(28px, 6vw, 48px) 38px;
}

.player-intro > span {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.13em;
}

.player-intro h2 {
  max-width: 520px;
  margin-top: 9px;
  color: var(--ink);
  font-size: clamp(34px, 5vw, 48px);
  line-height: 0.98;
}

.player-intro p {
  margin: 15px 0 28px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.player-form {
  display: grid;
}

.player-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.player-fields label {
  display: grid;
  gap: 7px;
}

.player-fields label > span {
  display: flex;
  justify-content: space-between;
  color: var(--ink);
  text-transform: uppercase;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.player-fields label b {
  color: var(--muted);
  font-size: 7px;
}

.player-fields input {
  width: 100%;
  height: 50px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  padding: 0 13px;
  color: var(--ink);
  font-size: 15px;
}

.player-height-input {
  position: relative;
}

.player-height-input > span {
  position: absolute;
  top: 50%;
  right: 12px;
  color: var(--muted);
  transform: translateY(-50%);
  font-size: 10px;
}

.player-check-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 6px 0;
  color: var(--ink);
  font-size: 11px;
  line-height: 1.4;
}

.player-check-row input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--ink);
}

.player-storage-note {
  margin: 5px 0 0 25px;
  color: var(--muted);
  font-size: 9px;
}

.player-form-error {
  min-height: 17px;
  margin: 9px 0;
  color: var(--ink);
  font-size: 10px;
  font-weight: 700;
}

.player-continue-button {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--ink);
  border-radius: 12px;
  background: var(--ink);
  padding: 0 18px;
  color: var(--paper);
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.challenge-widget .back-button {
  border-width: var(--ui-stroke);
  border-color: var(--ui-line);
  color: var(--ink);
}

.challenge-widget [data-quit] {
  position: relative;
  width: 42px;
  height: 42px;
  aspect-ratio: 1;
  padding: 0;
  border-radius: 50%;
  font-size: 0;
  line-height: 0;
}

.challenge-widget [data-quit]::before,
.challenge-widget [data-quit]::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: var(--ui-stroke);
  border-radius: 999px;
  background: var(--ink);
  transform-origin: center;
}

.challenge-widget [data-quit]::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.challenge-widget [data-quit]::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.challenge-widget .chat-header {
  border-color: var(--ui-line);
}

.challenge-widget .composer {
  border-color: var(--line);
}

.challenge-widget .chat-persona strong,
.challenge-widget .turn-counter strong {
  color: var(--ink);
}

.challenge-widget .start-marker,
.challenge-widget .opening-hint,
.challenge-widget .message-status,
.challenge-widget .turn-counter span,
.challenge-widget .chat-persona span {
  color: var(--muted);
}

.challenge-widget .start-marker::before,
.challenge-widget .start-marker::after {
  background: var(--line);
}

.challenge-widget .message-bubble {
  max-width: min(74%, 460px);
  border-color: transparent;
  background: rgba(153, 151, 138, 0.22);
  padding: 13.5px 16px;
  color: var(--ink);
  font-size: clamp(17px, 2.4vw, 21px);
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: -0.015em;
}

.challenge-widget .offer-screen .is-user .message-bubble {
  background: var(--ink);
  color: var(--paper);
}

.challenge-widget .chat-screen .message-row {
  margin-block: 8px;
}

.challenge-widget .chat-screen .is-user .message-bubble {
  border-color: transparent;
  background: rgba(153, 151, 138, 0.22);
  color: var(--ink);
  font-weight: 400;
}

.challenge-widget .chat-persona strong,
.challenge-widget .experience-tabs button {
  font-weight: 600;
}

.challenge-widget .composer textarea {
  border-color: var(--muted);
  border-radius: 18px 18px 3px 18px;
  background: var(--paper);
  color: var(--ink);
}

.challenge-widget .composer button {
  display: grid;
  place-items: center;
  border-color: var(--ink);
  border-radius: 18px 18px 3px 18px;
  background: var(--ink);
  padding: 0;
  color: var(--paper);
  line-height: 1;
}

.challenge-widget .result-screen {
  grid-template-columns: minmax(180px, 0.58fr) minmax(0, 1.18fr);
  gap: clamp(28px, 4vw, 42px);
  align-items: center;
  overflow-y: auto;
  padding: 32px 36px;
  background: var(--paper);
  color: var(--ink);
}

.challenge-widget .result-orbit {
  width: 100%;
  max-width: 220px;
  margin-inline: auto;
  border-color: var(--line);
  background: rgba(153, 151, 138, 0.12);
}

.challenge-widget .score-ring {
  --score-ring-base: rgba(153, 151, 138, 0.32);
  --score-ring-active: var(--ink);
}

.challenge-widget .score-ring strong {
  font-size: clamp(34px, 4vw, 52px);
}

.challenge-widget .result-copy {
  min-width: 0;
  align-self: center;
}

.challenge-widget .result-copy h2 {
  max-width: 390px;
  font-size: clamp(44px, 6vw, 60px);
  line-height: 0.91;
}

.challenge-widget .result-screen .eyebrow {
  margin-bottom: 14px;
}

.challenge-widget .result-copy > p:not(.eyebrow) {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.challenge-widget .feedback-card {
  margin: 20px 0;
  border-left-color: var(--ink);
  background: rgba(153, 151, 138, 0.15);
  padding: 16px 18px;
}

.challenge-widget .feedback-card > strong {
  font-size: 18px;
  line-height: 1.3;
}

.challenge-widget .feedback-card > p {
  margin: -2px 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.challenge-widget .diagnosis-detail,
.challenge-widget .diagnosis-example {
  display: grid;
  gap: 5px;
  border-top: 1px solid rgba(33, 33, 29, 0.14);
  padding-top: 11px;
}

.challenge-widget .diagnosis-detail small,
.challenge-widget .diagnosis-example small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.challenge-widget .diagnosis-detail q,
.challenge-widget .diagnosis-detail p {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
}

.challenge-widget .diagnosis-detail q {
  font-style: italic;
}

.challenge-widget .diagnosis-secondary {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.challenge-widget .diagnosis-example strong {
  font-size: 14px;
  line-height: 1.4;
}

.challenge-widget .feedback-card[data-diagnosis-kind="success"] {
  border-left-color: #51704d;
}

.challenge-widget .feedback-card[data-diagnosis-kind="bad_timing"] {
  border-left-color: #8b6b2e;
  background: rgba(139, 107, 46, 0.09);
}

.challenge-widget .feedback-card span,
.challenge-widget .text-button {
  color: var(--ink);
}

.challenge-widget .result-screen .eyebrow { color: var(--muted); }

.challenge-widget .result-screen .primary-button {
  min-height: 56px;
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.challenge-widget .result-screen .text-button {
  margin-top: 6px;
  padding-block: 8px;
}

.challenge-widget .result-screen .primary-button:hover {
  border-color: var(--muted);
  background: var(--muted);
}

@media (max-width: 560px) {
  .app-shell {
    padding: 14px 0 22px;
  }

  .challenge-widget {
    height: calc(100dvh - 108px);
    min-height: 590px;
    border-radius: 16px;
  }

  .widget-header {
    height: 68px;
    padding-inline: 18px;
  }

  .challenge-viewport {
    height: calc(100% - 68px);
  }

  .offer-screen.is-active {
    padding: 24px 18px;
  }

  .rules-screen.is-active {
    padding-top: 68px;
  }

  .offer-bubble,
  .reply-button {
    max-width: 82%;
    width: auto;
  }

  .offer-bubble {
    font-size: 16px;
  }

  .reply-button {
    min-width: 78%;
  }

  .choice-row {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 8px;
  }

  .choice-button {
    min-height: 96px;
    padding: 11px;
    font-size: 12px;
  }

  .widget-back {
    top: 16px;
    left: 18px;
  }

  .challenge-widget .chat-screen {
    height: 100%;
    min-height: 0;
    padding-top: 14px;
  }

  .player-screen.is-active {
    padding: 66px 18px 26px;
  }

  .player-intro h2 {
    font-size: 34px;
  }

  .player-fields {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .challenge-widget .result-screen {
    grid-template-columns: 1fr;
    gap: 24px;
    overflow-y: auto;
    padding: 28px 22px;
  }

  .challenge-widget .result-orbit {
    width: min(62vw, 220px);
  }
}
