:root {
  color-scheme: light;
  --paper: #fbf8f1;
  --panel: #fffaf2;
  --ink: #11110f;
  --muted: #4f493f;
  --line: #14120f;
  --purple: #6d5bd7;
  --purple-dark: #5140b8;
  --blue: #1b31e8;
  --mint: #dff4e9;
  --peach: #ffe5d3;
  --lavender: #ebe5ff;
  --aqua: #dff4fb;
  --shadow: rgba(20, 18, 15, 0.16);
  --hand-back-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 58 42' fill='none'%3E%3Cpath d='M43.5 21.1c-9.8.2-20.4.2-31.4-.1' stroke='%2311110f' stroke-width='4.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M19.3 7.8C14 12.2 9.5 16.8 5.8 21.2c4 4.8 8.6 9 13.7 13.2' stroke='%2311110f' stroke-width='4.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M44.8 20.1c-10.5.6-20.4.5-29.8-.2M18.1 8.9C13.8 12.6 10.2 16.3 7 20.5c3.3 3.8 7.3 7.4 12.1 11' stroke='%23232320' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' opacity='.72'/%3E%3C/svg%3E");
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  background: #f0ece3;
}

body {
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% 8%, rgba(255, 255, 255, 0.9), transparent 36rem),
    #f0ece3;
  color: var(--ink);
  font-family: "Comic Sans MS", "Marker Felt", "Chalkboard SE", ui-rounded, system-ui, sans-serif;
}

body[data-view="start"] {
  background: var(--panel);
}

button {
  font: inherit;
}

.app-shell {
  display: grid;
  min-height: 100svh;
  place-items: start center;
}

.test-panel {
  position: relative;
  width: min(100%, 390px);
  min-height: 100svh;
  padding: 16px 22px 22px;
  background: var(--panel);
  box-shadow: 0 24px 64px var(--shadow);
}

body[data-view="start"] .test-panel,
body[data-view="mode"] .test-panel,
body[data-view="quiz"] .test-panel,
body[data-view="share"] .test-panel {
  height: 100svh;
  min-height: 900px;
  overflow: hidden;
}

.topbar {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}

.brand-stack {
  min-width: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
}

.eyebrow::before {
  display: inline-block;
  width: 21px;
  height: 32px;
  margin-right: 6px;
  content: "";
  background: url("./assets/art/icons/icon-dna-logo.png") center / contain no-repeat;
}

.progress-text {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.1;
}

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

.icon-button,
.plain-nav {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.icon-button:disabled {
  pointer-events: none;
  opacity: 0;
}

.language-button {
  display: inline-grid;
  min-width: 42px;
  height: 34px;
  place-items: center;
  border: 2px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
}

.language-button:focus-visible {
  outline: 0;
}

.icon-button span,
.plain-nav span,
.primary-action span,
.secondary-action span {
  display: block;
  color: transparent;
  font-size: 0;
  line-height: 0;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

.icon-button span,
.plain-nav span {
  width: 28px;
  height: 28px;
}

.primary-action span,
.secondary-action span {
  width: 25px;
  height: 25px;
}

#backButton span,
.plain-nav span {
  background-image: var(--hand-back-arrow);
}

#shareButton span {
  background-image: url("./assets/art/icons/icon-share.png");
}

#startButton span,
#modeStartButton span,
#heroStartButton span {
  background-image: url("./assets/art/icons/icon-arrow-right.png");
}

#copyButton span,
#shareCopyButton span {
  background-image: url("./assets/art/icons/icon-copy.png");
}

#saveAvatarButton span {
  background-image: url("./assets/art/icons/icon-download.png");
}

#saveResultCardButton span {
  background-image: url("./assets/art/icons/icon-image-card.png");
}

.progress-track {
  height: 12px;
  margin: 10px 0 10px;
  overflow: hidden;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: #fffdfa;
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--purple);
  transition: width 220ms ease;
}

body[data-view="start"] .progress-track,
body[data-view="mode"] .progress-track {
  visibility: hidden;
}

body[data-view="mode"] .topbar {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

body[data-view="quiz"] .topbar {
  grid-template-columns: 42px minmax(0, 1fr) 86px;
  min-height: 58px;
  padding-top: 12px;
}

body[data-view="quiz"] .brand-stack {
  grid-column: 3;
  justify-self: end;
}

body[data-view="quiz"] .eyebrow {
  display: none;
}

body[data-view="quiz"] .progress-text {
  margin: 0;
  color: var(--ink);
  font-size: 1.42rem;
  font-weight: 800;
  line-height: 1;
  text-align: right;
  white-space: nowrap;
}

body[data-view="quiz"] .toolbar {
  display: none;
}

body[data-view="quiz"] .progress-track {
  position: absolute;
  top: 38px;
  right: 100px;
  left: 90px;
  height: 20px;
  margin: 0;
}

body[data-view="start"] .test-panel {
  min-height: 900px;
  aspect-ratio: auto;
  padding: 0;
  overflow: hidden;
  background: var(--panel) url("./assets/art/runtime/home-no-status.png") top center / 100% auto no-repeat;
  box-shadow: none;
}

body[data-view="start"] .topbar,
body[data-view="start"] .progress-track,
body[data-view="start"] .start-view h1,
body[data-view="start"] .start-copy,
body[data-view="start"] .home-art,
body[data-view="start"] .start-note {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(2.2rem, 10vw, 3.35rem);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 0.98;
}

h2 {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.08;
}

p {
  margin: 0;
}

.start-view {
  display: grid;
  min-height: calc(100svh - 82px);
  align-content: start;
  gap: 14px;
  padding-top: 6px;
}

.start-copy {
  max-width: 24em;
  color: var(--ink);
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.65;
}

.home-art {
  position: relative;
  min-height: min(53svh, 435px);
  margin-top: -4px;
}

.home-person {
  position: absolute;
  left: 21%;
  bottom: 18%;
  width: min(30vw, 122px);
  height: auto;
}

.home-helix {
  position: absolute;
  right: 3%;
  bottom: 7%;
  width: min(43vw, 178px);
  height: auto;
}

.ornament {
  position: absolute;
  pointer-events: none;
}

.molecule {
  top: 0;
  right: 1%;
  width: 58px;
}

.flask {
  left: 6%;
  bottom: 14%;
  width: 40px;
}

.spark-a {
  right: 3%;
  bottom: 26%;
  width: 40px;
}

.primary-action,
.secondary-action {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 3px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
}

.primary-action {
  background: var(--purple);
  color: #fff;
  box-shadow: 0 3px 0 var(--line);
}

.primary-action:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--line);
}

.secondary-action {
  background: #fffdf8;
  color: var(--ink);
}

.start-action,
.mode-start-action {
  width: 100%;
  margin-top: auto;
  font-size: 1.08rem;
}

body[data-view="start"] .start-view {
  position: relative;
  min-height: 900px;
  padding: 0;
}

body[data-view="start"] .start-action {
  position: absolute;
  left: 6.5%;
  top: 76.5%;
  width: 87%;
  height: 8.5%;
  min-height: 58px;
  margin: 0;
  opacity: 0;
}

.start-note,
.mode-note,
.disclaimer,
.share-note {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
}

.mode-view {
  display: grid;
  min-height: 100svh;
  align-content: start;
  gap: 12px;
  padding-top: 30px;
}

.mode-head {
  display: grid;
  align-items: start;
}

.mode-head h1 {
  max-width: 9em;
  margin: 0 auto;
  font-size: clamp(2.45rem, 11vw, 3.85rem);
  line-height: 0.96;
  text-align: center;
}

.mode-head .plain-nav {
  position: absolute;
  top: 36px;
  left: 26px;
  display: grid;
}

.mode-options {
  display: grid;
  gap: 12px;
  margin-top: 8px;
}

.mode-card {
  position: relative;
  display: grid;
  min-height: 248px;
  grid-template-columns: 58% minmax(0, 1fr);
  grid-template-rows: auto auto auto 1fr;
  column-gap: 6px;
  padding: 18px 22px 15px 20px;
  border: 3px solid var(--line);
  border-radius: 22px;
  background: #fffdf8;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.mode-card.selected {
  border-color: var(--purple);
  box-shadow: 0 0 0 2px rgba(109, 91, 215, 0.18);
}

.mode-radio {
  position: absolute;
  top: 21px;
  left: 24px;
  width: 36px;
  height: 36px;
  background: url("./assets/art/icons/icon-radio-empty.png") center / contain no-repeat;
}

.mode-card.selected .mode-radio {
  background-image: url("./assets/art/icons/icon-radio-selected.png");
}

.mode-doodle {
  grid-row: 1 / 5;
  width: 100%;
  min-height: 196px;
  align-self: center;
  background: url("./assets/art/parts/mode-free-stick-figure.png") center / contain no-repeat;
}

.mode-doodle-wow {
  background-image: url("./assets/art/parts/mode-full-stick-figure.png");
}

.mode-card strong {
  align-self: end;
  font-size: 2.12rem;
  line-height: 0.95;
}

.mode-card em {
  color: var(--purple);
  font-size: 5.35rem;
  font-style: normal;
  font-weight: 900;
  line-height: 0.9;
}

.mode-card span:not(.mode-radio):not(.mode-doodle) {
  font-size: 1.36rem;
  font-weight: 900;
}

.mode-card small {
  max-width: 12em;
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.25;
}

.mode-note {
  position: relative;
  display: grid;
  max-width: 20em;
  min-height: 38px;
  align-items: center;
  justify-self: center;
  padding-left: 54px;
  text-align: left;
}

.mode-note::before {
  position: absolute;
  left: 0;
  width: 42px;
  height: 42px;
  content: "";
  background: url("./assets/art/icons/icon-info.png") center / contain no-repeat;
}

.quiz-view {
  display: grid;
  max-height: calc(100svh - 78px);
  min-height: calc(100svh - 78px);
  align-content: start;
  gap: 18px;
  padding-top: 18px;
  padding-bottom: 18px;
  overflow-y: auto;
  scrollbar-width: none;
}

.quiz-view::-webkit-scrollbar {
  display: none;
}

.dimension-pill {
  justify-self: start;
  padding: 7px 16px;
  border: 3px solid var(--line);
  border-radius: 999px;
  background: var(--lavender);
  color: var(--ink);
  font-size: 1rem;
  font-weight: 900;
}

.quiz-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 126px;
  align-items: start;
  gap: 6px;
}

.quiz-title-row h1 {
  font-size: clamp(2.3rem, 10.5vw, 3.75rem);
  line-height: 1.05;
}

.quiz-title-row img {
  width: 126px;
  height: 156px;
  object-fit: contain;
}

.answers {
  display: grid;
  gap: 14px;
}

.answer-button {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-height: 94px;
  padding: 14px 16px;
  border: 3px solid var(--line);
  border-radius: 18px;
  background: #fffdf8;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.answer-button:hover,
.answer-button:focus-visible {
  border-color: var(--purple);
  outline: 0;
}

.answer-marker {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 3px solid var(--line);
  border-radius: 999px;
  background: var(--lavender);
  font-size: 1.25rem;
  font-weight: 900;
}

.answer-copy {
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1.28;
}

.quiz-actions,
.actions {
  display: grid;
  gap: 9px;
  margin-top: 8px;
}

.quiz-actions {
  grid-template-columns: 150px minmax(0, 1fr);
  align-items: center;
  margin-top: 8px;
}

.quiz-actions #quizBackButton {
  min-height: 48px;
  border-radius: 999px;
}

.gene-label {
  position: absolute;
  z-index: 2;
  padding: 8px 12px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--lavender);
  font-size: 0.82rem;
  font-weight: 900;
  transform: rotate(-4deg);
}

.label-comt {
  top: 8%;
  left: 6%;
}

.label-bdnf {
  top: 35%;
  right: 5%;
  background: var(--mint);
  transform: rotate(8deg);
}

.label-actn3 {
  left: 4%;
  bottom: 32%;
  background: var(--peach);
  transform: rotate(-8deg);
}

.label-cyp {
  right: 0;
  bottom: 20%;
  background: var(--aqua);
  transform: rotate(6deg);
}

.result-view {
  display: grid;
  gap: 14px;
  padding-top: 2px;
}

.result-header {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  padding: 8px 0 4px;
}

.gene-art {
  min-width: 0;
}

.avatar-card-image {
  display: grid;
  justify-items: center;
  gap: 4px;
}

.avatar-art-composition {
  position: relative;
  width: 104px;
  height: 104px;
}

.avatar-art-figure,
.avatar-art-dna,
.avatar-art-image {
  position: absolute;
  object-fit: contain;
}

.avatar-art-image {
  inset: 0;
  width: 100%;
  height: 100%;
}

.avatar-art-figure {
  left: 0;
  bottom: 0;
  width: 70px;
  height: 92px;
}

.avatar-art-dna {
  right: 0;
  bottom: 4px;
  width: 68px;
  height: 104px;
}

.avatar-caption {
  display: none;
}

.result-hero h1,
.share-card h2 {
  color: var(--blue);
  font-size: clamp(2rem, 8.5vw, 2.42rem);
  line-height: 0.95;
}

.type-summary,
.result-study {
  margin-top: 5px;
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.3;
}

.result-study {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  padding: 3px 8px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: #fffdf8;
  font-size: 0.66rem;
}

.result-section {
  padding: 13px 0;
  border-top: 2px solid rgba(17, 17, 15, 0.12);
}

.result-section h2 {
  margin-bottom: 9px;
  font-size: 1.1rem;
  line-height: 1;
}

.result-section p,
.result-section li {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.34;
}

.result-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  border-top: 0;
  padding-top: 0;
}

.result-metrics div {
  display: grid;
  min-height: 70px;
  grid-template-columns: 36px minmax(0, 1fr);
  grid-template-areas:
    "icon label"
    "icon value";
  align-items: center;
  column-gap: 8px;
  padding: 9px 10px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: #fffdf8;
}

