/* ============================================================================
   px-onboarding.css — onboarding flow (§9.5). Requires px-tokens + px-base.
   Tokens only; mobile-first; primary pill full-width on mobile.
   ============================================================================ */

[x-cloak] { display: none !important; }

.pxo {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  min-height: 100dvh;
  background: var(--px-bamboo-on); color: var(--px-ink-700);
  font: var(--px-text-body);
}

/* Progress */
.pxo__progress { height: 8px; background: var(--px-surface-200); border-radius: var(--px-radius-pill); overflow: hidden; }
.pxo__progressfill { height: 100%; background: var(--px-brand); border-radius: var(--px-radius-pill);
  transition: width var(--px-dur-base) var(--px-ease-out); }

/* Stage */
.pxo__stage { padding: 46px var(--px-space-5) var(--px-space-6); }
.pxo__slot { max-width: 860px; }
.pxo-step { width: 100%; display: flex; flex-direction: column; gap: var(--px-space-5); }
.pxo-q { margin: 0; color: var(--px-ink-900); font-weight: 600; }
.pxo-sub { margin: 0; }
.pxo-muted { color: var(--px-ink-500); margin: calc(var(--px-space-2) * -1) 0 0; text-align: center; }

/* Intro / preparing host */
.pxo-intro, .pxo-prep { align-items: center; justify-content: center; text-align: center; gap: var(--px-space-5); }
.pxo-avatar {
  width: 120px; height: 120px; display: grid; place-items: center; font-size: 64px; line-height: 1;
  background: var(--px-brand-subtle); border-radius: var(--px-radius-pill);
}
.pxo-bubble {
  background: var(--px-surface-0); border-radius: var(--px-radius-lg);
  box-shadow: var(--px-shadow-card); padding: var(--px-space-6); max-width: 460px;
}
.pxo-bubble p { margin: 0 0 var(--px-space-1); }
.pxo-question-bubble { max-width: 610px; min-height: 112px; display: flex; align-items: center; }
.pxo-question-bubble .pxo-q { font-size: 25px; line-height: 1.35; letter-spacing: -0.02em; }
.pxo-host { flex: 0 0 auto; width: 118px; height: 118px; }
.pxo-error { margin: 0; color: var(--px-error); }
.pxo-type-cursor {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-left: 4px;
  vertical-align: -0.12em;
  background: var(--px-brand);
  animation: pxo-cursor-blink 700ms steps(1) infinite;
}
@keyframes pxo-cursor-blink { 50% { opacity: 0; } }

/* Single-select option cards */
.pxo-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.pxo-opt {
  position: relative;
  display: grid; grid-template-columns: 44px minmax(0, 1fr) 24px; align-items: center; gap: 14px; text-align: left;
  min-height: 92px; padding: 16px 18px; background: var(--px-surface-0);
  border: 2px solid var(--px-surface-200); border-radius: 16px;
  cursor: pointer; color: var(--px-ink-900);
  transition: border-color var(--px-dur-fast) var(--px-ease-out), background-color var(--px-dur-fast) var(--px-ease-out), transform var(--px-dur-fast) var(--px-ease-out), box-shadow var(--px-dur-fast) var(--px-ease-out);
}
.pxo-opt:hover { border-color: var(--px-brand); transform: translateY(-1px); box-shadow: 0 7px 18px rgba(38, 44, 48, 0.07); }
.pxo-opt.is-on { border-color: var(--px-brand); background: var(--px-brand-subtle); box-shadow: 0 0 0 1px var(--px-brand); }
.pxo-opt span { margin: 0; }
.pxo-opt__icon {
  width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: 13px; background: var(--px-surface-100);
  font-size: 24px; line-height: 1;
}
.pxo-opt.is-on .pxo-opt__icon { background: var(--px-surface-0); }
.pxo-opt__copy { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pxo-opt__copy strong { color: var(--px-ink-900); font-size: 16px; line-height: 1.3; font-weight: 650; }
.pxo-opt__copy small { color: var(--px-ink-500); font-size: 13px; line-height: 1.35; }
.pxo-opt__check {
  width: 22px; height: 22px; display: grid; place-items: center;
  border: 2px solid var(--px-surface-200); border-radius: 7px;
  color: transparent; font-size: 14px; font-weight: 800;
}
.pxo-opt.is-on .pxo-opt__check { color: var(--px-brand-on); border-color: var(--px-brand); background: var(--px-brand); }

/* Multi-select chips */
.pxo-chips { display: flex; flex-wrap: wrap; gap: var(--px-space-3); }
.pxo-chip {
  padding: var(--px-space-3) var(--px-space-5); font: var(--px-text-body);
  background: var(--px-surface-0); color: var(--px-ink-900);
  border: 1px solid var(--px-surface-200); border-radius: var(--px-radius-pill); cursor: pointer;
  transition: border-color var(--px-dur-fast) var(--px-ease-out), background-color var(--px-dur-fast) var(--px-ease-out);
}
.pxo-chip:hover { border-color: var(--px-ink-300); }
.pxo-chip.is-on { border-color: var(--px-brand); background: var(--px-brand-subtle); color: var(--px-brand-active); }

/* Preparing checklist */
.pxo-checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--px-space-3); width: 100%; max-width: 360px; }
.pxo-check { display: flex; align-items: center; gap: var(--px-space-3); opacity: 0.4; transition: opacity var(--px-dur-base) var(--px-ease-out); }
.pxo-check.is-done { opacity: 1; }
.pxo-check__tick {
  width: 28px; height: 28px; flex: none; display: grid; place-items: center;
  border-radius: var(--px-radius-pill); background: var(--px-surface-200); color: var(--px-surface-0);
}
.pxo-check.is-done .pxo-check__tick { background: var(--px-success); }

