/* ================================================================
   Flip My Debt — candy-pop light-blue lead-gen
   ================================================================ */

:root {
  --sky:        #BFEBFF;
  --sky-2:      #A8E1FF;
  --sky-3:      #7FCFFF;
  --sky-deep:   #4FB8FF;
  --bubblegum:  #FF7EC8;
  --bubble-2:   #FFB3DE;
  --lemon:      #FFE56B;
  --lemon-2:    #FFC93A;
  --mint:       #B6F7D1;
  --peach:      #FFBE7B;
  --ink:        #1A2A50;
  --ink-soft:   #3A4A75;
  --cloud:      #ffffff;
  --shadow:     0 6px 0 #4FB8FF;
  --shadow-pink:0 6px 0 #D14E9C;
  --shadow-lem: 0 6px 0 #C99B00;
  --radius:     22px;
  --radius-sm:  14px;
  --maxw:       560px;
  --font:       'Fredoka', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 80% -10%, #E9F8FF 0%, transparent 60%),
    linear-gradient(180deg, var(--sky) 0%, var(--sky-2) 45%, var(--bubble-2) 100%);
  background-attachment: fixed;
  min-height: 100svh;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  padding: 24px 16px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

main#app {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--maxw);
  margin: auto 0;            /* vertically center when there's room */
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* =============== FLOATING BG COINS =============== */
.floaters {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.floater {
  position: absolute;
  width: 42px; height: 42px;
  opacity: .5;
  filter: drop-shadow(0 4px 0 rgba(26,42,80,.15));
  animation: floaterDrift 24s linear infinite;
}
.floater.f-a { top: 10%;  animation-duration: 26s; animation-delay: -3s;  }
.floater.f-b { top: 32%;  animation-duration: 22s; animation-delay: -9s;  width: 32px; height: 32px; }
.floater.f-c { top: 62%;  animation-duration: 30s; animation-delay: -15s; width: 50px; height: 50px; }
.floater.f-d { top: 78%;  animation-duration: 20s; animation-delay: -7s;  width: 36px; height: 36px; }
.floater.f-e { top: 48%;  animation-duration: 28s; animation-delay: -18s; }

@keyframes floaterDrift {
  0%   { transform: translate(-80px, 0)      rotate(0); }
  25%  { transform: translate(28vw, -18px)   rotate(360deg); }
  50%  { transform: translate(55vw, 6px)     rotate(720deg); }
  75%  { transform: translate(80vw, -18px)   rotate(1080deg); }
  100% { transform: translate(calc(100vw + 80px), 0) rotate(1440deg); }
}

/* =============== SKY / CLOUDS / SPARKLES =============== */
.sky {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.cloud {
  position: absolute;
  background: #fff;
  border-radius: 100px;
  opacity: .85;
  filter: drop-shadow(0 4px 0 rgba(26,42,80,.08));
  animation: drift linear infinite;
}
.cloud::before, .cloud::after {
  content: ""; position: absolute; background: #fff; border-radius: 100px;
}
.c1 { width: 140px; height: 36px; top: 8%;  left: -160px; animation-duration: 55s; }
.c1::before { width: 60px; height: 60px; top: -28px; left: 24px; }
.c1::after  { width: 44px; height: 44px; top: -18px; left: 74px; }
.c2 { width: 100px; height: 28px; top: 28%; left: -140px; animation-duration: 70s; animation-delay: -20s; opacity:.7; }
.c2::before { width: 40px; height: 40px; top: -20px; left: 16px; }
.c2::after  { width: 34px; height: 34px; top: -14px; left: 52px; }
.c3 { width: 180px; height: 44px; top: 58%; left: -200px; animation-duration: 85s; animation-delay: -40s; }
.c3::before { width: 70px; height: 70px; top: -34px; left: 28px; }
.c3::after  { width: 54px; height: 54px; top: -24px; left: 96px; }
.c4 { width: 120px; height: 32px; top: 78%; left: -160px; animation-duration: 60s; animation-delay: -10s; opacity:.75; }
.c4::before { width: 48px; height: 48px; top: -22px; left: 20px; }
.c4::after  { width: 40px; height: 40px; top: -18px; left: 60px; }
@keyframes drift { to { transform: translateX(120vw); } }

.sparkles span {
  position: absolute;
  top: var(--y);
  left: var(--x);
  width: 16px; height: 16px;
  background: radial-gradient(circle, #fff 0 30%, transparent 35%),
              conic-gradient(from 0deg, var(--lemon), var(--bubblegum), var(--sky-deep), var(--lemon));
  -webkit-mask: radial-gradient(circle at 50% 50%, #000 30%, transparent 32%) ,
                conic-gradient(#000 0 100%);
  border-radius: 50%;
  opacity: 0;
  animation: sparkle 3.2s infinite ease-in-out;
  animation-delay: var(--t);
}
.sparkles span::before, .sparkles span::after {
  content: ""; position: absolute; inset: 0;
  background: #fff;
  clip-path: polygon(50% 0, 55% 45%, 100% 50%, 55% 55%, 50% 100%, 45% 55%, 0 50%, 45% 45%);
}
@keyframes sparkle {
  0%, 100% { transform: scale(.2) rotate(0);   opacity: 0; }
  40%      { transform: scale(1)  rotate(90deg); opacity: 1; }
  60%      { transform: scale(1.1) rotate(180deg); opacity: 1; }
}

/* =============== LAYOUT =============== */
.screen { display: none; }
.screen.active { display: block; animation: bounce-in .55s cubic-bezier(.2,1.4,.4,1) both; }

@keyframes bounce-in {
  0%   { opacity: 0; transform: translateY(24px) scale(.7); }
  60%  { opacity: 1; transform: translateY(-6px) scale(1.06); }
  100% { opacity: 1; transform: translateY(0)   scale(1); }
}

/* =============== HERO =============== */
#screen-hero.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.hero-card {
  background: var(--cloud);
  border: 4px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px 24px;
  text-align: center;
  position: relative;
  width: 100%;
  transition: transform .4s cubic-bezier(.2,1.4,.3,1), box-shadow .3s ease;
}
.hero-card:hover {
  transform: rotate(-.6deg) translateY(-3px);
  box-shadow: 0 10px 0 var(--sky-deep);
}

/* --- 3D flippable coin --- */
.coin3d {
  all: unset;
  display: block;
  width: 140px; height: 140px;
  margin: 2px auto 10px;
  perspective: 1400px;
  cursor: grab;
  -webkit-tap-highlight-color: transparent;
  filter: drop-shadow(0 10px 0 rgba(26,42,80,.18));
}
.coin3d:active { cursor: grabbing; }
.coin3d:focus-visible {
  outline: 4px solid var(--sky-deep);
  outline-offset: 8px;
  border-radius: 50%;
}

/* Two nested wrappers so idle bob and flip-spin don't fight for the transform */
.coin3d-bob {
  display: block;
  width: 100%; height: 100%;
  animation: coinBob 3.6s ease-in-out infinite;
  will-change: transform;
}
.coin3d-inner {
  position: relative;
  display: block;
  width: 100%; height: 100%;
  transform-style: preserve-3d;
  animation: coinTilt 5s ease-in-out infinite;
  will-change: transform;
}
.coin3d-face {
  position: absolute; inset: 0;
  display: block;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.coin3d-face svg { width: 100%; height: 100%; display: block; }
.coin3d-back { transform: rotateY(180deg); }

/* Idle: outer bob (Y + scale) */
@keyframes coinBob {
  0%, 100% { transform: translateY(0)    scale(1); }
  50%      { transform: translateY(-8px) scale(1.02); }
}

/* Idle: inner gentle tilt — small range so flip start barely snaps */
@keyframes coinTilt {
  0%   { transform: rotateY(0deg); }
  50%  { transform: rotateY(14deg); }
  100% { transform: rotateY(0deg); }
}

/* Hover speeds the idle up slightly */
.coin3d:hover .coin3d-bob  { animation-duration: 2.2s; }
.coin3d:hover .coin3d-inner { animation-duration: 3s;   }

/* CLICK FLIP — bob does the ease-out hop, inner does a perfectly even linear spin */
.coin3d.flipping .coin3d-bob   { animation: coinHop   .9s cubic-bezier(.2,.9,.25,1) both; }
.coin3d.flipping .coin3d-inner { animation: coinSpin  .9s linear both; }

@keyframes coinHop {
  0%   { transform: translateY(0)     scale(1); }
  40%  { transform: translateY(-44px) scale(1.12); }
  70%  { transform: translateY(-28px) scale(1.06); }
  100% { transform: translateY(0)     scale(1); }
}
/* evenly-spaced rotation keyframes → constant angular velocity → smooth */
@keyframes coinSpin {
  0%   { transform: rotateY(0deg);    }
  25%  { transform: rotateY(450deg);  }
  50%  { transform: rotateY(900deg);  }
  75%  { transform: rotateY(1350deg); }
  100% { transform: rotateY(1800deg); }
}

h1 {
  font-size: clamp(2.2rem, 8.5vw, 3.6rem);
  line-height: 1;
  margin: 4px 0 12px;
  letter-spacing: -0.02em;
  font-weight: 700;
  display: flex;
  flex-wrap: wrap;
  gap: .12em .2em;
  justify-content: center;
  padding: .15em 0;
}
h1 span {
  display: inline-block;
  animation: wiggle 2.8s ease-in-out infinite;
  transform-origin: 50% 80%;
  text-shadow: 2px 3px 0 var(--ink);
}
h1 .w1 { color: var(--bubblegum); animation-delay: 0s; }
h1 .w2 { color: var(--sky-deep);  animation-delay: .2s; }
h1 .w3 { color: var(--lemon-2);   animation-delay: .4s; }

@keyframes wiggle {
  0%, 100% { transform: rotate(-2deg) translateY(0); }
  50%      { transform: rotate(2deg)  translateY(-2px); }
}

.lede {
  font-size: 1.05rem;
  color: var(--ink-soft);
  margin: 8px 0 20px;
  line-height: 1.4;
}
.lede b { color: var(--ink); }

.trust {
  list-style: none; padding: 0; margin: 16px 0 4px;
  display: flex; gap: 6px; justify-content: center; flex-wrap: wrap;
  font-size: .8rem;
  font-weight: 600;
}
.trust li {
  background: var(--mint);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 4px 10px;
  box-shadow: 0 2px 0 var(--ink);
  white-space: nowrap;
}
.trust b { color: var(--bubblegum); }

/* =============== BUTTONS =============== */
.cta {
  appearance: none;
  border: 3px solid var(--ink);
  background: var(--lemon);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 700;
  font-size: 1.05rem;
  padding: 14px 22px;
  border-radius: 16px;
  box-shadow: var(--shadow-lem);
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 10px;
  transition: transform .12s ease, box-shadow .12s ease, background .2s ease;
  text-decoration: none;
}
.cta:hover { transform: translateY(-2px) rotate(-1deg); }
.cta:active { transform: translateY(4px); box-shadow: 0 2px 0 #C99B00; }
.cta:focus-visible { outline: 4px solid var(--sky-deep); outline-offset: 3px; }
.cta svg { transition: transform .3s ease; }
.cta:hover svg { transform: translateX(4px) rotate(-8deg); }
.cta.big:hover svg { transform: translateX(6px) rotate(-15deg) scale(1.1); }

.cta.big {
  font-size: 1.2rem;
  padding: 16px 26px;
  background: var(--bubblegum);
  color: #fff;
  box-shadow: var(--shadow-pink);
  animation: heartbeat 2.6s ease-in-out infinite;
}
.cta.big:active { box-shadow: 0 2px 0 #D14E9C; }
@keyframes heartbeat {
  0%, 70%, 100% { transform: scale(1); }
  78%           { transform: scale(1.04); }
  86%           { transform: scale(.99); }
  92%           { transform: scale(1.02); }
}

.cta.ghost {
  background: #fff;
  box-shadow: 0 5px 0 var(--ink);
}
.cta.ghost:active { box-shadow: 0 2px 0 var(--ink); }

/* =============== QUIZ =============== */
.quiz { width: 100%; }
.quiz .screen { width: 100%; }

.progress-wrap {
  display: none;
  margin: 4px auto 22px;
  max-width: var(--maxw);
  padding: 0 4px;
}
.quiz.live .progress-wrap { display: block; }

.progress-track {
  position: relative;
  height: 14px;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 4px 0 var(--ink);
  overflow: visible;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--lemon), var(--bubblegum), var(--sky-deep));
  background-size: 200% 100%;
  border-radius: 999px;
  transition: width .6s cubic-bezier(.2,1.4,.4,1);
  animation: shimmer 3s linear infinite;
}
@keyframes shimmer { to { background-position: 200% 0; } }

.progress-coin {
  position: absolute;
  top: -10px;
  left: 0;
  transition: left .6s cubic-bezier(.2,1.4,.4,1);
  animation: coin-bob .6s ease-in-out infinite;
}
@keyframes coin-bob {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50%      { transform: translateY(-4px) rotate(6deg); }
}
.progress-label {
  display: block;
  text-align: center;
  font-size: .85rem;
  color: var(--ink-soft);
  margin-top: 8px;
  font-weight: 600;
}

.card {
  background: #fff;
  border: 4px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 20px 22px;
}
.card h2 {
  margin: 0 0 6px;
  font-size: clamp(1.35rem, 4.8vw, 1.75rem);
  line-height: 1.18;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.card h2 .hint {
  display: block;
  font-size: .78rem;
  color: var(--ink-soft);
  font-weight: 500;
  margin-top: 2px;
}
.sub { margin: 0 0 18px; color: var(--ink-soft); font-size: .92rem; line-height: 1.4; }

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.grid.faces { grid-template-columns: 1fr 1fr; }

.chip, .bubble, .face {
  appearance: none;
  border: 3px solid var(--ink);
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 14px 12px;
  font-family: var(--font);
  font-weight: 600;
  font-size: 1rem;
  color: var(--ink);
  cursor: pointer;
  text-align: center;
  box-shadow: 0 5px 0 var(--ink);
  transition: transform .12s ease, box-shadow .12s ease, background .2s ease;
  position: relative;
}
.chip:hover, .bubble:hover, .face:hover { transform: translateY(-2px) rotate(-1deg); background: var(--lemon); }
.chip:active, .bubble:active, .face:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--ink); }
.chip:focus-visible, .bubble:focus-within, .face:focus-visible { outline: 4px solid var(--sky-deep); outline-offset: 3px; }

.chip.selected, .face.selected {
  background: var(--bubblegum);
  color: #fff;
  animation: pop .45s cubic-bezier(.2,1.6,.4,1);
  transform: translateY(-2px) rotate(-1deg);
  box-shadow: 0 7px 0 #D14E9C;
}
/* Keep selected/checked styling when hovering or pressing — don't let base
   :hover/:active rules repaint them the default colors. */
.chip.selected:hover, .face.selected:hover {
  background: var(--bubblegum);
  transform: translateY(-3px) rotate(-1deg);
  box-shadow: 0 8px 0 #D14E9C;
}
.chip.selected:active, .face.selected:active {
  transform: translateY(2px) rotate(-1deg);
  box-shadow: 0 2px 0 #D14E9C;
}
.bubble.checked:hover {
  background: var(--sky-2);
  transform: translateY(-3px) rotate(-1deg);
  box-shadow: 0 8px 0 #2E8FD6;
}
.bubble.checked:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #2E8FD6;
}
.bubble.checked { box-shadow: 0 6px 0 #2E8FD6; }
.chip, .bubble, .face { position: relative; overflow: visible; }
.chip.selected::after, .face.selected::after, .bubble.checked::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: inherit;
  pointer-events: none;
  background:
    radial-gradient(circle at 10% 20%, var(--lemon) 2px, transparent 3px),
    radial-gradient(circle at 90% 15%, var(--sky-deep) 2px, transparent 3px),
    radial-gradient(circle at 80% 90%, var(--mint) 2px, transparent 3px),
    radial-gradient(circle at 15% 85%, #fff 2px, transparent 3px);
  animation: sparkleBurst .6s ease-out forwards;
}
@keyframes sparkleBurst {
  0%   { transform: scale(.5); opacity: 0; }
  40%  { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1.4); opacity: 0; }
}

.bubble {
  display: flex; align-items: center; justify-content: center;
  user-select: none;
}
.bubble input {
  position: absolute; opacity: 0; pointer-events: none;
}
.bubble.checked { background: var(--sky-2); animation: pop .35s cubic-bezier(.2,1.6,.4,1); }
.bubble.checked span::before { content: "✓ "; color: var(--bubblegum); font-weight: 900; }

@keyframes pop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.12) rotate(-2deg); }
  100% { transform: scale(1); }
}

.face {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 10px;
}
.face svg { width: 56px; height: 56px; }

/* slider */
.slider-wrap { padding: 10px 4px 4px; }
.slider-label {
  text-align: center;
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--bubblegum);
  margin-bottom: 10px;
  min-height: 2rem;
  animation: pop .3s ease;
}
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  background: transparent;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 14px; border-radius: 999px;
  background: linear-gradient(90deg, var(--sky-2), var(--lemon), var(--mint));
  border: 3px solid var(--ink);
  box-shadow: 0 4px 0 var(--ink);
}
input[type="range"]::-moz-range-track {
  height: 14px; border-radius: 999px;
  background: linear-gradient(90deg, var(--sky-2), var(--lemon), var(--mint));
  border: 3px solid var(--ink);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 34px; height: 34px;
  margin-top: -13px;
  background: var(--bubblegum);
  border: 3px solid var(--ink);
  border-radius: 50%;
  box-shadow: 0 4px 0 #D14E9C;
  cursor: grab;
}
input[type="range"]::-moz-range-thumb {
  width: 34px; height: 34px;
  background: var(--bubblegum);
  border: 3px solid var(--ink);
  border-radius: 50%;
  cursor: grab;
}
.slider-ticks {
  display: flex; justify-content: space-between;
  margin-top: 12px; font-size: .75rem; color: var(--ink-soft);
  font-weight: 600;
}

