[hidden] { display: none !important; }

#projection-table { overflow-x: auto; }
.projection-card { overflow: hidden; }
.reserve-card[role="button"] { cursor: pointer; }
.reserve-meta { flex-wrap: wrap; }
.coverage-gauge b { display: block; font-size: 20px; line-height: 1; }
.coverage-gauge small { margin-top: 4px; }
.reserve-health-copy { position: relative; z-index: 1; max-width: 430px; }
.reserve-health-copy .eyebrow { color: #e9bd75; }
.reserve-health-title { margin: 4px 0 7px; font-family: Georgia, serif; font-size: clamp(27px,3vw,39px); letter-spacing: -.025em; }
.reserve-health-copy p { margin: 0 0 8px; color: #c8d5cf; line-height: 1.45; }
.reserve-health-copy small { color: #9fb5aa; text-transform: capitalize; }
.reserve-indicators { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3,100px); gap: 14px; }
.reserve-indicator { display: grid; justify-items: center; gap: 7px; }
.reserve-indicator > em { color: #c8d5cf; font-size: 11px; font-style: normal; font-weight: 700; text-align: center; }
.indicator-ring { --ring-color: var(--gold); position: relative; width: 92px; height: 92px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--ring-color) calc(var(--percent)*1%),rgba(255,255,255,.12) 0); }
.indicator-ring:after { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: var(--forest-2); }
.indicator-ring span { position: relative; z-index: 1; max-width: 72px; text-align: center; }
.indicator-ring b, .indicator-ring small { display: block; }
.indicator-ring b { font-size: 17px; line-height: 1.05; }
.indicator-ring small { margin-top: 4px; color: #bbc9c2; font-size: 9px; }
.indicator-ring.target { --ring-color: #69ad8f; }
.reserve-indicator.down .indicator-ring.trend { --ring-color: var(--orange); }
.reserve-indicator.up .indicator-ring.trend { --ring-color: #69ad8f; }
.reserve-indicator.stable .indicator-ring.trend { --ring-color: var(--gold); }
.forecast-strip { display: grid; grid-template-columns: 1.2fr repeat(3, 1fr); gap: 10px; margin: 0 0 16px; }
.forecast-strip > div { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.forecast-strip strong, .forecast-strip small { display: block; }
.forecast-strip small { color: var(--muted); margin-top: 4px; }
.dialog-card .metric { min-width: 0; }
.dialog-card .metric strong { overflow-wrap: anywhere; }
.dialog-card { max-height: calc(100vh - 32px); overflow-y: auto; }
dialog.category-detail { max-width: min(1120px, calc(100% - 32px)); }
dialog.income-detail { max-width: 760px; }
.income-notice { cursor: pointer; align-items: center; transition: border-color .18s, box-shadow .18s, transform .18s; }
.income-notice:hover, .income-notice:focus-visible { border-color: var(--gold); box-shadow: 0 8px 24px rgba(117,93,46,.10); outline: none; transform: translateY(-1px); }
.income-notice span { flex: 1; }
.income-notice b { margin-left: auto; color: #755d2e; white-space: nowrap; }
.income-list { display: grid; gap: 9px; margin: 20px 0; }
.income-row { display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: center; gap: 14px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 13px; }
.income-row > div:first-child { min-width: 0; }
.income-row > div:first-child strong, .income-row > div:first-child small { display: block; }
.income-row > div:first-child strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.income-row > div:first-child small { margin-top: 4px; color: var(--muted); }
.income-row-actions, .income-editor-actions { display: flex; align-items: center; gap: 8px; }
.income-row-actions .danger { padding: 8px 10px; font-size: 12px; }
.income-editor-actions { margin-top: 18px; }
.category-costs { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.category-costs-title h3 { margin: 0; font-family: Georgia, serif; font-size: 21px; }
.category-costs-title p { margin: 4px 0 14px; color: var(--muted); font-size: 12px; }
.category-row[role="button"] { cursor: pointer; transition: border-color .18s, transform .18s, box-shadow .18s; }
.category-row[role="button"]:hover, .category-row[role="button"]:focus-visible { border-color: var(--green); box-shadow: 0 8px 24px rgba(30,69,55,.08); outline: none; transform: translateY(-1px); }
.category-cost-matrix-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
.category-cost-matrix { width: 100%; min-width: 960px; border-collapse: separate; border-spacing: 0; font-size: 12px; }
.category-cost-matrix th, .category-cost-matrix td { padding: 11px 12px; border-right: 1px solid #ebe7df; border-bottom: 1px solid #ebe7df; text-align: right; vertical-align: middle; white-space: nowrap; }
.category-cost-matrix th:last-child, .category-cost-matrix td:last-child { border-right: 0; }
.category-cost-matrix thead th { position: sticky; top: 0; z-index: 2; background: #f0ede5; color: var(--forest-2); text-transform: capitalize; }
.category-cost-matrix tr > :first-child { position: sticky; left: 0; z-index: 1; width: 260px; min-width: 260px; max-width: 260px; overflow: hidden; text-align: left; background: var(--paper); }
.category-cost-matrix thead tr > :first-child { z-index: 3; background: #f0ede5; }
.category-cost-matrix tbody th strong, .category-cost-matrix tbody th small, .category-cost-matrix td strong, .category-cost-matrix td small { display: block; }
.category-cost-matrix tbody th strong { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.category-cost-matrix tbody th small, .category-cost-matrix td small { margin-top: 3px; color: var(--muted); font-weight: 500; }
.category-cost-matrix tbody th small { max-width: 100%; overflow-wrap: anywhere; white-space: normal; line-height: 1.35; }
.category-cost-matrix td.editable-cost { padding-bottom: 7px; }
.cost-edit-button { margin-top: 7px; padding: 4px 9px; border: 1px solid #cfc8ba; border-radius: 99px; background: #fffdf8; color: var(--green); font-size: 10px; font-weight: 800; cursor: pointer; }
.cost-edit-button:hover, .cost-edit-button:focus-visible { border-color: var(--green); outline: none; background: #e7eee9; }
.category-cost-matrix .empty-cell { color: #aaa; text-align: center; }
.category-cost-matrix tfoot th, .category-cost-matrix tfoot td { border-bottom: 0; background: #f8f5ee; font-weight: 800; }
.category-cost-matrix tfoot th { z-index: 1; }
.cost-month { margin-top: 12px; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.cost-month > header { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; background: #f0ede5; text-transform: capitalize; font-size: 13px; }
.cost-line { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 12px; border-top: 1px solid #ebe7df; }
.cost-line time { color: var(--muted); font-size: 12px; text-align: center; }
.cost-line-main { min-width: 0; }
.cost-line-main strong, .cost-line-main small { display: block; }
.cost-line-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.cost-line-main small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.cost-line-value { font-size: 13px; white-space: nowrap; }
.installment-badge { display: inline-block; margin-left: 4px; padding: 2px 6px; border-radius: 99px; background: #fff0cf; color: #87600b; font-weight: 750; }
.cost-empty { margin: 0; padding: 11px 12px; border-top: 1px solid #ebe7df; color: var(--muted); font-size: 12px; }
.recurrence-control { display: grid; grid-template-columns: minmax(0,1fr) minmax(190px,.55fr); gap: 14px; align-items: end; margin-top: 18px; }
.recurrence-control > label { min-width: 0; }
.recurrence-control label > small { color: var(--muted); font-size: 11px; font-weight: 500; }
.check-field { display: flex !important; grid-template-columns: none !important; align-items: center; gap: 12px !important; min-height: 70px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 13px; background: #faf8f2; cursor: pointer; }
.check-field input { width: 20px; height: 20px; min-height: 0 !important; padding: 0 !important; accent-color: var(--green); flex: 0 0 auto; }
.check-field span, .check-field strong, .check-field small { display: block; }
.check-field small { margin-top: 3px; color: var(--muted); font-weight: 500; }
.recurrence-hint { margin: 8px 0 16px; color: var(--muted); font-size: 12px; }
.recurrence-badge { display: inline-block; margin-left: 5px; padding: 2px 6px; border-radius: 99px; background: #e7eee9; color: var(--forest-2); font-size: 9px; font-weight: 800; vertical-align: 1px; }
.subcategory-manager { margin-top: 24px; padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: #faf8f2; }
.subcategory-manager h3 { margin: 0; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
.subcategory-list { display: grid; gap: 8px; margin: 14px 0; }
.subcategory-manager form { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 10px; }
.subcategory-manager form label { min-width: 0; }
.subcategory-manager form button { min-height: 43px; }
.subcategory-edit-form { padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.subcategory-row-actions { display: flex; align-items: center; gap: 6px; }
.subcategory-row-actions .danger { padding: 9px 12px; }
#category-subcategory-form { margin-top: 16px; }
.share-access-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.share-access-actions .primary, .share-access-actions .filter-chip { min-height: 44px; }
.attachment-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.attachment-row:last-child { border-bottom: 0; }
.attachment-row .text-button { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-row .danger { flex: 0 0 auto; padding: 8px 11px; font-size: 12px; }
.transaction-pagination { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 18px; color: var(--muted); font-size: 12px; }
.transaction-pagination .filter-chip:disabled { opacity: .45; cursor: not-allowed; }
.header-actions { flex-wrap: wrap; justify-content: flex-end; }
.projection-month-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; }
.projection-tree-toggle { display: inline-grid; place-items: center; width: 25px; height: 25px; padding: 0; border: 1px solid #c9d8d1; border-radius: 7px; background: #eef5f1; color: var(--forest-2); font-weight: 900; line-height: 1; cursor: pointer; }
.projection-tree-toggle:hover { background: #dfece5; }
.projection-detail-row td { background: #faf8f2; }
.projection-category-row td { border-bottom-color: #e2ddd1; }
.projection-subcategory-row td { background: #f4f1e9; color: var(--muted); }
.projection-expense-row td { background: #efede6; color: var(--muted); }
.projection-tree-label { display: flex; align-items: center; gap: 9px; min-width: 190px; }
.projection-tree-label span, .projection-tree-label strong, .projection-tree-label small, .projection-detail-value strong, .projection-detail-value small { display: block; }
.projection-tree-label small, .projection-detail-value small { margin-top: 2px; color: var(--muted); font-size: 10px; font-weight: 500; }
.projection-tree-label.subcategory { padding-left: 34px; }
.projection-tree-label.subcategory strong { color: var(--forest-2); }
.projection-tree-label.expense { min-width: 260px; padding-left: 68px; }
.projection-tree-label.expense strong { color: var(--ink); font-weight: 650; }
.projection-detail-value { white-space: nowrap; }

#toast { z-index: 1000; }
.dialog-card > #toast { position: sticky; right: auto; bottom: 12px; width: 100%; max-width: none; margin-top: 16px; transform: translateY(10px); }
.dialog-card > #toast.show { transform: none; }

@media (max-width: 620px) {
  .category-actions { display: flex; flex-wrap: wrap; }
  .category-actions .primary { display: inline-block; }
  .reserve-value { font-size: 26px; padding-right: 82px; }
  .gauge { width: 82px; height: 82px; right: 18px; }
  .reserve-health-title { font-size: 29px; }
  .reserve-indicators { width: 100%; grid-template-columns: repeat(3,1fr); gap: 6px; margin-top: 8px; }
  .indicator-ring { width: 76px; height: 76px; }
  .indicator-ring:after { inset: 7px; }
  .indicator-ring b { font-size: 14px; }
  .reserve-indicator > em { font-size: 10px; }
  .dialog-card .metric { padding: 10px; }
  .dialog-card .metric strong { font-size: 17px; }
  .forecast-strip { grid-template-columns: 1fr 1fr; }
  .income-notice { align-items: start; }
  .income-notice b { display: none; }
  .income-row { grid-template-columns: minmax(0,1fr) auto; }
  .income-row-actions { grid-column: 1 / -1; }
  .cost-line { grid-template-columns: 28px minmax(0, 1fr); }
  .cost-line-value { grid-column: 2; }
  .recurrence-control { grid-template-columns: 1fr; }
  .subcategory-manager form { grid-template-columns: 1fr; }
  .transaction-pagination { flex-wrap: wrap; }
  .header-actions { justify-content: flex-start; }
}
