#money-view { font-size: 14px; }
#money-view h1 { margin: 0; font-size: 28px; }
#money-view h2 { margin: 0 0 12px; font-size: 20px; }
#money-view p { margin: 8px 0; }
#money-view input, #money-view select, #money-view button { min-height: 44px; font-size: 14px; }
#money-view input, #money-view select { padding: 9px 12px; }
#money-view label { font-size: 14px; gap: 6px; }
.money-header, .money-section-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px 24px; }
.money-header { margin-bottom: 16px; }
.money-header p { color: var(--muted); }
.money-tabs { display: flex; flex-wrap: wrap; gap: 8px; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.money-tabs button { border: 0; background: transparent; color: var(--muted); padding: 8px 12px; border-radius: 6px 6px 0 0; }
.money-tabs button:hover, .money-tabs .active { background: #e6eaf0; color: var(--fg); }
.money-tabs .active { box-shadow: inset 0 -2px var(--fg); font-weight: 600; }
.money-section { margin-block: 24px; }
.money-section-heading h2 { margin-bottom: 0 !important; }
.money-section-heading { margin-bottom: 12px; }
.money-upload { display: flex; align-items: end; flex-wrap: wrap; gap: 16px; }
.money-upload select { width: 260px; max-width: 100%; }
.money-file-label { flex: 1; min-width: 0; }
.money-file-label input { width: 100%; background: var(--surface); }
#money-view .money-help { display: block; font-size: 14px; color: var(--muted); line-height: 1.5; }
.money-sources { margin-top: 16px; }
.money-source { border-block: 1px solid var(--border); margin-block: -1px 0; padding: 8px 0; }
.money-source summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 4px; cursor: pointer; min-height: 44px; }
.money-source summary:hover { background: #e6eaf0; }
.money-source summary::before { content: "+"; font-size: 20px; }
.money-source[open] > summary::before { content: "−"; }
.money-source summary > span:first-of-type { flex: 1; }
.money-source-date { display: block; color: var(--muted); font-size: 14px; margin-top: 2px; }
.money-source-numbers { font-variant-numeric: tabular-nums; text-align: right; }
.money-source .money-help, .money-metadata dd { overflow-wrap: anywhere; }
.money-method, .money-metadata { margin-block: 12px; }
.money-method > summary, .money-metadata > summary { cursor: pointer; min-height: 44px; padding-block: 10px; }
.money-method > summary:hover, .money-metadata > summary:hover { text-decoration: underline; }
.money-method p { max-width: 80ch; font-size: 16px; }
.money-metadata dl { display: grid; grid-template-columns: minmax(140px,1fr) minmax(0,3fr); gap: 8px 16px; }
.money-metadata dd { margin: 0; color: var(--muted); }
.money-search { max-width: 320px; margin-block: 12px; }
.money-inventory { table-layout: auto; min-width: 680px; }
#money-view th { font-size: 12px; white-space: normal; letter-spacing: 0; text-transform: none; }
#money-view td, #money-view th { padding: 8px 10px; vertical-align: top; }
.money-inventory td:first-child { overflow-wrap: anywhere; min-width: 150px; max-width: 220px; }
.money-inventory td:not(:first-child), .money-result dd { font-variant-numeric: tabular-nums; text-align: right; }
.money-inventory tfoot { font-weight: 600; border-top: 1px solid var(--border); }
.money-actions { display: flex; gap: 8px 16px; align-items: center; flex-wrap: wrap; }
.money-placeholder { display: flex; gap: 16px; justify-content: space-between; align-items: center; flex-wrap: wrap; padding: 16px 0; border-bottom: 1px solid var(--border); }
.money-placeholder h2 { margin-bottom: 4px !important; }
.money-manual-totals { display: flex; gap: 16px 24px; flex-wrap: wrap; }
.money-manual-totals label { max-width: 100%; }
.money-manual-totals input { width: 220px; max-width: 100%; }
.money-entries { display: grid; gap: 16px; }
.money-entry { display: grid; grid-template-columns: minmax(160px,1fr) 180px minmax(180px,1.3fr) 44px; gap: 12px; align-items: end; }
.money-entry label, .money-entry input { min-width: 0; }
.money-remove { width: 44px; padding: 4px; border: 1px solid var(--border); border-radius: 6px; background: transparent; color: var(--muted); font-size: 24px !important; }
.money-remove:hover { color: var(--danger); background: #fae8e8; }
.money-comment { max-width: 760px; margin-block: 24px 16px; }
.money-comment textarea { resize: vertical; min-height: 72px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--fg); font: inherit; }
.money-draft-bar { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.money-draft-bar .text-button, #money-view .money-actions .text-button { color: var(--muted); }
.money-result { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 24px; }
.money-result dl { margin: 0; }
.money-result dl > div { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; }
.money-result dd { margin: 0; white-space: nowrap; font-weight: 600; }
.money-result-net { border-top: 1px solid var(--border); margin-top: 8px; }
.money-notice { background: #fff5d9; color: #664b12; padding: 12px 16px; border-radius: 6px; font-size: 14px; line-height: 1.5; }
.money-notice ul { padding-left: 20px; margin: 8px 0; }
.money-notice li + li { margin-top: 4px; }
.money-empty { padding: 16px 0; color: var(--muted); max-width: 75ch; }
.money-compare-fields { display: flex; align-items: end; flex-wrap: wrap; gap: 16px; margin-bottom: 16px; }
.money-compare-fields select { max-width: 100%; }
.money-dialog { width: min(520px, calc(100% - 32px)); border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--fg); padding: 24px; }
.money-dialog::backdrop { background: #17223566; }
.money-dialog .money-actions { margin-top: 20px; }
.money-history-table { min-width: 520px; }
.workspace:has(#money-view:not([hidden])) { padding: 32px 32px 72px; }
@media (max-width: 1199px) { .money-result { grid-template-columns: minmax(0,1fr); } .money-entry { grid-template-columns: minmax(140px,1fr) 160px 44px; } .money-entry label:nth-child(3) { grid-row: 2; grid-column: 1 / -1; } }
@media (max-width: 679px) {
  .sidebar { gap: 0; }
  .sidebar .brand-block { display: none; }
  .sidebar nav { width: 100%; justify-content: space-between; }
  .sidebar .nav-item { font-size: 14px; padding-inline: 8px; }
  .workspace:has(#money-view:not([hidden])) { padding: 24px 16px 64px; }
  #money-view h1 { font-size: 26px; }
  .money-header { align-items: flex-start; }
  .money-upload { display: grid; grid-template-columns: minmax(0,1fr); }
  .money-source summary { flex-wrap: wrap; }
  .money-source-numbers { flex-basis: 100%; text-align: left; padding-left: 24px; }
  .money-entry { grid-template-columns: minmax(0,1fr) 44px; gap: 8px; }
  .money-entry label:first-child { grid-column: 1; }
  .money-entry label:nth-child(2) { grid-row: 2; grid-column: 1; max-width: 220px; }
  .money-entry label:nth-child(3) { grid-row: 3; }
  .money-remove { grid-row: 1; grid-column: 2; }
  .money-metadata dl { grid-template-columns: minmax(0,1fr); }
  .money-metadata dd { margin-bottom: 8px; }
  .money-result dd { white-space: normal; overflow-wrap: anywhere; }
}