.metric-card::before {
  display: block;
  grid-area: icon;
  width: 34px;
  height: 34px;
  content: "";
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

.metric-active::before {
  background-image: url("./assets/art/results/parts/ui/metric-active-boxes.png");
}

.metric-library::before {
  background-image: url("./assets/art/results/parts/ui/metric-gene-library.png");
}

.result-metrics span {
  grid-area: label;
  align-self: end;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  line-height: 1;
}

.result-metrics strong {
  grid-area: value;
  align-self: start;
  color: var(--blue);
  font-size: 1.42rem;
  line-height: 1;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.score-card {
  display: grid;
  grid-template-rows: 42px minmax(34px, auto) minmax(25px, auto) minmax(18px, auto) 7px;
  gap: 4px;
  min-height: 150px;
  padding: 8px 6px 7px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: #fffdf8;
  text-align: center;
}

.score-card::before {
  content: none;
}

.gene-box-part {
  display: block;
  width: 42px;
  height: 42px;
  margin: 0 auto;
  object-fit: contain;
}

.score-head {
  display: none;
}

.score-label {
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1.04;
}

.gene-box-genes,
.gene-box-frequency {
  color: var(--blue);
  font-size: 0.64rem;
  font-weight: 900;
  line-height: 1.12;
}

.gene-box-frequency strong {
  display: inline-grid;
  min-height: 18px;
  align-items: center;
  padding: 1px 6px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--lavender);
  color: var(--ink);
  font-size: 0.58rem;
  line-height: 1;
}

.gene-box-frequency span {
  display: none;
}

.score-bar {
  align-self: end;
  height: 7px;
  overflow: hidden;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: #f5f1e8;
}

.score-bar span {
  display: block;
  width: var(--score-width);
  height: 100%;
  background: var(--score-color, var(--purple));
}

#bioProfile {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.gene-chip {
  display: inline-flex;
  padding: 4px 8px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--lavender);
  color: var(--ink);
  font-size: 0.66rem;
  font-weight: 900;
}

.gene-chip-1 {
  background: var(--mint);
}

.gene-chip-2 {
  background: var(--aqua);
}

.gene-chip-3 {
  background: var(--peach);
}

.result-section ul {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.result-section li {
  position: relative;
  padding-left: 25px;
}

.result-section li::before {
  position: absolute;
  top: 0.02em;
  left: 0;
  width: 19px;
  height: 19px;
  content: "";
  background: url("./assets/art/results/parts/ui/list-ability.png") center / contain no-repeat;
}

.result-boundary li::before {
  background-image: url("./assets/art/results/parts/ui/list-boundary.png");
}

.lifestyle-section li::before {
  background-image: url("./assets/art/results/parts/ui/list-lifestyle.png");
}

.share-view {
  display: grid;
  min-height: calc(100svh - 82px);
  align-content: start;
  gap: 12px;
  padding-top: 4px;
}

.share-card {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 8px 8px 16px;
}

.share-card h1 {
  font-size: 1.55rem;
  text-align: center;
}

.square-label {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 900;
}

.share-avatar-stage {
  position: relative;
  display: grid;
  width: min(100%, 320px);
  aspect-ratio: 1;
  place-items: center;
  border: 3px solid var(--line);
  border-radius: 12px;
  background:
    radial-gradient(circle at 12% 22%, var(--lavender) 0 5px, transparent 6px),
    radial-gradient(circle at 88% 26%, var(--mint) 0 4px, transparent 5px),
    radial-gradient(circle at 20% 78%, var(--peach) 0 4px, transparent 5px),
    #fffdf8;
}

.share-avatar-stage .avatar-art-composition {
  width: 230px;
  height: 230px;
}

.share-avatar-stage .avatar-art-figure {
  width: 138px;
  height: 178px;
}

.share-avatar-stage .avatar-art-dna {
  width: 138px;
  height: 206px;
}

.share-actions {
  margin-top: 2px;
}

@media (min-width: 720px) {
  .app-shell {
    padding: 28px;
  }

  .test-panel {
    min-height: 900px;
    border: 3px solid var(--line);
    border-radius: 24px;
  }

  body[data-view="start"] .test-panel {
    border: 0;
    border-radius: 0;
  }
}

@media (max-width: 370px) {
  .test-panel {
    padding-inline: 16px;
  }

  .score-grid {
    gap: 5px;
  }

  .score-card {
    padding-inline: 3px;
  }
}

/* Fidelity pass: fixed-flow pages use the approved art canvas as the visual source. */
body[data-view="mode"] .test-panel {
  padding: 0;
  background: var(--panel) url("./assets/art/runtime/mode-reference-canvas.png") center / contain no-repeat;
}

body[data-view="mode"] .topbar,
body[data-view="mode"] .progress-track,
body[data-view="mode"] .mode-head h1,
body[data-view="mode"] .mode-note {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

body[data-view="mode"] .mode-view {
  position: relative;
  min-height: 900px;
  padding: 0;
}

body[data-view="mode"] .plain-nav {
  position: absolute;
  top: 38px;
  left: 24px;
  z-index: 4;
  opacity: 0;
}

body[data-view="mode"] .mode-card {
  position: absolute;
  z-index: 3;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  opacity: 0;
}

body[data-view="mode"] #freeTestButton {
  left: 21px;
  top: 180px;
  width: 348px;
  height: 258px;
}

body[data-view="mode"] #fullTestButton {
  left: 21px;
  top: 454px;
  width: 348px;
  height: 258px;
}

body[data-view="mode"] .mode-start-action {
  position: absolute;
  left: 24px;
  top: 795px;
  z-index: 4;
  width: 342px;
  height: 72px;
  min-height: 0;
  margin: 0;
  opacity: 0;
}

/* Dynamic quiz page keeps real text/options, but should stay close to the art-board density. */
body[data-view="quiz"] .quiz-title-row {
  grid-template-columns: minmax(0, 1fr) 112px;
}

body[data-view="quiz"] .quiz-title-row h1 {
  font-size: clamp(1.75rem, 7.8vw, 2.65rem);
  line-height: 1.08;
}

body[data-view="quiz"] .quiz-title-row img {
  width: 112px;
  height: 140px;
}

body[data-view="quiz"] .answer-button {
  min-height: 84px;
}

/* Full-page reference pass: the approved left-side artwork is the target source of truth.
   The live DOM remains as transparent hotspots so the prototype still runs. */
body[data-view="start"],
body[data-view="mode"],
body[data-view="quiz"],
body[data-view="result"],
body[data-view="share"] {
  min-height: 100svh;
  background: var(--panel);
}

body[data-view="start"] .app-shell,
body[data-view="mode"] .app-shell,
body[data-view="quiz"] .app-shell,
body[data-view="result"] .app-shell,
body[data-view="share"] .app-shell {
  min-height: 100svh;
  padding: 0;
  place-items: start center;
}

body[data-view="start"] .test-panel,
body[data-view="mode"] .test-panel,
body[data-view="quiz"] .test-panel,
body[data-view="result"] .test-panel,
body[data-view="share"] .test-panel {
  width: min(100vw, calc(100svh * 853 / 1844), 390px);
  height: auto;
  min-height: 0;
  aspect-ratio: 853 / 1844;
  padding: 0;
  overflow: hidden;
  border-radius: 0;
  background-color: var(--panel);
  background-position: top center;
  background-repeat: no-repeat;
  background-size: contain;
  box-shadow: none;
}

body[data-view="start"] .test-panel {
  background-image: url("./assets/art/runtime/home-no-status.png");
}

body[data-view="mode"] .test-panel {
  background-image: url("./assets/art/runtime/02-mode-neutral.png");
}

body[data-view="quiz"] .test-panel {
  background-image: url("./assets/art/full-pages/03-quiz.png");
}

body[data-view="result"] .test-panel {
  background-image: url("./assets/art/full-pages/05-result.png");
}

body[data-view="share"] .test-panel {
  background-image: url("./assets/art/full-pages/06-share.png");
}

body[data-view="start"] .topbar,
body[data-view="mode"] .topbar,
body[data-view="quiz"] .topbar,
body[data-view="result"] .topbar,
body[data-view="share"] .topbar,
body[data-view="start"] .progress-track,
body[data-view="mode"] .progress-track,
body[data-view="quiz"] .progress-track,
body[data-view="result"] .progress-track,
body[data-view="share"] .progress-track {
  position: absolute;
  z-index: 5;
  opacity: 0;
}

body[data-view="start"] .topbar,
body[data-view="mode"] .topbar,
body[data-view="quiz"] .topbar,
body[data-view="result"] .topbar,
body[data-view="share"] .topbar {
  top: 0;
  right: 0;
  left: 0;
  display: grid;
  height: 100%;
  padding: 0;
  pointer-events: none;
}

body[data-view="start"] .progress-track,
body[data-view="mode"] .progress-track,
body[data-view="quiz"] .progress-track,
body[data-view="result"] .progress-track,
body[data-view="share"] .progress-track {
  top: 0;
  right: 0;
  left: 0;
  margin: 0;
  pointer-events: none;
}

body[data-view="start"] .start-view,
body[data-view="mode"] .mode-view,
body[data-view="quiz"] .quiz-view,
body[data-view="result"] .result-view,
body[data-view="share"] .share-view {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
  padding: 0;
  margin: 0;
  overflow: hidden;
  opacity: 0;
}

body[data-view="start"] .start-action {
  position: absolute;
  left: 6.7%;
  top: 83.6%;
  z-index: 10;
  width: 86.7%;
  height: 8.2%;
  min-height: 0;
  margin: 0;
  opacity: 0;
}

body[data-view="mode"] .plain-nav {
  position: absolute;
  top: 6%;
  left: 4.5%;
  z-index: 10;
  width: 10%;
  height: 6%;
  opacity: 0;
}

body[data-view="mode"] .mode-card {
  position: absolute;
  z-index: 10;
  left: 7.7%;
  width: 84.6%;
  height: 24.9%;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  opacity: 0;
}

body[data-view="mode"] #freeTestButton {
  top: 21.9%;
}

body[data-view="mode"] #fullTestButton {
  top: 49.4%;
}

body[data-view="mode"] .mode-start-action {
  position: absolute;
  left: 7.1%;
  top: 86.6%;
  z-index: 10;
  width: 85.8%;
  height: 7.5%;
  min-height: 0;
  margin: 0;
  border: 0;
  opacity: 0;
}

body[data-view="quiz"] .answer-button {
  position: absolute;
  z-index: 10;
  left: 7.1%;
  width: 85.8%;
  height: 10.1%;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  opacity: 0;
}

body[data-view="quiz"] .answer-button:nth-child(1) {
  top: 47.7%;
}

body[data-view="quiz"] .answer-button:nth-child(2) {
  top: 60.5%;
}

body[data-view="quiz"] .answer-button:nth-child(3) {
  top: 73.3%;
}

body[data-view="quiz"] .quiz-actions #quizBackButton {
  position: absolute;
  left: 7.1%;
  top: 86.6%;
  z-index: 10;
  width: 25%;
  height: 5%;
  min-height: 0;
  border: 0;
  opacity: 0;
}

body[data-view="result"] #backButton,
body[data-view="result"] #shareButton,
body[data-view="share"] #backButton,
body[data-view="share"] #shareButton {
  position: absolute;
  top: 3.8%;
  z-index: 10;
  width: 15%;
  height: 9%;
  pointer-events: auto;
}

body[data-view="result"] #backButton,
body[data-view="share"] #backButton {
  left: 1.7%;
}

body[data-view="result"] #shareButton {
  right: 1.7%;
}

body[data-view="share"] #shareButton {
  right: 1.7%;
}

body[data-view="share"] .share-actions {
  position: absolute;
  right: 7.1%;
  bottom: 13.7%;
  left: 7.1%;
  z-index: 10;
  display: grid;
  gap: 1.2%;
  height: 16.8%;
}

body[data-view="share"] .share-actions button {
  min-height: 0;
  border: 0;
}

/* Quiz dynamic layer: real changing content rebuilt over the art-board geometry. */
body[data-view="quiz"] .test-panel {
  background-image: none;
}

body[data-view="quiz"] .quiz-view {
  opacity: 1;
  background: var(--panel);
}

body[data-view="quiz"] .quiz-view::before {
  position: absolute;
  top: 6.25%;
  left: 7.1%;
  z-index: 1;
  width: 7.5%;
  height: 4.4%;
  content: "";
  background: url("./assets/art/icons/icon-back.png") center / contain no-repeat;
}

body[data-view="quiz"] .quiz-progress-bar {
  position: absolute;
  top: 7.1%;
  left: 15.2%;
  z-index: 1;
  width: 36.4%;
  height: 2.15%;
  overflow: hidden;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: #fffdfa;
}

body[data-view="quiz"] .quiz-progress-bar span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--purple);
  transition: width 180ms ease;
}

body[data-view="quiz"] .quiz-progress-count {
  position: absolute;
  top: 6.25%;
  right: 7.2%;
  z-index: 1;
  color: var(--ink);
  font-size: clamp(0.86rem, 3.5vw, 1rem);
  font-weight: 900;
  line-height: 1;
}

body[data-view="quiz"] .dimension-pill {
  position: absolute;
  top: 11.9%;
  left: 7.1%;
  z-index: 1;
  display: inline-grid;
  min-height: 3.2%;
  align-items: center;
  max-width: 52%;
  padding: 0.55% 2.3%;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--lavender);
  color: var(--ink);
  font-size: clamp(0.54rem, 2.35vw, 0.68rem);
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

body[data-view="quiz"] .quiz-title-row {
  position: absolute;
  top: 16.5%;
  right: 7.2%;
  left: 7.1%;
  z-index: 1;
  display: block;
}

