/* Friendly SaaS · type pairing · Designed using Design Lounge (https://www.designlounge.live) */
@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;600;800&family=JetBrains+Mono:wght@400;500;700&display=swap");

/* Harbour Ledger · full palette · Designed using Design Lounge (https://www.designlounge.live)
   Primary / secondary / tertiary + feedback + surfaces. Match the numbers.
   Free to use. */
:root {
  /* Brand */
  --primary: #b08a3e;
  --primary-ink: #141210;
  --primary-soft: #eae1cd;
  --secondary: #1e3a5f;
  --secondary-ink: #fffdf8;
  --secondary-soft: #d6d6d1;
  --tertiary: #8a3a3a;
  --tertiary-ink: #fffdf8;
  --tertiary-soft: #e5d6cc;

  /* Surface */
  --bg: #f4efe4;
  --surface: #fffaf0;
  --surface-2: #e8e0d0;
  --surface-3: #dbd4c7;
  --ink: #152033;
  --ink-2: #4a5568;
  --ink-3: #5e6879;
  --line: #d4cbb8;
  --line-strong: #8b8a85;

  /* Feedback: reserved for live state, never decoration */
  --success: #2f6b4f;
  --success-ink: #fffdf8;
  --success-soft: #d8ddcf;
  --success-on-soft: #2f6b4f;
  --warning: #c27a14;
  --warning-ink: #141210;
  --warning-soft: #eddfc7;
  --warning-on-soft: #84530e;
  --danger: #8a2a2a;
  --danger-ink: #fffdf8;
  --danger-soft: #e5d3ca;
  --danger-on-soft: #8a2a2a;
  --info: #2a4a7a;
  --info-ink: #fffdf8;
  --info-soft: #d8d8d5;
  --info-on-soft: #2a4a7a;

  /* Chrome */
  --focus: #b08a3e;
  --link: #80652d;
  --overlay: #141210;
  --inverse: #152033;
  --inverse-ink: #f4efe4;

  /* Aliases */
  --accent: var(--primary);
  --accent-ink: var(--primary-ink);
  --positive: var(--success);

  /* Roles this app maps onto theme tokens */
  --card-bg: var(--inverse);
  --card-ink: var(--inverse-ink);
  --knob: var(--surface);
  --bezel: var(--ink);
}

/* Harbour Night · full palette · Designed using Design Lounge (https://www.designlounge.live)
   The theme's pair, used for the Dark appearance switch in Settings. */
[data-theme="night"] {
  --primary: #d4b06a;
  --primary-ink: #141210;
  --primary-soft: #413c32;
  --secondary: #8eb0d4;
  --secondary-ink: #141210;
  --secondary-soft: #303c4b;
  --tertiary: #c47a7a;
  --tertiary-ink: #141210;
  --tertiary-soft: #3d3036;

  --bg: #121820;
  --surface: #1a2330;
  --surface-2: #243044;
  --surface-3: #394354;
  --ink: #f4efe4;
  --ink-2: #c5c0b4;
  --ink-3: #9a9488;
  --line: #314056;
  --line-strong: #7b838c;

  --success: #7dba9a;
  --success-ink: #141210;
  --success-soft: #2c3f3d;
  --success-on-soft: #7dba9a;
  --warning: #e0a34b;
  --warning-ink: #141210;
  --warning-soft: #43392a;
  --warning-on-soft: #e0a34b;
  --danger: #e07070;
  --danger-ink: #141210;
  --danger-soft: #432d33;
  --danger-on-soft: #e48181;
  --info: #8eb0d4;
  --info-ink: #141210;
  --info-soft: #303c4b;
  --info-on-soft: #8eb0d4;

  --focus: #d4b06a;
  --link: #d4b06a;
  --overlay: #070605;
  --inverse: #f4efe4;
  --inverse-ink: #121820;

  --card-bg: var(--surface-2);
  --card-ink: var(--ink);
  --knob: var(--ink);
  --bezel: var(--surface-3);
}

/* Friendly SaaS · type pairing · Designed using Design Lounge (https://www.designlounge.live) */
:root {
  --font-display: "Plus Jakarta Sans", "Helvetica Neue", Arial, sans-serif;
  --font-text: "Plus Jakarta Sans", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1;
}
body {
  font-family: var(--font-text);
  font-weight: 400;
  line-height: 1.55;
}
code, kbd, samp, .mono, .num {
  font-family: var(--font-mono);
  font-weight: 400;
}

/* Quiet family · Designed using Design Lounge (https://www.designlounge.live) */
:root {
  --radius: 6px;
  --radius-card: 8px;
  --control: 44px;
  --gap: 16px;
  --pad: 16px;
  --shadow: 0 10px 24px -16px rgba(0,0,0,.18);
}

