/* AnimeRadar v2.4.194 - Material 3 layout for the Anime News and Toplisten routes. */

/* -------------------------------------------------------------------------- */
/* Anime News (#view-news) - desktop golden master                            */
/*                                                                            */
/* Board: page header, filter bar, one featured story, a four column grid of  */
/* further stories and a load-more control. Every selector stays scoped to    */
/* #view-news so the shared page shell, sidebar and other routes are not      */
/* touched. All content comes from the existing /api/news feed payload.       */
/* -------------------------------------------------------------------------- */

html body #view-news {
  --md-primary: #e53949;
  --md-action-fill: #d43544;
  --md-secondary: #ff5c6b;
  --md-primary-container: #3a0d12;
  --md-background: #120f13;
  --md-surface: #241618;
  --md-surface-variant: #1b1013;
  --md-surface-elevated: #2c1a1e;
  --md-outline: #3a262c;
  --md-outline-strong: #55303a;
  --md-on-surface: #ece6e9;
  --news-radius: 12px;
  --news-gap: 16px;
  --red: var(--md-primary);
  --red-2: var(--md-primary-container);
  --gold: var(--md-secondary);
  --line: var(--md-outline);
}

/* Sichtbarkeit bleibt bei der zentralen View-Logik aus styles-v2-4-141.css
   (`.view { display: none }` / `.view.active { display: block }`). Hier wird
   ausschliesslich die aktive News-View auf Spaltenfluss gestellt - niemals
   ein `display` auf `#view-news` ohne `.active`, sonst stuende die News-Seite
   unter jeder anderen View. */
html body #view-news.active {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* -- Page header ----------------------------------------------------------- */

html body #view-news .anime-news-page-title {
  align-items: flex-end !important;
  gap: 16px 24px !important;
  margin: 0 0 18px !important;
  padding: 0 !important;
  border: 0 !important;
}

html body #view-news .anime-news-page-title h2 {
  margin: 0 !important;
  font-size: 30px !important;
  line-height: 1.16 !important;
  font-weight: 680 !important;
  letter-spacing: -.02em !important;
}

html body #view-news .anime-news-page-title p {
  margin: 7px 0 0 !important;
  color: var(--md-muted) !important;
  font-size: 13.5px !important;
  line-height: 1.45 !important;
}

html body #view-news .anime-news-title-actions {
  display: flex !important;
  align-items: center !important;
  gap: 14px !important;
  padding-bottom: 3px !important;
}

html body #view-news .anime-news-page-meta {
  color: var(--md-dim) !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  white-space: nowrap !important;
}

html body #view-news .anime-news-refresh {
  height: 36px !important;
  padding: 0 18px !important;
  border: 0 !important;
  border-radius: 9px !important;
  background: var(--md-action-fill) !important;
  color: var(--md-on-primary) !important;
  font-size: 13px !important;
  font-weight: 620 !important;
}

html body #view-news .anime-news-refresh:hover:not(:disabled) {
  background: var(--md-secondary) !important;
}

/* -- Filter bar ------------------------------------------------------------ */

html body #view-news .anime-news-filter-bar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: wrap !important;
  gap: 10px 12px !important;
  margin: 0 0 22px !important;
}

html body #view-news .anime-news-filter-lead {
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
  min-width: 0 !important;
}

html body #view-news .anime-news-quickfilters {
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
  min-width: 0 !important;
}

html body #view-news .anime-news-select {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  width: 148px !important;
  min-width: 0 !important;
  height: 34px !important;
  border: 0 !important;
  background: transparent !important;
}

html body #view-news .anime-news-select:has(#newsSourceFilter) {
  width: 126px !important;
}

/* Die bestehende AnimeRadar-Select-Komponente wird wiederverwendet und nur
   auf die Board-Geometrie gebracht - kein zweites Dropdown-System. */
html body #view-news .anime-news-select .ar-select {
  width: 100% !important;
}

html body #view-news .anime-news-select .ar-select-btn {
  width: 100% !important;
  min-height: 34px !important;
  height: 34px !important;
  padding: 0 !important;
  border: 1px solid var(--md-outline) !important;
  border-radius: 9px !important;
  background: var(--md-surface) !important;
  color: var(--md-on-surface) !important;
  grid-template-columns: minmax(0, 1fr) 28px !important;
  box-shadow: none !important;
}