body[data-view="quiz"] .quiz-title-row h1 {
  width: 68%;
  color: var(--ink);
  font-size: clamp(1.48rem, 7.3vw, 1.85rem);
  font-weight: 900;
  line-height: 1.03;
}

body[data-view="quiz"] .quiz-title-row img {
  position: absolute;
  top: -12%;
  right: -1%;
  width: 27%;
  height: auto;
  object-fit: contain;
}

body[data-view="quiz"] .answers {
  display: block;
}

body[data-view="quiz"] .answer-button {
  display: grid;
  grid-template-columns: 14.5% minmax(0, 1fr) 11%;
  align-items: center;
  gap: 2.8%;
  padding: 2.8% 3.4%;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: #fffdf8;
  color: var(--ink);
  cursor: pointer;
  opacity: 1;
  text-align: left;
}

body[data-view="quiz"] .answer-button:hover,
body[data-view="quiz"] .answer-button:focus-visible,
body[data-view="quiz"] .answer-button.selected {
  border-color: var(--purple);
  outline: 0;
  box-shadow: inset 0 0 0 1px var(--purple);
}

body[data-view="quiz"] .answer-marker {
  display: grid;
  width: 100%;
  aspect-ratio: 1;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--lavender);
  font-size: clamp(0.85rem, 4vw, 1.1rem);
  font-weight: 900;
  line-height: 1;
}

body[data-view="quiz"] .answer-copy {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink);
  font-size: clamp(0.62rem, 2.85vw, 0.78rem);
  font-weight: 800;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-height: 1.16;
}

body[data-view="quiz"] .answer-button.selected::after {
  justify-self: center;
  width: 100%;
  aspect-ratio: 1;
  content: "";
  background: url("./assets/art/icons/icon-check.png") center / contain no-repeat;
}

body[data-view="quiz"] .quiz-actions {
  display: block;
}

body[data-view="quiz"] .quiz-actions #quizBackButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--line);
  background: #fffdf8;
  color: var(--ink);
  font-size: clamp(0.76rem, 3.2vw, 0.9rem);
  font-weight: 900;
  opacity: 1;
}

body[data-view="quiz"] .quiz-actions #quizBackButton {
  border-radius: 999px;
}

/* Quiz dynamic tuning against assets/art/full-pages/03-quiz.png. */
body[data-view="quiz"] .quiz-view::before {
  top: 5.5%;
  left: 6.2%;
  width: 8.4%;
  height: 4.8%;
}

body[data-view="quiz"] .quiz-progress-bar {
  top: 6%;
  left: 22.5%;
  width: 45.8%;
  height: 2.5%;
}

body[data-view="quiz"] .quiz-progress-count {
  top: 5.8%;
  right: 5.5%;
  font-size: clamp(1.14rem, 5vw, 1.36rem);
}

body[data-view="quiz"] .dimension-pill {
  top: 11.8%;
  left: 5.6%;
  min-height: 4.2%;
  max-width: 58%;
  padding: 0.7% 3.5%;
  font-size: clamp(0.82rem, 3.8vw, 1rem);
}

body[data-view="quiz"] .quiz-title-row {
  top: 24.2%;
}

body[data-view="quiz"] .quiz-title-row h1 {
  width: 64%;
  font-size: clamp(1.72rem, 7.9vw, 2.06rem);
}

body[data-view="quiz"] .quiz-title-row img {
  top: -88%;
  right: -3%;
  width: 46%;
}

body[data-view="quiz"] .answer-button {
  grid-template-columns: 15.2% minmax(0, 1fr) 12%;
  gap: 4.2%;
  height: 12.8%;
  padding: 3.2% 4.1%;
}

body[data-view="quiz"] .answer-button:nth-child(1) {
  top: 39%;
}

body[data-view="quiz"] .answer-button:nth-child(2) {
  top: 54.7%;
}

body[data-view="quiz"] .answer-button:nth-child(3) {
  top: 70.5%;
}

body[data-view="quiz"] .answer-copy {
  font-size: clamp(0.84rem, 3.8vw, 0.98rem);
  -webkit-line-clamp: 4;
  line-height: 1.14;
}

body[data-view="quiz"] .quiz-actions #quizBackButton {
  left: 5.6%;
  top: 89.2%;
  width: 34%;
  height: 5.1%;
}

body[data-view="quiz"] .quiz-actions #quizBackButton::before {
  width: 1.55em;
  height: 1.1em;
  margin-right: 7%;
  content: "";
  background: var(--hand-back-arrow) center / contain no-repeat;
}

/* UI-standard rebuild pass: Home and Mode use real DOM plus independent assets,
   not baked full-page artwork. */
body[data-view="start"] .test-panel,
body[data-view="mode"] .test-panel {
  background-image: none;
}

body[data-view="start"] .topbar,
body[data-view="mode"] .topbar,
body[data-view="start"] .start-view,
body[data-view="mode"] .mode-view,
body[data-view="start"] .start-view h1,
body[data-view="start"] .start-copy,
body[data-view="start"] .home-art,
body[data-view="start"] .start-note,
body[data-view="mode"] .mode-head h1,
body[data-view="mode"] .mode-note {
  position: static;
  display: initial;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  white-space: normal;
  opacity: 1;
}

body[data-view="start"] .topbar,
body[data-view="mode"] .topbar {
  position: absolute;
  top: 5.8%;
  right: 7.2%;
  left: 7.2%;
  z-index: 5;
  display: grid;
  height: 6.2%;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  padding: 0;
  pointer-events: auto;
}

body[data-view="start"] .test-panel::before,
body[data-view="mode"] .test-panel::before {
  position: absolute;
  top: 2.3%;
  left: 7.2%;
  z-index: 5;
  color: var(--ink);
  content: "9:41";
  font-family: ui-rounded, system-ui, sans-serif;
  font-size: clamp(0.84rem, 3.75vw, 1rem);
  font-weight: 800;
  line-height: 1;
}

body[data-view="start"] .test-panel::after,
body[data-view="mode"] .test-panel::after {
  position: absolute;
  top: 2.1%;
  right: 7.2%;
  z-index: 5;
  width: 21%;
  height: 2.1%;
  content: "";
  background:
    linear-gradient(var(--ink), var(--ink)) 0 70% / 4px 32% no-repeat,
    linear-gradient(var(--ink), var(--ink)) 8px 52% / 4px 50% no-repeat,
    linear-gradient(var(--ink), var(--ink)) 16px 34% / 4px 68% no-repeat,
    radial-gradient(circle at 47% 50%, transparent 0 5px, var(--ink) 5.5px 6.5px, transparent 7px),
    linear-gradient(var(--ink), var(--ink)) 100% 50% / 22px 11px no-repeat;
}

body[data-view="start"] .brand-stack,
body[data-view="mode"] .brand-stack {
  display: block;
  grid-column: 1;
}

body[data-view="start"] .eyebrow,
body[data-view="mode"] .eyebrow {
  display: inline-flex;
  min-height: 0;
  font-size: clamp(1.05rem, 4.8vw, 1.25rem);
  font-weight: 900;
}

body[data-view="start"] .eyebrow::before,
body[data-view="mode"] .eyebrow::before {
  width: 13%;
  min-width: 29px;
  height: 48px;
  margin-right: 8px;
}

body[data-view="start"] .progress-text,
body[data-view="mode"] .progress-text,
body[data-view="start"] #backButton,
body[data-view="start"] #shareButton,
body[data-view="mode"] #backButton,
body[data-view="mode"] #shareButton {
  display: none;
}

body[data-view="start"] .toolbar,
body[data-view="mode"] .toolbar {
  display: grid;
  grid-column: 2;
}

body[data-view="start"] .start-view {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  padding: 0;
}

body[data-view="start"] .start-view h1 {
  position: absolute;
  top: 16.8%;
  left: 7.2%;
  z-index: 2;
  width: 66%;
  color: var(--ink);
  font-size: clamp(2.22rem, 10.2vw, 2.68rem);
  font-weight: 900;
  line-height: 1.02;
}

body[data-view="start"] .start-copy {
  position: absolute;
  top: 39.1%;
  left: 7.2%;
  z-index: 2;
  width: 49%;
  max-width: none;
  color: var(--ink);
  font-size: clamp(0.58rem, 2.62vw, 0.68rem);
  font-weight: 800;
  line-height: 1.72;
}

body[data-view="start"] .home-art {
  position: absolute;
  inset: 0;
  z-index: 1;
  min-height: 0;
  margin: 0;
}

body[data-view="start"] .molecule {
  top: 14.6%;
  right: 8.6%;
  width: 17%;
}

body[data-view="start"] .home-helix {
  display: none;
}

body[data-view="start"] .home-person {
  left: 7.5%;
  bottom: 14.1%;
  width: 81%;
}

body[data-view="start"] .flask {
  left: 7.1%;
  bottom: 15%;
  width: 9.8%;
}

body[data-view="start"] .spark-a {
  right: 16.2%;
  bottom: 33.5%;
  width: 10%;
}

body[data-view="start"] .start-action {
  top: 83.6%;
  left: 6.7%;
  z-index: 3;
  display: inline-flex;
  width: 86.6%;
  height: 8.1%;
  min-height: 0;
  border-width: 2px;
  opacity: 1;
  font-size: clamp(1.15rem, 5.2vw, 1.38rem);
}

body[data-view="start"] .start-note {
  position: absolute;
  bottom: 4.2%;
  left: 7%;
  z-index: 2;
  width: 86%;
  color: var(--ink);
  font-size: clamp(0.48rem, 2.2vw, 0.58rem);
  font-weight: 800;
}

body[data-view="mode"] .mode-view {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  padding: 0;
}

body[data-view="mode"] .topbar {
  grid-template-columns: 44px minmax(0, 1fr) 44px;
}

body[data-view="mode"] .brand-stack,
body[data-view="mode"] .toolbar {
  display: none;
}

body[data-view="mode"] .plain-nav {
  top: 6.2%;
  left: 6.3%;
  z-index: 8;
  display: grid;
  width: 10%;
  height: 5%;
  opacity: 1;
}

body[data-view="mode"] .mode-head h1 {
  position: absolute;
  top: 9.3%;
  left: 28%;
  z-index: 2;
  width: 44%;
  color: var(--ink);
  font-size: clamp(1.65rem, 7.7vw, 2.05rem);
  line-height: 0.98;
  text-align: center;
}

body[data-view="mode"] .mode-card {
  display: grid;
  grid-template-columns: 54% minmax(0, 1fr);
  grid-template-rows: 1fr auto auto auto 1fr;
  align-items: center;
  padding: 4.8% 6%;
  border: 2px solid var(--line);
  border-radius: 11px;
  background: #fffdf8;
  color: var(--ink);
  opacity: 1;
}

body[data-view="mode"] #freeTestButton {
  top: 20.9%;
  height: 28%;
}

body[data-view="mode"] #fullTestButton {
  top: 50.2%;
  height: 28%;
}

body[data-view="mode"] .mode-radio {
  top: 6.4%;
  left: 4.4%;
  width: 8.2%;
  height: 8.2%;
}

body[data-view="mode"] .mode-doodle {
  grid-row: 1 / 6;
  min-height: 0;
  height: 112%;
}

body[data-view="mode"] .mode-card strong {
  grid-column: 2;
  font-size: clamp(1.68rem, 7.6vw, 2.02rem);
}

body[data-view="mode"] .mode-card em {
  grid-column: 2;
  font-size: clamp(4.15rem, 19vw, 5rem);
}

body[data-view="mode"] .mode-card span:not(.mode-radio):not(.mode-doodle) {
  grid-column: 2;
  font-size: clamp(1.02rem, 4.8vw, 1.25rem);
}

body[data-view="mode"] .mode-card small {
  grid-column: 2;
  max-width: 11em;
  font-size: clamp(0.48rem, 2.1vw, 0.58rem);
  line-height: 1.25;
}

body[data-view="mode"] .mode-note {
  position: absolute;
  bottom: 9.6%;
  left: 19%;
  z-index: 2;
  width: 65%;
  min-height: 0;
  padding-left: 0;
  color: var(--ink);
  font-size: clamp(0.48rem, 2.15vw, 0.58rem);
  font-weight: 800;
  text-align: left;
}

body[data-view="mode"] .mode-note::before {
  left: -16%;
  width: 12%;
  height: 180%;
}

body[data-view="mode"] .mode-start-action {
  top: 88.2%;
  left: 6.9%;
  display: inline-flex;
  width: 86.2%;
  height: 7.1%;
  border: 2px solid var(--line);
  opacity: 1;
  font-size: clamp(1.2rem, 5.5vw, 1.45rem);
}

/* Final art-match pass for the first three real-UI pages. */
body[data-view="start"] .eyebrow {
  font-size: clamp(1.28rem, 6.2vw, 1.56rem);
}

body[data-view="start"] .eyebrow::before {
  width: 31px;
  min-width: 31px;
  height: 54px;
  margin-right: 8px;
}

body[data-view="start"] .start-copy {
  top: 38.7%;
  width: 58%;
  font-size: clamp(0.82rem, 3.8vw, 0.98rem);
  line-height: 1.52;
}

body[data-view="start"] .home-person {
  left: -10%;
  bottom: 15.4%;
  width: 62%;
  clip-path: inset(0 43% 0 0);
}

body[data-view="start"] .home-helix {
  position: absolute;
  top: 28.2%;
  right: -26%;
  display: block;
  width: 92%;
}

body[data-view="start"] .flask {
  bottom: 17.3%;
}

body[data-view="start"] .spark-a {
  right: 14.3%;
  bottom: 23.8%;
}

body[data-view="start"] .start-action {
  top: 85.9%;
  font-size: clamp(1.36rem, 6.2vw, 1.62rem);
}

body[data-view="start"] .start-note {
  bottom: 3.1%;
  font-size: clamp(0.58rem, 2.65vw, 0.68rem);
}

