.anime-page {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: stretch;
  gap: 20px;
}

.anime-card {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg2);
}

.anime-hero {
  overflow: hidden;
}

.anime-hero__banner {
  width: 100%;
  height: 300px;
  background-size: cover;
  background-position: center;
}

.anime-hero__body {
  padding: 18px;
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 18px;
}

.anime-hero__cover {
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--border);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.35);
}

.anime-hero__content {
  display: grid;
  gap: 14px;
  align-content: start;
  min-width: 0;
}

.anime-hero__title {
  font-size: clamp(24px, 2.4vw, 34px);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.anime-hero__title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
}

.anime-hero__title-block {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.anime-hero__subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.35;
}

.anime-hero__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-content: flex-start;
  max-width: 300px;
}

.anime-track-btn,
.anime-favorite-btn,
.anime-action-btn {
  min-height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(6, 12, 22, 0.7);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
  cursor: pointer;
  padding: 0 12px;
  font-size: 12px;
  font-family: "JetBrains Mono", monospace;
}

.anime-track-btn:hover,
.anime-favorite-btn:hover,
.anime-action-btn:hover {
  border-color: rgba(52, 184, 243, 0.7);
  color: #9fd9ff;
}

.anime-favorite-btn.is-active,
.anime-action-btn.is-active {
  border-color: rgba(255, 119, 153, 0.7);
  color: #ff8faf;
  background: rgba(255, 119, 153, 0.14);
}

.anime-library-quick {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.anime-library-quick__badge {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  font-family: "JetBrains Mono", monospace;
  background: rgba(6, 12, 22, 0.66);
}

.anime-library-quick__badge.is-watching,
.anime-library-quick__badge.is-reading,
.anime-library-quick__badge.is-rewatching,
.anime-library-quick__badge.is-rereading {
  border-color: rgba(52, 184, 243, 0.75);
  color: #8fd7ff;
}

.anime-library-quick__badge.is-completed {
  border-color: rgba(34, 197, 94, 0.65);
  color: #9af5be;
}

.anime-library-quick__badge.is-paused {
  border-color: rgba(250, 204, 21, 0.6);
  color: #f7db81;
}

.anime-library-quick__badge.is-dropped {
  border-color: rgba(248, 113, 113, 0.6);
  color: #ffc1c1;
}

.anime-library-quick__progress {
  color: var(--text-muted);
  font-size: 12px;
}

.anime-library-quick__progress strong {
  color: var(--text);
}

.library-modal {
  position: fixed;
  inset: 0;
  z-index: 13000;
  display: none;
}

.library-modal.is-open {
  display: block;
}

.library-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
}

.library-modal__dialog {
  position: relative;
  width: min(520px, calc(100% - 16px));
  margin: 22px auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg2);
  padding: 12px;
  max-height: calc(100vh - 44px);
  overflow-y: auto;
}

.library-modal__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.library-modal__close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(6, 12, 22, 0.8);
  color: var(--text);
  cursor: pointer;
}

.library-modal__form {
  display: grid;
  gap: 9px;
}

.library-modal__hint {
  margin: 2px 0 4px;
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.5;
}

.library-modal__field {
  display: grid;
  gap: 5px;
}

.library-modal__field span {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  font-family: "JetBrains Mono", monospace;
}

.library-modal__field input,
.library-modal__field select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(6, 12, 22, 0.9);
  color: var(--text);
  padding: 9px 10px;
}

.library-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.library-modal__btn {
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(6, 12, 22, 0.9);
  color: var(--text);
  padding: 8px 11px;
  cursor: pointer;
}

.library-modal__btn--primary {
  border-color: rgba(52, 184, 243, 0.75);
  background: rgba(52, 184, 243, 0.17);
}

.library-modal__btn--danger {
  border-color: rgba(248, 113, 113, 0.55);
  background: rgba(248, 113, 113, 0.12);
  color: #ffc5cc;
  margin-right: auto;
}

.library-modal__btn--danger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

body.library-modal-open {
  overflow: hidden;
}

.anime-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-radius: 10px;
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--border);
  gap: 1px;
}

.anime-meta__item {
  padding: 10px;
  display: grid;
  gap: 3px;
  background: var(--bg);
  height: 100%;
}

.anime-meta__label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  font-family: "JetBrains Mono", monospace;
}

