/* Presentation only: shared palette and spacing; accounting and storage stay in app.js. */
:root {
  color: #243f38;
  background: #f6f7f3;
  --navy: #254b40;
  --orange: #cc643a;
  --orange-soft: #fbede4;
  --muted: #748078;
  --line: #e5eae3;
  --surface: #ffffff;
  --shadow: 0 4px 20px rgba(35, 62, 45, .035);
}
body { background: #f6f7f3; }
.app-shell { max-width: 1060px; padding-top: 28px; }
.topbar { margin-bottom: 30px; }
.brand-mark { background: #254b40; border-radius: 11px; box-shadow: none; }
.brand { letter-spacing: .08em; }
.overline { color: #7d8a80; letter-spacing: .16em; font-size: 10px; }
.page-heading h1 { letter-spacing: -.035em; }
.account-chip, .date-chip, .round-button, .status-filter, .today-button {
  background: #fff; border: 1px solid var(--line); box-shadow: none;
}
.account-chip { color: #586d60; }
.round-button.add-round, .add-record-button, .primary-button {
  background: #cc643a; border-color: #cc643a; box-shadow: 0 4px 10px rgba(167, 80, 39, .1);
}
.primary-button:hover, .add-record-button:hover { background: #b9532e; }
button { transition: background-color .16s, border-color .16s, box-shadow .16s, transform .16s; }
button:active { transform: translateY(1px); }
button:focus-visible, input:focus-visible, .analysis-disclosure > summary:focus-visible { outline-color: #b96b43; }
.overview-panel {
  position: relative; isolation: isolate; overflow: hidden; border: 1px solid #254b40;
  border-radius: 24px; background: #254b40; box-shadow: 0 8px 24px rgba(37, 75, 64, .1);
}
.overview-panel::before { display: none; }
.overview-panel::after {
  position: absolute; z-index: -1; width: 240px; height: 240px; right: -100px; top: -110px;
  border: 1px solid rgba(222, 239, 210, .15); border-radius: 50%;
  background: transparent; box-shadow: 0 0 0 32px rgba(222,239,210,.035), 0 0 0 65px rgba(222,239,210,.025); content: '';
}
.overview-panel .overview-head h2, .overview-panel .overview-values strong { color: #fffdf5; }
.overview-panel .overview-values span, .overview-panel .overview-values small,
.overview-panel .overview-status, .overview-panel .overview-scope, .family-assets-note { color: #ceded0; }
.overview-values strong { font-weight: 700; letter-spacing: -.035em; line-height: 1.25; }
.financial-overview .overview-values strong { white-space: normal; overflow-wrap: anywhere; }
.overview-status { border-color: rgba(235,243,229,.16); }
.overview-values > div + div { border-color: rgba(235,243,229,.18); }
.asset-card, .analysis-card, .asset-history-panel, .transaction-list, .empty-state {
  border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: var(--shadow);
}
.asset-card { padding: 20px; min-height: 230px; }
.asset-card:hover { transform: none; border-color: #cfdbce; box-shadow: 0 5px 18px rgba(35,62,45,.06); }
.asset-card-top { min-height: 64px; }
.asset-icon { width: 46px; height: 46px; border-radius: 15px; color: #41664f; background: #edf3e9; }
.entity-card .asset-icon { background: #f7eee4; color: #a9754d; }
.financial-value { font-weight: 700; }
.asset-title-row { min-height: 54px; }
.status-tag { background: #f1f5ef; color: #667b68; }
.asset-foot { padding-top: 12px; border-top: 1px solid #f0f2ed; color: #7b887e; }
.progress-track { background: #edf0e9; height: 5px; }
.financial-section-head { margin-top: 28px; margin-bottom: 16px; }
.financial-section-head h2, .section-heading h2 { font-size: 17px; }
.status-filter.active { background: #254b40; color: #fff; border-color: #254b40; }
.transaction-list { padding: 0 20px 8px; }
.day-heading { padding-top: 20px; padding-bottom: 11px; border-color: #edf0e9; }
.day-heading h3 { color: #61715f; font-size: 12px; font-weight: 600; }
.day-heading span { color: #788475; }
.transaction-row { border-color: #f0f2ed; min-height: 80px; }
.transaction-icon { color: #637953; background: #f0f4e9; border-radius: 13px; }
.transaction-copy small { color: #7a857a; }
.transaction-row > b { font-weight: 600; letter-spacing: -.02em; }
.transaction-row .negative { color: #354c3b !important; }
.transaction-row .positive { color: #34826a !important; }
.row-more:hover { background: #eff3ed; }
.period-tabs { background: #eceedf; box-shadow: none; }
.transaction-filters { display: flex; gap: 6px; background: transparent; }
.transaction-filters button { background: #fff; border-color: var(--line); }
.period-tabs button.active, .transaction-filters button.active { background: #fff; color: #254b40; box-shadow: 0 1px 4px rgba(35,62,45,.06); }
.analysis-disclosure > summary { background: #fff; border-color: var(--line); border-radius: 15px; color: #49634d; }
.analysis-disclosure > summary > small { color: #788475; }
.legend-row:hover, .legend-row.selected { background: #f0f5ec; border-color: #d4e0ce; }
.bottom-nav { padding: 7px; border-color: #e0e7db; background: rgba(255,255,255,.97); box-shadow: 0 6px 28px rgba(34,59,39,.1); }
.bottom-nav button { min-height: 52px; color: #70806e; }
.bottom-nav button.active { color: #335b40; background: #eaf1e3; box-shadow: none; }
.empty-state { gap: 10px; padding: 28px 24px 34px; }
.empty-art { display: block; width: 180px; height: 120px; object-fit: contain; }
.empty-state p { color: #768073; line-height: 1.8; max-width: 420px; }
.empty-state strong { font-size: 16px; }
.auth-shell { max-width: 510px; margin-inline: auto; }
.auth-card { position: relative; padding: 34px; border: 1px solid var(--line); border-radius: 26px; box-shadow: 0 12px 40px rgba(35,62,45,.055); }
.auth-art { display: block; width: 150px; height: 100px; margin: -10px auto 20px; }
.auth-card h1 { font-size: 29px; letter-spacing: -.04em; }
.auth-copy { color: #6c7e70; line-height: 1.85; }
.auth-field input, .field input, .field select { background: #fcfdfa; border-color: #dee5d9; border-radius: 13px; }
.auth-field input:focus, .field input:focus, .field select:focus { border-color: #88a27b; box-shadow: 0 0 0 3px #edf3e9; }
.auth-submit { border-radius: 14px; }
.auth-footnote { color: #7c877a; }
.modal { border: 1px solid #e3e9de; border-radius: 25px; background: #fffefa; box-shadow: 0 20px 80px rgba(24,47,29,.16); }
.modal-backdrop { background: rgba(28,44,32,.3); backdrop-filter: blur(4px); }
.quick-category { color: #6f7f68; background: #f5f7f0; border-color: #e5eadf; border-radius: 15px; }
.quick-category.selected { color: #ad5833; background: #fcf0e7; border-color: #dca180; box-shadow: inset 0 0 0 1px #dca180; }
.entry-details { background: #f5f7f0; border-color: #e5eadf; }
.entry-details summary { color: #566e50; }
.asset-card, .page-heading, .legend-row, .pie-chart, .asset-history-panel, .asset-history-line, .trend-bars i { animation: none; }
@media (max-width: 480px) {
  .app-shell { padding-top: 20px; }
  .topbar { margin-bottom: 25px; }
  .overview-panel { border-radius: 21px; padding: 23px 20px 19px; }
  .overview-values strong { font-size: clamp(22px, 6.5vw, 30px); }
  .asset-card { padding: 15px; border-radius: 18px; min-height: 218px; }
  .financial-value { font-size: clamp(18px, 4.8vw, 24px); }
  .transaction-list { padding-right: 13px; padding-left: 13px; }
  .transaction-row { min-height: 78px; }
  .auth-card { padding: 26px 23px; border-radius: 23px; }
  .auth-art { width: 132px; height: 88px; margin-bottom: 16px; }
  .auth-card h1 { font-size: 27px; }
  .analysis-disclosure > summary { gap: 8px; padding: 12px; }
}
.add-record-button.secondary-add { color: #4d6651; background: #fff; border: 1px solid #dce5d7; box-shadow: none; }
/* Compact, readable data states. */
.history-compact { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px; }
.history-compact h2 { margin: 0 0 7px; font-size: 15px; }
.history-compact p { margin: 0; color: #697969; font-size: 12px; line-height: 1.8; }
.history-seed { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 14px; background: #eff4e9; color: #7e9570; }
.asset-foot, .asset-foot strong, .asset-title-row p, .financial-section-head span, .privacy-note { font-size: 12px; }
.asset-history-note, .asset-history-heading > div:first-child span, .asset-history-metric > span { font-size: 11px; color: #687a6b; }
.overview-values small, .overview-scope { font-size: 12px; }
.transaction-copy small { font-size: 12px; line-height: 1.6; }
.family-load-error { margin: 12px 0 20px; padding: 20px; border: 1px solid #e8d8b7; border-radius: 18px; background: #fffbef; color: #785b2a; font-size: 13px; }
.family-load-error p { line-height: 1.7; }
.status-filter, .period-tabs, .chart-switch, .transaction-filters button { box-shadow: none; }
@media (max-width: 480px) { .day-heading span { font-size: 11px; } .transaction-copy small { font-size: 11px; } .overview-scope { font-size: 10px; } }
/* Motion signals navigation and state changes without delaying numeric updates. */
.modal { animation-duration: .8s; animation-timing-function: cubic-bezier(.45,0,.55,1); }
.modal-exit { pointer-events: none; animation: none; }
.modal-exit .modal { animation: none; }
.quick-category { transition: background-color .2s, color .2s, border-color .2s, box-shadow .2s, transform .2s; }
.quick-category:active { transform: scale(.94); }
.quick-category.selected { animation: category-select .45s ease-out; }
.analysis-disclosure > summary::after { transition: transform .8s; }
.analysis-disclosure[open] > summary::after { transform: rotate(180deg); }
@keyframes category-select { from { transform: scale(.94); } to { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

.brand-mark img { display: block; width: 100%; height: 100%; border-radius: inherit; }
/* Keep one navigation surface across renders; move its selection instead of rebuilding it. */
.page-content { min-width: 0; overflow-anchor: none; }
.bottom-nav { isolation: isolate; }
.nav-indicator { position: absolute; z-index: -1; top: 7px; bottom: 7px; left: 7px; width: calc((100% - 14px) / 3); border-radius: 999px; background: #eaf1e3; transform: translateX(calc(var(--nav-index, 0) * 100%)); transition: transform .42s cubic-bezier(.45,0,.55,1); pointer-events: none; }
.bottom-nav button { position: relative; min-width: 0; }
.bottom-nav button.active { background: transparent; }
.bottom-nav button:active { transform: none; }

/* Wide financial rows keep names and balances easy to scan. */
.financial-list { grid-template-columns: minmax(0, 1fr); gap: 12px; }
.financial-card { display: grid; grid-template-columns: 46px minmax(0, 1fr) minmax(0, 1fr) 32px; align-items: center; gap: 18px; min-height: 120px; padding: 22px; }
.financial-info { min-width: 0; display: grid; gap: 7px; }
.financial-info h3 { margin: 0; font-size: 17px; color: var(--navy); overflow-wrap: anywhere; }
.financial-info p { margin: 0; font-size: 12px; color: #6c7d6c; overflow-wrap: anywhere; line-height: 1.5; }
.financial-info small { font-size: 11px; color: #788575; line-height: 1.5; }
.financial-balance { min-width: 0; text-align: right; }
.financial-balance > span { color: #748078; font-size: 11px; }
.financial-balance .financial-value { display: block; margin: 7px 0 0; white-space: normal; overflow-wrap: anywhere; font-size: 27px; }
.financial-card .more-button { display: grid; place-items: center; min-width: 32px; min-height: 40px; padding: 0; }
.add-entry-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 11px 16px; min-height: 43px; border: 0; border-radius: 14px; color: #fff; background: var(--orange); font-size: 13px; font-weight: 600; white-space: nowrap; box-shadow: 0 4px 10px rgba(167,80,39,.1); }
.add-entry-button .ui-icon { width: 19px; height: 19px; }
.add-entry-button:hover { background: #b9532e; }
.asset-search-toolbar { display: flex; justify-content: flex-end; margin: -7px 1px 12px; font-size: 12px; }
.detail-actions { display: flex; align-items: center; gap: 16px; }
@media (max-width: 480px) {
  .financial-card { grid-template-columns: 38px minmax(0,1fr) minmax(0,1.2fr) 24px; gap: 10px; padding: 17px 13px; min-height: 115px; }
  .financial-card .asset-icon { width: 38px; height: 38px; border-radius: 12px; }
  .financial-info h3 { font-size: 15px; }
  .financial-info p, .financial-info small { font-size: 10px; }
  .financial-balance .financial-value { font-size: clamp(18px, 5vw, 23px); }
  .financial-card .more-button { min-width: 24px; }
  .add-entry-button { padding: 10px 12px; gap: 4px; font-size: 12px; }
}
@media (max-width: 480px) {
  .topbar .brand { font-size: 12px; letter-spacing: .04em; }
  .topbar .brand-mark { flex: none; }
  .top-actions .account-chip { max-width: 90px; }
}

/* One type family and a shared hierarchy across pages, controls and charts. */
body { font-size: 14px; line-height: 1.6; }
button, input, select, textarea, svg text { font-family: inherit; }
input::placeholder, textarea::placeholder { font-family: inherit; font-weight: 400; }
.page-heading h1, .auth-card h1 { font-weight: 700; letter-spacing: -.02em; line-height: 1.3; }
.financial-section-head h2, .section-heading h2, .overview-head h2,
.asset-history-heading h2, .history-compact h2, .modal-head h2,
.financial-info h3, .asset-title-row h3 { font-weight: 600; letter-spacing: 0; line-height: 1.5; }
.overview-values strong, .financial-value, .asset-cost, .asset-history-metric strong,
.transaction-row > b, .quick-entry .amount-field input { font-weight: 700; font-variant-numeric: tabular-nums lining-nums; letter-spacing: -.015em; }
.auth-field, .field-caption, .bottom-nav button, .add-entry-button { font-weight: 600; letter-spacing: 0; }
.auth-field input, .field input, .field select { font-weight: 400; }
.overline { font-weight: 600; letter-spacing: .1em; }