html body #view-news .anime-news-select .ar-select-btn:hover,
html body #view-news .anime-news-select .ar-select.is-open .ar-select-btn {
  border-color: var(--md-outline-strong) !important;
  background: var(--md-surface-elevated) !important;
}

html body #view-news .anime-news-select .ar-select-text {
  padding: 0 0 0 13px !important;
  font-size: 12.5px !important;
  font-weight: 560 !important;
  letter-spacing: 0 !important;
}

html body #view-news .anime-news-select .ar-select-arrow {
  border-left: 0 !important;
  background: transparent !important;
}

html body #view-news .anime-news-select .ar-select-arrow::before {
  width: 6px !important;
  height: 6px !important;
  border-right: 1.6px solid var(--md-muted) !important;
  border-bottom: 1.6px solid var(--md-muted) !important;
}

html body #view-news .anime-news-select .ar-select-menu {
  border-radius: 10px !important;
  font-size: 12.5px !important;
}

html body #view-news .anime-news-select .ar-select-option {
  border-radius: 7px !important;
  font-size: 12.5px !important;
}

html body #view-news .anime-news-select.is-primary .ar-select-btn,
html body #view-news .anime-news-select.is-active .ar-select-btn {
  border-color: var(--md-primary) !important;
  background: color-mix(in srgb, var(--md-primary) 15%, var(--md-surface)) !important;
  color: var(--md-secondary) !important;
}

html body #view-news .anime-news-select.is-primary .ar-select-arrow::before,
html body #view-news .anime-news-select.is-active .ar-select-arrow::before {
  border-right-color: var(--md-secondary) !important;
  border-bottom-color: var(--md-secondary) !important;
}

html body #view-news .anime-news-chip {
  display: inline-flex !important;
  align-items: center !important;
  height: 34px !important;
  max-width: 190px !important;
  margin: 0 !important;
  padding: 0 14px !important;
  border: 1px solid var(--md-outline) !important;
  border-radius: 9px !important;
  background: var(--md-surface) !important;
  color: var(--md-on-surface) !important;
  font-family: inherit !important;
  font-size: 12.5px !important;
  font-weight: 560 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  cursor: pointer !important;
  transition: border-color .18s var(--md-motion), background .18s var(--md-motion), color .18s var(--md-motion) !important;
}

html body #view-news .anime-news-chip:hover {
  border-color: var(--md-outline-strong) !important;
  background: var(--md-surface-elevated) !important;
}

html body #view-news .anime-news-chip.is-active {
  border-color: var(--md-primary) !important;
  background: color-mix(in srgb, var(--md-primary) 18%, var(--md-surface)) !important;
  color: var(--md-secondary) !important;
}

html body #view-news .anime-news-sort {
  margin-left: auto !important;
}

/* -- Category badge -------------------------------------------------------- */

html body #view-news .anime-news-badge {
  display: inline-flex !important;
  align-items: center !important;
  align-self: flex-start !important;
  flex: 0 0 auto !important;
  height: 21px !important;
  padding: 0 9px !important;
  border-radius: 6px !important;
  background: color-mix(in srgb, var(--news-tone, var(--md-primary)) 20%, transparent) !important;
  color: var(--news-tone, var(--md-secondary)) !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  letter-spacing: .07em !important;
  line-height: 1 !important;
  text-transform: uppercase !important;
  white-space: nowrap !important;
  max-width: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

html body #view-news .anime-news-badge[data-tone="1"] { --news-tone: #ff5c6b; }
html body #view-news .anime-news-badge[data-tone="2"] { --news-tone: #b07cf0; }
html body #view-news .anime-news-badge[data-tone="3"] { --news-tone: #5b9cf6; }
html body #view-news .anime-news-badge[data-tone="4"] { --news-tone: #6dc48f; }
html body #view-news .anime-news-badge[data-tone="5"] { --news-tone: #e8964a; }
html body #view-news .anime-news-badge[data-tone="6"] { --news-tone: #d9be55; }

/* -- Byline ---------------------------------------------------------------- */

html body #view-news .anime-news-byline {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  min-width: 0 !important;
}

