:root { color-scheme: dark; font: 17px/1.5 system-ui, sans-serif; background: #111216; color: #f4eee4; }
body { margin: 0 auto; max-width: 64rem; padding: 1.25rem; }
header, .toolbar, li { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem; }
header { border-bottom: 1px solid #57472d; }
h1, a { color: #edd19b; }
button, input, select { font: inherit; color: inherit; background: #222329; border: 1px solid #8b744d; border-radius: .4rem; padding: .45rem .7rem; min-height: 44px; box-sizing: border-box; }
button[aria-pressed="true"] { background: #edd19b; color: #1d1711; }
:focus-visible { outline: 2px solid #f8d493; outline-offset: 3px; }
ul { padding: 0; list-style: none; }
li { border-bottom: 1px solid #3c3429; padding: .75rem 0; }
li a { flex: 1 0 10rem; }
details { margin-top: 2rem; }
[hidden] { display: none !important; }
@media (max-width: 520px) {
  body { padding: .85rem; }
  .toolbar { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
  .toolbar label:first-child { grid-column: 1 / -1; }
  .toolbar label input, .toolbar label select { width: 100%; }
  li a { flex-basis: 100%; font-weight: 650; }
  li button { font-size: .875rem; }
}

.favorite-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill,minmax(min(100%,290px),1fr));
  gap: .55rem;
}
.favorite-grid li {
  --poster-width: clamp(76px,24vw,100px);
  display: grid;
  grid-template-columns: var(--poster-width) minmax(0,1fr);
  grid-template-areas: "art title" "art actions";
  grid-template-rows: 2.5rem auto;
  column-gap: .65rem;
  align-items: start;
  position: relative;
  min-width: 0;
  padding: .55rem;
  background: #202128;
  border: 1px solid #514630;
  border-radius: 8px;
}
.favorite-grid.with-viewing-data li {
  grid-template-areas: "art title" "art meta" "art actions";
  grid-template-rows: 2.5rem 2.55rem auto;
}
.favorite-grid li > a {
  grid-area: title;
  padding-right: .9rem;
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.22;
  text-decoration: none;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.favorite-grid li > a:hover { text-decoration: underline; }
.favorite-art {
  grid-area: art;
  width: var(--poster-width);
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 4px;
  background: #17181e;
}
.favorite-art img { display: block; width: 100%; height: 100%; object-fit: contain; }
.favorite-meta {
  grid-area: meta;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  grid-template-areas: "next update" "progress progress";
  align-content: start;
  column-gap: .2rem;
  min-width: 0;
}
.favorite-meta .favorite-next { grid-area: next; }
.favorite-meta .favorite-update { grid-area: update; color: #9decb9; }
.favorite-meta .favorite-progress { grid-area: progress; }
.favorite-meta > span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: .7rem; }
.favorite-meta progress { display: block; width: 100%; height: .25rem; accent-color: #e4bd77; }
.favorite-meta.favorite-has-update::after {
  content: '';
  position: absolute;
  top: .84rem;
  right: .6rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #65da95;
}
.favorite-actions {
  grid-area: actions;
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: .16rem;
  align-self: end;
}
.favorite-actions button {
  min-width: 0;
  position: relative;
  isolation: isolate;
  padding: 0 .2rem;
  font-size: .7rem;
  line-height: 1.1;
  min-height: 38px;
  border: 0;
  background: transparent;
}
.favorite-actions button::before {
  content: '';
  position: absolute;
  inset: 5px 1px;
  z-index: -1;
  background: #24252c;
  border: 1px solid #66553b;
  border-radius: 4px;
}
.favorite-actions button[aria-pressed="true"] { background: transparent; color: #1d1711; }
.favorite-actions button[aria-pressed="true"]::before { background: #edd19b; border-color: #edd19b; }
.favorite-actions button[data-action="watched"] { grid-column: 2; grid-row: 2; }
#credits{font-size:.75rem;color:#d1c7b9}

#series-detail h2 { margin-bottom: .25rem; }
#series-detail select { margin: .6rem 0 0; }
.episode-list li { min-height: 44px; padding: .45rem 0; }
.episode-list li a { flex: 1 1 0; min-width: 0; }
.episode-tick { color: #89e5a5; width: 1.5rem; text-align: center; flex: none; }
.episode-list .episode-next { border-left: 2px solid #e4bd77; padding-left: .5rem; }

.favorite-art { position: relative; }
.ororo-series-status {
  position: absolute;
  bottom: .2rem;
  left: .2rem;
  padding: .12rem .2rem;
  border-radius: 3px;
  background: #17181e;
  color: #f4e7ce;
  font-size: .57rem;
  line-height: 1.2;
}
.series-metadata { margin: .25rem 0; }
