:root {
  color-scheme: light;
  --ink: #17201f;
  --muted: #68706d;
  --paper: #f6f3e9;
  --surface: #fffdfa;
  --line: #dcd8cc;
  --forest: #183b3a;
  --forest-light: #285a57;
  --mint: #dfece5;
  --tangerine: #e8693a;
  --yellow: #f3c969;
  --danger: #a33d2d;
  --shadow: 0 18px 50px rgb(26 42 38 / 9%);
  --radius: 18px;
  font-family: Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 86% 9%, rgb(243 201 105 / 20%), transparent 23rem),
    var(--paper);
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button,
label,
input[type="checkbox"],
input[type="radio"] {
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100svh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100svh;
  padding: 28px 20px 24px;
  color: #f8f7ef;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 4%), transparent 30%),
    var(--forest);
  overflow-y: auto;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 0 7px 24px;
  border-bottom: 1px solid rgb(255 255 255 / 14%);
}

.brand-mark {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  fill: var(--yellow);
}

.brand-mark path:last-child {
  fill: none;
  stroke: var(--forest);
  stroke-width: 2.5;
  stroke-linecap: round;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 1.24rem;
  letter-spacing: -0.04em;
}

.brand span {
  margin-top: 3px;
  color: rgb(255 255 255 / 62%);
  font-size: 0.74rem;
}

.eyebrow,
.section-number {
  margin: 0 0 9px;
  color: var(--tangerine);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.session-status {
  padding: 25px 8px 18px;
}

.sidebar .eyebrow {
  color: var(--yellow);
}

.status-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.status-row strong {
  font-size: 1.3rem;
}

.status-row span {
  color: rgb(255 255 255 / 62%);
  font-size: 0.8rem;
}

.progress-track {
  height: 4px;
  margin-top: 13px;
  background: rgb(255 255 255 / 13%);
  border-radius: 99px;
  overflow: hidden;
}

.progress-track span {
  display: block;
  width: 25%;
  height: 100%;
  background: var(--yellow);
  border-radius: inherit;
  transition: width 180ms ease;
}

.step-nav {
  display: grid;
  gap: 4px;
}

.step-link {
  display: flex;
  gap: 11px;
  align-items: center;
  min-height: 48px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  color: rgb(255 255 255 / 62%);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.step-link > span {
  width: 20px;
  color: rgb(255 255 255 / 32%);
  font-size: 0.68rem;
  font-weight: 800;
}

.step-link:hover {
  background: rgb(255 255 255 / 6%);
}

.step-link.is-active {
  color: #fff;
  background: rgb(255 255 255 / 11%);
  box-shadow: inset 3px 0 var(--yellow);
}

.step-link.is-active > span {
  color: var(--yellow);
}

.step-link:disabled {
  cursor: not-allowed;
  opacity: 0.44;
}

.local-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: auto;
  padding: 22px 8px 0;
  color: rgb(255 255 255 / 58%);
  font-size: 0.74rem;
  line-height: 1.55;
}

.local-note svg {
  width: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--yellow);
  stroke-width: 1.7;
}

.local-note p {
  margin: 0;
}

.local-note strong {
  color: rgb(255 255 255 / 86%);
}

.workspace {
  min-width: 0;
  padding: 0 clamp(26px, 7vw, 104px) 44px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 66px;
  border-bottom: 1px solid var(--line);
}

.save-state {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 0.78rem;
}

.save-state > span {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  background: #a9b0ad;
  border-radius: 50%;
}

.save-state.is-saved > span {
  background: #4f8c72;
}

.save-state.is-error > span {
  background: var(--danger);
}

.text-button,
.toast button {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.text-button {
  min-height: 44px;
  padding: 0 4px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
}

#responseForm {
  width: min(760px, 100%);
  margin: 0 auto;
}

.step-panel {
  padding: clamp(46px, 7vh, 72px) 0 28px;
  animation: panel-in 200ms ease both;
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-intro {
  max-width: 650px;
  margin-bottom: 30px;
}

.section-intro h1,
.section-intro h2 {
  margin: 0;
  font-size: clamp(2.15rem, 4.5vw, 3.85rem);
  font-weight: 780;
  letter-spacing: -0.06em;
  line-height: 1.1;
  text-wrap: balance;
}

.section-intro h2 {
  font-size: clamp(2rem, 4vw, 3.35rem);
}

.section-intro > p:last-child {
  max-width: 580px;
  margin: 15px 0 0;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.7;
  word-break: keep-all;
}

.quick-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
}

.quick-facts li {
  display: grid;
  gap: 4px;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgb(255 253 250 / 68%);
}

