:root {
  --primary: #047857; --primary-dark: #065f46; --primary-light: #d1fae5;
  --success: #047857; --danger: #be123c; --warning: #92400e;
  --bg-primary: #e9eef5; --bg-secondary: #fff; --bg-tertiary: #f1f5f9;
  --text-primary: #122138; --text-secondary: #52637a; --border: #d3dce8; --divider: #e4e9f0;
  --shadow: 0 16px 48px rgba(15,23,42,.08); --shadow-sm: 0 2px 8px rgba(15,23,42,.05);
  --card-depth: inset 0 1px 0 #fff, inset 0 -3px 0 #23365005, 0 3px 5px #23365008, 0 14px 24px -18px #23365060;
  --card-depth-raised: inset 0 1px 0 #fff, 0 6px 10px -6px #23365024, 0 22px 30px -20px #23365060;
}
#transactions-view > .header, #analytics-view > .header { position: relative; padding: 28px; margin-bottom: 24px; border: 1px solid #d5e0cf; border-radius: 24px; background: radial-gradient(ellipse at 100% 0, #f4e9c7, transparent 45%), linear-gradient(120deg, #f7faf1, #eaf3e7); }
#transactions-view > .header h1, #analytics-view > .header h1 { color: #254a35; letter-spacing: -1px; }
#transactions-view > .header .muted, #analytics-view > .header .muted { max-width: 650px; line-height: 1.7; color: #627562; }
#transactions-view .duplicate-review-panel { border-radius: 22px; border-color: #e8d5c4; background: linear-gradient(130deg, #fffaf5, #fcf0e5); padding: 24px; }
#transactions-view .duplicate-review-panel:nth-child(2) { border-color: #d7cee4; background: linear-gradient(130deg, #fbfaff, #f0ebf8); }
.activity-sticker { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 14px; border-radius: 13px; color: #9b7452; background: #f4ddc4; font-size: 23px; transform: rotate(-7deg); }
.duplicate-review-panel:nth-child(2) .activity-sticker { color: #8a73a6; background: #e4daf3; transform: rotate(7deg); }
#transactions-view .duplicate-review-panel h2 { color: #3b4d3d; margin: 8px 0; font-size: 20px; letter-spacing: -.4px; }
#transactions-view .filter-panel { border-radius: 20px; background: #fffdf8; border-color: #e1ddcf; padding: 24px; }
#transactions-view #txn-summary .metric-card { position: relative; overflow: hidden; border-radius: 22px; border-color: #d3e0ce; background: #f0f7eb; }
#transactions-view #txn-summary .metric-card.expense { background: #fff3e9; border-color: #ead5c3; }
#transactions-view #txn-summary .metric-card.net { background: #f2eef9; border-color: #dcd2e8; }
#transactions-view #txn-summary .metric-card::after { position: absolute; right: -14px; top: -20px; width: 70px; height: 70px; border: 12px solid #ffffff70; border-radius: 50%; content: ""; pointer-events: none; }
#transactions-view .transaction-panel { border-radius: 22px; overflow-x: auto; }
#transactions-view .transactions-table thead { background: #f7f8ef; }
@media (max-width: 600px) {
  #transactions-view > .header, #analytics-view > .header { padding: 22px; }
  #transactions-view .header-actions { flex-wrap: wrap; }
}
[hidden] { display: none !important; }
/* Loaded before the legacy stylesheet; these scoped rules retain the light palette. */
html body { background: #f5f5f1; color: #202e2a; font-family: "Segoe UI", system-ui, sans-serif; }
body .app-container { grid-template-columns: 248px minmax(0,1fr); }
body .sidebar { background: #fff; border-color: #e2e7df; padding: 32px 18px; }
body .sidebar-logo { display: flex; align-items: center; gap: 10px; color: #203d30; margin-bottom: 16px; font-size: 22px; font-weight: 720; letter-spacing: -.8px; }
.brand-mark { display: block; flex: 0 0 auto; width: 64px; height: 64px; filter: drop-shadow(0 8px 12px #164b3d26); }
.brand-mark-bg { fill: #226452; }
.brand-mark-line { fill: none; stroke: #fff; stroke-width: 5.5; stroke-linecap: round; stroke-linejoin: round; }
.brand-mark-accent { fill: #d9ea95; }
.brand-mark.small { width: 38px; height: 38px; filter: none; }
.sidebar-caption, .eyebrow { color: #75816d; font-size: 10px; letter-spacing: 1.7px; font-weight: 700; margin-bottom: 12px; }
.sidebar-caption { margin: 8px 12px 28px; font-size: 9px; }
body .nav-list { gap: 6px; }
body .nav-btn { color: #647168; padding: 13px 16px; }
body .nav-btn.active { background: #e9f0e7; color: #24553e; box-shadow: inset 3px 0 #286b50; }
.sidebar-bottom { margin-top: auto; padding: 24px 12px 0; display: grid; gap: 12px; color: #63716a; font-size: 13px; }
body .main-content { padding: 42px; gap: 28px; }
body .header h1 { font-size: clamp(24px, 3vw, 34px); letter-spacing: -1.1px; font-weight: 650; }
.muted { color: #63716a; font-size: 13px; line-height: 1.7; margin: 8px 0 16px; }
body .panel, body .metric-card { border-color: #e2e7df; background: white; border-radius: 18px; box-shadow: 0 4px 24px rgba(35,55,39,.025); }
.mtd-category-card { width: 100%; padding: 20px; color: inherit; text-align: left; cursor: pointer; }
body .panel-header { background: #fafbf8; padding: 20px; }
body .metric-label { letter-spacing: .7px; font-size: 10px; }
body .metric-value { letter-spacing: -.8px; }
body .btn { border-radius: 10px; padding: 11px 17px; }
body .btn-primary { background: #226452; color: white; }
body .btn-secondary { background: #edf1e9; color: #304c3d; }
body .panel { overflow-x: auto; }
input, select, textarea { font: inherit; max-width: 100%; color: #202e2a; background: #fff; border: 1px solid #d8e0d5; border-radius: 8px; padding: 10px; }
input[type=checkbox] { accent-color: #226452; width: 17px; height: 17px; }
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid #90b3a2; outline-offset: 3px; }
button:disabled { opacity: .55; cursor: wait; }
label { font-size: 13px; }
progress { width: 100%; accent-color: #226452; height: 10px; }
.auth-screen { min-height: 100vh; display: none; place-content: center; padding: 24px; background: radial-gradient(ellipse at top right,#e6ecda,transparent 60%),#f5f5f1; }
.auth-pending .auth-screen { display: grid; }
.auth-pending .app-container, .auth-pending #import-modal, .auth-pending #add-goal-modal, .auth-pending #debt-dialog, .auth-pending #mtd-transactions-dialog { display: none !important; }
.auth-card { width: min(440px,calc(100vw - 48px)); padding: 40px; border: 1px solid #e2e7df; border-radius: 24px; background: white; box-shadow: 0 20px 80px #264e3510; }
.auth-card .brand-mark { margin-bottom: 28px; }
.auth-card h1 { font-size: 30px; line-height: 1.15; letter-spacing: -1px; }
.auth-card form:not([hidden]), .auth-card label { display: grid; gap: 10px; }
.auth-card form { margin-top: 20px; }
.auth-card label[hidden] { display: none; }
.auth-card input { width: 100%; margin-bottom: 8px; }
#auth-error { color: #b84239; font-size: 13px; }
.auth-footnote { color: #63716a; font-size: 12px; text-align: center; margin-top: 24px; }
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 14px 0; }
.tx-pending-notice { margin-top: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-primary); color: var(--text-secondary); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; white-space: normal; }
.plan-card { padding: 24px; display: grid; gap: 12px; }
.coach-note { background: #f4f6ef; border-left: 3px solid #90a366; border-radius: 8px; padding: 18px; margin: 12px 0; line-height: 1.7; }
.coach-note.warning, .coach-note.danger { border-left-color: #b86a45; }
.table-scroll { overflow: auto; }
.review-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
.review-table td, .review-table th { padding: 14px 10px; border-bottom: 1px solid #e2e7df; }
.review-table td { vertical-align: middle; }
.review-table td .muted { margin: 3px 0 0; font-size: 12px; }
.review-table select { min-width: 150px; }
.remember-merchant { display: flex; align-items: center; gap: 9px; width: fit-content; padding: 8px 0; }
.rule-search-label { display: grid; gap: 6px; width: min(360px, 100%); margin: 16px 0; }
.rule-table { min-width: 700px; }
.rule-table td strong { display: block; max-width: 320px; overflow-wrap: anywhere; }
.rule-edit { margin-top: 5px; font-size: 12px; }
.rule-edit summary { color: #526c5e; cursor: pointer; }
.rule-edit input { display: block; width: min(300px, 100%); margin: 6px 0; }
.advanced-priority { max-width: 120px; }
.category-manager { gap: 20px; padding: clamp(20px, 3vw, 32px); }
.category-manager-intro { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 22px 24px; border: 1px solid #dfece0; border-radius: 20px; background: linear-gradient(120deg,#f8fcf6,#e8f5e9); }
.category-manager-intro h2 { margin: 0; font-size: clamp(20px, 2.5vw, 26px); letter-spacing: -.5px; }
.category-manager-intro .muted { max-width: 58ch; margin-bottom: 0; }
.category-manager-sparkle { display: grid; place-items: center; flex: 0 0 56px; height: 56px; border-radius: 20px; background: #fff; font-size: 28px; transform: rotate(8deg); box-shadow: 0 6px 16px #376f4815; }
.category-manager-tools { display: flex; flex-wrap: wrap; align-items: end; gap: 14px 20px; }
.category-manager-tools label { display: grid; gap: 7px; color: #3e5548; font-weight: 650; }
.category-manager-search { flex: 1 1 230px; max-width: 420px; }
.category-manager-search input, .category-create-form input { width: 100%; min-height: 46px; }
.category-create-form { display: flex; flex: 1 1 300px; align-items: end; flex-wrap: wrap; gap: 10px; }
.category-create-form label { flex: 1 1 180px; }
.category-create-form .btn { min-height: 46px; white-space: nowrap; }
.category-manager-status { margin: 0; color: #607367; font-size: 13px; }
.category-spec-migration { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 18px; padding: 20px 24px;
  border: 1px solid #cde2d1; border-radius: 18px; background: linear-gradient(120deg, #f7fcf6, #eaf5ec); }
.category-spec-migration h2 { margin: 0; font-size: 21px; }
.category-spec-migration p { margin: 6px 0; color: #526357; line-height: 1.5; }
.category-spec-migration ul { margin: 10px 0; padding-left: 20px; color: #405447; font-size: 14px; line-height: 1.6; }
.category-spec-migration-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.category-manager-list { display: grid; gap: 24px; min-width: 0; }
.category-manager-group-heading { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.category-manager-group-heading h3 { margin: 0; color: #3b5b4a; font-size: 15px; }
.category-manager-group-heading span { padding: 3px 8px; border-radius: 99px; background: #edf4ed; color: #526c5e; font-size: 12px; font-weight: 700; }
.category-manager-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); align-items: start; gap: 12px; }
.category-manager-row { min-width: 0; margin: 0; }
.category-manager-row[hidden], .category-manager-group[hidden] { display: none; }
.category-manager-card { overflow: hidden; border: 1px solid var(--card-strong); border-radius: 18px; background: linear-gradient(135deg,var(--card-light),#fff 80%); box-shadow: 0 5px 16px #293b2b0b; }
.category-manager-card > summary { display: flex; align-items: center; gap: 12px; min-height: 92px; padding: 16px; list-style: none; }
.category-manager-card > summary::-webkit-details-marker { display: none; }
.category-manager-card[open] > summary { margin: 0; border-bottom: 1px solid var(--card-strong); }
.category-manager-card > summary:hover { background: #ffffff70; }
.category-manager-card > summary:focus-visible { outline: 3px solid #226452; outline-offset: -4px; border-radius: 18px; }
.category-manager-icon { display: grid; place-items: center; flex: 0 0 48px; height: 48px; border-radius: 16px; background: var(--card-glow); font-size: 26px; }
.category-manager-card-title { display: grid; flex: 1; min-width: 0; gap: 5px; }
.category-manager-card-title strong { color: #263d31; font-size: 15px; line-height: 1.3; overflow-wrap: anywhere; }
.category-manager-card-title small { color: #52665a; font-size: 12px; line-height: 1.4; }
.category-manager-edit { flex: 0 0 auto; color: #275b44; font-size: 12px; font-weight: 750; }
.category-manager-editor { display: grid; gap: 15px; padding: 16px; background: #fff; }
.category-manager-editor label { display: grid; gap: 7px; color: #40584a; font-size: 13px; font-weight: 650; }
.category-manager-editor label[hidden] { display: none; }
.category-manager-editor input, .category-manager-editor select { width: 100%; min-height: 44px; }
.category-manager-editor .category-counts-field { display: grid; gap: 7px; min-width: 0; }
.category-counts-field small { color: #52665a; font-size: 12px; line-height: 1.5; }
.category-manager-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.category-manager-actions .btn { min-height: 44px; }
.category-review { gap: 16px; padding: clamp(20px, 3vw, 32px); }
.category-review-intro { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 22px 24px; border: 1px solid #e6d9ed; border-radius: 20px; background: linear-gradient(120deg,#fbf7ff,#f3e9fa); }
.category-review-intro h2 { margin: 0; font-size: clamp(20px, 2.5vw, 26px); letter-spacing: -.5px; }
.category-review-intro .muted { max-width: 58ch; margin-bottom: 0; }
.category-review-sticker { display: grid; place-items: center; flex: 0 0 56px; height: 56px; border-radius: 20px; background: #fff; color: #825ba0; font-size: 30px; transform: rotate(8deg); box-shadow: 0 6px 16px #63377a15; }
.category-review-controls, .category-review-actions { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.category-review-controls label, .category-review-list-tools > label:first-child { display: grid; gap: 7px; color: #40584a; font-size: 13px; font-weight: 650; }
.category-review-controls select, .category-review-controls .btn, .category-review-actions .btn { min-height: 44px; }
.category-review-status, .category-review-footnote { margin: 0; color: #596e60; font-size: 13px; line-height: 1.5; }
.category-review-status:empty, #review-rule-action:empty, #review-warnings:empty { display: none; }
.category-review-warning { border: 1px solid #ead8ae; border-radius: 15px; background: #fffaf0; }
.category-review-warning > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 15px; cursor: pointer; color: #684c1f; }
.category-review-warning > summary span { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 9px; background: #f5dfac; font-weight: 800; }
.category-review-warning > summary small { color: #755f39; }
.category-review-warning-body { padding: 0 15px 15px; color: #634e2c; font-size: 13px; }
.category-review-warning-body p { line-height: 1.5; }
.category-old-rule-tools { display: flex; flex-wrap: wrap; align-items: end; gap: 8px 16px; margin: 14px 0; }
.category-old-rule-tools label { display: grid; flex: 1 1 220px; max-width: 400px; gap: 6px; font-weight: 700; }
.category-old-rule-tools input { width: 100%; min-height: 44px; }
.category-old-rule-tools span, .category-old-rule-hint { color: #755f39; font-size: 12px; }
.category-old-rule-hint { display: block; margin-top: 7px; }
.category-review-warning-body ul { max-height: 320px; overflow: auto; margin: 12px 0 0; padding: 0; list-style: none; }
.category-review-warning-body li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid #eadfc8; overflow-wrap: anywhere; }
.category-review-warning-body li[hidden] { display: none; }
.category-old-rule-info { display: grid; flex: 1 1 220px; min-width: 0; gap: 4px; }
.category-old-rule-info small { color: #755f39; line-height: 1.4; }
.category-old-rule-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.category-old-rule-actions .btn { min-height: 40px; }
.category-review-list-tools { display: flex; flex-wrap: wrap; align-items: end; gap: 12px 20px; margin-bottom: 12px; }
.category-review-list-tools > label:first-child { flex: 1 1 230px; max-width: 400px; }
.category-review-list-tools input[type="search"] { width: 100%; min-height: 44px; }
.category-review-select-all { display: flex; align-items: center; gap: 8px; min-height: 44px; color: #40584a; font-size: 13px; font-weight: 650; }
#review-result-count { align-self: center; color: #607367; font-size: 12px; }
.category-review-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); align-items: start; gap: 10px; max-height: 560px; overflow: auto; padding: 2px; }
.category-suggestion { min-width: 0; padding: 16px; border: 1px solid #dfebe0; border-radius: 16px; background: linear-gradient(135deg,#f6fbf3,#fff 75%); }
.category-suggestion:nth-child(3n+2) { border-color: #e7deee; background: linear-gradient(135deg,#faf5fd,#fff 75%); }
.category-suggestion:nth-child(3n) { border-color: #efdfd0; background: linear-gradient(135deg,#fff8ee,#fff 75%); }
.category-suggestion[hidden] { display: none; }
.category-suggestion-head { display: flex; align-items: start; gap: 10px; min-width: 0; }
.category-suggestion-head > div { min-width: 0; overflow-wrap: anywhere; }
.category-suggestion-head small, .category-suggestion-choice small { display: block; margin-top: 5px; color: #617469; font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.category-suggestion-check { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.category-suggestion-check span { color: #8d68a9; font-size: 20px; }
.category-suggestion-choice { display: grid; gap: 8px; margin-top: 12px; }
.category-suggestion-choice label { display: grid; gap: 6px; color: #40584a; font-size: 12px; font-weight: 700; }
.category-suggestion-choice select { width: 100%; min-height: 42px; }
.category-review-empty { margin: 0; padding: 18px; border-radius: 14px; background: #f1f8ee; color: #395c43; }
.category-review-rules { min-width: 0; padding-top: 14px; border-top: 1px solid #e1e9df; }
.category-review-rules > summary { color: #355a46; font-weight: 700; cursor: pointer; }
.category-review-legacy { display: block; margin-top: 4px; color: #7d613a; }
@media (max-width: 600px) {
  .category-review-intro { padding: 18px; }
  .category-spec-migration { flex-direction: column; padding: 18px; }
  .category-spec-migration-actions { width: 100%; }
  .category-review-sticker { flex-basis: 44px; height: 44px; font-size: 24px; }
  .category-review-controls label, .category-review-controls .btn, .category-review-actions .btn { width: 100%; }
  .category-review-list-tools > label:first-child { max-width: none; }
  .rule-table, .rule-table tbody, .rule-table tr, .rule-table td { display: block; min-width: 0; width: 100%; }
  .review-table.rule-table { min-width: 0; }
  .rule-table thead { display: none; }
  .rule-table tr { margin-bottom: 12px; padding: 12px; border: 1px solid #dfe8df; border-radius: 14px; }
  .rule-table tr[hidden] { display: none; }
  .rule-table td { padding: 7px 0; border: 0; }
  .rule-table td:nth-child(2)::before, .rule-table td:nth-child(4)::before { display: block; margin-bottom: 6px; color: #40584a; font-weight: 700; }
  .rule-table td:nth-child(2)::before { content: 'Category'; }
  .rule-table td:nth-child(4)::before { content: 'Enabled'; }
  .rule-table select, .rule-table .btn { width: 100%; }
}
.category-confidence { display: block; max-width: 230px; margin-top: 5px; color: #63716a; font-size: 11px; line-height: 1.35; }
.category-overview-header { align-items: center; padding: 30px 34px; border-radius: 24px; background: radial-gradient(circle at 85% 10%,#dff3e4 0 8%,transparent 8.5%),linear-gradient(120deg,#fff 0%,#f0f7ea 62%,#e2f1e6 100%); }
.category-overview-header h1 { margin: 0; font-size: clamp(30px,4vw,42px) !important; }
.category-overview-header .muted { max-width: 540px; margin-bottom: 0; }
.category-overview-header .eyebrow { color: #377a60; }
.category-overview-header .btn { white-space: nowrap; box-shadow: 0 8px 18px #22645222; }
.category-overview-summary { display: flex; gap: 14px; flex-wrap: wrap; }
.category-overview-summary > div { display: flex; align-items: center; gap: 12px; min-width: 170px; padding: 13px 18px; border: 1px solid #e5eadf; border-radius: 16px; background: #fff; box-shadow: 0 5px 18px #314a3510; }
.category-overview-summary > div > span:last-child { display: grid; gap: 1px; }
.category-overview-summary strong { color: #244d3c; font-size: 18px; }
.category-overview-summary small { color: #738078; font-size: 11px; }
.summary-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: #e7f3e9; color: #287356; font-size: 19px; }
.category-cards { display: grid; grid-template-columns: repeat(auto-fill,minmax(220px,1fr)); gap: 18px; }
.category-card { position: relative; display: grid; grid-template-columns: 1fr auto; min-height: 198px; overflow: hidden; padding: 20px; text-align: left; border: 1px solid #e9ece4; border-radius: 22px; background: linear-gradient(145deg,var(--card-light),#fff 72%); color: #25352c; cursor: pointer; box-shadow: 0 7px 22px #293b2b0b; animation: card-arrive .42s both; animation-delay: calc(var(--card-order) * 24ms); transition: transform .18s ease,box-shadow .18s ease,border-color .18s ease; }
.category-card:hover { transform: translateY(-4px); border-color: var(--card-strong); box-shadow: 0 15px 30px #293b2b18; }
.category-card-art { position: absolute; inset: 0 0 auto auto; width: 142px; height: 126px; overflow: hidden; border-radius: 0 21px 0 100%; background: var(--card-glow); }
.category-card-art::before,.category-card-art::after { content: ""; position: absolute; border: 1px solid #ffffffa8; border-radius: 50%; }
.category-card-art::before { width: 94px; height: 94px; right: -17px; top: -22px; }
.category-card-art::after { width: 68px; height: 68px; right: 8px; top: 19px; }
.category-card-art > span { position: absolute; z-index: 1; top: 25px; right: 27px; font-size: 43px; filter: drop-shadow(0 5px 5px #3d463322); transform: rotate(-7deg); }
.category-card-art i,.category-card-art b { position: absolute; z-index: 1; display: block; border-radius: 50%; background: #ffffff70; }
.category-card-art i { top: 20px; left: 34px; width: 9px; height: 9px; }
.category-card-art b { right: 18px; bottom: 17px; width: 7px; height: 7px; }
.category-card-copy { z-index: 2; align-self: end; display: grid; gap: 5px; max-width: 100%; }
.category-card-copy strong { max-width: 190px; overflow-wrap: anywhere; font-size: 17px; letter-spacing: -.3px; }
.category-card-copy small { color: #6c7a70; font-size: 12px; }
.category-card-arrow { z-index: 2; align-self: end; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #ffffffc9; color: #334f40; font-size: 18px; }
.category-fresh { --card-light:#fff6df;--card-glow:#f3d994;--card-strong:#e8c267; }
.category-home { --card-light:#f2eaff;--card-glow:#cfb5ed;--card-strong:#ad89d7; }
.category-travel { --card-light:#e4f4ff;--card-glow:#a6d6f1;--card-strong:#73b6d9; }
.category-care { --card-light:#ffe9ed;--card-glow:#f2b6c1;--card-strong:#df8d9c; }
.category-income { --card-light:#e3f8ed;--card-glow:#a6e1bf;--card-strong:#72c394; }
.category-growth { --card-light:#edfae4;--card-glow:#bddd9c;--card-strong:#97c16a; }
.category-utility { --card-light:#e7f4ff;--card-glow:#a6cbed;--card-strong:#7eaddc; }
.category-shop { --card-light:#ffecdf;--card-glow:#f0c09b;--card-strong:#dd9e70; }
.category-play { --card-light:#fbe8f5;--card-glow:#e8b2d5;--card-strong:#d68abd; }
.category-finance { --card-light:#e7edff;--card-glow:#b5c2f0;--card-strong:#8b9ddc; }
.category-other { --card-light:#edf0f0;--card-glow:#c4cdcc;--card-strong:#a7b3b0; }
.category-empty { grid-column: 1/-1; padding: 54px 24px; border: 1px dashed #ccd8cd; border-radius: 20px; color: #718078; text-align: center; background: #ffffffa8; }
.category-admin-header { align-items: center; }
.category-admin-header .btn { white-space: nowrap; }
@keyframes card-arrive { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
#category-delete-dialog { border: 0; box-shadow: 0 20px 80px #264e3533; }
#category-delete-dialog form { display: grid; gap: 14px; }
#category-delete-dialog form > label { display: grid; gap: 7px; }
details > summary { cursor: pointer; font-weight: 650; }
details[open] > summary { margin-bottom: 12px; }
.editor { border: 0; padding: 28px; border-radius: 18px; width: min(560px,90vw); max-height: 90vh; color: #202e2a; }
.editor::backdrop { background: #172f2566; }
.editor form { display: grid; gap: 14px; }
.editor label { display: grid; gap: 5px; }
.editor h2 { margin-bottom: 10px; }
.mtd-dialog { width: min(760px, calc(100vw - 32px)); max-width: 760px; max-height: min(82vh, 820px); padding: 0; overflow: hidden; border: 1px solid #e1e9df; border-radius: 24px; color: #202e2a; background: #fff; box-shadow: 0 24px 90px #172f2540; }
.mtd-dialog::backdrop { background: #172f2570; backdrop-filter: blur(4px); }
.mtd-dialog-shell { display: grid; grid-template-rows: auto auto minmax(120px,1fr) auto; max-height: min(82vh,820px); }
.mtd-dialog-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding: 28px 30px 20px; background: radial-gradient(circle at 92% 10%,#dcefe1 0 13%,transparent 13.5%),linear-gradient(115deg,#f6faf4,#fff 72%); }
.mtd-dialog-header .eyebrow { margin-bottom: 8px; color: #377a60; }
.mtd-dialog-header h2 { margin: 0; font-size: clamp(22px,4vw,30px); letter-spacing: -.8px; }
.mtd-dialog-header .muted { margin: 4px 0 0; }
.mtd-dialog-close { flex: 0 0 auto; width: 38px; height: 38px; border: 1px solid #dce5db; border-radius: 12px; color: #355b49; background: #fff; font-size: 25px; line-height: 1; cursor: pointer; }
.mtd-dialog-summary { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; padding: 0 30px 20px; }
.mtd-dialog-summary > div { display: grid; gap: 4px; padding: 14px 16px; border: 1px solid #e5ebe2; border-radius: 15px; background: #fbfcfa; }
.mtd-dialog-summary span { color: #63716a; font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; }
.mtd-dialog-summary strong { color: #244d3c; font-size: 20px; letter-spacing: -.4px; }
.mtd-dialog-content { overflow: auto; min-height: 130px; padding: 0 30px 12px; }
.mtd-transaction-list { display: grid; }
.mtd-transaction-row { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 14px; padding: 14px 4px; border-top: 1px solid #edf0eb; }
.mtd-transaction-description { overflow-wrap: anywhere; font-size: 14px; font-weight: 650; }
.mtd-transaction-date { margin-top: 4px; color: #748078; font-size: 12px; }
.mtd-transaction-amount { text-align: right; white-space: nowrap; font-size: 14px; font-weight: 750; }
.mtd-transaction-amount.debit { color: #a94b3e; }
.mtd-transaction-amount.credit { color: #287356; }
.mtd-dialog-state { display: grid; place-items: center; min-height: 150px; padding: 24px; color: #63716a; text-align: center; }
.mtd-dialog-state strong { display: block; margin-bottom: 6px; color: #304c3d; font-size: 16px; }
.mtd-dialog-footer { display: flex; justify-content: flex-end; padding: 16px 30px 22px; border-top: 1px solid #edf0eb; background: #fff; }
@media (max-width: 600px) {
  .mtd-dialog { width: calc(100vw - 20px); max-height: 88vh; border-radius: 19px; }
  .mtd-dialog-shell { max-height: 88vh; }
  .mtd-dialog-header { padding: 22px 20px 16px; }
  .mtd-dialog-summary { padding: 0 20px 16px; }
  .mtd-dialog-content { padding: 0 20px 10px; }
  .mtd-dialog-footer { padding: 14px 20px 18px; }
}
@media(max-width:1100px) { body .main-content { padding: 28px; } }
@media(max-width:768px) { body .app-container { grid-template-columns: 1fr; } body .main-content { padding: 72px 18px 24px; } body .sidebar { width: 280px; } body .header { align-items: flex-start; } .auth-card { padding: 28px; } #goals-list { grid-template-columns: 1fr !important; } .panel-container { grid-template-columns: 1fr !important; } body .metrics-grid { grid-template-columns: 1fr 1fr; } .review-table { min-width: 650px; } }
@media(max-width:768px) { .category-overview-header { display: grid; padding: 24px; } .category-overview-header > .btn { width: 100%; } .category-cards { grid-template-columns: repeat(auto-fill,minmax(155px,1fr)); gap: 12px; } .category-card { min-height: 170px; padding: 15px; } .category-card-art { transform: scale(.82); transform-origin: top right; } .category-card-copy strong { max-width: 145px; font-size: 15px; } .category-overview-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .category-overview-summary > div { min-width: 0; padding: 10px; } .category-admin-header { display: grid; } .category-admin-header .btn { width: 100%; } }
@media(prefers-reduced-motion:reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Account recovery, support sessions and admin navigation */
.link-button { background: none; border: 0; color: #226452; text-decoration: underline; cursor: pointer; padding: 4px; font-size: 13px; }
.admin-only { display: none; }
body.is-admin .admin-only { display: block; }
a.nav-btn { display: block; text-decoration: none; }
.support-banner { position: sticky; top: 0; z-index: 1000; display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 12px 20px; background: #fff4d6; color: #5c4210; border-bottom: 2px solid #d9a73b; font-size: 14px; font-weight: 600; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; background: #dcebe4; color: #164b3d; font-size: 12px; font-weight: 700; }

/* Shared workspace surfaces override legacy page-specific presentation. */
*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: light; }
html body { margin: 0; background: var(--bg-primary); color: var(--text-primary); font-family: "Segoe UI", system-ui, sans-serif; font-size: 14px; line-height: 1.5; }
body .app-container { height: 100vh; height: 100dvh; grid-template-columns: 244px minmax(0,1fr); }
body .sidebar { min-height: 0; overflow-y: auto; background: #101e33; border-right: 1px solid #23334a; padding: 30px 16px 22px; }
body .sidebar-logo { color: #fff; font-size: 23px; letter-spacing: -.8px; padding: 0 8px; }
body .sidebar-caption { color: #a3b3c9; font-size: 9px; letter-spacing: 1.5px; margin: 0 8px 30px; }
body .nav-list { gap: 5px; }
body .nav-btn { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 12px 14px; color: #bac8dc; font-size: 13px; font-weight: 550; border-radius: 9px; }
.nav-btn svg { width: 19px; height: 19px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
body .nav-btn:hover { color: #fff; background: #1c2f49; }
body .nav-btn.active { color: #fff; background: #047857; box-shadow: 0 4px 14px #0002; }
.sidebar-bottom { color: #a3b3c9; margin-top: auto; padding: 28px 8px 0; }
.sidebar-bottom #account-name { color: #fff; font-weight: 650; overflow-wrap: anywhere; }
.sidebar-bottom .btn-secondary { background: #1c2f49; color: #e2e8f0; border-color: #344760; justify-content: center; }
body .main-content { min-width: 0; padding: 24px 36px 40px; gap: 30px; scrollbar-gutter: stable; }
.main-content > .view, .workspace-bar { width: 100%; max-width: 1560px; margin-inline: auto; flex-shrink: 0; }
.workspace-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 0 0 20px; border-bottom: 1px solid var(--border); }
.workspace-bar nav { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--text-secondary); }
.workspace-bar a { color: var(--text-secondary); text-decoration: none; }
.workspace-bar a:hover { color: var(--primary); text-decoration: underline; }
#current-page { color: var(--text-primary); font-weight: 650; }
.workspace-badge { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--text-secondary); white-space: nowrap; }
.workspace-badge > span { width: 6px; height: 6px; background: var(--primary); border-radius: 50%; }
body .view { gap: 24px; min-width: 0; }
body .header { align-items: center; gap: 20px; flex-wrap: wrap; }
body .header h1 { color: var(--text-primary); font-size: clamp(26px, 3vw, 36px); letter-spacing: -1.2px; line-height: 1.2; font-weight: 720; }
.eyebrow { color: var(--primary-dark); font-size: 10px; letter-spacing: 1.6px; margin-bottom: 10px; }
.muted { color: var(--text-secondary); line-height: 1.65; }
.header .muted { margin-bottom: 0; }
body .panel, body .metric-card { min-width: 0; max-height: none; border: 1px solid var(--border); border-radius: 16px; background: #fff; box-shadow: 0 3px 12px #0f172a04; }
body .panel-header { padding: 20px 24px; background: #f8fafc; border-color: var(--border); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; border: 1px solid transparent; font: inherit; font-weight: 650; text-decoration: none; cursor: pointer; transition: background .15s, box-shadow .15s; }
body .btn { border-radius: 9px; padding: 10px 16px; }
body .btn-primary { background: var(--primary); color: #fff; box-shadow: 0 2px 3px #065f461a; }
body .btn-primary:hover { background: var(--primary-dark); opacity: 1; transform: none; }
body .btn-secondary { background: #fff; color: #334155; border: 1px solid #cbd5e1; }
body .btn-secondary:hover { background: #f1f5f9; opacity: 1; transform: none; }
body .sidebar-bottom .btn-secondary { background: #1c2f49; color: #e2e8f0; border-color: #344760; }
input, select, textarea { min-width: 0; min-height: 42px; border-color: #cbd5e1; border-radius: 8px; background: #fff; color: var(--text-primary); }
input[type=checkbox] { min-height: 0; accent-color: var(--primary); flex-shrink: 0; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid #10b981; outline-offset: 3px; }
.metrics-grid { gap: 16px; }
body .metric-card { padding: 22px; gap: 10px; }
body .metric-label { color: var(--text-secondary); font-size: 10px; font-weight: 700; letter-spacing: 1px; }
body .metric-value { color: var(--text-primary); font-size: clamp(22px, 2.5vw, 30px); font-weight: 720; font-variant-numeric: tabular-nums; }
.metric-card.income .metric-value { color: var(--success); }
.metric-card.expense .metric-value { color: var(--danger); }
.metric-caption { color: var(--text-secondary); font-size: 11px; }
body .filter-panel { display: flex; flex-direction: row; flex-wrap: wrap; align-items: end; gap: 16px; padding: 20px; overflow: visible; }
.filter-panel label, .dialog-filter label { display: grid; gap: 7px; font-size: 12px; font-weight: 650; color: var(--text-secondary); }
.filter-panel label input, .filter-panel label select { width: 100%; min-width: 170px; }
.filter-panel .checkbox-filter { display: flex; align-items: center; gap: 9px; min-height: 42px; color: var(--text-primary); }
.filter-panel .checkbox-filter input { min-width: 0; width: 17px; }
.filter-status { margin: 0 0 11px auto; color: var(--text-secondary); font-size: 12px; }
body .transaction-panel { padding: 8px 20px; overflow: auto; }
.mobile-scroll-hint { display: none; }
@media (max-width: 768px) {
  .mobile-scroll-hint { display: block; margin: 0 0 8px; font-size: 12px; color: var(--text-secondary); }
}
.transactions-table { min-width: 720px; font-size: 13px; }
.transactions-table th { padding: 16px 14px !important; white-space: nowrap; font-size: 10px; text-transform: uppercase; letter-spacing: .8px; color: var(--text-secondary); border-bottom: 1px solid var(--border); }
.transactions-table td { padding: 16px 14px !important; border-bottom: 1px solid #edf2f7; }
.transactions-table td:nth-child(2) { min-width: 180px; max-width: 380px; overflow-wrap: anywhere; }
.transactions-table td:last-child { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.amount-debit { color: var(--danger); }
.amount-credit { color: var(--success); }
.transactions-table tbody tr:hover { background: #f8fafc; }
.transactions-table select { max-width: 210px; width: 100%; font-size: 12px; }
.empty-state { padding: 40px 20px; text-align: center; color: var(--text-secondary); }
.category-overview-header { padding: 0; background: none; border-radius: 0; }
.category-overview-header .eyebrow { color: var(--primary-dark); }
.category-overview-header .btn { box-shadow: none; }
.category-overview-summary > div { min-width: 190px; padding: 16px 20px; border-color: var(--border); border-radius: 12px; box-shadow: none; }
.category-overview-summary strong { color: var(--text-primary); }
.category-overview-summary small { color: var(--text-secondary); }
.summary-icon { background: #d1fae5; color: var(--primary-dark); }
.category-cards { grid-template-columns: repeat(auto-fill,minmax(225px,1fr)); gap: 16px; }
.category-card { min-height: 210px; padding: 24px; background: #fff; color: var(--text-primary); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 3px 12px #0f172a04; animation: none; }
.category-card:hover { border-color: var(--primary); transform: translateY(-3px); box-shadow: 0 12px 24px #0f172a0d; }
.category-card-art { top: 20px; right: 20px; width: 48px; height: 48px; border-radius: 12px; background: var(--card-strong); }
.category-card-art::before, .category-card-art::after, .category-card-art i, .category-card-art b { display: none; }
.category-card-art > span { display: grid; place-items: center; inset: 0; font-size: 25px; transform: none; filter: none; }
.category-card-copy { gap: 5px; padding-top: 55px; }
.category-card-copy strong { font-size: 15px; font-weight: 650; }
.category-card-copy small { color: var(--text-secondary); }
.category-card-total { font-size: 24px; letter-spacing: -.6px; font-weight: 720; font-variant-numeric: tabular-nums; }
#category-admin-content { display: grid; gap: 24px; min-width: 0; }
.toolbar > label { display: grid; gap: 6px; max-width: 100%; }
.category-card-arrow { width: 30px; height: 30px; background: #f1f5f9; color: #334155; }
.category-fresh { --card-strong: #fbbf24; }
.category-home { --card-strong: #a78bfa; }
.category-travel, .category-utility { --card-strong: #38bdf8; }
.category-care, .category-play { --card-strong: #fb7185; }
.category-income, .category-growth { --card-strong: #34d399; }
.category-shop { --card-strong: #fb923c; }
.category-finance { --card-strong: #818cf8; }
.category-other { --card-strong: #cbd5e1; }
/* The global margin reset also affects native dialogs; center every top-layer panel explicitly. */
body dialog { position: fixed; inset: 0; margin: auto; width: min(560px,calc(100vw - 40px)); max-width: calc(100vw - 40px); max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); overflow: auto; border: 1px solid #dce4ee; border-radius: 20px; background: #fff; color: var(--text-primary); box-shadow: 0 32px 100px #0f172a40; }
body dialog:not([open]) { display: none; }
body dialog::backdrop { background: #0b172bb3; backdrop-filter: blur(6px); }
body .editor { padding: 28px; }
dialog [role=alert] { color: var(--danger); font-size: 13px; }
dialog [role=alert]:empty { display: none; }
body .floating-dialog { width: min(600px,calc(100vw - 40px)); padding: 0; }
body #fixed-estimate-dialog { width: min(480px,calc(100vw - 32px)); }
.fixed-estimate-body { padding: 28px; }
.fixed-estimate-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.fixed-estimate-header h2 { margin: 3px 0 4px; font-size: 23px; line-height: 1.2; letter-spacing: -.5px; }
.fixed-estimate-eyebrow { margin: 0; color: #047857; font-size: 10px; font-weight: 800; letter-spacing: 1.2px; }
.fixed-estimate-name { margin: 0; color: var(--text-secondary); font-size: 14px; overflow-wrap: anywhere; }
.fixed-estimate-intro { margin: 20px 0; color: var(--text-secondary); font-size: 14px; line-height: 1.6; }
.fixed-estimate-label { display: block; margin-bottom: 8px; color: var(--text-primary); font-size: 13px; font-weight: 700; }
.fixed-estimate-input { display: flex; align-items: center; gap: 8px; padding: 0 14px; border: 1px solid #cbd5e1; border-radius: 12px; background: #fff; }
.fixed-estimate-input:focus-within { border-color: var(--primary); outline: 3px solid #10b98133; }
.fixed-estimate-input span { color: #64748b; font-size: 18px; font-weight: 700; }
.fixed-estimate-input input { width: 100%; min-width: 0; min-height: 50px; padding: 0; border: 0; outline: 0; background: transparent; color: var(--text-primary); font-size: 18px; font-weight: 700; box-shadow: none; }
.fixed-estimate-note { margin-top: 20px; padding: 14px 16px; border: 1px solid #d5eae1; border-radius: 12px; background: #f0faf5; color: #355d4d; font-size: 13px; line-height: 1.55; }
.fixed-estimate-note strong { color: #166348; }
.fixed-estimate-note p { margin: 5px 0 0; }
.fixed-estimate-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.fixed-estimate-footer .btn { min-height: 44px; }
@media (max-width: 480px) { .fixed-estimate-body { padding: 22px; } .fixed-estimate-footer .btn { flex: 1; } }
#add-goal-modal { width: min(520px,calc(100vw - 40px)); }
.floating-dialog-body { width: 100%; }
.dialog-close, .mtd-dialog-close { display: grid; place-items: center; flex-shrink: 0; width: 38px; height: 38px; border-radius: 10px; background: #f1f5f9; color: #334155; border: 1px solid var(--border); font-size: 24px; cursor: pointer; }
body #import-modal { width: min(520px,calc(100vw - 24px)); max-width: calc(100vw - 24px); padding: 0; overscroll-behavior: contain; scrollbar-width: thin; }
.import-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 24px 16px; }
.import-header h2 { margin: 0; font-size: 21px; line-height: 1.3; letter-spacing: -.5px; }
.import-header p { margin: 5px 0 0; color: var(--text-secondary); font-size: 13px; line-height: 1.5; }
#import-modal .dialog-close { width: 40px; height: 40px; }
.import-tabs { display: flex; gap: 4px; margin: 0 24px; padding: 4px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-tertiary); }
.import-tabs button { flex: 1; min-width: 0; min-height: 44px; padding: 8px; border: 0; border-radius: 8px; font: inherit; font-size: 13px; cursor: pointer; }
.import-content { padding: 20px 24px 24px; }
#import-modal .import-account { margin-bottom: 16px; padding-bottom: 16px; }
#import-account-select { width: 100%; min-height: 44px; padding: 10px 12px; background: #fff; color: var(--text-primary); border: 1px solid #cbd5e1; border-radius: 8px; font: inherit; font-size: 14px; }
#import-modal .import-new-account { grid-template-columns: repeat(2,minmax(0,1fr)); }
#import-modal .import-new-account :is(input,select) { width: 100%; min-width: 0; min-height: 44px; }
.import-description { margin: 0 0 14px; color: var(--text-secondary); font-size: 13px; line-height: 1.55; }
.import-hint { margin: 8px 0 0; color: var(--text-secondary); font-size: 12px; line-height: 1.5; }
.import-dropzone { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 6px; width: 100%; min-height: 132px; padding: 18px 14px; border: 1.5px dashed #94aaa4; border-radius: 12px; background: #f6faf8; color: var(--text-primary); font: inherit; text-align: center; cursor: pointer; transition: background .15s,border-color .15s; }
.import-dropzone:hover { border-color: var(--primary); background: #edf7f2; }
.import-dropzone strong { font-size: 14px; font-weight: 650; }
.import-dropzone > span:last-child { color: var(--text-secondary); font-size: 12px; line-height: 1.5; }
.import-file-icon { display: grid; place-items: center; width: 28px; height: 28px; margin-bottom: 2px; border-radius: 8px; background: #e2eee7; color: #226452; font-size: 23px; }
.import-file-list { margin-top: 12px; overflow-wrap: anywhere; }
.import-file-list:empty { display: none; }
.import-actions { margin-top: 16px; }
#import-history { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
#import-history summary { cursor: pointer; font-weight: 600; }
#import-history .import-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
#import-modal #import-history .import-actions .btn { width: auto; flex: 1 1 140px; }
#import-history-list { margin-top: 12px; max-height: 280px; overflow-y: auto; overflow-wrap: anywhere; }
#import-history-list label { cursor: pointer; font-size: 13px; line-height: 1.5; }
#import-history-list input { margin-right: 6px; }
.import-history-entry { padding: 10px 0; border-bottom: 1px solid var(--border); }
.import-recovery-review { margin-top: 16px; padding: 16px; border: 2px solid var(--primary); border-radius: 12px; background: var(--bg-tertiary); font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.import-recovery-review h3 { margin: 0 0 12px; }
#import-history-selection { font-size: 13px; font-weight: 600; }
#import-history .import-actions { position: relative; }
#import-history button[aria-pressed="true"] { border-color: var(--primary); font-weight: 700; }
.csv-account-mapping { min-width: 0; margin: 12px 0; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-secondary); }
.csv-account-mapping legend { padding: 0 6px; font-weight: 700; color: var(--text-primary); }
.csv-account-mapping > label { display: block; margin: 10px 0 6px; font-size: 13px; font-weight: 600; }
.csv-account-mapping select { width: 100%; min-width: 0; }
#csv-account-review { margin: 16px 0; }
#csv-overlap-review { margin: 20px 0; color: var(--text-primary); }
#csv-overlap-review > p { font-size: 13px; line-height: 1.6; }
.csv-overlap-list { max-height: 420px; overflow-y: auto; padding: 4px; }
.csv-overlap-incoming { padding: 12px; background: var(--bg-tertiary); border-radius: 8px; overflow-wrap: anywhere; }
.csv-overlap-incoming p { margin: 6px 0 0; font-size: 12px; }
#csv-overlap-review .csv-overlap-option { display: flex; align-items: flex-start; gap: 10px; margin: 12px 0; padding: 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; line-height: 1.5; cursor: pointer; }
.csv-overlap-option input { flex: 0 0 auto; width: auto; margin-top: 4px; accent-color: var(--primary); }
.csv-overlap-option span { min-width: 0; overflow-wrap: anywhere; }
.csv-overlap-option small { display: block; margin-top: 5px; color: var(--text-secondary); }
.csv-overlap-option:focus-within { outline: 2px solid var(--primary); outline-offset: 2px; }
#import-modal .import-actions .btn { width: 100%; min-height: 44px; }
.import-detected-account { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; margin-bottom: 14px; padding: 10px 12px; border: 1px solid #dce9e1; border-radius: 10px; background: #f6faf8; color: #35584a; font-size: 12px; line-height: 1.5; }
.import-detected-account button { min-height: 36px; padding: 4px 0; border: 0; background: transparent; color: #226452; font: inherit; font-weight: 650; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
#import-result { margin-top: 16px; padding: 14px; border-radius: 10px; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
#import-modal :is(button,input,select):focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
@media (max-width: 540px) {
  .import-header { padding: 18px 18px 14px; }
  .import-tabs { margin-inline: 18px; }
  .import-content { padding: 16px 18px 20px; }
  #import-modal :is(input,select) { font-size: 16px; }
}
body .mtd-dialog { width: min(780px,calc(100vw - 40px)); padding: 0; overflow: hidden; }
.mtd-dialog-shell { max-height: calc(100vh - 50px); max-height: calc(100dvh - 50px); grid-template-rows: auto auto auto minmax(80px,1fr) auto; }
.mtd-dialog-header { padding: 26px 28px 20px; background: #f8fafc; }
.mtd-dialog-header h2 { color: var(--text-primary); }
.mtd-dialog-header .eyebrow { color: var(--primary-dark); }
.dialog-filter { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; padding: 16px 28px; }
.mtd-dialog-summary { padding: 0 28px 20px; }
.mtd-dialog-summary > div { border-color: var(--border); background: #f8fafc; border-radius: 12px; }
.mtd-dialog-summary strong { color: var(--text-primary); }
.mtd-dialog-content { padding-inline: 28px; }
.mtd-transaction-amount.debit { color: var(--danger); }
.mtd-transaction-amount.credit { color: var(--success); }
.mtd-dialog-footer { padding: 16px 28px; }
body:has(dialog[open]) .main-content { overflow: hidden; }
.auth-screen { background: radial-gradient(ellipse at top right,#d1fae5,transparent 65%),#edf2f7; }
.auth-card { border-color: var(--border); box-shadow: var(--shadow); }
.auth-card h1 { color: var(--text-primary); }
.admin-shell { color: var(--text-primary); }
.admin-shell .card, .admin-shell .stat { border-color: var(--border); border-radius: 16px; box-shadow: 0 3px 12px #0f172a04; }
.admin-shell .tabs button.active { color: var(--primary); border-bottom-color: var(--primary); }
.admin-shell .admin-workspace-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
/* Section and data separation: every content block is a titled panel; data rows have clear dividers. */
body .panel, body .metric-card, .category-card { border-color: var(--border); box-shadow: 0 1px 2px #0f172a0d, 0 8px 20px -10px #0f172a1f; }
body .view { gap: 28px; }
body .section-panel { padding: 0; overflow: hidden; }
.section-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px 20px; padding: 18px 24px; background: #f8fafc; border-bottom: 1px solid var(--border); }
.section-head h2 { margin: 0; color: var(--text-primary); font-size: 17px; font-weight: 700; letter-spacing: -.2px; }
.section-head > div:first-child > div { margin-top: 3px; color: var(--text-secondary); font-size: 12px; }
.section-panel > :not(.section-head) { margin: 22px 24px; }
.section-panel > #dashboard-payments { margin: 0; overflow-x: auto; }
#dashboard-payments { padding: 20px 24px 24px; color: var(--text-primary); }
#cashflow-safety-badge > div { border-radius: 999px !important; padding: 6px 14px !important; font-size: 12px !important; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { padding: 12px 24px !important; background: #f1f5f9; color: var(--text-secondary); font-size: 10.5px; font-weight: 700; letter-spacing: .8px; text-align: left; text-transform: uppercase; white-space: nowrap; border-bottom: 1px solid var(--border); }
.data-table td { padding: 14px 24px !important; vertical-align: middle; border-bottom: 1px solid var(--divider); }
.data-table tbody tr:nth-child(even) { background: #f9fbfd; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #f1f6fb; }
.data-table tr.is-paid td { opacity: .62; }
.data-table tr.is-income { background: #f0fdf4; }
.data-table tr.is-deficit { background: #fff1f2; }
.data-table tr.is-deficit td:first-child { box-shadow: inset 4px 0 0 var(--danger); }
.data-table td:nth-child(n+3) { font-variant-numeric: tabular-nums; white-space: nowrap; }
body .btn-compact { min-height: 30px; margin-top: 8px; padding: 5px 11px; border-radius: 7px; font-size: 11.5px; }
body .metric-card { position: relative; overflow: hidden; }
.metric-card.income::before, .metric-card.expense::before, .metric-card.net::before, .metric-card.balance::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--accent, var(--primary)); }
.metric-card.income { --accent: var(--success); }
.metric-card.expense { --accent: var(--danger); }
.metric-card.net { --accent: #2563eb; }
.metric-card.balance { --accent: #0f766e; }
/* Layered spending tiles keep the amount primary; budgets fill upward at the right. */
#mtd-spending-section { background: radial-gradient(ellipse at 0 0,#e1f1ed 0,transparent 55%), radial-gradient(ellipse at 100% 100%,#e9e5f5 0,transparent 55%), #edf2f7; border: 1px solid #d9e3ed; box-shadow: 0 12px 32px -22px #243c6266, inset 0 1px 0 #fff; }
#mtd-spending-section > .section-head { background: linear-gradient(110deg,#ffffffcf,#f8faff80); border-bottom: 1px solid #d8e2ec; }
#mtd-spending-section > .section-head { flex-wrap: wrap; gap: 10px 20px; }
#mtd-spending-section > .section-head p { margin: 4px 0 0; }
#mtd-spending-section > .mtd-grid > p { grid-column: 1 / -1; margin: 0; }
#mtd-spending-section > .mtd-grid { margin: 0; padding: 24px; }
body .mtd-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(230px,1fr)); gap: 18px; }
body .mtd-category-card { position: relative; display: flex; flex-direction: column; gap: 0; min-width: 0; padding: 0; overflow: hidden; background: #fff; color: var(--text-primary); border: 1px solid #dce4e8; border-radius: 14px; box-shadow: 0 2px 4px #0f172a06; font: inherit; text-align: left; transition: border-color .15s, box-shadow .15s; }
body .mtd-category-card:hover { border-color: #94aaa4; box-shadow: 0 4px 14px #0f172a12; }
body .mtd-category-card:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
body .mtd-grid .mtd-category-card { padding: 0; }
.mtd-card-head { display: flex; align-items: center; padding: 20px 20px 0; }
.mtd-card-icon { display: grid; place-items: center; flex-shrink: 0; width: 40px; height: 40px; font-size: 21px; background: color-mix(in srgb, var(--mtd-accent) 18%, #fff); border-radius: 10px; }
.mtd-card-head strong { flex: 1; min-width: 0; font-size: 14px; line-height: 1.4; font-weight: 600; color: #475569; overflow-wrap: anywhere; }
.mtd-card-arrow { display: grid; place-items: center; flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; background: #f1f5f9; color: #334155; font-size: 14px; }
.mtd-card-body { display: grid; gap: 4px; padding: 10px 20px 20px; }
.mtd-card-total { font-size: clamp(24px,2.4vw,30px); line-height: 1.2; font-weight: 720; letter-spacing: -.7px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.mtd-card-body small { color: var(--text-secondary); font-size: 12px; }
.mtd-category-card:has(.mtd-budget-meter) :is(.mtd-card-head, .mtd-card-body) { padding-right: 48px; }
.mtd-budget-remainder { margin-top: 10px; color: #047857; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.mtd-budget-remainder.is-risk { color: #92400e; }
.mtd-budget-remainder.is-over { color: #b91c1c; }
.mtd-budget-meter { position: absolute; top: 20px; bottom: 20px; right: 20px; width: 10px; min-height: 60px; overflow: hidden; border: 1px solid #cbd5e1; border-radius: 999px; background: #edf2f4; }
.mtd-budget-meter i { position: absolute; inset: auto 0 0; background: #047857; border-radius: inherit; }
.mtd-budget-meter.is-risk i { background: #b45309; }
.mtd-budget-meter.is-over { border-color: #b91c1c; background: #fee2e2; }
.mtd-budget-meter.is-over i { background: repeating-linear-gradient(135deg,#b91c1c 0 5px,#ef4444 5px 8px); }
.mtd-category-card:has(.mtd-budget-meter.is-over) { border-color: #e6a5a5; }
body .transaction-panel { padding: 0; }
.transactions-table { width: 100%; border-collapse: collapse; }
.transactions-table th { background: #f1f5f9; }
.transactions-table th:first-child, .transactions-table td:first-child { padding-left: 24px !important; }
.transactions-table th:last-child, .transactions-table td:last-child { padding-right: 24px !important; text-align: right; }
.transactions-table td { border-bottom-color: var(--divider); }
.transactions-table tbody tr:nth-child(even) { background: #f9fbfd; }
.transactions-table tbody tr:hover { background: #f1f6fb; }
body .filter-panel { background: #fff; }
.category-overview-summary > div { background: #fff; box-shadow: 0 1px 2px #0f172a0d; }
.category-card { display: flex; flex-direction: column; min-height: 0; padding: 0; border-top: 4px solid var(--card-strong); }
.category-card-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--divider); }
.category-card-head .category-card-art { position: relative; inset: auto; flex-shrink: 0; width: 40px; height: 40px; border-radius: 10px; }
.category-card-head .category-card-art > span { font-size: 21px; }
.category-card-head strong { flex: 1; min-width: 0; font-size: 15px; font-weight: 650; overflow-wrap: anywhere; }
.category-card-head .category-card-arrow { width: 28px; height: 28px; flex-shrink: 0; }
.category-card-copy { padding: 16px 18px 18px; gap: 4px; align-self: stretch; }
.category-card-copy small { font-size: 12px; }
body .sidebar { overflow-x: hidden; scrollbar-width: thin; scrollbar-color: #33476280 transparent; }
/* Transaction search and flexible period filters */
body .filter-panel .search-filter { flex: 1 1 300px; }
.search-filter input { padding-left: 38px !important; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 12px center / 16px; }
#full-txn-table mark { padding: 0 2px; background: #fde68a; color: inherit; border-radius: 3px; }
.month-picker { display: grid; flex-basis: 100%; gap: 12px; padding: 16px; background: #f8fafc; border: 1px solid var(--border); border-radius: 12px; }
.month-picker[hidden] { display: none; }
.month-picker-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.month-picker-head strong { font-size: 13px; color: var(--text-primary); }
.month-picker-head span { margin-right: auto; color: var(--text-secondary); font-size: 12px; }
body .month-picker-head .btn-compact { margin-top: 0; }
.month-picker-year { display: grid; grid-template-columns: 64px minmax(0,1fr); align-items: center; gap: 12px; }
.month-picker-year-label { padding: 6px 0; background: none; border: 0; color: var(--text-primary); font: inherit; font-size: 13px; font-weight: 700; text-align: left; cursor: pointer; }
.month-picker-year-label:hover { color: var(--primary); text-decoration: underline; }
.month-picker-grid { display: grid; grid-template-columns: repeat(12,minmax(0,1fr)); gap: 6px; }
body .filter-panel .month-chip { position: relative; display: block; gap: 0; cursor: pointer; }
body .filter-panel .month-chip input { position: absolute; inset: 0; width: 100%; min-width: 0; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.month-chip span { display: grid; place-items: center; height: 34px; background: #fff; color: var(--text-primary); border: 1px solid var(--border); border-radius: 8px; font-size: 12.5px; font-weight: 600; transition: background .15s, border-color .15s, color .15s; }
.month-chip:hover span { border-color: var(--primary); }
.month-chip input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 4px 10px -4px #0f766e99; }
.month-chip input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.month-chip.is-empty span { background: #f1f5f9; color: #94a3b8; border-style: dashed; }
body .filter-panel .month-chip.is-empty, body .filter-panel .month-chip.is-empty input { cursor: not-allowed; }
/* Upcoming payments: a month calendar of compact bill cards (agenda list on small screens). */
.pay-cal-empty { margin: 0; color: var(--text-secondary); }
.pay-cal-summary { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-bottom: 12px; }
.pay-cal-summary > :is(div, button) { --tone: #64748b; display: grid; gap: 2px; min-width: 0; padding: 9px 14px; background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--tone); border-radius: 10px; }
.pay-cal-summary > button { font: inherit; text-align: left; color: inherit; cursor: pointer; }
.pay-cal-summary > button:hover { border-color: var(--tone); }
.pay-cal-summary span { color: var(--text-secondary); font-size: 10.5px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase; }
.pay-cal-summary strong { font-size: 18px; font-weight: 720; font-variant-numeric: tabular-nums; }
.pay-cal-summary small { color: var(--text-secondary); font-size: 12px; }
.pay-cal-summary .is-deficit strong { color: var(--danger); }
.pay-cal-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 12px; color: var(--text-secondary); font-size: 12px; }
.pay-cal-legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: -1px; background: var(--tone); border-radius: 3px; }
.pay-cal-summary .is-paid, .pay-cal-legend .is-paid, .pay-card.is-paid { --tone: #10b981; }
.pay-cal-summary .is-upcoming, .pay-cal-legend .is-upcoming, .pay-card.is-upcoming { --tone: #2563eb; }
.pay-cal-legend .is-overdue, .pay-card.is-overdue { --tone: #d97706; }
/* Bills matched to a pending bank debit: unpaid but already in the bank balance. */
.pay-cal-legend .is-pending, .pay-card.is-pending, .pay-row.is-pending { --tone: #64748b; }
.pay-card.is-pending { background: #f8fafc; border-style: dashed; border-left-style: solid; }
.pay-row.is-pending { background: #f8fafc; }
.pay-pending-note { display: block; min-width: 0; margin-top: 2px; color: #475569; font-size: 11px; font-weight: 650; line-height: 1.4; white-space: nowrap; }
.pay-card .pay-pending-note { order: 4; flex: 1 0 100%; overflow: hidden; text-overflow: ellipsis; font-size: 9.5px; }
.pay-duplicate-note { margin: 5px 0 0; padding: 7px 9px; color: #854d0e; background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; }
.pay-duplicate-note a { color: #713f12; font-weight: 700; }
.pay-cal-summary .is-deficit, .pay-cal-legend .is-deficit, .pay-card.is-deficit { --tone: #e11d48; }
.pay-cal-summary .is-balance { --tone: #0f766e; }
/* Month calendar sized to fit one screen: a single weekday header, compact day cells and dense bill cards. */
.pay-cal { overflow: hidden; background: #fff; border: 1px solid var(--border); border-radius: 14px; }
.pay-weekdays, .pay-week { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); }
.pay-weekdays { background: #f8fafc; border-bottom: 1px solid var(--border); }
.pay-weekdays span { padding: 7px 8px; color: var(--text-secondary); font-size: 10.5px; font-weight: 700; letter-spacing: .7px; text-align: center; text-transform: uppercase; }
.pay-week + .pay-week { border-top: 1px solid var(--divider); }
.pay-week.is-current { position: relative; background: color-mix(in srgb, var(--primary) 3%, #fff); }
.pay-week.is-current::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--primary); }
.pay-day { display: flex; flex-direction: column; gap: 4px; min-width: 0; min-height: 76px; padding: 6px 6px 7px; border-left: 1px solid var(--divider); }
.pay-day:first-child { border-left: 0; }
.pay-day.is-blank { background: repeating-linear-gradient(135deg,#f8fafc 0 8px,#f3f6f9 8px 16px); }
.pay-day-num { display: flex; align-items: center; gap: 6px; color: var(--text-primary); font-size: 13px; font-weight: 650; line-height: 20px; font-variant-numeric: tabular-nums; }
.pay-day.is-past .pay-day-num { color: #94a3b8; font-weight: 500; }
.pay-day.is-today { background: #fff5f6; }
.pay-day.is-today .pay-day-num { color: #e11d48; font-weight: 750; }
.pay-day-today { padding: 0 6px; background: #e11d48; color: #fff; border-radius: 999px; font-size: 9px; font-weight: 750; letter-spacing: .5px; line-height: 16px; text-transform: uppercase; }
.pay-day-items { display: grid; grid-template-columns: minmax(0,1fr); gap: 5px; width: 100%; }
.pay-day-items:empty { display: none; }
.pay-card { --tone: #2563eb; position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 1px 6px; min-width: 0; padding: 5px 7px 6px 8px; background: #fff; border: 1px solid color-mix(in srgb, var(--tone) 30%, var(--border)); border-left: 3px solid var(--tone); border-radius: 7px; box-shadow: 0 1px 2px #0f172a0d, 0 4px 10px -8px #0f172a40; font-size: 11px; line-height: 1.25; text-align: left; transition: transform .15s, box-shadow .15s; }
.pay-card:not(.is-paid):hover { transform: translateY(-1px); box-shadow: 0 8px 16px -10px #0f172a59; }
.pay-card.is-paid { --tone: #cbd5e1; background: #f4f6f9; border-color: #e2e8f0; border-left-color: #cbd5e1; box-shadow: none; filter: grayscale(1); }
.pay-card.is-paid > * { color: #94a3b8 !important; }
.pay-card.is-paid .pay-card-amount { text-decoration: line-through; text-decoration-thickness: 1px; }
.pay-card-cat { flex: 1 0 100%; min-width: 0; overflow: hidden; padding-right: 14px; color: color-mix(in srgb, var(--tone) 75%, #0f172a); font-size: 9px; font-weight: 750; letter-spacing: .5px; line-height: 1.3; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.pay-cal-legend .is-paid { --tone: #cbd5e1; }
.pay-card-amount { min-width: 0; overflow: hidden; color: var(--text-primary); font-size: 13px; font-weight: 750; letter-spacing: -.2px; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pay-amt-short { display: none; }
.pay-card.is-income .pay-card-amount { color: var(--success); }
.pay-card-bal { order: 3; flex: 1 0 100%; min-width: 0; overflow: hidden; color: var(--text-primary); font-size: 10.5px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pay-card-bal small { color: var(--text-secondary); font-size: 9px; font-weight: 650; letter-spacing: .3px; text-transform: uppercase; }
.pay-card-bal.is-negative { color: var(--danger); }
.pay-card-stop { position: absolute; top: 2px; right: 2px; display: grid; place-items: center; width: 18px; height: 18px; padding: 0; background: none; color: var(--text-secondary); border: 0; border-radius: 4px; font-size: 15px; line-height: 1; cursor: pointer; opacity: 0; transition: opacity .15s; }
.pay-card:hover .pay-card-stop, .pay-row:hover .pay-card-stop, .pay-card-stop:focus-visible { opacity: 1; }
.pay-card-stop:hover { background: #fee2e2; color: var(--danger); }
@media (hover: none) { .pay-card-stop { opacity: 1; } }
/* Auto-pay vs manual: teal pill = goes out on its own; violet pill = the user must act. */
.pay-card-mode { order: 2; display: inline-block; max-width: 100%; overflow: hidden; margin-top: 0; padding: 0 6px 0 5px; border: 1px solid; border-radius: 999px; font-size: 8.5px; font-weight: 750; letter-spacing: .3px; line-height: 15px; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.pay-cal .pay-card-mode { padding: 0 5px; letter-spacing: .2px; }
.pay-cal .pay-card-mode::before { display: none; }
.pay-card-mode::before { content: ""; display: inline-block; width: 5px; height: 5px; margin-right: 4px; vertical-align: 1px; background: currentColor; border-radius: 50%; }

/* List layout */
.pay-list { margin: 0; padding: 0; overflow: hidden; list-style: none; background: #fff; border: 1px solid var(--border); border-radius: 14px; }
.pay-row { --tone: #2563eb; display: grid; grid-template-columns: 46px minmax(0,1fr) auto 112px 124px 56px; align-items: center; gap: 14px; padding: 10px 14px 10px 13px; border-left: 3px solid var(--tone); transition: background .15s; }
.pay-row + .pay-row, .pay-list-today + .pay-row { border-top: 1px solid var(--divider); }
.pay-row:hover { background: #f8fafc; }
.pay-row.is-paid { --tone: #cbd5e1; background: #fafbfc; }
.pay-row.is-paid > * { color: #94a3b8 !important; }
.pay-row.is-paid .pay-row-amount { text-decoration: line-through; text-decoration-thickness: 1px; }
.pay-row.is-upcoming { --tone: #2563eb; }
.pay-row.is-overdue { --tone: #d97706; }
.pay-row.is-deficit { --tone: #e11d48; }
.pay-row-date { display: grid; justify-items: center; line-height: 1.1; }
.pay-row-date small { color: var(--text-secondary); font-size: 10px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; }
.pay-row-date strong { color: var(--text-primary); font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pay-row-main { display: grid; min-width: 0; gap: 1px; }
.pay-row-main .pay-card-cat { padding: 0; }
.pay-row-name { overflow: hidden; color: var(--text-primary); font-size: 13.5px; font-weight: 550; text-overflow: ellipsis; white-space: nowrap; }
.pay-row-tags { display: flex; align-items: center; gap: 6px; }
.pay-row-tags .pay-card-mode { margin: 0; font-size: 9.5px; line-height: 18px; }
.pay-row-status { padding: 0 8px; background: color-mix(in srgb, var(--tone) 13%, #fff); color: color-mix(in srgb, var(--tone) 80%, #000); border-radius: 999px; font-size: 9.5px; font-weight: 750; letter-spacing: .4px; line-height: 18px; text-transform: uppercase; white-space: nowrap; }
.pay-row-amount { color: var(--text-primary); font-size: 14.5px; font-weight: 750; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pay-row.is-income .pay-row-amount { color: var(--success); }
.pay-row-bal { display: grid; justify-items: end; color: var(--text-primary); font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pay-row-bal small { color: var(--text-secondary); font-size: 9px; font-weight: 650; letter-spacing: .3px; text-transform: uppercase; }
.pay-row-bal.is-negative { color: var(--danger); }
.pay-row-action { display: flex; align-items: center; justify-content: flex-end; gap: 4px; min-width: 0; }
.pay-row-action .pay-row-stop { position: static; width: 24px; height: 24px; }
.pay-list-today { display: flex; align-items: center; gap: 10px; padding: 6px 16px; background: #fff1f2; color: #e11d48; font-size: 10.5px; font-weight: 750; letter-spacing: .6px; text-transform: uppercase; border-top: 1px solid #fecdd3; border-bottom: 1px solid #fecdd3; }
.pay-list-today:first-child { border-top: 0; }
.pay-list-today::after { content: ""; flex: 1; height: 1px; background: #fda4af; }
.pay-list-heading, .pay-window-note { padding: 12px 16px; font-size: 12px; line-height: 1.6; color: var(--text-secondary); }
.pay-list-heading { background: #fff8e8; color: #854d0e; font-weight: 650; }
.pay-history { margin: 20px 0 24px; border: 1px solid var(--border); border-radius: 14px; background: #f8fafc; }
.pay-history > summary { padding: 16px; cursor: pointer; font-size: 13px; font-weight: 650; }
.pay-history > summary:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; border-radius: 14px; }
.category-multiselect { position: relative; min-width: 210px; align-self: end; }
.category-multiselect summary { cursor: pointer; padding: 12px; border: 1px solid var(--border); border-radius: 10px; }
.category-multiselect[open] { padding-bottom: 12px; }
#category-filter-options { max-height: 240px; overflow-y: auto; padding: 8px 0; }
#category-filter-options label { display: flex; align-items: center; gap: 8px; padding: 8px; cursor: pointer; }
#category-filter-options input { width: auto; }
.category-selection-chips { display: flex; flex-wrap: wrap; gap: 8px; flex-basis: 100%; }
.category-selection-chips button { padding: 6px 10px; border: 1px solid var(--border); border-radius: 20px; background: var(--surface, #fff); color: var(--text-primary); cursor: pointer; }
#upcoming-section .pay-history > ol.pay-list { display: block; margin: 0 12px 12px; }
.pay-actions { position: relative; color: var(--text-primary); font-size: 12px; }
.pay-actions summary { display: grid; place-items: center; width: 26px; height: 26px; border: 1px solid transparent; border-radius: 7px; color: #58758a; cursor: pointer; list-style: none; transition: background .15s, border-color .15s, color .15s; }
.pay-actions summary::-webkit-details-marker { display: none; }
.pay-actions summary span { font-size: 18px; font-weight: 800; line-height: 1; }
.pay-actions summary:hover, .pay-actions[open] summary { border-color: #cfe3da; background: #eef8f3; color: #08684d; }
.pay-actions-options { position: absolute; top: calc(100% + 4px); right: 0; z-index: 30; display: grid; gap: 1px; width: max-content; min-width: 150px; padding: 4px; border: 1px solid #dce5eb; border-radius: 10px; background: #fff; box-shadow: 0 12px 28px -10px #0f172a40, 0 2px 6px #0f172a14; animation: pay-pop .12s ease-out; }
.pay-row:nth-last-child(-n+2):not(:nth-child(-n+3)) .pay-actions-options { top: auto; bottom: calc(100% + 4px); }
.pay-actions-options button { min-height: 32px; padding: 6px 10px; border: 0; border-radius: 6px; background: transparent; color: #263d4e; font: inherit; font-size: 12.5px; font-weight: 600; text-align: left; white-space: nowrap; cursor: pointer; }
.pay-actions-options button:hover, .pay-actions-options button:focus-visible { background: #edf7f3; color: #08684d; }
.pay-actions-options button[data-payment-status="ignored"] { color: #8a3b46; }
.pay-actions-options button[data-payment-status="ignored"]:hover { background: #fff1f2; color: #be123c; }
.pay-actions summary:focus-visible, .pay-actions-options button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
@keyframes pay-pop { from { opacity: 0; transform: translateY(-3px) scale(.98); } }
:is(.pay-list, .pay-cal, .section-panel):has(.pay-actions[open]) { overflow: visible; }
.pay-row:has(.pay-actions[open]), .pay-card:has(.pay-actions[open]) { position: relative; z-index: 20; }
.pay-card-tools { position: absolute; top: 1px; right: 1px; display: flex; align-items: center; gap: 1px; }
.pay-card-tools .pay-card-stop { position: static; }
.pay-card-tools .pay-actions summary { width: 20px; height: 18px; border-radius: 5px; }
.pay-card-tools .pay-actions summary span { font-size: 14px; }
.pay-card:has(.pay-actions) .pay-card-cat { padding-right: 40px; }
@media (hover: none) { .pay-actions-options button { min-height: 44px; } }
/* Estimate progress: paid vs the user's monthly estimate */
.pay-progress { --fill: #2f8f6b; display: grid; gap: 3px; width: min(100%, 230px); margin-top: 4px; }
.pay-progress-track { height: 6px; overflow: hidden; border-radius: 99px; background: #e6edf1; }
.pay-progress-fill { display: block; height: 100%; min-width: 0; border-radius: inherit; background: linear-gradient(90deg, color-mix(in srgb, var(--fill) 70%, #fff), var(--fill)); transition: width .4s ease; }
.pay-progress.is-approx { --fill: #c08a12; }
.pay-progress.is-done { --fill: #15803d; }
.pay-progress-text { display: flex; align-items: baseline; gap: 6px; color: var(--text-secondary); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pay-progress-text b { color: var(--text-primary); font-weight: 750; }
.pay-progress-text em { margin-left: auto; padding: 0 6px; border-radius: 99px; background: color-mix(in srgb, var(--fill) 12%, #fff); color: color-mix(in srgb, var(--fill) 80%, #000); font-size: 10px; font-style: normal; font-weight: 750; line-height: 16px; }
.pay-progress.is-empty .pay-progress-text em { background: #f1f5f9; color: #475569; }
.pay-card .pay-progress { order: 4; flex-basis: 100%; width: 100%; margin-top: 2px; }
.pay-card .pay-progress-track { height: 4px; }
.pay-card .pay-progress-text { font-size: 9.5px; }
.pay-card .pay-progress-text em { display: none; }
.pay-carried { margin: 20px 0; padding: 16px; border: 1px solid #d97706; border-radius: 14px; }
.pay-carried h3 { margin: 0 0 8px; }
.pay-carried p { color: var(--text-secondary); font-size: 13px; }
#upcoming-section .pay-carried ol.pay-list { display: block; }

/* Layout toggle and which layout is visible */
#upcoming-section .section-head > div:first-child { flex: 1 1 320px; min-width: 0; }
.section-head-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px 12px; }
.view-toggle { display: inline-flex; padding: 3px; background: #e9eef3; border-radius: 10px; }
.view-toggle button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; background: transparent; color: var(--text-secondary); border: 0; border-radius: 8px; font: inherit; font-size: 12.5px; font-weight: 650; cursor: pointer; transition: background .15s, color .15s, box-shadow .15s; }
.view-toggle button:hover { color: var(--text-primary); }
.view-toggle button[aria-pressed="true"] { background: #fff; color: var(--text-primary); box-shadow: 0 1px 2px #0f172a1a, 0 2px 6px -2px #0f172a26; }
.view-toggle button:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.view-toggle svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.view-toggle svg circle { fill: currentColor; stroke: none; }
#upcoming-section[data-pay-view="list"] .pay-cal, #upcoming-section:not([data-pay-view="list"]) .pay-list { display: none; }

/* Medium widths: tighter cells so the full week still fits without sideways scrolling. */
@media (max-width: 1000px) {
  .pay-day { padding: 5px 4px 6px; }
  .pay-card { padding: 4px 5px 5px 6px; }
  .pay-card-amount { font-size: 12px; }
  .pay-card-mode { padding: 0 4px; }
  .pay-row { grid-template-columns: 42px minmax(0,1fr) 104px 112px 56px; }
  .pay-row-tags { grid-column: 2; grid-row: 2; margin-top: -4px; }
  .pay-row-date { grid-row: 1 / span 2; }
  .pay-row-amount, .pay-row-bal, .pay-row-action { grid-row: 1 / span 2; }
}
/* Short screens (laptops): denser month so the whole calendar fits without vertical scrolling. */
@media (max-height: 860px) and (min-width: 641px) {
  .pay-cal-summary { gap: 8px; margin-bottom: 10px; }
  .pay-cal-summary > :is(div, button) { gap: 0; padding: 6px 12px; }
  .pay-cal-summary span { font-size: 10px; }
  .pay-cal-summary strong { font-size: 15px; line-height: 1.3; }
  .pay-cal-summary small { display: none; }
  .pay-cal-legend { margin-bottom: 8px; }
  .pay-weekdays span { padding: 5px 6px; }
  .pay-day { min-height: 58px; gap: 3px; padding: 3px 5px 5px; }
  .pay-day-num { font-size: 12px; line-height: 17px; }
  .pay-day-items { gap: 3px; }
  .pay-card { padding: 3px 6px 4px 7px; }
  .pay-card-amount { font-size: 12px; }
  .pay-cal .pay-card-mode { display: none; }
  .pay-card.mode-auto .pay-card-cat::before, .pay-card.mode-manual .pay-card-cat::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 4px; vertical-align: 1px; border-radius: 50%; background: #14b8a6; }
  .pay-card.mode-manual .pay-card-cat::before { background: #6d28d9; }
}
/* Phones: each bill becomes a compact amount chip so the whole month fits; the list shows full detail. */
@media (max-width: 640px) {
  .pay-weekdays span { padding: 6px 0; font-size: 9.5px; letter-spacing: .3px; }
  .pay-day { min-height: 52px; gap: 3px; padding: 4px 2px 5px; align-items: center; }
  .pay-day-num { font-size: 12px; line-height: 16px; }
  .pay-day-today { display: none; }
  .pay-day.is-today .pay-day-num { padding: 0 5px; background: #e11d48; color: #fff; border-radius: 999px; }
  .pay-day-items { gap: 3px; }
  .pay-card { padding: 2px 2px; border-width: 0; border-radius: 5px; background: color-mix(in srgb, var(--tone) 14%, #fff); box-shadow: none; text-align: center; }
  .pay-card.is-paid { background: #eef1f4; }
  .pay-card.mode-manual:not(.is-paid) { box-shadow: inset 0 0 0 1.5px #6d28d9; }
  .pay-cal :is(.pay-card-cat, .pay-card-bal, .pay-card-mode, .pay-card-stop, .pay-amt-full) { display: none; }
  .pay-amt-short { display: inline; }
  .pay-card-amount { color: color-mix(in srgb, var(--tone) 80%, #0f172a); font-size: 10px; letter-spacing: -.3px; }
  .pay-row { grid-template-columns: 38px minmax(0,1fr) auto; gap: 4px 10px; padding: 10px 10px 10px 9px; }
  .pay-row-date { grid-row: 1 / span 3; }
  .pay-row-main { grid-column: 2; grid-row: 1; }
  .pay-row-tags { grid-column: 2; grid-row: 2; margin: 0; flex-wrap: wrap; }
  .pay-row-amount { grid-column: 3; grid-row: 1; font-size: 14px; }
  .pay-row-bal { grid-column: 3; grid-row: 2; font-size: 12px; }
  .pay-row-action { grid-column: 3; grid-row: 3; justify-self: end; }
  .pay-row-action .pay-actions summary { width: 32px; height: 28px; }
  .pay-cal .pay-card-tools, .pay-cal .pay-progress-text { display: none; }
  .pay-cal .pay-progress { margin-top: 1px; }
  .pay-cal .pay-progress-track { height: 3px; }
  .pay-row-name { font-size: 13px; }
  .pay-row.is-paid .pay-row-bal { display: none; }
  .section-head-actions { width: 100%; justify-content: space-between; }
}
.pay-card-mode.is-auto { background: #f0fdfa; color: #0f766e; border-color: #99f6e4; }
.pay-card-mode.is-review { background: #fff8e8; color: #854d0e; border-color: #e6c887; }
.pay-row-tags .pay-card-mode.is-review { font-size: 11px; line-height: 20px; letter-spacing: 0; text-transform: none; }
.pay-card-mode.is-manual { background: #f5f3ff; color: #6d28d9; border-color: #ddd6fe; }
.pay-card:not(.is-paid) .pay-card-mode.is-manual { background: #6d28d9; color: #fff; border-color: #6d28d9; box-shadow: 0 2px 6px -2px #6d28d980; }
.pay-card.is-paid .pay-card-mode { background: transparent; border-color: #e2e8f0; }
.pay-cal-legend .is-mode-auto { --tone: #14b8a6; }
.pay-cal-legend .is-mode-manual { --tone: #6d28d9; }
.pay-cal-legend .is-mode-auto::before, .pay-cal-legend .is-mode-manual::before { border-radius: 50%; }
/* Goal and debt-payoff plan entries are never automatic; they use the Plan page colors (goals violet, debt green) on top of the status tone. */
.pay-card.pay-plan-goal, .pay-row.pay-plan-goal, .pay-cal-legend .is-plan-goal { --plan: #6d4bd8; }
.pay-card.pay-plan-debt, .pay-row.pay-plan-debt, .pay-cal-legend .is-plan-debt { --plan: #0f9f6e; }
.pay-card:is(.pay-plan-goal, .pay-plan-debt):not(.is-paid) { border-color: color-mix(in srgb, var(--plan) 45%, var(--border)); background-color: color-mix(in srgb, var(--plan) 9%, #fff); background-image: linear-gradient(135deg, transparent calc(100% - 11px), var(--plan) 0); }
.pay-card:is(.pay-plan-goal, .pay-plan-debt):not(.is-paid) .pay-card-cat { color: color-mix(in srgb, var(--plan) 85%, #0f172a); }
.pay-row:is(.pay-plan-goal, .pay-plan-debt):not(.is-paid) { background: linear-gradient(90deg, color-mix(in srgb, var(--plan) 10%, #fff), #fff 65%); box-shadow: inset -3px 0 0 var(--plan); }
:is(.pay-card, .pay-row):is(.pay-plan-goal, .pay-plan-debt):not(.is-paid) .pay-card-mode { background: color-mix(in srgb, var(--plan) 12%, #fff); color: color-mix(in srgb, var(--plan) 85%, #0f172a); border-color: color-mix(in srgb, var(--plan) 35%, #fff); }
.pay-cal-legend :is(.is-plan-goal, .is-plan-debt)::before { background: var(--plan); }
.paymode-select { min-width: 104px; font-weight: 600; }
.paymode-select.is-auto { color: #0f766e; background-color: #f0fdfa; border-color: #99f6e4; }
.paymode-select.is-manual { color: #6d28d9; background-color: #f5f3ff; border-color: #ddd6fe; }
.paymode-select.is-unset { color: var(--text-secondary); }
.paymode-na { color: var(--text-secondary); }
/* Similar-transactions confirmation dialog */
.editor.similar-dialog { width: min(720px,94vw); display: none; }
.editor.similar-dialog[open] { display: flex; flex-direction: column; overflow: hidden; }
.similar-dialog form { display: flex; flex-direction: column; gap: 12px; min-height: 0; flex: 0 1 auto; }
.similar-dialog form > * { flex-shrink: 0; }
.similar-dialog h2 { margin: 0; }
.similar-dialog #similar-copy { margin: 0; line-height: 1.55; }
.similar-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 2px; font-size: 13px; color: #64748b; }
.similar-dialog label.similar-all, .rename-dialog label.similar-all { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: #0f172a; cursor: pointer; }
.similar-all input { width: 18px; height: 18px; margin: 0; accent-color: #059669; flex-shrink: 0; }
.similar-dialog .similar-list { display: grid; align-content: start; gap: 8px; flex: 0 1 auto; min-height: 96px; max-height: 420px; overflow-y: auto; padding: 2px; }
.similar-dialog label.similar-row, .rename-dialog label.similar-row { display: grid; grid-template-columns: auto 92px minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; }
.similar-row:hover { border-color: #94a3b8; }
.similar-row:has(input:checked) { border-color: #059669; background: #ecfdf5; box-shadow: inset 3px 0 0 #059669; }
.similar-row input { width: 18px; height: 18px; accent-color: #059669; margin: 0; }
.similar-date { font-size: 13px; color: #475569; white-space: nowrap; }
.similar-desc { min-width: 0; font-size: 14px; color: #0f172a; overflow-wrap: anywhere; }
.similar-desc small { display: block; margin-top: 3px; font-size: 12px; color: #64748b; }
.similar-amt { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
#similar-error:empty { display: none; }
#similar-error { margin: 0; color: #b91c1c; font-size: 13px; }
/* Renamed payees */
.tx-desc-cell { display: flex; align-items: center; gap: 8px; }
.tx-desc-text { min-width: 0; flex: 1; }
.tx-name { display: block; color: var(--text-primary, #0f172a); font-weight: 650; }
.tx-original { margin-top: 2px; font-size: 11px; color: var(--text-secondary, #64748b); overflow-wrap: anywhere; }
.tx-rename { flex-shrink: 0; padding: 2px 8px; border: 1px solid var(--border-color, #e2e8f0); border-radius: 999px; background: transparent; color: var(--text-secondary, #64748b); font: inherit; font-size: 11px; font-weight: 600; cursor: pointer; opacity: .55; transition: opacity .15s, color .15s, border-color .15s; }
tr:hover .tx-rename, .tx-rename:focus-visible { opacity: 1; }
.tx-rename:hover { color: #047857; border-color: #6ee7b7; }
.editor.rename-dialog { width: min(600px,94vw); }
.rename-dialog form, .rename-dialog > div { display: flex; flex-direction: column; gap: 12px; }
.rename-dialog h2 { margin: 0; }
.rename-dialog label { display: grid; gap: 6px; font-weight: 600; font-size: 13px; }
.rename-dialog label small { font-weight: 400; line-height: 1.45; }
.rename-original { display: grid; gap: 4px; margin: 0; font-size: 12px; }
.rename-original code, .rename-preview code, .name-rule-row code { padding: 2px 6px; border-radius: 6px; background: var(--bg-tertiary, #f1f5f9); font-size: 12px; overflow-wrap: anywhere; }
.rename-preview { padding: 10px 12px; border-radius: 10px; background: #f0fdf4; border: 1px solid #bbf7d0; font-size: 13px; }
.rename-preview p { margin: 0; }
.rename-preview .similar-list { display: grid; gap: 8px; max-height: 280px; overflow-y: auto; padding: 3px; margin-top: 8px; }
.rename-preview ul { margin: 6px 0 0; padding-left: 18px; color: #475569; font-size: 12px; }
.rename-preview .rename-none { color: #b45309; }
.rename-dialog .toolbar { display: flex; gap: 8px; align-items: center; }
.rename-dialog .toolbar-spacer { flex: 1; }
.rename-remove { color: #b91c1c !important; }
#rename-error:empty, #name-rules-error:empty { display: none; }
#rename-error, #name-rules-error { margin: 0; color: #b91c1c; font-size: 13px; }
.name-rules-list { display: grid; gap: 8px; max-height: 420px; overflow-y: auto; }
.name-rule-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid #e2e8f0; border-radius: 12px; }
.name-rule-row small { display: block; margin-top: 3px; color: #64748b; font-size: 12px; }
@media (max-width: 560px) {
  .similar-dialog label.similar-row, .rename-dialog label.similar-row { grid-template-columns: auto minmax(0,1fr) auto; row-gap: 4px; }
  .similar-date { grid-column: 2; grid-row: 1; }
  .similar-desc { grid-column: 2 / -1; grid-row: 2; }
  .similar-amt { grid-column: 3; grid-row: 1; }
  .similar-row input { grid-row: 1 / span 2; }
}
@media (max-width: 900px) { .pay-cal-summary { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 768px) {
  #dashboard-payments { padding: 16px; }
  body .filter-panel .search-filter, .month-picker { grid-column: 1 / -1; }
  .month-picker { padding: 12px; }
  .month-picker-year { grid-template-columns: 1fr; gap: 6px; }
  .month-picker-grid { grid-template-columns: repeat(6,minmax(0,1fr)); }
}
@media (max-width: 420px) { .pay-cal-summary { grid-template-columns: 1fr 1fr; gap: 8px; } .pay-cal-summary strong { font-size: 15px; } .pay-day-items { grid-template-columns: 1fr; } }
@media (max-width: 1100px) {
  body .app-container { grid-template-columns: 220px minmax(0,1fr); }
  body .main-content { padding: 24px; }
  .filter-status { flex-basis: 100%; margin: 0; }
}
@media (max-width: 768px) {
  body { overflow: auto; }
  body .app-container { display: block; height: auto; min-height: 100dvh; }
  body .main-content { overflow: visible; padding: 20px 16px 32px; gap: 24px; }
  body .view.active { overflow: visible; flex: none; }
  body .sidebar { width: min(280px,calc(100vw - 68px)); height: 100dvh; }
  .workspace-bar { min-height: 45px; padding: 0 0 16px 54px; }
  .workspace-badge { display: none; }
  body .hamburger { top: 16px; left: 16px; background: #fff; border-color: var(--border); }
  body .hamburger.open { left: min(292px,calc(100vw - 56px)); background: var(--primary); color: #fff; }
  body .header h1, .category-overview-header h1 { font-size: 28px !important; }
  body .header .btn { width: auto; }
  body .category-overview-header { display: flex; padding: 0; }
  body .filter-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 16px !important; }
  .filter-panel label input, .filter-panel label select { min-width: 0; }
  .filter-status { grid-column: 1/-1; margin: 0; }
  body .metrics-grid { grid-template-columns: repeat(auto-fit,minmax(150px,1fr)); gap: 12px; }
  body .metric-card { padding: 18px; }
  .category-overview-summary > div { min-width: 0; padding: 12px; }
  .category-cards { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
  .category-card { padding: 0; min-height: 0; }
  .category-card-head { padding: 12px 14px; gap: 10px; }
  .category-card-head .category-card-art { width: 34px; height: 34px; }
  .category-card-copy { padding: 12px 14px 14px; }
  .section-head { padding: 16px; }
  .section-panel > :not(.section-head) { margin: 16px; }
  .section-panel > #dashboard-payments { margin: 0; }
  .data-table th, .data-table td { padding: 10px 12px !important; }
  body .mtd-grid { grid-template-columns: repeat(auto-fill,minmax(min(100%,210px),1fr)); gap: 12px; }
  #mtd-spending-section > .mtd-grid { padding: 16px; }
  .mtd-card-head { padding: 16px 16px 0; }
  .mtd-card-icon { width: 34px; height: 34px; font-size: 18px; }
  .mtd-card-arrow { display: none; }
  .mtd-card-body { padding: 8px 16px 16px; }
  .mtd-card-total { font-size: 26px; }
  .mtd-budget-meter { top: 16px; right: 16px; bottom: 16px; }
  .transactions-table th:first-child, .transactions-table td:first-child { padding-left: 12px !important; }
  .transactions-table th:last-child, .transactions-table td:last-child { padding-right: 12px !important; }
  .category-card-copy strong { max-width: none; font-size: 14px; }
  .category-card-total { font-size: 21px; overflow-wrap: anywhere; }
  .category-card-arrow { display: none; }
  body #transactions-view .transaction-panel { padding: 0 8px !important; overflow: auto; }
  body #full-txn-table td { font-size: 13px !important; padding: 14px 10px !important; white-space: normal; }
  body #full-txn-table td:nth-child(2) { max-width: 240px; white-space: normal; }
  body #full-txn-table td:nth-child(3) select { padding: 10px !important; font-size: 12px !important; }
  body #import-modal > div, body #add-goal-modal > div { width: 100% !important; max-width: 100% !important; height: auto; max-height: none !important; border-radius: 0 !important; }
  body dialog, body .floating-dialog, body .mtd-dialog, body #add-goal-modal { width: calc(100vw - 24px); max-width: calc(100vw - 24px); max-height: calc(100dvh - 32px); border-radius: 16px; }
  .mtd-dialog-shell { max-height: calc(100dvh - 34px); }
  .mtd-dialog-header { padding: 20px; }
  .dialog-filter { padding: 14px 20px; }
  .mtd-dialog-summary { padding: 0 20px 16px; }
  .mtd-dialog-content { padding-inline: 20px; }
  .mtd-dialog-footer { padding: 14px 20px; }
  body:has(dialog[open]) { overflow: hidden; }
  body:has(.sidebar.open) { overflow: hidden; }
  .admin-shell { padding: 20px 16px 40px; }
}
@media (max-width: 380px) {
  body .filter-panel { grid-template-columns: 1fr; }
  .category-cards { grid-template-columns: 1fr; }
  .category-overview-summary { grid-template-columns: 1fr; }
  .category-card { min-height: 0; }
}
@media (max-width: 480px) {
  #txn-summary .metric-card:last-child { grid-column: 1/-1; }
}

.how-calc { display: inline-grid; place-items: center; flex: none; width: 24px; height: 24px; padding: 3px; vertical-align: middle; margin-left: 4px; border: 0; border-radius: 50%; color: #52637a; background: transparent; cursor: pointer; }
.how-calc:hover { color: var(--primary); background: #edf4ef; }
.how-calc:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
body .calculation-dialog { width: min(480px,calc(100vw - 32px)); max-height: calc(100dvh - 48px); margin: auto; padding: 24px; overflow: auto; border: 1px solid var(--border); border-radius: 18px; background: #fff; color: var(--text-primary); box-shadow: var(--shadow); }
.calculation-dialog::backdrop { background: #12213866; }
.calculation-dialog form { display: grid; justify-items: start; gap: 18px; }
.calculation-dialog h2 { font-size: 20px; line-height: 1.35; }
.calculation-dialog p { font-size: 14px; line-height: 1.7; overflow-wrap: anywhere; }

/* Keep depth on outer surfaces, not nested spending-card buttons or table rows. */
body .view .panel,
body .view .metric-card:not(.mtd-category-card),
body .view .acct-card,
body .view .welcome-pulse-row,
body .view .pro-kpi,
body .view .pay-cal-summary > :is(div, button),
body .view .acct-review-intro,
body .view .pay-history,
body .view .pay-card,
body .view .plan-strategy:not(.is-active),
body .view .tut-card:not(.is-current),
body .view .plan-debt:not(.is-excluded):not(.is-target),
body .view .plan-goal:not(.is-excluded) {
  box-shadow: var(--card-depth);
}
body .view #welcome-hero,
body .view .mtd-card-wrap,
body .view .category-card:not(.is-inactive) { box-shadow: var(--card-depth); }
body .view .plan-debt.is-target,
body .view .plan-strategy.is-active,
body .view .tut-card.is-current { box-shadow: 0 0 0 3px #22645218, var(--card-depth); }
@media (hover: hover) {
  body .view .mtd-card-wrap:hover,
  body .view .category-card:not(.is-inactive):hover,
  body .view .plan-strategy:not(.is-active):hover,
  body .view .tut-card:not(.is-current):hover { box-shadow: var(--card-depth-raised); }
}
body .view .metric-card:not(.mtd-category-card),
body .view .acct-card,
body .view .plan-debt:not(.is-excluded),
body .view .plan-goal:not(.is-excluded) {
  background-image: radial-gradient(ellipse at 100% 0, #e4effb80, transparent 80%), linear-gradient(145deg, #fff, #f3f8f6);
}
body .view .metric-card:not(.mtd-category-card),
body .view .acct-card {
  transition: box-shadow .2s ease;
}
@media (hover: hover) {
  body .view .metric-card:not(.mtd-category-card):hover,
  body .view .acct-card:hover,
  body .view .plan-debt:not(.is-excluded):not(.is-target):hover,
  body .view .plan-goal:not(.is-excluded):hover { box-shadow: var(--card-depth-raised); }
}
.acct-freshness { margin: 14px 0; padding: 12px 14px; border: 1px solid #d3dce8; border-radius: 12px; background: #ffffffb3; font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.acct-freshness .muted { margin: 4px 0 0; font-size: 12px; }
.acct-freshness .acct-badge { display: inline-block; margin: 3px 0; }
.acct-freshness.is-stale { border-color: #d9b465; background: #fff8e8; color: #783f0c; }
body .view .acct-stale { border-color: #d9b465; }
.acct-completeness { gap: 14px; margin: 0 0 24px; padding: clamp(16px, 2.5vw, 26px); overflow: visible; }
.acct-completeness header { display: grid; gap: 8px; }
.acct-completeness header > * { margin: 0; }
.acct-completeness .eyebrow { line-height: 1.4; }
.acct-completeness h2 { font-size: 20px; line-height: 1.3; }
.acct-completeness header .muted { max-width: 90ch; font-size: 14px; line-height: 1.65; }
.acct-completeness header .acct-badge.warn { display: block; padding: 10px 14px; border: 1px solid #f0d49a; border-radius: 10px; background: #fff8e8; color: #783f0c; font-size: 13px; line-height: 1.5; }
.acct-completeness .table-container { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-secondary); }
.acct-completeness-table { table-layout: auto; width: 100%; border-collapse: separate; border-spacing: 0; }
.acct-completeness-table th, .acct-completeness-table td { padding: 10px 14px; vertical-align: middle; line-height: 1.4; }
.acct-completeness-table thead th { min-width: 112px; background: var(--bg-tertiary); font-size: 12px; font-weight: 700; overflow-wrap: normal; word-break: normal; }
.acct-completeness-table tbody th { white-space: nowrap; font-weight: 700; }
.acct-completeness-table td { white-space: nowrap; }
.acct-completeness-table tbody tr:last-child > * { border-bottom: 0; }
.acct-completeness-table :is(th, td):first-child { position: sticky; left: 0; z-index: 1; background: var(--bg-secondary); box-shadow: 1px 0 0 var(--border); }
.acct-completeness-table thead :is(th, td):first-child { z-index: 2; background: var(--bg-tertiary); }
.acct-completeness-table tbody th .acct-badge { display: block; width: fit-content; margin: 4px 0 0; white-space: nowrap; }
.acct-completeness-table small { margin-left: 4px; color: var(--text-secondary); }
.acct-completeness-status { display: inline-block; min-width: 2.6em; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; text-align: center; }
.acct-completeness-status.is-yes { background: #dcf3ea; color: #17614d; }
.acct-completeness-status.is-partial { background: #fff1d6; color: #8a4b0f; }
.acct-completeness-status.is-no { background: var(--bg-tertiary); color: var(--text-secondary); }
.financial-checkup { display: grid; gap: 20px; min-width: 0; line-height: 1.65; }
#insights-view > .header { padding: 10px 0 20px; }
#insights-view > .header h1 { letter-spacing: -1px; }
.checkup-findings { display: grid; gap: 22px; min-width: 0; color: #294638; overflow-wrap: anywhere; }
.findings-intro { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 12px 4px; }
.findings-intro h2 { margin: 10px 0; color: #203d30; font-size: clamp(28px, 3vw, 38px); line-height: 1.16; letter-spacing: -1px; font-weight: 720; }
.findings-intro h2 em { color: #538366; font-style: normal; }
.findings-intro p:not(.checkup-kicker) { margin: 0; max-width: 560px; color: #627268; font-size: 14px; }
.findings-period { flex-shrink: 0; padding: 12px 18px; border: 1px solid #d6dfcf; border-radius: 18px; background: #fafbf4; color: #365f49; font-size: 13px; font-weight: 750; transform: rotate(2deg); box-shadow: 0 4px 0 #d6dfcf4d; }
.findings-canonical { margin: 0 0 16px; padding: 16px 20px; border: 1px solid #d6dfcf; border-radius: 18px; background: #fafbf4; }
.findings-canonical dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 8px 0; }
.findings-canonical dt { color: #5b6b60; font-size: 12px; font-weight: 700; }
.findings-canonical dd { margin: 2px 0 0; color: #23402f; font-size: 22px; font-weight: 800; }
.findings-canonical small { color: #5b6b60; }
.findings-period small { display: block; color: #738174; font-size: 10px; font-weight: 500; margin-top: 4px; }
.findings-top-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 20px; }
.findings-income, .findings-balance, .findings-list-card, .findings-extras { min-width: 0; padding: clamp(20px, 2.6vw, 30px); border: 1px solid #d7e1d3; border-radius: 24px; box-shadow: 0 8px 24px -20px #294b3b66; }
.findings-income { position: relative; overflow: hidden; background: radial-gradient(ellipse at 100% 0, #e9edc4, transparent 45%), linear-gradient(125deg, #f0f7eb, #e4f0e5); }
.findings-income-heading { display: flex; align-items: flex-start; gap: 10px; }
.findings-income-heading > div { flex: 1; }
.checkup-findings h3 { margin: 8px 0 12px; color: #2b4936; font-size: 21px; font-weight: 720; line-height: 1.3; letter-spacing: -.4px; }
.findings-art { width: 132px; flex-shrink: 0; margin: -10px -10px -40px 0; }
.findings-income-label { margin: 18px 0 3px; color: #4e6d58; font-size: 12px; }
.findings-income-value { display: block; color: #21533c; font-size: clamp(27px, 3.7vw, 46px); letter-spacing: -1.5px; font-weight: 780; line-height: 1.25; font-variant-numeric: tabular-nums; }
.findings-income-equivalent { margin: 10px 0 18px; color: #476550; font-size: 13px; }
.findings-income-equivalent b { display: inline-block; padding: 3px 8px; background: #ffffffa8; border-radius: 9px; }
.findings-paychecks { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.findings-paychecks li { padding: 13px 15px; border: 1px solid #d0dfc9; border-radius: 14px; background: #ffffffa8; }
.findings-paychecks strong { font-size: 13px; }
.findings-paychecks div > span { display: block; color: #6b7e6e; font-size: 11px; }
.findings-paychecks p { margin: 6px 0 0; font-size: 12px; color: #48644e; }
.findings-paychecks p > span { display: block; font-weight: 750; color: #28593f; }
.checkup-findings .findings-fine-print { margin: 14px 0 0; color: #68786b; font-size: 11px; line-height: 1.65; }
.findings-review-income { margin-top: 16px; padding: 0; border: 0; background: transparent; font: inherit; font-size: 12px; font-weight: 750; color: #28664d; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.findings-balance { background: #fffaf1; border-color: #e9ddc6; }
.findings-balance.is-tight { background: #fff4ec; border-color: #ead2bf; }
.findings-sticker { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 18px; border-radius: 14px; background: #f7e3b1; color: #88642b; font-size: 25px; transform: rotate(-8deg); }
.findings-balance dl { margin: 20px 0; display: grid; gap: 13px; }
.findings-balance dl > div { padding-bottom: 12px; border-bottom: 1px dashed #ddcdb5; }
.findings-balance dt { font-size: 12px; color: #7b725d; }
.findings-balance dd { margin: 2px 0 0; font-size: 23px; font-weight: 750; color: #584f35; letter-spacing: -.5px; }
.findings-balance > p:not(.checkup-kicker):not(.findings-fine-print) { font-size: 13px; }
.checkup-findings-warning { padding: 13px 15px; border-radius: 14px; background: #f7e3d4; color: #80452a; }
.checkup-findings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.findings-list-card { background: #fff; }
.findings-list-card.is-peach { border-top: 5px solid #eac1a2; }
.findings-list-card.is-lavender { border-top: 5px solid #c9bfde; }
.findings-list-card > p:not(.checkup-kicker) { margin: -4px 0 20px; font-size: 12px; color: #788075; }
.findings-ranking { display: grid; gap: 17px; list-style: none; padding: 0; margin: 20px 0 0; }
.findings-ranking li { display: flex; gap: 10px; align-items: flex-start; }
.findings-rank { display: grid; place-items: center; width: 25px; height: 25px; flex-shrink: 0; border-radius: 9px; background: #f8e9dd; color: #a87852; font-size: 11px; font-weight: 800; }
.is-lavender .findings-rank { background: #eeebf6; color: #8577a2; }
.findings-rank-content { flex: 1; min-width: 0; }
.findings-rank-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; line-height: 1.4; }
.findings-rank-heading strong { font-size: 13px; font-weight: 650; }
.findings-rank-heading b { font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.findings-bar { height: 6px; margin: 9px 0 5px; border-radius: 99px; background: #f4f0eb; overflow: hidden; }
.findings-bar span { display: block; height: 100%; border-radius: inherit; background: #d7a582; }
.is-lavender .findings-bar span { background: #ae9dc8; }
.findings-rank-content small { color: #788376; font-size: 10px; }
.findings-extras { background: linear-gradient(120deg, #faf7ee, #f8f5e7); border-color: #e4dcc2; }
.findings-extras-heading { display: flex; gap: 25px; align-items: center; }
.findings-extras-heading > div:last-child { flex: 1; min-width: 0; }
.findings-extras-heading p:not(.checkup-kicker) { color: #706d59; font-size: 13px; margin: 8px 0; }
.findings-donut { width: 120px; height: 120px; display: grid; place-items: center; flex-shrink: 0; border-radius: 50%; background: conic-gradient(#b9a267 var(--share), #e8e1ce 0); transform: rotate(-12deg); }
.findings-donut > span { display: grid; place-content: center; width: 94px; height: 94px; border-radius: 50%; background: #faf7ee; text-align: center; color: #7b6838; font-size: 28px; font-weight: 800; transform: rotate(12deg); }
.findings-donut small { display: block; font-size: 10px; font-weight: 500; }
.findings-extras .checkup-findings-grid { margin: 24px 0; padding-top: 12px; border-top: 1px dashed #ddd2b3; }
.findings-extras h4 { font-size: 14px; margin: 12px 0; color: #756448; }
.findings-extras .findings-rank { background: #eee6cc; color: #95805b; }
.findings-extras .findings-bar span { background: #b9a267; }
.findings-extras .findings-bar { background: #eee8d7; }
.findings-empty { padding: 15px 0; font-size: 13px; color: #748071; }
.findings-footer { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding: 8px 4px; }
.findings-footer details { max-width: 680px; font-size: 12px; color: #68796a; }
.findings-footer summary { cursor: pointer; color: #486750; font-weight: 700; }
.findings-footer a { font-size: 12px; color: #3f6c51; font-weight: 700; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .findings-list-card { transition: transform .18s ease, box-shadow .18s ease; }
  .findings-list-card:hover { transform: translateY(-3px); box-shadow: 0 12px 22px -18px #294b3b66; }
}
@media (max-width: 900px) {
  .findings-intro { flex-wrap: wrap; }
  .findings-period { transform: none; }
  .findings-top-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .checkup-findings-grid { grid-template-columns: 1fr; gap: 18px; }
  .findings-art { width: 85px; margin-bottom: -12px; }
  .findings-income-value { letter-spacing: -.7px; }
  .findings-extras-heading { flex-direction: column; align-items: flex-start; gap: 18px; }
  .findings-donut { width: 92px; height: 92px; }
  .findings-donut > span { width: 72px; height: 72px; font-size: 22px; }
  .findings-rank-heading { flex-wrap: wrap; gap: 2px 8px; }
  .findings-footer { flex-direction: column; }
}
#insights-view #insights-container { overflow: visible; }
.checkup-hero { position: relative; isolation: isolate; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(220px, .75fr); align-items: center; min-height: 250px; overflow: hidden; padding: clamp(24px, 4vw, 42px); border: 1px solid #cfddd1; border-radius: 24px; background: radial-gradient(ellipse at 91% 16%, #f5e8bd 0, transparent 26%), radial-gradient(ellipse at 78% 92%, #d9e8d2 0, transparent 37%), linear-gradient(120deg, #fbfaf3 10%, #eff5ec 100%); box-shadow: 0 12px 30px -25px #294b3b66; }
.checkup-hero::before { position: absolute; z-index: -1; top: -130px; right: 12%; width: 300px; height: 300px; border: 1px solid #6d94731c; border-radius: 50%; box-shadow: 0 0 0 28px #6d94730a, 0 0 0 58px #6d947308; content: ""; }
.checkup-hero-copy { position: relative; z-index: 1; max-width: 690px; }
.checkup-hero h2 { margin: 8px 0 10px; color: #203d30; font-size: clamp(27px, 3.2vw, 38px); font-weight: 680; letter-spacing: -1.2px; line-height: 1.13; }
.checkup-hero-copy > p:not(.checkup-kicker) { max-width: 620px; margin: 0; color: #52665a; font-size: 14px; line-height: 1.75; }
.checkup-kicker { display: flex; align-items: center; gap: 10px; margin: 0; color: #547260; font-size: 9px; font-weight: 800; letter-spacing: 1.4px; }
.checkup-kicker > span { padding: 4px 9px; border: 1px solid #d4dfd1; border-radius: 999px; background: #ffffffa8; color: #56695e; font-size: 9px; letter-spacing: .3px; }
.checkup-illustration { justify-self: center; align-self: end; width: min(100%, 285px); height: auto; margin: -4px -8px -20px 0; filter: drop-shadow(0 10px 12px #203d3010); }
.checkup-review { margin-top: 20px; }
.checkup-review span { margin-left: 5px; transition: transform .18s ease; }
.checkup-review:hover span { transform: translateX(3px); }
.checkup-refresh { display: inline-flex; align-items: center; gap: 7px; margin-top: 16px; padding: 7px 11px; border: 1px solid #c9d8cb; border-radius: 999px; background: #ffffffb8; color: #315b47; font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; }
.checkup-refresh:hover { background: #fff; border-color: #8eaa94; }
.checkup-loading { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border: 1px solid #e2e8de; border-radius: 12px; background: #fff; color: #617067; font-size: 12px; }
.checkup-loading-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: #5b9171; box-shadow: 0 0 0 4px #5b91711a; }
.checkup-loading .link-button { margin-left: auto; color: #28664d; font-size: 12px; font-weight: 700; }
.checkup-loading-card { display: flex; align-items: center; gap: 16px; min-height: 180px; padding: 28px; border: 1px solid #e0e6df; border-radius: 20px; background: linear-gradient(120deg, #fbfaf3, #eff5ec); }
.checkup-loading-card strong { color: #294d3a; font-size: 16px; }
.checkup-loading-card p { margin: 4px 0 0; color: #64736a; font-size: 12px; }
.checkup-loading-spinner { width: 28px; height: 28px; flex: none; border: 3px solid #dfe9dc; border-top-color: #3e805d; border-radius: 50%; animation: checkup-spin .8s linear infinite; }
@keyframes checkup-spin { to { transform: rotate(360deg); } }
.checkup-tabs { display: flex; gap: 6px; width: fit-content; max-width: 100%; padding: 5px; overflow-x: auto; border: 1px solid #e0e6df; border-radius: 14px; background: #edf1eb; }
.checkup-tabs [role="tab"] { min-height: 38px; padding: 8px 15px; border: 0; border-radius: 10px; background: transparent; color: #637168; font: inherit; font-size: 12px; font-weight: 700; white-space: nowrap; cursor: pointer; transition: color .18s ease, background .18s ease, box-shadow .18s ease; }
.checkup-tabs [role="tab"]:hover { color: #244b3b; background: #ffffffa8; }
.checkup-tabs [role="tab"][aria-selected="true"] { background: #fff; color: #24543f; box-shadow: 0 2px 6px #263e3018; }
.checkup-tabs [role="tab"]:focus-visible, .checkup-text-link:focus-visible { outline: 3px solid #90b3a2; outline-offset: 3px; }
.checkup-panel { min-width: 0; padding: clamp(20px, 3vw, 30px); border: 1px solid #e0e6df; border-radius: 20px; background: #fff; box-shadow: 0 8px 24px -24px #203d3059; animation: checkup-arrive .25s ease both; }
@keyframes checkup-arrive { from { opacity: .7; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.checkup-panel[hidden] { display: none !important; }
.checkup-section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.checkup-section-head h3 { margin: 5px 0 0; color: #203d30; font-size: clamp(19px, 2vw, 23px); letter-spacing: -.45px; }
.checkup-note-badge { flex: none; padding: 6px 10px; border: 1px solid #dbe5d7; border-radius: 999px; background: #f5f8f2; color: #5b705f; font-size: 10px; font-weight: 700; }
.checkup-flow { max-width: 780px; padding: clamp(17px, 3vw, 25px); border: 1px solid #e6ebe3; border-radius: 16px; background: linear-gradient(140deg, #fbfcf9, #f8faf6); }
.checkup-flow-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #54645a; font-size: 12px; }
.checkup-flow-row + .checkup-flow-track { margin: 9px 0 19px; }
.checkup-flow-row strong { color: #203d30; font-size: 19px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.flow-dot { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: #34795b; }
.flow-dot.is-outflow { background: #d29a46; }
.checkup-flow-track { height: 8px; overflow: hidden; border-radius: 99px; background: #e8ede7; }
.checkup-flow-track span { display: block; height: 100%; min-width: 5px; border-radius: inherit; transition: width .55s cubic-bezier(.2,.7,.2,1); }
.checkup-flow-track .is-income { background: linear-gradient(90deg, #387b5d, #79ad7e); }
.checkup-flow-track .is-outflow { background: linear-gradient(90deg, #dbad5d, #c78654); }
.checkup-balance-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 20px; }
.checkup-balance-pair > div { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid #e5eae3; border-radius: 11px; background: #fff; }
.checkup-balance-pair span { color: #68776c; font-size: 10px; font-weight: 700; }
.checkup-balance-pair strong { color: #316447; font-size: 17px; font-variant-numeric: tabular-nums; }
.checkup-balance-pair strong.is-negative { color: #9a5c2d; }
.checkup-takeaway { display: flex; align-items: flex-start; gap: 12px; margin-top: 22px; padding: 15px 16px; border: 1px solid #d8e6d9; border-radius: 13px; background: #eef6ef; }
.checkup-takeaway.is-watch { border-color: #eddcbf; background: #fff8ed; }
.checkup-takeaway > span { display: grid; place-items: center; width: 29px; height: 29px; flex: none; border-radius: 9px; background: #dcebdd; color: #35694f; font-size: 16px; font-weight: 800; }
.checkup-takeaway.is-watch > span { background: #f3e5cb; color: #906027; }
.checkup-takeaway p { margin: 0; color: #526259; font-size: 12px; line-height: 1.7; }
.checkup-takeaway p strong { color: #294d3a; font-size: 13px; }
.checkup-takeaway.is-watch p strong { color: #795629; }
.checkup-snapshot-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 780px; margin-top: 14px; color: #78847b; font-size: 10px; }
.checkup-text-link, .checkup-small-link { border: 0; background: none; color: #28664d; font: inherit; font-size: 11px; font-weight: 750; text-decoration: none; cursor: pointer; }
.checkup-text-link:hover, .checkup-small-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.checkup-panel-intro { max-width: 680px; margin: -12px 0 20px; color: #637168; font-size: 13px; line-height: 1.7; }
.checkup-goals { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.checkup-goal { min-width: 0; padding: 17px; border: 1px solid #e5eae3; border-radius: 15px; background: linear-gradient(145deg, #fff, #fbfcfa); }
.checkup-goal-top { display: flex; align-items: center; gap: 10px; }
.checkup-goal-icon { display: grid; place-items: center; width: 37px; height: 37px; flex: none; border-radius: 12px; background: #eff4e8; color: #427253; font-size: 18px; }
.checkup-goal-name { display: grid; gap: 3px; min-width: 0; flex: 1; }
.checkup-goal-name strong { overflow: hidden; color: #2b4335; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.checkup-goal-name span { color: #68776c; font-size: 10px; }
.checkup-goal-percent { color: #437252; font-size: 12px; font-variant-numeric: tabular-nums; }
.checkup-progress { height: 6px; margin-top: 15px; overflow: hidden; border-radius: 99px; background: #e9eee7; }
.checkup-progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #4d8c68, #a4c782); transition: width .5s ease; }
.checkup-goal > p { margin: 9px 0 0; color: #718076; font-size: 10px; line-height: 1.6; }
.checkup-empty { display: grid; justify-items: start; max-width: 520px; padding: 28px; border: 1px dashed #cbd9c9; border-radius: 16px; background: #f8faf6; }
.checkup-empty > span { color: #bd9b51; font-size: 24px; }
.checkup-empty h4 { margin: 10px 0 0; color: #2b4937; font-size: 17px; }
.checkup-empty p { margin: 5px 0 15px; color: #64736a; font-size: 12px; }
.checkup-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.checkup-action { display: grid; grid-template-columns: auto 1fr; align-content: start; align-items: start; gap: 12px; min-width: 0; padding: 17px; border: 1px solid #e4e9e2; border-radius: 15px; background: #fff; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.checkup-action:hover { transform: translateY(-2px); border-color: #c8d8c9; box-shadow: 0 9px 20px -17px #203d3099; }
.checkup-action-icon { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 11px; color: #35634b; font-size: 17px; font-weight: 750; }
.checkup-action.is-mint .checkup-action-icon { background: #e7f2e9; }
.checkup-action.is-lavender .checkup-action-icon { background: #f0ebf6; color: #685282; }
.checkup-action.is-peach .checkup-action-icon { background: #fbefe4; color: #9a633d; }
.checkup-action > div { min-width: 0; }
.checkup-action h3 { margin: 1px 0 5px; color: #2b4335; font-size: 13px; }
.checkup-action p { margin: 0; color: #657369; font-size: 11px; line-height: 1.65; }
.checkup-action > a { grid-column: 2; justify-self: start; align-self: end; margin-top: 2px; color: #28664d; font-size: 11px; font-weight: 750; text-decoration: none; }
.checkup-action > a:hover { text-decoration: underline; text-underline-offset: 3px; }
.checkup-category-peek { display: grid; grid-template-columns: minmax(140px, .65fr) minmax(0, 1.35fr); gap: 16px; margin-top: 24px; padding: 18px; border-radius: 15px; background: #f7f9f5; }
.checkup-category-peek h4 { margin: 6px 0 0; color: #2b4937; font-size: 15px; }
.checkup-category-peek ul { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.checkup-category-peek li { min-width: 0; padding: 14px; border: 1px solid #e5eae2; border-radius: 12px; background: #fff; color: #56665b; font-size: 11px; }
.checkup-extra-heading { margin-bottom: 12px; }
.checkup-extra-heading h5 { margin: 5px 0 0; color: #2b4937; font-size: 14px; }
.checkup-debt-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.checkup-debt-stats > div { display: grid; align-content: start; gap: 5px; min-width: 0; padding: 11px; border-radius: 10px; background: #f7f9f5; }
.checkup-debt-stats span, .checkup-debt-stats small { color: #718076; font-size: 9px; line-height: 1.4; }
.checkup-debt-stats strong { color: #304d3a; font-size: 15px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.checkup-debt-note { margin: 12px 0 0; color: #657369; font-size: 10px; line-height: 1.65; }
.checkup-insights { display: grid; gap: 8px; }
.checkup-insight { display: grid; grid-template-columns: auto 1fr; gap: 8px 11px; padding: 11px; border-radius: 10px; background: #f7f9f5; }
.checkup-insight > span { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 8px; background: #e8f0e6; color: #456a4d; font-weight: 800; }
.checkup-insight h4 { margin: 0 0 4px; color: #304d3a; font-size: 11px; }
.checkup-insight p { margin: 0; color: #657369; font-size: 10px; line-height: 1.55; }
.checkup-insight a { grid-column: 2; justify-self: start; color: #28664d; font-size: 10px; font-weight: 750; text-decoration: none; }
.checkup-insight a:hover { text-decoration: underline; text-underline-offset: 3px; }
.checkup-goal-summary { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 17px; border-radius: 14px; background: linear-gradient(110deg, #edf5e9, #f8f6e9); }
.checkup-goal-summary div { display: grid; gap: 4px; }
.checkup-goal-summary strong { color: #2b4937; font-size: 14px; }
.checkup-goal-summary span, .checkup-goal-summary p { margin: 0; color: #637168; font-size: 10px; line-height: 1.5; }
.checkup-goal-summary p strong { font-size: inherit; }
.checkup-assumptions { margin-top: 18px; padding: 14px 16px; border: 1px solid #e5eae3; border-radius: 12px; background: #fafbf9; }
.checkup-assumptions summary { color: #3c5a45; font-size: 11px; font-weight: 750; cursor: pointer; }
.checkup-assumptions p, .checkup-disclaimer { margin: 9px 0 0; color: #718076; font-size: 10px; line-height: 1.75; }
.checkup-disclaimer { padding-top: 13px; border-top: 1px solid #edf0ec; }
.checkup-error { padding: 24px; border: 1px solid #ecd7d2; border-radius: 16px; background: #fff9f7; }
.checkup-error h2 { margin: 0 0 6px; color: #713e34; font-size: 19px; }
.checkup-error p { color: #745e57; font-size: 13px; }
@media (max-width: 900px) { .checkup-actions { grid-template-columns: 1fr; } }
@media (max-width: 650px) {
  .checkup-hero { grid-template-columns: 1fr; min-height: 0; padding-bottom: 5px; }
  .checkup-illustration { width: min(78%, 230px); margin: -4px 0 -12px auto; }
  .checkup-tabs { width: 100%; }
  .checkup-tabs [role="tab"] { flex: 1; padding-inline: 9px; font-size: 10px; }
  .checkup-section-head { align-items: flex-start; flex-direction: column; gap: 9px; }
  .checkup-category-peek { grid-template-columns: 1fr; }
  .checkup-debt-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .checkup-goal-summary { align-items: flex-start; flex-direction: column; }
  .checkup-balance-pair { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .checkup-panel, .checkup-action, .checkup-progress span, .checkup-flow-track span, .checkup-loading-spinner { animation: none; transition: none; }
  .checkup-action:hover { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  body .view .metric-card:not(.mtd-category-card),
  body .view .acct-card,
  body .view .plan-debt,
  body .view .plan-goal { transition: none; }
  body .view .plan-debt:hover, body .view .plan-goal:hover { transform: none; }
}
.tx-note { display: grid; gap: 3px; margin-top: 8px; padding: 8px 10px; border-left: 3px solid #47745f; border-radius: 4px; background: #f3f7f4; font-size: 12px; }
.tx-note strong { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: #426650; }
.tx-note span { white-space: pre-wrap; overflow-wrap: anywhere; }
.tx-note-editor { margin-top: 8px; font-size: 12px; }
.tx-note-editor summary { cursor: pointer; color: #285b47; }
.tx-note-editor label, .tx-note-editor small { display: block; margin: 8px 0; }
.tx-note-editor textarea { display: block; width: 100%; min-width: 180px; box-sizing: border-box; resize: vertical; }
.tx-note-editor [role="status"] { display: block; margin-top: 6px; }
.review-filters, .review-actions, .review-pagination { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin: 16px 0; }
.review-filters label { display: grid; gap: 6px; }
.import-review-card { border: 1px solid var(--border); border-radius: 12px; padding: 18px; margin-bottom: 16px; }
.review-comparison { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.review-comparison h3 { font-size: 15px; overflow-wrap: anywhere; }
.review-comparison select { display: block; width: 100%; margin-top: 8px; }
.review-candidates { padding-left: 18px; font-size: 13px; overflow-wrap: anywhere; }
.review-candidates li { margin-bottom: 12px; }
.review-inclusion { font-size: 12px; font-weight: 600; }
@media (max-width: 700px) { .review-comparison { grid-template-columns: 1fr; } }
#dashboard-view .mtd-category-card.is-budget-focus { outline: 3px solid #6d28d9; outline-offset: 4px; }
.detail-link { cursor: pointer; color: inherit; text-decoration: underline; text-underline-offset: .18em; }
button.detail-link { font: inherit; border: 0; background: none; padding: 0; text-align: inherit; }
button.detail-link.today-row { width: 100%; padding: 10px 12px; }
.detail-link:hover { text-decoration-thickness: .14em; }
.detail-link:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; border-radius: 2px; }
a.health-target-bar { display: block; }
[data-detail-card] { cursor: pointer; }
[data-detail-card]:hover, [data-detail-card]:focus-within { outline: 1px solid var(--text-secondary, #64748b); }