body[data-view="mode"] .test-panel::before,
body[data-view="mode"] .test-panel::after {
  content: none;
}

body[data-view="mode"] .plain-nav {
  top: 4.8%;
  left: 5.2%;
  width: 12%;
}

body[data-view="mode"] .mode-head h1 {
  top: 5.1%;
  left: 29%;
  width: 43%;
  font-size: clamp(1.92rem, 8.8vw, 2.32rem);
}

body[data-view="mode"] #freeTestButton {
  top: 16.9%;
  height: 33.7%;
}

body[data-view="mode"] #fullTestButton {
  top: 52.4%;
  height: 30.7%;
}

body[data-view="mode"] .mode-doodle {
  height: 124%;
}

body[data-view="mode"] .mode-note {
  bottom: 10.7%;
}

body[data-view="mode"] .mode-start-action {
  top: 90.8%;
  height: 6.9%;
}

body[data-view="quiz"] .quiz-title-row h1 {
  width: 78%;
  font-size: clamp(1.52rem, 7vw, 1.86rem);
  line-height: 1.16;
}

body[data-view="quiz"] .quiz-title-row img {
  top: -92%;
  right: -5%;
  width: 58%;
}

/* Third pass: correct overshoot from the split-art rebuild. */
body[data-view="start"] .home-person {
  left: -12%;
  bottom: 3.2%;
  width: 74%;
  clip-path: inset(0 43% 0 0);
}

body[data-view="start"] .home-helix {
  top: 28.4%;
  right: -13%;
  width: 77%;
}

body[data-view="start"] .spark-a {
  display: none;
}

body[data-view="start"] .start-action {
  top: 85.8%;
}

body[data-view="mode"] .mode-head h1 {
  top: 5.2%;
  left: 22.5%;
  width: 55%;
  font-size: clamp(1.78rem, 8.2vw, 2.08rem);
  line-height: 1.03;
}

body[data-view="mode"] .mode-doodle {
  width: 116%;
  background-size: 128% auto;
  background-position: 45% center;
}

body[data-view="mode"] .mode-card strong {
  font-size: clamp(1.82rem, 8.35vw, 2.18rem);
}

body[data-view="mode"] .mode-card em {
  font-size: clamp(4.45rem, 20.5vw, 5.35rem);
}

body[data-view="quiz"] .quiz-title-row h1 {
  width: 86%;
  font-size: clamp(1.46rem, 6.7vw, 1.78rem);
  line-height: 1.18;
}

body[data-view="quiz"] .quiz-title-row img {
  top: -92%;
  right: -5.4%;
  width: 60%;
}

/* 95%+ visual-fidelity pass: fixed pages use approved static art as their
   non-changing visual layer; live controls remain as transparent hotspots. */
body[data-view="start"] .test-panel {
  background-image: url("./assets/art/runtime/home-no-status.png");
}

body[data-view="mode"] .test-panel {
  background-image: url("./assets/art/runtime/02-mode-neutral.png");
}

body[data-view="start"] .test-panel::before,
body[data-view="start"] .test-panel::after,
body[data-view="mode"] .test-panel::before,
body[data-view="mode"] .test-panel::after {
  content: none;
}

body[data-view="start"] .topbar,
body[data-view="mode"] .topbar,
body[data-view="start"] .progress-track,
body[data-view="mode"] .progress-track,
body[data-view="start"] .start-view,
body[data-view="mode"] .mode-view {
  opacity: 0;
}

body[data-view="start"] .topbar,
body[data-view="mode"] .topbar {
  z-index: 30;
  opacity: 1;
}

body[data-view="start"] .brand-stack,
body[data-view="mode"] .brand-stack {
  visibility: hidden;
}

body[data-view="start"] .start-action {
  position: absolute;
  left: 6.7%;
  top: 85.9%;
  z-index: 20;
  width: 86.7%;
  height: 8.2%;
  opacity: 0;
  pointer-events: auto;
}

body[data-view="mode"] .plain-nav,
body[data-view="mode"] .mode-card,
body[data-view="mode"] .mode-start-action {
  opacity: 0;
  pointer-events: auto;
}

body[data-view="mode"] #freeTestButton,
body[data-view="mode"] #fullTestButton {
  left: 6.2%;
  width: 87.6%;
}

body[data-view="mode"] #freeTestButton {
  top: 16.4%;
  height: 35.2%;
}

body[data-view="mode"] #fullTestButton {
  top: 52.1%;
  height: 32.4%;
}

body[data-view="mode"] .test-panel::before,
body[data-view="mode"] .test-panel::after {
  position: absolute;
  left: 11.4%;
  z-index: 50;
  width: 2.85%;
  height: 1.32%;
  content: "";
  border-radius: 999px;
  pointer-events: none;
}

body[data-view="mode"] .test-panel::before {
  top: 20.45%;
}

body[data-view="mode"] .test-panel::after {
  top: 55.97%;
}

body[data-view="mode"][data-selected-plan="free"] .test-panel::before,
body[data-view="mode"][data-selected-plan="full"] .test-panel::after {
  background: var(--purple);
}

body[data-view="mode"][data-selected-plan="free"] .test-panel::after,
body[data-view="mode"][data-selected-plan="full"] .test-panel::before {
  background: transparent;
}

body[data-view="quiz"] .quiz-title-row h1 {
  width: 80%;
  font-size: clamp(1.36rem, 6.2vw, 1.62rem);
  line-height: 1.2;
  white-space: pre-line;
}

body[data-view="quiz"] .quiz-title-row img {
  top: -88%;
  right: -3.4%;
  width: 44%;
}

body[data-view="quiz"][data-question-id="startup_mode"] .test-panel {
  background-image: none;
}

body[data-view="quiz"][data-question-id="startup_mode"] .quiz-view {
  opacity: 1;
}

/* Stable quiz layout: question length may change typography, not the page skeleton. */
body[data-view="quiz"] .quiz-view::before {
  top: 4.82%;
  left: 5.25%;
  width: 11.6%;
  height: 5.25%;
  background: var(--hand-back-arrow) center / contain no-repeat;
}

body[data-view="quiz"] .quiz-progress-bar {
  top: 5.85%;
  left: 22.3%;
  width: 46.8%;
  height: 2.55%;
}

body[data-view="quiz"] .quiz-progress-count {
  top: 5.65%;
  right: 5.1%;
  min-width: 17%;
  font-size: clamp(1.18rem, 5.15vw, 1.42rem);
  text-align: right;
  white-space: nowrap;
}

body[data-view="quiz"] .dimension-pill {
  top: 11.75%;
  left: 5.7%;
  min-height: 4.15%;
  padding: 0.65% 3.55%;
  font-size: clamp(0.82rem, 3.8vw, 1rem);
}

body[data-view="quiz"] .quiz-title-row {
  top: 22.2%;
  left: 6.05%;
  right: 5.5%;
  height: 23.2%;
}

body[data-view="quiz"] .quiz-title-row h1 {
  width: 59%;
  max-height: none;
  overflow: visible;
  font-size: clamp(1.42rem, 6.55vw, 1.72rem);
  line-height: 1.12;
  white-space: normal;
}

body[data-view="quiz"] .quiz-view[data-question-length="long"] .quiz-title-row h1 {
  font-size: clamp(1.08rem, 4.95vw, 1.34rem);
  line-height: 1.08;
}

body[data-view="quiz"][data-question-id="startup_mode"] .quiz-title-row h1 {
  font-size: clamp(1.34rem, 6.05vw, 1.56rem);
  line-height: 1.13;
  white-space: pre-line;
}

body[data-view="quiz"] .quiz-figure-frame {
  position: absolute;
  top: 11.6%;
  right: -8%;
  z-index: 2;
  width: 60%;
  aspect-ratio: 1;
  box-sizing: border-box;
  padding: 5.35% 4.2% 3.1%;
  pointer-events: none;
}

body[data-view="quiz"] .quiz-figure {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: right center;
}

body[data-view="quiz"] .answers {
  position: absolute;
  top: 46.8%;
  left: 7.1%;
  z-index: 10;
  display: flex;
  width: 85.8%;
  flex-direction: column;
  gap: clamp(12px, 2.2vh, 18px);
}

body[data-view="quiz"] .answer-button {
  position: relative;
  top: auto;
  left: auto;
  grid-template-columns: 14.6% minmax(0, 1fr) 12.2%;
  gap: 4%;
  width: 100%;
  height: auto;
  min-height: clamp(72px, 9.35vh, 82px);
  padding: 1.7% 4%;
  box-sizing: border-box;
}

body[data-view="quiz"] .answer-button:nth-child(1) {
  top: auto;
}

body[data-view="quiz"] .answer-button:nth-child(2) {
  top: auto;
}

body[data-view="quiz"] .answer-button:nth-child(3) {
  top: auto;
}

body[data-view="quiz"] .answer-copy {
  display: block;
  overflow: visible;
  font-size: clamp(0.9rem, 3.95vw, 1.03rem);
  font-weight: 900;
  line-height: 1.08;
  -webkit-line-clamp: unset;
}

body[data-view="quiz"] .quiz-view[data-question-length="long"] .answer-copy {
  font-size: clamp(0.82rem, 3.55vw, 0.96rem);
  line-height: 1.06;
}

body[data-view="quiz"] {
  background: #f0ece3;
}

body[data-view="start"] .test-panel {
  border: 2px solid var(--line);
  border-radius: 22px;
}

body[data-view="start"] .test-panel::before,
body[data-view="start"] .test-panel::after {
  content: none;
}

/* Mobile-web presentation: the running HTML is a phone-sized web app preview,
   not a desktop collection page. */
body[data-view="start"] .app-shell,
body[data-view="mode"] .app-shell,
body[data-view="quiz"] .app-shell,
body[data-view="result"] .app-shell,
body[data-view="share"] .app-shell {
  min-height: 100svh;
  padding: clamp(10px, 2.2svh, 22px);
  place-items: center;
}

body[data-view="start"] .test-panel,
body[data-view="mode"] .test-panel,
body[data-view="quiz"] .test-panel,
body[data-view="result"] .test-panel,
body[data-view="share"] .test-panel {
  width: min(calc(100vw - 20px), calc((100svh - 20px) * 853 / 1844), 390px);
  border: 2px solid var(--line);
  border-radius: 22px;
}

@media (max-width: 430px) {
  body[data-view="start"] .app-shell,
  body[data-view="mode"] .app-shell,
  body[data-view="quiz"] .app-shell,
  body[data-view="result"] .app-shell,
  body[data-view="share"] .app-shell {
    padding: 0;
    place-items: start center;
  }

  body[data-view="start"] .test-panel,
  body[data-view="mode"] .test-panel,
  body[data-view="quiz"] .test-panel,
  body[data-view="result"] .test-panel,
  body[data-view="share"] .test-panel {
    width: min(100vw, calc(100svh * 853 / 1844), 390px);
  }
}

/* Result and share pages must stay data-driven; full-page mockups hard-code one result. */
body[data-view="result"] .app-shell,
body[data-view="share"] .app-shell {
  padding: 0;
  place-items: start center;
}

body[data-view="result"] .test-panel,
body[data-view="share"] .test-panel {
  width: min(100%, 390px);
  min-height: 100svh;
  height: auto;
  aspect-ratio: auto;
  padding: 16px 22px 22px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: var(--panel);
  box-shadow: 0 24px 64px var(--shadow);
}

body[data-view="result"] .topbar,
body[data-view="share"] .topbar,
body[data-view="result"] .progress-track,
body[data-view="share"] .progress-track,
body[data-view="result"] .result-view,
body[data-view="share"] .share-view {
  position: static;
  display: grid;
  width: auto;
  height: auto;
  min-height: 0;
  max-height: none;
  padding: 0;
  overflow: visible;
  opacity: 1;
  pointer-events: auto;
}

body[data-view="result"] .topbar,
body[data-view="share"] .topbar {
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

body[data-view="result"] .progress-track,
body[data-view="share"] .progress-track {
  margin-bottom: 12px;
}

body[data-view="result"] #backButton,
body[data-view="result"] #shareButton,
body[data-view="share"] #backButton,
body[data-view="share"] #shareButton {
  position: static;
  width: auto;
  height: auto;
  min-width: 42px;
  padding: 0;
  opacity: 1;
  pointer-events: auto;
}

body[data-view="result"] .result-view,
body[data-view="share"] .share-view {
  gap: 12px;
}

body[data-view="result"] .actions {
  position: static;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 9px;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  width: auto;
  height: auto;
  margin-top: 2px;
  padding-bottom: 6px;
  z-index: auto;
  opacity: 1;
  pointer-events: auto;
}

body[data-view="result"] .actions .primary-action,
body[data-view="result"] .actions .secondary-action {
  min-height: 48px;
}

body[data-view="result"] .actions .secondary-action {
  padding-right: 14px;
  padding-left: 14px;
}

body[data-view="share"] .share-actions {
  position: static;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  height: auto;
  margin-top: 2px;
}

body[data-view="share"] .share-actions button {
  min-height: 44px;
  border: 2px solid var(--line);
}

/* Result art-card pass: keep the result dynamic, but match the approved result art layout. */
body[data-view="result"] .app-shell {
  min-height: 100svh;
  padding: 0;
  place-items: start center;
}

body[data-view="result"] .test-panel {
  position: relative;
  width: min(100vw, 390px);
  min-height: 100svh;
  height: auto;
  aspect-ratio: auto;
  padding: 40px 27px 22px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: var(--panel);
  box-shadow: 0 24px 64px var(--shadow);
}

body[data-view="result"] .topbar {
  position: absolute;
  top: 20px;
  right: 25px;
  left: 25px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: auto;
  height: 28px;
  min-height: 0;
  margin: 0;
  padding: 0;
  opacity: 1;
  pointer-events: none;
}

