/* Kiron Bank — design tokens measured against a 393×852pt iPhone reference */
:root {
  --brand: #e2001a;
  --brand-ink: #a30e13;
  --bg: #f6f6f6;
  --card: #ffffff;
  --ink: #161616;
  --muted: #5d5d5d;
  --placeholder: #8a8a8d;
  --line: #e7e7e7;
  --chip: #f6f6f6;
  --field: #e5e5e7;
  --tab-pill: #e7e7e7;
  --pos: #1d7a45;

  --gutter: 19px;        /* page side margin */
  --gutter-wide: 15px;   /* home cards run slightly wider */
  --pad: 14px;           /* card inner padding */
  --radius: 22px;
  --btn: 41px;           /* round header buttons */
  --circle: 37px;        /* icon circles */
  --gap: 15px;           /* vertical gap between cards */
  --tabbar-h: 57px;

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);

  --font: "Hind", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-family: var(--font);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}
/* Simulated iPhone insets for desktop comparison (?sim=1) */
:root.sim { --safe-t: 59px; --safe-b: 34px; }

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); }
body { min-height: 100dvh; max-width: 480px; margin: 0 auto; overscroll-behavior-y: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
svg { display: block; flex: none; }
:root.sim ::-webkit-scrollbar { display: none; }

#app {
  padding: max(12px, calc(var(--safe-t) - 5px)) var(--gutter) calc(var(--tabbar-h) + var(--safe-b) + 32px);
  animation: enter .2s ease-out;
}
#app.no-tabs { padding-bottom: calc(var(--safe-b) + 24px); }
@keyframes enter { from { transform: translateY(6px); } to { transform: none; } }

/* ---------- Header ---------- */
.topbar { display: flex; justify-content: space-between; align-items: center; height: var(--btn); margin: 0 -1px; }
.round {
  width: var(--btn); height: var(--btn); border-radius: 50%; position: relative;
  display: grid; place-items: center; color: var(--brand);
  background: var(--card);
  box-shadow: 0 0 0 .5px rgba(0,0,0,.22), 0 3px 8px rgba(0,0,0,.08);
  transition: transform .12s;
}
.round:active { transform: scale(.93); }
.round .badge {
  position: absolute; top: -2px; right: -3px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--brand); color: #fff; font-size: 11px; font-weight: 600; line-height: 17px; text-align: center;
}
h1 {
  height: 56px; margin: 0; display: flex; align-items: center; padding-top: 9px;
  font-size: 34px; font-weight: 300; letter-spacing: -.2px; line-height: 1;
}

/* ---------- Cards ---------- */
.card { background: var(--card); border-radius: var(--radius); padding: 0 var(--pad); }
.card + .card { margin-top: var(--gap); }
.wide { margin-left: calc(var(--gutter-wide) - var(--gutter)); margin-right: calc(var(--gutter-wide) - var(--gutter)); }
.card-head { display: flex; align-items: center; gap: 8px; font-size: 15px; line-height: 20px; color: var(--muted); }
.card-head.pay-head { font-size: 16px; }
.divider { height: 1px; background: var(--line); border: 0; margin: 0; }
.amount-xl { font-size: 26px; font-weight: 500; line-height: 30px; letter-spacing: -.1px; }
.sub { color: var(--muted); font-size: 13px; line-height: 16px; }

/* Icon circle */
.ico { flex: none; width: var(--circle); height: var(--circle); border-radius: 50%; background: var(--chip); display: grid; place-items: center; color: var(--brand); }

