:root {
  color-scheme: light;
  --ink: #101827;
  --muted: #667085;
  --line: #d9dee8;
  --paper: #ffffff;
  --page: #f5f7fb;
  --red: #ef2336;
  --blue: #063b66;
  --button-blue: #0070c0;
  --button-blue-hover: #005f9f;
  --button-blue-disabled: #8fc4e5;
  --gold: #f2b84b;
  --green: #0d8b72;
  --shadow: 0 22px 60px rgba(16, 24, 39, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(130deg, rgba(239, 35, 54, 0.08), transparent 32%),
    linear-gradient(220deg, rgba(6, 59, 102, 0.12), transparent 36%),
    var(--page);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

button,
input {
  font: inherit;
}

.survey-shell {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0;
}

.screen {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
}

.screen > .panel {
  width: 100%;
  flex: 1 1 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
  padding: 16px 18px;
  border: 1px solid rgba(217, 222, 232, 0.72);
  border-radius: 8px;
  background:
    linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.96),
      rgba(255, 255, 255, 0.86)
    ),
    linear-gradient(120deg, rgba(6, 59, 102, 0.07), rgba(239, 35, 54, 0.045));
  box-shadow: 0 12px 32px rgba(16, 24, 39, 0.08);
}

.masthead-copy {
  min-width: 0;
  position: relative;
  padding-left: 14px;
}

.masthead-copy::before {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  bottom: 2px;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--red), var(--gold), var(--green));
}

.masthead-subtitle {
  max-width: 560px;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

.masthead-logo-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
  min-width: 180px;
}

.masthead-logo {
  display: block;
  width: clamp(150px, 17vw, 220px);
  height: auto;
  opacity: 0.96;
}

.eyebrow,
.section-kicker {
  margin: 0;
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  font-weight: 700;
  line-height: 1;
}

h2 {
  margin-bottom: 14px;
  font-size: clamp(1.6rem, 4vw, 2.75rem);
  font-weight: 400;
  line-height: 1.08;
}

p {
  line-height: 1.65;
}

.progress-card {
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid rgba(217, 222, 232, 0.85);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px);
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.progress-track {
  position: relative;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf5;
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--red), var(--gold), var(--green));
  transition: width 260ms ease;
}

.survey-shell > .topbar,
.survey-shell > .progress-card {
  display: none;
}

.progress-percent-inline {
  position: absolute;
  top: 50%;
  display: none;
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  transform: translateY(-50%);
  transition: left 260ms ease;
}

.progress-card.is-question-progress {
  padding: 10px 12px;
}

.progress-card.is-question-progress .progress-meta {
  display: none;
}

.progress-card.is-question-progress .progress-track {
  height: 18px;
}

.progress-card.is-question-progress .progress-percent-inline {
  display: block;
}

.panel {
  min-height: 520px;
  padding: clamp(22px, 4vw, 42px);
  border: 1px solid rgba(217, 222, 232, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.welcome-panel {
  display: grid;
  align-content: center;
  max-width: 820px;
  margin: 0 auto;
}

.reward-band {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 18px;
  align-items: center;
  margin-top: 20px;
  padding: 18px;
  border-left: 5px solid var(--red);
  border-radius: 8px;
  background: #f7f9fc;
}

.reward-band span,
.reward-band small {
  color: var(--muted);
  font-weight: 700;
}

.reward-band strong {
  color: var(--blue);
  font-size: 1.2rem;
}

.question-heading {
  max-width: 890px;
  margin-bottom: 22px;
}

.question-heading h2 {
  font-size: clamp(1.35rem, 3vw, 2.05rem);
  font-weight: 400;
  line-height: 1.14;
}

.question-heading h2 strong {
  font-weight: 700;
}

.question-subtitle {
  margin-bottom: 0;
  color: var(--muted);
}

.stimulus-grid {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(150px, 0.75fr) repeat(3, minmax(130px, 1fr));
  gap: 10px;
  margin: 0 0 24px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
}

.stimulus-spacer {
  min-width: 0;
}

.stimulus-card {
  overflow: hidden;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  background: #070707;
  box-shadow: 0 12px 28px rgba(16, 24, 39, 0.14);
  cursor: zoom-in;
  text-align: left;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.stimulus-card:hover {
  border-color: rgba(6, 59, 102, 0.35);
  box-shadow: 0 14px 32px rgba(16, 24, 39, 0.18);
  transform: translateY(-1px);
}

.stimulus-card:focus-visible {
  outline: 3px solid rgba(239, 35, 54, 0.24);
  outline-offset: 2px;
}

.stimulus-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1200 / 729;
  object-fit: cover;
}

.stimulus-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  color: #fff;
  background: #111827;
  font-weight: 700;
}

.image-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(16, 24, 39, 0.72);
  backdrop-filter: blur(12px);
}