body[data-view="result"] .brand-stack,
body[data-view="result"] .progress-track {
  display: none;
}

body[data-view="result"] .toolbar {
  display: contents;
}

body[data-view="result"] #backButton,
body[data-view="result"] #shareButton {
  position: static;
  display: grid;
  width: 28px;
  height: 28px;
  min-width: 0;
  padding: 0;
  opacity: 1;
  pointer-events: auto;
}

body[data-view="result"] .result-view {
  display: grid;
  gap: 12px;
  width: 100%;
  min-height: calc(100svh - 62px);
  height: auto;
  padding: 0;
  overflow: visible;
}

body[data-view="result"] .result-header {
  grid-template-columns: 150px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-height: 202px;
  padding: 30px 0 0;
}

body[data-view="result"] .avatar-art-composition {
  width: 150px;
  height: 150px;
}

body[data-view="result"] .result-hero h1 {
  font-size: clamp(1.72rem, 7.1vw, 2.08rem);
  line-height: 0.9;
}

body[data-view="result"] .type-summary {
  max-height: none;
  margin-top: 9px;
  overflow: visible;
  font-size: 0.82rem;
  line-height: 1.15;
}

body[data-view="result"] .result-study {
  margin-top: 7px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 0.72rem;
  line-height: 1;
}

body[data-view="result"] .result-metrics,
body[data-view="result"] .conclusion-section,
body[data-view="result"] .result-boundary,
body[data-view="result"] .lifestyle-section {
  display: none;
}

body[data-view="result"] .result-section {
  padding: 10px 0;
  border-top: 0;
}

body[data-view="result"] .result-section + .result-section {
  border-top: 1.8px solid var(--line);
}

body[data-view="result"] .result-section h2 {
  margin-bottom: 9px;
  font-size: 1.32rem;
  line-height: 1;
}

body[data-view="result"] .score-grid {
  gap: 8px;
}

body[data-view="result"] .score-card {
  grid-template-rows: 36px minmax(30px, auto) 24px minmax(24px, auto) 19px;
  gap: 2px;
  min-height: 150px;
  padding: 9px 6px 7px;
  border: 2px solid var(--line);
  border-radius: 9px;
}

body[data-view="result"] .gene-box-part {
  width: 36px;
  height: 36px;
}

body[data-view="result"] .score-label {
  font-size: 0.74rem;
  line-height: 1.05;
}

body[data-view="result"] .gene-box-score {
  margin: 0;
  color: var(--purple);
  font-size: 1.16rem;
  font-weight: 900;
  line-height: 1;
}

body[data-view="result"] .gene-box-genes {
  max-height: none;
  overflow: hidden;
  font-size: 0.66rem;
  line-height: 1.08;
}

body[data-view="result"] .gene-box-frequency strong {
  min-height: 19px;
  padding: 1px 8px;
  font-size: 0.64rem;
}

body[data-view="result"] .score-bar {
  display: none;
}

body[data-view="result"] #bioProfile {
  gap: 8px;
}

body[data-view="result"] .gene-chip {
  min-width: 0;
  justify-content: center;
  padding: 6px 10px;
  font-size: 0.76rem;
  line-height: 1;
}

body[data-view="result"] .ability-section {
  padding-bottom: 4px;
}

body[data-view="result"] .result-section ul {
  gap: 9px;
}

body[data-view="result"] .result-section li {
  padding-left: 38px;
  font-size: 0.84rem;
  line-height: 1.22;
}

body[data-view="result"] .result-section li::before {
  top: -1px;
  width: 28px;
  height: 28px;
}

body[data-view="result"] .actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin-top: 4px;
  padding-bottom: 0;
}

body[data-view="result"] #copyButton {
  min-height: 48px;
  border-width: 2.5px;
  font-size: 1.16rem;
}

body[data-view="result"] .disclaimer {
  margin-top: 0;
  font-size: 0.72rem;
  line-height: 1.12;
  text-align: center;
}

/* Standard mobile web UI pass: real scrollable app pages, not fixed artboards. */
body {
  min-height: 100dvh;
  background:
    radial-gradient(circle at 50% -8%, rgba(255, 255, 255, 0.96), transparent 30rem),
    #f2eee6;
}

body[data-view] .app-shell {
  min-height: 100dvh;
  padding: 0;
  place-items: start center;
}

body[data-view] .test-panel {
  position: relative;
  width: min(100%, 430px);
  min-height: 100dvh;
  height: auto;
  aspect-ratio: auto;
  padding: calc(10px + env(safe-area-inset-top)) 20px calc(26px + env(safe-area-inset-bottom));
  overflow-x: hidden;
  overflow-y: visible;
  border: 0;
  border-radius: 0;
  background: var(--panel);
  box-shadow: 0 22px 60px rgba(20, 18, 15, 0.12);
}

body[data-view] .topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  width: auto;
  height: auto;
  min-height: 48px;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin: calc(-10px - env(safe-area-inset-top)) -20px 10px;
  padding: calc(10px + env(safe-area-inset-top)) 20px 8px;
  background: rgba(255, 250, 242, 0.94);
  opacity: 1;
  pointer-events: auto;
}

body[data-view] .progress-track {
  position: static;
  display: block;
  width: auto;
  height: 5px;
  margin: 0 0 14px;
  opacity: 1;
  pointer-events: none;
}

body[data-view="start"] .progress-track,
body[data-view="mode"] .progress-track,
body[data-view="share"] .progress-track {
  display: none;
}

body[data-view] #backButton,
body[data-view] #shareButton {
  position: static;
  width: auto;
  height: auto;
  min-width: 42px;
  opacity: 1;
  pointer-events: auto;
}

body[data-view="start"] #backButton,
body[data-view="start"] #shareButton,
body[data-view="mode"] #shareButton,
body[data-view="quiz"] #shareButton,
  display: none;
}

body[data-view] .start-view,
body[data-view] .mode-view,
body[data-view] .quiz-view,
body[data-view] .result-view,
body[data-view] .share-view {
  position: static;
  display: grid;
  width: auto;
  height: auto;
  min-height: 0;
  max-height: none;
  padding: 0;
  margin: 0;
  overflow: visible;
  opacity: 1;
  pointer-events: auto;
}

body[data-view="start"] .test-panel::before,
body[data-view="start"] .test-panel::after,
body[data-view="quiz"] .quiz-view::before,
body[data-view="mode"] .test-panel::before,
body[data-view="mode"] .test-panel::after {
  content: none;
}

body[data-view="start"] .start-view {
  min-height: calc(100dvh - 84px);
  align-content: start;
  gap: 16px;
  padding-top: 10px;
}

body[data-view="start"] .start-view h1 {
  max-width: 9em;
  font-size: clamp(2.35rem, 10.4vw, 3.35rem);
  line-height: 0.96;
}

body[data-view="start"] .start-copy {
  max-width: 24em;
  font-size: 1rem;
  line-height: 1.42;
}

body[data-view="start"] .home-art {
  position: relative;
  min-height: 300px;
  margin: 0 0 14px;
}

body[data-view="start"] .home-person {
  left: 20%;
  bottom: 18%;
  width: min(34vw, 142px);
}

body[data-view="start"] .home-helix {
  right: 6%;
  bottom: 10%;
  width: min(44vw, 186px);
}

body[data-view="start"] .molecule {
  top: 4%;
  right: 3%;
}

body[data-view="start"] .flask {
  bottom: 16%;
  left: 5%;
}

body[data-view="start"] .spark-a {
  right: 8%;
  bottom: 34%;
}

body[data-view="mode"] .mode-view {
  min-height: calc(100dvh - 84px);
  gap: 16px;
  padding-top: 12px;
}

body[data-view="mode"] .topbar {
  display: none;
}

body[data-view="mode"] .mode-head {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

body[data-view="mode"] .mode-head h1 {
  position: static;
  max-width: none;
  margin: 0;
  overflow: visible;
  font-size: clamp(1.84rem, 7.4vw, 2.32rem);
  line-height: 1;
  text-align: left;
}

body[data-view="mode"] .plain-nav {
  position: static;
  display: grid;
  width: 42px;
  height: 42px;
}

body[data-view="mode"] .mode-options {
  gap: 12px;
  margin-top: 0;
}

body[data-view="mode"] .mode-card {
  min-height: 190px;
  grid-template-columns: 42% minmax(0, 1fr);
  padding: 16px;
  border-radius: 18px;
}

body[data-view="mode"] .mode-doodle {
  min-height: 150px;
}

body[data-view="mode"] .mode-card strong {
  font-size: 1.68rem;
}

body[data-view="mode"] .mode-card em {
  font-size: 4.1rem;
}

body[data-view="mode"] .mode-card span:not(.mode-radio):not(.mode-doodle) {
  font-size: 1.08rem;
}

body[data-view="mode"] .mode-note {
  justify-self: stretch;
  max-width: none;
  min-height: 36px;
  padding-left: 46px;
}

body[data-view="mode"] .mode-note::before {
  width: 36px;
  height: 36px;
}

body[data-view="quiz"] .quiz-view {
  min-height: 0;
  max-height: none;
  gap: 14px;
  padding: 0 0 10px;
  overflow: visible;
}

body[data-view="quiz"] .toolbar {
  display: none;
}

body[data-view="quiz"] .quiz-progress-bar {
  position: static;
  width: auto;
  height: 10px;
  margin: 0;
}

body[data-view="quiz"] .quiz-progress-count {
  position: static;
  margin: -4px 0 0;
  font-size: 0.82rem;
  text-align: right;
}

body[data-view="quiz"] .dimension-pill {
  position: static;
  width: fit-content;
  height: auto;
  padding: 6px 12px;
  font-size: 0.82rem;
}

body[data-view="quiz"] .quiz-title-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px;
  gap: 10px;
  align-items: start;
}

body[data-view="quiz"] .quiz-title-row h1 {
  font-size: clamp(1.72rem, 7.2vw, 2.25rem);
  line-height: 1.06;
}

body[data-view="quiz"] .quiz-figure-frame {
  position: static;
  display: grid;
  width: 104px;
  height: 132px;
  margin: 0;
  padding: 0;
  place-items: center;
}

body[data-view="quiz"] .quiz-figure {
  position: static;
  width: 104px;
  height: 132px;
  object-fit: contain;
}

body[data-view="quiz"] .answers {
  position: static;
  display: grid;
  gap: 10px;
  margin: 0;
}

body[data-view="quiz"] .answer-button {
  position: static;
  display: grid;
  width: auto;
  min-height: 76px;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 14px;
  opacity: 1;
  pointer-events: auto;
}

body[data-view="quiz"] .answer-copy {
  font-size: 0.96rem;
  line-height: 1.24;
}

body[data-view="quiz"] .quiz-actions {
  position: static;
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 10px;
  margin-top: 2px;
}

body[data-view="result"] .test-panel,
body[data-view="share"] .test-panel {
  width: min(100%, 430px);
  min-height: 100dvh;
  padding: calc(10px + env(safe-area-inset-top)) 20px calc(28px + env(safe-area-inset-bottom));
}

body[data-view="result"] .result-view {
  min-height: 0;
  gap: 14px;
}

body[data-view="result"] .result-header {
  grid-template-columns: 158px minmax(0, 1fr);
  min-height: 218px;
  gap: 14px;
  padding-top: 10px;
}

body[data-view="result"] .avatar-art-composition {
  width: 158px;
  height: 158px;
}

body[data-view="result"] .result-hero h1 {
  font-size: clamp(1.8rem, 7.5vw, 2.22rem);
}

body[data-view="result"] .type-summary {
  font-size: 0.86rem;
  line-height: 1.2;
}

body[data-view="result"] .result-metrics {
  display: grid;
}

body[data-view="result"] .conclusion-section,
body[data-view="result"] .result-boundary,
body[data-view="result"] .lifestyle-section {
  display: block;
}

body[data-view="result"] .result-section {
  padding: 12px 0;
}

body[data-view="result"] .score-card {
  min-height: 158px;
}

body[data-view="result"] .result-section li {
  font-size: 0.86rem;
}

body[data-view="share"] .share-view {
  min-height: 0;
  gap: 14px;
  padding: 0;
}

body[data-view="share"] .share-card {
  gap: 10px;
  padding: 10px 0 0;
}

body[data-view="share"] .share-avatar-stage {
  width: min(100%, 330px);
}

body[data-view="share"] .share-actions {
  display: grid;
  gap: 10px;
}

@media (max-width: 370px) {
  body[data-view] .test-panel {
    padding-right: 16px;
    padding-left: 16px;
  }

  body[data-view] .topbar {
    margin-right: -16px;
    margin-left: -16px;
    padding-right: 16px;
    padding-left: 16px;
  }

  body[data-view="result"] .result-header {
    grid-template-columns: 132px minmax(0, 1fr);
  }

  body[data-view="result"] .avatar-art-composition {
    width: 132px;
    height: 132px;
  }

  body[data-view="result"] .score-grid {
    gap: 6px;
  }
}

/* Mobile web refinement after visual QA. */
body[data-view] .toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

body[data-view="start"] .topbar {
  grid-template-columns: minmax(0, 1fr) auto;
}

body[data-view="start"] .brand-stack {
  display: block;
}

body[data-view="start"] .toolbar {
  grid-column: 2;
}

body[data-view] .progress-track {
  display: none;
}

body[data-view="start"] .start-view h1,
body[data-view="start"] .start-copy,
body[data-view="start"] .home-art,
body[data-view="start"] .start-note {
  position: static;
  width: auto;
  height: auto;
  opacity: 1;
  transform: none;
}

body[data-view="start"] .start-view h1 {
  margin: 0;
  color: var(--ink);
}

body[data-view="start"] .start-copy {
  margin: 0;
}

body[data-view="start"] .start-note {
  margin: 0;
}