.anime-meta__value {
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
  line-height: 1.35;
}

.anime-meta__value--status {
  color: var(--accent);
}

.anime-hero__synopsis {
  margin: 0;
  width: 100%;
  color: var(--text-muted);
  line-height: 1.6;
  text-wrap: pretty;
  display: -webkit-box;
  -webkit-line-clamp: 8;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.22s ease, opacity 0.22s ease;
}

.anime-hero__synopsis-wrap {
  position: relative;
  width: 100%;
  justify-self: stretch;
}

.anime-hero__synopsis-wrap::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 64px;
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
  background: linear-gradient(180deg, rgba(16, 24, 38, 0), rgba(16, 24, 38, 0.995));
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.anime-hero__synopsis-wrap.is-collapsed::after {
  opacity: 1;
}

.anime-hero__synopsis-wrap.is-expanded::after {
  opacity: 0;
}

.anime-hero__synopsis-wrap.is-expanded .anime-hero__synopsis {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}

.anime-hero__synopsis-wrap.is-expanded .anime-hero__synopsis {
  opacity: 1;
}

.anime-hero__synopsis-toggle {
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translate(-50%, 6px);
  z-index: 2;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--accent);
  padding: 6px 10px;
  font-size: 11px;
  font-family: "JetBrains Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.22s ease,
    visibility 0.22s ease,
    transform 0.22s ease,
    color 0.22s ease;
}

.anime-hero__synopsis-wrap.is-collapsed:hover .anime-hero__synopsis-toggle,
.anime-hero__synopsis-wrap.is-collapsed:focus-within .anime-hero__synopsis-toggle {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.anime-hero__synopsis-toggle:hover {
  color: #bcd7ff;
}

.anime-hero__synopsis-wrap:not(.is-collapsed) .anime-hero__synopsis-toggle {
  display: none;
}

.translate-badge {
  display: inline-block;
  font-size: 0.65rem;
  color: var(--accent);
  border: 1px solid rgba(102, 163, 255, 0.3);
  border-radius: 6px;
  padding: 1px 6px;
  margin-top: 4px;
  opacity: 0.7;
}

.is-translating {
  opacity: 0.5;
  animation: translatePulse 1s ease-in-out infinite;
}

.is-translated {
  opacity: 1;
}

@keyframes translatePulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.8; }
}

.anime-rhythm-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.anime-rhythm-strip__item {
  border: 1px solid var(--border);
  background: rgba(8, 13, 20, 0.64);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 11px;
  color: var(--text-muted);
}

.anime-genre-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.episode-section {
  overflow: visible;
  position: relative;
  z-index: 2;
}

.section-head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--bg);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
}

.section-tabs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.02);
}

.section-tab {
  border: 0;
  border-radius: 999px;
  padding: 7px 12px;
  background: transparent;
  color: var(--text-dim);
  font-size: 11px;
  font-family: "JetBrains Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.16s ease;
}

.section-tab:hover {
  color: var(--text);
}

.section-tab.is-active {
  background: var(--accent);
  color: #0b111b;
}

.episode-panel {
  padding: 16px;
}

.episode-panel .legend {
  margin-bottom: 14px;
}

.legend-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.episode-panel .legend-toolbar .legend {
  margin-bottom: 0;
}

.guide-export-btn {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(102, 163, 255, 0.12);
  color: var(--text);
  padding: 6px 12px;
  font-size: 11px;
  font-family: "JetBrains Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
}

.guide-export-btn:hover {
  border-color: var(--accent);
  background: rgba(102, 163, 255, 0.2);
}

.guide-export-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.section-head__title {
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-family: "JetBrains Mono", monospace;
}

.section-head__credit {
  margin-top: 5px;
  font-size: 12px;
  color: var(--text-dim);
}

.section-head__credit strong {
  color: var(--text);
}

.legend {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.legend__item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-muted);
  font-size: 12px;
}

.legend__dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex-shrink: 0;
}

.legend__dot--canon {
  background: #00a640;
}

.legend__dot--mixed {
  background: #ffca29;
}

.legend__dot--filler {
  background: #ff3129;
}

.episode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(46px, 1fr));
  gap: 8px;
  overflow: visible;
}

.episode-empty {
  color: var(--text-dim);
  font-size: 13px;
}

.watch-fallback-link {
  display: inline-block;
  margin-top: 10px;
  color: var(--accent);
}

