:root {
  color-scheme: dark;
  --page: #0F0A1F;
  --surface: #1A1233;
  --surface-raised: #211842;
  --surface-soft: #2D2059;
  --text: #FBF8FF;
  --muted: #B7A9D2;
  --line: #2D2059;
  --accent: #8B5CF6;
  --accent-strong: #7C3AED;
  --accent-soft: rgba(139, 92, 246, .16);
  --orchid: #E879F9;
  --paid: #10B981;
  --paid-bright: #34D399;
  --danger: #F43F5E;
  --warning: #F59E0B;
  --gradient: linear-gradient(135deg, #7C3AED 0%, #C026D3 100%);
  --shadow: 0 18px 55px rgba(0, 0, 0, .32), 0 0 30px rgba(139, 92, 246, .12);
  font-family: Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--page); scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; color: var(--text); background: var(--page); transition: background .28s ease, color .28s ease; }
body[data-theme="gentle"] {
  color-scheme: light;
  --page: #F7F3FF;
  --surface: #FFFFFF;
  --surface-raised: #FFFFFF;
  --surface-soft: #F4F0FF;
  --text: #24183D;
  --muted: #75698D;
  --line: #E4D8FF;
  --accent: #7C3AED;
  --accent-strong: #6D28D9;
  --accent-soft: #EDE9FE;
  --orchid: #C026D3;
  --shadow: 0 18px 55px rgba(87, 47, 145, .10), 0 0 25px rgba(139, 92, 246, .06);
}
button, select, input { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.app-frame { width: min(100%, 480px); min-height: 100vh; margin: 0 auto; padding: 0 20px 104px; background: var(--page); transition: background .28s ease; }
.topbar { position: sticky; z-index: 5; top: 0; display: flex; align-items: center; justify-content: space-between; min-height: 76px; margin: 0 -20px; padding: 10px 20px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--page) 92%, transparent); backdrop-filter: blur(18px); }
.brand { display: inline-flex; gap: 10px; align-items: center; }
.brand-mark { position: relative; display: grid; width: 39px; height: 39px; place-items: center; border: 0; border-radius: 14px; color: #fff; background: var(--gradient); box-shadow: 0 5px 16px rgba(139, 92, 246, .28); font: 800 20px Helvetica, Arial, sans-serif; }
.brand-mark::after { position: absolute; top: -2px; right: -2px; width: 9px; height: 9px; border: 2px solid var(--page); border-radius: 50%; background: var(--paid-bright); content: ""; animation: duty-pulse 2.2s ease-out infinite; }
@keyframes duty-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, .45); } 55% { box-shadow: 0 0 0 5px rgba(52, 211, 153, 0); } }
.brand-copy { display: grid; gap: 1px; }
.brand-copy strong { font: 800 15px Helvetica, Arial, sans-serif; letter-spacing: -.5px; }
.brand-copy small { color: var(--muted); font-size: 10px; }
.header-actions { display: flex; align-items: center; gap: 7px; }
.currency-select, .theme-toggle { min-height: 35px; border: 1px solid var(--line); border-radius: 11px; color: var(--text); background: var(--surface); font-size: 11px; font-weight: 700; }
.currency-select { max-width: 82px; padding: 0 7px; }
.theme-toggle { display: inline-flex; align-items: center; gap: 5px; padding: 0 9px; cursor: pointer; transition: border-color .2s, transform .2s; }
.theme-toggle:hover { border-color: var(--accent); transform: translateY(-1px); }
.theme-icon { color: var(--accent); font-size: 16px; }

.view { animation: view-in .32s ease both; }
.view[hidden] { display: none; }
@keyframes view-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
.page-heading { display: flex; justify-content: space-between; align-items: flex-start; padding: 27px 0 20px; }
.eyebrow { margin: 0 0 8px; color: var(--accent); font-size: 9px; font-weight: 700; letter-spacing: 1.65px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 5px; font: 800 24px/1.22 Helvetica, Arial, sans-serif; letter-spacing: -.8px; }
h1 span { color: var(--accent); font-size: 15px; vertical-align: 3px; }
h2 { margin: 0 0 4px; font: 700 16px Helvetica, Arial, sans-serif; letter-spacing: -.3px; }
.page-subtitle, .section-caption { margin: 0; color: var(--muted); font-size: 12px; }
.icon-button { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid var(--line); border-radius: 11px; color: var(--muted); background: var(--surface); font-size: 19px; cursor: pointer; transition: color .2s, border-color .2s; }
.icon-button:hover { color: var(--accent); border-color: var(--accent); }
.reset-button { font-size: 20px; }

.summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.summary-card { position: relative; overflow: hidden; min-height: 110px; padding: 15px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); transition: transform .2s, background .25s; }
.summary-card:hover { transform: translateY(-2px); }
.summary-card:first-child { grid-column: span 2; background: radial-gradient(ellipse at 100% 0%, var(--accent-soft), transparent 60%), var(--surface); }
.summary-label { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; color: var(--muted); font-size: 11px; font-weight: 600; }
.summary-icon { color: var(--accent); font-size: 13px; }
.summary-value { margin: 0; font: 800 23px/1 Helvetica, Arial, sans-serif; letter-spacing: -.8px; }
.summary-card:not(:first-child) .summary-value { font-size: 19px; }
.summary-foot { margin: 7px 0 0; color: var(--muted); font-size: 10px; }
.summary-card:last-child .summary-value { color: var(--orchid); }

