    :root {
      --purple-deep: #3A0870;
      --purple: #5B00C8;
      --purple-soft: #F1E9FB;
      --orange: #FF6B00;
      --orange-soft: #FFE9DA;
      --ink: #241539;
      --muted: #766F8C;
      --bg: #FBF9FE;
      --card: #FFFFFF;
      --border: #E7DFF5;
    }

    * {
      box-sizing: border-box;
    }

    html,
    body {
      margin: 0;
      padding: 0;
    }

    body {
      font-family: 'Montserrat', sans-serif;
      background: var(--bg);
      color: var(--ink);
      -webkit-font-smoothing: antialiased;
      display: flex;
      justify-content: center;
    }

    .app {
      width: 100%;
      max-width: 480px;
      min-height: 100vh;
      background: var(--bg);
      display: flex;
      flex-direction: column;
      position: relative;
    }

    /* Header */
    header {
      padding: 28px 24px 20px;
      background: linear-gradient(180deg, var(--purple-deep) 0%, var(--purple) 100%);
      color: #fff;
      position: relative;
      overflow: hidden;
      border-radius: 0 0 28px 28px;
    }

    header .scan {
      position: absolute;
      top: 0;
      left: -20%;
      width: 40%;
      height: 100%;
      background: linear-gradient(90deg, transparent, rgba(255, 107, 0, 0.35), transparent);
      animation: sweep 1.6s ease-out 0.3s 1;
      pointer-events: none;
    }

    @keyframes sweep {
      from {
        left: -40%;
      }

      to {
        left: 120%;
      }
    }

    .logo {
      height: 34px;
      width: auto;
      display: block;
      position: relative;
      z-index: 1;
    }

    .hero-line {
      margin: 18px 0 0;
      font-size: 19px;
      font-weight: 700;
      line-height: 1.35;
      max-width: 320px;
    }

    .hero-sub {
      margin: 8px 0 0;
      font-size: 13px;
      font-weight: 500;
      color: rgba(255, 255, 255, 0.8);
    }

    /* Progress */
    .progress-wrap {
      padding: 18px 24px 6px;
    }

    .progress-track {
      display: flex;
      gap: 6px;
      margin-bottom: 8px;
    }

    .progress-seg {
      height: 4px;
      flex: 1;
      border-radius: 4px;
      background: var(--border);
      overflow: hidden;
    }

    .progress-seg.done,
    .progress-seg.active {
      background: var(--purple);
    }

    .progress-label {
      font-size: 12px;
      font-weight: 600;
      color: var(--muted);
    }

    .progress-label b {
      color: var(--purple);
    }

    /* Steps */
    main {
      flex: 1;
      padding: 8px 24px 24px;
    }

    .step {
      display: none;
      animation: fadeIn .28s ease;
    }

    .step.active {
      display: block;
    }

    @keyframes fadeIn {
      from {
        opacity: 0;
        transform: translateY(6px);
      }

      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    .step-title {
      font-size: 19px;
      font-weight: 700;
      margin: 18px 0 4px;
      color: var(--purple-deep);
    }

    .step-note {
      font-size: 13px;
      color: var(--muted);
      margin: 0 0 18px;
      line-height: 1.5;
    }

    .step-note.flag {
      background: var(--orange-soft);
      border-left: 3px solid var(--orange);
      padding: 10px 12px;
      border-radius: 8px;
      color: #8A3F00;
      font-weight: 500;
    }

    .field {
      margin-bottom: 18px;
    }

    .field label.q {
      display: block;
      font-size: 14.5px;
      font-weight: 600;
      margin-bottom: 10px;
      line-height: 1.4;
    }

    input[type="text"],
    input[type="email"],
    input[type="date"],
    textarea {
      width: 100%;
      padding: 12px 14px;
      border: 1.5px solid var(--border);
      border-radius: 12px;
      font-family: 'Montserrat', sans-serif;
      font-size: 14px;
      color: var(--ink);
      background: var(--card);
      outline: none;
      transition: border-color .15s ease;
    }

    input[type="text"]:focus,
    input[type="email"]:focus,
    input[type="date"]:focus,
    textarea:focus {
      border-color: var(--purple);
    }

    textarea {
      min-height: 70px;
      resize: vertical;
    }

    .pill-group {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
    }

    .pill {
      padding: 10px 18px;
      border-radius: 999px;
      border: 1.5px solid var(--border);
      background: var(--card);
      font-size: 13.5px;
      font-weight: 600;
      color: var(--muted);
      cursor: pointer;
      user-select: none;
      transition: all .15s ease;
    }

    .pill:active {
      transform: scale(0.97);
    }

    .pill.selected {
      background: var(--purple);
      border-color: var(--purple);
      color: #fff;
    }

    .pill.selected.warn {
      background: var(--orange);
      border-color: var(--orange);
    }

    .sub-fields {
      margin-top: 12px;
      padding: 14px;
      background: var(--purple-soft);
      border-radius: 12px;
      display: flex;
      flex-direction: column;
      gap: 12px;
      animation: fadeIn .2s ease;
    }

    .sub-fields .field {
      margin-bottom: 0;
    }

    .sub-fields label.small {
      display: block;
      font-size: 12.5px;
      font-weight: 600;
      color: var(--purple-deep);
      margin-bottom: 6px;
    }

    .scale-row {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    input[type="range"] {
      flex: 1;
      accent-color: var(--orange);
    }

    .scale-value {
      min-width: 28px;
      text-align: center;
      font-weight: 700;
      color: var(--purple-deep);
      background: var(--purple-soft);
      border-radius: 8px;
      padding: 4px 0;
    }

    .scale-label {
      font-size: 13px;
      font-weight: 600;
      color: var(--purple);
      margin-top: 6px;
    }

    .char-count {
      font-size: 11px;
      color: var(--muted);
      text-align: right;
      margin-top: 4px;
    }

    .required-flag {
      font-size: 12px;
      color: var(--orange);
      font-weight: 600;
      margin-top: 6px;
      display: none;
    }

    .field.invalid .required-flag {
      display: block;
    }

    .field.invalid input,
    .field.invalid textarea {
      border-color: var(--orange);
    }

    .field.invalid .pill-group .pill {
      border-color: var(--orange);
    }

    /* Nav */
    .nav-row {
      display: flex;
      gap: 10px;
      margin-top: 8px;
      padding-top: 8px;
    }

    button {
      font-family: 'Montserrat', sans-serif;
      border: none;
      cursor: pointer;
    }

    .btn-primary {
      flex: 1;
      background: var(--purple);
      color: #fff;
      font-weight: 700;
      font-size: 14.5px;
      padding: 15px;
      border-radius: 14px;
      transition: background .15s ease;
    }

    .btn-primary:active {
      background: var(--purple-deep);
    }

    .btn-secondary {
      background: var(--card);
      color: var(--purple);
      font-weight: 600;
      font-size: 14.5px;
      padding: 15px 18px;
      border-radius: 14px;
      border: 1.5px solid var(--border);
    }

    /* Confirmation step */
    .summary-box {
      background: var(--card);
      border: 1.5px solid var(--border);
      border-radius: 14px;
      padding: 14px;
      font-size: 12.5px;
      color: var(--muted);
      white-space: pre-wrap;
      line-height: 1.6;
      max-height: 260px;
      overflow-y: auto;
      margin-bottom: 16px;
    }

    .checkbox-row {
      display: flex;
      align-items: flex-start;
      gap: 10px;
      background: var(--purple-soft);
      padding: 14px;
      border-radius: 12px;
      margin-bottom: 18px;
    }

    .checkbox-row input {
      margin-top: 3px;
      accent-color: var(--purple);
      width: 18px;
      height: 18px;
      flex-shrink: 0;
    }

    .checkbox-row span {
      font-size: 12.5px;
      color: var(--purple-deep);
      line-height: 1.5;
    }

    .done-screen {
      display: none;
      text-align: center;
      padding: 40px 8px;
    }

    .done-screen.active {
      display: block;
    }

    .done-icon {
      width: 64px;
      height: 64px;
      border-radius: 50%;
      background: var(--purple-soft);
      display: flex;
      align-items: center;
      justify-content: center;
      margin: 0 auto 18px;
      font-size: 30px;
      color: var(--purple);
    }

    .done-title {
      font-size: 18px;
      font-weight: 700;
      color: var(--purple-deep);
      margin-bottom: 8px;
    }

    .done-text {
      font-size: 13.5px;
      color: var(--muted);
      line-height: 1.6;
      margin-bottom: 24px;
    }

    footer {
      padding: 18px 24px 28px;
      text-align: center;
      font-size: 11px;
      color: var(--muted);
      line-height: 1.6;
    }