:root {
  color-scheme: light;
  --canvas: #f5f3ee;
  --surface: #fffefa;
  --ink: #1c2723;
  --muted: #737873;
  --line: #dedfd8;
  --accent: #466854;
  --accent-soft: #e6eee8;
  --shadow: 0 18px 55px rgba(42, 53, 46, 0.09);
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--canvas); }

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: "Noto Sans SC", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.app-shell {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

.screen {
  display: none;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 30px 22px max(24px, env(safe-area-inset-bottom));
  opacity: 0;
}

.screen.is-active {
  display: flex;
  animation: screen-in 500ms cubic-bezier(.22, .8, .24, 1) forwards;
}

.screen.is-leaving {
  display: flex;
  position: fixed;
  inset: 0;
  animation: screen-out 280ms ease forwards;
}

.screen.is-leaving-back { animation-name: screen-out-back; }
.screen.is-entering-back.is-active { animation-name: screen-in-back; }

.welcome-screen {
  flex-direction: column;
  justify-content: space-between;
  max-width: 560px;
  margin: 0 auto;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--accent);
  font: 600 13px/1 "DM Sans", sans-serif;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.brand-dot { width: 11px; height: 11px; border: 3px solid var(--accent); border-radius: 50%; }
.welcome-copy { margin: auto 0; padding: 56px 0 48px; }

.eyebrow, .question-number {
  margin: 0 0 20px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .18em;
}

h1 { margin: 0; font-size: clamp(38px, 11vw, 56px); line-height: 1.18; letter-spacing: -.045em; }

.description {
  max-width: 430px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.9;
}

.welcome-footer { display: grid; gap: 18px; }
.time-hint { margin: 0; color: var(--muted); font-size: 12px; text-align: center; }

.primary-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 60px;
  padding: 0 22px;
  border: 0;
  border-radius: 18px;
  background: var(--ink);
  color: white;
  cursor: pointer;
  font-weight: 600;
  transition: transform 180ms ease, background 180ms ease, opacity 180ms ease;
}

.primary-button:not(:disabled):active { transform: scale(.985); }
.primary-button:not(:disabled):hover { background: var(--accent); }
.primary-button:disabled { cursor: not-allowed; opacity: .32; }
.button-arrow { font-size: 22px; font-weight: 400; }

.question-screen {
  position: relative;
  flex-direction: column;
  max-width: 680px;
  margin: 0 auto;
  background:
    radial-gradient(circle at 94% 34%, rgba(246, 200, 78, .12) 0 42px, transparent 43px),
    var(--surface);
}

