/* Stage 5: actual local data, visually continuous with the stage 4 concept. */
.layout{justify-content:center;padding:18px 10px;gap:0}
.sidepanel{display:none!important}
.device-frame{margin:auto}
.preview-ribbon{color:#b3e6c8;background:#133829;border-color:#28533d}
.ribbon-dot{background:#21de8e}
.account-row .row-main small{line-height:1.4}
.app-top{padding-bottom:12px}
.info-box{border:1px solid #315144;background:#173127;border-radius:12px;padding:12px;margin-bottom:12px;color:#c4dbd0;font-size:12px;line-height:1.55}
.info-box.amber{border-color:#84683e;background:#383022;color:#ffe4b1}
.hero-subline{color:#9db5a7;font-size:11px;line-height:1.6}
.balance-unknown{color:#efc780}
.entry-action{border:1px solid #305243;border-radius:10px;padding:7px 10px;color:#b4e9cb;background:#1b3a2c;font-size:11px;min-height:32px}
.account-row .entry-action{margin-left:6px}
.entry-dialog .primary-button{margin-top:12px}
.setup-header{display:flex;align-items:center;gap:10px;margin-bottom:12px}
.setup-header .good-symbol{flex-shrink:0}
.setup-field{margin-bottom:14px}
.setup-field input{width:100%;border:1px solid #37604c;background:#132c22;color:#eef7f0;border-radius:12px;padding:12px;min-height:44px;font-size:16px}
.setup-field label{display:block;font-size:12px;font-weight:650;margin-bottom:7px}
.setup-field .tiny{display:block;margin:5px 0 0;line-height:1.5}
#setup-date{width:100%;border:1px solid #37604c;background:#132c22;color:#eef7f0;border-radius:12px;padding:12px;margin-bottom:12px;font-size:16px}
input:focus,select:focus,button:focus-visible{outline:2px solid #2eeaa0;outline-offset:2px}
.status-chip{font-size:10px;display:inline-flex;gap:5px;align-items:center;border-radius:8px;padding:4px 7px;background:#23503b;color:#79ebae;margin-top:6px}
.status-chip.pending{background:#4b3823;color:#f6cb87}
.history-row{align-items:flex-start}
.history-actions{display:flex;gap:6px;justify-content:flex-end;flex-wrap:wrap;margin-top:9px}
.history-block{border-bottom:1px solid #29483a;padding:12px 0}
.history-block:last-child{border:0}
.history-block .history-row{border:0;padding:0}
.secondary-button{display:block;text-align:center;border:1px solid #3f6350;border-radius:12px;background:#1b382c;color:#d0efdd;padding:11px 15px;width:100%;font-weight:700;font-size:12px;margin:9px 0}
.warning-bar{display:flex;align-items:center;gap:8px;color:#ffe3aa;font-size:11px;line-height:1.6}
.value-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.value-grid .card{margin-bottom:0}
.field-hint{display:block;font-size:10px;color:#b3c4bc;margin:4px 0 0}
.mono-small{font-variant-numeric:tabular-nums}
@media(max-width:850px){.layout{padding:0;display:block}.device-frame{margin:0}}

/* Frosted surfaces over a cool, softly lit background. */
:root {
  color-scheme: light;
  --bg: #e7edf7;
  --panel: #f6f9ff;
  --panel2: #e8effb;
  --panel3: #dce6f7;
  --stroke: #b8c8df;
  --text: #182640;
  --muted: #4c607d;
  --green: #235cca;
  --green2: #184ab4;
  --yellow: #80500b;
  --red: #a02f57;
  --ink: #fff;
  --radius: 23px;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(ellipse at 20% 15%, #becff9, transparent 52%),
    radial-gradient(ellipse at 75% 85%, #b8dfda, transparent 48%), #e8edf8;
}
.device-frame { width: min(520px, 100%); border-color: #ffffffab; box-shadow: 0 20px 68px #304c7d33; }
.app-shell {
  background: radial-gradient(ellipse at 12% 8%, #cfddff, transparent 55%),
    radial-gradient(ellipse at 86% 78%, #c9e8e2, transparent 57%), #eaf0fb;
}
.card, .card.good, .feature-card, .quick-actions button, .entry-dialog {
  color: var(--text);
  border: 1px solid #fff;
  background: linear-gradient(145deg, #ffffffd9, #f5f9ff9e);
  box-shadow: inset 0 1px 0 #fff, 0 5px 18px #445d8b12;
}
.tabbar {
  background: #f8fbffe0;
  border-color: #ffffffcf;
  backdrop-filter: blur(20px) saturate(145%);
  -webkit-backdrop-filter: blur(20px) saturate(145%);
}
.tab, .top-brand small, .metric-label, .eyebrow, .tiny.muted, .small.muted, .section-note, .row-main small { color: var(--muted); }
.tab.active, .finance-link, .section-title button { color: #184cb7; }
.top-logo, .tab-add-icon, .primary-button {
  background: linear-gradient(135deg, #386adc, #184bb4);
  color: #fff;
}
.avatar, .action-icon, .category-icon, .good-symbol, .feature-card span, .close-btn {
  background: #e1eaff;
  color: #244fa9;
  border-color: #c3d2f1;
}
.info-box, .info-box.amber, .status-chip.pending { background: #fff5dc; border-color: #e0c58e; color: #62420e; }
.warning-text, .warning-bar, .balance-unknown { color: #80500b; }
.danger-text, .debt, .finance-credit .metric-num, .sheet-error { color: #a02f57; }
.row-amount.in { color: #146a58; }
.history-block, .account-row, .history-row, .divider { border-color: #b8c8df80; }
.entry-action, .secondary-button { background: #e4edff; border-color: #b8c8df; color: #244fa9; }
#screen input, #screen select, .entry-dialog input, .entry-dialog select {
  color: var(--text);
  background: #ffffffd9;
  border: 1px solid #aebfdb;
  border-radius: 12px;
  padding: 11px;
  width: 100%;
  min-height: 44px;
  font-size: 16px;
}
.type-button, .income-option span { background: #e8effb; border-color: #b8c8df; color: #344969; }
.type-button.active, .income-option input:checked + span { background: #dce8ff; color: #1749a7; border-color: #7196df; }
.field-hint, .sheet-note, .empty-state { color: var(--muted); }
.finance-hero { padding: 20px; }
.finance-hero .hero-amount { font-size: clamp(30px, 8vw, 46px); letter-spacing: -.055em; overflow-wrap: anywhere; }
.finance-hero .eyebrow, .finance-goal .eyebrow { text-transform: none; letter-spacing: 0; font-weight: 650; }
.finance-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.finance-title strong:last-child { text-align: right; }
.finance-goal h2, #budget-form h2 { margin: 3px 0 8px; font-size: 18px; }
.finance-goal .goal-amount { margin-top: 9px; }
.finance-link { background: none; border: 0; padding: 7px 0; font: inherit; font-size: 12px; flex-shrink: 0; }
.finance-shortcuts button { text-align: left; min-width: 0; display: grid; gap: 5px; }
.finance-shortcuts .metric-num { overflow-wrap: anywhere; }
.finance-shortcuts .finance-credit { background: linear-gradient(145deg, #fff4f8, #f9e5efb8); }
.card.finance-goal { background: linear-gradient(145deg, #f3fffc, #d9f4ecb8); }
.finance-meter { height: 8px; border-radius: 99px; background: #bdcde375; overflow: hidden; margin: 12px 0 7px; }
.finance-meter span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #3766d0, #7199f4); }
.finance-meter.mint span { background: linear-gradient(90deg, #177967, #36aa8e); }
.finance-meter.amber span { background: #b87716; }
.finance-meter.rose span { background: #b43e65; }
.percent-row { display: flex; flex-wrap: wrap; gap: 3px 10px; }
.percent-row strong { color: var(--text); }
.budget-row { border-color: #bdcde3; }
@media (max-width: 550px) {
  .device-frame { width: 100%; height: 100dvh; border: 0; border-radius: 0; }
  .app-top { padding-top: max(16px, env(safe-area-inset-top)); }
  .tabbar { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
}

/* Daily overview: one primary action, quiet surfaces, signals on exceptions. */
.home-heading { display:flex; align-items:center; justify-content:space-between; margin:8px 2px 18px; }
.home-heading p { margin:0 0 5px; color:var(--muted); font-size:12px; }
.home-heading h1 { margin:0; font-size:27px; letter-spacing:-.04em; }
.screen .card { border:1px solid #ffffffc9; box-shadow:0 3px 12px #354d7710; }
.screen .finance-hero { background:#ffffffb8; }
.finance-hero .hero-amount { font-weight:720; font-size:38px; margin:9px 0 15px; }
.available-amount { color:#176553; }
.finance-hero .small { line-height:1.6; }
.money-actions { display:grid; grid-template-columns:1.2fr 1fr 1fr; gap:8px; margin:14px 0 25px; }
.money-actions button { min-height:46px; border-radius:15px; display:flex; align-items:center; justify-content:center; gap:7px; border:1px solid #ffffffd9; background:#ffffffa8; color:#263a57; font-size:13px; font-weight:600; box-shadow:0 2px 6px #354d7709; }
.money-actions button span { background:none; font-size:21px; line-height:1; }
.money-actions .expense-action { background:#255bc3; border-color:#255bc3; color:white; }
.money-actions button:active { opacity:.75; }
.screen .section-title { margin:25px 2px 10px; align-items:center; }
.screen .section-title h2 { font-size:17px; letter-spacing:-.02em; }
.screen .section-title button, .finance-link { min-height:36px; }
.payment-list .account-row { padding:12px 0; }
.payment-list .category-icon { width:32px; height:32px; border-radius:10px; background:#e9edf5; color:#64748b; flex-shrink:0; }
.payment-list .payment-late { background:#f9e4d3; color:#875011; }
.credit-summary { width:100%; display:flex; align-items:center; justify-content:space-between; gap:12px; text-align:left; padding:17px; color:var(--text); }
.credit-summary small { display:block; font-size:11px; color:var(--muted); margin-top:4px; }
.credit-summary>strong { font-size:17px; white-space:nowrap; }
.screen .finance-goal { background:#f0faf7c9; }
.finance-goal .goal-amount { font-size:22px; }
.expense-list { padding:0 17px; }
.dashboard-caption { color:var(--muted); font-size:11px; line-height:1.6; margin:0 2px 12px; }
.expense-category { padding:19px 0; border-bottom:1px solid #bac9df66; }
.expense-category:last-child { border-bottom:0; }
.expense-category-heading { display:flex; gap:8px; align-items:baseline; justify-content:space-between; }
.expense-category-heading h3 { font-size:14px; margin:0; font-weight:650; }
.expense-category-heading>span { font-size:10px; text-align:right; color:var(--muted); flex-shrink:0; }
.expense-category-values { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:14px; }
.expense-category-values>div:last-child { text-align:right; }
.expense-category-values span, .expense-category-values small { display:block; font-size:11px; color:var(--muted); }
.expense-category-values strong { display:block; font-size:18px; margin:4px 0; font-weight:650; letter-spacing:-.025em; }
.expense-category .finance-meter { height:6px; margin:12px 0 0; background:#dce4f0; }
.expense-category.rose .expense-category-values>div:last-child strong { color:#a02f57; }
.expense-category.amber .expense-category-values>div:last-child strong { color:#80500b; }
.budget-signal { font-size:11px; color:#80500b; margin:7px 0 0; }
.expense-category.rose .budget-signal { color:#a02f57; }
.tabbar { margin:0 8px 8px; border-radius:23px; border:1px solid #fff; box-shadow:0 5px 20px #3341550d; }
.tab { min-height:46px; }
.tab.active { background:#dce8fc; border-radius:15px; }
@media(max-width:380px) {
  .expense-category-heading { align-items:flex-start; }
  .expense-category-heading>span { max-width:100px; }
  .expense-category-values strong { font-size:16px; }
  .money-actions { gap:5px; }
}

.priority-cards {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  align-items:stretch;
  gap:10px;
  width:100%;
  min-width:0;
  margin-bottom:10px;
}
.priority-card {
  width:100%;
  max-width:100%;
  min-width:0;
  min-height:0;
  aspect-ratio:auto;
  box-sizing:border-box;
  padding:12px;
  border:1px solid #fff;
  border-radius:20px;
  display:flex;
  flex-direction:column;
  align-items:stretch;
  text-align:left;
  color:#24344c;
  box-shadow:0 5px 18px #3341550c;
}
.priority-card>* { min-width:0; max-width:100%; }
.priority-dream { background:linear-gradient(145deg,#f5fffb,#dcefe8); }
.priority-debt { background:linear-gradient(145deg,#f5f8ff,#e0e7f7); }
.priority-caption { font-size:9px; line-height:1.3; color:#53677b; margin-bottom:6px; }
.priority-name { font-size:15px; letter-spacing:-.025em; line-height:1.15; margin-bottom:0; }
.priority-value { font-size:18px; line-height:1.2; font-weight:700; letter-spacing:-.04em; margin-top:10px; white-space:normal; overflow-wrap:anywhere; }
.priority-detail { font-size:10px; line-height:1.3; color:#53677b; margin-top:3px; }
.priority-card .finance-meter { height:5px; flex-shrink:0; margin:7px 0 4px; }
.priority-percent { font-size:10px; font-weight:600; line-height:1.3; }
.priority-card:active { opacity:.8; }
.reminder-link { display:flex; align-items:center; gap:9px; width:100%; text-align:left; border:0; border-radius:12px; padding:10px 6px; background:transparent; color:#354d70; font-size:12px; }
.reminder-link small { display:block; font-size:10px; color:var(--muted); margin-top:3px; }
.reminder-link>span:last-child { margin-left:auto; }
.reminder-preview { padding:16px 0; border-bottom:1px solid var(--stroke); }
.reminder-preview p { font-size:13px; line-height:1.6; }

.monthly-progress { display:block; border-top:1px solid #90a7bc55; margin-top:10px; padding-top:9px; }
.monthly-title { display:flex; flex-wrap:wrap; justify-content:space-between; gap:4px; font-size:10px; line-height:1.3; font-weight:650; }
.monthly-title>span { color:#53677b; }
.monthly-amount { display:flex; flex-wrap:wrap; align-items:baseline; gap:2px 4px; font-size:13px; line-height:1.4; font-weight:650; margin-top:6px; overflow-wrap:anywhere; }
.monthly-amount small { font-size:10px; color:#53677b; font-weight:400; }
.monthly-progress .priority-detail { display:block; font-size:10px; line-height:1.4; }
.is-complete .monthly-title>span, .is-complete .priority-detail { color:#176553; }
@media(max-width:380px) {
  .priority-cards { gap:8px; }
  .priority-card { padding:10px; border-radius:17px; }
  .priority-name { font-size:14px; }
  .priority-value { font-size:15px; }
  .monthly-amount { font-size:12px; }
}

.income-goals { padding:16px; }
.income-goals-heading { display:flex; justify-content:space-between; align-items:baseline; margin-bottom:16px; font-size:14px; }
.income-goals-heading span, .income-goal-note { color:var(--muted); font-size:11px; }
.income-goal-row { display:flex; align-items:center; gap:12px; margin:14px 0; }
.income-goal-person { display:grid; place-items:center; flex:none; width:27px; height:27px; border-radius:9px; color:#344c70; background:#e3ebfa; font-size:12px; }
.income-goal-body { min-width:0; flex:1; }
.income-goal-values { display:flex; justify-content:space-between; flex-wrap:wrap; gap:2px 8px; color:var(--muted); font-size:11px; margin-bottom:6px; font-variant-numeric:tabular-nums; }
.income-goal-values span:first-child { color:var(--text); font-weight:650; }
.income-goal-track { height:8px; border-radius:8px; background:#dce5f1; overflow:hidden; }
.income-goal-fill { display:block; height:100%; border-radius:inherit; }
.income-goal-fill.red { background:#cf6871; }
.income-goal-fill.orange { background:#d58b5b; }
.income-goal-fill.gold { background:#c5a04d; }
.income-goal-fill.green { background:#3b9a77; }
.income-goal-note { line-height:1.5; margin:10px 0 0; }

.weekly-expense-item { border-bottom:1px solid #b8c8df80; padding-bottom:10px; }
.weekly-expense-item:last-child { border-bottom:0; }
.weekly-expense-item .account-row { border-bottom:0; }
.weekly-expense-meter { height:5px; border-radius:99px; background:#dce4f0; overflow:hidden; }
.weekly-expense-meter span { display:block; height:100%; border-radius:inherit; }
.spending-overview { padding:17px; }
.spending-overview .section-title { margin-bottom:12px; }
.spending-chart { display:grid; justify-items:center; text-align:center; }
.spending-donut { width:min(190px,65vw); aspect-ratio:1; border-radius:50%; display:grid; place-items:center; }
.spending-donut-center { width:69%; aspect-ratio:1; border-radius:50%; background:#f5f8fbdc; display:flex; flex-direction:column; justify-content:center; align-items:center; padding:7px; }
.spending-donut-center strong { font-size:17px; line-height:1.2; color:var(--text); }
.spending-donut-center small { color:var(--muted); font-size:11px; margin-top:4px; }
.spending-chart p { margin:11px 0 4px; }
.spending-breakdown h3 { font-size:13px; margin:18px 0 8px; color:var(--text); }
.spending-breakdown-row { display:grid; grid-template-columns:9px minmax(0,1fr) auto; gap:8px; align-items:center; padding:7px 0; font-size:12px; border-bottom:1px solid #b8c8df55; }
.spending-breakdown-row strong { font-size:12px; white-space:nowrap; }
.spending-dot { width:8px; height:8px; border-radius:50%; }
.spending-periods { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:5px; margin-top:18px; padding:4px; background:#dce5f080; border-radius:13px; }
.spending-periods button { border:0; border-radius:10px; background:transparent; color:var(--muted); min-height:34px; font-size:11px; font-weight:650; }
.spending-periods button[aria-pressed="true"] { background:#fff; color:var(--text); box-shadow:0 2px 8px #24385b1a; }
.feature-card span { display:grid; width:40px; height:40px; place-items:center; border-radius:12px; margin:0 0 12px; font-size:21px; }
.budget-collapse-title { display:flex; align-items:center; justify-content:space-between; gap:10px; cursor:pointer; list-style:none; }
.budget-collapse-title::-webkit-details-marker { display:none; }
.budget-collapse-title::after { content:'⌄'; color:#536b91; font-size:22px; line-height:1; flex-shrink:0; transform:rotate(-90deg); }
.budget-collapse[open] > .budget-collapse-title::after { transform:none; }
.budget-collapse-title h2 { margin:0; }
.expense-list .budget-collapse-title { padding:17px 0 8px; }
.chart-layout { display:grid; grid-template-columns:minmax(115px,190px) minmax(0,1fr); gap:14px; align-items:center; width:100%; }
.chart-layout .spending-donut { width:100%; }
.chart-legend { display:grid; gap:7px; text-align:left; min-width:0; }
.chart-legend-row { display:grid; grid-template-columns:9px minmax(0,1fr) auto; align-items:center; gap:6px; font-size:11px; color:var(--text); }
.chart-legend-row span:nth-child(2) { overflow-wrap:anywhere; }
.chart-legend-row strong { font-size:11px; }
.chart-filters { margin-top:12px; font-size:12px; color:var(--text); }
.chart-filters summary { cursor:pointer; font-weight:650; padding:8px 0; }
.chart-filter-row { display:flex; gap:9px; align-items:center; padding:7px 0; }
.chart-filter-row input { width:18px; height:18px; accent-color:#3479bf; }
@media(max-width:380px) { .chart-layout { grid-template-columns:minmax(110px,42%) minmax(0,1fr); gap:10px; } .chart-layout .spending-donut-center strong { font-size:12px; } }
#screen .chart-filter-row input { width:18px; height:18px; min-height:0; padding:0; flex-shrink:0; }
.expense-wheel { display:block; width:100%; height:auto; overflow:visible; }
.expense-wheel .chart-label { fill:#24344c; font-size:11px; font-weight:600; }
.expense-wheel .chart-label-percent { fill:#53677b; font-size:10px; }
.expense-wheel .chart-total { fill:#24344c; font-size:15px; font-weight:700; }
.expense-wheel .chart-total-caption { fill:#53677b; font-size:10px; }
#screen .chart-filter-row { justify-content:flex-start; gap:9px; min-height:36px; }
#screen .chart-filter-row input[type="checkbox"] { appearance:auto; display:inline-block; width:16px; height:16px; min-width:16px; max-width:16px; min-height:16px; max-height:16px; padding:0; margin:0; flex:0 0 16px; border:0; box-shadow:none; }