body[data-view="mode"] .mode-card {
  overflow: hidden;
}

body[data-view="mode"] .mode-doodle {
  min-height: 136px;
  background-position: center;
  background-size: 88% auto;
}

body[data-view="quiz"] .quiz-progress-bar {
  margin-top: 2px;
}

body[data-view="quiz"] .quiz-progress-count {
  display: none;
}

body[data-view="result"] .toolbar {
  display: flex;
}

/* Proportion blueprint: reuse the approved art layout ratios on real DOM. */
body[data-view="mode"] .topbar {
  display: none;
}

body[data-view="mode"] .mode-view {
  padding-top: 12px;
}

body[data-view="mode"] .mode-head h1 {
  position: static;
}

body[data-view="result"] .result-view {
  gap: 12px;
}

body[data-view="result"] .result-header {
  order: 1;
  grid-template-columns: 156px minmax(0, 1fr);
  min-height: 222px;
  padding-top: 16px;
}

body[data-view="result"] .avatar-art-composition {
  width: 156px;
  height: 156px;
}

body[data-view="result"] .result-hero h1 {
  font-size: clamp(1.9rem, 7.8vw, 2.3rem);
  line-height: 0.92;
}

body[data-view="result"] .type-summary {
  margin-top: 10px;
  font-size: 0.88rem;
  line-height: 1.18;
}

body[data-view="result"] .result-study {
  margin-top: 9px;
  font-size: 0.76rem;
}

body[data-view="result"] .result-metrics {
  order: 6;
}

body[data-view="result"] .conclusion-section {
  order: 7;
}

body[data-view="result"] .result-section:has(#scoreGrid) {
  order: 2;
}

body[data-view="result"] .result-section:has(#bioProfile) {
  order: 3;
}

body[data-view="result"] .ability-section {
  order: 4;
}

body[data-view="result"] .actions {
  order: 5;
}

body[data-view="result"] .result-boundary {
  order: 8;
}

body[data-view="result"] .lifestyle-section {
  order: 9;
}

body[data-view="result"] .disclaimer {
  order: 10;
}

body[data-view="result"] .score-card {
  min-height: 160px;
}

body[data-view="result"] .gene-box-part {
  width: 38px;
  height: 38px;
}

body[data-view="result"] #copyButton {
  min-height: 54px;
}

/* Fixed-ratio art layout for the pre-result mobile screens, using real DOM. */
body[data-view="start"] .test-panel,
body[data-view="mode"] .test-panel,
body[data-view="quiz"] .test-panel,
body[data-view="share"] .test-panel {
  width: min(100vw, calc(100dvh * 853 / 1844), 430px);
  min-height: 100dvh;
  height: 100dvh;
  padding: 0;
  overflow: hidden;
}

body[data-view="start"] .topbar,
body[data-view="quiz"] .topbar,
body[data-view="share"] .topbar {
  position: absolute;
  top: 4.8%;
  right: 6.4%;
  left: 6.4%;
  z-index: 10;
  display: grid;
  min-height: 0;
  margin: 0;
  padding: 0;
  background: transparent;
}

body[data-view="start"] .topbar {
  grid-template-columns: 70px minmax(0, 1fr) 50px;
}

body[data-view="start"] .brand-stack {
  display: block;
  grid-column: 1 / 3;
}

body[data-view="start"] .eyebrow {
  font-size: clamp(2rem, 9vw, 3rem);
}

body[data-view="start"] .eyebrow::before {
  width: 56px;
  height: 80px;
  margin-right: 18px;
}

body[data-view="start"] .progress-text,
body[data-view="start"] #shareButton {
  display: none;
}

body[data-view="start"] .start-view {
  position: relative;
  min-height: 100%;
  gap: 0;
  padding: 0;
}

body[data-view="start"] .start-view h1 {
  position: absolute;
  top: 16.5%;
  left: 7.1%;
  width: 68%;
  max-width: none;
  font-size: clamp(2.85rem, 12.5vw, 5rem);
  line-height: 1;
}

body[data-view="start"] .start-copy {
  position: absolute;
  top: 45.5%;
  left: 7.1%;
  width: 56%;
  max-width: none;
  font-size: clamp(1.08rem, 4.8vw, 1.85rem);
  line-height: 1.42;
}

body[data-view="start"] .home-art {
  position: absolute;
  inset: 0;
  min-height: 0;
  margin: 0;
  pointer-events: none;
}

body[data-view="start"] .home-person {
  left: 14%;
  bottom: 16.6%;
  width: 30%;
}

body[data-view="start"] .home-helix {
  right: 4%;
  bottom: 11%;
  width: 33%;
}

body[data-view="start"] .molecule {
  top: 15%;
  right: 11%;
  width: 14%;
}

body[data-view="start"] .flask {
  left: 6%;
  bottom: 10.7%;
  width: 7.2%;
}

body[data-view="start"] .spark-a {
  right: 12%;
  bottom: 20%;
  width: 8%;
}

body[data-view="start"] .start-action {
  position: absolute;
  left: 7%;
  right: 7%;
  bottom: 6.9%;
  width: auto;
  min-height: 0;
  height: 8%;
  font-size: clamp(1.55rem, 7vw, 2.5rem);
}

body[data-view="start"] .start-note {
  position: absolute;
  right: 6%;
  bottom: 2.5%;
  left: 6%;
  font-size: clamp(0.86rem, 3.9vw, 1.34rem);
}

body[data-view="mode"] .mode-view {
  position: relative;
  min-height: 100%;
  gap: 0;
  padding: 0;
}

body[data-view="mode"] .mode-head {
  display: block;
}

body[data-view="mode"] .plain-nav {
  position: absolute;
  top: 6.1%;
  left: 6.2%;
  z-index: 5;
}

body[data-view="mode"] .mode-head h1 {
  position: absolute;
  top: 5.1%;
  right: 12%;
  left: 22%;
  font-size: clamp(2.8rem, calc(var(--artboard-width, 390px) * 0.122), 4.8rem);
  line-height: 0.98;
  text-align: center;
}

body[data-view="mode"] .mode-options {
  display: block;
  margin: 0;
}

body[data-view="mode"] .mode-card {
  position: absolute;
  left: 6.4%;
  width: 87.2%;
  height: 33.5%;
  min-height: 0;
  grid-template-columns: 58% minmax(0, 1fr);
  padding: 4.8% 6%;
  border-radius: 22px;
}

body[data-view="mode"] #freeTestButton {
  top: 16.5%;
}

body[data-view="mode"] #fullTestButton {
  top: 51.9%;
}

body[data-view="mode"] .mode-doodle {
  min-height: 100%;
  background-size: contain;
}

body[data-view="mode"] .mode-card strong {
  font-size: clamp(2.5rem, calc(var(--artboard-width, 390px) * 0.11), 4.2rem);
}

body[data-view="mode"] .mode-card em {
  font-size: clamp(4.5rem, calc(var(--artboard-width, 390px) * 0.2), 7.5rem);
}

body[data-view="mode"] .mode-card span:not(.mode-radio):not(.mode-doodle) {
  font-size: clamp(1.4rem, calc(var(--artboard-width, 390px) * 0.062), 2.35rem);
}

body[data-view="mode"] .mode-card small {
  font-size: clamp(0.72rem, calc(var(--artboard-width, 390px) * 0.032), 1.08rem);
  line-height: 1.05;
}

body[data-view="mode"] .mode-note {
  position: absolute;
  left: 22%;
  right: 10%;
  bottom: 11%;
  max-width: none;
  padding-left: 0;
  font-size: clamp(1rem, calc(var(--artboard-width, 390px) * 0.044), 1.6rem);
}

body[data-view="mode"] .mode-note::before {
  left: -58px;
}

body[data-view="mode"] .mode-start-action {
  position: absolute;
  right: 6.8%;
  bottom: 3.2%;
  left: 6.8%;
  width: auto;
  height: 7%;
  min-height: 0;
  font-size: clamp(1.7rem, 7.5vw, 2.7rem);
}

body[data-view="quiz"] .topbar {
  grid-template-columns: 52px minmax(0, 1fr);
}

body[data-view="quiz"] .brand-stack {
  justify-self: end;
}

body[data-view="quiz"] .eyebrow,
body[data-view="quiz"] .eyebrow::before {
  display: none;
}

body[data-view="quiz"] .progress-text {
  display: block;
  color: var(--ink);
  font-size: clamp(1.8rem, 8vw, 3rem);
  font-weight: 900;
}

body[data-view="quiz"] .quiz-view {
  position: relative;
  min-height: 100%;
  gap: 0;
  padding: 0;
}

body[data-view="quiz"] .quiz-progress-bar {
  position: absolute;
  top: 6.1%;
  left: 23%;
  width: 54%;
  height: 2.9%;
}

body[data-view="quiz"] .dimension-pill {
  position: absolute;
  top: 12.9%;
  left: 5.8%;
  padding: 2.2% 4%;
  font-size: clamp(1.18rem, 5.2vw, 1.9rem);
}

body[data-view="quiz"] .quiz-title-row {
  position: absolute;
  top: 24%;
  right: 5.8%;
  left: 5.8%;
  grid-template-columns: minmax(0, 1fr) 34%;
  gap: 4%;
}

body[data-view="quiz"] .quiz-title-row h1 {
  font-size: clamp(2.85rem, 12.4vw, 4.8rem);
  line-height: 1.14;
}

body[data-view="quiz"] .quiz-figure-frame,
body[data-view="quiz"] .quiz-figure {
  width: 100%;
  height: 100%;
}

body[data-view="quiz"] .quiz-figure-frame {
  position: absolute;
  top: 10%;
  right: 5.8%;
  z-index: 1;
  width: 36%;
  height: 18%;
  pointer-events: none;
}

body[data-view="quiz"] .answers {
  position: absolute;
  right: 6%;
  bottom: 16.7%;
  left: 6%;
  gap: 2.4dvh;
}

body[data-view="quiz"] .answer-button {
  min-height: 13.5dvh;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 18px;
  padding: 18px 22px;
  border-radius: 20px;
}

body[data-view="quiz"] .answer-marker {
  width: 50px;
  height: 50px;
  font-size: 1.5rem;
}

body[data-view="quiz"] .answer-copy {
  font-size: clamp(1.02rem, 4.55vw, 1.72rem);
  line-height: 1.24;
}

body[data-view="quiz"] .quiz-actions {
  position: absolute;
  right: 6%;
  bottom: 3.4%;
  left: 6%;
  grid-template-columns: 38% minmax(0, 1fr);
}

body[data-view="quiz"] .quiz-actions #quizBackButton {
  min-height: 58px;
  font-size: clamp(1.18rem, 5.2vw, 1.8rem);
}

body[data-view="share"] .topbar {
  grid-template-columns: 42px minmax(0, 1fr) 42px;
}

body[data-view="share"] .brand-stack {
  display: none;
}

body[data-view="share"] .share-view {
  position: relative;
  min-height: 100%;
  gap: 0;
  padding: 0;
}

body[data-view="share"] .share-card {
  padding: 0;
}

body[data-view="share"] .share-card h1 {
  position: absolute;
  top: 10.7%;
  right: 8%;
  left: 8%;
  font-size: clamp(2.05rem, 9.2vw, 3.4rem);
}

body[data-view="share"] .square-label {
  position: absolute;
  top: 20.4%;
  right: 8%;
  left: 8%;
  font-size: clamp(1.55rem, 6.8vw, 2.4rem);
  text-align: center;
}

body[data-view="share"] .share-avatar-stage {
  position: absolute;
  top: 25%;
  left: 6.8%;
  width: 86.4%;
}

body[data-view="share"] .share-avatar-stage .avatar-art-composition {
  width: 78%;
  height: 78%;
}

body[data-view="share"] .share-card h2 {
  position: absolute;
  top: 65.8%;
  right: 8%;
  left: 8%;
  font-size: clamp(2.3rem, 10vw, 3.7rem);
  text-align: center;
}

body[data-view="share"] .share-card .type-summary {
  display: none;
}

body[data-view="share"] .share-actions {
  position: absolute;
  right: 7%;
  bottom: 12.4%;
  left: 7%;
  gap: 2dvh;
}

body[data-view="share"] .share-actions button {
  min-height: 7dvh;
  font-size: clamp(1.35rem, 6vw, 2.1rem);
}

body[data-view="share"] .share-note {
  position: absolute;
  right: 12%;
  bottom: 3.2%;
  left: 12%;
  font-size: clamp(1.08rem, 4.8vw, 1.65rem);
}

/* Art proportion corrections for the mobile DOM version. */
body[data-view="start"] .brand-stack,
body[data-view="start"] .eyebrow {
  visibility: visible;
}

body[data-view="start"] .topbar {
  top: 5.2%;
  right: 7%;
  left: 7%;
  grid-template-columns: minmax(0, 1fr) 48px;
}

body[data-view="start"] .brand-stack {
  grid-column: 1;
}

body[data-view="start"] .eyebrow {
  font-size: clamp(2rem, 8.6vw, 3rem);
}

body[data-view="start"] .eyebrow::before {
  width: 46px;
  height: 66px;
  margin-right: 14px;
}

body[data-view="start"] .start-view h1 {
  top: 17.2%;
  width: 76%;
  font-size: clamp(2.8rem, 11.7vw, 4.8rem);
  line-height: 1.02;
}

body[data-view="start"] .start-copy {
  top: 40.9%;
  width: 54%;
  font-size: clamp(0.98rem, 4.25vw, 1.64rem);
  line-height: 1.48;
}

body[data-view="start"] .home-person {
  top: 56%;
  bottom: auto;
  left: 10.9%;
  width: 32.3%;
  height: 36.4%;
  object-fit: contain;
}

body[data-view="start"] .home-helix {
  top: 28.7%;
  right: auto;
  bottom: auto;
  left: 42.5%;
  width: 56%;
  height: 57.3%;
  object-fit: contain;
}