.watch-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  align-items: center;
}

.watch-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: "JetBrains Mono", monospace;
}

.watch-badge--ok {
  background: rgba(0, 166, 64, 0.2);
  color: #8ff2b7;
  border: 1px solid rgba(0, 166, 64, 0.45);
}

.watch-badge--warn {
  background: rgba(255, 202, 41, 0.16);
  color: #ffe49c;
  border: 1px solid rgba(255, 202, 41, 0.35);
}

.watch-badge--off {
  background: rgba(255, 49, 41, 0.14);
  color: #ffb0ad;
  border: 1px solid rgba(255, 49, 41, 0.32);
}

.watch-status__text {
  color: var(--text-muted);
  font-size: 12px;
}

.watch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.watch-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.16s ease, border-color 0.16s ease;
}

.watch-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.watch-card.is-hidden {
  display: none;
}

.watch-card--disabled {
  opacity: 0.8;
  border-style: dashed;
}

.watch-card--disabled:hover {
  transform: none;
  border-color: var(--border);
}

.watch-card__thumb {
  width: 100%;
  height: 116px;
  object-fit: cover;
  display: block;
}

.watch-card__body {
  padding: 9px;
  display: grid;
  gap: 3px;
}

.watch-card__ep {
  color: var(--accent);
  font-size: 10px;
  letter-spacing: 0.08em;
  font-family: "JetBrains Mono", monospace;
}

.watch-card__site {
  color: var(--text-dim);
  font-size: 10px;
}

.watch-card__body strong {
  font-size: 12px;
  line-height: 1.35;
}

.watch-card__hint {
  color: var(--text-dim);
  font-size: 10px;
}

.character-grid {
  display: grid;
  gap: 10px;
}

.character-card.is-hidden {
  display: none;
}

.character-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  background: var(--bg);
}

.character-side {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 9px;
  align-items: center;
}

.character-side img {
  width: 54px;
  height: 76px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border);
}

.character-side strong {
  display: block;
  line-height: 1.3;
  font-size: 12px;
}

.character-side__label {
  display: block;
  margin-bottom: 2px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 10px;
  font-family: "JetBrains Mono", monospace;
}

.character-side__meta {
  display: block;
  margin-top: 3px;
  color: var(--accent2);
  font-size: 10px;
}

.panel-more-btn {
  margin-top: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  cursor: pointer;
}

.panel-more-btn:hover {
  border-color: var(--accent);
}

.provider-list {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.provider-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  font-size: 11px;
}

.provider-chip:hover {
  border-color: var(--accent);
}

.relation-wall {
  padding: 14px;
}

.relation-wall__head {
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.relation-wall__grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 10px;
}

.relation-wall__grid.relation-wall__grid--compact {
  grid-template-columns: repeat(10, minmax(0, 1fr));
}

.relation-wall__grid.related-preview-collapsed {
  grid-template-columns: repeat(10, minmax(0, 1fr));
}

.relation-wall__item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  display: block;
  border: 1px solid var(--border);
  background: var(--bg);
  min-height: 126px;
}

.relation-wall__item.is-hidden {
  display: none;
}

.relation-wall__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s ease;
}

.relation-wall__item:hover img {
  transform: scale(1.04);
}

.relation-wall__label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 5px 7px;
  font-size: 10px;
  color: #f8fbff;
  text-align: center;
  background: linear-gradient(180deg, rgba(10, 15, 24, 0.05), rgba(10, 15, 24, 0.86));
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.recommendation-zone {
  padding: 14px;
  display: grid;
  gap: 12px;
}

.recommendation-zone__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.recommendation-zone__head .anime-extra__title {
  margin-bottom: 0;
}

.recommendation-zone__toggle {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text-muted);
  padding: 6px 12px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: "JetBrains Mono", monospace;
  cursor: pointer;
}

.recommendation-zone__toggle:hover {
  border-color: var(--accent);
  color: var(--text);
}

.recommendation-row {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 12px;
}

.recommendation-row.recommendation-row--compact {
  grid-template-columns: repeat(10, minmax(0, 1fr));
}

.recommendation-row.recommendation-preview-collapsed {
  grid-template-columns: repeat(10, minmax(0, 1fr));
}

.recommendation-row__item {
  color: var(--text);
  text-decoration: none;
  display: grid;
  gap: 7px;
}

