:root {
  --ink: #17342d;
  --muted: #68766f;
  --paper: #f7f5ef;
  --surface: #fffefa;
  --line: #d8ddd3;
  --moss: #316251;
  --moss-dark: #204539;
  --gold: #d99d37;
  --pale: #e7f0e8;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 16px/1.45 Georgia, "Times New Roman", serif; }
button, input { font: inherit; }
button { cursor: pointer; }
.site-header { display: flex; justify-content: space-between; gap: 2rem; align-items: end; padding: 2.5rem max(5vw, 2rem); color: white; background: var(--ink); }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(2rem, 4vw, 3.25rem); font-weight: 500; letter-spacing: -.04em; }
h2 { margin-bottom: 0; font-size: 1.7rem; font-weight: 500; }
.eyebrow { margin-bottom: .3rem; color: var(--gold); font: 700 .72rem/1.2 Arial, sans-serif; letter-spacing: .13em; text-transform: uppercase; }
.header-actions { display: flex; gap: 1rem; align-items: end; font-family: Arial, sans-serif; font-size: .85rem; }
.header-actions label { display: grid; gap: .3rem; color: #dce6de; }
input[type="number"] { width: 7rem; padding: .55rem; border: 1px solid var(--line); border-radius: 3px; color: var(--ink); background: white; }
button { padding: .6rem .8rem; border: 1px solid transparent; border-radius: 3px; color: white; background: var(--moss); font-family: Arial, sans-serif; font-size: .85rem; }
button:hover { background: var(--moss-dark); }
button.secondary { border-color: #aebdb3; color: var(--ink); background: var(--surface); }
button.secondary:hover { background: var(--pale); }
main { width: min(1200px, 92vw); margin: 2rem auto 4rem; }
.summary { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); background: var(--surface); }
.summary div { padding: 1.15rem 1.25rem; border-right: 1px solid var(--line); }
.summary div:last-child { border: 0; background: var(--pale); }
.summary span { display: block; margin-bottom: .3rem; color: var(--muted); font: 700 .7rem Arial, sans-serif; letter-spacing: .08em; text-transform: uppercase; }
.summary strong { font-size: 1.85rem; font-weight: 500; }
.months { display: grid; grid-template-columns: repeat(12, 1fr); gap: .35rem; margin: 2rem 0; }
.month-button { padding: .6rem .2rem; border: 1px solid var(--line); color: var(--ink); background: transparent; }
.month-button:hover, .month-button.active { color: white; background: var(--moss); border-color: var(--moss); }
.workspace, .report-panel { margin-bottom: 2rem; padding: clamp(1.2rem, 3vw, 2.2rem); border: 1px solid var(--line); background: var(--surface); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; }
.save-status { margin: 0; color: var(--moss); font: .8rem Arial, sans-serif; }
.intro { max-width: 42rem; margin: 1rem 0 1.5rem; color: var(--muted); }
.count-section { margin-top: 2rem; }
.count-section h3 { margin: 0 0 .65rem; padding-bottom: .55rem; border-bottom: 2px solid var(--moss); font-size: 1.1rem; font-weight: 500; }
table { width: 100%; border-collapse: collapse; }
th { color: var(--muted); font: 700 .7rem Arial, sans-serif; letter-spacing: .07em; text-align: right; text-transform: uppercase; }
th:first-child { text-align: left; }
th, td { padding: .55rem .65rem; border-bottom: 1px solid var(--line); }
td { text-align: right; }
td:first-child { width: 54%; text-align: left; }
td.total-cell { font-weight: bold; background: #f1f4ed; }
tr.subtotal td { border-top: 2px solid var(--ink); font-weight: bold; }
td input { width: 4.7rem; padding: .38rem; border: 1px solid #bac7bc; border-radius: 2px; text-align: right; }
.table-wrap { overflow-x: auto; }
.report-panel { background: #f0f4ec; }
.report-panel th, .report-panel td { white-space: nowrap; }
footer { display: flex; justify-content: space-between; gap: 1rem; padding: 1.3rem max(5vw, 2rem); color: #dce6de; background: var(--ink); font: .8rem Arial, sans-serif; }
.text-button { padding: 0; margin-left: 1rem; border: 0; color: #fff; background: transparent; text-decoration: underline; }
.text-button:hover { color: var(--gold); background: transparent; }
.file-label input { display: none; }
@media (max-width: 700px) {
  .site-header, footer { align-items: start; flex-direction: column; }
  .header-actions { align-items: end; flex-wrap: wrap; }
  .summary { grid-template-columns: repeat(2, 1fr); }
  .summary div:nth-child(2) { border-right: 0; }
  .summary div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .months { grid-template-columns: repeat(4, 1fr); }
  td:first-child { min-width: 185px; }
  footer div { display: flex; flex-wrap: wrap; gap: 1rem; }
  .text-button { margin-left: 0; }
}
@media print {
  body { background: white; font-size: 11px; }
  .site-header { padding: 1rem 0; color: var(--ink); background: white; }
  .site-header .eyebrow { color: var(--ink); }
  .header-actions, .summary, .months, .workspace, footer, .report-panel button { display: none; }
  main { width: 100%; margin: 0; }
  .report-panel { display: block; padding: 0; border: 0; background: white; }
}