/* row of back/next */
.row { display: flex; gap: 10px; margin-top: 18px; justify-content: space-between; }
.row .cta { flex: 1; justify-content: center; }

/* =============== FORM FIELDS =============== */
.field { display: block; margin: 0 0 14px; }
.field > span { display: block; font-weight: 600; margin-bottom: 6px; font-size: .95rem; }
.field > span em { color: var(--ink-soft); font-style: normal; font-weight: 500; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 14px;
  border: 3px solid var(--ink);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 1rem;
  color: var(--ink);
  background: #fff;
  box-shadow: inset 0 -4px 0 rgba(26,42,80,.08);
}
.field textarea { resize: vertical; min-height: 70px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 4px solid var(--sky-deep); outline-offset: 2px;
  background: #FFFDF0;
}
.consent {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--sky);
  border: 3px solid var(--ink);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: .85rem;
  line-height: 1.35;
  margin: 8px 0 10px;
  cursor: pointer;
}
.consent input { margin-top: 3px; transform: scale(1.3); accent-color: var(--bubblegum); }
.err {
  background: #FFE3E9; border: 3px solid #D14E9C; color: #8A2D6B;
  padding: 10px 12px; border-radius: var(--radius-sm); margin: 10px 0;
  font-weight: 600; font-size: .9rem;
}

