:root {
  --bg: #0f1419;
  --panel: #1a2332;
  --text: #e8eef7;
  --muted: #8b9cb3;
  --accent: #5b9bd5;
  --border: #2d3d52;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  padding: 1.25rem 1.5rem 3rem;
}

.hdr h1 {
  margin: 0 0 0.35rem;
  font-size: 1.5rem;
  font-weight: 600;
}

.meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.err {
  color: #f5a08c;
  margin: 0.5rem 0 0;
}

.summary,
.detail {
  margin-top: 2rem;
}

h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

th,
td {
  text-align: left;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--panel);
  color: var(--muted);
  font-weight: 500;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover td {
  background: rgba(91, 155, 213, 0.06);
}

tbody tr.sum-table-total td {
  font-weight: 600;
  border-top: 2px solid var(--border);
  background: rgba(91, 155, 213, 0.1);
}

tbody tr.sum-table-total:hover td {
  background: rgba(91, 155, 213, 0.14);
}

details.month {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 0.65rem;
  background: var(--panel);
}

details.month summary.month-summary-inner {
  display: grid;
  grid-template-columns:
    1rem
    minmax(0, 1fr)
    minmax(0, max-content)
    minmax(0, max-content)
    auto;
  align-items: center;
  column-gap: 1rem;
  row-gap: 0.35rem;
  padding: 0.65rem 0.85rem;
  min-height: 2.85rem;
  cursor: pointer;
  list-style: none;
  font-weight: 500;
}

details.month summary.month-summary-inner::-webkit-details-marker {
  display: none;
}

.month-sum-disclosure {
  display: block;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  justify-self: center;
  transition: transform 0.15s ease;
  margin-top: -2px;
}

details.month[open] > summary .month-sum-disclosure {
  transform: rotate(45deg);
  margin-top: 0;
}

.month-sum-label {
  font-weight: 600;
  min-width: 0;
}

.month-sum-metric {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 0.65rem;
  padding-inline-end: 0.25rem;
  min-width: 0;
  font-size: 0.875rem;
  color: var(--text);
  white-space: nowrap;
}

.month-metric-lbl {
  flex: 0 0 auto;
}

.month-metric-val {
  flex: 0 0 auto;
  min-width: 2.25ch;
  text-align: left;
  font-variant-numeric: tabular-nums;
}

.month-sum-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.month-sum-noexpand {
  color: var(--muted);
  font-size: 0.875rem;
  padding-right: 0.25rem;
}

@media (max-width: 720px) {
  details.month summary.month-summary-inner {
    grid-template-columns: 1rem minmax(0, 1fr) auto;
    grid-template-rows: auto auto auto;
    align-items: center;
  }

  .month-sum-disclosure {
    grid-row: 1 / -1;
    align-self: center;
  }

  .month-sum-label {
    grid-column: 2;
    grid-row: 1;
  }

  .month-sum-wbca {
    grid-column: 2;
    grid-row: 2;
    white-space: normal;
    max-width: 100%;
    flex-wrap: wrap;
    row-gap: 0.1rem;
  }

  .month-sum-bound {
    grid-column: 2;
    grid-row: 3;
    white-space: normal;
    max-width: 100%;
    flex-wrap: wrap;
    row-gap: 0.1rem;
  }

  .month-sum-actions {
    grid-column: 3;
    grid-row: 1 / -1;
    justify-self: end;
    align-self: center;
  }
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-top: 1px solid var(--border);
  align-items: start;
}

@media (max-width: 768px) {
  .split {
    grid-template-columns: 1fr;
  }
}

.col {
  padding: 0.85rem 1rem 1.1rem;
  vertical-align: top;
}

.col:first-child {
  border-right: 1px solid var(--border);
}

@media (max-width: 768px) {
  .col:first-child {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
}

.col h3 {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 600;
}

.bound-expand-btn {
  display: inline-block;
  width: auto;
  max-width: none;
  background: #2d6a4f;
  color: #f4fff8;
  border: 1px solid #40916c;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  margin: 0;
  white-space: nowrap;
}

.bound-expand-btn:hover {
  background: #40916c;
}

.bound-expand-btn:focus-visible {
  outline: 2px solid #74c69d;
  outline-offset: 2px;
}

.bound-panel {
  padding-top: 0.35rem;
  margin-top: 0.15rem;
}

.bound-panel[hidden] {
  display: none !important;
}

ol.titles {
  margin: 0;
  padding-left: 1.1rem;
}

ol.titles li {
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.45;
}

ol.titles a {
  color: var(--accent);
  text-decoration: none;
}

ol.titles a:hover {
  text-decoration: underline;
}