.recommendation-row__item img {
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 8px;
  border: 1px solid var(--border);
  object-fit: cover;
  display: block;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.recommendation-row__item:hover img {
  transform: translateY(-3px);
  border-color: var(--accent);
}

.recommendation-row__item strong {
  font-size: 12px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.recommendation-row__item span {
  font-size: 11px;
  color: var(--text-dim);
}

.recommendation-row__item.is-hidden {
  display: none;
}

.recommendation-skeleton {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid rgba(182, 213, 244, 0.22);
  background:
    linear-gradient(180deg, rgba(15, 26, 42, 0.92), rgba(11, 20, 34, 0.94)),
    linear-gradient(108deg, rgba(120, 149, 180, 0.3) 22%, rgba(180, 214, 246, 0.58) 47%, rgba(120, 149, 180, 0.3) 72%);
  background-size: 100% 100%, 260% 100%;
  aspect-ratio: 2 / 3;
  animation: recommendation-skeleton 1.25s linear infinite;
}

.recommendation-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 32%, rgba(235, 247, 255, 0.24) 50%, transparent 68%);
  transform: translateX(-120%);
  animation: recommendation-skeleton-sweep 1.35s ease-out infinite;
}

@keyframes recommendation-skeleton {
  0% {
    background-position: 0 0, 200% 0;
  }

  100% {
    background-position: 0 0, -30% 0;
  }
}

