/* ==========================================================
   Tutorial screens – scoped under .new-onboarding
   ========================================================== */

/* Shell */
.new-onboarding .shell {
  width: 100%;
  max-width: 393px;
  height: 100%;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, var(--white) 0%, var(--warm-cream) 100%);
}

/* ── Top bar ─────────────────────────────────────────────── */
.new-onboarding .tut-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 14px 20px 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 40;
  background: linear-gradient(180deg, var(--white) 70%, transparent);
}

.new-onboarding .tut-bk {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: var(--white);
  flex-shrink: 0;
}

.new-onboarding .tut-bk:active {
  opacity: .7;
}

.new-onboarding .tut-bk svg {
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
}

.new-onboarding .tut-ptr {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  overflow: hidden;
}

.new-onboarding .tut-pf {
  height: 100%;
  background: var(--coral);
  border-radius: 2px;
  transition: width .4s ease;
}

/* ── Pages strip ─────────────────────────────────────────── */
.new-onboarding .pages {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform .5s cubic-bezier(.4, 0, .2, 1);
}

.new-onboarding .pg {
  min-width: 100%;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── Copy screen (pg0) ───────────────────────────────────── */
.new-onboarding .copy {
  padding: 72px 28px 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100%;
}

.new-onboarding .c-line {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1.4s cubic-bezier(.25, .1, .25, 1),
              transform 1.4s cubic-bezier(.25, .1, .25, 1);
}

.new-onboarding .c-line.tut-vis {
  opacity: 1;
  transform: translateY(0);
}

.new-onboarding .c-name {
  font-family: var(--font-d);
  font-weight: 700;
  font-size: 38px;
  color: var(--coral);
  line-height: 1.1;
  letter-spacing: -.03em;
  margin-bottom: 18px;
}

.new-onboarding .c-main {
  font-family: var(--font-d);
  font-weight: 700;
  font-size: 32px;
  color: var(--text-primary);
  line-height: 1.15;
  letter-spacing: -.025em;
  margin-bottom: 28px;
}

.new-onboarding .c-sub {
  font-size: 17px;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* ── Tutorial screens ────────────────────────────────────── */
.new-onboarding .tut {
  padding: 56px 0 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
}

.new-onboarding .phone-wrap {
  position: relative;
  flex: 1;
  width: 100%;
  display: flex;
  align-items: stretch;
  justify-content: center;
  min-height: 0;
  padding: 0 20px;
}

.new-onboarding .phone-shell {
  position: relative;
  width: 100%;
  max-width: 280px;
  display: flex;
  flex-direction: column;
}

.new-onboarding .phone-shell::before {
  content: '';
  position: absolute;
  left: -3px;
  top: 72px;
  width: 3px;
  height: 28px;
  background: #C8C8CC;
  border-radius: 2px 0 0 2px;
  box-shadow: 0 36px 0 #C8C8CC, 0 68px 0 #C8C8CC;
}

.new-onboarding .phone-shell::after {
  content: '';
  position: absolute;
  right: -3px;
  top: 96px;
  width: 3px;
  height: 52px;
  background: #C8C8CC;
  border-radius: 0 2px 2px 0;
}

.new-onboarding .tut-phone {
  width: 100%;
  flex: 1;
  min-height: 0;
  border-radius: 44px;
  border: 8px solid #1A1A1E;
  background: var(--sand-light);
  overflow: hidden;
  position: relative;
  box-shadow: 0 0 0 1px #3A3A3C,
              0 2px 4px rgba(0, 0, 0, .3),
              0 12px 40px rgba(0, 0, 0, .22),
              0 24px 60px rgba(0, 0, 0, .12),
              inset 0 0 0 1px rgba(255, 255, 255, .08);
}

.new-onboarding .phone-island {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 72px;
  height: 20px;
  background: #1A1A1E;
  border-radius: 20px;
  z-index: 20;
}

.new-onboarding .phone-status {
  height: 44px;
  background: var(--white);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 20px 6px;
  position: relative;
  z-index: 10;
  flex-shrink: 0;
}

.new-onboarding .phone-status-time {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -.02em;
}

.new-onboarding .phone-status-icons {
  display: flex;
  align-items: center;
  gap: 5px;
}

.new-onboarding .phone-body {
  height: calc(100% - 44px - 50px);
  overflow: hidden;
  position: relative;
  isolation: isolate;
}

.new-onboarding .phone-scroll {
  padding: 12px 14px 60px;
  transition: transform .8s ease-in-out;
}

.new-onboarding .phone-nav {
  display: flex;
  border-top: none;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  padding: 5px 5px 12px;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 5;
  gap: 2px;
  box-shadow: 0 -0.5px 0 rgba(0, 0, 0, .1);
}

.new-onboarding .pnav {
  flex: 1;
  font-size: 8.5px;
  color: var(--text-muted);
  padding: 4px 2px;
  border-radius: 12px;
  font-weight: 600;
  letter-spacing: -.01em;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transition: color .2s ease, background .2s ease;
}

.new-onboarding .pnav svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
}

.new-onboarding .pnav.tut-on {
  color: var(--coral);
  background: rgba(245, 238, 232, .85);
}

.new-onboarding .pnav.tut-on svg {
  stroke-width: 2.2;
}

/* ── Callout bubble ──────────────────────────────────────── */
.new-onboarding .callout {
  position: absolute;
  left: 10px;
  right: 10px;
  padding: 10px 13px;
  border-radius: 12px;
  background: var(--coral);
  border: 1.5px solid var(--coral);
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .95),
              0 4px 16px rgba(239, 83, 80, .35),
              0 2px 8px rgba(0, 0, 0, .08);
  display: flex;
  align-items: flex-start;
  z-index: 20;
  pointer-events: none;
  opacity: 0;
  transform: scale(.85);
  transform-origin: 50% 100%;
  transition: opacity .32s cubic-bezier(.34, 1.56, .64, 1),
              transform .32s cubic-bezier(.34, 1.56, .64, 1),
              top .55s cubic-bezier(.4, 0, .2, 1);
}

