/* ===== Records Layout ===== */
.records-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ===== Chart Container ===== */
.chart-box {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.chart-box__title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.chart-box canvas {
  width: 100% !important;
  max-height: 200px;
}

/* ===== Ranking ===== */
.ranking {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.ranking__title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.ranking__empty {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ===== Cumulative Stats ===== */
.cumulative-stats {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.cumulative-stats__title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.cumulative-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.cumulative-item {
  text-align: center;
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
}

.cumulative-item__value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent);
}

.cumulative-item__label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ===== Per-Kana Stats Table ===== */
.kana-stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.kana-stats-table th {
  background: var(--bg-secondary);
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 8px 6px;
  text-align: center;
  white-space: nowrap;
}

.kana-stats-table td {
  padding: 6px;
  text-align: center;
  border-top: 1px solid var(--border-light);
  vertical-align: middle;
}

.kana-stats-table__img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  filter: var(--kana-filter, none);
}

[data-theme="dark"] .kana-stats-table__img {
  filter: invert(1) hue-rotate(180deg);
}

.kana-sort-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

/* ===== Sync Status ===== */
.sync-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 4px 0;
}

.sync-status__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}

.sync-status__dot--syncing {
  background: var(--warning, #f59e0b);
  animation: syncPulse 1s infinite;
}

.sync-status__dot--success {
  background: var(--success, #22c55e);
}

.sync-status__dot--error {
  background: var(--danger, #ef4444);
}

@keyframes syncPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.sync-setup-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sync-setup-card .form-input {
  width: 100%;
  font-size: 0.85rem;
}
