/* ==========================================================================
   #cp-app — "Your card, in your hand." The Card tab at real phone scale,
   light theme, tied to the accordion: the open item picks what the screen
   points at (data-focus on .cpa-scr: swipe | pocket | clear).
   ========================================================================== */

/* the phone: real scale on desktop, ~300px on phones, never cropped */
#cp-app .cpa-dev { --pw: clamp(300px, 27vw, 372px); display: flex; justify-content: center; }
#cp-app .cpa-phone { --pw: inherit; }
@media (max-width: 900px) {
  #cp-app .cpa-dev { --pw: min(340px, 46vw); margin-top: clamp(8px, 2vw, 24px); }
}
@media (max-width: 640px) {
  #cp-app .cpa-dev { --pw: min(300px, 78vw); }
}

/* ---------- Light theme (same token swap as #story) ------------------- */
#cp-app .phone-screen.app {
  --ink: #F5F7F4; --ink-2: #FFFFFF; --ink-3: #E3E7E2;
  --on-ink: #16211D; --on-ink-70: #4F5954; --on-ink-50: #6A736E; --on-ink-line: rgba(22,33,29,.11);
  --ax-line: rgba(22,33,29,.11); --ax-panel: #EEF1ED;
  --green-light: #0E6B4E; --amber-light: #A0640F;
}
#cp-app .app .a-navpill { background: rgba(255,255,255,.94); border-color: rgba(22,33,29,.1); box-shadow: 0 10px 24px -14px rgba(22,33,29,.35); }
#cp-app .app .a-navpill span.on { background: #16211D; color: #F5F7F4; }
#cp-app .app .a-fab { background: #16211D; color: #F5F7F4; }
#cp-app .ax-pill { background: #FFFFFF; }
#cp-app .hx-fade { background: linear-gradient(180deg, rgba(245,247,244,0), rgba(245,247,244,.94) 55%, #F5F7F4); }
#cp-app .app .live { background: #1F9E6E; box-shadow: none; }
#cp-app .cpa-mini .ccard { box-shadow: 0 8px 16px -10px rgba(22,33,29,.5), inset 0 0 0 1px rgba(255,255,255,.14); }

/* ---------- Screen (authored at 390 x 844) ----------------------------- */
#cp-app .cpa-title { font-family: var(--f-display); font-weight: 800; font-size: 26px; line-height: 1; letter-spacing: -0.035em; }
#cp-app .cpa-on { height: 30px; }

/* the card, small, as the first tile */
#cp-app .cpa-cardm { display: grid; grid-template-columns: 132px minmax(0, 1fr) auto; align-items: center; column-gap: 16px; padding: 14px var(--ax-px); }
#cp-app .cpa-mini { width: 132px; }
#cp-app .cpa-mini .ccard-in { padding: 9cqw 9cqw 8cqw; }
#cp-app .cpa-mini .ccard-brand { font-size: 11cqw; }
#cp-app .cpa-mini .ccard-nfc { width: 10cqw; height: 10cqw; }
#cp-app .cpa-mini .ccard-chip { width: 17cqw; }
#cp-app .cpa-mini .ccard-num { font-size: 8.4cqw; letter-spacing: .08em; margin-top: 0; }
#cp-app .cpa-mini .ccard-type { font-size: 7cqw; letter-spacing: .1em; opacity: .85; }
#cp-app .cpa-cardt-t { display: grid; gap: 7px; min-width: 0; }
#cp-app .cpa-cardt-t b { font-size: 16px; font-weight: 600; line-height: 1.1; }
#cp-app .cpa-num { font-size: 13.5px; line-height: 1; color: var(--on-ink-70); font-variant-numeric: tabular-nums; }

/* the cycle: open, covered by savings; no bars */
#cp-app .cpa-cyc .ax-m { padding: 16px var(--ax-px) 15px; }
#cp-app .cpa-cyc .ax-cyc-n { font-size: 52px; }

