:root {
  color-scheme: light;
  --page: #f7f3ef;
  --surface: #fffdfb;
  --surface-muted: #f0ebe6;
  --ink: #241b27;
  --muted: #5f5663;
  --faint: #8b828d;
  --line: #ded7d1;
  --line-strong: #2b2230;
  --accent: #2b2030;
  --accent-soft: #eee7f0;
  --danger: #9f2d20;
  --success: #2f6f4e;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --ring: 0 0 0 3px rgba(43, 32, 48, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-rendering: optimizeLegibility;
}

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

button {
  color: inherit;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.12em;
  text-decoration-thickness: 1px;
}

a:hover {
  text-decoration-thickness: 2px;
}

h1,
.description a,
.question h2 a,
.rank-label a,
.match-row strong a,
.scale-value-row a,
.tradeoff-definition-copy strong a,
.tradeoff-axis-title a {
  overflow-wrap: anywhere;
}

.shell {
  width: min(1000px, calc(100vw - 48px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 42px 0 64px;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  padding: clamp(28px, 6vh, 70px) 0 48px;
}

.topbar-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line-strong);
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.eyebrow--secure {
  color: var(--success);
}

.eyebrow--secure::before {
  content: "\1F512";
  margin-right: 6px;
  font-size: 11px;
}

h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", ui-serif, serif;
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 0.95;
}

.description {
  margin: 0;
  color: var(--ink);
  font-size: clamp(18px, 2.2vw, 23px);
  line-height: 1.35;
}

.status-panel {
  display: flex;
  gap: 16px;
  align-items: baseline;
  color: var(--muted);
  font-size: 13px;
}

.status-panel span {
  white-space: nowrap;
}

.status-panel span:first-child {
  color: var(--success);
  font-weight: 750;
}

.status-panel[data-status="saving"] span:first-child {
  color: var(--accent);
}

.status-panel[data-status="save-failed"] span:first-child,
.status-panel[data-status="submit-failed"] span:first-child {
  color: var(--danger);
}

.questions {
  display: grid;
  gap: 18px;
}

.question {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.question-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  padding: 28px 28px 22px;
  border-bottom: 1px solid var(--line);
}

.question h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1.06;
}

.question-type {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.choices,
.ranking,
.matching,
.scale-answer,
.color-choices,
.binary-tradeoff,
.text-answer {
  display: grid;
  gap: 10px;
  padding: 20px 28px 28px;
}

.choice-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 26px;
  gap: 10px;
  align-items: center;
}

.choice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px;
  gap: 16px;
  align-items: center;
  width: 100%;
  min-height: 58px;
  padding: 16px 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition:
    border-color 140ms ease,
    background 140ms ease,
    color 140ms ease,
    transform 140ms ease;
}

.choice-label {
  overflow-wrap: anywhere;
}

.choice-link {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  transition: color 140ms ease, background 140ms ease;
}

.choice-link:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.choice-link:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

.choice:hover {
  border-color: var(--line-strong);
}

.choice:focus-visible,
.secondary:focus-visible,
.small:focus-visible,
.primary:focus-visible,
.color-choice:focus-visible,
.tradeoff-quick-picks button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

.choice.is-selected {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.mark {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 24px;
  height: 24px;
  border: 1.5px solid currentColor;
  background: var(--surface);
  color: var(--muted);
  transition:
    background 140ms ease,
    border-color 140ms ease,
    color 140ms ease,
    transform 140ms ease;
}

.mark::before {
  content: "";
  transition: transform 140ms ease;
}

.choice--single .mark {
  border-radius: 999px;
}

.choice--single .mark::before {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: currentColor;
  transform: scale(0);
}

.choice--multiple .mark {
  border-radius: 7px;
}

.choice--multiple .mark::before {
  width: 10px;
  height: 6px;
  border-bottom: 2px solid currentColor;
  border-left: 2px solid currentColor;
  transform: rotate(-45deg) scale(0);
}

.choice.is-selected .mark {
  border-color: #fff;
  background: #fff;
  color: var(--accent);
  transform: scale(1.04);
}

.choice.is-selected.choice--single .mark::before {
  transform: scale(1);
}

.choice.is-selected.choice--multiple .mark::before {
  transform: rotate(-45deg) scale(1);
}

.color-choices {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.color-choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 88px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.68), transparent),
    var(--surface);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition:
    border-color 140ms ease,
    background 140ms ease,
    transform 140ms ease,
    box-shadow 140ms ease;
}

.color-choice:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.color-choice.is-selected {
  border-color: var(--color-choice);
  box-shadow: inset 0 0 0 2px var(--color-choice);
}

.color-swatch {
  grid-row: span 2;
  width: 54px;
  height: 54px;
  border: 2px solid var(--surface);
  border-radius: 999px;
  background: var(--color-choice);
  box-shadow:
    0 0 0 1px var(--line),
    0 8px 18px rgba(36, 27, 39, 0.16);
}

.color-label {
  align-self: end;
  overflow-wrap: anywhere;
  font-weight: 800;
}