/* Motion tokens · Designed using Design Lounge (https://www.designlounge.live) */
:root {
  --ease-standard: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-expo-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-ios-sheet: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-enter: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-exit: cubic-bezier(0.4, 0, 1, 1);
  --t-micro: 120ms;
  --t-fast: 160ms;
  --t-ui: 200ms;
  --t-layout: 320ms;
  --t-sheet: 400ms;
}

/* Phone frame */
:root {
  --safe-t: max(54px, env(safe-area-inset-top));
  --safe-b: max(34px, env(safe-area-inset-bottom));
  --m: 20px;
  --tabs-h: calc(50px + var(--safe-b));
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
}
p, h1, h2, h3, dl, dd { margin: 0; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.num { font-variant-numeric: tabular-nums; }
.ic {
  width: 24px; height: 24px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.75;
  stroke-linecap: round; stroke-linejoin: round;
}
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

/* ---------- presentation: phone full-bleed, desktop in a frame ---------- */
.caption { display: none; }
.app {
  position: fixed; inset: 0;
  overflow: hidden;
  background: var(--bg);
  isolation: isolate;
}

@media (min-width: 700px) {
  body {
    background: var(--surface-2);
    min-height: 100%;
    display: grid;
    place-items: center;
  }
  .stage {
    display: flex; flex-direction: column; align-items: center;
    gap: 18px; padding: 24px;
  }
  .caption {
    display: block;
    font-size: 14px; color: var(--ink-2);
    text-align: center; max-width: 640px;
  }
  .device-wrap {
    --fs: 1;
    position: relative;
    width: calc(414px * var(--fs));
    height: calc(868px * var(--fs));
  }
  .device {
    position: absolute; top: 0; left: 0;
    width: 414px; height: 868px;
    padding: 12px;
    border-radius: 56px;
    background: var(--bezel);
    transform: scale(var(--fs));
    transform-origin: 0 0;
    box-shadow: 0 30px 60px -30px rgba(0,0,0,.35);
  }
  .app {
    position: relative; inset: auto;
    width: 390px; height: 844px;
    border-radius: 44px;
  }
}

/* ---------- screens ---------- */
.screen {
  position: absolute; inset: 0;
  overflow: hidden;
  background: var(--bg);
}
.scroll {
  position: absolute; inset: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-inline: var(--m);
  padding-bottom: calc(var(--tabs-h) + 32px);
}
.push.slide-in { animation: push-in var(--t-layout) var(--ease-ios-sheet); }
@keyframes push-in { from { transform: translateX(100%); } to { transform: none; } }

/* ---------- buttons, fields, groups (components.md, quiet) ---------- */
.btn {
  height: var(--control);
  padding: 0 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  font: 600 15px/1 var(--font-text);
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  text-decoration: none;
  transition: border-color var(--t-ui) var(--ease-standard), transform var(--t-fast) var(--ease-standard), opacity var(--t-ui) var(--ease-standard);
}
.btn .ic { width: 18px; height: 18px; }
.btn:hover { border-color: var(--ink); }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--primary); color: var(--primary-ink); border-color: transparent; }
.btn-primary:hover { border-color: transparent; }
.btn:disabled { opacity: .4; cursor: default; transform: none; }
.btn-block { width: 100%; }
.gap-top { margin-top: var(--gap); }

.icon-btn {
  width: 44px; height: 44px; flex: none;
  display: grid; place-items: center;
  border: 0; border-radius: var(--radius);
  background: transparent; color: var(--ink);
  transition: background var(--t-ui) var(--ease-standard);
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn .ic { width: 22px; height: 22px; }

.bar-btn {
  min-height: 44px; padding: 0 8px 0 2px;
  display: inline-flex; align-items: center; gap: 2px;
  border: 0; background: transparent;
  color: var(--link);
  font: 600 15px/1 var(--font-text);
  text-decoration: none;
  border-radius: var(--radius);
}
.bar-btn .ic { width: 22px; height: 22px; }
.bar-btn:active { opacity: .6; }
.text-btn {
  min-height: 44px; padding: 0 4px;
  display: inline-flex; align-items: center;
  color: var(--link); font: 600 14px/1 var(--font-text);
  text-decoration: none; border-radius: var(--radius);
}
.pill-btn {
  height: 44px; padding: 0 16px;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: transparent; color: var(--ink);
  font: 600 15px/1 var(--font-text);
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font: 600 12px/1 var(--font-text); color: var(--ink-2); }
.field input {
  height: var(--control);
  padding: 0 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font: 400 16px/1.4 var(--font-text);
}
.field input::placeholder { color: var(--ink-3); }
.field input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.field input[aria-invalid="true"] { border-color: var(--danger); }
.err {
  display: flex; align-items: center; gap: 6px;
  font: 600 13px/1.35 var(--font-text); color: var(--danger);
}
.err .ic { width: 16px; height: 16px; }

.search {
  display: flex; align-items: center; gap: 8px;
  height: var(--control);
  padding: 0 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-3);
}
.search .ic { width: 18px; height: 18px; }
.search input {
  flex: 1; min-width: 0; height: 100%;
  border: 0; background: transparent; outline: none;
  color: var(--ink); font: 400 16px/1 var(--font-text);
}
.search input::placeholder { color: var(--ink-3); }
.search input::-webkit-search-cancel-button { display: none; }
.search:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }

.group {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  overflow: hidden;
}
.sec-label {
  margin: 24px 4px 8px;
  font: 600 13px/1.3 var(--font-text);
  letter-spacing: 0;
  color: var(--ink-2);
}
.foot { margin: 8px 4px 0; font-size: 13px; line-height: 1.4; color: var(--ink-2); }
.where { font: 600 13px/1.3 var(--font-text); letter-spacing: .04em; color: var(--ink-2); }

.av {
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  border-radius: var(--radius);
  font: 600 13px/1 var(--font-text); letter-spacing: .02em; text-transform: uppercase;
}
.av-0 { background: var(--primary-soft); color: var(--link); }
.av-1 { background: var(--secondary-soft); color: var(--secondary); }
.av-2 { background: var(--tertiary-soft); color: var(--tertiary); }
.av-3 { background: var(--surface-2); color: var(--ink-2); }
[data-theme="night"] .av-0 { color: var(--primary); }
.av-lg { width: 58px; height: 58px; font-size: 20px; border-radius: var(--radius-card); }

.flag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px;
  border-radius: var(--radius);
  font: 600 14px/1.2 var(--font-text);
  background: var(--surface-2); color: var(--ink-2);
}
.flag .ic { width: 16px; height: 16px; }
.flag.ok { background: var(--success-soft); color: var(--success-on-soft); }
.flag.wait { background: var(--warning-soft); color: var(--warning-on-soft); }
.flag.info { background: var(--info-soft); color: var(--info-on-soft); }

.facts .fact {
  position: relative;
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  min-height: 48px; padding: 13px 16px;
}
.facts .fact + .fact::before {
  content: ""; position: absolute; left: 16px; right: 0; top: 0; height: 1px; background: var(--line);
}
.facts dt { font-size: 14px; color: var(--ink-2); flex: none; }
.facts dd { font-size: 15px; color: var(--ink); text-align: right; min-width: 0; overflow-wrap: anywhere; }
.facts dd .sub { display: block; font-size: 12px; color: var(--ink-2); }

/* ---------- tab bar · phone-tab-plain ---------- */
.tabs {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 8;
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding-bottom: var(--safe-b);
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.tab {
  min-height: 50px;
  margin-top: -1px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border-top: 2px solid transparent;
  color: var(--ink-3);
  font: 600 11px/1 var(--font-text);
  text-decoration: none;
}
.tab .ic { width: 22px; height: 22px; }
.tab[aria-current="page"] { color: var(--ink); border-top-color: var(--primary); }
.tab:focus-visible { outline-offset: -4px; }

/* ---------- home · ios-fintech-home ---------- */
.topbar {
  position: absolute; inset: 0 0 auto 0; z-index: 3;
  height: calc(var(--safe-t) + 48px);
  padding: var(--safe-t) 12px 0 var(--m);
  display: flex; align-items: center; gap: 4px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid var(--line);
}
.tb-text { flex: 1; min-width: 0; }
.tb-title { font: 600 17px/1.3 var(--font-display); letter-spacing: -0.01em; }
.tb-sub { font: 600 12px/1.3 var(--font-text); color: var(--ink-2); }
.avatar-btn {
  width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: var(--radius); text-decoration: none;
}
.avatar-btn .av { width: 36px; height: 36px; font-size: 12px; }

.ptr {
  position: absolute; left: 0; right: 0; z-index: 1;
  top: calc(var(--safe-t) + 48px); height: 64px;
  display: grid; place-items: center;
  pointer-events: none;
}
.ring { opacity: var(--pp, 0); transform: rotate(-90deg) scale(calc(.6 + .4 * var(--pp, 0))); transition: opacity var(--t-fast) var(--ease-standard); }
.ring circle { fill: none; stroke-width: 2.5; }
.ring .track { stroke: var(--line); }
.ring .prog {
  stroke: var(--primary); stroke-linecap: round;
  stroke-dasharray: 62.83; stroke-dashoffset: calc(62.83 * (1 - var(--pp, 0)));
  transition: stroke-dashoffset var(--t-fast) var(--ease-standard);
}
#s-home:not(.pulling) .ring .prog { transition: stroke-dashoffset var(--t-fast) var(--ease-standard); }
#s-home.pulling .ring .prog { transition: none; }
#s-home.loading .ring { opacity: 1; animation: spin 800ms linear infinite; }
#s-home.loading .ring .prog { stroke-dashoffset: 16; }
@keyframes spin { from { transform: rotate(-90deg) scale(1); } to { transform: rotate(270deg) scale(1); } }

.home-scroll {
  z-index: 2;
  padding-top: calc(var(--safe-t) + 48px + 16px);
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
}
#s-home.snap .home-scroll { transition: transform 420ms var(--ease-ios-sheet); }

.bal {
  position: relative;
  padding: 18px 20px 20px;
  border-radius: var(--radius-card);
  background: var(--card-bg);
  color: var(--card-ink);
  box-shadow: inset 0 2px 0 var(--primary), var(--shadow);
}
.bal-top { display: flex; align-items: center; gap: 8px; min-height: 44px; margin: -6px -8px 0 0; }
.bal-label { font: 600 13px/1.4 var(--font-text); opacity: .82; }
.ex-tag {
  height: 22px; padding: 0 8px; border-radius: 999px;
  background: color-mix(in srgb, var(--card-ink) 14%, transparent);
  font: 600 11px/22px var(--font-text); letter-spacing: .04em;
}
.eye {
  margin-left: auto;
  width: 44px; height: 44px; display: grid; place-items: center;
  border: 0; border-radius: var(--radius);
  background: color-mix(in srgb, var(--card-ink) 8%, transparent);
  color: var(--card-ink);
  transition: background var(--t-fast) var(--ease-standard);
}
.eye:hover { background: color-mix(in srgb, var(--card-ink) 14%, transparent); }
.eye:focus-visible { outline-color: var(--card-ink); outline-offset: 2px; }
.eye .ic { width: 20px; height: 20px; }
.eye .off { display: none; }
.bal.hidden .eye .on { display: none; }
.bal.hidden .eye .off { display: block; }
.amt {
  display: flex; align-items: baseline; gap: 6px;
  margin: 10px 0 8px;
  font: 500 40px/1 var(--font-mono);
  white-space: nowrap;
  transition: filter var(--t-layout) var(--ease-standard), opacity var(--t-layout) var(--ease-standard);
}
.amt .cur { font-size: 20px; opacity: .72; }
.amt .dec { font-size: 24px; opacity: .72; margin-left: -6px; }
.acct {
  font-size: 12px; letter-spacing: .04em; opacity: .75;
  transition: filter var(--t-layout) var(--ease-standard);
}
.bal.hidden .amt { filter: blur(12px); opacity: .7; }
.bal.hidden .acct, .bal.hidden .delta .num { filter: blur(6px); }
.delta {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; margin-top: 14px; padding: 0 10px;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--card-ink) 12%, transparent);
  font: 600 12px/1 var(--font-text);
}
.delta .num { font-weight: 500; transition: filter var(--t-layout) var(--ease-standard); }
.delta .ic { width: 14px; height: 14px; }