/* Summary gauge + recommendations */
.pxo-gauge { display: flex; flex-direction: column; gap: var(--px-space-2); }
.pxo-gauge__track { height: 12px; background: var(--px-surface-200); border-radius: var(--px-radius-pill); overflow: hidden; }
.pxo-gauge__fill { height: 100%; background: var(--px-brand); border-radius: var(--px-radius-pill); transition: width var(--px-dur-slow) var(--px-ease-out); }
.pxo-gauge__labels { display: flex; justify-content: space-between; }
.pxo-recs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--px-space-2); }
.pxo-rec { display: flex; align-items: center; gap: var(--px-space-3); }
.pxo-rec__dot { width: 8px; height: 8px; flex: none; border-radius: var(--px-radius-pill); background: var(--px-bamboo); }

/* Reminder */
.pxo-toggle { display: flex; align-items: center; gap: var(--px-space-3); }
.pxo-remfields { display: flex; flex-direction: column; gap: var(--px-space-3); }
.pxo-days { display: flex; gap: var(--px-space-2); }
.pxo-day {
  width: 40px; height: 40px; flex: none; border-radius: var(--px-radius-pill);
  background: var(--px-surface-0); border: 1px solid var(--px-surface-200); color: var(--px-ink-700); cursor: pointer;
}
.pxo-day.is-on { background: var(--px-brand); border-color: var(--px-brand); color: var(--px-brand-on); }
.pxo-time { max-width: 160px; }

/* Footer */
.pxo__footer { background: var(--px-surface-0); }
.pxo__footer .__wrap { position: relative; align-items: center; justify-content: center; gap: var(--px-space-3); }
.pxo__primary { width: 340px; min-width: 220px; margin-left: 0; }
.pxo__skip { color: var(--px-ink-500); }
.pxo__footer .pxo__skip { position: absolute; left: 0; }
.pxo__top {
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  border-bottom: 1px solid var(--px-surface-200);
}
.pxo__backslot { width: 44px; height: 44px; display: grid; place-items: center; }
.pxo__backtop { font-size: 26px; font-weight: 400; }
.pxo__topspacer { display: block; width: 44px; height: 44px; }
.pxo-host { background: transparent; }

