/* WishNap — ported app screens.
   Faithful HTML ports of Design/boards (sav-01, sav-02, main-04, ins-01..05),
   drawn at the boards' native 393×852 inside a CSS phone and scaled with
   --s (set per breakpoint in site.css). Colors come from tokens.css only. */

/* ---------- Phone (same device as the loop demo) ---------- */
.phone {
  --s: 0.8;
  position: relative;
  flex: none;
  width: calc(417px * var(--s));
  height: calc(876px * var(--s));
  border-radius: calc(67px * var(--s));
  box-shadow: var(--ld-phone-shadow);
}
.phone__device {
  position: absolute; top: 0; left: 0;
  width: 417px; height: 876px;
  transform: scale(var(--s));
  transform-origin: 0 0;
  border-radius: 67px;
  background: var(--ld-bezel);
  box-shadow: inset 0 0 0 1.5px var(--ld-bezel-edge), inset 0 0 0 4px var(--ld-bezel);
}

/* A phone cut off at design-y --crop, fading out (hero) */
.phone--crop {
  height: calc(var(--crop, 560px) * var(--s));
  border-radius: calc(67px * var(--s)) calc(67px * var(--s)) 0 0;
  box-shadow: none;
  -webkit-mask-image: linear-gradient(to bottom, var(--ink) var(--fade, 76%), transparent 100%);
          mask-image: linear-gradient(to bottom, var(--ink) var(--fade, 76%), transparent 100%);
}
.phone--crop .phone__device { box-shadow: inset 0 0 0 1.5px var(--ld-bezel-edge), inset 0 0 0 4px var(--ld-bezel); }

/* ---------- Screen: the boards' own globals ---------- */
.scr {
  position: absolute; top: 12px; left: 12px;
  width: 393px; height: 852px;
  border-radius: 55px;
  overflow: hidden;
  clip-path: inset(0 round 55px);
  isolation: isolate;
  background: var(--base);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 16px;
  line-height: normal;
  letter-spacing: normal;
  text-align: left;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.scr *, .scr *::before, .scr *::after { box-sizing: border-box; }
.scr svg { display: block; flex-shrink: 0; }
.scr img { display: block; }
.s-abs { position: absolute; }
.s-num { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.s-title { margin: 0; font-size: 34px; line-height: 1.1; font-weight: 700; letter-spacing: -0.02em; text-wrap: balance; }
.s-card { background: var(--card); border-radius: 20px; box-shadow: var(--shadow-card); }
.s-grain {
  position: absolute; inset: 0; pointer-events: none;
  background-image: var(--grain); background-size: var(--grain-size) var(--grain-size);
  mix-blend-mode: overlay; opacity: 0.3;
}

/* Tab bar */
.s-tabbar {
  position: absolute; left: 0; right: 0; bottom: 0; height: 83px;
  display: flex;
  background: var(--ld-tabbar);
  box-shadow: 0 -0.5px 0 var(--ink-line);
  -webkit-backdrop-filter: blur(20px);
          backdrop-filter: blur(20px);
}
.s-tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding-top: 8px; color: var(--ink-faint);
}
.s-tab span { font-size: 10px; font-weight: 600; letter-spacing: 0.1px; }
.s-tab.is-on { color: var(--accent-mid); }

/* Nav bar with a back link (sav-02, ins-05) */
.s-nav {
  top: 59px; left: 0; right: 0; height: 44px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
}
.s-back {
  display: flex; align-items: center; gap: 2px;
  color: var(--accent); font-size: 17px; height: 44px; margin-left: -6px;
}

/* ---------- sav-01 · Savings ---------- */
.sav01-h { top: 103px; left: 20px; right: 20px; }
.sav01-total { top: 172px; left: 20px; right: 20px; display: flex; flex-direction: column; gap: 6px; }
.sav01-glow {
  position: absolute; left: -40px; top: -30px; width: 300px; height: 150px; border-radius: 50%;
  background: radial-gradient(circle, var(--sc-amber-glow) 0%, transparent 70%);
}
.sav01-big { position: relative; font-size: 80px; line-height: 1; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); }
.sav01-sub { position: relative; font-size: 17px; color: var(--ink-muted); }
.sav01-cards { top: 312px; left: 16px; right: 16px; display: flex; flex-direction: column; gap: 12px; }
.sav01-chart { padding: 20px; }
.sav01-chart-t { font-size: 15px; font-weight: 600; margin-bottom: 14px; }
.sav01-bars { display: flex; gap: 18px; height: 160px; align-items: flex-end; }
.sav01-col {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px;
  font-size: 13px; color: var(--ink-soft);
}
.sav01-col .s-num { font-weight: 700; }
.sav01-bar { width: 100%; max-width: 48px; border-radius: 10px; background: var(--sc-bar); }
.sav01-col.is-now { color: var(--ink); }
.sav01-col.is-now .sav01-bar { background: var(--amber); }
.sav01-col.is-now .sav01-m { font-weight: 600; }
.sav01-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.sav01-stat { padding: 18px; }
.sav01-stat-l { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.sav01-stat-v { font-size: 34px; font-weight: 700; margin-top: 6px; }
.sav01-stat-s { font-size: 15px; color: var(--ink-muted); margin-top: 4px; }
.sav01-goal { padding: 16px; display: flex; align-items: center; gap: 14px; }
.sav01-tile {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--sc-goal-tile); color: var(--sc-goal-glyph);
  display: flex; align-items: center; justify-content: center;
}
.sav01-goal-b { flex: 1; }
.sav01-goal-t { font-size: 17px; font-weight: 600; }
.sav01-track { margin-top: 8px; width: 100%; height: 6px; border-radius: 6px; background: var(--sc-goal-track-sm); overflow: hidden; }
.sav01-fill { width: 71.3%; height: 100%; border-radius: 6px; background: var(--amber); }
.sav01-pct { font-size: 17px; font-weight: 700; }
.s-chev { color: var(--ink-soft); }

