/* =====================================================================
   Cash Checking - iPhone-style UI (Cash_Checking_app_001)
   On a desktop browser the app sits inside an iPhone-sized frame
   (393 x 852, iPhone 15/16). On a real phone - or when saved to the
   Home Screen - it fills the screen and respects the notch / home bar.
   ===================================================================== */

:root {
    --bg: #f2f2f7;
    --cell: #ffffff;
    --cell-press: #e5e5ea;
    --label: #000000;
    --label2: rgba(60, 60, 67, .60);
    --label3: rgba(60, 60, 67, .30);
    --sep: rgba(60, 60, 67, .22);
    --fill: rgba(118, 118, 128, .12);
    --fill2: rgba(118, 118, 128, .20);
    --bar: rgba(249, 249, 249, .86);
    --blue: #007aff;
    --green: #34c759;
    --red: #ff3b30;
    --orange: #ff9500;
    --indigo: #5856d6;
    --teal: #30b0c7;
    --gray: #8e8e93;
    --page: #d6dbe1;
    --frame: #1b1b1d;
    --radius: 10px;
    --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
    --safe-top: 54px;      /* fake status bar height inside the desktop frame */
    --safe-bottom: 34px;   /* home indicator area inside the desktop frame */
    color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #000000;
        --cell: #1c1c1e;
        --cell-press: #2c2c2e;
        --label: #ffffff;
        --label2: rgba(235, 235, 245, .60);
        --label3: rgba(235, 235, 245, .30);
        --sep: rgba(84, 84, 88, .55);
        --fill: rgba(118, 118, 128, .24);
        --fill2: rgba(118, 118, 128, .32);
        --bar: rgba(22, 22, 23, .86);
        --blue: #0a84ff;
        --green: #30d158;
        --red: #ff453a;
        --orange: #ff9f0a;
        --indigo: #5e5ce6;
        --teal: #40c8e0;
        --page: #0e0f11;
        --frame: #2a2a2d;
    }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
    font-family: var(--font);
    font-size: 17px;
    line-height: 1.29;
    letter-spacing: -.41px;
    color: var(--label);
    background: var(--page);
    -webkit-font-smoothing: antialiased;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px 0;
}
a { color: var(--blue); text-decoration: none; }
button, input, select, textarea { font: inherit; letter-spacing: inherit; color: inherit; }

/* ------------------------------ device frame ------------------------------ */
.device {
    position: relative;
    width: 393px;
    height: 852px;
    border-radius: 56px;
    background: var(--bg);
    box-shadow: 0 0 0 11px var(--frame), 0 0 0 13px #3a3a3c, 0 30px 80px rgba(0,0,0,.35);
    overflow: hidden;
}
.island {
    position: absolute; top: 11px; left: 50%; transform: translateX(-50%);
    width: 124px; height: 36px; border-radius: 20px; background: #000; z-index: 60;
}
.statusbar {
    position: absolute; top: 0; left: 0; right: 0; height: var(--safe-top);
    display: flex; align-items: center; justify-content: space-between;
    padding: 6px 30px 0 46px; z-index: 55; font-weight: 600; font-size: 17px;
    pointer-events: none;
}
.sb-icons { display: flex; gap: 6px; align-items: center; fill: var(--label); color: var(--label); }
.home-indicator {
    position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%);
    width: 140px; height: 5px; border-radius: 3px; background: var(--label); opacity: .85; z-index: 70;
    pointer-events: none;
}

/* Real phone, or saved to Home Screen: no frame, use the real safe areas. */
@media (max-width: 600px), (display-mode: standalone) {
    body { padding: 0; display: block; background: var(--bg); }
    :root {
        --safe-top: env(safe-area-inset-top, 20px);
        --safe-bottom: env(safe-area-inset-bottom, 0px);
    }
    .device { width: 100%; height: 100dvh; border-radius: 0; box-shadow: none; }
    .island, .statusbar, .home-indicator { display: none; }
}

