:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --ink: #17202c;
  --muted: #667085;
  --line: #d9e0ea;
  --panel: #ffffff;
  --accent: #155eef;
  --accent-dark: #0f3f9f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.page {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0;
}

.summary {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.2;
  letter-spacing: 0;
}

.time {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.live-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.live-status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
}

.live-status.is-active::before {
  background: #16a34a;
}

.total {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  background: var(--panel);
  margin-bottom: 14px;
}

.total div {
  padding: 24px;
  border-right: 1px solid var(--line);
}

.total div:last-child {
  border-right: 0;
}

.label {
  display: block;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 8px;
}

.total strong {
  display: block;
  font-size: 32px;
  line-height: 1.1;
}

.status-line {
  min-height: 22px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 14px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  background: var(--panel);
}

table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

th,
td {
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}

th:first-child,
td:first-child {
  text-align: left;
}

th {
  background: #eef3fa;
  color: #344054;
  font-size: 14px;
}

td {
  font-size: 17px;
}

tr:last-child td {
  border-bottom: 0;
}

.total-row td {
  background: #f8fbff;
  color: var(--accent-dark);
  font-weight: 800;
}

@media (max-width: 720px) {
  .page {
    width: min(100% - 20px, 1080px);
    padding: 24px 0;
  }

  .summary {
    align-items: start;
  }

  h1 {
    font-size: 28px;
  }

  .live-status {
    margin-top: 4px;
  }

  .total {
    grid-template-columns: 1fr;
  }

  .total div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .total div:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 560px) {
  .nav-link {
    margin-top: 4px;
  }

  .history-card summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 14px;
  }

  .history-time {
    font-size: 16px;
  }

  .history-table-wrap {
    overflow: visible;
    border-top: 1px solid var(--line);
  }

  .history-table-wrap table {
    min-width: 0;
  }

  .page {
    width: min(100% - 16px, 1080px);
    padding: 20px 0;
  }

  .summary {
    gap: 12px;
    margin-bottom: 18px;
  }

  h1 {
    font-size: 25px;
  }

  .time {
    font-size: 15px;
  }

  .total div {
    padding: 18px;
  }

  .total strong {
    font-size: 30px;
  }

  .table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  tr {
    margin-bottom: 10px;
    border: 1px solid var(--line);
    background: var(--panel);
  }

  td {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 11px 14px;
    text-align: right;
    font-size: 16px;
  }

  td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    text-align: left;
  }

  td:first-child {
    font-size: 18px;
    font-weight: 800;
  }
}


.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.history-list {
  display: grid;
  gap: 12px;
}

.history-card {
  border: 1px solid var(--line);
  background: var(--panel);
}

.history-card summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  cursor: pointer;
  list-style: none;
}

.history-card summary::-webkit-details-marker {
  display: none;
}

.history-time {
  color: var(--ink);
  font-size: 17px;
  font-weight: 800;
}

.history-metrics {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  color: var(--muted);
  white-space: nowrap;
}

.history-metrics strong {
  color: var(--accent-dark);
  font-size: 22px;
}

.history-table-wrap {
  overflow-x: auto;
  border-top: 1px solid var(--line);
}

.history-table-wrap table {
  min-width: 680px;
}
