:root {
  --ink: #18162b;
  --muted: #716d82;
  --line: #e9e6f0;
  --surface: #ffffff;
  --canvas: #f7f6fb;
  --purple: #6f4af2;
  --purple-deep: #5532ce;
  --purple-soft: #eee9ff;
  --mint: #e3f8ed;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); }
body {
  min-height: 100dvh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(127, 91, 246, .10), transparent 26rem),
    radial-gradient(circle at 88% 88%, rgba(82, 205, 153, .08), transparent 24rem),
    var(--canvas);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

.product-bar {
  display: flex;
  width: min(1120px, calc(100% - 40px));
  height: 76px;
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
}
.product-mark { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-size: 18px; font-weight: 850; letter-spacing: -.035em; }
.pulse-mark { display: inline-flex; align-items: center; gap: 3px; }
.pulse-mark i { display: block; width: 8px; height: 8px; border-radius: 999px; background: var(--purple); }
.pulse-mark i:nth-child(2) { width: 18px; }
.pulse-mark i:nth-child(3) { width: 5px; opacity: .45; }
.privacy-badge { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border: 1px solid #cdebdc; border-radius: 999px; color: #176d4a; background: var(--mint); font-size: 12px; font-weight: 750; }
.privacy-badge i { width: 6px; height: 6px; border-radius: 50%; background: #299c6c; }

.checkin-wrap { width: min(640px, calc(100% - 32px)); margin: clamp(34px, 7vh, 74px) auto 64px; }
.week-row { display: flex; justify-content: space-between; gap: 12px; margin: 0 18px 12px; color: var(--muted); font-size: 12px; font-weight: 750; }
.progress-track { height: 5px; margin: 0 18px 18px; overflow: hidden; border-radius: 999px; background: #e7e3ef; }
.progress-track span { display: block; width: 20%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--purple), #9879ff); transition: width .2s ease; }
.checkin-card { padding: clamp(26px, 5vw, 46px); border: 1px solid rgba(42, 32, 78, .07); border-radius: 28px; background: rgba(255,255,255,.96); box-shadow: 0 22px 70px rgba(43,30,87,.10), 0 2px 8px rgba(43,30,87,.04); text-align: center; }
.question-count { margin: 0 0 12px; color: var(--purple); font-size: 12px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.checkin-card h1 { max-width: 530px; margin: 0 auto; font-size: clamp(27px, 5vw, 39px); line-height: 1.12; letter-spacing: -.045em; }
.question-help, .state-card > p:not(.question-count) { max-width: 450px; margin: 14px auto 30px; color: var(--muted); font-size: 15px; line-height: 1.55; }

.score-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 9px; }
.score-option { min-width: 0; padding: 14px 5px 12px; border: 1px solid var(--line); border-radius: 17px; color: #5d586c; background: #fbfafd; cursor: pointer; transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; }
.score-option:hover { transform: translateY(-2px); border-color: #cfc4f5; }
.score-option:focus-visible { outline: 3px solid rgba(111,74,242,.24); outline-offset: 2px; }
.score-option.is-selected { border-color: var(--purple); color: var(--purple-deep); background: var(--purple-soft); box-shadow: 0 0 0 3px rgba(111,74,242,.1); }
.score-face { display: block; font-size: clamp(25px, 5vw, 34px); }
.score-label { display: block; min-height: 28px; margin-top: 6px; font-size: 10px; font-weight: 750; line-height: 1.25; }

.reason-block { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); text-align: left; }
.reason-block > p { margin: 0 0 10px; font-size: 13px; font-weight: 800; }
.reason-block > p span { color: var(--muted); font-size: 11px; font-weight: 600; }
.reason-options { display: flex; flex-wrap: wrap; gap: 7px; }
.reason-options button { padding: 9px 11px; border: 1px solid var(--line); border-radius: 999px; color: #625d70; background: #fbfafd; cursor: pointer; font-size: 12px; font-weight: 700; }
.reason-options button.is-selected { border-color: #b8a5fb; color: var(--purple-deep); background: var(--purple-soft); }

.step-actions { display: flex; align-items: center; gap: 10px; margin-top: 24px; }
.primary-action, .back-action, .secondary-action { min-height: 52px; border-radius: 15px; cursor: pointer; font-weight: 800; }
.primary-action { flex: 1; border: 0; color: white; background: linear-gradient(135deg, var(--purple), var(--purple-deep)); box-shadow: 0 10px 24px rgba(92,54,211,.22); }
.primary-action:disabled { opacity: .35; box-shadow: none; cursor: not-allowed; }
.back-action { padding: 0 16px; border: 1px solid var(--line); color: var(--muted); background: white; }
.back-action:disabled { visibility: hidden; }
.secondary-action { padding: 0 18px; border: 1px solid var(--line); color: var(--ink); background: white; }
.form-error { margin: 14px 0 0; color: #a93446; font-size: 13px; font-weight: 750; }
.privacy-note { max-width: 490px; margin: 18px auto 0; color: var(--muted); font-size: 12px; line-height: 1.55; text-align: center; }

.state-card { padding-block: clamp(45px, 9vw, 72px); }
.state-icon { display: grid; width: 64px; height: 64px; margin: 0 auto 20px; place-items: center; border-radius: 50%; font-size: 28px; font-weight: 900; }
.state-icon.is-done { color: #14734a; background: var(--mint); }
.state-icon.is-error { color: #a93446; background: #feecef; }
.loader { width: 38px; height: 38px; margin: 0 auto 24px; border: 4px solid #e5dff8; border-top-color: var(--purple); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 620px) {
  .product-bar { width: calc(100% - 28px); height: 66px; }
  .privacy-badge { padding: 7px 9px; font-size: 11px; }
  .checkin-wrap { width: min(100% - 24px, 520px); margin-top: 26px; }
  .checkin-card { padding: 28px 18px 22px; border-radius: 23px; }
  .question-help { margin-bottom: 24px; }
  .score-grid { gap: 5px; }
  .score-option { padding: 12px 2px 10px; border-radius: 14px; }
  .score-label { font-size: 9px; }
}
@media (max-width: 370px) { .privacy-badge { display: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
