.survey-page { background: var(--bg); min-height: 100svh; isolation: isolate; }
.survey-preview {
  background: var(--fg);
  color: var(--surface);
  padding: 10px 20px;
  text-align: center;
  font-size: 11px;
  line-height: 1.6;
}
.survey-preview a {
  margin-left: 15px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.survey-header {
  padding: 20px 40px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}
.survey-progress-wrap {
  width: 100%;
  max-width: 880px;
  margin: auto;
  display: grid;
  gap: 11px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.progress-caption {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: var(--n-600);
}
.progress-caption > span:first-child {
  font-weight: 600;
}
.survey-progress {
  display: block;
  width: 100%;
  height: 12px;
  border: 0;
  background: var(--border);
  accent-color: var(--fg);
  border-radius: var(--r-none);
  overflow: hidden;
}
.survey-progress::-webkit-progress-bar {
  background: var(--border);
  border-radius: var(--r-none);
}
.survey-progress::-webkit-progress-value {
  background: var(--fg);
  border-radius: var(--r-none);
  transition: width 0.4s;
}
.survey-progress::-moz-progress-bar {
  background: var(--fg);
  border-radius: var(--r-none);
}
.survey-intro {
  max-width: 880px;
  margin: 0 auto;
  padding: 30px 0 28px;
  border-bottom: 1px solid var(--border);
}
.intro-logo {
  display: block;
  width: 48px;
  height: 48px;
  margin-bottom: 15px;
}
.survey-intro h1 {
  font-size: clamp(27px, 3vw, 36px);
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 1.12;
  margin: 0 0 19px;
  max-width: 720px;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.welcome-description {
  color: var(--fg-muted);
  font-size: 14px;
  max-width: 670px;
  line-height: 1.85;
}
.survey-flow {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 40px;
}
.flow-question {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 14px;
  padding: 27px 0;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: 110px;
}
.flow-question[hidden] {
  display: none;
}
.question-index {
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
  padding-top: 5px;
  font-variant-numeric: tabular-nums;
  position: relative;
}
.question-index:after {
  content: "";
  display: block;
  width: 24px;
  height: 1px;
  background: var(--n-300);
  margin-top: 17px;
  transition:
    width 0.3s,
    background-color 0.3s;
}
.answered .question-index:after {
  width: 42px;
  background: var(--fg);
}
.question-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--fg-muted);
  min-height: 16px;
  margin-bottom: 8px;
}
.question-state {
  color: var(--fg);
}
.question-content h2 {
  font-size: 22px;
  line-height: 1.22;
  font-weight: 600;
  letter-spacing: -0.045em;
  text-wrap: pretty;
  overflow-wrap: anywhere;
}
.question-content h2:focus {
  outline: none;
}
.question-description {
  font-size: 13px;
  line-height: 1.85;
  color: var(--fg-muted);
  margin-top: 14px;
  max-width: 640px;
}
.answer-area {
  margin-top: 16px;
}
.question-note {
  font-size: 11px;
  color: var(--fg-muted);
  margin-top: 15px;
  line-height: 1.6;
}
.answer-error {
  font-size: 12px;
  color: var(--fg);
  margin-top: 16px;
  font-weight: 600;
}
.answer-error:empty {
  display: none;
}
.has-error .question-index {
  color: var(--fg);
  font-weight: 700;
}
.has-error .question-content {
  border-left: 3px solid var(--fg);
  padding-left: 17px;
}
.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.choice {
  border: 1px solid var(--border);
  background: var(--surface);
  min-height: 62px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 16px;
  cursor: pointer;
  border-radius: var(--r-none);
  transition:
    background-color 0.2s,
    border-color 0.2s,
    transform 0.2s;
}
.choice:hover {
  background: var(--hover-bg);
  transform: translateY(-2px);
}
.choice:has(input:checked) {
  border-color: var(--fg);
  background: var(--selected-bg);
  box-shadow: inset 0 0 0 1px var(--fg);
}
.choice input {
  margin: 0;
}
.choice > span:first-of-type {
  flex: 1;
  font-size: 13px;
  line-height: 1.5;
}
.rating-field {
  max-width: 340px;
  margin-inline: auto;
}
.rating-field .rating-option {
  flex: 1;
  min-width: 0;
}
.rating-star {
  display: block;
  width: 32px;
  height: 32px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.35;
  stroke-linejoin: round;
}
.rating-option:has(input:checked) .rating-star svg,
.rating-option:has(~ .rating-option input:checked) .rating-star svg {
  fill: currentColor;
}
.rating-options,
.scale-options {
  display: flex;
  gap: 10px;
}
.rating-option,
.scale-option {
  position: relative;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--r-none);
  cursor: pointer;
  transition:
    background-color 0.2s,
    transform 0.2s;
}
.rating-option {
  height: 58px;
  width: 86px;
  font-size: 48px;
  font-family: var(--font-sans);
}
.scale-option {
  flex: 1;
  min-width: 0;
  height: 44px;
  font-size: 15px;
}
.rating-option input,
.scale-option input {
  position: absolute;
  opacity: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.rating-option:has(input:checked),
.rating-option:has(~ .rating-option input:checked),
.scale-option:has(input:checked) {
  background: var(--fg);
  color: var(--surface);
  border-color: var(--fg);
}
.rating-option:has(input:focus-visible),
.scale-option:has(input:focus-visible) {
  outline: 2px solid var(--fg);
  outline-offset: 4px;
}
.rating-option:hover,
.scale-option:hover {
  transform: translateY(-3px);
}
.range-labels {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-size: 11px;
  color: var(--fg-muted);
  margin-top: 14px;
}
.slider-output {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.03em;
  display: block;
  margin-bottom: 10px;
  min-height: 40px;
}
.slider-input {
  width: 100%;
  height: 32px;
  accent-color: var(--fg);
  margin: 0;
  cursor: pointer;
}
.answer-area > .help {
  margin-top: 14px;
  font-size: 11px;
}
.rank-instruction {
  display: flex;
  gap: 9px;
  align-items: center;
  font-size: 12px;
  margin-bottom: 14px;
  color: var(--n-600);
}
.rank-instruction .icon {
  width: 15px;
  height: 15px;
}
.ranking-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 9px;
}
.rank-item {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-none);
  background: var(--surface);
  min-height: 48px;
  padding: 2px 8px 2px 3px;
  position: relative;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  transition:
    box-shadow 0.18s,
    border-color 0.18s,
    background-color 0.18s;
}
.drag-handle {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  min-height: 44px;
  background: none;
  border: 0;
  border-radius: var(--r-none);
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.drag-handle svg {
  width: 16px;
  height: 20px;
  stroke: var(--fg-muted);
  stroke-width: 1.5;
  stroke-linecap: round;
  fill: none;
}
.drag-handle:hover {
  background: var(--hover-bg);
}
.rank-position {
  font-size: 11px;
  color: var(--fg-muted);
  font-variant-numeric: tabular-nums;
}
.rank-label {
  flex: 1;
  font-size: 13px;
  line-height: 1.4;
}
.rank-buttons {
  display: flex;
  gap: 3px;
}
.rank-buttons button {
  background: transparent;
  border: 0;
  border-radius: var(--r-none);
  min-width: 34px;
  height: 42px;
  font-size: 17px;
}
.rank-buttons button:hover {
  background: var(--hover-bg);
}
.rank-buttons button:disabled {
  cursor: default;
  opacity: 0.25;
}
.rank-item.dragging {
  position: fixed;
  z-index: 100;
  pointer-events: none;
  margin: 0;
  background: var(--fg);
  color: var(--surface);
  border-color: var(--fg);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  transition: none;
  cursor: grabbing;
}
.rank-item.dragging .rank-position,
.rank-item.dragging .drag-handle svg {
  color: var(--border);
  stroke: var(--border);
}
.rank-placeholder {
  list-style: none;
  border: 2px dashed var(--fg-subtle);
  border-radius: var(--r-none);
  background: var(--selected-bg);
}
.is-dragging,
.is-dragging .rank-item,
.is-dragging .drag-handle {
  cursor: grabbing;
}
.ranking-foot {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  margin-top: 16px;
  align-items: center;
}
.ranking-foot .help {
  font-size: 10px;
}
.ranking-foot button {
  background: transparent;
  border: 0;
  padding: 7px 0;
  white-space: nowrap;
  font-size: 11px;
}
.matrix-wrap {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  border: 1px solid var(--border);
  border-radius: var(--r-none);
  background: var(--surface);
}
.matrix {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}
.matrix th {
  font-weight: 500;
  text-align: center;
  padding: 16px 10px;
  line-height: 1.5;
}
.matrix thead {
  background: var(--hover-bg);
}
.matrix th:first-child {
  text-align: left;
  min-width: 120px;
  width: 31%;
}
.matrix td {
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 0;
  min-width: 76px;
}
.matrix tbody th {
  border-top: 1px solid var(--border);
}
.matrix td label {
  display: grid;
  place-items: center;
  min-height: 58px;
  cursor: pointer;
}
.matrix td:has(input:checked) {
  background: var(--hover-bg);
}
.matrix input {
  margin: 0;
}
.answer-area input[type="text"],
.answer-area input[type="number"],
.answer-area input[type="date"],
.answer-area textarea,
.answer-area select {
  background: var(--surface);
  padding: 11px 13px;
  border-color: var(--n-300);
  font-size: 16px;
  min-height: 44px;
  border-radius: var(--r-none);
}
.answer-area textarea {
  min-height: 94px;
  line-height: 1.7;
}
.survey-submit {
  padding: 12px 0 28px 42px;
}
.survey-submit .eyebrow {
  font-size: 9px;
  color: var(--fg-muted);
  letter-spacing: 0.14em;
}
.survey-submit h2 {
  font-size: 42px;
  letter-spacing: -0.055em;
  margin: 20px 0 15px;
}
.survey-submit > p:not(.question-note):not(.answer-error) {
  font-size: 13px;
  color: var(--fg-muted);
}
.survey-primary {
  background: var(--fg);
  color: var(--surface);
  border: 1px solid var(--fg);
  border-radius: var(--r-none);
  min-height: 52px;
  padding: 15px 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  font-size: 13px;
  transition:
    background-color 0.2s,
    transform 0.2s;
  margin-top: 26px;
}
.survey-primary:hover {
  background: var(--n-600);
  transform: translateY(-2px);
}
.survey-footer {
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin: 0 5%;
  padding: 27px 0;
  font-size: 10px;
  line-height: 1.75;
  color: var(--fg-muted);
}
.survey-footer > span:last-child {
  text-align: right;
  font-size: 8px;
  letter-spacing: 0.12em;
}
.honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.survey-finish {
  min-height: calc(100svh - 210px);
  display: grid;
  place-items: center;
  padding: 55px 25px;
}
.thank-you {
  text-align: center;
  max-width: 660px;
  margin: auto;
}
.thank-you > .eyebrow {
  display: block;
  font-size: 10px;
  letter-spacing: 0.15em;
}
.thank-you h1 {
  font-size: clamp(42px, 5vw, 65px);
  margin: 20px 0;
}
.thank-you p {
  font-size: 14px;
  color: var(--fg-muted);
  max-width: 500px;
  margin: 0 auto 24px;
}
.thank-you small {
  font-size: 9px;
  letter-spacing: 0.13em;
  display: block;
  color: var(--fg-muted);
}
.thank-you .btn {
  margin-top: 27px;
}
@media (max-width: 1000px) {
  .survey-intro {
    margin: 0 40px;
  }
  .survey-flow {
    max-width: none;
  }
}
@media (max-width: 650px) {
  .survey-preview {
    font-size: 9px;
    padding: 8px 12px;
  }
  .survey-preview a {
    margin-left: 8px;
  }
  .survey-header {
    padding: 16px 24px;
  }
  .survey-progress-wrap {
    font-size: 11px;
    gap: 10px;
  }
  .survey-progress {
    height: 11px;
  }
  .survey-intro {
    margin: 0 24px;
    padding: 34px 0 32px;
  }
  .intro-logo {
    width: 40px;
    height: 40px;
    margin-bottom: 20px;
  }
  .survey-intro h1 {
    font-size: 29px;
    margin-bottom: 16px;
  }
  .welcome-description {
    font-size: 13px;
    line-height: 1.8;
  }
  .survey-flow {
    padding: 0 24px;
  }
  .flow-question {
    display: block;
    position: relative;
    text-align: left;
    padding: 22px 0;
    scroll-margin-top: 88px;
  }
  .question-index {
    position: absolute;
    top: 22px;
    left: 0;
    font-size: 9px;
    padding: 0;
  }
  .question-index:after {
    display: none;
  }
  .question-index:after {
    width: 15px;
  }
  .answered .question-index:after {
    width: 23px;
  }
  .question-topline {
    padding-left: 26px;
    font-size: 8px;
    letter-spacing: 0.08em;
    margin-bottom: 11px;
  }
  .question-content h2 {
    font-size: 20px;
  }
  .question-description {
    font-size: 12px;
    margin-top: 12px;
  }
  .answer-area {
    margin-top: 13px;
  }
  .choice-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .choice {
    min-height: 58px;
    padding: 13px;
  }
  .choice > span:first-of-type {
    font-size: 12px;
  }
  .rating-star {
    width: 29px;
    height: 29px;
  }
  .rating-options {
    gap: 7px;
  }
  .rating-option {
    flex: 1;
    width: auto;
    height: 48px;
    font-size: 33px;
  }
  .scale-options {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
  }
  .scale-option {
    height: 44px;
    font-size: 14px;
  }
  .range-labels {
    font-size: 10px;
  }
  .slider-output {
    font-size: 32px;
  }
  .rank-item {
    gap: 8px;
    padding: 2px 5px 2px 0;
    min-height: 48px;
  }
  .drag-handle {
    width: 29px;
  }
  .rank-position {
    font-size: 9px;
  }
  .rank-label {
    font-size: 11px;
  }
  .rank-buttons {
    gap: 0;
  }
  .rank-buttons button {
    min-width: 26px;
    font-size: 15px;
  }
  .rank-instruction {
    font-size: 11px;
    align-items: flex-start;
  }
  .rank-instruction .icon {
    flex: none;
    margin-top: 2px;
  }
  .ranking-foot {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }
  .matrix {
    font-size: 10px;
  }
  .matrix th {
    padding: 12px 9px;
  }
  .matrix td {
    min-width: 64px;
  }
  .matrix th:first-child {
    min-width: 100px;
  }
  .answer-area input[type="text"],
  .answer-area input[type="date"],
  .answer-area input[type="number"],
  .answer-area textarea,
  .answer-area select {
    font-size: 16px;
    padding: 14px;
    min-height: 53px;
  }
  .survey-submit {
    padding: 6px 0 25px;
  }
  .survey-submit h2 {
    font-size: 35px;
  }
  .survey-submit .eyebrow {
    font-size: 8px;
  }
  .survey-submit > p:not(.question-note):not(.answer-error) {
    font-size: 12px;
  }
  .survey-primary {
    width: 100%;
    font-size: 12px;
    gap: 12px;
  }
  .survey-footer {
    margin: 0 24px;
    font-size: 9px;
    gap: 16px;
  }
  .survey-footer > span:last-child {
    font-size: 7px;
  }
  .question-note {
    font-size: 10px;
  }
  .has-error .question-content {
    padding-left: 10px;
  }
  .survey-finish {
    padding: 35px 24px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .survey-page *,
  .survey-page *:before {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

.survey-page .answer-area input[type="date"] {
  width: 260px;
  max-width: 100%;
  cursor: pointer;
}

.plain-choices {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.plain-choices .choice {
  border: 0;
  border-radius: var(--r-none);
  box-shadow: none;
  background: transparent;
  padding: 7px 0;
  min-height: 36px;
  gap: 11px;
}
.plain-choices .choice:hover,
.plain-choices .choice:has(input:checked) {
  transform: none;
  background: transparent;
  box-shadow: none;
  border: 0;
}
.plain-choices .choice:has(input:checked) > span {
  font-weight: 600;
}
.binary-choices {
  max-width: 320px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.binary-choices .choice {
  min-height: 44px;
  padding: 10px 13px;
}
.survey-page .answer-area input[type="number"] {
  width: 180px;
  max-width: 100%;
}
.ranking-foot {
  justify-content: flex-end;
  margin-top: 5px;
}
.finish-logo {
  display: block;
  margin: 0 auto 25px;
}
@media (max-width: 650px) {
  .survey-intro,
  .question-content,
  .question-content h2,
  .question-description,
  .choice,
  .rank-label {
    text-align: left;
  }
  .survey-flow {
    padding: 0 20px;
  }
  .survey-intro {
    margin: 0 20px;
    padding: 24px 0;
  }
  .ranking-foot {
    align-items: flex-end;
  }
  .survey-header {
    padding: 12px 20px;
  }
  .survey-progress {
    height: 10px;
  }
}

.date-control {
  position: relative;
  width: 260px;
  max-width: 100%;
}
.survey-page .date-control input[type="date"] {
  position: relative;
  width: 100%;
  padding-right: 42px;
}
.date-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  pointer-events: none;
}
.date-control input[type="date"]::-webkit-calendar-picker-indicator {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
}

.question-index:after {
  display: none;
}

/* Separate layers let scroll movement and idle movement compose without
   moving the question column or intercepting a single pointer event. */
.survey-ambience {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: clip;
  pointer-events: none;
  contain: strict;
}
.ambient-layer { position: absolute; width: 340px; aspect-ratio: 1; }
.ambient-left { left: calc(50% - 790px); top: 16%; --travel-x: 70px; --travel-y: 300px; --travel-angle: 70deg; }
.ambient-right { right: calc(50% - 800px); top: 52%; width: 390px; --travel-x: -55px; --travel-y: -360px; --travel-angle: -80deg; }
.ambient-small { right: calc(50% - 620px); top: 14%; width: 100px; --travel-x: 45px; --travel-y: 260px; --travel-angle: 120deg; }
.ambient-orbit { position: absolute; inset: 0; animation: orbit-float 9s ease-in-out infinite alternate; }
.orbit-outline { position: absolute; inset: 0; border: 1px solid var(--n-300); border-radius: var(--r-pill); opacity: .65; }
.orbit-offset { inset: 12% -8% 12% 8%; opacity: .4; }
.orbit-traveller { position: absolute; inset: 0; animation: orbit-travel 18s linear infinite; }
.orbit-traveller > span { position: absolute; top: 50%; left: -3px; width: 7px; height: 7px; background: var(--fg-muted); border-radius: var(--r-pill); opacity: .7; }
.ambient-right .ambient-orbit { animation-delay: -4s; animation-duration: 12s; }
.ambient-right .orbit-traveller { animation-direction: reverse; animation-duration: 23s; }
.ambient-small .ambient-orbit { animation-delay: -7s; }
.ambient-small .orbit-traveller { animation-duration: 12s; }
.survey-intro, .survey-flow { position: relative; background: var(--bg); }
.intro-logo { animation: seal-turn 28s linear infinite; }
@keyframes orbit-float { from { transform: translate(-8px, -20px); } to { transform: translate(8px, 20px); } }
@keyframes orbit-travel { to { transform: rotate(360deg); } }
@keyframes seal-turn { to { transform: rotate(360deg); } }
/* Decorative enhancement: browsers without scroll timelines retain idle motion. */
@supports (animation-timeline: scroll()) and (animation-range: entry) {
  @media (prefers-reduced-motion: no-preference) {
    .ambient-layer {
      animation: orbit-scroll linear both;
      animation-timeline: scroll(root block);
      animation-range: 0% 100%;
    }
  }
}
@keyframes orbit-scroll { from { transform: translate(0, 0) rotate(0deg); } to { transform: translate(var(--travel-x), var(--travel-y)) rotate(var(--travel-angle)); } }
.motion-paused .survey-ambience *, .motion-paused .intro-logo,
.motion-idle .survey-ambience *, .motion-idle .intro-logo { animation-play-state: paused; }
.progress-tools { display: flex; align-items: center; gap: var(--s-4); }
.motion-toggle { border: 0; background: transparent; color: var(--fg-muted); font-size: 10px; padding: 2px 0; text-decoration: underline; text-underline-offset: 3px; }
.survey-intro h1, .question-content h2 { font-weight: 600; letter-spacing: -.03em; }
.question-content { min-width: 0; }
.question-state { display: inline-flex; align-items: center; gap: 4px; text-transform: uppercase; }
.question-state .icon { width: 12px; height: 12px; }
.choice { font-weight: 400; }
.choice:hover { transform: none; }
.plain-choices .choice { min-height: 36px; }
.rank-buttons button { display: inline-grid; place-items: center; }
.rank-buttons .icon { width: 16px; height: 16px; }
.survey-page .answer-area input:not([type=radio]):not([type=checkbox]):not([type=range]),
.survey-page .answer-area textarea, .survey-page .answer-area select { border-color: var(--border); padding: 10px 12px; min-height: 44px; }
.survey-page .date-control input[type=date] { padding-right: 42px; }
.answer-error { color: var(--signal-red); }
@media (max-width: 650px) {
  .ambient-left { left: -180px; top: 20%; width: 210px; --travel-x: -15px; --travel-y: 260px; }
  .ambient-right { right: -175px; top: 58%; width: 205px; --travel-x: 15px; --travel-y: -260px; }
  .ambient-small { display: none; }
  .orbit-outline { opacity: .4; }
  .orbit-offset { opacity: .25; }
  .survey-intro, .survey-flow { background: transparent; }
  .progress-caption { font-size: 10px; gap: 8px; }
  .progress-tools { gap: 10px; }
  .motion-toggle { font-size: 9px; }
  .thank-you { text-align: left; }
  .finish-logo { margin-left: 0; }
  .survey-footer > span:last-child { text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  .survey-page::before, .survey-page::after, .survey-page *, .survey-page *::before, .survey-page *::after { animation: none !important; transition: none !important; }
  .motion-toggle { display: none; }
}

.choice span, .rank-label { overflow-wrap: anywhere; min-width: 0; }

/* Keep the hit area fixed while its contents move. Hover never changes answers. */
.choice { position: relative; isolation: isolate; }
.choice::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--selected-bg);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-base) var(--ease-out);
}
.choice > input, .choice > span,
.rating-option > span, .scale-option > span,
.slider-output, .slider-input,
.rank-label, .drag-handle .icon,
.matrix input, .entry-field > input, .entry-field > textarea, .date-icon {
  transition: translate var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
}
.choice > input, .choice > span { translate: var(--option-shift, 0px) 0; }
.choice:has(input:focus-visible) { --option-shift: 8px; }
.choice:has(input:focus-visible)::before { transform: scaleX(1); }
.rating-option:hover, .scale-option:hover { transform: none; }
.rating-option > span, .scale-option > span { translate: 0 var(--option-rise, 0px); }
.rating-option:has(input:focus-visible), .scale-option:has(input:focus-visible) { --option-rise: -6px; }
.rating-option, .scale-option { transition: border-color var(--dur-base), background-color var(--dur-base); }
.scale-option::after {
  content: "";
  position: absolute;
  bottom: 6px;
  width: 14px;
  height: 2px;
  background: currentColor;
  opacity: 0;
  translate: -6px 0;
  transition: opacity var(--dur-base), translate var(--dur-base) var(--ease-out);
  pointer-events: none;
}
.scale-option:has(input:focus-visible)::after { opacity: 1; translate: 0; }
.slider-field:has(input:focus-visible) .slider-output { translate: 8px -3px; }
.slider-field:has(input:focus-visible) .slider-input { translate: 0 -3px; }
.rank-item:focus-within .rank-label { translate: 6px 0; }
.matrix td:has(input:focus-visible) input { translate: 0 -4px; }
.entry-field { position: relative; }
.entry-field > input, .entry-field > textarea, .entry-field > select { display: block; }
.number-field { width: 180px; max-width: 100%; }
.entry-field::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--fg);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-base) var(--ease-out);
  pointer-events: none;
}
.entry-field:focus-within::after { transform: scaleX(1); }
.entry-field:focus-within > :is(input, textarea, select) { border-color: var(--fg) !important; }
.entry-field:not(.date-control):focus-within > :is(input, textarea) { translate: 0 -3px; }
.date-control:focus-within .date-icon { translate: -5px 0; }
.select-field select::picker-icon { transition: translate var(--dur-base) var(--ease-out); }
.select-field:focus-within select::picker-icon { translate: 0 3px; }