.new-onboarding .callout.show {
  opacity: 1;
  transform: scale(1);
}

.new-onboarding .callout::after {
  content: "";
  position: absolute;
  bottom: -7px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 8px solid var(--coral);
}

.new-onboarding .callout.arrow-up {
  transform-origin: 50% 0;
}

.new-onboarding .callout.arrow-up::after {
  bottom: auto;
  top: -7px;
  border-top: none;
  border-bottom: 8px solid var(--coral);
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
}

.new-onboarding .callout-text {
  display: none;
  font-size: 11.5px;
  color: rgba(255, 255, 255, .9);
  line-height: 1.45;
  flex: 1;
}

.new-onboarding .callout-text strong {
  color: #fff;
  font-weight: 700;
}

/* ==========================================================
   App-preview components — ported from the redesign prototype
   (shared/styles.css), scaled to the mini demo phone. Scoped to
   .tut-phone so they never collide with the questionnaire screens.
   ========================================================== */

/* Page header */
.new-onboarding .tut-phone .tp-head { margin-bottom: 10px; }
.new-onboarding .tut-phone .tp-head.tp-center { text-align: center; }
.new-onboarding .tut-phone .tp-title {
  font-family: var(--font-d);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.025em;
  color: var(--text-primary);
  line-height: 1.15;
}
.new-onboarding .tut-phone .tp-sub {
  font-size: 9.5px;
  color: var(--text-secondary);
  margin-top: 2px;
  line-height: 1.4;
}
.new-onboarding .tut-phone .tp-coral { color: var(--coral); }

/* Small utilities (scoped) */
.new-onboarding .tut-phone .tp-mt { margin-top: 8px; }
.new-onboarding .tut-phone .tp-mb { margin-bottom: 8px; }
.new-onboarding .tut-phone .tp-between { display: flex; align-items: center; justify-content: space-between; }
.new-onboarding .tut-phone .tp-meta { font-size: 9px; color: var(--text-muted); }
.new-onboarding .tut-phone .tp-spark { font-size: 16px; opacity: .8; flex-shrink: 0; }
.new-onboarding .tut-phone .tp-spacer { height: 150px; }
.new-onboarding .tut-phone .tp-disclaimer {
  font-size: 8px;
  color: var(--text-hint);
  text-align: center;
  margin-top: 8px;
  line-height: 1.4;
}