html body #view-news .anime-news-avatar {
  display: grid !important;
  place-items: center !important;
  flex: 0 0 auto !important;
  width: 22px !important;
  height: 22px !important;
  border-radius: 50% !important;
  background: color-mix(in srgb, var(--md-primary) 30%, var(--md-surface-elevated)) !important;
  color: var(--md-on-surface) !important;
  font-size: 10px !important;
  font-style: normal !important;
  font-weight: 700 !important;
  line-height: 1 !important;
}

html body #view-news .anime-news-byline b {
  color: var(--md-on-surface) !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

html body #view-news .anime-news-byline time {
  color: var(--md-dim) !important;
  font-size: 11.5px !important;
  font-weight: 500 !important;
  white-space: nowrap !important;
}

/* -- Icon actions ---------------------------------------------------------- */

html body #view-news .anime-news-icon-btn {
  display: grid !important;
  place-items: center !important;
  flex: 0 0 auto !important;
  width: 34px !important;
  height: 34px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 1px solid var(--md-outline) !important;
  border-radius: 9px !important;
  background: transparent !important;
  color: var(--md-muted) !important;
  cursor: pointer !important;
  transition: border-color .18s var(--md-motion), color .18s var(--md-motion), background .18s var(--md-motion) !important;
}

html body #view-news .anime-news-icon-btn svg {
  width: 16px !important;
  height: 16px !important;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 1.7 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}

html body #view-news .anime-news-featured .anime-news-icon-btn svg {
  fill: none !important;
}

html body #view-news .anime-news-icon-btn:hover,
html body #view-news .anime-news-icon-btn:focus-visible {
  border-color: var(--md-primary) !important;
  color: var(--md-secondary) !important;
  background: color-mix(in srgb, var(--md-primary) 12%, transparent) !important;
}

/* -- Featured story -------------------------------------------------------- */

html body #view-news .anime-news-featured-host {
  min-width: 0 !important;
}

html body #view-news .anime-news-featured {
  display: grid !important;
  grid-template-columns: minmax(0, 41.6%) minmax(0, 1fr) !important;
  grid-template-rows: minmax(0, 1fr) !important;
  height: 235px !important;
  min-height: 235px !important;
  margin: 0 0 26px !important;
  border: 1px solid var(--md-outline) !important;
  border-radius: var(--news-radius) !important;
  background: var(--md-surface) !important;
  overflow: hidden !important;
  cursor: pointer !important;
  transition: border-color .2s var(--md-motion), box-shadow .2s var(--md-motion) !important;
}

html body #view-news .anime-news-featured:hover,
html body #view-news .anime-news-featured:focus-within {
  border-color: var(--md-outline-strong) !important;
  box-shadow: var(--md-elevation-3) !important;
}

html body #view-news .anime-news-featured-media {
  position: relative !important;
  height: 100% !important;
  min-height: 0 !important;
  background: var(--md-surface-variant) !important;
  overflow: hidden !important;
}

/* Die Bilder liegen absolut im Medienfeld, damit ihre echten Seitenverhaeltnisse
   die Kartenhoehe des Boards nicht auseinanderziehen. */
html body #view-news .anime-news-featured-image,
html body #view-news .anime-news-card-image,
html body #view-news :where(.anime-news-featured-media, .anime-news-card-media) .anime-news-image-fallback {
  position: absolute !important;
  inset: 0 !important;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

html body #view-news .anime-news-featured-copy {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 0 !important;
  min-width: 0 !important;
  padding: 22px 26px 20px !important;
  overflow: hidden !important;
}

html body #view-news .anime-news-featured-copy h3 {
  margin: 6px 0 0 !important;
  font-size: 25px !important;
  line-height: 1.26 !important;
  font-weight: 660 !important;
  letter-spacing: -.015em !important;
}

html body #view-news .anime-news-featured-title {
  display: -webkit-box !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: var(--md-on-surface) !important;
  font: inherit !important;
  text-align: left !important;
  cursor: pointer !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 2 !important;
  overflow: hidden !important;
}

html body #view-news .anime-news-featured-title:hover,
html body #view-news .anime-news-featured-title:focus-visible {
  color: var(--md-secondary) !important;
}

html body #view-news .anime-news-featured-copy p {
  display: -webkit-box !important;
  margin: 6px 0 0 !important;
  color: var(--md-muted) !important;
  font-size: 13px !important;
  line-height: 1.5 !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 2 !important;
  overflow: hidden !important;
}

