/* ==========================================================================
   Zyora — app demo (app.html)
   Loaded after site.css, which provides tokens, header, buttons and footer.
   Replaces styles-v14 / app-v14 / polish-v14 / brand-v14 / demo-refine.
   The phone is a real 390pt-wide screen, so text uses iOS-sized type.
   ========================================================================== */

.demo-page {
  --phone-w: 390px;
  --phone-h: clamp(680px, calc(100svh - var(--header-h) - 56px), 844px);
  --app-ink: #17131d;
  --app-ink-2: #221d2b;
  --app-ink-line: transparent;
  --app-accent: var(--purple);
  --app-accent-soft: var(--purple-tint);
  --app-lime-soft: #eefbc4;
  --app-coral: #f47255;
}
html[data-theme="dark"] .demo-page {
  --app-ink: #221d2b;
  --app-ink-2: #1a1621;
  --app-ink-line: #3a3344;
  --app-accent: #b3a5ff;
  --app-accent-soft: #29223f;
  --app-lime-soft: #29223f;
}

/* --------------------------------------------------------------------------
   Page layout: copy + guided tour beside the phone
   -------------------------------------------------------------------------- */
.demo-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(40px, 6vw, 104px);
  align-items: center;
  padding-block: clamp(28px, 4vw, 56px) clamp(56px, 7vw, 96px);
}
.demo-copy { min-width: 0; max-width: 540px; }
.demo-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 0 11px;
  border-radius: 99px;
  background: var(--purple-tint);
  color: var(--accent-text);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
}
.demo-stage h1 { margin: 20px 0 18px; font-size: clamp(2.4rem, 1.5rem + 2.6vw, 3.9rem); line-height: 1.02; letter-spacing: -.048em; }
.demo-stage h1 span {
  color: var(--purple);
  background: linear-gradient(120deg, var(--logo-a), var(--logo-b) 70%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
html[data-theme="dark"] .demo-stage h1 span { background-image: linear-gradient(120deg, #b3a5ff, #7c68ff 75%); }
.demo-lead { max-width: 500px; font-size: 17px; color: var(--muted); }

.demo-tour { margin-top: 34px; }
.demo-tour .kicker { color: var(--muted); }
.tour-list { list-style: none; display: grid; gap: 4px; margin: 12px 0 0; padding: 0; }
.tour-step {
  width: 100%;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 14px;
  align-items: start;
  padding: 14px 16px;
  border: 1px solid transparent;
  border-radius: 18px;
  text-align: left;
  transition: background-color 200ms ease, border-color 200ms ease, box-shadow 200ms ease, transform 160ms var(--ease-out);
}
.tour-step:active { transform: scale(.99); }
.tour-step > b {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font: 800 11.5px/1 var(--font-display);
  transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease;
}
.tour-step strong { display: block; font: 700 16.5px/1.3 var(--font-display); letter-spacing: -.02em; }
.tour-step small { display: block; margin-top: 3px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.tour-step[aria-pressed="true"] { background: var(--surface); border-color: var(--line); box-shadow: var(--shadow-md); }
.tour-step[aria-pressed="true"] > b { background: var(--purple-strong); border-color: var(--purple-strong); color: #fff; }
.demo-note { display: flex; gap: 10px; align-items: flex-start; margin-top: 22px; font-size: 13.5px; line-height: 1.55; color: var(--muted); }
.demo-note .icon { width: 17px; height: 17px; margin-top: 1px; color: var(--accent-text); }
@media (hover: hover) and (pointer: fine) {
  .tour-step:not([aria-pressed="true"]):hover { background: color-mix(in srgb, var(--text) 4%, transparent); }
}

/* --------------------------------------------------------------------------
   Device
   -------------------------------------------------------------------------- */
.phone-shell-wrap { position: relative; justify-self: center; isolation: isolate; }
.phone-shell-wrap::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 8% -18%;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--purple) 20%, transparent), transparent);
}
.phone-shell {
  position: relative;
  width: var(--phone-w);
  height: var(--phone-h);
  padding: 10px;
  border-radius: 60px;
  background: #111015;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), 0 0 0 1px rgba(17, 16, 21, .1), var(--shadow-lg);
}
html[data-theme="dark"] .phone-shell { background: #1d1a24; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14), 0 0 0 1px rgba(255, 255, 255, .05), var(--shadow-lg); }
.phone-shell::before, .phone-shell::after { content: ""; position: absolute; width: 3px; border-radius: 3px; background: #26232d; }
.phone-shell::before { left: -3px; top: 150px; height: 64px; }
.phone-shell::after { right: -3px; top: 190px; height: 96px; }
.phone-hardware { position: absolute; z-index: 40; top: 21px; left: 50%; width: 112px; height: 32px; margin-left: -56px; border-radius: 20px; background: #050407; pointer-events: none; }
.phone-screen {
  position: relative;
  height: 100%;
  overflow: hidden;
  border-radius: 50px;
  background: var(--app-bg);
  color: var(--app-text);
  isolation: isolate;
  font-size: 15px;
  line-height: 1.35;
}
.phone-screen button { color: inherit; text-align: inherit; }
.phone-screen .icon { stroke-width: 1.9; }
.phone-screen h2 { text-wrap: balance; }

/* Status bar */
.app-statusbar { position: relative; z-index: 12; height: 54px; padding: 19px 30px 0 34px; display: flex; justify-content: space-between; align-items: flex-start; font-size: 15px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.status-icons { display: flex; align-items: center; gap: 6px; height: 14px; }
.signal-bars { width: 18px; height: 11px; display: flex; align-items: flex-end; gap: 1.6px; }
.signal-bars i { display: block; width: 3px; border-radius: 1px; background: currentColor; }
.signal-bars i:nth-child(1) { height: 4px; } .signal-bars i:nth-child(2) { height: 6px; } .signal-bars i:nth-child(3) { height: 8.5px; } .signal-bars i:nth-child(4) { height: 11px; }
.wifi-icon { position: relative; width: 15px; height: 11px; overflow: hidden; }
.wifi-icon::before, .wifi-icon::after { content: ""; position: absolute; left: 50%; transform: translateX(-50%) rotate(45deg); border: 1.8px solid currentColor; border-left-color: transparent; border-top-color: transparent; border-radius: 0 0 3px 0; }
.wifi-icon::before { width: 12px; height: 12px; top: -7px; }
.wifi-icon::after { width: 5px; height: 5px; top: -.5px; }
.battery { position: relative; min-width: 25px; height: 12px; padding: 0 3px; display: grid; place-items: center; border: 1.2px solid currentColor; border-radius: 4px; font-size: 8px; font-weight: 800; line-height: 1; }
.battery::after { content: ""; position: absolute; right: -3.5px; top: 3.5px; width: 2px; height: 4px; border-radius: 0 1px 1px 0; background: currentColor; }

/* Views */
.mobile-view {
  display: none;
  height: calc(100% - 54px);
  overflow-y: auto;
  padding: 0 18px calc(118px + env(safe-area-inset-bottom, 0px));
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.mobile-view::-webkit-scrollbar { display: none; }
.mobile-view.active { display: block; animation: view-in 240ms var(--ease-out); }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } }
.pro-view { background: radial-gradient(90% 40% at 100% 0%, color-mix(in srgb, var(--purple) 7%, transparent), transparent 70%); }

/* Pull-down wealth — the zone reveals the drawer beneath the hint */
.wealth-pull-zone {
  position: relative;
  z-index: 8;
  height: 46px;
  margin: 0 -6px;
  padding: 0 6px;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  transition: height 440ms var(--ease-drawer);
}
.wealth-pull-zone.open { height: var(--wealth-open, 250px); }
.wealth-pull-zone.is-dragging { transition: none; }
.pull-hint {
  width: 100%;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--app-muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: grab;
}
.pull-hint .icon { width: 16px; height: 16px; stroke-width: 2.2; transition: transform 320ms var(--ease-out); }
.wealth-pull-zone.open .pull-hint .icon { transform: rotate(180deg); }
.wealth-pull-zone.is-dragging .pull-hint { cursor: grabbing; }
.wealth-drawer {
  padding: 18px 18px 16px;
  border: 1px solid var(--app-ink-line);
  border-radius: 24px;
  background: radial-gradient(90% 90% at 100% 0%, rgba(101, 82, 232, .35), transparent 60%), var(--app-ink);
  color: #fff;
  opacity: 0;
  transform: translateY(-10px) scale(.985);
  transform-origin: top center;
  transition: opacity 280ms ease, transform 440ms var(--ease-drawer);
}
.wealth-pull-zone.open .wealth-drawer { opacity: 1; transform: none; }
.wealth-pull-zone.is-dragging .wealth-drawer { transition: none; transform: none; }
.wealth-drawer-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: #cac4d0; }
.wealth-eye { width: 18px; height: 18px; color: #c3b8ff; }
.wealth-drawer > strong { display: block; margin-top: 4px; font: 800 32px/1.1 var(--font-display); letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.wealth-drawer > small { display: block; margin-top: 2px; font-size: 13px; font-weight: 600; color: var(--lime); }
.wealth-breakdown { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; margin-top: 14px; }
.wealth-breakdown div { display: flex; justify-content: space-between; gap: 6px; padding-top: 8px; border-top: 1px solid rgba(255, 255, 255, .1); font-size: 12.5px; }
.wealth-breakdown span { color: #b8b0c4; }
.wealth-breakdown b { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Home: top line + balance */
.mobile-topline { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; padding: 2px 0 8px; }
.app-wordmark { text-align: center; font: 800 22px/1 var(--font-display); letter-spacing: -.055em; }
.round-btn { position: relative; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--app-line); background: var(--app-surface); transition: transform 140ms var(--ease-out); }
.round-btn:active { transform: scale(.94); }
.round-btn .icon { width: 20px; height: 20px; }
.profile-btn { border-color: transparent; background: linear-gradient(145deg, var(--purple), #8a70ff); color: #fff; font: 800 15px/1 var(--font-display); }
.notif-btn > i { position: absolute; top: 8px; right: 9px; width: 9px; height: 9px; border-radius: 50%; background: #ff5e59; border: 2px solid var(--app-surface); }

.spendable-hero { padding: 8px 0 22px; text-align: center; }
.spendable-hero > small { display: block; font-size: 13.5px; font-weight: 600; color: var(--app-muted); }
.spendable-hero > strong { display: block; margin: 6px 0 12px; font: 800 46px/1 var(--font-display); letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.spendable-hero > strong em { font-size: 18px; font-style: normal; letter-spacing: 0; }
.saving-delta {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 2px 5px;
  max-width: 100%;
  padding: 6px 11px;
  border: 1px solid transparent;
  border-radius: 99px;
  font-size: 12px;
  line-height: 1.25;
  transition: background-color 240ms ease, border-color 240ms ease, color 240ms ease;
}
.saving-delta-label { white-space: nowrap; }
.saving-delta b { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.saving-delta-arrow { font-size: 14px; font-weight: 700; }
.saving-delta.is-positive { background: var(--app-positive-bg); border-color: var(--app-positive-line); color: var(--app-positive); }
.saving-delta.is-negative { background: #fff0ed; border-color: #ffd1c8; color: #91432f; }
.saving-delta.is-neutral { background: var(--app-fill); border-color: var(--app-line); color: var(--app-muted); }
html[data-theme="dark"] .saving-delta.is-negative { background: #38201b; border-color: #5a332a; color: #ffb29c; }

/* Quick actions */
.quick-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 20px; }
.quick-action { display: flex; flex-direction: column; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; }
.quick-action > span {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 19px;
  border: 1px solid var(--app-line);
  background: var(--app-fill);
  color: var(--app-accent);
  transition: transform 140ms var(--ease-out), background-color 140ms ease;
}
.quick-action .icon { width: 23px; height: 23px; }
.quick-action:active > span { transform: scale(.93); background: var(--app-accent-soft); }

/* Smart Split banner + goals preview */
.smart-split-banner, .goals-preview, .level-preview { width: 100%; transition: transform 160ms var(--ease-out); }
.smart-split-banner:active, .goals-preview:active, .level-preview:active { transform: scale(.985); }
.smart-split-banner {
  display: grid;
  grid-template-columns: 46px 1fr 20px;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
  padding: 14px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--purple), var(--logo-b));
  color: #fff !important;
  box-shadow: 0 16px 28px -16px rgba(78, 59, 204, .9);
}
.split-orb { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 15px; background: #fff; color: var(--purple); }
.split-orb .icon { width: 22px; height: 22px; }
.smart-split-banner small, .smart-split-banner strong, .smart-split-banner span > span { display: block; }
.smart-split-banner small { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; color: #dcd5ff; }
.smart-split-banner strong { margin: 2px 0; font-size: 15px; font-weight: 700; }
.smart-split-banner span > span { font-size: 12.5px; color: #e3ddff; }
.banner-chevron { width: 20px; height: 20px; opacity: .8; }

.goals-preview {
  display: grid;
  grid-template-columns: 46px 1fr auto 18px;
  gap: 12px;
  align-items: center;
  margin-bottom: 24px;
  padding: 14px;
  border: 1px solid var(--app-line);
  border-radius: 22px;
  background: var(--app-surface);
}
.goals-preview-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 15px; background: var(--app-lime-soft); font-size: 23px; }
.goals-preview-main small, .goals-preview-main strong { display: block; }
.goals-preview-main small { font-size: 12px; font-weight: 600; color: var(--app-muted); }
.goals-preview-main strong { font-size: 15.5px; font-weight: 700; }
.goals-preview .goal-progress { margin: 8px 0 0; height: 6px; }
.goals-preview-side { text-align: right; }
.goals-preview-side b { display: block; font: 800 17px/1.1 var(--font-display); letter-spacing: -.03em; }
.goals-preview-side small { font-size: 12px; color: var(--app-muted); white-space: nowrap; }
.goals-preview .banner-chevron { color: var(--app-muted); }

/* Transactions */
.section-head { display: flex; justify-content: space-between; align-items: flex-end; margin: 0 2px 10px; }
.section-head strong, .section-head small { display: block; }
.section-head strong { font: 800 21px/1.1 var(--font-display); letter-spacing: -.035em; }
.section-head small { margin-top: 2px; font-size: 12.5px; color: var(--app-muted); }
.section-head button, .level-roadmap-head button { min-height: 32px; padding: 0 2px; font-size: 14px; font-weight: 700; color: var(--app-accent); }
.transaction-list { padding: 2px 14px; border: 1px solid var(--app-line); border-radius: 22px; background: var(--app-surface); }
.transaction-row { display: grid; grid-template-columns: 42px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--app-line); }
.transaction-row:last-child { border-bottom: 0; }
.merchant-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; font: 800 14px/1 var(--font-display); }
.merchant-icon .icon { width: 18px; height: 18px; stroke-width: 2.2; }
.merchant-icon.grocery { background: #e8f7c9; color: #315324; }
.merchant-icon.fun { background: #ede8ff; color: #5d45c4; }
.merchant-icon.netflix { background: #1c1c1c; color: #e50914; font-size: 18px; }
.merchant-icon.salary { background: #dff6e8; color: #19754a; }
html[data-theme="dark"] .merchant-icon.grocery { background: #2c2f18; color: #e3f08a; }
html[data-theme="dark"] .merchant-icon.fun { background: #29223e; color: #c9bfff; }
html[data-theme="dark"] .merchant-icon.netflix { background: #24171d; color: #ff6478; }
html[data-theme="dark"] .merchant-icon.salary { background: #163127; color: #83d9b1; }
.tx-main strong, .tx-main small, .tx-amount strong, .tx-amount small { display: block; }
.tx-main strong, .tx-amount strong { font-size: 15px; font-weight: 600; }
.tx-main small, .tx-amount small { margin-top: 2px; font-size: 12.5px; color: var(--app-muted); }
.tx-amount { text-align: right; font-variant-numeric: tabular-nums; }
.transaction-row.income .tx-amount strong { color: var(--app-positive); }

/* Level preview */
.level-preview {
  display: grid;
  grid-template-columns: 1fr 56px;
  gap: 6px 12px;
  align-items: center;
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--app-ink-line);
  border-radius: 24px;
  background: radial-gradient(80% 90% at 100% 0%, rgba(244, 114, 85, .22), transparent 55%), linear-gradient(145deg, var(--app-ink-2), var(--app-ink));
  color: #fff !important;
}
.level-preview-main > * { display: block; }
.level-preview-main small { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; color: var(--lime); }
.level-preview-main strong { margin: 3px 0; font-size: 16px; font-weight: 700; }
.level-preview-main span { font-size: 12.5px; color: #b8b0c4; font-variant-numeric: tabular-nums; }
.mini-level-ring { position: relative; width: 54px; height: 54px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--lime) 78%, #3a3344 0); }
.mini-level-ring::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--app-ink); }
.mini-level-ring span { position: relative; font: 800 17px/1 var(--font-display); }
.level-preview-note { grid-column: 1 / -1; display: block; margin-top: 6px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .1); font-size: 13px; line-height: 1.45; color: #cac4d0; }
.level-preview-note b { color: var(--lime); }

/* Inside screens: header */
.inside-header { position: relative; z-index: 3; display: grid; grid-template-columns: 42px 1fr 42px; align-items: center; gap: 6px; padding: 6px 0 20px; }
.inside-header > div { text-align: center; }
.inside-header small, .inside-header strong { display: block; }
.inside-header small { font-size: 10.5px; font-weight: 700; letter-spacing: .13em; color: var(--app-muted); }
.inside-header strong { margin-top: 2px; font-size: 16px; font-weight: 700; line-height: 1.25; }
.inside-header button { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--app-line); background: var(--app-fill); transition: transform 140ms var(--ease-out); }
.inside-header button:active { transform: scale(.93); }
.inside-header button .icon { width: 20px; height: 20px; stroke-width: 2.1; }

/* Smart Split screen */
.split-mobile-intro h2 { margin: 0 0 6px; font: 800 30px/1.1 var(--font-display); letter-spacing: -.045em; }
.split-mobile-intro p { margin: 0 0 16px; font-size: 14.5px; line-height: 1.5; color: var(--app-muted); }
.salary-mobile-card { display: block; padding: 18px; border: 1px solid var(--app-ink-line); border-radius: 22px; background: radial-gradient(90% 90% at 100% 0%, rgba(101, 82, 232, .3), transparent 60%), var(--app-ink); color: #fff; cursor: text; transition: box-shadow 180ms ease; }
.salary-mobile-card:focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--purple) 55%, transparent); }
.salary-mobile-card > span { font-size: 12.5px; color: #cac4d0; }
.salary-mobile-card > div { display: flex; align-items: baseline; gap: 6px; margin-top: 4px; }
.salary-mobile-card input { flex: 1; width: 100%; min-width: 0; padding: 0; border: 0; outline: 0; background: transparent; color: inherit; font: 800 38px/1.1 var(--font-display); letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.salary-mobile-card b { font-size: 16px; }
/* Let the currency sit right after the number where the browser can size inputs to content. */
@supports (field-sizing: content) {
  .salary-mobile-card input, .sheet-amount input { field-sizing: content; flex: 0 1 auto; width: auto; min-width: 1ch; }
}

.mobile-mode-selector { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.mobile-mode-selector button {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 8px;
  align-items: center;
  padding: 11px 10px;
  border: 1px solid var(--app-line);
  border-radius: 17px;
  background: var(--app-surface);
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, transform 140ms var(--ease-out);
}
.mobile-mode-selector button:active { transform: scale(.96); }
.mobile-mode-selector button > span { grid-row: 1 / 3; font-size: 20px; }
.mobile-mode-selector b { font-size: 14px; font-weight: 700; }
.mobile-mode-selector small { font-size: 12px; color: var(--app-muted); }
.mobile-mode-selector button.active { border-color: transparent; background: linear-gradient(135deg, var(--purple), var(--logo-b)); color: #fff; box-shadow: 0 10px 20px -12px rgba(78, 59, 204, .9); }
.mobile-mode-selector button.active small { color: #e6e0ff; }

.split-result-card { padding: 18px; border: 1px solid var(--app-line); border-radius: 22px; background: var(--app-surface); }
.split-result-card > small { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .12em; color: var(--app-muted); }
.split-result-card > strong { display: block; margin: 4px 0; font: 800 32px/1.1 var(--font-display); letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.split-result-card > span { font-size: 13.5px; font-weight: 700; color: var(--app-positive); font-variant-numeric: tabular-nums; }
.distribution-bar { display: flex; gap: 2px; height: 12px; margin: 16px 0 12px; overflow: hidden; border-radius: 99px; background: var(--app-fill); }
.distribution-bar i { display: block; height: 100%; transition: width 360ms var(--ease-in-out); }
.distribution-bar i:nth-child(1), #legendFixed::before { background: #242030; }
.distribution-bar i:nth-child(2), #legendGoals::before { background: var(--purple-strong); }
.distribution-bar i:nth-child(3), #legendEmergency::before { background: #5ca870; }
.distribution-bar i:nth-child(4), #legendSpend::before { background: var(--lime); box-shadow: inset 0 0 0 1px rgba(23, 19, 29, .1); }
html[data-theme="dark"] .distribution-bar i:nth-child(1), html[data-theme="dark"] #legendFixed::before { background: #e6e1ef; }
/* Legend reads as a key, so labels never collide on narrow segments (JS may still set `left`). */
.split-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--app-muted); }
.split-legend span { position: static !important; display: inline-flex; align-items: center; gap: 6px; }
.split-legend span::before { content: ""; width: 8px; height: 8px; border-radius: 3px; }

.allocation-mobile-list { margin: 12px 0; }
.allocation-mobile-list article { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 12px 2px; border-bottom: 1px solid var(--app-line); }
.alloc-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 13px; }
.alloc-icon .icon { width: 19px; height: 19px; }
.alloc-icon.fixed { background: var(--app-fill); color: var(--app-text); }
.alloc-icon.goals { background: var(--app-accent-soft); color: var(--app-accent); }
.alloc-icon.emergency { background: var(--app-positive-bg); color: var(--app-positive); }
.allocation-mobile-list strong, .allocation-mobile-list small { display: block; }
.allocation-mobile-list strong { font-size: 15px; font-weight: 600; }
.allocation-mobile-list small { margin-top: 2px; font-size: 12.5px; color: var(--app-muted); }
.allocation-mobile-list article > b { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }

.year-impact { padding: 16px 18px; border-radius: 22px; background: var(--app-lime-soft); color: #2e3819; }
.year-impact span, .year-impact strong { display: block; }
.year-impact span { font-size: 12.5px; font-weight: 700; }
.year-impact strong { margin: 4px 0; font: 800 27px/1.1 var(--font-display); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.year-impact p { margin: 0; font-size: 13px; line-height: 1.5; color: #56643a; }
html[data-theme="dark"] .year-impact { color: #f7f5fb; box-shadow: inset 0 0 0 1px #3f355d; }
html[data-theme="dark"] .year-impact strong { color: var(--lime); }
html[data-theme="dark"] .year-impact p { color: #c5bec9; }

.shield-mobile { margin-top: 12px; padding: 16px; border: 1px solid var(--app-line); border-radius: 22px; background: var(--app-surface); }
.shield-head { display: flex; gap: 12px; align-items: center; }
.shield-icon { width: 42px; height: 42px; display: grid; place-items: center; flex: none; border-radius: 13px; background: var(--app-accent-soft); color: var(--app-accent); }
.shield-icon .icon { width: 21px; height: 21px; }
.shield-mobile strong, .shield-mobile small { display: block; }
.shield-mobile strong { font-size: 15.5px; font-weight: 700; }
.shield-mobile small { margin-top: 1px; font-size: 12.5px; color: var(--app-muted); }
.shield-options { display: flex; gap: 2px; margin: 14px 0 10px; padding: 3px; border-radius: 13px; background: var(--app-fill); }
.shield-options button { flex: 1; text-align: center !important; min-height: 38px; border-radius: 10px; font-size: 14px; font-weight: 700; color: var(--app-muted) !important; transition: background-color 180ms ease, color 180ms ease; }
.shield-options button.active { background: var(--purple-strong); color: #fff !important; box-shadow: 0 6px 14px -8px rgba(78, 59, 204, .9); }
.shield-mobile p { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--app-muted); }

/* Goals */
.goals-total-card { margin-bottom: 12px; padding: 18px; border-radius: 22px; background: linear-gradient(135deg, var(--purple), var(--logo-b)); color: #fff; box-shadow: 0 16px 28px -16px rgba(78, 59, 204, .9); }
.goals-total-card small, .goals-total-card strong, .goals-total-card span { display: block; }
.goals-total-card small { font-size: 12.5px; color: #ddd7ff; }
.goals-total-card strong { margin: 4px 0; font: 800 32px/1.1 var(--font-display); letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.goals-total-card span { font-size: 12.5px; font-weight: 600; color: var(--lime); }
.mobile-goals-list { display: grid; gap: 10px; }
.mobile-goal { padding: 16px; border: 1px solid var(--app-line); border-radius: 22px; background: var(--app-surface); }
.mobile-goal.featured { border-color: transparent; background: var(--app-lime-soft); }
html[data-theme="dark"] .mobile-goal.featured { box-shadow: inset 0 0 0 1px #3f355d; }
.goal-top { display: flex; justify-content: space-between; align-items: center; }
.goal-top > span { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 15px; background: var(--app-fill); font-size: 24px; }
.mobile-goal.featured .goal-top > span { background: rgba(255, 255, 255, .6); }
html[data-theme="dark"] .mobile-goal.featured .goal-top > span { background: rgba(255, 255, 255, .06); }
.goal-top b { font: 800 16px/1 var(--font-display); letter-spacing: -.02em; }
.mobile-goal > small { display: block; margin-top: 12px; font-size: 10.5px; font-weight: 700; letter-spacing: .1em; color: var(--app-muted); }
.mobile-goal > strong { display: block; margin: 2px 0; font: 800 20px/1.2 var(--font-display); letter-spacing: -.03em; }
.mobile-goal > p { margin: 0; font-size: 13.5px; color: var(--app-muted); font-variant-numeric: tabular-nums; }
.goal-progress { height: 8px; margin: 12px 0; overflow: hidden; border-radius: 99px; background: var(--app-fill); }
.goal-progress i { display: block; height: 100%; border-radius: inherit; background: var(--purple); }
.mobile-goal.featured .goal-progress { background: rgba(23, 19, 29, .08); }
html[data-theme="dark"] .mobile-goal.featured .goal-progress { background: rgba(255, 255, 255, .1); }
.mobile-goal.featured .goal-progress i { background: #5c7c22; }
html[data-theme="dark"] .mobile-goal.featured .goal-progress i { background: var(--lime); }
.mobile-goal footer { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--app-muted); }
.mobile-goal footer b { color: var(--app-text); }

/* Levels */
.level-hero-game {
  position: relative;
  display: grid;
  grid-template-columns: 94px 1fr;
  gap: 16px;
  align-items: center;
  margin-bottom: 12px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid var(--app-ink-line);
  border-radius: 26px;
  background: radial-gradient(circle at 15% 20%, rgba(244, 114, 85, .32), transparent 36%), linear-gradient(135deg, #2b2442, #17151d);
  color: #fff;
}
.level-hero-game::after { content: ""; position: absolute; top: -52px; right: -55px; width: 140px; height: 140px; border: 1px solid rgba(255, 255, 255, .08); border-radius: 50%; }
.level-orbit { position: relative; width: 88px; height: 88px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--app-coral) 0 78%, #4b425c 78% 100%); box-shadow: 0 0 0 7px rgba(255, 255, 255, .045); }
.level-orbit::before { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: #1b1724; }
.level-orbit > span { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; font: 800 30px/1 var(--font-display); }
.level-orbit small { margin-top: 2px; font-size: 9.5px; letter-spacing: .13em; color: #bdb5cf; }
.level-orbit > i { position: absolute; z-index: 3; right: -4px; bottom: 2px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 10px; background: #ffd65a; color: #3a2c05; box-shadow: 0 5px 14px rgba(255, 214, 90, .25); }
.level-orbit > i .icon { width: 16px; height: 16px; stroke-width: 2.2; }
.level-hero-copy > small { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; color: #bdb5cf; }
.level-hero-copy h2 { margin: 4px 0; font: 800 19px/1.15 var(--font-display); letter-spacing: -.03em; }
.level-hero-copy p { margin: 0 0 12px; font-size: 13px; color: #c8c2d1; }
.xp-bar { height: 8px; overflow: hidden; border-radius: 99px; background: #443c51; }
.xp-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--app-coral), #ffd65a); }
.xp-line { display: flex; justify-content: space-between; margin-top: 6px; font-size: 12px; font-variant-numeric: tabular-nums; }
.xp-line span { color: #aaa2b7; }

.next-reward-card { display: grid; grid-template-columns: 52px 1fr 22px; gap: 12px; align-items: center; margin-bottom: 12px; padding: 14px; border: 1px solid #e5dcff; border-radius: 22px; background: linear-gradient(135deg, #f0ecff, #fff0eb); color: #2b2440; }
html[data-theme="dark"] .next-reward-card { border-color: #45374d; background: linear-gradient(135deg, #28213e, #332019); color: #fff; }
.reward-icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 16px; background: var(--purple); color: #fff; font: 800 15px/1 var(--font-display); box-shadow: 0 8px 17px -6px rgba(101, 82, 232, .6); }
.next-reward-card small { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; color: #756a8e; }
.next-reward-card strong { display: block; margin: 2px 0; font-size: 15.5px; font-weight: 700; }
.next-reward-card p { margin: 0; font-size: 12.5px; line-height: 1.4; color: #756f80; }
html[data-theme="dark"] .next-reward-card small, html[data-theme="dark"] .next-reward-card p { color: #c5bec9; }
.reward-lock { color: #8c82a2; }
.reward-lock .icon { width: 18px; height: 18px; }

.streak-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0 20px; }
.streak-strip > div { padding: 12px 8px; border: 1px solid var(--app-line); border-radius: 18px; background: var(--app-surface); text-align: center; }
.streak-strip span { display: block; font-size: 20px; line-height: 1.2; }
.streak-strip b { display: block; margin: 4px 0 1px; font-size: 15px; font-weight: 700; }
.streak-strip small { font-size: 11.5px; color: var(--app-muted); }

.challenge-head, .level-roadmap-head, .friend-list-head, .pro-section-title { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; margin: 20px 2px 10px; }
.challenge-head small, .pro-section-title small { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .1em; color: var(--app-muted); }
.challenge-head strong, .level-roadmap-head strong, .friend-list-head strong, .pro-section-title strong { display: block; font: 800 18px/1.2 var(--font-display); letter-spacing: -.025em; }
.challenge-head > span { padding: 5px 10px; border-radius: 99px; background: var(--app-accent-soft); color: var(--app-accent); font-size: 12.5px; font-weight: 700; }
.friend-list-head small { font-size: 12px; color: var(--app-muted); }
.pro-section-title { display: block; }
.pro-section-title strong { margin-top: 2px; }

.mission-list { display: grid; gap: 8px; }
.mission { display: grid; grid-template-columns: 42px 1fr auto; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--app-line); border-radius: 18px; background: var(--app-surface); }
.mission-check { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: var(--app-fill); color: var(--app-muted); font: 800 15px/1 var(--font-display); }
.mission-check .icon { width: 19px; height: 19px; stroke-width: 2.4; }
.mission.done .mission-check { background: var(--app-positive-bg); color: var(--app-positive); }
.mission strong { display: block; font-size: 14.5px; font-weight: 600; }
.mission small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--app-muted); }
.mission > b { font-size: 13px; font-weight: 700; color: var(--app-accent); white-space: nowrap; }

.level-path { margin-top: 2px; }
.level-row { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 12px 2px; border-bottom: 1px solid var(--app-line); }
.level-row:last-child { border-bottom: 0; }
.level-dot { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--app-line); background: var(--app-fill); font: 800 13px/1 var(--font-display); }
.level-row.current .level-dot { background: var(--purple-strong); border-color: var(--purple-strong); color: #fff; }
.level-row.major { margin: 6px -6px; padding: 14px 8px; border: 0; border-radius: 18px; background: linear-gradient(135deg, #f0ecff, #fff0eb); color: #30283f; }
html[data-theme="dark"] .level-row.major { background: linear-gradient(135deg, #29223f, #342019); box-shadow: inset 0 0 0 1px #43364b; color: #fff; }
.level-row.major .level-dot { background: var(--app-coral); border-color: var(--app-coral); color: #fff; }
.level-row small, .level-row strong, .level-row p { display: block; }
.level-row small { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; color: var(--app-muted); }
.level-row strong { margin: 2px 0; font-size: 15px; font-weight: 700; }
.level-row p { margin: 0; font-size: 12.5px; line-height: 1.4; color: var(--app-muted); }
.level-row.major small, .level-row.major p { color: #6f6780; }
html[data-theme="dark"] .level-row.major small, html[data-theme="dark"] .level-row.major p { color: #bbb4c4; }
.level-row > span { font-size: 12.5px; font-weight: 700; color: var(--app-muted); font-variant-numeric: tabular-nums; }
.level-row > span .icon { width: 17px; height: 17px; }

/* Friends */
.friends-search { display: flex; align-items: center; gap: 10px; height: 48px; margin-bottom: 16px; padding: 0 14px; border: 1px solid var(--app-line); border-radius: 16px; background: var(--app-fill); transition: border-color 180ms ease, box-shadow 180ms ease; }
.friends-search:focus-within { border-color: color-mix(in srgb, var(--purple) 60%, var(--app-line)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--purple) 20%, transparent); }
.friends-search .icon { width: 19px; height: 19px; color: var(--app-muted); }
.friends-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--app-text); font: 500 16px/1 var(--font-body); } /* 16px: no iOS zoom on focus */
.friends-search input::placeholder { color: var(--app-muted); }
.friend-favorites { display: flex; gap: 14px; overflow-x: auto; margin: 0 -18px; padding: 2px 18px 10px; scrollbar-width: none; scroll-padding-inline: 18px; scroll-snap-type: x proximity; }
.friend-favorites::-webkit-scrollbar { display: none; }
.friend-chip { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 58px; scroll-snap-align: start; transition: transform 140ms var(--ease-out); }
.friend-chip:active { transform: scale(.95); }
.friend-chip b { font-size: 12.5px; font-weight: 600; }
.friend-avatar { width: 54px; height: 54px; display: grid; place-items: center; flex: none; border-radius: 18px; color: #fff; font: 800 17px/1 var(--font-display); box-shadow: 0 7px 17px -6px rgba(0, 0, 0, .25); }
.friend-list { display: grid; gap: 8px; }
.friend-row { display: grid; grid-template-columns: 46px 1fr auto; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--app-line); border-radius: 18px; background: var(--app-surface); }
.friend-row .friend-avatar { width: 46px; height: 46px; border-radius: 15px; font-size: 15px; }
.friend-row strong { display: block; font-size: 15px; font-weight: 600; }
.friend-row small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--app-muted); }
.send-friend { min-height: 38px; padding: 0 14px; border-radius: 12px; background: var(--app-accent-soft); color: var(--app-accent) !important; font-size: 13.5px; font-weight: 700; transition: transform 140ms var(--ease-out); }
.send-friend:active { transform: scale(.95); }

/* Send sheet */
.send-sheet { position: absolute; inset: 0; z-index: 60; visibility: hidden; pointer-events: none; transition: visibility 0s linear 440ms; }
.send-sheet.open { visibility: visible; pointer-events: auto; transition-delay: 0s; }
.sheet-backdrop { position: absolute; inset: 0; width: 100%; background: rgba(8, 7, 12, .46); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); opacity: 0; transition: opacity 280ms ease; }
.send-sheet.open .sheet-backdrop { opacity: 1; }
.sheet-card {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  padding: 10px 18px calc(18px + env(safe-area-inset-bottom, 0px));
  border: 1px solid var(--app-line);
  border-radius: 34px;
  background: var(--app-surface);
  color: var(--app-text);
  box-shadow: 0 -16px 50px rgba(0, 0, 0, .22);
  transform: translateY(110%);
  transition: transform 440ms var(--ease-drawer);
}
.send-sheet.open .sheet-card { transform: none; }
.sheet-handle { width: 40px; height: 5px; margin: 0 auto 16px; border-radius: 99px; background: var(--app-line); }
.sheet-person { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.sheet-person .friend-avatar { width: 48px; height: 48px; border-radius: 16px; }
.sheet-person small { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .1em; color: var(--app-muted); }
.sheet-person strong { font: 800 19px/1.2 var(--font-display); letter-spacing: -.025em; }
.sheet-card > label { display: block; font-size: 12.5px; font-weight: 700; color: var(--app-muted); }
.sheet-amount { display: flex; align-items: baseline; gap: 6px; margin-top: 4px; border-bottom: 2px solid var(--app-line); transition: border-color 180ms ease; }
.sheet-amount:focus-within { border-color: var(--purple); }
.sheet-amount input { width: 100%; min-width: 0; padding: 6px 0; border: 0; outline: 0; background: transparent; color: var(--app-text); font: 800 38px/1.1 var(--font-display); letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.sheet-amount b { font-size: 16px; }
.sheet-presets { display: flex; gap: 8px; margin: 14px 0; }
.sheet-presets button { flex: 1; text-align: center !important; min-height: 44px; border: 1px solid var(--app-line); border-radius: 14px; background: var(--app-fill); font-size: 14.5px; font-weight: 700; font-variant-numeric: tabular-nums; transition: transform 140ms var(--ease-out); }
.sheet-presets button:active { transform: scale(.95); }
.sheet-send { width: 100%; min-height: 54px; border-radius: 17px; background: var(--purple-strong); color: #fff !important; font-size: 16px; font-weight: 700; text-align: center !important; box-shadow: 0 12px 24px -12px rgba(78, 59, 204, .9); transition: transform 140ms var(--ease-out); }
.sheet-send:active { transform: scale(.98); }

/* Pro */
.pro-header .pro-pill { justify-self: end; padding: 5px 8px; border-radius: 9px; background: linear-gradient(135deg, #1d1a27, #3c3157); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.pro-header strong { line-height: 1.15; }
.pro-coming { position: relative; overflow: hidden; padding: 20px; border: 1px solid #373044; border-radius: 26px; background: radial-gradient(circle at 90% 10%, rgba(114, 215, 255, .18), transparent 32%), linear-gradient(140deg, #242033, #0f0e14); color: #fff; box-shadow: 0 18px 38px -18px rgba(22, 17, 35, .5); }
.pro-coming::after { content: ""; position: absolute; top: -60px; right: -55px; width: 150px; height: 150px; border: 1px solid rgba(139, 114, 255, .24); border-radius: 50%; }
.pro-mark { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 14px; border-radius: 14px; background: linear-gradient(145deg, var(--purple), var(--app-coral)); font: 800 13px/1 var(--font-display); }
.pro-coming small { font-size: 10.5px; font-weight: 700; letter-spacing: .1em; color: #b8afc7; }
.pro-coming h2 { margin: 6px 0 8px; font: 800 30px/1 var(--font-display); letter-spacing: -.045em; }
.pro-coming p { margin: 0; font-size: 13.5px; line-height: 1.55; color: #dcd5e8; }
.pro-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.pro-metrics article { padding: 14px; border: 1px solid var(--app-line); border-radius: 18px; background: var(--app-surface); }
.pro-metrics small { display: block; font-size: 12px; color: var(--app-muted); }
.pro-metrics strong { display: block; margin: 4px 0; font: 800 20px/1.1 var(--font-display); letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.pro-metrics span { font-size: 12px; font-weight: 600; color: var(--app-accent); }
.pro-feature-list { display: grid; gap: 8px; }
.pro-feature-list article { display: grid; grid-template-columns: 42px 1fr; gap: 12px; padding: 14px; border: 1px solid var(--app-line); border-radius: 18px; background: var(--app-surface); }
.pro-feature-list article > span { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: var(--app-accent-soft); color: var(--app-accent); font: 800 13px/1 var(--font-display); }
.pro-feature-list article > span .icon { width: 20px; height: 20px; }
.pro-feature-list strong { display: block; font-size: 15px; font-weight: 700; }
.pro-feature-list p { margin: 3px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--app-muted); }
.pro-cta { width: 100%; min-height: 54px; display: flex; justify-content: space-between; align-items: center; margin-top: 12px; padding: 0 18px; border-radius: 17px; background: linear-gradient(135deg, #1c1824, #332946); color: #fff !important; font-size: 15px; font-weight: 700; transition: transform 140ms var(--ease-out); }
.pro-cta .icon { width: 19px; height: 19px; color: #c3b8ff; }
.pro-cta:active { transform: scale(.98); }
html[data-theme="dark"] .pro-cta { background: var(--purple-strong); }
html[data-theme="dark"] .pro-cta .icon { color: #fff; }

/* Tab bar — translucent material over scrolling content */
.mobile-tabbar {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 8px 6px max(8px, env(safe-area-inset-bottom, 0px));
  border: 1px solid color-mix(in srgb, var(--app-line) 80%, transparent);
  border-radius: 30px;
  background: color-mix(in srgb, var(--app-surface) 84%, transparent);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 14px 34px -14px rgba(23, 19, 29, .28);
}
html[data-theme="dark"] .mobile-tabbar { background: rgba(24, 21, 30, .86); box-shadow: 0 14px 34px -10px rgba(0, 0, 0, .6); }
.tab-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 52px; color: var(--app-muted) !important; font-size: 10.5px; font-weight: 600; }
.tab-btn > span { width: 46px; height: 30px; display: grid; place-items: center; border-radius: 12px; transition: background-color 180ms ease, color 180ms ease, transform 140ms var(--ease-out); }
.tab-btn .icon { width: 22px; height: 22px; }
.tab-btn:active > span { transform: scale(.9); }
.tab-btn.active { color: var(--app-text) !important; }
.tab-btn.active > span { background: var(--app-accent-soft); color: var(--app-accent); }
.friends-tab > span { width: 48px; height: 38px; margin-top: -14px; border-radius: 15px; background: linear-gradient(145deg, var(--purple), #8a70ff) !important; color: #fff !important; box-shadow: 0 8px 18px -6px rgba(101, 82, 232, .6); }
.pro-tab.active > span { background: linear-gradient(145deg, #17151d, #493c67); color: #fff; }
html[data-theme="dark"] .pro-tab.active > span { background: linear-gradient(145deg, var(--app-coral), #8a70ff); }

/* Toast */
.demo-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 99;
  max-width: calc(100vw - 32px);
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 16px);
  transition: opacity 220ms ease, transform 320ms var(--ease-out);
}
html[data-theme="dark"] .demo-toast { background: #2a2433; box-shadow: inset 0 0 0 1px #3a3344, var(--shadow-lg); }
.demo-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Hover only where a real pointer exists */
@media (hover: hover) and (pointer: fine) {
  .transaction-row { transition: background-color 160ms ease; }
  .quick-action:hover > span { background: var(--app-accent-soft); }
  .goals-preview:hover, .friend-row:hover, .mission:hover { border-color: color-mix(in srgb, var(--purple) 30%, var(--app-line)); }
  .tab-btn:not(.active):hover { color: var(--app-text) !important; }
  .inside-header button:hover, .round-btn:not(.profile-btn):hover { border-color: color-mix(in srgb, var(--purple) 35%, var(--app-line)); }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-view.active { animation: none; }
  .wealth-pull-zone, .wealth-drawer, .sheet-card, .distribution-bar i, .demo-toast { transition-duration: .01ms; }
  .sheet-card { transform: none; }
  .send-sheet:not(.open) .sheet-card { opacity: 0; }
}
@media (prefers-reduced-transparency: reduce) {
  .mobile-tabbar { background: var(--app-surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1023px) {
  .demo-stage { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 36px; padding-top: 36px; }
  .demo-copy { width: 100%; }
  .demo-copy { max-width: 680px; text-align: center; }
  .demo-lead { margin-inline: auto; }
  .demo-tour { margin-top: 28px; }
  .tour-list { display: flex; gap: 8px; overflow-x: auto; margin: 12px calc(var(--gutter) * -1) 0; padding: 4px var(--gutter) 10px; scroll-padding-inline: var(--gutter); scroll-snap-type: x proximity; scrollbar-width: none; }
  .tour-list::-webkit-scrollbar { display: none; }
  .tour-list li { flex: none; scroll-snap-align: start; }
  .tour-step { grid-template-columns: auto auto; align-items: center; gap: 10px; padding: 8px 16px 8px 8px; border-color: var(--line); border-radius: 99px; background: var(--surface); }
  .tour-step > b { width: 30px; height: 30px; }
  .tour-step strong { font-size: 15px; white-space: nowrap; }
  .tour-step small { display: none; }
  .tour-step[aria-pressed="true"] { border-color: var(--purple-strong); box-shadow: 0 0 0 1px var(--purple-strong); }
  .demo-note { justify-content: center; text-align: left; }
}

/* Phones: the demo becomes the app — full-bleed, no fake status bar */
@media (max-width: 720px) {
  .demo-stage { padding-top: 28px; padding-bottom: 40px; gap: 24px; }
  .demo-copy { text-align: left; }
  .demo-stage h1 { font-size: clamp(2.2rem, 9.5vw, 2.9rem); }
  .demo-lead { font-size: 16px; }
  .demo-note { justify-content: flex-start; font-size: 13px; }
  .phone-shell-wrap { justify-self: stretch; width: auto; margin-inline: calc(var(--gutter) * -1); }
  .phone-shell-wrap::before { display: none; }
  .phone-shell, html[data-theme="dark"] .phone-shell { width: 100%; height: calc(100dvh - var(--header-h)); min-height: 600px; padding: 0; border-radius: 0; background: var(--app-bg); box-shadow: none; border-block: 1px solid var(--line-soft); }
  .phone-shell::before, .phone-shell::after, .phone-hardware, .app-statusbar { display: none; }
  .phone-screen { border-radius: 0; }
  .mobile-view { height: 100%; padding-top: 6px; }
  .mobile-tabbar { left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom, 0px)); padding-bottom: 8px; }
  .demo-toast { bottom: calc(100px + env(safe-area-inset-bottom, 0px)); }
}

@media (max-width: 370px) {
  .mobile-view { padding-left: 14px; padding-right: 14px; }
  .quick-action > span { width: 52px; height: 52px; border-radius: 17px; }
  .spendable-hero > strong { font-size: 40px; }
  .mobile-mode-selector button { padding: 10px 8px; column-gap: 6px; }
  .mobile-mode-selector button > span { font-size: 17px; }
  .level-hero-game { grid-template-columns: 76px 1fr; padding: 14px; gap: 12px; }
  .level-orbit { width: 72px; height: 72px; }
  .level-orbit > span { font-size: 25px; }
  .tab-btn > span { width: 40px; }
}