/* Card */
.new-onboarding .tut-phone .card {
  background: var(--white);
  border-radius: 13px;
  padding: 11px 12px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
}
.new-onboarding .tut-phone .card.coral-fill { background: var(--coral); border-color: var(--coral); }
.new-onboarding .tut-phone .card.coral-glow-bg { background: var(--coral-glow); border-color: var(--coral-light); }
.new-onboarding .tut-phone .tp-hero { border-color: var(--green); box-shadow: 0 0 0 3px rgba(46, 125, 50, .10); }
.new-onboarding .tut-phone .card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.new-onboarding .tut-phone .card-title { font-size: 11.5px; font-weight: 700; color: var(--text-primary); }
.new-onboarding .tut-phone .card-subtitle { font-size: 9.5px; color: var(--text-secondary); margin-top: 2px; line-height: 1.4; }
.new-onboarding .tut-phone .coral-fill .card-title { color: var(--white); }
.new-onboarding .tut-phone .coral-fill .card-subtitle { color: rgba(255, 255, 255, .9); }

/* Section highlight driven by the animation controller (.hl) */
.new-onboarding .tut-phone [data-new-onboarding--tutorial-phone-target="section"] {
  outline: 1.5px solid transparent;
  outline-offset: 1px;
  border-radius: 13px;
  transition: outline-color .4s ease;
}
.new-onboarding .tut-phone [data-new-onboarding--tutorial-phone-target="section"].hl {
  outline-color: var(--coral);
}

/* Buttons */
.new-onboarding .tut-phone .btn {
  width: 100%;
  padding: 9px;
  border-radius: 11px;
  background: var(--coral);
  color: var(--white);
  font-family: var(--font-b);
  font-size: 11px;
  font-weight: 600;
  border: none;
  text-align: center;
}
.new-onboarding .tut-phone .btn-sm { width: auto; padding: 6px 13px; font-size: 9.5px; border-radius: 14px; }
.new-onboarding .tut-phone .tp-btn-onfill { background: var(--white); color: var(--coral); margin-top: 8px; }

/* Chip */
.new-onboarding .tut-phone .chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 8.5px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.new-onboarding .tut-phone .chip.coral { background: var(--coral-glow); color: var(--coral); }
.new-onboarding .tut-phone .chip.amber { background: #FEF3C7; color: #92400E; }
.new-onboarding .tut-phone .chip.green { background: #D1FAE5; color: #065F46; }

/* Rows */
.new-onboarding .tut-phone .row { display: flex; align-items: center; gap: 8px; padding: 6px 2px; }
.new-onboarding .tut-phone .row-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--sand-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-secondary);
}
.new-onboarding .tut-phone .row-icon.coral-bg { background: var(--coral-glow); color: var(--coral); }
.new-onboarding .tut-phone .row-body { flex: 1; min-width: 0; }
.new-onboarding .tut-phone .row-title { font-size: 10.5px; font-weight: 500; color: var(--text-primary); }
.new-onboarding .tut-phone .row-subtitle { font-size: 8.5px; color: var(--text-muted); margin-top: 1px; }
.new-onboarding .tut-phone .row-chevron { color: var(--text-hint); flex-shrink: 0; display: flex; }

/* Segments */
.new-onboarding .tut-phone .segments {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 6px;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to right, black 86%, transparent 100%);
  mask-image: linear-gradient(to right, black 86%, transparent 100%);
}
.new-onboarding .tut-phone .segments::-webkit-scrollbar { display: none; }
.new-onboarding .tut-phone .seg {
  padding: 5px 10px;
  border-radius: 14px;
  font-size: 9.5px;
  font-weight: 500;
  white-space: nowrap;
  background: var(--sand-light);
  color: var(--text-secondary);
  flex-shrink: 0;
}
.new-onboarding .tut-phone .seg.active { background: var(--coral); color: var(--white); font-weight: 600; }