.question-screen.is-active {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

.progress-header { width: 100%; }
.progress-meta { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; color: var(--ink); font-size: 11px; font-weight: 600; }
.survey-title { display: flex; align-items: center; gap: 8px; }
.mini-mark { width: 12px; height: 12px; border: 3px solid var(--accent); border-radius: 50% 50% 50% 2px; transform: rotate(-12deg); }
.progress-count { display: flex; align-items: baseline; gap: 4px; padding: 7px 10px; border-radius: 999px; background: #f1f1e9; color: var(--muted); font-family: "DM Sans", sans-serif; }
.progress-meta strong { color: var(--ink); font-size: 14px; }
.progress-track { height: 5px; overflow: hidden; border-radius: 99px; background: #e9e8df; }
.progress-fill { height: 100%; border-radius: inherit; background: #efb942; animation: progress-in 800ms 200ms cubic-bezier(.22,.8,.24,1) both; }
.progress-01 { width: calc(100% / 6); }
.progress-02 { width: calc(200% / 6); }
.progress-03 { width: calc(300% / 6); }
.progress-04 { width: calc(400% / 6); }
.progress-05 { width: calc(500% / 6); }
.progress-06 { width: 100%; }

.question-content { display: flex; flex: 1; flex-direction: column; padding: clamp(38px, 8vh, 68px) 0 20px; }
.question-heading { display: flex; align-items: flex-start; justify-content: space-between; min-height: 122px; gap: 14px; }
.question-number { margin-bottom: 12px; color: #b07c16; font-family: "DM Sans", sans-serif; }
h2 { max-width: 390px; margin: 0; font-size: clamp(27px, 7.5vw, 38px); line-height: 1.3; letter-spacing: -.035em; }
.question-type { display: inline-block; color: var(--muted); font-size: 13px; font-weight: 400; letter-spacing: 0; vertical-align: middle; }
.question-doodle { position: relative; flex: 0 0 82px; width: 82px; height: 86px; margin-top: 8px; transform: rotate(3deg); }
.doodle-face { position: absolute; inset: 10px 8px auto auto; width: 54px; height: 54px; border-radius: 50%; background: #f5c84c; box-shadow: 3px 4px 0 rgba(28,39,35,.08); }
.doodle-face i { position: absolute; top: 18px; width: 5px; height: 9px; border-radius: 50%; background: var(--ink); }
.doodle-face i:first-child { left: 15px; }
.doodle-face i:last-child { right: 15px; }
.doodle-face::after { content: ""; position: absolute; left: 18px; bottom: 10px; width: 18px; height: 8px; border-bottom: 2px solid var(--ink); border-radius: 50%; }
.doodle-dot { position: absolute; right: 0; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: #7eb777; box-shadow: 0 0 0 4px var(--surface); }
.doodle-stem { position: absolute; right: 10px; bottom: 5px; width: 31px; height: 26px; border-bottom: 3px solid var(--accent); border-right: 3px solid var(--accent); border-radius: 0 0 23px; transform: rotate(-9deg); }
.doodle-stem::after { content: ""; position: absolute; right: -5px; bottom: 20px; width: 13px; height: 7px; border-radius: 50% 0 50% 0; background: var(--accent); transform: rotate(35deg); }
.doodle-variant { transform: rotate(-4deg); }
.doodle-variant .doodle-face { border-radius: 42% 58% 48% 52%; background: #dce592; }
.doodle-variant .doodle-dot { right: 58px; top: 0; background: #efb942; }
.doodle-variant .doodle-stem { transform: scaleX(-1) rotate(-9deg); }
.doodle-career { transform: scale(.9) rotate(7deg); }
.doodle-career .doodle-face { background: #efb942; border-radius: 38% 62% 55% 45%; }
.doodle-career .doodle-dot { background: #7eb777; right: 62px; top: 4px; }
.doodle-home { transform: scale(.86) rotate(-2deg); }
.doodle-home .doodle-face { background: #dce592; border-radius: 15px 15px 22px 22px; }
.doodle-home .doodle-face::before { content: ""; position: absolute; left: 7px; top: -15px; width: 40px; height: 40px; border-left: 5px solid #efb942; border-top: 5px solid #efb942; border-radius: 5px; transform: rotate(45deg); }
.doodle-home .doodle-dot { right: 2px; top: 1px; background: #efb942; }
.doodle-category { transform: scale(.78) rotate(5deg); transform-origin: top right; }
.doodle-category .doodle-face { background: #efb942; border-radius: 50% 42% 48% 45%; }
.doodle-category .doodle-dot { background: #7eb777; right: 58px; top: 0; }
.doodle-motivation { transform: scale(.8) rotate(-6deg); transform-origin: top right; }
.doodle-motivation .doodle-face { background: #dce592; border-radius: 46% 54% 44% 56%; }
.doodle-motivation .doodle-dot { background: #efb942; right: 60px; top: 2px; }
.doodle-motivation .doodle-face::after { border-bottom-width: 3px; }
.options { display: grid; gap: 10px; margin: clamp(18px, 4vh, 36px) 0 0; padding: 0; border: 0; }
.options-short { align-content: start; }
.options-long { align-content: start; padding-bottom: 4px; }
.options-featured { align-content: center; gap: 14px; }

.option-card {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 60px;
  padding: 10px 13px 10px 11px;
  border: 1px solid #e8e0c9;
  border-radius: 18px;
  background: #fbf8ed;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease, box-shadow 180ms ease;
  -webkit-tap-highlight-color: transparent;
}

.option-card:hover { border-color: #cbbb91; transform: translateY(-1px); }
.option-card:active { transform: scale(.99); }
.option-card:has(input:checked) { border-color: var(--accent); background: #edf4ee; box-shadow: 0 7px 24px rgba(70, 104, 84, .12); }
.option-card input { position: absolute; width: 1px; height: 1px; opacity: 0; }

.option-index { display: grid; place-items: center; flex: 0 0 auto; width: 34px; height: 34px; margin-right: 13px; border-radius: 11px 8px 12px 8px; background: #f2c84b; color: #5b4911; font: 600 13px/1 "DM Sans", sans-serif; transform: rotate(-3deg); transition: transform 180ms ease, background 180ms ease; }
.option-card:nth-of-type(even) .option-index { transform: rotate(3deg); background: #dce592; }
.option-card:has(input:checked) .option-index { background: var(--accent); color: white; transform: rotate(0) scale(1.04); }
.multi-option.is-limit-disabled { cursor: not-allowed; opacity: .43; }
.check-indicator {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin-left: auto;
  border: 1.5px solid #aeb3ae;
  border-radius: 7px;
  background: var(--surface);
  color: white;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}
.check-indicator::after { content: "✓"; font: 700 13px/1 "DM Sans", sans-serif; opacity: 0; transform: scale(.5); transition: opacity 180ms ease, transform 180ms ease; }
input:checked ~ .check-indicator { border-color: var(--accent); background: var(--accent); }
input:checked ~ .check-indicator::after { opacity: 1; transform: scale(1); }

.radio-indicator {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin-left: auto;
  border: 1.5px solid #aeb3ae;
  border-radius: 50%;
  background: var(--surface);
  transition: border 180ms ease;
}

.radio-indicator::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: white; transform: scale(0); transition: transform 180ms ease; }
input:checked ~ .radio-indicator { border: 6px solid var(--accent); }
input:checked ~ .radio-indicator::after { transform: scale(1); }
.option-text { min-width: 0; font-size: 15px; font-weight: 500; overflow-wrap: anywhere; }
.option-card-featured { align-items: flex-start; min-height: 104px; padding: 18px 15px 18px 13px; }
.option-card-featured .option-index { margin-top: 1px; }
.option-card-featured .option-text { flex: 1 1 auto; padding-right: 8px; line-height: 1.7; }
.option-card-featured .radio-indicator { flex: 0 0 auto; margin-top: 7px; }
.selection-hint { margin: 12px 2px 0; color: var(--muted); font-size: 12px; }
.selection-hint.is-error { color: #b44f43; font-weight: 500; }
.question-footer { padding-top: 8px; border-top: 1px solid rgba(28,39,35,.07); }
.question-footer .primary-button { min-height: 56px; border-radius: 17px; background: var(--accent); }
.question-footer .primary-button:not(:disabled):hover { background: #385543; }
.question-footer-split { display: grid; grid-template-columns: minmax(112px, .78fr) minmax(0, 1.22fr); gap: 10px; }
.secondary-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 54px;
  padding: 0 18px;
  border: 1px solid #d9dcd4;
  border-radius: 17px;
  background: #f3f3ed;
  color: var(--ink);
  cursor: pointer;
  font-weight: 600;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}
.secondary-button:hover { border-color: #abb9af; background: var(--accent-soft); }
.secondary-button:active { transform: scale(.985); }
.question-screen-scroll .progress-header,
.question-footer-sticky { flex: 0 0 auto; }
.question-content-scroll { overflow-x: hidden; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #d4d7cf transparent; overscroll-behavior: contain; }
.question-content-scroll::-webkit-scrollbar { width: 4px; }
.question-content-scroll::-webkit-scrollbar-thumb { border-radius: 99px; background: #d4d7cf; }
.question-heading-compact { min-height: 108px; }
.question-heading-multi { min-height: 164px; }
.question-heading-multi h2 { max-width: 310px; font-size: clamp(24px, 6.5vw, 29px); }
.multi-meta { display: flex; align-items: center; gap: 9px; margin-top: 14px; color: var(--muted); font-size: 12px; }
.multi-meta strong { padding: 6px 9px; border-radius: 99px; background: #f1f1e9; color: var(--accent); font-weight: 600; }
.other-option-group { display: grid; gap: 8px; }
.other-input-wrap { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows 220ms ease, opacity 180ms ease; }
.other-input-wrap.is-visible { grid-template-rows: 1fr; opacity: 1; }
.other-input-wrap > * { min-height: 0; }
.other-input {
  width: 100%;
  height: 48px;
  padding: 0 15px;
  overflow: hidden;
  border: 1px solid #cfd7cf;
  border-radius: 14px;
  outline: 0;
  background: #fffefa;
  color: var(--ink);
  font-size: 15px;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}
.other-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(70,104,84,.1); }
.other-input::placeholder { color: #9a9e99; }
.success-screen { flex-direction: column; justify-content: space-between; max-width: 680px; margin: 0 auto; background: var(--surface); }
.success-content { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; padding: 38px 0; text-align: center; }
.success-content .eyebrow { margin: 28px 0 12px; }
.success-content h2 { margin: 0; font-size: clamp(34px, 9vw, 48px); }
.success-content > p:last-child { margin: 14px 0 0; color: var(--muted); font-size: 15px; }
.success-note { margin: 0; color: var(--muted); font-size: 11px; letter-spacing: .18em; text-align: center; }
.success-illustration { position: relative; width: 132px; height: 122px; }
.success-face { position: absolute; left: 36px; top: 24px; width: 76px; height: 76px; border-radius: 48% 52% 44% 56%; background: #efc44b; box-shadow: 6px 7px 0 rgba(28,39,35,.07); transform: rotate(5deg); }
.success-face i { position: absolute; top: 27px; width: 6px; height: 11px; border-radius: 50%; background: var(--ink); }
.success-face i:first-child { left: 22px; }
.success-face i:last-child { right: 22px; }
.success-face::after { content: ""; position: absolute; left: 25px; bottom: 17px; width: 27px; height: 11px; border-bottom: 3px solid var(--ink); border-radius: 50%; }
.success-orbit { position: absolute; inset: 7px 5px 12px 8px; border: 2px solid #dce592; border-radius: 50%; transform: rotate(-17deg); }
.success-orbit::after { content: ""; position: absolute; right: 8px; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px var(--surface); }
.success-leaf { position: absolute; left: 15px; bottom: 7px; width: 34px; height: 18px; border-radius: 100% 0 100% 0; background: var(--accent); transform: rotate(18deg); }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@keyframes screen-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes screen-out { to { opacity: 0; transform: translateY(-10px); } }
@keyframes screen-in-back { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@keyframes screen-out-back { to { opacity: 0; transform: translateY(12px); } }
@keyframes progress-in { from { transform: scaleX(0); transform-origin: left; } to { transform: scaleX(1); transform-origin: left; } }

@media (max-width: 699px) {
  html,
  body,
  .app-shell { overflow: hidden; }

  .question-screen {
    padding:
      max(20px, calc(env(safe-area-inset-top) + 12px))
      clamp(18px, 5vw, 22px)
      max(18px, calc(env(safe-area-inset-bottom) + 10px));
  }

  .success-screen {
    padding:
      max(20px, calc(env(safe-area-inset-top) + 12px))
      clamp(18px, 5vw, 22px)
      max(18px, calc(env(safe-area-inset-bottom) + 10px));
  }

  .progress-meta { margin-bottom: 10px; }
  .progress-count { padding: 5px 9px; }
  .progress-track { height: 4px; }

  .question-content {
    min-height: 0;
    padding: clamp(28px, 4.5vh, 40px) 0 10px;
  }

  .question-heading {
    min-height: clamp(98px, 12.5vh, 112px);
  }

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

  .question-doodle {
    flex-basis: 74px;
    width: 74px;
    height: 76px;
    margin-top: 1px;
    transform: scale(.9) rotate(3deg);
    transform-origin: top right;
  }

  .options {
    flex: 1;
    align-content: center;
    gap: clamp(8px, 1.1vh, 10px);
    margin-top: clamp(10px, 1.5vh, 14px);
  }

  .option-card {
    min-height: clamp(54px, 6.5vh, 58px);
    padding: 8px 13px 8px 10px;
    border-radius: 17px;
  }

  .option-index {
    width: 32px;
    height: 32px;
    margin-right: 12px;
    border-radius: 10px 7px 11px 7px;
  }

  .radio-indicator {
    width: 20px;
    height: 20px;
  }

  .selection-hint {
    min-height: 17px;
    margin: 7px 2px 0;
  }

  .question-footer {
    flex: 0 0 auto;
    padding-top: 9px;
  }

  .question-footer .primary-button {
    min-height: 54px;
  }

  .options-short {
    flex: 0 1 auto;
    align-content: start;
    margin-top: clamp(18px, 3vh, 28px);
  }

  .question-screen-scroll .question-content-scroll {
    padding-top: clamp(24px, 3.8vh, 34px);
    padding-right: 3px;
  }

  .question-screen-scroll .options-long {
    display: grid;
    flex: none;
    gap: 9px;
    margin-top: 14px;
  }

  .question-screen-scroll .option-card { min-height: 56px; }
  .question-screen-scroll .multi-option { min-height: 62px; padding-top: 10px; padding-bottom: 10px; }
  .question-screen-scroll .multi-option .option-text { flex: 1 1 auto; padding-right: 8px; line-height: 1.55; }
  .question-screen-scroll .multi-option .check-indicator { margin-top: 1px; }
  .question-screen-scroll .selection-hint { margin-bottom: 8px; }

  .question-heading-featured {
    min-height: clamp(132px, 17vh, 150px);
  }

  .question-heading-featured h2 {
    font-size: clamp(25px, 6.8vw, 29px);
  }

  .options-featured {
    flex: 1;
    margin-top: 12px;
  }

  .option-card-featured {
    min-height: clamp(98px, 12.5vh, 112px);
  }
}

@supports (padding: max(0px)) {
  @media (max-width: 699px) {
    .question-screen.is-active {
      height: 100svh;
      min-height: 100svh;
    }
  }
}

@media (min-width: 700px) {
  body { padding: 36px; }
  .app-shell { max-width: 760px; min-height: calc(100vh - 72px); margin: 0 auto; border: 1px solid rgba(28,39,35,.07); border-radius: 30px; background: rgba(255,254,250,.45); box-shadow: var(--shadow); }
  .screen { min-height: calc(100vh - 74px); padding: 42px 56px; }
  .welcome-screen, .question-screen { max-width: none; }
  .success-screen { max-width: none; }
  .question-screen { background: radial-gradient(circle at 92% 32%, rgba(246,200,78,.13) 0 62px, transparent 63px), var(--surface); }
  .question-content { padding-top: 68px; }
  .question-heading { min-height: 140px; }
  .question-doodle { flex-basis: 100px; transform: scale(1.15) rotate(3deg); }
  .question-footer { display: flex; justify-content: flex-end; }
  .question-footer .primary-button { width: 210px; }
  .question-footer-split { display: grid; grid-template-columns: 150px 210px; }
}

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