.image-modal[hidden] {
  display: none;
}

.image-modal-panel {
  position: relative;
  width: min(1040px, 100%);
}

.image-modal-panel img {
  display: block;
  width: 100%;
  max-height: calc(100vh - 120px);
  object-fit: contain;
  border-radius: 8px;
  background: #000;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.38);
}

.modal-close-btn {
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 1;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 8px;
  color: #fff;
  background: rgba(16, 24, 39, 0.74);
  cursor: pointer;
  font-size: 1.45rem;
  font-weight: 600;
  line-height: 1;
}

.word-rows {
  display: grid;
  gap: 14px;
}

.word-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.75fr) repeat(3, minmax(130px, 1fr));
  gap: 10px;
  align-items: stretch;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.word-label {
  display: flex;
  align-items: center;
  min-height: 58px;
  color: var(--ink);
  font-size: 1.02rem;
  font-weight: 700;
}

.choice-card,
.age-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  padding: 12px 14px;
  border: 1px solid #cfd6e3;
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
  text-align: center;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.choice-card input,
.age-card input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.choice-card:has(input:focus-visible),
.age-card:has(input:focus-visible) {
  outline: 3px solid rgba(239, 35, 54, 0.24);
  outline-offset: 2px;
}

.choice-card:hover,
.age-card:hover {
  transform: translateY(-1px);
  border-color: var(--blue);
  box-shadow: 0 10px 24px rgba(6, 59, 102, 0.12);
}

.choice-card.selected,
.age-card.selected {
  border-color: var(--green);
  background: var(--paper);
  box-shadow:
    inset 0 0 0 1px rgba(13, 139, 114, 0.28),
    0 10px 24px rgba(13, 139, 114, 0.12);
}

.negative-card.selected {
  border-color: var(--red);
  background: #fff5f6;
  box-shadow: inset 0 0 0 2px rgba(239, 35, 54, 0.16);
}

.choice-card.selected::before,
.age-card.selected::before {
  content: "✓";
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 2px solid #fff;
  border-radius: 50%;
  color: #fff;
  background: var(--green);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 6px 14px rgba(16, 24, 39, 0.18);
}

.negative-card.selected::before {
  content: "×";
  background: var(--red);
}

.message-panel {
  display: grid;
  align-content: center;
}

.imagery-grid,
.recall-list {
  display: grid;
  gap: 10px;
}

.imagery-choice-card,
.recall-image-btn {
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #000;
}