html body #view-news .anime-news-featured-foot {
  display: flex !important;
  align-items: flex-end !important;
  justify-content: space-between !important;
  gap: 16px !important;
  width: 100% !important;
  margin-top: auto !important;
  padding-top: 14px !important;
}

html body #view-news .anime-news-featured-tools,
html body #view-news .anime-news-detail-tools {
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px !important;
}

html body #view-news .anime-news-featured .anime-news-icon-btn {
  width: 36px !important;
  height: 36px !important;
  border-radius: 10px !important;
}

html body #view-news .anime-news-featured .anime-news-byline b {
  font-size: 12.5px !important;
}

html body #view-news .anime-news-featured .anime-news-byline time {
  font-size: 12.5px !important;
}

html body #view-news .anime-news-featured .anime-news-avatar {
  width: 26px !important;
  height: 26px !important;
  font-size: 11px !important;
}

/* -- "Weitere News" grid --------------------------------------------------- */

html body #view-news .anime-news-more-head {
  margin: 0 0 14px !important;
}

html body #view-news .anime-news-more-head h3 {
  margin: 0 !important;
  font-size: 17px !important;
  line-height: 1.2 !important;
  font-weight: 640 !important;
}

html body #view-news .anime-news-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: var(--news-gap) !important;
  align-items: stretch !important;
  min-width: 0 !important;
}

html body #view-news .anime-news-grid > :where(.empty-state, .ui-state-card) {
  grid-column: 1 / -1 !important;
}

html body #view-news .anime-news-card {
  display: grid !important;
  grid-template-columns: 124px minmax(0, 1fr) !important;
  grid-template-rows: minmax(0, 1fr) !important;
  height: 155px !important;
  min-height: 155px !important;
  border: 1px solid var(--md-outline) !important;
  border-radius: var(--news-radius) !important;
  background: var(--md-surface) !important;
  overflow: hidden !important;
  cursor: pointer !important;
  transition: border-color .2s var(--md-motion), box-shadow .2s var(--md-motion), transform .2s var(--md-motion) !important;
}

html body #view-news .anime-news-card:hover,
html body #view-news .anime-news-card:focus-within {
  border-color: var(--md-outline-strong) !important;
  box-shadow: var(--md-elevation-3) !important;
  transform: translateY(-2px) !important;
}

html body #view-news .anime-news-card-media {
  position: relative !important;
  min-height: 0 !important;
  height: 100% !important;
  background: var(--md-surface-variant) !important;
  overflow: hidden !important;
}

html body #view-news .anime-news-card-copy {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 0 !important;
  min-width: 0 !important;
  padding: 12px 13px 10px !important;
  overflow: hidden !important;
}

html body #view-news .anime-news-card-copy .anime-news-badge {
  height: 18px !important;
  padding: 0 8px !important;
  font-size: 9.5px !important;
}

html body #view-news .anime-news-card-copy h3 {
  margin: 7px 0 0 !important;
  font-size: 13px !important;
  line-height: 1.3 !important;
  font-weight: 640 !important;
  letter-spacing: -.005em !important;
}

html body #view-news .anime-news-card-title {
  display: -webkit-box !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: var(--md-on-surface) !important;
  font: inherit !important;
  text-align: left !important;
  cursor: pointer !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 2 !important;
  overflow: hidden !important;
}

html body #view-news .anime-news-card-title:hover,
html body #view-news .anime-news-card-title:focus-visible {
  color: var(--md-secondary) !important;
}

html body #view-news .anime-news-card-copy p {
  display: -webkit-box !important;
  margin: 6px 0 0 !important;
  color: var(--md-muted) !important;
  font-size: 11px !important;
  line-height: 1.45 !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 2 !important;
  overflow: hidden !important;
}

html body #view-news .anime-news-card-foot {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  width: 100% !important;
  margin-top: auto !important;
  padding-top: 6px !important;
}

html body #view-news .anime-news-card-foot .anime-news-byline {
  gap: 7px !important;
}

html body #view-news .anime-news-card-foot .anime-news-avatar {
  width: 18px !important;
  height: 18px !important;
  font-size: 9px !important;
}

html body #view-news .anime-news-card-foot .anime-news-byline b,
html body #view-news .anime-news-card-foot .anime-news-byline time {
  font-size: 10.5px !important;
}

