/* Cashflow 0.3 — polished mobile workspace. System fonts, no remote assets. */
:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px; line-height: 1.5; font-synthesis: none;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  --bg: #0c0e14; --surface: #151821; --surface-2: #1d212c; --surface-3: #252b39;
  --rail: #10131b; --text: #f1f2f8; --muted: #b0b5c8; --subtle: #8d95ab;
  --line: #2b3141; --accent: #9d96ff; --accent-ink: #191535; --accent-soft: #2a2544;
  --positive: #82d2b5; --positive-soft: #20352f; --negative: #eeaf9c; --negative-soft: #352a29;
  --business: #7d86b3; --personal: #c1a8dc; --shadow: 0 12px 36px #00000016;
  --radius: 20px;
  --safe-top: env(safe-area-inset-top, 0px); --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px); --safe-left: env(safe-area-inset-left, 0px);
  --visual-height: 100dvh; --visual-top: 0px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f5f6fa; --surface: #fff; --surface-2: #f4f5fa; --surface-3: #eaedf5;
  --rail: #fff; --text: #1d2438; --muted: #56617b; --subtle: #6e7890;
  --line: #e0e4ee; --accent: #6551d6; --accent-ink: #fff; --accent-soft: #eeeafb;
  --positive: #207e62; --positive-soft: #e5f3ed; --negative: #b65a41; --negative-soft: #faeee8;
  --business: #6d78a8; --personal: #a387c8; --shadow: 0 8px 28px #343c6b06;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { background: var(--bg); scroll-padding-top: calc(84px + var(--safe-top)); }
