body.survey {
  min-height: 100dvh;
  background: var(--paper);
}

.sv-shell {
  display: grid;
  min-height: 100dvh;
  grid-template-columns: 220px minmax(0, 1fr);
}

.sv-sidebar {
  padding: 30px 28px;
  border-right: 1px solid var(--line);
}

.sv-brand {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 23px;
  letter-spacing: -.01em;
  text-decoration: none;
}

.sv-page {
  display: grid;
  min-width: 0;
  min-height: 100dvh;
  grid-template-rows: auto 1fr auto;
}

.sv-top {
  display: flex;
  min-height: 84px;
  padding: 26px 44px;
  align-items: center;
  gap: 24px;
}

.sv-progress {
  display: flex;
  margin-left: auto;
  align-items: center;
  gap: 14px;
}

.sv-progress-label,
.sv-count {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.sv-rail {
  position: relative;
  width: 112px;
  height: 2px;
  overflow: hidden;
  background: var(--line);
}

.sv-rail-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: var(--accent);
  transition: width 300ms cubic-bezier(.4, 0, .2, 1);
}

.sv-leave {
  color: var(--ink-2);
  font-size: 14.5px;
  text-decoration: none;
}

.sv-leave:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.sv-main {
  display: grid;
  min-width: 0;
  align-items: start;
}

.sv-sheet {
  width: min(680px, calc(100% - 88px));
  margin: 0 auto;
  padding: 48px 0 90px;
}

.sv-sheet--intent {
  width: min(900px, calc(100% - 88px));
  padding-top: 76px;
}

.sv-flow,
.sv-panel {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
}

.js .sv-panel:not(.is-current) {
  display: none;
}

.sv-panel.is-leaving {
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 150ms ease, transform 150ms ease;
}

.sv-eyebrow {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.sv-ask {
  max-width: 27ch;
  min-height: 1.2em;
  font-size: clamp(25px, 2.7vw, 32px);
  letter-spacing: -.012em;
  line-height: 1.22;
}

/* Script-focused headings announce panel changes but are not keyboard controls. */
.sv-ask[tabindex="-1"]:focus {
  outline: none;
}

.sv-flow > .sv-eyebrow + .sv-ask {
  margin-top: 12px;
}

.sv-ask.is-typing::after {
  display: inline-block;
  width: 2px;
  height: .86em;
  margin-left: 2px;
  animation: survey-caret 900ms steps(1, end) infinite;
  background: var(--accent);
  content: "";
  vertical-align: -.06em;
}

@keyframes survey-caret {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* Answers wait for the question to finish, then arrive 38ms apart. The
   hidden start state is gated twice, so nothing can be left invisible
   where the script or the animation does not run. */
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] {
    opacity: 0;
  }

  .js [data-reveal].rise {
    animation: survey-rise 420ms cubic-bezier(.4, 0, .2, 1) forwards;
    animation-delay: calc(var(--n, 0) * 38ms);
  }
}

@keyframes survey-rise {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: none; }
}

.sv-lead {
  width: 100%;
  margin-top: 14px;
  color: var(--ink-2);
  font-size: 15.5px;
}

.sv-help {
  width: 100%;
  margin-top: 10px;
  color: var(--ink-3);
  font-size: 13.5px;
  line-height: 1.5;
}

.sv-answer {
  width: 100%;
  margin-top: 28px;
}

.sv-options {
  display: grid;
  gap: 0;
}

.sv-choices {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.sv-choice-form {
  display: flex;
  margin: 0;
}

.sv-choice {
  display: flex;
  width: 100%;
  min-height: 214px;
  flex-direction: column;
  align-items: flex-start;
  padding: 25px 22px 26px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  text-align: left;
  text-decoration: none;
  transition: background-color 150ms ease, border-color 150ms ease;
}

.sv-choice--lead {
  padding-top: 24px;
  border-top: 2px solid var(--accent);
}

.sv-choice:hover:not(:disabled) {
  border-color: var(--line-2);
  background: var(--paper-2);
}

.sv-choice:hover:not(:disabled) .sv-choice-title {
  color: var(--accent);
}

.sv-choice:disabled {
  color: var(--ink-3);
  cursor: default;
}

/* Line-art marks: report trace, linked people, a path with waypoints. */
.sv-choice-icon {
  width: 30px;
  height: 30px;
  margin-bottom: 26px;
  color: var(--accent);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.25;
}

.sv-choice:disabled .sv-choice-icon {
  color: var(--line-2);
}

.sv-choice-copy {
  display: grid;
  gap: 6px;
}

.sv-choice-title {
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 1.3;
  transition: color 150ms ease;
}

.sv-choice-detail {
  color: var(--ink-3);
  font-size: 13.5px;
  line-height: 1.45;
}

.sv-stages {
  display: flex;
  margin-top: 74px;
  flex-direction: column;
}

.sv-stage {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 9px 0;
  color: var(--ink-3);
  font-size: 14px;
}

.sv-stage::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 6px;
  width: 1px;
  background: var(--line);
  content: "";
}

