#history-nav[aria-current="page"] { color: var(--accent); background: rgb(255 255 255 / 8%); }
.history-section { padding: 32px var(--gutter) 72px; }
.history-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.history-heading { font-size: 30px; line-height: 1.2; }
.history-header-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.history-count, .history-storage { color: var(--muted); font-size: 13px; }
.history-storage { margin-bottom: 20px; }
.history-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px 18px; }
.history-card { position: relative; min-width: 0; scroll-snap-align: start; }
.history-play { position: relative; border-radius: 4px; }
.history-card .poster-frame { aspect-ratio: 16 / 9; }
.history-card .history-portrait { object-fit: contain; background: var(--surface); }
.history-card .poster-fallback { font-size: 16px; }
.history-play .poster-affordance { opacity: 1; background: rgb(0 0 0 / 12%); }
.history-play:hover .poster-affordance, .history-play:focus-visible .poster-affordance { background: rgb(0 0 0 / 36%); }
.history-play .poster-affordance .lucide { width: 42px; height: 42px; }
.history-play .card-title { padding-right: 4px; }
.history-progress { display: block; width: 100%; height: 4px; border: 0; border-radius: 0; appearance: none; background: var(--border); accent-color: var(--accent); }
.history-progress::-webkit-progress-bar { background: var(--border); }
.history-progress::-webkit-progress-value { background: var(--accent); }
.history-progress::-moz-progress-bar { background: var(--accent); }
.history-episode { color: var(--text); font-size: 13px; margin-top: 7px; line-height: 1.5; overflow-wrap: anywhere; }
.history-footer { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 6px; }
.history-timing { display: grid; gap: 3px; min-width: 0; color: var(--muted); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.history-actions { display: flex; flex-shrink: 0; }
.history-actions .icon-button { width: 40px; height: 40px; }
.history-actions .lucide { width: 18px; height: 18px; }
.history-continue { padding-top: 10px; }
.history-continue .shelf-track { grid-auto-columns: minmax(230px, 24%); }
.history-empty { display: grid; justify-items: center; gap: 18px; padding: 72px 16px; color: var(--muted); text-align: center; }
.history-empty > .lucide { width: 40px; height: 40px; }
.history-empty .button { margin-top: 6px; }
@media (min-width: 1600px) { .history-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .history-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .history-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 14px; }
  .history-heading { font-size: 26px; }
  .history-header { gap: 10px; }
  .history-header-actions { gap: 6px; }
  .history-continue .shelf-track { grid-auto-columns: minmax(220px, 64%); }
}
@media (max-width: 440px) {
  .history-grid { grid-template-columns: minmax(0, 1fr); }
  .history-heading { font-size: 24px; }
  .history-header-actions { flex-shrink: 1; }
  .history-count { display: none; }
  .history-continue .shelf-track { grid-auto-columns: minmax(210px, 82%); }
  #history-nav { width: 40px; height: 40px; }
  .search-tools:has(#search-form:not([hidden])) { flex-basis: 100%; }
}