.confirmation-banner { display: flex; align-items: center; gap: 11px; margin: 16px 0 27px; padding: 13px; border: 1px solid color-mix(in srgb, var(--accent) 23%, var(--line)); border-radius: 15px; background: var(--accent-soft); }
.confirmation-banner[hidden] { display: none; }
.confirmation-icon { display: grid; flex: 0 0 34px; width: 34px; height: 34px; place-items: center; border-radius: 11px; color: var(--accent); background: color-mix(in srgb, var(--accent) 13%, var(--surface)); }
.confirmation-copy { flex: 1; min-width: 0; }
.confirmation-copy strong { font-size: 11px; }
.confirmation-copy p { margin: 3px 0 0; color: var(--muted); font-size: 10px; line-height: 1.4; }
.confirmation-priority { align-items: flex-start; border-color: color-mix(in srgb, var(--warning) 38%, var(--line)); background: color-mix(in srgb, var(--warning) 10%, var(--surface)); }
.confirmation-priority .confirmation-icon { color: var(--warning); background: color-mix(in srgb, var(--warning) 14%, var(--surface)); }
.confirmation-request-list { display: grid; gap: 9px; margin-top: 9px; }
.confirmation-request { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 5px 12px; padding-top: 8px; border-top: 1px solid color-mix(in srgb, var(--line) 75%, transparent); }
.confirmation-request p { flex: 1 1 180px; margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.confirmation-request p strong { color: var(--text); }
.request-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.decline-request { color: var(--danger); }
.text-button { padding: 5px 0 5px 5px; border: 0; color: var(--accent); background: none; font-size: 10px; font-weight: 700; white-space: nowrap; cursor: pointer; }
.text-button:hover { text-decoration: underline; }
.section-block { margin-top: 0; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.primary-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 45px; padding: 0 17px; border: 0; border-radius: 13px; color: #fff; background: var(--gradient); font-size: 12px; font-weight: 700; cursor: pointer; transition: transform .18s, filter .18s; }
body[data-theme="gentle"] .primary-button { color: #fff; }
.primary-button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.primary-button.compact { min-height: 34px; padding: 0 11px; border-radius: 10px; font-size: 10px; }
.filter-row { display: flex; gap: 7px; overflow-x: auto; margin: 0 -20px 12px; padding: 1px 20px 5px; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }
.filter-pill { flex: 0 0 auto; padding: 7px 11px; border: 1px solid var(--line); border-radius: 20px; color: var(--muted); background: transparent; font-size: 10px; font-weight: 600; cursor: pointer; transition: color .2s, background .2s, border .2s; }
.filter-pill.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.debt-list { display: grid; gap: 11px; }
.debt-card { padding: 15px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); box-shadow: 0 5px 16px rgba(0, 0, 0, .08), 0 0 22px rgba(139, 92, 246, .04); transition: transform .2s, border .2s; }
.debt-card:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); transform: translateY(-2px); }
.debt-topline { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.person-block { display: flex; min-width: 0; gap: 10px; align-items: center; }
.avatar { display: grid; flex: 0 0 39px; width: 39px; height: 39px; place-items: center; border-radius: 13px; color: var(--accent); background: var(--accent-soft); font: 700 13px Helvetica, Arial, sans-serif; }
.person-copy { min-width: 0; }
.person-copy strong { display: block; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.person-copy small { display: block; margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.status-badge { flex: 0 0 auto; padding: 5px 8px; border-radius: 20px; color: var(--accent); background: var(--accent-soft); font-size: 9px; font-weight: 700; }
.status-badge.overdue { color: var(--danger); background: color-mix(in srgb, var(--danger) 11%, transparent); }
.status-badge.due-soon { color: var(--warning); background: color-mix(in srgb, var(--warning) 12%, transparent); }
.status-badge.grace-period { color: var(--warning); background: color-mix(in srgb, var(--warning) 13%, transparent); }
.status-badge.settled { color: var(--paid); background: color-mix(in srgb, var(--paid-bright) 15%, transparent); }
.status-badge.pending-confirmation, .status-badge.snooze-requested { color: var(--warning); background: color-mix(in srgb, var(--warning) 14%, transparent); }
.status-badge.question-hold { color: var(--accent); background: var(--accent-soft); }
.debt-amounts { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin: 16px 0 11px; }
.amount-label { color: var(--muted); font-size: 10px; }
.amount-value { display: block; margin-top: 3px; font: 800 19px Helvetica, Arial, sans-serif; letter-spacing: -.55px; }
.due-label { text-align: right; }
.due-label strong { display: block; margin-top: 4px; font-size: 10px; }
.progress-label { display: flex; justify-content: space-between; margin-bottom: 6px; color: var(--muted); font-size: 9px; }
.progress-track { height: 5px; overflow: hidden; border-radius: 8px; background: var(--surface-soft); }
.progress-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent) 0%, var(--orchid) 100%); transition: width .4s ease; }
.channel-row { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin-top: 12px; }
.channels-label { margin-right: 2px; color: var(--muted); font-size: 9px; }
.channel-chip { padding: 4px 7px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); font-size: 9px; }
.debt-audit { margin-top: 12px; border-top: 1px solid var(--line); color: var(--muted); }
.debt-audit summary { padding: 10px 0 0; font-size: 9px; font-weight: 700; cursor: pointer; list-style: none; }
.debt-audit summary::-webkit-details-marker { display: none; }
.debt-audit summary::after { float: right; color: var(--accent); content: "＋"; }
.debt-audit[open] summary::after { content: "−"; }
.debt-audit summary span { margin-left: 4px; color: var(--accent); }
.debt-audit ol { display: grid; gap: 9px; margin: 10px 0 0; padding: 0 0 0 14px; }
.debt-audit li { padding-left: 2px; font-size: 9px; }
.debt-audit li::marker { color: var(--accent); }
.debt-audit time { display: block; margin-bottom: 3px; color: var(--muted); font-size: 8px; }
.debt-audit li strong { color: var(--text); }
.debt-audit li > span { margin-left: 7px; color: var(--paid); font-weight: 700; }
.debt-audit li p { margin: 4px 0 0; overflow-wrap: anywhere; color: var(--muted); line-height: 1.5; }
.debt-actions button:disabled, .portal-action-list button:disabled { opacity: .48; cursor: not-allowed; transform: none; }
.debt-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 14px; }
.small-action { min-height: 33px; padding: 0 7px; border: 1px solid var(--line); border-radius: 9px; color: var(--text); background: var(--surface-raised); font-size: 9px; font-weight: 600; cursor: pointer; transition: border .2s, color .2s; }
.small-action:hover { border-color: var(--accent); color: var(--accent); }
.small-action.primary-action { border-color: transparent; color: #fff; background: var(--gradient); }
.small-action.settle-action { color: var(--paid); }
.empty-state { padding: 30px 15px; border: 1px dashed var(--line); border-radius: 15px; color: var(--muted); text-align: center; font-size: 12px; }
.demo-note { margin: 21px 0 0; color: var(--muted); font-size: 9px; text-align: center; }

.heading-badge { display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid var(--line); border-radius: 14px; color: var(--accent); background: var(--accent-soft); font-size: 21px; }
.vault-intro { display: flex; align-items: center; gap: 11px; margin: 4px 0 17px; padding: 14px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.vault-icon { display: grid; width: 35px; height: 35px; place-items: center; border-radius: 11px; color: var(--accent); background: var(--accent-soft); }
.vault-intro strong { font-size: 11px; }
.vault-intro p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.payout-list { display: grid; gap: 9px; margin-bottom: 19px; }
.payout-card { display: flex; align-items: center; gap: 11px; padding: 12px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.payout-logo { display: grid; flex: 0 0 39px; width: 39px; height: 39px; place-items: center; border-radius: 12px; color: var(--accent); background: var(--accent-soft); font-size: 12px; font-weight: 800; }
.payout-main { flex: 1; min-width: 0; }
.payout-main strong { display: flex; align-items: center; gap: 6px; font-size: 11px; }
.currency-tag { padding: 3px 5px; border-radius: 5px; color: var(--muted); background: var(--surface-soft); font-size: 8px; }
.payout-main p { overflow: hidden; margin: 4px 0 0; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.qr-thumb { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 7px; object-fit: cover; }
.remove-payout { width: 28px; height: 28px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; font-size: 16px; cursor: pointer; }
.remove-payout:hover { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }
.form-card { padding: 17px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); }
.reminder-settings-card { margin-bottom: 18px; }
.reminder-time-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.form-card-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 17px; }
.mini-icon { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 10px; color: var(--accent); background: var(--accent-soft); }
.form-card-heading h2 { font-size: 13px; }
.form-card-heading p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.stack-form { display: grid; gap: 12px; }
.stack-form label, .dialog-form label { display: grid; gap: 6px; color: var(--muted); font-size: 10px; font-weight: 600; }
.stack-form input:not([type="file"]), .stack-form select, .dialog-form input, .dialog-form select { width: 100%; height: 42px; padding: 0 11px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: var(--page); font-size: 11px; }
.stack-form input::placeholder, .dialog-form input::placeholder { color: var(--muted); opacity: .7; }
.upload-control input[type="file"] { width: 100%; color: var(--muted); font-size: 10px; }
.upload-hint { color: var(--muted); font-size: 9px; font-weight: 400; }
.optional-label { display: inline; color: var(--muted); font-size: 9px; font-weight: 400; }
.stack-form .primary-button { margin-top: 3px; }

.reliability-callout { display: flex; gap: 10px; align-items: flex-start; margin: 1px 0 14px; padding: 13px; border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--line)); border-radius: 14px; color: var(--accent); background: var(--accent-soft); }
.reliability-callout span { font-size: 14px; }
.reliability-callout p { margin: 0; color: var(--text); font-size: 10px; line-height: 1.55; }
.reliability-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 23px; }
.reliability-metric { padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.reliability-metric span { color: var(--muted); font-size: 9px; }
.reliability-metric strong { display: block; margin-top: 6px; font: 800 19px Helvetica, Arial, sans-serif; }
.reliability-list { display: grid; gap: 9px; }
.reliability-card { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.rank { width: 19px; color: var(--muted); font: 700 10px Helvetica, Arial, sans-serif; text-align: center; }
.reliability-card .avatar { flex-basis: 36px; width: 36px; height: 36px; }
.reliability-person { flex: 1; min-width: 0; }
.reliability-person strong { display: block; font-size: 11px; }
.reliability-person small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.score-box { min-width: 46px; text-align: right; }
.score-box strong { display: block; color: var(--accent); font: 800 16px Helvetica, Arial, sans-serif; }
.score-box small { color: var(--muted); font-size: 8px; }
.reliability-section { margin-top: 0; }
.reliability-section .section-heading { align-items: flex-start; }

.bottom-nav { position: fixed; z-index: 6; right: 0; bottom: 0; left: 0; display: flex; justify-content: center; gap: 0; min-height: 72px; padding: 8px max(20px, calc((100vw - 440px) / 2)) max(8px, env(safe-area-inset-bottom)); border-top: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line)); background: color-mix(in srgb, var(--surface) 86%, transparent); box-shadow: 0 -7px 28px rgba(139, 92, 246, .08); backdrop-filter: blur(20px) saturate(135%); }
.nav-item { display: grid; flex: 1; place-content: center; justify-items: center; gap: 3px; color: var(--muted); font-size: 9px; font-weight: 600; transition: color .2s; }
.nav-item.active { color: var(--accent); }
.nav-icon { font-size: 19px; line-height: 1; }
.toast { position: fixed; z-index: 10; right: 20px; bottom: 88px; left: 20px; width: fit-content; max-width: 440px; margin: 0 auto; padding: 11px 15px; border: 1px solid var(--line); border-radius: 11px; color: var(--text); background: var(--surface-raised); box-shadow: var(--shadow); font-size: 11px; opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .2s, transform .2s; }
.toast.visible { opacity: 1; transform: translateY(0); }
.app-dialog { position: fixed; width: min(calc(100% - 32px), 390px); max-width: 390px; padding: 21px; border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); border-radius: 20px; color: var(--text); background: color-mix(in srgb, var(--surface) 88%, transparent); box-shadow: var(--shadow); backdrop-filter: blur(22px) saturate(135%); }
.app-dialog::backdrop { background: rgba(4, 8, 14, .64); backdrop-filter: blur(4px); }
.dialog-close-form { position: absolute; top: 12px; right: 12px; }
.dialog-content { padding-top: 10px; }
.dialog-content h2 { padding-right: 30px; font-size: 17px; }
.dialog-content > p { margin: 7px 0 18px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.dialog-form { display: grid; gap: 12px; }
.dialog-actions { display: flex; gap: 8px; margin-top: 17px; }
.dialog-actions > * { flex: 1; }
.secondary-button { min-height: 42px; padding: 0 13px; border: 1px solid var(--line); border-radius: 12px; color: var(--text); background: var(--surface-soft); font-size: 11px; font-weight: 600; cursor: pointer; }
.link-box { overflow-wrap: anywhere; padding: 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--accent); background: var(--page); font-size: 10px; }

