*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #0f1117;
  color: #e2e8f0;
  min-height: 100vh;
  padding: 40px 32px;
}

.tab-nav {
  display: flex;
  max-width: 900px;
  margin: 0 auto 32px;
  border-bottom: 1px solid #1e2535;
}
.tab-nav a {
  padding: 10px 18px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #3d526b;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab-nav a:hover { color: #94a3b8; }
.tab-nav a.active {
  color: #e2e8f0;
  border-bottom-color: #4a7cc7;
}

@media (max-width: 500px) {
  body {
    padding: 24px 10px;
  }
}

h1 {
  text-align: center;
  font-size: 1.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #f1f5f9;
  margin-bottom: 6px;
}

.subtitle {
  text-align: center;
  font-size: 0.85rem;
  color: #475569;
  margin-bottom: 8px;
}

.last-updated {
  text-align: center;
  font-size: 0.75rem;
  color: #2d3f55;
  margin-bottom: 32px;
}

.scroll-hint {
  display: none;
}

.table-wrapper {
  max-width: 900px;
  margin: 0 auto;
  border-radius: 12px;
  overflow-x: auto;
  overflow-y: visible;
  border: 1px solid #1e2535;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 500px) {
  .table-wrapper {
    overflow-x: visible;
  }
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead tr {
  background: #13192a;
}

thead th {
  padding: 14px 28px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #475569;
  text-align: left;
  white-space: nowrap;
}

thead th:first-child {
  width: 70px;
}

thead th:not(:first-child) {
  text-align: right;
}

@media (max-width: 500px) {
  thead th {
    padding: 10px 8px;
    font-size: 0.62rem;
    white-space: normal;
  }
}

tbody tr {
  border-top: 1px solid #141a28;
  transition: background 0.12s;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

td {
  padding: 9px 28px;
  font-size: 0.87rem;
  white-space: nowrap;
  vertical-align: top;
}

td.year {
  padding-right: 16px;
}

td:not(.year) {
  text-align: right;
}

.year-num {
  color: #7a97b8;
  font-weight: 700;
  margin-right: 10px;
}

.row-label {
  font-size: 0.68rem;
  font-weight: 500;
  color: #3d526b;
  white-space: nowrap;
}

.cell-line-left {
  justify-content: flex-start;
}

@media (max-width: 500px) {
  td {
    padding: 7px 8px;
    font-size: 0.75rem;
    white-space: normal;
  }
  .row-label {
    font-size: 0.6rem;
  }
}

.cell-line {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.cell-line + .cell-line {
  margin-top: 5px;
}

@media (max-width: 500px) {
  .cell-line {
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px;
  }
}

.pct {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 500px) {
  .pct {
    font-size: 0.72rem;
  }
}

.no-data {
  color: #2a3547;
  font-size: 0.85rem;
  font-weight: 500;
}

.z-score {
  display: inline-block;
  width: 5.5em;
  text-align: left;
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 500;
  color: #3d526b;
  font-variant-numeric: tabular-nums;
}

.z-score.outlier {
  color: #94a3b8;
  font-weight: 600;
}

@media (max-width: 500px) {
  .z-score {
    font-size: 0.65rem;
  }
}


@keyframes live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

.live-dot {
  display: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  animation: live-pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}

.live-dot.active {
  display: inline-block;
}

.event-row td {
  padding: 0 20px 10px 20px;
  border-top: none;
}

@media (max-width: 500px) {
  .event-row td {
    padding: 0 8px 8px 8px;
  }
}

.event-row:hover {
  background: transparent !important;
}

.event-text {
  display: block;
  font-size: 0.75rem;
  color: #64748b;
  font-style: italic;
  padding: 5px 10px;
  border-left: 2px solid #334d6e;
  line-height: 1.5;
  white-space: normal;
}

@media (max-width: 500px) {
  .event-text {
    font-size: 0.68rem;
  }
}