/* =============== CONFETTI =============== */
.confetti {
  position: fixed;
  top: -20px;
  left: var(--x, 50vw);
  width: 10px; height: 14px;
  border-radius: 2px;
  z-index: 9999;
  pointer-events: none;
  animation: confetti-fall var(--d, 2s) cubic-bezier(.3,.6,.4,1) forwards;
  transform: rotate(var(--r, 0deg));
}
@keyframes confetti-fall {
  0%   { transform: translate3d(0,0,0) rotate(var(--r)); opacity: 1; }
  100% { transform: translate3d(var(--dx, 0), 110vh, 0) rotate(calc(var(--r) + 720deg)); opacity: 1; }
}

/* =============== DONE =============== */
#screen-done.active {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.done-card { padding-top: 22px; }
.flipcoin {
  width: 150px; height: 150px;
  margin: 0 auto 10px;
  perspective: 900px;
}
.flipcoin-inner {
  position: relative;
  width: 100%; height: 100%;
  transform-style: preserve-3d;
  animation: coin-flip 2.2s cubic-bezier(.3,1.3,.5,1) forwards, coin-spin 6s 2.2s linear infinite;
}
.flipcoin-face {
  position: absolute; inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.flipcoin-face.back { transform: rotateY(180deg); }
@keyframes coin-flip {
  0%   { transform: rotateY(0) scale(.4); }
  100% { transform: rotateY(1800deg) scale(1); }
}
@keyframes coin-spin {
  0%   { transform: rotateY(1800deg); }
  100% { transform: rotateY(2160deg); }
}
.tiny { font-size: .85rem; color: var(--ink-soft); margin-top: 10px; }

/* =============== FOOTER =============== */
.foot {
  position: relative; z-index: 1;
  width: 100%; max-width: var(--maxw);
  margin: 30px auto 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.foot small { display: block; line-height: 1.5; }
.foot small { color: var(--ink-soft); font-size: .75rem; line-height: 1.4; }
.foot a {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 2px solid var(--sky-deep);
  padding-bottom: 1px;
  transition: color .15s ease, border-color .15s ease;
}
.foot a:hover { color: var(--bubblegum); border-bottom-color: var(--bubblegum); }

/* =============== BRAND LOCKUP =============== */
.brandbar {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px 8px 10px;
  margin: 0 auto 18px;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 4px 0 var(--ink);
  text-decoration: none;
  align-self: center;
  transition: transform .18s ease, box-shadow .18s ease;
}
.brandbar:hover {
  transform: translateY(-2px) rotate(-1deg);
  box-shadow: 0 6px 0 var(--ink);
}
.brandbar:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--ink);
}
.brandbar-logo {
  width: 34px; height: 34px;
  animation: coinTilt 5s ease-in-out infinite;
  transform-origin: 50% 50%;
}
.brandbar-text {
  display: inline-flex;
  gap: .15em;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1;
}
.brandbar-text span {
  display: inline-block;
  animation: wiggle 2.8s ease-in-out infinite;
  transform-origin: 50% 80%;
  text-shadow: 1.5px 2px 0 var(--ink);
}
.brandbar-text .w1 { color: var(--bubblegum); animation-delay: 0s; }
.brandbar-text .w2 { color: var(--sky-deep);  animation-delay: .2s; }
.brandbar-text .w3 { color: var(--lemon-2);   animation-delay: .4s; }