@media (hover: hover) and (pointer: fine) {
  .choice:hover { --option-shift: 8px; }
  .choice:hover::before { transform: scaleX(1); }
  .rating-option:hover, .scale-option:hover { --option-rise: -6px; border-color: var(--fg); }
  .rating-option:has(~ .rating-option:hover) { --option-rise: -3px; }
  .scale-option:hover::after { opacity: 1; translate: 0; }
  .slider-field:hover .slider-output { translate: 8px -3px; }
  .slider-field:hover .slider-input { translate: 0 -3px; }
  .rank-item:not(.dragging):hover { border-color: var(--fg); background: var(--selected-bg); }
  .rank-item:not(.dragging):hover .rank-label { translate: 6px 0; }
  .rank-item:not(.dragging):hover .drag-handle .icon { translate: 0 -3px; }
  .matrix td:hover { background: var(--selected-bg); }
  .matrix td:hover input { translate: 0 -4px; }
  .entry-field:hover::after { transform: scaleX(1); }
  .entry-field:hover > :is(input, textarea, select) { border-color: var(--fg) !important; }
  .entry-field:not(.date-control):hover > :is(input, textarea) { translate: 0 -3px; }
  .date-control:hover .date-icon { translate: -5px 0; }
  .select-field:hover select::picker-icon { translate: 0 3px; }
}

@media (prefers-reduced-motion: reduce) {
  .survey-ambience { display: none; }
  .answer-area *, .answer-area *::before, .answer-area *::after { translate: none !important; }
}
