/* Khata365 landing. Tokens mirror packages/khata_design_system (colors.dart). Light only.
   Surfaces are separated by tone steps, not lines or resting shadows. One accent: the action. */
:root {
  --ground: #F4F5F9;
  --tone: #EBEDF3;
  --surface: #FFFFFF;
  --surface-2: #ECEEF4;
  --ink: #12151C;
  --ink-soft: #2A3042;
  --text-2: #5C6578;
  --text-3: #687182;
  --accent: #E85D04;
  --accent-strong: #C2410C;
  --accent-muted: #FFF4E8;
  --income: #059669;
  --income-strong: #047857;
  --income-muted: #ECFDF5;
  --expense: #DC2626;
  --expense-strong: #B91C1C;
  --expense-muted: #FEF2F2;
  --warning: #B45309;
  --warning-muted: #FFFBEB;
  --card-dark: #161A24;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);

  --font: "Plus Jakarta Sans", ui-sans-serif, sans-serif;
  --font-arab: "Plus Jakarta Sans", "Noto Naskh Arabic", sans-serif;
  --font-urdu: "Plus Jakarta Sans", "Noto Nastaliq Urdu", "Noto Naskh Arabic", sans-serif;

  /* Five page sizes. The phone mock uses its own fixed px sizes, as it depicts the app. */
  --fs-display: clamp(2.5rem, 4.4vw, 3.875rem);
  --fs-h2: clamp(2rem, 4.2vw, 3.25rem);
  --fs-title: 1.5rem;
  --fs-body: 1.125rem;
  --fs-small: 0.875rem;

  --gutter: clamp(16px, 4vw, 32px);
  --max: 1200px;
  --r: 16px;
  --r-in: 12px;
  --section: clamp(56px, 6.5vw, 104px);

  color-scheme: light;
  accent-color: var(--accent-strong);
  scrollbar-color: #C4C8D3 var(--ground);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, p, ul, dl, dd { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
::selection { background: #FFD9BF; color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 3px; border-radius: 6px; }

.ic { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: 999px; background: var(--ink); color: #fff; }
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: calc(var(--max) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }

h2 { font-size: var(--fs-h2); line-height: 1.04; letter-spacing: -0.03em; font-weight: 800; text-wrap: balance; max-width: 16ch; }
h3 { font-size: var(--fs-body); font-weight: 700; letter-spacing: -0.01em; }
.lead { color: var(--ink-soft); max-width: 58ch; text-wrap: pretty; }
.hint, .note { color: var(--text-2); font-size: var(--fs-small); }
.note { margin-top: 24px; }

/* Buttons: flat, one fill, fully round everywhere. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 24px; border-radius: 999px;
  font-weight: 700; font-size: var(--fs-body); letter-spacing: -0.005em;
  transition: transform 160ms var(--ease-out), background-color 200ms ease, color 200ms ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }
.btn--sm { min-height: 42px; padding: 0 18px; font-size: var(--fs-small); }
.btn--primary { background: var(--accent-strong); color: #fff; }
.btn--ghost { background: var(--surface-2); color: var(--ink); }
.btn .ic { transition: transform 200ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .btn--primary:hover { background: #A8380A; }
  .btn--ghost:hover { background: #E1E4EC; }
  .btn:not(.btn--sm):hover .ic { transform: translateX(2px); }
}

/* Nav */
.nav { position: sticky; top: 0; z-index: 50; background: var(--ground); transition: background-color 200ms ease; }
.nav.is-scrolled { background: var(--surface); }
.nav__inner { display: flex; align-items: center; gap: 24px; height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: var(--fs-body); letter-spacing: -0.02em; }
.brand__mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 800; font-size: var(--fs-body); }
.nav__links { display: flex; gap: 4px; margin-inline-start: auto; }
.nav__links a { padding: 8px 14px; border-radius: 999px; color: var(--ink-soft); font-weight: 600; font-size: var(--fs-small); transition: background-color 160ms ease, color 160ms ease; }
@media (hover: hover) and (pointer: fine) { .nav__links a:hover { background: var(--surface-2); color: var(--ink); } }
@media (max-width: 860px) {
  .nav__links { display: none; }
  .nav .btn { margin-inline-start: auto; }
}

/* Reveal: heading, text, then picture; once. Content is visible without JS. */
.js [data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity 600ms var(--ease-out), transform 700ms var(--ease-out); transition-delay: calc(var(--d, 0) * 70ms); }
.js [data-reveal].is-in { opacity: 1; transform: none; }

/* Hero */
.hero { padding-block: clamp(32px, 6vw, 80px) var(--section); }
.hero__grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: clamp(40px, 6vw, 88px); align-items: center; }
.hero__title { font-size: var(--fs-display); line-height: 1.02; letter-spacing: -0.035em; font-weight: 800; }
.hero__title span { display: inline-block; }
.hero__copy .lead { margin-top: 24px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.trust { display: flex; flex-wrap: wrap; gap: 10px 24px; margin-top: 32px; color: var(--ink-soft); font-weight: 600; font-size: var(--fs-small); }
.trust li { display: inline-flex; align-items: center; gap: 8px; }
.hero__visual { position: relative; display: flex; justify-content: center; padding-block: 8px; }
@media (max-width: 960px) {
  .hero__grid { grid-template-columns: 1fr; }
}
@media (max-width: 380px) { .hero__title { font-size: 2.125rem; } }

/* Phone (a picture of the app: keeps the app's own sizes and row rules) */
.phone { --pw: 324px; position: relative; width: var(--pw); max-width: 100%; padding: 11px; border-radius: 50px; background: var(--ink); }
.phone::before { content: ""; position: absolute; top: 20px; left: 50%; width: 92px; height: 26px; translate: -50% 0; border-radius: 20px; background: var(--ink); z-index: 3; }
.phone__screen { position: relative; display: flex; flex-direction: column; height: 660px; border-radius: 40px; overflow: hidden; background: var(--ground); font-size: 13px; line-height: 1.35; }
.sb { display: flex; justify-content: space-between; align-items: center; padding: 16px 26px 0; height: 46px; font-weight: 700; font-size: 13px; }
.sb__icons { display: inline-flex; gap: 4px; }
.sb__icons i { width: 16px; height: 9px; border-radius: 3px; background: var(--ink); }
.sb__icons i:nth-child(1) { width: 14px; }
.sb__icons i:nth-child(2) { width: 12px; }
.sb__icons i:nth-child(3) { width: 22px; }
.app-top { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; }
.app-top__greet { color: var(--text-2); font-size: 12px; }
.app-top__name { font-weight: 800; font-size: 17px; letter-spacing: -0.02em; }
.sync-pill { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px; background: var(--income-muted); color: var(--income-strong); font-weight: 700; font-size: 11px; transition: background-color 250ms ease, color 250ms ease; }
.sync-pill .ic { width: 13px; height: 13px; }
.sync-pill.is-busy { background: var(--accent-muted); color: var(--accent-strong); }
.sync-pill.is-busy .ic { animation: spin 900ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.cash-card { margin: 0 14px; padding: 16px 16px 15px; border-radius: 20px; color: #fff; background: var(--card-dark); }
.cash-card__row { display: flex; justify-content: space-between; align-items: center; color: rgba(255, 255, 255, 0.72); font-weight: 600; font-size: 12px; }
.eye { display: grid; place-items: center; width: 30px; height: 30px; margin: -6px -6px -6px 0; border-radius: 999px; color: rgba(255, 255, 255, 0.85); transition: background-color 160ms ease, transform 160ms var(--ease-out); }
.eye:active { transform: scale(0.92); }
.eye .ic { width: 17px; height: 17px; }
@media (hover: hover) and (pointer: fine) { .eye:hover { background: rgba(255, 255, 255, 0.12); } }
.cash-card__amt { margin-top: 4px; font-size: 30px; font-weight: 800; letter-spacing: -0.03em; }
.cash-card__split { display: flex; gap: 10px; white-space: nowrap; margin-top: 10px; color: rgba(255, 255, 255, 0.72); font-size: 11px; }
.cash-card__split span { display: inline-flex; align-items: center; gap: 5px; }
.cash-card__split b { color: #fff; font-weight: 700; }
.dot { width: 7px; height: 7px; border-radius: 99px; }
.dot--in { background: #34D399; }
.dot--out { background: #F87171; }

.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 12px 14px 0; }
.quick__tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 2px 9px; border-radius: 14px; background: var(--surface); font-weight: 700; font-size: 11px; }
.quick__tile .ic { width: 19px; height: 19px; color: var(--ink-soft); }
.quick__tile--accent { background: var(--accent); color: #fff; }
.quick__tile--accent .ic { color: #fff; }

.mini { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 8px 14px 0; }
.mini__cell { padding: 10px 12px; border-radius: 14px; background: var(--surface); }
.mini__cell span { display: block; color: var(--text-2); font-size: 11px; font-weight: 600; }
.mini__cell b { font-size: 15px; font-weight: 800; letter-spacing: -0.02em; }

.activity { flex: 1; min-height: 0; margin: 8px 14px 0; padding: 10px 12px 0; border-radius: 16px 16px 0 0; background: var(--surface); overflow: hidden; }
.activity__head { display: flex; justify-content: space-between; font-weight: 700; font-size: 12.5px; margin-bottom: 4px; }
.activity__all { color: var(--accent-strong); font-size: 11.5px; }
.feed { display: flex; flex-direction: column; }
.feed li { display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid #F0F1F5; }
.feed li:first-child { border-top: 0; }
.feed__ic { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; }
.feed__ic .ic { width: 15px; height: 15px; }
.feed__ic--in { background: var(--income-muted); color: var(--income); }
.feed__ic--out { background: var(--expense-muted); color: var(--expense); }
.feed__ic--credit { background: var(--warning-muted); color: var(--warning); }
.feed__t { font-weight: 700; font-size: 12.5px; }
.feed__s { display: block; color: var(--text-3); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed__a { font-weight: 800; font-size: 12.5px; text-align: end; }
.feed__a small { display: block; color: var(--text-3); font-weight: 600; font-size: 10.5px; }
.amt-in { color: var(--income-strong); }
.amt-out { color: var(--expense-strong); }
.amt-credit { color: var(--warning); }
.feed li.is-new { animation: feedIn 500ms var(--ease-out) both; }
@keyframes feedIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

.tabbar { display: grid; grid-template-columns: repeat(4, 1fr); padding: 8px 8px 18px; background: var(--surface); border-top: 1px solid #E8EAEF; }
.tabbar span { display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--text-3); font-size: 10px; font-weight: 600; }
.tabbar .ic { width: 19px; height: 19px; }
.tabbar .is-on { color: var(--accent-strong); }

[data-money] { transition: filter 200ms ease, opacity 200ms ease; }
.is-private [data-money] { filter: blur(7px); opacity: 0.7; }

/* Transient notification over the phone: the one shadow on the page, and only while shown. */
.nudge {
  position: absolute; left: max(0px, calc(50% - 300px)); bottom: 168px; z-index: 4;
  display: flex; align-items: center; gap: 12px; width: 268px; padding: 12px 14px;
  border-radius: var(--r); background: var(--surface);
  box-shadow: 0 24px 48px -20px rgba(18, 21, 28, 0.35);
  opacity: 0; transform: translateY(8px) scale(0.96); transform-origin: right center;
  transition: opacity 180ms ease, transform 180ms ease;
}
.nudge.is-on { opacity: 1; transform: none; transition: opacity 260ms var(--ease-out), transform 300ms var(--ease-out); }
.nudge__icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: #25D366; color: #fff; flex: none; }
.nudge__title { font-weight: 700; font-size: 13px; }
.nudge__text { color: var(--text-2); font-size: 12.5px; }
@media (max-width: 640px) { .nudge { left: 50%; bottom: -14px; translate: -50% 0; } }

/* Sections */
.section { padding-block: var(--section); }
.section--tone { background: var(--tone); }
.section--ink { background: var(--ink); color: #fff; }
.head { display: grid; gap: 20px; margin-bottom: clamp(32px, 4vw, 56px); }
.head--inv .lead { color: rgba(255, 255, 255, 0.82); }

.split { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(40px, 6vw, 96px); align-items: center; }
.split--flip > :first-child { order: 2; }
.split__copy { display: grid; gap: 22px; align-content: start; }
@media (max-width: 960px) {
  .split { grid-template-columns: 1fr; }
  .split--flip > :first-child { order: 0; }
}
.points { display: grid; gap: 16px; margin-top: 8px; }
.points li { position: relative; padding-inline-start: 26px; color: var(--ink-soft); max-width: 52ch; }
.points li::before { content: ""; position: absolute; inset-inline-start: 2px; top: 0.62em; width: 8px; height: 8px; border-radius: 99px; background: var(--ink); }
.points b { color: var(--ink); }

/* Real screenshots: a row of devices, swipeable on narrow screens. */
.shots { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 1fr); gap: clamp(12px, 2vw, 24px); max-width: calc(var(--max) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 36px; }
.shots::-webkit-scrollbar { display: none; }
.shot { scroll-snap-align: center; }
.shot figure { margin: 0; display: grid; gap: 14px; justify-items: center; }
.shot__frame { display: block; width: 100%; max-width: 240px; padding: 7px; border-radius: 34px; background: var(--ink); }
.shot__frame img { display: block; width: 100%; height: auto; border-radius: 27px; background: var(--ground); }
.shot figcaption { font-weight: 700; font-size: var(--fs-small); color: var(--ink-soft); }
.shot:nth-child(even) .shot__frame { transform: translateY(28px); }
.shot:nth-child(even) figcaption { transform: translateY(28px); }
@media (max-width: 960px) {
  .shots { grid-auto-columns: 62%; }
  .shot:nth-child(even) .shot__frame, .shot:nth-child(even) figcaption { transform: none; }
}
@media (max-width: 560px) { .shots { grid-auto-columns: 74%; } }

/* Parties ledger: one white panel, rows on it, a toned detail area. */
.ledger { padding: 12px; border-radius: var(--r); background: var(--surface); }
.ledger__totals { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.total { display: grid; gap: 2px; padding: 16px 18px; border-radius: var(--r-in); text-align: start; background: var(--ground); transition: background-color 220ms ease, transform 160ms var(--ease-out); }
.total:active { transform: scale(0.98); }
.total span { font-size: var(--fs-small); font-weight: 600; color: var(--text-2); }
.total b { font-size: var(--fs-title); letter-spacing: -0.02em; }
.total--in.is-on { background: var(--income-muted); }
.total--in b { color: var(--income-strong); }
.total--out.is-on { background: var(--expense-muted); }
.total--out b { color: var(--expense-strong); }
.ledger__list { margin-top: 6px; }
.prow { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 14px; width: 100%; padding: 12px 10px; border-radius: var(--r-in); text-align: start; transition: background-color 160ms ease, transform 160ms var(--ease-out); }
.prow:active { transform: scale(0.99); }
.prow[aria-pressed="true"] { background: var(--ground); }
@media (hover: hover) and (pointer: fine) { .prow:hover { background: var(--ground); } }
.avatar { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; font-weight: 800; font-size: var(--fs-small); background: var(--surface-2); color: var(--ink-soft); }
.prow__n { font-weight: 700; }
.prow__s { color: var(--text-3); font-size: var(--fs-small); }
.prow__a { font-weight: 800; text-align: end; }
.prow__a small { display: block; color: var(--text-3); font-weight: 600; font-size: var(--fs-small); }
.ledger__detail { margin-top: 8px; padding: 16px; border-radius: var(--r-in); background: var(--ground); }
.ld__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.ld__name { font-weight: 800; }
.ld__remind { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: #E7F8EE; color: #0F7A3D; font-weight: 700; font-size: var(--fs-small); transition: transform 160ms var(--ease-out), background-color 200ms ease; }
.ld__remind:active { transform: scale(0.96); }
.ld__remind.is-sent { background: var(--surface-2); color: var(--ink-soft); }
.ld__rows { display: grid; gap: 2px; }
.ld__row { display: grid; grid-template-columns: 1fr auto auto; gap: 16px; padding: 7px 0; font-size: var(--fs-small); }
.ld__row span:first-child small { display: block; color: var(--text-3); font-size: var(--fs-small); }
.ld__row .bal { color: var(--text-2); min-width: 100px; text-align: end; }
.ld__row > :nth-child(2) { font-weight: 700; text-align: end; }
.ld__rows.is-swap { animation: fadeUp 240ms var(--ease-out) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.ld__bubble { margin-top: 10px; padding: 10px 12px; border-radius: 12px 12px 12px 4px; background: #DCF8C6; color: #14301F; font-size: var(--fs-small); animation: pop 220ms var(--ease-out) both; transform-origin: left bottom; }
@keyframes pop { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: none; } }
@media (max-width: 520px) {
  .ld__row { grid-template-columns: 1fr auto; }
  .ld__row .bal { display: none; }
}

/* Offline simulator: one white panel, toned rows. */
.sim { padding: 12px; border-radius: var(--r); background: var(--surface); }
.sim__bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 6px 12px; }
.sim__status { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; font-weight: 700; font-size: var(--fs-small); background: var(--income-muted); color: var(--income-strong); transition: background-color 250ms ease, color 250ms ease; }
.sim__status[data-state="offline"] { background: var(--warning-muted); color: var(--warning); }
.sim__status[data-state="syncing"] { background: var(--accent-muted); color: var(--accent-strong); }
.sim__status[data-state="syncing"] .ic { animation: spin 900ms linear infinite; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 700; font-size: var(--fs-small); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__track { position: relative; width: 48px; height: 28px; border-radius: 99px; background: #C9CDD8; transition: background-color 200ms ease; }
.switch__thumb { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 99px; background: #fff; transition: transform 220ms var(--ease-out); }
.switch:active .switch__thumb { transform: scale(0.92); }
.switch input:checked + .switch__track { background: var(--income); }
.switch input:checked + .switch__track .switch__thumb { transform: translateX(20px); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--accent-strong); outline-offset: 3px; }
.switch__label { display: inline-flex; align-items: center; gap: 6px; }
.sim__list { display: grid; gap: 6px; min-height: 236px; align-content: start; }
.sim__row { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-in); background: var(--ground); animation: feedIn 400ms var(--ease-out) both; }
.sim__row .feed__ic { width: 36px; height: 36px; }
.sim__t { font-weight: 700; font-size: var(--fs-small); }
.sim__tag { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-small); font-weight: 600; color: var(--text-3); transition: color 250ms ease; }
.sim__tag .ic { width: 14px; height: 14px; }
.sim__row[data-state="pending"] .sim__tag { color: var(--warning); }
.sim__row[data-state="syncing"] .sim__tag { color: var(--accent-strong); }
.sim__row[data-state="syncing"] .sim__tag .ic { animation: spin 900ms linear infinite; }
.sim__row[data-state="synced"] .sim__tag { color: var(--income-strong); }
.sim__amt { font-weight: 800; color: var(--income-strong); }
.sim__foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 6px 4px; }
.sim__count { color: var(--text-2); font-weight: 600; font-size: var(--fs-small); }

/* Books: tabs sit on the page ground, the panel is the one white surface. */
.books { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; }
.books__tabs { display: grid; gap: 2px; align-content: start; }
.btab { display: grid; grid-template-columns: 40px 1fr; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-in); text-align: start; transition: background-color 160ms ease, transform 160ms var(--ease-out); }
.btab:active { transform: scale(0.98); }
.btab__ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--surface-2); color: var(--ink-soft); transition: background-color 200ms ease, color 200ms ease; }
.btab__ic .ic { width: 19px; height: 19px; }
.btab__n { display: block; font-weight: 700; font-size: var(--fs-small); }
.btab__s { display: block; color: var(--text-3); font-size: var(--fs-small); }
.btab[aria-selected="true"] { background: var(--surface); }
.btab[aria-selected="true"] .btab__ic { background: var(--ink); color: #fff; }
@media (hover: hover) and (pointer: fine) { .btab:hover { background: var(--surface); } }
.books__panel { position: relative; min-height: 500px; padding: clamp(20px, 3vw, 36px); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.bp.is-anim { animation: fadeUp 240ms var(--ease-out) both; }
.bp__title { font-size: var(--fs-title); font-weight: 800; letter-spacing: -0.02em; }
.bp__desc { margin-top: 8px; color: var(--ink-soft); max-width: 52ch; }
.bp__body { margin-top: 24px; display: grid; gap: 6px; }
.bp__row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 12px 16px; border-radius: var(--r-in); background: var(--ground); }
.bp__row small { display: block; color: var(--text-3); font-size: var(--fs-small); }
.bp__row b { font-weight: 800; }
.meter { display: grid; grid-template-columns: minmax(0, 1fr) 140px auto; align-items: center; gap: 16px; padding: 12px 16px; border-radius: var(--r-in); background: var(--ground); }
.meter small { display: block; color: var(--text-3); font-size: var(--fs-small); }
.meter__bar { display: block; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bp .meter__bar, .budget .meter__bar { background: #DFE2EA; }
.meter__bar i { display: block; height: 100%; width: var(--w); border-radius: inherit; background: var(--income); transform-origin: left; animation: grow 600ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 60ms + 100ms); }
.meter__bar i.warn { background: #F59E0B; }
.meter__bar i.crit { background: var(--expense); }
@keyframes grow { from { transform: scaleX(0); } to { transform: none; } }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: var(--fs-small); font-weight: 700; }
.badge--ok { background: var(--income-muted); color: var(--income-strong); }
.badge--due { background: var(--warning-muted); color: var(--warning); }
.badge--crit { background: var(--expense-muted); color: var(--expense-strong); }
.att { display: inline-flex; gap: 4px; }
.att i { width: 10px; height: 10px; border-radius: 3px; background: var(--income); }
.att i.a { background: #F3C3C3; }
.att i.l { background: #F7D58B; }
@media (max-width: 960px) {
  .books { grid-template-columns: 1fr; }
  .books__tabs { grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; scrollbar-width: none; margin: -2px; padding: 2px; }
  .books__tabs::-webkit-scrollbar { display: none; }
  .btab { grid-template-columns: 32px auto; padding: 8px 14px 8px 8px; }
  .btab__ic { width: 32px; height: 32px; border-radius: 10px; }
  .btab__s { display: none; }
  .books__panel { min-height: 0; }
}
@media (max-width: 560px) {
  .meter { grid-template-columns: 1fr auto; }
  .meter__bar { grid-column: 1 / -1; grid-row: 2; }
}

/* Insights */
.insights { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; }
.insights h3 { color: #fff; }
.chart, .flow, .dead { padding: clamp(20px, 3vw, 32px); border-radius: var(--r); background: #1B1F29; }
.chart__head { display: flex; justify-content: space-between; align-items: baseline; }
.chart__range { color: rgba(255, 255, 255, 0.7); font-size: var(--fs-small); font-weight: 600; }
.chart__bars { display: grid; grid-template-columns: repeat(7, 1fr); align-items: end; gap: clamp(8px, 1.6vw, 18px); height: 300px; margin-top: 28px; }
.cbar { display: grid; grid-template-rows: auto 1fr auto; height: 100%; gap: 8px; text-align: center; }
.cbar__v { font-size: var(--fs-small); font-weight: 700; color: rgba(255, 255, 255, 0.75); opacity: 0; transition: opacity 400ms ease; transition-delay: calc(var(--i) * 70ms + 500ms); }
.cbar__col { position: relative; display: flex; align-items: end; }
.cbar__col i { display: block; width: 100%; height: var(--h); border-radius: 10px 10px 4px 4px; background: #3A4254; transform: scaleY(0); transform-origin: bottom; transition: transform 900ms var(--ease-out); transition-delay: calc(var(--i) * 70ms + 150ms); }
.cbar--peak .cbar__col i { background: var(--accent); }
.cbar__d { font-size: var(--fs-small); color: rgba(255, 255, 255, 0.7); font-weight: 600; }
.chart.is-in .cbar__col i { transform: none; }
.chart.is-in .cbar__v { opacity: 1; }
html:not(.js) .cbar__col i { transform: none; }
html:not(.js) .cbar__v { opacity: 1; }
.insights__side { display: grid; gap: 16px; }
.flow { display: grid; gap: 16px; align-content: start; }
.flow__row { display: grid; grid-template-columns: 76px 1fr auto; align-items: center; gap: 14px; font-size: var(--fs-small); color: rgba(255, 255, 255, 0.82); }
.flow__bar { height: 10px; border-radius: 99px; background: #2A3042; overflow: hidden; }
.flow__fill { display: block; height: 100%; width: var(--w); border-radius: inherit; transform: scaleX(0); transform-origin: left; transition: transform 900ms var(--ease-out) 300ms; }
.flow.is-in .flow__fill, html:not(.js) .flow__fill { transform: none; }
.flow__fill--in { background: #34D399; }
.flow__fill--out { background: #F87171; }
.flow .amt-in { color: #6EE7B7; }
.flow .amt-out { color: #FCA5A5; }
.dead p { margin-top: 10px; color: rgba(255, 255, 255, 0.82); }
.dead p b { color: #fff; }
.dead__chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.dead__chips span { padding: 6px 12px; border-radius: 999px; background: #2A3042; color: rgba(255, 255, 255, 0.88); font-size: var(--fs-small); font-weight: 600; }
@media (max-width: 960px) { .insights { grid-template-columns: 1fr; } .chart__bars { height: 240px; } }

/* Languages */
.lang { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; }
.lang__stage { display: grid; align-content: space-between; gap: 32px; min-height: 380px; padding: clamp(24px, 4vw, 48px); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.lang__line { font-size: var(--fs-h2); font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; min-height: 2.4em; display: flex; align-items: center; }
.lang__line.is-out { animation: langOut 200ms ease both; }
.lang__line.is-in { animation: langIn 360ms var(--ease-out) both; }
@keyframes langOut { to { opacity: 0; transform: translateY(-10px); } }
@keyframes langIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
[lang="ar"], [lang="fa"], [lang="ps"], [lang="sd"] { font-family: var(--font-arab); letter-spacing: 0; }
[lang="ur"] { font-family: var(--font-urdu); letter-spacing: 0; line-height: 2; }
[lang="hi"] { font-family: "Plus Jakarta Sans", "Noto Sans Devanagari", sans-serif; letter-spacing: 0; }
[lang="bn"] { font-family: "Plus Jakarta Sans", "Noto Sans Bengali", sans-serif; letter-spacing: 0; }
.lang__line[lang="ur"] { font-size: clamp(1.7rem, 3.6vw, 2.75rem); }
/* A glossary list, not a row of cards. */
.lang__terms { display: grid; gap: 0; }
.lang__terms div { display: grid; grid-template-columns: 10rem minmax(0, 1fr); align-items: baseline; gap: 16px; padding: 10px 0; }
.lang__terms dt { color: var(--text-2); font-size: var(--fs-small); font-weight: 600; }
.lang__terms dd { font-weight: 700; overflow-wrap: anywhere; }
.lang__chips { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-content: start; }
.chip { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 52px; padding: 8px 18px; border-radius: 999px; background: var(--surface); font-weight: 700; text-align: start; transition: background-color 200ms ease, color 200ms ease, transform 160ms var(--ease-out); }
.chip:active { transform: scale(0.97); }
.chip small { color: var(--text-3); font-weight: 600; font-size: var(--fs-small); }
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; }
.chip[aria-pressed="true"] small { color: rgba(255, 255, 255, 0.7); }
@media (hover: hover) and (pointer: fine) { .chip:hover:not([aria-pressed="true"]) { background: var(--surface-2); } }
@media (max-width: 960px) { .lang { grid-template-columns: 1fr; } .lang__chips { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) {
  .lang__terms div { grid-template-columns: 1fr; gap: 2px; }
  .lang__chips { grid-template-columns: 1fr 1fr; }
  .chip small { display: none; }
  .lang__stage { min-height: 0; }
}

/* PIN */
.pin { justify-self: center; width: min(380px, 100%); padding: 28px 24px 24px; border-radius: var(--r); background: var(--surface); }
.pin__head { text-align: center; }
.pin__lock { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 999px; background: var(--surface-2); color: var(--ink); transition: background-color 300ms ease, color 300ms ease, transform 300ms var(--ease-out); }
.pin__lock .ic { width: 24px; height: 24px; }
.pin.is-ok .pin__lock { background: var(--income-muted); color: var(--income-strong); transform: scale(1.06); }
.pin__title { margin-top: 14px; font-weight: 800; font-size: var(--fs-title); letter-spacing: -0.02em; }
.pin__sub { color: var(--text-2); font-size: var(--fs-small); }
.pin__dots { display: flex; justify-content: center; gap: 16px; margin: 24px 0 22px; }
.pin__dots i { width: 14px; height: 14px; border-radius: 99px; background: var(--surface-2); transition: background-color 160ms ease, transform 200ms var(--ease-out); }
.pin__dots i.on { background: var(--ink); transform: scale(1.1); }
.pin.is-ok .pin__dots i { background: var(--income); }
.pin__pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pin__pad button { display: grid; place-items: center; height: 60px; border-radius: 999px; background: var(--ground); font-size: var(--fs-title); font-weight: 700; transition: background-color 120ms ease, transform 120ms var(--ease-out); }
.pin__pad button:active { transform: scale(0.95); background: var(--surface-2); }
.pin__pad .ic { width: 22px; height: 22px; }
@media (hover: hover) and (pointer: fine) { .pin__pad button:hover { background: var(--surface-2); } }

/* Spaces: control on the ground, two white panels, toned rows. */
.seg { display: inline-grid; grid-auto-flow: column; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface); }
.seg button { padding: 10px 20px; border-radius: 999px; font-weight: 700; font-size: var(--fs-small); color: var(--ink-soft); transition: background-color 200ms ease, color 200ms ease, transform 160ms var(--ease-out); }
.seg button:active { transform: scale(0.97); }
.seg button[aria-selected="true"] { background: var(--ink); color: #fff; }
.spaces__body { margin-top: 16px; }
.sp { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.sp.is-anim { animation: fadeUp 240ms var(--ease-out) both; }
.sp__copy, .sp__demo { padding: clamp(20px, 3vw, 36px); border-radius: var(--r); background: var(--surface); }
.sp__copy h3 { font-size: var(--fs-title); font-weight: 800; letter-spacing: -0.02em; }
.sp__copy p { margin-top: 10px; color: var(--ink-soft); }
.sp__copy ul { display: grid; gap: 10px; margin-top: 20px; }
.sp__copy li { display: flex; gap: 10px; align-items: center; font-weight: 600; }
.sp__copy li .ic { color: var(--ink-soft); }
.sp__demo { display: grid; gap: 6px; align-content: start; }
.sp__big { padding: 18px 20px; border-radius: var(--r-in); color: #fff; background: var(--card-dark); }
.sp__big span { display: block; color: rgba(255, 255, 255, 0.72); font-size: var(--fs-small); font-weight: 600; }
.sp__big b { font-size: var(--fs-title); letter-spacing: -0.02em; }
.budget { padding: 14px 16px; border-radius: var(--r-in); background: var(--ground); }
.budget__top { display: flex; justify-content: space-between; gap: 12px; font-size: var(--fs-small); font-weight: 600; }
.budget__top span:last-child { color: var(--text-2); }
.budget .meter__bar { margin-top: 10px; }
@media (max-width: 860px) { .sp { grid-template-columns: 1fr; } }

/* CTA */
.cta { padding-block: var(--section); background: var(--tone); }
.cta__inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 40px; align-items: end; }
.cta__inner > div:first-child { display: grid; gap: 18px; }
.cta__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.store { display: inline-flex; align-items: center; gap: 12px; min-height: 60px; padding: 0 26px 0 22px; border-radius: 999px; background: var(--ink); color: #fff; transition: transform 160ms var(--ease-out), background-color 200ms ease; }
.store:active { transform: scale(0.97); }
.store .ic { width: 22px; height: 22px; }
.store span { display: grid; font-weight: 800; line-height: 1.15; }
.store small { font-weight: 600; font-size: var(--fs-small); color: rgba(255, 255, 255, 0.72); }
@media (hover: hover) and (pointer: fine) { .store:hover { background: var(--ink-soft); } }
@media (max-width: 860px) { .cta__inner { grid-template-columns: 1fr; align-items: start; } }

/* Footer */
.foot { padding-block: 40px; background: var(--ground); }
.foot__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; }
.foot__links { display: flex; flex-wrap: wrap; gap: 4px 20px; color: var(--ink-soft); font-weight: 600; font-size: var(--fs-small); }
.foot__copy { margin-inline-start: auto; color: var(--text-2); font-size: var(--fs-small); }
@media (max-width: 720px) { .foot__copy { margin-inline-start: 0; width: 100%; } }

@media (max-width: 420px) {
  .phone { --pw: 300px; padding: 9px; border-radius: 46px; }
  .phone__screen { height: 620px; border-radius: 38px; }
}

/* Reduced motion: keep fades and colour, drop travel and loops. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-reveal] { transform: none; transition: opacity 400ms ease; }
  .feed li.is-new, .sim__row, .bp.is-anim, .sp.is-anim, .ld__rows.is-swap, .ld__bubble, .lang__line.is-in, .lang__line.is-out { animation-name: fadeOnly; }
  .nudge, .nudge.is-on { transform: none; }
  .meter__bar i, .cbar__col i, .flow__fill { animation: none; transition: none; transform: none; }
  .cbar__v { transition: none; opacity: 1; }
  .sync-pill.is-busy .ic, .sim__status .ic, .sim__tag .ic { animation: none; }
}
@keyframes fadeOnly { from { opacity: 0; } to { opacity: 1; } }