/* Quick Add grid */
.new-onboarding .tut-phone .quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.new-onboarding .tut-phone .quick-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 9px 4px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--white);
}
.new-onboarding .tut-phone .qi-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--sand-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}
.new-onboarding .tut-phone .qi-label { font-size: 8px; font-weight: 500; color: var(--text-secondary); text-align: center; }

/* Mini chart */
.new-onboarding .tut-phone .mini-chart { display: flex; align-items: flex-end; gap: 2px; height: 42px; padding: 8px 0; }
.new-onboarding .tut-phone .mini-chart .bar { flex: 1; border-radius: 2px 2px 0 0; background: rgba(239, 83, 80, .33); min-width: 0; }
.new-onboarding .tut-phone .mini-chart .bar.active { background: var(--coral); }
.new-onboarding .tut-phone .mini-chart .bar.muted { background: #DDD3CA; }

/* Confidence bar */
.new-onboarding .tut-phone .confidence-bar { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.new-onboarding .tut-phone .confidence-track { flex: 1; height: 3px; border-radius: 2px; background: var(--border); overflow: hidden; }
.new-onboarding .tut-phone .confidence-fill { height: 100%; border-radius: 2px; background: var(--coral); }
.new-onboarding .tut-phone .confidence-label { font-size: 8.5px; font-weight: 500; color: var(--text-muted); white-space: nowrap; }

/* Signal summary */
.new-onboarding .tut-phone .signal-row { display: flex; align-items: center; gap: 8px; padding: 6px 9px; border-radius: 8px; background: var(--sand-light); margin-bottom: 4px; }
.new-onboarding .tut-phone .signal-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.new-onboarding .tut-phone .signal-dot.coral { background: var(--coral); }
.new-onboarding .tut-phone .signal-dot.amber { background: #F59E0B; }
.new-onboarding .tut-phone .signal-dot.green { background: var(--green); }
.new-onboarding .tut-phone .signal-dot.muted { background: var(--text-hint); }
.new-onboarding .tut-phone .signal-label { font-size: 9.5px; color: var(--text-secondary); flex: 1; }
.new-onboarding .tut-phone .signal-value { font-size: 9.5px; font-weight: 600; color: var(--text-primary); }

/* Today feed cards */
.new-onboarding .tut-phone .feed-card { display: flex; align-items: center; gap: 9px; padding: 7px 3px; }
.new-onboarding .tut-phone .feed-icon { width: 30px; height: 30px; border-radius: 9px; background: var(--sand-light); color: var(--text-secondary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.new-onboarding .tut-phone .feed-body { flex: 1; min-width: 0; }
.new-onboarding .tut-phone .feed-title { font-size: 10.5px; font-weight: 600; color: var(--text-primary); }
.new-onboarding .tut-phone .feed-subtitle { font-size: 9px; color: var(--text-muted); margin-top: 1px; }

/* State pills */
.new-onboarding .tut-phone .state-bar { display: flex; gap: 5px; flex-wrap: wrap; }
.new-onboarding .tut-phone .state-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 7px;
  font-size: 9px;
  font-weight: 500;
  background: var(--sand-light);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.new-onboarding .tut-phone .state-pill.urgent { background: var(--coral-glow); color: var(--coral); border-color: var(--coral-light); }

/* Guided cards */
.new-onboarding .tut-phone .guided-card { display: flex; align-items: center; gap: 10px; padding: 9px; border-radius: 11px; border: 1px solid var(--border); background: var(--white); margin-bottom: 6px; }
.new-onboarding .tut-phone .guided-icon { width: 36px; height: 36px; border-radius: 11px; background: var(--sand-light); color: var(--text-secondary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.new-onboarding .tut-phone .guided-body { flex: 1; min-width: 0; }
.new-onboarding .tut-phone .guided-name { font-size: 11px; font-weight: 600; color: var(--text-primary); }
.new-onboarding .tut-phone .guided-meta { font-size: 9px; color: var(--text-muted); margin-top: 1px; }
.new-onboarding .tut-phone .guided-tag { display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px; border-radius: 6px; font-size: 8px; font-weight: 600; background: var(--sand-light); color: var(--text-muted); margin-top: 4px; }

/* Report card */
.new-onboarding .tut-phone .report-card { background: var(--white); border: 1.5px solid var(--border); border-radius: 13px; padding: 11px 12px; margin-bottom: 8px; }
.new-onboarding .tut-phone .report-badge { display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 5px; font-size: 8px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.new-onboarding .tut-phone .report-ready { background: #D1FAE5; color: #065F46; }

/* Visit-prep progress + checklist */
.new-onboarding .tut-phone .prep-progress { display: flex; gap: 3px; margin: 8px 0 3px; }
.new-onboarding .tut-phone .prep-step { flex: 1; height: 3px; border-radius: 2px; background: var(--border); }
.new-onboarding .tut-phone .prep-step.done { background: var(--coral); }
.new-onboarding .tut-phone .prep-step.active { background: var(--coral-light); }
.new-onboarding .tut-phone .prep-label { font-size: 8.5px; color: var(--text-muted); }
.new-onboarding .tut-phone .checklist-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; margin-bottom: 4px; }
.new-onboarding .tut-phone .check-box { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--border); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.new-onboarding .tut-phone .check-box.checked { background: var(--coral); border-color: var(--coral); }
.new-onboarding .tut-phone .check-box svg { width: 11px; height: 11px; stroke: transparent; stroke-width: 2.5; }
.new-onboarding .tut-phone .check-box.checked svg { stroke: #fff; }
.new-onboarding .tut-phone .check-label { font-size: 9.5px; color: var(--text-secondary); flex: 1; }
.new-onboarding .tut-phone .check-label.done { text-decoration: line-through; color: var(--text-hint); }

/* Chat guide rows */
.new-onboarding .tut-phone .guide-row { display: flex; align-items: center; gap: 9px; padding: 7px 2px; margin-bottom: 2px; }
.new-onboarding .tut-phone .guide-row.tp-flat { padding: 0; margin-bottom: 0; }
.new-onboarding .tut-phone .guide-avatar { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.new-onboarding .tut-phone .guide-avatar.neutral { background: var(--sand-light); color: var(--text-secondary); }
.new-onboarding .tut-phone .guide-avatar.coral { background: var(--coral-glow); color: var(--coral); }
.new-onboarding .tut-phone .guide-body { flex: 1; min-width: 0; }
.new-onboarding .tut-phone .guide-name { font-size: 11px; font-weight: 600; color: var(--text-primary); }
.new-onboarding .tut-phone .guide-desc { font-size: 9px; color: var(--text-muted); margin-top: 1px; line-height: 1.35; }

/* Prompt chips */
.new-onboarding .tut-phone .group-label { font-size: 8.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-hint); margin-bottom: 6px; }
.new-onboarding .tut-phone .prompt-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.new-onboarding .tut-phone .prompt-chip { padding: 6px 10px; border-radius: 14px; font-size: 9.5px; font-weight: 500; color: var(--text-secondary); background: var(--sand-light); border: 1px solid var(--border); }

/* Chat input bar */
.new-onboarding .tut-phone .chat-input-bar { display: flex; align-items: center; gap: 6px; padding: 5px 5px 5px 12px; border-radius: 18px; border: 1px solid var(--border); background: var(--white); margin-top: 10px; }
.new-onboarding .tut-phone .chat-input-ph { flex: 1; font-size: 9.5px; color: var(--text-hint); }
.new-onboarding .tut-phone .chat-send { width: 26px; height: 26px; border-radius: 50%; background: var(--coral); color: var(--white); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* ── Bottom CTA ──────────────────────────────────────────── */
.new-onboarding .tut-bot {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  padding: 12px 24px 32px;
  background: linear-gradient(0deg, var(--warm-cream) 80%, transparent);
  z-index: 30;
}

.new-onboarding .tut-btn {
  width: 100%;
  padding: 15px;
  border-radius: 16px;
  background: var(--coral);
  color: var(--white);
  font-family: var(--font-b);
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.new-onboarding .tut-btn:active {
  transform: scale(.97);
}