/* ---------- sav-02 · Goal detail ---------- */
.sav02-edit { height: 44px; display: flex; align-items: center; color: var(--accent); font-size: 17px; font-weight: 400; }
.sav02-head { top: 112px; left: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; }
.sav02-name { font-size: 17px; font-weight: 600; color: var(--ink-muted); }
.sav02-amt { display: flex; align-items: baseline; gap: 10px; }
.sav02-big { font-size: 64px; line-height: 1; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); }
.sav02-of { font-size: 20px; color: var(--ink-soft); font-weight: 600; white-space: nowrap; }
.sav02-track { margin-top: 14px; width: 100%; height: 14px; border-radius: 14px; background: var(--goal-track); overflow: hidden; }
.sav02-fill { width: 71.3%; height: 100%; border-radius: 14px; background: var(--amber); }
.sav02-togo { font-size: 17px; color: var(--ink-muted); margin-top: 6px; }
.sav02-wave { position: absolute; top: 322px; left: 0; width: 393px; height: 18px; color: var(--sc-wave); }
.sav02-list { top: 360px; left: 16px; right: 16px; display: flex; flex-direction: column; gap: 12px; }
.sav02-label { font-size: 15px; font-weight: 600; color: var(--ink-soft); padding: 0 4px; }
.sav02-card { padding: 16px; }
.sav02-rows { display: flex; flex-direction: column; gap: 12px; }
.sav02-row { display: flex; align-items: center; gap: 12px; }
.sav02-thumb {
  width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; color: var(--ink-muted);
}
.sav02-thumb.t-phones { background: var(--lav-300); }
.sav02-thumb.t-watch { background: var(--ld-thumb-lamp); }
.sav02-thumb.t-boots { background: var(--ld-thumb-sneaker); }
.sav02-thumb.t-throw { background: var(--ld-thumb-candle); }
.sav02-item { flex: 1; }
.sav02-item-t { font-size: 17px; font-weight: 500; }
.sav02-item-d { font-size: 13px; color: var(--ink-soft); }
.sav02-price { font-size: 17px; font-weight: 700; }
.sav02-sep { display: block; width: 100%; height: 18px; color: var(--hairline); }
.sav02-all { font-size: 17px; font-weight: 600; padding: 4px; display: flex; align-items: center; gap: 4px; color: var(--accent); }

