/* ═══════════════════════════════════════════════════════════════
   Sankalp — design system
   Gateway geometry, a blue→orange spectrum, and a lot of restraint.
   ═══════════════════════════════════════════════════════════════ */

/* Aeonik (trial). The trial cut carries 66 glyphs — A–Z a–z 0–9 space , - .
   and nothing else. unicode-range pins it to exactly those, so ₹ ? % ' ( ) : ;
   — and · resolve to the fallback instead of tofu, and figures fall back to a
   family with tabular numerals (Aeonik's trial digits are proportional). */
@font-face {
  font-family: "Aeonik"; font-style: normal; font-weight: 100 350; font-display: swap;
  src: url("/assets/fonts/Aeonik-Light.otf") format("opentype");
  unicode-range: U+0020, U+002C-002E, U+0030-0039, U+0041-005A, U+0061-007A;
}
@font-face {
  font-family: "Aeonik"; font-style: italic; font-weight: 100 350; font-display: swap;
  src: url("/assets/fonts/Aeonik-LightItalic.otf") format("opentype");
  unicode-range: U+0020, U+002C-002E, U+0030-0039, U+0041-005A, U+0061-007A;
}
@font-face {
  font-family: "Aeonik"; font-style: normal; font-weight: 351 550; font-display: swap;
  src: url("/assets/fonts/Aeonik-Regular.otf") format("opentype");
  unicode-range: U+0020, U+002C-002E, U+0030-0039, U+0041-005A, U+0061-007A;
}
@font-face {
  font-family: "Aeonik"; font-style: italic; font-weight: 351 550; font-display: swap;
  src: url("/assets/fonts/Aeonik-RegularItalic.otf") format("opentype");
  unicode-range: U+0020, U+002C-002E, U+0030-0039, U+0041-005A, U+0061-007A;
}
@font-face {
  font-family: "Aeonik"; font-style: normal; font-weight: 551 900; font-display: swap;
  src: url("/assets/fonts/Aeonik-Bold.otf") format("opentype");
  unicode-range: U+0020, U+002C-002E, U+0030-0039, U+0041-005A, U+0061-007A;
}
@font-face {
  font-family: "Aeonik"; font-style: italic; font-weight: 551 900; font-display: swap;
  src: url("/assets/fonts/Aeonik-BoldItalic.otf") format("opentype");
  unicode-range: U+0020, U+002C-002E, U+0030-0039, U+0041-005A, U+0061-007A;
}

