/* First-run setup (one question per screen). See js/modules/onboarding.js */
.onb-open, .onb-open body { overflow: hidden; }
.onb {
  position: fixed; inset: 0; z-index: 2000; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background-color: var(--bg);
  background-image:
    radial-gradient(60vmax 40vmax at 0% -10%, var(--bg-glow-1, transparent), transparent 60%),
    radial-gradient(60vmax 40vmax at 100% 0%, var(--bg-glow-2, transparent), transparent 60%);
  color: var(--text); font-family: var(--font);
  display: flex; justify-content: center; padding: max(16px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
}
.onb-card { width: 100%; max-width: 560px; display: flex; flex-direction: column; }
.onb-top { display: flex; align-items: center; gap: 12px; min-height: 44px; }
.onb-link {
  flex: none; min-height: 40px; padding: 0 10px; border: none; border-radius: 4px; background: none;
  color: var(--text-muted); font: inherit; font-size: 0.95rem; font-weight: 700; cursor: pointer;
}
@media (hover: hover) { .onb-link:hover { color: var(--text); background: var(--accent-soft); } }
.onb-progress { flex: 1; height: 8px; border-radius: 99px; background: var(--border); overflow: hidden; }
.onb-progress i { display: block; height: 100%; border-radius: inherit; background: var(--grad-brand); transition: width 0.3s var(--ease); }
.onb-body { padding: 24px 0 8px; animation: onb-in 0.25s var(--ease); }
@keyframes onb-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.onb-welcome { margin: 0 0 8px; color: var(--accent); font-weight: 700; }
.onb-title:focus, .onb-title:focus-visible { outline: none; box-shadow: none; }
.onb-title { margin: 0 0 6px; font-size: clamp(1.45rem, 5vw, 1.9rem); line-height: 1.2; letter-spacing: -0.02em; }
.onb-sub { margin: 0 0 4px; color: var(--text-muted); }
.onb-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.onb-option {
  display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 14px; text-align: left;
  border: 2px solid var(--border); border-radius: 4px; background: var(--surface); color: inherit; font: inherit;
  box-shadow: var(--shadow-sm); cursor: pointer; transition: transform 0.15s var(--ease), border-color 0.15s, background 0.15s;
}
/* Hover only where there's a mouse: on phones it stuck after a tap and looked picked. */
@media (hover: hover) { .onb-option:not(.selected):hover { border-color: var(--text-muted); } }
.onb-option:active { transform: scale(0.98); }
.onb-option:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }
.onb-option.selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
/* A ✓ marks picked answers, so it never relies on color alone. */
.onb-check {
  flex: none; display: none; place-items: center; width: 24px; height: 24px; margin-left: auto; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 0.85rem; font-weight: 800; line-height: 1;
}
.onb-option.selected .onb-check { display: grid; }
/* On chips the ✓ sits on the corner, so picking one doesn't widen it and
   push the chips after it onto other lines under your finger. */
.onb-chips .onb-option { position: relative; }
.onb-chips .onb-check { position: absolute; top: -6px; right: -4px; width: 22px; height: 22px; margin: 0; box-shadow: 0 0 0 2px var(--bg); }
.onb-icon { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 4px; background: var(--accent-soft); font-size: 1.4rem; }
.onb-option.selected .onb-icon { background: var(--surface); }
.onb-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.onb-label { font-size: 1.05rem; font-weight: 700; }
.onb-hint { font-size: 0.82rem; color: var(--text-muted); }
.onb-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.onb-chips .onb-option { min-height: 48px; padding: 8px 16px 8px 10px; border-radius: 99px; gap: 8px; }
.onb-chips .onb-icon { width: 30px; height: 30px; font-size: 1.1rem; border-radius: 50%; }
.onb-chips .onb-label { font-size: 1rem; }
.onb-primary {
  display: block; width: 100%; min-height: 56px; margin-top: 24px; border: none; border-radius: 4px; cursor: pointer;
  background: var(--grad-accent); color: #fff; font: inherit; font-size: 1.1rem; font-weight: 800;
  box-shadow: var(--glow-accent); transition: transform 0.15s var(--ease);
}
.onb-primary:active { transform: scale(0.98); }
.onb-primary:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }
/* Continue stays in view at the bottom of long lists (reasons, interests). */
.onb-footer {
  position: sticky; bottom: calc(-1 * max(24px, env(safe-area-inset-bottom))); margin-top: 16px;
  padding: 12px 0 max(24px, env(safe-area-inset-bottom)); background: linear-gradient(to bottom, transparent, var(--bg) 24px);
}
.onb-footer .onb-primary { margin-top: 0; }
.onb-emoji { font-size: 3rem; margin-bottom: 8px; }
.onb-summary { margin: 20px 0 0; padding: 4px 16px; border: 2px solid var(--border); border-radius: 4px; background: var(--surface); box-shadow: var(--shadow-sm); }
.onb-summary div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.onb-summary div:last-child { border-bottom: none; }
.onb-summary dt { color: var(--text-muted); flex: none; }
.onb-summary dd { margin: 0; font-weight: 700; text-align: right; }
@media (max-width: 420px) {
  .onb-options:not(.onb-chips) { grid-template-columns: 1fr; }
  .onb-option { min-height: 58px; }
}

.onb-writein { display: flex; flex-direction: column; gap: 6px; margin-top: 16px; }
.onb-writein input {
  min-height: 48px; padding: 0 14px; border: 2px solid var(--border); border-radius: 4px;
  background: var(--surface); color: inherit; font: inherit; font-size: 1rem;
}
.onb-writein input:focus { outline: none; border-color: var(--accent); }
