:root {
  --paper: #f8f7ef;
  --surface: #fffef8;
  --ink: #22241e;
  --plum: #2a1d2c;
  --plum-mid: #53427d;
  --muted: #5d6054;
  --line: #d6d8c9;
  --cream: #eeeccf;
  --amber: #ffbe3e;
  --danger: #b83227;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html,
body {
  min-height: 100%;
  font-family:
    "DM Sans",
    -apple-system,
    BlinkMacSystemFont,
    "Helvetica Neue",
    sans-serif;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.progress-track {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(42, 29, 44, 0.08);
  z-index: 50;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--plum);
  transition: width 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.topbar {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 720px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: rgba(255, 254, 248, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: 999px;
  z-index: 40;
}
.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.04em;
  color: var(--ink);
}
.brand-lockup svg {
  width: 30px;
  height: 28px;
  display: block;
}
.step-pill {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--plum);
  padding: 5px 12px;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.stage {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 96px 18px 64px;
}
.card {
  width: 100%;
  max-width: 680px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 40px 38px;
  box-shadow: 0 14px 36px rgba(34, 36, 30, 0.06);
  animation: cardIn 0.26s ease-out;
}
@media (max-width: 600px) {
  .card {
    padding: 26px 20px;
    border-radius: 18px;
  }
}
@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.q-title,
.range-field:has(#minDeal) label {
  font-size: clamp(23px, 3.6vw, 31px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.q-sub {
  margin-top: 8px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--muted);
}

.body-area {
  margin-top: 24px;
}

/* Choice buttons */
.choices-grid {
  display: grid;
  gap: 10px;
}
.choices-grid.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 540px) {
  .choices-grid.two-col {
    grid-template-columns: 1fr;
  }
}
.choice-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    transform 0.15s ease;
}
.choice-btn:hover {
  border-color: var(--plum-mid);
  background: var(--surface);
}
.choice-btn.selected {
  border-color: var(--plum);
  background: rgba(255, 190, 62, 0.36);
  box-shadow: 0 0 0 1.5px var(--plum);
}
.key-cap {
  font-family: "IBM Plex Mono", monospace;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}
.choice-btn.selected .key-cap {
  background: var(--plum);
  border-color: var(--plum);
  color: var(--amber);
}
.choice-sub {
  display: block;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  margin-top: 2px;
}
.check-box {
  margin-left: auto;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  border-radius: 5px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.choice-btn.selected .check-box {
  background: var(--plum);
  border-color: var(--plum);
}
.choice-btn.selected .check-box::after {
  content: "";
  width: 9px;
  height: 5px;
  border-left: 2px solid var(--amber);
  border-bottom: 2px solid var(--amber);
  transform: rotate(-45deg) translateY(-1px);
}

/* Compact multi-select tags for large interest / brand lists */
.chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}
.chip-btn {
  padding: 10px 15px;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.14s ease;
}
.chip-btn:hover {
  border-color: var(--plum-mid);
  background: var(--surface);
}
.chip-btn.selected {
  background: var(--plum);
  border-color: var(--plum);
  color: var(--amber);
}

/* Inputs & Selects */
.field-stack {
  display: grid;
  gap: 14px;
}
.field-row label {
  display: block;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--plum-mid);
  margin-bottom: 6px;
}
.text-input,
.textarea-input,
.select-input {
  width: 100%;
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  outline: none;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}
.text-input:focus,
.textarea-input:focus,
.select-input:focus {
  background: var(--surface);
  border-color: var(--plum);
  box-shadow: 0 0 0 3px rgba(83, 66, 125, 0.14);
}
.text-input:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.textarea-input {
  min-height: 120px;
  resize: vertical;
  line-height: 1.5;
}

.other-box {
  margin-top: 12px;
  display: none;
}
.other-box.show {
  display: block;
}

.toggle-row {
  margin-top: 12px;
}

.error-msg {
  margin-top: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--danger);
  min-height: 18px;
}

/* Footer actions */
.actions {
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.btn-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  background: var(--plum);
  color: var(--surface);
  border: 1.5px solid var(--plum);
  border-radius: 999px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-primary:hover {
  background: var(--amber);
  color: var(--ink);
  border-color: var(--ink);
}
.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.btn-ghost {
  padding: 12px 18px;
  background: var(--surface);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}
.btn-ghost:hover {
  background: var(--cream);
}
.enter-hint {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  color: var(--muted);
}

/* Completion screen */
.done-wrap {
  text-align: center;
  padding: 10px 4px;
}
.done-wrap .btn-primary {
  margin-top: 20px;
  text-decoration: none;
}
.piko-hero-svg {
  width: 96px;
  height: 90px;
  margin: 0 auto 14px;
  display: block;
}

.brand-lockup {
  text-decoration: none;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

.range-field {
  margin-top: 1rem;
}
.range-field output {
  font-weight: 700;
}
.range-field input {
  width: 100%;
  accent-color: var(--amber);
}

.range-field label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.choice-btn[data-action="selectBrandNiche"] .check-box {
  border-radius: 50%;
}
.choice-btn[data-action="selectBrandNiche"].selected .check-box::after {
  width: 8px;
  height: 8px;
  border: 0;
  border-radius: 50%;
  background: var(--amber);
  transform: none;
}