/* =============== PORTAL =============== */
body.portal-body { padding: 28px 18px 60px; }
body.portal-body main#app {
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
}

/* ---- hero / title ---- */
.portal-hero {
  text-align: center;
  margin: 8px 0 26px;
  padding: 0 4px;
}
.portal-eyebrow {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .22em;
  color: var(--sky-deep);
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 3px 12px;
  margin: 0 0 10px;
  box-shadow: 0 2px 0 var(--ink);
}
.portal-title {
  font-size: clamp(1.7rem, 5vw, 2.2rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.02em;
  margin: 0 0 10px;
  color: var(--ink);
}
.portal-lede {
  margin: 0 auto;
  max-width: 540px;
  font-size: .98rem;
  line-height: 1.5;
  color: var(--ink-soft);
}
.portal-lede b { color: var(--ink); }

/* ---- summary card ---- */
.portal-summary {
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 20px;
  box-shadow: 0 5px 0 var(--ink);
  padding: 22px;
  margin: 0 0 20px;
  animation: bounce-in .45s cubic-bezier(.2,1.4,.4,1) both;
}
.summary-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: stretch;
}
@media (min-width: 640px) {
  .summary-hero { grid-template-columns: 1.15fr 1fr; gap: 28px; }
}
.summary-hero-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}
.summary-label {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 6px;
}
.summary-amount {
  display: block;
  font-size: clamp(2.4rem, 8vw, 3.4rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.03em;
  color: var(--ink);
}
.summary-eta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--sky);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 4px 12px;
  align-self: flex-start;
}
.summary-eta svg { color: var(--sky-deep); }
.summary-bar {
  margin: 16px 0 0;
  height: 10px;
  background: #F0F3F8;
  border: 2px solid var(--ink);
  border-radius: 999px;
  overflow: hidden;
}
.summary-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--mint), var(--sky-deep), var(--bubblegum));
  background-size: 200% 100%;
  animation: shimmer 4s linear infinite;
  transition: width .6s cubic-bezier(.2,1.4,.4,1);
  width: 0%;
}

.summary-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  align-content: center;
}
.summary-stats .stat {
  background: #F8FAFE;
  border: 2px solid var(--ink);
  border-radius: 12px;
  padding: 10px 12px;
  text-align: left;
}
.summary-stats .stat b {
  display: block;
  font-size: 1.1rem;
  line-height: 1.1;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -.01em;
}
.summary-stats .stat span {
  display: block;
  font-size: .68rem;
  color: var(--ink-soft);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-top: 3px;
}

/* ---- toolbar (add button) ---- */
.portal-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 0 0 22px;
  padding: 14px 16px;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 16px;
  box-shadow: 0 4px 0 var(--ink);
}
.portal-toolbar-sub {
  font-size: .88rem;
  color: var(--ink-soft);
  flex: 1;
  min-width: 0;
}

.btn-primary {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--ink);
  color: #fff;
  border: 2px solid var(--ink);
  border-radius: 10px;
  font-family: var(--font);
  font-weight: 700;
  font-size: .95rem;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(26,42,80,.3);
  transition: transform .15s ease, box-shadow .15s ease, background .2s ease;
  white-space: nowrap;
}
.btn-primary:hover {
  background: #2A3D6C;
  transform: translateY(-1px);
  box-shadow: 0 4px 0 rgba(26,42,80,.35);
}
.btn-primary:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 rgba(26,42,80,.3);
}
.btn-primary svg {
  display: block;
  flex-shrink: 0;
}

