.aggregate-board {
  --aggregate-ink: #17251d;
  --aggregate-muted: #46554b;
  width: 100%;
  min-width: 0;
  color: var(--aggregate-ink);
  font-size: 16px;
  line-height: 1.45;
}
.aggregate-board *, .aggregate-board *::before, .aggregate-board *::after { box-sizing: border-box; }
.aggregate-board h2, .aggregate-board h3, .aggregate-board p { margin: 0; }
.aggregate-board h2 { font-size: clamp(23px, 3vw, 29px); line-height: 1.15; letter-spacing: -.035em; }
.aggregate-board .eyebrow { display: block; margin-bottom: 6px; font-size: 13px; letter-spacing: .045em; }
.aggregate-titlebar { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.aggregate-titlebar > p { max-width: 240px; color: var(--aggregate-muted); font-size: 14px; text-align: right; }
.aggregate-board .aggregate-filter-summary { display: flex; align-items: start; gap: 8px; padding: 10px 0 14px; font-size: 15px; color: var(--aggregate-muted); overflow-wrap: anywhere; }
.aggregate-filter-summary > .ui-icon { width: 18px; height: 18px; flex: 0 0 18px; margin-top: 2px; }

.aggregate-records-summary { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 16px 18px; margin-bottom: 14px; border-radius: 14px; background: #17281f; color: #fffbe8; }
.aggregate-records-summary > span { display: flex; align-items: center; gap: 12px; }
.aggregate-records-summary > span > .ui-icon { width: 25px; height: 25px; color: #dff591; }
.aggregate-records-summary strong { font-size: 35px; line-height: 1; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.aggregate-records-summary > span > span { font-size: 14px; line-height: 1.3; }
.aggregate-records-summary > p { color: #dde5d2; font-size: 14px; line-height: 1.35; text-align: right; }
.aggregate-tile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.aggregate-tile { display: flex; flex-direction: column; min-width: 0; background: #fffdf4; border: 1px solid #c4cebc; border-radius: 15px; overflow: hidden; box-shadow: 0 2px 0 #14271d0a; }
.aggregate-board .aggregate-tile-overview { display: flex; flex-direction: column; align-items: stretch; gap: 5px; width: 100%; flex: 1; min-width: 0; padding: 15px 15px 13px; background: transparent; border: 0; color: var(--aggregate-ink); font: inherit; line-height: 1.35; text-align: left; cursor: pointer; }
.aggregate-tile-overview:hover { background: #edf2da; }
.aggregate-tile-title { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; font-size: 16px; line-height: 1.3; font-weight: 700; }
.aggregate-tile-title > .ui-icon { width: 21px; height: 21px; flex: 0 0 21px; }
.aggregate-tile-title > .ui-icon:last-child { width: 17px; height: 17px; flex-basis: 17px; margin-left: auto; color: #5b6d50; }
.aggregate-tile-label { color: var(--aggregate-muted); font-size: 13px; }
.aggregate-board .aggregate-tile-total { font-size: clamp(23px, 2.8vw, 31px); line-height: 1.2; letter-spacing: -.035em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.aggregate-tile-coverage { color: var(--aggregate-muted); font-size: 13px; }
.aggregate-value-caveat { color: #7b4417; font-size: 13px; font-weight: 650; }

/* Shared with the category popup: each side remains an independent button. */
.aggregate-sides { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.aggregate-side { display: flex; flex-direction: column; align-items: stretch; gap: 7px; min-width: 0; min-height: 124px; padding: 14px 12px; border: 1px solid transparent; border-radius: 11px; font-family: inherit; font-size: 16px; line-height: 1.35; text-align: left; cursor: pointer; transition: background .12s ease; }
.aggregate-side-red { background: #79243a; border-color: #a84b5c; color: #fff0f1; }
.aggregate-side-green { background: #07503d; border-color: #48866b; color: #f4f8d2; }
.aggregate-side-red:hover { background: #8a2e46; }
.aggregate-side-green:hover { background: #0c6049; }
.aggregate-side:focus-visible, .aggregate-tile-overview:focus-visible { outline: 3px solid #1554d1; outline-offset: -3px; }
.aggregate-side-name { display: flex; justify-content: space-between; align-items: start; gap: 4px; font-size: 14px; font-weight: 700; overflow-wrap: anywhere; }
.aggregate-side-name > .ui-icon { width: 15px; height: 15px; flex: 0 0 15px; margin-top: 2px; }
.aggregate-side-total { font-size: clamp(18px, 2vw, 25px); line-height: 1.2; letter-spacing: -.025em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.aggregate-side-red .aggregate-side-total { color: #ffe5aa; }
.aggregate-side-green .aggregate-side-total { color: #e7f58f; }
.aggregate-side-count { font-size: 13px; line-height: 1.3; }
.aggregate-board .aggregate-tile .aggregate-sides { gap: 0; margin-top: auto; }
.aggregate-board .aggregate-tile .aggregate-side { min-height: 100px; padding: 11px 13px; gap: 5px; border: 0; border-radius: 0; }
.aggregate-board .aggregate-tile .aggregate-side + .aggregate-side { border-left: 2px solid #fffdf4; }
.aggregate-board .aggregate-tile .aggregate-side > .aggregate-side-total { font-size: 22px; overflow-wrap: anywhere; }
.aggregate-board .aggregate-tile .aggregate-side > .aggregate-side-count { font-size: 13px; }
.aggregate-board .aggregate-logic { display: flex; align-items: start; gap: 8px; padding-top: 14px; font-size: 14px; line-height: 1.45; color: var(--aggregate-muted); }
.aggregate-logic > .ui-icon { flex: 0 0 18px; width: 18px; height: 18px; margin-top: 2px; }

@media (max-width: 680px) {
  .aggregate-titlebar { display: block; }
  .aggregate-titlebar > p { max-width: none; margin-top: 8px; text-align: left; }
  .aggregate-tile-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .aggregate-records-summary { padding: 14px; gap: 10px; flex-wrap: wrap; }
  .aggregate-records-summary > p { text-align: left; }
  .aggregate-records-summary > p br { display: none; }
  .aggregate-records-summary > span { gap: 9px; }
  .aggregate-records-summary strong { font-size: 32px; }
  .aggregate-board .aggregate-tile-overview { padding: 13px 14px 12px; }
  .aggregate-board .aggregate-tile-total { font-size: 26px; }
  .aggregate-board .aggregate-tile .aggregate-side { min-height: 97px; padding: 11px 12px; }
  .aggregate-board .aggregate-tile .aggregate-side > .aggregate-side-total { font-size: 21px; }
}
@media (max-width: 360px) {
  .aggregate-board .aggregate-tile .aggregate-side > .aggregate-side-total { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) {
  .aggregate-side { transition: none; }
}

/* Keep the category totals above the fold, after the shared filters. */
.aggregate-board .aggregate-titlebar{align-items:center;margin-bottom:10px;gap:10px}
.aggregate-board .aggregate-titlebar h2{font-size:19px;line-height:1.25;letter-spacing:-.02em}
.aggregate-board .aggregate-titlebar>p{font-size:13px;max-width:none}
.aggregate-board .aggregate-records-summary{padding:10px 13px;margin-bottom:12px;border-radius:10px;gap:8px}
.aggregate-board .aggregate-records-summary strong{font-size:26px}
.aggregate-board .aggregate-records-summary>span{gap:8px}
.aggregate-board .aggregate-records-summary>p{font-size:13px}
@media(max-width:680px){.aggregate-board .aggregate-titlebar>p{margin-top:5px}.aggregate-board .aggregate-records-summary>p{display:none}}
