:root {
  --accent: #4a90d9;
  --ink: #222;
  --muted: #777;
  --line: #ddd;
  --bg: #fafafa;
}

* { box-sizing: border-box; }

body {
  margin: 0 auto;
  padding: 16px;
  max-width: 860px;
  font-family: "Courier New", Courier, monospace;
  color: var(--ink);
  background: #fff;
}

header { display: flex; align-items: baseline; gap: 24px; flex-wrap: wrap; }
h1 { font-size: 22px; margin: 8px 0; }
h2 { font-size: 15px; margin: 20px 0 8px; }

.month-nav { display: flex; align-items: center; gap: 10px; }
.month-nav button {
  font: inherit; background: var(--bg); border: 1px solid var(--line);
  padding: 2px 10px; cursor: pointer;
}
.month-nav button:hover { border-color: var(--accent); color: var(--accent); }
#month-label { min-width: 130px; text-align: center; }

#link-bot {
  font: inherit; font-size: 12px; background: var(--bg);
  border: 1px solid var(--line); padding: 2px 10px; cursor: pointer;
  margin-left: auto;
}
#link-bot:hover { border-color: var(--accent); color: var(--accent); }

.chart-block { margin-bottom: 8px; }
.empty, #status { color: var(--muted); }

.bar-row {
  display: grid; grid-template-columns: 140px 1fr 90px;
  align-items: center; gap: 8px; margin: 3px 0; font-size: 13px;
}
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { background: var(--bg); border: 1px solid var(--line); height: 16px; }
.bar { display: block; height: 100%; background: var(--accent); }
.bar-value { text-align: right; }

.columns { display: flex; gap: 4px; align-items: flex-end; height: 110px; }
.column {
  flex: 1; display: flex; flex-direction: column;
  justify-content: flex-end; align-items: center; height: 100%;
}
.col-fill { width: 100%; background: var(--line); min-height: 1px; }
.column.current .col-fill { background: var(--accent); }
.col-label { font-size: 10px; color: var(--muted); margin-top: 3px; }

#category-filter {
  font: inherit; margin-bottom: 8px; padding: 3px;
  border: 1px solid var(--line); background: var(--bg);
}

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: normal; }
.num { text-align: right; }
button.delete {
  font: inherit; color: var(--muted); background: none;
  border: none; cursor: pointer;
}
button.delete:hover { color: #c44; }

@media (max-width: 600px) {
  .bar-row { grid-template-columns: 90px 1fr 80px; }
  th:nth-child(4), td:nth-child(4) { display: none; } /* hide note column */
}