@keyframes recommendation-skeleton-sweep {
  100% {
    transform: translateX(120%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .recommendation-skeleton,
  .recommendation-skeleton::after {
    animation: none;
  }
}

.anime-extra {
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.align-items {
  align-items: center;
}

.anime-extra__title {
  margin-bottom: 8px;
  font-size: 13px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-family: "JetBrains Mono", monospace;
}

.anime-extra__grid {
  display: grid;
  gap: 8px;
}

.anime-extra__item {
  display: grid;
  grid-template-columns: 50px 1fr;
  gap: 8px;
  align-items: center;
  text-decoration: none;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px;
}

.anime-extra__item img {
  width: 50px;
  height: 70px;
  border-radius: 5px;
  object-fit: cover;
}

.anime-extra__item strong {
  display: block;
  font-size: 12px;
  line-height: 1.35;
}

.anime-extra__item span {
  color: var(--text-dim);
  font-size: 11px;
}

.anime-extra__empty {
  color: var(--text-dim);
  font-size: 12px;
}

.anime-compare-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.anime-compare-grid article {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  background: rgba(8, 13, 20, 0.6);
  display: grid;
  gap: 4px;
}

.anime-compare-grid span {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: "JetBrains Mono", monospace;
}

.anime-compare-grid strong {
  font-size: 22px;
  line-height: 1;
}

.anime-compare-grid small {
  color: var(--text-muted);
  font-size: 11px;
}

.ep-item {
  width: 100%;
  max-width: 50px;
  height: 36px;
  justify-self: center;
  border: 0;
  border-radius: 7px;
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  padding: 4px;
  position: relative;
  font-size: 12px;
  font-weight: 700;
  color: #111;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.16s ease;
}

.ep-item.is-hidden {
  display: none;
}

.ep-item:hover {
  transform: scale(1.1);
  z-index: 4;
}

.ep-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  transform: scale(1.08);
  z-index: 4;
}

.ep-item--canon {
  background: #00a640;
}

.ep-item--mixed {
  background: #ffca29;
}

.ep-item--filler {
  background: #ff3129;
}

.ep-tooltip {
  --tip-x: -50%;
  --tip-arrow-x: 50%;
  --tip-float-y: 4px;
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translate(var(--tip-x), var(--tip-float-y));
  min-width: 140px;
  max-width: 230px;
  padding: 9px 10px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: #10141c;
  color: #d8dee8;
  line-height: 1.35;
  text-align: left;
  font-size: 11px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
  transition:
    opacity 0.14s ease,
    transform 0.14s ease;
  z-index: 6;
}

.ep-tooltip::after {
  content: "";
  position: absolute;
  left: var(--tip-arrow-x);
  top: 100%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: #10141c transparent transparent transparent;
}

.ep-item:hover .ep-tooltip,
.ep-item:focus-visible .ep-tooltip,
.ep-item.is-active .ep-tooltip {
  opacity: 1;
  visibility: visible;
  --tip-float-y: 0px;
}

.ep-tooltip.align-left {
  left: 0;
  --tip-x: 0;
}

.ep-tooltip.align-left::after {
  left: 14px;
  transform: none;
}

.ep-tooltip.align-right {
  left: auto;
  right: 0;
  --tip-x: 0;
}

.ep-tooltip.align-right::after {
  left: auto;
  right: 14px;
  transform: none;
}

.ep-tooltip.align-bottom {
  bottom: auto;
  top: calc(100% + 10px);
}

.ep-tooltip.align-bottom::after {
  top: auto;
  bottom: 100%;
  border-color: transparent transparent #10141c transparent;
}

.ep-tooltip strong {
  color: #fff;
}

.ep-tooltip__note {
  display: block;
  margin-top: 4px;
  margin-bottom: 2px;
  font-size: 10px;
  line-height: 1.3;
  font-style: italic;
  color: #9eb8d6;
}

@media (max-width: 680px) {
  .ep-tooltip__note {
    font-size: 9.5px;
    margin-top: 3px;
  }
}

.ep-tooltip.align-side-right {
  left: calc(100% + 10px);
  right: auto;
  top: 50%;
  bottom: auto;
  transform: translate(0, -50%);
}

.ep-tooltip.align-side-right::after {
  left: auto;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  border-color: transparent #10141c transparent transparent;
}

.ep-tooltip.align-side-left {
  right: calc(100% + 10px);
  left: auto;
  top: 50%;
  bottom: auto;
  transform: translate(0, -50%);
}

.ep-tooltip.align-side-left::after {
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  border-color: transparent transparent transparent #10141c;
}

@media (hover: none) {
  .ep-item:hover {
    transform: none;
  }
}

@media (max-width: 960px) {
  .episode-section {
  overflow: hidden;
  }

  .section-head {
    align-items: flex-start;
  }

  .section-tabs {
    width: 100%;
    justify-content: space-between;
  }

  .section-tab {
    flex: 1;
  }

  .character-card {
    grid-template-columns: 1fr;
  }

  .anime-page {
    padding: 14px 10px;
    gap: 14px;
  }

  .anime-hero__banner {
    height: 220px;
  }

  .anime-hero__body {
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 14px;
    padding: 14px;
  }

  .anime-track-btn,
  .anime-favorite-btn {
    padding: 0 10px;
    font-size: 11px;
  }

  .anime-hero__title-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .anime-hero__actions {
    max-width: 100%;
    justify-content: flex-start;
  }

  .anime-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 0;
  }

  .anime-meta__item {
    border-bottom: 1px solid var(--border);
  }

  .anime-meta__item:nth-child(2n) {
    border-right: 0;
  }

  .anime-meta__item:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .legend {
    width: 100%;
    gap: 10px;
  }

  .guide-export-btn {
    width: 100%;
    text-align: center;
  }

  .anime-extra {
    grid-template-columns: 1fr;
  }

  .relation-wall__grid {
    grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  }

  .recommendation-row,
  .recommendation-expand__grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }

  .anime-compare-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .anime-page {
    padding: 10px 8px;
  }

  .anime-hero__banner {
    height: 168px;
  }

  .anime-hero__body {
    grid-template-columns: 1fr;
  }

  .anime-hero__content {
    min-height: 0;
  }

  .anime-hero__title-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .anime-hero__actions {
    width: 100%;
  }

  .anime-track-btn,
  .anime-favorite-btn {
    flex: 1 1 auto;
    justify-content: center;
  }

  .anime-hero__synopsis {
    -webkit-line-clamp: 7;
  }

  .anime-hero__synopsis-wrap::after {
    height: 72px;
  }

  .anime-hero__synopsis-wrap.is-collapsed {
    cursor: pointer;
  }

  .anime-hero__synopsis-toggle {
    display: none;
  }

  .anime-hero__cover {
    width: 130px;
    margin-top: -56px;
  }

  .section-head {
    gap: 8px;
  }

  .legend__item {
    font-size: 11px;
  }

  .episode-grid {
    gap: 6px;
  }

  .episode-panel {
    padding: 12px;
  }

  .ep-item {
    max-width: 44px;
    height: 32px;
    font-size: 11px;
  }

  .watch-grid {
    grid-auto-flow: column;
    grid-template-columns: none;
    grid-template-rows: 1fr;
    grid-auto-columns: minmax(172px, 200px);
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 10px;
    padding-bottom: 8px;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
    scrollbar-color: rgba(102, 163, 255, 0.5) transparent;
  }

  .watch-card {
    scroll-snap-align: start;
  }

  .watch-card.is-hidden {
    display: block;
  }

  .watch-grid::-webkit-scrollbar {
    height: 6px;
  }

  .watch-grid::-webkit-scrollbar-track {
    background: transparent;
  }

  .watch-grid::-webkit-scrollbar-thumb {
    background: rgba(102, 163, 255, 0.4);
    border-radius: 999px;
  }

  .watch-more-btn {
    display: none;
  }

  .character-grid {
    grid-auto-flow: column;
    grid-template-columns: none;
    grid-template-rows: 1fr;
    grid-auto-columns: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 10px;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(102, 163, 255, 0.5) transparent;
  }

  .character-card {
    scroll-snap-align: start;
  }

  .character-card.is-hidden {
    display: grid;
  }

  .character-grid::-webkit-scrollbar {
    height: 6px;
  }

  .character-grid::-webkit-scrollbar-track {
    background: transparent;
  }

  .character-grid::-webkit-scrollbar-thumb {
    background: rgba(102, 163, 255, 0.4);
    border-radius: 999px;
  }

  .character-more-btn {
    display: none;
  }

  .relation-wall__grid,
  .recommendation-row,
  .recommendation-expand__grid {
    grid-auto-flow: column;
    grid-template-columns: none;
    grid-template-rows: repeat(2, auto);
    justify-content: flex-start;
    align-content: start;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 0;
    padding-bottom: 8px;
    gap: 10px;
    scrollbar-width: thin;
    scrollbar-color: rgba(102, 163, 255, 0.5) transparent;
    -webkit-overflow-scrolling: touch;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .relation-wall__grid.relation-wall__grid--compact,
  .recommendation-row.recommendation-row--compact {
    grid-template-columns: none;
    grid-template-rows: 1fr;
    align-content: center;
  }

  .relation-wall__grid.relation-wall__grid--compact {
    grid-auto-columns: calc((100% - 20px) / 3);
    justify-content: flex-start;
  }

  .recommendation-row.recommendation-row--compact {
    grid-auto-columns: calc((100% - 20px) / 3);
    justify-content: flex-start;
  }

  .relation-wall__grid {
    grid-auto-columns: calc((100% - 20px) / 3);
  }

  .recommendation-row,
  .recommendation-expand__grid {
    grid-auto-columns: calc((100% - 20px) / 3);
  }

  .relation-wall__item,
  .recommendation-row__item {
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  .recommendation-row__item {
    min-width: 0;
    width: 100%;
  }

  .relation-wall__item.is-hidden {
    display: block;
  }

  .related-more-btn {
    display: none;
  }

  .recommendation-row__item.is-hidden {
    display: block;
  }

  .recommendation-more-btn {
    display: none;
  }

  .relation-wall__grid::-webkit-scrollbar,
  .recommendation-row::-webkit-scrollbar,
  .recommendation-expand__grid::-webkit-scrollbar {
    height: 6px;
  }

  .relation-wall__grid::-webkit-scrollbar-track,
  .recommendation-row::-webkit-scrollbar-track,
  .recommendation-expand__grid::-webkit-scrollbar-track {
    background: transparent;
  }

  .relation-wall__grid::-webkit-scrollbar-thumb,
  .recommendation-row::-webkit-scrollbar-thumb,
  .recommendation-expand__grid::-webkit-scrollbar-thumb {
    background: rgba(102, 163, 255, 0.4);
    border-radius: 999px;
    opacity: 0;
    transition: all 0.25s ease;
  }

  .relation-wall__grid:hover::-webkit-scrollbar-thumb,
  .recommendation-row:hover::-webkit-scrollbar-thumb,
  .recommendation-expand__grid:hover::-webkit-scrollbar-thumb {
    opacity: 1;
    background: rgba(102, 163, 255, 0.9);
  }

  .watch-status {
    flex-direction: column;
    align-items: flex-start;
  }

  .ep-tooltip {
    min-width: 126px;
    max-width: 186px;
    font-size: 10px;
  }
}