.color-value {
  align-self: start;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.custom-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding-top: 6px;
}

.custom-row input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  padding: 14px 15px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.custom-row input:hover,
textarea:hover,
select:hover {
  border-color: var(--line-strong);
}

.custom-row input::placeholder,
textarea::placeholder {
  color: var(--faint);
}

textarea {
  min-height: 132px;
  line-height: 1.5;
  resize: vertical;
}

.scale-answer {
  --scale-progress: 50%;
  gap: 18px;
}

.scale-value-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: center;
  color: var(--muted);
}

.scale-value-row strong {
  display: grid;
  place-items: center;
  min-width: 82px;
  height: 56px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 25px;
  font-weight: 750;
  letter-spacing: 0;
}

.scale-value-row span:last-child {
  text-align: right;
}

.scale-control {
  display: grid;
  gap: 12px;
  padding: 20px 18px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), transparent),
    var(--surface-muted);
}

.scale-range {
  width: 100%;
  height: 34px;
  margin: 0;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

.scale-range::-webkit-slider-runnable-track {
  height: 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    var(--accent) 0 var(--scale-progress),
    var(--surface) var(--scale-progress) 100%
  );
}

.scale-range::-webkit-slider-thumb {
  width: 30px;
  height: 30px;
  margin-top: -10px;
  appearance: none;
  border: 3px solid var(--surface);
  border-radius: 999px;
  background: var(--accent);
  box-shadow:
    0 0 0 1px var(--line-strong),
    0 8px 18px rgba(36, 27, 39, 0.18);
}

.scale-range::-moz-range-track {
  height: 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.scale-range::-moz-range-progress {
  height: 12px;
  border-radius: 999px;
  background: var(--accent);
}

.scale-range::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border: 3px solid var(--surface);
  border-radius: 999px;
  background: var(--accent);
  box-shadow:
    0 0 0 1px var(--line-strong),
    0 8px 18px rgba(36, 27, 39, 0.18);
}

.scale-ticks {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  padding: 0 13px;
}

.scale-ticks span {
  justify-self: center;
  width: 1px;
  height: 8px;
  background: var(--line-strong);
  opacity: 0.32;
}

.scale-ticks span:first-child {
  justify-self: start;
}

.scale-ticks span:last-child {
  justify-self: end;
}

.binary-tradeoff {
  --tradeoff-left: #c6533d;
  --tradeoff-left-soft: #fae9e3;
  --tradeoff-right: #126a74;
  --tradeoff-right-soft: #e2f3f2;
  --tradeoff-progress: 50%;
  --tradeoff-active: var(--accent);
  --tradeoff-active-soft: var(--accent-soft);
  container-type: inline-size;
  gap: 16px;
}

