@font-face {
  font-family: "Google Sans";
  src: url("./assets/google-sans-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --blue: #0077ff;
  --ink: #111318;
  --text: #2f3033;
  --secondary: #545559;
  --muted: #939599;
  --placeholder: #b9bbbf;
  --surface: #ffffff;
  --background: #f5f6f7;
  --divider: #eceef1;
  --danger: #ff3430;
  --font: "Google Sans", "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: #edf1f5; }
body { margin: 0; min-height: 100dvh; color: var(--ink); background: radial-gradient(circle at 78% 10%, #e2ebf7 0, transparent 36%), #edf1f5; font-family: var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button { padding: 0; border: 0; color: inherit; background: none; cursor: pointer; }
button, input, select, textarea, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
button:disabled { cursor: default; }
h1, h2, h3, p { margin: 0; }
svg { width: 24px; height: 24px; display: block; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 16px; top: -60px; z-index: 200; padding: 12px 16px; border-radius: 10px; color: white; background: var(--blue); }
.skip-link:focus { top: 16px; }

.workspace { min-height: 100dvh; display: flex; align-items: center; justify-content: center; gap: clamp(32px, 5vw, 84px); padding: 24px; }
.prototype-panel { width: 216px; flex: none; }
.prototype-brand { display: flex; align-items: center; gap: 11px; }
.brand-symbol { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 13px; color: white; background: var(--blue); font-size: 1.25rem; font-weight: 600; box-shadow: 0 8px 20px #0077ff26; }
.prototype-brand strong { display: block; font-size: 1rem; line-height: 1.4; }
.prototype-brand div > span { display: block; color: var(--muted); font-size: .6875rem; line-height: 1.5; }
.panel-caption { margin: 24px 0 10px; color: #8a94a3; font-size: .625rem; letter-spacing: .09em; }
.flow-nav { display: grid; gap: 5px; }
.flow-nav button { min-height: 43px; display: flex; align-items: center; gap: 12px; padding: 0 12px; border-radius: 11px; color: #6f7987; font-size: .75rem; text-align: left; transition: color 150ms, background 150ms; }
.flow-nav button > span { color: #a0a9b5; font-size: .625rem; font-variant-numeric: tabular-nums; }
.flow-nav button.is-active { color: #075fc5; background: #ffffffc9; box-shadow: 0 4px 14px #344c6b0a; font-weight: 600; }
.flow-nav button.is-active > span { color: var(--blue); }
.scenario-control { display: grid; gap: 7px; margin-top: 22px; }
.scenario-control label { color: #7c8795; font-size: .6875rem; }
.scenario-control select { width: 100%; min-height: 40px; padding: 0 10px; border: 1px solid #dfe5ec; border-radius: 10px; color: #4c5664; background: #ffffffb8; font-size: .75rem; }
.reference-button { width: 100%; min-height: 40px; margin-top: 10px; border: 1px solid #dce4ed; border-radius: 10px; color: #526277; font-size: .75rem; }
.source-link { display: block; width: fit-content; margin-top: 16px; color: #52729d; font-size: .6875rem; text-decoration: none; }
.panel-note { margin-top: 12px; color: #98a1ad; font-size: .625rem; line-height: 1.7; }
.prototype-stage { display: flex; flex-direction: column; align-items: center; flex: none; }
.stage-toolbar { width: 360px; min-height: 32px; display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; color: #7d8897; font-size: .6875rem; }
.stage-toolbar button { min-height: 32px; color: #52729d; font-size: .6875rem; }
.stage-note { margin-top: 12px; color: #939da9; font-size: .625rem; }

.phone { position: relative; width: 360px; height: 800px; overflow: hidden; flex: none; border: 1px solid #ffffffc9; border-radius: 38px; background: var(--background); box-shadow: 0 28px 70px #263c5b24, 0 4px 18px #263c5b12; }
.status-bar { position: absolute; inset: 0 0 auto; z-index: 40; height: 36px; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; color: var(--text); font-size: .875rem; line-height: 1; font-weight: 550; pointer-events: none; }
.status-icons { display: flex; align-items: center; gap: 5px; font-size: .6875rem; }
.status-icons b { font-weight: 550; }
.cellular { width: 16px; height: 12px; background: linear-gradient(to right, currentColor 2px, transparent 2px) 0 8px/3px 4px no-repeat, linear-gradient(to right, currentColor 2px, transparent 2px) 4px 5px/3px 7px no-repeat, linear-gradient(to right, currentColor 2px, transparent 2px) 8px 2px/3px 10px no-repeat, linear-gradient(to right, currentColor 2px, transparent 2px) 12px 0/3px 12px no-repeat; }
.battery { min-width: 22px; padding: 1px 3px; border-radius: 4px; color: white; background: #4b4e55; font-size: .625rem; line-height: 13px; text-align: center; }
.screen { position: absolute; inset: 0; overflow: hidden; }
.home-indicator { position: absolute; left: 50%; bottom: 5px; z-index: 60; width: 120px; height: 4px; border-radius: 4px; background: #23262959; transform: translateX(-50%); pointer-events: none; display: none; }
.phone.camera-mode .home-indicator { display: block; }
.toast { position: absolute; left: 50%; bottom: 94px; z-index: 80; max-width: 280px; padding: 10px 16px; border-radius: 20px; color: white; background: #24272de8; box-shadow: 0 8px 20px #1b23301f; font-size: .75rem; line-height: 1.5; text-align: center; opacity: 0; transform: translate(-50%, 8px); transition: opacity 160ms, transform 160ms; pointer-events: none; white-space: nowrap; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

.page { width: 100%; height: 100%; animation: page-in 180ms ease-out; }
.page:not(.wallet-home-page):not(.camera-page) { padding-top: 36px; }
.page-scroll { height: 100%; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
.page-scroll::-webkit-scrollbar, .filter-row::-webkit-scrollbar, .result-cards::-webkit-scrollbar { display: none; }
.app-header { height: 56px; display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; padding: 0 12px; }
.app-header h1 { font-size: 1rem; line-height: 1.4; font-weight: 600; text-align: center; }
.app-header .header-title-left { text-align: left; }
.header-action { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; justify-self: center; border-radius: 50%; }
.header-action svg { width: 24px; height: 24px; }
.header-text-action { color: var(--blue); font-size: .875rem; font-weight: 500; white-space: nowrap; }
.header-cluster { display: flex; align-items: center; justify-content: flex-end; }
.home-page .app-header { grid-template-columns: 56px 1fr 88px; padding: 0 12px; }
.home-page .app-header h1 { text-align: left; }
.home-page .header-cluster { gap: 2px; }

.home-page { background: radial-gradient(ellipse 270px 225px at 38px -38px, #e2f2ffb3, transparent 72%), radial-gradient(ellipse 230px 190px at 332px 8px, #e5edffa6, transparent 72%), linear-gradient(#f7f9fb, #f5f6f7 58%); }
.home-scroll { padding: 0 16px 92px; }
.expenditure-summary { padding-top: 20px; text-align: center; }
.expenditure-label { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--muted); font-size: .75rem; line-height: 1.4; }
.expenditure-label button { width: 24px; height: 24px; display: grid; place-items: center; color: var(--muted); }
.expenditure-label svg { width: 16px; height: 16px; }
.expenditure-amount { min-height: 35px; margin-top: 4px; font-size: 1.625rem; line-height: 1.3; font-weight: 600; letter-spacing: -.015em; font-variant-numeric: tabular-nums; }
.expenditure-stats { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 9px; color: var(--muted); font-size: .6875rem; line-height: 1.4; }
.expenditure-stats strong { margin-left: 3px; color: #73777d; font-weight: 500; }
.expenditure-stats .stats-divider { width: 1px; height: 12px; background: #e0e2e6; }
.summary-dots { display: flex; justify-content: center; gap: 6px; margin-top: 16px; }
.summary-dots i { width: 5px; height: 5px; border-radius: 50%; background: #e0e3e8; }
.summary-dots i:first-child { background: #777c84; }
.ai-summary-card { min-height: 84px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 8px; margin-top: 21px; padding: 13px 14px; border: 1px solid #ffffffe6; border-radius: 17px; background: linear-gradient(110deg, #f5f3ff, #f8f7ff 64%, #f1f0ff); box-shadow: 0 5px 20px #6c63a705; }
.ai-summary-label { display: flex; align-items: center; gap: 5px; color: #9290a5; font-size: .75rem; line-height: 1.3; }
.ai-summary-label svg { width: 14px; height: 14px; color: #8f8cff; fill: #8f8cff; stroke: #8f8cff; }
.ai-summary-card p { grid-column: 1; max-width: 205px; color: #4e5059; font-size: .75rem; line-height: 1.55; }
.insight-button { grid-column: 2; grid-row: 1 / 3; min-width: 76px; min-height: 32px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; border-radius: 22px; color: white; background: linear-gradient(110deg, #00a5ff, #6536ef); box-shadow: 0 7px 16px #4d5ee629; font-size: .6875rem; font-weight: 600; }
.insight-button svg { width: 14px; height: 14px; fill: white; }
.section-title { margin: 27px 0 13px; font-size: 1rem; line-height: 1.4; font-weight: 600; }
.management-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.management-grid button { min-width: 0; min-height: 72px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; border: 1px solid #ffffffeb; border-radius: 16px; color: #26343f; background: #ffffffed; box-shadow: 0 4px 14px #4e647a05; font-size: .6875rem; line-height: 1.35; }
.management-grid button:active { transform: scale(.98); }
.management-grid svg { width: 23px; height: 23px; color: #273845; stroke-width: 1.55; }
.bill-card { min-height: 128px; display: flex; flex-direction: column; align-items: center; justify-content: center; margin-top: 8px; padding: 12px; border: 1px solid #ffffffeb; border-radius: 17px; background: #fffffff0; text-align: center; }
.empty-note { width: 42px; height: 47px; object-fit: contain; margin-bottom: 6px; }
.bill-card strong { font-size: .875rem; line-height: 1.45; font-weight: 550; }
.bill-card span { margin-top: 3px; color: var(--muted); font-size: .625rem; line-height: 1.4; }
.trading-title { margin-top: 18px; }
.filter-row { display: flex; align-items: center; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -2px; }
.filter-row button { min-width: 52px; min-height: 32px; padding: 0 13px; border: 1px solid transparent; border-radius: 18px; color: #72767d; font-size: .75rem; white-space: nowrap; }
.filter-row button.is-active { border-color: #8db7e8; color: #3c6391; background: #ffffff8c; }
.transaction-empty { min-height: 106px; display: flex; align-items: center; justify-content: center; margin-top: 12px; border-radius: 17px; background: #ffffffad; }
.transaction-empty img { opacity: .8; }
.transaction-list { display: grid; gap: 8px; margin-top: 12px; }
.transaction-row { width: 100%; min-height: 68px; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid #ffffffe6; border-radius: 15px; background: #fffffff0; text-align: left; }
.transaction-row > span:nth-child(2) { flex: 1; min-width: 0; }
.transaction-row strong { display: block; overflow: hidden; font-size: .8125rem; line-height: 1.4; font-weight: 550; text-overflow: ellipsis; white-space: nowrap; }
.transaction-row small { display: block; margin-top: 3px; color: var(--muted); font-size: .625rem; line-height: 1.4; }
.transaction-row .transaction-amount { flex: none; max-width: 128px; text-align: right; font-size: .8125rem; font-weight: 550; font-variant-numeric: tabular-nums; }
.transaction-icon { width: 34px; height: 34px; display: grid; place-items: center; flex: none; border-radius: 10px; color: #4d77a5; background: #eaf2fb; }
.transaction-icon svg { width: 18px; height: 18px; }
.privacy-line { margin-top: 16px; color: #a2a6ac; font-size: .625rem; line-height: 1.5; text-align: center; }
.ai-composer { position: absolute; left: 16px; right: 16px; bottom: 16px; z-index: 20; min-height: 52px; display: flex; align-items: center; gap: 9px; padding: 5px 6px 5px 14px; border: 1px solid #ffffff; border-radius: 28px; background: #fffffff5; box-shadow: 0 7px 24px #334f6b12; }
.composer-text { flex: 1; min-width: 0; min-height: 40px; display: flex; align-items: center; justify-content: center; gap: 8px; border-radius: 20px; color: var(--secondary); background: #f2f3f5; font-size: .75rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.composer-text svg { width: 18px; height: 18px; color: #4d83ff; }
.composer-action { width: 42px; height: 42px; display: grid; place-items: center; flex: none; border-radius: 50%; color: #111318; background: #f8f9fa; }
.composer-action svg { width: 22px; height: 22px; stroke-width: 1.8; }
.composer-action.camera svg { width: 23px; height: 23px; }
.original-note-button { position: absolute; right: 16px; bottom: 16px; z-index: 20; min-width: 82px; min-height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; border-radius: 20px; color: white; background: var(--blue); box-shadow: 0 6px 16px #0077ff2e; font-size: .75rem; font-weight: 500; }
.original-note-button svg { width: 15px; height: 15px; }

.manual-page { background: linear-gradient(180deg, #f4f8fb, #f5f6f7 45%); }
.manual-types { height: 50px; display: grid; grid-template-columns: repeat(4, 1fr); align-items: center; padding: 0 28px; }
.manual-types button { position: relative; height: 50px; color: #16181d; font-size: .75rem; }
.manual-types button.is-active { color: var(--blue); }
.manual-types button.is-active::after { content: ""; position: absolute; left: 50%; bottom: 2px; width: 18px; height: 2px; border-radius: 2px; background: var(--blue); transform: translateX(-50%); }
.manual-content { height: calc(100% - 344px); overflow-y: auto; scrollbar-width: none; }
.amount-editor { min-height: 106px; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 18px 20px 10px; }
.amount-currency { color: var(--blue); font-size: .75rem; }
.amount-value { max-width: 250px; overflow: hidden; color: var(--placeholder); font-size: 1.25rem; line-height: 1.4; font-weight: 550; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.amount-value.has-value { color: #111318; }
.amount-caret { width: 1px; height: 24px; margin-left: -5px; background: #9ea5ae; animation: blink 1.1s step-end infinite; }
.loan-amount-editor { margin: 18px 30px 0; padding-bottom: 12px; border-bottom: 1px solid #e3e7eb; }
.loan-amount-editor > span { color: var(--secondary); font-size: .6875rem; }
.loan-amount-editor > div { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.loan-amount-value { color: var(--placeholder); font-size: 1.5rem; line-height: 1.3; font-weight: 550; font-variant-numeric: tabular-nums; }
.loan-amount-value.has-value { color: var(--ink); }
.counterparty-field { display: block; margin: 14px 30px 0; padding-bottom: 7px; border-bottom: 1px solid #e3e7eb; }
.counterparty-field > span:first-child { color: var(--secondary); font-size: .6875rem; }
.counterparty-input { display: flex; align-items: center; gap: 10px; }
.counterparty-input input { width: 100%; min-width: 0; min-height: 44px; padding: 0; border: 0; color: var(--ink); background: transparent; font-size: 1rem; outline: none; }
.counterparty-input input::placeholder { color: var(--placeholder); font-size: .75rem; }
.counterparty-input > span { display: grid; place-items: center; color: var(--muted); }
.counterparty-input svg { width: 18px; height: 18px; }
.loan-content .account-row { margin-top: 12px; }
.account-row { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 30px; }
.account-select { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; font-size: .75rem; }
.account-select svg { width: 12px; height: 12px; color: var(--muted); }
.account-date { color: var(--secondary); font-size: .75rem; }
.note-field { position: relative; display: block; margin: 4px 30px 0; padding-bottom: 9px; border-bottom: 1px solid #e3e7eb; }
.note-field input { width: 100%; height: 40px; padding: 0 42px 0 0; border: 0; color: #25282d; background: transparent; font-size: 1rem; outline: none; }
.note-field input::placeholder { color: var(--muted); font-size: .75rem; }
.note-counter { position: absolute; right: 0; top: 13px; color: var(--placeholder); font-size: .625rem; }
.category-carousel { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; touch-action: pan-x; }
.category-carousel::-webkit-scrollbar { display: none; }
.category-grid { flex: 0 0 100%; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px 0; padding: 18px 24px 12px; scroll-snap-align: start; }
.category-grid button { min-height: 54px; display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--muted); font-size: .6875rem; }
.category-icon { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid transparent; border-radius: 8px; color: #a9adb3; }
.category-icon svg { width: 20px; height: 20px; }
.category-grid button.is-active { color: #4a6783; }
.category-grid button.is-active .category-icon { border-color: #9bbde4; color: #5e8cba; background: #edf5fd; }
.category-grid { user-select: none; -webkit-user-select: none; }
.category-dots { display: flex; justify-content: center; gap: 6px; margin-top: 2px; }
.category-dots button { width: 5px; height: 5px; border-radius: 50%; background: #dfe3e8; }
.category-dots button.is-active { background: #747a83; }
.danger-text { color: var(--danger); }
.number-pad { position: absolute; inset: auto 0 0; height: 238px; display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(4, 1fr); gap: 6px; padding: 7px 8px 9px; background: #f2f3f5; }
.pad-key { min-height: 44px; display: grid; place-items: center; border: 1px solid #e4e6e9; border-radius: 6px; color: #16181c; background: white; box-shadow: 0 1px 1px #1b2b3d05; font-size: 1.4375rem; line-height: 1; }
.pad-key:active { background: #e9edf2; }
.pad-key.utility { color: #252a30; background: #d9dde2; border-color: #d9dde2; font-size: 1.125rem; font-weight: 550; }
.pad-key.again { color: var(--secondary); background: #e8eaed; border-color: #e8eaed; font-size: .75rem; }
.pad-key.equals { color: white; background: var(--blue); border-color: var(--blue); font-size: 1.75rem; box-shadow: 0 4px 10px #0077ff26; }
.pad-key svg { width: 21px; height: 21px; }

.sms-import-page .app-header h1 { font-size: .875rem; }
.sms-import-body { height: calc(100% - 56px); display: flex; flex-direction: column; padding: 4px 16px 18px; overflow: hidden; }
.sms-search { margin: 4px 0 10px; }
.sms-search label { display: block; margin-bottom: 5px; color: var(--secondary); font-size: .625rem; }
.sms-search input { width: 100%; min-height: 48px; padding: 0 13px; border: 1px solid #d8e0e8; border-radius: 13px; color: var(--ink); background: white; font-size: 1rem; }
.sms-import-hint { margin: 6px 2px 8px; color: var(--muted); font-size: .625rem; }
#smsImportForm { min-height: 0; display: flex; flex: 1; flex-direction: column; }
.sms-results { min-height: 0; overflow-y: auto; flex: 1; scrollbar-width: none; }
.sms-message { border-bottom: 1px solid #e8ebef; }
.sms-message label { min-height: 88px; display: flex; align-items: center; gap: 10px; padding: 12px 2px; cursor: pointer; }
.sms-avatar { width: 34px; height: 34px; display: grid; place-items: center; flex: none; border-radius: 50%; color: #8e99a5; background: #e9edf1; }
.sms-avatar svg { width: 17px; height: 17px; }
.sms-copy { min-width: 0; flex: 1; }
.sms-copy strong { display: block; font-size: .75rem; font-weight: 550; }
.sms-copy > span { display: -webkit-box; margin-top: 4px; overflow: hidden; color: #8a9098; font-size: .625rem; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.sms-copy small { display: block; margin-top: 4px; color: #a3a9b0; font-size: .5625rem; }
.sms-radio { width: 20px; height: 20px; display: grid; place-items: center; flex: none; border: 1.5px solid #c9d1da; border-radius: 50%; color: transparent; background: white; }
.sms-radio svg { width: 12px; height: 12px; stroke-width: 2.5; }
.sms-message input:checked + label .sms-radio { border-color: var(--blue); color: white; background: var(--blue); }
.sms-message input:focus-visible + label .sms-radio { outline: 2px solid var(--blue); outline-offset: 3px; }
.sms-message.is-imported { opacity: .5; }
.sms-import-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.sms-import-actions .secondary-action { width: 100%; }
.sms-empty { display: grid; place-items: center; min-height: 160px; color: var(--muted); font-size: .75rem; text-align: center; }

.phone.camera-mode .status-bar { color: white; }
.phone.camera-mode .battery { color: #2f3033; background: #f5f6f7; }
.phone.camera-mode .screen { inset: 0; }
.camera-page { position: relative; height: 800px; color: white; background: radial-gradient(ellipse 260px 360px at 50% 28%, #73797e 0%, #484e53 48%, #292e33 82%); }
.camera-page::after { content: ""; position: absolute; inset: 0; background: linear-gradient(#00000014, transparent 45%, #00000042); pointer-events: none; }
.camera-receipt-scene { position: absolute; left: 50%; top: 137px; z-index: 1; width: 230px; aspect-ratio: 3 / 5; transform: translateX(-50%) rotate(-6deg); filter: saturate(.78) brightness(.9); }
.camera-receipt-paper { position: relative; height: 100%; padding: 23px 19px; color: #3e3b35; background: linear-gradient(92deg, #e9e4d8, #f6f2e8 48%, #eee9dc); box-shadow: 0 22px 44px #00000063, 0 3px 8px #00000038; font-family: "Courier New", ui-monospace, monospace; }
.camera-receipt-paper::after { content: ""; position: absolute; left: 0; right: 0; bottom: -8px; height: 9px; background: linear-gradient(135deg, #eee9dc 5px, transparent 0) 0 0/11px 11px repeat-x, linear-gradient(45deg, transparent 5px, #eee9dc 0) 0 0/11px 11px repeat-x; }
.receipt-heading { font-size: 1.125rem; line-height: 1.3; font-weight: 700; letter-spacing: .06em; text-align: center; }
.receipt-subheading { margin-top: 3px; font-size: .5625rem; letter-spacing: .12em; text-align: center; }
.receipt-date { margin-top: 12px; font-size: .4375rem; text-align: center; }
.receipt-rule { margin: 15px 0 11px; border-top: 1px dashed #8c887e; }
.receipt-line { display: flex; justify-content: space-between; gap: 8px; margin-top: 9px; font-size: .5rem; line-height: 1.4; }
.receipt-total { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: 20px; padding-top: 12px; border-top: 1px solid #8c887e; font-size: .625rem; }
.receipt-total strong { font-size: 1.125rem; line-height: 1.2; }
.receipt-barcode { width: 104px; height: 34px; margin: 22px auto 0; background: repeating-linear-gradient(90deg, #4b4841 0 2px, transparent 2px 4px, #4b4841 4px 5px, transparent 5px 8px, #4b4841 8px 11px, transparent 11px 14px); opacity: .72; }
.receipt-thanks { margin-top: 8px; font-size: .4375rem; text-align: center; }
.camera-header { position: absolute; inset: 36px 0 auto; z-index: 3; height: 56px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; }
.camera-header button { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid #ffffff26; border-radius: 50%; color: white; background: #33363a6b; backdrop-filter: blur(8px); }
.camera-hint { position: absolute; left: 0; right: 0; top: 591px; z-index: 2; font-size: .875rem; text-align: center; text-shadow: 0 1px 3px #00000059; }
.camera-controls { position: absolute; inset: auto 0 0; z-index: 3; height: 145px; display: flex; align-items: center; justify-content: center; padding-bottom: 15px; background: linear-gradient(transparent, #1d21262b); }
.shutter { width: 64px; height: 64px; border: 4px solid #ffffffb8; border-radius: 50%; background: white; box-shadow: 0 0 0 1px #ffffff36; }
.shutter:active { transform: scale(.94); }
.flash-button { position: absolute; left: 58px; width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid #ffffff24; border-radius: 50%; color: white; background: #2d31345c; }
.flash-button.is-active { color: #ffe77a; background: #ffffff30; }

.ai-dialog { position: absolute; inset: 0; z-index: 70; width: 360px; height: 800px; max-width: 100%; max-height: 100%; margin: 0; padding: 0; overflow: hidden; border: 0; border-radius: 38px; color: var(--ink); background: transparent; overscroll-behavior: contain; }
.ai-dialog[open] { display: block; }
#dialogContent { width: 100%; height: 100%; }
.ai-overlay { position: relative; width: 100%; height: 100%; background: #171a209e; }
.ai-sheet { position: absolute; inset: auto 0 0; min-height: 288px; display: flex; flex-direction: column; align-items: center; padding: 24px 16px 20px; border-radius: 28px 28px 0 0; background: #f5f5f7; box-shadow: 0 -12px 40px #1f27330a; animation: sheet-in 220ms cubic-bezier(.2,.8,.2,1); }
.ai-sheet-handle { position: absolute; left: 50%; top: 4px; width: 44px; height: 20px; border-radius: 12px; transform: translateX(-50%); }
.ai-sheet-handle::after { content: ""; position: absolute; left: 4px; top: 4px; width: 36px; height: 4px; border-radius: 4px; background: #d7d9dd; }
.ai-sheet-close { position: absolute; right: 16px; top: 14px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: #4e5157; background: white; box-shadow: 0 3px 10px #1f273312; }
.ai-sheet-close::after { content: ""; position: absolute; inset: -6px; }
.ai-sheet-close svg { width: 16px; height: 16px; }
.ai-done-button { min-height: 44px; margin-bottom: 10px; font-variant-numeric: tabular-nums; }
.ai-sheet.analyzing { min-height: 416px; }
.ai-sheet.result { min-height: 504px; }
.ai-brand-icon { width: 64px; height: 64px; display: grid; place-items: center; margin-bottom: 15px; border-radius: 20px; background: white; box-shadow: 0 5px 18px #5266a20a; }
.ai-brand-book { position: relative; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 9px; color: white; background: linear-gradient(145deg, #3c8dff, #2469ed); box-shadow: -5px 0 0 #b5e1ff; }
.ai-brand-book svg { width: 25px; height: 25px; stroke-width: 2.3; }
.ai-title-row { display: flex; align-items: center; justify-content: center; gap: 7px; }
.ai-title-row h2 { font-size: 1.125rem; line-height: 1.4; font-weight: 650; }
.beta-tag { padding: 2px 4px; border-radius: 4px; color: #4e5157; background: #e9eaec; font-size: .5625rem; line-height: 1.2; }
.ai-subtitle { margin-top: 14px; color: var(--muted); font-size: .75rem; line-height: 1.5; text-align: center; }
.ai-full-text { margin-top: 20px; color: #24262b; font-size: .8125rem; line-height: 1.6; text-align: center; }
.ai-input-row { width: 100%; min-height: 48px; display: flex; align-items: center; gap: 8px; margin-top: auto; padding: 4px 5px 4px 13px; border: 1px solid #ffffff; border-radius: 27px; background: white; box-shadow: 0 6px 20px #344c6b0b; }
.ai-input-row > svg { width: 15px; height: 15px; color: #4d83ff; fill: #4d83ff; }
.ai-input-row button { width: 40px; height: 40px; display: grid; place-items: center; flex: none; border-radius: 50%; }
.ai-input-row button svg { width: 21px; height: 21px; }
.ai-input-row .voice-hold-button { flex: 1 1 auto; width: auto; min-width: 0; min-height: 40px; display: flex; align-items: center; justify-content: center; gap: 8px; border-radius: 20px; color: var(--secondary); background: #f2f3f5; font-size: .75rem; font-weight: 500; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.voice-hold-button.is-listening { color: #075fc5; background: #e4efff; }
.voice-hold-button:active { background: #dceaff; }
.listening-wave { height: 26px; display: flex; align-items: center; gap: 4px; margin-top: 16px; }
.listening-wave i { width: 3px; height: 8px; border-radius: 3px; background: #8ab8ff; animation: wave 900ms ease-in-out infinite; }
.listening-wave i:nth-child(2) { height: 17px; animation-delay: 100ms; }
.listening-wave i:nth-child(3) { height: 25px; animation-delay: 200ms; }
.listening-wave i:nth-child(4) { height: 15px; animation-delay: 300ms; }
.listening-wave i:nth-child(5) { height: 9px; animation-delay: 400ms; }
.receipt-preview { width: 100%; height: 156px; display: grid; place-items: center; margin-top: 20px; border-radius: 20px; background: white; overflow: hidden; }
.receipt-paper { width: 64px; min-height: 136px; padding: 9px 7px; color: #7b7972; background: linear-gradient(90deg, #f2f0eb, #faf9f6); box-shadow: 0 3px 12px #3e3a2a12; font-family: ui-monospace, monospace; font-size: .375rem; transform: rotate(-1deg); }
.receipt-paper strong { display: block; margin-bottom: 6px; color: #5c5a55; font-size: .4375rem; text-align: center; }
.receipt-paper span { display: block; margin-top: 4px; border-bottom: 1px dotted #c5c0b7; }
.result-cards { width: calc(100% + 32px); display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 20px -16px 18px; padding: 0 42px 4px; }
.result-card { min-height: 172px; display: flex; flex: 0 0 278px; flex-direction: column; align-items: center; justify-content: center; padding: 14px; border-radius: 20px; background: white; box-shadow: 0 6px 20px #344c6b08; scroll-snap-align: center; }
.result-category { display: flex; align-items: center; gap: 6px; color: var(--secondary); font-size: .75rem; }
.result-category svg { width: 16px; height: 16px; }
.result-amount { margin-top: 10px; font-size: 2rem; line-height: 1.25; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.result-amount small { font-size: 1.25rem; font-weight: 500; }
.result-meta { margin-top: 6px; color: var(--muted); font-size: .625rem; }
.undo-button { min-width: 72px; min-height: 32px; margin-top: 13px; padding: 0 13px; border-radius: 18px; color: var(--danger); background: #f1f1f2; font-size: .75rem; font-weight: 500; }
.result-card.is-undone { opacity: .55; }
.result-card.is-undone .undo-button { color: #777; }

.secondary-page { background: linear-gradient(180deg, #f2f7fb, #f5f6f7 42%); }
.secondary-content { padding: 4px 16px 30px; }
.secondary-summary { padding: 22px 18px; border: 1px solid white; border-radius: 18px; background: #fffffff2; text-align: center; }
.secondary-summary > span { color: var(--muted); font-size: .75rem; }
.secondary-summary h2 { margin-top: 7px; font-size: 1.75rem; line-height: 1.3; font-weight: 600; }
.secondary-summary p { margin-top: 7px; color: var(--muted); font-size: .6875rem; }
.budget-track { height: 6px; margin-top: 17px; overflow: hidden; border-radius: 6px; background: #e9ecf1; }
.budget-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #36a3ff, #6553ed); }
.budget-meta { display: flex; justify-content: space-between; margin-top: 8px; color: var(--muted); font-size: .6875rem; }
.detail-section-title { margin: 22px 0 10px; font-size: .875rem; font-weight: 600; }
.detail-list { overflow: hidden; border: 1px solid white; border-radius: 17px; background: #fffffff2; }
.detail-row { min-height: 62px; display: flex; align-items: center; gap: 10px; padding: 10px 13px; border-bottom: 1px solid var(--divider); }
.detail-row:last-child { border-bottom: 0; }
.detail-row > span:nth-child(2) { flex: 1; }
.detail-row strong { display: block; font-size: .75rem; font-weight: 550; }
.detail-row small { display: block; margin-top: 3px; color: var(--muted); font-size: .625rem; }
.detail-amount { font-size: .75rem; font-weight: 550; }

.insight-page { background: radial-gradient(ellipse 300px 260px at 50% 0, #e5f5ff, transparent 80%), #f5f6f7; }
.insight-scroll { height: calc(100% - 56px); padding: 2px 12px 30px; }
.insight-bubble-region { padding: 10px 4px 0; }
.insight-bubble-stage { position: relative; width: 100%; height: 164px; display: block; text-align: left; touch-action: pan-x; user-select: none; -webkit-user-select: none; }
.insight-bubble { position: absolute; min-height: 106px; display: flex; flex-direction: column; padding: 14px 16px 12px; border: 1px solid #ffffffc9; border-radius: 22px; color: #303741; background: #ffffffc7; box-shadow: 0 8px 26px #6b8ba614; transition: top 260ms ease, left 260ms ease, right 260ms ease, opacity 260ms ease, filter 260ms ease, transform 260ms ease; }
.insight-bubble[data-position="2"] { left: 18px; right: 18px; top: 0; z-index: 1; opacity: .38; filter: blur(2px); transform: scale(.97); }
.insight-bubble[data-position="1"] { left: 8px; right: 8px; top: 23px; z-index: 2; opacity: .62; filter: blur(1.2px); transform: scale(.985); }
.insight-bubble[data-position="0"] { left: 0; right: 0; top: 55px; z-index: 3; opacity: 1; filter: none; transform: scale(1); }
.insight-bubble[data-position="0"]::after { content: ""; position: absolute; left: 24px; bottom: -6px; width: 14px; height: 14px; border-radius: 2px; background: #ffffffc7; transform: rotate(45deg); }
.insight-bubble-label { color: #8b929d; font-size: .625rem; line-height: 1.3; }
.insight-bubble-text { display: block; margin-top: 6px; font-size: .75rem; line-height: 1.5; }
.insight-bubble-eyes { display: block; margin-top: auto; padding-top: 5px; font-size: .75rem; line-height: 1; letter-spacing: 3px; }
.insight-card { margin-top: 12px; padding: 16px; border: 1px solid #ffffff; border-radius: 18px; background: #fffffff2; box-shadow: 0 4px 16px #344c6b04; }
.insight-card h2 { font-size: .875rem; line-height: 1.4; font-weight: 600; }
.insight-overview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 17px 10px; }
.insight-overview > div { min-width: 0; padding: 0 7px; border-right: 1px solid var(--divider); }
.insight-overview > div:last-child { border-right: 0; }
.insight-overview span, .insight-category-summary span { display: block; color: var(--muted); font-size: .625rem; }
.insight-overview strong { display: block; margin-top: 5px; overflow: hidden; font-size: .8125rem; line-height: 1.4; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.insight-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.insight-chart-legend { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .5625rem; }
.insight-chart-legend span { display: flex; align-items: center; gap: 4px; }
.insight-chart-legend i { width: 4px; height: 8px; border-radius: 2px; }
.insight-chart-legend .expense { background: #6547f5; }
.insight-chart-legend .budget { background: #ffad32; }
.insight-chart-card figure { margin: 0; }
.insight-chart { position: relative; height: 162px; margin-top: 8px; }
.insight-chart-value { position: absolute; right: 3px; top: 3px; z-index: 2; padding: 4px 7px; border: 1px solid #eceef2; border-radius: 6px; color: #545559; background: white; box-shadow: 0 2px 7px #344c6b0b; font-size: .5625rem; }
.insight-chart-grid { position: absolute; inset: 34px 0 25px; display: flex; flex-direction: column; justify-content: space-between; }
.insight-chart-grid i { border-top: 1px solid #eff1f4; }
.insight-chart-bars { position: absolute; inset: 34px 0 25px; display: flex; align-items: flex-end; justify-content: space-between; gap: 5px; }
.insight-day { height: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; flex: 1; }
.insight-bar { display: block; width: 4px; min-height: 2px; border-radius: 3px 3px 0 0; }
.insight-bar.expense { background: #6547f5; }
.insight-bar.budget { width: 3px; background: #ffad32; }
.insight-chart-labels { position: absolute; inset: auto 0 0; display: flex; justify-content: space-between; gap: 5px; color: #a0a5ad; font-size: .5rem; }
.insight-chart-labels span { flex: 1; text-align: center; white-space: nowrap; }
.insight-category-summary { display: grid; grid-template-columns: 1fr 34px 1fr; align-items: center; gap: 8px; }
.insight-category-summary > div:last-child { text-align: right; }
.insight-category-summary strong { display: block; margin-top: 4px; font-size: 1.125rem; line-height: 1.3; font-weight: 600; font-variant-numeric: tabular-nums; }
.insight-ai-avatar { width: 32px; height: 32px; display: grid; place-items: center; border: 3px solid white; border-radius: 50%; color: white; background: linear-gradient(135deg, #65b9ff, #6a4dee); box-shadow: 0 3px 10px #5266a225; }
.insight-ai-avatar svg { width: 15px; height: 15px; fill: white; }
.insight-category-bar { height: 8px; display: flex; overflow: hidden; margin-top: 17px; border-radius: 5px; background: #edf0f4; }
.insight-category-bar i { display: block; height: 100%; }
.insight-category-legend { display: flex; flex-wrap: wrap; gap: 9px 13px; margin: 13px 0 0; padding: 0; color: #777d87; font-size: .5625rem; list-style: none; }
.insight-category-legend li { display: flex; align-items: center; gap: 4px; }
.insight-category-legend i { width: 4px; height: 8px; border-radius: 2px; }
.insight-merchant-list { margin: 11px 0 0; padding: 0; list-style: none; }
.insight-merchant-list li { min-height: 60px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--divider); }
.insight-merchant-list li:last-child { border-bottom: 0; }
.insight-merchant-icon { width: 30px; height: 30px; display: grid; place-items: center; flex: none; border-radius: 9px; color: #149dd1; background: #e8f7fc; }
.insight-merchant-icon svg { width: 17px; height: 17px; }
.insight-merchant-copy { flex: 1; min-width: 0; }
.insight-merchant-copy strong, .insight-merchant-amount strong { display: block; overflow: hidden; font-size: .75rem; font-weight: 550; text-overflow: ellipsis; white-space: nowrap; }
.insight-merchant-copy small, .insight-merchant-amount small { display: block; margin-top: 4px; color: var(--muted); font-size: .5625rem; }
.insight-merchant-amount { flex: none; text-align: right; font-variant-numeric: tabular-nums; }
.insight-pattern-list { display: grid; gap: 17px; margin-top: 16px; }
.insight-pattern { display: flex; align-items: center; gap: 11px; }
.insight-pattern > span { width: 30px; height: 30px; display: grid; place-items: center; flex: none; border-radius: 9px; color: #399bc0; background: #eaf6fb; }
.insight-pattern svg { width: 17px; height: 17px; }
.insight-pattern strong { display: block; font-size: .75rem; font-weight: 550; }
.insight-pattern small { display: block; margin-top: 4px; color: var(--muted); font-size: .625rem; }
.insight-empty { margin-top: 14px; color: var(--muted); font-size: .6875rem; line-height: 1.5; text-align: center; }

.repayment-banner { margin: 4px 0 14px; padding: 12px 14px; border-radius: 10px; color: #72767c; background: #e9ebee; font-size: .6875rem; line-height: 1.55; }
.repayment-row { flex-wrap: wrap; }
.repayment-row > span:nth-child(2) { min-width: 135px; }
.repayment-amount { margin-left: auto; font-size: .8125rem; font-weight: 550; font-variant-numeric: tabular-nums; }
.repayment-actions { width: 100%; display: flex; justify-content: flex-end; gap: 8px; margin-top: 2px; }
.repayment-actions button { min-width: 52px; min-height: 28px; padding: 0 10px; border-radius: 15px; color: var(--blue); background: #eaf3ff; font-size: .625rem; font-weight: 500; }
.repayment-actions .paid-button { color: white; background: var(--blue); }
.repayment-empty { margin-top: 100px; }
.source-amount { margin-top: 22px; font-size: 1.75rem; font-weight: 600; }
.source-detail { width: 100%; display: grid; gap: 12px; margin: 22px 0; padding: 14px; border-radius: 14px; background: #f0f2f5; text-align: left; }
.source-detail div { display: flex; justify-content: space-between; gap: 12px; font-size: .6875rem; }
.source-detail span { color: var(--muted); }
.source-detail strong { font-weight: 500; text-align: right; }
.source-sheet { max-height: 92%; align-items: stretch; overflow-y: auto; }
.source-header { display: flex; align-items: center; justify-content: space-between; }
.source-header h2 { font-size: 1rem; font-weight: 600; }
.source-sheet .source-amount { text-align: center; }
.source-category { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 8px; color: var(--secondary); font-size: .75rem; }
.source-category svg { width: 16px; height: 16px; }
.source-lock { display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: 8px; color: var(--muted); font-size: .5625rem; }
.source-lock svg { width: 12px; height: 12px; }
.source-evidence { width: 100%; padding: 14px; border-radius: 14px; background: #f0f2f5; text-align: left; }
.source-evidence > span { color: var(--muted); font-size: .625rem; }
.source-evidence p { margin-top: 8px; color: #5d636c; font-size: .6875rem; line-height: 1.55; }
.source-receipt { height: 140px; display: grid; place-items: center; margin-top: 8px; overflow: hidden; border-radius: 12px; background: white; }
.source-receipt .receipt-paper { width: 82px; min-height: 124px; }
.source-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: auto; padding-top: 18px; }
.source-actions .secondary-action { width: 100%; }

.settings-page > .app-header { position: relative; z-index: 3; flex: none; }
.settings-scroll { height: calc(100% - 56px); padding: 4px 16px 30px; }
.settings-section-heading { width: 100%; min-height: 30px; display: flex; align-items: center; justify-content: space-between; margin: 18px 0 8px; color: var(--secondary); font-size: .75rem; line-height: 1.4; font-weight: 500; text-align: left; }
.settings-card { overflow: hidden; border: 1px solid #ffffff; border-radius: 16px; background: #fffffff2; }
.setting-row { min-height: 60px; display: flex; align-items: center; gap: 10px; padding: 11px 13px; border-bottom: 1px solid var(--divider); }
.setting-row:last-child { border-bottom: 0; }
.setting-copy { flex: 1; min-width: 0; }
.setting-copy strong { display: block; font-size: .875rem; line-height: 1.4; font-weight: 550; }
.setting-copy strong small { display: inline; margin-left: 4px; color: var(--muted); font-size: .5625rem; font-weight: 400; }
.setting-copy small { display: block; margin-top: 3px; color: var(--muted); font-size: .625rem; line-height: 1.45; }
.setting-star, .setting-source-icon { width: 25px; height: 25px; display: grid; place-items: center; flex: none; color: #6c737c; }
.setting-star svg, .setting-source-icon svg { width: 21px; height: 21px; }
.setting-source-icon { color: #8b939d; }
.setting-link { width: 100%; text-align: left; }
.setting-meta { display: inline-flex; align-items: center; gap: 3px; color: var(--muted); font-size: .625rem; white-space: nowrap; }
.setting-meta svg { width: 13px; height: 13px; transform: rotate(-90deg); }
.settings-description { margin: 10px 4px 0; color: var(--muted); font-size: .625rem; line-height: 1.65; }
.settings-activation-note { width: 100%; min-height: 46px; display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 22px; border-radius: 14px; color: var(--blue); background: #eaf3ff; font-size: .75rem; }
.settings-activation-note svg { width: 16px; height: 16px; }
.switch-control { position: relative; width: 40px; height: 24px; flex: none; }
.switch-control input { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.switch-track { position: absolute; inset: 0; border-radius: 14px; background: #c9cdd2; transition: background 150ms; }
.switch-track::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: white; box-shadow: 0 1px 3px #00000026; transition: transform 150ms; }
.switch-control input:checked + .switch-track { background: var(--blue); }
.switch-control input:checked + .switch-track::after { transform: translateX(16px); }
.switch-control input:focus-visible + .switch-track { outline: 2px solid var(--blue); outline-offset: 3px; }
.category-settings-group { margin-bottom: 22px; }
.category-settings-group h2 { margin: 14px 0 8px; color: var(--secondary); font-size: .75rem; font-weight: 500; }
.category-settings-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px 5px; padding: 14px 9px; }
.category-setting-item { position: relative; min-width: 0; min-height: 46px; display: flex; flex-direction: column; align-items: center; gap: 5px; color: var(--muted); font-size: .5625rem; line-height: 1.3; }
.category-setting-select { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.category-delete { position: absolute; right: -3px; top: -5px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; color: #8d939b; background: #f0f1f3; }
.category-delete:hover, .category-delete:focus-visible { color: white; background: var(--danger); }
.category-delete svg { width: 12px; height: 12px; }
.category-setting-item .category-icon { width: 28px; height: 28px; }
.category-setting-item.is-selected { color: var(--blue); }
.category-setting-item.is-selected .category-icon { border-color: #9dc4f5; background: #eaf3ff; }
.danger-row strong { color: var(--danger); }
.account-delete { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 6px; color: white; background: var(--danger); }
.account-delete svg { width: 14px; height: 14px; }
.setting-name { text-align: left; }
.drag-handle { min-width: 28px; min-height: 36px; display: grid; place-items: center; color: var(--muted); font-size: 1.125rem; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.drag-handle:active { cursor: grabbing; }

.onboarding-page, .consent-page, .reveal-page { position: relative; overflow: hidden; background: radial-gradient(ellipse 280px 240px at 40px -20px, #e1f1ff, transparent 72%), #f7f9fb; }
.onboarding-content { height: calc(100% - 150px); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px 32px 12px; text-align: center; }
.onboarding-book { width: 52px; height: 52px; display: grid; place-items: center; margin-bottom: 24px; border-radius: 12px; color: white; background: linear-gradient(145deg, #2c8cff, #146cf0); box-shadow: -7px 0 0 #bce6ff, 0 8px 20px #1674e326; }
.onboarding-book svg { width: 29px; height: 29px; stroke-width: 2.3; }
.onboarding-content h1 { font-size: 1.125rem; line-height: 1.45; font-weight: 600; }
.onboarding-content > p { margin-top: 7px; color: var(--muted); font-size: .6875rem; }
.onboarding-features { width: 100%; display: grid; gap: 22px; margin-top: 44px; text-align: left; }
.onboarding-feature { display: flex; align-items: center; gap: 14px; }
.onboarding-feature > span { width: 28px; height: 28px; display: grid; place-items: center; color: #25282d; }
.onboarding-feature svg { width: 23px; height: 23px; }
.onboarding-feature strong { display: block; font-size: .875rem; line-height: 1.4; font-weight: 550; }
.onboarding-feature small { display: block; margin-top: 3px; color: var(--muted); font-size: .625rem; }
.onboarding-actions { position: absolute; inset: auto 20px 22px; text-align: center; }
.primary-action, .secondary-action { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; border-radius: 24px; font-size: .875rem; font-weight: 550; }
.primary-action { width: 100%; color: white; background: var(--blue); box-shadow: 0 7px 18px #0077ff26; }
.secondary-action { color: #4a86c8; background: #eaf3ff; }
.onboarding-actions .secondary-action { width: 100%; margin-top: 10px; background: #eef3f8; }
.privacy-caption { display: block; margin-top: 13px; color: var(--muted); font-size: .5625rem; }
.consent-page { overflow-y: auto; padding: 68px 24px 100px; }
.consent-content { text-align: center; }
.consent-content .onboarding-book { margin-bottom: 18px; }
.consent-content h1 { font-size: 1.25rem; line-height: 1.35; font-weight: 600; }
.consent-lead { margin: 12px auto 0; max-width: 280px; color: #83878e; font-size: .6875rem; line-height: 1.6; }
.consent-transaction { display: flex; align-items: center; justify-content: space-between; margin-top: 26px; padding: 17px 15px; border-radius: 15px; color: #5c6772; background: #eef4f8; text-align: left; }
.consent-transaction > span { font-size: .5625rem; line-height: 1.5; }
.consent-transaction strong { padding: 10px 12px; border-radius: 12px; color: white; background: linear-gradient(135deg, #21a5f5, #0879ed); font-size: 1rem; }
.consent-transaction small { display: block; font-size: .5rem; font-weight: 400; }
.consent-shield { display: grid; place-items: center; margin: 18px auto; color: #4b9ba5; }
.consent-shield svg { width: 28px; height: 28px; }
.consent-copy { margin-top: 13px; color: #96999f; font-size: .625rem; line-height: 1.65; text-align: left; }
.consent-copy button { color: #4b7fa8; font-size: inherit; text-decoration: underline; }
.consent-actions { position: absolute; inset: auto 24px 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.reveal-page { background: linear-gradient(180deg, #f8fcff, #f5f8fb); }
.reveal-bubbles { position: absolute; inset: 30px 22px 190px; }
.reveal-bubbles span { position: absolute; display: grid; place-items: center; border-radius: 50%; box-shadow: 0 5px 12px #506b8508; }
.reveal-bubbles svg { width: 45%; height: 45%; color: #5b7187; stroke-width: 1.4; }
.reveal-content { position: absolute; inset: auto 24px 26px; text-align: center; }
.reveal-content .onboarding-book { margin-bottom: 18px; }
.reveal-content h1 { margin-bottom: 30px; font-size: 1.125rem; font-weight: 500; }
.reveal-content h1 strong { font-size: 1.5rem; font-weight: 650; }
.confirm-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 28px; }
.danger-action { background: var(--danger); box-shadow: none; }
.account-form { width: 100%; display: grid; gap: 12px; margin-top: 22px; text-align: left; }
.account-form label { color: var(--secondary); font-size: .75rem; }
.account-form input { width: 100%; min-height: 46px; padding: 0 13px; border: 1px solid #d8dde5; border-radius: 12px; color: var(--ink); background: white; font-size: 1rem; }
.account-form select { width: 100%; min-height: 46px; padding: 0 13px; border: 1px solid #d8dde5; border-radius: 12px; color: var(--ink); background: white; font-size: 1rem; }
.account-form .account-default { display: flex; align-items: center; gap: 8px; min-height: 36px; font-size: .6875rem; }
.account-default input { width: 18px; min-height: 18px; margin: 0; accent-color: var(--blue); }
.sheet-options { display: grid; margin-top: 18px; }
.sheet-options button { min-height: 48px; display: flex; align-items: center; justify-content: space-between; padding: 0 14px; border-bottom: 1px solid var(--divider); font-size: .75rem; text-align: left; }
.sheet-options button svg { width: 17px; height: 17px; color: var(--blue); }
.operator-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 22px; }
.operator-grid button { min-height: 56px; border-radius: 12px; background: white; box-shadow: 0 2px 8px #344c6b0a; font-size: 1.5rem; }
.category-form-error { min-height: 18px; color: var(--danger); font-size: .625rem; }

.reference-dialog { width: 394px; max-width: calc(100vw - 24px); max-height: 94dvh; padding: 0; overflow: auto; border: 0; border-radius: 22px; background: #f5f6f7; box-shadow: 0 24px 70px #17203340; }
.reference-dialog::backdrop { background: #16203380; }
.reference-header { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; background: #fffffff2; backdrop-filter: blur(10px); }
.reference-header strong { display: block; font-size: .8125rem; }
.reference-header span { display: block; margin-top: 2px; color: var(--muted); font-size: .625rem; }
.reference-header button { width: 36px; height: 36px; border-radius: 50%; color: #555; background: #f0f1f3; font-size: 1.25rem; }
.reference-dialog > img { width: 360px; height: 800px; margin: 0 auto; }

.split-host { position: absolute; inset: 0; }
.split-ledger-entry { width: 100%; min-height: 62px; display: flex; align-items: center; gap: 11px; margin-top: 10px; padding: 10px 12px; border: 1px solid #0077ff14; border-radius: 16px; color: var(--blue); background: #eff6fff0; text-align: left; }
.split-ledger-entry.has-match { border-color: #117a5640; background: #ebf9f3; color: #117a56; }
.split-ledger-entry.has-match .split-ledger-icon { background: #d6f3e6; color: #117a56; }
.split-ledger-icon { width: 34px; height: 34px; display: grid; place-items: center; flex: none; border-radius: 11px; background: #dceaff; }
.split-ledger-entry > span:nth-child(2) { flex: 1; min-width: 0; }
.split-ledger-entry strong { display: block; color: var(--ink); font-size: .875rem; line-height: 1.4; }
.split-ledger-entry small { display: block; margin-top: 2px; color: #71809a; font-size: .6875rem; line-height: 1.35; }
.split-ledger-entry > svg { width: 16px; height: 16px; transform: rotate(-90deg); }
.split-controls .reference-button { margin-top: 4px; }
.tx-split-tag { font-style: normal; color: #0b6bcb; font-weight: 500; }
.source-split-box { width: 100%; display: grid; gap: 9px; margin: 0 0 14px; padding: 12px 14px; border-radius: 14px; background: #eaf3ff; text-align: left; }
.source-split-box div { display: flex; justify-content: space-between; gap: 10px; font-size: .6875rem; }
.source-split-box span { color: #54667d; }
.source-split-box strong { color: #0b4f9c; font-weight: 600; font-variant-numeric: tabular-nums; }
.source-split-action { width: 100%; min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; margin-top: 12px; border-radius: 21px; color: var(--blue); background: #eaf3ff; border: 1px solid #cce0ff; font-size: .8125rem; font-weight: 600; }
.source-split-action svg { width: 16px; height: 16px; }
.repayment-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin: 4px 0 12px; border-radius: 13px; background: #e4e8ee; }
.repayment-tabs button { min-height: 34px; border-radius: 10px; color: #67707d; font-size: .75rem; font-weight: 550; }
.repayment-tabs button.is-active { color: var(--ink); background: white; box-shadow: 0 2px 8px #20304814; font-weight: 600; }
.collect-summary-card { padding: 16px; border: 1px solid #ffffff; border-radius: 18px; background: #fffffff4; box-shadow: 0 4px 16px #344c6b08; }
.collect-summary-kicker { color: var(--blue); font-size: .625rem; font-weight: 700; letter-spacing: .05em; }
.collect-summary-amount { margin-top: 6px; font-size: 1.5rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.collect-summary-card > p { margin-top: 6px; color: var(--muted); font-size: .6875rem; line-height: 1.5; }
.collect-summary-list { display: grid; gap: 7px; margin: 12px 0 14px; }
.collect-summary-item { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 12px; background: #f2f5f9; text-align: left; }
.collect-summary-item strong { display: block; font-size: .75rem; font-weight: 600; }
.collect-summary-item small { display: block; margin-top: 2px; color: var(--muted); font-size: .625rem; }
.collect-summary-item b { color: #96600e; font-size: .75rem; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.collect-manage-btn { min-height: 42px; font-size: .8125rem; }
.repayment-start-split { min-height: 34px; margin-top: 12px; padding: 0 14px; border-radius: 17px; color: white; background: var(--blue); font-size: .75rem; font-weight: 550; }

.wallet-home-page { position: relative; overflow: hidden; color: #000; background: radial-gradient(ellipse 280px 220px at 250px -30px, #a0bdffcc, transparent), radial-gradient(ellipse 220px 270px at 58px 55px, #c0eafffa, transparent), radial-gradient(ellipse 300px 220px at 263px 134px, #e3d7ffa3, transparent), #f7f7f7; }
.wallet-home-body { position: absolute; inset: 36px 0 0; }
.wallet-home-header { position: absolute; inset: 0 0 auto; height: 56px; }
.wallet-home-header h1 { position: absolute; left: 24px; top: 4px; font-size: 2rem; line-height: 43px; font-weight: 600; }
.wallet-notifications { position: absolute; left: 300px; top: 4px; width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid white; border-radius: 50%; background: #ffffff4d; box-shadow: 0 11px 16px #00000012; }
.wallet-sprite { display: block; flex: none; width: 40px; height: 40px; background-image: url("./assets/wallet-home-baseline.png"); background-size: 360px 800px; background-repeat: no-repeat; }
.wallet-icon-scan { background-position: -61.333333px -124px; }
.wallet-icon-access { background-position: -160px -124px; }
.wallet-icon-coming { background-position: -258.666667px -124px; }
.wallet-icon-coupon { background-position: -43px -232px; }
.wallet-icon-fx { background-position: -121px -232px; }
.wallet-icon-nobu { background-position: -199px -232px; }
.wallet-icon-vouchers { background-position: -277px -232px; }
.wallet-icon-roaming { background-position: -43.2px -302px; }
.wallet-icon-bell { width: 24px; height: 24px; background-position: -310px -50px; }
.wallet-icon-nav-wallet { background-position: -88px -730px; }
.wallet-icon-nav-home-active { background-position: -168px -730px; }
.wallet-icon-nav-me { background-position: -248px -730px; }
.wallet-home-quick, .wallet-home-services, .wallet-ai-entry { border-radius: 20px; background: #ffffffa6; backdrop-filter: blur(16px); }
.wallet-home-quick { position: absolute; left: 16px; top: 72px; width: 328px; height: 92px; display: flex; padding: 16px; }
.wallet-home-quick button { width: 98.666667px; height: 60px; display: flex; flex: none; flex-direction: column; align-items: center; gap: 4px; }
.wallet-home-quick button > span:last-child { font-size: .75rem; line-height: 16px; font-weight: 500; }
.wallet-home-services { position: absolute; left: 16px; top: 180px; width: 328px; height: 155px; }
.wallet-home-services > div { position: absolute; left: 8px; top: 16px; display: flex; }
.wallet-home-services button { width: 78px; height: 56px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.wallet-home-services button > span:last-child { font-size: .625rem; line-height: 12px; }
.wallet-home-services .wallet-roaming { position: absolute; left: 16px; top: 86px; width: 62.4px; }
.wallet-home-quick button > span:last-child, .wallet-home-services button > span:last-child { color: #000000a6; white-space: nowrap; }
.wallet-home-promo { position: absolute; left: 16px; top: 543px; width: 328px; height: 124px; overflow: hidden; border-radius: 20px; background: linear-gradient(145deg, #fff, #e5f2ff); }
.wallet-promo-art { position: absolute; background-image: url("./assets/coupon-art.png"); background-repeat: no-repeat; filter: drop-shadow(0 6px 11px #00000014); }
.wallet-promo-art.left { left: 9px; top: 13px; width: 138px; height: 102px; background-size: 271.294316px 152.62284px; background-position: -.41604px -.613251px; }
.wallet-promo-art.right { left: 147px; top: 7px; width: 166px; height: 120px; background-size: 318.474756px 179.55631px; background-position: -152.48855px -.72148px; }
.wallet-promo-dots { position: absolute; left: 147px; top: 110px; width: 34px; height: 6px; display: flex; gap: 8px; }
.wallet-promo-dots i { width: 6px; height: 6px; border-radius: 50%; background: #0000001f; }
.wallet-promo-dots i:first-child { background: #000000a6; }
.wallet-ai-entry { position: absolute; left: 16px; top: 351px; width: 328px; height: 176px; display: flex; flex-direction: column; overflow: hidden; }
.wallet-home-page:not(.is-activated) .wallet-ai-entry { height: 88px; }
.wallet-home-page:not(.is-activated) .wallet-home-promo { top: 455px; }
.wallet-onboarding-entry { min-width: 0; min-height: 88px; display: flex; flex: 1; align-items: center; gap: 12px; padding: 10px 16px; text-align: left; }
.wallet-entry-symbol { position: relative; width: 34px; height: 34px; display: grid; place-items: center; flex: none; border-radius: 10px; color: var(--blue); background: #eaf2ff; }
.wallet-entry-symbol svg { width: 19px; height: 19px; }
.wallet-onboarding-entry strong { display: block; font-size: .8125rem; line-height: 1.4; font-weight: 600; white-space: nowrap; }
.wallet-onboarding-entry small { display: block; margin-top: 4px; color: #00000073; font-size: .625rem; line-height: 1.4; white-space: nowrap; }
.wallet-entry-cta { min-width: 54px; min-height: 30px; display: inline-flex; align-items: center; justify-content: center; margin-left: auto; border-radius: 18px; color: white; background: var(--blue); font-size: .6875rem; font-weight: 600; }
.wallet-bill-summary { padding: 12px 14px 0; }
.wallet-bill-kicker { display: block; color: #9b8a68; font-size: .625rem; line-height: 1.4; }
.wallet-bill-main { display: flex; align-items: center; gap: 10px; margin-top: 7px; }
.wallet-bill-icon { width: 28px; height: 28px; display: grid; place-items: center; flex: none; border-radius: 9px; color: #3185c5; background: #eaf4fc; }
.wallet-bill-icon svg { width: 17px; height: 17px; }
.wallet-bill-main > span:nth-child(2) { flex: 1; min-width: 0; }
.wallet-bill-main strong { display: block; font-size: .75rem; line-height: 1.4; font-weight: 550; }
.wallet-bill-main small { display: block; margin-top: 1px; color: #00000066; font-size: .5625rem; line-height: 1.35; }
.wallet-paid { align-self: flex-start; min-width: 48px; min-height: 26px; margin-top: 3px; border-radius: 15px; color: #377fb9; background: #eff1f3; font-size: .625rem; }
.wallet-bill-dots { display: flex; justify-content: center; gap: 5px; margin-top: 8px; }
.wallet-bill-dots i { width: 4px; height: 4px; border-radius: 50%; background: #00000017; }
.wallet-bill-dots i:first-child { background: #00000080; }
.wallet-entry-actions { display: flex; height: 58px; margin-top: auto; }
.wallet-entry-actions button { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: #000000a6; font-size: .625rem; }
.wallet-entry-actions svg { width: 18px; height: 18px; }
.wallet-reminder-symbol { position: relative; display: block; height: 18px; }
.wallet-reminder-symbol b { position: absolute; left: 11px; top: -7px; padding: 1px 4px; border-radius: 8px; color: white; background: var(--danger); font-size: .5rem; line-height: 1.4; }
.wallet-home-nav { position: absolute; left: 52px; top: 684px; width: 256px; height: 60px; border-radius: 100px; background: #ffffffeb; box-shadow: 0 6px 20px #0000001f; }
.wallet-home-nav button { position: absolute; top: 4px; width: 88px; height: 52px; border-radius: 100px; }
.wallet-home-nav button:nth-child(1) { left: 4px; }
.wallet-home-nav button:nth-child(2) { left: 84px; }
.wallet-home-nav button:nth-child(3) { left: 164px; }
.wallet-home-nav button.is-active { background: #00000014; }
.wallet-home-nav .wallet-sprite { position: absolute; left: 32px; top: 6px; width: 24px; height: 24px; }
.wallet-home-nav button > span:last-child { position: absolute; left: 8px; top: 31px; width: 72px; height: 14px; font-size: .625rem; line-height: 14px; text-align: center; }
.wallet-home-nav button.is-active > span:last-child { color: #0069ff; font-weight: 600; }

.account-split-section { margin-top: 10px; padding-top: 10px; border-top: 1px solid #eef0f4; display: grid; gap: 6px; }
.account-split-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.account-split-head label { margin: 0; }
.account-quick-phone { min-height: 24px; padding: 0 8px; border-radius: 100px; color: var(--blue); background: #eaf2ff; font-size: .625rem; font-weight: 600; }

@keyframes page-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheet-in { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes blink { 0%, 45% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes wave { 0%, 100% { transform: scaleY(.55); } 50% { transform: scaleY(1); } }

@media (max-width: 760px) {
  .workspace { flex-direction: column; gap: 16px; padding: 14px 12px 28px; }
  .prototype-stage { order: 1; }
  .prototype-panel { order: 2; width: min(100%, 360px); }
  .prototype-brand, .panel-caption, .panel-note, .source-link:not(.handoff-link) { display: none; }
  .handoff-link { margin: 12px auto 0; text-align: center; }
  .flow-nav { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .flow-nav button { min-height: 40px; justify-content: center; gap: 5px; padding: 0 5px; background: #ffffff80; font-size: .6875rem; }
  .scenario-control { margin-top: 12px; }
  .reference-button { margin-top: 8px; }
}
@media (max-width: 380px) {
  .phone { transform: scale(.92); transform-origin: top center; margin-bottom: -64px; }
  .stage-toolbar { width: 330px; }
  .stage-note { margin-top: 4px; }
}
@media (max-width: 320px) {
  .workspace { padding-inline: 6px; }
  .phone { transform: scale(.76); margin-bottom: -192px; }
  .stage-toolbar { width: 274px; }
  .stage-note { display: none; }
}
@media (max-height: 860px) and (min-width: 761px) {
  .workspace { align-items: flex-start; }
  .phone { transform: scale(.9); transform-origin: top center; margin-bottom: -80px; }
  .prototype-stage { padding-top: 4px; }
  .stage-note { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}


/* === Mobile Chrome App-Native Viewport Overrides === */
html, body {
  height: 100%;
  min-height: 100dvh;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

.app-viewport {
  width: 100%;
  height: 100dvh;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: radial-gradient(circle at 78% 10%, #e2ebf7 0, transparent 36%), #edf1f5;
}

.home-indicator {
  display: none !important;
}

/* Desktop Chrome preview: centered mobile frame */
@media (min-width: 521px) {
  .phone {
    width: 390px;
    height: min(844px, 95dvh);
    border: 1px solid #ffffffd9;
    border-radius: 36px;
    box-shadow: 0 28px 70px #263c5b24, 0 4px 18px #263c5b12;
    transform: none !important;
    margin: 0 !important;
  }
}

/* Mobile Chrome (iOS / Android): full-bleed native App experience */
@media (max-width: 520px) {
  html, body, .app-viewport {
    background: var(--background);
  }
  .phone {
    width: 100%;
    height: 100dvh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    transform: none !important;
    margin: 0 !important;
  }
}

/* Prevent iOS Chrome auto-zoom on form field focus */
@media (pointer: coarse) {
  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea {
    font-size: max(16px, 1rem);
  }
}

/* Remove fake 36px status-bar offset; respect real safe-area-inset-top */
.page:not(.wallet-home-page):not(.camera-page) {
  padding-top: max(4px, env(safe-area-inset-top, 0px));
}

.home-scroll {
  padding: 0 16px calc(92px + env(safe-area-inset-bottom, 0px));
  scroll-padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
}

.ai-composer {
  bottom: max(14px, calc(8px + env(safe-area-inset-bottom, 0px)));
}

.original-note-button {
  bottom: max(14px, calc(8px + env(safe-area-inset-bottom, 0px)));
}

/* Fluid Manual Bookkeeping layout for all Chrome viewport heights */
.manual-page {
  display: flex;
  flex-direction: column;
}
.manual-page > .app-header,
.manual-types {
  flex: none;
}
.manual-content {
  flex: 1;
  min-height: 0;
  height: auto;
  overflow-y: auto;
  padding-bottom: 10px;
}
.amount-editor {
  min-height: 84px;
  padding: 12px 20px 8px;
}
.category-grid {
  gap: 14px 0;
  padding: 14px 24px 10px;
}
.number-pad {
  position: relative;
  inset: auto;
  flex: none;
  height: calc(222px + env(safe-area-inset-bottom, 0px));
  padding: 7px 8px max(9px, env(safe-area-inset-bottom, 0px));
}

/* Fluid Camera receipt page */
.camera-page {
  height: 100%;
}
.camera-header {
  inset: max(10px, env(safe-area-inset-top, 0px)) 0 auto;
}
.camera-receipt-scene {
  top: clamp(72px, 11dvh, 132px);
  width: min(226px, 60vw);
}
.camera-hint {
  top: auto;
  bottom: calc(134px + env(safe-area-inset-bottom, 0px));
}
.camera-controls {
  height: calc(128px + env(safe-area-inset-bottom, 0px));
  padding-bottom: max(14px, env(safe-area-inset-bottom, 0px));
}

/* Fluid AI Dialog & Bottom Sheets */
.ai-dialog {
  width: 100%;
  height: 100%;
  border-radius: inherit;
}
.ai-sheet {
  max-height: calc(100% - 16px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 22px 16px max(18px, calc(12px + env(safe-area-inset-bottom, 0px)));
}
.ai-sheet.analyzing {
  min-height: min(400px, calc(100% - 24px));
}
.ai-sheet.result {
  min-height: min(488px, calc(100% - 20px));
}
.result-cards {
  margin: 16px -16px 14px;
}

/* Fluid Onboarding, Consent & Reveal pages */
.onboarding-page {
  display: flex;
  flex-direction: column;
}
.onboarding-content {
  flex: 1;
  min-height: 0;
  height: auto;
  overflow-y: auto;
  padding: 20px 28px 12px;
}
.onboarding-features {
  gap: 16px;
  margin-top: 28px;
}
.onboarding-actions {
  position: relative;
  inset: auto;
  flex: none;
  padding: 8px 20px max(18px, env(safe-area-inset-bottom, 0px));
}

.consent-page {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}
.consent-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 24px 24px 16px;
}
.consent-actions {
  position: relative;
  inset: auto;
  flex: none;
  padding: 10px 24px max(18px, env(safe-area-inset-bottom, 0px));
  background: #f7f9fb;
}

.reveal-bubbles {
  inset: 18px 22px 176px;
}
.reveal-content {
  bottom: max(22px, env(safe-area-inset-bottom, 0px));
}

.sms-import-body {
  padding-bottom: max(18px, env(safe-area-inset-bottom, 0px));
}

/* Responsive Wallet Home (preserves V2.X Figma sprites & visual hierarchy across 360-430px widths and 620-850px heights) */
.wallet-home-body {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  padding: max(10px, env(safe-area-inset-top, 0px)) 16px calc(88px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.wallet-home-body::-webkit-scrollbar {
  display: none;
}
.wallet-home-header {
  position: relative;
  inset: auto;
  height: 48px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px 0 8px;
}
.wallet-home-header h1 {
  position: static;
  font-size: 1.875rem;
  line-height: 1.2;
}
.wallet-notifications {
  position: static;
  flex: none;
}
.wallet-home-quick {
  position: relative;
  left: auto;
  top: auto;
  width: 100%;
  min-height: 88px;
  height: auto;
  flex: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  padding: 14px 12px;
}
.wallet-home-quick button {
  width: 100%;
}
.wallet-home-services {
  position: relative;
  left: auto;
  top: auto;
  width: 100%;
  height: auto;
  flex: none;
  padding: 14px 8px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  row-gap: 14px;
  justify-items: center;
}
.wallet-home-services > div {
  position: static;
  display: contents;
}
.wallet-home-services button,
.wallet-home-services .wallet-roaming {
  position: static;
  width: 100%;
  height: 56px;
}
.wallet-ai-entry {
  position: relative;
  left: auto;
  top: auto;
  width: 100%;
  min-height: 170px;
  height: auto;
  flex: none;
}
.wallet-home-page:not(.is-activated) .wallet-ai-entry {
  min-height: 84px;
  height: auto;
}
.wallet-home-promo,
.wallet-home-page:not(.is-activated) .wallet-home-promo {
  position: relative;
  left: auto;
  top: auto;
  width: 100%;
  height: 124px;
  flex: none;
}
.wallet-promo-art.left {
  left: 12px;
}
.wallet-promo-art.right {
  left: auto;
  right: 10px;
}
.wallet-promo-dots {
  left: 50%;
  transform: translateX(-50%);
}
.wallet-home-nav {
  position: absolute;
  left: 50%;
  top: auto;
  bottom: max(14px, calc(8px + env(safe-area-inset-bottom, 0px)));
  transform: translateX(-50%);
  z-index: 30;
}