.imagery-choice-card {
  position: relative;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.imagery-choice-card:hover {
  border-color: rgba(6, 59, 102, 0.35);
  box-shadow: 0 12px 26px rgba(16, 24, 39, 0.1);
}

.imagery-choice-card.selected {
  border-color: var(--green);
  box-shadow:
    0 0 0 3px rgba(13, 139, 114, 0.18),
    0 14px 32px rgba(16, 24, 39, 0.14);
}

.imagery-choice-card.selected::before {
  content: "✓";
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 2px solid #fff;
  border-radius: 50%;
  color: #fff;
  background: var(--green);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 6px 16px rgba(16, 24, 39, 0.22);
}

.imagery-choice-card.selected img {
  filter: brightness(0.72);
}

.imagery-choice-card img,
.recall-image-btn img {
  display: block;
  width: 100%;
  aspect-ratio: 2139 / 695;
  object-fit: contain;
}

.brand-recall-panel {
  max-width: 760px;
  margin: 0 auto;
}

.recall-row {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.recall-row .recall-image-btn {
  border-width: 1px;
}

.brand-recall-panel .text-input {
  min-height: 42px;
  padding: 0 12px;
  font-size: 0.9rem;
}

.text-input {
  width: 100%;
  min-height: 54px;
  padding: 0 16px;
  border: 1px solid #cfd6e3;
  border-radius: 8px;
  color: var(--ink);
  background: var(--paper);
  font-size: 1rem;
  font-weight: 400;
  outline: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.text-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(6, 59, 102, 0.12);
}

.occupation-other-field {
  grid-column: 1 / -1;
}

.scale-design-cards {
  display: grid;
  gap: 12px;
}

.scale-design-card {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(92px, 1fr);
  gap: 10px;
  align-items: stretch;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 10px 28px rgba(16, 24, 39, 0.08);
}

.scale-image-btn {
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background: #000;
  cursor: zoom-in;
}

.scale-image-btn img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 190px;
  object-fit: contain;
}

.side-rating-scale {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 7px;
  min-width: 0;
}

.side-anchor {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
}

.side-anchor-bottom {
  text-align: right;
}

.side-rating-options {
  display: grid;
  grid-template-rows: repeat(5, minmax(34px, 1fr));
  gap: 6px;
}

.side-rating-option {
  position: relative;
  display: grid;
  place-items: center;
  border: 2px solid currentColor;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-weight: 700;
}

.side-rating-option span {
  position: relative;
  z-index: 1;
}

.side-rating-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.side-rating-option:has(input:focus-visible) {
  outline: 3px solid rgba(6, 59, 102, 0.16);
  outline-offset: 2px;
}

.side-rating-option.selected {
  color: #fff;
  box-shadow: 0 8px 18px rgba(16, 24, 39, 0.1);
}

.rating-1,
.rating-2 {
  color: var(--green);
}

.rating-1.selected,
.rating-2.selected {
  background: var(--green);
  border-color: var(--green);
}

.rating-3 {
  color: var(--gold);
}

.rating-3.selected {
  background: var(--gold);
  border-color: var(--gold);
}

.rating-4 {
  color: #d5763f;
}

.rating-4.selected {
  background: #d5763f;
  border-color: #d5763f;
}

.rating-5 {
  color: var(--red);
}

.rating-5.selected {
  background: var(--red);
  border-color: var(--red);
}


.compact-panel {
  max-width: 820px;
  margin: 0 auto;
}

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

.reward-panel {
  display: grid;
  align-content: center;
}

.upi-field {
  display: grid;
  gap: 8px;
  margin-top: 22px;
}

.upi-field span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.upi-field input {
  width: 100%;
  min-height: 54px;
  padding: 0 16px;
  border: 1px solid #cfd6e3;
  border-radius: 8px;
  color: var(--ink);
  background: var(--paper);
  font-size: 1rem;
  font-weight: 400;
  outline: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.upi-field input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(6, 59, 102, 0.12);
}

.error {
  margin: 18px 0 0;
  color: #b31323;
  font-weight: 700;
}

.error:empty {
  display: none;
}

.field-error {
  margin: -2px 2px 0;
  color: #b31323;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.25;
}

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

.summary {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.complete-panel,
.complete-panel * {
  font-weight: 400;
}

.complete-panel h2,
.complete-panel .section-kicker {
  font-weight: 700;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #f5f7fb;
}

.summary-row span:first-child {
  color: var(--muted);
  font-weight: 600;
}

.summary-row span:last-child {
  font-weight: 700;
  text-align: right;
}

.actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 18px;
}

.actions[hidden] {
  display: none;
}

.primary-btn,
.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-width: 128px;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.96rem;
  font-weight: 600;
  line-height: 1.1;
  transition:
    opacity 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease,
    transform 120ms ease;
}

.primary-btn {
  border: 0;
  color: #fff;
  background: var(--button-blue);
  box-shadow: 0 12px 24px rgba(0, 112, 192, 0.22);
}

.primary-btn:hover {
  background: var(--button-blue-hover);
}

.primary-btn:active:not([disabled]),
.ghost-btn:active:not([disabled]) {
  transform: translateY(1px) scale(0.99);
}

.primary-btn[disabled] {
  cursor: wait;
  background: var(--button-blue-disabled);
  box-shadow: 0 8px 18px rgba(6, 59, 102, 0.12);
  opacity: 1;
  transform: none;
}

.btn-spinner {
  width: 17px;
  height: 17px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.ghost-btn {
  border: 1px solid var(--line);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.74);
}

.ghost-btn[disabled] {
  cursor: not-allowed;
  opacity: 0.4;
}

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