/* ---------- main-04 · Expiry prompt (night) ---------- */
.scr.m04 { background: var(--night-ground); color: var(--night-text); }
.m04-glow {
  position: absolute; left: -80px; right: -80px; top: 60px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle, var(--sc-night-glow) 0%, transparent 65%);
}
.m04-top { top: 112px; left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 22px; }
.m04-tile {
  width: 148px; height: 148px; flex-shrink: 0; border-radius: 32px;
  background: var(--night-tile); color: var(--night-glyph);
  display: flex; align-items: center; justify-content: center;
}
.m04-meta { text-align: center; display: flex; flex-direction: column; gap: 6px; }
.m04-name { font-size: 17px; color: var(--night-muted); }
.m04-price { font-size: 56px; line-height: 1; font-weight: 700; letter-spacing: -0.02em; color: var(--night-text); }
.m04-when { font-size: 15px; color: var(--night-muted); }
.m04-q { top: 470px; left: 28px; right: 28px; text-align: center; }
.m04-q .s-title { font-size: 36px; color: var(--night-text); }
.m04-actions { left: 20px; right: 20px; bottom: 44px; display: flex; flex-direction: column; align-items: stretch; }
.m04-btn {
  height: 64px; width: 100%; border-radius: 16px;
  display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 19px;
}
.m04-no { background: var(--night-answer); color: var(--ink); font-weight: 700; }
.m04-yes { margin-top: 12px; border: 2px solid var(--night-outline); color: var(--night-text); font-weight: 600; }
.m04-later {
  align-self: center; height: 44px; margin-top: 6px; padding: 0 12px;
  display: flex; align-items: center; justify-content: center;
  color: var(--night-muted); font-size: 15px; font-weight: 500;
}

/* ---------- ins-01..04 · Weekly review story ---------- */
.ins-bg { position: absolute; inset: 0; }
.ins-bg.g-dusk {
  background:
    radial-gradient(100% 60% at 0% 0%, var(--sc-dusk-a) 0%, transparent 60%),
    radial-gradient(100% 70% at 100% 30%, var(--sc-dusk-b) 0%, transparent 70%),
    radial-gradient(120% 70% at 30% 100%, var(--sc-dusk-c) 0%, transparent 70%),
    var(--sc-dusk-ground);
}
.ins-bg.g-sun {
  background:
    radial-gradient(80% 50% at 50% 38%, var(--sc-sun-a) 0%, transparent 75%),
    radial-gradient(100% 60% at 100% 100%, var(--sc-sun-b) 0%, transparent 70%),
    radial-gradient(90% 60% at 0% 0%, var(--sc-sun-c) 0%, transparent 60%),
    var(--sc-sun-ground);
}
.ins-bg.g-clay {
  background:
    radial-gradient(100% 60% at 100% 0%, var(--lav-900) 0%, transparent 60%),
    radial-gradient(100% 70% at 0% 40%, var(--peach) 0%, transparent 70%),
    radial-gradient(120% 70% at 60% 100%, var(--accent-soft) 0%, transparent 70%),
    var(--peach-deep);
}
.ins-prog { top: 62px; left: 12px; right: 12px; display: flex; gap: 4px; }
.ins-prog i { flex: 1; height: 3px; border-radius: 2px; background: var(--sc-story-off); }
.ins-prog i.on { background: var(--sc-story-on); }
.ins-head { top: 72px; left: 20px; right: 8px; height: 44px; display: flex; align-items: center; justify-content: space-between; }
.ins-week { font-size: 15px; font-weight: 600; }
.ins-close { width: 44px; height: 44px; border-radius: 22px; display: flex; align-items: center; justify-content: center; color: var(--ink); }
.ins-text { left: 28px; right: 28px; display: flex; flex-direction: column; }
.ins-lead { font-size: 22px; font-weight: 600; }
.ins-big { margin: 0; line-height: 1; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); }
.ins-h { margin: 0; line-height: 1.1; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); text-wrap: balance; }
.ins-body { font-size: 20px; line-height: 1.35; font-weight: 500; }
.ins-card { left: 20px; right: 20px; background: var(--sc-story-card); border-radius: 20px; }
.ins-foot { left: 20px; right: 20px; bottom: 50px; display: flex; flex-direction: column; gap: 8px; align-items: stretch; }

