/* Louga Money, money.louga.app.
   The store listing's world, carried to the web. Canvas, card and money
   colours come from the app's own theme (app/lib/src/core/theme/), the
   yellow is sampled from the launcher icon, and every device or panel shows
   the app's light theme against the dark page, as the store frames do.
   Expenses are ink with a minus sign; green means money in; red means over
   budget and nothing else (docs/design-tokens.md, section 2). */

:root {
  /* Canvas: AppColorSchemes.dark */
  --page: #020817;
  --deep: #0B1426;
  --card: #101A2C;
  --card-2: #16223A;
  --line: #1E2A42;
  --ink: #F8FAFC;
  --body: #CBD5E1;
  --muted: #94A3B8;

  /* Brand: the coin */
  --brand: #F9CC21;
  --brand-hi: #FFD84A;
  --brand-ink: #0B1222;
  --brand-soft: rgba(11, 18, 34, .72);
  --brand-rule: rgba(11, 18, 34, .16);

  /* Rule-group tints on the dark canvas: the site's own, lightened from the chart ramp's hues */
  --g-amt: #F9CC21;
  --g-merch: #74AAEC;
  --g-acct: #A98EDD;
  --g-date: #3FC4D7;
  --g-ref: #F0913A;

  --font: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-ar: "IBM Plex Sans Arabic", "IBM Plex Sans", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --max: 1200px;
  --gutter: clamp(16px, 4vw, 48px);
  --top-h: 64px;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

/* The app's light theme, inside every device and panel.
   AppColorSchemes.light, AppSemantics.light, AppChartColors.light. */
.screen {
  --s-page: #FAFAFA;
  --s-card: #FFFFFF;
  --s-line: #E2E8F0;
  --s-ink: #020817;
  --s-muted: #556579;
  --s-track: rgba(100, 116, 139, .14);
  --s-up: #15803D;
  --s-down: #B91C1C;
  --s-warn: #B45309;
  --sc-blue: #2971C6;
  --sc-orange: #DA720D;
  --sc-purple: #7347AF;
  --sc-teal: #0097AC;
  --sc-yellow: #F9CC21;
  --sc-slate: #8794A6;
  color: var(--s-ink);
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
  background: var(--page);
  color: var(--ink);
  font-family: var(--font);
  font-size: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-padding-top: calc(var(--top-h) + 48px);
  scrollbar-color: #2A3854 var(--page);
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { background: var(--page); line-height: 1.55; overflow-x: hidden; }

::selection { background: var(--brand); color: var(--brand-ink); }
.close ::selection { background: var(--brand-ink); color: var(--brand); }

::-webkit-scrollbar { width: 12px; }
::-webkit-scrollbar-track { background: var(--page); }
::-webkit-scrollbar-thumb { background: #2A3854; border-radius: 99px; border: 3px solid var(--page); }

img, svg { display: block; }
[hidden] { display: none !important; }
a { color: inherit; text-underline-offset: .22em; text-decoration-thickness: 1px; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 6px; }
.close :focus-visible { outline-color: var(--brand-ink); }

.amt, .num, .io-v, .bv, .p, .goal-amt { font-variant-numeric: tabular-nums; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--brand); color: var(--brand-ink); padding: 10px 16px;
  border-radius: 10px; font-weight: 600; text-decoration: none;
}
.skip:focus { top: 12px; }

/* The Google Play action ---------------------------------------------------
   The official badge's anatomy (logo, a small "Get it on", a bold "Google
   Play", a rounded rectangle) drawn in one colour, so the page keeps its
   single brand hue and green and red keep meaning money. */

.play {
  display: inline-flex; align-items: center; gap: 13px;
  height: 62px; padding: 0 26px 0 18px; border-radius: 14px;
  background: var(--brand); color: var(--brand-ink);
  text-decoration: none; white-space: nowrap;
  box-shadow: 0 10px 28px rgba(249, 204, 33, .18), 0 2px 6px rgba(0, 0, 0, .3);
  transition: background-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
}
.play-logo { width: 30px; height: 30px; flex: none; }
.play-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1;
  font-size: 1.375rem; font-weight: 600; letter-spacing: -.015em; }
.play-text .subtext { font-size: .6875rem; font-weight: 500; letter-spacing: .07em;
  text-transform: uppercase; margin-bottom: 4px; }
.play:hover { background: var(--brand-hi); transform: translateY(-1px);
  box-shadow: 0 14px 34px rgba(249, 204, 33, .26), 0 3px 8px rgba(0, 0, 0, .32); }
.play:active { transform: translateY(0); }
.play:focus-visible { outline-color: var(--ink); outline-offset: 4px; border-radius: 16px; }

.play--small { height: 44px; padding: 0 16px 0 12px; gap: 9px; border-radius: 11px; box-shadow: none; }
.play--small .play-logo { width: 21px; height: 21px; }
.play--small .play-text { font-size: 1rem; }
.play--small .play-text .subtext { font-size: .5625rem; margin-bottom: 2px; }
.play--small:hover { box-shadow: 0 8px 20px rgba(249, 204, 33, .2); }
.play--small:focus-visible { border-radius: 13px; }

.play--ink { background: var(--brand-ink); color: var(--brand);
  box-shadow: 0 12px 30px rgba(11, 18, 34, .28); }
.play--ink:hover { background: #17233B; box-shadow: 0 16px 36px rgba(11, 18, 34, .34); }
.play--ink:focus-visible { outline-color: var(--brand-ink); }

/* Header and the month rail ----------------------------------------------- */

.top {
  position: sticky; top: 0; z-index: 50;
  background: rgba(2, 8, 23, .86);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid rgba(30, 42, 66, .8);
}
.top-in {
  max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto;
  padding: 0 var(--gutter); height: var(--top-h);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px;
}
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none;
  font-weight: 700; font-size: 1.0625rem; letter-spacing: -.015em; justify-self: start; }
.brand img { border-radius: 9px; }
.top .play--small { justify-self: end; }

.rail { display: flex; align-items: center; gap: 18px; }
.rail-label { width: 96px; text-align: end; font-size: .875rem; font-weight: 600;
  color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rail-label.is-day { color: var(--brand); }
.rail-track { position: relative; width: 390px; }
.rail-ticks { list-style: none; display: grid; grid-template-columns: repeat(30, 1fr);
  align-items: end; height: 28px; position: relative; }
.rail-ticks li { display: flex; justify-content: center; align-items: flex-end; height: 100%; }
.rail-ticks .tick { width: 1px; height: 7px; background: #33415A; border-radius: 1px;
  margin-bottom: 4px; }
.rail-ticks a { position: relative; display: flex; align-items: flex-end; justify-content: center;
  width: 100%; height: 100%; text-decoration: none; }
.rail-ticks a::before { content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: #52627D; margin-bottom: 4px; }
.rail-ticks a.is-past::before { background: var(--brand); }
.rail-ticks a.is-now::before { background: var(--brand); transform: scale(1.45);
  box-shadow: 0 0 0 4px rgba(249, 204, 33, .18); }
.rail-ticks a:hover::before { background: var(--brand-hi); transform: scale(1.3); }
.rail-ticks a .tip {
  position: absolute; bottom: calc(100% + 2px); left: 50%; translate: -50% 0;
  font-size: .75rem; font-weight: 600; color: var(--ink); white-space: nowrap;
  background: var(--card-2); border: 1px solid var(--line); padding: 3px 8px; border-radius: 7px;
  opacity: 0; pointer-events: none; transition: opacity .15s;
}
.rail-ticks a:hover .tip, .rail-ticks a:focus-visible .tip { opacity: 1; }
.rail-ticks a:focus-visible { outline-offset: 0; }
.rail-fill { position: absolute; left: 0; bottom: 0; height: 2px; border-radius: 2px;
  width: 100%; transform-origin: left center; transform: scaleX(var(--p, 0)); background: var(--brand);
  box-shadow: 0 0 10px rgba(249, 204, 33, .5); }
@media (prefers-reduced-motion: no-preference) {
  .rail-fill { transition: transform .12s linear; }
  .rail-ticks a::before { transition: background-color .25s var(--ease), transform .25s var(--ease); }
}
.rail-track::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: #1E2A42; border-radius: 2px; z-index: -1; }

/* Hero -------------------------------------------------------------------- */

.hero { position: relative; overflow: hidden; isolation: isolate;
  min-height: clamp(640px, calc(100svh - var(--top-h)), 880px); display: flex; }
.glow { position: absolute; z-index: -1; width: 760px; height: 760px; border-radius: 50%;
  background: #2563EB; opacity: .2; filter: blur(130px); top: -360px; right: -200px; }
.glow::after { content: ""; position: absolute; width: 420px; height: 420px; border-radius: 50%;
  background: var(--brand); opacity: .35; left: -520px; top: 820px; }
.hero-in {
  width: 100%; max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto;
  padding: 0 var(--gutter);
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 40px;
}
.hero-copy { align-self: center; padding: 72px 0 96px; }
.hero h1 {
  font-size: clamp(2.75rem, 5.6vw, 5.25rem); line-height: 1.02; font-weight: 700;
  letter-spacing: -.04em; text-wrap: balance;
}
.hero h1 b { color: var(--brand); font-weight: 700; }
.lede { margin-top: 28px; font-size: clamp(1.0625rem, 1.5vw, 1.25rem); line-height: 1.55;
  color: var(--body); max-width: 34em; text-wrap: pretty; }
.cta { margin-top: 40px; display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.cta-note { font-size: .9375rem; color: var(--muted); max-width: 30em; }

/* The stage: a 540 x 720 drawing, zoomed as a unit so the trail keeps its
   landing point on every screen. */
.stage { position: relative; width: 540px; height: 720px; align-self: end; justify-self: end; }
.sms-bubble {
  position: absolute; left: 0; top: 34px; width: 300px; z-index: 3;
  padding: 16px 20px 18px; border-radius: 24px; corner-shape: squircle;
  background: #F8FAFC; color: var(--brand-ink); transform: rotate(-4deg);
  box-shadow: 0 26px 50px rgba(0, 0, 0, .55), 0 4px 12px rgba(0, 0, 0, .3);
}
.sms-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.sms-av { width: 30px; height: 30px; border-radius: 50%; background: var(--brand-ink);
  display: flex; align-items: center; justify-content: center; flex: none; }
.sms-av svg { width: 16px; height: 16px; fill: none; stroke: var(--brand); stroke-width: 2.4;
  stroke-linecap: round; stroke-linejoin: round; }
.sms-who { font-size: .8125rem; font-weight: 700; letter-spacing: .04em; }
.sms-when { margin-left: auto; font-size: .8125rem; color: #64748B; }
.sms-body { font-size: .9375rem; line-height: 1.45; }
.sms-body b { font-weight: 600; }
.trail { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }

.phone {
  --bezel: 9px; --radius: 56px;
  position: absolute; left: 172px; top: 118px; width: 352px; height: 762px;
  padding: var(--bezel); border-radius: var(--radius);
  background: #07090E;
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .13), 0 40px 110px rgba(0, 0, 0, .6);
}
@supports (corner-shape: squircle) {
  .phone { --radius: 80px; corner-shape: squircle; }
  .phone .screen { corner-shape: squircle; }
}
.phone .screen { position: relative; width: 100%; height: 100%; overflow: hidden;
  border-radius: calc(var(--radius) - var(--bezel)); background: var(--s-page); }
.status { position: relative; height: 46px; }
.cutout { position: absolute; left: 50%; top: 12px; width: 96px; height: 27px;
  translate: -50% 0; border-radius: 999px; background: #000; }
.screen-content { padding: 4px 16px 0; }
.large-title { font-size: 1.625rem; font-weight: 700; letter-spacing: -.02em; margin: 4px 2px 14px; }
.day-head { display: flex; justify-content: space-between; font-size: .75rem; font-weight: 600;
  color: var(--s-muted); margin: 0 4px 8px; }
.day-head--plain { margin-top: 14px; }

.arrived {
  position: relative; padding: 16px 16px 14px; border-radius: 18px;
  background: linear-gradient(180deg, #FFFBEB, #FFFFFF);
  border: 1.5px solid rgba(249, 204, 33, .85);
  box-shadow: 0 16px 40px rgba(249, 204, 33, .2), 0 6px 18px rgba(15, 23, 42, .08);
}
.arr-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.arr-merchant { font-size: 1.1875rem; font-weight: 600; letter-spacing: -.01em; }
.arr-when { font-size: .75rem; color: var(--s-warn); font-weight: 500; margin-top: 2px; }
.arrived .amt { font-size: 1.1875rem; font-weight: 600; white-space: nowrap; }
.arr-rule { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--s-line); }
.arr-src { display: flex; align-items: center; gap: 7px; font-size: .75rem; color: var(--s-muted); }
.arr-src svg { width: 15px; height: 15px; fill: none; stroke: var(--s-warn); stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; }
.arr-src code { font-family: var(--font); font-weight: 600; color: var(--s-ink);
  background: var(--s-track); padding: 2px 8px; border-radius: 7px; }
.arr-branches { margin-left: 7px; }
.br { position: relative; display: flex; align-items: center; gap: 10px;
  padding: 9px 0 0 26px; font-size: .75rem; color: var(--s-muted); }
.br::before { content: ""; position: absolute; left: 0; top: -3px; width: 17px; height: 24px;
  border-left: 1.5px solid rgba(217, 164, 6, .6); border-bottom: 1.5px solid rgba(217, 164, 6, .6);
  border-bottom-left-radius: 8px; }
.br + .br::before { top: -10px; height: 31px; }
.arr-src--next { margin-top: 10px; }
.learned { font-size: .6875rem; color: var(--s-muted); }
.br .k { width: 58px; }
.chip { display: inline-block; font-size: .75rem; font-weight: 600; padding: 3px 10px;
  border-radius: 999px; white-space: nowrap; }
.chip--cat { background: rgba(249, 204, 33, .28); color: #7A5A00; }
.chip--acc { background: rgba(41, 113, 198, .12); color: #1F5CA3; }

.earlier { margin-top: 12px; }
.row-tx { display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 11px 14px; background: var(--s-card); border: 1px solid var(--s-line);
  border-radius: 14px; margin-bottom: 7px; }
.row-tx .n { font-size: .9375rem; font-weight: 500; }
.row-tx .c { font-size: .75rem; color: var(--s-muted); margin-top: 1px; }
.row-tx .amt { font-size: .9375rem; font-weight: 600; white-space: nowrap; }
.amt--in { color: var(--s-up); }
.earlier .n, .earlier .amt, .device-earlier .n, .device-earlier .amt { color: #64748B; }
.earlier .amt--in { color: var(--s-up); }

/* The one authored moment: the message arrives, the trail draws, the entry
   lands already filed. Every element is visible at rest; the keyframes only
   say where it came from. */
@media (prefers-reduced-motion: no-preference) {
  .sms-bubble { animation: sms-in .9s var(--ease) .15s both; }
  .trail-glow { stroke-dasharray: 1; animation: trail-draw .6s linear .75s both; }
  .trail-dots circle { transform-box: fill-box; transform-origin: center;
    animation: dot .32s var(--ease) calc(.75s + var(--i) * 30ms) both; }
  .trail-land { transform-box: fill-box; transform-origin: center; animation: dot .4s var(--ease) 1.33s both; }
  .trail-ring { transform-origin: 176px 300px; animation: ring 1.2s var(--ease) 1.45s both; }
  .arrived { animation: land .8s var(--ease) 1.3s both; }
  .arrived .chip--acc { animation: chip .5s var(--ease) 1.85s both; }
  .arrived .chip--cat, .arrived .learned { animation: chip .5s var(--ease) 2.0s both; }
  .earlier { animation: settle .9s var(--ease) 1.2s both; }
}
@keyframes sms-in {
  from { opacity: 0; transform: translate(60px, -40px) rotate(6deg); filter: blur(6px); }
}
@keyframes trail-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes dot { from { transform: scale(0); opacity: 0; } 55% { transform: scale(1.5); opacity: 1; } }
@keyframes ring { from { transform: scale(.2); opacity: 0; } 50% { opacity: 1; } }
@keyframes land {
  from { opacity: 0; transform: translateY(14px) scale(.97);
    box-shadow: 0 0 0 rgba(249, 204, 33, 0), 0 0 0 rgba(15, 23, 42, 0); }
}
@keyframes chip { from { opacity: 0; transform: translateX(-8px) scale(.9); } }
@keyframes settle { from { transform: translateY(-120px); } }

/* The month --------------------------------------------------------------- */

.month-intro {
  max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto;
  padding: 120px var(--gutter) 40px;
  display: grid; grid-template-columns: 200px minmax(0, 1fr); column-gap: 48px;
}
.month-intro h2, .month-intro p { grid-column: 2; }
.month-intro h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); font-weight: 600; letter-spacing: -.03em;
  line-height: 1.15; }
.month-intro p { margin-top: 12px; color: var(--muted); font-size: 1.0625rem; max-width: 40em; }

.day {
  max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto;
  padding: 104px var(--gutter);
  display: grid; grid-template-columns: 200px minmax(0, 1fr); column-gap: 48px;
  position: relative;
}
.day + .day::before { content: ""; position: absolute; top: 0; right: var(--gutter);
  left: calc(var(--gutter) + 248px); height: 1px; background: var(--line); }
.day--quiet { padding-top: 88px; padding-bottom: 88px; }

.date { position: sticky; top: calc(var(--top-h) + 40px); align-self: start;
  display: flex; flex-direction: column; }
.date .num { font-size: clamp(4.5rem, 7.2vw, 6rem); line-height: .86; font-weight: 700;
  letter-spacing: -.045em; color: var(--brand); }
.date .dow { margin-top: 12px; font-size: 1.125rem; font-weight: 500; color: var(--muted); }

.day h2 { font-size: clamp(1.875rem, 3.4vw, 3rem); line-height: 1.07; font-weight: 700;
  letter-spacing: -.035em; text-wrap: balance; max-width: 16em; }
.copy p, .after-tester p, .gold-copy p { margin-top: 18px; font-size: 1.0625rem; line-height: 1.65;
  color: var(--body); max-width: 36em; text-wrap: pretty; }
.copy p b, .after-tester p b { color: var(--ink); font-weight: 600; }
.copy--wide { max-width: 50em; }
.copy--wide h2 { max-width: 22em; }
.copy--wide p { max-width: 44em; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px;
  align-items: start; }
.split--flip > .copy { order: 2; }

.panel {
  background: var(--s-card); border-radius: 26px; padding: 26px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 255, 255, .05);
}
.panel-title { font-size: .8125rem; font-weight: 600; color: var(--s-muted); margin-bottom: 14px; }
.panel-title--gap { margin-top: 28px; }
.panel-foot { margin-top: 16px; font-size: .8125rem; color: var(--s-muted); line-height: 1.5; }

/* Day 1: payday */
.sms-inline {
  font-family: var(--font-ar); font-size: 1rem; line-height: 1.7; color: var(--s-ink);
  background: #F1F5F9; border-radius: 18px 18px 18px 6px; padding: 12px 16px;
}
.landed { display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin: 10px 0 24px; padding: 14px 16px; border-radius: 16px;
  background: linear-gradient(180deg, #FFFBEB, #FFFFFF); border: 1.5px solid rgba(249, 204, 33, .85); }
.landed .n { font-weight: 600; }
.landed .c { font-size: .8125rem; color: var(--s-muted); }
.landed .amt { font-weight: 600; font-size: 1.0625rem; white-space: nowrap; }
.acct-list { list-style: none; }
.acct-list li { display: grid; grid-template-columns: 32px 1fr auto; gap: 12px; align-items: center;
  padding: 11px 0; border-top: 1px solid var(--s-line); }
.acct-list li:first-child { border-top: 0; padding-top: 0; }
.acct-ico { width: 32px; height: 32px; border-radius: 10px;
  background: color-mix(in srgb, var(--i) 16%, white);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--i) 40%, transparent); }
.acct-n { font-weight: 500; font-size: .9375rem; display: flex; flex-direction: column; }
.acct-n small { font-size: .75rem; color: var(--s-muted); font-weight: 400; }
.acct-list .amt { font-weight: 600; font-size: .9375rem; }

/* Day 3: the tester */
.tester {
  margin-top: 44px; background: var(--card); border: 1px solid var(--line);
  border-radius: 28px; padding: 14px; box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
}
.tester-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px;
  background: var(--deep); border-radius: 18px; padding: 4px; }
.tester-tabs button {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 10px 12px; border-radius: 14px; font-weight: 600; font-size: .9375rem; color: var(--body);
  transition: background-color .2s var(--ease), color .2s var(--ease);
}
.tester-tabs button small { font-size: .75rem; font-weight: 400; color: var(--muted); }
.tester-tabs button small[lang="ar"] { font-family: var(--font-ar); }
.tester-tabs button:hover { background: rgba(148, 163, 184, .08); color: var(--ink); }
.tester-tabs button[aria-selected="true"] { background: var(--ink); color: var(--brand-ink); }
.tester-tabs button[aria-selected="true"] small { color: #475569; }

.tester-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 14px;
  margin-top: 14px; }
.msg-pane { padding: 18px 16px 12px; }
.pane-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  margin-bottom: 12px; }
.pane-label { font-size: .8125rem; font-weight: 600; color: var(--muted); }
.link-btn { font-size: .875rem; font-weight: 600; color: var(--brand); text-decoration: underline;
  text-decoration-color: rgba(249, 204, 33, .4); text-underline-offset: .25em; padding: 2px 0; }
.link-btn:hover { text-decoration-color: var(--brand); }

.msg-read, .msg-edit {
  display: block; width: 100%; min-height: 132px;
  background: #F8FAFC; color: var(--brand-ink); border-radius: 20px; padding: 18px 20px;
  font-family: var(--font); font-size: 1.0625rem; line-height: 1.9;
  border: 0; box-shadow: 0 12px 30px rgba(0, 0, 0, .35);
}
.msg-read[dir="rtl"], .msg-edit[dir="rtl"] { font-family: var(--font-ar); font-size: 1.125rem; }
.msg-edit { resize: vertical; caret-color: #B45309; outline: 2px solid var(--brand); outline-offset: 2px; }
.msg-edit::selection { background: rgba(249, 204, 33, .5); color: var(--brand-ink); }

.msg-read mark {
  color: inherit; background-color: transparent; border-radius: 5px; padding: 2px 1px;
  background-repeat: no-repeat; background-size: 100% 100%;
  box-decoration-break: clone; -webkit-box-decoration-break: clone;
}
.msg-read mark[data-g="amt"], .msg-read mark[data-g="cur"] {
  background-image: linear-gradient(rgba(249, 204, 33, .55), rgba(249, 204, 33, .55));
  box-shadow: inset 0 -2px 0 #C79A00; }
.msg-read mark[data-g="merch"] {
  background-image: linear-gradient(rgba(41, 113, 198, .16), rgba(41, 113, 198, .16));
  box-shadow: inset 0 -2px 0 #2971C6; }
.msg-read mark[data-g="acct"] {
  background-image: linear-gradient(rgba(115, 71, 175, .16), rgba(115, 71, 175, .16));
  box-shadow: inset 0 -2px 0 #7347AF; }
.msg-read mark[data-g="date"], .msg-read mark[data-g="time"] {
  background-image: linear-gradient(rgba(0, 151, 172, .16), rgba(0, 151, 172, .16));
  box-shadow: inset 0 -2px 0 #0097AC; }
.msg-read mark[data-g="ref"] {
  background-image: linear-gradient(rgba(218, 114, 13, .16), rgba(218, 114, 13, .16));
  box-shadow: inset 0 -2px 0 #DA720D; }
.msg-read .nomatch { color: #64748B; }

/* The reading sweep: each captured part fills in, in the order the rule
   reads it. */
@media (prefers-reduced-motion: no-preference) {
  .msg-read.is-reading mark { animation: read .55s var(--ease) calc(var(--i) * 110ms + 80ms) both; }
  .msg-read[dir="rtl"].is-reading mark { animation-name: read-rtl; }
  .entry.is-reading > div { animation: fill .5s var(--ease) calc(var(--i) * 90ms + 260ms) both; }
}
@keyframes read { from { background-size: 0% 100%; box-shadow: inset 0 0 0 transparent; } }
@keyframes read-rtl { from { background-size: 0% 100%; background-position: right; box-shadow: inset 0 0 0 transparent; } to { background-position: right; } }
@keyframes fill { from { opacity: 0; transform: translateY(6px); } }

.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 14px; }
.g {
  font-family: var(--mono); font-size: .8125rem; font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.legend .g::before { content: ""; width: 8px; height: 8px; border-radius: 3px; background: currentColor; }
.legend .g { font-family: var(--font); font-weight: 500; color: var(--muted); }
.legend .g--amt::before { background: var(--g-amt); }
.legend .g--merch::before { background: var(--g-merch); }
.legend .g--acct::before { background: var(--g-acct); }
.legend .g--date::before { background: var(--g-date); }
.legend .g--ref::before { background: var(--g-ref); }
code.g { padding: 1px 7px; border-radius: 6px; font-size: .875em; }
code.g--amt { color: var(--g-amt); background: rgba(249, 204, 33, .12); }
code.g--merch { color: var(--g-merch); background: rgba(116, 170, 236, .13); }
code.g--acct { color: var(--g-acct); background: rgba(169, 142, 221, .14); }
code.g--date { color: var(--g-date); background: rgba(63, 196, 215, .13); }

.pattern { margin-top: 16px; }
.pattern summary { cursor: pointer; font-size: .875rem; font-weight: 600; color: var(--muted);
  list-style: none; display: inline-flex; align-items: center; gap: 8px; padding: 4px 0; }
.pattern summary::-webkit-details-marker { display: none; }
.pattern summary::before { content: ""; width: 7px; height: 7px; border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor; rotate: -45deg; transition: rotate .2s var(--ease); }
.pattern[open] summary::before { rotate: 45deg; }
.pattern summary:hover { color: var(--ink); }
.pattern code {
  display: block; margin-top: 10px; padding: 14px 16px; border-radius: 14px;
  background: var(--deep); border: 1px solid var(--line);
  font-family: var(--mono); font-size: .8125rem; line-height: 1.6; color: var(--body);
  white-space: pre-wrap; word-break: break-all; direction: ltr; text-align: left;
}
.pattern code .pg { font-weight: 500; }
.pattern code bdi { font-family: var(--font-ar); color: #E2E8F0; }
.pattern code .pg[data-g="amt"], .pattern code .pg[data-g="cur"] { color: var(--g-amt); }
.pattern code .pg[data-g="merch"] { color: var(--g-merch); }
.pattern code .pg[data-g="acct"] { color: var(--g-acct); }
.pattern code .pg[data-g="date"], .pattern code .pg[data-g="time"] { color: var(--g-date); }
.pattern code .pg[data-g="ref"] { color: var(--g-ref); }

.entry-pane { background: var(--s-card); border-radius: 20px; padding: 20px 22px 8px; }
.entry-title { display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  font-size: .8125rem; font-weight: 600; color: var(--s-muted); padding-bottom: 12px;
  border-bottom: 1px solid var(--s-line); }
.entry-title .is-miss { color: var(--s-warn); }
.entry-rule { font-weight: 500; text-align: end; }
.entry > div { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 12px; align-items: baseline;
  padding: 11px 0; border-bottom: 1px solid var(--s-line); }
.entry > div:last-child { border-bottom: 0; }
.entry dt { font-size: .8125rem; color: var(--s-muted); }
.entry dd { font-size: 1rem; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.entry dd small { display: block; font-size: .75rem; font-weight: 400; color: var(--s-muted); margin-top: 1px; }
.entry dd small::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 2px;
  margin-inline-end: 6px; background: var(--dot, transparent); vertical-align: 1px; }
.entry dd small.plain::before { display: none; }
.entry .big dd { font-size: 1.625rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.entry .muted dd { color: var(--s-muted); font-weight: 400; font-size: .9375rem; }
.entry .miss dd { color: var(--s-muted); font-weight: 400; font-size: .9375rem; line-height: 1.5; }

.after-tester { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 48px; margin-top: 28px; }
.after-tester p { margin-top: 0; font-size: 1rem; }

/* Day 7: merchants */
.merge { display: grid; grid-template-columns: auto 80px minmax(0, 1fr); align-items: center; }
.raw { list-style: none; display: grid; gap: 12px; }
.raw li { height: 42px; display: flex; align-items: center; }
.raw code { font-family: var(--mono); font-size: .875rem; color: var(--body); background: var(--deep);
  border: 1px solid var(--line); padding: 8px 13px; border-radius: 11px; white-space: nowrap; }
.merge-lines { width: 80px; height: 150px; }
.merge-lines path { fill: none; stroke: var(--brand); stroke-opacity: .7; stroke-width: 1.5;
  stroke-dasharray: 1 6; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.merged { background: var(--s-card); border-radius: 18px; padding: 18px 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .4); }
.merged .n { font-size: 1.1875rem; font-weight: 600; }
.merged .c { margin-top: 8px; font-size: .8125rem; color: var(--s-muted); display: flex;
  align-items: center; gap: 10px; flex-wrap: wrap; }

/* Day 16: budgets */
.bud { margin-bottom: 18px; }
.bud-line { display: flex; justify-content: space-between; align-items: center; gap: 12px;
  font-size: .9375rem; margin-bottom: 8px; }
.bud-line span:first-child { font-weight: 500; }
.bud-line span:last-child { color: var(--s-muted); font-variant-numeric: tabular-nums;
  display: inline-flex; align-items: center; gap: 6px; }
.bud--over .bud-line span:last-child { color: var(--s-down); font-weight: 600; }
.bud-line svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2;
  stroke-linecap: round; stroke-linejoin: round; }
.track { height: 10px; border-radius: 999px; background: var(--s-track); overflow: hidden; }
.track > span { display: block; height: 100%; border-radius: 999px; }
.track--goal { height: 12px; margin-top: 10px; }
.goal-line { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.goal-amt { font-size: 1.5rem; font-weight: 700; letter-spacing: -.02em; }
.goal-of { font-size: .875rem; color: var(--s-muted); }

/* Day 22: gold */
.gold { margin-top: 44px; }
.karats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.karat { display: flex; flex-direction: column; gap: 4px; padding: 26px 26px 24px;
  border-radius: 24px; background: var(--card); border: 1px solid var(--line); }
.karat .k { font-size: 1.125rem; font-weight: 700; color: var(--muted); }
.karat .p { font-size: clamp(1.5rem, 3.2vw, 2.625rem); font-weight: 700; letter-spacing: -.035em;
  margin-top: 18px; line-height: 1; }
.karat .u { font-size: .875rem; color: var(--muted); }
.karat--on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand);
  box-shadow: 0 24px 60px rgba(249, 204, 33, .18); }
.karat--on .k, .karat--on .u { color: var(--brand-soft); }
.gold-copy { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 64px;
  margin-top: 40px; align-items: start; }
.gold-copy > p:not(.fine) { grid-column: 1; }
.gold-copy > p:first-child { margin-top: 0; }
.gold-rows { grid-column: 2; grid-row: 1; background: var(--s-page); border-radius: 22px;
  padding: 12px 12px 5px; box-shadow: 0 24px 60px rgba(0, 0, 0, .4); }
.gold-copy .fine { grid-column: 2; grid-row: 2; font-size: .875rem; color: var(--muted); margin-top: 16px; }

/* Day 25: pending, inside the device, the one row lit and the rest dimmed
   the way the store frames focus a screen */
.device { justify-self: start; width: 100%; max-width: 360px; aspect-ratio: 9 / 19.5;
  display: flex; padding: 9px; border-radius: 52px;
  background: #07090E; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .13), 0 40px 100px rgba(0, 0, 0, .55); }
@supports (corner-shape: squircle) { .device, .device-screen { corner-shape: squircle; } .device { border-radius: 76px; } }
.device-screen { position: relative; flex: 1; border-radius: 43px; background: var(--s-page); overflow: hidden; }
.device-screen::after { content: ""; position: absolute; left: 50%; bottom: 9px; width: 34%; height: 5px;
  translate: -50% 0; border-radius: 999px; background: #0F172A; opacity: .85; }
@supports (corner-shape: squircle) { .device-screen { border-radius: 67px; } }
.device-in { padding: 4px 16px 26px; }
.pending { background: var(--s-card); border-radius: 18px; padding: 16px;
  border: 1.5px solid rgba(249, 204, 33, .85);
  box-shadow: 0 16px 40px rgba(249, 204, 33, .18), 0 6px 18px rgba(15, 23, 42, .08); }
.device-earlier { margin-top: 18px; }
.row-tx--skipped .amt { text-decoration: line-through; text-decoration-thickness: 1px; }
.next-dates { margin-top: 36px; padding-top: 28px; border-top: 1px solid var(--line); }
.nd-lead { margin: 0 0 16px; font-size: 1rem; color: var(--ink); font-weight: 500; }
.nd { list-style: none; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.nd li { display: flex; flex-direction: column; align-items: center; padding: 10px 4px 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.nd .m { font-size: .75rem; font-weight: 600; color: var(--muted); }
.nd .d { font-size: 1.625rem; font-weight: 700; letter-spacing: -.03em; line-height: 1.15;
  font-variant-numeric: tabular-nums; }
.nd li.short { border-color: rgba(249, 204, 33, .7); background: rgba(249, 204, 33, .08); }
.nd li.short .d { color: var(--brand); }
.nd-note { margin-top: 14px !important; font-size: .9375rem !important; color: var(--muted) !important; }
.pending-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.pending-head .panel-title { margin: 0; }
.pending-due { font-size: .75rem; font-weight: 600; color: var(--s-warn); background: #FFFBEB;
  border: 1px solid #FDE68A; padding: 3px 10px; border-radius: 999px; }
.pending-row { display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 14px 0; border-top: 1px solid var(--s-line); border-bottom: 1px solid var(--s-line); }
.pending-row .n { font-weight: 600; font-size: 1.0625rem; }
.pending-row .c { font-size: .8125rem; color: var(--s-muted); }
.pending-row .amt { font-weight: 600; font-size: 1.0625rem; white-space: nowrap; }
.pending-actions { display: flex; gap: 10px; margin-top: 16px; }
.btn { height: 42px; padding: 0 18px; border-radius: 12px; font-weight: 600; font-size: .9375rem;
  border: 1px solid #7F8DA1; color: var(--s-ink); background: var(--s-card);
  transition: background-color .15s, transform .15s var(--ease); }
.btn:hover { background: #F1F5F9; }
.btn:active { transform: scale(.98); }
.btn--primary { background: #0F172A; border-color: #0F172A; color: #F8FAFC; }
.btn--primary:hover { background: #1E293B; }
.btn:focus-visible { outline-color: #0F172A; }
.pending-result { margin-top: 14px; font-size: .9375rem; display: flex; gap: 10px; align-items: baseline;
  flex-wrap: wrap; }
.pending-result .link-btn { color: #1F5CA3; text-decoration-color: rgba(31, 92, 163, .4); }
.pending.is-done .pending-row .n, .pending.is-done .pending-row .amt { color: #64748B; }
.pending.is-confirmed .pending-row .amt { text-decoration: none; }
.pending.is-skipped .pending-row .amt { text-decoration: line-through; }

/* Day 30: report */
.report { margin-top: 44px; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; }
.report-side { display: grid; gap: 20px; align-content: start; }
.io { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding-bottom: 22px;
  margin-bottom: 22px; border-bottom: 1px solid var(--s-line); }
.io > div { display: flex; flex-direction: column; }
.io-l { font-size: .8125rem; color: var(--s-muted); }
.io-v { font-size: clamp(1.125rem, 1.9vw, 1.5rem); font-weight: 700; letter-spacing: -.025em; white-space: nowrap; }
.bars { list-style: none; display: grid; gap: 12px; }
.bars li { display: grid; grid-template-columns: 104px minmax(0, 1fr) 56px; gap: 14px; align-items: center;
  font-size: .9375rem; }
.bt { height: 12px; border-radius: 999px; background: var(--s-track); overflow: hidden; }
.bt > span { display: block; height: 100%; border-radius: 999px; }
.bv { text-align: end; color: var(--s-muted); }
.merch { list-style: none; }
.merch li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 11px 0; border-top: 1px solid var(--s-line); font-size: .9375rem; }
.merch li:first-child { border-top: 0; padding-top: 0; }
.merch li span:first-child { font-weight: 500; }
.merch small { font-size: .8125rem; color: var(--s-muted); margin-inline-start: 8px; font-weight: 400; }
.merch .amt { color: var(--s-muted); }
.mom { display: flex; align-items: flex-end; gap: 9px; height: 120px; }
.mom span { flex: 1; height: var(--h); border-radius: 8px 8px 3px 3px; background: rgba(100, 116, 139, .2); }
.mom span.now { background: var(--sc-yellow); }
.mom-x { display: flex; gap: 9px; margin-top: 8px; }
.mom-x span { flex: 1; text-align: center; font-size: .75rem; color: var(--s-muted); }
.mom-x span.now { color: var(--s-warn); font-weight: 600; }

/* The close: the icon's yellow, drenched --------------------------------- */

.close {
  margin-top: 64px; color: var(--brand-ink);
  background:
    radial-gradient(55% 60% at 18% 12%, rgba(255, 236, 150, .9), transparent 70%),
    var(--brand);
}
.close-in { max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto;
  padding: 128px var(--gutter) 120px; }
.close h2 { font-size: clamp(2.75rem, 7vw, 6rem); line-height: .98; font-weight: 700;
  letter-spacing: -.045em; max-width: 10em; text-wrap: balance; }
.close-sub { margin-top: 24px; font-size: clamp(1.0625rem, 1.6vw, 1.3125rem); color: var(--brand-soft);
  max-width: 30em; }
.nots { list-style: none; display: grid; grid-template-columns: 1fr 1fr; column-gap: 64px; margin-top: 64px; }
.nots li { display: flex; gap: 18px; padding: 24px 0; border-top: 2px solid var(--brand-rule); }
.nots svg { flex: none; width: 26px; height: 26px; fill: none; stroke: var(--brand-ink); stroke-width: 2.6;
  stroke-linecap: round; stroke-linejoin: round; margin-top: 1px; }
.nots b { display: block; font-size: 1.25rem; font-weight: 700; letter-spacing: -.015em; }
.nots span { display: block; margin-top: 4px; color: var(--brand-soft); font-size: 1rem; line-height: 1.5; }
.close-cta { margin-top: 56px; display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.close-cta p { font-weight: 600; color: var(--brand-soft); }

/* Footer ------------------------------------------------------------------ */

.foot { border-top: 1px solid var(--line); }
.foot-in { max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; padding: 36px var(--gutter) 48px;
  display: flex; align-items: center; gap: 16px 40px; flex-wrap: wrap; }
.foot .brand { font-size: 1rem; }
.foot .brand img { border-radius: 7px; }
.foot-links { list-style: none; display: flex; gap: 8px 28px; flex-wrap: wrap; }
.foot-links a { color: var(--body); font-size: .9375rem; text-decoration: none; }
.foot-links a:hover { color: var(--ink); text-decoration: underline; }
.foot-note { flex-basis: 100%; font-size: .8125rem; color: var(--muted); }

/* Narrower screens -------------------------------------------------------- */

@media (max-width: 1100px) {
  .rail-track { width: 300px; }
  .rail-label { width: 84px; }
  .hero-in { grid-template-columns: minmax(0, 1fr) 460px; gap: 24px; }
  .stage { zoom: .85; }
}

@media (max-width: 900px) {
  :root { --top-h: 104px; }
  .top-in { grid-template-columns: 1fr auto; grid-template-rows: 56px 48px; height: auto; row-gap: 0; }
  .rail { grid-column: 1 / -1; grid-row: 2; justify-content: space-between; gap: 14px;
    border-top: 1px solid rgba(30, 42, 66, .8); }
  .rail-label { width: auto; min-width: 72px; text-align: start; }
  .rail-track { flex: 1; width: auto; }

  .hero { min-height: 0; display: block; }
  .hero-in { grid-template-columns: 1fr; gap: 8px; }
  .hero-copy { padding: 48px 0 16px; }
  .stage { justify-self: center; zoom: .74; margin-top: 12px; }

  .month-intro, .day { grid-template-columns: 1fr; }
  .month-intro h2, .month-intro p { grid-column: 1; }
  .month-intro { padding-top: 80px; padding-bottom: 8px; }
  .day, .day--quiet { padding-top: 56px; padding-bottom: 56px; }
  .day + .day::before { display: none; }
  .date { position: static; flex-direction: row; align-items: baseline; gap: 12px; margin-bottom: 18px; }
  .date .num { font-size: clamp(3.5rem, 16vw, 4.25rem); }
  .date .dow { margin-top: 0; font-size: 1.0625rem; }

  .split, .gold-copy, .after-tester, .report { grid-template-columns: minmax(0, 1fr); }
  .split { gap: 32px; }
  .split--flip > .copy { order: 0; }
  .tester-grid { grid-template-columns: minmax(0, 1fr); }
  .gold-copy > p:not(.fine), .gold-rows, .gold-copy .fine { grid-column: 1; grid-row: auto; }
  .gold-rows { margin-top: 24px; }
  .device { justify-self: center; max-width: 320px; }
  .nots { grid-template-columns: 1fr; margin-top: 44px; }
  .close-in { padding: 88px var(--gutter) 80px; }
}

@media (max-width: 359px) {
  .play--small .play-text { position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip-path: inset(50%); white-space: nowrap; }
  .play--small { width: 44px; padding: 0; justify-content: center; }
}

@media (max-width: 560px) {
  .hero-copy { padding: 28px 0 4px; }
  .lede { margin-top: 18px; font-size: 1.0625rem; }
  .cta { margin-top: 24px; gap: 12px; }
  .cta-note { font-size: .875rem; }
  .stage { margin-top: 0; }
  .hero h1 { font-size: clamp(2.375rem, 11vw, 2.75rem); }
  .cta .play { width: 100%; justify-content: center; }
  .stage { zoom: .62; }
  .rail-ticks a .tip { display: none; }
  .tester { padding: 8px; border-radius: 22px; margin-top: 32px; }
  .tester-tabs button { font-size: .8125rem; padding: 8px 4px; }
  .msg-pane { padding: 14px 6px 8px; }
  .msg-read, .msg-edit { font-size: 1rem; padding: 14px 16px; }
  .entry-pane { padding: 16px 16px 4px; }
  .entry > div { grid-template-columns: 78px minmax(0, 1fr); }
  .panel { padding: 20px; border-radius: 22px; }
  .merge { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .merge-lines { display: none; }
  .raw { display: flex; flex-wrap: wrap; gap: 8px; }
  .raw li { height: auto; }
  .karats { gap: 8px; }
  .karat { padding: 16px 14px; border-radius: 18px; }
  .karat .k { font-size: .9375rem; }
  .karat .p { font-size: 1.5rem; margin-top: 10px; letter-spacing: -.025em; }
  .karat .u { font-size: .75rem; }
  .nd { gap: 5px; }
  .nd li { padding: 8px 2px 10px; border-radius: 11px; }
  .nd .d { font-size: 1.25rem; }
  .bars li { grid-template-columns: 92px minmax(0, 1fr) 48px; gap: 10px; font-size: .875rem; }
  .io-v { font-size: 1.1875rem; }
}