body[data-view="start"] .molecule {
  top: 11.6%;
  right: auto;
  left: 64.7%;
  width: 30.4%;
  height: 19.3%;
  object-fit: contain;
}

body[data-view="start"] .flask {
  top: 78.1%;
  bottom: auto;
  left: 1.2%;
  width: 21.4%;
  height: 10.9%;
  object-fit: contain;
}

body[data-view="quiz"] .progress-text {
  display: none;
}

body[data-view="quiz"] .quiz-progress-count {
  position: absolute;
  top: 5.25%;
  right: 6.6%;
  z-index: 12;
  display: block;
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.55rem, 6.8vw, 2.35rem);
  font-weight: 900;
  line-height: 1;
}

body[data-view="quiz"] .quiz-progress-bar {
  top: 5.95%;
  left: 22.5%;
  width: 53.5%;
  height: 2.55%;
}

body[data-view="quiz"] .dimension-pill {
  top: 11.6%;
  left: 5.8%;
}

body[data-view="quiz"] .quiz-title-row {
  top: 23.8%;
  right: auto;
  left: 6.1%;
  z-index: 2;
  display: block;
  width: 62.7%;
  grid-template-columns: none;
}

body[data-view="quiz"] .quiz-title-row h1 {
  width: 100%;
  font-size: clamp(1.88rem, 7.75vw, 3.2rem);
  line-height: 1.12;
}

body[data-view="quiz"] .quiz-view[data-question-length="long"] .quiz-title-row h1 {
  width: 100%;
  font-size: clamp(1.12rem, 5.05vw, 1.9rem);
  line-height: 1.08;
}

body[data-view="quiz"] .quiz-figure-frame {
  top: 13.3%;
  right: auto;
  left: 63.3%;
  z-index: 1;
  width: 32.8%;
  height: 22.8%;
}

body[data-view="quiz"] .answers {
  top: 39.15%;
  right: 5.6%;
  bottom: auto;
  left: 5.6%;
  gap: 2.6dvh;
}

body[data-view="quiz"] .answer-marker {
  width: 50px;
  height: 50px;
  font-size: 1.5rem;
}

body[data-view="quiz"] .answer-copy {
  font-size: clamp(1.18rem, 5.2vw, 1.95rem);
  line-height: 1.3;
}

body[data-view="quiz"] .quiz-actions {
  right: 5.6%;
  bottom: 5.6%;
  left: 5.6%;
  display: block;
  height: 6%;
  grid-template-columns: none;
}

body[data-view="result"] .result-header {
  grid-template-columns: 188px minmax(0, 1fr);
  min-height: 252px;
}

body[data-view="result"] .avatar-art-composition {
  width: 188px;
  height: 188px;
}

/* Goal: real DOM pages matched to the clickable art design using reusable PNG parts. */
body[data-view="start"] .test-panel,
body[data-view="mode"] .test-panel,
body[data-view="quiz"] .test-panel {
  width: min(100vw, calc(100dvh * 853 / 1844), 430px);
  min-height: 100dvh;
  height: 100dvh;
  padding: 0;
  overflow: hidden;
  background: var(--panel);
  box-shadow: none;
}

body[data-view="start"] .topbar,
body[data-view="mode"] .mode-view,
body[data-view="quiz"] .quiz-view {
  position: relative;
  min-height: 100%;
  height: 100%;
  max-height: none;
  padding: 0;
  overflow: hidden;
}

body[data-view="start"] .topbar,
body[data-view="quiz"] .topbar {
  position: absolute;
  z-index: 20;
  margin: 0;
  padding: 0;
  background: transparent;
}

body[data-view="start"] .progress-track,
body[data-view="mode"] .topbar,
body[data-view="mode"] .progress-track {
  display: none;
}

body[data-view="start"] .start-view h1,
body[data-view="start"] .start-copy,
body[data-view="start"] .home-art,
body[data-view="start"] .start-note {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

body[data-view="start"] .brand-stack,
body[data-view="start"] .eyebrow {
  visibility: visible;
}

body[data-view="start"] .topbar {
  top: 3.85%;
  right: 5.6%;
  left: 7.5%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 0;
  min-height: 0;
  height: 6.6%;
  pointer-events: none;
}

body[data-view="start"] #backButton,
body[data-view="start"] #shareButton {
  display: none;
}

body[data-view="start"] .brand-stack {
  grid-column: 1;
}

body[data-view="start"] .eyebrow {
  display: inline-flex;
  min-height: 0;
  font-size: clamp(1.75rem, 8vw, 3rem);
  line-height: 1;
}

body[data-view="start"] .eyebrow::before {
  width: 6.33vw;
  min-width: 0;
  height: 6.78dvh;
  min-height: 0;
  margin-top: -0.33dvh;
  margin-right: 5.51vw;
  background-image: url("./assets/art/icons/icon-home-header-dna.png");
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  flex: 0 0 auto;
}

body[data-view="start"] .progress-text {
  display: none;
}

body[data-view="start"] .toolbar {
  display: block;
  justify-self: end;
}

body[data-view="start"] .start-view {
  position: relative;
  min-height: 100%;
  height: 100%;
  padding: 0;
}

body[data-view="start"] .start-view h1 {
  position: absolute;
  top: 17.9%;
  left: 6.8%;
  z-index: 5;
  width: 66.82%;
  font-size: clamp(2.55rem, 10.8vw, 4.5rem);
  line-height: 1.02;
}

body[data-view="start"] .start-copy {
  position: absolute;
  top: 40.94%;
  left: 7.03%;
  z-index: 5;
  width: 44%;
  max-width: none;
  font-size: clamp(0.9rem, 3.7vw, 1.4rem);
  line-height: 1.45;
}

body[data-view="start"] .home-art {
  position: absolute;
  inset: 0;
  min-height: 0;
  margin: 0;
  pointer-events: none;
}

body[data-view="start"] .home-person,
body[data-view="start"] .home-helix,
body[data-view="start"] .dna-side-marks,
body[data-view="start"] .molecule,
body[data-view="start"] .flask,
body[data-view="start"] .spark-a {
  position: absolute;
  display: block;
  object-fit: contain;
  object-position: center;
}

body[data-view="start"] .home-person {
  top: 57.05%;
  left: 4.92%;
  width: 37.28%;
  height: 27.3%;
  clip-path: none;
}

body[data-view="start"] .home-helix {
  top: 33.08%;
  left: 51.58%;
  width: 37.51%;
  height: 48.81%;
}

body[data-view="start"] .dna-side-marks {
  top: 59%;
  left: 77.96%;
  width: 17%;
  height: 20.61%;
}

body[data-view="start"] .molecule {
  top: 11.6%;
  left: 64.7%;
  width: 30.4%;
  height: 19.3%;
}

body[data-view="start"] .flask {
  top: 78.1%;
  left: 1.2%;
  width: 21.4%;
  height: 10.9%;
}

body[data-view="start"] .spark-a {
  right: 8.5%;
  bottom: 21.5%;
  width: 9%;
  height: auto;
}

body[data-view="start"] .start-note {
  position: absolute;
  right: auto;
  bottom: 0;
  left: 16.65%;
  width: 66.82%;
  font-size: clamp(0.61rem, 2.7vw, 0.9rem);
  line-height: 1.15;
}

body[data-view="mode"] .mode-view {
  display: block;
}

body[data-view="mode"] .mode-head {
  display: block;
}

body[data-view="mode"] .plain-nav {
  position: absolute;
  top: 5.53%;
  left: 6.21%;
  z-index: 30;
  width: 7.74%;
  height: 2.6%;
}

body[data-view="mode"] .mode-head h1 {
  position: absolute;
  top: 4.88%;
  left: 29%;
  z-index: 5;
  width: 58%;
  max-width: none;
  font-size: clamp(2.25rem, calc(var(--artboard-width, 390px) * 0.1), 4rem);
  line-height: 1;
  text-align: center;
}

body[data-view="mode"] .mode-options {
  display: block;
  margin: 0;
}

body[data-view="mode"] .mode-card {
  border-radius: 22px;
}

body[data-view="mode"] #freeTestButton {
  top: 16.59%;
  left: 6.1%;
  width: 87.69%;
  height: 33.62%;
}

body[data-view="mode"] #fullTestButton {
  top: 52.39%;
  left: 6.1%;
  width: 87.69%;
  height: 30.37%;
}

body[data-view="mode"] .mode-note {
  position: absolute;
  top: var(--mode-note-top);
  right: auto;
  bottom: auto;
  left: 23.68%;
  z-index: 5;
  width: 53.34%;
  max-width: none;
  min-height: 0;
  padding-left: 0;
  font-size: clamp(0.92rem, calc(var(--artboard-width, 390px) * 0.04), 1.42rem);
  line-height: 1.22;
}

body[data-view="mode"] .mode-note::before {
  top: -5%;
  left: -24%;
  width: 15%;
  height: 90%;
}

body[data-view="mode"] .mode-start-action {
  top: auto;
  right: auto;
  bottom: 2.0%;
  left: 6.21%;
  width: 87.69%;
  height: 6.78%;
}

body[data-view="quiz"] .topbar {
  top: 4.76%;
  right: auto;
  left: 6.21%;
  width: 44px;
  height: 44px;
  min-height: 0;
  display: block;
}

body[data-view="quiz"] #backButton {
  min-width: 44px;
  width: 100%;
  height: 100%;
}

body[data-view="quiz"] .brand-stack,
body[data-view="quiz"] .toolbar {
  display: none;
}

body[data-view="quiz"] .quiz-view {
  display: block;
}

body[data-view="quiz"] .quiz-progress-bar {
  position: absolute;
  top: 6.45%;
  left: 22.51%;
  width: 53.22%;
  height: 2.28%;
}

body[data-view="quiz"] .quiz-progress-count {
  position: absolute;
  top: 6.28%;
  right: auto;
  left: 77.8%;
  z-index: 20;
  display: block;
  width: 12.31%;
  min-width: 0;
  margin: 0;
  color: var(--ink);
  font-size: clamp(1rem, 4.65vw, 1.5rem);
  font-weight: 900;
  line-height: 1;
  text-align: right;
  white-space: nowrap;
}

body[data-view="quiz"] .dimension-pill {
  position: absolute;
  top: 11.71%;
  left: 5.28%;
  z-index: 10;
  width: 48.65%;
  max-width: none;
  box-sizing: border-box;
  min-height: 4.23%;
  padding: 1.3% 3.5%;
  font-size: clamp(0.9rem, 4.1vw, 1.35rem);
  line-height: 1;
}

body[data-view="quiz"] .quiz-title-row {
  position: absolute;
  top: 19.5%;
  left: 5.7%;
  z-index: 5;
  display: block;
  width: 43.8%;
  max-width: none;
  height: auto;
  min-height: 10.3%;
}

body[data-view="quiz"] .quiz-title-row h1 {
  width: 100%;
  max-width: none;
  font-size: clamp(1.48rem, 6.15vw, 1.75rem);
  line-height: 1.08;
}

body[data-view="quiz"] .quiz-view[data-question-length="long"] .quiz-title-row h1 {
  width: 100%;
  font-size: clamp(1.48rem, 6.15vw, 1.75rem);
  line-height: 1.08;
}

body[data-view="quiz"] .quiz-figure-frame {
  position: absolute;
  top: 14.35%;
  left: 60.26%;
  z-index: 4;
  width: 39.85%;
  height: 24.86%;
  pointer-events: none;
}

