:root {
  --ink: #211b16;
  --muted: #7b7770;
  --paper: #f6f5f3;
  --panel: #ffffff;
  --line: #e7e6e4;
  --teal: #514236;
  --teal-deep: #3e3329;
  --lime: #c7ae77;
  --amber: #c0a364;
  --red: #c6525d;
  --shadow: 0 8px 24px rgba(38, 31, 25, .055);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 14px; -webkit-tap-highlight-color: transparent; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: 236px; background: #ffffff; color: var(--ink); padding: 27px 17px 19px; display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; border-right: 1px solid var(--line); }
.brand-mark { width: 42px; height: 42px; border-radius: 8px; overflow: hidden; background: #f4f2ee; display: grid; place-items: center; margin: 0 0 11px 10px; box-shadow: 0 3px 10px rgba(38, 31, 25, .1); }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.brand-copy { padding: 0 10px 30px; display: flex; flex-direction: column; gap: 4px; }
.brand-copy strong { font-size: 17px; letter-spacing: 0; }
.brand-copy span { color: var(--muted); font-size: 11px; }
.nav-list { display: flex; flex-direction: column; gap: 5px; }
.nav-item { border: 0; background: transparent; color: #6e6a64; text-align: left; padding: 12px; border-radius: 7px; display: flex; gap: 12px; align-items: center; font-weight: 650; }
.nav-item:hover { background: #f6f5f3; color: var(--ink); }
.nav-item.active { background: #f4f0ea; color: var(--teal-deep); box-shadow: inset 3px 0 var(--teal); }
.nav-icon { width: 18px; text-align: center; font-size: 17px; color: var(--teal); }
.sidebar-footer { margin-top: auto; padding: 0 7px; }
.sync-card { padding: 12px 11px; background: #f6f5f3; border-radius: 8px; display: flex; gap: 9px; align-items: flex-start; margin-bottom: 12px; border: 1px solid var(--line); }
.sync-dot, .status-dot { width: 8px; height: 8px; background: var(--lime); border-radius: 50%; flex: 0 0 auto; margin-top: 5px; }
.sync-card strong, .sync-card span { display: block; font-size: 11px; }
.sync-card span { color: var(--muted); margin-top: 4px; }
.text-button { border: 0; background: transparent; color: var(--teal-deep); padding: 6px 0; font-size: 12px; }
.main-content { margin-left: 236px; padding: 28px 40px 48px; width: calc(100% - 236px); max-width: 1500px; }
.topbar { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 34px; }
.eyebrow, .section-kicker { color: var(--muted); text-transform: uppercase; letter-spacing: 0; font-size: 10px; font-weight: 700; line-height: 1.3; margin: 0; }
h1, h2, p { margin: 0; }
h1 { margin-top: 7px; font-size: 29px; letter-spacing: 0; }
h2 { margin-top: 7px; font-size: 20px; letter-spacing: 0; }
.topbar-actions { display: flex; gap: 10px; align-items: center; }
.icon-button, .ghost-button, .secondary-button, .primary-button { border-radius: 7px; padding: 10px 14px; border: 1px solid var(--line); background: #ffffff; color: var(--ink); transition: background .15s, border-color .15s, color .15s, transform .15s; }
.icon-button { width: 40px; padding: 10px; font-size: 18px; }
.primary-button { background: var(--teal); color: #ffffff; border-color: var(--teal); font-weight: 700; }
.primary-button:hover { background: var(--teal-deep); }
.secondary-button:hover, .ghost-button:hover, .icon-button:hover { border-color: var(--teal); color: var(--teal-deep); }
.ghost-button { border: 0; padding: 5px 0; background: transparent; color: var(--teal-deep); font-size: 12px; }
.view { display: none; }
.view.active { display: block; }
.hero-row { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(270px, .8fr); gap: 18px; }
.net-worth-panel, .insight-panel, .metric-card, .table-panel, .settings-panel, .receivable-summary, .plan-card, .analysis-summary, .analysis-list, .transfer-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.net-worth-panel { padding: 24px 26px 18px; min-height: 386px; }
.net-worth-main { display: block; }
.net-worth-value { font-size: 60px; font-weight: 760; letter-spacing: 0; margin: 8px 0 5px; overflow-wrap: anywhere; }
.change-row { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; line-height: 1.35; }
.change-pill { display: inline-flex; align-items: center; padding: 4px 7px; border-radius: 4px; font-weight: 700; line-height: 1.25; }
.change-rate { font-weight: 800; white-space: nowrap; }
.change-row > span:last-child { line-height: 1.35; }
.snapshot-button { display: block; margin-top: 10px; }
.positive { background: #eee8df; color: #635142; }
.negative { background: #cb4d58; color: var(--red); }
.chart-wrap { height: 205px; margin-top: 19px; }
#netWorthChart { width: 100%; height: 100%; }
.side-insights { display: flex; flex-direction: column; gap: 18px; }
.insight-panel { padding: 21px 20px; min-height: 176px; }
.insight-panel strong { display: block; font-size: 25px; margin: 10px 0 5px; letter-spacing: 0; line-height: 1.15; }
.muted { color: var(--muted); line-height: 1.55; }
.allocation-bar { height: 10px; display: flex; border-radius: 5px; overflow: hidden; margin: 15px 0 11px; background: #f1efed; }
.allocation-bar span { height: 100%; }
.legend-list { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 12px; }
.legend-item { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; }
.legend-item i { width: 7px; height: 7px; border-radius: 50%; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin: 34px 0 15px; }
.section-head.compact { margin: 0 0 15px; }
.section-head .muted { margin-top: 8px; font-size: 12px; }
.section-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; flex-wrap: wrap; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.metric-card { padding: 18px 19px; min-height: 116px; }
.metric-card.accent { background: #f5f2ee; border-color: #e4e1db; }
.metric-label, .metric-foot { display: block; color: var(--muted); font-size: 11px; line-height: 1.35; }
.metric-card strong { display: block; margin: 12px 0 9px; font-size: 22px; letter-spacing: 0; line-height: 1.15; }
.metric-foot { font-size: 11px; }
.lower-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 18px; margin-top: 18px; }
.table-panel { padding: 20px; }
.activity-list, .breakdown-list { display: flex; flex-direction: column; gap: 2px; }
.activity-row, .breakdown-row { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 12px 0; border-top: 1px solid #f0f0ef; }
.activity-main, .breakdown-main { display: flex; gap: 10px; align-items: center; min-width: 0; }
.activity-icon { width: 28px; height: 28px; border-radius: 8px; background: #f6f3ef; color: var(--teal-deep); display: grid; place-items: center; }
.activity-name, .activity-date, .breakdown-name, .breakdown-value { display: block; }
.activity-name, .breakdown-name { font-weight: 650; font-size: 12px; line-height: 1.35; }
.activity-date { color: var(--muted); font-size: 11px; line-height: 1.35; margin-top: 3px; }
.activity-amount { font-weight: 700; white-space: nowrap; }
.amount-income { color: #635142; }.amount-expense { color: var(--red); }.amount-transfer { color: var(--teal-deep); }
.breakdown-row { gap: 8px; }.breakdown-main { flex: 1; }.breakdown-track { flex: 1; height: 6px; border-radius: 3px; background: #f1efed; overflow: hidden; }.breakdown-track span { display: block; height: 100%; border-radius: inherit; background: var(--teal); }.breakdown-value { min-width: 94px; text-align: right; font-weight: 700; font-size: 12px; }
.filter-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 12px; }
.segmented { display: inline-flex; gap: 3px; background: #edecea; padding: 3px; border-radius: 7px; }.segmented button { border: 0; background: transparent; color: var(--muted); border-radius: 5px; padding: 7px 11px; font-size: 12px; }.segmented button.selected { background: #ffffff; color: var(--ink); box-shadow: 0 1px 4px rgba(0, 0, 0, .08); font-weight: 700; }
.search-box { border: 1px solid var(--line); background: #ffffff; border-radius: 7px; display: flex; align-items: center; gap: 7px; padding: 7px 10px; width: 220px; color: var(--muted); }.search-box input { border: 0; outline: 0; width: 100%; background: transparent; font-size: 12px; }
.account-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }.account-card { background: #ffffff; border: 1px solid var(--line); border-radius: 8px; padding: 17px; }.account-top { display: flex; justify-content: space-between; gap: 8px; }.account-name { font-weight: 700; line-height: 1.35; }.account-category { color: var(--muted); font-size: 11px; line-height: 1.35; margin-top: 4px; }.account-balance { font-size: 24px; font-weight: 750; line-height: 1.15; margin: 24px 0 4px; letter-spacing: 0; }.account-currency { color: var(--muted); font-size: 11px; line-height: 1.35; }.account-actions { border-top: 1px solid #f0f0ef; margin-top: 16px; padding-top: 11px; display: flex; gap: 13px; align-items: center; }.account-actions button { border: 0; padding: 0; background: transparent; color: var(--teal-deep); font-size: 11px; }
.data-table { width: 100%; }.data-row { display: grid; grid-template-columns: 100px 1.2fr 110px 130px 100px; gap: 12px; align-items: center; min-height: 56px; border-top: 1px solid #f0f0ef; }.data-row.header { min-height: 34px; border-top: 0; color: var(--muted); font-size: 11px; }.data-row > div:nth-child(3), .data-row > div:nth-child(4), .data-row > div:nth-child(5) { text-align: right; }.data-title { font-weight: 650; font-size: 12px; line-height: 1.35; }.data-sub { color: var(--muted); font-size: 11px; line-height: 1.35; margin-top: 3px; }.table-empty { padding: 34px 0; color: var(--muted); text-align: center; }
.receivable-summary { padding: 18px 20px; display: flex; gap: 70px; margin-bottom: 16px; }.receivable-summary span, .receivable-summary strong { display: block; }.receivable-summary span { color: var(--muted); font-size: 11px; }.receivable-summary strong { font-size: 24px; margin-top: 8px; }
.plan-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; padding: 12px 14px; background: #ffffff; border: 1px solid var(--line); border-radius: 8px; }
.plan-toolbar label { color: var(--muted); font-size: 11px; }
.plan-toolbar input { border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; color: var(--ink); background: #ffffff; }
.plan-month-summary { margin-left: auto; display: flex; align-items: baseline; gap: 9px; }
.plan-month-summary span { color: var(--muted); font-size: 11px; }
.plan-month-summary strong { font-size: 16px; }
.plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.plan-card { padding: 18px; }
.plan-card-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.plan-name { font-size: 15px; font-weight: 700; }
.plan-status { padding: 4px 7px; border-radius: 4px; background: #f4f0ea; color: var(--teal-deep); font-size: 10px; font-weight: 700; white-space: nowrap; }
.plan-status.over { background: #cb4d58; color: var(--red); }
.plan-remaining { margin: 20px 0 4px; font-size: 25px; font-weight: 750; letter-spacing: 0; line-height: 1.15; }
.plan-remaining.over { color: var(--red); }
.plan-caption { color: var(--muted); font-size: 11px; }
.plan-progress { height: 7px; margin-top: 16px; overflow: hidden; border-radius: 4px; background: #f1efed; }
.plan-progress span { display: block; height: 100%; border-radius: inherit; background: var(--teal); }
.plan-progress span.over { background: var(--red); }
.plan-card .account-actions { justify-content: flex-end; }
.settings-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }.settings-panel { padding: 22px; min-height: 285px; }.settings-panel label { display: block; color: var(--muted); font-size: 12px; margin-top: 17px; }.settings-panel label input, .settings-panel label select { display: block; width: 100%; margin-top: 7px; padding: 11px; border: 1px solid var(--line); border-radius: 6px; background: #ffffff; color: var(--ink); }.settings-panel .secondary-button { margin-top: 18px; }.save-note { color: var(--teal-deep); font-size: 11px; margin-top: 10px; min-height: 16px; }.recovery-box { display: flex; gap: 9px; padding: 13px; background: #f7f6f4; margin-top: 17px; }.recovery-box strong { font-size: 12px; }.recovery-box p { color: var(--muted); font-size: 11px; margin-top: 4px; line-height: 1.45; }.button-stack { display: flex; flex-direction: column; gap: 9px; margin-top: 17px; }.button-stack .secondary-button { margin: 0; text-align: left; }
.language-panel { grid-column: 1 / -1; min-height: 0; }
.app-credit { margin-top: 20px; color: #928e87; font-size: 10px; text-align: center; }
.analysis-summary { display: grid; grid-template-columns: repeat(3, 1fr); margin-bottom: 15px; overflow: hidden; }
.analysis-summary > div { padding: 20px 22px; border-right: 1px solid var(--line); }
.analysis-summary > div:last-child { border-right: 0; }
.analysis-summary span, .analysis-summary strong { display: block; }
.analysis-summary span { color: var(--muted); font-size: 11px; }
.analysis-summary strong { margin-top: 9px; font-size: 23px; line-height: 1.2; }
.analysis-list { padding: 0 22px; }
.analysis-row { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 17px 0; border-top: 1px solid #f1efed; }
.analysis-row:first-child { border-top: 0; }
.analysis-date strong, .analysis-date span, .analysis-value strong, .analysis-value span { display: block; }
.analysis-date strong, .analysis-value strong { font-size: 14px; }
.analysis-date span, .analysis-value span { margin-top: 5px; color: var(--muted); font-size: 11px; }
.analysis-value { text-align: right; }
.lending-tabs { margin-bottom: 15px; }
.lending-pane { display: none; }
.lending-pane.active { display: block; }
.lending-head { margin-top: 0; }
.profile-onboarding, .profile-card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.profile-onboarding { min-height: 350px; padding: 52px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.profile-onboarding-mark { width: 72px; height: 72px; margin-bottom: 18px; border-radius: 8px; display: grid; place-items: center; background: #f3efea; color: var(--teal-deep); font-size: 23px; font-weight: 850; }
.profile-onboarding h2 { margin: 8px 0; font-size: 25px; }
.profile-onboarding .muted { max-width: 480px; }
.profile-onboarding .primary-button { margin-top: 24px; }
.profile-card { padding: 26px; }
.profile-identity { display: flex; align-items: center; gap: 16px; min-width: 0; }
.profile-identity > div:last-child { min-width: 0; }
.profile-identity h2 { margin: 6px 0 4px; font-size: 26px; overflow-wrap: anywhere; }
.profile-identity p { color: var(--muted); overflow-wrap: anywhere; }
.profile-avatar { width: 82px; height: 82px; flex: 0 0 82px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); }
.profile-avatar-placeholder { display: grid; place-items: center; background: #f3efea; color: var(--teal-deep); font-size: 31px; font-weight: 850; }
.profile-local-badge { display: inline-flex; padding: 4px 7px; border-radius: 4px; background: #f1eee8; color: var(--teal-deep); font-size: 10px; font-weight: 750; }
.profile-actions { display: flex; gap: 9px; margin: 24px 0; }
.profile-signature { padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.profile-signature span, .profile-meta span { display: block; color: var(--muted); font-size: 11px; }
.profile-signature blockquote { margin: 10px 0 0; font-size: 16px; font-weight: 650; line-height: 1.55; }
.profile-meta { display: flex; justify-content: space-between; gap: 16px; padding-top: 18px; }
.profile-meta strong { font-size: 12px; }
.profile-delete { margin-top: 24px; }
.transfer-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.transfer-panel { display: grid; grid-template-columns: 46px 1fr; gap: 15px; min-height: 218px; padding: 22px; }
.transfer-panel > button { grid-column: 1 / -1; align-self: end; justify-self: start; min-width: 160px; }
.transfer-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 8px; background: #f4f0ea; color: var(--teal-deep); font-size: 22px; font-weight: 800; }
.transfer-panel h2 { margin-top: 5px; }
.transfer-panel .muted { margin-top: 9px; }
.transfer-panel-main { border-color: #e1ded8; background: #fcfbf9; }
.transfer-note { padding: 0 4px; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(18, 15, 12, .52); display: grid; place-items: center; z-index: 2147483003; padding: 18px; backdrop-filter: blur(5px); }.modal-backdrop[hidden] { display: none; }.modal { width: min(540px, 100%); max-height: min(88dvh, 900px); overflow-y: auto; background: #ffffff; border-radius: 8px; padding: 72px 25px 25px; position: relative; box-shadow: 0 30px 80px rgba(0, 0, 0, .2); }.modal::before { content: ""; position: absolute; top: 55px; right: 0; left: 0; height: 1px; background: var(--line); }.modal-close { border: 0; background: #f4f3f1; font-size: 22px; position: absolute; top: 10px; left: 14px; width: 36px; height: 36px; border-radius: 50%; color: var(--muted); }.modal-confirm { position: absolute; top: 10px; right: 14px; z-index: 2; min-height: 36px; padding: 7px 14px; }.modal h2 { margin: 0 0 5px; }.modal-subtitle { color: var(--muted); font-size: 12px; margin-bottom: 21px; }.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }.form-field { display: flex; flex-direction: column; gap: 7px; color: var(--muted); font-size: 11px; }.form-field.full { grid-column: 1 / -1; }.form-field input, .form-field select { border: 1px solid var(--line); border-radius: 6px; padding: 10px; color: var(--ink); background: #ffffff; }.form-actions { display: flex; justify-content: flex-start; gap: 9px; margin-top: 23px; }.form-actions:empty { display: none; }.form-error { color: var(--red); font-size: 11px; margin-top: 10px; }
.modal { padding: 0; }
.modal::before { display: none; }
.modal-toolbar { position: sticky; top: 0; z-index: 4; min-height: 58px; display: flex; align-items: center; justify-content: space-between; padding: 9px 14px; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .97); backdrop-filter: blur(14px); }
.modal-action { display: flex; align-items: center; justify-content: flex-end; }
.modal-close, .modal-confirm { position: static; }
.modal-confirm { min-height: 40px; }
#modalContent { padding: 22px 25px 25px; }
.modal.bill-import-modal { width: min(820px, 100%); max-height: min(86vh, 900px); overflow: auto; }
.bill-import-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; margin: 14px 0; color: var(--muted); font-size: 12px; }
.bill-import-meta label { display: flex; align-items: center; gap: 8px; }
.bill-import-meta select { min-width: 190px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: #ffffff; color: var(--ink); }
.bill-import-table-wrap { max-height: 45vh; overflow: auto; border: 1px solid var(--line); border-radius: 6px; }
.bill-import-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.bill-import-table th, .bill-import-table td { padding: 9px 10px; border-bottom: 1px solid #f0f0ef; text-align: left; white-space: nowrap; }
.bill-import-table th { position: sticky; top: 0; z-index: 1; background: #f6f6f6; color: var(--muted); font-weight: 650; }
.bill-import-table td.bill-name { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.bill-import-table tr.duplicate { opacity: .5; }
.bill-import-table td:last-child, .bill-import-table th:last-child { text-align: right; }
.bill-import-note { margin-top: 10px; color: var(--muted); font-size: 11px; }
.toast { position: fixed; right: 28px; bottom: 25px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #c3ac79; color: #ffffff; padding: 11px 15px; border-radius: 7px; font-size: 12px; opacity: 0; transform: translateY(8px); pointer-events: none; transition: all .2s; z-index: 10; }.toast.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.mobile-more-nav, .mobile-fab, .mobile-sheet-backdrop, .mobile-top-nav, .mobile-more-panel, .mobile-settings-bar { display: none; }
.transaction-delete { min-width: 48px; height: 36px; padding: 0 8px; border: 1px solid #c4555f; border-radius: 6px; background: #ffffff; color: var(--red); font-size: 11px; line-height: 1; }
.transaction-delete:hover { background: #cb4d58; border-color: var(--red); }
.transaction-entry { cursor: pointer; transition: background .15s, border-color .15s, box-shadow .15s; }
.transaction-entry:hover { background: #fbfaf8; }
.transaction-entry:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.transaction-chevron { color: var(--muted); font-size: 23px; line-height: 1; }
.danger-text { color: var(--red) !important; }
.debt-actions { display: flex; justify-content: flex-end; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.data-row.transaction-row { grid-template-columns: 90px minmax(180px, 1.2fr) minmax(100px, .8fr) 130px 80px 88px; }
.data-row.transaction-row > div { min-width: 0; }
.data-row.transaction-row .data-main, .data-row.transaction-row .data-account { overflow: hidden; text-overflow: ellipsis; }
.data-row.transaction-row .data-actions { display: flex; justify-content: flex-end; align-items: center; gap: 7px; }
.detail-toolbar { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 12px; max-width: 760px; margin: 0 auto 14px; }
.detail-toolbar h2 { margin-top: 4px; }
.detail-toolbar .primary-button:disabled { opacity: .45; cursor: not-allowed; }
.detail-back { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 7px; background: #ffffff; color: var(--ink); font-size: 28px; line-height: 1; }
.transaction-detail-card { max-width: 760px; margin: 0 auto; padding: 28px; border: 1px solid var(--line); border-radius: 8px; background: #ffffff; box-shadow: var(--shadow); }
.detail-type { display: inline-flex; padding: 5px 8px; border-radius: 4px; background: #f4f2ee; color: var(--teal-deep); font-size: 11px; font-weight: 750; }
.detail-amount { display: block; margin: 18px 0 5px; font-size: 40px; line-height: 1.1; letter-spacing: 0; overflow-wrap: anywhere; }
.detail-native { color: var(--muted); font-size: 12px; }
.detail-linked-note { margin-top: 20px; padding: 12px 14px; border: 1px solid #e4dac4; border-radius: 6px; background: #fbf9f4; color: #69572e; font-size: 12px; line-height: 1.5; }
.detail-list { margin: 26px 0 0; }
.detail-list > div { display: grid; grid-template-columns: minmax(110px, .45fr) minmax(0, 1fr); gap: 18px; padding: 15px 0; border-top: 1px solid #f1efed; }
.detail-list dt { color: var(--muted); font-size: 12px; }
.detail-list dd { margin: 0; text-align: right; font-weight: 650; overflow-wrap: anywhere; }
.detail-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.detail-empty { max-width: 760px; margin: 40px auto; padding: 36px; text-align: center; }
.detail-empty button { margin-top: 16px; }
.entity-card { cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.entity-card:hover { border-color: #dad8d2; box-shadow: 0 10px 26px rgba(38, 31, 25, .09); }
.entity-card:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.entity-chevron { margin-left: auto; color: var(--muted); font-size: 22px; line-height: 1; }
.entity-detail-card { max-width: 860px; margin: 0 auto; padding: 28px; border: 1px solid var(--line); border-radius: 8px; background: #ffffff; box-shadow: var(--shadow); }
.entity-detail-hero > span { color: var(--muted); font-size: 12px; }
.entity-detail-hero h2 { margin: 8px 0 20px; font-size: 24px; }
.entity-detail-hero > strong { display: block; font-size: 38px; line-height: 1.12; overflow-wrap: anywhere; }
.entity-detail-hero > small { display: block; margin-top: 7px; color: var(--muted); font-size: 12px; }
.entity-detail-progress { max-width: 440px; margin-top: 18px; }
.entity-detail-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 26px 0; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--line); }
.entity-detail-metrics > div { min-width: 0; padding: 17px; background: #fbfaf9; }
.entity-detail-metrics span, .entity-detail-metrics strong { display: block; }
.entity-detail-metrics span { color: var(--muted); font-size: 11px; }
.entity-detail-metrics strong { margin-top: 8px; font-size: 16px; overflow-wrap: anywhere; }
.related-section { margin-top: 28px; }
.related-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.related-section-head h2 { margin-top: 5px; font-size: 18px; }
.related-section-head > span { color: var(--muted); font-size: 11px; }
.related-transaction-list { border-top: 1px solid var(--line); }
.related-transaction-row { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto 18px; align-items: center; gap: 13px; padding: 15px 4px; border: 0; border-bottom: 1px solid #f1efed; background: transparent; color: var(--ink); text-align: left; }
.related-transaction-row:hover { background: #fbfaf8; }
.related-transaction-main { min-width: 0; }
.related-transaction-main strong, .related-transaction-main small { display: block; }
.related-transaction-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.related-transaction-main small { margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; }
.related-transaction-amount { font-weight: 750; white-space: nowrap; }
.related-empty { padding: 30px 0; border-top: 1px solid var(--line); color: var(--muted); text-align: center; }
.reconciliation-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.reconciliation-toolbar .muted { margin-top: 5px; font-size: 12px; }
.reconciliation-list { margin-top: 12px; border-top: 1px solid #f1efed; }
.reconciliation-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px 2px; border-bottom: 1px solid #f1efed; }
.reconciliation-row > div { min-width: 0; }
.reconciliation-row > div:first-child strong, .reconciliation-row > div:first-child span, .reconciliation-row > div:last-child small, .reconciliation-row > div:last-child strong { display: block; }
.reconciliation-row > div:first-child strong { font-size: 12px; }
.reconciliation-row > div:first-child span, .reconciliation-row > div:last-child small { margin-top: 4px; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.reconciliation-row > div:last-child { text-align: right; }
.reconciliation-row > div:last-child strong { margin-top: 4px; font-size: 12px; }
.backup-preview-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--line); }
.backup-preview-grid > div { padding: 13px 15px; background: #faf9f8; }
.backup-preview-grid span, .backup-preview-grid strong { display: block; }
.backup-preview-grid span { color: var(--muted); font-size: 11px; }
.backup-preview-grid strong { margin-top: 5px; font-size: 18px; }
.restore-warning { display: grid; gap: 5px; margin-top: 16px; padding: 13px 14px; border: 1px solid #e4dac4; border-radius: 6px; background: #fbf9f4; color: #69572e; }
.restore-warning strong { font-size: 12px; }
.restore-warning span { font-size: 11px; line-height: 1.5; }
.restore-undo-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 15px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 7px; background: #ffffff; }
.restore-undo-row > div { display: grid; gap: 4px; }
.restore-undo-row strong { font-size: 12px; }
.restore-undo-row span { color: var(--muted); font-size: 11px; line-height: 1.45; }
.restore-undo-row button[hidden] { display: none; }
.toast-action { flex: 0 0 auto; border: 0; border-left: 1px solid rgba(255, 255, 255, .3); padding: 2px 0 2px 12px; background: transparent; color: #c7ae77; font-weight: 750; }
h1, h2, .metric-card strong, .account-balance, .plan-remaining, .insight-panel strong { letter-spacing: 0; }
@media (max-width: 1000px) { .main-content { padding: 24px; }.hero-row, .lower-grid, .settings-grid { grid-template-columns: 1fr; }.side-insights { display: grid; grid-template-columns: 1fr 1fr; }.account-grid, .plan-grid { grid-template-columns: repeat(2, 1fr); }.metric-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px) {
  body { --host-footer-offset: 46px; font-size: 15px; overscroll-behavior-y: none; }
  .app-shell { display: block; min-height: 100dvh; }
  .sidebar { display: none; }
  .main-content { margin-left: 0; width: 100%; max-width: none; padding: calc(12px + env(safe-area-inset-top)) 14px calc(82px + env(safe-area-inset-bottom) + var(--host-footer-offset)); }
  .topbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "title date"; align-items: center; gap: 12px; margin: 0 -14px; padding: 9px 14px 15px; background: #ffffff; }
  .topbar > div:first-child { display: contents; }
  .topbar h1 { grid-area: title; margin: 0; color: #c3ac79; font-size: 30px; font-weight: 850; line-height: 1.1; }
  .eyebrow { grid-area: date; align-self: center; color: #c3ac79; font-size: 13px; font-weight: 750; line-height: 1.1; letter-spacing: 0; text-align: right; text-transform: none; white-space: nowrap; }
  .topbar-actions { display: none; }
  .mobile-top-nav { position: sticky; top: 0; z-index: 4; display: grid; grid-template-columns: repeat(4, 1fr); margin: 0 -14px 14px; padding: 0 10px; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .97); backdrop-filter: blur(16px); }
  .mobile-tab { position: relative; min-height: 50px; padding: 0 4px; border: 0; background: transparent; color: #76726b; font-size: 14px; font-weight: 750; }
  .mobile-tab.active { color: #c3ac79; font-weight: 850; }
  .mobile-tab.active::after { content: ""; position: absolute; right: 20%; bottom: 0; left: 20%; height: 4px; border-radius: 4px 4px 0 0; background: var(--lime); }
  .mobile-more-panel { position: sticky; top: 50px; z-index: 3; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: -14px 0 14px; padding: 12px; border: 1px solid var(--line); border-radius: 0 0 8px 8px; background: #ffffff; box-shadow: 0 12px 28px rgba(195, 172, 121, .12); }
  .mobile-more-panel[hidden] { display: none; }
  .mobile-more-panel button { min-height: 70px; padding: 10px 5px; border: 0; border-radius: 6px; background: #f7f6f4; color: var(--ink); }
  .mobile-more-panel span, .mobile-more-panel strong { display: block; }
  .mobile-more-panel span { margin-bottom: 6px; color: var(--teal-deep); font-size: 19px; }
  .mobile-more-panel strong { font-size: 13px; font-weight: 800; }
  .mobile-fab { position: fixed; left: 16px; bottom: max(14px, env(safe-area-inset-bottom)); z-index: 2147483002; display: flex; align-items: center; gap: 6px; min-height: 50px; padding: 0 19px; border: 0; border-radius: 25px; background: var(--teal); color: #ffffff; box-shadow: 0 8px 22px rgba(68, 55, 45, .28); font-size: 14px; font-weight: 850; }
  .mobile-fab.detail-hidden { display: none; }
  .mobile-fab span { font-size: 24px; font-weight: 400; }
  .hero-row, .side-insights, .metric-grid, .account-grid, .plan-grid { grid-template-columns: 1fr; }
  .hero-row { gap: 12px; }
  .net-worth-panel { padding: 17px 16px 15px; min-height: 0; }
  .net-worth-panel > .section-kicker { color: #564639; font-size: 14px; font-weight: 850; }
  .net-worth-main { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
  .net-worth-value { min-width: 0; font-size: 42px; font-weight: 850; line-height: 1.12; margin: 0; }
  .change-row { align-items: center; flex-wrap: wrap; margin-top: 12px; row-gap: 7px; font-size: 12px; }
  .snapshot-button { flex: 0 0 auto; min-height: 42px; margin: 0; padding: 8px 12px; border-color: #d6c49b; background: #f2ede0; color: #2e251e; font-size: 13px; font-weight: 850; }
  .chart-wrap { display: none; }
  .side-insights { gap: 12px; }
  .insight-panel { min-height: 138px; padding: 18px 17px; }
  .insight-panel .section-kicker, .metric-label { color: #5c4b3e; font-size: 13px; font-weight: 800; }
  .insight-panel strong { font-size: 30px; font-weight: 850; }
  .section-head { align-items: flex-start; margin: 27px 0 13px; }
  .section-head > .primary-button { min-height: 44px; padding: 9px 12px; flex: 0 0 auto; }
  .section-head h2 { font-size: 22px; font-weight: 850; }
  .section-head .muted { max-width: 230px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .metric-card { min-height: 112px; padding: 15px; }
  .metric-card strong { font-size: 23px; font-weight: 850; overflow-wrap: anywhere; }
  .lower-grid { gap: 12px; margin-top: 12px; }
  .table-panel { padding: 15px; }
  .filter-row { flex-direction: column; align-items: stretch; margin-bottom: 12px; }
  .segmented { width: 100%; overflow-x: auto; scrollbar-width: none; }
  .segmented button { flex: 1 0 auto; min-height: 38px; }
  .search-box { width: 100%; min-height: 44px; }
  .account-grid, .plan-grid { gap: 10px; }
  .account-card, .plan-card { padding: 16px; }
  .account-name, .plan-name { font-size: 16px; font-weight: 800; }
  .account-balance, .plan-remaining { font-size: 28px; font-weight: 850; }
  .account-actions button { min-height: 38px; padding: 7px 3px; }
  .transaction-panel { padding: 0; background: transparent; border: 0; box-shadow: none; }
  .data-row.header { display: none; }
  .data-row.transaction-row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "main amount" "date date" "meta actions"; gap: 7px 12px; min-height: 0; margin-bottom: 10px; padding: 15px; border: 1px solid var(--line); border-radius: 8px; background: #ffffff; box-shadow: var(--shadow); }
  .transaction-row .data-date { position: static; grid-area: date; color: var(--muted); font-size: 11px; line-height: 1.35; text-align: left !important; }
  .transaction-row .data-main { grid-area: main; min-width: 0; padding-bottom: 0; }
  .transaction-row .data-title { font-size: 15px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .transaction-row .data-account { grid-area: meta; color: var(--muted); font-size: 11px; text-align: left !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .transaction-row .data-amount { grid-area: amount; align-self: start; font-size: 15px; text-align: right; white-space: nowrap; }
  .transaction-row .data-status { display: none; }
  .transaction-row .data-actions { grid-area: actions; align-self: end; }
  .transaction-delete { min-width: 52px; height: 42px; font-size: 11px; }
  .transaction-chevron { font-size: 24px; }
  .detail-toolbar { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 9px; margin-top: 4px; }
  .detail-toolbar h2 { font-size: 19px; }
  .detail-toolbar .section-kicker { font-size: 10px; }
  .detail-toolbar .primary-button { min-height: 42px; padding: 8px 11px; font-size: 12px; }
  .transaction-detail-card { padding: 20px 17px; }
  .detail-amount { font-size: 34px; }
  .detail-list { margin-top: 22px; }
  .detail-list > div { grid-template-columns: 104px minmax(0, 1fr); gap: 12px; padding: 14px 0; }
  .detail-list dd { font-size: 13px; }
  .detail-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .detail-actions button { min-height: 44px; padding-inline: 8px; }
  .entity-detail-card { padding: 20px 17px; }
  .entity-detail-hero h2 { margin-bottom: 16px; font-size: 21px; }
  .entity-detail-hero > strong { font-size: 31px; }
  .entity-detail-metrics { grid-template-columns: 1fr; }
  .entity-detail-metrics > div { padding: 14px 15px; border-top: 1px solid var(--line); }
  .entity-detail-metrics > div:first-child { border-top: 0; }
  .reconciliation-toolbar { align-items: flex-start; }
  .reconciliation-toolbar .secondary-button { min-height: 42px; padding-inline: 10px; white-space: nowrap; }
  .backup-preview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .restore-undo-row { align-items: flex-start; flex-direction: column; }
  .restore-undo-row button { min-height: 42px; }
  .related-section { margin-top: 23px; }
  .related-transaction-row { grid-template-columns: minmax(0, 1fr) auto 14px; gap: 9px; padding: 14px 1px; }
  .related-transaction-main strong { font-size: 14px; }
  .related-transaction-amount { font-size: 13px; }
  #receivableTable .data-row:not(.header), #debtTable .data-row:not(.header) { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; min-height: 0; margin-bottom: 10px; padding: 15px; border: 1px solid var(--line); border-radius: 8px; background: #ffffff; }
  #receivableTable .data-row:not(.header) > div, #debtTable .data-row:not(.header) > div { text-align: left; }
  #receivableTable .data-row:not(.header) > div:nth-child(3), #debtTable .data-row:not(.header) > div:nth-child(3) { color: var(--muted); font-size: 11px; }
  #receivableTable .data-row:not(.header) > div:nth-child(4), #receivableTable .data-row:not(.header) > div:nth-child(5), #debtTable .data-row:not(.header) > div:nth-child(4), #debtTable .data-row:not(.header) > div:nth-child(5) { text-align: right; }
  #debtTable .debt-actions { grid-column: 1 / -1; justify-content: flex-end; border-top: 1px solid #f0f0ef; padding-top: 8px; }
  .receivable-summary { justify-content: space-between; gap: 15px; }
  .plan-toolbar { align-items: flex-start; flex-wrap: wrap; }
  .plan-toolbar input { min-height: 44px; }
  .plan-month-summary { width: 100%; margin-left: 0; flex-wrap: wrap; }
  .settings-grid, .transfer-grid { grid-template-columns: 1fr; gap: 12px; }
  .settings-panel { min-height: 0; padding: 18px; }
  .analysis-summary { grid-template-columns: 1fr; }
  .analysis-summary > div { padding: 16px 18px; border-right: 0; border-top: 1px solid var(--line); }
  .analysis-summary > div:first-child { border-top: 0; }
  .analysis-row { padding: 15px 0; }
  .section-actions { width: 100%; justify-content: stretch; }
  .section-actions button { flex: 1 1 150px; min-height: 44px; }
  .lending-tabs { display: flex; width: 100%; margin-bottom: 12px; }
  .lending-tabs button { flex: 1; min-height: 42px; }
  .lending-head { align-items: flex-start; }
  .profile-onboarding { min-height: 310px; padding: 38px 20px; }
  .profile-card { padding: 18px; }
  .profile-avatar { width: 68px; height: 68px; flex-basis: 68px; }
  .profile-identity h2 { font-size: 22px; }
  .profile-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .profile-actions button { min-height: 44px; padding-inline: 8px; }
  .analysis-date strong, .analysis-value strong { font-size: 13px; }
  .transfer-panel { min-height: 190px; padding: 18px; }
  .form-grid { grid-template-columns: 1fr; gap: 13px; }
  .form-field.full { grid-column: auto; }
  .form-field input, .form-field select { min-height: 48px; font-size: 16px; }
  .modal-backdrop { align-items: end; padding: 0; }
  .modal { width: 100%; max-height: calc(92dvh - env(safe-area-inset-top)); overflow-y: auto; border-radius: 14px 14px 0 0; padding: 0; }
  .modal-toolbar { min-height: 60px; padding: 9px 12px; }
  .modal-close { width: 42px; height: 42px; }
  .modal-confirm { min-height: 42px; padding: 8px 15px; }
  #modalContent { padding: 20px 18px calc(22px + env(safe-area-inset-bottom)); }
  .form-actions { margin-top: 20px; }
  .form-actions button { min-height: 44px; }
  .bill-import-table-wrap { max-height: 48dvh; }
  .bill-import-meta { align-items: stretch; flex-direction: column; }
  .bill-import-meta label { justify-content: space-between; }
  .bill-import-meta select { min-width: 0; max-width: 65%; }
  .toast { left: 14px; right: 14px; bottom: calc(72px + env(safe-area-inset-bottom) + var(--host-footer-offset)); text-align: center; }
  .mobile-sheet-backdrop { position: fixed; inset: 0 0 var(--host-footer-offset); z-index: 2147483001; display: flex; align-items: flex-end; background: rgba(195, 172, 121, .45); }
  .mobile-sheet-backdrop[hidden] { display: none; }
  .mobile-sheet { width: 100%; padding: 8px 16px calc(20px + env(safe-area-inset-bottom)); border-radius: 16px 16px 0 0; background: #ffffff; box-shadow: 0 -18px 50px rgba(195, 172, 121, .16); }
  .mobile-sheet-handle { width: 38px; height: 4px; margin: 0 auto 13px; border-radius: 2px; background: #dbd9d7; }
  .mobile-sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
  .mobile-sheet-head strong { font-size: 18px; }
  .mobile-sheet-head button { width: 44px; height: 44px; border: 0; background: transparent; color: var(--muted); font-size: 25px; }
  .mobile-sheet-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .mobile-sheet-grid button { min-height: 82px; padding: 13px; border: 1px solid var(--line); border-radius: 8px; background: #faf9f8; color: var(--ink); text-align: left; }
  .mobile-sheet-grid button span, .mobile-sheet-grid button strong { display: block; }
  .mobile-sheet-grid button span { color: var(--teal-deep); font-size: 21px; margin-bottom: 8px; }
  .mobile-sheet-grid button strong { font-size: 13px; }
}
@media (max-width: 380px) { .main-content { padding-inline: 10px; }.topbar, .mobile-top-nav { margin-inline: -10px; }.topbar { padding-inline: 10px; }.metric-grid { grid-template-columns: 1fr; }.net-worth-panel { padding-inline: 15px; }.net-worth-value { font-size: 34px; } }
