:root {
  font-family: Inter, "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #18364a;
  background: #f2f3f6;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --navy: #17364a;
  --orange: #e45f0b;
  --orange-soft: #fff0e6;
  --muted: #858b91;
  --line: #ecebe8;
  --surface: #fffefa;
  --shadow: 0 12px 35px rgba(31, 52, 66, .055);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; padding-bottom: calc(105px + env(safe-area-inset-bottom)); }
button, input, select { font: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.app-shell { width: min(100%, 1060px); margin: 0 auto; padding: 20px 28px 35px; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin: 6px 1px 27px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--navy); font-size: 14px; font-weight: 700; letter-spacing: .02em; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; color: white; border-radius: 12px; background: var(--navy); font-size: 18px; }
.account-chip { padding: 9px 12px; color: #61727b; border: 1px solid rgba(255,255,255,.88); border-radius: 999px; background: rgba(255,255,255,.58); box-shadow: 0 5px 16px rgba(28,49,65,.045), inset 0 1px 0 white; font-size: 10px; }
.top-actions { display: flex; gap: 11px; }
.round-button { display: grid; place-items: center; width: 47px; height: 47px; padding: 0; color: var(--navy); border: 0; border-radius: 50%; background: var(--surface); box-shadow: 0 4px 13px rgba(28, 47, 60, .04); font-size: 29px; line-height: 1; }
.round-button.add-round { color: white; background: var(--orange); font-size: 31px; font-weight: 300; }
.small-round { width: 40px; height: 40px; color: var(--muted); font-size: 19px; }
.page-heading { display: flex; align-items: end; justify-content: space-between; margin: 6px 1px 21px; }
.page-heading h1 { margin: 3px 0 0; color: var(--navy); font-size: clamp(27px, 5vw, 36px); font-weight: 750; letter-spacing: -.045em; }
.overline { color: #989da1; font-size: 10px; font-weight: 700; letter-spacing: .14em; }
.date-chip { margin-bottom: 5px; padding: 7px 11px; color: var(--muted); border-radius: 999px; background: rgba(255,255,255,.65); font-size: 11px; }
.overview-panel { padding: 22px 24px 18px; border: 1px solid rgba(53, 51, 46, .025); border-radius: 27px; background: var(--surface); box-shadow: var(--shadow); }
.overview-head { display: flex; align-items: center; gap: 12px; }
.overview-head h2 { margin: 0; color: var(--navy); font-size: 17px; font-weight: 750; }
.overview-head > span { color: #8b9094; font-size: 13px; }
.overview-values { display: grid; grid-template-columns: 1fr 1fr; margin: 23px 0 20px; }
.overview-values > div { display: grid; gap: 5px; min-width: 0; }
.overview-values > div + div { padding-left: 22px; border-left: 1px solid #dededb; }
.overview-values span { color: #8b9094; font-size: 12px; }
.overview-values strong { overflow: hidden; color: var(--navy); font-size: clamp(22px, 5vw, 31px); font-weight: 750; letter-spacing: -.045em; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.overview-values small { overflow: hidden; color: #8b9094; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.dual-overview .overview-values { margin: 0; }
.dual-overview .overview-values > div { gap: 7px; }
.entity-section-head { margin-top: 34px; padding-top: 22px; border-top: 1px solid rgba(24,54,74,.1); }
.secondary-add { color: var(--navy); background: white; border: 1px solid #dfe4e4; }
.entity-empty { padding-top: 30px; padding-bottom: 30px; }
.entity-empty .secondary-button { min-height: 43px; padding: 10px 16px; border-color: #e4e7e6; }
.overview-status { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 16px; border-top: 1px solid #e7e5e1; color: #858a8e; font-size: 12px; }
.overview-status > span { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.overview-status b { color: var(--navy); font-size: 13px; }
.dot { display: inline-block; width: 8px; height: 8px; flex: none; border-radius: 50%; background: #a5a9ac; }
.dot.green { background: #31a567; }
.dot.gray { background: #aeb0b2; }
.dot.blue, .dot.navy { background: #1d4159; }
.dot.orange { background: var(--orange); }
.filter-tabs { display: flex; align-items: center; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.filter-tabs::-webkit-scrollbar { display: none; }
.category-tabs { margin: 24px 0 17px; gap: 22px; }
.category-tabs button { position: relative; flex: none; padding: 3px 0 11px; color: #858b90; border: 0; background: transparent; font-size: 14px; }
.category-tabs button.active { color: var(--navy); font-weight: 750; }
.category-tabs button.active::after { position: absolute; right: 30%; bottom: 2px; left: 30%; height: 3px; border-radius: 9px; background: var(--orange); content: ""; }
.financial-section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 22px 1px 13px; }
.financial-section-head > div { display: grid; gap: 3px; }
.financial-section-head h2 { margin: 0; color: var(--navy); font-size: 17px; font-weight: 740; }
.financial-section-head span { color: var(--muted); font-size: 10px; }
.add-record-button { flex: none; padding: 9px 12px; color: white; border: 0; border-radius: 12px; background: var(--orange); font-size: 11px; font-weight: 650; }
.filter-row { display: flex; align-items: center; gap: 9px; margin-bottom: 16px; }
.status-filter { flex: none; padding: 9px 14px; color: #8b8f93; border: 0; border-radius: 999px; background: rgba(255,255,255,.82); font-size: 11px; }
.status-filter.active { color: white; background: var(--navy); }
.filter-icon { display: grid; place-items: center; width: 37px; height: 37px; margin-left: auto; color: var(--navy); border: 0; border-radius: 50%; background: var(--surface); font-size: 20px; }
.asset-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.asset-card { display: flex; min-height: 252px; flex-direction: column; padding: 16px 16px 14px; border: 1px solid rgba(53, 51, 46, .025); border-radius: 26px; background: var(--surface); box-shadow: var(--shadow); }
.asset-card-top { display: flex; align-items: start; justify-content: space-between; min-height: 69px; }
.asset-icon { display: grid; place-items: center; width: 53px; height: 53px; color: var(--navy); border-radius: 17px; background: #f5f5f2; font-size: 28px; font-weight: 700; }
.status-tag { display: inline-flex; align-items: center; gap: 5px; padding: 6px 9px; color: #7b8488; border-radius: 999px; background: #f4f5f4; font-size: 10px; white-space: nowrap; }
.status-tag i { width: 7px; height: 7px; border-radius: 50%; background: #39aa70; }
.status-tag.retired i { background: #9fa4a6; }
.status-tag.sold i { background: #637e99; }
.asset-title-row { display: flex; align-items: start; justify-content: space-between; gap: 5px; min-height: 60px; }
.asset-title-row h3 { overflow: hidden; margin: 0; color: var(--navy); font-size: 16px; font-weight: 730; letter-spacing: -.025em; text-overflow: ellipsis; white-space: nowrap; }
.asset-title-row p { overflow: hidden; margin: 5px 0 0; color: #8c9093; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.financial-value { overflow: hidden; margin: 8px 0 12px; color: var(--navy); font-size: clamp(19px, 4.5vw, 25px); font-weight: 760; letter-spacing: -.04em; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.financial-card .asset-foot { margin-top: auto; }
.more-button { flex: none; padding: 0 3px; color: #92979a; border: 0; background: transparent; font-size: 20px; line-height: 1; }
.asset-cost { margin: 8px 0 8px; color: var(--navy); font-size: 21px; font-weight: 750; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.asset-cost span { margin-left: 3px; color: #8c9093; font-size: 11px; font-weight: 500; letter-spacing: 0; }
.progress-track { height: 7px; overflow: hidden; margin: auto 0 8px; border-radius: 99px; background: #dededc; }
.progress-track i { display: block; height: 100%; min-width: 4px; border-radius: inherit; background: var(--orange); }
.asset-foot { display: flex; align-items: center; justify-content: space-between; gap: 5px; color: #898e91; font-size: 9px; }
.asset-foot strong { overflow: hidden; color: #777e83; font-size: 10px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.privacy-note { margin: 23px 0 4px; color: #989da0; text-align: center; font-size: 10px; }
.privacy-note button, .link-button { padding: 0; color: #6c7f8b; border: 0; background: none; font-size: inherit; text-decoration: underline; text-underline-offset: 2px; }
.privacy-note .sync-indicator:disabled { color: inherit; cursor: default; text-decoration: none; }
.privacy-note .sync-indicator:not(:disabled) { color: #a9574b; font-weight: 700; }
.bottom-nav { position: fixed; right: 0; bottom: max(13px, env(safe-area-inset-bottom)); left: 0; z-index: 4; display: flex; width: min(470px, calc(100vw - 30px)); margin: auto; padding: 6px; border: 1px solid rgba(255,255,255,.9); border-radius: 999px; background: rgba(255,255,255,.85); box-shadow: 0 14px 38px rgba(26, 48, 63, .14); backdrop-filter: blur(18px); }
.bottom-nav button { display: flex; min-height: 57px; flex: 1; align-items: center; justify-content: center; gap: 8px; color: var(--navy); border: 0; border-radius: 999px; background: transparent; font-size: 13px; font-weight: 650; }
.bottom-nav button span { font-size: 20px; }
.bottom-nav button.active { color: var(--orange); background: #f0efed; }
.search-box { display: flex; gap: 8px; margin: -12px 0 20px; }
.search-box input { min-width: 0; flex: 1; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; outline: none; background: white; }
.search-box button { padding: 0 12px; color: var(--navy); border: 0; border-radius: 13px; background: white; }
.empty-state { display: grid; grid-column: 1 / -1; justify-items: center; gap: 9px; padding: 46px 24px; border-radius: 25px; background: var(--surface); box-shadow: var(--shadow); text-align: center; }
.empty-state > span { color: var(--orange); font-size: 30px; }
.empty-state strong { color: var(--navy); font-size: 16px; }
.empty-state p { max-width: 260px; margin: 0 0 7px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.primary-button { min-height: 47px; padding: 12px 18px; color: white; border: 0; border-radius: 15px; background: var(--orange); font-weight: 650; }
.bookkeeping-overview .overview-values strong { font-size: clamp(22px, 5vw, 30px); }
.positive { color: #28975d !important; }
.negative { color: var(--navy) !important; }
.period-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 21px 0; }
.period-tabs { flex: none; padding: 4px; border-radius: 13px; background: #e7e8e9; }
.period-tabs button { min-width: 37px; padding: 8px 12px; color: #737b80; border: 0; border-radius: 10px; background: transparent; font-size: 12px; }
.period-tabs button.active { color: var(--navy); background: white; box-shadow: 0 2px 7px rgba(29,52,40,.07); font-weight: 700; }
.period-nav { position: relative; display: flex; align-items: center; gap: 7px; min-width: 0; color: var(--navy); }
.period-nav button { width: 30px; height: 30px; color: var(--navy); border: 0; border-radius: 50%; background: white; font-size: 19px; }
.period-nav strong { min-width: 92px; text-align: center; font-size: 11px; }
.period-nav input { position: absolute; left: 36px; width: calc(100% - 72px); height: 32px; margin: 0; opacity: 0; cursor: pointer; }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin: 24px 2px 12px; }
.section-heading h2 { margin: 0; color: var(--navy); font-size: 16px; font-weight: 730; }
.section-heading > span { color: var(--muted); font-size: 11px; }
.analysis-grid { display: grid; gap: 0; }
.chart-switch { display: flex; gap: 3px; padding: 3px; border-radius: 12px; background: #e8e9e9; }
.chart-switch button { padding: 6px 11px; color: #778087; border: 0; border-radius: 9px; background: transparent; font-size: 11px; }
.chart-switch button.active { color: var(--navy); background: white; font-weight: 700; }
.analysis-card { padding: 18px; border-radius: 23px; background: var(--surface); box-shadow: var(--shadow); }
.pie-content { display: grid; grid-template-columns: 150px minmax(0, 1fr); align-items: center; gap: 19px; min-height: 145px; }
.pie-chart { width: 136px; aspect-ratio: 1; justify-self: center; border: 1px solid rgba(20,45,32,.06); border-radius: 50%; background: #edf0ef; }
.pie-empty { background: conic-gradient(#e8eae8 0 100%); }
.pie-legend { display: grid; gap: 9px; min-width: 0; }
.legend-row { display: grid; grid-template-columns: 9px minmax(0, 1fr) auto; align-items: center; gap: 7px; color: #737d82; font-size: 11px; }
.legend-row i { width: 8px; height: 8px; border-radius: 50%; background: var(--legend-color); }
.legend-row strong { color: var(--navy); font-size: 11px; font-variant-numeric: tabular-nums; }
.empty-inline { grid-column: 1 / -1; padding: 24px 8px; color: var(--muted); text-align: center; font-size: 12px; }
.legend-label { display: flex; align-items: center; gap: 5px; }
.legend-label .dot:not(:first-child) { margin-left: 8px; }
.trend-chart { display: flex; align-items: stretch; justify-content: space-around; gap: 4px; min-height: 153px; padding: 17px 12px 7px; }
.trend-column { display: grid; grid-template-rows: 1fr auto; flex: 1; min-width: 0; text-align: center; }
.trend-bars { display: flex; align-items: end; justify-content: center; gap: 3px; height: 107px; }
.trend-bars i { display: block; width: min(30%, 17px); min-height: 0; border-radius: 5px 5px 1px 1px; }
.expense-bar { background: var(--navy); }
.income-bar { background: #e4a447; }
.trend-column small { overflow: hidden; padding: 8px 0; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.transaction-filters { margin: 14px 0 10px; }
.transaction-filters button { padding: 7px 13px; color: #7f8589; border: 1px solid transparent; border-radius: 999px; background: white; font-size: 11px; }
.transaction-filters button.active { color: var(--navy); border-color: #d9e0e4; background: #eaf0f2; font-weight: 700; }
.transaction-list { overflow: hidden; padding: 2px 16px; border-radius: 23px; background: var(--surface); box-shadow: var(--shadow); }
.transaction-row { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 13px 0; border-bottom: 1px solid var(--line); }
.transaction-row:last-child { border-bottom: 0; }
.transaction-icon { display: grid; width: 39px; height: 39px; flex: none; place-items: center; border-radius: 14px; background: #f3f3f0; font-size: 18px; }
.transaction-copy { display: grid; min-width: 0; flex: 1; gap: 4px; }
.transaction-copy strong { overflow: hidden; color: var(--navy); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.transaction-copy small { color: #969a9c; font-size: 9px; }
.transaction-row > b { flex: none; font-size: 12px; font-variant-numeric: tabular-nums; }
.edit-transaction-button { flex: none; padding: 7px 9px; color: #3a6175; border: 1px solid rgba(31,65,84,.1); border-radius: 10px; background: rgba(236,243,246,.7); font-size: 11px; font-weight: 650; cursor: pointer; transition: background-color .2s ease, transform .2s ease; }
.edit-transaction-button:hover { background: #e4eef2; }
.edit-transaction-button:active { transform: scale(.96); }
.delete-button { flex: none; padding: 4px; color: #a4a7a7; border: 0; background: transparent; font-size: 17px; }
.modal-backdrop { position: fixed; inset: 0; z-index: 8; display: grid; align-items: end; padding: 14px; background: rgba(21, 38, 49, .38); }
.modal { width: min(100%, 550px); max-height: min(90vh, 850px); overflow-y: auto; margin: auto auto 0; padding: 21px; border-radius: 25px; background: var(--surface); box-shadow: 0 20px 70px rgba(17,33,43,.22); }
.modal-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; }
.modal-top h2 { margin: 0; color: var(--navy); font-size: 19px; }
.close-modal { width: 34px; height: 34px; color: #788188; border: 0; border-radius: 50%; background: #f0f1ef; font-size: 23px; }
.field { display: grid; gap: 7px; margin: 14px 0; }
.field label { color: #596b75; font-size: 12px; font-weight: 650; }
.field input, .field select { width: 100%; min-height: 46px; padding: 11px 13px; color: var(--navy); border: 1px solid #e5e7e6; border-radius: 13px; outline: none; background: #fff; }
.field input:focus, .field select:focus { border-color: #e89866; box-shadow: 0 0 0 3px rgba(228,95,11,.09); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin: 3px 0 17px; padding: 4px; border-radius: 13px; background: #eeefed; }
.segmented button { padding: 10px; color: #7a8387; border: 0; border-radius: 10px; background: transparent; font-size: 12px; }
.segmented button.active { color: var(--orange); background: white; box-shadow: 0 2px 7px rgba(29,52,40,.08); font-weight: 700; }
.modal-actions { display: flex; gap: 9px; margin-top: 18px; }
.modal-actions > * { flex: 1; }
.secondary-button, .delete-modal-button { min-height: 47px; padding: 11px; color: #65737a; border: 1px solid #e5e7e6; border-radius: 14px; background: white; font-weight: 600; }
.delete-modal-button { flex: none; color: #ad5a4a; }
.backup-copy, .backup-warning { color: #7d878d; font-size: 12px; line-height: 1.7; }
.backup-actions { display: grid; gap: 10px; margin: 18px 0 12px; }
.backup-actions .secondary-button { width: 100%; }
.backup-warning { margin: 8px 0 0; color: #a36b54; font-size: 10px; }
.recovery-copies { display: grid; gap: 9px; margin: 18px 0; padding: 15px; border: 1px solid rgba(34, 55, 67, .12); border-radius: 16px; background: rgba(255,255,255,.55); }
.recovery-copies > strong { color: var(--navy); font-size: 13px; }
.recovery-copies .backup-copy { margin: 0 0 3px; }
.toast { position: fixed; bottom: calc(91px + env(safe-area-inset-bottom)); left: 50%; z-index: 12; max-width: calc(100vw - 32px); padding: 11px 15px; color: white; border-radius: 12px; background: #253c4b; box-shadow: var(--shadow); font-size: 12px; opacity: 0; pointer-events: none; transform: translate(-50%, 8px); transition: opacity .18s, transform .18s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.auth-shell { display: grid; min-height: min(85vh, 760px); align-content: center; justify-items: center; gap: 22px; padding: 30px 0; }
.auth-brand { display: flex; align-items: center; gap: 10px; color: var(--navy); font-size: 15px; font-weight: 750; }
.auth-card { width: min(100%, 460px); padding: clamp(24px, 6vw, 38px); border: 1px solid rgba(255,255,255,.9); border-radius: 28px; background: linear-gradient(145deg, rgba(255,255,255,.88), rgba(255,255,255,.62)); box-shadow: 0 22px 65px rgba(31,52,66,.1), inset 0 1px 0 white; backdrop-filter: blur(24px); }
.auth-card h1 { margin: 8px 0; color: var(--navy); font-size: 29px; letter-spacing: -.045em; }
.auth-copy { margin: 0 0 24px; color: #77858b; font-size: 12px; line-height: 1.7; }
.auth-field { display: grid; gap: 8px; margin: 16px 0; color: #596b75; font-size: 12px; font-weight: 650; }
.auth-field input { width: 100%; min-height: 47px; padding: 12px 14px; color: var(--navy); border: 1px solid #e3e8e8; border-radius: 14px; outline: none; background: rgba(255,255,255,.86); font-weight: 450; }
.auth-field input:focus { border-color: #e89866; box-shadow: 0 0 0 3px rgba(228,95,11,.09); }
.auth-consent { display: flex; align-items: flex-start; gap: 10px; margin: 16px 0; color: #596b75; font-size: 12px; line-height: 1.6; }
.auth-consent input { width: 17px; height: 17px; flex: none; margin: 1px 0 0; accent-color: var(--orange); }
.auth-submit { width: 100%; margin-top: 8px; }
.auth-toggle { display: block; margin: 17px auto 0; padding: 6px; color: #526d7c; border: 0; background: transparent; font-size: 12px; }
.auth-footnote { margin: 19px 0 0; color: #9aa1a4; font-size: 10px; line-height: 1.6; text-align: center; }
.auth-error { margin: 10px 0; padding: 10px 12px; color: #9e4938; border: 1px solid #f1d7ce; border-radius: 12px; background: #fff3ef; font-size: 12px; }
.family-members { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -12px 1px 19px; }
.family-person-filter { display: grid; gap: 8px; margin: 0 1px 20px; }
.family-person-filter > span { color: #73838b; font-size: 11px; font-weight: 650; }
.family-person-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 2px 1px 6px; scrollbar-width: none; }
.family-person-tabs::-webkit-scrollbar { display: none; }
.family-person-tabs button { flex: none; min-height: 35px; padding: 7px 13px; color: #536d7b; border: 1px solid rgba(255,255,255,.9); border-radius: 999px; background: rgba(255,255,255,.62); box-shadow: inset 0 1px 0 #fff; font-size: 11px; cursor: pointer; transition: background-color .2s ease, color .2s ease, transform .2s ease; }
.family-person-tabs button:active { transform: scale(.96); }
.family-person-tabs button.active { color: #fff; border-color: rgba(255,255,255,.3); background: linear-gradient(145deg, #28546d, #17374b); box-shadow: 0 6px 16px rgba(22,53,73,.17), inset 0 1px 0 rgba(255,255,255,.2); }
.family-person-tabs button:focus-visible, .edit-transaction-button:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.family-member, .family-readonly { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; color: #536d7b; border: 1px solid rgba(255,255,255,.9); border-radius: 999px; background: rgba(255,255,255,.58); font-size: 11px; box-shadow: inset 0 1px 0 white; }
.family-member i { width: 7px; height: 7px; border-radius: 50%; background: #3ca875; }
.family-readonly { margin-left: auto; color: #8b8f93; background: rgba(230,234,234,.46); }
.family-manage-button { padding: 8px 12px; color: #536d7b; border: 1px solid rgba(255,255,255,.9); border-radius: 999px; background: rgba(255,255,255,.65); font-size: 11px; }
.family-manage-group { display: grid; gap: 8px; margin: 18px 0; }
.family-manage-group > strong { color: var(--navy); font-size: 13px; }
.family-manage-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 46px; padding: 9px 12px; border: 1px solid rgba(34,55,67,.09); border-radius: 14px; background: rgba(255,255,255,.6); color: var(--navy); font-size: 12px; }
.family-manage-row small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.family-manage-row button { flex: none; padding: 6px 8px; color: #a9574b; border: 0; background: transparent; font-size: 11px; }
.family-empty { margin-top: 35px; }

@media (min-width: 760px) {
  .app-shell { padding-top: 30px; }
  .asset-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .analysis-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 18px; margin-top: 24px; }
  .analysis-grid .section-heading { min-height: 34px; margin: 0 2px 12px; }
  .analysis-grid .analysis-card { min-height: 198px; }
  .overview-panel { padding: 26px 30px 20px; }
  .asset-card { min-height: 282px; padding: 19px; }
  .asset-card-top { min-height: 83px; }
  .asset-title-row h3 { font-size: 18px; }
  .asset-cost { font-size: 25px; }
}
@media (max-width: 480px) {
  body { padding-bottom: calc(99px + env(safe-area-inset-bottom)); }
  .app-shell { padding: 16px 15px 28px; }
  .topbar { margin-bottom: 24px; }
  .page-heading { margin-bottom: 18px; }
  .overview-panel { padding: 19px 18px 16px; border-radius: 24px; }
  .overview-values { margin: 20px 0 17px; }
  .overview-values > div + div { padding-left: 14px; }
  .overview-status { gap: 4px; font-size: 10px; }
  .overview-status > span { gap: 4px; }
  .overview-status b { font-size: 11px; }
  .category-tabs { gap: 19px; margin-top: 22px; }
  .category-tabs button { font-size: 13px; }
  .filter-row { gap: 7px; }
  .status-filter { padding: 9px 12px; }
  .asset-grid { gap: 10px; }
  .asset-card { min-height: 237px; padding: 14px 12px 12px; border-radius: 24px; }
  .asset-card-top { min-height: 62px; }
  .asset-icon { width: 47px; height: 47px; border-radius: 15px; font-size: 25px; }
  .status-tag { padding: 5px 7px; font-size: 9px; }
  .asset-title-row { min-height: 57px; }
  .asset-title-row h3 { font-size: 14px; }
  .asset-title-row p { font-size: 9px; }
  .asset-cost { margin-top: 6px; font-size: 19px; }
  .financial-value { margin: 5px 0 10px; font-size: 19px; }
  .asset-foot { font-size: 8px; }
  .asset-foot strong { font-size: 9px; }
  .period-toolbar { align-items: start; flex-direction: column; }
  .period-nav { align-self: stretch; justify-content: center; }
  .period-nav strong { min-width: 118px; }
  .pie-content { grid-template-columns: 118px minmax(0, 1fr); gap: 12px; }
  .pie-chart { width: 112px; }
  .analysis-card { padding: 14px; }
  .legend-row { font-size: 10px; }
  .legend-row strong { font-size: 10px; }
  .trend-chart { padding-right: 5px; padding-left: 5px; }
  .trend-bars { gap: 2px; }
}
@media (max-width: 360px) {
  .asset-card { min-height: 225px; padding-right: 10px; padding-left: 10px; }
  .status-tag { gap: 3px; padding-right: 5px; padding-left: 5px; }
  .status-filter { padding-right: 9px; padding-left: 9px; }
  .overview-values strong { font-size: 21px; }
  .overview-status { font-size: 9px; }
  .bottom-nav button { gap: 4px; font-size: 11px; }
}

/* Soft liquid-glass finish */
:root {
  --navy: #17364a;
  --orange: #d96824;
  --muted: #7e8991;
  --line: rgba(28, 51, 66, .09);
  --surface: rgba(255, 255, 255, .76);
  --shadow: 0 18px 46px rgba(31, 55, 72, .075), inset 0 1px 0 rgba(255, 255, 255, .82);
}
body {
  color: var(--navy);
  background:
    radial-gradient(ellipse at 2% 1%, rgba(215, 231, 242, .8), transparent 34rem),
    radial-gradient(ellipse at 98% 22%, rgba(255, 226, 204, .5), transparent 30rem),
    linear-gradient(145deg, #f4f6f8 0%, #f3f3f5 54%, #f7f4f1 100%);
  background-attachment: fixed;
}
button, input, select { -webkit-tap-highlight-color: transparent; }
button { transition: transform .22s cubic-bezier(.2,.8,.2,1), background-color .22s ease, border-color .22s ease, box-shadow .22s ease, color .22s ease; }
button:hover { filter: saturate(1.04); }
button:active { transform: scale(.965); }
.brand-mark {
  border: 1px solid rgba(255,255,255,.58);
  background: linear-gradient(145deg, #244a61, #102b3d);
  box-shadow: 0 8px 18px rgba(23,54,74,.2), inset 0 1px 0 rgba(255,255,255,.22);
}
.page-heading { animation: soft-rise .48s both; }
.page-heading h1 { letter-spacing: -.055em; }
.date-chip {
  border: 1px solid rgba(255,255,255,.75);
  background: rgba(255,255,255,.48);
  box-shadow: 0 5px 16px rgba(36,55,68,.04), inset 0 1px 0 white;
  backdrop-filter: blur(16px);
}
.overview-panel, .analysis-card, .transaction-list, .empty-state {
  border: 1px solid rgba(255,255,255,.86);
  background: linear-gradient(145deg, rgba(255,255,255,.82), rgba(255,255,255,.58));
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(1.16);
  -webkit-backdrop-filter: blur(22px) saturate(1.16);
}
.overview-panel { position: relative; overflow: hidden; }
.overview-panel::before {
  position: absolute;
  top: -72px;
  right: -35px;
  width: 190px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255,255,255,.8), transparent 70%);
  content: "";
  pointer-events: none;
}
.overview-values { position: relative; }
.overview-values > div + div { border-color: rgba(34,55,67,.12); }
.overview-values strong { letter-spacing: -.055em; }
.financial-section-head { margin-top: 26px; }
.entity-section-head { border-color: rgba(29,54,72,.09); }
.add-record-button, .primary-button {
  border: 1px solid rgba(255,255,255,.36);
  background: linear-gradient(145deg, #e77b37, #ce5816);
  box-shadow: 0 8px 18px rgba(203,88,22,.17), inset 0 1px 0 rgba(255,255,255,.28);
}
.secondary-add, .secondary-button {
  color: #345364;
  border: 1px solid rgba(255,255,255,.94);
  background: rgba(255,255,255,.58);
  box-shadow: 0 6px 17px rgba(27,52,69,.055), inset 0 1px 0 white;
  backdrop-filter: blur(14px);
}
.filter-row { gap: 7px; }
.status-filter, .period-tabs, .chart-switch, .transaction-filters button {
  border: 1px solid rgba(255,255,255,.9);
  background: rgba(255,255,255,.45);
  box-shadow: 0 5px 16px rgba(28,49,65,.045), inset 0 1px 0 rgba(255,255,255,.9);
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
}
.status-filter {
  padding: 9px 15px;
  color: #77858d;
  font-weight: 560;
}
.status-filter.active, .period-tabs button.active, .chart-switch button.active, .transaction-filters button.active {
  color: #fff;
  border-color: rgba(255,255,255,.24);
  background: linear-gradient(145deg, rgba(34,73,96,.96), rgba(20,48,66,.98));
  box-shadow: 0 6px 16px rgba(22,53,73,.19), inset 0 1px 0 rgba(255,255,255,.22);
}
.asset-card {
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.9);
  background: linear-gradient(150deg, rgba(255,255,255,.88), rgba(255,255,255,.57));
  box-shadow: 0 15px 34px rgba(31,54,69,.065), inset 0 1px 0 rgba(255,255,255,.96);
  backdrop-filter: blur(20px) saturate(1.12);
  -webkit-backdrop-filter: blur(20px) saturate(1.12);
  animation: soft-rise .52s both;
  transition: transform .28s cubic-bezier(.2,.8,.2,1), box-shadow .28s ease, border-color .28s ease;
}
.asset-card:nth-child(2) { animation-delay: .045s; }
.asset-card:nth-child(3) { animation-delay: .09s; }
.asset-card:nth-child(4) { animation-delay: .135s; }
.asset-card:hover { transform: translateY(-3px); box-shadow: 0 22px 42px rgba(31,54,69,.105), inset 0 1px 0 white; }
.asset-icon, .transaction-icon {
  border: 1px solid rgba(255,255,255,.88);
  background: linear-gradient(145deg, rgba(239,245,247,.94), rgba(225,234,238,.76));
  box-shadow: 0 5px 12px rgba(28,52,68,.055), inset 0 1px 0 white;
}
.status-tag { border: 1px solid rgba(255,255,255,.8); background: rgba(241,245,244,.72); }
.asset-foot { color: #818b91; }
.bottom-nav {
  border: 1px solid rgba(255,255,255,.9);
  background: rgba(248,250,251,.67);
  box-shadow: 0 18px 44px rgba(26,48,63,.16), inset 0 1px 0 rgba(255,255,255,.95);
  backdrop-filter: blur(28px) saturate(1.4);
  -webkit-backdrop-filter: blur(28px) saturate(1.4);
}
.bottom-nav button.active {
  color: var(--orange);
  background: linear-gradient(145deg, rgba(255,255,255,.92), rgba(240,241,241,.66));
  box-shadow: 0 5px 16px rgba(32,50,63,.08), inset 0 1px 0 white;
}
.period-tabs { padding: 4px; border-radius: 999px; }
.period-tabs button, .chart-switch button { transition: color .2s ease, background .2s ease, transform .2s ease, box-shadow .2s ease; }
.period-nav button, .round-button, .close-modal {
  border: 1px solid rgba(255,255,255,.88);
  background: rgba(255,255,255,.64);
  box-shadow: 0 6px 16px rgba(27,50,65,.07), inset 0 1px 0 white;
  backdrop-filter: blur(16px);
}
.round-button.add-round { background: linear-gradient(145deg, #e77b37, #ce5816); }
.analysis-card { border-radius: 26px; }
.pie-chart { box-shadow: 0 8px 20px rgba(28,48,63,.09), inset 0 2px 5px rgba(255,255,255,.8); animation: chart-pop .7s cubic-bezier(.2,.8,.2,1) both; }
.trend-bars i { transform-origin: bottom; animation: bar-grow .65s cubic-bezier(.2,.8,.2,1) both; }
.trend-column:nth-child(2n) .trend-bars i { animation-delay: .06s; }
.legend-row { animation: soft-rise .35s both; }
.legend-row:nth-child(2) { animation-delay: .04s; }
.legend-row:nth-child(3) { animation-delay: .08s; }
.transaction-row { transition: background-color .2s ease, transform .2s ease; }
.transaction-row:hover { background: rgba(239,244,246,.48); }
.modal-backdrop {
  align-items: end;
  background: rgba(18,37,50,.3);
  backdrop-filter: blur(12px) saturate(.86);
  -webkit-backdrop-filter: blur(12px) saturate(.86);
  animation: backdrop-in .2s ease both;
}
.modal {
  border: 1px solid rgba(255,255,255,.92);
  background: linear-gradient(150deg, rgba(255,255,255,.94), rgba(250,251,251,.84));
  box-shadow: 0 26px 80px rgba(15,33,45,.24), inset 0 1px 0 white;
  backdrop-filter: blur(28px) saturate(1.2);
  -webkit-backdrop-filter: blur(28px) saturate(1.2);
  animation: sheet-in .36s cubic-bezier(.2,.82,.2,1) both;
}
.field input, .field select, .search-box input {
  border: 1px solid rgba(39,65,82,.1);
  border-radius: 15px;
  background-color: rgba(246,248,249,.78);
  box-shadow: inset 0 1px 2px rgba(20,42,56,.025);
  transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease;
}
.field select {
  appearance: none;
  padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7d87' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
.field input:focus, .field select:focus, .search-box input:focus {
  border-color: rgba(91,142,168,.55);
  background-color: rgba(255,255,255,.94);
  box-shadow: 0 0 0 4px rgba(89,144,171,.12), 0 5px 16px rgba(23,54,74,.06);
}
.field select option { color: var(--navy); background: #fbfcfc; }
.segmented {
  border: 1px solid rgba(255,255,255,.86);
  background: rgba(229,235,237,.62);
  box-shadow: inset 0 1px 3px rgba(30,50,62,.045);
  backdrop-filter: blur(14px);
}
.segmented button.active {
  color: var(--navy);
  border: 1px solid rgba(255,255,255,.9);
  background: linear-gradient(145deg, #fff, rgba(255,255,255,.8));
  box-shadow: 0 4px 12px rgba(28,50,64,.09), inset 0 1px 0 white;
}
.secondary-button, .delete-modal-button { border-color: rgba(37,61,77,.1); background: rgba(255,255,255,.64); }
.delete-modal-button { color: #a9574b; }
.close-modal { font-size: 21px; }
.toast { border: 1px solid rgba(255,255,255,.2); background: rgba(28,51,67,.88); backdrop-filter: blur(18px); }
@keyframes soft-rise { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: translateY(0); } }
@keyframes chart-pop { from { opacity: .4; transform: scale(.92); } to { opacity: 1; transform: scale(1); } }
@keyframes bar-grow { from { transform: scaleY(.08); opacity: .55; } to { transform: scaleY(1); opacity: 1; } }
@keyframes backdrop-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheet-in { from { opacity: .8; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@media (max-width: 480px) {
  .status-filter { padding: 9px 13px; }
  .modal-backdrop { padding: 10px; }
  .modal { border-radius: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

.custom-select { position: relative; min-width: 0; }
.custom-select > select {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.custom-select-trigger {
  display: flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  color: var(--navy);
  border: 1px solid rgba(255,255,255,.96);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(255,255,255,.88), rgba(244,248,249,.72));
  box-shadow: 0 6px 16px rgba(25,49,64,.055), inset 0 1px 0 white;
  text-align: left;
}
.custom-select-trigger:hover, .custom-select-trigger[aria-expanded="true"] {
  border-color: rgba(113,157,180,.42);
  background: rgba(255,255,255,.96);
  box-shadow: 0 0 0 4px rgba(98,150,176,.095), 0 8px 22px rgba(25,49,64,.075), inset 0 1px 0 white;
}
.custom-select-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.custom-select-trigger > i {
  width: 9px;
  height: 9px;
  flex: none;
  margin: -4px 3px 0 0;
  border-right: 1.8px solid #7b8c95;
  border-bottom: 1.8px solid #7b8c95;
  transform: rotate(45deg);
  transition: transform .2s ease;
}
.custom-select-trigger[aria-expanded="true"] > i { margin-top: 5px; transform: rotate(225deg); }
.custom-select-menu {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  left: 0;
  z-index: 20;
  display: grid;
  max-height: min(214px, 30vh);
  overflow: auto;
  padding: 6px;
  border: 1px solid rgba(255,255,255,.96);
  border-radius: 17px;
  background: rgba(249,251,252,.97);
  box-shadow: 0 18px 42px rgba(25,46,60,.17), inset 0 1px 0 white;
  backdrop-filter: blur(28px) saturate(1.35);
  -webkit-backdrop-filter: blur(28px) saturate(1.35);
  animation: menu-in .18s cubic-bezier(.2,.8,.2,1) both;
}
.custom-select-menu::-webkit-scrollbar { width: 5px; }
.custom-select-menu::-webkit-scrollbar-thumb { border-radius: 999px; background: rgba(68,100,117,.22); }
.custom-select-menu[hidden] { display: none; }
.custom-select-option {
  display: flex;
  width: 100%;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  color: #435c6b;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  text-align: left;
  font-size: 13px;
}
.custom-select-option:hover, .custom-select-option:focus-visible {
  outline: none;
  color: var(--navy);
  border-color: rgba(255,255,255,.95);
  background: rgba(255,255,255,.76);
  box-shadow: 0 3px 10px rgba(28,50,64,.055), inset 0 1px 0 white;
}
.custom-select-option.selected {
  color: #244c62;
  background: linear-gradient(100deg, rgba(221,235,241,.86), rgba(242,247,248,.8));
  font-weight: 680;
}
.custom-select-option > i { color: #497990; font-size: 13px; font-style: normal; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px) scale(.99); } to { opacity: 1; transform: translateY(0) scale(1); } }

.asset-history-panel {
  overflow: hidden;
  margin-top: 17px;
  padding: 19px 20px 12px;
  border: 1px solid rgba(255,255,255,.88);
  border-radius: 25px;
  background: linear-gradient(145deg, rgba(255,255,255,.77), rgba(255,255,255,.52));
  box-shadow: 0 14px 36px rgba(31,54,69,.055), inset 0 1px 0 rgba(255,255,255,.96);
  backdrop-filter: blur(20px) saturate(1.15);
  -webkit-backdrop-filter: blur(20px) saturate(1.15);
  animation: soft-rise .5s .06s both;
}
.asset-history-heading { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.asset-history-heading > div:first-child { display: grid; gap: 4px; }
.asset-history-heading h2 { margin: 0; color: var(--navy); font-size: 15px; font-weight: 740; letter-spacing: -.025em; }
.asset-history-heading > div:first-child span, .asset-history-metric > span { color: #879198; font-size: 10px; }
.asset-history-metric { display: grid; justify-items: end; gap: 4px; }
.asset-history-metric strong { color: var(--navy); font-size: 17px; font-weight: 760; font-variant-numeric: tabular-nums; }
.asset-history-metric > span { text-align: right; }
.asset-history-metric .history-up { color: #378b6d; }
.asset-history-metric .history-down { color: #bd7657; }
.asset-history-chart { display: block; width: 100%; height: auto; margin: 5px 0 -2px; overflow: visible; }
.asset-history-gridline { stroke: rgba(35,62,78,.09); stroke-dasharray: 3 7; stroke-width: 1; }
.asset-history-area { fill: url(#asset-area-fill); }
.asset-history-line { fill: none; stroke: #547f93; stroke-linecap: round; stroke-linejoin: round; stroke-width: 3; vector-effect: non-scaling-stroke; animation: history-draw .9s cubic-bezier(.2,.8,.2,1) both; }
.asset-history-halo { fill: rgba(77,126,149,.17); }
.asset-history-point { fill: #fff; stroke: #4d7e95; stroke-width: 3; vector-effect: non-scaling-stroke; }
.asset-history-date { fill: #919ba0; font-family: inherit; font-size: 10px; }
.asset-history-note { margin: -2px 0 0; color: #929a9e; font-size: 9px; line-height: 1.55; }
@keyframes history-draw { from { stroke-dasharray: 900; stroke-dashoffset: 900; opacity: .45; } to { stroke-dasharray: 900; stroke-dashoffset: 0; opacity: 1; } }
@media (max-width: 480px) {
  .asset-history-panel { margin-top: 14px; padding: 16px 14px 11px; border-radius: 22px; }
  .asset-history-heading h2 { font-size: 14px; }
  .asset-history-metric strong { font-size: 16px; }
  .asset-history-chart { margin-top: 7px; }
}