.sv-stage:first-child::before { top: 50%; }
.sv-stage:last-child::before { bottom: 50%; }

.sv-dot {
  position: relative;
  z-index: 1;
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  background: var(--paper);
}

.sv-stage.is-done {
  color: var(--ink-2);
}

.sv-stage.is-done .sv-dot {
  border-color: var(--accent);
  background: var(--accent);
}

.sv-stage.is-current {
  color: var(--ink);
}

.sv-stage.is-current .sv-dot {
  border: 3.5px solid var(--accent);
}

.sv-trail {
  display: flex;
  min-height: 31px;
  margin-bottom: 22px;
  flex-wrap: wrap;
  gap: 7px;
}

.sv-trail:empty {
  margin-bottom: 0;
}

.sv-chip {
  padding: 4px 12px 5px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--ink-2);
  cursor: pointer;
  font: inherit;
  font-size: 13.5px;
  line-height: 1.5;
}

.sv-chip:hover {
  border-color: var(--line-2);
  color: var(--ink);
}

.sv-chip--more {
  border-color: transparent;
  background: transparent;
  color: var(--ink-3);
  cursor: default;
}

.sv-chip--more:hover {
  border-color: transparent;
  color: var(--ink-3);
}

.sv-q {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.sv-q legend {
  padding: 0;
}

.sv-opt {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 13px 14px 14px;
  border-top: 1px solid var(--line);
  cursor: pointer;
  transition: background-color 150ms ease;
}

.sv-opt:hover {
  background: var(--paper-2);
}

.sv-opt:has(input:focus-visible) {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.sv-opt:has(input:checked) {
  background: color-mix(in srgb, var(--accent-3) 58%, var(--paper));
  box-shadow: inset 2px 0 0 var(--accent);
}

.sv-opt.is-disabled {
  color: var(--ink-3);
  cursor: default;
}

.sv-opt.is-disabled:hover {
  background: transparent;
}

.sv-opt input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.sv-mark {
  position: relative;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  margin-top: 5px;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  background: var(--paper);
}

.sv-mark--box {
  border-radius: 3px;
}

.sv-opt:has(input:checked) .sv-mark:not(.sv-mark--box) {
  border: 5px solid var(--accent);
}

.sv-opt:has(input:checked) .sv-mark--box {
  border-color: var(--accent);
  background: var(--accent);
}

.sv-opt:has(input:checked) .sv-mark--box::after {
  position: absolute;
  top: 1.5px;
  left: 3.5px;
  width: 6px;
  height: 9.5px;
  transform: rotate(38deg);
  border: 1.7px solid var(--on-accent);
  border-top: 0;
  border-left: 0;
  content: "";
}

.sv-opt > span:last-child {
  font-size: 16px;
  line-height: 1.45;
}

.sv-textarea {
  width: 100%;
  margin-top: 30px;
  padding: 12px 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  resize: vertical;
}

.sv-textarea:focus-visible {
  border-color: var(--accent);
  outline-offset: 1px;
}

.sv-no-report {
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.sv-no-report h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: 22px;
}

.sv-no-report p {
  max-width: 58ch;
  margin: 9px 0 0;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.55;
}

.sv-help {
  margin-top: 22px;
}

.sv-help [hidden] {
  display: none;
}

.sv-help-label {
  display: block;
  margin-bottom: 8px;
  color: var(--ink-2);
  font-size: 13.5px;
}

.sv-help-email,
.sv-select {
  width: 100%;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
}

.sv-help-email:focus-visible,
.sv-select:focus-visible {
  border-color: var(--accent);
  outline-offset: 1px;
}

.sv-opt--plain {
  margin-top: 16px;
  border-top: 0;
  padding: 0;
}

.sv-help-actions {
  margin-top: 16px;
}

.sv-other-input {
  width: 100%;
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
}

.sv-other-input:focus-visible {
  border-color: var(--accent);
  outline-offset: 1px;
}

.sv-note {
  width: 100%;
  margin-top: 26px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 13.5px;
  line-height: 1.55;
}

.sv-note strong {
  color: var(--ink-2);
  font-weight: 600;
}

.sv-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.sv-field-grid--single {
  grid-template-columns: minmax(0, 1fr);
}

/* The caret needs the extra right padding; the rest is the shared skin. */
.sv-select {
  padding-right: 38px;
}

.sv-field .sv-textarea {
  margin-top: 0;
}

.sv-existing {
  grid-column: 1 / -1;
  padding: 16px;
  border-left: 2px solid var(--accent);
  background: var(--paper-2);
}

.sv-existing p {
  color: var(--ink-2);
  font-size: 14px;
}

.sv-actions {
  display: flex;
  width: 100%;
  margin-top: 32px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.sv-back {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  font: inherit;
  font-size: 14.5px;
  text-decoration: none;
}

.sv-back:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.sv-btn {
  display: inline-block;
  padding: 11px 19px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--on-accent);
  cursor: pointer;
  font: 15px/1.4 var(--font-body);
  text-decoration: none;
}

.sv-btn:hover {
  border-color: var(--accent-2);
  background: var(--accent-2);
}

.sv-btn--ghost {
  background: transparent;
  color: var(--accent);
}

.sv-btn--ghost:hover {
  border-color: var(--accent);
  background: var(--accent-3);
  color: var(--accent);
}

.sv-panel-next,
.sv-panel-back {
  display: none;
}

.js .sv-panel-next,
.js .sv-panel-back {
  display: inline-block;
}

.js .sv-panel-next[hidden] {
  display: none;
}

.sv-errors {
  margin-bottom: 28px;
  padding: 13px 16px;
  border-left: 3px solid var(--alert);
  background: color-mix(in srgb, var(--alert) 7%, var(--paper));
}

.sv-errors h2 {
  color: var(--alert);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
}

.sv-errors ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.sv-errors a {
  color: var(--alert);
  text-underline-offset: 3px;
}

.sv-saved {
  margin-bottom: 28px;
  padding: 13px 16px;
  border-left: 3px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 7%, var(--paper));
  color: var(--ink);
}

.sv-status {
  display: flex;
  min-height: 320px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 18px;
}

.sv-status h1 {
  max-width: 24ch;
  font-size: clamp(27px, 4vw, 32px);
}

.sv-status p {
  max-width: 44ch;
  color: var(--ink-2);
}

.sv-status-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.sv-foot {
  width: min(680px, calc(100% - 88px));
  margin-inline: auto;
  padding: 0 0 28px;
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
}

.sv-foot:empty {
  padding: 0;
}

@media (max-width: 760px) {
  .sv-shell {
    grid-template-columns: 1fr;
  }

  .sv-sidebar {
    display: flex;
    padding: 22px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    align-items: center;
    gap: 28px;
  }

  .sv-stages {
    margin: 0 0 0 auto;
    flex-direction: row;
    gap: 16px;
  }

  .sv-stage {
    padding: 0;
    font-size: 12.5px;
  }

  .sv-stage::before {
    display: none;
  }

  .sv-top {
    min-height: 66px;
    padding: 18px 22px;
  }

  .sv-progress-label,
  .sv-rail {
    display: none;
  }

  .sv-sheet,
  .sv-sheet--intent {
    width: 100%;
    padding: 38px 22px 68px;
  }

  .sv-foot {
    width: 100%;
    padding: 18px 22px 24px;
  }

  .sv-choices {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .sv-choice {
    min-height: 0;
    padding: 20px;
  }

  .sv-choice-icon {
    margin-bottom: 16px;
  }

  .sv-field-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 520px) {
  .sv-stage:not(.is-current) {
    display: none;
  }

  .sv-status-actions {
    align-items: flex-start;
    flex-direction: column-reverse;
  }

  .sv-status-actions--switch {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sv-panel,
  .sv-rail-fill,
  .sv-choice,
  .sv-choice-title {
    transition: none;
  }

  .sv-ask.is-typing::after {
    display: none;
  }
}
