﻿/* History owns content only; shell and preference controls retain their shared owners. */
.media-history-page .media-history {
  padding: 24px;
  max-width: 1200px;
  margin-inline: auto;
}
.media-history-page .media-history-heading,
.media-history-page .media-history-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.media-history-page .media-history-note,
.media-history-page time,
.media-history-page .media-history-empty {
  color: var(--text-muted);
}
.media-history-page .media-history-actions {
  margin-block: 20px;
  min-block-size: 1.5em; /* Reserve the count line before local history loads. */
}
.media-history-page .media-history-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
}
.media-history-page h2 {
  font-size: 22px;
  color: var(--accent-primary);
  border-bottom: 1px solid var(--line-subtle);
  padding-bottom: 12px;
}
.media-history-page h2 span {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 400;
}
.media-history-page .media-history-entry {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line-subtle);
}
.media-history-page .media-history-link {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}
.media-history-page h3 {
  font-size: 18px;
  color: var(--accent-primary);
  margin: 0;
  overflow-wrap: anywhere;
}
.media-history-page .media-history-link:hover h3 {
  text-decoration: underline;
}
.media-history-page time,
.media-history-page .media-history-position {
  font-size: 14px;
}
.media-history-page progress {
  display: block;
  width: 100%;
  height: 5px;
  direction: ltr;
  accent-color: #e52222;
  border: 0;
  background: var(--line-subtle);
  border-radius: 4px;
  overflow: hidden;
}
.media-history-page progress::-webkit-progress-bar {
  background: var(--line-subtle);
}
.media-history-page progress::-webkit-progress-value {
  background: #e52222;
}
.media-history-page progress::-moz-progress-bar {
  background: #e52222;
}
.media-history-page [hidden] {
  display: none;
}
@media (max-width: 700px) {
  .media-history-page .media-history-columns {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
  .media-history-page .media-history {
    padding: 16px 12px;
  }
}

.media-history-page .media-history-entry-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}
.media-history-page .media-history-play {
  display: inline-flex;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  box-sizing: border-box;
  padding: 9px;
  border-radius: 8px;
  box-shadow: none;
}
.media-history-page .media-history-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.media-history-page .media-history-remove svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}
.media-history-page .media-history-remove:hover {
  background: var(--surface-interactive);
  color: var(--accent-primary);
}
.media-history-page .media-history-remove:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.media-history-page .media-history {
  padding-block-start: 0;
}

.media-history-paging {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-block: 20px;
}

/* Round return action follows the Study PDF share control's 40px geometry. */
.media-history-navigation { display: flex; align-items: center; gap: 12px; padding-block-start: 8px; }
.media-history-navigation .media-section-nav { flex: 1; padding-block-start: 0; min-width: 0; }
.media-history-navigation .media-back { width: 40px; height: 40px; min-height: 40px; flex: 0 0 40px; border-radius: 50%; padding: 7px; box-sizing: border-box; }
