/* MyBudget web styles: one stylesheet, in the cascade order the eight former files loaded.
   Later sections intentionally refine earlier ones; add new rules to the section they belong to
   instead of appending another override file. */

/* ===== app ===== */
/* Inter, the same typeface as the Android app (SIL Open Font License, see fonts/Inter-OFL.txt). */
@font-face {
  font-family: Inter;
  src: url("fonts/Inter.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
:root {
  --ink: #172522;
  --muted: #55636c;
  --line: #dfe7e4;
  --surface: #ffffff;
  --canvas: #f3f6f5;
  --brand: #173b35;
  --brand-2: #285d52;
  --mint: #dcebe5;
  --green: #257453;
  --red: #a8473c;
  --blue: #416b8c;
  --shadow: 0 8px 24px rgba(23, 59, 53, .055);
  --radius: 16px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
  font-feature-settings: "tnum";
}
* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; min-height: 100vh; background: var(--canvas); }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.nav-icon { width: 22px; height: 22px; display: block; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, .button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid #74ad9e; outline-offset: 2px; }
.skip-link { position: fixed; z-index: 100; left: 1rem; top: -5rem; background: #fff; padding: .8rem 1rem; border-radius: 8px; }
.skip-link:focus { top: 1rem; }
.app-shell { min-height: 100vh; }
.account-identity { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 16px; padding: 12px 16px; margin-bottom: 24px; background: #eaf1f7; border-left: 4px solid #416b8c; border-radius: 10px; font-size: .88rem; }
.account-identity.joint { background: #eef3e8; border-left-color: #6d844c; }
.account-identity span { color: var(--muted); font-size: .8rem; }
.commitment-breakdown { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; border-top: 1px solid var(--line); padding-top: 18px; }
.commitment-breakdown div { display: grid; gap: 6px; }
.commitment-breakdown strong { font-size: 1.45rem; }
.commitment-breakdown small { color: var(--muted); line-height: 1.4; }
.entry-amount, .panel-figure, .overview-total, .overview-metrics strong, .commitment-breakdown strong, td { font-variant-numeric: tabular-nums; }
.schedule-editor { border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.schedule-editor summary { font-weight: 650; cursor: pointer; }
.form-save-status { color: var(--muted); font-size: .82rem; margin: 8px 0 0; }
.session-gate { max-width: 560px; margin: 12vh auto; padding: 28px; background: #fff; border-radius: 16px; line-height: 1.6; }
.export-controls { margin: 0 0 24px; padding: 20px; }
.export-controls .form-grid { align-items: end; }
.export-controls .report-actions { margin-top: 16px; }
@media (max-width: 599px) { .commitment-breakdown { grid-template-columns: 1fr; gap: 14px; } .commitment-breakdown div { grid-template-columns: 1fr auto; } .commitment-breakdown small { grid-column: 1 / -1; } }
[hidden] { display: none !important; }
.balance-explainer { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.5; }
.undo-dismiss { border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 1.5rem; line-height: 1; padding: 0 4px; }
.expense-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin-bottom: 16px; }
.expense-filters label { flex: 0 1 150px; }
.expense-filters > span { padding-bottom: 12px; font-size: .82rem; }
.filter-empty { padding: 12px; color: var(--muted); }
.pot-toggle { border: 0; background: transparent; padding: 0; text-align: left; color: inherit; font: inherit; cursor: pointer; }
.pot-toggle > span:not(.pot-art-shell) { display: inline-block; margin-left: 7px; }
.pot-toggle[aria-expanded="false"] > span:not(.pot-art-shell) { transform: rotate(-90deg); }
.entry-actions { position: relative; margin-right: 10px; }
.entry-actions > summary { list-style: none; min-width: 32px; min-height: 36px; display: grid; place-items: center; cursor: pointer; color: var(--brand); border-radius: 8px; }
.entry-actions > summary::-webkit-details-marker { display: none; }
.entry-actions[open] > summary { background: var(--mint); }
.entry-action-menu { position: absolute; right: 0; top: 100%; z-index: 15; width: 170px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: 0 8px 28px #173b3526; }
.entry-action-menu a, .entry-action-menu button { display: block; width: 100%; padding: 11px 9px; text-align: left; text-decoration: none; border: 0; border-radius: 6px; color: var(--ink); background: transparent; cursor: pointer; font-size: .85rem; }
.entry-action-menu a:hover, .entry-action-menu button:hover { background: var(--canvas); }
.movement-details { padding: 0 20px 18px; }
.movement-details > summary { width: fit-content; cursor: pointer; }
.movement-details .balance-form { margin-top: 12px; padding-inline: 0; }
.save-preview { padding: 14px; border-radius: 10px; background: #edf4f1; color: var(--brand); line-height: 1.5; font-size: .9rem; }
.month-checkboxes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.month-checkboxes label { display: flex; gap: 8px; align-items: center; min-height: 42px; }
.month-checkboxes input { width: 20px; min-height: 20px; margin: 0; }
.forecast-table { overflow-x: auto; }
.forecast-table table { width: 100%; border-collapse: collapse; }
.forecast-table caption { padding: 18px; text-align: left; color: var(--muted); }
.forecast-table th, .forecast-table td { padding: 14px 18px; border-top: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; }
.forecast-table th:first-child { text-align: left; }
.forecast-table thead { background: var(--canvas); }
.subscription-row, .subscription-head { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 18px; padding: 15px 20px; border-top: 1px solid var(--line); text-decoration: none; }
.subscription-head { color: var(--muted); }
.subscription-row small { display: block; margin-top: 4px; color: var(--muted); }
.subscription-row strong { font-variant-numeric: tabular-nums; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 232px; padding: 28px 18px; background: var(--brand); color: #f6fbf9; display: flex; flex-direction: column; z-index: 20; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 750; font-size: 1.14rem; text-decoration: none; letter-spacing: -.02em; }
.brand-mark { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: var(--brand); background: #e8f4ef; font-family: Georgia, serif; font-weight: 800; }
.desktop-nav { display: grid; gap: 8px; margin-top: 38px; }
.desktop-nav a { min-height: 58px; padding: 7px 9px; display: flex; align-items: center; gap: 11px; border-radius: 12px; color: #d6e4df; text-decoration: none; }
.nav-icon-box { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.12); border-radius: 10px; background: rgba(255,255,255,.08); font-size: 1.22rem; line-height: 1; }
.nav-copy { min-width: 0; display: grid; gap: 2px; }
.nav-copy strong { color: inherit; font-size: .91rem; font-weight: 720; }
.nav-copy small { color: #aebfba; font-size: .7rem; font-weight: 520; line-height: 1.2; }
.desktop-nav a:hover, .desktop-nav a.active { color: #fff; background: rgba(255,255,255,.12); }
.desktop-nav a:hover .nav-icon-box, .desktop-nav a.active .nav-icon-box { border-color: rgba(255,255,255,.22); background: rgba(255,255,255,.15); }
.desktop-nav a.active .nav-copy small { color: #d5e3df; }
.sidebar-user { margin-top: auto; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.14); display: grid; grid-template-columns: 34px 1fr 34px; gap: 10px; align-items: center; }
.sidebar-user small { display: block; color: #abc0ba; margin-top: 2px; }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: var(--brand); background: #cde2da; font-weight: 750; }
.icon-button { min-width: 34px; min-height: 34px; border: 0; border-radius: 9px; color: #e3eeeb; background: transparent; cursor: pointer; font-size: 1.2rem; }
.icon-button:hover { background: rgba(255,255,255,.1); }
.main-content { margin-left: 232px; padding: 38px clamp(24px, 4vw, 58px) 70px; max-width: 1540px; min-height: 100vh; }
.mobile-nav { display: none; }
.page-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 24px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 4px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2rem, 3.5vw, 2.8rem); line-height: 1.05; letter-spacing: -.035em; }
h2 { margin-bottom: 4px; font-size: 1.2rem; letter-spacing: -.02em; }
.page-header p:not(.eyebrow), .form-page header > p:last-child { margin: 8px 0 0; color: var(--muted); }
.eyebrow { margin-bottom: 7px; font-size: .72rem; font-weight: 780; letter-spacing: .13em; text-transform: uppercase; color: var(--muted); }
.month-bar { display: grid; grid-template-columns: 44px minmax(170px, 220px) 44px; align-items: center; gap: 7px; position: relative; }
.month-arrow { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-decoration: none; font-size: 1.7rem; box-shadow: 0 4px 14px rgba(23,59,53,.04); }
.month-picker { min-height: 56px; position: relative; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 6px 16px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); cursor: pointer; }
.month-picker .eyebrow { margin: 0 0 2px; font-size: .62rem; color: var(--blue); }
.month-name { font-weight: 760; }
.month-picker input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.today-link { position: absolute; top: calc(100% + 4px); left: 50%; transform: translateX(-50%); font-size: .75rem; font-weight: 700; color: var(--brand-2); }
.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 24px; }
.summary-card { min-width: 0; min-height: 145px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); display: flex; flex-direction: column; }
.summary-card > span { font-size: .86rem; color: var(--muted); font-weight: 650; }
.summary-card strong { margin: auto 0 8px; font-size: clamp(1.5rem, 2.5vw, 2.1rem); letter-spacing: -.045em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.summary-card small { color: var(--muted); }
.summary-card.income { border-top: 4px solid #4c9a75; }
.summary-card.automatic { border-top: 4px solid #7096b3; }
.summary-card.hero { background: var(--brand); color: #fff; border-color: var(--brand); }
.summary-card.hero > span, .summary-card.hero small { color: #bed3cc; }
.summary-card.hero.negative { background: #813b33; border-color: #813b33; }
.content-grid { display: grid; gap: 18px; }
.two-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.panel-header { padding: 20px 22px 16px; display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.panel-header .eyebrow { margin-bottom: 4px; }
.button { min-height: 44px; padding: 0 17px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 11px; text-decoration: none; font-weight: 720; cursor: pointer; }
.button.small { min-height: 40px; padding: 0 14px; color: var(--brand); border-color: #cddbd7; background: #f9fbfa; }
.button.primary { color: #fff; background: var(--brand); }
.button.primary:hover { background: var(--brand-2); }
.button.ghost { color: var(--brand); border-color: var(--line); background: var(--surface); }
.button.light { color: var(--brand); background: #eff7f4; border-color: rgba(255,255,255,.2); }
.button.quiet { color: var(--brand-2); border-color: var(--line); background: transparent; }
.button.quiet:hover { background: #f5f8f7; }
.button.danger { color: #fff; background: var(--red); }
.entry-list { border-top: 1px solid var(--line); }
.entry-row { min-height: 64px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 10px 18px; border-bottom: 1px solid var(--line); text-decoration: none; }
.entry-row:hover { background: #f8faf9; }
.entry-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; font-weight: 800; }
.income-icon { color: var(--green); background: #e3f2ea; }
.expense-icon { color: #8a544f; background: #f5e9e7; }
.auto-icon { color: var(--blue); background: #e6eef4; }
.entry-copy { min-width: 0; }
.entry-copy strong, .entry-copy small { display: block; overflow-wrap: anywhere; }
.entry-copy small { margin-top: 4px; color: var(--muted); }
.entry-amount { white-space: nowrap; font-variant-numeric: tabular-nums; }
.automatic-row { background: #f6f9fb; }
.panel-total { display: flex; justify-content: space-between; gap: 20px; padding: 17px 20px; background: #fafcfb; border-radius: 0 0 var(--radius) var(--radius); font-weight: 700; }
.empty-state { min-height: 110px; padding: 24px; display: grid; place-items: center; align-content: center; gap: 6px; color: var(--muted); text-align: center; }
.empty-state span { font-size: 1.5rem; }
.empty-state p { margin: 0; }
.joint-hero { padding: clamp(22px, 4vw, 34px); border-radius: 22px; background: var(--brand); color: #fff; display: grid; grid-template-columns: minmax(180px, 1.3fr) minmax(240px, 1fr) auto; gap: 32px; align-items: center; }
.joint-hero > div:first-child { display: flex; flex-direction: column; }
.joint-hero > div:first-child span { color: #bcd1ca; font-weight: 650; }
.joint-hero > div:first-child strong { margin: 5px 0; font-size: clamp(2.2rem, 5vw, 3.6rem); letter-spacing: -.055em; }
.joint-hero small { color: #bcd1ca; }
.hero-actions { display: grid; gap: 8px; justify-items: stretch; }
.hero-actions > a { color: #d8e7e2; text-align: center; font-size: .82rem; font-weight: 700; }
.contribution-list { border-left: 1px solid rgba(255,255,255,.18); padding-left: 28px; display: grid; gap: 10px; }
.contribution-list div { display: flex; justify-content: space-between; gap: 25px; }
.contribution-list span { color: #bcd1ca; }
.overview-panel { display: grid; grid-template-columns: minmax(250px, 1fr) minmax(350px, 1.45fr) auto; gap: 28px; align-items: center; padding: 28px 30px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); }
.overview-primary { min-width: 0; padding-right: 28px; border-right: 1px solid var(--line); }
.overview-primary .eyebrow { color: var(--brand-2); }
.overview-primary > span, .overview-primary > small { display: block; color: var(--muted); }
.overview-primary > span { font-weight: 650; }
.overview-primary > small { line-height: 1.45; }
.overview-total { display: block; margin: 5px 0 7px; font-size: clamp(2.2rem, 4vw, 3.25rem); line-height: 1; letter-spacing: -.055em; font-variant-numeric: tabular-nums; }
.overview-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.overview-metrics div { min-width: 0; padding: 14px; border-radius: 12px; background: #f5f8f7; }
.overview-metrics span, .overview-metrics strong { display: block; }
.overview-metrics span { min-height: 34px; color: var(--muted); font-size: .76rem; line-height: 1.25; }
.overview-metrics strong { margin-top: 6px; font-size: 1.06rem; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.joint-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.overview-actions { min-width: 142px; display: grid; gap: 7px; }
.overview-actions .button { width: 100%; white-space: nowrap; }
.overview-primary { order: 0; }
.overview-metrics { order: 1; }
.overview-actions { order: 2; }
.commitment-breakdown { order: 3; }
.overview-panel > .balance-explainer { order: 4; }
.dashboard-section { margin-top: 34px; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 14px; }
.section-heading h2 { font-size: 1.35rem; }
.section-heading .eyebrow { margin-bottom: 3px; }
.panel-figure { text-align: right; }
.panel-figure strong, .panel-figure small { display: block; }
.panel-figure strong { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.panel-figure small { margin-top: 2px; color: var(--muted); font-size: .74rem; }
.supporting-grid { display: grid; grid-template-columns: minmax(300px, .85fr) minmax(480px, 1.35fr); gap: 18px; align-items: start; margin-top: 24px; }
.text-action { color: var(--brand-2); font-size: .82rem; font-weight: 740; text-decoration: none; }
.text-action:hover { text-decoration: underline; }
.folder-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); margin: 14px 0 22px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.folder-summary div { padding: 15px 20px; display: flex; justify-content: space-between; gap: 12px; border-right: 1px solid var(--line); }
.folder-summary div:last-child { border: 0; }
.folder-summary span { color: var(--muted); }
.clickable-summary a { min-width: 0; padding: 14px 20px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 12px; border-right: 1px solid var(--line); text-decoration: none; }
.clickable-summary a:last-child { border-right: 0; }
.clickable-summary a:hover { background: #f8faf9; }
.clickable-summary a small { grid-column: 1 / -1; color: var(--muted); }
.folder-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.folder-card .entry-row { grid-template-columns: auto minmax(0, 1fr) auto auto; padding-inline: 18px; }
.folder-add { min-height: 44px; padding: 12px 18px; display: block; border-radius: 0 0 var(--radius) var(--radius); text-align: center; color: var(--brand-2); background: #fafcfb; font-size: .86rem; font-weight: 720; text-decoration: none; }
.folder-add:hover { background: #f1f6f4; }
.form-page { max-width: 780px; margin: 0 auto; }
.back-link { display: inline-block; margin-bottom: 24px; color: var(--brand-2); font-weight: 700; text-decoration: none; }
.form-page > header { margin-bottom: 22px; }
.stack-form { display: grid; gap: 18px; }
.entry-form { padding: 24px; }
.custom-expense-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.custom-expense-fields[hidden] { display: none; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
label, legend { font-weight: 680; font-size: .9rem; }
input, select, textarea { width: 100%; min-height: 48px; margin-top: 7px; padding: 10px 12px; border: 1px solid #cad6d2; border-radius: 10px; color: var(--ink); background: #fff; font-size: 1rem; }
textarea { resize: vertical; }
.password-field { display: block; position: relative; margin-top: 7px; }
.password-field input { margin-top: 0; padding-right: 54px; }
.password-toggle { position: absolute; top: 2px; right: 2px; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--brand); cursor: pointer; }
.password-toggle:hover { background: #eef3f1; }
.password-toggle svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.password-toggle .eye-slash { display: none; }
.password-toggle[aria-pressed="true"] .eye-slash { display: block; }
input:disabled, select:disabled { color: var(--muted); background: #eef2f0; }
label > small { display: block; margin-top: 5px; color: var(--muted); font-weight: 400; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.span-2 { grid-column: 1 / -1; }
.optional { color: var(--muted); font-weight: 450; }
.segmented { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.segmented label { min-height: 48px; padding: 10px 13px; display: flex; align-items: center; gap: 9px; border: 1px solid #cad6d2; border-radius: 10px; cursor: pointer; }
.segmented input, .choice-cards input { width: 19px; height: 19px; min-height: auto; margin: 0; flex: 0 0 auto; accent-color: var(--brand); }
.end-month { display: block; margin-top: 13px; max-width: 260px; }
.choice-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 8px; }
.choice-cards label { padding: 14px; display: flex; gap: 10px; align-items: flex-start; border: 1px solid #cad6d2; border-radius: 12px; cursor: pointer; }
.choice-cards strong, .choice-cards small { display: block; }
.choice-cards small { margin-top: 4px; color: var(--muted); line-height: 1.35; font-weight: 450; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 4px; }
.notice { margin-bottom: 14px; padding: 14px 17px; border: 1px solid #c7dbe5; border-radius: 12px; color: #2c556f; background: #eff6f9; }
.action-panel { margin-top: 16px; padding: 20px 24px; }
.action-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.danger-zone { margin-top: 24px; padding: 18px 22px; border: 1px solid #e3cac7; border-radius: 14px; background: #fff8f7; }
.danger-zone summary { min-height: 30px; cursor: pointer; color: #8a3830; font-weight: 750; }
.danger-zone form { max-width: 440px; display: grid; gap: 14px; }
.history-panel { overflow: hidden; }
.context-history-link { display: inline-block; margin-top: 8px; color: var(--brand-2); font-weight: 720; text-decoration: none; }
.context-history-link:hover { text-decoration: underline; }
.context-links { display: flex; flex-wrap: wrap; gap: 0; margin-top: 10px; }
.context-links a { color: var(--muted); font-size: .82rem; font-weight: 680; text-decoration: none; }
.context-links a + a { margin-left: 10px; padding-left: 10px; border-left: 1px solid #c8d1ce; }
.context-links a:hover { text-decoration: underline; }
.history-back { margin: 14px 0 0; }
.history-head, .history-row { display: grid; gap: 20px; align-items: center; padding: 15px 22px; }
.personal-history .history-head, .personal-history .history-row { grid-template-columns: minmax(160px, 1.3fr) repeat(3, minmax(110px, .8fr)) 20px; }
.joint-history .history-head, .joint-history .history-row { grid-template-columns: minmax(160px, 1.3fr) repeat(3, minmax(110px, .8fr)) 20px; }
.history-head { color: var(--muted); background: #f3f6f5; font-size: .77rem; font-weight: 760; text-transform: uppercase; letter-spacing: .06em; }
.history-row { min-height: 70px; border-top: 1px solid var(--line); text-decoration: none; }
.history-row:hover { background: #fafcfb; }
.history-month small { display: block; margin-top: 4px; color: var(--muted); }
.history-value small { display: none; color: var(--muted); font-weight: 500; }
.empty-months { border-top: 1px solid var(--line); }
.empty-months summary { padding: 16px 22px; color: var(--brand-2); cursor: pointer; font-weight: 700; }
.negative-text { color: var(--red); }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.settings-card { padding: 23px; }
.settings-card > p { color: var(--muted); }
.settings-card .panel-header { padding: 0 0 10px; }
.span-card { grid-column: 1 / -1; }
.split-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.badge { padding: 6px 10px; border-radius: 999px; color: var(--blue); background: #e8f0f5; font-size: .8rem; font-weight: 720; }
.folder-settings { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.folder-settings form { padding: 15px; border: 1px solid var(--line); border-radius: 12px; display: grid; gap: 10px; }
.pot-order-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pot-order-actions .button { padding-inline: 10px; }
.button:disabled { opacity: .45; cursor: not-allowed; }
.muted { color: var(--muted); }
.personal-pot-card.savings-pot { border-color: #b9d8cc; }
.personal-pot-card.savings-pot .panel-header { background: #f2faf6; }
.personal-income-panel { margin-top: 0; }
.password-required { border-color: #d6b96f; background: #fff8e6; color: #654b10; }
.budget-toolbar { display: flex; justify-content: flex-end; align-items: center; gap: 12px; }
.budget-toolbar label { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.budget-toolbar label > span { font-size: .78rem; font-weight: 650; }
.budget-toolbar select { width: auto; min-width: 155px; min-height: 40px; margin: 0; padding-block: 7px; font-size: .86rem; }
.entry-control { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; border-bottom: 1px solid var(--line); }
.entry-control .entry-row { border-bottom: 0; }
.payment-form { padding-right: 12px; }
.payment-badge { min-height: 32px; padding: 5px 9px; border: 1px solid #cad6d2; border-radius: 999px; color: var(--brand-2); background: #fff; cursor: pointer; font-size: .72rem; font-weight: 760; white-space: nowrap; }
.payment-badge.paid { color: #fff; border-color: var(--green); background: var(--green); }
.payment-badge.overdue { color: #8a3830; border-color: #e3aaa4; background: #fff3f1; }
.goal { padding: 12px 18px; border-top: 1px solid var(--line); background: #f7fbf9; }
.goal > div { display: flex; justify-content: space-between; gap: 10px; }
.goal progress { width: 100%; height: 10px; margin: 10px 0 4px; accent-color: var(--green); }
.goal small { color: var(--muted); }
.goal p { margin: 12px 0; line-height: 1.55; }
.restore-page .panel { padding: 24px; margin-top: 20px; }
.restore-page p, .restore-page .notice { line-height: 1.6; overflow-wrap: anywhere; }
.restore-page select { min-width: 0; width: 100%; }
.restore-page .budget-table { border-collapse: collapse; width: 100%; font-size: .85rem; }
.restore-page th, .restore-page td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; }
.restore-page th:first-child, .restore-page td:first-child { text-align: left; min-width: 150px; }
.restore-page th { background: #eef5f3; }
.balance-panel { margin-top: 0; overflow: hidden; }
.balance-form { padding: 18px 22px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; border-top: 1px solid var(--line); }
.balance-form .button { align-self: end; }
.supporting-grid .balance-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.transaction-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.transaction-list div { padding: 13px 20px; display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; border-bottom: 1px solid var(--line); }
.transaction-list small { grid-column: 1 / -1; color: var(--muted); }
.catalog-picker > input { margin-bottom: 7px; }
.catalog-picker > select { margin-top: 0; }
.quick-dialog { width: min(680px, calc(100vw - 28px)); padding: 0; border: 0; border-radius: 18px; color: var(--ink); background: #fff; box-shadow: 0 30px 90px rgba(15, 35, 30, .28); }
.quick-dialog::backdrop { background: rgba(10, 28, 24, .58); backdrop-filter: blur(3px); }
.quick-dialog form { padding: 22px; }
.dialog-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.dialog-head .icon-button { color: var(--ink); background: #eef3f1; font-size: 1.5rem; }
.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.report-actions { display: flex; justify-content: flex-end; gap: 9px; margin: -12px 0 18px; }
.report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.report-card { overflow: hidden; }
.bar-chart { padding: 8px 22px 22px; display: grid; gap: 14px; }
.bar-row { display: grid; grid-template-columns: minmax(80px, 130px) minmax(80px, 1fr) auto; gap: 12px; align-items: center; }
.bar-row > span { color: var(--muted); font-size: .83rem; }
.bar-row > div { height: 11px; overflow: hidden; border-radius: 99px; background: #e6eeeb; }
.bar-row i { display: block; height: 100%; min-width: 3px; border-radius: inherit; background: var(--green); }
.bar-row strong { font-size: .86rem; white-space: nowrap; }
.category-chart .bar-row i { background: var(--blue); }
.report-summary { margin-top: 18px; }
.report-insights { margin-top: 18px; }
.insight-list { padding: 4px 22px 18px; }
.insight-list div, .comparison div { padding: 12px 0; display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); }
.insight-list span, .comparison span { color: var(--muted); }
.comparison { padding: 4px 22px 18px; }
.activity-panel { overflow: hidden; }
.activity-row { min-height: 74px; padding: 14px 20px; display: flex; justify-content: space-between; align-items: center; gap: 16px; border-bottom: 1px solid var(--line); }
.activity-row:last-child { border-bottom: 0; }
.activity-row strong, .activity-row small { display: block; }
.activity-row small { margin-top: 5px; color: var(--muted); }
.status-pill { display: inline-block; margin-top: 7px; padding: 3px 8px; border-radius: 99px; color: var(--muted); background: #edf1ef; font-size: .72rem; font-weight: 700; }
.flash-stack { position: fixed; z-index: 50; top: 18px; right: 20px; width: min(380px, calc(100vw - 40px)); display: grid; gap: 8px; }
.flash { padding: 13px 16px; border: 1px solid #c8d9d4; border-radius: 11px; background: #fff; box-shadow: var(--shadow); }
.flash.success { border-left: 4px solid var(--green); }
.flash.error { border-left: 4px solid var(--red); }
.flash.warning { border-left: 4px solid #b5802b; }
.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, 520px) 1fr; }
.login-panel { padding: clamp(28px, 7vw, 80px); display: flex; flex-direction: column; justify-content: center; background: #fff; }
.brand.login-brand { position: absolute; top: 34px; color: var(--brand); }
.login-copy { margin-bottom: 28px; }
.login-copy h1 { font-size: clamp(2.5rem, 5vw, 3.6rem); }
.login-copy > p:last-child { max-width: 390px; color: var(--muted); line-height: 1.55; }
.login-panel .stack-form { max-width: 390px; }
.remember-row { display: flex; align-items: flex-start; gap: 10px; color: var(--muted); font-size: .88rem; line-height: 1.35; }
.remember-row input[type="checkbox"] { width: 18px; height: 18px; min-height: 18px; margin: 1px 0 0; padding: 0; flex: 0 0 auto; border-radius: 4px; accent-color: var(--green); }
.secure-note { margin: 24px 0 0; color: var(--muted); font-size: .86rem; }
.secure-note span { color: var(--green); }
.login-visual { padding: 8vw; display: grid; place-items: center; background: radial-gradient(circle at 30% 20%, #3e7165 0, var(--brand) 56%); }
.login-art { display: block; width: min(360px, 70%); height: auto; border-radius: 24%; box-shadow: 0 28px 70px rgba(0,0,0,.22); }

@media (max-width: 1199px) {
  .folder-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-panel { grid-template-columns: minmax(240px, 1fr) minmax(340px, 1.5fr); }
  .overview-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; }
  .overview-actions .button { width: auto; }
  .joint-hero { grid-template-columns: minmax(180px, 1fr) minmax(230px, 1fr); }
  .joint-hero .button { grid-column: 1 / -1; justify-self: start; }
}
@media (max-width: 899px) {
  .sidebar { width: 88px; padding-inline: 15px; align-items: center; }
  .sidebar .brand > span:last-child, .nav-copy { display: none; }
  .desktop-nav a { justify-content: center; width: 56px; min-height: 56px; padding: 0; }
  .nav-icon-box { width: 42px; height: 42px; flex-basis: 42px; }
  .sidebar-user { grid-template-columns: 34px; }
  .sidebar-user > div:nth-child(2), .sidebar-user form { display: none; }
  .main-content { margin-left: 88px; padding-inline: 28px; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-panel { grid-template-columns: 1fr; gap: 18px; }
  .overview-primary { padding: 0 0 20px; border-right: 0; border-bottom: 1px solid var(--line); }
  .overview-actions { grid-column: auto; }
  .supporting-grid { grid-template-columns: 1fr; }
  .joint-hero { grid-template-columns: 1fr 1fr; }
  .folder-grid { grid-template-columns: 1fr; }
  .folder-settings { grid-template-columns: 1fr; }
  .login-page { grid-template-columns: 1fr; }
  .login-visual { display: none; }
}
.forecast-scroll-hint { display: none; }
@media (max-width: 599px) {
  .forecast-scroll-hint { display: block; font-size: .85rem; }
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .sidebar { display: none; }
  .main-content { margin: 0; padding: 24px 14px 28px; }
  .mobile-nav { position: fixed; z-index: 30; display: grid; grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); left: 0; right: 0; bottom: 0; min-height: 64px; padding-bottom: env(safe-area-inset-bottom); border-top: 1px solid var(--line); background: rgba(255,255,255,.97); box-shadow: 0 -8px 24px rgba(23,59,53,.07); }
  .mobile-nav a { min-width: 0; min-height: 62px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px; color: var(--muted); text-decoration: none; }
  .mobile-nav-icon { font-size: 1.25rem; line-height: 1; }
  .mobile-nav a small { font-size: .69rem; font-weight: 650; }
  .mobile-nav a.active { color: var(--brand); }
  .page-header { align-items: flex-start; flex-direction: column; margin-bottom: 20px; }
  .page-header > div:first-child { width: 100%; }
  h1 { font-size: 2rem; }
  .month-bar { width: 100%; grid-template-columns: 44px 1fr 44px; }
  .overview-panel { padding: 20px 18px; border-radius: 16px; }
  .overview-total { font-size: 2.35rem; }
  .overview-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-metrics div:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .overview-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .overview-actions .button { width: 100%; padding-inline: 10px; }
  .dashboard-section { margin-top: 28px; }
  .section-heading { align-items: stretch; flex-direction: column; gap: 12px; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .summary-card { min-height: 116px; padding: 15px; border-radius: 14px; }
  .summary-card strong { font-size: clamp(1.3rem, 6.6vw, 1.7rem); }
  .summary-card small { font-size: .74rem; }
  .two-column { grid-template-columns: 1fr; }
  .panel-header { padding: 17px 16px 13px; }
  .entry-row { padding-inline: 14px; gap: 9px; }
  .entry-icon { width: 30px; height: 30px; }
  .joint-hero { grid-template-columns: 1fr; gap: 22px; padding: 22px; }
  .joint-hero .button { grid-column: auto; width: 100%; }
  .contribution-list { padding: 18px 0 0; border-left: 0; border-top: 1px solid rgba(255,255,255,.18); }
  .folder-summary { grid-template-columns: 1fr; }
  .folder-summary div, .clickable-summary a { border-right: 0; border-bottom: 1px solid var(--line); }
  .folder-summary div:last-child, .clickable-summary a:last-child { border-bottom: 0; }
  .folder-card .entry-row { padding-inline: 15px; }
  .form-page { width: 100%; }
  .entry-form { padding: 18px 15px; }
  .custom-expense-fields { grid-template-columns: 1fr; }
  .form-grid, .choice-cards, .settings-grid, .split-grid { grid-template-columns: 1fr; }
  .span-2, .span-card { grid-column: auto; }
  .form-actions { position: sticky; bottom: 74px; z-index: 5; margin-inline: -15px; padding: 12px 15px calc(12px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.97); box-shadow: 0 -7px 18px rgba(23,59,53,.08); }
  .form-actions .button { flex: 1; }
  .action-row, .action-row form, .action-row .button { width: 100%; }
  .history-head { display: none; }
  .personal-history .history-row, .joint-history .history-row { grid-template-columns: minmax(0, 1fr) auto 18px; gap: 12px; padding: 14px 16px; }
  .history-value { text-align: right; }
  .history-value small { display: block; }
  .personal-history .history-value:nth-of-type(2), .personal-history .history-value:nth-of-type(3), .joint-history .history-value:nth-of-type(n+3) { display: none; }
  .settings-card { padding: 18px 16px; }
  .budget-toolbar { align-items: stretch; flex-wrap: wrap; }
  .budget-toolbar form, .budget-toolbar label { width: 100%; }
  .budget-toolbar select { width: 100%; }
  .budget-toolbar .button { flex: 1; }
  .entry-control { grid-template-columns: 1fr; }
  .entry-actions { margin: -42px 10px 8px auto; }
  .payment-form { padding: 0 14px 10px 56px; }
  .payment-badge { width: auto; }
  .balance-form, .supporting-grid .balance-form, .transaction-list, .report-grid { grid-template-columns: 1fr; }
  .quick-grid { grid-template-columns: 1fr; }
  .report-actions { justify-content: stretch; }
  .report-actions .button { flex: 1; }
  .bar-row { grid-template-columns: minmax(72px, 100px) minmax(60px, 1fr) auto; gap: 8px; }
  .flash-stack { top: 10px; right: 10px; width: calc(100vw - 20px); }
  .login-page { min-height: calc(100vh - 68px); }
  .login-panel { padding: 95px 24px 40px; justify-content: flex-start; }
  .brand.login-brand { top: 28px; }
}
@media (max-width: 360px) {
  .main-content { padding-inline: 10px; }
  .summary-card { padding: 13px 11px; }
  .summary-card > span { font-size: .77rem; }
  .summary-card strong { font-size: 1.25rem; }
  .month-picker { padding-inline: 8px; }
  .month-name { font-size: .92rem; }
  .entry-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .entry-row > span:last-child { display: none; }
  .entry-row .entry-amount { font-size: .9rem; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }

/* Private rental and tax ledger */
.account-identity.rental { background: #f5eee4; border-left-color: #a56a32; }
.tax-year-picker { min-width: 150px; }
.tax-year-picker label { display: grid; gap: 6px; color: var(--muted); font-size: .78rem; font-weight: 750; }
.tax-year-picker select { min-height: 44px; padding: 0 38px 0 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--ink); font-weight: 750; }
.rental-hero { margin-bottom: 16px; padding: 22px 24px; display: flex; justify-content: space-between; align-items: center; gap: 20px; border-radius: 18px; background: #604024; color: #fff; }
.rental-hero > div { display: grid; }
.rental-hero span, .rental-hero small { color: #ead9c8; }
.rental-hero strong { font-size: 2rem; letter-spacing: -.04em; }
.rental-export-actions { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.rental-documents { margin-top:20px; padding:20px; }
.rental-documents > p { margin:4px 0 16px; color:var(--muted, #64748b); }
.rental-document-form { display:flex; flex-wrap:wrap; align-items:end; gap:12px; }
.rental-document-form label { display:grid; gap:5px; min-width:180px; flex:1; }
.rental-document-list { margin-top:18px; border-top:1px solid #dce8e3; }
.rental-document-row { display:flex; flex-wrap:wrap; align-items:center; gap:12px; padding:10px 0; border-bottom:1px solid #dce8e3; }
.rental-document-row a { min-width:0; flex:1; overflow-wrap:anywhere; }
.rental-document-row span { color:var(--muted, #64748b); }
.rental-summary .summary-card:nth-child(1) { border-top: 4px solid var(--green); }
.rental-summary .summary-card:nth-child(2) { border-top: 4px solid #b76b42; }
.rental-summary .summary-card:nth-child(3) { border-top: 4px solid var(--blue); }
.rental-summary .summary-card:nth-child(4) { border-top: 4px solid #80649c; }
.rental-breakdown { margin: -10px 0 24px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.rental-breakdown div { padding: 15px 18px; border-right: 1px solid var(--line); }
.rental-breakdown div:last-child { border-right: 0; }
.rental-breakdown span, .rental-breakdown strong { display: block; }
.rental-breakdown span { color: var(--muted); font-size: .78rem; font-weight: 650; }
.rental-breakdown strong { margin-top: 3px; font-size: 1.08rem; }
.rental-table-wrap { overflow-x: auto; border-top: 1px solid var(--line); }
.rental-table { width: 100%; min-width: 820px; border-collapse: collapse; }
.rental-table th, .rental-table td { padding: 14px 17px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.rental-table th { color: var(--muted); background: #f8faf9; font-size: .7rem; letter-spacing: .07em; text-transform: uppercase; }
.rental-table td { font-size: .86rem; }
.rental-table td strong, .rental-table td small { display: block; }
.rental-table td small { max-width: 300px; margin-top: 3px; color: var(--muted); }
.rental-table .numeric { text-align: right; white-space: nowrap; }
.rental-amount { font-weight: 780; }
.rental-amount.income { color: var(--green); }
.rental-amount.expense { color: #995337; }
.rental-pill { display: inline-flex; padding: 4px 8px; border-radius: 999px; font-size: .72rem; font-weight: 750; }
.rental-pill.income { color: #195e42; background: #e3f2ea; }
.rental-pill.expense { color: #85442f; background: #f9e9e1; }
.row-link { color: var(--brand-2); font-weight: 750; }
.rental-empty { padding: 58px 24px; text-align: center; }
.rental-empty > span { font-size: 2.2rem; }
.rental-empty h2 { margin-top: 8px; }
.rental-empty p { margin-bottom: 18px; color: var(--muted); }
.rental-disclaimer { max-width: 900px; margin: 15px 3px; color: var(--muted); font-size: .78rem; line-height: 1.5; }
.currency-field { margin-top: 6px; display: flex; }
.currency-field span { width: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-right: 0; border-radius: 9px 0 0 9px; background: var(--canvas); font-weight: 800; }
.currency-field input { margin: 0; border-radius: 0 9px 9px 0; }

@media (max-width: 720px) {
  .rental-header { gap: 18px; }
  .tax-year-picker { width: 100%; }
  .tax-year-picker select { width: 100%; }
  .rental-hero { align-items: stretch; flex-direction: column; }
  .rental-hero .button { width: 100%; }
  .rental-breakdown { grid-template-columns: 1fr; }
  .rental-breakdown div { border-right: 0; border-bottom: 1px solid var(--line); }
  .rental-breakdown div:last-child { border-bottom: 0; }
}

/* ===== cards ===== */
.card-layout-toolbar { display:flex; flex-wrap:wrap; align-items:center; gap:12px 20px; margin:20px 0 16px; }
.card-layout-toolbar>div { flex:1; min-width:220px; }
.card-layout-toolbar strong,.card-layout-toolbar span { display:block; }
.card-layout-toolbar strong { font-size:.9rem; }
.card-layout-toolbar span { color:var(--muted); font-size:.78rem; margin-top:5px; }
.card-layout-status { flex-basis:100%; min-height:1em; }
.card-board { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:24px; align-items:start; }
.dashboard-card { border-radius:20px; border:1px solid #d3e1db; background:#fff; box-shadow:0 9px 26px #173b350d; min-width:0; transition:box-shadow .16s,border-color .16s; }
.dashboard-card:hover { border-color:#a6c4b7; box-shadow:0 12px 30px #173b3517; }
.card-arrange { display:flex; gap:4px; align-items:center; padding:8px 12px; border-bottom:1px solid #e8eeeb; border-radius:20px 20px 0 0; background:#f7faf8; }
.card-arrange button { border:0; background:transparent; color:#59736a; min-width:36px; min-height:34px; border-radius:7px; cursor:pointer; }
.card-arrange button:hover { background:#e2eee8; color:#173b35; }
.card-arrange .card-handle { margin-right:auto; padding:0 9px; cursor:grab; touch-action:none; font-size:.76rem; font-weight:650; }
.card-handle:active { cursor:grabbing; }
.card-moving { border:2px dashed #32755c; opacity:.45; }
.card-drag-active { user-select:none; cursor:grabbing; }
.card-drag-label { position:fixed; z-index:200; pointer-events:none; max-width:260px; padding:15px 22px; background:#173b35; color:white; border-radius:12px; box-shadow:0 15px 35px #173b3544; }
.dashboard-card .panel-header { gap:12px; flex-wrap:wrap; padding:20px; }
.dashboard-card .entry-control { grid-template-columns:minmax(0,1fr) auto; }
.dashboard-card .entry-control>.entry-row { grid-column:1/-1; }
.dashboard-card .payment-form { padding:0 0 10px 62px; }
.dashboard-card .entry-actions { margin:0 12px 10px auto; }
.dashboard-card .entry-copy small { line-height:1.5; }
.dashboard-card .entry-list[data-pot-content] { max-height:520px; overflow-y:auto; scrollbar-width:thin; }
.dashboard-card .entry-list[data-pot-content].pot-content-animating { overflow:hidden!important; max-height:none; will-change:height,opacity; }
.dashboard-card:has(.entry-actions[open]) { position:relative; z-index:40; overflow:visible; }
.dashboard-card .entry-list[data-pot-content]:has(.entry-actions[open]) { max-height:none; overflow:visible; }
.dashboard-card:has(.entry-actions[open]) .entry-action-menu { z-index:50; width:max-content; min-width:210px; max-width:min(270px,calc(100vw - 36px)); box-shadow:0 15px 38px #173b3540; }
.dashboard-card .folder-add { border-radius:0 0 20px 20px; }
.dashboard-card.savings-pot>p { padding:0 20px; }
.dashboard-card .balance-form { grid-template-columns:repeat(2,minmax(0,1fr)); }
.personal-overview { grid-template-columns:1.1fr 1fr; align-items:start; gap:22px; }
.personal-overview .overview-primary { grid-column:1; grid-row:1; padding:22px; border-radius:14px; background:#edf5f0; }
.personal-overview .overview-metrics { grid-column:2; grid-row:1; height:100%; align-content:center; }
.personal-overview .commitment-breakdown { grid-column:1/-1; grid-row:2; padding-top:20px; }
.personal-overview .overview-actions { grid-column:1/-1; grid-row:3; display:flex; justify-content:flex-start; }
.personal-overview .balance-explainer { grid-row:4; }
@media(min-width:1800px) { .main-content { max-width:1900px; } .card-board { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media(max-width:1100px) { .card-board { grid-template-columns:1fr; } }
@media(max-width:700px) {
 .personal-overview { grid-template-columns:1fr; padding:18px; }
 .personal-overview .overview-primary,.personal-overview .overview-metrics,.personal-overview .commitment-breakdown,.personal-overview .overview-actions,.personal-overview .balance-explainer { grid-column:1; grid-row:auto; }
 .personal-overview .commitment-breakdown { grid-template-columns:1fr; }
 .card-board { gap:18px; }
 .dashboard-card .balance-form { grid-template-columns:1fr; }
 .dashboard-card .entry-list[data-pot-content] { max-height:none; }
 .card-arrange button { min-height:42px; min-width:42px; }
}
@media(prefers-reduced-motion:reduce) { .dashboard-card { transition:none; } .pot-content-animating { will-change:auto!important; } }
.joint-workspace .dashboard-card .entry-control { grid-template-columns:minmax(0,1fr) auto auto auto; }
.joint-workspace .dashboard-card .entry-control>.entry-row { grid-column:1/-1; }
.joint-workspace .dashboard-card .funding-form { padding:0 0 8px 12px; }
.joint-workspace .dashboard-card .payment-form { padding:0 0 8px 0; }
.joint-workspace .dashboard-card .automatic-badge { margin:0 0 8px 0; }
.joint-workspace .dashboard-card .entry-actions { margin:0 8px 8px auto; }
@container(max-width:420px) {
 .joint-workspace .dashboard-card .entry-control { grid-template-columns:minmax(0,1fr) auto auto; }
 .joint-workspace .dashboard-card .funding-form { padding-left:12px; }
 .joint-workspace .dashboard-card .entry-actions { grid-column:3; }
}
.card-board { grid-auto-rows:1px; gap:20px; }
.dashboard-backup { margin:0 0 16px; padding:10px 14px; border:1px solid #d3e1db; border-radius:10px; background:#f2f8f4; font-size:.78rem; color:#275744; }
.dashboard-backup.warning { background:#fff8e9; border-color:#ead5a6; color:#785418; }
.dashboard-backup summary { cursor:pointer; }
.dashboard-backup summary span { display:inline-block; margin-left:14px; }
.dashboard-backup>div { margin-top:10px; max-width:850px; line-height:1.5; }
.dashboard-backup p { margin:6px 0; }
@media(max-width:700px) { .dashboard-backup summary span { display:block; margin:6px 0 0; } }
.quick-edit-dialog { width:min(520px,calc(100vw - 32px)); max-height:90vh; overflow:auto; border:1px solid #d3e1db; border-radius:18px; padding:24px; color:var(--ink); }
.quick-edit-dialog::backdrop { background:#173b3577; }
.quick-edit-fields { display:grid; gap:14px; }
.quick-edit-fields[hidden],.quick-edit-scope[hidden] { display:none; }
.quick-edit-error { color:#a32727; }
.quick-edit-error:empty { display:none; }
.quick-edit-dialog .form-actions { flex-wrap:wrap; }
/* Dialog actions must stay in normal flow, not use the page's sticky footer. */
dialog .form-actions { position:static; margin-inline:0; bottom:auto; padding:12px 0 0; box-shadow:none; background:none; }
.quick-edit-dialog,.quick-dialog { max-height:calc(100dvh - 24px); overflow-y:auto; overscroll-behavior:contain; }
@media(max-width:599px) {
 .quick-edit-dialog { padding:18px; }
 dialog input,dialog select,dialog textarea { font-size:16px; }
 dialog .form-actions { display:flex; flex-wrap:wrap; gap:8px; }
 dialog .form-actions .button { min-height:44px; }
 .payment-badge,.entry-actions>summary,.pot-toggle { min-height:44px; }
 .entry-actions>summary { min-width:44px; display:grid; place-items:center; }
}
.card-board:not(.is-arranging) .card-arrange { display:none; }
.card-layout-toolbar { justify-content:flex-end; margin:12px 0; }
.card-layout-toolbar [hidden],.card-layout-status:empty { display:none; }
.card-layout-status { flex-basis:auto; min-height:0; }
.dashboard-card { container-type:inline-size; }
.dashboard-card .panel-header { padding:16px; }
.dashboard-card .empty-state { padding:20px 16px; }
.dashboard-card .entry-control { grid-template-columns:minmax(0,1fr) auto auto; }
.dashboard-card .entry-control>.entry-row { grid-column:auto; padding:8px 10px; gap:8px; min-height:62px; }
.dashboard-card .entry-icon { width:30px; height:30px; font-size:1rem; }
.dashboard-card .entry-copy { overflow-wrap:anywhere; }
.dashboard-card .entry-copy small { font-size:.7rem; line-height:1.3; }
.dashboard-card .entry-copy strong { font-size:.88rem; }
.dashboard-card .payment-form { padding:0; }
.dashboard-card .entry-actions { margin:0 6px; }
@container(max-width:420px) {
 .dashboard-card .entry-control { grid-template-columns:minmax(0,1fr) auto; }
 .dashboard-card .entry-control>.entry-row { grid-column:1/-1; }
 .dashboard-card .payment-form { padding:0 0 8px 48px; }
 .dashboard-card .entry-actions { margin-bottom:8px; }
}
.personal-overview { grid-template-columns:minmax(220px,1fr) minmax(260px,1fr) auto; gap:12px 24px; padding:18px 22px; }
.personal-overview .overview-primary { padding:0; background:none; border:0; }
.personal-overview .overview-primary .eyebrow,.personal-overview .overview-primary>small { display:none; }
.personal-overview .overview-total { font-size:2.4rem; margin:6px 0 0; }
.summary-headlines { grid-column:2; grid-row:1; display:grid; grid-template-columns:1fr 1fr; gap:20px; }
.summary-headlines span,.summary-headlines strong { display:block; }
.summary-headlines span { font-size:.8rem; color:var(--muted); }
.summary-headlines strong { font-size:1.35rem; margin-top:6px; }
.personal-overview .overview-actions { grid-column:3; grid-row:1; align-self:center; }
.personal-overview .overview-actions .button { flex:none; width:auto; }
.summary-details { grid-column:1/-1; grid-row:2; font-size:.82rem; }
.summary-details>summary { cursor:pointer; color:var(--muted); padding:4px 0; }
.personal-overview .summary-details .overview-metrics { height:auto; margin-top:14px; }
.personal-overview .summary-details .commitment-breakdown { padding-top:14px; }
.summary-details .balance-explainer { margin-bottom:0; }
@media(max-width:1100px) {
 .personal-overview { grid-template-columns:1fr 1fr; }
 .personal-overview .overview-actions { grid-column:1/-1; grid-row:2; }
 .summary-details { grid-row:3; }
}
@media(max-width:700px) {
 .personal-overview { grid-template-columns:1fr; }
 .personal-overview .overview-primary { grid-row:1; }
 .summary-headlines { grid-column:1; grid-row:2; }
 .personal-overview .overview-actions { grid-row:3; flex-wrap:wrap; }
 .summary-details { grid-row:4; }
}
.compact-income { display:flex; flex-wrap:wrap; align-items:center; gap:12px 20px; padding:14px 0; margin:0 0 20px; border-bottom:1px solid #d3e1db; }
.compact-income .panel-header { padding:0; border:0; gap:16px; flex-shrink:0; }
.compact-income h2 { font-size:1rem; margin:0; }
.compact-income .entry-list { display:flex; flex:1; flex-wrap:wrap; gap:8px; min-width:0; }
.compact-income .entry-row { flex:1 1 220px; padding:10px 12px; border:1px solid #dfe8e3; border-radius:10px; background:#fff; gap:10px; }
.compact-income .entry-icon { width:30px; height:30px; font-size:1rem; }
.compact-income .entry-copy small { font-size:.72rem; }
.compact-income .panel-total { padding:0; border:0; background:none; display:flex; flex-direction:column; gap:4px; font-size:.8rem; }
.compact-income .panel-total strong { font-size:1rem; }
@media(max-width:700px) { .compact-income .entry-list { flex-basis:100%; } .compact-income .panel-header { width:100%; justify-content:space-between; } }

/* ===== modern ===== */
/* MyBudget: the approved pastel design, layered over existing behaviour. */
.automatic-badge { color:#356998; background:#eaf4ff; padding:8px; border-radius:10px; font-size:.7rem; margin-right:5px; }
.funding-badge { min-height:32px; padding:5px 9px; border:1px solid var(--line); border-radius:999px; color:var(--muted); background:var(--surface, #fff); cursor:pointer; font-size:.72rem; font-weight:760; white-space:nowrap; }
.funding-badge.funded { color:#135f49; background:#e1f7ed; border-color:#9bd8bb; }
.funding-badge:hover { border-color:var(--brand-2); }
.folder-header-actions { display:flex; align-items:flex-end; flex-direction:column; gap:7px; min-width:0; max-width:100%; }
.folder-header-actions .panel-figure { text-align:right; }
.folder-header-actions form { max-width:100%; }
.folder-funding-badge { display:grid; place-items:center; width:44px; height:44px; min-height:44px; padding:0; border-radius:12px; font-size:1.1rem; line-height:1; }
@container(max-width:420px) { .automatic-badge { margin:0 0 8px 48px; justify-self:start; } }
.home-privacy { display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:12px; margin:22px 0 16px; }
.home-privacy small,.home-note { color:var(--muted); font-size:.8rem; }
.home-stats { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; margin-bottom:24px; }
.home-stats .modern-stat { min-width:0; padding:22px; border-radius:16px; display:grid; gap:12px; }
.home-stats .modern-stat strong { font-size:clamp(1.5rem,2.5vw,2.2rem); overflow-wrap:anywhere; }
.home-stats .stat-mint { background:#e5f9ee; }
.home-stats small { color:var(--muted); }
.home-spaces { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:22px; }
.home-space:first-child .panel-header { background:#eaf3ff; border-radius:16px 16px 0 0; }
.home-space:last-child .panel-header { background:#f0e8ff; border-radius:16px 16px 0 0; }
.home-space-body { padding:20px; }
.home-space-body>p { color:var(--muted); }
.home-space-body>.button { margin-top:24px; }
.home-line { display:flex; justify-content:space-between; flex-wrap:wrap; gap:10px; padding:12px 0; border-bottom:1px solid var(--line); }
.home-note { margin-top:20px; line-height:1.5; }
.colourful-joint { grid-template-columns:minmax(200px,1fr) 2fr; padding:0; border:0; background:none; box-shadow:none; gap:16px; }
.colourful-joint .overview-primary { padding:22px; border:0; border-radius:16px; background:linear-gradient(120deg,#e2f9ee,#effcf4); }
.colourful-joint .overview-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
.colourful-joint .overview-metrics>div { padding:18px; background:#e8f2ff; }
.colourful-joint .overview-metrics>div:nth-child(2) { background:#ffebf2; }
.colourful-joint .overview-metrics>div:nth-child(3) { background:#eee5ff; }
.colourful-joint .overview-metrics>div:nth-child(4) { background:#e7f8ef; }
.colourful-joint .overview-metrics span { min-height:0; }
.colourful-joint .overview-metrics strong { font-size:1.4rem; }
.colourful-joint .overview-actions { grid-column:1/-1; display:flex; justify-content:flex-end; }
.colourful-joint .overview-actions .button { width:auto; }
.folder-card:not(.personal-pot-card):nth-child(3n+1)>.panel-header { background:#e9f3ff; }
.folder-card:not(.personal-pot-card):nth-child(3n+2)>.panel-header { background:#fff0e8; }
.folder-card:not(.personal-pot-card):nth-child(3n+3)>.panel-header { background:#f1eaff; }
@media(max-width:900px) { .home-stats { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:599px) { .home-spaces,.colourful-joint { grid-template-columns:1fr; } .home-stats .modern-stat { padding:16px; } .mobile-nav { grid-template-columns:repeat(6,minmax(0,1fr)); } .mobile-nav a small { font-size:.62rem; } }
:root { --ink:#152447; --muted:#62728d; --line:#e2eaf5; --canvas:#f6f9ff; --brand:#1762df; --brand-2:#1c54b2; --mint:#e9f2ff; --green:#237454; --shadow:0 6px 22px #254c8910; }
body { background:linear-gradient(145deg,#f4f8ff,#fbfdff 65%); }
h1 { font-family:inherit; font-size:clamp(1.8rem,3vw,2.3rem); font-weight:780; letter-spacing:-.045em; line-height:1.2; }
h2 { font-size:1.1rem; }
.sidebar { background:#fff; color:var(--ink); border-right:1px solid var(--line); }
.brand { font-size:1.25rem; }
.brand-mark { background:transparent; font-family:inherit; font-size:1.8rem; }
.desktop-nav a { color:#405476; min-height:54px; }
.desktop-nav a:hover,.desktop-nav a.active { color:#1359c9; background:#e5f0ff; }
.nav-icon-box { border:0; background:#f3f7fd; }
.desktop-nav a:hover .nav-icon-box,.desktop-nav a.active .nav-icon-box { background:#d9eaff; border:0; }
.nav-copy small,.desktop-nav a.active .nav-copy small,.sidebar-user small { color:#687b98; }
.sidebar-user { border-color:var(--line); }
.sidebar-user .icon-button { color:#62728d; }
.avatar { background:#e2ecff; color:#245ec0; }
.account-identity { padding:0 0 12px; margin-bottom:20px; border:0; border-bottom:1px solid var(--line); border-radius:0; background:transparent; }
.account-identity.joint,.account-identity.rental { background:transparent; }
.account-identity strong { font-size:.8rem; }
.page-header { align-items:center; }
.context-links { margin-top:12px; }
.context-links a { font-size:.78rem; }
.eyebrow { color:#4f6488; font-size:.65rem; }
.button.primary { background:linear-gradient(135deg,#2581fa,#145cdc); box-shadow:0 3px 9px #1762df20; }
.button.primary:hover { background:#1356c8; }
.button.small,.button.ghost,.button.quiet { background:#f8fbff; border-color:#dce7f6; color:#285598; }
input,select,textarea { border-color:#dce6f4; border-radius:10px; }
input:focus,select:focus,textarea:focus { border-color:#619cf1; }
button:focus-visible,a:focus-visible,summary:focus-visible,input:focus-visible,select:focus-visible { outline-color:#639efa; }
.personal-overview { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; padding:0; background:none; border:0; box-shadow:none; }
.personal-overview .modern-stat { grid-column:auto; grid-row:1; order:0; min-width:0; padding:20px; border:1px solid #ffffff90; border-radius:16px; display:flex; flex-direction:column; justify-content:center; gap:10px; }
.modern-stat>span { color:#263956; font-size:.82rem; font-weight:700; }
.personal-overview .modern-stat>strong { display:block; margin:0; font-size:clamp(1.6rem,2.4vw,2.2rem); line-height:1.15; letter-spacing:-.04em; overflow-wrap:anywhere; font-variant-numeric:tabular-nums; }
.personal-overview .stat-mint { background:linear-gradient(120deg,#e2f9ee,#effcf4); }
.stat-blue { background:linear-gradient(120deg,#e2efff,#eff6ff); }
.stat-pink { background:linear-gradient(120deg,#fce5ef,#fff0f5); }
.stat-lilac { background:linear-gradient(120deg,#eee3ff,#f6efff); }
.personal-overview .summary-details { grid-column:1/-1; grid-row:2; order:1; }
.personal-overview .overview-actions { grid-column:1/-1; grid-row:3; order:2; justify-content:flex-end; }
.summary-details>summary { color:#4d6187; }
.summary-details[open] { background:white; border:1px solid var(--line); border-radius:12px; padding:14px; }
.compact-income { margin-top:18px; border-color:var(--line); }
.compact-income .entry-row { border-color:var(--line); box-shadow:0 3px 12px #254c8905; }
.dashboard-card { border-color:var(--line); border-radius:16px; box-shadow:0 5px 18px #254c8909; }
.dashboard-card:hover { border-color:#bfd4f0; box-shadow:0 7px 22px #254c8912; }
.dashboard-card .panel-header { border-radius:16px 16px 0 0; }
.personal-pot-card .panel-header { background:linear-gradient(120deg,#f4f9ff,#fff); }
.personal-pot-card.savings-pot .panel-header { background:linear-gradient(120deg,#e8faf0,#f6fff9); }
.personal-pot-card .pot-toggle::before { content:'💳'; display:inline-grid; place-items:center; width:32px; height:32px; margin-right:8px; background:#e0eeff; border-radius:9px; }
.savings-pot .pot-toggle::before { content:'🐷'; background:#ddf6e7; }
.panel-figure strong { color:#213c68; }
.dashboard-card .folder-add { border-radius:0 0 16px 16px; background:#fafcff; color:#1762df; }
.entry-row:hover { background:#f3f8ff; }
.expense-icon { background:#f0f5fc; }
.payment-badge { background:#edf4ff; border-color:#dfebfb; color:#365e95; }
.payment-badge.paid { background:#e5f6eb; color:#246945; }
.payment-badge.overdue { background:#fff0e2; color:#925019; }
.card-arrange { background:#f1f6ff; border-color:var(--line); }
.card-arrange button { color:#4c6c9c; }
.card-drag-label { background:#245db9; }
.summary-card { border:1px solid var(--line); }
.summary-card:nth-child(4n+1) { background:#e8f8ef; }
.summary-card:nth-child(4n+2) { background:#eaf2ff; }
.summary-card:nth-child(4n+3) { background:#ffedf3; }
.summary-card:nth-child(4n+4) { background:#f0e9ff; }
.summary-card.hero,.summary-card.hero>span,.summary-card.hero small { color:var(--ink); border-color:var(--line); }
.summary-card.hero.negative { background:#ffe9e8; }
.mobile-nav { background:#ffffffed; border-color:var(--line); backdrop-filter:blur(12px); }
.mobile-nav a.active { color:#1762df; background:#edf5ff; }
@media(min-width:1400px) { .card-board { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media(max-width:1100px) { .personal-overview { grid-template-columns:repeat(2,minmax(0,1fr)); } .personal-overview .modern-stat { grid-row:auto; } .personal-overview .summary-details,.personal-overview .overview-actions { grid-row:auto; } }
@media(max-width:599px) {
 .main-content { padding-top:18px; }
 .account-identity { margin-bottom:16px; }
 .personal-overview { gap:10px; }
 .personal-overview .modern-stat { padding:16px 12px; }
 .personal-overview .stat-mint { grid-column:1/-1; }
 .personal-overview .stat-lilac { grid-column:1/-1; flex-direction:row; justify-content:space-between; align-items:center; }
 .personal-overview .stat-lilac>strong { font-size:1.3rem; }
 .personal-overview .overview-actions { justify-content:stretch; }
 .personal-overview .overview-actions .button { flex:1; }
 .modern-stat>span { font-size:.76rem; }
 .desktop-nav { margin-top:24px; }
 .compact-income .entry-list { gap:8px; }
 .personal-pot-card .pot-toggle::before { width:28px; height:28px; }
}
/* Shared visual language with the native app: ink, mint, sand and lilac. */
:root { --ink:#172c36; --muted:#55636c; --line:#dfe8e5; --canvas:#f4f5f7; --brand:#146653; --brand-2:#105b4b; --mint:#e1f2e8; --green:#146653; --shadow:0 10px 28px #172c3610; }
body { background:linear-gradient(150deg,#f3f6f3,#f8f6f2 58%,#f5f2fa); }
.sidebar { background:#fbfcfa; }
.desktop-nav a { color:#415b62; }
.desktop-nav a:hover,.desktop-nav a.active { color:#125d4d; background:#e1f2e8; }
.desktop-nav a:hover .nav-icon-box,.desktop-nav a.active .nav-icon-box { background:#caebd9; }
.avatar,.card-drag-label { background:#d8eee0; color:#145d4c; }
.button.primary { background:linear-gradient(135deg,#1c8068,#146653); box-shadow:0 4px 12px #14665324; }
.button.primary:hover { background:#105b4b; }
.button.small,.button.ghost,.button.quiet { background:#f8fcf9; border-color:#d8e7de; color:#146653; }
input,select,textarea { border-color:#d9e5df; }
input:focus,select:focus,textarea:focus { border-color:#59ad8e; }
button:focus-visible,a:focus-visible,summary:focus-visible,input:focus-visible,select:focus-visible { outline-color:#59ad8e; }
.stat-blue,.colourful-joint .overview-metrics>div { background:linear-gradient(135deg,#e8eef7,#f3f6fc); }
.stat-pink,.colourful-joint .overview-metrics>div:nth-child(2) { background:linear-gradient(135deg,#f7e9df,#fff5ec); }
.stat-lilac,.colourful-joint .overview-metrics>div:nth-child(3) { background:linear-gradient(135deg,#ede8f7,#f7f2ff); }
.stat-mint,.home-stats .stat-mint,.colourful-joint .overview-primary,.colourful-joint .overview-metrics>div:nth-child(4) { background:linear-gradient(135deg,#e1f2e8,#f1fbf5); }
.home-space:first-child .panel-header,.folder-card:not(.personal-pot-card):nth-child(3n+1)>.panel-header { background:#e1f2e8; }
.home-space:last-child .panel-header,.folder-card:not(.personal-pot-card):nth-child(3n+3)>.panel-header { background:#ede8f7; }
.folder-card:not(.personal-pot-card):nth-child(3n+2)>.panel-header { background:#f7e9df; }
.personal-pot-card .panel-header { background:linear-gradient(120deg,#eaf3ed,#fff); }
.personal-pot-card.savings-pot .panel-header { background:linear-gradient(120deg,#e1f2e8,#f6fff9); }
.panel-figure strong { color:#1d4c41; }
.dashboard-card .folder-add { background:#f7fbf8; color:#146653; }
.entry-row:hover { background:#f0f8f3; }
.expense-icon,.nav-icon-box { background:#ecf4ee; }
.mobile-nav a.active { color:#146653; background:#e6f4eb; }
.history-filters { display:flex; flex-wrap:wrap; gap:8px; margin:0 0 16px; }
@media (hover:hover) and (pointer:fine) {
  .dashboard-card,.home-space,.summary-card,.modern-stat { transition:transform .3s cubic-bezier(.2,.9,.25,1.25),box-shadow .3s ease,border-color .3s ease; }
  .dashboard-card:hover,.home-space:hover,.summary-card:hover,.modern-stat:hover { transform:translateY(-4px); box-shadow:0 16px 30px #172c3618; }
  .dashboard-card:active,.home-space:active { transform:translateY(-1px) scale(.995); }
  .dashboard-card:hover { border-color:#a9d5be; }
}
@media (prefers-reduced-motion:reduce) { .dashboard-card,.home-space,.summary-card,.modern-stat { transition:none!important; transform:none!important; } }

/* A single visual system across web and Android: navy anchors, calm tinted cards. */
.sidebar { background:#172c36; color:#f7faf9; border-right:0; box-shadow:8px 0 34px #172c3610; }
.brand { color:#fff; font-size:1.3rem; }
.brand-mark { width:42px; height:42px; background:#ffffff17; border-radius:14px; }
.desktop-nav { gap:7px; }
.desktop-nav a { color:#c6d4d4; border:1px solid transparent; }
.desktop-nav a .nav-copy small,.sidebar-user small { color:#9fb5b9; }
.desktop-nav a:hover,.desktop-nav a.active { color:#fff; background:#ffffff16; border-color:#ffffff15; }
.desktop-nav a:hover .nav-icon-box,.desktop-nav a.active .nav-icon-box { background:#67d9b02b; }
.desktop-nav a.active .nav-copy small { color:#b8d9cf; }
.nav-icon-box { background:#ffffff10; border-color:#ffffff15; }
.sidebar-user { border-color:#ffffff23; }
.sidebar-user .icon-button { color:#e0efeb; }
.avatar { background:#67d9b0; color:#172c36; }
.main-content { max-width:1680px; }
.workspace-topline { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:28px; padding-bottom:14px; border-bottom:1px solid #dce7e2; }
.workspace-topline .account-identity { display:grid; gap:2px; padding:0; margin:0; border:0; }
.account-identity strong { font-size:.84rem; color:#214338; }
.privacy-control { flex:none; }
.privacy-control button { display:inline-flex; align-items:center; gap:8px; min-height:42px; padding:9px 14px; border:1px solid #cfe0d7; border-radius:999px; color:#245748; background:#fff; font:inherit; font-size:.82rem; font-weight:750; cursor:pointer; box-shadow:0 3px 10px #172c3609; }
.privacy-control button:hover { border-color:#70b798; background:#eef8f2; }
.privacy-control button span { font-size:1.12rem; }
.privacy-notice { margin:-10px 0 24px; padding:13px 16px; border-radius:14px; background:#e7f6ec; color:#205a46; font-size:.85rem; font-weight:650; }
.page-header h1 { letter-spacing:-.045em; }
.page-header .eyebrow,.section-heading .eyebrow { color:#2d6b55; }
.context-links { gap:6px; }
.context-links a,.context-links a+a { margin:0; padding:5px 9px; border:0; border-radius:8px; background:#fff; }
.context-links a:hover { color:#155b47; background:#e6f4eb; text-decoration:none; }
.button.primary { border-color:#146653; background:#146653; }
.button.primary:hover { background:#0f5948; }
.home-hero { display:grid; grid-template-columns:minmax(0,1.4fr) minmax(235px,.8fr); align-items:end; gap:30px; margin-bottom:20px; padding:clamp(24px,3vw,42px); border-radius:28px; color:#fff; background:radial-gradient(circle at 85% 5%,#3a6256 0,#25483f 26%,#172c36 68%); box-shadow:0 18px 38px #172c3625; overflow:hidden; }
.home-hero-kicker { display:inline-block; color:#a1ead1; font-size:.7rem; font-weight:800; letter-spacing:.11em; }
.home-hero h2 { margin:16px 0 4px; color:#e4eeec; font-size:clamp(1.1rem,1.7vw,1.5rem); font-weight:620; }
.home-hero-lead>strong { display:block; font-size:clamp(2.5rem,5vw,4.6rem); letter-spacing:-.06em; line-height:1.05; font-variant-numeric:tabular-nums; }
.home-hero p { max-width:440px; margin:14px 0 0; color:#c7d8d5; line-height:1.45; }
.home-hero-figures { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.home-hero-figures>div { min-width:0; padding:18px; border:1px solid #ffffff22; border-radius:18px; background:#0b1f1a4d; backdrop-filter:blur(4px); }
.home-hero-figures span { display:block; margin-bottom:8px; color:#e6f4ef; font-size:.76rem; }
.home-hero-figures strong { display:block; font-size:clamp(1rem,1.4vw,1.2rem); letter-spacing:-.035em; white-space:nowrap; font-variant-numeric:tabular-nums; }
.home-hero-figures>div:first-child strong { color:#90e4bb; }
.home-hero-figures>div:last-child strong { color:#f2d09e; }
.home-stats { grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; margin-bottom:20px; }
.home-stats .modern-stat { border:1px solid #ffffff; border-radius:19px; box-shadow:0 8px 19px #172c360b; }
.home-stats .stat-blue { background:#eaf0f6; }
.home-stats .stat-pink { background:#fbefe4; }
.home-stats .stat-lilac { background:#eee9fb; }
.home-spaces { gap:16px; }
.home-space { border-radius:22px; overflow:hidden; }
.home-space .panel-header { padding:20px 22px; }
.home-space:first-child .panel-header { background:#dff3e7; }
.home-space:last-child .panel-header { background:#eee7fa; }
.home-space-body { padding:22px; }
.home-space-body .button { width:100%; justify-content:center; }
.personal-overview { grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
.personal-overview .modern-stat { grid-row:auto; min-height:135px; padding:22px; border-radius:20px; }
.personal-overview .overview-primary { grid-column:1/-1; min-height:190px; color:#fff; background:linear-gradient(115deg,#172c36,#28564b); border-color:transparent; }
.personal-overview .overview-primary .eyebrow,.personal-overview .overview-primary span,.personal-overview .overview-primary small { color:#bfe5d6; }
.personal-overview .overview-primary .overview-total { color:#fff; font-size:clamp(2.4rem,4vw,3.7rem); }
.personal-overview .stat-blue { background:#eaf0f6; }
.personal-overview .stat-pink { background:#fbefe4; }
.personal-overview .stat-lilac { background:#eee9fb; }
.personal-overview .summary-details { grid-column:1/-1; grid-row:auto; }
.personal-overview .overview-actions { grid-column:1/-1; grid-row:auto; }
.colourful-joint { grid-template-columns:minmax(240px,.9fr) minmax(0,1.6fr); align-items:stretch; gap:14px; }
.colourful-joint .overview-primary { min-height:240px; display:flex; flex-direction:column; justify-content:center; padding:26px; border-radius:20px; color:#fff; background:linear-gradient(140deg,#172c36,#385c57); }
.colourful-joint .overview-primary .eyebrow,.colourful-joint .overview-primary span,.colourful-joint .overview-primary small { color:#c2ded5; }
.colourful-joint .overview-primary strong { color:#fff; }
.colourful-joint .overview-metrics { gap:12px; }
.colourful-joint .overview-metrics>div { display:flex; flex-direction:column; justify-content:center; min-height:112px; border-radius:18px; }
.colourful-joint .overview-metrics>div:nth-child(1) { background:#dff3e7; }
.colourful-joint .overview-metrics>div:nth-child(2) { background:#fbefe4; }
.colourful-joint .overview-metrics>div:nth-child(3) { background:#eaf0f6; }
.colourful-joint .overview-metrics>div:nth-child(4) { background:#eee9fb; }
.rental-hero { background:linear-gradient(120deg,#172c36,#305e54); border-radius:22px; box-shadow:0 14px 32px #172c361c; }
.rental-hero span,.rental-hero small { color:#e8f5f0; }
.rental-summary .summary-card { border:1px solid #fff; border-top:0!important; border-radius:18px; box-shadow:0 8px 18px #172c360a; }
.rental-summary .summary-card:nth-child(1) { background:#dff3e7; }
.rental-summary .summary-card:nth-child(2) { background:#fbefe4; }
.rental-summary .summary-card:nth-child(3) { background:#eaf0f6; }
.rental-summary .summary-card:nth-child(4) { background:#eee9fb; }
.dashboard-card { border-radius:20px; box-shadow:0 7px 22px #172c360d; }
.dashboard-card .panel-header { border-radius:20px 20px 0 0; }
@media(max-width:1050px) { .home-hero { grid-template-columns:1fr; } .home-hero-figures { max-width:520px; } .colourful-joint { grid-template-columns:1fr; } .colourful-joint .overview-primary { min-height:0; } }
@media(max-width:750px) { .home-stats { grid-template-columns:1fr 1fr; } .personal-overview { grid-template-columns:1fr 1fr; } .personal-overview .overview-primary { grid-column:1/-1; } }
@media(max-width:599px) { .workspace-topline { align-items:flex-start; margin-bottom:18px; } .workspace-topline .account-identity span { display:none; } .privacy-control button { padding:8px 10px; min-height:38px; font-size:.72rem; } .home-hero { padding:23px; border-radius:22px; } .home-hero-lead>strong { font-size:2.7rem; } .home-hero-figures>div { padding:13px; } .home-stats { grid-template-columns:1fr; } .home-stats .modern-stat { padding:16px; } .home-spaces { grid-template-columns:1fr; } .personal-overview { grid-template-columns:1fr 1fr; gap:10px; } .personal-overview .modern-stat { min-height:110px; padding:16px; } .personal-overview .stat-lilac { grid-column:1/-1; } .colourful-joint .overview-metrics>div { min-height:98px; } }

/* ===== desktop ===== */
/* A denser workspace for large screens, with the same calm cards on mobile. */
.home-key-figures,.home-detail-grid,.all-entry-grid { display:grid; gap:12px; }
.home-key-figures { grid-template-columns:repeat(3,minmax(0,1fr)); }
.home-key-figures { margin:-4px 0 12px; }
.home-key-figures>div { display:flex; align-items:center; justify-content:space-between; gap:12px; min-width:0; padding:11px 15px; border:1px solid #dbe7e1; border-radius:14px; background:#f8fbf9; }
.home-key-figures>div:nth-child(2) { background:#f4f0fb; }
.home-key-figures>div:nth-child(3) { background:#eaf3f8; }
.home-key-figures span { color:#49625f; font-size:.78rem; font-weight:680; }
.home-key-figures strong { color:#172c36; font-size:1.12rem; white-space:nowrap; font-variant-numeric:tabular-nums; }
.home-quick-actions { display:flex; flex-wrap:wrap; gap:8px; margin:0 0 13px; }
.home-quick-actions a { display:inline-flex; align-items:center; min-height:35px; padding:7px 12px; border:1px solid #cfe2d7; border-radius:10px; background:#fff; color:#1a604e; font-size:.8rem; font-weight:760; text-decoration:none; }
.home-quick-actions a:hover { background:#e8f6ee; transform:translateY(-2px); }
.home-detail-grid { grid-template-columns:repeat(2,minmax(0,1fr)); align-items:start; margin-top:13px; }
.home-detail-card { min-width:0; overflow:hidden; border:1px solid #dbe6e3; border-radius:17px; background:#fff; box-shadow:0 7px 18px #172c3609; }
.home-detail-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:13px 16px; border-bottom:1px solid #e6eeea; }
.home-detail-heading h2 { margin:2px 0 0; font-size:1.01rem; }
.home-detail-heading .eyebrow { margin:0; font-size:.63rem; }
.home-detail-heading>a { color:#17654f; font-size:.8rem; font-weight:750; text-decoration:none; white-space:nowrap; }
.home-detail-heading>small { color:#51665f; }
.home-bill,.home-change,.all-entry-row { display:flex; align-items:center; gap:11px; min-height:50px; padding:9px 15px; border-bottom:1px solid #edf1ef; color:#1e353d; text-decoration:none; }
.home-bill:last-of-type,.home-change:last-of-type,.all-entry-row:last-child { border-bottom:0; }
.home-bill:hover,.home-change:hover,.all-entry-row:hover { background:#f7fbf8; }
.bill-day { flex:none; display:grid; place-items:center; width:33px; height:34px; border-radius:9px; background:#eaf2ef; color:#23644d; font-size:.8rem; font-weight:800; }
.bill-copy,.home-change>span:nth-child(2),.all-entry-row>span:nth-child(2) { display:grid; gap:2px; min-width:0; flex:1; }
.bill-copy strong,.home-change strong,.all-entry-row strong { font-size:.8rem; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.bill-copy small,.home-change small,.all-entry-row small { color:#546a66; font-size:.69rem; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.home-bill b { color:#21383e; font-size:.83rem; white-space:nowrap; font-variant-numeric:tabular-nums; }
.home-bill>span:last-child,.home-change>span:last-child { color:#638078; }
.change-dot { flex:none; width:9px; height:9px; border-radius:50%; background:#63b995; }
.change-dot.joint { background:#ad86db; }
.home-empty,.home-more { display:block; margin:0; padding:15px; color:#586864; font-size:.8rem; }
.home-more { border-top:1px solid #edf1ef; padding-block:9px; }
.home-note { margin:11px 0 0; color:#546a65; font-size:.73rem; }
.all-entry-filters { display:flex; align-items:end; gap:10px; flex-wrap:wrap; margin:0 0 14px; }
.all-entry-filters label { display:grid; gap:5px; color:#506864; font-size:.76rem; font-weight:700; }
.all-entry-filters label:first-of-type { flex:1; min-width:220px; }
.all-entry-filters input,.all-entry-filters select { min-height:38px; }
.all-entry-grid { grid-template-columns:repeat(3,minmax(0,1fr)); align-items:start; }
.all-entry-row { min-height:60px; }
.all-entry-row.is-archived { background:#f8f8f7; }
.all-entry-date { flex:none; display:grid; gap:2px; text-align:right; white-space:nowrap; }
.all-entry-date small { color:#586a66; font-size:.62rem; }
.all-entry-date time { color:#36554e; font-size:.72rem; font-weight:700; font-variant-numeric:tabular-nums; }
.all-entry-icon { flex:none; display:grid; place-items:center; width:33px; height:33px; border-radius:10px; background:#edf4ef; font-size:1.05rem; }
.all-entry-row>a,.all-entry-row form { flex:none; color:#17654f; font-size:.75rem; font-weight:750; white-space:nowrap; }
.all-entry-row form { margin:0; }

@media (min-width:1101px) {
  .main-content { max-width:none; padding:23px clamp(20px,2.4vw,42px) 55px; }
  .workspace-topline { margin-bottom:14px; padding-bottom:10px; }
  .page-header { margin-bottom:13px; }
  .page-header p:not(.eyebrow) { margin-top:3px; }
  .page-header h1 { font-size:clamp(1.55rem,2vw,2rem); }
  .context-links { margin-top:7px; }
  .home-hero { align-items:center; gap:18px; margin-bottom:12px; padding:19px 23px; border-radius:20px; }
  .home-hero h2 { margin:5px 0 1px; font-size:1rem; }
  .home-hero-lead>strong { font-size:clamp(2.1rem,3vw,3rem); }
  .home-hero p { margin-top:4px; font-size:.78rem; }
  .home-hero-figures>div { padding:11px 14px; border-radius:12px; }
  .home-hero-figures span { margin-bottom:3px; }
  .personal-overview { grid-template-columns:minmax(230px,1.25fr) repeat(3,minmax(0,1fr)); gap:10px; }
  .personal-overview .modern-stat,.personal-overview .overview-primary { grid-column:auto; grid-row:1; min-height:108px; padding:14px 17px; gap:5px; border-radius:15px; }
  .personal-overview .overview-primary .overview-total { font-size:clamp(1.9rem,2.4vw,2.7rem); }
  .personal-overview .overview-primary small { font-size:.68rem; }
  .personal-overview .modern-stat>strong { font-size:clamp(1.45rem,1.9vw,2rem); }
  .personal-overview .summary-details { grid-column:1/-1; grid-row:2; }
  .personal-overview .overview-actions { grid-column:1/-1; grid-row:3; }
  .colourful-joint { grid-template-columns:minmax(230px,.85fr) minmax(0,2fr); gap:10px; }
  .colourful-joint .overview-primary { min-height:150px; padding:18px; border-radius:15px; }
  .colourful-joint .overview-metrics { gap:9px; }
  .colourful-joint .overview-metrics>div { min-height:70px; padding:10px 14px; border-radius:13px; }
  .colourful-joint .overview-metrics strong { font-size:1.15rem; }
  .colourful-joint .overview-actions,.personal-overview .overview-actions { margin-top:0; }
  .rental-hero { margin-bottom:10px; padding:13px 18px; }
  .rental-hero strong { font-size:1.6rem; }
  .rental-summary { gap:10px; }
  .rental-summary .summary-card { min-height:91px; padding:13px 15px; border-radius:14px; }
  .rental-summary .summary-card strong { margin:7px 0 2px; font-size:clamp(1.3rem,1.65vw,1.7rem); }
  .rental-summary .summary-card small { font-size:.68rem; }
  .rental-breakdown { margin:-2px 0 14px; }
  .rental-breakdown div { padding:9px 14px; }
}
@media (max-width:1200px) { .all-entry-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (min-width:1320px) { .colourful-joint .overview-metrics { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media (min-width:900px) and (max-width:1100px) {
  .home-hero { grid-template-columns:minmax(0,1.2fr) minmax(0,1fr); align-items:center; gap:10px; padding:18px; }
  .home-hero h2 { margin-top:6px; }
  .home-hero-lead>strong { font-size:2.5rem; }
  .home-hero p { margin-top:5px; font-size:.75rem; }
  .home-hero-figures>div { padding:10px; }
}
@media (max-width:850px) {
  .home-key-figures,.all-entry-grid { grid-template-columns:1fr; }
  .home-detail-grid { grid-template-columns:1fr; }
}
@media (max-width:599px) {
  .home-key-figures { gap:7px; }
  .home-key-figures>div { padding:9px 11px; }
  .home-quick-actions { display:grid; grid-template-columns:1fr 1fr; }
  .home-quick-actions a { justify-content:center; text-align:center; font-size:.72rem; }
  .home-hero { margin-bottom:11px; }
  .home-hero p { font-size:.78rem; }
  .home-bill,.home-change,.all-entry-row { padding-inline:11px; }
  .all-entry-filters label:first-of-type { min-width:100%; }
  .all-entry-date time { font-size:.66rem; }
}
@media (hover:none) { .home-quick-actions a:hover { transform:none; } }
@media (prefers-reduced-motion:reduce) { .home-quick-actions a { transition:none; } .home-quick-actions a:hover { transform:none; } }

/* Keep the working list beside the summary instead of below a tall dashboard. */
.budget-workspace { min-width:0; }
.scenario-workspace { display:grid; grid-template-columns:minmax(250px,320px) minmax(0,1fr); gap:16px; align-items:start; }
.scenario-controls { padding:20px; }
.scenario-controls h2 { margin:0 0 8px; }
.scenario-controls .stack-form { margin-top:16px; }
.scenario-controls .stack-form label { display:grid; gap:6px; }
.scenario-controls .stack-form input,.scenario-controls .stack-form select { width:100%; min-height:48px; }
.scenario-safety { margin:16px 0 0; color:var(--muted); font-size:.77rem; }
.scenario-results,.scenario-intro { min-width:0; }
.scenario-result-hero,.scenario-intro { padding:21px 23px; border-radius:19px; background:linear-gradient(115deg,#172c36,#28594c); color:#fff; }
.scenario-result-hero .eyebrow { color:#9fe6c9; }
.scenario-result-hero h2,.scenario-intro h2 { margin:6px 0; font-size:clamp(1.25rem,2vw,1.85rem); }
.scenario-result-hero p,.scenario-intro p { margin:0; color:#d7e7df; }
.scenario-intro { min-height:220px; display:flex; flex-direction:column; justify-content:center; }
.scenario-intro>span { font-size:2.2rem; }
.scenario-totals { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin:11px 0; }
.scenario-totals>div { display:grid; gap:5px; padding:13px 17px; border:1px solid var(--line); border-radius:14px; background:var(--surface); }
.scenario-totals span { color:var(--muted); font-size:.76rem; }
.scenario-totals strong { font-size:1.15rem; font-variant-numeric:tabular-nums; }
.scenario-table { overflow:auto; }
.scenario-table td,.scenario-table th { white-space:nowrap; }
@media (min-width:1180px) {
  .budget-workspace { display:grid; grid-template-columns:minmax(300px,320px) minmax(0,1fr); column-gap:16px; align-items:start; }
  .budget-workspace>.overview-panel { grid-column:1; grid-row:1; }
  .budget-workspace>.dashboard-section { grid-column:2; grid-row:1 / span 3; min-width:0; margin-top:0; }
  .personal-workspace>.personal-income-panel { grid-column:1; grid-row:2; min-width:0; margin-top:12px; }
  .budget-workspace .overview-panel { display:grid; grid-template-columns:1fr; padding:0; gap:0; overflow:hidden; }
  .budget-workspace .overview-primary { border-radius:14px 14px 0 0; min-height:105px; padding:16px; }
  .budget-workspace .overview-metrics { display:grid; grid-template-columns:1fr 1fr; gap:5px; padding:8px; }
  .budget-workspace .overview-metrics>div,.budget-workspace .modern-stat:not(.overview-primary) { min-height:65px; padding:9px 11px; border-radius:10px; }
  .budget-workspace .modern-stat:not(.overview-primary)>strong,.budget-workspace .overview-metrics strong { font-size:1.05rem; }
  .budget-workspace .overview-total { font-size:2rem!important; }
  .budget-workspace .overview-actions,.budget-workspace .summary-details { grid-column:1; }
  .budget-workspace .folder-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
  .budget-workspace .section-heading { margin-top:0; }

  /* The summary is a narrow rail here, not the four-column overview above. */
  .personal-workspace>.personal-overview { grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; overflow:visible; }
  .personal-workspace>.personal-overview>.overview-primary { grid-column:1/-1; grid-row:auto; min-width:0; min-height:125px; padding:16px; border-radius:15px; }
  .personal-workspace>.personal-overview>.modern-stat:not(.overview-primary) { grid-column:auto; grid-row:auto; min-width:0; min-height:76px; padding:10px 11px; }
  .personal-workspace>.personal-overview>.modern-stat.stat-lilac { grid-column:1/-1; }
  .personal-workspace>.personal-overview>.summary-details { grid-column:1/-1; grid-row:auto; min-width:0; overflow-wrap:anywhere; }
  .personal-workspace>.personal-income-panel { display:grid; grid-template-columns:minmax(0,1fr); align-items:stretch; gap:9px; margin-top:10px; padding:13px; border:1px solid #dbe7e1; border-radius:15px; background:#fff; }
  .personal-workspace>.personal-income-panel .panel-header { width:100%; justify-content:space-between; }
  .personal-workspace>.personal-income-panel .entry-list { display:grid; grid-template-columns:minmax(0,1fr); width:100%; }
  .personal-workspace>.personal-income-panel .entry-row { min-width:0; }
  .personal-workspace>.personal-income-panel .panel-total { flex-direction:row; justify-content:space-between; align-items:center; padding-top:8px; border-top:1px solid #e4ece8; }

  .joint-workspace>.colourful-joint { grid-template-columns:minmax(0,1fr); gap:0; overflow:visible; }
  .joint-workspace>.colourful-joint>.overview-primary { grid-column:1; grid-row:auto; min-width:0; min-height:125px; }
  .joint-workspace>.colourful-joint>.overview-metrics { grid-column:1; grid-row:auto; grid-template-columns:repeat(2,minmax(0,1fr)); min-width:0; }
}
@media (min-width:1180px) and (max-width:1549px) {
  /* A laptop's working pane is too narrow for two readable account cards. */
  .budget-workspace .folder-grid { grid-template-columns:minmax(0,1fr); }
}
@media (max-width:899px) { .scenario-workspace { grid-template-columns:1fr; } }
@media (max-width:599px) { .scenario-controls { padding:17px; } .scenario-totals { gap:7px; } .scenario-totals>div { padding:11px; } }

/* Editing uses a working column and a compact review rail on desktop.
   Both return to natural document order on touch-sized screens. */
.entry-edit-page { max-width:1180px; margin-inline:auto; }
.edit-review-panel { min-width:0; padding:18px; border:1px solid var(--line); border-radius:16px; background:var(--surface); }
.edit-review-panel h2 { margin:0 0 6px; font-size:1.1rem; }
.edit-review-panel>.muted { margin:0 0 12px; font-size:.82rem; }
.edit-review-panel .form-actions { position:static; flex-wrap:wrap; margin:16px 0 0; padding:0; box-shadow:none; background:none; }
.entry-edit-page>form[method="get"] { padding:16px; margin-bottom:16px; }
@media (min-width:760px) {
  .entry-edit-page>form[method="get"] { grid-template-columns:minmax(0,1fr) auto; align-items:end; gap:10px 16px; }
  .entry-edit-page>form[method="get"]>small { grid-column:1/-1; }
}
.save-preview { overflow-wrap:anywhere; line-height:1.5; }
.save-preview p { margin:9px 0 0; }
.edit-review-dialog { width:min(540px,calc(100vw - 32px)); max-height:85dvh; overflow:auto; padding:24px; border:1px solid var(--line); border-radius:20px; background:var(--surface); color:var(--text,var(--ink)); box-shadow:0 24px 80px #0004; }
.edit-review-dialog::backdrop { background:#071c27aa; }
@media (min-width:1180px) {
  .entry-edit-page>.entry-form { display:grid; grid-template-columns:minmax(0,1fr) 310px; align-items:start; gap:22px; }
  .entry-edit-page>.entry-form>.form-grid { min-width:0; }
  .edit-review-panel { position:sticky; top:90px; }
}
@media (max-width:600px) {
  .edit-review-panel { margin-top:16px; padding:14px; }
  .entry-edit-page .choice-cards { grid-template-columns:1fr; }
  .entry-edit-page .button,.edit-review-dialog .button { min-height:48px; }
}

/* ===== refine ===== */
/* One visual vocabulary across Home, Personal, Joint and the native app. */
:root {
  --mb-ink:#172c36;
  --mb-green:#146653;
  --mb-canvas:#f4f5f7;
  --mb-muted:#55636c;
  --mb-mint:#e1f2e8;
  --mb-blue:#e8eef7;
  --mb-sand:#f7e9df;
  --mb-lilac:#ede8f7;
  --mb-line:#dbe7e1;
  --mb-shadow:0 8px 24px #172c3610;
}
.personal-overview .personal-funding-metrics { grid-column:1/-1; grid-row:auto; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; min-width:0; }
.personal-funding-metrics>div { display:flex; justify-content:space-between; align-items:center; gap:12px; min-width:0; padding:10px 13px; border:1px solid var(--mb-line); border-radius:12px; background:#e8f7ee; }
.personal-funding-metrics>div:nth-child(2) { background:#fff5ec; }
.personal-funding-metrics span { color:#34584c; font-size:.76rem; font-weight:700; }
.personal-funding-metrics strong { white-space:nowrap; font-size:1rem; font-variant-numeric:tabular-nums; }
.personal-funding-metrics>small { grid-column:1/-1; color:var(--mb-muted); font-size:.7rem; }
.personal-workspace>.personal-overview>.summary-details { grid-row:auto; }
@media(min-width:1180px) { .personal-workspace>.personal-overview>.personal-funding-metrics { grid-template-columns:1fr; } }
@media(min-width:1180px) { .personal-workspace .dashboard-card .entry-control { grid-template-columns:minmax(0,1fr) auto auto auto; } }
@media(max-width:599px) { .personal-overview .personal-funding-metrics { grid-template-columns:1fr; } }
.home-space-link.joint .joint-house-icon { width:25px; height:25px; }
.welcome-grid { display:grid; grid-template-columns:minmax(260px,.8fr) minmax(0,1.2fr); gap:16px; align-items:start; }
.welcome-example,.welcome-safety { border:1px solid var(--mb-line); border-radius:20px; padding:22px; background:#fff; box-shadow:var(--mb-shadow); }
.welcome-example { background:linear-gradient(145deg,var(--mb-ink),#285a4d); color:#fff; }
.welcome-example .eyebrow { color:#9ee4c9; }
.welcome-example h2 { margin:12px 0 3px; color:#fff; }
.welcome-example>strong { display:block; font-size:clamp(2rem,4vw,3.3rem); letter-spacing:-.05em; font-variant-numeric:tabular-nums; }
.welcome-example p { margin:10px 0 17px; color:#d5e9e2; }
.welcome-example small { color:#c5dad2; line-height:1.5; }
.welcome-steps { display:grid; gap:9px; }
.welcome-steps a { display:flex; align-items:center; gap:13px; min-height:72px; padding:13px 15px; border:1px solid var(--mb-line); border-radius:16px; color:var(--mb-ink); background:#fff; box-shadow:var(--mb-shadow); text-decoration:none; }
.welcome-steps a:hover { border-color:#91c9ae; transform:translateY(-2px); }
.welcome-steps a>span { display:grid; place-items:center; flex:none; width:35px; height:35px; border-radius:11px; color:var(--mb-green); background:var(--mb-mint); font-weight:800; }
.welcome-steps a:nth-child(2)>span { background:var(--mb-blue); }
.welcome-steps a:nth-child(3)>span { background:var(--mb-lilac); }
.welcome-steps a:nth-child(4)>span { background:var(--mb-sand); }
.welcome-steps a>div { display:grid; gap:3px; min-width:0; }
.welcome-steps strong { font-size:.9rem; }
.welcome-steps small { color:var(--mb-muted); font-size:.76rem; }
.welcome-steps b { margin-left:auto; color:var(--mb-muted); font-size:1.4rem; }
.welcome-safety { margin-top:16px; }
.welcome-safety p { color:var(--mb-muted); line-height:1.55; }
@media(max-width:800px) { .welcome-grid { grid-template-columns:1fr; } }
@media(prefers-reduced-motion:reduce) { .welcome-steps a { transition:none; } .welcome-steps a:hover { transform:none; } }
.workspace-topline:has(.workspace-month) { gap:10px; }
.workspace-month { min-width:0; }
.workspace-month .month-bar { grid-template-columns:40px minmax(170px,205px) 40px; gap:5px; }
.workspace-month .month-arrow { width:40px; height:40px; }
.workspace-month .month-picker { min-height:44px; }
.workspace-month .today-link { position:static; grid-column:2; justify-self:center; transform:none; font-size:.74rem; }
.workspace-month .starting-month-action { grid-column:2; justify-self:center; margin:0; }
.workspace-month .starting-month-action button { border:0; background:transparent; color:var(--brand-2); font:inherit; font-size:.74rem; font-weight:700; padding:3px 5px; cursor:pointer; text-decoration:underline; text-underline-offset:2px; }
.workspace-month .starting-month-action button:hover,.workspace-month .starting-month-action button:focus-visible { color:var(--ink); }
.plan-summary-trigger { all:unset; box-sizing:border-box; display:flex; flex-direction:column; align-items:flex-start; gap:4px; width:100%; height:100%; cursor:pointer; border-radius:12px; }
.plan-summary-content { box-sizing:border-box; display:flex; flex-direction:column; align-items:flex-start; gap:4px; width:100%; height:100%; }
.plan-summary-trigger .eyebrow,.plan-summary-content .eyebrow { margin:0; }
.plan-summary-trigger .overview-total,.plan-summary-content .overview-total { display:block; line-height:1.1; font-variant-numeric:tabular-nums; }
.plan-summary-trigger .plan-tap { margin-top:auto; padding-top:5px; color:#c1e9d8; font-size:.72rem; font-weight:750; }
.plan-summary-trigger:hover .plan-tap { color:#fff; }
.plan-summary-trigger:focus-visible { outline:3px solid #f2d09e; outline-offset:3px; }
.summary-details { min-width:0; }
.summary-details>summary { cursor:pointer; font-size:.79rem; font-weight:750; }
.summary-details[open],.joint-plan-details[open] { background:#fff; border:1px solid var(--mb-line); border-radius:14px; padding:15px; box-shadow:var(--mb-shadow); }
.summary-details[open]>summary { margin-bottom:12px; }
.plan-insight-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:9px; margin-top:12px; }
.plan-insight-grid>div { display:grid; gap:4px; min-width:0; padding:12px 14px; border-radius:12px; background:#f4f8f6; }
.plan-insight-grid>div:nth-child(2) { background:var(--mb-blue); }
.plan-insight-grid>div:nth-child(3) { background:var(--mb-sand); }
.plan-insight-grid span { color:#485d58; font-size:.75rem; }
.plan-insight-grid strong { font-size:1rem; font-variant-numeric:tabular-nums; }
.plan-watch { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:15px; margin-top:15px; }
.plan-watch>div { min-width:0; }
.plan-watch h3 { margin:0 0 7px; font-size:.87rem; }
.plan-watch p { display:flex; justify-content:space-between; gap:12px; margin:0; padding:7px 0; border-bottom:1px solid #e7efeb; font-size:.8rem; }
.plan-watch p strong { white-space:nowrap; font-variant-numeric:tabular-nums; }
.joint-plan-details { margin:7px 0 0; }
.budget-toolbar .button.primary { min-height:40px; white-space:nowrap; }
.expense-filters .card-layout-toolbar { flex:0 0 auto; margin:0; gap:8px; }
.expense-filters .card-layout-toolbar .button { min-height:40px; }
.folder-card { box-shadow:var(--mb-shadow); }
.entry-icon img,.all-entry-icon img { display:block; width:28px; height:28px; }
img[src*="spotify-icon.png"],img[src*="netflix-symbol.png"] { width:21px; height:21px; object-fit:cover; object-position:center; }
img[src*="netflix-symbol.png"] { background:#080808; border-radius:5px; }
.joint-house-icon { display:block; width:24px; height:24px; object-fit:contain; }
.mobile-nav-icon .joint-house-icon { width:22px; height:22px; }
.login-monitor { display:grid; gap:10px; }
.login-monitor-item { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; padding:13px 15px; border:1px solid var(--mb-line); border-radius:13px; background:#f9fbfa; }
.login-monitor-item strong { color:var(--mb-ink); }
.login-monitor-item small,.login-monitor-item p { color:#647873; font-size:.78rem; }
.login-monitor-item p { margin:5px 0 0; }
.login-monitor-status { display:grid; justify-items:end; gap:8px; }
.login-monitor-status form { display:flex; align-items:end; flex-wrap:wrap; gap:8px; }
.login-monitor-status label { display:grid; gap:4px; font-size:.76rem; }
.login-monitor-status input { min-height:40px; }
.login-monitor-status .button { min-height:40px; }
.security-alert { padding:12px 14px; margin:10px 0 16px; border:1px solid #dfb869; border-radius:12px; background:#fff4db; color:#633e0b; font-weight:700; }
.security-events { display:grid; gap:7px; max-height:430px; overflow:auto; padding-right:4px; }
.security-event { display:flex; align-items:center; gap:12px; padding:10px 12px; border:1px solid var(--mb-line); border-radius:12px; background:#f9fbfa; }
.security-event-icon { display:grid; place-items:center; flex:none; width:34px; height:34px; border-radius:10px; background:#e1f2e8; color:#146653; font-weight:850; }
.security-event-icon.failed { background:#fff0da; color:#804c07; }
.security-event-icon.locked { background:#ffe8e7; color:#9a2828; }
.security-event-icon.unlocked { background:#e8eef7; color:#284f86; }
.security-event>div { display:grid; gap:2px; min-width:0; }
.security-event strong { font-size:.84rem; }
.security-event small { color:#647873; font-size:.75rem; overflow-wrap:anywhere; }
.security-event time { margin-left:auto; color:#647873; font-size:.74rem; white-space:nowrap; }
.folder-card:hover { box-shadow:0 12px 27px #172c3618; }
.home-space-link:focus-visible,.month-arrow:focus-visible,.privacy-control button:focus-visible,.context-links a:focus-visible,.folder-card button:focus-visible,.budget-toolbar a:focus-visible,.budget-toolbar button:focus-visible,.plan-watch a:focus-visible { outline:3px solid #bd8c35; outline-offset:3px; }

@media (min-width:1101px) {
  .workspace-topline:has(.workspace-month) { display:grid; grid-template-columns:minmax(150px,1fr) auto auto; position:sticky; top:0; z-index:30; margin:0 0 9px; padding:8px 12px; border:1px solid var(--mb-line); border-radius:14px; background:#f9fbfaef; backdrop-filter:blur(14px); box-shadow:0 5px 18px #172c360b; }
  .dashboard-header { display:block; margin-bottom:9px; }
  .dashboard-header h1 { margin:0; font-size:1.5rem; }
  .dashboard-header>div>p:not(.eyebrow) { display:none; }
  .dashboard-header .context-links { margin-top:6px; }
  .personal-overview { grid-template-columns:minmax(225px,1.35fr) repeat(3,minmax(0,1fr)); gap:10px; }
  .personal-overview .modern-stat,.personal-overview .overview-primary { grid-column:auto; grid-row:1; min-height:104px; padding:13px 15px; border-radius:16px; }
  .personal-overview .overview-primary .overview-total { font-size:clamp(1.8rem,2.1vw,2.45rem); }
  .personal-overview .modern-stat>strong { font-size:clamp(1.28rem,1.65vw,1.8rem); }
  .personal-overview .summary-details { grid-column:1/-1; grid-row:2; }
  .colourful-joint { grid-template-columns:minmax(220px,.8fr) minmax(0,2.8fr); gap:10px; }
  .colourful-joint .overview-primary { min-height:115px; padding:14px 17px; border-radius:16px; }
  .colourful-joint .overview-primary .overview-total { font-size:clamp(1.9rem,2.3vw,2.5rem); }
  .colourful-joint .overview-metrics { display:grid; grid-template-columns:repeat(auto-fit,minmax(125px,1fr)); gap:8px; }
  .colourful-joint .overview-metrics>div { min-height:66px; padding:9px 12px; border-radius:13px; }
  .colourful-joint .overview-metrics strong { font-size:1.04rem; }
  .dashboard-section { margin-top:14px; }
  .dashboard-section .section-heading { align-items:center; margin-bottom:9px; }
  .folder-grid { grid-template-columns:repeat(auto-fit,minmax(310px,1fr)); gap:12px; }
}
@media (min-width:900px) and (max-width:1100px) {
  .workspace-topline:has(.workspace-month) { display:grid; grid-template-columns:minmax(140px,1fr) auto auto; gap:8px; margin-bottom:9px; }
  .workspace-month { order:0; width:auto; }
  .dashboard-header { margin-bottom:9px; }
  .dashboard-header>div>p:not(.eyebrow) { display:none; }
  .personal-overview { grid-template-columns:minmax(190px,1.25fr) repeat(3,minmax(0,1fr)); gap:8px; }
  .personal-overview .modern-stat,.personal-overview .overview-primary { grid-column:auto; grid-row:1; min-height:112px; padding:12px; }
  .personal-overview .overview-primary .overview-total { font-size:2rem; }
  .personal-overview .modern-stat>strong { font-size:1.35rem; }
  .personal-overview .summary-details { grid-column:1/-1; grid-row:2; }
  .colourful-joint { grid-template-columns:minmax(195px,.8fr) minmax(0,2.4fr); gap:8px; }
  .colourful-joint .overview-primary { min-height:120px; padding:13px; }
  .colourful-joint .overview-metrics { grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
  .colourful-joint .overview-metrics>div { min-height:60px; padding:8px; }
  .colourful-joint .overview-metrics strong { font-size:1rem; }
}
@media (max-width:1100px) {
  .workspace-topline:has(.workspace-month) { flex-wrap:wrap; }
  .workspace-month { order:3; width:100%; }
  .workspace-month .month-bar { width:100%; grid-template-columns:44px minmax(0,1fr) 44px; }
  .workspace-month .month-arrow { width:44px; height:44px; }
  .workspace-month .today-link { grid-column:2; }
}
@media (max-width:750px) {
  .security-event { flex-wrap:wrap; }
  .security-event time { flex-basis:100%; margin-left:46px; }
  .login-monitor-item { flex-direction:column; }
  .login-monitor-status { justify-items:start; width:100%; }
  .personal-overview .overview-primary { min-height:125px; }
  .plan-insight-grid,.plan-watch { grid-template-columns:1fr; }
  .budget-toolbar { gap:8px; }
  .budget-toolbar .button.primary { min-height:44px; }
  .context-links a { min-height:36px; }
}
@media (min-width:900px) and (max-width:1100px) {
  .workspace-month { order:0; width:auto; }
  .workspace-month .month-bar { width:auto; grid-template-columns:40px minmax(170px,205px) 40px; }
}
@media (prefers-reduced-motion:reduce) { .folder-card,.home-space-link { transition:none; transform:none!important; } }

/* ===== release-polish ===== */
/* Natural rows keep card bounds stable during confirmation, filtering and resize. */
.budget-workspace .card-board,.rental-ledger.card-board { grid-auto-rows:auto; grid-auto-flow:row; align-items:start; }
.card-board>.dashboard-card { grid-row:auto!important; align-self:start; transform:none; }
.dashboard-card .entry-list[data-pot-content] { max-height:none; overflow:visible; }
.dashboard-card .entry-control { grid-template-columns:minmax(0,1fr) auto auto auto; align-items:center; }
.dashboard-card .entry-amount,.panel-figure strong { font-variant-numeric:tabular-nums; white-space:nowrap; }
.dashboard-card .entry-row { min-width:0; }
.dashboard-card .entry-copy { min-width:0; }
.dashboard-card .funding-form { margin:0; }
.dashboard-card .funding-badge { min-height:32px; font-size:.7rem; white-space:nowrap; }
.dashboard-card .entry-actions { align-self:center; }
.funding-progress { grid-column:1/-1; min-width:0; padding:14px 16px; border:1px solid var(--mb-line,#dbe7e1); border-radius:14px; background:var(--surface,#fff); color:var(--ink,#172c36); }
.folder-card>.funding-progress { border:0; border-bottom:1px solid var(--mb-line,#dbe7e1); border-radius:0; }
.funding-progress-heading { display:flex; justify-content:space-between; align-items:center; gap:10px; margin-bottom:10px; font-size:.82rem; }
.funding-progress-heading>span { color:var(--muted,#49625f); font-size:.72rem; white-space:nowrap; }
.funding-progress-figures { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
.funding-progress-figures span { display:block; color:var(--muted,#49625f); font-size:.7rem; }
.funding-progress-figures strong { display:block; margin-top:4px; font-size:.91rem; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.funding-progress progress { display:block; width:100%; height:6px; accent-color:#17866a; margin:10px 0 7px; }
.funding-progress small { display:block; font-size:.67rem; color:var(--muted,#49625f); line-height:1.5; }
.personal-funding-metrics[hidden] { display:none; }
.budget-workspace>.overview-panel>.funding-progress { grid-row:auto; }
@media(min-width:1180px) {
  .budget-workspace { grid-template-columns:minmax(270px,300px) minmax(0,1fr); gap:16px; }
  .budget-workspace>.overview-panel { gap:8px; }
  .budget-workspace .overview-primary { min-height:0!important; }
  .budget-workspace .modern-stat:not(.overview-primary) { min-height:60px!important; }
  .budget-workspace .overview-metrics>div { min-height:54px!important; }
}
@container(max-width:560px) {
  .dashboard-card .entry-control { grid-template-columns:minmax(0,1fr) auto auto; }
  .dashboard-card .entry-control>.entry-row { grid-column:1/-1; }
  .dashboard-card .funding-form { padding:0 0 8px 10px; }
  .dashboard-card .payment-form { padding:0 0 8px; }
  .dashboard-card .entry-actions { margin:0 8px 8px; }
}
@media(prefers-reduced-motion:reduce) { .dashboard-card { transition:none; } }

/* Layered card depth shared with the Android app. The inset highlight gives the
   face a soft bevel while the two outside shadows keep the card grounded. */
:root {
  --mb-card-depth:
    inset 0 1px 0 rgba(255,255,255,.82),
    inset 0 -1px 0 rgba(23,44,54,.045),
    0 2px 4px rgba(23,44,54,.075),
    0 12px 28px rgba(23,44,54,.105);
  --mb-card-depth-hover:
    inset 0 1px 0 rgba(255,255,255,.9),
    inset 0 -1px 0 rgba(23,44,54,.05),
    0 4px 7px rgba(23,44,54,.08),
    0 18px 38px rgba(23,44,54,.14);
}

:is(.panel,.summary-card,.overview-primary,.modern-stat,.overview-metrics>div,.home-key-figures>div,.home-detail-card,.home-hero-figures>div,.dashboard-card,.welcome-example,.welcome-safety,.welcome-steps a,.compact-income,.compact-income .entry-row,.rental-hero,.rental-breakdown>div,.plan-insight-grid>div,.comparison>div,.login-monitor-item,.security-event,.choice-cards label) {
  border-color:color-mix(in srgb,var(--mb-line,#dbe7e1) 88%,#fff 12%);
  box-shadow:var(--mb-card-depth);
  transition:transform 180ms cubic-bezier(.2,.75,.25,1),box-shadow 180ms ease,border-color 180ms ease;
}

/* Rental is a financial year workspace, not just another list. */
.rental-hero {
  position:relative;
  overflow:hidden;
  border:1px solid #ffffff24;
  background:
    radial-gradient(circle at 86% -25%,#67d9b052 0 28%,transparent 29%),
    linear-gradient(135deg,#172c36 0%,#1c4d43 100%);
}
.rental-hero::after { content:'🏘️'; position:absolute; right:22px; bottom:-18px; font-size:5.2rem; opacity:.1; transform:rotate(-6deg); pointer-events:none; }
.rental-hero>.button { position:relative; z-index:1; }
.rental-stat { position:relative; padding-right:64px!important; overflow:hidden; }
.rental-stat-icon { position:absolute; top:13px; right:14px; display:grid!important; place-items:center; width:38px; height:38px; border:1px solid #ffffffa8; border-radius:12px; background:#ffffff8f; box-shadow:inset 0 1px 0 #fff,0 5px 12px #172c3612; font-size:1.2rem; }
.rental-stat>span:not(.rental-stat-icon) { font-weight:760; }
.rental-breakdown { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; overflow:visible; border:0; background:none; }
.rental-breakdown>div { display:grid; grid-template-columns:auto 1fr; column-gap:9px; align-items:center; min-width:0; border:1px solid var(--mb-line,#dbe7e1); border-radius:14px; background:linear-gradient(145deg,#fff,#f5f9f7); }
.rental-breakdown>div>span:first-child { grid-row:1/3; font-size:1.35rem; }
.rental-breakdown>div>span:nth-child(2),.rental-breakdown>div>strong { grid-column:2; }
.rental-ledger-card { overflow:hidden; }
.rental-ledger-card>.panel-header { border-bottom:1px solid var(--mb-line,#dbe7e1); background:linear-gradient(135deg,#e1f2e8,#f4fbf7); }
.rental-ledger-card.expense-ledger>.panel-header { background:linear-gradient(135deg,#f7e9df,#fff7f1); }
.rental-ledger-card>.panel-total { background:linear-gradient(135deg,#f7fbf9,#fff); }

/* Smaller tiles are cards too: give them the bevel without making the page
   jump or turning every list row into a floating object. */
.overview-metrics>div,.home-key-figures>div,.home-hero-figures>div,.plan-insight-grid>div,.comparison>div,.compact-income .entry-row,.rental-breakdown>div {
  border:1px solid color-mix(in srgb,var(--mb-line,#dbe7e1) 82%,#fff 18%);
}

/* Only actionable cards lift. Static figures keep their position while gaining
   the same bevel and contact shadow. */
@media (hover:hover) and (pointer:fine) {
  :is(.folder-card,.welcome-steps a):hover {
    transform:translateY(-3px);
    border-color:color-mix(in srgb,var(--mb-green,#146653) 34%,var(--mb-line,#dbe7e1));
    box-shadow:var(--mb-card-depth-hover);
  }
  :is(.folder-card,.welcome-steps a):active {
    transform:translateY(-1px);
    box-shadow:var(--mb-card-depth);
  }
}

@media (prefers-reduced-motion:reduce) {
  :is(.panel,.summary-card,.overview-primary,.modern-stat,.overview-metrics>div,.home-key-figures>div,.home-detail-card,.home-hero-figures>div,.dashboard-card,.welcome-example,.welcome-safety,.welcome-steps a,.compact-income,.compact-income .entry-row,.rental-hero,.rental-breakdown>div,.plan-insight-grid>div,.comparison>div,.login-monitor-item,.security-event,.choice-cards label) {
    transition:none;
  }
  :is(.folder-card,.welcome-steps a):hover,
  :is(.folder-card,.welcome-steps a):active { transform:none; }
}

@media(max-width:700px) {
  .rental-breakdown { grid-template-columns:1fr; }
  .rental-stat { padding-right:58px!important; }
}

/* Clear status language without adding another dashboard. A narrow colour rail
   and the existing text badges make each outgoing scannable at a glance. */
.entry-control { position:relative; border-inline-start:3px solid transparent; }
.entry-control.state-overdue { border-inline-start-color:#d85c56; background:linear-gradient(90deg,#fff1ef 0,transparent 28%); }
.entry-control.state-due_soon { border-inline-start-color:#d89a42; background:linear-gradient(90deg,#fff7e8 0,transparent 28%); }
.entry-control.state-paid,.entry-control.funded { border-inline-start-color:#35a981; }
.entry-control.state-automatic { border-inline-start-color:#7189d6; }
.entry-control.unfunded:not(.state-paid):not(.state-overdue):not(.state-due_soon) { border-inline-start-color:#b9c5c1; }

/* The home page only calls out exceptions; a quiet all-clear state avoids a
   noisy permanent report when everything is fine. */
.attention-strip { margin:14px 0; padding:16px; border:1px solid var(--mb-line,#dbe7e1); border-radius:18px; background:linear-gradient(145deg,#f9fcfb,#f0f7f4); box-shadow:var(--mb-card-depth); }
.attention-strip.all-clear { padding:14px 16px; background:linear-gradient(145deg,#e5f6ec,#f7fcf9); }
.attention-strip.all-clear>p { margin:7px 0 0; color:var(--muted,#49625f); }
.attention-heading { display:flex; align-items:end; justify-content:space-between; gap:12px; margin-bottom:11px; }
.attention-heading h2 { margin:2px 0 0; font-size:1rem; }
.attention-heading small { color:var(--muted,#49625f); }
.attention-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:9px; }
.attention-item { display:flex; align-items:center; gap:6px; min-width:0; padding:7px; border:1px solid #dce8e3; border-radius:14px; color:var(--ink,#172c36); background:var(--surface,#fff); box-shadow:inset 0 1px 0 #fff,0 5px 13px #172c3610; }
.attention-open { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:9px; min-width:0; flex:1; padding:4px; color:inherit; text-decoration:none; }
.attention-open-label { color:var(--mb-green,#146653); font-size:.69rem; font-weight:780; white-space:nowrap; }
.attention-dismiss { flex:none; min-height:36px!important; padding:5px 8px; border:0; border-radius:9px; color:var(--muted,#49625f); background:transparent; font-size:.65rem; font-weight:750; cursor:pointer; }
.attention-dismiss:hover { color:var(--ink,#172c36); background:#ffffffa8; }
.attention-item.warning { border-color:#e9c986; background:#fffaf0; }
.attention-item.danger { border-color:#efb2a9; background:#fff4f2; }
.attention-item.info { border-color:#b8cee9; background:#f3f8ff; }
.attention-item strong,.attention-item small { display:block; overflow-wrap:anywhere; }
.attention-item strong { font-size:.78rem; }
.attention-item small { margin-top:3px; color:var(--muted,#49625f); font-size:.67rem; line-height:1.35; }
.attention-dismissed-empty { margin:7px 0 0; color:var(--muted,#49625f); }
.attention-icon,.entry-icon,.all-entry-icon,.space-icon,.nav-icon-box,.mobile-nav-icon { box-shadow:inset 0 1px 0 #ffffffc7,0 3px 8px #172c3612; }
.category-art-shell { overflow:visible; background:linear-gradient(145deg,#fbfdfc,#e8f1ed)!important; }
.category-art-shell .category-art { display:block; width:30px; height:30px; object-fit:contain; filter:drop-shadow(0 3px 4px #17382c20); transform:translateZ(0); }
.category-art-shell .semantic-entry-glyph { display:grid; place-items:center; width:30px; height:30px; font-size:1.12rem; line-height:1; filter:drop-shadow(0 2px 2px #17382c18); }
.category-art-shell .savings-pig-art { object-fit:contain; }
.category-art-shell .brand-art { display:block; width:21px; height:21px; object-fit:contain; }
.category-art-shell .netflix-art { object-fit:cover; border-radius:5px; background:#080808; }
.pot-toggle:has(.pot-art-shell)::before { display:none; }
.pot-art-shell { display:inline-grid; place-items:center; flex:0 0 40px; width:40px; height:40px; margin-right:8px; border-radius:12px; background:linear-gradient(145deg,#fff,#eef6f2); box-shadow:inset 0 1px 0 #fff,0 5px 12px #17382c18; }
.pot-art-shell img { display:block; width:37px; height:37px; object-fit:contain; filter:drop-shadow(0 3px 4px #17382c20); }
.attention-icon { display:grid; place-items:center; width:34px; height:34px; border-radius:11px; background:#ffffffb8; font-size:1.05rem; }

/* Rental documents are visible records rather than filename-only rows. */
.rental-document-summary { margin-top:8px; color:#f2fbf7!important; font-weight:700; }
.receipt-chip { display:inline-flex!important; align-items:center; width:max-content; margin-top:6px; padding:3px 7px; border-radius:999px; font-size:.63rem!important; font-weight:780; line-height:1.25; }
.receipt-chip.attached { color:#11634e; background:#dff5e9; }
.receipt-chip.missing { color:#9a4d19; background:#fff0d7; }
.receipt-chip.neutral { color:#435b72; background:#eaf1fb; }
.rental-entry-row.missing-document { box-shadow:inset 3px 0 #d89a42; }
.rental-document-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; padding-top:14px; border-top:0!important; }
.rental-document-row { display:grid!important; grid-template-columns:64px minmax(0,1fr) auto; align-items:center; gap:12px; padding:10px!important; border:1px solid var(--mb-line,#dbe7e1)!important; border-radius:14px; background:linear-gradient(145deg,#fff,#f6faf8); box-shadow:inset 0 1px 0 #fff,0 6px 15px #172c3612; }
.rental-document-preview { display:grid; place-items:center; width:64px; height:58px; overflow:hidden; border-radius:10px; color:#fff; background:linear-gradient(145deg,#d75a56,#a42f2c); text-decoration:none; font-size:.78rem; font-weight:900; letter-spacing:.08em; }
.rental-document-preview img { width:100%; height:100%; object-fit:cover; }
.rental-document-copy { min-width:0; }
.rental-document-copy a,.rental-document-copy strong,.rental-document-copy span { display:block; min-width:0; overflow-wrap:anywhere; }
.rental-document-copy span { margin-top:4px; color:var(--muted,#49625f); font-size:.72rem; }
.receipt-document-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; align-items:center; gap:6px; }
.receipt-document-actions form { margin:0; }
.receipt-document-actions .button { min-height:38px; white-space:nowrap; }

/* Keyboard users get the same unambiguous interaction signal as pointer users. */
:where(a,button,input,select,textarea,summary):focus-visible { outline:3px solid color-mix(in srgb,var(--mb-green,#146653) 66%,#fff); outline-offset:3px; }
.entry-row,.home-bill,.home-change,.menu-action { min-height:48px; }

@media (hover:hover) and (pointer:fine) {
  .attention-item:hover,.rental-document-row:hover { transform:translateY(-2px); box-shadow:var(--mb-card-depth-hover); }
}

/* Wide workspaces use their width instead of stretching one long column. */
@media(min-width:1650px) {
  .home-detail-grid { grid-template-columns:minmax(0,1.15fr) minmax(360px,.85fr); }
  .rental-ledger { grid-template-columns:repeat(2,minmax(0,1fr)); align-items:start; }
  .rental-ledger-card { position:relative; }
}
@media(max-width:1100px) { .attention-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:700px) {
  .attention-grid,.rental-document-list { grid-template-columns:1fr; }
  .attention-strip { padding:13px; }
  .rental-document-row { grid-template-columns:54px minmax(0,1fr); }
  .rental-document-preview { width:54px; height:52px; }
  .receipt-document-actions { grid-column:1 / -1; justify-content:flex-start; padding-left:66px; }
  .receipt-document-actions form { grid-column:auto; }
}
@media(prefers-reduced-motion:reduce) {
  .attention-item,.rental-document-row { transition:none!important; transform:none!important; }
}

/* One status per entry and folded finished entries (0.9.94); Undo is the existing banner */
.entry-status { display:flex; flex-wrap:wrap; align-items:center; gap:6px; }
.status-form { display:inline; margin:0; }
.status-chip { min-height:32px; padding:5px 11px; border:1px solid var(--line); border-radius:999px; background:var(--surface, #fff); color:var(--brand-2); cursor:pointer; font-size:.74rem; font-weight:760; text-align:left; white-space:normal; }
.status-chip.in-account { color:#7a4b00; background:#fff4dc; border-color:#f0cf8c; }
.status-chip.paid { color:#135f49; background:#e1f7ed; border-color:#9bd8bb; }
.status-chip.overdue { color:#8a3830; background:#fff3f1; border-color:#e3aaa4; }
.status-chip.back { min-width:32px; padding:5px 8px; color:var(--muted); }
.status-chip:hover { border-color:var(--brand-2); }
.done-fold { margin-top:6px; }
.done-fold > summary { cursor:pointer; padding:10px 12px; color:var(--brand-2); font-weight:760; font-size:.85rem; list-style:none; }
.done-fold > summary::-webkit-details-marker { display:none; }
.done-fold > summary::before { content:'▸ '; }
.done-fold[open] > summary::before { content:'▾ '; }
html[data-theme="dark"] .status-chip { background:#242424; color:#a7e8c9; }
html[data-theme="dark"] .status-chip.in-account { color:#ffd27a; background:#3a2f17; border-color:#6b5426; }
html[data-theme="dark"] .status-chip.paid { color:#a7e8c9; background:#173a2d; border-color:#2f6b52; }
html[data-theme="dark"] .status-chip.overdue { color:#ffb4ab; background:#3d1f1c; border-color:#7a3a33; }
/* Nicer look (0.9.98): pot tint, progress rings, calmer statuses, softer plan card */
.folder-card { background: color-mix(in srgb, var(--pot-accent, transparent) 7%, var(--surface, #fff)); }
.pot-progress { display:flex; align-items:center; gap:6px; margin-top:4px; justify-content:flex-end; }
.pot-progress small { color:var(--muted); font-weight:700; }
.pot-progress.done small { color:#1b7a55; }
.pot-ring { --pct:0; width:18px; height:18px; border-radius:50%; display:inline-grid; place-items:center; font-size:11px; font-weight:900; color:#fff;
  background: radial-gradient(closest-side, var(--surface, #fff) 64%, transparent 66%), conic-gradient(#1b7a55 calc(var(--pct) * 1%), rgba(15,92,70,.14) 0); transition: background .6s ease; }
.pot-progress.done .pot-ring { background:#1b7a55; }
.status-chip.to-fund { color:#5f6b68; background:#eef1f0; border-color:#d9dfdd; }
.status-chip.to-fund.overdue { color:#8a3830; background:#fff3f1; border-color:#e3aaa4; }
.paid-bar { width:100%; height:6px; margin:8px 0 6px; border:0; border-radius:99px; background:rgba(255,255,255,.25); overflow:hidden; }
.paid-bar::-webkit-progress-bar { background:rgba(255,255,255,.25); border-radius:99px; }
.paid-bar::-webkit-progress-value { background:#71d8b1; border-radius:99px; transition:width .6s ease; }
.paid-bar::-moz-progress-bar { background:#71d8b1; border-radius:99px; }
.info-tip { margin:6px 0; }
.info-tip > summary { cursor:pointer; color:var(--brand-2); font-weight:700; font-size:.82rem; list-style:none; }
.info-tip > summary::-webkit-details-marker { display:none; }
.done-fold.all-done > summary { color:#1b7a55; }
.status-chip, .done-fold > summary { transition: transform .15s ease, background-color .3s ease; }
.status-chip:active { transform: scale(.96); }
html[data-theme="dark"] .folder-card { background: color-mix(in srgb, var(--pot-accent, transparent) 10%, #1f2423); }
html[data-theme="dark"] .pot-ring { background: radial-gradient(closest-side, #1f2423 64%, transparent 66%), conic-gradient(#71d8b1 calc(var(--pct) * 1%), rgba(255,255,255,.14) 0); color:#0f1713; }
html[data-theme="dark"] .pot-progress.done .pot-ring { background:#71d8b1; }
html[data-theme="dark"] .pot-progress.done small, html[data-theme="dark"] .done-fold.all-done > summary { color:#a7e8c9; }
html[data-theme="dark"] .status-chip.to-fund { color:#b7c2bf; background:#2a302f; border-color:#3a4240; }

/* ===== generated dark theme: scripts/build_dark_theme.py (do not edit by hand) ===== */
html[data-theme="dark"] .skip-link{background:#242424}
html[data-theme="dark"] .account-identity{background:#212c36}
html[data-theme="dark"] .account-identity.joint{background:#2c3324}
html[data-theme="dark"] .session-gate{background:#242424}
html[data-theme="dark"] .save-preview{background:#26312c}
html[data-theme="dark"] .brand-mark{background:#23342d}
html[data-theme="dark"] .nav-icon-box{border:1px solid #4545451f;background:#24242414}
html[data-theme="dark"] .desktop-nav a:hover,html[data-theme="dark"] .desktop-nav a.active{background:#2424241f}
html[data-theme="dark"] .desktop-nav a:hover .nav-icon-box,html[data-theme="dark"] .desktop-nav a.active .nav-icon-box{border-color:#45454538;background:#24242426}
html[data-theme="dark"] .sidebar-user{border-top:1px solid #45454524}
html[data-theme="dark"] .avatar{background:#25322d}
html[data-theme="dark"] .icon-button:hover{background:#2424241a}
html[data-theme="dark"] .button.small{border-color:#3a504a;background:#27302b}
html[data-theme="dark"] .button.light{background:#23332d;border-color:#45454533}
html[data-theme="dark"] .button.quiet:hover{background:#27302d}
html[data-theme="dark"] .entry-row:hover{background:#272f2b}
html[data-theme="dark"] .income-icon{background:#23342b}
html[data-theme="dark"] .expense-icon{color:#e0b2ae;background:#352422}
html[data-theme="dark"] .auto-icon{background:#222d35}
html[data-theme="dark"] .automatic-row{background:#222d35}
html[data-theme="dark"] .panel-total{background:#25312b}
html[data-theme="dark"] .contribution-list{border-left:1px solid #4545452e}
html[data-theme="dark"] .overview-metrics div{background:#27302d}
html[data-theme="dark"] .folder-summary{background:#242424}
html[data-theme="dark"] .clickable-summary a:hover{background:#272f2b}
html[data-theme="dark"] .folder-add{background:#25312b}
html[data-theme="dark"] .folder-add:hover{background:#26312c}
html[data-theme="dark"] input,html[data-theme="dark"] select,html[data-theme="dark"] textarea{border:1px solid #3c4e48;background:#242424}
html[data-theme="dark"] .password-toggle:hover{background:#272f2c}
html[data-theme="dark"] input:disabled,html[data-theme="dark"] select:disabled{background:#282f2b}
html[data-theme="dark"] .segmented label{border:1px solid #3c4e48}
html[data-theme="dark"] .choice-cards label{border:1px solid #3c4e48}
html[data-theme="dark"] .notice{border:1px solid #374953;color:#aecde0;background:#213036}
html[data-theme="dark"] .danger-zone{border:1px solid #533a37;background:#3c1f1b}
html[data-theme="dark"] .danger-zone summary{color:#e2b1ac}
html[data-theme="dark"] .context-links a + a{border-left:1px solid #3f4b47}
html[data-theme="dark"] .history-head{background:#282f2c}
html[data-theme="dark"] .history-row:hover{background:#25312b}
html[data-theme="dark"] .badge{background:#222e35}
html[data-theme="dark"] .personal-pot-card.savings-pot{border-color:#375348}
html[data-theme="dark"] .personal-pot-card.savings-pot .panel-header{background:#21362b}
html[data-theme="dark"] .password-required{border-color:#534b37;background:#3c331b;color:#eed6a0}
html[data-theme="dark"] .payment-badge{border:1px solid #3c4e48;background:#242424}
html[data-theme="dark"] .payment-badge.overdue{color:#e2b1ac;border-color:#533a37;background:#3c201b}
html[data-theme="dark"] .goal{background:#23332b}
html[data-theme="dark"] .restore-page th{background:#25322e}
html[data-theme="dark"] .quick-dialog{background:#242424}
html[data-theme="dark"] .dialog-head .icon-button{background:#272f2c}
html[data-theme="dark"] .bar-row > div{background:#27302c}
html[data-theme="dark"] .status-pill{background:#282e2b}
html[data-theme="dark"] .flash{border:1px solid #38514a;background:#242424}
html[data-theme="dark"] .login-panel{background:#242424}
@media (max-width: 599px){html[data-theme="dark"] .mobile-nav{background:#242424f7}}
@media (max-width: 599px){html[data-theme="dark"] .contribution-list{border-top:1px solid #4545452e}}
@media (max-width: 599px){html[data-theme="dark"] .form-actions{background:#242424f7}}
html[data-theme="dark"] .account-identity.rental{background:#362d20}
html[data-theme="dark"] .rental-documents > p{color:var(--muted, #aec2e0)}
html[data-theme="dark"] .rental-document-list{border-top:1px solid #375347}
html[data-theme="dark"] .rental-document-row{border-bottom:1px solid #375347}
html[data-theme="dark"] .rental-document-row span{color:var(--muted, #aec2e0)}
html[data-theme="dark"] .rental-table th{background:#272f2b}
html[data-theme="dark"] .rental-amount.expense{color:#e1bcac}
html[data-theme="dark"] .rental-pill.income{color:#a6e7cd;background:#23342b}
html[data-theme="dark"] .rental-pill.expense{color:#e2b9ac;background:#3b261b}
html[data-theme="dark"] .dashboard-card{border:1px solid #385247;background:#242424}
html[data-theme="dark"] .dashboard-card:hover{border-color:#375347}
html[data-theme="dark"] .card-arrange{border-bottom:1px solid #3b4f45;background:#26312a}
html[data-theme="dark"] .card-arrange button{color:#dde4e2}
html[data-theme="dark"] .card-arrange button:hover{background:#25322b;color:#aee0d8}
html[data-theme="dark"] .personal-overview .overview-primary{background:#25322a}
html[data-theme="dark"] .dashboard-backup{border:1px solid #385247;background:#243329;color:#aee0cc}
html[data-theme="dark"] .dashboard-backup.warning{background:#3c311b;border-color:#534a37;color:#ecd0a2}
html[data-theme="dark"] .quick-edit-dialog{border:1px solid #385247}
html[data-theme="dark"] .quick-edit-error{color:#e9a4a4}
html[data-theme="dark"] .compact-income{border-bottom:1px solid #385247}
html[data-theme="dark"] .compact-income .entry-row{border:1px solid #3a5044;background:#242424}
html[data-theme="dark"] .automatic-badge{color:#acc8e2;background:#1b2b3c}
html[data-theme="dark"] .funding-badge{background:var(--surface, #242424)}
html[data-theme="dark"] .funding-badge.funded{color:#a2ecd7;background:#1e392d;border-color:#375346}
html[data-theme="dark"] .home-stats .stat-mint{background:#1c3a2a}
html[data-theme="dark"] .home-space:first-child .panel-header{background:#1b293c}
html[data-theme="dark"] .home-space:last-child .panel-header{background:#261b3c}
html[data-theme="dark"] .colourful-joint .overview-primary{background:linear-gradient(120deg,#1c3b2c,#1b3c28)}
html[data-theme="dark"] .colourful-joint .overview-metrics>div{background:#1b293c}
html[data-theme="dark"] .colourful-joint .overview-metrics>div:nth-child(2){background:#3c1b26}
html[data-theme="dark"] .colourful-joint .overview-metrics>div:nth-child(3){background:#261b3c}
html[data-theme="dark"] .colourful-joint .overview-metrics>div:nth-child(4){background:#1e382b}
html[data-theme="dark"] .folder-card:not(.personal-pot-card):nth-child(3n+1)>.panel-header{background:#1b2a3c}
html[data-theme="dark"] .folder-card:not(.personal-pot-card):nth-child(3n+2)>.panel-header{background:#3c261b}
html[data-theme="dark"] .folder-card:not(.personal-pot-card):nth-child(3n+3)>.panel-header{background:#261b3c}
html[data-theme="dark"] body{background:linear-gradient(145deg,#1b273c,#1b2b3c 65%)}
html[data-theme="dark"] .sidebar{background:#242424}
html[data-theme="dark"] .desktop-nav a{color:#aec0e0}
html[data-theme="dark"] .desktop-nav a:hover,html[data-theme="dark"] .desktop-nav a.active{color:#a0beee;background:#1b293c}
html[data-theme="dark"] .nav-icon-box{background:#1b283c}
html[data-theme="dark"] .desktop-nav a:hover .nav-icon-box,html[data-theme="dark"] .desktop-nav a.active .nav-icon-box{background:#1b2a3c}
html[data-theme="dark"] .nav-copy small,html[data-theme="dark"] .desktop-nav a.active .nav-copy small,html[data-theme="dark"] .sidebar-user small{color:#aec2e0}
html[data-theme="dark"] .sidebar-user .icon-button{color:#aec0e0}
html[data-theme="dark"] .avatar{background:#1b263c;color:#a1bded}
html[data-theme="dark"] .eyebrow{color:#aec0e0}
html[data-theme="dark"] .button.small,html[data-theme="dark"] .button.ghost,html[data-theme="dark"] .button.quiet{background:#1b293c;border-color:#374353;color:#a6c0e8}
html[data-theme="dark"] input,html[data-theme="dark"] select,html[data-theme="dark"] textarea{border-color:#374353}
html[data-theme="dark"] input:focus,html[data-theme="dark"] select:focus,html[data-theme="dark"] textarea:focus{border-color:#374253}
html[data-theme="dark"] button:focus-visible,html[data-theme="dark"] a:focus-visible,html[data-theme="dark"] summary:focus-visible,html[data-theme="dark"] input:focus-visible,html[data-theme="dark"] select:focus-visible{outline-color:#374253}
html[data-theme="dark"] .personal-overview .modern-stat{border:1px solid #45454590}
html[data-theme="dark"] .modern-stat>span{color:#aec2e0}
html[data-theme="dark"] .personal-overview .stat-mint{background:linear-gradient(120deg,#1c3b2c,#1b3c28)}
html[data-theme="dark"] .stat-blue{background:linear-gradient(120deg,#1b2a3c,#1b293c)}
html[data-theme="dark"] .stat-pink{background:linear-gradient(120deg,#3c1b29,#3c1b26)}
html[data-theme="dark"] .stat-lilac{background:linear-gradient(120deg,#281b3c,#291b3c)}
html[data-theme="dark"] .summary-details>summary{color:#aebfe0}
html[data-theme="dark"] .summary-details[open]{background:#242424}
html[data-theme="dark"] .dashboard-card:hover{border-color:#374353}
html[data-theme="dark"] .personal-pot-card .panel-header{background:linear-gradient(120deg,#1b2a3c,#242424)}
html[data-theme="dark"] .personal-pot-card.savings-pot .panel-header{background:linear-gradient(120deg,#1c3b2a,#1b3c26)}
html[data-theme="dark"] .personal-pot-card .pot-toggle::before{background:#1b2a3c}
html[data-theme="dark"] .savings-pot .pot-toggle::before{background:#1d3929}
html[data-theme="dark"] .panel-figure strong{color:#aac0e4}
html[data-theme="dark"] .dashboard-card .folder-add{background:#1b283c;color:#a0bdee}
html[data-theme="dark"] .entry-row:hover{background:#1b293c}
html[data-theme="dark"] .expense-icon{background:#1b293b}
html[data-theme="dark"] .payment-badge{background:#1b283c;border-color:#374353;color:#adc3e1}
html[data-theme="dark"] .payment-badge.paid{background:#203728;color:#abe2c6}
html[data-theme="dark"] .payment-badge.overdue{background:#3c2b1b;color:#eec3a0}
html[data-theme="dark"] .card-arrange{background:#1b273c}
html[data-theme="dark"] .card-arrange button{color:#aec2e0}
html[data-theme="dark"] .summary-card:nth-child(4n+1){background:#1f382a}
html[data-theme="dark"] .summary-card:nth-child(4n+2){background:#1b273c}
html[data-theme="dark"] .summary-card:nth-child(4n+3){background:#3c1b26}
html[data-theme="dark"] .summary-card:nth-child(4n+4){background:#251b3c}
html[data-theme="dark"] .summary-card.hero.negative{background:#3c1c1b}
html[data-theme="dark"] .mobile-nav{background:#242424ed}
html[data-theme="dark"] .mobile-nav a.active{color:#a0bdee;background:#1b2a3c}
html[data-theme="dark"] body{background:linear-gradient(150deg,#282f28,#332e24 58%,#292136)}
html[data-theme="dark"] .sidebar{background:#2b3125}
html[data-theme="dark"] .desktop-nav a{color:#aed5e0}
html[data-theme="dark"] .desktop-nav a:hover,html[data-theme="dark"] .desktop-nav a.active{color:#a1eddd;background:#22352a}
html[data-theme="dark"] .desktop-nav a:hover .nav-icon-box,html[data-theme="dark"] .desktop-nav a.active .nav-icon-box{background:#21362a}
html[data-theme="dark"] .avatar,html[data-theme="dark"] .card-drag-label{background:#223529;color:#a3ebda}
html[data-theme="dark"] .button.small,html[data-theme="dark"] .button.ghost,html[data-theme="dark"] .button.quiet{background:#223527;border-color:#375342;color:#a1eddb}
html[data-theme="dark"] input,html[data-theme="dark"] select,html[data-theme="dark"] textarea{border-color:#385245}
html[data-theme="dark"] input:focus,html[data-theme="dark"] select:focus,html[data-theme="dark"] textarea:focus{border-color:#375348}
html[data-theme="dark"] button:focus-visible,html[data-theme="dark"] a:focus-visible,html[data-theme="dark"] summary:focus-visible,html[data-theme="dark"] input:focus-visible,html[data-theme="dark"] select:focus-visible{outline-color:#375348}
html[data-theme="dark"] .stat-blue,html[data-theme="dark"] .colourful-joint .overview-metrics>div{background:linear-gradient(135deg,#202937,#1d273a)}
html[data-theme="dark"] .stat-pink,html[data-theme="dark"] .colourful-joint .overview-metrics>div:nth-child(2){background:linear-gradient(135deg,#3a291d,#3c2a1b)}
html[data-theme="dark"] .stat-lilac,html[data-theme="dark"] .colourful-joint .overview-metrics>div:nth-child(3){background:linear-gradient(135deg,#282037,#281b3c)}
html[data-theme="dark"] .stat-mint,html[data-theme="dark"] .home-stats .stat-mint,html[data-theme="dark"] .colourful-joint .overview-primary,html[data-theme="dark"] .colourful-joint .overview-metrics>div:nth-child(4){background:linear-gradient(135deg,#22352a,#1e3929)}
html[data-theme="dark"] .home-space:first-child .panel-header,html[data-theme="dark"] .folder-card:not(.personal-pot-card):nth-child(3n+1)>.panel-header{background:#22352a}
html[data-theme="dark"] .home-space:last-child .panel-header,html[data-theme="dark"] .folder-card:not(.personal-pot-card):nth-child(3n+3)>.panel-header{background:#282037}
html[data-theme="dark"] .folder-card:not(.personal-pot-card):nth-child(3n+2)>.panel-header{background:#3a291d}
html[data-theme="dark"] .personal-pot-card .panel-header{background:linear-gradient(120deg,#253229,#242424)}
html[data-theme="dark"] .personal-pot-card.savings-pot .panel-header{background:linear-gradient(120deg,#22352a,#1b3c26)}
html[data-theme="dark"] .panel-figure strong{color:#aee0d4}
html[data-theme="dark"] .dashboard-card .folder-add{background:#233327;color:#a1eddb}
html[data-theme="dark"] .entry-row:hover{background:#233429}
html[data-theme="dark"] .expense-icon,html[data-theme="dark"] .nav-icon-box{background:#253228}
html[data-theme="dark"] .mobile-nav a.active{color:#a1eddb;background:#223529}
@media (hover:hover) and (pointer:fine){html[data-theme="dark"] .dashboard-card:hover{border-color:#375344}}
html[data-theme="dark"] .brand-mark{background:#24242417}
html[data-theme="dark"] .desktop-nav a:hover,html[data-theme="dark"] .desktop-nav a.active{background:#24242416;border-color:#45454515}
html[data-theme="dark"] .desktop-nav a:hover .nav-icon-box,html[data-theme="dark"] .desktop-nav a.active .nav-icon-box{background:#1d3a2f2b}
html[data-theme="dark"] .nav-icon-box{background:#24242410;border-color:#45454515}
html[data-theme="dark"] .sidebar-user{border-color:#45454523}
html[data-theme="dark"] .avatar{background:#1d3a2f;color:#aed0e0}
html[data-theme="dark"] .workspace-topline{border-bottom:1px solid #385246}
html[data-theme="dark"] .account-identity strong{color:#aee0d0}
html[data-theme="dark"] .privacy-control button{border:1px solid #375344;color:#aee0d1;background:#242424}
html[data-theme="dark"] .privacy-control button:hover{border-color:#375347;background:#213529}
html[data-theme="dark"] .privacy-notice{background:#213628;color:#ace2cf}
html[data-theme="dark"] .page-header .eyebrow,html[data-theme="dark"] .section-heading .eyebrow{color:#aee0ce}
html[data-theme="dark"] .context-links a,html[data-theme="dark"] .context-links a+a{background:#242424}
html[data-theme="dark"] .context-links a:hover{color:#a4ead6;background:#223529}
html[data-theme="dark"] .home-hero-figures>div{border:1px solid #45454522}
html[data-theme="dark"] .home-stats .modern-stat{border:1px solid #454545}
html[data-theme="dark"] .home-stats .stat-blue{background:#222b35}
html[data-theme="dark"] .home-stats .stat-pink{background:#3c2b1b}
html[data-theme="dark"] .home-stats .stat-lilac{background:#241b3c}
html[data-theme="dark"] .home-space:first-child .panel-header{background:#213629}
html[data-theme="dark"] .home-space:last-child .panel-header{background:#271c3b}
html[data-theme="dark"] .personal-overview .stat-blue{background:#222b35}
html[data-theme="dark"] .personal-overview .stat-pink{background:#3c2b1b}
html[data-theme="dark"] .personal-overview .stat-lilac{background:#241b3c}
html[data-theme="dark"] .colourful-joint .overview-metrics>div:nth-child(1){background:#213629}
html[data-theme="dark"] .colourful-joint .overview-metrics>div:nth-child(2){background:#3c2b1b}
html[data-theme="dark"] .colourful-joint .overview-metrics>div:nth-child(3){background:#222b35}
html[data-theme="dark"] .colourful-joint .overview-metrics>div:nth-child(4){background:#241b3c}
html[data-theme="dark"] .rental-summary .summary-card{border:1px solid #454545}
html[data-theme="dark"] .rental-summary .summary-card:nth-child(1){background:#213629}
html[data-theme="dark"] .rental-summary .summary-card:nth-child(2){background:#3c2b1b}
html[data-theme="dark"] .rental-summary .summary-card:nth-child(3){background:#222b35}
html[data-theme="dark"] .rental-summary .summary-card:nth-child(4){background:#241b3c}
html[data-theme="dark"] .home-key-figures>div{border:1px solid #375345;background:#253229}
html[data-theme="dark"] .home-key-figures>div:nth-child(2){background:#281e39}
html[data-theme="dark"] .home-key-figures>div:nth-child(3){background:#1f2f37}
html[data-theme="dark"] .home-key-figures span{color:#dde4e3}
html[data-theme="dark"] .home-key-figures strong{color:#aed0e0}
html[data-theme="dark"] .home-quick-actions a{border:1px solid #375343;background:#242424;color:#a7e7d7}
html[data-theme="dark"] .home-quick-actions a:hover{background:#21362a}
html[data-theme="dark"] .home-detail-card{border:1px solid #38514a;background:#242424}
html[data-theme="dark"] .home-detail-heading{border-bottom:1px solid #385245}
html[data-theme="dark"] .home-detail-heading>a{color:#a4ead6}
html[data-theme="dark"] .home-detail-heading>small{color:#dde4e2}
html[data-theme="dark"] .home-bill,html[data-theme="dark"] .home-change,html[data-theme="dark"] .all-entry-row{border-bottom:1px solid #3c4d45;color:#aed3e0}
html[data-theme="dark"] .home-bill:hover,html[data-theme="dark"] .home-change:hover,html[data-theme="dark"] .all-entry-row:hover{background:#233327}
html[data-theme="dark"] .bill-day{background:#26312d;color:#ace2cf}
html[data-theme="dark"] .bill-copy small,html[data-theme="dark"] .home-change small,html[data-theme="dark"] .all-entry-row small{color:#dde4e3}
html[data-theme="dark"] .home-bill b{color:#aed6e0}
html[data-theme="dark"] .home-bill>span:last-child,html[data-theme="dark"] .home-change>span:last-child{color:#dde4e2}
html[data-theme="dark"] .change-dot{background:#22342d}
html[data-theme="dark"] .change-dot.joint{background:#2a1e38}
html[data-theme="dark"] .home-empty,html[data-theme="dark"] .home-more{color:#dee3e2}
html[data-theme="dark"] .home-more{border-top:1px solid #3c4d45}
html[data-theme="dark"] .home-note{color:#dde4e2}
html[data-theme="dark"] .all-entry-filters label{color:#dde4e3}
html[data-theme="dark"] .all-entry-row.is-archived{background:#262621}
html[data-theme="dark"] .all-entry-date small{color:#dee3e2}
html[data-theme="dark"] .all-entry-date time{color:#aee0d5}
html[data-theme="dark"] .all-entry-icon{background:#263129}
html[data-theme="dark"] .all-entry-row>a,html[data-theme="dark"] .all-entry-row form{color:#a4ead6}
@media (min-width:1180px){html[data-theme="dark"] .personal-workspace>.personal-income-panel{border:1px solid #375345;background:#242424}}
@media (min-width:1180px){html[data-theme="dark"] .personal-workspace>.personal-income-panel .panel-total{border-top:1px solid #395145}}
html[data-theme="dark"] .personal-funding-metrics>div{background:#203729}
html[data-theme="dark"] .personal-funding-metrics>div:nth-child(2){background:#3c2a1b}
html[data-theme="dark"] .personal-funding-metrics span{color:#aee0cf}
html[data-theme="dark"] .welcome-example,html[data-theme="dark"] .welcome-safety{background:#242424}
html[data-theme="dark"] .welcome-steps a{background:#242424}
html[data-theme="dark"] .welcome-steps a:hover{border-color:#375345}
html[data-theme="dark"] .summary-details[open],html[data-theme="dark"] .joint-plan-details[open]{background:#242424}
html[data-theme="dark"] .plan-insight-grid>div{background:#26312b}
html[data-theme="dark"] .plan-insight-grid span{color:#dde4e2}
html[data-theme="dark"] .plan-watch p{border-bottom:1px solid #375345}
html[data-theme="dark"] .login-monitor-item{background:#27302b}
html[data-theme="dark"] .login-monitor-item small,html[data-theme="dark"] .login-monitor-item p{color:#dee3e2}
html[data-theme="dark"] .security-alert{border:1px solid #534a37;background:#3c321b;color:#eecda0}
html[data-theme="dark"] .security-event{background:#27302b}
html[data-theme="dark"] .security-event-icon{background:#22352a;color:#a1eddb}
html[data-theme="dark"] .security-event-icon.failed{background:#3c2e1b;color:#eecca0}
html[data-theme="dark"] .security-event-icon.locked{background:#3c1c1b;color:#e8a6a6}
html[data-theme="dark"] .security-event-icon.unlocked{background:#202937;color:#a9c2e5}
html[data-theme="dark"] .security-event small{color:#dee3e2}
html[data-theme="dark"] .security-event time{color:#dee3e2}
@media (min-width:1101px){html[data-theme="dark"] .workspace-topline:has(.workspace-month){background:#27302bef}}
html[data-theme="dark"] .funding-progress{border:1px solid var(--mb-line,#375345);background:var(--surface,#242424);color:var(--ink,#aed0e0)}
html[data-theme="dark"] .folder-card>.funding-progress{border-bottom:1px solid var(--mb-line,#375345)}
html[data-theme="dark"] .funding-progress-heading>span{color:var(--muted,#dde4e3)}
html[data-theme="dark"] .funding-progress-figures span{color:var(--muted,#dde4e3)}
html[data-theme="dark"] .funding-progress small{color:var(--muted,#dde4e3)}
html[data-theme="dark"] :is(.panel,.summary-card,.overview-primary,.modern-stat,.overview-metrics>div,.home-key-figures>div,.home-detail-card,.home-hero-figures>div,.dashboard-card,.welcome-example,.welcome-safety,.welcome-steps a,.compact-income,.compact-income .entry-row,.rental-hero,.rental-breakdown>div,.plan-insight-grid>div,.comparison>div,.login-monitor-item,.security-event,.choice-cards label){border-color:color-mix(in srgb,var(--mb-line,#375345) 88%,#454545 12%)}
html[data-theme="dark"] .rental-hero{border:1px solid #45454524;background:radial-gradient(circle at 86% -25%,#1d3a2f52 0 28%,transparent 29%),
    linear-gradient(135deg,#172c36 0%,#1c4d43 100%)}
html[data-theme="dark"] .rental-stat-icon{border:1px solid #454545a8;background:#2424248f}
html[data-theme="dark"] .rental-breakdown>div{border:1px solid var(--mb-line,#375345);background:linear-gradient(145deg,#242424,#25312b)}
html[data-theme="dark"] .rental-ledger-card>.panel-header{border-bottom:1px solid var(--mb-line,#375345);background:linear-gradient(135deg,#22352a,#20362a)}
html[data-theme="dark"] .rental-ledger-card.expense-ledger>.panel-header{background:linear-gradient(135deg,#3a291d,#3c291b)}
html[data-theme="dark"] .rental-ledger-card>.panel-total{background:linear-gradient(135deg,#23332b,#242424)}
html[data-theme="dark"] .overview-metrics>div,html[data-theme="dark"] .home-key-figures>div,html[data-theme="dark"] .home-hero-figures>div,html[data-theme="dark"] .plan-insight-grid>div,html[data-theme="dark"] .comparison>div,html[data-theme="dark"] .compact-income .entry-row,html[data-theme="dark"] .rental-breakdown>div{border:1px solid color-mix(in srgb,var(--mb-line,#375345) 82%,#454545 18%)}
@media (hover:hover) and (pointer:fine){html[data-theme="dark"] :is(.folder-card,.welcome-steps a):hover{border-color:color-mix(in srgb,var(--mb-green,#146653) 34%,var(--mb-line,#375345))}}
html[data-theme="dark"] .entry-control.state-overdue{background:linear-gradient(90deg,#3c1f1b 0,transparent 28%)}
html[data-theme="dark"] .entry-control.state-due_soon{background:linear-gradient(90deg,#3c301b 0,transparent 28%)}
html[data-theme="dark"] .attention-strip{border:1px solid var(--mb-line,#375345);background:linear-gradient(145deg,#23332e,#24332c)}
html[data-theme="dark"] .attention-strip.all-clear{background:linear-gradient(145deg,#203729,#213629)}
html[data-theme="dark"] .attention-strip.all-clear>p{color:var(--muted,#dde4e3)}
html[data-theme="dark"] .attention-heading small{color:var(--muted,#dde4e3)}
html[data-theme="dark"] .attention-item{border:1px solid #375347;color:var(--ink,#aed0e0);background:var(--surface,#242424)}
html[data-theme="dark"] .attention-open-label{color:var(--mb-green,#a1eddb)}
html[data-theme="dark"] .attention-dismiss{color:var(--muted,#dde4e3)}
html[data-theme="dark"] .attention-dismiss:hover{color:var(--ink,#aed0e0);background:#242424a8}
html[data-theme="dark"] .attention-item.warning{border-color:#534a37;background:#3c311b}
html[data-theme="dark"] .attention-item.danger{border-color:#533b37;background:#3c201b}
html[data-theme="dark"] .attention-item.info{border-color:#374353;background:#1b293c}
html[data-theme="dark"] .attention-item small{color:var(--muted,#dde4e3)}
html[data-theme="dark"] .attention-dismissed-empty{color:var(--muted,#dde4e3)}
html[data-theme="dark"] .category-art-shell{background:linear-gradient(145deg,#23332b,#26312c)!important}
html[data-theme="dark"] .pot-art-shell{background:linear-gradient(145deg,#242424,#24332b)}
html[data-theme="dark"] .attention-icon{background:#242424b8}
html[data-theme="dark"] .receipt-chip.attached{color:#a0eeda;background:#1f382a}
html[data-theme="dark"] .receipt-chip.missing{color:#eebfa0;background:#3c2f1b}
html[data-theme="dark"] .receipt-chip.neutral{color:#aec7e0;background:#1b283c}
html[data-theme="dark"] .rental-document-row{border:1px solid var(--mb-line,#375345)!important;background:linear-gradient(145deg,#242424,#25322b)}
html[data-theme="dark"] .rental-document-copy span{color:var(--muted,#dde4e3)}
html[data-theme="dark"] .attention-actions button{color:var(--green,#a1eddb)}
html[data-theme="dark"] .status-hero>span{background:var(--mint,#1e392b)}
html[data-theme="dark"] .status-hero.warning>span{background:var(--sand,#3c2f1b)}
html[data-theme="dark"] body{background:radial-gradient(circle at 78% -15%,#23342b 0,transparent 31%),linear-gradient(150deg,#282f28,#332e24 58%,#292136)}
html[data-theme="dark"] .desktop-nav a::before{background:#1d3a2f}
html[data-theme="dark"] .panel,html[data-theme="dark"] .summary-card,html[data-theme="dark"] .modern-stat,html[data-theme="dark"] .folder-card,html[data-theme="dark"] .home-detail-card,html[data-theme="dark"] .rental-ledger-card{border-color:color-mix(in srgb,var(--mb-line) 82%,#454545)}
html[data-theme="dark"] .home-hero::after{border:1px solid #45454518}
html[data-theme="dark"] .home-plan-ring{background:conic-gradient(#1d3a2f 0 var(--personal-angle),#3c2f1b var(--personal-angle) calc(var(--personal-angle) + var(--joint-angle)),#2424242b calc(var(--personal-angle) + var(--joint-angle)) 360deg)}
html[data-theme="dark"] .home-plan-ring.is-private{background:conic-gradient(#24242438 0 360deg)}
html[data-theme="dark"] .home-key-figures>a{border:1px solid #375345;background:linear-gradient(145deg,#23332b,#25322a)}
html[data-theme="dark"] .home-key-figures>a:nth-child(2){background:linear-gradient(145deg,#291e39,#271d39)}
html[data-theme="dark"] .home-key-figures>a:nth-child(3){background:linear-gradient(145deg,#1d303a,#202f36)}
html[data-theme="dark"] .home-key-figures>a>span{color:#dde4e3}
html[data-theme="dark"] .home-key-figures>a>strong{color:#aed0e0}
html[data-theme="dark"] .home-key-figures>a>small{color:#aee0cc}
html[data-theme="dark"] .attention-strip::before,html[data-theme="dark"] .home-detail-card::before{background:linear-gradient(90deg,#1f382f,#1f372f 46%,transparent)}
html[data-theme="dark"] .entry-journey li{background:#242424b8}
html[data-theme="dark"] .entry-create-summary{border:1px solid #45454580}
html[data-theme="dark"] .entry-create-summary dl>div{border:1px solid #45454518;background:#2424240d}
html[data-theme="dark"] .entry-template-strip{background:linear-gradient(145deg,#22352a,#25322b)}
html[data-theme="dark"] .entry-template-card{background:linear-gradient(145deg,#242424,#25322b)}
html[data-theme="dark"] .entry-template-card.selected{border-color:#375349;background:linear-gradient(145deg,#1f382c,#1f382b)}
html[data-theme="dark"] .duplicate-warning{border:1px solid #534837;color:#e6cda7;background:linear-gradient(145deg,#3c331b,#3c321b)}
html[data-theme="dark"] .attachment-field{background:linear-gradient(145deg,#25322e,#25322c)}
html[data-theme="dark"] .rental-performance{background:linear-gradient(145deg,#242424,#26312b)}
html[data-theme="dark"] .rental-performance-track{background:#22352a}
html[data-theme="dark"] .rental-performance-track>span{background:linear-gradient(90deg,#3b2e1c,#de725f)}
html[data-theme="dark"] .rental-performance>small i,html[data-theme="dark"] .rental-performance>small b{background:#3b2e1c}
html[data-theme="dark"] .rental-performance>small b{background:#1f382f}
html[data-theme="dark"] .rental-ledger-card>.panel-header::before{background:#1f382f}
html[data-theme="dark"] .rental-ledger-card.expense-ledger>.panel-header::before{background:#3b2e1c}
html[data-theme="dark"] .empty-state>span,html[data-theme="dark"] .rental-empty>span{border:1px solid #454545;background:linear-gradient(145deg,#23332a,#24332c)}
html[data-theme="dark"] body{background:radial-gradient(circle at 84% -10%,#22342b 0,transparent 29%),
    radial-gradient(circle at 95% 92%,#281f38 0,transparent 24%),
    var(--mb-page)}
html[data-theme="dark"] .brand-mark{background:#24242414}
html[data-theme="dark"] .nav-icon-box{background:linear-gradient(145deg,#2424241f,#2424240c)}
html[data-theme="dark"] .mobile-nav-icon{color:#aee0d6;border:1px solid #375347;background:linear-gradient(145deg,#242424,#25322b)}
html[data-theme="dark"] .mobile-nav a.active .mobile-nav-icon{color:#a1eddb;background:linear-gradient(145deg,#1f382c,#21362b)}
html[data-theme="dark"] .folder-card .pot-toggle::before{color:color-mix(in srgb,var(--pot-accent) 82%,#aed0e0);background:linear-gradient(145deg,color-mix(in srgb,var(--pot-accent) 26%,#242424),color-mix(in srgb,var(--pot-accent) 13%,#242424));border:1px solid color-mix(in srgb,var(--pot-accent) 25%,#454545)}
html[data-theme="dark"] .entry-icon{background:linear-gradient(145deg,#242424,#26312c)}
html[data-theme="dark"] .entry-control:hover{background:linear-gradient(90deg,color-mix(in srgb,var(--pot-accent,#1f382f) 6%,var(--mb-surface)),var(--mb-surface))}
html[data-theme="dark"] .mobile-nav a.active .mobile-nav-icon:has(.soft-nav-art){background:radial-gradient(circle,#1f382d 0,transparent 70%)}
html[data-theme="dark"] .update-pill button{background:#1d3a30;color:#a2ecd7}
/* ===== end generated dark theme ===== */
/* Dark theme: html[data-theme="dark"] is set before paint by base.html (system or the sun/moon choice). */
html[data-theme="dark"] .category-art-shell { background:linear-gradient(145deg,#2c3c3a,#172321)!important; box-shadow:inset 0 1px 0 #ffffff18,0 4px 12px #0006!important; }
html[data-theme="dark"] .category-art-shell .category-art { filter:drop-shadow(0 3px 5px #0007) saturate(.96); }
html[data-theme="dark"] .pot-art-shell { background:linear-gradient(145deg,#2c3c3a,#172321); box-shadow:inset 0 1px 0 #ffffff18,0 4px 12px #0006; }

/* Shared professional tools: Home customisation, health checks and receipt vault. */
.home-configurable-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem;margin-top:1rem;align-items:start}.home-configurable-wide{grid-column:1/-1;margin:0}.home-density-compact{gap:.65rem}.home-density-compact :is(.home-detail-card,.attention-strip){padding:.85rem}.attention-actions{display:flex;justify-content:flex-end;padding:.15rem .7rem .55rem}.attention-actions form{display:flex;gap:.35rem}.attention-actions button{border:0;background:transparent;color:var(--green,#146653);font:inherit;font-weight:700;padding:.5rem;border-radius:.65rem;cursor:pointer}.attention-actions button:hover{background:color-mix(in srgb,var(--green,#146653) 9%,transparent)}
.home-layout-editor{max-width:850px}.home-layout-editor form{display:grid;gap:1rem}.home-layout-list{list-style:none;padding:0;margin:0;display:grid;gap:.65rem}.home-layout-list li{display:grid;grid-template-columns:auto 1fr auto auto;align-items:center;gap:.85rem;padding:1rem;border:1px solid var(--line);border-radius:1rem;background:var(--surface)}.home-layout-list li>span:first-child{font-size:1.45rem}.home-layout-list li span:nth-child(2){display:grid}.home-layout-list small{color:var(--muted)}.home-layout-buttons{display:flex;gap:.35rem}.switch-label{display:flex;gap:.35rem;align-items:center}.home-layout-editor fieldset{display:flex;flex-wrap:wrap;gap:1rem;border:1px solid var(--line);border-radius:1rem;padding:1rem}.home-layout-editor fieldset label{display:flex;gap:.45rem;align-items:center}
.professional-status-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem;margin-bottom:1rem}.status-hero{display:flex;align-items:center;gap:1rem}.status-hero>span{display:grid;place-items:center;width:3rem;height:3rem;border-radius:1rem;background:var(--mint,#dcf5e8);font-size:1.5rem}.status-hero.warning>span{background:var(--sand,#fff0d8)}.status-hero h2,.professional-list h2{margin:.1rem 0}.status-timeline{display:grid}.status-timeline>div{display:grid;grid-template-columns:auto 1fr auto;gap:.7rem;align-items:center;padding:.8rem 0;border-bottom:1px solid var(--line)}.status-timeline time{color:var(--muted)}.professional-list{display:grid;gap:.75rem}.professional-list article{display:grid;grid-template-columns:auto 1fr auto;gap:1rem;align-items:center}.professional-list article p{margin:.3rem 0;color:var(--muted)}.receipt-vault-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:.65rem}.receipt-vault-grid a{display:grid;grid-template-columns:auto 1fr;gap:.15rem .65rem;padding:.8rem;border:1px solid var(--line);border-radius:.9rem;text-decoration:none;color:inherit}.receipt-vault-grid a span{grid-row:1/3;font-size:1.35rem}.receipt-vault-grid small{color:var(--muted)}
@media(max-width:760px){.home-configurable-grid,.professional-status-grid{grid-template-columns:1fr}.home-configurable-wide{grid-column:auto}.home-layout-list li{grid-template-columns:auto 1fr}.home-layout-list .switch-label,.home-layout-buttons{grid-column:2}.professional-list article{grid-template-columns:auto 1fr}.professional-list article .button{grid-column:2}.status-timeline>div{grid-template-columns:auto 1fr}.status-timeline time{grid-column:2}}
@media(prefers-reduced-motion:reduce){.home-layout-list li{scroll-behavior:auto}}

/* ===== premium ===== */
/* MyBudget premium design system.
   This file is deliberately loaded last: it aligns the mature Personal,
   Joint, Rental and Home surfaces without changing their budgeting logic. */
:root {
  --mb-space-1:4px;
  --mb-space-2:8px;
  --mb-space-3:12px;
  --mb-space-4:16px;
  --mb-space-5:24px;
  --mb-space-6:32px;
  --mb-radius-sm:10px;
  --mb-radius-md:15px;
  --mb-radius-lg:21px;
  --mb-radius-xl:28px;
  --mb-ease:cubic-bezier(.2,.78,.24,1);
  --mb-shadow-low:inset 0 1px 0 #ffffffd9,0 2px 5px #172c3610,0 7px 18px #172c360b;
  --mb-shadow-mid:inset 0 1px 0 #ffffffe6,inset 0 -1px 0 #172c3609,0 4px 8px #172c3612,0 16px 34px #172c3613;
  --mb-shadow-high:inset 0 1px 0 #ffffffef,inset 0 -1px 0 #172c3610,0 7px 13px #172c3615,0 24px 48px #172c361c;
  --mb-identity-0:#35a981;
  --mb-identity-1:#7189d6;
  --mb-identity-2:#d89a42;
  --mb-identity-3:#907bd5;
  --mb-identity-4:#d66e7f;
  --mb-identity-5:#4f9eb3;
}

html { scroll-behavior:smooth; }
body { background:radial-gradient(circle at 78% -15%,#e5f3ec 0,transparent 31%),linear-gradient(150deg,#f3f6f3,#f8f6f2 58%,#f5f2fa); }
.main-content { isolation:isolate; }
h1,h2,h3,.overview-total,.panel-figure strong,.summary-card strong { text-wrap:balance; }
.entry-amount,.overview-total,.modern-stat>strong,.summary-card>strong,.home-hero strong,.home-key-figures strong,.rental-performance strong { font-variant-numeric:tabular-nums lining-nums; }

/* Clear navigation: a stable active rail plus one icon language. */
.desktop-nav a { position:relative; overflow:hidden; transition:background 170ms ease,color 170ms ease,transform 170ms var(--mb-ease); }
.desktop-nav a::before { content:""; position:absolute; inset:13px auto 13px 0; width:3px; border-radius:0 4px 4px 0; background:#67d9b0; opacity:0; transform:scaleY(.35); transition:opacity 170ms ease,transform 170ms var(--mb-ease); }
.desktop-nav a.active::before { opacity:1; transform:scaleY(1); }
.desktop-nav a.active .nav-icon-box { box-shadow:inset 0 1px 0 #ffffff35,0 5px 12px #071b2230; }
.mobile-nav a { position:relative; }
.mobile-nav a.active::after { content:""; position:absolute; left:34%; right:34%; bottom:4px; height:3px; border-radius:3px; background:var(--mb-green); }

/* Depth is hierarchical: hero, working card, then list row. */
:is(.home-hero,.overview-primary,.rental-hero) { box-shadow:var(--mb-shadow-high); }
:is(.folder-card,.rental-ledger-card,.home-detail-card,.entry-create-form,.settings-card,.welcome-example,.welcome-safety) { box-shadow:var(--mb-shadow-mid); }
:is(.summary-card,.modern-stat,.overview-metrics>div,.home-key-figures>a,.rental-breakdown>div,.compact-income .entry-row,.menu-section) { box-shadow:var(--mb-shadow-low); }
.panel,.summary-card,.modern-stat,.folder-card,.home-detail-card,.rental-ledger-card { border-color:color-mix(in srgb,var(--mb-line) 82%,#fff); }

/* Home: the single dominant story, followed by compact actionable figures. */
.home-hero { grid-template-columns:minmax(0,1.2fr) minmax(390px,.8fr); align-items:center; position:relative; }
.home-hero::after { content:""; position:absolute; width:310px; height:310px; right:-150px; top:-180px; border:1px solid #ffffff18; border-radius:50%; box-shadow:0 0 0 42px #ffffff08,0 0 0 84px #ffffff06; pointer-events:none; }
.home-hero-visual { display:grid; grid-template-columns:112px minmax(0,1fr); align-items:center; gap:14px; min-width:0; }
.home-plan-ring { position:relative; display:grid; place-items:center; width:108px; aspect-ratio:1; border-radius:50%; background:conic-gradient(#67d9b0 0 var(--personal-angle),#efca91 var(--personal-angle) calc(var(--personal-angle) + var(--joint-angle)),#ffffff2b calc(var(--personal-angle) + var(--joint-angle)) 360deg); box-shadow:inset 0 0 0 1px #ffffff21,0 12px 24px #071c2738; }
.home-plan-ring::before { content:""; position:absolute; inset:12px; border-radius:50%; background:linear-gradient(145deg,#254a42,#172c36); box-shadow:inset 0 2px 9px #071c2770,0 1px 0 #ffffff1f; }
.home-plan-ring>span { position:relative; z-index:1; display:grid; justify-items:center; max-width:75px; text-align:center; }
.home-plan-ring b { max-width:100%; color:#fff; font-size:.9rem; overflow:hidden; text-overflow:ellipsis; }
.home-plan-ring small { color:#b9d8d0; font-size:.6rem; letter-spacing:.04em; }
.home-plan-ring.is-private { background:conic-gradient(#ffffff38 0 360deg); }
.home-hero-figures { min-width:0; }
.home-key-figures { margin-bottom:14px; }
.home-key-figures>a { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:3px 12px; min-width:0; padding:13px 15px; border:1px solid #dbe7e1; border-radius:15px; color:inherit; background:linear-gradient(145deg,#fbfdfc,#f3f8f5); text-decoration:none; transition:transform 170ms var(--mb-ease),box-shadow 170ms ease,border-color 170ms ease; }
.home-key-figures>a:nth-child(2) { background:linear-gradient(145deg,#faf8fd,#f1ecfa); }
.home-key-figures>a:nth-child(3) { background:linear-gradient(145deg,#f7fbfd,#e9f2f7); }
.home-key-figures>a>span { color:#49625f; font-size:.78rem; font-weight:720; }
.home-key-figures>a>strong { grid-row:1/3; grid-column:2; color:#172c36; font-size:1.12rem; white-space:nowrap; }
.home-key-figures>a>small { color:#456357; font-size:.66rem; font-weight:720; }
.attention-strip,.home-detail-card { overflow:hidden; }
.attention-strip::before,.home-detail-card::before { content:""; display:block; height:3px; background:linear-gradient(90deg,#35a981,#75d2b1 46%,transparent); }
.attention-grid { grid-template-columns:repeat(auto-fit,minmax(300px,1fr)); }
.attention-item { display:grid; grid-template-columns:minmax(0,1fr); align-items:stretch; gap:0; padding:7px; }
.attention-open { min-width:0; }
.attention-actions { margin-top:2px; padding:5px 5px 2px; border-top:1px solid color-mix(in srgb,var(--mb-line) 80%,transparent); }
.attention-actions form { margin-left:auto; }

/* Stable account identity survives reordering and makes scanning much faster. */
.folder-card { --pot-accent:var(--mb-identity-0); position:relative; overflow:hidden; }
.folder-card:is(.pot-identity-0,.folder-identity-0) { --pot-accent:var(--mb-identity-0); }
.folder-card:is(.pot-identity-1,.folder-identity-1) { --pot-accent:var(--mb-identity-1); }
.folder-card:is(.pot-identity-2,.folder-identity-2) { --pot-accent:var(--mb-identity-2); }
.folder-card:is(.pot-identity-3,.folder-identity-3) { --pot-accent:var(--mb-identity-3); }
.folder-card:is(.pot-identity-4,.folder-identity-4) { --pot-accent:var(--mb-identity-4); }
.folder-card:is(.pot-identity-5,.folder-identity-5) { --pot-accent:var(--mb-identity-5); }
.folder-card::before { content:""; position:absolute; inset:0 auto 0 0; z-index:3; width:4px; background:var(--pot-accent); box-shadow:2px 0 10px color-mix(in srgb,var(--pot-accent) 35%,transparent); pointer-events:none; }
.folder-card>.panel-header { position:relative; padding-left:18px; }
.folder-card>.panel-header::after { content:""; position:absolute; left:18px; bottom:0; width:38px; height:3px; border-radius:3px 3px 0 0; background:var(--pot-accent); }
.folder-card .pot-toggle::before { box-shadow:inset 0 1px 0 #fff,0 4px 10px color-mix(in srgb,var(--pot-accent) 22%,transparent); }

/* New entry is a short guided journey with a live, sticky review. */
.entry-create-page { max-width:1120px; }
.entry-journey { counter-reset:none; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:9px; margin:0 0 14px; padding:0; list-style:none; }
.entry-journey li { position:relative; display:grid; grid-template-columns:34px minmax(0,1fr); gap:1px 9px; align-items:center; min-width:0; padding:10px 12px; border:1px solid var(--mb-line); border-radius:14px; background:#ffffffb8; box-shadow:var(--mb-shadow-low); }
.entry-journey li::after { content:""; position:absolute; top:50%; right:-10px; width:10px; height:1px; background:var(--mb-line); }
.entry-journey li:last-child::after { display:none; }
.entry-journey li>span { grid-row:1/3; display:grid; place-items:center; width:34px; height:34px; border-radius:11px; color:#fff; background:var(--mb-green); box-shadow:inset 0 1px 0 #ffffff65,0 5px 11px #14665324; font-weight:850; }
.entry-journey li:nth-child(2)>span { background:#4c63b0; }
.entry-journey li:nth-child(3)>span { background:#6a52b3; }
.entry-journey strong { font-size:.82rem; }
.entry-journey small { color:var(--muted); font-size:.66rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.entry-create-form { padding:20px; }
.entry-create-summary { align-self:start; padding:18px; border:1px solid #ffffff80; border-radius:18px; background:linear-gradient(145deg,#172c36,#28584c); color:#fff; box-shadow:var(--mb-shadow-high); }
.entry-create-summary h2 { margin:5px 0; color:#fff; font-size:1.25rem; }
.entry-create-summary>p:not(.eyebrow) { margin:0 0 15px; color:#c7d9d4; font-size:.8rem; }
.entry-create-summary .eyebrow { color:#c6f3df; }
.entry-create-summary dl { display:grid; gap:8px; margin:0; }
.entry-create-summary dl>div { padding:10px 11px; border:1px solid #ffffff18; border-radius:12px; background:#ffffff0d; }
.entry-create-summary dt { color:#d2e8e1; font-size:.64rem; font-weight:780; letter-spacing:.08em; text-transform:uppercase; }
.entry-create-summary dd { margin:4px 0 0; color:#fff; font-size:.86rem; font-weight:680; overflow-wrap:anywhere; }
.entry-create-summary [data-preview-amount] { color:#8ae4c0; font-size:1.25rem; font-variant-numeric:tabular-nums; }
.entry-create-summary>small { display:block; margin-top:14px; color:#c8ddd6; font-size:.68rem; line-height:1.5; }
.entry-create-form .form-actions { grid-column:1/-1; }
.entry-template-strip { display:grid; grid-template-columns:minmax(180px,.45fr) minmax(0,1.55fr); gap:16px; align-items:center; margin-bottom:14px; padding:15px; border:1px solid var(--mb-line); border-radius:18px; background:linear-gradient(145deg,#f6fbf8,#edf5f1); box-shadow:var(--mb-shadow-low); }
.entry-template-strip h2 { margin:3px 0; font-size:1rem; }
.entry-template-strip p { margin:3px 0; color:var(--muted); font-size:.72rem; }
.entry-template-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.entry-template-card { display:grid; grid-template-columns:42px minmax(0,1fr) auto; align-items:center; gap:9px; min-height:60px; padding:8px 10px; border:1px solid var(--mb-line); border-radius:14px; color:var(--ink); background:linear-gradient(145deg,#fff,#f6faf8); box-shadow:var(--mb-shadow-low); text-align:left; cursor:pointer; transition:transform 170ms var(--mb-ease),border-color 170ms ease,box-shadow 170ms ease; }
.entry-template-card>img { width:40px; height:40px; object-fit:contain; filter:drop-shadow(0 4px 5px #172c3622); }
.entry-template-card span { min-width:0; }
.entry-template-card strong,.entry-template-card small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.entry-template-card strong { font-size:.78rem; }
.entry-template-card small { margin-top:3px; color:var(--muted); font-size:.65rem; }
.entry-template-card b { color:var(--mb-green); font-size:.68rem; }
.entry-template-card.selected { border-color:#35a981; background:linear-gradient(145deg,#effaf5,#dcf4e8); box-shadow:0 0 0 2px #35a98122,var(--mb-shadow-mid); }
.duplicate-warning { display:grid; grid-template-columns:58px minmax(0,1fr); gap:12px; align-items:center; margin-bottom:14px; padding:13px 15px; border:1px solid #e5ae58; border-radius:17px; color:#5d421a; background:linear-gradient(145deg,#fff9e9,#fff0cd); box-shadow:var(--mb-shadow-low); }
.duplicate-warning img { width:56px; height:56px; object-fit:contain; }
.duplicate-warning p { margin:4px 0; font-size:.76rem; }
.attachment-field { padding:14px; border:1px solid var(--mb-line); border-radius:15px; background:linear-gradient(145deg,#f8fbfa,#eef5f2); }
.attachment-picker { display:grid; grid-template-columns:52px minmax(0,1.2fr) minmax(170px,.8fr); gap:12px; align-items:end; }
.attachment-picker>img { width:50px; height:50px; align-self:center; object-fit:contain; }
.attachment-picker label { min-width:0; }
.attachment-field>small { display:block; margin-top:8px; color:var(--muted); }
.entry-documents { margin-top:16px; }
.entry-documents>.panel-header>img { width:64px; height:64px; object-fit:contain; }
.document-upload { display:grid; grid-template-columns:minmax(0,1fr) minmax(170px,.45fr) auto; gap:12px; align-items:end; }
.document-upload label { display:grid; gap:6px; min-width:0; font-size:.74rem; font-weight:720; }
.template-applied { animation:mb-template-applied 420ms var(--mb-ease); }
.entry-created { position:relative; z-index:1; animation:mb-entry-created 1.15s var(--mb-ease) 2; }
@keyframes mb-template-applied { 0%{transform:scale(.995);box-shadow:0 0 0 0 #35a98100} 45%{transform:scale(1.003);box-shadow:0 0 0 4px #35a98124,var(--mb-shadow-high)} 100%{transform:none;box-shadow:var(--mb-shadow-mid)} }
@keyframes mb-entry-created { 0%,100%{box-shadow:inset 3px 0 #35a981} 45%{box-shadow:inset 5px 0 #35a981,0 0 0 4px #65d5ac4d,0 12px 30px #14665324} }
@media(min-width:900px) {
  .entry-create-form { grid-template-columns:minmax(0,1fr) 286px; align-items:start; gap:22px; }
  .entry-create-main { grid-column:1; }
  .entry-create-summary { grid-column:2; position:sticky; top:86px; }
}

/* Rental reads as an annual financial workspace, not a pair of long lists. */
.rental-performance { display:grid; grid-template-columns:minmax(220px,.62fr) minmax(260px,1.38fr); align-items:center; gap:7px 20px; margin:-2px 0 16px; padding:13px 16px; border:1px solid var(--mb-line); border-radius:16px; background:linear-gradient(145deg,#fff,#f4f8f6); box-shadow:var(--mb-shadow-low); }
.rental-performance>div:first-child { grid-row:1/3; }
.rental-performance span,.rental-performance strong { display:block; }
.rental-performance span { color:var(--muted); font-size:.7rem; font-weight:740; }
.rental-performance strong { margin-top:3px; font-size:.92rem; }
.rental-performance-track { height:10px; overflow:hidden; border-radius:99px; background:#dff1e7; box-shadow:inset 0 2px 4px #172c361a; }
.rental-performance-track>span { height:100%; border-radius:inherit; background:linear-gradient(90deg,#d89a42,#de725f); box-shadow:inset 0 1px 0 #ffffff75; }
.rental-performance>small { display:flex; flex-wrap:wrap; align-items:center; gap:5px 8px; color:var(--muted); font-size:.66rem; }
.rental-performance>small i,.rental-performance>small b { width:8px; height:8px; border-radius:50%; background:#d89a42; }
.rental-performance>small b { background:#35a981; }
.rental-ledger-card>.panel-header { position:relative; }
.rental-ledger-card>.panel-header::before { content:""; position:absolute; inset:0 auto 0 0; width:4px; background:#35a981; }
.rental-ledger-card.expense-ledger>.panel-header::before { background:#d89a42; }

/* Professional finishing: intentional interaction, loading and empty states. */
.button,.home-quick-actions a,.folder-add,.entry-row,.home-bill,.home-change { transition:transform 160ms var(--mb-ease),box-shadow 160ms ease,background 160ms ease,border-color 160ms ease; }
.empty-state,.rental-empty,.home-empty { position:relative; }
.empty-state>span,.rental-empty>span { display:grid; place-items:center; width:50px; height:50px; margin-inline:auto; border:1px solid #ffffff; border-radius:17px; background:linear-gradient(145deg,#edf6f1,#dfeee7); box-shadow:var(--mb-shadow-low); }
.button[aria-busy="true"],button[disabled] { cursor:wait; opacity:.72; }
.button[aria-busy="true"]::after { content:""; width:14px; height:14px; margin-left:8px; border:2px solid currentColor; border-right-color:transparent; border-radius:50%; animation:mb-spin .7s linear infinite; }
@keyframes mb-spin { to { transform:rotate(360deg); } }

@media(hover:hover) and (pointer:fine) {
  .home-key-figures>a:hover,.home-detail-card:hover,.rental-ledger-card:hover { transform:translateY(-3px); border-color:color-mix(in srgb,var(--mb-green) 34%,var(--mb-line)); box-shadow:var(--mb-shadow-high); }
  .home-key-figures>a:active,.entry-row:active,.home-bill:active,.home-change:active { transform:translateY(-1px) scale(.995); }
  .desktop-nav a:hover { transform:translateX(2px); }
}

/* Layouts scale by available space instead of by device label. */
@media(min-width:1650px) {
  .home-configurable-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .home-configurable-wide { grid-column:1/-1; }
  .rental-ledger { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media(max-width:1100px) {
  .home-hero { grid-template-columns:minmax(0,1fr) minmax(310px,.9fr); }
  .home-hero-visual { grid-template-columns:92px minmax(0,1fr); }
  .home-plan-ring { width:90px; }
}
@media(max-width:780px) {
  .home-hero { grid-template-columns:1fr; }
  .home-hero-visual { grid-template-columns:82px minmax(0,1fr); }
  .home-plan-ring { width:80px; }
  .rental-performance { grid-template-columns:1fr; }
  .rental-performance>div:first-child { grid-row:auto; }
}
@media(max-width:599px) {
  :root { --mb-radius-lg:17px; }
  .home-hero-visual { grid-template-columns:1fr; }
  .home-plan-ring { display:none; }
  .home-key-figures { grid-template-columns:1fr; }
  .home-key-figures>a { min-height:60px; }
  .entry-journey { gap:5px; }
  .entry-journey li { grid-template-columns:28px minmax(0,1fr); padding:8px; }
  .entry-journey li>span { width:28px; height:28px; border-radius:9px; }
  .entry-journey small { display:none; }
  .entry-create-form { padding:15px; }
  .entry-template-strip { grid-template-columns:1fr; }
  .entry-template-grid { display:flex; overflow-x:auto; scroll-snap-type:x mandatory; padding-bottom:4px; }
  .entry-template-card { min-width:245px; scroll-snap-align:start; }
  .attachment-picker,.document-upload { grid-template-columns:1fr; }
  .attachment-picker>img { display:none; }
  .entry-create-summary { order:2; padding:15px; }
  .entry-create-form .form-actions { order:3; }
  .rental-performance { padding:12px; }
}

@media(prefers-reduced-motion:reduce) {
  html { scroll-behavior:auto; }
  *,*::before,*::after { animation:none!important; transition-duration:.01ms!important; }
  :is(.home-key-figures>a,.home-detail-card,.rental-ledger-card,.desktop-nav a):hover { transform:none!important; }
}

@media(forced-colors:active) {
  .folder-card::before,.folder-card>.panel-header::after,.desktop-nav a::before { background:Highlight; }
  .home-plan-ring { border:5px solid Highlight; background:Canvas; }
}

/* ===== visual-next ===== */
/* MyBudget visual system 2.0.
   Loaded last so every destination shares the same page, section and action
   depth without changing any budgeting behaviour. */
:root {
  --mb-page:#f3f6f4;
  --mb-surface:#ffffff;
  --mb-surface-raised:#fbfdfc;
  --mb-surface-action:#f2f8f5;
  --mb-text:#172c36;
  --mb-text-secondary:#4e5f5c;
  --mb-border:#d8e5df;
  --mb-brand:#146653;
  --mb-brand-bright:#35a981;
  --mb-depth-section:inset 0 1px 0 #ffffffd9,0 2px 5px #172c360d,0 11px 26px #172c3610;
  --mb-depth-card:inset 0 1px 0 #fffffff0,inset 0 -1px 0 #172c3608,0 4px 9px #172c3612,0 18px 42px #172c3615;
  --mb-depth-action:inset 0 1px 0 #fff,0 3px 8px #172c3610;
  --mb-motion:cubic-bezier(.2,.78,.24,1);
}

body {
  color:var(--mb-text);
  background:
    radial-gradient(circle at 84% -10%,#dcefe5 0,transparent 29%),
    radial-gradient(circle at 95% 92%,#eee8f8 0,transparent 24%),
    var(--mb-page);
}

/* Product artwork at the top, then one calm vector language everywhere else. */
.brand-mark { overflow:hidden; padding:0; background:#ffffff14; box-shadow:inset 0 1px 0 #ffffff25,0 7px 17px #071b2230; }
.brand-image { display:block; width:100%; height:100%; object-fit:cover; border-radius:inherit; }
.nav-glyph { display:block; width:23px; height:23px; fill:none; stroke:currentColor; stroke-width:1.75; stroke-linecap:round; stroke-linejoin:round; }
.nav-icon-box {
  color:#d9eee7;
  background:linear-gradient(145deg,#ffffff1f,#ffffff0c);
  box-shadow:inset 0 1px 0 #ffffff2c,0 5px 12px #06192032;
}
.desktop-nav a.active .nav-icon-box { color:#77e0bd; }
.mobile-nav-icon { display:grid; place-items:center; width:34px; height:34px; margin-inline:auto; color:#365c54; border:1px solid #d9e7e1; border-radius:11px; background:linear-gradient(145deg,#fff,#edf5f1); box-shadow:inset 0 1px 0 #fff,0 4px 10px #172c3612; }
.mobile-nav a.active .mobile-nav-icon { color:#146653; background:linear-gradient(145deg,#e3f6ed,#cdebdc); }
.mobile-nav-icon .nav-glyph { width:21px; height:21px; }

/* Page, section and actionable card are deliberately different depths. */
.workspace-topline,.dashboard-backup { box-shadow:var(--mb-depth-section); }
:is(.folder-card,.rental-ledger-card,.home-detail-card,.compact-income,.settings-card,.menu-section,.entry-create-form) {
  border-color:var(--mb-border);
  background:var(--mb-surface);
  box-shadow:var(--mb-depth-card);
}
:is(.summary-card,.modern-stat,.overview-metrics>div,.home-key-figures>a,.rental-breakdown>div,.compact-income .entry-row,.attention-item) {
  box-shadow:var(--mb-depth-action);
}

/* A pot keeps the same identity colour wherever it moves. */
.folder-card>.panel-header {
  background:linear-gradient(145deg,color-mix(in srgb,var(--pot-accent) 17%,var(--mb-surface-raised)),var(--mb-surface-raised) 72%);
}
.folder-card::before { width:5px; }
.folder-card>.panel-header::after { width:44px; box-shadow:0 0 12px color-mix(in srgb,var(--pot-accent) 45%,transparent); }
.folder-card .pot-toggle { display:inline-flex; align-items:center; gap:2px; min-width:0; }
.folder-card .pot-toggle::before {
  flex:none;
  color:color-mix(in srgb,var(--pot-accent) 82%,#172c36);
  background:linear-gradient(145deg,color-mix(in srgb,var(--pot-accent) 26%,#fff),color-mix(in srgb,var(--pot-accent) 13%,#fff));
  border:1px solid color-mix(in srgb,var(--pot-accent) 25%,#fff);
}

/* Transactions scan as one aligned table without becoming flat. */
.entry-control { background:var(--mb-surface); }
.entry-row {
  grid-template-columns:36px minmax(0,1fr) minmax(78px,auto) 16px;
  gap:11px;
  min-height:68px;
  padding:11px 14px;
}
.entry-icon { width:34px; height:34px; border-radius:11px; background:linear-gradient(145deg,#fff,#edf4f1); box-shadow:inset 0 1px 0 #fff,0 4px 10px #172c3612; }
.entry-copy strong { font-size:.88rem; font-weight:760; line-height:1.25; }
.entry-copy small { margin-top:3px; color:var(--mb-text-secondary); font-size:.71rem; line-height:1.35; }
.entry-amount { min-width:78px; text-align:right; font-size:.9rem; font-weight:790; letter-spacing:-.015em; }
.entry-control>.funding-form,.entry-control>.payment-form,.entry-control>.automatic-badge,.entry-control>.entry-actions { align-self:center; }
.entry-control:hover { background:linear-gradient(90deg,color-mix(in srgb,var(--pot-accent,#35a981) 6%,var(--mb-surface)),var(--mb-surface)); }

/* Compact summaries leave the working cards above the fold. */
@media(min-width:1180px) {
  .budget-workspace {
    display:grid;
    grid-template-columns:minmax(0,1fr);
    gap:13px;
  }
  .budget-workspace>.overview-panel { grid-column:1; grid-row:1; }
  .budget-workspace>.dashboard-section { grid-column:1; grid-row:2; min-width:0; margin-top:0; }
  .personal-workspace>.personal-income-panel { grid-column:1; grid-row:3; min-width:0; }

  .personal-workspace>.personal-overview {
    display:grid;
    grid-template-columns:minmax(220px,1.28fr) repeat(3,minmax(145px,1fr));
    gap:8px;
    padding:8px;
    border:1px solid var(--mb-border);
    border-radius:20px;
    background:color-mix(in srgb,var(--mb-surface) 88%,transparent);
    box-shadow:var(--mb-depth-section);
  }
  .personal-workspace>.personal-overview>.overview-primary,
  .personal-workspace>.personal-overview>.modern-stat:not(.overview-primary) {
    grid-column:auto;
    grid-row:1;
    min-height:104px;
    padding:13px 15px;
    border-radius:14px;
  }
  .personal-workspace>.personal-overview>.modern-stat.stat-lilac { grid-column:auto; }
  .personal-workspace>.personal-overview .overview-total { font-size:clamp(1.8rem,2.2vw,2.45rem)!important; }
  .personal-workspace>.personal-overview .modern-stat>strong { font-size:clamp(1.23rem,1.55vw,1.65rem); }
  .personal-workspace>.personal-overview>.summary-details,
  .personal-workspace>.personal-overview>.personal-funding-metrics { grid-column:1/-1; grid-row:auto; }

  .joint-workspace>.colourful-joint {
    display:grid;
    grid-template-columns:minmax(225px,.82fr) minmax(0,2.8fr);
    gap:8px;
    padding:8px;
    border:1px solid var(--mb-border);
    border-radius:20px;
    background:color-mix(in srgb,var(--mb-surface) 88%,transparent);
    box-shadow:var(--mb-depth-section);
  }
  .joint-workspace>.colourful-joint>.overview-primary { min-height:104px; padding:13px 16px; border-radius:14px; }
  .joint-workspace>.colourful-joint>.overview-metrics { grid-column:2; grid-row:1; display:grid; grid-template-columns:repeat(auto-fit,minmax(130px,1fr)); gap:8px; padding:0; }
  .joint-workspace>.colourful-joint>.overview-metrics>div { min-height:104px!important; padding:12px 13px; display:flex; flex-direction:column; justify-content:center; }
  .joint-workspace>.colourful-joint>.overview-metrics span { min-height:0; }

  .budget-workspace .folder-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
  .personal-workspace>.personal-income-panel { display:grid; grid-template-columns:180px minmax(0,1fr) 150px; align-items:center; gap:10px; margin-top:2px; padding:10px 12px; }
  .personal-workspace>.personal-income-panel .panel-header { padding:5px 7px; }
  .personal-workspace>.personal-income-panel .entry-list { display:grid; grid-template-columns:repeat(auto-fit,minmax(245px,1fr)); gap:8px; border:0; }
  .personal-workspace>.personal-income-panel .entry-row { min-height:56px; border:1px solid var(--mb-border); border-radius:12px; }
  .personal-workspace>.personal-income-panel .panel-total { padding:10px 12px; border:0; border-radius:12px; }
}

@media(min-width:1700px) {
  .budget-workspace .folder-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
}

@media(max-width:1179px) and (min-width:760px) {
  .folder-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}

@media(max-width:759px) {
  .entry-row { grid-template-columns:34px minmax(0,1fr) auto 14px; padding-inline:11px; }
  .entry-amount { min-width:0; }
  .folder-card>.panel-header { padding:15px 14px 13px 17px; }
  .summary-card,.modern-stat { min-height:0; }
  .personal-overview .modern-stat.stat-lilac { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:5px 12px; }
  .personal-overview .modern-stat.stat-lilac>span { grid-column:1; grid-row:1; }
  .personal-overview .modern-stat.stat-lilac>strong { grid-column:2; grid-row:1; white-space:nowrap; overflow-wrap:normal; }
  .personal-overview .modern-stat.stat-lilac>small { grid-column:1/-1; grid-row:2; }
  .personal-income-panel { overflow:hidden; border-radius:18px; }
}

/* One motion language: lift on intent, press on touch and directional periods. */
@media(hover:hover) and (pointer:fine) {
  :is(.folder-card,.home-key-figures>a,.home-detail-card,.settings-card,.rental-ledger-card) {
    transition:transform 190ms var(--mb-motion),box-shadow 190ms ease,border-color 190ms ease;
    transform-origin:center bottom;
  }
  :is(.folder-card,.home-key-figures>a,.home-detail-card,.settings-card,.rental-ledger-card):hover {
    transform:translateY(-3px);
    border-color:color-mix(in srgb,var(--pot-accent,var(--mb-brand-bright)) 34%,var(--mb-border));
    box-shadow:inset 0 1px 0 #fff,0 7px 14px #172c3614,0 24px 48px #172c361b;
  }
}
.mb-pressed { transform:translateY(-1px) scale(.995)!important; }

/* The five primary destinations use one colourful soft-clay 3D family. */
.soft-nav-art {
  display:block;
  width:38px;
  height:38px;
  max-width:none;
  object-fit:contain;
  filter:drop-shadow(0 4px 5px #06192038);
  transform:translateZ(0);
  transition:transform 180ms var(--mb-motion),filter 180ms var(--mb-motion);
}
.nav-icon-box:has(.soft-nav-art),
.mobile-nav-icon:has(.soft-nav-art) {
  overflow:visible;
  border-color:transparent;
  background:transparent;
  box-shadow:none;
}
.desktop-nav a:is(:hover,.active) .soft-nav-art { transform:translateY(-1px) scale(1.08); filter:drop-shadow(0 6px 7px #06192052); }
.mobile-nav-icon .soft-nav-art { width:36px; height:36px; }
.mobile-nav a.active .mobile-nav-icon:has(.soft-nav-art) { background:radial-gradient(circle,#d9f3e8 0,transparent 70%); }
.mobile-nav a.active .soft-nav-art { transform:translateY(-1px) scale(1.06); filter:drop-shadow(0 5px 6px #06192048); }

/* A complete, readable system-dark palette instead of isolated black panels. */
/* Dark theme: html[data-theme="dark"] is set before paint by base.html (system or the sun/moon choice). */
html[data-theme="dark"] {
    color-scheme:dark;
    --ink:#e8f1ee;
    --muted:#a9bab5;
    --line:#344843;
    --surface:#182326;
    --canvas:#0e1618;
    --brand:#75dcba;
    --brand-2:#8be6c7;
    --green:#75dcba;
    --blue:#a9c7ff;
    --mb-page:#0e1618;
    --mb-surface:#182326;
    --mb-surface-raised:#1d292c;
    --mb-surface-action:#223034;
    --mb-text:#e8f1ee;
    --mb-text-secondary:#a9bab5;
    --mb-border:#354944;
    --mb-brand:#75dcba;
    --mb-depth-section:inset 0 1px 0 #ffffff0d,0 2px 6px #0005,0 13px 30px #0006;
    --mb-depth-card:inset 0 1px 0 #ffffff10,inset 0 -1px 0 #0005,0 5px 10px #0006,0 20px 44px #0007;
    --mb-depth-action:inset 0 1px 0 #ffffff0d,0 4px 10px #0005;
  }
html[data-theme="dark"],html[data-theme="dark"] body { background:#0e1618; color:var(--mb-text); }
html[data-theme="dark"] body { background:radial-gradient(circle at 80% -8%,#17342d 0,transparent 31%),radial-gradient(circle at 100% 100%,#251f35 0,transparent 24%),#0e1618; }
html[data-theme="dark"] .sidebar { background:#101e24; box-shadow:8px 0 34px #0006; }
html[data-theme="dark"] .mobile-nav { background:#152124f2; border-color:var(--mb-border); }
html[data-theme="dark"] .mobile-nav a { color:#a9bab5; }
html[data-theme="dark"] .mobile-nav a.active { color:#8be6c7; background:#20352f; }
html[data-theme="dark"] .mobile-nav-icon { color:#c4d8d2; border-color:#3a504a; background:linear-gradient(145deg,#27373a,#192528); box-shadow:inset 0 1px 0 #ffffff10,0 4px 10px #0006; }
html[data-theme="dark"] .mobile-nav a.active .mobile-nav-icon { color:#8be6c7; background:linear-gradient(145deg,#29483e,#1f332e); }
html[data-theme="dark"] .workspace-topline,html[data-theme="dark"] .panel,html[data-theme="dark"] .folder-card,html[data-theme="dark"] .compact-income,html[data-theme="dark"] .home-detail-card,html[data-theme="dark"] .attention-strip,html[data-theme="dark"] .settings-card,html[data-theme="dark"] .menu-section,html[data-theme="dark"] .entry-create-form,html[data-theme="dark"] .login-panel,html[data-theme="dark"] .session-gate,html[data-theme="dark"] .edit-review-dialog { color:var(--mb-text); background:var(--mb-surface); border-color:var(--mb-border); }
html[data-theme="dark"] .workspace-topline:has(.workspace-month) { background:#182326ed; }
html[data-theme="dark"] .account-identity strong,html[data-theme="dark"] .entry-copy strong,html[data-theme="dark"] .panel-figure strong,html[data-theme="dark"] .login-monitor-item strong { color:var(--mb-text); }
html[data-theme="dark"] .account-identity span,html[data-theme="dark"] .entry-copy small,html[data-theme="dark"] .panel-figure small,html[data-theme="dark"] .muted,html[data-theme="dark"] .home-note { color:var(--mb-text-secondary); }
html[data-theme="dark"] .privacy-control button,html[data-theme="dark"] .month-arrow,html[data-theme="dark"] .month-picker,html[data-theme="dark"] .context-links a,html[data-theme="dark"] .button.small,html[data-theme="dark"] .button.ghost,html[data-theme="dark"] .button.quiet,html[data-theme="dark"] .funding-badge,html[data-theme="dark"] .entry-action-menu { color:var(--mb-text); background:var(--mb-surface-raised); border-color:var(--mb-border); }
html[data-theme="dark"] .context-links a:hover,html[data-theme="dark"] .entry-row:hover,html[data-theme="dark"] .button.ghost:hover,html[data-theme="dark"] .button.quiet:hover { background:var(--mb-surface-action); }
html[data-theme="dark"] input,html[data-theme="dark"] select,html[data-theme="dark"] textarea { color:var(--mb-text); background:#111b1e; border-color:var(--mb-border); }
html[data-theme="dark"] .personal-workspace>.personal-overview,html[data-theme="dark"] .joint-workspace>.colourful-joint { background:#142023d9; border-color:var(--mb-border); }
html[data-theme="dark"] .modern-stat>span,html[data-theme="dark"] .summary-card>span { color:#b7c7c3; }
html[data-theme="dark"] .personal-workspace>.personal-overview>.modern-stat.stat-blue,html[data-theme="dark"] .joint-workspace>.colourful-joint>.overview-metrics>div { color:var(--mb-text); background:linear-gradient(145deg,#202e3b,#19262b); border-color:#344a53; }
html[data-theme="dark"] .personal-workspace>.personal-overview>.modern-stat.stat-pink,html[data-theme="dark"] .joint-workspace>.colourful-joint>.overview-metrics>div:nth-child(2) { color:var(--mb-text); background:linear-gradient(145deg,#392b25,#242224); border-color:#594239; }
html[data-theme="dark"] .personal-workspace>.personal-overview>.modern-stat.stat-lilac,html[data-theme="dark"] .joint-workspace>.colourful-joint>.overview-metrics>div:nth-child(3) { color:var(--mb-text); background:linear-gradient(145deg,#302941,#22232c); border-color:#4a4161; }
html[data-theme="dark"] .personal-workspace>.personal-overview>.modern-stat.stat-mint,html[data-theme="dark"] .joint-workspace>.colourful-joint>.overview-metrics>div:nth-child(4) { color:var(--mb-text); background:linear-gradient(145deg,#1c342d,#1b2827); border-color:#315247; }
html[data-theme="dark"] .personal-workspace>.personal-overview>.modern-stat:is(.stat-blue,.stat-pink,.stat-lilac,.stat-mint)>:is(span,strong,small),html[data-theme="dark"] .joint-workspace>.colourful-joint>.overview-metrics>div>:is(span,strong,small) { color:inherit; }
html[data-theme="dark"] .folder-card>.panel-header { background:linear-gradient(145deg,color-mix(in srgb,var(--pot-accent) 19%,#1d292c),#182326 76%); }
html[data-theme="dark"] .personal-pot-card.savings-pot>.panel-header { color:var(--mb-text); background:linear-gradient(145deg,#213c33,#182827); }
html[data-theme="dark"] .entry-control,html[data-theme="dark"] .entry-row,html[data-theme="dark"] .compact-income .entry-row,html[data-theme="dark"] .panel-total,html[data-theme="dark"] .folder-add { background:var(--mb-surface); }
html[data-theme="dark"] .folder-card>.folder-add,html[data-theme="dark"] .dashboard-card>.folder-add { color:#8be6c7; background:#172326; border-color:var(--mb-border); }
html[data-theme="dark"] .flash,html[data-theme="dark"] .privacy-notice { color:var(--mb-text); background:#20362f; border-color:#3d6255; }
html[data-theme="dark"] .entry-icon { background:linear-gradient(145deg,#29383a,#192326); box-shadow:inset 0 1px 0 #ffffff12,0 4px 10px #0005; }
html[data-theme="dark"] .payment-badge,html[data-theme="dark"] .automatic-badge { background:#24343a; border-color:#3a4d50; color:#b9d0ff; }
html[data-theme="dark"] .funding-badge.funded,html[data-theme="dark"] .payment-badge.paid { color:#a7ebd3; background:#203a32; border-color:#3f6859; }
html[data-theme="dark"] .rental-breakdown>div,html[data-theme="dark"] .rental-ledger-card>.panel-total,html[data-theme="dark"] .rental-document-row,html[data-theme="dark"] .home-key-figures>a,html[data-theme="dark"] .welcome-example,html[data-theme="dark"] .welcome-safety,html[data-theme="dark"] .welcome-steps a { color:var(--mb-text); background:linear-gradient(145deg,#1d292c,#172124); border-color:var(--mb-border); }
html[data-theme="dark"] .rental-ledger-card>.panel-header { background:linear-gradient(145deg,#20372f,#1a2928); }
html[data-theme="dark"] .rental-ledger-card.expense-ledger>.panel-header { background:linear-gradient(145deg,#3a2d27,#262326); }
html[data-theme="dark"] .login-copy>p:last-child,html[data-theme="dark"] .secure-note { color:var(--mb-text-secondary); }
html[data-theme="dark"] .login-visual { background:radial-gradient(circle at 30% 20%,#28584b 0,#10252a 65%); }
html[data-theme="dark"] .nav-icon-box:has(.soft-nav-art),html[data-theme="dark"] .mobile-nav-icon:has(.soft-nav-art) { background:transparent; border-color:transparent; box-shadow:none; }
html[data-theme="dark"] .mobile-nav a.active .mobile-nav-icon:has(.soft-nav-art) { background:radial-gradient(circle,#294b40 0,transparent 72%); }

@media(prefers-reduced-motion:reduce) {
  html { scroll-behavior:auto; }
  *,*::before,*::after { animation:none!important; transition-duration:.01ms!important; }
  .mb-pressed { transform:none!important; }
}

/* ===== activity parity (0.9.66) ===== */
.activity-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.receipt-missing-item { display: flex; flex-direction: column; gap: 6px; }
.receipt-missing-item form { order: 2; }
.checkbox-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.checkbox-row small { flex-basis: 100%; }

/* Accessibility: WCAG 2.2 minimum 24px touch targets for small links, buttons and disclosures
   (checked by scripts/web_a11y.cjs in the browser gate). */
.today-link, .text-action, .back-link, .home-detail-heading a, .dashboard-backup a, .starting-month-action button {
  display: inline-flex; align-items: center; min-height: 24px;
}
summary { min-height: 24px; }
.context-history-link, .all-entry-row > a, th > a { display: inline-flex; align-items: center; min-height: 24px; }

/* Sun/moon theme switch (topline on every signed-in page, corner of the sign-in page). */
.theme-toggle { display:inline-grid; place-items:center; width:40px; height:40px; flex:0 0 40px; padding:0; border-radius:50%; border:1px solid var(--line); background:var(--surface); color:var(--ink); cursor:pointer; box-shadow:0 2px 6px #172c3614; transition:transform 160ms ease,background 160ms ease; }
.theme-toggle:hover { transform:translateY(-1px); }
.theme-toggle:focus-visible { outline:3px solid #67d9b0; outline-offset:2px; }
.theme-icon { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.theme-moon { fill:currentColor; stroke:none; }
.theme-sun { display:none; }
html[data-theme="dark"] .theme-moon { display:none; }
html[data-theme="dark"] .theme-sun { display:block; }
.public-theme { position:fixed; top:14px; right:14px; z-index:20; }
.privacy-control { display:flex; align-items:center; gap:8px; }
.privacy-control .theme-toggle { order:-1; width:42px; height:42px; min-height:42px; flex:0 0 42px; padding:0; justify-content:center; }
@media(max-width:599px) { .privacy-control .theme-toggle { width:38px; height:38px; min-height:38px; flex-basis:38px; padding:0; } }
@media(prefers-reduced-motion:reduce){ .theme-toggle { transition:none; } .theme-toggle:hover { transform:none; } }

/* Selected small filter buttons (e.g. Admin → Change history) keep white text on green in both themes. */
.button.primary.small { color:#fff; }
html[data-theme="dark"] .button.primary.small { color:#07231b; background:#75dcba; border-color:#75dcba; }

/* Dark values for the remaining colour variables (surfaces, lines, muted text, depth). */
html[data-theme="dark"] {
  --mint:#1c332c; --mb-muted:#a9bab5; --mb-mint:#1c332c; --mb-blue:#1c2636; --mb-sand:#33271d; --mb-lilac:#2a2438; --mb-line:#344843;
  --mb-shadow:0 8px 24px #0006; --mb-card-depth:inset 0 1px 0 #ffffff10,0 5px 14px #0006; --mb-card-depth-hover:inset 0 1px 0 #ffffff14,0 9px 22px #0007;
  --mb-shadow-low:inset 0 1px 0 #ffffff0d,0 2px 6px #0005; --mb-shadow-mid:inset 0 1px 0 #ffffff10,0 5px 12px #0006; --mb-shadow-high:inset 0 1px 0 #ffffff12,0 10px 26px #0007;
}
html[data-theme="dark"] .attention-open-label { color:#8be6c7; }
html[data-theme="dark"] .entry-create-summary .eyebrow { color:#c6f3df; }
html[data-theme="dark"] .negative-text { color:#f0a197; }

/* Update-ready notice: a small corner pill instead of a page-wide banner. */
.update-pill { position:fixed; right:16px; bottom:16px; z-index:60; display:flex; align-items:center; gap:8px; padding:6px 6px 6px 14px; border-radius:999px; background:#173b35; color:#fff; font-size:.8rem; font-weight:700; box-shadow:0 8px 24px #0003; }
.update-pill button { min-height:28px; padding:4px 12px; border:0; border-radius:999px; background:#75dcba; color:#07231b; font:inherit; cursor:pointer; }
.update-pill .update-pill-close { min-width:28px; padding:4px 8px; background:transparent; color:#cfe6de; font-size:1rem; }
@media(max-width:599px) { .update-pill { bottom:84px; } }
html[data-theme="dark"] .update-pill { background:#20362f; border:1px solid #3d6255; }

/* Savings account: set the real total (records the difference as a top-up or withdrawal). */
.savings-total-form { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:end; gap:6px 10px; margin:8px 16px 12px; }
.savings-total-form label { display:grid; gap:4px; font-size:.78rem; font-weight:700; }
.savings-total-form input { min-height:38px; }
.savings-total-form small { grid-column:1/-1; color:var(--mb-muted); font-size:.72rem; }

/* Top-right notices fade away on their own (app.js); clicking dismisses them. */
.flash-stack .flash { cursor:pointer; transition:opacity 240ms ease,transform 240ms ease; }
.flash-stack .flash.flash-leaving { opacity:0; transform:translateY(-6px); }

/* One-time Undo offer after a change (base.html); app.js hides it after 10 s or on ×. */
.undo-banner { position:fixed; z-index:50; left:50%; bottom:24px; transform:translateX(-50%); width:min(460px, calc(100vw - 32px)); display:flex; align-items:center; gap:10px; padding:10px 12px 10px 16px; border:1px solid var(--line); border-radius:12px; background:var(--surface); box-shadow:var(--shadow); transition:opacity 240ms ease; }
.undo-banner span { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.undo-banner form { margin:0; }
.undo-banner .undo-dismiss { border:0; background:none; font-size:1.3rem; line-height:1; padding:4px 6px; cursor:pointer; color:var(--mb-muted); }
.undo-banner.flash-leaving { opacity:0; }

/* Paid more than once a month (payment_plans.py): set-up choices, a tick per payment, and the month editor. */
.visually-hidden { position:absolute!important; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
.payment-plan { border:1px solid var(--line); border-radius:16px; padding:14px; }
.payment-plan legend { font-weight:760; padding:0 6px; }
.plan-choices { display:grid; grid-template-columns:repeat(auto-fit,minmax(128px,1fr)); gap:8px; }
.plan-choice { position:relative; cursor:pointer; }
.plan-choice input { position:absolute; opacity:0; pointer-events:none; }
.plan-choice span { display:flex; flex-direction:column; gap:2px; height:100%; padding:10px 12px; border:1px solid var(--line); border-radius:12px; background:#fff; transition:border-color .2s, box-shadow .2s, transform .2s cubic-bezier(.2,.9,.3,1.3), background .2s; }
.plan-choice small { color:#66756f; font-size:.74rem; }
.plan-choice:hover span { transform:translateY(-1px); }
.plan-choice input:checked + span { border-color:var(--green); background:#effaf4; box-shadow:0 0 0 3px #2574531f; transform:scale(1.02); }
.plan-choice input:focus-visible + span { outline:2px solid var(--green); outline-offset:2px; }
.plan-details { display:flex; flex-wrap:wrap; gap:12px; margin-top:10px; }
.plan-details > [hidden] { display:none; }
.plan-details > label:not([hidden]) { animation:mb-plan-reveal .25s ease-out; }
.plan-hint { margin:10px 0 4px; font-weight:650; color:var(--brand-2); }
.plan-hint:empty { display:none; }


.entry-control > .parts-strip { grid-column:1/-1; order:99; }
.parts-strip { display:flex; flex-wrap:wrap; align-items:center; gap:8px 14px; padding:0 12px 12px 56px; }
.part-pills { display:flex; flex-wrap:wrap; gap:6px; }
.part-form { margin:0; }
.part-pill { position:relative; display:inline-grid; place-items:center; width:38px; height:38px; padding:0; border:1.5px solid #cad6d2; border-radius:50%; background:#fff; color:var(--brand-2); font-weight:760; font-size:.8rem; cursor:pointer; transition:background .25s, border-color .25s, color .25s, transform .2s cubic-bezier(.2,.9,.3,1.4), box-shadow .25s; }
.part-pill:hover { transform:translateY(-2px); box-shadow:0 4px 10px #1d4a4021; }
.part-pill:active { transform:scale(.92); }
.part-pill.due { border-color:#e8b27a; box-shadow:0 0 0 3px #f4b26a26; }
.part-pill .part-check, .part-pill .part-label { grid-area:1/1; transition:opacity .2s, transform .3s cubic-bezier(.2,.9,.3,1.5); }
.part-pill .part-check { opacity:0; transform:scale(.3) rotate(-30deg); font-size:1rem; }
.part-pill.paid { background:var(--green); border-color:var(--green); color:#fff; }
.part-pill.paid .part-check { opacity:1; transform:none; }
.part-pill.paid .part-label { opacity:0; transform:scale(.5); }
.part-pill.just-changed { animation:mb-pill-pop .45s cubic-bezier(.2,.9,.3,1.4); }
.part-pill.just-changed.paid::after { content:""; position:absolute; inset:-5px; border-radius:50%; border:2px solid var(--green); animation:mb-pill-ring .55s ease-out forwards; pointer-events:none; }
.part-pill[aria-busy="true"] { cursor:progress; }
.parts-summary { display:inline-flex; align-items:center; gap:8px; color:#4c5d57; font-size:.8rem; font-weight:700; text-decoration:none; }
.parts-summary:hover { color:var(--brand-2); text-decoration:underline; }
.parts-meter { width:64px; height:6px; border-radius:999px; background:#e2ebe7; overflow:hidden; }
.parts-meter > span { display:block; width:var(--done,0%); height:100%; border-radius:inherit; background:linear-gradient(90deg,#35a981,var(--green)); transition:width .5s cubic-bezier(.2,.8,.2,1); }
.parts-strip.all-paid .parts-summary { color:var(--green); }
.parts-strip.celebrate .part-pills { animation:mb-parts-wave .7s ease-out; }
.parts-strip.celebrate .parts-summary { animation:mb-parts-glow 1.1s ease-out; }
@media (max-width:760px) { .parts-strip { padding:0 14px 12px 56px; } }
.dashboard-card .parts-strip { padding-left:62px; }

.parts-editor .parts-rows { list-style:none; margin:14px 0; padding:0; display:grid; gap:8px; }
.parts-row { display:grid; grid-template-columns:auto minmax(0,1fr) minmax(0,140px) auto; align-items:end; gap:10px; padding:10px 12px; border:1px solid var(--line); border-radius:14px; background:#fff; transition:background .25s, border-color .25s; }
.parts-row.paid { background:#f1faf5; border-color:#b9dfca; }
.parts-row.is-new { animation:mb-row-in .35s cubic-bezier(.2,.9,.3,1.2); }
.parts-row.removing { animation:mb-row-out .3s ease-in forwards; pointer-events:none; }
.part-name { align-self:center; font-weight:700; }
.part-paid { position:relative; align-self:center; cursor:pointer; }
.part-paid input { position:absolute; opacity:0; }
.part-paid .part-tick { display:grid; place-items:center; width:34px; height:34px; border:1.5px solid #cad6d2; border-radius:50%; color:transparent; transition:all .25s cubic-bezier(.2,.9,.3,1.4); }
.part-paid input:checked + .part-tick { background:var(--green); border-color:var(--green); color:#fff; transform:scale(1.08); }
.part-paid input:focus-visible + .part-tick { outline:2px solid var(--green); outline-offset:2px; }
.parts-add { width:100%; border-style:dashed; }
[data-parts-total] { display:inline-block; }
[data-parts-total].bump { animation:mb-total-bump .35s ease-out; }
@media (max-width:560px) { .parts-row { grid-template-columns:auto minmax(0,1fr); } .parts-row .part-remove { grid-column:1/-1; justify-self:end; } }

@keyframes mb-plan-reveal { from { opacity:0; transform:translateY(-4px); } to { opacity:1; transform:none; } }
@keyframes mb-pill-pop { 0% { transform:scale(1); } 40% { transform:scale(1.18); } 100% { transform:scale(1); } }
@keyframes mb-pill-ring { from { opacity:.8; transform:scale(.85); } to { opacity:0; transform:scale(1.35); } }
@keyframes mb-parts-wave { 0%,100% { transform:none; } 30% { transform:translateY(-3px); } 60% { transform:translateY(1px); } }
@keyframes mb-parts-glow { 0% { text-shadow:0 0 0 #35a98100; } 40% { text-shadow:0 0 12px #35a981aa; } 100% { text-shadow:none; } }
@keyframes mb-row-in { from { opacity:0; transform:translateY(-8px) scale(.98); } to { opacity:1; transform:none; } }
@keyframes mb-row-out { to { opacity:0; transform:translateX(24px); } }
@keyframes mb-total-bump { 40% { transform:scale(1.08); } }
@media (prefers-reduced-motion:reduce) {
  .plan-choice span, .part-pill, .part-pill span, .parts-meter > span, .parts-row, .part-paid .part-tick { transition:none!important; }
  .plan-details > label, .part-pill.just-changed, .part-pill::after, .parts-strip.celebrate *, .parts-row.is-new, .parts-row.removing, [data-parts-total].bump { animation:none!important; }
}
html[data-theme="dark"] .plan-choice span, html[data-theme="dark"] .part-pill, html[data-theme="dark"] .parts-row { background:#1f2a2c; border-color:#3a4d50; color:#d6e2de; }
html[data-theme="dark"] .plan-choice small, html[data-theme="dark"] .parts-summary { color:#9fb3ad; }
html[data-theme="dark"] .plan-choice input:checked + span, html[data-theme="dark"] .parts-row.paid { background:#203a32; border-color:#3f6859; }
html[data-theme="dark"] .part-pill.paid { background:#2f8a62; border-color:#2f8a62; color:#fff; }
html[data-theme="dark"] .parts-meter { background:#2b393b; }
html[data-theme="dark"] .plan-hint, html[data-theme="dark"] .parts-strip.all-paid .parts-summary { color:#a7ebd3; }

/* Press feedback: cards sink slightly while pressed and spring back when let go. */
.entry-control, .dashboard-card, .home-space, .folder-card .panel-header, .summary-card, .modern-stat { transition:transform .38s cubic-bezier(.2,1.6,.4,1); }
.entry-control:has(.entry-row:active), .dashboard-card:active, .home-space:active, .summary-card:active, .modern-stat:active { transform:scale(.975)!important; transition-duration:.08s; }
.entry-control:has(.entry-row:active) { box-shadow:inset 3px 0 #35a981; }
@media (prefers-reduced-motion:reduce) {
  .entry-control, .dashboard-card, .home-space, .summary-card, .modern-stat { transition:none; }
  .entry-control:has(.entry-row:active), .dashboard-card:active, .home-space:active, .summary-card:active, .modern-stat:active { transform:none!important; }
}

.plan-advance { display:flex; flex-wrap:wrap; gap:6px 16px; border:0; padding:0; margin:0; }
.plan-advance[hidden] { display:none; }
.plan-advance legend { font-weight:700; margin-bottom:4px; }
.plan-advance label { display:inline-flex; align-items:center; gap:6px; }
[data-schedule-extra][hidden], .payment-plan[hidden] { display:none!important; }
.plan-advance label { flex-direction:row!important; } .plan-advance input[type="radio"] { width:auto!important; min-height:0!important; height:auto!important; margin:0; flex:none; }

.weeks-list { list-style:none; margin:14px 0; padding:0; display:grid; gap:8px; }
.week-choice { display:flex; align-items:center; gap:12px; padding:12px 14px; border:1px solid var(--line); border-radius:14px; cursor:pointer; transition:opacity .2s, background .2s; }
.week-choice input { width:auto!important; min-height:0!important; }
.week-choice span { flex:1; font-weight:700; }
.weeks-list li.away .week-choice { opacity:.55; border-style:dashed; }
.weeks-link { display:inline-block; margin:0 12px 10px 56px; font-size:.8rem; font-weight:700; }

/* Month calendar for weekly payments */
.month-calendar { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:6px; margin:14px 0 8px; }
.calendar-head { text-align:center; font-size:.72rem; font-weight:760; color:#66756f; padding-bottom:2px; }
.calendar-day { aspect-ratio:1; display:flex; flex-direction:column; align-items:center; justify-content:center; border:1px solid var(--line); border-radius:12px; background:transparent; color:inherit; font-weight:760; cursor:pointer; transition:background .2s, border-color .2s, transform .25s cubic-bezier(.2,1.6,.4,1); }
.calendar-day small { font-size:.62rem; font-weight:700; min-height:.8em; }
.calendar-day.outside { border:0; cursor:default; }
.calendar-day:hover { transform:translateY(-1px); }
.calendar-day.going { background:var(--green); border-color:var(--green); color:#fff; }
.calendar-day.added { background:#3d7fd6; border-color:#3d7fd6; color:#fff; }
.calendar-day.away { border-style:dashed; border-color:#e8a35c; color:#b0702c; }
.calendar-day.away span { text-decoration:line-through; }
.calendar-day.tapped { animation:mb-pill-pop .4s cubic-bezier(.2,.9,.3,1.4); }
.calendar-key { display:flex; flex-wrap:wrap; gap:6px 14px; align-items:center; font-size:.78rem; color:#66756f; }
.calendar-key .key { display:inline-block; width:12px; height:12px; border-radius:4px; margin-right:-8px; vertical-align:middle; }
.calendar-key .key.going { background:var(--green); } .calendar-key .key.away { border:1.5px dashed #e8a35c; } .calendar-key .key.added { background:#3d7fd6; } .calendar-key .key.paid { background:var(--green); box-shadow:inset 0 0 0 2px #fff; }
.year-ahead table { width:100%; border-collapse:collapse; } .year-ahead th, .year-ahead td { padding:8px 4px; border-bottom:1px solid var(--line); text-align:left; } .year-ahead td.amount { text-align:right; font-weight:760; }
@media (prefers-reduced-motion:reduce) { .calendar-day { transition:none; } .calendar-day.tapped { animation:none; } }
.calendar-day:not(.going):not(.added) { background:transparent!important; box-shadow:none!important; } .calendar-day.going:not(.added) { background:var(--green)!important; } .calendar-day.added { background:#3d7fd6!important; }

/* ===== search history and quick-add recent chips (match the app's Search and recent payees) ===== */
.entry-history { display:grid; gap:4px; margin-top:6px; }
.entry-bars { display:grid; grid-template-columns:repeat(12, 1fr); gap:3px; align-items:end; height:30px; max-width:320px; }
.entry-bars i { display:block; height:var(--h); min-height:3px; border-radius:2px; background:#b7dccb; }
.entry-bars i.none { height:2px; min-height:2px; background:#e6ece9; }
.entry-bars i.now { background:#1b7a55; }
.entry-history small { color:var(--muted); white-space:normal; overflow:visible; text-overflow:clip; }
.quick-recent { margin:2px 0 10px; }
.quick-recent .eyebrow { margin:0 0 6px; }
.quick-recent-chips { display:flex; gap:8px; overflow-x:auto; padding-bottom:4px; scrollbar-width:none; }
.quick-chip { flex:none; min-height:40px; padding:0 14px; border-radius:999px; border:1px solid rgba(15,92,70,.15); background:#eaf6f0; color:#15211d; font:inherit; font-weight:650; font-size:.85rem; cursor:pointer; white-space:nowrap; }
.quick-chip:hover { background:#dcefe5; }
.quick-chip.selected { border-color:#1b7a55; box-shadow:0 0 0 2px rgba(27,122,85,.18); }
html[data-theme="dark"] .entry-bars i { background:#3e6b5c; }
html[data-theme="dark"] .entry-bars i.none { background:rgba(255,255,255,.13); }
html[data-theme="dark"] .entry-bars i.now { background:#6fd3a8; }
html[data-theme="dark"] .quick-chip { background:#22302c; color:#eef3f0; border-color:rgba(255,255,255,.2); }
html[data-theme="dark"] .quick-chip:hover { background:#2a3a35; }

/* ===== new look (design A, as in the app): one calm top card, Money to put in, white pots with a tinted top ===== */
.na-card { background:#fff; border-radius:20px; padding:18px 20px; box-shadow:0 6px 18px rgba(15,61,46,.08); margin-bottom:14px; }
.na-hero { background:#eaf6f0; }
.na-label { display:block; font-size:.85rem; font-weight:650; color:#45625a; }
.na-big { display:block; font-size:clamp(2rem, 4vw, 2.6rem); font-weight:780; letter-spacing:-.03em; line-height:1.15; margin:4px 0 10px; color:#15211d; }
.na-bar { width:100%; height:8px; border:0; border-radius:99px; overflow:hidden; background:rgba(15,61,46,.1); appearance:none; }
.na-bar::-webkit-progress-bar { background:rgba(15,61,46,.1); border-radius:99px; }
.na-bar::-webkit-progress-value { background:#1b7a55; border-radius:99px; }
.na-bar::-moz-progress-bar { background:#1b7a55; border-radius:99px; }
.na-three { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:10px; margin-top:12px; }
.na-three span { display:block; font-size:.72rem; font-weight:650; color:#45625a; }
.na-three strong { font-size:1rem; }
.na-two { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:12px; }
.na-line, .na-muted { margin:10px 0 0; font-size:.8rem; color:#5e6b66; }
.na-muted { margin:2px 0 6px; }
.personal-overview { display:block; }
.money-plan h2 { margin:0; font-size:1.02rem; }
.plan-row { display:flex; align-items:center; gap:12px; padding:9px 0; border-top:1px solid #edf1ef; }
.plan-row:first-of-type { border-top:0; }
.plan-name { flex:1; font-weight:650; display:grid; }
.plan-name small { font-weight:500; color:#5e6b66; font-size:.75rem; }
.plan-row form { margin:0; }
.plan-mark, .plan-spacer { min-width:92px; }
.plan-mark { min-height:40px; padding:0 16px; border-radius:99px; border:1.5px solid #1b7a55; background:#fff; color:#1b7a55; font:inherit; font-weight:700; cursor:pointer; }
.plan-mark:hover { background:#eaf6f0; }
.na-section { font-size:.8rem !important; letter-spacing:.1em; text-transform:uppercase; color:#5e6b66; font-weight:750; margin:0; }
.more-links { display:inline-block; position:relative; margin-left:10px; padding-left:10px; border-left:1px solid #c8d1ce; }
.more-links summary { list-style:none; cursor:pointer; color:var(--muted); font-size:.82rem; font-weight:680; }
.more-links summary::-webkit-details-marker { display:none; }
.more-links[open] > div { position:absolute; z-index:20; top:24px; left:0; display:grid; gap:2px; min-width:220px; padding:8px; border-radius:14px; background:#fff; box-shadow:0 12px 30px rgba(15,61,46,.16); }
.more-links > div a { margin:0 !important; padding:9px 10px !important; border:0 !important; border-radius:9px; }
.more-links > div a:hover { background:#f1f6f3; text-decoration:none; }
/* Pots: white card, tinted top strip in the pot's own colour, soft shadow, one corner size. */
.folder-grid .folder-card { background:#fff; border:0; border-radius:20px; box-shadow:0 6px 18px rgba(15,61,46,.08); overflow:hidden; }
.folder-grid .folder-card > .panel-header { background:linear-gradient(color-mix(in srgb, var(--pot-accent, #1b7a55) 6%, #fff), color-mix(in srgb, var(--pot-accent, #1b7a55) 13%, #fff)) !important; border-bottom:0; }
.folder-grid .folder-card .eyebrow { display:none; }
html[data-theme="dark"] .na-card { background:#1a2224; box-shadow:none; border:1px solid #26302c; }
html[data-theme="dark"] .na-hero { background:#1d2a2c; }
html[data-theme="dark"] .na-big { color:#eef3f0; }
html[data-theme="dark"] .na-label, html[data-theme="dark"] .na-three span, html[data-theme="dark"] .na-line, html[data-theme="dark"] .na-muted, html[data-theme="dark"] .plan-name small, html[data-theme="dark"] .na-section { color:#a9b6b1; }
html[data-theme="dark"] .na-bar { background:rgba(255,255,255,.1); }
html[data-theme="dark"] .na-bar::-webkit-progress-bar { background:rgba(255,255,255,.1); }
html[data-theme="dark"] .na-bar::-webkit-progress-value { background:#6fd3a8; }
html[data-theme="dark"] .na-bar::-moz-progress-bar { background:#6fd3a8; }
html[data-theme="dark"] .plan-row { border-color:#26302c; }
html[data-theme="dark"] .plan-mark { background:transparent; border-color:#6fd3a8; color:#6fd3a8; }
html[data-theme="dark"] .more-links[open] > div { background:#1f2a28; }
html[data-theme="dark"] .more-links > div a:hover { background:#26302c; }
html[data-theme="dark"] .folder-grid .folder-card { background:#1a2224; box-shadow:none; border:1px solid #26302c; }
html[data-theme="dark"] .folder-grid .folder-card > .panel-header { background:linear-gradient(color-mix(in srgb, var(--pot-accent, #6fd3a8) 10%, #1a2224), color-mix(in srgb, var(--pot-accent, #6fd3a8) 18%, #1a2224)) !important; }
.overview-panel.na-top { display:grid; gap:12px; padding:0; background:transparent; box-shadow:none; border:0; overflow:visible; }
.overview-panel.na-top .na-card { margin-bottom:0; }
html[data-theme="dark"] .overview-panel.na-top { background:transparent; }
.overview-panel.na-top > .na-card + .na-card, .overview-panel.na-top > .na-card + .money-plan, .overview-panel.na-top .money-plan { margin-top:12px !important; }
.overview-panel.na-top > .na-card, .overview-panel.na-top > div.na-card { border-radius:20px !important; }
.overview-panel.personal-overview.na-top { grid-template-columns:minmax(0, 1fr) !important; grid-template-areas:none !important; }
.overview-panel.personal-overview.na-top > * { grid-column:1 / -1 !important; grid-row:auto !important; }
.na-hero-personal .na-big { font-size:clamp(1.6rem, 3.2vw, 2.2rem); overflow-wrap:anywhere; }

/* ===== the status chip's short list: To put in, In account, Paid (_entry_status.html) ===== */
@media (max-width: 760px) {
  /* A comfortable thumb size on phones. */
  .status-chip { min-height:40px; padding:8px 14px; font-size:.8rem; }
}
.status-pick { position:relative; display:inline-block; }
.status-pick > summary { list-style:none; display:inline-flex; align-items:center; }
.status-pick > summary::-webkit-details-marker { display:none; }
/* A sheet at the bottom of the window, as in the app (pots clip anything that pokes out of them). */
.status-menu { position:fixed; z-index:1201; left:50%; bottom:calc(88px + env(safe-area-inset-bottom)); transform:translateX(-50%); width:min(420px, calc(100vw - 24px)); padding:16px; border-radius:20px; background:#fff; box-shadow:0 12px 40px rgba(15,61,46,.28); display:grid; gap:8px; }
.status-pick[open] > summary::before { content:""; position:fixed; inset:0; z-index:1200; background:rgba(10,20,16,.35); cursor:default; }
.status-menu p { margin:0 2px 4px; color:#15211d; font-size:1rem; font-weight:750; }
.status-menu form { margin:0; }
.status-menu button { width:100%; display:flex; align-items:center; gap:10px; min-height:44px; padding:6px 12px; border:1.5px solid #e3e8e5; border-radius:12px; background:none; color:#15211d; font:inherit; font-size:.9rem; font-weight:650; cursor:pointer; text-align:left; }
.status-menu button:hover { border-color:#1b7a55; }
.status-menu button.now { border:2px solid #1b7a55; cursor:default; }
.status-menu button small { margin-left:auto; color:#1b7a55; font-weight:750; font-size:.75rem; }
.status-menu .dot { font-style:normal; width:24px; height:24px; border-radius:99px; display:grid; place-items:center; font-size:.75rem; }
.status-menu .dot.to_put_in { background:#eef1f0; color:#5f6b68; }
.status-menu .dot.in_account { background:#fff4dc; color:#7a4b00; }
.status-menu .dot.paid { background:#e1f7ed; color:#135f49; }
html[data-theme="dark"] .status-menu { background:#1a2224; box-shadow:0 12px 32px rgba(0,0,0,.5); }
html[data-theme="dark"] .status-menu p { color:#eef3f0; }
html[data-theme="dark"] .status-menu button { color:#eef3f0; border-color:#2f3a37; }
html[data-theme="dark"] .status-menu button.now, html[data-theme="dark"] .status-menu button:hover { border-color:#6fd3a8; }
html[data-theme="dark"] .status-menu button small { color:#6fd3a8; }
html[data-theme="dark"] .status-menu .dot.to_put_in { background:#2a302f; color:#b7c2bf; }
html[data-theme="dark"] .status-menu .dot.in_account { background:#3a2f17; color:#ffd27a; }
html[data-theme="dark"] .status-menu .dot.paid { background:#173a2d; color:#a7e8c9; }
/* ===== archived past months and planning-ahead months (as in the app) ===== */
.archive-card { text-align:center; padding:26px 20px; }
.archive-card .archive-art { font-size:2.2rem; }
.archive-card h2 { margin:8px 0 4px; font-size:1.15rem; }
.archive-card p { margin:0; color:#5e6b66; font-size:.88rem; }
.archive-go { display:inline-block; margin-top:14px; padding:11px 22px; border-radius:99px; background:#1b7a55; color:#fff; font-weight:750; text-decoration:none; }
.archive-back { display:block; margin-top:10px; color:#166a49; font-size:.84rem; font-weight:650; }
.archive-bar { display:flex; align-items:center; gap:10px; padding:10px 12px 10px 14px; border-radius:14px; background:#e8ebea; color:#3e4a46; font-size:.86rem; }
.archive-bar b { flex:1; }
.archive-bar a { padding:6px 13px; border-radius:99px; border:1.5px solid currentColor; color:inherit; font-weight:700; font-size:.8rem; text-decoration:none; white-space:nowrap; }
.archive-bar.ahead { background:#fdf2dc; color:#8a5a00; }
.archive-cover .na-hero { filter:grayscale(1); opacity:.5; }
.archive-cover :is(.money-plan, .summary-details, .dashboard-section, .personal-income-panel) { display:none !important; }
.archive-toast { position:fixed; left:50%; bottom:28px; transform:translateX(-50%); z-index:60; max-width:min(92vw, 460px); padding:12px 18px; border-radius:14px; background:#15211d; color:#fff; font-size:.88rem; box-shadow:0 10px 30px rgba(0,0,0,.25); }
/* archive a month by hand once it is done (_close_month.html) */
.close-month-button { margin-top:14px; text-align:center; }
.close-month-button button { width:100%; min-height:46px; border:0; border-radius:99px; background:#1b7a55; color:#fff; font:inherit; font-weight:750; font-size:.95rem; cursor:pointer; }
.close-month-button small { display:block; margin-top:7px; color:#5e6b66; font-size:.82rem; font-weight:600; }
.close-month-link { margin:22px 0 8px; text-align:center; }
.close-month-link button { border:0; background:none; color:#166a49; font:inherit; font-weight:650; font-size:.86rem; text-decoration:underline; text-underline-offset:3px; cursor:pointer; padding:10px; }
.archive-reopen { margin:0; }
.archive-reopen button { padding:6px 13px; border-radius:99px; border:1.5px solid currentColor; background:none; color:inherit; font:inherit; font-weight:700; font-size:.8rem; cursor:pointer; white-space:nowrap; }
.archive-bar-plain { background:none; justify-content:center; margin-top:4px; color:#166a49; }
html[data-theme="dark"] .close-month-button button { background:#6fd3a8; color:#0d1f18; }
html[data-theme="dark"] .close-month-button small { color:#a9b6b1; }
html[data-theme="dark"] .close-month-link button, html[data-theme="dark"] .archive-bar-plain { color:#6fd3a8; }
html[data-theme="dark"] .archive-bar-plain { background:none; }
html[data-theme="dark"] .archive-card p { color:#a9b6b1; }
html[data-theme="dark"] .archive-go { background:#6fd3a8; color:#0d1f18; }
html[data-theme="dark"] .archive-back { color:#6fd3a8; }
html[data-theme="dark"] .archive-bar { background:#232b2a; color:#c3ccc8; }
html[data-theme="dark"] .archive-bar.ahead { background:#3a2f17; color:#ffd27a; }
html[data-theme="dark"] .archive-toast { background:#eef3f0; color:#15211d; }

/* second bug hunt: an overdue "To put in" chip stays red at night; touch targets of 44px on phones */
html[data-theme="dark"] .status-chip.to-fund.overdue { color:#ffb4ab; background:#3d1f1c; border-color:#7a3a33; }
@media (pointer:coarse) {
  .status-chip { min-height:44px; }
  .status-chip.back { min-width:44px; }
  .entry-actions > summary { min-width:44px; min-height:44px; }
  .undo-banner .undo-dismiss, .undo-dismiss { min-width:44px; min-height:44px; }
}
.status-menu[aria-busy="true"], .entry-action-menu[aria-busy="true"] { opacity:.6; pointer-events:none; }
.flash.error { cursor:pointer; }
.attention-hidden { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-top:10px; color:var(--muted); font-size:.85rem; }
.attention-hidden form { margin:0; }
/* gentle movement for the things you open (never when the device asks for reduced motion) */
@media (prefers-reduced-motion: no-preference) {
  @keyframes mb-sheet-up { from { opacity:0; transform:translate(-50%, 18px); } to { opacity:1; transform:translate(-50%, 0); } }
  @keyframes mb-choice-in { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }
  @keyframes mb-drop-in { from { opacity:0; transform:translateY(-6px) scale(.98); } to { opacity:1; transform:none; } }
  details.status-pick[open] > .status-menu { animation:mb-sheet-up .22s cubic-bezier(.2,.8,.2,1); }
  details.status-pick[open] > .status-menu form { animation:mb-choice-in .22s ease-out both; }
  details.status-pick[open] > .status-menu form:nth-of-type(2) { animation-delay:.04s; }
  details.status-pick[open] > .status-menu form:nth-of-type(3) { animation-delay:.08s; }
  details.entry-actions[open] > .entry-action-menu { animation:mb-drop-in .16s ease-out; transform-origin:top right; }
  details.done-fold[open] > :not(summary) { animation:mb-choice-in .24s ease-out both; }
  .flash-stack .flash, .undo-banner { animation:mb-drop-in .22s ease-out; }
  .attention-item, .folder-card { transition:box-shadow .2s ease, transform .2s ease; }
}

/* Rental: each list folds away and scrolls inside its own card, so a long list of outgoings does not push the page */
.rental-fold > summary { display:flex; align-items:center; gap:8px; min-height:44px; padding:8px 16px; cursor:pointer; list-style:none; color:var(--brand-2); font-weight:760; font-size:.85rem; border-bottom:1px solid var(--line); }
.rental-fold > summary::-webkit-details-marker { display:none; }
.rental-fold > summary::before { content:'▸'; }
.rental-fold[open] > summary::before { content:'▾'; }
.rental-fold > summary::after { content:'Show'; margin-left:auto; color:var(--muted); font-weight:650; font-size:.78rem; }
.rental-fold[open] > summary::after { content:'Hide'; }
.rental-scroll { max-height:min(62vh, 560px); overflow-y:auto; overscroll-behavior:contain; scrollbar-width:thin; border-top:0; }
.rental-scroll:focus-visible { outline:2px solid var(--brand-2); outline-offset:-2px; }
@media (max-width:760px) { .rental-scroll { max-height:56vh; } }