.quick-facts strong {
  color: var(--forest);
  font-size: 0.9rem;
}

.quick-facts span {
  color: var(--muted);
  font-size: 0.76rem;
}

.notice-card,
.export-panel {
  display: flex;
  gap: 15px;
  padding: 18px 20px;
  border: 1px solid #e8cda8;
  border-radius: var(--radius);
  background: #fff3dd;
}

.notice-card {
  margin-bottom: 20px;
}

.notice-icon {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  color: #fff;
  background: var(--tangerine);
  border-radius: 50%;
  font-weight: 900;
}

.notice-card strong {
  display: block;
  margin: 2px 0 4px;
}

.notice-card p,
.export-panel p {
  margin: 0;
  color: #695a46;
  font-size: 0.84rem;
  line-height: 1.55;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.check-row {
  display: flex;
  gap: 13px;
  align-items: center;
  min-height: 62px;
  padding: 14px 17px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgb(255 253 250 / 68%);
  cursor: pointer;
}

.check-row:has(input:checked) {
  border-color: #81a99a;
  background: var(--mint);
}

.check-row input,
.choice-chip input,
.choice-card input {
  position: absolute;
  opacity: 0;
}

.custom-check {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  place-items: center;
  border: 1.5px solid #98a19c;
  border-radius: 7px;
  background: var(--surface);
}

.check-row input:checked + .custom-check {
  border-color: var(--forest);
  background: var(--forest);
}

.check-row input:checked + .custom-check::after {
  width: 8px;
  height: 4px;
  border-bottom: 2px solid #fff;
  border-left: 2px solid #fff;
  content: "";
  transform: rotate(-45deg) translateY(-1px);
}

.check-row > span:last-child {
  font-size: 0.88rem;
  line-height: 1.5;
}

.form-grid {
  display: grid;
  gap: 18px;
}

.two-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.field > span {
  color: #4c5552;
  font-size: 0.82rem;
  font-weight: 750;
}

.field em {
  margin-left: 4px;
  color: #929894;
  font-size: 0.7rem;
  font-style: normal;
  font-weight: 600;
}

.field input,
.field textarea {
  width: 100%;
  min-height: 50px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: rgb(255 253 250 / 78%);
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.field textarea {
  min-height: 92px;
  line-height: 1.6;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #9ba19e;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--forest-light);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgb(40 90 87 / 13%);
}

.field-group {
  margin-top: 28px;
}

.field-group.first-group,
.compact-fields .field-group {
  margin-top: 0;
}

.field-group > legend {
  width: 100%;
  margin-bottom: 12px;
  font-size: 0.86rem;
  font-weight: 800;
}

.field-group > legend span {
  margin-left: 7px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 500;
}

.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.choice-chip,
.choice-card {
  position: relative;
  cursor: pointer;
}

.choice-chip span {
  display: grid;
  min-height: 46px;
  padding: 0 17px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #57605d;
  background: rgb(255 253 250 / 72%);
  font-size: 0.84rem;
  font-weight: 700;
}

.choice-chip input:checked + span {
  border-color: var(--forest);
  color: #fff;
  background: var(--forest);
}

.compact {
  gap: 7px;
}

.compact .choice-chip span {
  min-height: 42px;
  padding: 0 14px;
  font-size: 0.78rem;
}

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

.choice-card span {
  display: grid;
  min-height: 76px;
  padding: 14px 16px;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgb(255 253 250 / 72%);
  font-size: 0.88rem;
  font-weight: 800;
}

.choice-card small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 500;
}

.choice-card input:checked + span {
  border-color: var(--forest-light);
  background: var(--mint);
  box-shadow: inset 0 0 0 1px var(--forest-light);
}

.choice-card input:checked + span small {
  color: #3e5d56;
}

.choice-chip input:focus-visible + span,
.choice-card input:focus-visible + span,
.check-row:has(input:focus-visible) {
  outline: 3px solid rgb(232 105 58 / 34%);
  outline-offset: 2px;
}

.compact-fields {
  margin-top: 28px;
  padding-top: 25px;
  border-top: 1px solid var(--line);
}

.featured-field {
  margin-top: 30px;
}

.featured-field textarea {
  border-color: #a9c0b6;
  background: #f3f8f4;
  font-size: 0.96rem;
}

.stacked-fields {
  display: grid;
  gap: 20px;
  margin-top: 28px;
}

.stacked-fields .featured-field {
  margin-top: 0;
}

.export-panel {
  align-items: center;
  justify-content: space-between;
  margin-top: 34px;
  border-color: #b8cec5;
  background: var(--mint);
}

.export-panel h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.export-panel .eyebrow {
  margin-bottom: 5px;
  color: var(--forest-light);
}

.export-panel p {
  color: #4e6760;
}

.export-panel .privacy-warning {
  margin-top: 10px;
  padding-left: 11px;
  border-left: 3px solid var(--danger);
  color: var(--danger);
  font-weight: 750;
}

.submission-message {
  margin-top: 10px;
  padding-left: 11px;
  border-left: 3px solid currentColor;
  font-weight: 750;
}

.submission-message.is-success {
  color: var(--forest-light);
}

.submission-message.is-error {
  color: var(--danger);
}

.honeypot {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.export-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 9px;
}

.form-footer {
  position: sticky;
  bottom: 16px;
  z-index: 4;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  margin-top: 16px;
  padding: 11px;
  border: 1px solid rgb(220 216 204 / 84%);
  border-radius: 16px;
  background: rgb(255 253 250 / 90%);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.form-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  text-align: center;
}

.primary-button,
.secondary-button {
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid var(--forest);
  border-radius: 11px;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
}

.primary-button {
  color: #fff;
  background: var(--forest);
}

.secondary-button {
  color: var(--forest);
  background: transparent;
}

.primary-button:hover:not(:disabled) {
  background: var(--forest-light);
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.34;
}

button:focus-visible {
  outline: 3px solid rgb(232 105 58 / 38%);
  outline-offset: 2px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  display: flex;
  gap: 16px;
  align-items: center;
  max-width: min(420px, calc(100vw - 32px));
  padding: 14px 17px;
  color: #fff;
  background: #152321;
  border-radius: 12px;
  box-shadow: var(--shadow);
  font-size: 0.82rem;
}

.toast button {
  min-height: 36px;
  padding: 0 5px;
  color: var(--yellow);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .sidebar {
    padding-inline: 14px;
  }

  .workspace {
    padding-inline: clamp(22px, 5vw, 48px);
  }

  .two-columns {
    grid-template-columns: 1fr;
  }

  .compact-fields {
    gap: 26px;
  }

  .export-panel {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 720px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: sticky;
    z-index: 8;
    height: auto;
    min-height: 0;
    padding: 12px 15px 10px;
    overflow: hidden;
  }

  .brand {
    padding: 0 1px 9px;
    border-bottom: 0;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
  }

  .brand span,
  .local-note {
    display: none;
  }

  .session-status {
    display: grid;
    grid-template-columns: auto auto 1fr;
    gap: 10px;
    align-items: center;
    padding: 4px 2px 7px;
  }

  .session-status .eyebrow {
    margin: 0;
  }

  .status-row {
    gap: 8px;
  }

  .status-row strong {
    font-size: 0.82rem;
  }

  .status-row span {
    display: none;
  }

  .progress-track {
    margin: 0;
  }

  .step-nav {
    display: flex;
    gap: 5px;
    padding: 2px 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .step-nav::-webkit-scrollbar {
    display: none;
  }

  .step-link {
    min-width: max-content;
    min-height: 40px;
    padding-inline: 10px;
    font-size: 0.76rem;
  }

  .step-link.is-active {
    box-shadow: inset 0 -2px var(--yellow);
  }

  .workspace {
    padding: 0 16px 30px;
  }

  .topbar {
    min-height: 54px;
  }

  .save-state {
    max-width: 215px;
    font-size: 0.7rem;
  }

  .step-panel {
    padding: 32px 0 22px;
  }

  .section-intro {
    margin-bottom: 24px;
  }

  .section-intro h1,
  .section-intro h2 {
    font-size: clamp(1.85rem, 9.5vw, 2.55rem);
  }

  .section-intro > p:last-child {
    font-size: 0.89rem;
  }

  .quick-facts {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .quick-facts li {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 12px 14px;
  }

  .notice-card {
    padding: 15px;
  }

  .notice-card strong {
    font-size: 0.86rem;
  }

  .notice-card p {
    font-size: 0.76rem;
  }

  .choice-grid {
    grid-template-columns: 1fr 1fr;
  }

  .choice-card span {
    min-height: 78px;
    padding: 12px;
    font-size: 0.81rem;
  }

  .choice-card small {
    font-size: 0.68rem;
  }

  .export-actions {
    width: 100%;
  }

  .export-actions button {
    flex: 1;
  }

  .form-footer {
    bottom: 8px;
    grid-template-columns: auto auto;
    gap: 8px;
    padding: 8px;
  }

  .form-footer p {
    display: none;
  }

  .form-footer button {
    min-width: 98px;
  }

  .form-footer #nextButton {
    margin-left: auto;
  }
}

@media (max-width: 420px) {
  .choice-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