html body #view-news .anime-news-card-foot .anime-news-icon-btn {
  width: 24px !important;
  height: 24px !important;
  border-color: transparent !important;
  border-radius: 8px !important;
}

html body #view-news .anime-news-card-foot .anime-news-icon-btn svg {
  width: 14px !important;
  height: 14px !important;
}

/* -- Image fallback -------------------------------------------------------- */

html body #view-news .anime-news-image-fallback {
  width: 100% !important;
  height: 100% !important;
  display: grid !important;
  place-items: center !important;
  background:
    radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--md-primary) 26%, transparent), transparent 62%),
    var(--md-surface-variant) !important;
}

html body #view-news .anime-news-image-fallback span {
  display: grid !important;
  place-items: center !important;
  width: 44px !important;
  height: 44px !important;
  border: 2px solid color-mix(in srgb, var(--md-primary) 55%, transparent) !important;
  border-radius: 50% !important;
  color: var(--md-secondary) !important;
  font-family: var(--font-display) !important;
  font-size: 15px !important;
  font-weight: 700 !important;
}

/* -- Load more ------------------------------------------------------------- */

html body #view-news .anime-news-loadmore-row {
  display: flex !important;
  justify-content: center !important;
  margin: 26px 0 0 !important;
}

html body #view-news .anime-news-loadmore {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  width: min(242px, 100%) !important;
  height: 38px !important;
  margin: 0 !important;
  padding: 0 20px !important;
  border: 1px solid color-mix(in srgb, var(--md-primary) 55%, transparent) !important;
  border-radius: 10px !important;
  background: color-mix(in srgb, var(--md-primary) 13%, transparent) !important;
  color: var(--md-secondary) !important;
  font-family: inherit !important;
  font-size: 13px !important;
  font-weight: 640 !important;
  cursor: pointer !important;
  transition: background .18s var(--md-motion), border-color .18s var(--md-motion) !important;
}

html body #view-news .anime-news-loadmore:hover {
  border-color: var(--md-primary) !important;
  background: color-mix(in srgb, var(--md-primary) 22%, transparent) !important;
}

html body #view-news .anime-news-loadmore svg {
  width: 16px !important;
  height: 16px !important;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 1.9 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}

/* -- Loading skeletons ----------------------------------------------------- */

html body #view-news .anime-news-featured.is-skeleton,
html body #view-news .anime-news-card.is-skeleton {
  cursor: default !important;
  pointer-events: none !important;
}

html body #view-news .is-skeleton .anime-news-featured-media,
html body #view-news .is-skeleton .anime-news-card-media {
  background: var(--md-surface-variant) !important;
}

html body #view-news .is-skeleton :where(span, b, i) {
  display: block !important;
  border-radius: 6px !important;
  background: color-mix(in srgb, var(--md-on-surface) 7%, transparent) !important;
}

html body #view-news .is-skeleton .anime-news-featured-copy span { width: 88px; height: 21px; }
html body #view-news .is-skeleton .anime-news-featured-copy b { width: 78%; height: 25px; margin-top: 14px; }
html body #view-news .is-skeleton .anime-news-featured-copy i { width: 58%; height: 15px; margin-top: 14px; }
html body #view-news .is-skeleton .anime-news-card-copy span { width: 64px; height: 18px; }
html body #view-news .is-skeleton .anime-news-card-copy b { width: 90%; height: 14px; margin-top: 10px; }
html body #view-news .is-skeleton .anime-news-card-copy i { width: 62%; height: 12px; margin-top: 8px; }

/* -- Responsive ------------------------------------------------------------ */

@media (max-width: 1440px) {
  html body #view-news .anime-news-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 1180px) {
  html body #view-news .anime-news-featured {
    grid-template-columns: minmax(0, 44%) minmax(0, 1fr) !important;
  }

  html body #view-news .anime-news-featured-copy h3 {
    font-size: 22px !important;
  }
}

@media (max-width: 1040px) {
  html body #view-news .anime-news-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  html body #view-news .anime-news-sort {
    margin-left: 0 !important;
  }
}