.tradeoff-definitions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.tradeoff-definition {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 13px;
  align-items: start;
  min-height: 92px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.tradeoff-definition--left {
  border-color: var(--tradeoff-left);
  background: linear-gradient(180deg, var(--tradeoff-left-soft), var(--surface) 78%);
}

.tradeoff-definition--right {
  border-color: var(--tradeoff-right);
  background: linear-gradient(180deg, var(--tradeoff-right-soft), var(--surface) 78%);
}

.tradeoff-definition-letter {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 22px;
  font-weight: 900;
}

.tradeoff-definition--left .tradeoff-definition-letter {
  background: var(--tradeoff-left);
}

.tradeoff-definition--right .tradeoff-definition-letter {
  background: var(--tradeoff-right);
}

.tradeoff-definition-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.tradeoff-definition-copy span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.tradeoff-definition-copy strong {
  font-size: 19px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.tradeoff-axis {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 12px;
  align-items: end;
  padding-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.tradeoff-axis-end {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-width: 0;
}

.tradeoff-axis-end--right {
  grid-template-columns: minmax(0, 1fr) auto;
  text-align: right;
}

.tradeoff-letter {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 17px;
  font-weight: 900;
}

.tradeoff-axis-end--left .tradeoff-letter {
  background: var(--tradeoff-left);
}

.tradeoff-axis-end--right .tradeoff-letter {
  background: var(--tradeoff-right);
}

.tradeoff-axis-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@container (max-width: 720px) {
  .tradeoff-axis-title {
    display: none;
  }

  .tradeoff-axis-end,
  .tradeoff-axis-end--right {
    grid-template-columns: auto;
  }

  .tradeoff-axis-end--right {
    justify-items: end;
  }
}

.tradeoff-zero {
  color: var(--accent);
}

.tradeoff-range {
  width: 100%;
  height: 34px;
  margin: 0;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

.tradeoff-range::-webkit-slider-runnable-track {
  height: 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    var(--tradeoff-left) 0 var(--tradeoff-progress),
    var(--tradeoff-right) var(--tradeoff-progress) 100%
  );
}

.tradeoff-range::-webkit-slider-thumb {
  width: 30px;
  height: 30px;
  margin-top: -10px;
  appearance: none;
  border: 3px solid var(--surface);
  border-radius: 999px;
  background: var(--tradeoff-active);
  box-shadow:
    0 0 0 1px var(--line-strong),
    0 8px 18px rgba(36, 27, 39, 0.18);
}

.tradeoff-range::-moz-range-track {
  height: 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.tradeoff-range::-moz-range-progress {
  height: 12px;
  border-radius: 999px;
  background: var(--tradeoff-left);
}

.tradeoff-range::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border: 3px solid var(--surface);
  border-radius: 999px;
  background: var(--tradeoff-active);
  box-shadow:
    0 0 0 1px var(--line-strong),
    0 8px 18px rgba(36, 27, 39, 0.18);
}

.tradeoff-readout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 15px;
  border: 1px solid var(--tradeoff-active);
  border-radius: var(--radius-md);
  background: var(--tradeoff-active-soft);
}

.tradeoff-readout strong {
  display: block;
  margin-bottom: 4px;
  color: var(--tradeoff-active);
  font-size: 18px;
}

.tradeoff-readout span {
  color: var(--muted);
  line-height: 1.4;
}

.tradeoff-score {
  display: grid;
  place-items: center;
  min-width: 72px;
  height: 54px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--tradeoff-active);
  font-size: 25px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.tradeoff-quick-picks {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.tradeoff-quick-picks button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-weight: 750;
  transition:
    border-color 140ms ease,
    background 140ms ease,
    transform 140ms ease;
}

.tradeoff-quick-picks button:hover {
  border-color: var(--line-strong);
  background: var(--surface-muted);
  transform: translateY(-1px);
}

.secondary,
.small,
.primary {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 750;
  transition:
    transform 140ms ease,
    background 140ms ease,
    color 140ms ease,
    opacity 140ms ease,
    box-shadow 140ms ease;
}

.secondary,
.small {
  background: var(--surface);
  color: var(--ink);
}

.secondary {
  padding: 13px 16px;
}

.small {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  font-size: 18px;
}

.primary {
  min-width: 138px;
  padding: 15px 20px;
  background: var(--accent);
  color: #fff;
}

.secondary:hover,
.small:hover {
  background: var(--surface-muted);
}

.primary:hover {
  background: #120d15;
}

.primary:disabled,
.small:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

body[data-completed="true"] .primary:disabled {
  background: var(--success);
  border-color: var(--success);
  opacity: 1;
}

.rank-row,
.match-row {
  display: grid;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 12px;
}

.rank-row {
  grid-template-columns: 38px minmax(0, 1fr) auto auto;
}

.rank-index {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--ink);
  font-weight: 800;
}

.match-row {
  grid-template-columns: minmax(0, 1fr) 28px minmax(180px, 1fr);
}

.match-row strong {
  font-weight: 700;
}

.connector {
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-top: 22px;
  padding: 18px 0 0;
  border-top: 1px solid var(--line-strong);
}

.footer strong {
  font-size: 17px;
}

.footer span {
  color: var(--muted);
}

.progress-track {
  width: min(260px, 42vw);
  height: 5px;
  margin-top: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 200ms ease;
}

.empty {
  width: min(620px, calc(100vw - 48px));
  margin: 16vh auto 0;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.empty h2 {
  margin: 0 0 12px;
  font-family: Georgia, "Times New Roman", ui-serif, serif;
  font-size: clamp(42px, 8vw, 72px);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 0.95;
}

.empty p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

@media (max-width: 760px) {
  .shell {
    width: min(100vw - 24px, 1000px);
    padding: 24px 0 42px;
  }

  .question-head,
  .match-row,
  .custom-row,
  .tradeoff-definitions,
  .tradeoff-readout,
  .tradeoff-quick-picks {
    grid-template-columns: 1fr;
  }

  .topbar {
    gap: 20px;
    padding: 34px 0 34px;
  }

  .topbar-meta {
    flex-wrap: wrap;
    gap: 10px;
  }

  h1 {
    max-width: 100%;
    font-size: clamp(28px, 9vw, 44px);
  }

  .description {
    font-size: 19px;
  }

  .question-head,
  .choices,
  .ranking,
  .matching,
  .scale-answer,
  .color-choices,
  .binary-tradeoff,
  .text-answer {
    padding-right: 18px;
    padding-left: 18px;
  }

  .question-type {
    justify-self: start;
  }

  .footer {
    align-items: stretch;
    gap: 14px;
  }

  .primary {
    min-width: 120px;
  }

  .tradeoff-axis-title {
    display: none;
  }

  .tradeoff-axis-end,
  .tradeoff-axis-end--right {
    grid-template-columns: auto;
  }

  .tradeoff-axis-end--right {
    justify-items: end;
  }
}

@media (max-width: 460px) {
  .rank-row {
    grid-template-columns: 36px minmax(0, 1fr) auto auto;
    gap: 8px;
  }

  .rank-index,
  .small {
    width: 34px;
    height: 34px;
  }

  .footer {
    gap: 12px;
  }

  .progress-track {
    width: 36vw;
  }
}
