/* ── Approach Builder · Forecast redesign ─────────────────────────────────────
   Scoped under .ab2 so the design's Spectral/Inter + cream palette never leak
   into the rest of the funnel. Recreated from the handoff design
   (Approach Builder.dc.html + approach-builder-forecast-FRD.md §8).
   Branch accent colours are data-driven and passed inline; this file owns
   layout, the iMessage phone, the branch deck, tabs, pager, and loading/error. */

.ab2 {
  --ab-ink: #1d1418;
  --ab-muted: #7a666d;
  --ab-faint: #9a8890;
  --ab-rose: #b23a63;
  --ab-rose-deep: #7e2b50;
  --ab-line: rgba(40, 20, 30, 0.10);
  --ab-area: #0b0809;          /* iMessage thread bg — tail masks must match */
  --ab-recv: #262629;          /* received bubble */
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--ab-ink);
}
.ab2 .serif { font-family: 'Spectral', Georgia, serif; }

/* page background applied to body when this page is active */
.approach-page-body.ab2-bg {
  background:
    radial-gradient(120% 90% at 78% -8%, #fde7ee 0%, rgba(253,231,238,0) 46%),
    radial-gradient(90% 70% at 6% 4%, #fbeef0 0%, rgba(251,238,240,0) 40%),
    #f7f0ef;
}

.ab2-wrap { max-width: 1100px; margin: 0 auto; }

/* ── headers ── */
.ab2-head { text-align: center; margin-bottom: 30px; }
.ab2-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 600; letter-spacing: .13em; text-transform: uppercase;
  color: #bf4069; background: #fbe9ef; border: 1px solid #f2cdd9;
  padding: 7px 13px; border-radius: 999px;
}
.ab2-h1 {
  font-weight: 600; font-size: clamp(30px, 4.6vw, 46px); line-height: 1.05;
  letter-spacing: -.01em; margin: 16px 0 12px;
}
.ab2-sub { color: var(--ab-muted); font-size: 16px; line-height: 1.55; max-width: 560px; margin: 0 auto; }
.ab2-sub b { color: #3a2c32; font-weight: 500; }

/* ── two-column compose / analysis ── */
.ab2-cols { display: flex; flex-wrap: wrap; gap: 46px; align-items: flex-start; }
.ab2-col-form { flex: 1 1 380px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.ab2-col-phone { flex: 0 1 360px; min-width: 300px; display: flex; flex-direction: column; align-items: center; }

.ab2-card {
  background: #fff; border: 1px solid var(--ab-line); border-radius: 22px; padding: 22px;
  box-shadow: 0 1px 2px rgba(30,15,25,.04), 0 18px 44px -24px rgba(120,40,70,.30);
}
.ab2-intro {
  background: linear-gradient(155deg, #241016, #140a0e 70%); color: #fbe8ef;
  border-radius: 18px; padding: 18px 20px; box-shadow: 0 14px 34px -22px rgba(90,20,50,.7);
}
.ab2-intro .serif { font-size: 18px; line-height: 1.42; margin: 11px 0 0; }
.ab2-intro-eyebrow {
  display: inline-flex; align-items: center; font-size: 11px; font-weight: 600;
  letter-spacing: .13em; text-transform: uppercase; color: #f3b9cd;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
  padding: 7px 13px; border-radius: 999px;
}

.ab2-label { font-size: 13.5px; font-weight: 600; color: #3a2c32; margin-bottom: 10px; }
.ab2-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.ab2-chip {
  font-size: 13.5px; font-weight: 500; border-radius: 999px; padding: 9px 15px; cursor: pointer;
  transition: .16s; border: 1px solid transparent; background: #f4eeef; color: var(--ab-muted); white-space: nowrap;
}
.ab2-chip.sel { background: #fff; border-color: var(--ab-rose); color: var(--ab-rose); box-shadow: 0 0 0 3px #fbe9ef; }

.ab2-textarea {
  width: 100%; border: 1px solid var(--ab-line); border-radius: 14px; padding: 13px 14px;
  font-size: 14.5px; line-height: 1.5; color: var(--ab-ink); background: #fdf9fa; resize: vertical; min-height: 92px;
}
.ab2-textarea:focus { border-color: var(--ab-rose); }

.ab2-channels { display: flex; flex-wrap: wrap; gap: 16px; }
.ab2-channel { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; color: var(--ab-muted); }
.ab2-channel.sel { color: #3a2c32; font-weight: 500; }
.ab2-radio { width: 17px; height: 17px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid #cdbcc2; }
.ab2-channel.sel .ab2-radio { border-color: var(--ab-rose); }
.ab2-radio i { width: 8px; height: 8px; border-radius: 50%; background: transparent; display: block; }
.ab2-channel.sel .ab2-radio i { background: var(--ab-rose); }

.ab2-cta {
  width: 100%; border: none; cursor: pointer; color: #fff; font-weight: 600; font-size: 15.5px;
  padding: 16px; border-radius: 14px; background: linear-gradient(95deg, #8c2c52, #b23a63 55%, #c0436c);
  box-shadow: 0 12px 26px -12px rgba(150,40,80,.6); transition: transform .16s;
}
.ab2-cta:hover { transform: translateY(-1px); }
.ab2-cta:disabled { opacity: .7; cursor: default; transform: none; }
.ab2-fine { text-align: center; font-size: 12px; color: var(--ab-muted); margin-top: 14px; }
.ab2-err { margin-top: 10px; font-size: 13px; color: var(--ab-rose); }

/* ── analysis rows + draft cards ── */
.ab2-section-label { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: #bf4069; margin-bottom: 10px; }
.ab2-analysis-intro { font-size: 14.5px; line-height: 1.55; color: #3a2c32; margin: 0 0 18px; }
.ab2-arow { display: flex; flex-direction: column; gap: 3px; padding-left: 12px; border-left: 2px solid #f2cdd9; }
.ab2-arow + .ab2-arow { margin-top: 13px; }
.ab2-arow-label { font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: #9c5070; }
.ab2-arow-text { font-size: 13.5px; font-weight: 500; line-height: 1.45; color: #3a2c32; }

.ab2-drafts-title { font-size: 13.5px; font-weight: 600; color: #3a2c32; margin-bottom: 11px; }
.ab2-draft {
  width: 100%; text-align: left; cursor: pointer; border-radius: 16px; padding: 14px 15px; transition: .16s;
  background: #fff; border: 1.5px solid var(--ab-line); box-shadow: 0 1px 2px rgba(30,15,25,.04); display: block;
}
.ab2-draft + .ab2-draft { margin-top: 10px; }
.ab2-draft.sel { border-color: var(--ab-rose); box-shadow: 0 0 0 3px #fbe9ef; }
.ab2-draft-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.ab2-draft-label { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; color: #9a8890; }
.ab2-draft.sel .ab2-draft-label { color: var(--ab-rose); }
.ab2-draft-check {
  width: 18px; height: 18px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center;
  border: 1.5px solid #cdbcc2; background: transparent; color: #fff;
}
.ab2-draft.sel .ab2-draft-check { border-color: var(--ab-rose); background: var(--ab-rose); }
.ab2-draft-text { font-size: 13.5px; line-height: 1.5; color: #3a2c32; margin: 0; }

/* ── iMessage phone ── */
.ab2-phone {
  width: 100%; background: var(--ab-area); border-radius: 32px; padding: 0 0 14px; overflow: hidden;
  box-shadow: 0 24px 64px -34px rgba(70,15,40,.55), 0 2px 8px rgba(0,0,0,.16); border: 1px solid #1c1416;
}
.ab2-phone-status { display: flex; justify-content: space-between; align-items: center; padding: 9px 18px 3px; color: #fff; font-size: 12.5px; font-weight: 600; }
.ab2-phone-head { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 0 12px; border-bottom: .5px solid rgba(255,255,255,.10); }
.ab2-phone-avatar { width: 38px; height: 38px; border-radius: 50%; background: radial-gradient(circle at 32% 28%, #e87aa3, #9c2d59); }
.ab2-phone-name { color: #fff; font-size: 11.5px; font-weight: 600; display: flex; align-items: center; gap: 3px; opacity: .95; }
.ab2-phone-name span { color: #8a8a8e; font-weight: 400; }
.ab2-thread { padding: 14px 12px 6px; display: flex; flex-direction: column; min-height: 178px; }
.ab2-daystamp { text-align: center; font-size: 10.5px; color: #7c7c80; margin: 6px 0 10px; }
.ab2-daystamp b { color: #aaa; font-weight: 600; }
.ab2-delay { text-align: center; font-size: 10.5px; color: #7c7c80; margin: 11px 0 9px; }
.ab2-receipt { font-size: 10px; color: #8a8a8e; text-align: right; margin: 3px 4px 0; font-weight: 500; }

.ab2-bubble { position: relative; z-index: 1; max-width: 74%; padding: 8px 13px; border-radius: 18px; font-size: 14px; line-height: 1.36; }
.ab2-bubble.in { align-self: flex-start; background: var(--ab-recv); color: #f1eef0; }
.ab2-bubble.out { align-self: flex-end; background: linear-gradient(180deg, #e0568a, #bf3a6c); color: #fff; }
.ab2-bubble + .ab2-bubble { margin-top: 9px; }
/* tails — masked with the thread bg so no seam (FRD §8) */
.ab2-bubble.in::before { content: ''; position: absolute; z-index: -1; bottom: 0; left: -6px; width: 17px; height: 17px; background: var(--ab-recv); border-bottom-right-radius: 15px 13px; }
.ab2-bubble.in::after  { content: ''; position: absolute; z-index: -1; bottom: 0; left: -22px; width: 22px; height: 17px; background: var(--ab-area); border-bottom-right-radius: 9px; }
.ab2-bubble.out::before { content: ''; position: absolute; z-index: -1; bottom: 0; right: -6px; width: 17px; height: 17px; background: #bf3a6c; border-bottom-left-radius: 15px 13px; }
.ab2-bubble.out::after  { content: ''; position: absolute; z-index: -1; bottom: 0; right: -22px; width: 22px; height: 17px; background: var(--ab-area); border-bottom-left-radius: 9px; }
.ab2-phone-cap { text-align: center; font-size: 12px; color: var(--ab-muted); margin: 12px 6px 0; line-height: 1.5; }

/* ── tone bar (under draft phone) ── */
.ab2-tonebar { display: flex; gap: 7px; padding: 13px 14px; }
.ab2-tone {
  flex: 1; font-size: 12.5px; font-weight: 500; cursor: pointer; border-radius: 10px; padding: 9px 6px;
  transition: .15s; border: 1px solid transparent; color: var(--ab-muted); background: #f4eeef; text-align: center;
}
.ab2-tone.sel { color: var(--ab-rose); border-color: var(--ab-rose); background: #fbe9ef; }

/* ── forecast: tabs ── */
.ab2-tabs { display: flex; gap: 9px; justify-content: center; flex-wrap: wrap; margin-bottom: 26px; }
.ab2-tab {
  display: flex; align-items: center; gap: 9px; padding: 10px 15px; border-radius: 999px; cursor: pointer;
  font-size: 13px; transition: .16s; white-space: nowrap; font-weight: 500; color: var(--ab-muted);
  background: #fff; border: 1px solid var(--ab-line);
}
.ab2-tab .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.ab2-tab .pct { font-weight: 600; font-size: 12px; color: #9a8890; }

/* ── forecast: branch deck ── */
.ab2-deck { max-width: 480px; margin: 0 auto; position: relative; }
.ab2-branch {
  background: #fff; border: 1px solid var(--ab-line); border-radius: 24px; padding: 18px 18px 22px;
  box-shadow: 0 1px 2px rgba(30,15,25,.04), 0 18px 44px -24px rgba(120,40,70,.30),
    0 16px 0 -7px #fff, 0 16px 0 -6px var(--ab-line), 0 32px 0 -14px #fcf4f5, 0 32px 0 -13px var(--ab-line);
}
.ab2-branch-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.ab2-branch-name { display: flex; align-items: center; gap: 9px; font-size: 19px; font-weight: 600; white-space: nowrap; }
.ab2-branch-name .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.ab2-branch-tier { font-size: 12px; font-weight: 600; color: var(--ab-muted); white-space: nowrap; }
.ab2-branch-tier b { color: #3a2c32; }
.ab2-bar { height: 5px; border-radius: 5px; background: #efe6e8; overflow: hidden; margin-bottom: 16px; }
.ab2-bar i { display: block; height: 100%; border-radius: 5px; }
.ab2-meaning-label { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; color: #bf4069; margin: 18px 0 6px; }
.ab2-meaning { font-size: 14px; line-height: 1.5; color: #3a2c32; margin-bottom: 4px; }
.ab2-move-label { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; color: #bf4069; margin: 14px 0 9px; }
.ab2-move-wrap { display: flex; flex-direction: column; }
.ab2-move {
  position: relative; z-index: 1; align-self: flex-end; max-width: 92%; padding: 10px 14px; border-radius: 18px;
  background: linear-gradient(180deg, #e0568a, #bf3a6c); color: #fff; font-size: 14px; line-height: 1.42;
  box-shadow: 0 10px 22px -12px rgba(178,58,99,.55);
}
.ab2-copy { align-self: flex-end; margin-top: 10px; font-size: 12.5px; font-weight: 600; color: var(--ab-rose); background: none; border: none; cursor: pointer; }

/* ── pager + footer nav ── */
.ab2-pager { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 30px; }
.ab2-arrow { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--ab-line); background: #fff; cursor: pointer; display: grid; place-items: center; color: var(--ab-rose); font-size: 18px; line-height: 1; }
.ab2-dots { display: flex; gap: 7px; align-items: center; }
.ab2-dot { width: 7px; height: 7px; border-radius: 50%; background: #dcccd1; transition: .2s; cursor: pointer; }
.ab2-dot.sel { width: 22px; border-radius: 4px; background: var(--ab-rose); }
.ab2-footnav { display: flex; justify-content: center; gap: 24px; margin-top: 26px; }
.ab2-footnav button { font-size: 13.5px; font-weight: 500; color: var(--ab-rose); background: none; border: none; cursor: pointer; white-space: nowrap; }

/* ── loading + error ── */
.ab2-loading {
  max-width: 480px; margin: 48px auto; display: flex; flex-direction: column; align-items: center; gap: 22px;
  padding: 56px 28px; border-radius: 26px; background: var(--ab-area);
  background-image: radial-gradient(120% 90% at 0% 0%, rgba(178,58,99,0.34), transparent 55%);
  border: 1px solid rgba(255,255,255,0.06); box-shadow: 0 26px 64px -30px rgba(70,15,40,.7);
}
.ab2-loading-orb { position: relative; width: 58px; height: 58px; }
.ab2-loading-orb i { position: absolute; inset: 0; border-radius: 18px; background: linear-gradient(135deg, #d64d7d, #7e2b50); animation: ab2-pulse 1.8s ease-in-out infinite; box-shadow: 0 8px 28px rgba(178,58,99,0.4); }
.ab2-loading-title { font-size: 22px; font-weight: 600; color: #fff; text-align: center; }
.ab2-loading-sub { font-size: 13.5px; font-weight: 500; color: rgba(255,255,255,0.62); text-align: center; }
.ab2-loading-track { width: 200px; height: 4px; border-radius: 9999px; background: rgba(255,255,255,0.12); overflow: hidden; }
.ab2-loading-track i { display: block; width: 34%; height: 100%; border-radius: 9999px; background: linear-gradient(90deg, #d64d7d, #7e2b50); animation: ab2-bar 1.3s ease-in-out infinite; }
@keyframes ab2-pulse { 0%,100% { transform: scale(1); opacity: .92 } 50% { transform: scale(1.1); opacity: 1 } }
@keyframes ab2-bar { 0% { transform: translateX(-100%) } 100% { transform: translateX(320%) } }
@keyframes ab2-fade { from { transform: translateY(10px); opacity: 0 } to { transform: none; opacity: 1 } }
.ab2-rise { animation: ab2-fade .42s ease both; }

.ab2-errcard {
  max-width: 440px; margin: 64px auto; display: flex; flex-direction: column; align-items: center; gap: 18px;
  padding: 46px 28px; border-radius: 24px; background: #fff; border: 1px solid var(--ab-line);
  box-shadow: 0 1px 2px rgba(30,15,25,.04), 0 18px 44px -24px rgba(120,40,70,.30); text-align: center;
}
.ab2-errcard h2 { font-size: 21px; font-weight: 600; margin: 0; }

/* paywall reuses funnel chrome; keep it readable */
.ab2-paywall { max-width: 620px; margin: 0 auto; text-align: center; padding: 24px 0 48px; }

@media (max-width: 920px) {
  .ab2-cols { gap: 28px; }
  .ab2-col-phone { order: 2; width: 100%; }
}