@media (max-width: 860px) {
  html body #view-news .anime-news-featured {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto auto !important;
    height: auto !important;
    min-height: 0 !important;
  }

  html body #view-news .anime-news-featured-media {
    height: auto !important;
    min-height: 0 !important;
    aspect-ratio: 16 / 9 !important;
  }

  html body #view-news .anime-news-featured-copy {
    padding: 18px !important;
  }

  html body #view-news .anime-news-featured-copy h3 {
    font-size: 20px !important;
  }
}

@media (max-width: 760px) {
  html body #view-news .anime-news-page-title {
    align-items: flex-start !important;
  }

  html body #view-news .anime-news-title-actions {
    flex-wrap: wrap !important;
    gap: 8px 12px !important;
  }

  html body #view-news .anime-news-page-meta {
    white-space: normal !important;
  }

  html body #view-news .anime-news-refresh {
    flex: 0 0 auto !important;
    width: auto !important;
  }

  html body #view-news .anime-news-filter-bar {
    gap: 8px !important;
  }

  html body #view-news .anime-news-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px !important;
  }

  html body #view-news .anime-news-card {
    grid-template-columns: 108px minmax(0, 1fr) !important;
    height: 138px !important;
    min-height: 138px !important;
  }

  html body #view-news .anime-news-card-copy {
    padding: 12px !important;
  }
}

@media (max-width: 480px) {
  html body #view-news .anime-news-page-title h2 {
    font-size: 25px !important;
  }

  html body #view-news .anime-news-chip,
  html body #view-news .anime-news-select {
    height: 32px !important;
  }
}

/* -------------------------------------------------------------------------- */
/* Toplisten (#view-toplists) - desktop golden master                         */
/*                                                                            */
/* Data dashboard layout: page header, honest toolbar, three summary cards,   */
/* three equal ranking panels. Every selector is scoped to #view-toplists so  */
/* the shared .mini-list / .rank-row / .rated-row rules used by the profile   */
/* and public-profile views stay untouched.                                   */
/* -------------------------------------------------------------------------- */

html body #view-toplists {
  --toplist-gap: 18px;
  --toplist-radius: 12px;
  --toplist-line: var(--md-outline);
  --toplist-surface: var(--md-surface-variant);
  --toplist-row: color-mix(in srgb, var(--md-surface-elevated) 62%, var(--md-surface-variant));
}

/* ------------------------------------------------------------ page header -- */

html body #view-toplists .toplist-header {
  margin: 0 0 18px !important;
}

html body #view-toplists .toplist-header .page-main-title {
  margin: 0 !important;
  font-size: 30px !important;
  font-weight: 700 !important;
  line-height: 1.16 !important;
  letter-spacing: -.016em !important;
}

html body #view-toplists .toplist-header p {
  max-width: none;
  margin: 7px 0 0;
  color: var(--md-muted);
  font-size: 13px;
  line-height: 1.45;
}

/* ---------------------------------------------------------------- toolbar -- */
/* The board shows Zeitraum/Typ dropdowns. The data layer
   (get_community_toplists(p_limit)) has no range or type parameter, so no
   dropdown is rendered here - only truthful information and the real
   force-reload action that already exists via data-ui-retry="toplists". */

html body #view-toplists .toplist-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 34px;
  margin: 0 0 18px;
}

html body #view-toplists .toplist-toolbar-note {
  margin: 0;
  color: var(--md-muted);
  font-size: 12.5px;
  line-height: 1.35;
}

html body #view-toplists .toplist-toolbar-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
}

html body #view-toplists .toplist-freshness {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 13px;
  border: 1px solid var(--toplist-line);
  border-radius: 9px;
  background: color-mix(in srgb, var(--md-surface-elevated) 55%, transparent);
  color: var(--md-muted);
  font-size: 12px;
  white-space: nowrap;
}

html body #view-toplists .toplist-freshness svg {
  flex: 0 0 15px;
  width: 15px;
  height: 15px;
  fill: none;
  stroke: var(--md-secondary);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

html body #view-toplists .toplist-refresh {
  height: 34px !important;
  min-height: 34px !important;
  padding: 0 15px !important;
  border-radius: 9px !important;
  font-size: 12.5px !important;
  white-space: nowrap;
}

/* --------------------------------------------------------- summary cards -- */

html body #view-toplists .toplist-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--toplist-gap);
  margin: 0 0 16px;
}

html body #view-toplists .toplist-summary:empty {
  display: none;
}

