.viewing-history {
  max-width: 1200px;
  margin: 0 auto 2em;
  padding: 0 1em;
}

.viewing-history-page {
  padding: 0;
}

.viewing-history-empty {
  background: #f5f9fc;
  border: 1px solid #dce8f2;
  border-radius: 6px;
  color: #6f7e88;
  margin: 0;
  padding: 1em;
}

.viewing-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1em;
  margin-bottom: 0.85em;
}

.viewing-history h2 {
  margin: 0;
  font-size: 1.25em;
  font-weight: 700;
}

.viewing-history-clear {
  border: 0;
  background: transparent;
  color: #357abd;
  cursor: pointer;
  font: inherit;
  padding: 0.2em 0;
}

.viewing-history-clear:hover {
  text-decoration: underline;
}

.viewing-history-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75em;
  list-style: none;
  margin: 0;
  padding: 0;
}

.viewing-history-card {
  align-items: center;
  background: #fff;
  border: 1px solid #dce8f2;
  border-radius: 6px;
  color: inherit;
  display: flex;
  gap: 0.75em;
  min-height: 76px;
  padding: 0.75em;
  text-decoration: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.viewing-history-card:hover {
  border-color: #6bb7e8;
  box-shadow: 0 3px 10px rgba(52, 116, 168, 0.15);
}

.viewing-history-image,
.viewing-history-fallback {
  border-radius: 4px;
  flex: 0 0 52px;
  height: 52px;
  width: 52px;
}

.viewing-history-image {
  object-fit: contain;
}

.viewing-history-fallback {
  align-items: center;
  background: #eef7fc;
  color: #3598d8;
  display: flex;
  font-size: 1.5em;
  justify-content: center;
}

.viewing-history-text {
  display: flex;
  flex-direction: column;
  gap: 0.2em;
  min-width: 0;
}

.viewing-history-title {
  color: #20445e;
  font-weight: 700;
  line-height: 1.35;
}

.viewing-history-category {
  color: #6f7e88;
  font-size: 0.85em;
  line-height: 1.3;
}

@media screen and (max-width: 736px) {
  .viewing-history {
    padding: 0 1.25em;
  }

  .viewing-history-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.35em;
  }

  .viewing-history-list {
    grid-template-columns: 1fr;
  }
}