.ins01-blob { top: 170px; left: 0; right: 0; display: flex; justify-content: center; }
.ins01-blob img { width: 210px; height: 226px; }
.ins01-text { top: 460px; gap: 10px; }
.ins01-text .ins-big { font-size: 72px; }
.ins01-tap { font-size: 15px; font-weight: 600; text-align: center; opacity: 0.75; }

.ins02-text { top: 210px; gap: 14px; }
.ins02-text .ins-big { font-size: 80px; }
.ins02-card { top: 540px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.ins02-row { display: flex; justify-content: space-between; font-size: 17px; }
.ins02-row .s-num { font-weight: 700; }

.ins03-blob { top: 150px; right: -20px; }
.ins03-blob img { width: 190px; height: 191px; }
.ins03-text { top: 380px; gap: 12px; }
.ins03-text .ins-h { font-size: 48px; }
.ins03-card { top: 640px; padding: 16px 18px; font-size: 17px; line-height: 1.4; }

.ins04-blob { top: 150px; left: 0; right: 0; display: flex; justify-content: center; }
.ins04-blob img { width: 180px; height: 210px; }
.ins04-text { top: 430px; gap: 10px; }
.ins04-text .ins-h { font-size: 56px; }
.ins04-done {
  height: 56px; width: 100%; border-radius: 14px;
  background: var(--ink); color: var(--base);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 600; flex-shrink: 0;
}

/* ---------- ins-05 · Trigger map ---------- */
.ins05-head { top: 103px; left: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; }
.ins05-label { font-size: 15px; font-weight: 600; color: var(--ink-soft); }
.ins05-p { font-size: 17px; color: var(--ink-muted); line-height: 1.4; }
.ins05-map { top: 290px; left: 16px; right: 16px; }
.ins05-card { padding: 18px; }
.ins05-grid { display: grid; grid-template-columns: 40px repeat(6, minmax(0, 1fr)); gap: 6px; }
.ins05-x { font-size: 13px; color: var(--ink-soft); text-align: center; }
.ins05-d { font-size: 13px; color: var(--ink-muted); display: flex; align-items: center; }
.ins05-grid i { display: block; height: 36px; border-radius: 10px; background: var(--card-alt); }
.ins05-grid i.h1 { background: var(--lav-100); }
.ins05-grid i.h2 { background: var(--lav-500); }
.ins05-grid i.hp { background: var(--sc-heat-5); box-shadow: 0 0 0 2.5px var(--accent-mid); }
.ins05-legend { display: flex; align-items: center; gap: 8px; margin-top: 16px; font-size: 13px; color: var(--ink-soft); }
.ins05-legend i { display: block; width: 18px; height: 10px; border-radius: 3px; }
.ins05-legend i:nth-of-type(1) { background: var(--card-alt); }
.ins05-legend i:nth-of-type(2) { background: var(--lav-100); }
.ins05-legend i:nth-of-type(3) { background: var(--lav-500); }
.ins05-legend i:nth-of-type(4) { background: var(--lav-900); }
.ins05-legend i:nth-of-type(5) { background: var(--sc-heat-4); }
.ins05-legend i:nth-of-type(6) { background: var(--sc-heat-5); }
.ins05-cta { top: 686px; left: 16px; right: 16px; }
.ins05-cta .s-card { padding: 16px; display: flex; align-items: center; gap: 12px; }
.ins05-moon { color: var(--sc-moon); }
.ins05-cta-t { flex: 1; font-size: 17px; }