/* recent purchases, each tagged with the pocket that paid */
#cp-app .cpa-list { display: grid; padding: 0 var(--ax-px); }
#cp-app .cpa-li { height: 62px; }
#cp-app .cpa-li .ax-t > span { gap: 8px; overflow: visible; }
#cp-app .cpa-pk { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 8px 0 7px; border-radius: 999px; font-style: normal; font-size: 11.5px; font-weight: 600; line-height: 1; letter-spacing: .01em; }
#cp-app .cpa-pk::before { content: ""; width: 6px; height: 6px; border-radius: 1.5px; background: currentColor; }
#cp-app .cpa-pk.s { color: #0E6B4E; background: rgba(14,107,78,.1); }
#cp-app .cpa-pk.c { color: #24409E; background: rgba(36,64,158,.09); }
#cp-app .cpa-pk { outline: 1.5px solid transparent; outline-offset: 2px; transition: outline-color .35s var(--ease); }
#cp-app .cpa-cr { color: var(--on-ink-50); }
#cp-app .cpa-clr { position: relative; transition: background-color .35s var(--ease); }
#cp-app .cpa-clr::after { content: ""; position: absolute; inset: 0; border-radius: 0 0 var(--ax-r) var(--ax-r); box-shadow: inset 0 0 0 1.5px transparent; pointer-events: none; transition: box-shadow .35s var(--ease); }

/* the push note, over the top of the screen */
#cp-app .cpa-note {
  position: absolute; left: 10px; right: 10px; top: 58px; z-index: 6;
  display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: 12px; align-items: center;
  padding: 13px 16px 14px 13px; border-radius: 24px; background: #FFFFFF;
  border: 1px solid rgba(22,33,29,.08); box-shadow: 0 1px 2px rgba(22,33,29,.06), 0 18px 34px -14px rgba(22,33,29,.4);
  transform: translateY(-130%); opacity: 0;
  transition: transform .7s var(--ease), opacity .4s var(--ease);
}
#cp-app .cpa-note-i { width: 40px; height: 40px; border-radius: 11px; background: #16211D; color: #F5F7F4; display: grid; place-items: center; }
#cp-app .cpa-note-i svg { width: 21px; height: 21px; }
#cp-app .cpa-note-t { display: grid; gap: 2px; min-width: 0; color: #16211D; }
#cp-app .cpa-note-h { display: flex; justify-content: space-between; font-size: 12.5px; line-height: 1.2; color: #6A736E; margin-bottom: 1px; }
#cp-app .cpa-note-h span:first-child { font-weight: 600; color: #4F5954; letter-spacing: .01em; }
#cp-app .cpa-note-t b { font-size: 15px; font-weight: 600; line-height: 1.25; }
#cp-app .cpa-note-t > span:last-child { font-size: 14px; line-height: 1.25; color: #4F5954; white-space: nowrap; }

/* ---------- Focus: what the open accordion item points at ------------- */
#cp-app .cpa-dim, #cp-app .cpa-li .ax-ico, #cp-app .cpa-li .ax-t b, #cp-app .cpa-li .ax-a, #cp-app .cpa-cr { transition: opacity .4s var(--ease); }
#cp-app .cpa-li { transition: background-color .4s var(--ease); }

/* 1 — every swipe: the note slides down; the row it is about is marked */
#cp-app [data-focus="swipe"] .cpa-note { transform: none; opacity: 1; }
#cp-app .cpa-li.is-new { margin-inline: calc(var(--ax-px) * -1); padding-inline: var(--ax-px); }
#cp-app [data-focus="swipe"] .cpa-li.is-new { background: rgba(22,33,29,.035); }

/* 2 — which pocket: the tags ring, the rest steps back */
#cp-app [data-focus="pocket"] .cpa-dim,
#cp-app [data-focus="pocket"] .cpa-clr,
#cp-app [data-focus="pocket"] .cpa-li .ax-ico,
#cp-app [data-focus="pocket"] .cpa-li .ax-t b,
#cp-app [data-focus="pocket"] .cpa-li .ax-a,
#cp-app [data-focus="pocket"] .cpa-cr { opacity: .38; }
#cp-app [data-focus="pocket"] .cpa-pk { outline-color: currentColor; }

/* 3 — where it clears from: the footer row lifts, the rest steps back */
#cp-app [data-focus="clear"] .cpa-dim,
#cp-app [data-focus="clear"] .cpa-list { opacity: .38; }
#cp-app .cpa-list { transition: opacity .4s var(--ease); }
#cp-app [data-focus="clear"] .cpa-clr { background: #FFFFFF; color: var(--on-ink); }
#cp-app [data-focus="clear"] .cpa-clr::after { box-shadow: inset 0 0 0 1.5px #16211D; }
#cp-app [data-focus="clear"] .cpa-clr .ax-chev { color: var(--on-ink); }

@media (prefers-reduced-motion: reduce) {
  #cp-app .cpa-note, #cp-app .cpa-dim, #cp-app .cpa-list, #cp-app .cpa-pk, #cp-app .cpa-clr, #cp-app .cpa-clr::after { transition: none; }
}