html body #view-toplists .toplist-summary-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 15px;
  min-width: 0;
  height: 117px;
  padding: 16px 18px;
  border: 1px solid var(--toplist-line);
  border-radius: var(--toplist-radius);
  background: var(--toplist-surface);
  box-shadow: var(--md-elevation-1);
}

html body #view-toplists .toplist-summary-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid color-mix(in srgb, var(--md-primary) 26%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--md-primary) 14%, transparent);
}

html body #view-toplists .toplist-summary-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--md-primary);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

html body #view-toplists .toplist-summary-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

html body #view-toplists .toplist-summary-copy small {
  color: var(--md-muted);
  font-size: 12.5px;
  line-height: 1.2;
}

html body #view-toplists .toplist-summary-copy b {
  overflow: hidden;
  color: var(--md-on-surface);
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.16;
  letter-spacing: -.018em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html body #view-toplists .toplist-summary-copy em {
  overflow: hidden;
  color: var(--md-dim);
  font-size: 11.5px;
  font-style: normal;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Fills the slot where the board puts a sparkline. No time series exists in
   the data layer, so the real current leader goes here instead of a chart. */
html body #view-toplists .toplist-summary-leader {
  display: grid;
  gap: 3px;
  justify-items: end;
  max-width: 180px;
  min-width: 0;
  text-align: right;
}

html body #view-toplists .toplist-summary-leader small {
  color: var(--md-secondary);
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: .04em;
  line-height: 1;
  text-transform: uppercase;
}

html body #view-toplists .toplist-summary-leader b {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: var(--md-on-surface);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.3;
}

/* --------------------------------------------------------- ranking panels -- */

html body #view-toplists .toplist-panels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: var(--toplist-gap);
}

html body #view-toplists .toplist-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--toplist-line);
  border-radius: var(--toplist-radius);
  background: var(--toplist-surface);
  box-shadow: var(--md-elevation-1);
}

html body #view-toplists .toplist-panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin: 0 0 13px;
  padding: 0 2px;
}

html body #view-toplists .toplist-panel-icon {
  display: grid;
  flex: 0 0 20px;
  place-items: center;
  width: 20px;
  height: 20px;
}

html body #view-toplists .toplist-panel-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--md-primary);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

html body #view-toplists .toplist-panel-head h2 {
  margin: 0 !important;
  overflow: hidden;
  color: var(--md-on-surface);
  font-family: var(--font-display);
  font-size: 16.5px !important;
  font-weight: 650;
  line-height: 1.2 !important;
  letter-spacing: -.012em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ------------------------------------------------------------ ranking rows -- */

html body #view-toplists .toplist-list {
  display: grid;
  align-content: start;
  gap: 5px;
  min-height: 0;
  min-width: 0;
}

html body #view-toplists .toplist-row {
  display: grid;
  grid-template-columns: 26px 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-width: 0;
  height: 48px;
  padding: 0 11px;
  border: 1px solid color-mix(in srgb, var(--toplist-line) 80%, transparent);
  border-radius: 8px;
  background: var(--toplist-row);
  color: var(--md-on-surface);
  text-decoration: none;
  transition:
    border-color .16s var(--md-motion),
    background-color .16s var(--md-motion);
}

html body #view-toplists .toplist-row:hover,
html body #view-toplists .toplist-row:focus-visible {
  border-color: color-mix(in srgb, var(--md-primary) 46%, transparent);
  background: color-mix(in srgb, var(--md-primary) 11%, var(--md-surface-elevated));
  outline: none;
}

html body #view-toplists .toplist-rank {
  display: grid;
  flex: 0 0 26px;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--md-surface-elevated) 90%, #000);
  color: var(--md-muted);
  font-size: 11.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Rank 1 gets a restrained crimson accent - no medal, no podium. */
html body #view-toplists .toplist-list > .toplist-row:nth-child(1) .toplist-rank {
  border: 1px solid color-mix(in srgb, var(--md-primary) 40%, transparent);
  background: color-mix(in srgb, var(--md-primary) 20%, transparent);
  color: var(--md-secondary);
}

html body #view-toplists .toplist-cover {
  position: relative;
  display: block;
  overflow: hidden;
  width: 34px;
  height: 42px;
  border: 1px solid color-mix(in srgb, var(--toplist-line) 70%, transparent);
  border-radius: 5px;
  background: color-mix(in srgb, var(--md-surface-elevated) 80%, #000);
}