body[data-view="quiz"] .quiz-figure {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

body[data-view="quiz"] .answers,
body[data-view="quiz"] .quiz-view[data-question-length="long"] .answers {
  position: absolute;
  top: 43.2%;
  right: auto;
  bottom: auto;
  left: 5.63%;
  z-index: 8;
  display: grid;
  width: 88.39%;
  gap: 7px;
}

body[data-view="quiz"] .answer-button {
  width: 100%;
  position: relative;
  min-height: 12.5dvh;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 18px;
  padding: 14px 22px;
  border-radius: 20px;
}

body[data-view="quiz"] .answer-button:nth-child(1) {
  min-height: 13.45dvh;
}

body[data-view="quiz"] .answer-button:nth-child(2) {
  min-height: 14.64dvh;
}

body[data-view="quiz"] .answer-button:nth-child(3) {
  min-height: 11.93dvh;
}

body[data-view="quiz"] .answer-copy {
  font-size: clamp(0.95rem, 3.98vw, 1.08rem);
  line-height: 1.12;
}

body[data-view="quiz"] .quiz-view[data-question-length="long"] .answer-copy {
  font-size: clamp(0.95rem, 3.98vw, 1.08rem);
  line-height: 1.12;
}

body[data-view="quiz"] .answer-button.selected::after {
  position: absolute;
  bottom: 9px;
  left: 84px;
  width: 34px;
  height: 34px;
  aspect-ratio: auto;
  pointer-events: none;
}

body[data-view="quiz"][data-question-id="startup_mode"] .quiz-title-row h1 {
  font-size: clamp(1.48rem, 6.15vw, 1.75rem);
  line-height: 1.08;
}

body[data-view="quiz"] .quiz-actions {
  position: absolute;
  right: auto;
  top: 80.1%;
  bottom: auto;
  left: 50%;
  z-index: 12;
  display: block;
  width: 33.76%;
  height: 5.45%;
  min-height: 44px;
  margin: 0;
  transform: translateX(-50%);
}

/* Final figure canvas-padding compensation:
   PNG canvases are larger for safer cropping, while visible figures keep their page scale. */
body[data-view="start"] .home-person {
  top: var(--home-person-top);
  left: var(--home-person-left);
  width: var(--home-person-width);
  height: var(--home-person-height);
  clip-path: none;
}

body[data-view="mode"] .mode-doodle {
  background-size: contain;
}

body[data-view="quiz"] .quiz-figure-frame {
  top: 13.4%;
  left: 51%;
  width: 45.48%;
  height: 27.46%;
}

body[data-view="quiz"] .dimension-pill {
  display: none;
}

/* Quiz adaptive strategy:
   - regular/tall phones keep the art-directed single-screen composition;
   - short phones keep the same 390x844 composition and scroll vertically,
     so figures and answer cards are not squeezed into each other. */
body[data-view="quiz"] {
  --quiz-artboard-height: 844px;
  --quiz-short-panel-width: min(100vw, 390px);
}

/* Keep the art-directed phone canvas from using desktop viewport units.
   The in-app browser can be wider than the phone mockup, so page art must scale
   from the panel width/height, not raw vw/dvh. */
body[data-view="start"],
body[data-view="mode"],
body[data-view="quiz"],
body[data-view="result"],
body[data-view="share"] {
  --artboard-width: min(calc(100vw - 20px), calc((100svh - 20px) * 853 / 1844), 390px);
  --artboard-height: calc(var(--artboard-width) * 1844 / 853);
}

body[data-view="start"] {
  --home-title-top: 17.9%;
  --home-title-left: 6.8%;
  --home-title-width: 66.82%;
  --home-title-font-size: clamp(2.55rem, calc(var(--artboard-width) * 0.108), 4.5rem);
  --home-title-line-height: 1.02;
  --home-copy-top: 40.94%;
  --home-copy-left: 7.03%;
  --home-copy-width: 44%;
  --home-copy-line-height: 1.45;
  --home-person-top: 56.1%;
  --home-person-left: 2.11%;
  --home-person-width: 42.91%;
  --home-person-height: 29.81%;
  --home-cta-top: 86.8%;
  --home-cta-left: 6.68%;
  --home-cta-width: 86.75%;
  --home-cta-height: 7.86%;
  --home-cta-font-size: clamp(1.55rem, calc(var(--artboard-width) * 0.068), 2.5rem);
  --home-landscape-panel-width: min(100vw, 390px);
  --home-landscape-artboard-height: 844px;
}

body[data-view="mode"] {
  --mode-title-top: 4.9%;
  --mode-title-left: 22%;
  --mode-title-right: 12%;
  --mode-title-font-size: clamp(2.25rem, calc(var(--artboard-width, 390px) * 0.1), 4rem);
  --mode-free-top: 16.59%;
  --mode-free-height: 33.62%;
  --mode-full-top: 52.39%;
  --mode-full-height: 30.37%;
  --mode-note-top: 82.9%;
  --mode-cta-bottom: 2%;
  --mode-cta-height: 6.78%;
  --mode-card-title-font: clamp(2.2rem, calc(var(--artboard-width, 390px) * 0.106), 3.9rem);
  --mode-card-count-font: clamp(4.45rem, calc(var(--artboard-width, 390px) * 0.2), 7.4rem);
  --mode-card-unit-font: clamp(1.28rem, calc(var(--artboard-width, 390px) * 0.059), 2.15rem);
  --mode-card-small-font: clamp(0.72rem, calc(var(--artboard-width, 390px) * 0.0325), 1.08rem);
  --mode-full-title-font: clamp(2.05rem, calc(var(--artboard-width, 390px) * 0.0925), 3.55rem);
  --mode-full-count-font: clamp(3.9rem, calc(var(--artboard-width, 390px) * 0.171), 6.2rem);
  --mode-full-unit-font: clamp(1.22rem, calc(var(--artboard-width, 390px) * 0.0535), 1.95rem);
  --mode-full-small-font: clamp(0.64rem, calc(var(--artboard-width, 390px) * 0.0285), 0.95rem);
  --mode-free-doodle-top: 10.2%;
  --mode-free-doodle-left: -0.8%;
  --mode-free-doodle-width: 66.4%;
  --mode-free-doodle-height: 91.3%;
  --mode-full-doodle-top: 11.9%;
  --mode-full-doodle-left: 3.7%;
  --mode-full-doodle-width: 57.7%;
  --mode-full-doodle-height: 87.4%;
}

body[data-view="start"] .test-panel,
body[data-view="mode"] .test-panel,
body[data-view="quiz"] .test-panel,
body[data-view="result"] .test-panel,
body[data-view="share"] .test-panel {
  width: var(--artboard-width);
  min-height: var(--artboard-height);
  height: var(--artboard-height);
}

body[data-view="start"] .eyebrow {
  font-size: clamp(1.75rem, calc(var(--artboard-width) * 0.08), 3rem);
}

body[data-view="start"] .eyebrow::before {
  width: calc(var(--artboard-width) * 0.0633);
  height: calc(var(--artboard-height) * 0.0678);
  margin-top: calc(var(--artboard-height) * -0.0033);
  margin-right: calc(var(--artboard-width) * 0.0551);
}

body[data-view="start"] .start-view h1 {
  top: var(--home-title-top);
  left: var(--home-title-left);
  width: var(--home-title-width);
  font-size: var(--home-title-font-size);
  line-height: var(--home-title-line-height);
}

body[data-view="start"] .start-copy {
  top: var(--home-copy-top);
  left: var(--home-copy-left);
  width: var(--home-copy-width);
  font-size: clamp(0.9rem, calc(var(--artboard-width) * 0.037), 1.4rem);
  line-height: var(--home-copy-line-height);
}

body[data-view="start"] .start-note {
  font-size: clamp(0.61rem, calc(var(--artboard-width) * 0.027), 0.9rem);
}

body[data-view="start"] .start-action {
  font-size: var(--home-cta-font-size);
}

body[data-view="start"] .start-action span {
  width: calc(var(--artboard-width) * 0.038);
  height: calc(var(--artboard-width) * 0.038);
}

@media (max-width: 430px) {
  body[data-view="start"],
  body[data-view="mode"],
  body[data-view="quiz"],
  body[data-view="result"],
  body[data-view="share"] {
    --artboard-width: min(100vw, 390px);
  }
}

@media (max-width: 380px) {
  body[data-view="start"] {
    --home-title-width: 74%;
    --home-title-font-size: clamp(2.2rem, calc(var(--artboard-width) * 0.1), 3rem);
    --home-title-line-height: 1;
    --home-copy-top: 39.9%;
    --home-copy-width: 52%;
    --home-copy-line-height: 1.2;
    --home-person-top: 60%;
    --home-person-height: 26.5%;
  }
}

@media (max-width: 340px) {
  body[data-view="mode"] {
    --mode-title-left: 16%;
    --mode-title-right: 6%;
    --mode-title-font-size: clamp(1.8rem, calc(var(--artboard-width) * 0.082), 2.4rem);
    --mode-free-doodle-height: 89%;
    --mode-full-doodle-height: 85%;
  }

  body[data-view="mode"] .mode-note {
    display: none;
  }
}

@media (max-height: 760px) {
  body[data-view="quiz"] {
    --artboard-width: var(--quiz-short-panel-width);
    --artboard-height: var(--quiz-artboard-height);
    overflow-y: auto;
  }

  body[data-view="quiz"] .app-shell {
    min-height: var(--quiz-artboard-height);
  }

  body[data-view="quiz"] .test-panel {
    width: var(--quiz-short-panel-width);
    min-height: var(--quiz-artboard-height);
    height: var(--quiz-artboard-height);
    margin-inline: auto;
    overflow: visible;
  }

  body[data-view="quiz"] .quiz-view {
    min-height: 100%;
    height: 100%;
    overflow: visible;
  }
}

@media (orientation: landscape) and (max-height: 500px) {
  body[data-view="start"],
  body[data-view="mode"],
  body[data-view="result"],
  body[data-view="share"] {
    --artboard-width: min(100vw, 390px);
    --artboard-height: 844px;
    overflow-y: auto;
  }

  body[data-view="start"] .app-shell,
  body[data-view="mode"] .app-shell,
  body[data-view="result"] .app-shell,
  body[data-view="share"] .app-shell {
    min-height: 844px;
  }

  body[data-view="start"] .test-panel,
  body[data-view="mode"] .test-panel {
    width: min(100vw, 390px);
    min-height: 844px;
    height: 844px;
    margin-inline: auto;
    overflow: visible;
  }

  body[data-view="result"] .test-panel,
  body[data-view="share"] .test-panel {
    width: min(100vw, 390px);
    min-height: 844px;
    height: auto;
    margin-inline: auto;
    overflow: visible;
  }

  body[data-view="share"] .test-panel,
  body[data-view="share"] .share-view {
    height: 844px;
  }
}

.avatar-art-image {
  top: -6.25%;
  left: -6.25%;
  width: 112.5%;
  height: 112.5%;
}

body[data-view="result"] .avatar-art-composition::before {
  content: "";
  position: absolute;
  z-index: 3;
  pointer-events: none;
}

body[data-view="result"] .avatar-art-composition::before {
  inset: 4px 5px 5px 3px;
  border: 3px solid var(--line);
  border-radius: 18px 23px 20px 25px / 22px 18px 24px 19px;
  transform: rotate(-1deg);
}

body[data-view="result"] #backButton,
body[data-view="result"] #shareButton,
body[data-view="share"] #backButton,
body[data-view="share"] #shareButton {
  width: 48px;
  height: 44px;
  min-width: 48px;
}

body[data-view="result"] #backButton span,
body[data-view="share"] #backButton span {
  width: 34px;
  height: 34px;
}

body[data-view="result"] #shareButton span {
  width: 46px;
  height: 46px;
}

body[data-view="share"] #shareButton span {
  width: 34px;
  height: 34px;
}

body[data-view="share"] #backButton,
body[data-view="share"] #shareButton {
  width: 58px;
  height: 52px;
  min-width: 58px;
}

body[data-view="share"] #backButton {
  transform: translate(-4px, -20px);
}

body[data-view="share"] #shareButton {
  transform: translate(56px, -4px);
}

body[data-view="share"] #backButton span,
body[data-view="share"] #shareButton span {
  width: 42px;
  height: 42px;
}

body[data-view="share"] #shareButton span {
  width: 44px;
  height: 44px;
}

body[data-view="share"] #shareButton {
  display: none;
}

body[data-view="share"] #saveAvatarButton span {
  background-image: url("./assets/art/icons/icon-share.png");
}

body[data-view="share"] #saveResultCardButton span {
  background-image: url("./assets/art/icons/icon-download.png");
}

.payment-dialog {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(18, 17, 15, 0.42);
}

.payment-dialog[hidden] {
  display: none;
}

.payment-card {
  position: relative;
  width: min(100%, 330px);
  padding: 24px 22px 22px;
  border: 4px solid var(--line);
  border-radius: 22px 18px 24px 20px / 18px 24px 20px 22px;
  background: #fffdf8;
  box-shadow: 8px 8px 0 rgba(17, 17, 15, 0.22);
  color: var(--line);
}

.payment-kicker {
  margin: 2px 56px 8px 0;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.payment-card h2 {
  margin: 0 54px 10px 0;
  font-size: 1.9rem;
  line-height: 0.98;
}

.payment-copy,
.payment-message {
  margin: 0;
  color: #4f493f;
  font-size: 0.96rem;
  font-weight: 800;
  line-height: 1.36;
}

.payment-confirm {
  width: 100%;
  min-height: 54px;
  margin: 18px 0 12px;
}

.payment-confirm:disabled {
  cursor: wait;
  opacity: 0.72;
}

body[data-view="share"] .share-avatar-stage .avatar-art-composition {
  width: 86%;
  height: 86%;
}

@supports (-webkit-touch-callout: none) {
  @media (hover: none) and (pointer: coarse) {
    body[data-view="start"] .start-note {
      display: none;
    }

    body[data-view="mode"] {
      --mode-title-top: 3.4%;
      --mode-title-font-size: clamp(2.05rem, calc(var(--artboard-width, 390px) * 0.09), 3.2rem);
      --mode-free-top: 13.3%;
      --mode-free-height: 29.5%;
      --mode-full-top: 44.9%;
      --mode-full-height: 24.5%;
      --mode-card-title-font: clamp(1.95rem, calc(var(--artboard-width, 390px) * 0.09), 3rem);
      --mode-card-count-font: clamp(3.85rem, calc(var(--artboard-width, 390px) * 0.17), 5.4rem);
      --mode-card-unit-font: clamp(1.1rem, calc(var(--artboard-width, 390px) * 0.048), 1.55rem);
      --mode-card-small-font: clamp(0.62rem, calc(var(--artboard-width, 390px) * 0.027), 0.86rem);
      --mode-full-title-font: clamp(1.95rem, calc(var(--artboard-width, 390px) * 0.087), 2.9rem);
      --mode-full-count-font: clamp(3.6rem, calc(var(--artboard-width, 390px) * 0.158), 5.1rem);
      --mode-full-unit-font: clamp(1.05rem, calc(var(--artboard-width, 390px) * 0.046), 1.5rem);
      --mode-full-small-font: clamp(0.6rem, calc(var(--artboard-width, 390px) * 0.026), 0.82rem);
    }

    body[data-view="mode"] .mode-note {
      display: none;
    }
  }
}

body[data-view="quiz"] .quiz-progress-count {
  font-size: clamp(1rem, calc(var(--artboard-width, 390px) * 0.0465), 1.5rem);
}

body[data-view="quiz"] .quiz-title-row h1,
body[data-view="quiz"] .quiz-view[data-question-length="long"] .quiz-title-row h1,
body[data-view="quiz"][data-question-id="startup_mode"] .quiz-title-row h1 {
  font-size: clamp(1.48rem, calc(var(--artboard-width, 390px) * 0.0615), 1.75rem);
}

body[data-view="start"] .start-view {
  opacity: 1;
  pointer-events: auto;
}

body[data-view="mode"] .mode-view {
  opacity: 1;
  pointer-events: auto;
}
