:root {
  --ink: #17191d;
  --muted: #62666d;
  --line: #e4e3e0;
  --paper: #f7f6f2;
  --red: #e62935;
  --red-dark: #bc1722;
  --night: #101114;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
body { margin: 0; color: var(--ink); background: #fff; font: 400 1rem/1.6 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button, input { font: inherit; }
:focus-visible { outline: 3px solid #fa6b73; outline-offset: 4px; }
.site-shell { width: min(100% - 3rem, 79rem); margin-inline: auto; }
.skip-link { position: absolute; z-index: 100; top: -5rem; left: 1rem; padding: .7rem 1rem; background: #fff; color: var(--ink); }
.skip-link:focus { top: 1rem; }

.site-header { position: relative; z-index: 10; background: var(--night); color: #fff; border-bottom: 1px solid #2e3034; }
.header-inner { display: flex; align-items: center; gap: 2rem; min-height: 5rem; }
.brand { display: inline-flex; flex: 0 0 auto; align-items: center; }
.brand-logo { width: 8.3rem; height: auto; }
.primary-nav { display: flex; align-items: center; justify-content: center; gap: clamp(1.2rem, 3vw, 2.7rem); margin-left: auto; font-size: .9rem; font-weight: 650; }
.primary-nav a { padding: .6rem 0; color: #d3d4d6; transition: color .2s; }
.primary-nav a:hover, .site-footer a:hover { color: #fff; }
.login-link { display: inline-flex; align-items: center; justify-content: center; min-width: 6.5rem; min-height: 2.55rem; padding: .5rem 1rem; border: 1px solid #66686b; border-radius: 4px; font-size: .88rem; font-weight: 750; transition: border-color .2s, background .2s; }
.login-link:hover { border-color: #fff; background: #282a2e; }

.expense-hero { position: relative; overflow: hidden; background: radial-gradient(circle at 75% 58%, #25282e 0, var(--night) 53%); color: #fff; }
.expense-hero::before { content: ""; position: absolute; inset: auto -10% -43% 34%; height: 80%; border: 1px solid #5b252b; border-radius: 50%; transform: rotate(-18deg); pointer-events: none; }
.expense-hero-grid { position: relative; display: grid; grid-template-columns: .84fr 1.16fr; align-items: center; gap: 2.5rem; min-height: 38rem; padding-block: 5rem; }
.expense-hero-copy { position: relative; z-index: 1; }
.eyebrow { margin: 0 0 1rem; color: var(--red); font-size: .73rem; font-weight: 800; letter-spacing: .17em; text-transform: uppercase; }
h1, h2, h3, p { text-wrap: pretty; }
.expense-hero h1 { margin: 0; font-size: clamp(3.5rem, 5.4vw, 6rem); font-weight: 800; line-height: 1.02; letter-spacing: -.06em; }
.expense-hero h1 span { color: #f24a53; }
.hero-intro { max-width: 32rem; margin: 1.6rem 0 0; color: #cbccd0; font-size: clamp(1.06rem, 1.5vw, 1.22rem); line-height: 1.65; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: .8rem; min-height: 3.2rem; padding: .75rem 1.3rem; border-radius: 4px; font-size: .9rem; font-weight: 800; transition: transform .2s, background .2s, border-color .2s; }
.button:hover { transform: translateY(-2px); }
.button::after { content: "↗"; font-size: 1.1em; }
.button-primary { background: var(--red); color: #fff; }
.button-primary:hover { background: var(--red-dark); }
.button-secondary { border: 1px solid #66686b; color: #fff; }
.button-secondary:hover { border-color: #fff; }
.hero-caption { margin: 1.5rem 0 0; color: #aeb0b5; font-size: .82rem; }
.expense-hero-visual { position: relative; z-index: 1; }
.hero-platform-preview { width: min(100%, 48rem); margin-inline: auto; filter: drop-shadow(0 2rem 3rem rgb(0 0 0 / .4)); }

.benefits-section { padding: clamp(4rem, 7vw, 7rem) 0; background: var(--paper); }
.section-heading { max-width: 41rem; }
.section-heading h2, .cards-control h2, .platform-copy h2 { margin: 0; font-size: clamp(2.3rem, 3.7vw, 4rem); font-weight: 780; line-height: 1.1; letter-spacing: -.05em; }
.section-heading h2 span, .cards-control h2 span { color: var(--red-dark); }
.section-heading > p:last-child { max-width: 32rem; margin: 1rem 0 0; color: var(--muted); font-size: 1.08rem; }
.feature-ribbon { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-top: 3rem; }
.feature-item { min-height: 14rem; padding: 1.6rem; border: 1px solid var(--line); border-radius: 5px; background: #fff; }
.feature-ribbon-icon { width: 2.8rem; height: 2.8rem; object-fit: contain; object-position: left center; }
.feature-item h3 { margin: 1.4rem 0 .4rem; font-size: 1.04rem; line-height: 1.3; }
.feature-item p { margin: 0; color: var(--muted); font-size: .9rem; }

.cards-section { padding: clamp(4rem, 7vw, 7rem) 0; }
.cards-control { display: grid; grid-template-columns: minmax(14rem, .8fr) minmax(0, 1.7fr); gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.cards-control-intro { position: sticky; top: 2rem; }
.cards-control-intro > p:not(.eyebrow) { max-width: 21rem; margin: 1.2rem 0 1.5rem; color: var(--muted); }
.text-link { color: var(--red-dark); font-size: .9rem; font-weight: 800; border-bottom: 1px solid currentColor; padding-bottom: .2rem; }
.text-link::after { content: " ↗"; }
.expense-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.expense-card { min-height: 15rem; padding: 1.5rem; border: 1px solid var(--line); border-radius: 5px; background: #fff; transition: box-shadow .2s, transform .2s; }
.expense-card:hover { transform: translateY(-3px); box-shadow: 0 1rem 2.5rem rgb(23 25 29 / .08); }
.mini-business-card { position: relative; width: 8.8rem; height: 5.35rem; overflow: hidden; padding: .7rem; border-radius: 6px; background: radial-gradient(circle at 88% 0%, #96303a, transparent 58%), linear-gradient(135deg, #303238, #151619); color: #fff; box-shadow: 0 .45rem 1rem rgb(0 0 0 / .12); }
.mini-business-card span { font-size: .72rem; font-weight: 800; }
.mini-business-card i { position: absolute; top: 2.4rem; left: .75rem; width: 1rem; height: .7rem; border-radius: 2px; background: linear-gradient(135deg, #e9d6ad, #a9916d); }
.mini-business-card strong { position: absolute; right: .65rem; bottom: .5rem; font-size: .72rem; font-style: italic; }
.expense-card h3 { margin: 1.3rem 0 .3rem; font-size: 1.1rem; }
.expense-card p { margin: 0; color: var(--muted); font-size: .9rem; }

.platform-section { overflow: hidden; background: #1b1d21; color: #fff; }
.platform-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(3rem, 8vw, 7rem); align-items: center; min-height: 32rem; padding-block: 5rem; }
.platform-art { position: relative; display: grid; place-items: center; min-height: 24rem; border-radius: 50%; background: radial-gradient(circle, #3b2229 0, #25262b 38%, transparent 70%); }
.platform-orbit { position: absolute; width: 18rem; height: 18rem; border: 1px solid #6b3a41; border-radius: 50%; }
.orbit-two { width: 25rem; height: 25rem; border-color: #3c3d42; }
.platform-art-icon { position: relative; z-index: 1; width: 8rem; height: 8rem; object-fit: contain; filter: drop-shadow(0 1rem 2rem rgb(0 0 0 / .4)); }
.platform-copy h2 span { color: #f24a53; }
.platform-copy > p:not(.eyebrow) { max-width: 31rem; margin: 1.3rem 0; color: #c6c7ca; font-size: 1.07rem; }
.platform-copy ul { display: grid; gap: .6rem; margin: 1.5rem 0 2rem; padding: 0; list-style: none; }
.platform-copy li::before { content: "✓"; margin-right: .75rem; color: #f24a53; font-weight: 900; }

.site-footer { background: var(--night); color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.4fr .7fr 1.1fr; gap: clamp(2rem, 7vw, 7rem); padding-block: 4rem; }
.brand-footer .brand-logo { width: 8.2rem; }
.footer-grid p, .footer-grid li, .footer-grid address { color: #b7b9be; font-size: .91rem; }
.footer-grid p { max-width: 17rem; }
.footer-grid h2 { margin: 0 0 1rem; font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; }
.footer-grid ul { display: grid; gap: .6rem; margin: 0; padding: 0; list-style: none; }
.footer-grid address { display: grid; gap: .6rem; font-style: normal; }
.footer-bottom { display: flex; justify-content: space-between; gap: 1rem; padding-block: 1.2rem; border-top: 1px solid #34363b; color: #9d9fa4; font-size: .8rem; }

.auth-surface { min-height: 100vh; background: radial-gradient(circle at 85% 15%, #382029, transparent 32rem), var(--night); color: #fff; }
.auth-shell { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; padding: 2rem 1rem; }
.auth-shell::before { content: "PayDNA"; margin-bottom: 1.7rem; color: #fff; font-size: 1.25rem; font-weight: 850; letter-spacing: -.04em; }
.admin-auth-surface .auth-shell::before { content: "Cardmash / Admin"; }
.auth-flash, .auth-card { width: min(100%, 28rem); }
.auth-flash-message { margin: 0 0 1rem; padding: .85rem 1rem; border: 1px solid #cbd4c7; border-radius: 5px; background: #f4fbf1; color: #264b2b; font-size: .9rem; }
.auth-flash-message-alert { border-color: #f1b7bd; background: #fff0f1; color: #9f1823; }
.auth-card { padding: clamp(1.5rem, 5vw, 2.5rem); border-radius: 6px; background: #fff; color: var(--ink); box-shadow: 0 2rem 5rem rgb(0 0 0 / .3); }
.auth-card h1 { margin: 0; font-size: 2.1rem; line-height: 1.15; letter-spacing: -.045em; }
.auth-card > p:not(.eyebrow, .auth-link) { margin: .8rem 0 0; color: var(--muted); font-size: .94rem; }
.auth-form { display: grid; gap: 1.1rem; margin-top: 1.7rem; }
.auth-form div { display: grid; gap: .35rem; }
.auth-form label { font-size: .86rem; font-weight: 750; }
.auth-form input:not([type="submit"]) { width: 100%; min-height: 2.9rem; padding: .7rem .8rem; border: 1px solid #cdd0d4; border-radius: 4px; background: #fff; color: var(--ink); }
.auth-form input:focus { border-color: var(--red); }
.auth-form input[type="submit"], .auth-card form.button_to button { min-height: 3rem; padding: .75rem 1rem; border: 0; border-radius: 4px; background: var(--red); color: #fff; font-weight: 800; cursor: pointer; }
.auth-form input[type="submit"]:hover, .auth-card form.button_to button:hover { background: var(--red-dark); }
.auth-link { margin: 1.2rem 0 0; font-size: .88rem; }
.auth-link a { color: var(--red-dark); font-weight: 750; }

.workspace { display: grid; grid-template-columns: 14rem minmax(0, 1fr); background: #f5f6f8; letter-spacing: 0; }
.workspace-sidebar { display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 2rem 1rem 1.25rem; background: #101114; color: #fff; }
.workspace-sidebar > a { padding: 0 .75rem 2rem; }
.workspace-sidebar .brand-logo { width: 10rem; }
.workspace-sidebar-links { display: grid; gap: .5rem; }
.workspace-sidebar-links a { display: flex; align-items: center; gap: .9rem; padding: .75rem 1rem; border-radius: 6px; color: #dedfe2; font-size: .875rem; font-weight: 550; }
.workspace-sidebar-links a[aria-current=page] { background: #cf1d29; color: #fff; }
.workspace-sidebar-links a:hover { background: #282a2e; }
.workspace-sidebar-links .ui-icon { filter: invert(1); }
.workspace-sidebar-company { margin-top: auto; border: 1px solid #36383d; border-radius: 6px; padding: .9rem; overflow-wrap: anywhere; }
.workspace-sidebar-company span { display: block; color: #92959c; font-size: .65rem; }
.workspace-sidebar-company strong { display: block; margin-top: .25rem; font-size: .8rem; font-weight: 550; }
.workspace-content { min-width: 0; }
.workspace-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.5rem; padding: .85rem 2rem; background: #fff; border-bottom: 1px solid #e5e8ed; color: #17191d; }
.workspace-header-label { color: #62666d; font-size: .8rem; }
.workspace-header nav { display: flex; align-items: center; gap: .75rem; font-size: .8rem; }
.workspace-header nav span { overflow-wrap: anywhere; }
.workspace-header .account-avatar { display: flex; align-items: center; justify-content: center; flex: 0 0 2.2rem; height: 2.2rem; border-radius: 50%; background: #e9ebef; font-weight: 650; }
.workspace-header button { display: flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; border: 1px solid #e0e5e9; border-radius: 6px; background: #fff; cursor: pointer; }
.workspace-header button:hover { background: #f5f6f8; }
.ui-icon { width: 1.15rem; height: 1.15rem; flex-shrink: 0; }
.workspace-main { max-width: 88rem; margin: auto; padding: 1.75rem 2rem 3rem; }
.workspace-heading { display: flex; justify-content: space-between; margin-bottom: 1.5rem; }
.workspace-heading h1 { margin: 0; font-size: 1.75rem; line-height: 1.3; overflow-wrap: anywhere; letter-spacing: 0; }
.workspace-heading p { margin: .4rem 0 0; color: var(--muted); }
.cards-filters { display: flex; align-items: end; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.5rem; }
.cards-filters div { display: grid; gap: .4rem; min-width: 0; flex: 1 1 15rem; max-width: 26rem; }
.cards-filters label { font-size: .875rem; font-weight: 650; }
.cards-filters input, .cards-filters select { min-width: 0; width: 100%; min-height: 2.75rem; padding: .55rem .7rem; border: 1px solid #bac0c6; border-radius: 4px; background: #fff; }
.cards-filters input[type=submit] { width: auto; background: var(--red-dark); color: #fff; border-color: var(--red-dark); cursor: pointer; }
.cards-filters > a { padding: .55rem 0; color: var(--red-dark); }
.cards-table-scroll { overflow-x: auto; background: #fff; border-block: 1px solid var(--line); }
.cards-table { border-collapse: collapse; width: 100%; text-align: left; font-size: .875rem; }
.cards-table th, .cards-table td { padding: .85rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.cards-table th { background: #eef0f2; font-weight: 650; white-space: nowrap; }
.card-number { color: var(--red-dark); white-space: nowrap; font-variant-numeric: tabular-nums; }
.card-status { color: #24654b; white-space: nowrap; }
.cards-empty { padding: 2rem 0; color: var(--muted); }
.cards-pagination { display: flex; align-items: center; justify-content: end; gap: 1.5rem; padding: 1rem 0; font-size: .875rem; }
.cards-pagination a, .cards-back { color: var(--red-dark); }
.cards-back { display: inline-block; margin-bottom: 1rem; }
.card-details { display: grid; grid-template-columns: minmax(8rem, 12rem) minmax(0, 1fr); gap: 1rem; border-top: 1px solid var(--line); padding-top: 1.5rem; }
.card-details dt { color: var(--muted); }
.card-details dd { margin: 0; overflow-wrap: anywhere; }
.workspace-main h2 { font-size: 1.1rem; }
.cards-table small { display: block; color: var(--muted); }
.cards-table .fetch-error, .fetch-error { color: #a8202d; }
.card-balance { white-space: nowrap; font-variant-numeric: tabular-nums; }
.dashboard-refresh { display: inline-flex; align-items: center; justify-content: center; gap: .6rem; padding: .65rem 1rem; border: 1px solid #bc1722; border-radius: 6px; background: #bc1722; color: #fff; font-size: .8rem; font-weight: 650; cursor: pointer; }
.dashboard-refresh .ui-icon { filter: invert(1); }
.dashboard-refresh:hover { background: #99131c; }
.expense-heading { align-items: center; gap: 1rem; margin-bottom: 1rem; }
.expense-navigation { display: flex; gap: 1.75rem; border-bottom: 1px solid #dfe3e7; margin-bottom: 1.5rem; font-size: .875rem; font-weight: 600; }
.expense-navigation a { padding: .75rem 0; border-bottom: 2px solid transparent; color: #62666d; }
.expense-navigation a[aria-current=page] { color: #bc1722; border-color: #bc1722; }
.expense-navigation a:hover { color: #bc1722; }
.expense-dashboard { display: grid; gap: 1.75rem; }
.balance-overview { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: 1rem; }
.balance-summary, .summary-stat { min-width: 0; padding: 1.25rem 1.5rem; border: 1px solid #e0e5e9; border-radius: 8px; background: #fff; box-shadow: 0 2px 4px rgb(23 25 29 / .025); }
.summary-icon { width: 1.15rem; height: 1.15rem; flex-shrink: 0; filter: invert(17%) sepia(85%) saturate(2559%) hue-rotate(340deg) brightness(92%) contrast(99%); }
.summary-label { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.balance-summary h2, .summary-stat h2 { margin: 0; font-size: .85rem; font-weight: 550; color: #62666d; }
.balance-summary strong, .summary-stat strong { display: block; margin: .6rem 0 .5rem; font-size: 1.5rem; font-weight: 700; line-height: 1.3; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.summary-stat strong span { color: #899198; font-size: 1rem; font-weight: 450; }
.balance-summary p, .summary-stat p { display: flex; align-items: center; gap: .5rem; margin: 0; color: #62666d; font-size: .8rem; }
.currency-label { font-size: .7rem; font-weight: 650; color: #62666d; }
.status-dot { display: inline-block; flex: 0 0 6px; width: 6px; height: 6px; border-radius: 50%; background: #247857; }
.status-dot-warning { background: #b87517; }
.balance-history, .recent-card-activity { min-width: 0; padding: 1.25rem 1.5rem; border: 1px solid #e0e5e9; border-radius: 8px; background: #fff; }
.dashboard-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.dashboard-section-heading h2 { margin: 0; font-size: 1.05rem; font-weight: 650; }
.dashboard-section-heading p { margin: .15rem 0 0; color: #62666d; font-size: .8rem; }
.period-label { color: #62666d; font-size: .8rem; white-space: nowrap; }
.balance-chart { margin-top: .75rem; }
.chart-caption { display: flex; align-items: center; justify-content: space-between; gap: 1rem; font-size: .8rem; color: #62666d; }
.chart-caption > span:first-child { display: flex; align-items: center; gap: .5rem; font-weight: 600; color: #247857; }
.balance-chart svg { width: 100%; height: 220px; margin-top: 1rem; }
.chart-empty, .dashboard-loading { display: flex; align-items: center; gap: .7rem; min-height: 12rem; justify-content: center; padding: 1.5rem; border: 1px dashed #d7dde2; border-radius: 8px; color: #62666d; font-size: .875rem; text-align: center; }
.loading-indicator { display: inline-block; flex: 0 0 12px; width: 12px; height: 12px; border: 2px solid #d9dfe4; border-top-color: #bc1722; border-radius: 50%; animation: dashboard-spin 1s linear infinite; }
@keyframes dashboard-spin { to { transform: rotate(360deg); } }
.dashboard-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); gap: 1rem; }
.dashboard-card { min-width: 0; background: #fff; border: 1px solid #e0e5e9; border-radius: 8px; padding: 1.25rem; transition: border-color .15s, box-shadow .15s; }
.dashboard-card:hover { border-color: #b8c2ca; box-shadow: 0 4px 12px rgb(23 25 29 / .045); }
.dashboard-card-top { display: flex; justify-content: space-between; align-items: center; min-height: 2.5rem; gap: 1rem; }
.dashboard-card-icon { width: 2rem; height: 2rem; object-fit: contain; opacity: .65; }
.workflow-badge { color: #62666d; background: #eff1f3; border-radius: 4px; padding: .15rem .5rem; font-size: .7rem; overflow-wrap: anywhere; }
.workflow-badge-active { color: #247857; background: #eaf5ef; }
.dashboard-card-program { margin: 1rem 0 .15rem; color: #62666d; font-size: .75rem; }
.dashboard-card-title { margin: 0; line-height: 1.4; }
.dashboard-card .card-number { display: inline-block; color: #17191d; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.05rem; font-weight: 600; white-space: normal; overflow-wrap: anywhere; }
.dashboard-card .card-number:hover { color: #bc1722; text-decoration: underline; }
.dashboard-card-owner { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; margin: 1rem 0; }
.dashboard-card-owner dt { color: #62666d; font-size: .7rem; }
.dashboard-card-owner dd { margin: .15rem 0 0; font-size: .8rem; font-weight: 550; overflow-wrap: anywhere; }
.dashboard-card-funds { min-height: 6.5rem; padding: 1rem 0; border-top: 1px solid #edf0f2; }
.dashboard-card-funds > span, .dashboard-card-funds small { display: block; color: #62666d; font-size: .75rem; }
.dashboard-card-funds strong { display: block; font-size: 1.4rem; font-weight: 650; line-height: 1.4; margin: .2rem 0; white-space: normal; overflow-wrap: anywhere; }
.dashboard-card-footer { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding-top: .8rem; border-top: 1px solid #edf0f2; min-height: 2.4rem; font-size: .8rem; }
.dashboard-card-footer a { color: #bc1722; font-weight: 600; }
.dashboard-card-footer a:hover { text-decoration: underline; }
.statement-ready { color: #247857; font-size: .7rem; }
.recent-card-activity { min-width: 0; }
.recent-card-activity .cards-table-scroll { border: 0; border-radius: 0; }
.recent-card-activity th { background: #f9fafb; color: #62666d; font-size: .75rem; }
.recent-card-activity td { font-size: .8rem; }
.transaction-amount { white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 600; }
.transaction-type { font-size: .7rem; color: #62666d; }
.transaction-credit { color: #247857; }
.dashboard-card-funds .fetch-error { color: #a8202d; }
.dashboard-card-funds .card-sync, .card-sync { display: flex; align-items: center; gap: .5rem; color: #62666d; }
@media (max-width: 42rem) {
  .workspace { display: block; }
  .workspace-sidebar { position: static; height: auto; padding: .8rem 1rem; flex-direction: row; align-items: center; justify-content: space-between; gap: 1rem; }
  .workspace-sidebar > a { padding: 0; }
  .workspace-sidebar .brand-logo { width: 6.5rem; }
  .workspace-sidebar-links { display: flex; gap: .3rem; }
  .workspace-sidebar-links a { padding: .6rem .65rem; font-size: .75rem; gap: .35rem; }
  .workspace-sidebar-company { display: none; }
  .workspace-header-label, .account-avatar { display: none !important; }
  .workspace-header { justify-content: end; min-height: 3rem; }
  .balance-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .balance-summary { grid-column: 1 / -1; }
  .summary-stat:last-child { grid-column: 1 / -1; }
  .expense-heading { align-items: stretch; }
  .balance-summary, .summary-stat { padding: 1rem; }
  .balance-history, .recent-card-activity { padding: 1rem; }
  .balance-chart { overflow-x: auto; }
  .balance-chart svg { min-width: 36rem; }
  .chart-caption { align-items: start; flex-direction: column; gap: .4rem; }
  .period-label { font-size: .7rem; }
}
@media (prefers-reduced-motion: reduce) { .loading-indicator { animation: none; } }
@media (max-width: 42rem) { .workspace-heading { flex-direction: column; gap: 1rem; } }
@media (max-width: 42rem) {
  .workspace-header { padding: .6rem 1rem; }
  .workspace-header nav { gap: .5rem; }
  .workspace-main { padding: 1.5rem 1rem; }
  .cards-filters div { max-width: none; }
}

@media (max-width: 58rem) {
  .expense-hero-grid { grid-template-columns: 1fr; gap: 1rem; padding-block: 4rem 2rem; }
  .expense-hero h1 { max-width: 42rem; }
  .expense-hero-visual { max-width: 42rem; margin-inline: auto; }
  .feature-ribbon { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cards-control { grid-template-columns: 1fr; }
  .cards-control-intro { position: static; }
  .platform-grid { gap: 2rem; }
}
@media (max-width: 42rem) {
  .site-shell { width: min(100% - 2rem, 79rem); }
  .header-inner { flex-wrap: wrap; gap: .5rem 1rem; padding-block: .8rem; }
  .brand-logo { width: 7.2rem; }
  .login-link { margin-left: auto; }
  .primary-nav { order: 3; justify-content: space-between; width: 100%; margin-left: 0; gap: .5rem; font-size: .79rem; }
  .expense-hero-grid { padding-block: 3.5rem 1.5rem; }
  .expense-hero h1 { font-size: clamp(3.3rem, 12vw, 4.5rem); }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .feature-ribbon, .expense-card-grid, .platform-grid, .footer-grid { grid-template-columns: 1fr; }
  .feature-item { min-height: 0; }
  .platform-grid { padding-block: 3.5rem; }
  .platform-art { min-height: 14rem; }
  .platform-orbit { width: 12rem; height: 12rem; }
  .orbit-two { width: 17rem; height: 17rem; }
  .platform-art-icon { width: 6rem; height: 6rem; }
  .footer-grid { gap: 2rem; padding-block: 3rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}
