:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --page-blue: #0649cf;
  --surface-blue: #0c3785;
  --surface-raised: #154ba5;
  --line: #d3e4ff38;
  --text: #f8faff;
  --muted: #c8d6ed;
  --green: #39d98a;
  --orange: #ffad42;
  --purple: #a38bff;
  --pink: #ff6d8e;
  --teal: #39d6d0;
  --yellow: #ffd84d;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(ellipse at 9% 0%, #8ab6ff55, transparent 34rem),
    radial-gradient(ellipse at 92% 17%, #6699ff44, transparent 38rem),
    radial-gradient(ellipse at 55% 100%, #36a5df38, transparent 45rem),
    linear-gradient(145deg, #0649cf, #0b3b9c 58%, #082e79);
  color: var(--text);
}
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

.app-shell { width: min(1120px, calc(100% - 36px)); margin: 0 auto; padding: max(22px, env(safe-area-inset-top)) max(0px, env(safe-area-inset-right)) max(42px, env(safe-area-inset-bottom)) max(0px, env(safe-area-inset-left)); }
.topbar, .brand, .save-state, .main-nav, .welcome-row, .period-control, .section-heading, .goal-progress-copy, .goal-input-row, .wallet-summary, .wallet-card-heading, .wallet-card-footer, .balance-row { display: flex; align-items: center; }
.topbar, .welcome-row, .section-heading, .goal-progress-copy { justify-content: space-between; }
.brand { gap: 10px; color: var(--text); text-decoration: none; }
.brand-lockup { display: grid; gap: 2px; }
.brand-name { font-size: 1.06rem; line-height: 1; }
.brand-tagline { color: #d8e7ff; font-size: .64rem; font-weight: 450; line-height: 1.2; }
.brand-mark { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid #ffffffc9; border-radius: 11px; background: linear-gradient(145deg, #f7fbff, #b9d1f6); color: #132d53; font-weight: 850; box-shadow: 0 4px 16px #6093df55; }
.save-state { gap: 8px; color: var(--muted); font-size: .82rem; }
.save-dot { width: 8px; height: 8px; border-radius: 50%; background: #51e09c; box-shadow: 0 0 12px #51e09c88; }
.save-dot.pending { background: #ffd064; box-shadow: 0 0 12px #ffd06488; }
.save-dot.error { background: #ff8296; box-shadow: 0 0 12px #ff829688; }
.connection-alert { margin: 12px 0 0; padding: 11px 14px; border: 1px solid #ff9aab70; border-radius: 10px; background: #7c223b88; color: #fff1f4; font-size: .82rem; line-height: 1.45; }
.demo-banner { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 12px; padding: 12px 14px; border: 1px solid #f7d88e88; border-radius: 12px; background: linear-gradient(110deg, #594019d9, #372953e8); box-shadow: 0 10px 25px #041e5848; }
.demo-banner > div { display: grid; gap: 3px; }
.demo-banner strong { color: #ffe4a1; font-size: .86rem; }
.demo-banner span { color: #fff5dc; font-size: .77rem; line-height: 1.4; }
.demo-banner .button { flex: 0 0 auto; }

.main-nav { gap: 6px; margin: 20px 0 26px; padding: 5px; border: 1px solid var(--line); border-radius: 14px; background: #dceaff12; backdrop-filter: blur(18px); overflow-x: auto; }
.nav-link { flex: 0 0 auto; padding: 9px 14px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; font-size: .9rem; }
.nav-link:hover { background: #ffffff19; color: #fff; }
.nav-link.active { background: linear-gradient(135deg, #f3f7ff, #bed2f2); color: #142b4d; font-weight: 700; box-shadow: 0 3px 14px #8db4f33d; }
.page-view { animation: view-in .22s ease-out; }
@keyframes view-in { from { opacity: .5; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; } }

.welcome-row, .page-heading { gap: 20px; margin-bottom: 16px; }
.welcome-row h1, .page-heading h1 { margin: 2px 0 5px; font-size: clamp(1.7rem, 3vw, 2.2rem); letter-spacing: -.035em; }
.welcome-row p, .page-heading p { margin-top: 0; }
.eyebrow { margin: 0 0 7px; color: #b7d0ff; font-size: .69rem; font-weight: 750; letter-spacing: .13em; }
.muted, .fine-print { color: var(--muted); }
.small { font-size: .83rem; }
.period-control { gap: 5px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: #092f76c9; backdrop-filter: blur(14px); }
.period-control button { border: 0; border-radius: 9px; padding: 8px 11px; background: transparent; color: var(--muted); cursor: pointer; }
.period-control button:hover { color: #fff; background: #ffffff19; }
.period-control button.selected { background: linear-gradient(135deg, #f3f7ff, #bed2f2); color: #142b4d; font-weight: 700; }

.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.summary-card, .surface { border: 1px solid var(--line); border-radius: 15px; background: linear-gradient(145deg, #1550a9df, #0b3478eb); box-shadow: 0 14px 40px #041e5860, inset 0 1px #ffffff16; backdrop-filter: blur(20px); }
.summary-card { display: flex; min-height: 112px; flex-direction: column; justify-content: center; padding: 17px; }
.summary-label, .summary-foot { color: var(--muted); font-size: .82rem; }
.summary-value { margin: 7px 0 4px; font-size: 1.65rem; line-height: 1.1; letter-spacing: -.035em; }
.positive { color: #9df0c2; }
.negative { color: #ffb5c3; }
.period-insight { margin: 14px 0; padding: 0; overflow: hidden; border-top: 0; }
.period-insight > summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 15px 19px; list-style: none; color: var(--text); font-size: .9rem; }
.period-insight > summary::-webkit-details-marker { display: none; }
.period-disclosure-copy { display: grid; gap: 4px; }
.period-disclosure-copy .eyebrow { margin: 0; font-size: .62rem; }
.period-disclosure-copy strong { font-size: .92rem; }
.period-disclosure-copy small { color: var(--muted); font-size: .75rem; font-weight: 400; }
.period-disclosure-action { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 8px; color: #d7e6ff; font-size: .76rem; font-weight: 650; }
.period-disclosure-action span { transition: transform .18s ease; }
.period-insight[open] > summary { border-bottom: 1px solid var(--line); background: #dceaff08; }
.period-insight[open] .period-disclosure-action span { transform: rotate(180deg); }
.period-insight-content { padding: 17px 19px 19px; }
.period-insight-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(230px, .8fr); gap: 18px; align-items: stretch; }
.period-visual { min-width: 0; padding: 14px; border: 1px solid #d5e4ff20; border-radius: 12px; background: linear-gradient(145deg, #082e6b80, #09275e99); }
.period-legend { display: flex; gap: 16px; margin-bottom: 8px; color: var(--muted); font-size: .74rem; }
.period-legend > span { display: inline-flex; align-items: center; gap: 7px; }
.period-legend-dot { width: 9px; height: 9px; border-radius: 3px; }
.income-dot { background: #64e6b1; }
.spending-dot { background: #ffba68; }
.period-chart { min-height: 174px; }
.period-chart-columns { display: flex; height: 174px; align-items: stretch; gap: 5px; }
.period-chart-column { display: flex; min-width: 0; flex: 1; flex-direction: column; justify-content: flex-end; align-items: center; }
.period-chart-bars { display: flex; width: 100%; height: 145px; align-items: flex-end; justify-content: center; gap: 4px; border-bottom: 1px solid #d5e4ff48; background: repeating-linear-gradient(to top, transparent 0, transparent calc(25% - 1px), #d5e4ff16 calc(25% - 1px), #d5e4ff16 25%); }
.period-bar { display: block; width: min(17px, 34%); min-height: 0; border-radius: 5px 5px 1px 1px; box-shadow: 0 0 13px #72adff25; transition: height .22s ease; }
.period-bar.income, .period-day-fill.income { background: linear-gradient(180deg, #7bf2c0, #27b988); }
.period-bar.spending, .period-day-fill.spending { background: linear-gradient(180deg, #ffd08b, #ff954d); }
.period-axis-label { display: block; width: 100%; padding-top: 7px; overflow: hidden; color: #cfe0ff; font-size: .68rem; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.period-chart-day { display: flex; min-height: 174px; flex-direction: column; justify-content: center; gap: 20px; padding: 8px 5px; }
.period-day-row { display: grid; grid-template-columns: minmax(90px, .45fr) minmax(0, 1fr); align-items: center; gap: 14px; }
.period-day-copy { display: flex; flex-direction: column; gap: 4px; }
.period-day-copy span { color: var(--muted); font-size: .76rem; }
.period-day-copy strong { font-size: .95rem; }
.period-day-track { height: 16px; overflow: hidden; border-radius: 99px; background: #ffffff19; }
.period-day-fill { display: block; height: 100%; min-width: 0; border-radius: inherit; transition: width .22s ease; }
.period-insight-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.period-stat { display: flex; min-width: 0; flex-direction: column; justify-content: center; gap: 6px; padding: 12px; border: 1px solid #d5e4ff22; border-radius: 11px; background: linear-gradient(145deg, #ffffff0b, #ffffff04); }
.period-stat > span { color: var(--muted); font-size: .7rem; }
.period-stat > strong { overflow-wrap: anywhere; font-size: 1rem; line-height: 1.2; }
.period-stat > small { color: #c5d9ff; font-size: .66rem; line-height: 1.35; }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(270px, .8fr); gap: 14px; align-items: start; }
.surface { padding: 19px; }
.section-heading { gap: 12px; margin-bottom: 13px; }
h2 { margin: 0; font-size: 1.12rem; letter-spacing: -.02em; }
h3 { margin: 0; font-size: .96rem; }
.section-heading .eyebrow { margin-bottom: 5px; }
.period-caption { border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; color: var(--muted); font-size: .76rem; white-space: nowrap; }
.chart-layout { display: grid; grid-template-columns: 175px minmax(180px, 1fr); align-items: center; gap: 22px; min-height: 188px; }
.donut { display: grid; width: 164px; height: 164px; place-items: center; border-radius: 50%; }
.donut-hole { display: flex; width: 111px; height: 111px; flex-direction: column; align-items: center; justify-content: center; border: 1px solid #fff3; border-radius: 50%; background: #0b3478; }
.donut-hole strong { font-size: 1.15rem; }
.donut-hole span { color: var(--muted); font-size: .76rem; }
.donut.empty-chart { background: #ffffff29; }
.chart-legend { display: grid; gap: 8px; }
.legend-row { display: flex; justify-content: space-between; gap: 10px; color: #f7faff; font-size: .83rem; }
.legend-name { display: inline-flex; align-items: center; gap: 8px; }
.swatch { width: 10px; height: 10px; flex: 0 0 auto; border-radius: 3px; }
.empty-note, .empty-cell { color: var(--muted); font-size: .86rem; }
.table-wrap { width: 100%; overflow-x: auto; margin-top: 11px; }
table { width: 100%; border-collapse: collapse; font-size: .81rem; }
th, td { padding: 10px 8px; border-top: 1px solid #ffffff2c; text-align: right; white-space: nowrap; }
th { color: #c9dcff; font-size: .73rem; font-weight: 650; }
th:first-child, td:first-child { text-align: left; }
.category-cell { min-width: 140px; white-space: normal; }
.category-sub { display: block; margin-top: 3px; color: #c5d9ff; font-size: .74rem; }
.fine-print { margin: 12px 0 0; font-size: .75rem; line-height: 1.5; }

.goal-card { align-self: start; padding: 19px; border: 1px solid #d5e4ff70; border-radius: 15px; background: linear-gradient(145deg, #0c53b8, #1468c9 68%, #354ba8); box-shadow: 0 14px 35px #041e5860, inset 0 1px #ffffff24; }
.goal-card-top { display: flex; align-items: center; gap: 9px; }
.goal-icon { display: grid; width: 29px; height: 29px; place-items: center; border-radius: 9px; background: var(--yellow); color: #764e00; }
.goal-kicker { color: #d9e8ff; font-size: .68rem; font-weight: 750; letter-spacing: .1em; }
.goal-card h2 { margin: 14px 0 5px; }
.goal-description, .goal-suggestion { margin: 0; color: #e2edff; font-size: .84rem; line-height: 1.45; }
.goal-progress-copy { gap: 8px; margin-top: 15px; font-size: .83rem; }
.goal-progress-copy span { color: #f8e796; font-weight: 700; }
.goal-progress-track { height: 8px; margin: 8px 0 11px; overflow: hidden; border-radius: 99px; background: #ffffff4d; }
.goal-progress-track div { height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #62e99e, #ffe16b); transition: width .25s ease; }
.goal-suggestion { margin-bottom: 13px; }
.button, .text-button, .icon-button { min-height: 40px; padding: 9px 15px; border: 1px solid #ffffff62; border-radius: 9px; background: linear-gradient(135deg, #f2f7ff, #b9d1f3); color: #142b4d; font-weight: 750; cursor: pointer; box-shadow: 0 5px 16px #02091640; }
.button:hover, .icon-button:hover { background: linear-gradient(135deg, #fff, #dbe8ff); }
.button-light { border-color: #f9d99788; background: linear-gradient(135deg, #f1d89e, #c89a5c); color: #321b20; }
.button-light:hover { background: linear-gradient(135deg, #ffedc5, #e3b878); }
.button-outline { border: 1px solid #b9d2fa99; background: #ffffff08; color: #f4f8ff; box-shadow: none; }
.button-outline:hover { background: #ffffff17; }
.text-button { min-height: 0; padding: 8px; background: transparent; color: #ffdf8a; }
.text-button:hover { text-decoration: underline; }
.quick-actions { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.quick-actions > div { flex: 1; }
.quick-actions .eyebrow { margin-bottom: 5px; }
.quick-actions h2 { font-size: .97rem; }

.section-block { margin-top: 14px; }
.entry-form { display: grid; grid-template-columns: 1fr 1.35fr .85fr 1fr; gap: 10px; align-items: end; }
.entry-form label, .goal-form label { display: grid; gap: 5px; color: #e1edff; font-size: .75rem; }
.description-field { grid-column: span 3; }
.form-actions { display: flex; align-items: center; gap: 8px; }
input, select { width: 100%; min-width: 0; padding: 9px 10px; border: 1px solid #c8dcff55; border-radius: 9px; outline: none; background: #0a3478; color: #fff; }
input::placeholder { color: #c0d5ff9c; }
input:focus, select:focus { border-color: #9dc2ff; box-shadow: 0 0 0 3px #6198e932; }
select option, optgroup { background: #fff; color: #17345c; }
.filters { display: flex; align-items: center; gap: 8px; }
.filters input { width: min(260px, 35vw); }
.filters select { width: auto; }
.activity-table { margin-top: 16px; }
.type-chip { display: inline-block; padding: 4px 8px; border-radius: 99px; background: #ffffff20; color: #e3edff; font-size: .72rem; }
.type-chip.income { background: #3ce29224; color: #a8f3c7; }
.type-chip.expense { background: #ffad4224; color: #ffd08d; }
.row-actions { display: flex; justify-content: flex-end; gap: 5px; }
.row-action { border: 0; border-radius: 7px; padding: 5px 8px; background: #ffffff17; color: #fff; cursor: pointer; font-size: .75rem; }
.row-action:hover { background: #ffffff30; }
.row-action.delete { color: #ffd4dc; }

.wallet-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 14px; }
.wallet-summary > div { display: flex; min-height: 91px; flex-direction: column; justify-content: center; gap: 7px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(145deg, #1550a9c5, #0b3478dd); box-shadow: inset 0 1px #ffffff12; backdrop-filter: blur(14px); }
.wallet-summary span { color: var(--muted); font-size: .8rem; }
.wallet-summary strong { font-size: 1.45rem; }
.wallet-net-worth strong { color: #a8f3c7; }
.wallet-surface { padding-bottom: 15px; overflow: hidden; }
.carousel-controls { display: flex; gap: 7px; }
.icon-button { width: 37px; min-height: 37px; padding: 0; font-size: 1.1rem; }
.wallet-holder { position: relative; padding: 16px; border: 1px solid #e8d5ad62; border-radius: 29px; background: linear-gradient(145deg, #6d4a3bd9, #38242d 38%, #221820 70%, #503044); box-shadow: inset 0 1px #fff3, inset 0 -7px 18px #09060d75, 0 24px 44px #08060c88; }
.wallet-holder::before { position: absolute; inset: 8px; border: 1px dashed #e6c8a956; border-radius: 23px; content: ""; pointer-events: none; }
.wallet-lining { position: relative; min-height: 322px; padding: 39px 18px 78px; overflow: hidden; border: 1px solid #f5e5f21c; border-radius: 20px; background: radial-gradient(ellipse at 50% 0%, #84536c75, transparent 48%), linear-gradient(145deg, #301f31, #201723 58%, #3b202f); box-shadow: inset 0 8px 18px #0c09115c, inset 0 1px #fff2; }
.wallet-lining::before { position: absolute; inset: 7px; border: 1px solid #f0d7e30c; border-radius: 15px; content: ""; pointer-events: none; }
.wallet-brand-stamp { position: absolute; top: 14px; left: 21px; z-index: 1; color: #e7d5e36b; font-size: .56rem; font-weight: 750; letter-spacing: .19em; }
.wallet-track { position: relative; z-index: 2; display: flex; align-items: center; gap: 12px; min-height: 206px; padding: 8px 3px 12px; overflow-x: auto; overscroll-behavior-inline: contain; scroll-behavior: smooth; scroll-snap-type: x mandatory; scrollbar-color: #e1c4cf75 #ffffff10; }
.wallet-empty { align-self: center; margin: auto; padding: 25px; text-align: center; }
.wallet-card { position: relative; display: flex; flex: 0 0 285px; min-height: 183px; flex-direction: column; justify-content: space-between; padding: 17px; overflow: hidden; border: 1px solid #ffffff78; border-radius: 15px; background: var(--wallet-color); box-shadow: 0 11px 22px #09060d70, inset 0 1px #ffffff75; scroll-snap-align: start; animation: card-arrive .32s ease-out both; }
.wallet-card::before { position: absolute; inset: 0; background: linear-gradient(118deg, #ffffff18, transparent 32%, #ffffff05 58%, transparent 76%); content: ""; pointer-events: none; }
.wallet-card::after { position: absolute; right: -34px; bottom: -66px; width: 160px; height: 160px; border: 1px solid #ffffff36; border-radius: 50%; content: ""; box-shadow: 0 0 0 16px #ffffff12, 0 0 0 34px #ffffff0b; pointer-events: none; }
@keyframes card-arrive { from { opacity: .35; transform: translateY(9px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.wallet-card-heading, .wallet-card-footer { position: relative; z-index: 1; justify-content: space-between; gap: 8px; }
.wallet-card-type { display: flex; align-items: center; gap: 8px; color: #ffffffdf; font-size: .76rem; }
.wallet-chip { width: 27px; height: 20px; border: 1px solid #f7e6bdad; border-radius: 5px; background: linear-gradient(135deg, #f3ddac, #ba926b); box-shadow: inset 0 1px #fff8; }
.wallet-remove { border: 1px solid #ffffff3d; border-radius: 7px; padding: 5px 7px; background: #1c111b72; color: #fff; cursor: pointer; font-size: .75rem; }
.wallet-remove:hover { background: #100b13c9; }
.wallet-card-name { position: relative; z-index: 1; overflow-wrap: anywhere; font-size: 1.05rem; font-weight: 700; }
.wallet-card-balance { position: relative; z-index: 1; font-size: 1.58rem; font-weight: 750; letter-spacing: -.035em; }
.wallet-card-footer { color: #ffffffd9; font-size: .74rem; }
.wallet-pocket-front { position: absolute; right: -1px; bottom: -1px; left: -1px; z-index: 4; height: 104px; border: 1px solid #d5aa8b65; border-radius: 0 0 19px 19px; background: linear-gradient(165deg, #744437 0%, #4b2c31 52%, #2d1d28 100%); box-shadow: 0 -8px 17px #100a144d, inset 0 1px #ffe3c345; pointer-events: none; }
.wallet-pocket-front::before { position: absolute; top: -1px; right: 12px; left: 12px; height: 1px; background: linear-gradient(90deg, transparent, #ffe1c080, transparent); content: ""; }
.wallet-pocket-stitch { position: absolute; top: 12px; right: 13px; left: 13px; height: 73px; border: 1px dashed #edc49a5e; border-bottom: 0; border-radius: 10px 10px 0 0; }
.wallet-clasp { position: absolute; top: 27px; left: 50%; display: grid; width: 38px; height: 38px; place-items: center; transform: translateX(-50%); border: 1px solid #f7e6bc; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff8dc, #c39b61 60%, #795533); box-shadow: 0 3px 8px #170c15aa, inset 0 1px #fff; }
.wallet-clasp span { width: 11px; height: 11px; border: 2px solid #593d36; border-radius: 50%; }
.account-form { grid-template-columns: 1.2fr 1.3fr 1fr auto; }
.data-backup-actions { display: flex; flex-wrap: wrap; gap: 9px; }

.goals-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); align-items: start; gap: 14px; }
.goal-detail { min-height: 260px; }
.goal-form { display: grid; gap: 12px; }
.goal-form .goal-input-row { gap: 9px; align-items: start; }
.goal-input-row label { min-width: 0; flex: 1; }
.contribution-form { grid-template-columns: 1fr 1fr auto; }

.learning-recommendation { background: linear-gradient(130deg, #0a48a2, #135ab6 65%, #354996); }
.learn-badge { display: inline-block; margin-bottom: 12px; padding: 6px 10px; border: 1px solid #ffffff45; border-radius: 999px; background: #ffffff14; color: #dce8ff; font-size: .68rem; font-weight: 750; letter-spacing: .06em; }
.learning-recommendation h2 { margin-bottom: 7px; }
.learning-recommendation p { margin: 0; max-width: 720px; line-height: 1.5; }
.compact-search { width: min(230px, 40vw); }
.learning-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.learning-tile { padding: 14px; border: 1px solid #c8dcff3d; border-radius: 12px; background: linear-gradient(145deg, #104082d9, #0b316de8); backdrop-filter: blur(14px); }
.tile-icon { display: inline-grid; width: 29px; height: 29px; place-items: center; margin-bottom: 10px; border-radius: 8px; background: #355a9e; color: #fff; }
.green-icon { background: #28735f; }
.orange-icon { background: #a76e3f; }
.purple-icon { background: #684879; }
.pink-icon { background: #8e3c56; }
.teal-icon { background: #386e73; }
.learning-tile > p { margin: 6px 0; color: #d4e3ff; font-size: .8rem; line-height: 1.5; }
details { margin-top: 11px; border-top: 1px solid #ffffff30; padding-top: 9px; }
summary { color: #fff; cursor: pointer; font-size: .8rem; font-weight: 650; }
details p { color: #d4e3ff; font-size: .79rem; line-height: 1.55; }

.news-source-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.news-card { min-width: 0; padding: 18px; border: 1px solid #c8dcff3d; border-radius: 13px; background: linear-gradient(145deg, #104082e0, #0b316ded); backdrop-filter: blur(14px); }
.news-card h2 { margin: 0 0 8px; }
.news-card p { margin: 0; color: #d4e3ff; font-size: .83rem; line-height: 1.5; }
.news-tag { display: inline-block; margin-bottom: 12px; padding: 5px 8px; border-radius: 99px; background: #315a99; color: #f5f8ff; font-size: .64rem; font-weight: 750; letter-spacing: .06em; }
.green-tag { background: #326b58; }
.orange-tag { background: #9c6037; }
.source-link { display: inline-block; margin-top: 15px; color: #fff; font-size: .82rem; font-weight: 700; text-decoration-color: #a9c7ff; text-underline-offset: 3px; }
.source-link:hover { color: #ffe16b; }
.news-note h2 { margin-bottom: 7px; }
.news-note p { margin: 0; line-height: 1.55; }
.disclaimer { margin: 20px 0 0; color: #c6d9ff; font-size: .75rem; line-height: 1.5; text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 820px) {
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .period-insight-grid { grid-template-columns: minmax(0, 1fr); }
  .overview-grid, .goals-grid { grid-template-columns: minmax(0, 1fr); }
  .entry-form, .account-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .description-field { grid-column: auto; }
  .learning-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick-actions { flex-wrap: wrap; }
  .quick-actions > div { flex-basis: 100%; }
}

@media (max-width: 560px) {
  .app-shell { width: min(100% - 24px, 1120px); padding-top: max(14px, env(safe-area-inset-top)); }
  .save-state { font-size: .72rem; }
  .main-nav { margin: 15px 0 20px; }
  .nav-link { padding: 8px 10px; font-size: .82rem; }
  .welcome-row, .page-heading { align-items: flex-start; flex-direction: column; }
  .period-control { width: 100%; justify-content: space-between; }
  .period-control button { flex: 1; padding-inline: 5px; }
  .summary-card { min-height: 101px; padding: 13px; }
  .summary-value { font-size: 1.35rem; }
  .surface { padding: 15px; }
  .quick-actions { align-items: stretch; flex-direction: column; }
  .demo-banner { align-items: stretch; flex-direction: column; }
  .demo-banner .button { align-self: flex-start; }
  .chart-layout { grid-template-columns: 1fr; justify-items: center; gap: 16px; padding: 7px 0; }
  .chart-legend { width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .legend-row { font-size: .76rem; }
  .filters { width: 100%; }
  .filters input { width: 100%; }
  .filters select { max-width: 120px; }
  .wallet-summary { gap: 7px; }
  .wallet-summary > div { min-height: 79px; padding: 11px; }
  .wallet-summary strong { font-size: 1.05rem; }
  .wallet-card { flex-basis: min(285px, 82vw); }
  .entry-form, .account-form, .contribution-form { grid-template-columns: 1fr 1fr; }
  .form-actions, .entry-form > .button { grid-column: span 2; }
  .goal-input-row { align-items: stretch; flex-direction: column; }
  .learning-grid, .news-source-grid { grid-template-columns: 1fr; }
  .compact-search { width: 100%; }
  .section-heading { align-items: flex-start; flex-wrap: wrap; }
}