.quick-add-card { margin: 0 0 15px; padding: 14px; border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--line)); border-radius: 17px; background: radial-gradient(ellipse at 100% 0%, var(--accent-soft), transparent 58%), var(--surface); box-shadow: 0 7px 22px rgba(139, 92, 246, .08); }
.quick-add-heading { display: flex; align-items: center; gap: 9px; margin-bottom: 11px; }
.quick-add-spark, .preview-spark { display: grid; flex: 0 0 31px; width: 31px; height: 31px; place-items: center; border-radius: 10px; color: #fff; background: var(--gradient); font-size: 14px; }
.quick-add-heading h2 { margin: 0 0 2px; font-size: 13px; }
.quick-add-heading p { margin: 0; color: var(--muted); font-size: 10px; }
.quick-add-form { display: flex; align-items: center; gap: 7px; padding: 5px; border: 1px solid var(--line); border-radius: 12px; background: var(--page); }
.quick-add-form input { flex: 1; min-width: 0; height: 36px; padding: 0 8px; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 11px; }
.quick-add-form input::placeholder { color: var(--muted); opacity: .78; }
.quick-add-submit { display: grid; flex: 0 0 34px; width: 34px; height: 34px; place-items: center; border: 0; border-radius: 9px; color: #fff; background: var(--gradient); font-size: 18px; cursor: pointer; transition: transform .18s; }
.quick-add-submit:hover { transform: translateX(2px); }
.quick-add-pills { display: flex; min-height: 20px; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.quick-add-hint { align-self: center; color: var(--muted); font-size: 9px; }
.quick-pill { display: inline-flex; align-items: baseline; gap: 4px; padding: 5px 7px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-raised); }
.quick-pill small { color: var(--muted); font-size: 8px; }
.quick-pill strong { max-width: 140px; overflow: hidden; color: var(--accent); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }

.creator-dialog { width: min(calc(100vw - 24px), 900px); max-width: 900px; max-height: min(94vh, 880px); overflow: auto; padding: 19px; overscroll-behavior: contain; }
.creator-dialog .dialog-close-form { position: sticky; z-index: 3; top: 0; float: right; height: 0; margin-right: -6px; }
.creator-modal { clear: both; }
.creator-header { display: flex; align-items: center; gap: 11px; margin: 0 38px 14px 0; }
.creator-heading-icon { display: grid; flex: 0 0 39px; width: 39px; height: 39px; place-items: center; border-radius: 13px; color: #fff; background: var(--gradient); font-size: 16px; }
.creator-header .eyebrow { margin-bottom: 3px; font-size: 8px; }
.creator-header h2 { margin: 0; font-size: 17px; }
.creator-header p:last-child { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.creator-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-bottom: 15px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--page); }
.creator-tab { min-height: 35px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; font-size: 10px; font-weight: 700; cursor: pointer; }
.creator-tab.active { color: #fff; background: var(--gradient); box-shadow: 0 4px 12px rgba(139, 92, 246, .2); }
.creator-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(240px, .75fr); align-items: start; gap: 16px; }
.creator-fields { min-width: 0; }
.creator-panel:not([hidden]) { display: grid; gap: 12px; }
.creator-panel[hidden], #installment-options[hidden], .friend-amount-field[hidden] { display: none !important; }
.creator-form label { display: grid; min-width: 0; gap: 5px; color: var(--muted); font-size: 9px; font-weight: 700; }
.creator-form label[hidden] { display: none !important; }
.creator-form input:not([type="checkbox"]):not([type="radio"]), .creator-form select { width: 100%; min-width: 0; height: 37px; padding: 0 9px; border: 1px solid var(--line); border-radius: 9px; color: var(--text); background: var(--page); font: 500 10px Helvetica, Arial, sans-serif; }
.creator-form input::placeholder { color: var(--muted); opacity: .7; }
.creator-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.amount-currency-row { grid-template-columns: minmax(0, 1.35fr) minmax(95px, .65fr); }
.creator-fieldset { min-width: 0; margin: 0; padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
.creator-fieldset legend { padding: 0 5px; color: var(--text); font-size: 10px; font-weight: 700; }
.creator-fieldset legend span { margin-left: 3px; color: var(--muted); font-size: 8px; font-weight: 400; }
.channel-input-list { display: grid; gap: 6px; }
.channel-input-row { display: grid; grid-template-columns: 97px minmax(0, 1fr); align-items: center; gap: 7px; }
.creator-form .channel-check { display: flex; align-items: center; gap: 6px; color: var(--text); font-size: 9px; }
.creator-form input[type="checkbox"], .creator-form input[type="radio"] { width: 14px; height: 14px; margin: 0; accent-color: var(--accent); }
.channel-input-row > input { height: 32px !important; }
.waterfall-editor { display: grid; gap: 7px; }
.editor-section-heading, .friend-list-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.editor-section-heading strong, .friend-list-heading strong { color: var(--text); font-size: 10px; }
.editor-section-heading small, .friend-list-heading small { color: var(--muted); font-size: 8px; }
.channel-order { display: flex; flex-wrap: wrap; gap: 5px; }
.priority-row { display: inline-flex; align-items: center; gap: 5px; padding: 4px 5px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-raised); }
.priority-index { display: grid; width: 17px; height: 17px; place-items: center; border-radius: 6px; color: var(--accent); background: var(--accent-soft); font-size: 8px; font-weight: 800; }
.priority-row strong { font-size: 8px; }
.priority-controls { display: flex; gap: 2px; }
.priority-controls button { display: grid; width: 19px; height: 19px; place-items: center; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); background: var(--page); font-size: 10px; cursor: pointer; }
.priority-controls button:disabled { opacity: .35; cursor: default; }
.priority-empty { color: var(--muted); font-size: 8px; }
.schedule-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.creator-form .schedule-option { display: flex; min-height: 44px; align-items: flex-start; gap: 5px; padding: 7px 5px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-raised); }
.schedule-option input { flex: 0 0 12px; width: 12px !important; height: 12px !important; margin-top: 2px !important; }
.schedule-option span { display: grid; gap: 3px; }
.schedule-option strong { color: var(--text); font-size: 7px; line-height: 1.25; }
.schedule-option small { color: var(--muted); font-size: 7px; }
.installment-options { display: grid; grid-template-columns: 1fr 1fr; align-items: end; gap: 8px; margin-top: 9px; }
.installment-estimate { display: grid; grid-column: span 2; grid-template-columns: 1fr auto; align-items: center; gap: 6px; padding: 7px 9px; border-radius: 8px; color: var(--muted); background: var(--accent-soft); font-size: 8px; }
.installment-estimate strong { color: var(--accent); font-size: 10px; }
.policy-grid { align-items: end; }
.quiet-hours-toggle { display: flex !important; flex-direction: row; align-items: center; gap: 8px !important; padding: 8px 9px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-raised); }
.quiet-hours-toggle span { display: grid; gap: 3px; }
.quiet-hours-toggle strong { color: var(--text); font-size: 9px; }
.quiet-hours-toggle small { color: var(--muted); font-size: 8px; font-weight: 400; }
.tone-select { max-width: 220px; }
.percentage-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.split-type-options { display: flex; gap: 12px; }
.creator-form .split-type-options label { display: flex; align-items: center; gap: 5px; color: var(--text); font-size: 9px; }
.friend-list-heading { margin-bottom: 7px; }
.friend-list-heading strong span { color: var(--accent); }
#friend-rows { display: grid; gap: 6px; }
.friend-row { display: grid; grid-template-columns: minmax(70px, 1fr) minmax(70px, .85fr) minmax(85px, 1.2fr) minmax(70px, .75fr) 24px; align-items: end; gap: 5px; padding: 7px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-raised); }
.friend-amount-field { min-width: 65px; }
.friend-contact-field { min-width: 75px; }
.friend-share-block { display: grid; gap: 3px; align-self: center; }
.friend-share-block span { color: var(--muted); font-size: 7px; }
.friend-share-block strong { color: var(--accent); font-size: 8px; white-space: nowrap; }
.remove-friend { width: 23px; height: 25px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); background: var(--page); cursor: pointer; }
.remove-friend:disabled { opacity: .35; cursor: default; }
.add-friend-button { width: fit-content; padding: 5px 0; border: 0; color: var(--accent); background: transparent; font-size: 9px; font-weight: 700; cursor: pointer; }
.add-friend-button:disabled { opacity: .45; cursor: default; }
.message-preview-card { position: sticky; top: 8px; padding: 13px; border: 1px solid color-mix(in srgb, var(--accent) 27%, var(--line)); border-radius: 15px; background: radial-gradient(ellipse at 100% 0%, var(--accent-soft), transparent 60%), var(--surface-raised); }
.preview-heading { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.preview-spark { flex-basis: 27px; width: 27px; height: 27px; border-radius: 9px; font-size: 11px; }
.preview-heading h3 { margin: 0 0 3px; color: var(--text); font: 700 10px Helvetica, Arial, sans-serif; }
.preview-heading p { margin: 0; color: var(--muted); font-size: 8px; }
.message-preview { display: grid; gap: 10px; }
.preview-message { padding: 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: var(--surface); font-size: 9px; line-height: 1.6; }
.preview-payment { display: flex; align-items: center; gap: 9px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; }
.preview-qr { display: grid; flex: 0 0 52px; width: 52px; height: 52px; place-content: center; justify-items: center; gap: 2px; overflow: hidden; border: 2px solid color-mix(in srgb, var(--accent) 45%, var(--line)); border-radius: 9px; color: var(--accent); background: var(--accent-soft); font-size: 21px; }
.preview-qr img { width: 100%; height: 100%; object-fit: cover; background: white; }
.preview-qr small { font-size: 6px; }
.preview-payment > div:last-child { display: grid; min-width: 0; gap: 3px; }
.preview-label { color: var(--accent); font-size: 7px; font-weight: 800; letter-spacing: .7px; }
.preview-payment strong, .preview-payment small { overflow: hidden; color: var(--text); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.preview-payment small { color: var(--muted); }
.preview-signoff { color: var(--muted); font-size: 8px; line-height: 1.5; }
.preview-signoff strong { color: var(--accent); font: 800 11px Helvetica, Arial, sans-serif; }
.preview-link { padding: 7px; overflow-wrap: anywhere; border-radius: 7px; color: var(--accent); background: var(--accent-soft); font-size: 7px; }
.preview-note { margin: 0; color: var(--muted); font-size: 7px; line-height: 1.5; }
.creator-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 15px; padding-top: 12px; border-top: 1px solid var(--line); }
.creator-footer .secondary-button, .creator-footer .primary-button { min-height: 38px; font-size: 10px; }

.borrower-portal:not([hidden]) { display: block; }
.portal-card { width: min(100%, 430px); margin: 28px auto 0; padding: 12px; border: 1px solid var(--line); border-radius: 25px; background: var(--surface); box-shadow: var(--shadow); }
.portal-header-card { position: relative; overflow: hidden; padding: 23px 19px 24px; border-radius: 19px; color: #fff; background: var(--gradient); }
.portal-header-card::after { position: absolute; top: -72px; right: -48px; width: 190px; height: 190px; border: 1px solid rgba(255, 255, 255, .16); border-radius: 50%; background: rgba(255, 255, 255, .08); box-shadow: 0 0 0 22px rgba(255, 255, 255, .035), 0 0 0 46px rgba(255, 255, 255, .025); content: ""; pointer-events: none; }
.portal-wordmark { position: relative; z-index: 1; display: flex; align-items: center; gap: 9px; margin-bottom: 27px; }
.portal-wordmark strong { font: 800 15px Helvetica, Arial, sans-serif; letter-spacing: -.45px; }
.portal-wordmark strong span { color: #F5B7FF; }
.portal-mark { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid rgba(255, 255, 255, .38); border-radius: 12px; background: rgba(255, 255, 255, .17); font: 800 18px Helvetica, Arial, sans-serif; }
.portal-kicker { position: relative; z-index: 1; display: block; margin-bottom: 8px; color: #F4D6FF; font-size: 9px; font-weight: 700; letter-spacing: 1.35px; }
.portal-header-card h1 { position: relative; z-index: 1; margin: 0 0 7px; color: #fff; font-size: 23px; }
.portal-header-card > p { position: relative; z-index: 1; max-width: 290px; margin: 0; color: rgba(255, 255, 255, .84); font-size: 11px; line-height: 1.6; }
.portal-balance { display: grid; gap: 6px; margin: 13px 0; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-soft); }
.portal-balance span { color: var(--muted); font-size: 10px; font-weight: 600; }
.portal-balance strong { color: var(--text); font: 800 25px Helvetica, Arial, sans-serif; letter-spacing: -.7px; }
.portal-balance small { color: var(--muted); font-size: 10px; }
.portal-payment { display: flex; align-items: center; gap: 13px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.portal-qr-frame { display: grid; flex: 0 0 100px; width: 100px; height: 100px; place-content: center; justify-items: center; gap: 4px; overflow: hidden; padding: 7px; border: 2px solid color-mix(in srgb, var(--accent) 45%, var(--line)); border-radius: 15px; background: var(--accent-soft); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 9%, transparent); }
.portal-qr-frame img { width: 100%; height: 100%; border-radius: 8px; object-fit: contain; background: #fff; }
.portal-qr-placeholder { color: var(--accent); font-size: 39px; line-height: 1; }
.portal-qr-caption { color: var(--muted); font-size: 7px; font-weight: 600; }
.portal-payment-copy { display: grid; min-width: 0; gap: 5px; }
.portal-payment-label { color: var(--accent); font-size: 8px; font-weight: 800; letter-spacing: .9px; }
.portal-payment-copy strong { overflow-wrap: anywhere; color: var(--text); font-size: 11px; line-height: 1.45; }
.portal-payment-copy small { color: var(--muted); font-size: 9px; line-height: 1.45; }
.portal-paid-button { display: flex; width: 100%; min-height: 49px; align-items: center; justify-content: center; gap: 8px; margin-top: 13px; border: 0; border-radius: 14px; color: #fff; background: var(--gradient); box-shadow: 0 8px 20px rgba(139, 92, 246, .25); font: 800 13px Helvetica, Arial, sans-serif; cursor: pointer; transition: filter .2s, transform .2s, box-shadow .2s; }
.portal-paid-button:hover { filter: brightness(1.09); transform: translateY(-2px); box-shadow: 0 11px 25px rgba(139, 92, 246, .33); }
.portal-paid-button:active { transform: translateY(0); }
.portal-paid-button span { color: #F5B7FF; }
.portal-help { margin: 9px 5px 0; color: var(--muted); font-size: 9px; line-height: 1.5; text-align: center; }
.portal-settled-note { padding: 18px 12px; border: 1px solid color-mix(in srgb, var(--paid) 22%, var(--line)); border-radius: 14px; color: var(--paid); background: color-mix(in srgb, var(--paid-bright) 10%, transparent); font-size: 11px; font-weight: 700; text-align: center; }
.portal-back-link { display: inline-flex; margin: 18px 5px 0; color: var(--accent); font-size: 11px; font-weight: 700; }
.portal-disclaimer { margin: 14px 5px 3px; color: var(--muted); font-size: 9px; line-height: 1.5; text-align: center; }
.settlement-card { padding: 10px; }
.settlement-card .portal-header-card { padding: 20px 17px 22px; }
.portal-itemized { display: grid; gap: 0; margin: 12px 0; padding: 4px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-soft); }
.portal-itemized > div:not(.portal-installments) { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.portal-itemized > div > span { color: var(--muted); font-size: 10px; }
.portal-itemized > div > strong { max-width: 62%; color: var(--text); font-size: 10px; text-align: right; overflow-wrap: anywhere; }
.portal-itemized .portal-remaining-row strong { color: var(--accent); font: 800 17px Helvetica, Arial, sans-serif; }
.portal-installments { padding: 11px 0 7px; }
.portal-payment-methods { display: grid; gap: 9px; margin-top: 17px; }
.portal-payment-methods h2 { margin: 0; font-size: 15px; }
.portal-payment-methods > p { margin: -4px 0 1px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.portal-method-card { display: flex; align-items: center; gap: 12px; padding: 11px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.portal-payment-copy { flex: 1; }
.portal-copy-button { justify-self: start; padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; color: var(--accent); background: var(--accent-soft); font-size: 9px; font-weight: 700; cursor: pointer; }
.portal-copy-button:hover { border-color: var(--accent); }
.portal-copy-button span { margin-left: 4px; }
.portal-no-method { padding: 13px; border: 1px dashed var(--line); border-radius: 13px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.portal-action-list { display: grid; gap: 8px; margin-top: 13px; }
.portal-action-list .portal-paid-button { margin: 0; }
.portal-secondary-action { display: flex; min-height: 43px; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); border-radius: 13px; color: var(--text); background: var(--surface); font-size: 10px; font-weight: 700; cursor: pointer; transition: border-color .2s, transform .2s; }
.portal-secondary-action:hover:not(:disabled) { border-color: var(--accent); transform: translateY(-1px); }
.portal-response-banner { margin-top: 12px; padding: 12px; border: 1px solid color-mix(in srgb, var(--warning) 34%, var(--line)); border-radius: 13px; background: color-mix(in srgb, var(--warning) 9%, var(--surface)); }
.portal-response-banner strong { color: var(--text); font-size: 10px; }
.portal-response-banner p { margin: 4px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.portal-audit { margin: 14px 5px 0; border-top: 1px solid var(--line); color: var(--muted); }
.portal-audit summary { padding: 12px 0 3px; color: var(--text); font-size: 10px; font-weight: 700; cursor: pointer; }
.portal-audit summary span { margin-left: 5px; color: var(--accent); }
.portal-audit ol { display: grid; gap: 10px; padding: 0 0 0 15px; }
.portal-audit li { padding-left: 2px; font-size: 9px; }
.portal-audit li::marker { color: var(--accent); }
.portal-audit time { display: block; margin-bottom: 3px; color: var(--muted); font-size: 8px; }
.portal-audit li strong { color: var(--text); }
.portal-audit li p { margin: 4px 0 0; overflow-wrap: anywhere; line-height: 1.5; }
.portal-disclaimer { opacity: .8; }
body[data-portal="true"] .app-frame { width: min(100%, 480px); padding: 1px 14px 28px; border: 0; border-radius: 0; box-shadow: none; }
body[data-portal="true"] .portal-card { margin-top: 12px; }
.borrower-sheet-content { padding: 7px 2px 2px; }
.borrower-sheet-content h2 { margin-bottom: 6px; font-size: 19px; }
.borrower-sheet-content > p:not(.eyebrow) { margin: 0 0 17px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.borrower-sheet-form, .ledger-form { display: grid; gap: 12px; }
.borrower-sheet-form label, .ledger-form label { display: grid; gap: 6px; color: var(--muted); font-size: 10px; font-weight: 600; }
.borrower-sheet-form input:not([type="file"]), .borrower-sheet-form textarea, .ledger-form input { width: 100%; min-height: 42px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: var(--page); font: 500 11px Helvetica, Arial, sans-serif; }
.borrower-sheet-form input[type="file"] { width: 100%; padding: 10px; border: 1px dashed var(--line); border-radius: 10px; color: var(--muted); background: var(--page); font-size: 10px; }
.borrower-sheet-form textarea { resize: vertical; }
.borrower-sheet-form small { color: var(--muted); font-size: 9px; font-weight: 400; }
.ledger-dialog { width: min(calc(100% - 24px), 440px); max-width: 440px; max-height: min(90vh, 760px); padding: 19px; overflow-y: auto; }
.ledger-dialog .dialog-close-form { position: sticky; z-index: 3; top: -19px; float: right; height: 0; margin-right: -6px; }
.ledger-sheet { padding: 8px 2px 2px; }
.ledger-sheet h2 { margin-bottom: 5px; font-size: 19px; }
.ledger-subtitle { margin: 0 0 15px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.ledger-balance { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); }
.ledger-balance span { color: var(--muted); font-size: 10px; }
.ledger-balance strong { color: var(--accent); font: 800 17px Helvetica, Arial, sans-serif; }
.ledger-form input { padding: 0 11px; }
.ledger-footnote { margin: 12px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.report-receipt { display: block; max-width: 100%; max-height: 260px; margin: 0 auto 12px; border: 1px solid var(--line); border-radius: 11px; object-fit: contain; }
.receipt-empty { margin-bottom: 12px; padding: 15px; border: 1px dashed var(--line); border-radius: 11px; color: var(--muted); font-size: 10px; text-align: center; }
.report-note { margin: 0 0 13px; padding: 10px 12px; border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; color: var(--text); background: var(--accent-soft); font-size: 10px; line-height: 1.5; }
.report-actions { flex-wrap: wrap; }
.borrower-sheet[open], .ledger-dialog[open] { animation: sheet-in .2s ease-out both; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: translateY(0) scale(1); } }
body[data-portal="true"] { background: color-mix(in srgb, var(--page) 80%, #39215E); }
body[data-portal="true"][data-theme="gentle"] { background: #EEE7FF; }
body[data-portal="true"] .app-frame { min-height: 100vh; padding-bottom: 30px; }
body[data-portal="true"] .topbar,
body[data-portal="true"] .bottom-nav { display: none; }
.auth-button { display: inline-flex; min-height: 35px; align-items: center; justify-content: center; gap: 5px; padding: 0 9px; border: 1px solid var(--line); border-radius: 11px; color: var(--accent); background: var(--surface); font-size: 10px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.auth-button > span:first-child { font-size: 14px; }
.auth-button:hover { border-color: var(--accent); }
.auth-dialog { width: min(calc(100% - 28px), 410px); max-width: 410px; padding: 20px; }
.auth-dialog .auth-sheet { padding: 7px 2px 2px; }
.auth-sheet h2 { margin-bottom: 7px; padding-right: 28px; font-size: 19px; }
.auth-sheet > p:not(.eyebrow) { margin: 0 0 16px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.auth-sheet code { padding: 2px 4px; border-radius: 4px; color: var(--accent); background: var(--accent-soft); font-size: 10px; }
.auth-sheet strong { color: var(--text); overflow-wrap: anywhere; }
.auth-form { display: grid; gap: 12px; }
.auth-form label { display: grid; gap: 6px; color: var(--muted); font-size: 10px; font-weight: 600; }
.auth-form input { width: 100%; height: 44px; padding: 0 11px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: var(--page); font-size: 12px; }
.auth-form > small { color: var(--muted); font-size: 9px; line-height: 1.5; text-align: center; }
.auth-success { padding: 12px; border: 1px solid color-mix(in srgb, var(--paid) 30%, var(--line)); border-radius: 11px; color: var(--paid); background: color-mix(in srgb, var(--paid) 9%, var(--surface)); font-size: 10px; font-weight: 700; text-align: center; }
body[data-auth-required="true"] #main-content,
body[data-auth-required="true"] .bottom-nav { display: none !important; }
body[data-auth-required="true"] #currency-select,
body[data-auth-required="true"] .theme-toggle { display: none; }
body[data-auth-required="true"] .app-frame { min-height: 100vh; padding-bottom: 30px; }

@media (min-width: 700px) {
  body { padding: 24px 0; background: color-mix(in srgb, var(--page) 78%, #39215E); }
  body[data-theme="gentle"] { background: #EBE2FF; }
  .app-frame { min-height: calc(100vh - 48px); padding-bottom: 90px; border: 1px solid var(--line); border-radius: 25px; box-shadow: var(--shadow); }
  .topbar { border-radius: 24px 24px 0 0; }
  .bottom-nav { right: auto; bottom: 24px; left: 50%; width: min(calc(100% - 40px), 440px); border: 1px solid var(--line); border-radius: 17px; transform: translateX(-50%); }
  .toast { bottom: 108px; }
}
@media (max-width: 640px) {
  .creator-dialog { width: calc(100vw - 16px); max-height: 96vh; padding: 14px; }
  .creator-layout { grid-template-columns: minmax(0, 1fr); }
  .message-preview-card { position: static; }
}
@media (max-width: 390px) {
  .auth-button { width: 35px; padding: 0; }
  .auth-button > span:last-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .header-actions { gap: 4px; }
  .currency-select { max-width: 76px; }
  .theme-toggle { padding: 0 6px; }
  .quick-add-card { padding: 12px; }
  .friend-row { grid-template-columns: minmax(0, 1fr) minmax(0, .9fr) 24px; }
  .friend-name-field { grid-column: 1; }
  .friend-row > label:nth-child(2) { grid-column: 2; }
  .friend-contact-field { grid-column: 1 / 3; }
  .friend-amount-field { grid-column: 1; }
  .friend-share-block { grid-column: 2; }
  .remove-friend { grid-column: 3; grid-row: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