body { margin: 0; background: var(--bg); color: var(--text); }
body.modal-open { position: fixed; left: 0; right: 0; width: 100%; overflow: hidden; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { color: inherit; cursor: pointer; touch-action: manipulation; border: 0; }
button:disabled { opacity: .45; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
svg { display: block; }
.icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sprite { width: 0; height: 0; position: absolute; overflow: hidden; }
.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; }
[hidden] { display: none !important; }
.skip-link { position: fixed; left: 16px; top: -70px; padding: 12px 18px; background: var(--accent); color: var(--accent-ink); z-index: 200; border-radius: 12px; }
.skip-link:focus { top: calc(12px + var(--safe-top)); }
.accent { color: var(--accent); }
.button { display: inline-flex; gap: 9px; align-items: center; justify-content: center; min-height: 48px; padding: 12px 18px; font-size: 14px; font-weight: 650; border-radius: 13px; line-height: 1.35; text-align: center; border: 1px solid transparent; transition: background .16s, box-shadow .16s, transform .16s; }
.button.primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 4px 13px #53479e19; }
.button.primary:hover:not(:disabled) { filter: brightness(1.06); box-shadow: 0 6px 17px #53479e28; }
.button.primary:active:not(:disabled) { transform: scale(.98); }
.button.secondary { background: var(--surface-2); border-color: var(--line); color: var(--text); }
.button.secondary:hover:not(:disabled) { background: var(--surface-3); }
.button .icon { width: 18px; height: 18px; }
.full-width { width: 100%; }
.icon-button { display: grid; place-items: center; min-width: 44px; width: 44px; height: 44px; border-radius: 12px; background: transparent; color: var(--muted); flex: none; transition: background .15s, color .15s; }
.icon-button:hover { background: var(--surface-3); color: var(--text); }
.text-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; background: none; color: var(--accent); font-size: 14px; font-weight: 600; padding: 8px 4px; }
.text-button:hover { text-decoration: underline; text-underline-offset: 5px; }
.danger-text { color: var(--negative) !important; }
.subtle-text { font-size: 14px; color: var(--muted); }

/* Navigation and workspace */
.rail { position: fixed; inset: 0 auto 0 0; width: 236px; background: var(--rail); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 34px 20px 24px; z-index: 20; }
.brand { display: flex; align-items: center; gap: 11px; font-size: 23px; font-weight: 700; letter-spacing: -.75px; padding: 0 5px; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; background: linear-gradient(145deg,#9c94fb,#7564d5); color: #fff; border: 1px solid #bfb8ff33; border-radius: 13px; flex: none; box-shadow: inset 0 1px 0 #ffffff26; }
.brand-mark .icon { width: 23px; height: 23px; stroke-width: 1.8; }
.brand-sub { display: block; font-size: 9px; letter-spacing: .9px; font-weight: 550; color: var(--subtle); margin-top: 2px; white-space: nowrap; }
.rail-label { margin: 54px 14px 14px; color: var(--subtle); font-size: 11px; font-weight: 650; letter-spacing: 1.8px; }
.rail-nav { display: flex; flex-direction: column; gap: 7px; }
.rail-button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 49px; padding: 12px 14px; border-radius: 12px; text-align: left; background: transparent; color: var(--muted); font-size: 14px; font-weight: 500; transition: background .16s, color .16s; }
.rail-button .icon { width: 20px; height: 20px; }
.rail-button.active { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.rail-button:hover:not(.active) { background: var(--surface-2); color: var(--text); }
.rail-bottom { margin-top: auto; }
.workspace-note { margin: 30px 12px 36px; color: var(--subtle); font-size: 13px; line-height: 1.8; }
.workspace-note .icon { color: var(--accent); margin-bottom: 15px; }
.workspace-note strong { font-weight: 500; color: var(--muted); }
.demo-rail { display: flex; justify-content: space-between; border-top: 1px solid var(--line); margin-top: 20px; padding: 20px 13px 0; font-size: 11px; letter-spacing: .6px; color: var(--subtle); }
.workspace { margin-left: 236px; }
/* A solid header reserves the actual iOS status area instead of placing controls beneath it. */
.topbar { position: sticky; top: 0; z-index: 30; height: calc(84px + var(--safe-top)); border-bottom: 1px solid var(--line); padding: var(--safe-top) max(44px,var(--safe-right)) 0 max(44px,var(--safe-left)); display: flex; align-items: center; justify-content: space-between; background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; }
.desktop-breadcrumb { font-size: 14px; color: var(--subtle); }
.desktop-breadcrumb span { display: inline-block; margin: 0 15px; color: var(--subtle); opacity: .6; }
.desktop-breadcrumb strong { font-weight: 500; color: var(--text); }
.top-actions { display: flex; align-items: center; gap: 12px; }
.demo-badge { font-size: 12px; font-weight: 500; border: 1px solid var(--line); background: var(--surface); border-radius: 7px; padding: 5px 9px; white-space: nowrap; color: var(--muted); }
.avatar { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface-3); color: var(--muted); font-size: 12px; display: grid; place-items: center; }
.profile-button { display: grid; place-items: center; width: 44px; height: 44px; min-width: 44px; padding: 3px; flex: none; border-radius: 50%; background: var(--surface-3); border: 1px solid var(--line); color: var(--accent); overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.profile-button:hover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.profile-button img { width: 36px; height: 36px; object-fit: cover; border-radius: 50%; display: block; }
.profile-button span, .profile-button #user-avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; font-size: 13px; font-weight: 650; letter-spacing: -.2px; }
.mobile-brand, .mobile-settings, .bottom-nav { display: none; }
.main { max-width: 1420px; margin: auto; padding: 40px 44px 50px; }
.main:focus { outline: none; }
.view:not([hidden]) { animation: page-arrive .18s ease-out both; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.eyebrow { font-size: 11px; font-weight: 650; letter-spacing: 1.6px; color: var(--subtle); }
.page-heading h1 { font-size: 34px; font-weight: 650; letter-spacing: -1.25px; line-height: 1.2; margin: 10px 0; }
.page-description { font-size: 16px; color: var(--muted); line-height: 1.65; }
#user-greeting { color: var(--muted); font-size: 14px; font-weight: 500; letter-spacing: 0; }
.period-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 19px; }
.period-picker { display: flex; align-items: center; gap: 2px; }
.period-picker > .icon-button { min-width: 44px; width: 44px; height: 44px; border-radius: 11px; background: var(--surface); border: 1px solid var(--line); }
.period-picker > .icon-button .icon { width: 16px; height: 16px; }
.period-label { background: transparent; display: flex; align-items: center; gap: 9px; min-height: 44px; padding: 0 11px; font-size: 15px; font-weight: 600; white-space: nowrap; }
.period-label > .icon { width: 18px; height: 18px; color: var(--subtle); }
.period-label .chevron { width: 15px; }

/* Financial overview */
.metric-grid { display: grid; grid-template-columns: 1.38fr 1fr 1fr; gap: 18px; margin-bottom: 24px; }
.net-card, .metric-card { border-radius: var(--radius); position: relative; overflow: hidden; padding: 24px 26px; min-width: 0; }
.net-card { background: linear-gradient(125deg,#312b50 0%,#242139 70%,#222639 100%); color: #f8f6ff; border: 1px solid #514969; box-shadow: 0 10px 25px #05050f20, inset 0 1px 0 #ffffff06; min-height: 218px; }
[data-theme="light"] .net-card { background: linear-gradient(125deg,#34304f,#272536 72%,#342c4a); border-color: #443b60; box-shadow: 0 10px 22px #3c2a6e12; }
.net-card-top { display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 1; }
.net-card-top > p { font-size: 14px; font-weight: 500; color: #d9d4ef; }
.net-card-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: #c8bcff14; color: #c4baff; border: 1px solid #b6a8ee22; }
.net-card-icon .icon { width: 19px; height: 19px; }
.net-card h2 { font-size: clamp(25px,2.5vw,38px); font-weight: 620; letter-spacing: -1.4px; line-height: 1.2; margin-top: 22px; position: relative; z-index: 1; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.net-definition { font-size: 13px; color: #c0b9d7; margin-top: 8px; position: relative; z-index: 1; }
.net-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; position: relative; z-index: 1; font-size: 12px; font-weight: 500; }
.net-foot > span { padding: 4px 0; color: #cbc4e5; }
.text-info { display: grid; place-items: center; width: 44px; height: 44px; background: none; color: #bbb1dd; margin-right: -9px; }
.text-info .icon { width: 18px; height: 18px; }
.net-decoration { position: absolute; width: 260px; height: 260px; border: 1px solid #c2a8f31b; border-radius: 50%; right: -163px; bottom: -90px; box-shadow: 0 0 0 24px #c2a8f307, 0 0 0 49px #c2a8f305; pointer-events: none; }
.metric-card { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: flex-start; }
.metric-icon { height: 36px; width: 36px; border-radius: 11px; display: grid; place-items: center; margin-bottom: 19px; }
.income { background: var(--positive-soft); color: var(--positive); }
.expense { background: var(--negative-soft); color: var(--negative); }
.metric-card p { font-size: 14px; color: var(--muted); }
.metric-card h2 { font-size: clamp(21px,2.2vw,32px); letter-spacing: -1px; font-weight: 620; margin-top: 7px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metric-card small { font-size: 12px; color: var(--subtle); margin-top: 12px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 24px 26px 0; }
.panel-heading h2 { font-size: 18px; font-weight: 600; letter-spacing: -.4px; }
.panel-heading p { font-size: 13px; color: var(--muted); margin-top: 6px; }
.overview-columns { display: grid; grid-template-columns: 1.62fr 1fr; gap: 20px; margin-bottom: 24px; }
.chart-legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); }
.chart-legend span { display: flex; align-items: center; gap: 7px; }
.chart-legend i { display: block; width: 7px; height: 7px; border-radius: 3px; }
.legend-in { background: var(--accent); }
.legend-out { background: var(--business); }
.cash-chart { padding: 24px 26px 8px; height: 216px; }
.cash-chart svg { height: 100%; width: 100%; overflow: visible; }
.chart-gridline { stroke: var(--line); stroke-dasharray: 3 6; stroke-width: 1; }
.chart-axis { font-family: inherit; fill: var(--subtle); font-size: 12px; }
.bar-income { fill: var(--accent); }
.bar-expense { fill: var(--business); opacity: .85; }
.chart-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; padding: 15px 26px; border-top: 1px solid var(--line); }
.chart-currency { letter-spacing: 1px; font-size: 11px; color: var(--subtle); }
.spending-total { padding: 22px 26px 0; }
.spending-total > span:first-child { display: block; font-size: 27px; font-weight: 600; letter-spacing: -.8px; overflow-wrap: anywhere; }
.spending-total > span:last-child { display: block; font-size: 12px; color: var(--subtle); margin-top: 4px; }
.spending-strip { height: 8px; border-radius: 7px; display: flex; overflow: hidden; margin: 21px 26px; background: var(--surface-3); gap: 3px; }
.spending-strip i { border-radius: 6px; }
.spending-strip i:first-child { background: var(--business); }
.spending-strip i:last-child { background: var(--personal); }
.spending-breakdown { display: flex; flex-direction: column; gap: 14px; padding: 0 26px 21px; }
.spending-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; }
.spending-item > span { display: flex; align-items: center; gap: 9px; color: var(--muted); }
.spending-item i { width: 8px; height: 8px; display: block; border-radius: 3px; background: var(--business); }
.spending-item:last-child i { background: var(--personal); }
.spending-item strong { font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; }
.panel-note { border-top: 1px solid var(--line); padding: 13px 26px; font-size: 12px; color: var(--subtle); }
.catchup-card { border: 1px solid var(--line); border-radius: 16px; display: flex; align-items: center; gap: 17px; padding: 20px 22px; margin-bottom: 24px; background: var(--surface); }
.catchup-icon { height: 43px; width: 43px; border-radius: 13px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.catchup-icon .icon { width: 22px; height: 22px; }
.catchup-card h2 { font-size: 15px; font-weight: 600; letter-spacing: -.15px; }
.catchup-card p { font-size: 14px; color: var(--muted); margin-top: 4px; }
.catchup-card .button { margin-left: auto; font-size: 14px; min-height: 44px; }
.recent-panel .panel-heading { padding-bottom: 17px; }
.tx-row { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 81px; text-align: left; padding: 16px 26px; border-top: 1px solid var(--line); background: transparent; color: var(--text); transition: background .15s; }
.tx-row:hover { background: var(--surface-2); }
.tx-icon { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 12px; flex: none; }
.tx-icon .icon { width: 20px; height: 20px; }
.tx-main { flex: 1; min-width: 0; }
.tx-main strong { font-weight: 550; font-size: 14px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-main p { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 4px; }
.tx-main p .separator { padding: 0 6px; color: var(--subtle); }
.tx-money { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; max-width: 52%; }
.tx-money strong { font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tx-money small { font-size: 12px; color: var(--subtle); font-weight: 400; }
.income-text { color: var(--positive); }
.expense-text { color: var(--text); }
.demo-disclaimer { display: flex; align-items: center; justify-content: center; gap: 7px; color: var(--subtle); font-size: 12px; margin: 24px 0 0; text-align: center; }
.demo-disclaimer .icon { width: 15px; height: 15px; flex: none; }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 35px 24px; gap: 10px; color: var(--muted); }
.empty > .icon { height: 30px; width: 30px; color: var(--subtle); }
.empty h3 { font-size: 16px; color: var(--text); font-weight: 550; }
.empty p { font-size: 14px; max-width: 330px; }
.empty .button { margin-top: 9px; }
.error-notice { border: 1px solid var(--negative); color: var(--negative); padding: 16px; border-radius: 12px; font-size: 14px; margin-bottom: 20px; }

/* History and preferences */
.history-tools { display: flex; gap: 12px; margin: 25px 0 17px; }
.search-input { display: flex; gap: 10px; align-items: center; flex: 1; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; }
.search-input .icon { width: 19px; height: 19px; color: var(--muted); }
.search-input input { min-width: 0; width: 100%; background: transparent; border: none; min-height: 48px; color: var(--text); font-size: 16px; padding: 10px 0; }
.search-input input:focus { outline: none; }
.search-input:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
input::placeholder, textarea::placeholder { color: var(--subtle); opacity: 1; }
.filter-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 4px 1px; }
.filter-chip { display: inline-flex; justify-content: center; align-items: center; min-height: 44px; border: 1px solid var(--line); padding: 8px 17px; border-radius: 11px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 500; white-space: nowrap; }
.filter-chip.active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-soft); }
.history-summary { display: flex; justify-content: space-between; gap: 14px; margin: 22px 0 15px; color: var(--muted); font-size: 13px; }
.history-summary strong { font-weight: 600; color: var(--text); }
.history-date { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 26px 3px 12px; }
.history-date h2 { font-size: 14px; font-weight: 600; }
.history-date span { font-size: 12px; color: var(--muted); }
.history-group .transaction-list { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); overflow: hidden; }
.history-group .tx-row:first-child { border-top: 0; }
.load-more { display: flex; margin: 25px auto 0; min-width: 220px; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.settings-panel { padding: 26px; }
.settings-panel h2 { font-size: 18px; font-weight: 600; }
.settings-panel > p { color: var(--muted); font-size: 14px; margin: 8px 0 22px; line-height: 1.7; }
.theme-options { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.theme-options button { display: flex; flex-direction: column; gap: 10px; align-items: center; border: 1px solid var(--line); background: var(--surface-2); border-radius: 13px; padding: 15px 10px; min-height: 100px; font-size: 14px; color: var(--muted); }
.theme-options button[aria-pressed=true] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); color: var(--accent); }
.theme-swatch { height: 42px; width: 58px; border-radius: 8px; border: 2px solid #c4c8db; background: #f5f6fa; position: relative; }
.theme-swatch::before { content: ""; position: absolute; top: 8px; bottom: 8px; left: 9px; width: 7px; border-radius: 2px; background: #9a8be8; }
.theme-swatch::after { content: ""; position: absolute; left: 23px; right: 8px; top: 8px; height: 6px; background: #c4c8db; border-radius: 2px; box-shadow: 0 10px 0 #c4c8db; }
.dark-swatch { background: #151821; border-color: #51576d; }
.dark-swatch::after { background: #51576d; box-shadow: 0 10px 0 #51576d; }
.system-swatch { background: linear-gradient(90deg,#f5f6fa 50%,#151821 50%); }
.settings-panel .settings-caption { font-size: 12px; color: var(--subtle); margin: 18px 0 0; }
.setting-switch-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); padding-top: 18px; font-size: 14px; }
.switch { appearance: none; -webkit-appearance: none; width: 48px; height: 29px; flex: none; min-width: 48px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface-3); position: relative; cursor: pointer; margin: 0; outline-offset: 4px; }
.switch::before { content: ""; position: absolute; width: 23px; height: 23px; background: #dfe3f2; border-radius: 50%; left: 2px; top: 2px; box-shadow: 0 1px 3px #0002; transition: transform .18s; }
.switch:checked { background: var(--accent); border-color: var(--accent); }
.switch:checked::before { transform: translateX(19px); background: var(--accent-ink); }
.category-tabs { display: flex; gap: 10px; }
.category-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.category-tag { padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; color: var(--muted); }
.inline-form { display: flex; gap: 8px; }
.inline-form input { width: 100%; min-width: 0; }
.settings-actions { display: flex; flex-direction: column; gap: 10px; }
.settings-actions > .text-button { align-self: flex-start; padding: 8px 0; }
.scope-note { display: flex; align-items: flex-start; gap: 15px; margin: 24px 0; padding: 24px; border: 1px solid var(--line); border-radius: 16px; }
.scope-note > .icon { color: var(--accent); width: 23px; height: 23px; }
.scope-note h2 { font-size: 15px; font-weight: 600; }
.scope-note p { font-size: 14px; line-height: 1.7; color: var(--muted); margin-top: 6px; }

/* Keyboard-aware entry and dialogs */
dialog.sheet { position: fixed; inset: auto var(--safe-right) auto var(--safe-left); top: calc(var(--visual-top) + (var(--visual-height) + var(--safe-top) - var(--safe-bottom)) / 2); transform: translateY(-50%); color: var(--text); border: 1px solid var(--line); background: var(--surface); border-radius: 24px; margin: 0 auto; padding: 0; width: min(560px,calc(100% - var(--safe-left) - var(--safe-right) - 30px)); max-height: min(1000px,calc(var(--visual-height) - var(--safe-top) - var(--safe-bottom) - 32px)); box-shadow: 0 30px 90px #0005; overflow: hidden; overscroll-behavior: contain; }
dialog::backdrop { background: #070811ad; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.sheet-inner { display: flex; flex-direction: column; height: 100%; max-height: inherit; min-height: 0; position: relative; }
dialog[open] > .sheet-inner { animation: sheet-arrive .22s cubic-bezier(.2,.7,.2,1) both; }
.sheet-handle { display: none; }
.sheet-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 24px 26px 20px; flex: none; background: var(--surface); border-bottom: 1px solid var(--line); }
.sheet-header h2 { font-size: 24px; font-weight: 600; letter-spacing: -.7px; margin-top: 4px; }
.sheet-header .eyebrow { font-size: 10px; }
.sheet-header > .icon-button { background: var(--surface-2); width: 44px; min-width: 44px; height: 44px; }
#entry-form { display: flex; flex-direction: column; min-height: 0; overflow: hidden; flex: 1; }
.entry-scroll { min-height: 0; padding: 23px 26px 17px; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain; scroll-padding-top: 15px; scroll-padding-bottom: 25px; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; background: var(--bg); border: 1px solid var(--line); padding: 5px; border-radius: 14px; gap: 5px; }
.segmented button { display: flex; justify-content: center; align-items: center; gap: 7px; min-height: 44px; border-radius: 10px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 600; transition: background .17s,color .17s; }
.segmented button .icon { height: 18px; width: 18px; }
.segmented button.active { background: var(--surface-3); color: var(--text); box-shadow: 0 2px 6px #0001; }
.segmented button[data-entry-type=masuk].active { color: var(--positive); }
.segmented button[data-entry-type=keluar].active { color: var(--negative); }
.amount-label { font-size: 14px; color: var(--muted); display: block; margin: 25px 0 8px; }
.amount-input { display: flex; gap: 10px; align-items: baseline; border-bottom: 1px solid var(--line); padding: 0 0 12px; }
.amount-input > span { font-size: 24px; color: var(--subtle); font-weight: 500; }
.amount-input input { font-size: 40px; font-weight: 600; letter-spacing: -1.1px; color: var(--text); background: transparent; border: 0; min-width: 0; width: 100%; height: 57px; padding: 0; border-radius: 0; }
.amount-input input:focus { outline: none; }
.amount-input:focus-within { border-color: var(--accent); }
.amount-presets { display: flex; gap: 9px; margin-top: 13px; margin-bottom: 23px; }
.amount-presets button { background: var(--surface-2); border: 1px solid var(--line); min-height: 44px; padding: 9px 14px; font-size: 14px; border-radius: 10px; color: var(--muted); }
.amount-presets button:hover { border-color: var(--accent); color: var(--accent); }
.date-field > label, .field { display: flex; flex-direction: column; gap: 8px; font-size: 14px; font-weight: 500; }
.date-line { display: flex; gap: 9px; margin-top: 8px; align-items: stretch; min-width: 0; }
.date-line input { flex: 1; min-width: 0; }
.date-today { border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); font-size: 14px; padding: 9px 13px; }
.field-help { margin: 6px 0 20px; font-size: 12px; color: var(--subtle); line-height: 1.6; }
.entry-two-cols { display: grid; grid-template-columns: 1fr 1.15fr; gap: 12px; margin-bottom: 18px; }
.field .optional { font-weight: 400; color: var(--subtle); font-size: 12px; display: inline; margin-top: -28px; margin-bottom: 3px; align-self: flex-end; }
.field select, input[type=date], input[type=month], .inline-form input, .field textarea { appearance: none; -webkit-appearance: none; border: 1px solid var(--line); background: var(--bg); color: var(--text); border-radius: 11px; padding: 12px; min-height: 48px; font-size: 16px; width: 100%; font-weight: 400; line-height: 1.4; max-width: 100%; }
.field select { padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238d95ab' stroke-width='1.7'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.field textarea { resize: vertical; min-height: 77px; max-height: 180px; }
.field textarea::placeholder { font-size: 15px; }
input::-webkit-date-and-time-value { text-align: left; }
input::-webkit-datetime-edit { display: inline-flex; min-width: 0; padding: 0; }
input[type=date] { min-width: 0; text-align: left; }
.choice-field { margin: 0 0 21px; padding: 0; border: 0; min-width: 0; }
.choice-field legend { padding: 0; margin: 0 0 9px; color: var(--text); font-size: 14px; font-weight: 500; }
.usage-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.usage-choices button, .category-choice { position: relative; min-height: 48px; padding: 11px 37px 11px 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--muted); font-size: 14px; font-weight: 500; line-height: 1.4; text-align: left; display: flex; align-items: center; gap: 8px; transition: border-color .15s, background .15s, color .15s; }
.usage-choices button > .icon, .category-choice > .icon { width: 18px; height: 18px; }
.usage-choices button[aria-pressed=true], .category-choice[aria-pressed=true], .usage-choices button.active, .category-choice.active { color: var(--accent); background: var(--accent-soft); border-color: var(--accent); box-shadow: inset 0 0 0 1px #9385df0d; }
.usage-choices button[aria-pressed=true]::after, .category-choice[aria-pressed=true]::after, .usage-choices button.active::after, .category-choice.active::after { content: ""; position: absolute; width: 6px; height: 10px; border-right: 1.8px solid currentColor; border-bottom: 1.8px solid currentColor; transform: rotate(45deg); right: 17px; top: calc(50% - 7px); }
.usage-choices button:hover, .category-choice:hover { border-color: var(--accent); }
.category-choices { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.category-choice { min-height: 49px; overflow-wrap: anywhere; }
.category-choice-field { margin-bottom: 22px; }
.repeat-option { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-top: 20px; margin-top: 2px; }
.repeat-option > label { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; min-height: 44px; }
.repeat-option .icon { width: 20px; height: 20px; color: var(--accent); }
.repeat-option strong { font-size: 14px; font-weight: 500; }
.repeat-option small { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }
.entry-meta { font-size: 12px; color: var(--subtle); margin-top: 13px; }
.entry-session { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 12px 14px; margin-top: 18px; border: 1px solid var(--line); border-radius: 11px; background: var(--accent-soft); color: var(--accent); font-size: 13px; }
.entry-session > .icon { width: 16px; height: 16px; }
.entry-session button { color: inherit; background: transparent; text-decoration: underline; min-height: 44px; flex-basis: 100%; text-align: left; font-size: 13px; padding: 3px 0; display: block; }
.entry-footer { display: flex; align-items: stretch; gap: 10px; border-top: 1px solid var(--line); background: var(--surface); padding: 16px 26px max(20px,var(--safe-bottom)); flex: none; }
.entry-footer .primary { flex: 1; min-height: 51px; font-size: 16px; }
.entry-footer .secondary { padding-inline: 15px; }
.edit-actions { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-top: 12px; }
.edit-actions .icon { height: 18px; width: 18px; }
.form-error { color: var(--negative); font-size: 14px; line-height: 1.6; margin-top: 14px; }
.period-content { padding: 24px 26px 27px; overflow-y: auto; }
.period-presets { display: flex; gap: 8px; margin-bottom: 23px; flex-wrap: wrap; }
.period-presets .button { font-size: 14px; padding: 10px 13px; }
.period-content form > .button { margin-top: 18px; }
.period-content .field + .field { margin-top: 14px; }
.custom-period { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 4px; }
.custom-period summary { font-size: 14px; cursor: pointer; min-height: 48px; display: flex; align-items: center; color: var(--muted); }
.custom-period summary::after { content: "+"; margin-left: auto; font-size: 22px; }
.custom-period[open] summary::after { content: "−"; }
.confirm-sheet { max-width: 440px; }
.confirm-sheet .sheet-header { border: none; padding-bottom: 0; }
.confirm-sheet .sheet-header h2 { font-size: 20px; }
.confirm-sheet #confirm-text { font-size: 16px; color: var(--muted); line-height: 1.7; padding: 16px 26px 24px; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 0 26px 26px; }
.confirm-actions .button { min-width: 100px; }
.toast { position: fixed; z-index: 200; bottom: 28px; left: calc(50% + 118px); transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 17px; border-radius: 15px; background: var(--text); color: var(--bg); box-shadow: 0 10px 30px #0004; font-size: 14px; max-width: min(570px,calc(100vw - 32px)); }
.toast > .icon { width: 18px; height: 18px; flex: none; }
.toast > span { min-width: 0; }
.toast > button { font-size: 13px; font-weight: 650; background: transparent; color: inherit; min-height: 44px; flex: none; }
.toast-close { width: 34px; display: grid; place-items: center; }
.toast-close > .icon { width: 18px; height: 18px; }
.no-script { padding: 25px; color: var(--negative); position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); z-index: 1000; }

/* Save confirmation remains inside the modal top layer. */
.save-confirm { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; padding: 28px; background: #080a1485; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); border-radius: inherit; }
.save-confirm-card { display: flex; flex-direction: column; align-items: center; text-align: center; width: min(100%,300px); padding: 29px 22px 26px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 18px 65px #0005; animation: confirmation-arrive .2s ease-out both; }
.save-check { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent); margin-bottom: 18px; }
.save-check .icon { width: 30px; height: 30px; stroke-width: 2; }
.save-confirm-card h3 { font-size: 21px; font-weight: 600; letter-spacing: -.6px; }
.save-confirm-card p { font-size: 14px; color: var(--muted); margin-top: 8px; line-height: 1.6; }

/* Brief entrance animation, never a fake biometric prompt. */
.launch-screen { position: fixed; inset: 0; z-index: 400; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 17px; background: var(--bg); transition: opacity .2s ease; }
.launch-screen.is-leaving { opacity: 0; pointer-events: none; }
.launch-mark { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: linear-gradient(145deg,#9c94fb,#7564d5); color: #fff; box-shadow: 0 10px 35px #8375da30, inset 0 1px 0 #ffffff40; animation: launch-mark-arrive .38s cubic-bezier(.2,.75,.2,1) both; }
.launch-mark .icon { width: 33px; height: 33px; }
.launch-screen h1, .launch-screen h2 { font-size: 27px; font-weight: 600; letter-spacing: -.8px; animation: page-arrive .25s .08s both; }
.launch-screen p { font-size: 12px; color: var(--subtle); letter-spacing: 1.6px; }
@keyframes page-arrive { from { opacity: 0; translate: 0 6px; } to { opacity: 1; translate: 0 0; } }
@keyframes sheet-arrive { from { opacity: 0; translate: 0 10px; } to { opacity: 1; translate: 0 0; } }
@keyframes confirmation-arrive { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }
@keyframes launch-mark-arrive { from { opacity: 0; transform: translateY(8px) scale(.92); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* Desktop and compact tablet */
@media (min-width:1600px) { .main { padding-top: 50px; } }
@media (max-width:1190px) {
  .rail { width: 210px; padding-inline: 14px; }.workspace { margin-left: 210px; }
  .brand { font-size: 21px; gap: 9px; }.brand-sub { font-size: 8px; letter-spacing: .5px; }
  .topbar { padding: var(--safe-top) max(28px,var(--safe-right)) 0 max(28px,var(--safe-left)); }.main { padding: 31px 28px 48px; }.metric-grid { gap: 14px; }
  .net-card,.metric-card { padding: 21px; }.net-card h2 { font-size: 30px; }.metric-card h2 { font-size: 25px; }
  .overview-columns { grid-template-columns: 1.35fr 1fr; gap: 16px; }.panel-heading { padding: 22px 21px 0; }
  .chart-legend { gap: 9px; }.cash-chart { padding-inline: 20px; }.spending-total { padding-inline: 21px; }
  .spending-total > span:first-child { font-size: 24px; }.tx-row { padding-inline: 22px; }
  .page-heading h1 { font-size: 31px; }.toast { left: calc(50% + 105px); }
}

/* iPhone and tablet navigation. Sheets fit the visual viewport, including landscape. */
@media (max-width:900px) {
  .rail,.desktop-breadcrumb,.desktop-only { display: none !important; }.workspace { margin-left: 0; }
  .topbar { height: calc(76px + var(--safe-top)); padding: var(--safe-top) max(22px,var(--safe-right)) 0 max(22px,var(--safe-left)); background: var(--bg); }
  .mobile-brand { display: flex; align-items: center; gap: 10px; font-size: 22px; letter-spacing: -.7px; font-weight: 650; }
  .brand-mark { width: 35px; height: 35px; border-radius: 11px; }.brand-mark .icon { width: 22px; height: 22px; }
  .mobile-settings { display: grid; }.top-actions { gap: 4px; }.top-actions .theme-toggle { margin-left: 2px; }
  .demo-badge { font-size: 11px; padding: 4px 7px; }.profile-button { margin-left: 3px; }
  .main { padding: 28px max(22px,var(--safe-right)) calc(122px + var(--safe-bottom)) max(22px,var(--safe-left)); max-width: 780px; }
  .page-heading h1 { font-size: 31px; }.page-description { font-size: 16px; }
  .metric-grid { gap: 12px; grid-template-columns: 1.4fr 1fr 1fr; }.metric-card { padding: 21px 18px; }
  .metric-card h2 { font-size: 22px; }.net-card h2 { font-size: 30px; }.overview-columns { grid-template-columns: 1.4fr 1fr; }
  .bottom-nav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; justify-content: space-around; align-items: center; min-height: 80px; padding: 8px max(20px,var(--safe-right)) max(10px,var(--safe-bottom)) max(20px,var(--safe-left)); background: var(--rail); border-top: 1px solid var(--line); z-index: 25; box-shadow: 0 -6px 30px #00000009; }
  .bottom-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-width: 85px; min-height: 56px; font-size: 12px; font-weight: 500; background: none; color: var(--subtle); }
  .bottom-item .icon { width: 22px; height: 22px; }.bottom-item.active { color: var(--accent); }
  .bottom-add { background: none; color: var(--accent); display: flex; align-items: center; flex-direction: column; gap: 4px; min-width: 90px; font-size: 12px; font-weight: 600; }
  .bottom-add > span { width: 58px; height: 42px; display: grid; place-items: center; border-radius: 14px; background: var(--accent); color: var(--accent-ink); box-shadow: 0 4px 12px #56478d20; }.bottom-add .icon { width: 23px; height: 23px; }
  .toast { left: 50%; bottom: calc(94px + var(--safe-bottom)); }.settings-grid { gap: 15px; }
  .panel-heading .chart-legend { flex-wrap: wrap; font-size: 12px; }
  /* Bottom sheets may fill the visual viewport, but their top stays below the notch.
     Home-indicator clearance belongs inside each footer/scroll area. */
  dialog.sheet { inset: auto var(--safe-right) auto var(--safe-left); margin: 0 auto; width: calc(100% - var(--safe-left) - var(--safe-right)); max-width: 560px; border-radius: 25px 25px 0 0; max-height: calc(var(--visual-height) - var(--safe-top) - 8px); }
  dialog.sheet[open] { top: calc(var(--visual-top,0px) + var(--visual-height,100dvh)); transform: translateY(-100%); }
  .entry-sheet { height: min(1000px,calc(var(--visual-height) - var(--safe-top) - 8px)); }
  .sheet-handle { display: block; width: 34px; height: 4px; border-radius: 3px; background: var(--line); margin: 10px auto 0; flex: none; }
}
@media (max-width:600px) {
  .topbar { height: calc(71px + var(--safe-top)); padding: var(--safe-top) max(18px,var(--safe-right)) 0 max(18px,var(--safe-left)); }
  .mobile-brand { font-size: 21px; gap: 9px; }.mobile-brand .brand-mark { width: 32px; height: 32px; border-radius: 10px; }.mobile-brand .icon { width: 21px; height: 21px; }
  .top-actions { gap: 1px; }.top-actions .icon-button { width: 44px; min-width: 44px; }.top-actions .demo-badge { display: none; }
  .profile-button { width: 44px; height: 44px; min-width: 44px; }.profile-button img { width: 36px; height: 36px; }
  .main { padding: 27px max(18px,var(--safe-right)) calc(116px + var(--safe-bottom)) max(18px,var(--safe-left)); }
  .page-heading { margin-bottom: 24px; }.eyebrow { font-size: 11px; letter-spacing: 1.2px; }
  .page-heading h1 { font-size: 30px; letter-spacing: -1.15px; margin: 9px 0; }.page-description { font-size: 15px; line-height: 1.65; }
  .period-bar { margin-bottom: 17px; gap: 6px; }.period-label { gap: 5px; padding: 0 3px; font-size: 14px; }.period-label > .icon { width: 16px; height: 16px; }.period-label .chevron { display: none; }
  .period-picker { gap: 2px; }.period-picker > .icon-button { min-width: 44px; width: 44px; height: 44px; }.subtle-text { font-size: 12px; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
  .net-card { grid-column: 1/-1; min-height: 192px; padding: 21px 23px 10px; border-radius: 21px; }
  .net-card h2 { font-size: 37px; margin-top: 18px; }.net-card-top > p { font-size: 14px; }.net-definition { font-size: 12px; margin-top: 7px; }.net-foot { margin-top: 6px; }
  .metric-card { border-radius: 17px; min-height: 156px; padding: 17px; }.metric-icon { width: 30px; height: 30px; border-radius: 9px; margin-bottom: 12px; }.metric-icon .icon { width: 18px; height: 18px; }
  .metric-card p { font-size: 14px; }.metric-card h2 { font-size: 21px; letter-spacing: -.65px; margin-top: 6px; }.metric-card small { font-size: 12px; margin-top: 7px; }
  .overview-columns { grid-template-columns: 1fr; gap: 18px; margin-bottom: 18px; }.trend-panel .panel-heading { padding: 21px 20px 0; }.panel-heading h2 { font-size: 17px; }.panel-heading p { font-size: 13px; }
  .chart-legend { flex-direction: column; gap: 5px; font-size: 12px; }.cash-chart { height: 199px; padding: 25px 20px 8px; }.chart-footer { padding: 13px 20px; font-size: 12px; }.spending-panel { display: none; }
  .catchup-card { padding: 18px; gap: 13px; flex-wrap: wrap; border-radius: 17px; margin-bottom: 20px; }.catchup-icon { width: 38px; height: 38px; border-radius: 11px; }.catchup-card > div { flex: 1; min-width: 190px; }.catchup-card h2 { font-size: 15px; }.catchup-card p { font-size: 13px; margin-top: 5px; }.catchup-card .button { margin: 0 0 0 51px; min-height: 44px; font-size: 14px; padding: 9px 14px; }
  .recent-panel .panel-heading { padding: 20px 17px 16px; }.panel-heading .text-button { font-size: 14px; white-space: nowrap; }
  .tx-row { gap: 10px; padding: 16px 17px; min-height: 81px; }.tx-icon { width: 34px; height: 34px; border-radius: 10px; }.tx-icon .icon { width: 18px; height: 18px; }.tx-main strong { font-size: 14px; }.tx-main p { font-size: 12px; }.tx-money strong { font-size: 14px; letter-spacing: -.25px; }.tx-money small { font-size: 12px; }
  .demo-disclaimer { font-size: 12px; margin-top: 20px; align-items: flex-start; }.demo-disclaimer .icon { width: 14px; height: 14px; margin-top: 2px; }
  .history-tools { flex-wrap: wrap; gap: 9px; margin-top: 20px; }.search-input { flex-basis: 100%; }.history-tools > .button { font-size: 14px; min-height: 44px; }.history-tools #history-period { flex: 1; justify-content: flex-start; }.history-tools #history-period .icon { width: 16px; height: 16px; }.history-tools .export-button { padding: 9px 16px; }
  .filter-chips { gap: 7px; }.filter-chip { font-size: 14px; padding: 8px 16px; }.history-summary { font-size: 13px; flex-wrap: wrap; margin-top: 20px; }.history-date h2 { font-size: 14px; }.history-date span { font-size: 12px; }.history-date { margin-top: 23px; }.history-group .tx-row { padding: 15px 14px; gap: 10px; }
  .settings-grid { grid-template-columns: 1fr; gap: 18px; }.settings-panel { padding: 22px; }.settings-panel > p { font-size: 14px; }.scope-note { padding: 20px; gap: 12px; }.scope-note h2 { font-size: 15px; }.scope-note p { font-size: 14px; }
  .toast { font-size: 14px; max-width: calc(100vw - 28px); width: max-content; padding: 8px 9px 8px 13px; gap: 8px; }.toast > span { max-width: 230px; }.toast-close { width: 27px; }.toast > button { font-size: 13px; }
  dialog.sheet { max-width: none; border-bottom: 0; }.sheet-header { padding: 16px 21px; }.sheet-header h2 { font-size: 23px; }.sheet-header .eyebrow { font-size: 10px; letter-spacing: 1.1px; }
  .entry-scroll { padding: 18px 21px 19px; scroll-padding-bottom: 20px; }.segmented button { font-size: 14px; min-height: 44px; }.amount-label { margin-top: 24px; font-size: 14px; }.amount-input input { font-size: 39px; height: 55px; }.amount-presets { margin-bottom: 22px; }.amount-presets button { min-height: 44px; font-size: 14px; }
  .entry-two-cols { gap: 10px; margin-bottom: 18px; }.field { font-size: 14px; }.entry-footer { padding: 13px 21px max(16px,var(--safe-bottom)); gap: 8px; }.entry-footer .primary { min-height: 51px; font-size: 16px; }.entry-footer .secondary { min-height: 51px; font-size: 14px; padding-inline: 12px; }
  .repeat-option { gap: 12px; }.repeat-option strong { font-size: 14px; }.repeat-option small { font-size: 12px; }.entry-scroll .field textarea { min-height: 74px; }
  .confirm-sheet .sheet-inner { padding-top: 5px; }.confirm-sheet .sheet-header { padding: 20px 23px 0; }.confirm-sheet #confirm-text { padding: 16px 23px 24px; }.confirm-actions { padding: 0 23px max(24px,var(--safe-bottom)); }.period-content { padding: 20px 22px max(26px,var(--safe-bottom)); }
  .save-confirm-card { padding: 28px 21px 25px; width: min(100%,290px); }.save-confirm-card h3 { font-size: 20px; }.save-confirm-card p { font-size: 14px; }
}
@media (max-width:370px) {
  .main { padding-right: max(14px,var(--safe-right)); padding-left: max(14px,var(--safe-left)); }.topbar { padding-right: max(14px,var(--safe-right)); padding-left: max(14px,var(--safe-left)); }.mobile-brand { font-size: 20px; }.mobile-brand .brand-mark { width: 29px; height: 29px; border-radius: 9px; }
  .top-actions { gap: 0; }.top-actions .theme-toggle { margin: 0; }
  .page-heading h1 { font-size: 28px; }.period-label { font-size: 14px; padding-inline: 7px; }.period-label > .icon:first-child { display: none; }#period-count { display: none; }
  .metric-card { padding: 15px; }.metric-card h2 { font-size: 19px; }.catchup-card > div { min-width: 160px; }.tx-icon { display: none; }.tx-money strong { font-size: 14px; }.net-card h2 { font-size: 33px; }
  .entry-two-cols { grid-template-columns: 1fr 1.1fr; }.entry-scroll { padding-inline: 18px; }.field select { padding-left: 10px; }.category-choice { padding-left: 11px; padding-right: 29px; }.category-choice[aria-pressed=true]::after { right: 13px; }.usage-choices button { padding-left: 11px; }.amount-presets { gap: 7px; }.amount-presets button { padding-inline: 12px; }.repeat-option > label { gap: 8px; }.repeat-option small { font-size: 12px; }.entry-footer { padding-inline: 18px; }
}
@media (max-height:550px) and (max-width:900px) {
  .entry-sheet { height: calc(var(--visual-height) - var(--safe-top) - 8px); }.sheet-header { padding-block: 10px; }.sheet-header .eyebrow { display: none; }.entry-footer { padding-top: 10px; padding-bottom: max(10px,var(--safe-bottom)); }.entry-scroll { padding-top: 12px; }.sheet-header h2 { font-size: 21px; }.sheet-handle { margin-top: 7px; }
}
@media (prefers-reduced-motion:reduce) {
  *,*::before,*::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
@media (prefers-contrast:more) {
  :root { --muted: var(--text); --subtle: var(--text); --line: #6b7190; }
  :root[data-theme=light] { --line: #707a94; }
}