/* Personalized path handoff */
.pxo-path__top .pxo__progress { max-width: 620px; }
.pxo-path__done {
  width: 32px; height: 32px; display: grid; place-items: center; justify-self: end;
  border-radius: 50%; background: var(--px-success); color: #fff; font-size: 16px; font-weight: 800;
}
.pxo-path__stage { padding: 38px 20px 32px; }
.pxo-path__content { width: 100%; max-width: 920px; display: flex; flex-direction: column; gap: 20px; }
.pxo-path__hero {
  display: grid; grid-template-columns: minmax(0, 1fr) 150px; align-items: center; gap: 28px;
  padding: 30px 34px;
  border: 1px solid var(--px-surface-200); border-radius: 22px;
  background: linear-gradient(135deg, var(--px-surface-0) 0%, var(--px-brand-subtle) 100%);
}
.pxo-path__eyebrow {
  display: inline-flex; margin-bottom: 10px;
  color: var(--px-brand); font-size: 12px; line-height: 1; font-weight: 800;
  letter-spacing: 0.09em; text-transform: uppercase;
}
.pxo-path__hero h1 {
  margin: 0; color: var(--px-ink-900);
  font-size: clamp(28px, 4vw, 42px); line-height: 1.12; letter-spacing: -0.035em;
}
.pxo-path__hero p { max-width: 650px; margin: 12px 0 0; color: var(--px-ink-600); font-size: 16px; line-height: 1.6; }
.pxo-path__character { width: 145px; height: 145px; object-fit: contain; justify-self: end; }
.pxo-path__summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.pxo-path__summary-card {
  min-width: 0; display: grid; grid-template-columns: 42px minmax(0, 1fr); align-items: center; gap: 12px;
  min-height: 92px; padding: 16px;
  border: 1px solid var(--px-surface-200); border-radius: 16px; background: var(--px-surface-0);
}
.pxo-path__summary-icon {
  width: 42px; height: 42px; display: grid; place-items: center;
  border-radius: 12px; background: var(--px-surface-100); font-size: 22px;
}
.pxo-path__summary-card > span:last-child { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.pxo-path__summary-card small,
.pxo-path__focus small { color: var(--px-ink-500); font-size: 12px; line-height: 1.2; }
.pxo-path__summary-card strong {
  overflow: hidden; color: var(--px-ink-900); font-size: 14px; line-height: 1.35;
  text-overflow: ellipsis;
}
.pxo-path__route {
  display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 36px;
  padding: 28px 30px; border: 1px solid var(--px-surface-200); border-radius: 20px; background: var(--px-surface-0);
}
.pxo-path__section-head > span {
  color: var(--px-brand); font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
}
.pxo-path__section-head h2 { margin: 8px 0 10px; color: var(--px-ink-900); font-size: 24px; line-height: 1.25; }
.pxo-path__section-head p { margin: 0; color: var(--px-ink-500); font-size: 14px; line-height: 1.55; }
.pxo-path__steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.pxo-path__steps li { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; align-items: start; }
.pxo-path__step-number {
  width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 50%; background: var(--px-brand-subtle); color: var(--px-brand); font-size: 13px; font-weight: 800;
}
.pxo-path__steps li > span:last-child { display: flex; flex-direction: column; gap: 3px; }
.pxo-path__steps strong { color: var(--px-ink-900); font-size: 14px; line-height: 1.35; }
.pxo-path__steps small { color: var(--px-ink-500); font-size: 12.5px; line-height: 1.45; }
.pxo-path__focus {
  display: flex; align-items: center; gap: 12px; padding: 14px 18px;
  border-radius: 14px; background: var(--px-surface-100);
}
.pxo-path__focus > span { font-size: 22px; }
.pxo-path__focus p { margin: 0; display: flex; flex-direction: column; gap: 2px; }
.pxo-path__focus strong { color: var(--px-ink-900); font-size: 14px; }
.pxo-path__error { margin: 0; color: var(--px-error); text-align: center; }
.pxo-path__footer .__wrap { justify-content: center; }
.pxo-path__primary { width: 340px; }

@media (max-width: 480px) {
  .pxo__top {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    min-height: 68px;
    padding: 10px 14px;
  }
  .pxo__top .pxo__progress { order: initial; max-width: 220px; width: 100%; }
  .pxo__stage { padding: 34px 18px var(--px-space-4); }
  .pxo-step { gap: var(--px-space-4); }
  .pxo-intro {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 84px;
    gap: 14px;
    align-items: center;
    text-align: left;
  }
  .pxo-host { grid-column: 2; grid-row: 1; width: 84px; height: 84px; }
  .pxo-question-bubble {
    grid-column: 1; grid-row: 1;
    min-height: auto;
    padding: 0;
    border: 0;
    background: transparent;
  }
  .pxo-question-bubble::before { display: none; }
  .pxo-question-bubble .pxo-q { font-size: 25px; line-height: 1.32; }
  .pxo-muted { margin: -2px 0 4px; text-align: left; font-size: 14px; line-height: 1.45; }
  .pxo-opts { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .pxo-opt { min-height: 82px; padding: 13px 14px; grid-template-columns: 42px minmax(0, 1fr) 24px; gap: 12px; border-radius: 16px; }
  .pxo-opt__icon { width: 42px; height: 42px; font-size: 23px; }
  .pxo-opt__copy strong { font-size: 16px; }
  .pxo-opt__copy small { font-size: 12.5px; }
  .pxo__footer .__wrap { flex-wrap: wrap; }
  .pxo__footer .pxo__skip { position: static; order: 2; width: 100%; }
  .pxo__primary { width: 100%; }
  .pxo-path__top .pxo__progress { max-width: 220px; }
  .pxo-path__done { width: 30px; height: 30px; font-size: 14px; }
  .pxo-path__stage { padding: 24px 16px 20px; }
  .pxo-path__content { gap: 14px; }
  .pxo-path__hero {
    grid-template-columns: minmax(0, 1fr) 88px; gap: 12px;
    padding: 22px 20px; border-radius: 18px;
  }
  .pxo-path__hero h1 { font-size: 27px; }
  .pxo-path__hero p { grid-column: 1 / -1; font-size: 14px; line-height: 1.5; }
  .pxo-path__character { width: 88px; height: 88px; }
  .pxo-path__summary { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .pxo-path__summary-card { min-height: 76px; padding: 13px 14px; }
  .pxo-path__route { grid-template-columns: minmax(0, 1fr); gap: 22px; padding: 22px 20px; border-radius: 18px; }
  .pxo-path__section-head h2 { font-size: 21px; }
  .pxo-path__focus { padding: 13px 15px; }
  .pxo-path__primary { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .pxo__progressfill, .pxo-check, .pxo-gauge__fill { transition: none; }
  .pxo-type-cursor { animation: none; display: none; }
}