:root {
  --paper:      #FAFAFB;
  --paper-2:    #F0F1F5;
  --surface:    #FFFFFF;
  --surface-2:  #F4F5F9;
  --surface-3:  #E7E9F1;
  --ink:        #1E2033;
  --ink-2:      #3A3F5C;
  --ink-3:      #6E7490;
  --ink-4:      #A5AAC2;
  --line:       #E4E6EE;
  --line-2:     #D2D6E3;

  --blue:       #3B49C8;
  --blue-2:     #6A88E2;
  --blue-3:     #A5BBFC;
  --blue-4:     #D5E2FF;
  --violet:     #9B7BE8;
  --saffron:    #E8823C;
  --saffron-2:  #F2A05A;

  --good:       #197A57;
  --good-bg:    #E6F3EE;
  --warn:       #A55C18;
  --warn-bg:    #FBEFE2;
  --bad:        #B3352B;
  --bad-bg:     #FBEBE9;

  --spectrum: linear-gradient(100deg, #4C6BEA 0%, var(--violet) 50%, #F0965A 100%);

  --r-xs: 6px; --r-sm: 9px; --r-md: 13px; --r-lg: 18px; --r-xl: 26px;
  --shadow-1: 0 1px 2px rgba(30,32,51,.05), 0 1px 1px rgba(30,32,51,.03);
  --shadow-2: 0 12px 34px -14px rgba(30,32,51,.18), 0 2px 6px -2px rgba(30,32,51,.07);
  --shadow-3: 0 40px 90px -30px rgba(30,32,51,.30), 0 8px 24px -12px rgba(30,32,51,.14);

  /* Aeonik throughout, display and text. Instrument Sans is a backstop only:
     it fills the glyphs the trial cut is missing (₹ ? % ' etc.) and carries
     columns of figures, which the trial's proportional digits can't align.
     Its weight is matched to whatever Aeonik sits at, so a fallback ₹ never
     reads heavier than the numerals beside it. */
  --sans: "Aeonik", "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Aeonik", "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
  --num: "Instrument Sans", ui-sans-serif, system-ui, sans-serif;

  --ease: cubic-bezier(.22,.61,.36,1);
  --ease-out: cubic-bezier(.16,1,.3,1);
  --wrap: 1180px;
}

[data-theme="dark"] {
  --paper:      #121320;
  --paper-2:    #171A28;
  --surface:    #1A1C2B;
  --surface-2:  #222536;
  --surface-3:  #2D3145;
  --ink:        #F1F2F8;
  --ink-2:      #B7BCD2;
  --ink-3:      #868CA8;
  --ink-4:      #5B6180;
  --line:       #272A3C;
  --line-2:     #343850;

  --blue:       #8CA6F5;
  --blue-2:     #6A88E2;
  --blue-3:     #A5BBFC;
  --blue-4:     #2A3255;
  --violet:     #AF92F0;
  --saffron:    #F2A05A;
  --saffron-2:  #F7B67C;

  --good:       #5FD3A0;
  --good-bg:    #13291F;
  --warn:       #E5A755;
  --warn-bg:    #2A2013;
  --bad:        #F2837A;
  --bad-bg:     #2B1614;

  --shadow-1: 0 1px 2px rgba(0,0,0,.45);
  --shadow-2: 0 12px 34px -14px rgba(0,0,0,.72), 0 2px 6px -2px rgba(0,0,0,.42);
  --shadow-3: 0 40px 90px -30px rgba(0,0,0,.88), 0 8px 24px -12px rgba(0,0,0,.55);
}

/* ── reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 92px; }
body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01" 1, "cv01" 1;
  min-height: 100dvh;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; padding: 0; }
[hidden] { display: none !important; }
::selection { background: color-mix(in srgb, var(--violet) 22%, transparent); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }

/* ── type ──────────────────────────────────────────────── */
/* Aeonik is a geometric grotesque: at display sizes it wants noticeably
   tighter tracking and a shorter leading than a serif would. Weight stays at
   400 wherever a figure appears, so the fallback ₹ matches its neighbours. */
.display {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(29px, 4.1vw, 44px);
  line-height: 1.06;
  letter-spacing: -0.033em;
  text-wrap: balance;
}
.display--xl { font-size: clamp(33px, 5.1vw, 56px); letter-spacing: -0.037em; }
/* The serif carried emphasis as an italic. A geometric grotesque reads that as
   a mechanical oblique, so the key figure takes the brand spectrum instead —
   and the fallback ₹ inherits the same gradient, being one text run. */
.display em {
  font-style: normal;
  background: var(--spectrum); -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.h2 {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(23px, 2.8vw, 31px); line-height: 1.14; letter-spacing: -0.028em;
}
.eyebrow {
  font-size: 11.5px; font-weight: 600; letter-spacing: .13em; text-transform: uppercase;
  color: var(--ink-3);
}
.lede { color: var(--ink-2); font-size: 16px; line-height: 1.6; max-width: 46ch; text-wrap: pretty; }
.lede--wide { max-width: 60ch; }
/* Columns of figures need lining tabular numerals, which the Aeonik trial
   doesn't carry — those surfaces run entirely in the fallback so a table
   never mixes two families mid-number. Standalone figures stay in Aeonik. */
.num, .table, .ctip, .imp__v { font-family: var(--num); font-variant-numeric: tabular-nums; }
.num { letter-spacing: -0.01em; }

/* ═══════════════ INDIC MOTIFS ═══════════════ */

/* The aura — saffron overhead falling through periwinkle into paper.
   Sarvam's atmospheric wash, rebuilt from stacked radials. */
.aura { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.aura::before {
  content: ""; position: absolute; inset: -12% -12% auto -12%; height: 132%;
  /* the wash has to reach zero before the box ends, or it leaves a seam */
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 46%, transparent 92%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 46%, transparent 92%);
  background:
    radial-gradient(78% 52% at 50% -6%,  rgba(232,130,60,.40) 0%,  rgba(232,130,60,0) 62%),
    radial-gradient(62% 44% at 14% 4%,   rgba(242,160,90,.26) 0%,  rgba(242,160,90,0) 68%),
    radial-gradient(96% 62% at 52% 40%,  rgba(150,175,250,.44) 0%, rgba(150,175,250,0) 72%),
    radial-gradient(60% 40% at 88% 24%,  rgba(155,123,232,.24) 0%, rgba(155,123,232,0) 70%);
}
[data-theme="dark"] .aura::before {
  background:
    radial-gradient(78% 52% at 50% -6%,  rgba(232,130,60,.26) 0%,  rgba(232,130,60,0) 62%),
    radial-gradient(62% 44% at 14% 4%,   rgba(242,160,90,.16) 0%,  rgba(242,160,90,0) 68%),
    radial-gradient(96% 62% at 52% 40%,  rgba(106,136,226,.34) 0%, rgba(106,136,226,0) 72%),
    radial-gradient(60% 40% at 88% 24%,  rgba(155,123,232,.20) 0%, rgba(155,123,232,0) 70%);
}
.aura--hero::before { height: 108%; opacity: .72; }

/* torana — the gateway */
.torana { width: 100%; height: auto; }
.torana__g path { stroke-dasharray: 2400; stroke-dashoffset: 2400; animation: draw 2.6s var(--ease-out) forwards; }
.torana__g path:nth-child(1) { animation-delay: .05s }
.torana__g path:nth-child(2) { animation-delay: .16s }
.torana__g path:nth-child(3) { animation-delay: .27s }
.torana__g path:nth-child(4) { animation-delay: .38s }
.torana__g path:nth-child(5) { animation-delay: .49s }
.torana__g path:nth-child(6) { animation-delay: .60s }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* mandala — lotus by rotation */
.mandala { width: 100%; height: auto; }
.mandala--spin { animation: spin 220s linear infinite; }
@keyframes spin { to { transform: rotate(360deg) } }

/* ornament — the manuscript flourish */
.ornament { width: 208px; height: auto; color: var(--ink-3); margin: 0 auto; opacity: .8; }
.rule-orn { display: flex; align-items: center; justify-content: center; padding: 6px 0 18px; }

/* jaali — the pierced screen */
.jaali { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--ink-4); opacity: .5; }

/* arch meter */
.archmeter { width: 46px; height: 54px; display: block; }

/* ── brand ─────────────────────────────────────────────── */
.brand { display: inline-flex; align-items: center; gap: 9px; }
.brand__mark { width: 22px; height: 22px; color: var(--ink); }
.brand__mark svg { width: 100%; height: 100%; }
.brand__name {
  font-family: var(--sans); font-size: 19px; font-weight: 500; letter-spacing: -0.028em;
  line-height: 1;
}
.brand--lg .brand__mark { width: 28px; height: 28px; }
.brand--lg .brand__name { font-size: 24px; }

/* ── buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 20px; border-radius: 100px;
  font-size: 14.5px; font-weight: 500; letter-spacing: -0.005em;
  border: 1px solid transparent; white-space: nowrap;
  transition: background .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease), transform .12s var(--ease), opacity .18s;
}
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .4; pointer-events: none; }
.btn--primary { background: var(--ink); color: var(--paper); }
.btn--primary:hover { background: color-mix(in srgb, var(--ink) 86%, var(--violet)); }
.btn--quiet { background: var(--surface); border-color: var(--line-2); color: var(--ink); }
.btn--quiet:hover { background: var(--surface-2); border-color: var(--ink-4); }
.btn--ghost { color: var(--ink-2); border-color: transparent; }
.btn--ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn--danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.btn--danger:hover { background: var(--bad-bg); }
.btn--sm { height: 34px; padding: 0 15px; font-size: 13.5px; }
.btn--full { width: 100%; }

.iconbtn {
  width: 36px; height: 36px; border-radius: 100px; display: grid; place-items: center;
  color: var(--ink-2); transition: background .18s, color .18s;
}
.iconbtn:hover { background: var(--surface-2); color: var(--ink); }
.i-moon { display: none; }
[data-theme="dark"] .i-sun { display: none; }
[data-theme="dark"] .i-moon { display: block; }

/* ── fields ────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field__label { font-size: 12.5px; font-weight: 600; letter-spacing: .02em; color: var(--ink-2); }
.field__hint { font-size: 12.5px; color: var(--ink-3); min-height: 1em; }
.field__wrap { position: relative; display: flex; }
.input {
  width: 100%; height: 46px; padding: 0 14px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-sm);
  font-size: 15px; color: var(--ink); font-variant-numeric: tabular-nums;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), background .18s;
}
.input::placeholder { color: var(--ink-4); }
.input:hover { border-color: var(--ink-4); }
.input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--blue) 13%, transparent); }
select.input { appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 17px) 21px, calc(100% - 12px) 21px;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 34px;
}
.reveal {
  position: absolute; right: 4px; top: 4px; bottom: 4px; padding: 0 12px; border-radius: var(--r-xs);
  font-size: 12.5px; font-weight: 600; color: var(--ink-3);
}
.reveal:hover { color: var(--ink); background: var(--surface-2); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
@media (max-width: 620px) { .grid-2 { grid-template-columns: 1fr; } }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chip {
  height: 31px; padding: 0 13px; border-radius: 100px; border: 1px solid var(--line-2);
  font-size: 13px; font-weight: 500; color: var(--ink-2); background: var(--surface);
  transition: all .16s var(--ease);
}
.chip:hover { border-color: var(--ink); color: var(--ink); }

/* ═══════════════ AUTH ═══════════════ */
.auth { display: grid; grid-template-columns: 1.02fr .98fr; min-height: 100dvh; }
.auth__art {
  position: relative; overflow: hidden; background: var(--paper-2);
  border-right: 1px solid var(--line);
}
.auth__stage { position: absolute; inset: 0; z-index: 2; display: grid; grid-template-rows: 1fr auto; }
.auth__mandala {
  justify-self: center; align-self: end; width: min(38%, 250px);
  transform: translateY(46%); /* the rose window sits in the crown of the arch */
  animation: bloom 1.8s var(--ease-out) both .35s;
}
@keyframes bloom {
  from { opacity: 0; transform: translateY(46%) scale(.86) rotate(-8deg) }
  to   { opacity: 1; transform: translateY(46%) scale(1) rotate(0) }
}
.auth__torana { align-self: end; width: 100%; }

.auth__panel { position: relative; display: grid; place-items: center; padding: 48px 40px; background: var(--paper); }
.auth__panel > * { position: relative; z-index: 1; }
.auth__inner { width: 100%; max-width: 384px; animation: rise .7s var(--ease-out) both .15s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.auth__title { font-family: var(--display); font-weight: 400; font-size: 37px; line-height: 1.05; letter-spacing: -.036em; margin: 34px 0 14px; }
.auth__title em { font-style: normal; background: var(--spectrum); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth__sub { color: var(--ink-2); font-size: 15px; line-height: 1.6; margin-bottom: 32px; }
.auth__form { display: flex; flex-direction: column; gap: 15px; }
.auth__form .btn { margin-top: 6px; }
.auth__error {
  font-size: 13.5px; color: var(--bad); background: var(--bad-bg);
  padding: 10px 13px; border-radius: var(--r-sm); border: 1px solid color-mix(in srgb, var(--bad) 22%, transparent);
}
.auth__foot { margin-top: 26px; font-size: 12.5px; color: var(--ink-3); }
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth__art { display: none; }
  .auth__panel { padding: 40px 24px; align-items: start; padding-top: 12vh; }
}

/* ═══════════════ ONBOARDING ═══════════════ */
.onb { display: grid; grid-template-columns: 320px 1fr; min-height: 100dvh; }
.onb__rail {
  background: var(--paper-2); border-right: 1px solid var(--line);
  padding: 32px 28px; display: flex; flex-direction: column; gap: 46px;
}
.onb__steps { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.onb__steps li {
  display: flex; gap: 13px; align-items: flex-start; padding: 13px 12px; border-radius: var(--r-md);
  transition: background .25s var(--ease); opacity: .45;
}
.onb__steps li.is-active { opacity: 1; background: var(--surface); box-shadow: var(--shadow-1); }
.onb__steps li.is-done { opacity: .75; }
.onb__num {
  width: 25px; height: 25px; flex: none; border-radius: 100px; display: grid; place-items: center;
  font-size: 12px; font-weight: 600; border: 1px solid var(--line-2); color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.onb__steps li.is-active .onb__num { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.onb__steps li.is-done .onb__num { background: var(--good-bg); color: var(--good); border-color: transparent; }
.onb__steps b { display: block; font-size: 14px; font-weight: 600; }
.onb__steps em { font-style: normal; font-size: 12.5px; color: var(--ink-3); }
.onb__note { margin-top: auto; font-size: 12.5px; color: var(--ink-3); line-height: 1.55; }
.onb__stage { display: grid; place-items: center; padding: 40px 32px; }
.onb__panels { width: 100%; max-width: 560px; }
.onb__panel { display: none; }
.onb__panel.is-active { display: block; animation: rise .55s var(--ease-out) both; }
.onb__panel .display { margin: 12px 0 12px; }
.onb__panel .lede { margin-bottom: 30px; }
.onb__actions { display: flex; gap: 10px; margin-top: 34px; }
.onb__tally { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; row-gap: 8px; justify-content: space-between; align-items: baseline; font-size: 14px; }
.onb__tally b { font-size: 19px; font-family: var(--display); font-weight: 500; letter-spacing: -.026em; }
@media (max-width: 860px) {
  .onb { grid-template-columns: 1fr; }
  .onb__rail { flex-direction: row; align-items: center; gap: 20px; padding: 16px 20px; overflow-x: auto; }
  .onb__rail .brand { flex: none; }
  .onb__steps { flex-direction: row; gap: 6px; }
  .onb__steps em { display: none; }
  .onb__note { display: none; }
  .onb__stage { padding: 32px 20px; align-items: start; }
}

.bigfield { display: flex; align-items: baseline; gap: 10px; border-bottom: 1.5px solid var(--line-2); padding-bottom: 12px; transition: border-color .2s; flex-wrap: wrap; }
.bigfield:focus-within { border-color: var(--ink); }
.bigfield__cur { font-family: var(--display); font-size: 35px; color: var(--ink-3); letter-spacing: -.02em; }
.bigfield__input {
  flex: 1 1 160px; min-width: 0; border: none; background: none; outline: none;
  font-family: var(--display); font-size: clamp(32px, 5.6vw, 46px); letter-spacing: -.035em;
  font-variant-numeric: tabular-nums;
}
.bigfield__input::placeholder { color: var(--ink-4); }
.bigfield__hint { font-size: 13px; color: var(--ink-3); font-weight: 500; }

.expenses { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.exp { display: grid; grid-template-columns: 1fr 168px 36px; gap: 10px; align-items: center; }
.exp .iconbtn { width: 34px; height: 34px; }
@media (max-width: 520px) { .exp { grid-template-columns: 1fr 118px 32px; gap: 7px; } }

/* ═══════════════ APP SHELL ═══════════════ */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line);
}
.topbar__in {
  max-width: var(--wrap); margin: 0 auto; padding: 0 28px; height: 62px;
  display: flex; align-items: center; gap: 24px;
}
.tnav { display: flex; gap: 2px; margin-left: 12px; }
.tnav__a {
  padding: 7px 13px; border-radius: 100px; font-size: 14px; font-weight: 500;
  color: var(--ink-3); text-decoration: none; transition: color .18s, background .18s;
}
.tnav__a:hover { color: var(--ink); }
.tnav__a.is-active { color: var(--ink); background: var(--surface-2); }
.topbar__end { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.who { display: flex; align-items: center; gap: 9px; padding-left: 12px; border-left: 1px solid var(--line); }
.who__dot { width: 7px; height: 7px; border-radius: 100px; background: var(--spectrum); flex: none; }
.who__id { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.who__out { font-size: 13px; color: var(--ink-3); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2); }
.who__out:hover { color: var(--ink); }
.lbl-short { display: none; }
@media (max-width: 940px) {
  .topbar__in { flex-wrap: wrap; height: auto; padding: 9px 18px 4px; gap: 8px; row-gap: 2px; }
  .tnav { order: 3; width: 100%; margin-left: -6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
  .tnav::-webkit-scrollbar { display: none; }
  .topbar__end { gap: 6px; }
  .who { padding-left: 8px; }
  .who__id { display: none; }
  .lbl-full { display: none; }
  .lbl-short { display: inline; }
  html { scroll-padding-top: 104px; }
  .sec { scroll-margin-top: 96px; }
}

.app { position: relative; }
.aura--page { position: absolute; inset: 0 0 auto 0; height: 760px; z-index: 0; }
.aura--page::before { opacity: .58; }
[data-theme="dark"] .aura--page::before { opacity: .8; }
.topbar, .wrap { position: relative; z-index: 1; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 28px 100px; }
@media (max-width: 700px) { .wrap { padding: 0 18px 72px; } }
.sec { padding-top: 62px; scroll-margin-top: 80px; }
.sec__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.sec__sub { color: var(--ink-3); font-size: 14px; margin-top: 5px; max-width: 60ch; }
.sec__actions { display: flex; gap: 8px; }

.hero { display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: end; padding: 46px 0 34px; }
.hero .display { margin: 10px 0 14px; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; align-items: start; } }
.hero__verdict {
  display: flex; flex-direction: column; gap: 6px; padding: 18px 22px; border-radius: var(--r-lg);
  border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-1);
  min-width: 250px; max-width: 340px;
}
.hero__verdict .v__tag { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.hero__verdict .v__dot { width: 8px; height: 8px; border-radius: 100px; }
.hero__verdict .v__line { font-size: 14.5px; color: var(--ink-2); line-height: 1.5; }
.hero__verdict.is-good .v__tag { color: var(--good); } .hero__verdict.is-good .v__dot { background: var(--good); }
.hero__verdict.is-warn .v__tag { color: var(--warn); } .hero__verdict.is-warn .v__dot { background: var(--warn); }
.hero__verdict.is-bad  .v__tag { color: var(--bad);  } .hero__verdict.is-bad  .v__dot { background: var(--bad); }

/* ── stat row ─────────────────────────────────────────── */
.statrow {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
}
@media (max-width: 900px) { .statrow { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .statrow { grid-template-columns: 1fr; } }
.stat { background: var(--surface); padding: 20px 20px 18px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.stat__k { font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); }
.stat__v { font-family: var(--display); font-size: 25px; line-height: 1.22; letter-spacing: -.03em; font-variant-numeric: tabular-nums; word-break: break-word; }
.stat__n { font-size: 12.5px; color: var(--ink-3); }
.stat--accent .stat__v { background: var(--spectrum); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat--good .stat__v { color: var(--good); } .stat--bad .stat__v { color: var(--bad); }

/* ── cards ────────────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 24px; margin-top: 18px; box-shadow: var(--shadow-1);
}
.card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; flex-wrap: wrap; }
.card__title { font-size: 16px; font-weight: 600; letter-spacing: -.005em; }
.card__sub { font-size: 13.5px; color: var(--ink-3); margin-top: 3px; }
.card__foot { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ink-3); }

/* ── money map ────────────────────────────────────────── */
/* The bar is a row of gateways: every segment arches at the top, so the
   month reads as a colonnade rather than a stack bar. */
.moneymap { display: flex; gap: 3px; height: 62px; align-items: flex-end; }
.mm {
  position: relative; transition: flex-grow .5s var(--ease-out); min-width: 3px; height: 100%;
  display: grid; place-items: center; overflow: hidden;
  /* fixed elliptical spring, so every bay arches the same way — the browser
     scales the radii down on narrow columns, which is what a colonnade does */
  border-radius: 32px 32px 5px 5px / 26px 26px 5px 5px;
}
.mm__l { position: relative; z-index: 2; font-size: 11.5px; font-weight: 700; color: #fff; padding: 0 8px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.mm[data-kind="expense"] { background: var(--surface-3); }
.mm[data-kind="expense"] .mm__l { color: var(--ink-2); }
.mm[data-kind="head"] { background: var(--surface-2); border: 1px solid var(--line); }
.mm[data-kind="head"] .mm__l { color: var(--ink-3); }
.mm[data-kind="head"] .jaali { opacity: .42; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; }
.lg { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); }
.lg__s { width: 9px; height: 9px; border-radius: 3px; flex: none; }

/* ── goals ────────────────────────────────────────────── */
.goals { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
@media (max-width: 560px) { .goals { grid-template-columns: 1fr; } }
.goal {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 20px; display: flex; flex-direction: column; gap: 16px; position: relative; overflow: hidden;
  box-shadow: var(--shadow-1); transition: box-shadow .25s var(--ease), transform .25s var(--ease), border-color .25s;
}
.goal:hover { box-shadow: var(--shadow-2); border-color: var(--line-2); }
.goal__bar { position: absolute; inset: 0 auto 0 0; width: 3px; }
.goal__top { display: flex; gap: 14px; align-items: flex-start; }
.goal__name { font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.goal__meta { font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.goal__meter { flex: none; position: relative; width: 46px; height: 54px; }
.goal__meter span {
  position: absolute; inset: 0; display: grid; place-items: center; padding-top: 9px;
  font-family: var(--num); font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums;
  letter-spacing: -.01em; pointer-events: none;
}
.goal__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.goal__cell { min-width: 0; }
.goal__k { font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }
.goal__v { font-family: var(--display); font-size: 21px; letter-spacing: -.028em; font-variant-numeric: tabular-nums; margin-top: 1px; }
.goal__v small { font-family: var(--sans); font-size: 12px; color: var(--ink-3); letter-spacing: 0; }
.goal__note { font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.goal__note b { font-weight: 600; color: var(--ink); }
.goal__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; }
.goal__ops { display: flex; gap: 2px; opacity: 0; transition: opacity .2s; }
.goal:hover .goal__ops, .goal:focus-within .goal__ops { opacity: 1; }
@media (hover: none) { .goal__ops { opacity: 1; } }
.goal__ops .iconbtn { width: 30px; height: 30px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 25px; padding: 0 11px;
  border-radius: 100px; font-size: 12px; font-weight: 600; letter-spacing: .01em;
}
.pill--good { background: var(--good-bg); color: var(--good); }
.pill--warn { background: var(--warn-bg); color: var(--warn); }
.pill--bad { background: var(--bad-bg); color: var(--bad); }
.pill--mute { background: var(--surface-2); color: var(--ink-3); }

.empty { text-align: center; padding: 52px 24px 56px; border: 1px dashed var(--line-2); border-radius: var(--r-lg); }
.empty__art { width: 132px; margin: 0 auto 22px; }
.areatop { opacity: .9; }
.empty h3 { font-family: var(--display); font-weight: 400; font-size: 23px; letter-spacing: -.026em; margin-bottom: 6px; }
.empty p { color: var(--ink-3); font-size: 14px; margin-bottom: 20px; }

/* ── charts ───────────────────────────────────────────── */
.card--chart { padding: 20px 20px 12px; }
.chartbox { width: 100%; overflow-x: auto; }
.chartbox svg { width: 100%; min-width: 520px; height: auto; display: block; }
.ax { font-size: 10.5px; fill: var(--ink-3); font-variant-numeric: tabular-nums; }
.axline { stroke: var(--line); stroke-width: 1; }
.gridline { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 4; }
.chart-tip { fill: var(--ink); font-size: 11px; font-weight: 600; }
.marker { stroke: var(--ink-4); stroke-width: 1; stroke-dasharray: 3 3; }
.markerlbl { font-size: 10.5px; fill: var(--ink-3); }
.area { transition: opacity .2s; }
.progline { fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* ── timeline ─────────────────────────────────────────── */
.timeline { display: flex; flex-direction: column; }
.tl {
  display: grid; grid-template-columns: 108px 1fr; gap: 18px; padding: 15px 0;
  border-top: 1px solid var(--line); align-items: start;
}
.tl:first-child { border-top: none; padding-top: 0; }
.tl__when { font-size: 13px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; padding-top: 1px; }
.tl__when em { display: block; font-style: normal; font-weight: 400; font-size: 12px; color: var(--ink-3); }
.tl__items { display: flex; flex-direction: column; gap: 9px; }
.tl__item { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.tl__dot { width: 8px; height: 8px; border-radius: 100px; flex: none; }
.tl__item b { font-weight: 600; }
.tl__item span { color: var(--ink-3); font-size: 13px; }
@media (max-width: 560px) { .tl { grid-template-columns: 1fr; gap: 8px; } }

/* ── tables ───────────────────────────────────────────── */
.tablewrap { overflow-x: auto; margin: 0 -4px; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.table th, .table td { padding: 10px 12px; text-align: right; white-space: nowrap; }
.table th:first-child, .table td:first-child { text-align: left; padding-left: 4px; position: sticky; left: 0; background: var(--surface); }
.table th {
  font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3);
  border-bottom: 1px solid var(--line-2); position: sticky; top: 0; background: var(--surface); z-index: 1;
}
.table th:first-child { z-index: 2; }
.table td { border-bottom: 1px solid var(--line); }
.table tbody tr:hover td { background: var(--surface-2); }
.table tbody tr:hover td:first-child { background: var(--surface-2); }
.table .t-mute { color: var(--ink-3); }
.table .t-good { color: var(--good); font-weight: 600; }
.table .t-bad { color: var(--bad); font-weight: 600; }
.table tr.is-now td { background: color-mix(in srgb, var(--blue) 6%, var(--surface)); }
.table tr.is-mark td:first-child::after { content: "◆"; margin-left: 7px; color: var(--ink-4); font-size: 9px; vertical-align: middle; }

/* ── segmented control ────────────────────────────────── */
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border-radius: 100px; border: 1px solid var(--line); }
.seg__b {
  height: 28px; padding: 0 14px; border-radius: 100px; font-size: 13px; font-weight: 500;
  color: var(--ink-3); transition: background .2s var(--ease), color .2s var(--ease);
}
.seg__b:hover { color: var(--ink); }
.seg__b.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.seg--sm .seg__b { height: 25px; padding: 0 11px; font-size: 12.5px; }

/* ── chart hover ──────────────────────────────────────── */
.chartwrap { position: relative; }
.cguide { position: absolute; width: 1px; background: var(--ink-4); pointer-events: none; }
.ctip {
  position: absolute; top: 10px; z-index: 3; pointer-events: none;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-md);
  padding: 10px 12px; box-shadow: var(--shadow-2); min-width: 168px;
  font-size: 12.5px; font-variant-numeric: tabular-nums;
}
.ctip__h { font-weight: 700; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 7px; }
.ctip__r { display: flex; align-items: center; gap: 7px; padding: 2px 0; }
.ctip__r i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.ctip__r span { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctip__r b { margin-left: auto; font-weight: 600; }
.ctip__t { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; }

.tablewrap--tall { max-height: 440px; overflow-y: auto; }

/* ── what-if ──────────────────────────────────────────── */
.whatif { display: grid; grid-template-columns: 1.15fr .85fr; gap: 18px; align-items: start; }
@media (max-width: 860px) { .whatif { grid-template-columns: 1fr; } }
.whatif .card { margin-top: 0; }
.card--sliders { display: flex; flex-direction: column; gap: 26px; }
.slider__top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.slider__top label { font-size: 13.5px; font-weight: 600; }
.slider__top output { font-family: var(--display); font-size: 20px; font-weight: 500; letter-spacing: -.026em; font-variant-numeric: tabular-nums; }
.slider__delta { font-size: 12.5px; color: var(--ink-3); margin-top: 9px; min-height: 1.2em; }
.slider__delta b { font-weight: 600; }
.slider__delta .up { color: var(--good); } .slider__delta .down { color: var(--bad); }

.range { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: none; cursor: pointer; }
.range::-webkit-slider-runnable-track { height: 4px; border-radius: 100px; background: var(--surface-3); }
.range::-moz-range-track { height: 4px; border-radius: 100px; background: var(--surface-3); }
.range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px; border-radius: 100px; margin-top: -8px;
  background: var(--surface); border: 1.5px solid var(--ink); box-shadow: var(--shadow-1);
  transition: transform .14s var(--ease);
}
.range::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 100px; background: var(--surface);
  border: 1.5px solid var(--ink); box-shadow: var(--shadow-1);
}
.range:hover::-webkit-slider-thumb { transform: scale(1.14); }
.range:active::-webkit-slider-thumb { transform: scale(.96); }

.impact { display: flex; flex-direction: column; margin-top: 16px; }
.imp { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.imp:last-child { border-bottom: none; }
.imp__k { font-size: 13.5px; color: var(--ink-2); }
.imp__v { display: flex; align-items: baseline; gap: 9px; font-variant-numeric: tabular-nums; }
.imp__was { font-size: 13px; color: var(--ink-4); text-decoration: line-through; }
.imp__is { font-size: 16px; font-weight: 600; }
.imp__is.up { color: var(--good); } .imp__is.down { color: var(--bad); }

/* ── drawer ───────────────────────────────────────────── */
.scrim {
  position: fixed; inset: 0; z-index: 60; background: rgba(22,19,15,.34);
  backdrop-filter: blur(3px); animation: fade .25s var(--ease) both;
}
[data-theme="dark"] .scrim { background: rgba(0,0,0,.6); }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.drawer {
  position: fixed; z-index: 61; top: 0; right: 0; bottom: 0; width: min(460px, 100vw);
  background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow-3);
  display: flex; flex-direction: column; animation: slidein .38s var(--ease-out) both;
}
@keyframes slidein { from { transform: translateX(28px); opacity: 0 } to { transform: none; opacity: 1 } }
.drawer__head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.drawer__title { font-family: var(--display); font-weight: 400; font-size: 22px; letter-spacing: -.028em; }
.drawer__body { flex: 1; overflow-y: auto; padding: 22px; display: flex; flex-direction: column; gap: 18px; }
.drawer__foot { padding: 16px 22px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; background: var(--surface); flex-wrap: wrap; }
.drawer__foot .btn--danger { margin-right: auto; }
.dsec { display: flex; flex-direction: column; gap: 14px; }
.dsec__t { font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.dhr { height: 1px; background: var(--line); }
.summaryline { display: flex; justify-content: space-between; align-items: baseline; padding: 13px 15px; background: var(--surface-2); border-radius: var(--r-sm); font-size: 14px; }
.summaryline b { font-family: var(--display); font-weight: 500; font-size: 18px; letter-spacing: -.024em; font-variant-numeric: tabular-nums; }
@media (max-width: 520px) { .drawer { width: 100vw; } }

/* ── toast ────────────────────────────────────────────── */
.toast {
  position: fixed; z-index: 80; bottom: 26px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--paper); padding: 11px 19px; border-radius: 100px;
  font-size: 13.5px; font-weight: 500; box-shadow: var(--shadow-3);
  animation: toastin .4s var(--ease-out) both;
}
@keyframes toastin { from { opacity: 0; transform: translate(-50%, 12px) } to { opacity: 1; transform: translate(-50%, 0) } }

/* ── footer ───────────────────────────────────────────── */
.foot { margin-top: 72px; padding-top: 22px; border-top: 1px solid var(--line); display: flex; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-3); }
.foot__dot { color: var(--ink-4); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
