body[data-page="history"] .history-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: 22px 14px;
}

body[data-page="history"] .history-list .hrow {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transition: transform 120ms ease;
}

body[data-page="history"] .history-list .hrow:hover {
  transform: translateY(-2px);
}

body[data-page="history"] .history-list .hrow:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

body[data-page="history"] .history-list .history-card-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  min-height: 0;
  overflow: hidden;
  border-radius: 10px;
  background: var(--surface);
}

body[data-page="history"] .history-list .history-card-thumb .th {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  border-radius: 0;
  object-fit: cover;
}

body[data-page="history"] .history-list .history-card-thumb .nf {
  display: grid;
  place-items: center;
  font-size: 36px;
}

body[data-page="history"] .history-list .hrow .body {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 10px 0 0;
}

body[data-page="history"] .history-list .hrow .nm {
  display: -webkit-box;
  min-height: calc(1.4em * 2);
  max-height: calc(1.4em * 2);
  margin: 0;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.4;
  letter-spacing: 0;
  white-space: normal;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

body[data-page="history"] .history-list .hrow .ch,
body[data-page="history"] .history-list .hrow .dt {
  min-width: 0;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

body[data-page="history"] .history-list .hrow .ch + .dt::before {
  content: none;
}

body[data-page="history"] .history-list .history-card-stats {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

body[data-page="history"] .history-list .history-card-stat {
  display: grid;
  gap: 5px;
}

body[data-page="history"] .history-list .history-card-stat-heading {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
}

body[data-page="history"] .history-list .history-card-stat-label {
  color: var(--muted);
}

body[data-page="history"] .history-list .history-card-stat-value {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

body[data-page="history"] .history-list .history-card-stat-track {
  display: block;
  height: 4px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}

body[data-page="history"] .history-list .history-card-stat-fill {
  display: block;
  height: 100%;
  background: var(--accent);
}

body[data-page="history"] .history-list .history-card-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

body[data-page="history"] .history-list .history-card-chip {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

body[data-page="history"] .history-list > .empty,
body[data-page="history"] .history-list > .more {
  grid-column: 1 / -1;
}


body[data-page="history"] .wrap {
  width: min(1600px, calc(100vw - 48px));
  max-width: none;
  margin: 0 auto;
  padding: 28px 0 48px;
}

body[data-page="history"] .head {
  position: static;
  gap: 14px;
  padding: 0 0 24px;
  border: 0;
  background: transparent;
}

body[data-page="history"] .head .sub { word-break: keep-all; }

body[data-page="history"] .history-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 12px;
}

body[data-page="history"] .history-actions button { flex: none; }

body[data-page="history"] .history-controls {
  display: grid;
  gap: 22px;
  margin-bottom: 26px;
}

body[data-page="history"] [hidden] { display: none !important; }

body[data-page="history"] .history-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
}

body[data-page="history"] .find {
  flex: 1;
  margin: 0;
  padding: 0;
}

body[data-page="history"] .find input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  height: 44px;
  padding: 0 16px;
  font: inherit;
}

body[data-page="history"] .history-channel,
body[data-page="history"] .history-controls button,
body[data-page="history"] .history-actions button {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

body[data-page="history"] .history-channel,
body[data-page="history"] .history-toolbar button,
body[data-page="history"] .history-actions button {
  height: 44px;
  padding: 0 14px;
  font-size: 16px;
}

body[data-page="history"] .history-channel { flex: 0 1 240px; min-width: 0; }

body[data-page="history"] .history-range {
  display: grid;
  gap: 14px;
  max-width: 480px;
  font-size: 13px;
}

body[data-page="history"] .history-range output {
  margin-left: 12px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

body[data-page="history"] .history-range-inputs { position: relative; height: 24px; }
body[data-page="history"] .history-range-track { position: absolute; inset: 10px 0; height: 4px; background: var(--line); border-radius: 4px; }
body[data-page="history"] .history-range-fill { position: absolute; height: 100%; left: 0; width: 100%; background: var(--accent); }
body[data-page="history"] .history-range input { position: absolute; inset: 0; width: 100%; height: 24px; margin: 0; background: transparent; appearance: none; pointer-events: none; }
body[data-page="history"] .history-range input::-webkit-slider-thumb { appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--accent); pointer-events: auto; cursor: pointer; }
body[data-page="history"] .history-range input::-moz-range-thumb { width: 16px; height: 16px; border: 0; border-radius: 50%; background: var(--accent); pointer-events: auto; cursor: pointer; }
body[data-page="history"] .history-range input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

body[data-page="history"] .history-sort { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
body[data-page="history"] .history-sort button { border-radius: 999px; font-size: 12px; }
body[data-page="history"] .history-sort button[aria-pressed="true"] { color: var(--bg); border-color: var(--accent); background: var(--accent); }
body[data-page="history"] .history-sort button[aria-pressed="true"]::after { content: " ↓"; }
body[data-page="history"] .history-sort button[data-direction="asc"]::after { content: " ↑"; }
body[data-page="history"] .history-count { margin-left: auto; color: var(--muted); font-size: 13px; }
body[data-page="history"] .history-list { padding: 0; }
body[data-page="history"] .sync { margin: 0 0 16px; padding: 0; }

@media (max-width: 760px) {
  body[data-page="history"] .wrap { width: min(calc(100vw - 28px), 720px); padding-top: 20px; overflow-x: visible; }
  body[data-page="history"] .head { gap: 8px; }
  body[data-page="history"] .history-toolbar { flex-wrap: wrap; }
  body[data-page="history"] .find { flex-basis: 100%; }
  body[data-page="history"] .history-channel { flex: 1; min-width: 0; }
  body[data-page="history"] .history-range { max-width: none; }
  body[data-page="history"] .history-actions span { font-size: 11px; }
  body[data-page="history"] .history-range input { top: -10px; bottom: auto; left: -14px; right: auto; width: calc(100% + 28px); height: 44px; }
  body[data-page="history"] .history-range input::-webkit-slider-thumb { box-sizing: border-box; width: 44px; height: 44px; border: 14px solid transparent; background-clip: content-box; }
  body[data-page="history"] .history-range input::-moz-range-thumb { box-sizing: border-box; width: 44px; height: 44px; border: 14px solid transparent; background-clip: content-box; }
}
