body.books { min-height: 100vh; }
.books-note {
  background: #2a2410;
  border: 1px solid #4a3d14;
  color: #f3e2a4;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 13px;
}
.books-periods { display: flex; flex-wrap: wrap; gap: 8px; }
.books-periods button {
  background: var(--bg2);
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.books-periods button.on {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
  font-weight: 700;
}
.books-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.books-stats .stat b { font-variant-numeric: tabular-nums; }
.delta { font-size: 12px; color: var(--dim); margin-top: 4px; }
.delta.up { color: var(--green); }
.delta.down { color: var(--red); }
.bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 140px;
  padding-top: 8px;
}
.bars .col { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.bars .bar {
  background: linear-gradient(#ffe27a, #ffb800);
  border-radius: 4px 4px 0 0;
  min-height: 2px;
}
.bars .lbl {
  margin-top: 6px;
  color: var(--dim);
  font-size: 10px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
}
.books-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.books-table th {
  text-align: left;
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  padding: 8px 8px 8px 0;
}
.books-table td { padding: 10px 8px 10px 0; border-top: 1px solid var(--line); vertical-align: top; }
.books-table td.num, .books-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.pill {
  display: inline-block;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 99px;
  background: var(--card2);
  color: var(--muted);
}
.pill.ok { color: var(--green); }
.pill.warn { color: #ffd84d; }
.plan-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.plan-row:last-child { border-bottom: 0; }
.side-stat { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.side-stat:last-child { border-bottom: 0; }
.side-stat b { font-variant-numeric: tabular-nums; }
body.books .page { padding-bottom: 32px; }
@media (max-width: 860px) {
  .books-stats { grid-template-columns: 1fr 1fr; }
  .books-table { font-size: 13px; }
  body.books .topnav { display: flex; gap: 14px; }
}