/* ---- empty state ---- */
.empty-state {
  text-align: center;
  padding: 36px 20px;
  color: var(--ink-soft);
  font-size: .98rem;
  background: #fff;
  border: 3px dashed rgba(26,42,80,.25);
  border-radius: 16px;
  margin: 0 0 20px;
}
.empty-state svg {
  animation: floatPortal 3.4s ease-in-out infinite;
  filter: drop-shadow(0 6px 0 rgba(26,42,80,.12));
  margin-bottom: 14px;
}
.empty-state p { margin: 0; line-height: 1.5; }
.empty-state b { color: var(--ink); font-weight: 700; }
@keyframes floatPortal {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50%      { transform: translateY(-6px) rotate(3deg); }
}

/* ---- debt form ---- */
.debt-form {
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 20px;
  box-shadow: 0 5px 0 var(--ink);
  padding: 26px 24px 22px;
  margin: 0 0 22px;
  animation: bounce-in .4s cubic-bezier(.2,1.4,.4,1) both;
}
.debt-form h2 {
  margin: 0 0 18px;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -.01em;
}
.debt-form .field { margin-bottom: 16px; }
.debt-form .field:last-of-type { margin-bottom: 0; }
.debt-form .field-label,
.debt-form .field > span {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: .9rem;
  color: var(--ink);
}
.debt-form .field > span em,
.debt-form .field-label em {
  color: var(--ink-soft);
  font-style: normal;
  font-weight: 500;
  font-size: .85rem;
}
.debt-form .field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.debt-form input,
.debt-form textarea,
.debt-form select {
  padding: 12px 14px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  font-size: .95rem;
  box-shadow: none;
  background: #FBFCFF;
}
.debt-form input:focus,
.debt-form textarea:focus {
  background: #fff;
  outline: 3px solid var(--sky-deep);
  outline-offset: 1px;
}
.grid-type {
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.grid-type .chip {
  padding: 9px 6px;
  font-size: .78rem;
  box-shadow: 0 2px 0 var(--ink);
  border-width: 2px;
  border-radius: 10px;
}
.grid-type .chip:active { box-shadow: 0 0 0 var(--ink); }
@media (max-width: 520px) {
  .grid-type { grid-template-columns: repeat(2, 1fr); }
}

.prefix-input {
  position: relative;
  display: flex;
  align-items: center;
}
.prefix-input .prefix {
  position: absolute;
  left: 14px;
  font-weight: 700;
  color: var(--ink-soft);
  pointer-events: none;
}
.prefix-input input { padding-left: 28px; }

/* ---- photo capture ---- */
.photo-field { margin-top: 4px; }
.photo-capture {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.photo-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: #F8FAFE;
  font-weight: 700;
  font-size: .9rem;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--ink);
  transition: transform .15s ease, box-shadow .15s ease, background .2s ease;
}
.photo-btn:hover { background: var(--sky); transform: translateY(-1px); box-shadow: 0 4px 0 var(--ink); }
.photo-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.photo-preview {
  position: relative;
  width: 72px; height: 72px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  box-shadow: 0 3px 0 var(--ink);
  overflow: hidden;
  background: #F6F6F6;
}
.photo-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-x {
  position: absolute;
  top: -8px; right: -8px;
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: var(--bubblegum);
  color: #fff;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 0 var(--ink);
}

.debt-form .row {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid #EAEEF5;
}

/* ---- debt list ---- */
.debt-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 0 0 22px;
}
@media (min-width: 640px) {
  .debt-list { grid-template-columns: repeat(2, 1fr); }
}