/* --------------------------------- screen --------------------------------- */
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; }
.scroll {
    flex: 1; overflow-y: auto; overflow-x: hidden;
    -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain;
    padding-top: calc(var(--safe-top) + 44px);
    animation: push .32s cubic-bezier(.2,.8,.2,1);
}
.scroll::-webkit-scrollbar { display: none; }
@keyframes push { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
.tab-spacer { height: calc(49px + var(--safe-bottom) + 24px); }

/* ------------------------------ navigation bar ---------------------------- */
.navbar {
    position: absolute; top: 0; left: 0; right: 0; z-index: 40;
    padding-top: var(--safe-top);
    height: calc(var(--safe-top) + 44px);
    display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
    background: var(--bar);
    -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
    border-bottom: .5px solid var(--sep);
    transition: border-color .2s, background .2s;
}
.navbar.is-large:not(.scrolled) { background: var(--bg); border-bottom-color: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
.nav-title { font-weight: 600; font-size: 17px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 210px; transition: opacity .2s; }
.navbar.is-large:not(.scrolled) .nav-title { opacity: 0; }
.nav-left { padding-left: 8px; }
.nav-right { padding-right: 16px; display: flex; justify-content: flex-end; gap: 18px; align-items: center; }
.nav-back { display: inline-flex; align-items: center; gap: 5px; font-size: 17px; height: 44px; padding-right: 8px; }
.nav-back svg { margin-top: 1px; }
.nav-btn { font-size: 17px; background: none; border: 0; color: var(--blue); padding: 0; cursor: pointer; display: inline-flex; align-items: center; }
.nav-btn.bold { font-weight: 600; }
.nav-plus { width: 28px; height: 28px; }

.large-title { font-size: 34px; line-height: 41px; font-weight: 700; letter-spacing: .37px; margin: 2px 16px 10px; }

/* --------------------------------- tab bar -------------------------------- */
.tabbar {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 40;
    height: calc(49px + var(--safe-bottom)); padding-bottom: var(--safe-bottom);
    display: flex; background: var(--bar);
    -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
    border-top: .5px solid var(--sep);
}
.tab {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
    padding-top: 6px; gap: 2px; color: var(--gray); font-size: 10px; font-weight: 500; letter-spacing: .1px;
}
.tab svg { width: 27px; height: 27px; fill: currentColor; }
.tab svg .stroke { fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.tab.on { color: var(--blue); }
.auth-screen .scroll { padding-top: var(--safe-top); animation: none; }

/* ------------------------------ grouped lists ----------------------------- */
.section { margin: 0 16px 34px; }
.section-head { font-size: 13px; line-height: 18px; color: var(--label2); text-transform: uppercase; letter-spacing: -.08px; margin: 0 16px 7px; display: flex; justify-content: space-between; align-items: baseline; }
.section-head a { text-transform: none; font-size: 15px; }
.section-head.plain { text-transform: none; font-size: 20px; line-height: 25px; font-weight: 700; color: var(--label); margin: 0 4px 8px; letter-spacing: .38px; }
.section-foot { font-size: 13px; line-height: 18px; color: var(--label2); margin: 7px 16px 0; }

.group { background: var(--cell); border-radius: var(--radius); overflow: hidden; }
.row {
    position: relative; display: flex; align-items: center; gap: 12px;
    min-height: 44px; padding: 11px 16px; color: var(--label); background: var(--cell);
}
a.row:active, button.row:active, label.row:active { background: var(--cell-press); }
.row + .row::before, .row + form > .row::before, form + .row::before, form + form > .row::before {
    content: ""; position: absolute; top: 0; right: 0; left: 16px; border-top: .5px solid var(--sep);
}
.group.icons .row + .row::before, .group.icons form + .row::before { left: 60px; }
.group.avatars .row + .row::before { left: 68px; }
.row .grow { flex: 1; min-width: 0; }
.row .title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .sub { font-size: 15px; line-height: 20px; color: var(--label2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .detail { color: var(--label2); text-align: right; white-space: nowrap; }
.row .end { text-align: right; white-space: nowrap; }
.row .end .sub { text-align: right; }
.chev::after {
    content: ""; display: inline-block; width: 8px; height: 8px; margin-left: 2px;
    border-right: 2.3px solid var(--label3); border-top: 2.3px solid var(--label3);
    transform: rotate(45deg); border-radius: 1px; flex-shrink: 0;
}
.row-btn { width: 100%; border: 0; text-align: left; cursor: pointer; font-size: 17px; }
.row-btn.center { justify-content: center; color: var(--blue); }
.row-btn.danger { color: var(--red); }

/* square coloured icon at the left of a row (Settings-app style) */
.ico {
    width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; flex-shrink: 0;
    color: #fff; font-size: 16px; font-weight: 700;
}
.ico svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ico.blue { background: var(--blue); } .ico.green { background: var(--green); } .ico.red { background: var(--red); }
.ico.orange { background: var(--orange); } .ico.gray { background: var(--gray); } .ico.indigo { background: var(--indigo); } .ico.teal { background: var(--teal); }

.avatar {
    width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
    background: linear-gradient(180deg, #a8adb7, #858a94); color: #fff; font-weight: 600; font-size: 16px; letter-spacing: .3px;
}
.avatar.lg { width: 84px; height: 84px; font-size: 34px; }
.avatar.red { background: linear-gradient(180deg, #ff6b62, #e5372d); }

/* -------------------------------- badges ---------------------------------- */
.badge {
    display: inline-block; font-size: 12px; font-weight: 600; line-height: 18px; padding: 0 7px; border-radius: 9px;
    letter-spacing: 0; vertical-align: middle;
}
.badge.green { color: var(--green); background: color-mix(in srgb, var(--green) 15%, transparent); }
.badge.red { color: var(--red); background: color-mix(in srgb, var(--red) 14%, transparent); }
.badge.orange { color: var(--orange); background: color-mix(in srgb, var(--orange) 16%, transparent); }
.badge.blue { color: var(--blue); background: color-mix(in srgb, var(--blue) 14%, transparent); }
.badge.gray { color: var(--gray); background: var(--fill); }
.count { background: var(--red); color: #fff; border-radius: 10px; font-size: 13px; font-weight: 600; padding: 0 7px; line-height: 20px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot.green { background: var(--green); } .dot.red { background: var(--red); } .dot.orange { background: var(--orange); }
.dot.blue { background: var(--blue); } .dot.gray { background: var(--gray); }

.money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.in { color: var(--green); }
.out { color: var(--label); }
.neg { color: var(--red); }
.muted { color: var(--label2); }
.small { font-size: 13px; line-height: 18px; }
.strong { font-weight: 600; }

/* ---------------------------- segmented control --------------------------- */
.seg {
    display: flex; background: var(--fill); border-radius: 9px; padding: 2px; margin: 0 16px 16px; gap: 0;
}
.seg a, .seg label {
    flex: 1; text-align: center; font-size: 13px; font-weight: 500; line-height: 28px; color: var(--label);
    border-radius: 7px; position: relative; cursor: pointer; white-space: nowrap;
}
.seg a + a::before, .seg label + label::before {
    content: ""; position: absolute; left: 0; top: 7px; bottom: 7px; border-left: 1px solid var(--fill2);
}
.seg a.on, .seg input:checked + span { background: var(--cell); box-shadow: 0 3px 8px rgba(0,0,0,.12), 0 3px 1px rgba(0,0,0,.04); font-weight: 600; }
.seg a.on::before, .seg a.on + a::before { display: none; }
.seg input { display: none; }
.seg label span { display: block; border-radius: 7px; }
.seg.in-row { margin: 0; flex: 1; }

/* --------------------------------- search --------------------------------- */
.search { margin: 0 16px 14px; position: relative; }
.search input {
    width: 100%; height: 36px; border: 0; border-radius: 10px; background: var(--fill);
    padding: 0 12px 0 34px; font-size: 17px; outline: none;
}
.search svg { position: absolute; left: 10px; top: 10px; width: 16px; height: 16px; fill: none; stroke: var(--label2); stroke-width: 2.4; stroke-linecap: round; }

/* --------------------------------- buttons -------------------------------- */
.btn {
    display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
    height: 50px; border-radius: 12px; border: 0; cursor: pointer;
    font-size: 17px; font-weight: 600; background: var(--blue); color: #fff;
}
.btn:active { opacity: .7; }
.btn.green { background: var(--green); }
.btn.red { background: var(--red); }
.btn.tinted { background: color-mix(in srgb, var(--blue) 15%, transparent); color: var(--blue); }
.btn.tinted.red { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.btn.tinted.green { background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); }
.btn.sm { height: 34px; font-size: 15px; border-radius: 17px; width: auto; padding: 0 16px; }
.btn-row { display: flex; gap: 10px; margin: 0 16px 24px; }
.btn-row > * { flex: 1; }
.pad { margin: 0 16px 24px; }

/* ---------------------------------- forms --------------------------------- */
.field { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 16px; position: relative; background: var(--cell); }
.field + .field::before, .field + .row::before, .row + .field::before {
    content: ""; position: absolute; top: 0; right: 0; left: 16px; border-top: .5px solid var(--sep);
}
.field > label { width: 118px; flex-shrink: 0; color: var(--label); }
.field input, .field select, .field textarea {
    flex: 1; min-width: 0; border: 0; outline: none; background: transparent; padding: 11px 0;
    font-size: 17px; text-align: right; color: var(--label);
}
.field input::placeholder, .field textarea::placeholder { color: var(--label3); }
.field select { -webkit-appearance: none; appearance: none; direction: rtl; color: var(--label2); cursor: pointer; padding-right: 2px; }
.field select option { direction: ltr; }
.field.stack { flex-direction: column; align-items: stretch; gap: 0; padding-top: 8px; }
.field.stack > label { width: auto; font-size: 13px; color: var(--label2); }
.field.stack textarea, .field.stack input { text-align: left; padding: 4px 0 10px; resize: vertical; min-height: 40px; }
.field input[type=date] { -webkit-appearance: none; appearance: none; min-height: 22px; color: var(--blue); }
.field .unit { color: var(--label2); }
input[type=checkbox].switch {
    -webkit-appearance: none; appearance: none; width: 51px; height: 31px; border-radius: 16px; background: var(--fill2);
    position: relative; cursor: pointer; transition: background .2s; flex-shrink: 0; margin: 0;
}
input[type=checkbox].switch::after {
    content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%;
    background: #fff; box-shadow: 0 3px 8px rgba(0,0,0,.15), 0 3px 1px rgba(0,0,0,.06); transition: transform .2s;
}
input[type=checkbox].switch:checked { background: var(--green); }
input[type=checkbox].switch:checked::after { transform: translateX(20px); }
.field-error, .validation { color: var(--red); font-size: 13px; }
.field-error:empty { display: none; }
.errors { margin: 0 16px 16px; padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--red) 12%, var(--cell)); color: var(--red); font-size: 15px; }
.errors ul { margin: 0; padding-left: 18px; }
.validation-summary-valid { display: none; }
.input-validation-error { color: var(--red) !important; }

/* big amount input on New Check */
.amount-box { text-align: center; padding: 18px 16px 6px; }
.amount-box .cur { font-size: 34px; font-weight: 600; color: var(--label2); vertical-align: top; line-height: 64px; }
.amount-box input {
    width: 76%; border: 0; outline: none; background: transparent; text-align: center;
    font-size: 54px; font-weight: 700; letter-spacing: -1px; font-variant-numeric: tabular-nums; color: var(--label);
}
.amount-box input::placeholder { color: var(--label3); }
.amount-box .hint { font-size: 13px; color: var(--label2); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 16px 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
    flex-shrink: 0; height: 34px; padding: 0 14px; border-radius: 17px; border: 0; cursor: pointer;
    background: var(--cell); color: var(--label); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.chip.on { background: var(--blue); color: #fff; }
.chip.suggested { box-shadow: inset 0 0 0 1.5px var(--blue); }

.receipt { background: var(--cell); border-radius: 14px; padding: 4px 16px; }
.receipt .line { display: flex; justify-content: space-between; padding: 9px 0; font-variant-numeric: tabular-nums; }
.receipt .line + .line { border-top: .5px solid var(--sep); }
.receipt .total { font-size: 22px; font-weight: 700; padding: 12px 0; }
.receipt .total .money { color: var(--green); }

.notice { margin: 0 16px 14px; padding: 11px 14px; border-radius: 12px; font-size: 15px; line-height: 20px; display: flex; gap: 10px; align-items: flex-start; }
.notice.warn { background: color-mix(in srgb, var(--orange) 16%, var(--cell)); }
.notice.bad { background: color-mix(in srgb, var(--red) 13%, var(--cell)); }
.notice.info { background: color-mix(in srgb, var(--blue) 11%, var(--cell)); }
.notice b { font-weight: 600; }
.notice:empty, .notice.hidden { display: none; }

/* photo picker */
.photos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.photo {
    position: relative; aspect-ratio: 2.2 / 1; border-radius: 12px; background: var(--cell); overflow: hidden;
    display: grid; place-items: center; cursor: pointer; color: var(--blue); font-size: 15px; font-weight: 500;
    border: 1.5px dashed var(--fill2);
}
.photo input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo .ph { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.photo svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; }
.check-img { display: block; width: 100%; border-radius: 12px; background: var(--cell); }

/* ------------------------------- dashboard -------------------------------- */
.hero {
    margin: 0 16px 16px; padding: 18px 18px 16px; border-radius: 20px; color: #fff;
    background: linear-gradient(145deg, #0a84ff 0%, #0060df 55%, #3a3ad6 100%);
    box-shadow: 0 10px 30px -12px rgba(0, 90, 220, .55);
}
.hero.hero-pos { background: linear-gradient(145deg, #1fb15a 0%, #13914a 55%, #0f7a5a 100%); box-shadow: 0 10px 30px -12px rgba(20,150,80,.55); }
.hero.hero-neg { background: linear-gradient(145deg, #ff6b4a 0%, #e8433a 55%, #c2304f 100%); box-shadow: 0 10px 30px -12px rgba(220,60,50,.55); }
.hero .lbl { font-size: 13px; opacity: .85; font-weight: 500; }
.hero .big { font-size: 38px; font-weight: 700; letter-spacing: -.5px; margin: 2px 0 12px; font-variant-numeric: tabular-nums; }
.hero .split { display: flex; gap: 10px; }
.hero .split div { flex: 1; background: rgba(255,255,255,.16); border-radius: 12px; padding: 8px 12px; }
.hero .split b { display: block; font-size: 17px; font-variant-numeric: tabular-nums; }
.hero .split span { font-size: 12px; opacity: .85; }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 16px 24px; }
.tile { background: var(--cell); border-radius: 16px; padding: 12px 14px; display: block; color: var(--label); min-height: 92px; }
.tile:active { background: var(--cell-press); }
.tile .t-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.tile .t-lbl { font-size: 13px; color: var(--label2); font-weight: 500; }
.tile .t-val { font-size: 24px; font-weight: 700; letter-spacing: -.3px; font-variant-numeric: tabular-nums; }
.tile .t-sub { font-size: 13px; color: var(--label2); margin-top: 1px; }
.tile .ico { width: 28px; height: 28px; border-radius: 50%; }
.tile .ico svg { width: 16px; height: 16px; }

.chart { background: var(--cell); border-radius: 16px; padding: 14px 14px 10px; }
.chart-bars { display: flex; align-items: flex-end; gap: 8px; height: 120px; }
.chart-day { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.chart-pair { display: flex; gap: 3px; align-items: flex-end; height: 100%; width: 100%; justify-content: center; }
.chart-pair i { display: block; width: 40%; max-width: 12px; border-radius: 4px 4px 2px 2px; min-height: 3px; }
.chart-pair i.b-in { background: var(--green); }
.chart-pair i.b-out { background: var(--fill2); }
.chart-lbl { font-size: 11px; color: var(--label2); font-weight: 500; }
.chart-legend { display: flex; gap: 14px; font-size: 12px; color: var(--label2); margin-top: 10px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.chart-legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }

/* -------------------------------- profile --------------------------------- */
.profile { text-align: center; padding: 4px 16px 18px; }
.profile .avatar { margin: 0 auto 10px; }
.profile h2 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: .2px; }
.profile p { margin: 4px 0 0; color: var(--label2); font-size: 15px; }
.quick { display: flex; gap: 10px; margin: 0 16px 24px; }
.quick a, .quick button {
    flex: 1; background: var(--cell); border-radius: 12px; border: 0; cursor: pointer; padding: 9px 4px 7px;
    display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--blue); font-size: 12px; font-weight: 500;
}
.quick svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.quick a:active, .quick button:active { background: var(--cell-press); }

.kv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; background: var(--cell); border-radius: var(--radius); overflow: hidden; }
.kv div { padding: 10px 6px; text-align: center; position: relative; }
.kv div + div::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; border-left: .5px solid var(--sep); }
.kv b { display: block; font-size: 19px; font-variant-numeric: tabular-nums; }
.kv span { font-size: 12px; color: var(--label2); }

.status-head { text-align: center; padding: 6px 16px 18px; }
.status-head .amt { font-size: 44px; font-weight: 700; letter-spacing: -.8px; font-variant-numeric: tabular-nums; }
.status-head .who { color: var(--label2); font-size: 15px; margin-top: 2px; }
.status-head .badge { font-size: 13px; line-height: 22px; padding: 0 10px; border-radius: 11px; margin-bottom: 8px; }

.empty { text-align: center; padding: 34px 24px; color: var(--label2); }
.empty svg { width: 48px; height: 48px; fill: none; stroke: var(--label3); stroke-width: 1.6; margin-bottom: 8px; }
.empty b { display: block; color: var(--label); font-size: 20px; margin-bottom: 4px; }

/* ---------------------------------- login --------------------------------- */
.login { padding: 64px 24px 24px; display: flex; flex-direction: column; min-height: 100%; }
.login .app-icon {
    width: 96px; height: 96px; border-radius: 22px; margin: 0 auto 18px; display: grid; place-items: center;
    background: linear-gradient(145deg, #34c759, #0a9f43); box-shadow: 0 12px 30px -10px rgba(10,160,70,.6);
}
.login .app-icon svg { width: 54px; height: 54px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.login h1 { text-align: center; font-size: 28px; margin: 0; font-weight: 700; }
.login .tag { text-align: center; color: var(--label2); margin: 6px 0 32px; font-size: 15px; }
.login .group { margin-bottom: 14px; }
.login .field > label { width: 84px; }
.login .field input { text-align: left; }
.login .foot { margin-top: auto; text-align: center; font-size: 12px; color: var(--label3); padding-top: 24px; }
.check-line { display: flex; align-items: center; justify-content: space-between; margin: 6px 4px 22px; font-size: 15px; }

/* ---------------------------------- toast --------------------------------- */
.toast {
    position: absolute; left: 50%; top: calc(var(--safe-top) + 6px); transform: translate(-50%, -140%);
    z-index: 80; max-width: 86%; padding: 11px 18px; border-radius: 22px;
    background: var(--bar); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
    box-shadow: 0 8px 30px rgba(0,0,0,.18); font-size: 15px; font-weight: 600; text-align: center;
    animation: toast 3.2s ease forwards; pointer-events: none;
}
.toast.ok::before { content: "✓  "; color: var(--green); }
.toast.err::before { content: "!  "; color: var(--red); }
@keyframes toast {
    0% { transform: translate(-50%, -140%); }
    10%, 85% { transform: translate(-50%, 0); }
    100% { transform: translate(-50%, -160%); }
}

/* ------------------------------ action sheet ------------------------------ */
.sheet-back { position: absolute; inset: 0; background: rgba(0,0,0,.32); z-index: 90; display: none; }
.sheet-back.open { display: block; animation: fade .2s; }
.sheet {
    position: absolute; left: 8px; right: 8px; bottom: calc(var(--safe-bottom) + 8px); z-index: 91;
    transform: translateY(120%); transition: transform .28s cubic-bezier(.2,.8,.2,1);
}
.sheet.open { transform: none; }
.sheet .sgroup { background: var(--bar); -webkit-backdrop-filter: blur(30px); backdrop-filter: blur(30px); border-radius: 14px; overflow: hidden; margin-bottom: 8px; }
.sheet .smsg { padding: 14px 16px; text-align: center; font-size: 13px; color: var(--label2); border-bottom: .5px solid var(--sep); }
.sheet button { display: block; width: 100%; height: 57px; border: 0; background: transparent; font-size: 20px; color: var(--blue); cursor: pointer; }
.sheet button + button { border-top: .5px solid var(--sep); }
.sheet button.danger { color: var(--red); }
.sheet button.cancel { font-weight: 600; background: var(--cell); border-radius: 14px; }
@keyframes fade { from { opacity: 0; } }

.mt0 { margin-top: 0 !important; }
.hidden { display: none !important; }

/* ------------------------- 003: cash sources ------------------------- */
.hero.hero-src { background: linear-gradient(145deg, #5e5ce6 0%, #4644c9 55%, #2f5fd0 100%); box-shadow: 0 10px 30px -12px rgba(80,70,220,.55); }
.hero.hero-profit { background: linear-gradient(145deg, #1fb15a 0%, #13914a 55%, #0f7a5a 100%); box-shadow: 0 10px 30px -12px rgba(20,150,80,.55); }
.hero .split div span { white-space: nowrap; }
.src-list { display: flex; flex-direction: column; gap: 10px; }
.src-card { display: block; background: var(--cell); border-radius: 16px; padding: 12px 14px 11px; color: var(--label); }
.src-card:active { background: var(--cell-press); }
.src-card.off { opacity: .55; }
.src-top { display: flex; align-items: center; gap: 12px; }
.src-top .grow { flex: 1; min-width: 0; }
.src-top .title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.src-top .sub, .src-top .end .sub { font-size: 13px; color: var(--label2); }
.src-top .end { text-align: right; }
.src-logo { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 18px; flex-shrink: 0; }
.src-logo.green { background: var(--green); } .src-logo.orange { background: var(--orange); }
.src-logo.red { background: var(--red); } .src-logo.gray { background: var(--gray); }
.bar { height: 6px; border-radius: 3px; background: var(--fill); overflow: hidden; margin: 11px 0 7px; }
.bar i { display: block; height: 100%; border-radius: 3px; }
.bar i.green { background: var(--green); } .bar i.orange { background: var(--orange); }
.bar i.red { background: var(--red); } .bar i.gray { background: var(--gray); }
.src-foot { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--label2); }

/* mini source rows on Home / Cash Flow */
.mini-src { display: flex; align-items: center; gap: 10px; }
.mini-src .bar { flex: 0 0 64px; margin: 0; }

/* customer rate card */
.rate-card { background: var(--cell); border-radius: 16px; padding: 14px 16px; }
.rate-card .rate-top { display: flex; align-items: center; justify-content: space-between; }
.rate-card .rate-big { font-size: 40px; font-weight: 700; letter-spacing: -.6px; font-variant-numeric: tabular-nums; }
.rate-card .rate-sub { font-size: 13px; color: var(--label2); }
.rate-card .chips { padding: 10px 0 4px; margin: 0; }
.rate-card .chip { background: var(--fill); }
.rate-card .chip.on { background: var(--blue); color: #fff; }
.rate-edit { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
.rate-edit input { flex: 1; height: 44px; border: 0; border-radius: 10px; background: var(--fill); padding: 0 12px; font-size: 20px; font-weight: 600; text-align: center; outline: none; }
.rate-edit .btn { width: auto; padding: 0 22px; height: 44px; }
.rate-input { width: 70px; height: 34px; border: 0; border-radius: 8px; background: var(--fill); text-align: center; font-size: 16px; font-weight: 600; outline: none; font-variant-numeric: tabular-nums; }
.rate-input::placeholder { color: var(--label3); font-weight: 500; }
.rate-input.changed { box-shadow: inset 0 0 0 2px var(--blue); }
.receipt .line.profit { font-weight: 600; }
.receipt .line.profit .money { color: var(--green); }
.receipt .line.profit .money.neg { color: var(--red); }
.save-bar { position: sticky; bottom: calc(49px + var(--safe-bottom) + 10px); margin: 0 16px; z-index: 5; }
.rate-card .chips { flex-wrap: wrap; overflow: visible; }
.rate-edit input { min-width: 0; width: 100%; }
.rate-edit .btn { flex: 0 0 auto; }
.mini-src .bar { flex-basis: 48px; }

/* ---------------------- 004 local HTML version ---------------------- */
.errors.hidden { display: none; }
.errors ul { margin: 0; padding-left: 18px; }
.receipt a { color: var(--blue); }
button.row-btn { background: var(--cell); font: inherit; }
label.row-btn { justify-content: center; color: var(--blue); }
.quick a { text-decoration: none; }
.notice > div { flex: 1; }

/* ---------------------- 005: new pieces ---------------------- */
/* bright red bounced-checks bar above "Home" */
.bounce-banner {
  display: flex; align-items: center; gap: 12px; margin: 4px 16px 8px; padding: 11px 14px; border-radius: 14px;
  background: linear-gradient(135deg, #ff3b30, #e0182d); color: #fff; box-shadow: 0 8px 22px -10px rgba(255, 40, 40, .75);
  animation: bbPulse 2.4s ease-in-out infinite;
}
.bounce-banner .bb-count { min-width: 34px; height: 34px; border-radius: 17px; background: #fff; color: #e0182d; font-weight: 800; font-size: 18px; display: grid; place-items: center; padding: 0 8px; }
.bounce-banner .bb-text { flex: 1; display: flex; flex-direction: column; line-height: 1.2; }
.bounce-banner .bb-text b { font-size: 17px; }
.bounce-banner .bb-text span { font-size: 13px; opacity: .9; }
.bounce-banner .bb-chev { font-size: 26px; font-weight: 300; opacity: .9; }
@keyframes bbPulse { 0%, 100% { box-shadow: 0 8px 22px -10px rgba(255, 40, 40, .75); } 50% { box-shadow: 0 8px 28px -6px rgba(255, 40, 40, .95); } }

/* clickable Drawer / Bank boxes */
.hero .split a { flex: 1; background: rgba(255,255,255,.16); border-radius: 12px; padding: 8px 12px; color: #fff; display: block; }
.hero .split a:active { background: rgba(255,255,255,.3); }
.hero .split a b { display: block; font-size: 17px; font-variant-numeric: tabular-nums; }
.hero .split a span { font-size: 12px; opacity: .9; }

/* scan check */
.scan-card { margin: 0 16px 6px; }
.scan-btn {
  width: 100%; border: 0; font: inherit; text-align: left;
  position: relative; display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 16px; cursor: pointer;
  background: linear-gradient(135deg, #0a84ff, #5856d6); color: #fff; box-shadow: 0 10px 24px -12px rgba(10, 90, 255, .7);
}
.scan-btn:active { opacity: .85; }
.scan-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.scan-ico { width: 48px; height: 48px; border-radius: 12px; background: rgba(255,255,255,.2); display: grid; place-items: center; flex-shrink: 0; }
.scan-ico svg { width: 28px; height: 28px; fill: none; stroke: #fff; stroke-width: 2; }
.scan-txt { display: flex; flex-direction: column; line-height: 1.25; }
.scan-txt b { font-size: 18px; }
.scan-txt span { font-size: 13px; opacity: .9; }
.scan-upload { display: block; text-align: center; margin-top: 9px; font-size: 15px; color: var(--blue); cursor: pointer; }
.scan-status { margin-top: 10px; padding: 10px 13px; border-radius: 12px; font-size: 14px; line-height: 19px; }
.scan-status.info { background: color-mix(in srgb, var(--blue) 11%, var(--cell)); }
.scan-status.ok { background: color-mix(in srgb, var(--green) 14%, var(--cell)); }
.scan-status.warn { background: color-mix(in srgb, var(--orange) 16%, var(--cell)); }
input.scanned, select.scanned, .amount-box input.scanned { background: color-mix(in srgb, #ffcc00 22%, transparent) !important; border-radius: 6px; }
.verify-row .sub { font-size: 13px; color: var(--label2); }

/* fee chips 2-7% */
.chip.over { opacity: .35; text-decoration: line-through; }
.chip.theirs:not(.on) { box-shadow: inset 0 0 0 1.5px var(--blue); }

/* drawer: amount + % per cash source */
.src-add { display: grid; grid-template-columns: 1fr 112px 74px; gap: 8px; align-items: center; padding: 10px 12px 10px 16px; position: relative; background: var(--cell); }
.src-add + .src-add::before { content: ""; position: absolute; top: 0; right: 0; left: 16px; border-top: .5px solid var(--sep); }
.sa-name { display: flex; flex-direction: column; min-width: 0; }
.sa-name b { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sa-name span { font-size: 12px; color: var(--label2); }
.sa-name input { border: 0; background: var(--fill); border-radius: 8px; height: 36px; padding: 0 10px; font-size: 16px; outline: none; min-width: 0; }
.sa-amt, .sa-pct { display: flex; align-items: center; gap: 3px; background: var(--fill); border-radius: 8px; height: 36px; padding: 0 8px; }
.sa-amt span, .sa-pct span { color: var(--label2); font-weight: 600; }
.sa-amt input, .sa-pct input { border: 0; background: transparent; outline: none; width: 100%; min-width: 0; font-size: 16px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.add-src-btn { display: block; width: 100%; margin-top: 10px; height: 44px; border: 1.5px dashed var(--fill2); border-radius: 12px; background: transparent; color: var(--blue); font-size: 16px; font-weight: 600; cursor: pointer; }

/* company avatars are rounded squares */
.avatar.co { border-radius: 10px; background: linear-gradient(180deg, #6e8efb, #4a6cf0); }
.avatar.lg.co { border-radius: 20px; }
.btn-row .btn.tinted { font-size: 15px; }

/* ---------------------- 006 ---------------------- */
.center-select select { flex: 1; direction: ltr; text-align: center; text-align-last: center; color: var(--label); font-weight: 600; font-size: 18px; padding: 12px 0; }
.center-select select:invalid, .center-select select option[value=""] { color: var(--label2); }
input.readonly { color: var(--label2) !important; pointer-events: none; }
.req { color: var(--red); }
.src-add { grid-template-columns: 1fr 120px 76px; row-gap: 6px; }
.sa-due { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--label2); }
.sa-due input { border: 0; background: var(--fill); border-radius: 8px; height: 32px; padding: 0 8px; font-size: 15px; color: var(--blue); outline: none; }
.owe-row { display: flex; align-items: center; gap: 10px; padding: 11px 14px 11px 16px; position: relative; background: var(--cell); }
.owe-row + .owe-row::before { content: ""; position: absolute; top: 0; right: 0; left: 16px; border-top: .5px solid var(--sep); }
.owe-row.overdue { background: color-mix(in srgb, var(--red) 7%, var(--cell)); }
.owe-main { flex: 1; display: flex; align-items: center; gap: 10px; color: var(--label); min-width: 0; }
.owe-main .grow { flex: 1; min-width: 0; }
.owe-main .sub { font-size: 13px; color: var(--label2); line-height: 18px; }
.owe-main .end { text-align: right; }
.owe-row .btn.sm { flex-shrink: 0; }

/* ------------------------- live check camera ------------------------- */
.cam-sheet { position: absolute; inset: 0; z-index: 500; background: #000; color: #fff; overflow: hidden; border-radius: inherit; }
body > .cam-sheet { position: fixed; }
.cam-sheet video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam-frame { position: absolute; left: 50%; top: 46%; width: 90%; aspect-ratio: 2.3 / 1; max-height: 70%; transform: translate(-50%, -50%);
  border-radius: 14px; box-shadow: 0 0 0 200vmax rgba(0,0,0,.55); }
.cam-frame i { position: absolute; width: 34px; height: 34px; border: 4px solid #fff; }
.cam-frame i:nth-child(1) { left: -2px; top: -2px; border-right: 0; border-bottom: 0; border-top-left-radius: 14px; }
.cam-frame i:nth-child(2) { right: -2px; top: -2px; border-left: 0; border-bottom: 0; border-top-right-radius: 14px; }
.cam-frame i:nth-child(3) { left: -2px; bottom: -2px; border-right: 0; border-top: 0; border-bottom-left-radius: 14px; }
.cam-frame i:nth-child(4) { right: -2px; bottom: -2px; border-left: 0; border-top: 0; border-bottom-right-radius: 14px; }
.cam-hint { position: absolute; left: 0; right: 0; top: calc(46% + 22vmin); text-align: center; font-size: 15px; padding: 0 20px; text-shadow: 0 1px 3px #000; }
.cam-top { position: absolute; left: 0; right: 0; top: 0; display: flex; justify-content: space-between; padding: max(54px, env(safe-area-inset-top)) 18px 0; }
.cam-top button, .cam-upload { background: rgba(0,0,0,.45); color: #fff; border: 0; border-radius: 20px; padding: 8px 15px; font: inherit; font-size: 16px; cursor: pointer; }
.cam-flip { font-size: 20px !important; width: 42px; padding: 6px 0 !important; }
.cam-bottom { position: absolute; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; justify-items: center;
  padding: 0 18px max(44px, calc(env(safe-area-inset-bottom) + 20px)); }
.cam-shutter { width: 76px; height: 76px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 0 0 5px rgba(0,0,0,.4), 0 0 0 9px #fff; cursor: pointer; }
.cam-shutter:active { transform: scale(.93); }
.cam-shutter:disabled { opacity: .4; }
.cam-msg { position: absolute; left: 22px; right: 22px; top: 38%; background: rgba(30,30,32,.94); border-radius: 16px; padding: 18px; text-align: center; line-height: 1.4; }
.cam-msg .btn { margin-top: 12px; }
.cam-sheet.flash::after { content: ""; position: absolute; inset: 0; background: #fff; animation: camflash .25s ease-out forwards; }
@keyframes camflash { from { opacity: .9; } to { opacity: 0; } }

/* ---------------------- 009 total profit ---------------------- */
.profit-box .total-row { background: color-mix(in srgb, var(--green) 8%, var(--cell)); }
.profit-box .big-total { font-size: 22px; font-weight: 700; }
.profit-box .money.muted { color: var(--label3, #8e8e93); }

/* ---------------------- 010 several checks at once ---------------------- */
.smsg { white-space: pre-line; }
.scan-card .scan-upload { display: none; }
.upload-btn { position: relative; display: flex; align-items: center; gap: 14px; padding: 12px 16px; margin-top: 10px; border-radius: 16px; cursor: pointer;
  background: var(--cell); color: var(--label); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--blue) 45%, transparent); }
.upload-btn:active { opacity: .8; }
.upload-btn .up-ico { width: 44px; height: 44px; border-radius: 12px; background: color-mix(in srgb, var(--blue) 14%, transparent); display: grid; place-items: center; flex-shrink: 0; }
.upload-btn .up-ico svg { width: 24px; height: 24px; fill: none; stroke: var(--blue); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.upload-btn .scan-txt b { font-size: 17px; color: var(--blue); }
.upload-btn .scan-txt span { color: var(--label2); }
.scan-status-out { margin: 0 16px 6px; }
.batch-resume { display: block; text-decoration: none; color: inherit; }

.pill { display: inline-block; margin-top: 3px; padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill.gray { background: color-mix(in srgb, #8e8e93 18%, transparent); color: var(--label2); }
.pill.blue { background: color-mix(in srgb, var(--blue) 16%, transparent); color: var(--blue); }
.pill.orange { background: color-mix(in srgb, var(--orange) 20%, transparent); color: color-mix(in srgb, var(--orange) 80%, #000); }
.pill.green { background: color-mix(in srgb, var(--green) 18%, transparent); color: color-mix(in srgb, var(--green) 75%, #000); }

.batch-hero .batch-progress { height: 8px; border-radius: 4px; background: rgba(255,255,255,.25); margin: 12px 0 4px; overflow: hidden; }
.batch-hero .batch-progress span { display: block; height: 100%; background: #fff; border-radius: 4px; transition: width .3s; }
.batch-row { align-items: center; }
.batch-thumb { width: 74px; height: 34px; object-fit: cover; border-radius: 5px; flex-shrink: 0; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
.batch-row .end { text-align: right; }
.batch-row.cashed .title { color: var(--label2); }

.batch-bar { margin: 0 16px 12px; padding: 12px; border-radius: 16px; background: var(--cell); }
.bb-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; font-size: 16px; }
.bb-head .bb-all { color: var(--blue); text-decoration: none; font-size: 15px; }
.bb-head .bb-skip { justify-self: end; background: none; border: 0; color: var(--blue); font: inherit; font-size: 15px; cursor: pointer; }
.bb-dots { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 10px 0; }
.bdot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 600; text-decoration: none;
  background: color-mix(in srgb, #8e8e93 16%, transparent); color: var(--label2); }
.bdot.ready { background: color-mix(in srgb, var(--orange) 22%, transparent); color: color-mix(in srgb, var(--orange) 80%, #000); }
.bdot.cashed { background: var(--green); color: #fff; }
.bdot.skipped { background: transparent; box-shadow: inset 0 0 0 1.5px #8e8e93; }
.bdot.cur { box-shadow: 0 0 0 2.5px var(--blue); }
.batch-pic { position: relative; display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.batch-pic img { display: block; width: 100%; border-radius: 10px; box-shadow: 0 0 0 1px rgba(0,0,0,.1); }
.batch-pic span { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; padding: 3px 8px; border-radius: 8px; }
.pic-zoom { position: absolute; inset: 0; z-index: 600; background: rgba(0,0,0,.92); display: flex; align-items: center; justify-content: center; overflow: auto; cursor: zoom-out; border-radius: inherit; }
body > .pic-zoom { position: fixed; }
.pic-zoom img { max-width: 100%; max-height: 100%; }
@media (orientation: portrait) { .device .pic-zoom img { max-width: none; width: 100%; } }
.pic-zoom-hint { position: absolute; bottom: 30px; left: 0; right: 0; text-align: center; color: #fff; opacity: .7; font-size: 14px; }