/* Painted underneath the cover image: if the AniList image request fails,
   the row keeps its exact geometry and shows the AR mark instead of a
   broken-image icon. */
html body #view-toplists .toplist-cover::after {
  content: 'AR';
  position: absolute;
  inset: 0;
  z-index: 0;
  display: grid;
  place-items: center;
  color: var(--md-dim);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
}

html body #view-toplists .toplist-cover img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  object-fit: cover;
}

/* No cover known yet: the container pseudo-element already paints AR, so
   the span only has to hide its own duplicate text. */
html body #view-toplists .toplist-cover-placeholder {
  color: transparent;
  font-size: 0;
}

html body #view-toplists .toplist-ident {
  display: grid;
  gap: 1px;
  min-width: 0;
}

html body #view-toplists .toplist-ident b {
  overflow: hidden;
  color: var(--md-on-surface);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html body #view-toplists .toplist-ident small {
  overflow: hidden;
  color: var(--md-rating);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html body #view-toplists .toplist-ident small::before {
  content: '\2605\00a0';
}

html body #view-toplists .toplist-metric {
  display: grid;
  flex: 0 0 auto;
  gap: 1px;
  justify-items: end;
  text-align: right;
}

html body #view-toplists .toplist-metric b {
  color: var(--md-on-surface);
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

html body #view-toplists .toplist-metric small {
  color: var(--md-dim);
  font-size: 10.5px;
  line-height: 1.2;
  white-space: nowrap;
}

/* Truthful note for a ranking that only has one or two entries yet. */
html body #view-toplists .toplist-list-hint {
  margin: 5px 2px 0;
  color: var(--md-dim);
  font-size: 11.5px;
  line-height: 1.45;
}

/* Loading, empty and error states render per panel, so one failing ranking
   never takes the other two down. */
html body #view-toplists .toplist-list > :where(.ui-state-card, .empty-state) {
  margin: 0;
}

/* -------------------------------------------------------------- responsive -- */
/* Desktop is the golden master. Below that the same blocks reflow; nothing is
   hidden and every anime link stays reachable. */

@media (min-width: 1341px) and (min-height: 1050px) {
  html body #view-toplists .toplist-summary-card {
    height: clamp(117px, calc(12dvh + 4px), 135px);
  }

  html body #view-toplists .toplist-panel {
    min-height: clamp(590px, calc(80dvh - 163px), 700px);
  }

  html body #view-toplists .toplist-list > :where(.ui-state-card, .empty-state) {
    min-height: 100%;
  }
}

@media (max-width: 1340px) {
  html body #view-toplists .toplist-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  html body #view-toplists .toplist-summary-card {
    grid-template-columns: 40px minmax(0, 1fr);
    height: auto;
    min-height: 117px;
  }

  html body #view-toplists .toplist-summary-icon {
    width: 40px;
    height: 40px;
  }

  html body #view-toplists .toplist-summary-leader {
    grid-column: 1 / -1;
    justify-items: start;
    max-width: none;
    text-align: left;
  }
}

@media (max-width: 1080px) {
  html body #view-toplists .toplist-summary,
  html body #view-toplists .toplist-panels {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  html body #view-toplists .toplist-header .page-main-title {
    font-size: 24px !important;
  }

  html body #view-toplists .toplist-toolbar {
    flex-wrap: wrap;
    gap: 10px;
  }

  html body #view-toplists .toplist-toolbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  html body #view-toplists .toplist-summary,
  html body #view-toplists .toplist-panels {
    gap: 12px;
  }

  html body #view-toplists .toplist-summary-card {
    min-height: 0;
    padding: 14px;
  }

  html body #view-toplists .toplist-summary-copy b {
    font-size: 22px;
  }

  html body #view-toplists .toplist-panel {
    padding: 13px;
  }

  html body #view-toplists .toplist-row {
    grid-template-columns: 24px 30px minmax(0, 1fr) auto;
    gap: 9px;
    height: 44px;
    padding: 0 9px;
  }

  html body #view-toplists .toplist-rank {
    width: 24px;
    height: 24px;
    font-size: 11px;
  }

  html body #view-toplists .toplist-cover {
    width: 30px;
    height: 36px;
  }
}