.qa { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 18px 0 26px; }
.qa-btn {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 0; border: 0; background: transparent;
  color: var(--ink-2); font: 600 12px/1 var(--font-text);
  text-decoration: none; border-radius: var(--radius);
}
.qa-btn i {
  width: 56px; height: 56px; display: grid; place-items: center;
  border-radius: var(--radius-card);
  background: var(--surface); border: 1px solid var(--line); color: var(--ink);
  transition: transform var(--t-fast) var(--ease-standard), background var(--t-ui) var(--ease-standard);
}
.qa-btn:hover i { background: var(--surface-2); }
.qa-btn.primary i { background: var(--primary); color: var(--primary-ink); border-color: transparent; }
.qa-btn:active i { transform: scale(.9); }

.sec-h { font: 600 17px/1.3 var(--font-display); letter-spacing: -0.01em; margin: 0 0 2px; }
.day {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 14px 4px 8px;
  font: 600 12px/1.3 var(--font-text); letter-spacing: .04em; text-transform: uppercase;
  color: var(--ink-3);
}
.day .num { font-weight: 500; letter-spacing: 0; text-transform: none; }

.tx {
  position: relative;
  width: 100%;
  display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 12px;
  min-height: 64px; padding: 12px 14px;
  border: 0; background: transparent; color: var(--ink);
  text-align: left;
  transition: background var(--t-fast) var(--ease-standard);
}
.tx::after { content: ""; position: absolute; left: 66px; right: 0; bottom: 0; height: 1px; background: var(--line); }
.tx:last-child::after { display: none; }
.tx:hover { background: var(--surface-2); }
.tx:active { background: var(--bg); }
.tx:focus-visible { outline-offset: -2px; }
.tx.src { visibility: hidden; }
.tx .t { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tx .n { font: 600 15px/1.35 var(--font-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx .m { font-size: 12px; line-height: 1.3; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx .v { font: 500 15px/1.3 var(--font-mono); white-space: nowrap; }
.tx .v.in { color: var(--success); }
.tx.pending .av { opacity: .55; }
.tx.pending .v { color: var(--ink-3); font-weight: 400; }
.tx.new { animation: tx-enter 360ms var(--ease-ios-sheet), tx-glow 1200ms var(--ease-standard); }
@keyframes tx-enter { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes tx-glow {
  0%, 25% { background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
  100% { background: transparent; box-shadow: inset 0 0 0 1px transparent; }
}
.app.tx-open #s-home .scroll, .app.tx-open #s-home .topbar { opacity: .35; transition: opacity var(--t-layout) var(--ease-standard); }
#s-home .scroll, #s-home .topbar { transition: opacity var(--t-layout) var(--ease-standard), transform 0s; }
#s-home.snap .home-scroll { transition: transform 420ms var(--ease-ios-sheet), opacity var(--t-layout) var(--ease-standard); }

/* ---------- transaction detail · shared-element-expand ---------- */
.txd {
  position: absolute; inset: 0; z-index: 15;
  background: var(--bg);
  transform-origin: 0 0;
  overflow: hidden;
}
.txd-in { position: absolute; inset: 0; opacity: 0; transition: opacity 120ms var(--ease-standard); }
.app.tx-open .txd-in { opacity: 1; transition: opacity 260ms var(--ease-standard) 200ms; }
.txd-bar {
  height: calc(var(--safe-t) + 44px); padding: var(--safe-t) 8px 0;
  display: flex; justify-content: flex-end; align-items: center;
}
.txd-scroll {
  position: absolute; left: 0; right: 0; bottom: 0; top: calc(var(--safe-t) + 44px);
  overflow-y: auto; padding: 4px var(--m) calc(var(--safe-b) + 20px);
}
.txd-hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; }
.txd-hero .av-lg { margin-bottom: 8px; }
.txd-name { font: 600 20px/1.25 var(--font-display); letter-spacing: -0.015em; }
.txd-meta { font-size: 13px; color: var(--ink-2); }
.txd-amt { font: 500 40px/1 var(--font-mono); margin: 14px 0 10px; white-space: nowrap; }
.txd-amt.in { color: var(--success); }
#txdFacts { margin: 26px 0 16px; }
.txd-actions { display: flex; flex-direction: column; gap: 10px; }

/* ---------- large title collapse · ios-large-title-collapse ---------- */
.lt { --p: 0; }
.lt-bar {
  position: absolute; inset: 0 0 auto 0; z-index: 3;
  height: calc(var(--safe-t) + 44px);
  padding-top: var(--safe-t);
  display: flex; align-items: center; justify-content: center;
  -webkit-backdrop-filter: blur(calc(20px * var(--p))) saturate(160%);
  backdrop-filter: blur(calc(20px * var(--p))) saturate(160%);
  pointer-events: none;
}
.lt-bar::before { content: ""; position: absolute; inset: 0; background: var(--bg); opacity: calc(.82 * var(--p)); z-index: -1; }
.lt-bar::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--line); opacity: var(--p); }
.lt-mid {
  font: 600 17px/1 var(--font-display); letter-spacing: -0.01em;
  opacity: clamp(0, calc((var(--p) - .55) / .45), 1);
  transform: translateY(calc(6px * (1 - var(--p))));
}
.lt-scroll { padding-top: calc(var(--safe-t) + 44px); }
.lt-head { padding: 0 0 18px; }
.lt-title {
  font-size: 34px; line-height: 1.15;
  transform-origin: left bottom;
  opacity: calc(1 - var(--p) * 1.4);
  transform: scale(calc(1 - .18 * var(--p))) translateY(calc(-4px * var(--p)));
}
.lt-sub { margin-top: 4px; font: 600 13px/1.4 var(--font-text); color: var(--ink-2); }
.lt-sub .num { font-weight: 500; }
.lt .lt-head .search {
  height: calc(44px * (1 - var(--p)));
  margin-top: calc(12px * (1 - var(--p)));
  border-width: calc(1px - 1px * var(--p));
  opacity: calc(1 - var(--p) * 1.6);
  transform: scale(calc(1 - .06 * var(--p)));
  transform-origin: center top;
  overflow: hidden;
}

/* ---------- grouped rows · ios-grouped-settings ---------- */
.row {
  position: relative;
  width: 100%;
  display: flex; align-items: center; gap: 12px;
  min-height: 44px; padding: 0 16px;
  border: 0; background: transparent; color: var(--ink);
  font: 400 16px/1.3 var(--font-text);
  text-align: left; text-decoration: none;
  transition: background var(--t-fast) var(--ease-standard);
}
.row::after { content: ""; position: absolute; left: 57px; right: 0; bottom: 0; height: 1px; background: var(--line); }
.group > .row:last-child::after { display: none; }
.row.link:hover { background: var(--surface-2); }
.row.link:active { background: var(--line); }
.row:focus-visible { outline-offset: -2px; border-radius: var(--radius-card); }
.row-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-val { color: var(--ink-2); white-space: nowrap; flex: none; }
.row-val.num { font-size: 14px; font-weight: 500; }
.chev { width: 18px; height: 18px; color: var(--ink-3); flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.sq {
  width: 29px; height: 29px; flex: none;
  display: grid; place-items: center;
  border-radius: var(--radius);
}
.sq .ic { width: 18px; height: 18px; }
.sq-navy { background: var(--secondary); color: var(--secondary-ink); }
.sq-brass { background: var(--primary); color: var(--primary-ink); }
.sq-ox { background: var(--tertiary); color: var(--tertiary-ink); }
.sq-grey { background: var(--ink-2); color: var(--bg); }
.row.profile { min-height: 76px; padding: 12px 16px; gap: 14px; }
.row.profile::after { display: none; }
.row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.p-name { font: 600 20px/1.25 var(--font-display); letter-spacing: -0.015em; }
.p-sub { font-size: 13px; color: var(--ink-2); }
.row.two { min-height: 60px; padding-block: 10px; }
.row.two .row-label { white-space: normal; }
.credit { font-size: 13px; color: var(--ink-2); }
.credit a { color: var(--link); text-underline-offset: 2px; }

.row.person { min-height: 62px; padding: 10px 16px; }
.row.person::after { left: 68px; }
.row.person .row-text .nm { font: 600 15px/1.3 var(--font-text); }
.row.person .row-text .ac { font: 400 12px/1.3 var(--font-mono); color: var(--ink-2); }
.search-empty { margin: 12px 4px 0; font-size: 14px; color: var(--ink-2); }

.tog {
  position: relative; flex: none;
  width: 51px; height: 31px; padding: 0;
  border: 0; border-radius: 16px;
  background: var(--surface-3);
  transition: background 280ms var(--ease-standard);
}
.tog::after {
  content: ""; position: absolute; left: 2px; top: 2px;
  width: 27px; height: 27px; border-radius: 50%;
  background: var(--knob);
  box-shadow: 0 3px 8px rgba(0,0,0,.15), 0 1px 1px rgba(0,0,0,.16);
  transition: transform 280ms var(--ease-ios-sheet), width var(--t-fast) var(--ease-standard);
}
.tog[aria-checked="true"] { background: var(--secondary); }
.tog[aria-checked="true"]::after { transform: translateX(20px); }
.tog:active::after { width: 32px; }
.tog[aria-checked="true"]:active::after { transform: translateX(15px); }

/* ---------- wallet · phone-wallet-cards ---------- */
.w-head {
  position: absolute; inset: 0 0 auto 0; z-index: 3;
  height: calc(var(--safe-t) + 60px);
  padding: var(--safe-t) var(--m) 0;
  display: flex; align-items: center; justify-content: space-between;
}
.w-title { font-size: 30px; line-height: 1.1; }
.w-stack {
  position: absolute; left: var(--m); right: var(--m);
  top: calc(var(--safe-t) + 72px);
  bottom: calc(var(--tabs-h) + 12px);
  overflow: hidden;
  padding-top: 0;
}
.wcard {
  position: absolute; top: 0; left: 0;
  width: 100%; aspect-ratio: 1.586;
  padding: 0; border: 0;
  border-radius: var(--radius-card);
  text-align: left;
  transform-origin: 50% 0;
  transition: transform 420ms var(--ease-ios-sheet), opacity 420ms var(--ease-ios-sheet);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--surface) 14%, transparent), 0 -8px 24px -12px rgba(0,0,0,.35);
  will-change: transform;
}
.wcard:focus-visible { outline-offset: -3px; }
.c-debit { background: var(--secondary); color: var(--secondary-ink); }
.c-credit { background: var(--tertiary); color: var(--tertiary-ink); }
.c-online { background: var(--primary); color: var(--primary-ink); }
.w-strip {
  height: 56px; padding: 0 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.w-brand { font: 600 13px/1 var(--font-text); letter-spacing: .06em; text-transform: uppercase; }
.w-fig { font: 500 14px/1 var(--font-mono); white-space: nowrap; }
.w-chip {
  position: absolute; top: 74px; left: 18px;
  width: 40px; height: 30px; border-radius: var(--radius);
  background: var(--primary-soft);
}
[data-theme="night"] .w-chip { background: var(--primary); }
.w-chip::before { content: ""; position: absolute; inset: 10px 0; border-block: 1px solid rgba(0,0,0,.25); }
.w-chip::after { content: ""; position: absolute; inset: 0 15px; border-inline: 1px solid rgba(0,0,0,.25); }
.w-contact { position: absolute; top: 76px; right: 16px; opacity: .8; }
.w-virtual { position: absolute; top: 74px; left: 18px; font: 600 12px/1.3 var(--font-text); opacity: .85; }
.w-foot { position: absolute; left: 18px; right: 18px; bottom: 16px; }
.w-no { display: block; font-size: 15px; letter-spacing: .08em; }
.w-meta { display: flex; justify-content: space-between; margin-top: 8px; }
.w-lab { font: 600 10px/1 var(--font-text); letter-spacing: .12em; text-transform: uppercase; opacity: .78; }
.w-lab.num { font-family: var(--font-mono); font-weight: 500; }

.w-detail {
  position: absolute; left: 0; right: 0; bottom: 60px;
  overflow-y: auto;
  opacity: 0; transform: translateY(16px);
  pointer-events: none;
  transition: opacity 240ms var(--ease-standard), transform var(--t-layout) var(--ease-ios-sheet);
}
#s-cards[data-mode="open"] .w-detail {
  opacity: 1; transform: none; pointer-events: auto;
  transition-delay: 120ms;
}
.wd-label { font: 600 12px/1.3 var(--font-text); color: var(--ink-2); }
.wd-amt { font: 500 24px/1.2 var(--font-mono); margin: 2px 0 10px; }
.w-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 46px; border-top: 1px solid var(--line);
}
.w-row:last-of-type { border-bottom: 1px solid var(--line); }
.w-row .tt { display: flex; flex-direction: column; min-width: 0; }
.w-row .tn { font: 600 14px/1.3 var(--font-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-row .tm { font-size: 12px; color: var(--ink-2); }
.w-row .tv { font: 400 14px/1 var(--font-mono); white-space: nowrap; }
.w-row .tv.in { color: var(--success); }
.w-detail .btn { margin-top: 16px; }
.wd-status { margin-top: 10px; font-size: 13px; color: var(--ink-2); text-align: center; }

.w-pay {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding-top: 18px;
  opacity: 0; pointer-events: none;
  transition: opacity 240ms var(--ease-standard);
}
#s-cards[data-mode="pay"] .w-pay { opacity: 1; pointer-events: auto; transition-delay: 160ms; }
.w-ring {
  position: relative;
  width: 112px; height: 112px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--line-strong);
  color: var(--primary);
  transition: background 240ms var(--ease-standard), border-color 240ms var(--ease-standard);
}
[data-theme="ledger"] .w-ring { color: var(--link); }
.w-ring .glyph { width: 44px; height: 44px; }
.w-ring .tick { display: none; width: 48px; height: 48px; fill: none; stroke: var(--primary-ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 30; stroke-dashoffset: 30; }
.w-ring::before, .w-ring::after {
  content: ""; position: absolute; inset: -1px; border-radius: 50%;
  border: 1px solid var(--primary); opacity: 0;
}
.w-pay[data-s="hold"] .w-ring::before { animation: pulse 1800ms var(--ease-standard) infinite; }
.w-pay[data-s="hold"] .w-ring::after { animation: pulse 1800ms var(--ease-standard) 600ms infinite; }
@keyframes pulse { from { transform: scale(1); opacity: .6; } to { transform: scale(1.9); opacity: 0; } }
.w-pay[data-s="done"] .w-ring { background: var(--primary); border-color: var(--primary); }
.w-pay[data-s="done"] .glyph { display: none; }
.w-pay[data-s="done"] .tick { display: block; animation: draw 420ms var(--ease-ios-sheet) 80ms forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.w-pay-status { margin-top: 28px; font: 600 22px/1.25 var(--font-display); letter-spacing: -0.015em; }
.w-pay-sub { margin: 6px 0 22px; font-size: 13px; color: var(--ink-2); }
.w-pay .btn { min-width: 140px; }

.w-bar {
  position: absolute; left: var(--m); right: var(--m);
  bottom: calc(var(--tabs-h) + 16px);
  transition: opacity 240ms var(--ease-standard), transform var(--t-layout) var(--ease-ios-sheet);
}
#s-cards:not([data-mode="closed"]) .w-bar { opacity: 0; transform: translateY(20px); pointer-events: none; }
.w-default { margin: 12px 0 10px; text-align: center; font-size: 12px; color: var(--ink-2); }

/* ---------- scheduled · mobile-list-empty ---------- */
.nav-bar {
  position: absolute; inset: 0 0 auto 0; z-index: 3;
  height: calc(var(--safe-t) + 44px);
  padding: var(--safe-t) 8px 0;
  display: flex; align-items: center;
  background: var(--bg);
}
.sched-scroll {
  padding-top: calc(var(--safe-t) + 44px + 8px);
  display: flex; flex-direction: column;
}
.well { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; max-width: 300px; padding-bottom: 40px; }
.empty-h { font-size: 28px; line-height: 1.15; margin: 0 0 8px; }
.empty-p { font-size: 15px; line-height: 1.4; color: var(--ink-2); margin: 0 0 20px; }
.sched-list { padding-top: 16px; }
.sched-list .empty-h { margin-bottom: 16px; }

/* ---------- send flow ---------- */
.flow {
  position: absolute; inset: 0; z-index: 20;
  background: var(--bg);
  transform: translateY(100%);
  transition: transform var(--t-sheet) var(--ease-ios-sheet);
}
.flow.up { transform: none; }
.flow-bar {
  height: calc(var(--safe-t) + 44px);
  padding: var(--safe-t) 8px 0;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
}
.bar-title { font: 600 17px/1 var(--font-display); letter-spacing: -0.01em; text-align: center; }
.flow-bar .bar-btn { justify-self: start; }
.flow-step {
  position: absolute; left: 0; right: 0; bottom: 0;
  top: calc(var(--safe-t) + 44px);
  animation: step-in var(--t-ui) var(--ease-standard);
}
@keyframes step-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
.flow-scroll {
  height: 100%; overflow-y: auto;
  padding: 8px var(--m) calc(var(--safe-b) + 24px);
}
.flow-scroll > .search { margin-bottom: 4px; }

.amount-wrap {
  height: 100%;
  display: flex; flex-direction: column; gap: 12px;
  padding: 8px var(--m) var(--safe-b);
}
.rcpt {
  display: flex; align-items: center; gap: 12px;
  min-height: 60px; padding: 8px 8px 8px 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card);
}
.rcpt-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rcpt-name { font: 600 15px/1.3 var(--font-text); }
.rcpt-acct { font-size: 12px; color: var(--ink-2); }
.amt-entry {
  flex: 1; min-height: 110px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  text-align: center;
}
.amt-big { font: 500 48px/1.05 var(--font-mono); white-space: nowrap; }
.amt-big .cur { font-size: 24px; color: var(--ink-2); margin-right: 8px; }
.amt-big.empty #amtVal { color: var(--ink-3); }
.amt-hint { font-size: 13px; color: var(--ink-2); }
.amt-hint .num { font-weight: 500; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.keypad button {
  height: 52px;
  display: grid; place-items: center;
  border: 0; border-radius: var(--radius);
  background: transparent; color: var(--ink);
  font: 400 24px/1 var(--font-mono);
  transition: background var(--t-fast) var(--ease-standard);
}
.keypad button:hover { background: var(--surface-2); }
.keypad button:active { background: var(--primary-soft); }
.keypad .ic { width: 24px; height: 24px; }

.amt-review { font: 500 40px/1.1 var(--font-mono); margin: 6px 0 20px; white-space: nowrap; }
.seg { border: 0; padding: 0; margin: 20px 0 0; min-width: 0; display: grid; grid-template-columns: 1fr 1fr; }
.seg legend { padding: 0; margin-bottom: 6px; font: 600 12px/1 var(--font-text); color: var(--ink-2); }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span {
  height: var(--control);
  display: grid; place-items: center;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  font: 600 15px/1 var(--font-text); color: var(--ink-2);
  transition: background var(--t-ui) var(--ease-standard), color var(--t-ui) var(--ease-standard);
}
.seg label:first-of-type span { border-radius: var(--radius) 0 0 var(--radius); }
.seg label:last-of-type span { border-radius: 0 var(--radius) var(--radius) 0; margin-left: -1px; }
.seg input:checked + span { background: var(--primary-soft); color: var(--ink); border-color: var(--ink); position: relative; z-index: 1; }
.seg input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; position: relative; z-index: 2; }
#dateField { margin-top: 14px; }
.arrive { margin: 16px 0; font-size: 13px; color: var(--ink-2); }

.done { display: flex; flex-direction: column; align-items: flex-start; }
.done .where { margin-top: 14px; }
.amt-done { font: 500 44px/1.1 var(--font-mono); letter-spacing: 0; margin: 6px 0 12px; white-space: nowrap; }
.amt-done:focus { outline: none; }
.lead { font-size: 16px; line-height: 1.5; color: var(--ink); }
#doneFacts { width: 100%; margin: 22px 0 20px; }
.done .btn + .btn { margin-top: 10px; }

/* ---------- request sheet ---------- */
.scrim {
  position: absolute; inset: 0; z-index: 30;
  background: var(--overlay); opacity: 0;
  transition: opacity var(--t-sheet) var(--ease-ios-sheet);
}
.scrim.on { opacity: .42; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 31;
  padding: 8px var(--m) var(--safe-b);
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-radius: var(--radius-card) var(--radius-card) 0 0;
  transform: translateY(100%);
  transition: transform var(--t-sheet) var(--ease-ios-sheet);
}
.sheet.up { transform: none; }
.grab { display: block; width: 36px; height: 5px; margin: 0 auto 6px; border-radius: 3px; background: var(--line-strong); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-right: -10px; }
.sheet-title { font-size: 22px; line-height: 1.2; }
.sheet-p { margin: 4px 0 16px; font-size: 15px; line-height: 1.45; color: var(--ink-2); }
.sheet .facts { background: var(--bg); margin-bottom: 16px; }
.sheet-status { min-height: 20px; margin-top: 8px; font-size: 13px; color: var(--ink-2); text-align: center; }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 1ms !important;
    transition-delay: 0ms !important;
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
  }
  #s-home.loading .ring { animation: spin 2s linear infinite !important; }
  .tx.new { animation: tx-glow 1200ms var(--ease-standard) !important; }
  .w-pay[data-s="hold"] .w-ring::before, .w-pay[data-s="hold"] .w-ring::after { animation: none !important; }
  .w-pay[data-s="done"] .tick { stroke-dashoffset: 0; }
}