/* ---------- Quick actions ---------- */
.actions { display: grid; grid-template-columns: repeat(3, 1fr); padding: 14px 7px 13px; }
.action { display: flex; flex-direction: column; align-items: center; gap: 7px; font-size: 13px; line-height: 16px; color: var(--muted); letter-spacing: .1px; }
.action:active .ico { background: #ececec; }
.quick { padding: 11px 0 14px; }
.quick .actions { padding: 0 7px; }
.carousel { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.carousel::-webkit-scrollbar { display: none; }
.carousel > .actions { min-width: 100%; scroll-snap-align: start; }
.dots { display: flex; justify-content: center; gap: 7px; margin-top: 14px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: #d6d6d6; }
.dots i.on { background: #3a3a3a; }

/* ---------- Home: accounts & pay ---------- */
.accounts { padding-top: 18px; padding-bottom: 16px; }
.accounts .card-head { line-height: 16px; }
.accounts .divider { margin: 17px 0 13px; }
.acc-row { display: flex; align-items: center; gap: 15px; }
.acc-row .t { flex: 1; font-size: 17px; line-height: 20px; }
.acc-row .chev { color: var(--muted); margin-right: 4px; }
.accounts .amount-xl { margin-top: 18px; }

.pay { padding-top: 13px; padding-bottom: 13px; }
.pay .divider { margin: 14px 0 13px; }
.p2p { display: grid; grid-template-columns: repeat(3, 1fr); padding: 0 12px; }
.p2p button { display: flex; flex-direction: column; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; line-height: 16px; letter-spacing: .1px; }
.p2p .dark { width: var(--circle); height: var(--circle); border-radius: 50%; background: #1c1c1c; color: #fff; display: grid; place-items: center; transition: transform .12s; }
.p2p button:active .dark { transform: scale(.92); }

.pill-btn { display: block; margin: 26px auto 0; height: 32px; padding: 0 11px; background: var(--card); color: var(--brand); border-radius: 16px; font-weight: 600; font-size: 16px; line-height: 34px; }
.pill-btn:active { background: #eee; }

/* ---------- Account screen ---------- */
.search { display: flex; align-items: center; gap: 8px; height: 40px; background: var(--field); border-radius: 20px; padding: 0 14px 0 15px; color: var(--ink); }
.search input { border: 0; background: none; outline: none; flex: 1; font-size: 16px; min-width: 0; padding: 3px 0 0; }
.search input::placeholder { color: var(--placeholder); }
.search + .card { margin-top: 25px; }
.balance { padding-top: 12px; padding-bottom: 18px; }
.balance .card-head { gap: 10px; }
.balance .amount-xl { margin-top: 12px; font-size: 25px; }
.balance .sub { margin-top: 1px; }

.group-label { height: 56px; display: flex; align-items: flex-end; padding: 0 0 17px; margin: 0; font-size: 15px; line-height: 15px; color: var(--muted); font-weight: 400; }
.list { padding: 0 var(--pad); }
.row { position: relative; display: flex; align-items: center; gap: 15px; width: 100%; min-height: 66px; text-align: left; }
.row + .row::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: var(--line); }
.row .main { flex: 1; min-width: 0; }
.row .t { font-size: 16px; line-height: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-top: 2px; }
.row .s { font-size: 13px; line-height: 16px; color: var(--muted); margin-top: 2px; }
.row .end { text-align: right; flex: none; }
.row .amt { font-size: 16px; line-height: 19px; font-weight: 500; padding-top: 2px; }
.row .amt.pos { color: var(--pos); }
.row .chev { color: var(--muted); }
.row:active { opacity: .55; }

/* ---------- Detail / forms ---------- */
.hero { text-align: center; padding: 8px 0 22px; }
.hero .ico { width: 64px; height: 64px; margin: 0 auto 14px; background: var(--card); }
.hero .amount-xl { font-size: 32px; line-height: 38px; margin: 4px 0 2px; }
.hero .label { font-size: 16px; color: var(--muted); }
.kv { display: flex; justify-content: space-between; gap: 16px; padding: 15px 0 13px; font-size: 15px; line-height: 19px; }
.kv + .kv { border-top: 1px solid var(--line); }
.kv span { color: var(--muted); flex: none; }
.kv b { font-weight: 400; text-align: right; word-break: break-word; }
.form-card { padding: 4px var(--pad) 0; margin-top: var(--gap); }
.field { display: block; padding: 12px 0 10px; }
.field + .field { border-top: 1px solid var(--line); }
.field span { display: block; font-size: 13px; line-height: 16px; color: var(--muted); }
.field input { width: 100%; border: 0; background: none; padding: 6px 0 0; font-size: 17px; line-height: 22px; outline: none; }
.field input::placeholder { color: #b5b5b8; }
.field .err { color: var(--brand); font-size: 13px; line-height: 16px; }
.field .err:empty { display: none; }
.section-title { font-size: 15px; line-height: 15px; font-weight: 400; color: var(--muted); margin: 24px 0 12px; }

.primary { display: block; width: 100%; height: 50px; margin-top: 24px; border-radius: 25px; background: var(--brand); color: #fff; font-weight: 600; font-size: 17px; line-height: 52px; text-align: center; }
.primary:active { background: var(--brand-ink); }
.ghost { display: block; width: 100%; height: 48px; color: var(--brand); font-weight: 600; font-size: 16px; line-height: 50px; text-align: center; }
.done-ico { width: 72px; height: 72px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; margin: 48px auto 20px; animation: pop .35s cubic-bezier(.2,1.4,.4,1); }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.center { text-align: center; }
.done-title { font-size: 26px; font-weight: 300; margin: 0 0 6px; }
.empty { text-align: center; color: var(--muted); font-size: 15px; padding: 36px 12px; }
.empty .ico { width: 64px; height: 64px; margin: 0 auto 14px; }
.footnote { text-align: center; color: var(--muted); font-size: 13px; margin-top: 20px; }
.total { display: flex; justify-content: space-between; padding: 18px 4px 0; font-size: 15px; color: var(--muted); }
.total b { color: var(--ink); font-weight: 600; }

/* ---------- Tab bar ---------- */
.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 10;
  bottom: max(12px, calc(var(--safe-b) - 15px));
  width: min(calc(100% - 2 * var(--gutter)), 442px); height: var(--tabbar-h);
  display: grid; grid-template-columns: repeat(5, 1fr); padding: 4px 7px;
  border-radius: 29px;
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(20px) saturate(1.6); -webkit-backdrop-filter: blur(20px) saturate(1.6);
  box-shadow: 0 0 0 .5px rgba(0,0,0,.28), 0 6px 24px rgba(0,0,0,.08);
}
.tabbar[hidden] { display: none; }
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; font-size: 11px; line-height: 13px; color: #090909; border-radius: 24px; padding-bottom: 2px; }
.tab svg { width: 26px; height: 26px; }
.tab.on { background: var(--tab-pill); color: var(--brand); font-weight: 600; margin: 0 -3.5px; }

/* ---------- Bottom sheet ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.32); z-index: 20; display: flex; align-items: flex-end; justify-content: center; animation: fade .2s; }
.sheet-backdrop[hidden] { display: none; }
.sheet { background: var(--bg); width: 100%; max-width: 480px; border-radius: 22px 22px 0 0; padding: 8px var(--gutter) calc(var(--safe-b) + 12px); animation: up .26s cubic-bezier(.2,.9,.3,1); }
.sheet .grip { width: 36px; height: 5px; border-radius: 3px; background: #cfcfcf; margin: 0 auto 16px; }
.sheet h2 { margin: 0 0 4px; font-size: 22px; font-weight: 400; }
.sheet > .sub { font-size: 15px; margin-bottom: 14px; }
.sheet .card { margin-top: 12px; }
@keyframes up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + max(12px, calc(var(--safe-b) - 15px)) + 14px); transform: translateX(-50%); width: max-content; max-width: calc(100% - 40px); background: #1c1c1c; color: #fff; padding: 11px 16px 9px; border-radius: 14px; font-size: 14px; z-index: 30; animation: fade .2s; }
