.records-page {
  background: var(--hub-surface);
  border: 1px solid var(--hub-border);
  border-radius: var(--hub-radius-lg);
  padding: 22px 24px 28px;
  box-shadow: var(--hub-shadow-md);
}

.records-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--hub-border);
}

.records-header h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--hub-ink);
}

.records-refresh {
  height: 38px;
  border: 1px solid var(--hub-border);
  border-radius: var(--hub-radius-sm);
  background: var(--hub-input-bg);
  color: var(--hub-ink);
  font: inherit;
  font-size: 13px;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 650;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.records-refresh:hover {
  background: var(--hub-surface-muted);
}

.records-refresh:focus-visible {
  outline: none;
  box-shadow: var(--hub-focus-ring);
}

.records-loading,
.records-empty,
.records-error {
  color: var(--hub-muted);
  font-weight: 650;
  padding: 12px 0;
}

.records-error {
  color: var(--hub-bad);
}

.records-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.summary-card {
  padding: 10px 12px;
  border: 1px solid var(--hub-border);
  border-radius: var(--hub-radius-sm);
  background: var(--hub-surface-muted);
}

.summary-card span {
  display: block;
  color: var(--hub-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.summary-card strong {
  font-size: 17px;
  font-weight: 800;
  color: var(--hub-ink);
  font-variant-numeric: tabular-nums;
}

.records-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

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

  .records-page {
    padding: 18px 16px 24px;
  }
}

.chart-card {
  border: 1px solid var(--hub-border);
  border-radius: var(--hub-radius-md);
  padding: 16px;
  background: var(--hub-surface);
  min-width: 0;
  box-shadow: var(--hub-shadow-sm);
}

.chart-card h3 {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 800;
  color: var(--hub-ink);
}

.records-graph-host {
  margin-bottom: 10px;
}

.records-graph {
  width: 100%;
}

.records-graph svg {
  width: 100%;
  height: auto;
  display: block;
}

.graph-grid {
  stroke: var(--hub-surface-muted);
  stroke-width: 1;
}

.graph-axis {
  stroke: var(--hub-border);
  stroke-width: 1;
}

.graph-axis-label,
.graph-x-label {
  font-size: 9px;
  fill: var(--hub-muted);
  font-weight: 600;
}

.graph-line {
  fill: none;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.graph-line.shape { stroke: #2563eb; }
.graph-line.deviation { stroke: #059669; }
.graph-line.approximation { stroke: #7c3aed; }
.graph-line.seriesNumber { stroke: #0d9488; }
.graph-line.passageMemory { stroke: #0891b2; }
.graph-line.mentalMath { stroke: #e11d48; }
.graph-line.reactionMatch { stroke: #4f46e5; }
.graph-line.stroop { stroke: #db2777; }
.graph-line.mentalRotation { stroke: #0284c7; }
.graph-line.patternMatrix { stroke: #475569; }
.graph-line.cube { stroke: #d97706; }

.graph-area { opacity: 0.12; }
.graph-area.shape { fill: #2563eb; }
.graph-area.deviation { fill: #059669; }
.graph-area.approximation { fill: #7c3aed; }
.graph-area.seriesNumber { fill: rgba(13, 148, 136, 0.12); }
.graph-area.passageMemory { fill: rgba(8, 145, 178, 0.12); }
.graph-area.mentalMath { fill: rgba(225, 29, 72, 0.12); }
.graph-area.reactionMatch { fill: rgba(79, 70, 229, 0.12); }
.graph-area.stroop { fill: rgba(219, 39, 119, 0.12); }
.graph-area.mentalRotation { fill: rgba(2, 132, 199, 0.12); }
.graph-area.patternMatrix { fill: rgba(71, 85, 105, 0.12); }
.graph-area.cube { fill: #d97706; }

.graph-dot {
  fill: var(--hub-surface);
  stroke-width: 2;
}

.graph-dot.shape { stroke: #2563eb; }
.graph-dot.deviation { stroke: #059669; }
.graph-dot.approximation { stroke: #7c3aed; }
.graph-dot.seriesNumber { stroke: #0d9488; }
.graph-dot.passageMemory { stroke: #0891b2; }
.graph-dot.mentalMath { stroke: #e11d48; }
.graph-dot.reactionMatch { stroke: #4f46e5; }
.graph-dot.stroop { stroke: #db2777; }
.graph-dot.mentalRotation { stroke: #0284c7; }
.graph-dot.patternMatrix { stroke: #475569; }
.graph-dot.cube { stroke: #d97706; }

.graph-caption {
  margin: 4px 0 0;
  font-size: 11px;
  color: var(--hub-muted);
  font-weight: 600;
  text-align: center;
}

.records-table-wrap {
  overflow-x: auto;
}

.records-grid .records-table-wrap:not(.is-empty) {
  border: 1px solid var(--hub-border);
  border-radius: var(--hub-radius-sm);
  overflow: hidden;
}

.records-grid .records-table-wrap:not(.is-empty) .records-table {
  display: block;
  width: 100%;
}

.records-grid .records-table-wrap:not(.is-empty) .records-table thead {
  display: table;
  width: 100%;
  table-layout: fixed;
}

.records-grid .records-table-wrap:not(.is-empty) .records-table tbody {
  display: block;
  max-height: calc(var(--records-row-h) * 5);
  overflow-y: auto;
  overflow-x: auto;
  width: 100%;
}

.records-grid .records-table-wrap:not(.is-empty) .records-table tbody tr {
  display: table;
  width: 100%;
  table-layout: fixed;
}

.records-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  --records-row-h: 1.875rem;
}

.records-table th,
.records-table td {
  height: var(--records-row-h);
  padding: 0 10px;
  text-align: left;
  border-bottom: 1px solid var(--hub-border);
  white-space: nowrap;
  vertical-align: middle;
  box-sizing: border-box;
}

.records-table th {
  color: var(--hub-muted);
  font-weight: 700;
  background: var(--hub-surface-muted);
}

.records-table td {
  font-weight: 650;
  color: var(--hub-ink);
}

.chart-empty {
  color: var(--hub-muted);
  font-size: 14px;
  font-weight: 650;
  margin: 0 0 12px;
}