@media (max-width: 780px) {
  .survey-shell {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    height: 100dvh;
    min-height: 100dvh;
    width: min(100% - 16px, 1120px);
    padding: 5px 0;
  }

  .topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-left: 0;
    margin-bottom: 6px;
    padding: 8px 10px;
  }

  .masthead-logo-wrap {
    justify-content: flex-start;
    min-width: 0;
  }

  .masthead-logo {
    width: 148px;
  }

  .masthead-subtitle {
    font-size: 0.78rem;
    line-height: 1.25;
  }

  .progress-card {
    margin-bottom: 6px;
    padding: 8px 10px;
  }

  .progress-meta {
    margin-bottom: 7px;
    font-size: 0.82rem;
  }

  .progress-card.is-question-progress {
    margin-bottom: 6px;
    padding: 4px 8px;
  }

  .progress-card.is-question-progress .progress-track {
    height: 12px;
  }

  .progress-card.is-question-progress .progress-percent-inline {
    font-size: 0.66rem;
  }

  .question-heading {
    margin-bottom: 8px;
  }

  .question-heading h2 {
    margin-bottom: 5px;
    font-size: clamp(1.18rem, 5vw, 1.55rem);
    line-height: 1.1;
  }

  .question-subtitle {
    font-size: 0.92rem;
    line-height: 1.35;
  }

  .imagery-grid,
  .recall-list {
    gap: 9px;
  }

  .brand-recall-panel {
    padding: 8px;
  }

  .brand-recall-panel .question-heading {
    margin-bottom: 6px;
  }

  .brand-recall-panel .recall-list {
    gap: 20px;
  }

  .brand-recall-panel .recall-row {
    gap: 4px;
    padding: 4px;
  }

  .brand-recall-panel .recall-image-btn img {
    aspect-ratio: 2139 / 695;
    object-fit: contain;
  }

  .brand-recall-panel .text-input {
    min-height: 34px;
  }

  .screen {
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 2px;
    overscroll-behavior: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .screen::-webkit-scrollbar {
    display: none;
  }

  .panel {
    min-height: auto;
    padding: 10px 10px 10px;
  }

  .question-panel {
    overflow-x: auto;
  }

  .stimulus-grid {
    grid-template-columns: minmax(78px, 0.82fr) repeat(3, minmax(68px, 1fr));
    width: 100%;
    min-width: 0;
    gap: 6px;
    padding: 8px;
  }

  .stimulus-spacer {
    display: block;
  }

  .word-row {
    grid-template-columns: minmax(78px, 0.82fr) repeat(3, minmax(68px, 1fr));
    width: 100%;
    min-width: 0;
    gap: 6px;
    padding: 8px;
  }

  .stimulus-label {
    display: grid;
    gap: 1px;
    padding: 7px 6px;
    font-size: 0.62rem;
  }

  .word-label,
  .choice-card {
    min-height: 46px;
    font-size: 0.74rem;
  }

  .choice-card {
    padding: 8px 5px;
  }

  .scale-question-panel {
    overflow-x: visible;
  }

  .scale-design-cards {
    gap: 4px;
  }

  .scale-design-card {
    grid-template-columns: minmax(0, 3fr) 82px;
    gap: 4px;
    padding: 4px;
  }

  .scale-image-btn img {
    min-height: 88px;
  }

  .side-rating-scale {
    gap: 3px;
  }

  .side-anchor {
    font-size: 0.56rem;
    line-height: 1.05;
  }

  .side-rating-options {
    grid-template-rows: repeat(5, minmax(16px, 1fr));
    gap: 2px;
  }

  .side-rating-option {
    border-radius: 6px;
    font-size: 0.68rem;
  }

  .age-options {
    grid-template-columns: 1fr;
  }

  .question-panel-age .age-options,
  .question-panel-occupation .age-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .actions {
    margin-top: 0;
    padding: 6px max(8px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  }

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

@media (max-width: 380px) {
  .scale-question-panel {
    padding: 8px;
  }

  .scale-design-card {
    grid-template-columns: minmax(0, 1fr) 112px;
  }

  .side-anchor {
    font-size: 0.54rem;
  }
}

.invalid-url-panel {
  display: grid;
  min-height: 100vh;
  place-items: center;
  text-align: center;
}

.invalid-url-panel p {
  max-width: 560px;
  margin: 0;
  color: var(--ink);
  font-size: 1.42rem;
  font-weight: 400;
  line-height: 1.45;
}