.debt-card {
  background: #fff;
  border: 2px solid var(--ink);
  border-left: 6px solid var(--pri, var(--sky-deep));
  border-radius: 14px;
  box-shadow: 0 3px 0 rgba(26,42,80,.12);
  padding: 16px 16px 14px;
  position: relative;
  animation: bounce-in .35s cubic-bezier(.2,1.4,.4,1) both;
  transition: transform .18s ease, box-shadow .18s ease;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.debt-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 0 rgba(26,42,80,.14);
}
.debt-badge {
  position: absolute;
  top: 12px; right: 12px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--pri, var(--lemon));
  border: 2px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .8rem;
  color: var(--ink);
  box-shadow: none;
}
.debt-top {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  padding-right: 34px;
}
.debt-type {
  display: inline-block;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 3px 10px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  color: var(--ink);
}
.debt-balance {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -.02em;
  line-height: 1;
  text-shadow: none;
  display: block;
  margin-left: auto;
  margin-right: 0;
  order: 2;
}
.debt-creditor {
  font-size: 1.02rem;
  font-weight: 700;
  margin: 2px 0 8px;
  line-height: 1.25;
  word-break: break-word;
  color: var(--ink);
}
.debt-meta {
  list-style: none;
  padding: 0;
  margin: 0 0 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: .82rem;
  color: var(--ink-soft);
}
.debt-meta li { white-space: nowrap; }
.debt-meta b { color: var(--ink); font-weight: 700; }
.debt-notes {
  margin: 10px 0 0;
  font-size: .82rem;
  color: var(--ink-soft);
  line-height: 1.4;
  background: #FBF8EA;
  border-left: 3px solid var(--lemon-2);
  padding: 7px 10px;
  border-radius: 6px;
}
.debt-photo {
  all: unset;
  cursor: zoom-in;
  display: block;
  margin-top: 10px;
  width: 60px; height: 60px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  overflow: hidden;
  transition: transform .15s ease;
}
.debt-photo:hover { transform: scale(1.05); }
.debt-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.debt-actions {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #EEF1F7;
}
.mini-btn {
  appearance: none;
  border: 1.5px solid rgba(26,42,80,.25);
  background: #fff;
  border-radius: 8px;
  padding: 5px 12px;
  font-family: var(--font);
  font-size: .78rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  box-shadow: none;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.mini-btn:hover { border-color: var(--ink); background: #F8FAFE; }
.mini-btn.delete:hover { background: #FFF0F4; color: #B83264; border-color: #E07CA8; }
.mini-btn.edit:hover { background: var(--sky); border-color: var(--sky-deep); }

/* ---- strategy ---- */
.strategy-wrap {
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 20px;
  box-shadow: 0 5px 0 var(--ink);
  padding: 22px;
  margin: 0 0 20px;
}
.strategy-wrap h3 {
  margin: 0 0 14px;
  font-size: 1.05rem;
  font-weight: 700;
  text-align: left;
  letter-spacing: -.005em;
}
.grid-strategy {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
@media (max-width: 560px) { .grid-strategy { grid-template-columns: 1fr; } }
.strategy-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px;
  text-align: left;
  background: #F8FAFE;
  border: 2px solid var(--ink);
  border-radius: 12px;
  cursor: pointer;
  box-shadow: none;
  transition: background .15s ease, transform .15s ease;
}
.strategy-chip:hover { background: var(--sky); transform: translateY(-1px); }
.strategy-chip.selected,
.chip.selected.strategy-chip {
  background: var(--ink);
  color: #fff;
  transform: none;
  box-shadow: 0 3px 0 rgba(26,42,80,.3);
}
.strategy-chip.selected:hover,
.chip.selected.strategy-chip:hover {
  background: #2A3D6C;
  transform: translateY(-1px);
  box-shadow: 0 4px 0 rgba(26,42,80,.35);
}
.strategy-chip span { display: flex; flex-direction: column; line-height: 1.2; }
.strategy-chip b { font-size: .92rem; font-weight: 700; }
.strategy-chip em {
  font-style: normal;
  font-size: .72rem;
  color: var(--ink-soft);
  font-weight: 500;
  margin-top: 2px;
}
.strategy-chip.selected em { color: rgba(255,255,255,.72); }
.strategy-hint {
  margin: 14px 0 0;
  text-align: left;
  font-size: .88rem;
  color: var(--ink-soft);
  background: #F8FAFE;
  border: 2px solid #DDE5F1;
  border-radius: 10px;
  padding: 10px 14px;
  line-height: 1.4;
}
.strategy-hint b { color: var(--ink); font-weight: 700; }

/* ---- extra payment input ---- */
.extra-input {
  margin-top: 16px;
  padding: 14px 16px;
  background: #F8FAFE;
  border: 2px dashed rgba(26,42,80,.22);
  border-radius: 12px;
}
.extra-input-label {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  cursor: text;
}
.extra-input-label > span {
  font-weight: 600;
  font-size: .92rem;
  color: var(--ink);
  flex: 1;
  min-width: 180px;
}
.extra-input .prefix-input {
  width: 150px;
  flex-shrink: 0;
}
.extra-input input {
  padding: 10px 14px 10px 28px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  font-size: 1rem;
  font-family: var(--font);
  font-weight: 700;
  width: 100%;
  background: #fff;
  box-shadow: none;
}
.extra-input input:focus {
  outline: 3px solid var(--sky-deep);
  outline-offset: 1px;
}
.extra-input-hint {
  margin: 8px 0 0;
  font-size: .78rem;
  color: var(--ink-soft);
  line-height: 1.4;
}
.extra-input-hint b { color: var(--ink); font-weight: 700; }

/* ---- strategy comparison tiles ---- */
.strategy-compare {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
@media (max-width: 560px) { .strategy-compare { grid-template-columns: 1fr; } }
.compare-tile {
  appearance: none;
  padding: 10px 12px;
  border: 2px solid rgba(26,42,80,.18);
  border-radius: 10px;
  background: #fff;
  text-align: center;
  cursor: pointer;
  font-family: var(--font);
  transition: border-color .15s ease, background .2s ease, transform .15s ease;
  position: relative;
}
.compare-tile:hover {
  border-color: rgba(26,42,80,.5);
  transform: translateY(-1px);
}
.compare-tile.active {
  border-color: var(--ink);
  background: var(--sky);
  box-shadow: 0 3px 0 var(--ink);
}
.compare-tile.winner:not(.active)::after {
  content: 'BEST';
  position: absolute;
  top: -7px;
  right: 6px;
  background: var(--mint);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  padding: 1px 6px;
  font-size: .58rem;
  font-weight: 800;
  letter-spacing: .08em;
  color: var(--ink);
}
.compare-tile.active.winner::after {
  content: 'YOUR PICK · BEST';
  position: absolute;
  top: -7px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--mint);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: .56rem;
  font-weight: 800;
  letter-spacing: .06em;
  color: var(--ink);
  white-space: nowrap;
}
.compare-label {
  display: block;
  font-size: .7rem;
  letter-spacing: .12em;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.compare-tile.active .compare-label { color: var(--sky-deep); }
.compare-months {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  margin: 3px 0 2px;
  color: var(--ink);
  letter-spacing: -.01em;
}
.compare-interest {
  display: block;
  font-size: .72rem;
  color: var(--ink-soft);
}
.compare-tile.active .compare-interest { color: var(--ink); }

/* ---- payoff chart ---- */
.payoff-chart-wrap {
  margin-top: 16px;
  padding: 14px 16px 10px;
  background: #fff;
  border: 2px solid rgba(26,42,80,.15);
  border-radius: 12px;
}
.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 4px;
  font-size: .82rem;
  flex-wrap: wrap;
}
.chart-header #chartTitle {
  font-weight: 700;
  color: var(--ink);
}
.chart-savings {
  font-size: .78rem;
  color: var(--ink-soft);
  background: var(--mint);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  padding: 2px 10px;
  font-weight: 600;
}
.chart-savings b { color: var(--ink); font-weight: 800; }
.payoff-chart {
  width: 100%;
  height: 150px;
  display: block;
  overflow: visible;
}
.chart-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: .72rem;
  color: var(--ink-soft);
  font-weight: 600;
}

.portal-actions {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}
.portal-actions .cta.big {
  margin: 0;
  justify-content: center;
  animation: none;
}
.portal-actions-sub {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.cta.ghost.small {
  font-size: .82rem;
  padding: 7px 14px;
  box-shadow: 0 2px 0 rgba(26,42,80,.2);
  border-width: 2px;
}
.cta.ghost.small:active { box-shadow: 0 0 0 rgba(26,42,80,.2); }
.cta.ghost.small.danger { color: #B83264; border-color: #E07CA8; }
.cta.ghost.small.danger:hover { background: #FFF0F4; }

.portal-privacy {
  text-align: center;
  font-size: .78rem;
  color: var(--ink-soft);
  line-height: 1.5;
  max-width: 560px;
  margin: 10px auto 0;
  padding: 0 10px;
}
.portal-privacy b { color: var(--ink); font-weight: 700; }

/* ---- lightbox ---- */
.photo-lightbox {
  position: fixed; inset: 0;
  background: rgba(26,42,80,.82);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.photo-lightbox img {
  max-width: 100%;
  max-height: 85vh;
  border: 4px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 0 10px 0 rgba(0,0,0,.2);
  background: #fff;
}
.photo-lightbox-close {
  position: absolute;
  top: 20px; right: 20px;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 3px solid var(--ink);
  background: var(--lemon);
  font-size: 1.5rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--ink);
}

/* =============== LEGAL / PRIVACY PAGE =============== */
body.legal-body { padding: 24px 16px 48px; }
body.legal-body main#app { margin: 0 auto; max-width: 720px; }

.legal {
  background: #fff;
  border: 4px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 28px;
  margin: 0 0 22px;
  color: var(--ink);
  line-height: 1.55;
}
.legal h1 {
  font-size: clamp(1.7rem, 5vw, 2.2rem);
  line-height: 1.1;
  margin: 0 0 8px;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.legal h2 {
  font-size: 1.15rem;
  margin: 28px 0 8px;
  color: var(--bubblegum);
  font-weight: 700;
  letter-spacing: -0.005em;
}
.legal .legal-meta {
  font-size: .8rem;
  color: var(--ink-soft);
  margin: 0 0 16px;
  font-weight: 600;
}
.legal .legal-lede {
  font-size: .98rem;
  background: var(--sky);
  border: 3px solid var(--ink);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin: 12px 0 24px;
  line-height: 1.5;
}
.legal p { font-size: .92rem; margin: 10px 0; }
.legal ul { font-size: .92rem; padding-left: 22px; margin: 8px 0 14px; }
.legal li { margin: 6px 0; }
.legal a {
  color: var(--sky-deep);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
}
.legal a:hover { color: var(--bubblegum); }
.legal .legal-footnote {
  margin-top: 32px;
  padding: 14px 16px;
  background: var(--lemon);
  border: 3px dashed var(--ink);
  border-radius: var(--radius-sm);
  font-size: .85rem;
  line-height: 1.45;
}

.legal-back {
  display: inline-flex;
  margin: 0 auto 20px;
  align-self: center;
}

/* =============== PARTNERS CTA =============== */
.partners-cta {
  display: flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 auto;
  padding: 10px 18px;
  background: linear-gradient(100deg, var(--lemon) 0%, var(--bubblegum) 100%);
  border: 3px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 5px 0 var(--ink);
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  text-align: center;
  line-height: 1;
  transition: transform .18s ease, box-shadow .18s ease;
}
.partners-cta:hover {
  transform: translateY(-2px) rotate(-.5deg);
  box-shadow: 0 7px 0 var(--ink);
}
.partners-cta:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 var(--ink);
}
.partners-cta-icon {
  width: 26px; height: 26px;
  flex-shrink: 0;
  display: block;
  filter: drop-shadow(0 2px 0 rgba(26,42,80,.2));
}
.partners-cta-text {
  font-size: .9rem;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}
.partners-cta-text b { font-weight: 800; }
@media (max-width: 420px) {
  .partners-cta { padding: 9px 14px; gap: 8px; }
  .partners-cta-text { font-size: .8rem; }
  .partners-cta-icon { width: 22px; height: 22px; }
}

/* =============== MOBILE TWEAKS =============== */
@media (max-width: 380px) {
  body { padding: 20px 12px 120px; }
  .grid { grid-template-columns: 1fr; }
  .coin3d { width: 118px; height: 118px; }
  .hero-card { padding: 18px 18px 20px; }
  .card { padding: 20px 16px 18px; }
  .cta { padding: 12px 18px; font-size: 1rem; }
  .cta.big { padding: 15px 22px; font-size: 1.1rem; }
}

/* =============== REDUCED MOTION =============== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .screen.active { animation: none; }
  .cta.big { animation: none; }
  .cloud, .sparkles span, h1 span, .progress-fill, .progress-coin,
  .coin3d-inner, .coin3d-bob, .floater { animation: none !important; }
  .confetti { display: none !important; }
  .floaters { display: none; }
  .hero-card:hover { transform: none; }
}

/* =============== PARTNER PORTAL =============== */
body.pp-body {
  padding: 24px 18px 60px;
  background:
    radial-gradient(1200px 600px at 80% -10%, #E9F8FF 0%, transparent 60%),
    linear-gradient(180deg, #F4F9FF 0%, #FBF4FA 100%);
  background-attachment: fixed;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
}
body.pp-body main#app {
  max-width: 880px;
  width: 100%;
  margin: 0 auto;
}

.pp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 16px;
  box-shadow: 0 4px 0 var(--ink);
  padding: 12px 16px;
  margin: 8px 0 22px;
}
.pp-eyebrow {
  margin: 0 0 2px;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .22em;
  color: var(--sky-deep);
  text-transform: uppercase;
}
.pp-firm {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--ink);
}
.pp-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.pp-balance {
  display: flex;
  flex-direction: column;
  line-height: 1;
  text-align: right;
  padding: 4px 12px;
  background: var(--sky);
  border: 2px solid var(--ink);
  border-radius: 999px;
}
.pp-balance-label {
  font-size: .62rem;
  letter-spacing: .14em;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.pp-balance-amt {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  margin-top: 2px;
}
.pp-signout {
  appearance: none;
  width: 38px;
  height: 38px;
  border: 2px solid rgba(26,42,80,.2);
  background: #fff;
  border-radius: 10px;
  color: var(--ink-soft);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.pp-signout:hover {
  background: #FFF0F4;
  border-color: #E07CA8;
  color: #B83264;
}

/* stats row */
.pp-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 0 0 22px;
}
@media (max-width: 560px) {
  .pp-stats { grid-template-columns: repeat(2, 1fr); }
}
.pp-stat {
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 12px;
  box-shadow: 0 3px 0 rgba(26,42,80,.1);
  padding: 12px 14px;
  text-align: left;
}
.pp-stat b {
  display: block;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.1;
  letter-spacing: -.01em;
}
.pp-stat span {
  display: block;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 4px;
}

/* sections */
.pp-section {
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 20px;
  box-shadow: 0 5px 0 var(--ink);
  padding: 20px 22px 22px;
  margin: 0 0 22px;
}
.pp-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.pp-section-head h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.pp-section-count {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  background: var(--ink);
  color: #fff;
  border-radius: 999px;
  padding: 2px 8px;
  line-height: 1.3;
}
.pp-empty {
  margin: 10px 0 0;
  padding: 18px 16px;
  text-align: center;
  background: #F8FAFE;
  border: 2px dashed rgba(26,42,80,.2);
  border-radius: 12px;
  color: var(--ink-soft);
  font-size: .92rem;
}

/* leads grid */
.pp-leads-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 640px) {
  .pp-leads-grid { grid-template-columns: repeat(2, 1fr); }
}
.pp-lead-card {
  background: #fff;
  border: 2px solid var(--ink);
  border-left: 6px solid var(--sky-deep);
  border-radius: 14px;
  box-shadow: 0 3px 0 rgba(26,42,80,.12);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform .18s ease, box-shadow .18s ease;
}
.pp-lead-card.pp-q-hot   { border-left-color: var(--bubblegum); }
.pp-lead-card.pp-q-warm  { border-left-color: var(--lemon-2); }
.pp-lead-card.pp-q-fresh { border-left-color: var(--sky-deep); }
.pp-lead-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 0 rgba(26,42,80,.14);
}
.pp-lead-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.pp-quality {
  display: inline-flex;
  align-items: center;
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .12em;
  padding: 3px 9px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  text-transform: uppercase;
}
.pp-quality.pp-q-hot   { background: var(--bubblegum); color: #fff; }
.pp-quality.pp-q-warm  { background: var(--lemon); color: var(--ink); }
.pp-quality.pp-q-fresh { background: var(--mint); color: var(--ink); }
.pp-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -.01em;
}
.pp-lead-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pp-chip {
  display: inline-block;
  padding: 3px 10px;
  font-size: .75rem;
  font-weight: 700;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
}
.pp-chip.pp-state { background: var(--sky); }
.pp-chip.pp-debt { background: #FFF2F8; }
.pp-chip.pp-credit { background: #F4FBF7; }
.pp-types {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
}
.pp-types li {
  font-size: .78rem;
  color: var(--ink-soft);
  font-weight: 600;
}
.pp-types li::before { content: "• "; color: var(--ink); font-weight: 700; }
.pp-types li:first-child::before { content: ""; }
.pp-lead-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 2px;
}
.pp-age {
  font-size: .76rem;
  color: var(--ink-soft);
  font-weight: 600;
}
.pp-buy {
  appearance: none;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: #fff;
  padding: 8px 16px;
  border-radius: 10px;
  font-family: var(--font);
  font-weight: 700;
  font-size: .88rem;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(26,42,80,.3);
  transition: transform .15s ease, box-shadow .15s ease, background .2s ease;
}
.pp-buy:hover:not(.disabled) {
  background: #2A3D6C;
  transform: translateY(-1px);
  box-shadow: 0 4px 0 rgba(26,42,80,.35);
}
.pp-buy:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(26,42,80,.3); }
.pp-buy.disabled {
  opacity: .5;
  cursor: not-allowed;
  background: #D1D7E3;
  color: var(--ink-soft);
  border-color: rgba(26,42,80,.2);
  box-shadow: none;
}

/* my leads */
.pp-my-leads {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 640px) {
  .pp-my-leads { grid-template-columns: repeat(2, 1fr); }
}
.pp-mine-card {
  background: #F8FAFE;
  border: 2px solid rgba(26,42,80,.18);
  border-radius: 12px;
  padding: 14px 16px;
}
.pp-mine-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 6px;
}
.pp-mine-head h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
}
.pp-mine-sub {
  margin: 2px 0 0;
  font-size: .8rem;
  color: var(--ink-soft);
  font-weight: 600;
}
.pp-status {
  appearance: none;
  padding: 4px 24px 4px 10px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: #fff;
  font-family: var(--font);
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%231A2A50' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}
.pp-mine-contact {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin: 4px 0 8px;
  font-size: .86rem;
}
.pp-mine-contact a {
  color: var(--sky-deep);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1.5px solid transparent;
}
.pp-mine-contact a:hover {
  border-bottom-color: var(--sky-deep);
  color: var(--ink);
}
.pp-dot {
  color: var(--ink-soft);
}
.pp-mine-notes {
  margin: 8px 0 0;
  padding: 8px 10px;
  background: #fff;
  border-left: 3px solid var(--lemon-2);
  border-radius: 6px;
  font-size: .82rem;
  color: var(--ink-soft);
  line-height: 1.45;
}

/* modals */
.pp-modal {
  position: fixed;
  inset: 0;
  background: rgba(26, 42, 80, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn .18s ease;
}
.pp-modal-card {
  position: relative;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 20px;
  box-shadow: 0 8px 0 var(--ink);
  padding: 26px 24px 22px;
  width: 100%;
  max-width: 460px;
  animation: bounce-in .32s cubic-bezier(.2,1.4,.4,1) both;
}
.pp-modal-card h2 {
  margin: 0 0 8px;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -.01em;
}
.pp-modal-sub {
  margin: 0 0 18px;
  font-size: .92rem;
  color: var(--ink-soft);
  line-height: 1.45;
}
.pp-modal-sub b { color: var(--ink); }
.pp-modal-sub code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .85em;
  background: #F0F3F8;
  padding: 1px 6px;
  border-radius: 4px;
}
.pp-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: #fff;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.pp-modal-close:hover { background: #FFF0F4; }
.pp-modal-footnote {
  margin: 14px 0 0;
  font-size: .76rem;
  color: var(--ink-soft);
  line-height: 1.45;
  text-align: center;
}

.btn-primary-full {
  width: 100%;
  justify-content: center;
  margin-top: 4px;
}

/* funds presets */
.pp-preset-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 14px;
}
.pp-preset {
  appearance: none;
  border: 2px solid rgba(26,42,80,.2);
  background: #fff;
  padding: 10px 4px;
  border-radius: 10px;
  font-family: var(--font);
  font-weight: 700;
  font-size: .88rem;
  color: var(--ink);
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .12s ease;
}
.pp-preset:hover {
  background: var(--sky);
  border-color: var(--sky-deep);
}
.pp-preset.selected {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.pp-modal-card .field {
  margin-bottom: 14px;
}
.pp-modal-card .field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.pp-modal-card .field > span {
  display: block;
  font-weight: 600;
  font-size: .88rem;
  margin-bottom: 5px;
}
.pp-modal-card .field > span em {
  color: var(--ink-soft);
  font-style: normal;
  font-weight: 500;
}
.pp-modal-card input {
  width: 100%;
  padding: 11px 14px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  font-family: var(--font);
  font-size: .95rem;
  background: #FBFCFF;
  box-shadow: none;
}
.pp-modal-card input:focus {
  outline: 3px solid var(--sky-deep);
  outline-offset: 1px;
  background: #fff;
}
.pp-modal-card .prefix-input input { padding-left: 28px; }
