/* ==========================================================================
   Anime Portal theme styles
   ========================================================================== */

:root {
  --ap-bg: #0f1117;
  --ap-bg-elevated: #151922;
  --ap-surface: #1b2030;
  --ap-surface-2: #232a3d;
  --ap-border: #2f374c;
  --ap-border-light: #3d4763;
  --ap-text: #e8ecf4;
  --ap-text-muted: #9aa3b8;
  --ap-accent: #ff6b2c;
  --ap-accent-hover: #ff854f;
  --ap-link: #6ea8ff;
  --ap-link-hover: #9bc0ff;
  --ap-radius: 8px;
  --ap-radius-sm: 6px;
  --ap-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  --ap-sidebar-w: 260px;
  --ap-sidebar-right-w: 300px;
  --ap-header-h: 56px;
  --ap-nav-h: 44px;
  --ap-rating-excellent: #3ecf8e;
  --ap-rating-good: #8bc34a;
  --ap-rating-average: #ffc107;
  --ap-rating-low: #ff7043;
}

body.body-inner {
  background: var(--ap-bg);
  color: var(--ap-text);
}

#preloader {
  display: none !important;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.ap-header {
  background: var(--ap-bg-elevated);
  border-bottom: 1px solid var(--ap-border);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.ap-header__top {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: var(--ap-header-h);
  padding: 8px 0;
}

.ap-header__logo {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ap-text);
  min-width: 0;
}

.ap-header__logo img {
  height: 40px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
}

.ap-header__logo-text {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.ap-header__search {
  flex: 1 1 auto;
  max-width: 520px;
  margin: 0 auto;
}

.ap-header__search form {
  display: flex;
  align-items: stretch;
  background: var(--ap-surface);
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius);
  overflow: hidden;
}

.ap-header__search input[type="search"],
.ap-header__search input[type="text"] {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--ap-text);
  padding: 10px 14px;
  font-size: 0.9rem;
  outline: none;
  min-width: 0;
}

.ap-header__search input::placeholder {
  color: var(--ap-text-muted);
}

.ap-header__search button {
  border: 0;
  background: var(--ap-accent);
  color: #fff;
  padding: 0 16px;
  cursor: pointer;
  transition: background 0.2s;
}

.ap-header__search button:hover {
  background: var(--ap-accent-hover);
}

.ap-header__actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ap-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--ap-radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  white-space: nowrap;
}

.ap-btn--primary {
  background: var(--ap-accent);
  color: #fff;
}

.ap-btn--primary:hover {
  background: var(--ap-accent-hover);
  color: #fff;
}

.ap-btn--ghost {
  background: transparent;
  border-color: var(--ap-border-light);
  color: var(--ap-text);
}

.ap-btn--ghost:hover {
  border-color: var(--ap-accent);
  color: var(--ap-accent);
}

.ap-header__burger {
  display: none;
  border: 0;
  background: var(--ap-surface);
  color: var(--ap-text);
  width: 40px;
  height: 40px;
  border-radius: var(--ap-radius-sm);
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
}

.ap-header__burger svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.ap-nav {
  background: var(--ap-surface);
  border-bottom: 1px solid var(--ap-border);
}

.ap-nav__inner {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: var(--ap-nav-h);
  overflow-x: auto;
  scrollbar-width: none;
}

.ap-nav__inner::-webkit-scrollbar {
  display: none;
}

.ap-nav__list {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.ap-nav__list a {
  display: block;
  padding: 10px 14px;
  color: var(--ap-text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
  border-radius: var(--ap-radius-sm);
  transition: color 0.2s, background 0.2s;
}

.ap-nav__list a:hover,
.ap-nav__list .current-menu-item > a,
.ap-nav__list .current_page_item > a {
  color: var(--ap-text);
  background: rgba(255, 107, 44, 0.12);
}

/* --------------------------------------------------------------------------
   Layout (3 columns)
   -------------------------------------------------------------------------- */
.ap-layout {
  padding: 20px 0 40px;
}

.ap-container {
  max-width: 1400px;
}

.ap-layout__grid {
  display: grid;
  grid-template-columns: var(--ap-sidebar-w) minmax(0, 1fr) var(--ap-sidebar-right-w);
  gap: 20px;
  align-items: start;
}

.ap-main {
  min-width: 0;
}

/* --------------------------------------------------------------------------
   Top poster carousel
   -------------------------------------------------------------------------- */
.ap-top-carousel {
  position: relative;
  background: var(--ap-surface);
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius);
  padding: 12px 14px 14px;
  margin-bottom: 16px;
}

.ap-top-carousel__head {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
  min-height: 28px;
}

.ap-top-carousel__nav {
  display: flex;
  gap: 6px;
}

.ap-top-carousel__arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--ap-border);
  border-radius: 4px;
  background: var(--ap-bg-elevated);
  color: var(--ap-text);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.ap-top-carousel__arrow:hover {
  background: var(--ap-surface-2);
  border-color: var(--ap-border-light);
}

.ap-top-carousel__track {
  margin: 0 -4px;
}

.ap-top-carousel__track:not(.slick-initialized) {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.ap-top-carousel__track:not(.slick-initialized)::-webkit-scrollbar {
  display: none;
}

.ap-top-carousel__slide {
  padding: 0 4px;
  scroll-snap-align: start;
}

.ap-top-carousel__track:not(.slick-initialized) .ap-top-carousel__slide {
  flex: 0 0 calc(12.5% - 8px);
  min-width: 100px;
}

.ap-top-carousel__item {
  display: block;
  border-radius: 6px;
  overflow: hidden;
  aspect-ratio: 2 / 3;
  background: var(--ap-bg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s, box-shadow 0.2s;
}

.ap-top-carousel__item:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
}

.ap-top-carousel__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ap-top-carousel .slick-list {
  overflow: hidden;
}

.ap-top-carousel .slick-track {
  display: flex;
  align-items: stretch;
}

/* --------------------------------------------------------------------------
   Sidebars
   -------------------------------------------------------------------------- */
.ap-sidebar {
  /* position: sticky; */
  top: calc(var(--ap-header-h) + var(--ap-nav-h) + 20px);
}

.ap-sidebar--left {
  /* position: relative; */
  padding-left: 10px;
}

.ap-sidebar--left::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 3px;
  background: linear-gradient(180deg, #a855f7 0%, #ec4899 100%);
}

.ap-sidebar--right {
  /* position: relative; */
  padding-right: 10px;
}

/* .ap-sidebar--right::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 3px;
  background: linear-gradient(180deg, #6366f1 0%, #ec4899 100%);
} */

.ap-sidebar__panel {
  background: var(--ap-surface);
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius);
  margin-bottom: 14px;
  overflow: hidden;
}

.ap-sidebar__panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--ap-surface-2);
  border-bottom: 1px solid var(--ap-border);
}

.ap-sidebar__panel-head--updates {
  background: transparent;
  border-bottom: 0;
  padding: 12px 12px 8px;
}

.ap-sidebar__panel-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--ap-text-muted);
  cursor: pointer;
}

.ap-sidebar__panel-toggle:hover {
  color: var(--ap-text);
  background: rgba(255, 255, 255, 0.05);
}

.ap-sidebar__panel-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ap-text);
}

.ap-sidebar__panel-body {
  padding: 10px 12px 12px;
}

.ap-sidebar__panel-body.is-collapsed {
  display: none;
}

.ap-sidebar__divider {
  height: 1px;
  background: var(--ap-border);
  margin: 10px 0;
}

.ap-genres-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.ap-genres-grid__link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 2px;
  color: var(--ap-text-muted);
  text-decoration: none;
  font-size: 0.84rem;
  line-height: 1.3;
  transition: color 0.15s;
}

.ap-genres-grid__link:hover,
.ap-genres-grid__link.is-hot {
  color: var(--ap-link);
}

.ap-genres-grid__fire {
  flex-shrink: 0;
  color: #ef4444;
}

.ap-sidebar__type-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.ap-sidebar__type-link {
  display: block;
  padding: 8px 10px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ap-text-muted);
  text-decoration: none;
  background: var(--ap-bg-elevated);
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius-sm);
  transition: color 0.15s, border-color 0.15s;
}

.ap-sidebar__type-link:hover {
  color: var(--ap-link);
  border-color: var(--ap-border-light);
}

.ap-genres-grid--years .ap-genres-grid__link {
  font-size: 0.8rem;
}

.ap-sidebar__quick-links {
  list-style: none;
  margin: 0;
  padding: 8px 0 4px;
}

.ap-sidebar__quick-links a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  color: var(--ap-text-muted);
  text-decoration: none;
  font-size: 0.86rem;
  transition: color 0.15s, background 0.15s;
}

.ap-sidebar__quick-links a:hover {
  color: var(--ap-link);
  background: rgba(110, 168, 255, 0.06);
}

.ap-sidebar__quick-links svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.ap-sidebar__updates-icon {
  color: #3b82f6;
  flex-shrink: 0;
}

.ap-updates-list {
  padding: 0 0 8px;
}

.ap-updates-list__item {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  text-decoration: none;
  color: inherit;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.15s;
}

.ap-updates-list__item:first-child {
  border-top: 0;
}

.ap-updates-list__item:hover {
  background: rgba(110, 168, 255, 0.06);
}

.ap-updates-list__item:hover .ap-updates-list__title {
  color: var(--ap-link-hover);
}

.ap-updates-list__thumb {
  flex: 0 0 72px;
  width: 72px;
  height: 48px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--ap-bg);
}

.ap-updates-list__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ap-updates-list__body {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ap-updates-list__title {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ap-link);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ap-updates-list__meta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.74rem;
  color: var(--ap-text-muted);
}

.ap-updates-list__update {
  font-size: 0.74rem;
  line-height: 1.35;
  color: var(--ap-link, #9b8cff);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ap-updates-list__meta svg {
  opacity: 0.65;
}

.ap-updates-list__episodes {
  font-size: 0.74rem;
  color: var(--ap-text-muted);
}

.ap-updates-list__empty {
  margin: 0;
  padding: 12px 14px;
  font-size: 0.84rem;
  color: var(--ap-text-muted);
}

.ap-sidebar__comments-icon {
  color: var(--ap-text-muted);
  flex-shrink: 0;
}

.ap-comments-list {
  padding: 0 0 8px;
}

.ap-comments-list__item {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.ap-comments-list__item:first-child {
  border-top: 0;
}

.ap-comments-list__avatar {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
}

.ap-comments-list__avatar-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: #f5c542;
}

.ap-comments-list__body {
  min-width: 0;
  flex: 1;
}

.ap-comments-list__post {
  display: block;
  margin-bottom: 4px;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ap-link);
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ap-comments-list__post:hover {
  color: var(--ap-link-hover);
}

.ap-comments-list__meta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 6px;
  font-size: 0.74rem;
  color: var(--ap-text-muted);
}

.ap-comments-list__meta svg {
  opacity: 0.65;
}

.ap-comments-list__text {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--ap-text-muted);
}

.ap-comments-list__text a {
  color: inherit;
  text-decoration: none;
}

.ap-comments-list__text a:hover {
  color: var(--ap-text);
}

.ap-comments-list__empty {
  margin: 0;
  padding: 12px 14px;
  font-size: 0.84rem;
  color: var(--ap-text-muted);
}

/* Legacy sidebar blocks (widgets) */
.ap-sidebar__block {
  background: var(--ap-surface);
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius);
  margin-bottom: 16px;
  overflow: hidden;
}

.ap-sidebar__title {
  margin: 0;
  padding: 12px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ap-text);
  background: var(--ap-surface-2);
  border-bottom: 1px solid var(--ap-border);
}

/* --------------------------------------------------------------------------
   Catalog section
   -------------------------------------------------------------------------- */
.ap-catalog {
  background: var(--ap-surface);
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius);
  padding: 18px;
}

.ap-catalog__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--ap-border);
}

.ap-catalog__title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
}

.ap-catalog__subtitle {
  margin: 4px 0 0;
  font-size: 0.88rem;
  color: var(--ap-text-muted);
}

.ap-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ap-tabs__btn {
  border: 1px solid var(--ap-border);
  background: var(--ap-bg-elevated);
  color: var(--ap-text-muted);
  padding: 7px 14px;
  border-radius: var(--ap-radius-sm);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}

.ap-tabs__btn:hover,
.ap-tabs__btn.active {
  color: #fff;
  border-color: var(--ap-accent);
  background: rgba(255, 107, 44, 0.18);
}

.ap-catalog__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 18px;
}

.ap-catalog__empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 24px;
  text-align: center;
  color: var(--ap-text-muted);
}

/* --------------------------------------------------------------------------
   Catalog cards — poster overlay
   -------------------------------------------------------------------------- */
.ap-card {
  position: relative;
}

.ap-card__link {
  display: block;
  text-decoration: none;
  color: inherit;
  height: 100%;
  border-radius: 10px;
  transition: box-shadow 0.25s ease;
}

.ap-card__poster {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: 10px;
  overflow: hidden;
  background: var(--ap-bg);
  border: 2px solid transparent;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.ap-card__poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.ap-card__badges {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ap-card__badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 4px;
  background: linear-gradient(180deg, #e84c3d 0%, #c0392b 100%);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.ap-card__badge svg {
  flex-shrink: 0;
  opacity: 0.95;
}

.ap-card__shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.ap-card__shade--default {
  z-index: 1;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0) 45%,
    rgba(0, 0, 0, 0.35) 70%,
    rgba(0, 0, 0, 0.82) 100%
  );
  opacity: 1;
}

.ap-card__shade--hover {
  z-index: 2;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.15) 0%,
    rgba(0, 0, 0, 0.55) 55%,
    rgba(0, 0, 0, 0.92) 100%
  );
  opacity: 0;
}

.ap-card__caption {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 4;
  padding: 12px 10px 14px;
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.ap-card__caption--default {
  bottom: 0;
  text-align: center;
  opacity: 1;
}

.ap-card__caption--hover {
  bottom: 0;
  text-align: left;
  opacity: 0;
  transform: translateY(8px);
}

.ap-card__title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.25;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.65);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ap-card__caption--default .ap-card__title {
  font-size: 1rem;
  letter-spacing: 0.01em;
}

.ap-card__genres {
  margin: 8px 0 0;
  font-size: 0.72rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.82);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ap-card__link:hover .ap-card__poster,
.ap-card__link:focus-visible .ap-card__poster {
  border-color: #e74c3c;
  box-shadow: 0 0 0 1px #e74c3c, 0 8px 24px rgba(231, 76, 60, 0.25);
}

.ap-card__link:hover .ap-card__poster img,
.ap-card__link:focus-visible .ap-card__poster img {
  transform: scale(1.04);
}

.ap-card__link:hover .ap-card__shade--default,
.ap-card__link:focus-visible .ap-card__shade--default {
  opacity: 0;
}

.ap-card__link:hover .ap-card__shade--hover,
.ap-card__link:focus-visible .ap-card__shade--hover {
  opacity: 1;
}

.ap-card__link:hover .ap-card__caption--default,
.ap-card__link:focus-visible .ap-card__caption--default {
  opacity: 0;
  transform: translateY(6px);
}

.ap-card__link:hover .ap-card__caption--hover,
.ap-card__link:focus-visible .ap-card__caption--hover {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 575.98px) {
  .ap-card__title {
    font-size: 0.82rem;
  }

  .ap-card__caption--default .ap-card__title {
    font-size: 0.88rem;
  }

  .ap-card__genres {
    font-size: 0.68rem;
  }
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.ap-footer {
  background: var(--ap-bg-elevated);
  border-top: 1px solid var(--ap-border);
  margin-top: auto;
}

.ap-footer__main {
  padding: 28px 0;
}

.ap-footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 28px;
}

.ap-footer__brand img {
  max-width: 160px;
  height: auto;
  margin-bottom: 12px;
}

.ap-footer__brand p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--ap-text-muted);
  line-height: 1.6;
  max-width: 360px;
}

.ap-footer__heading {
  margin: 0 0 12px;
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.ap-footer__links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ap-footer__links li {
  margin-bottom: 8px;
}

.ap-footer__links a {
  color: var(--ap-link);
  text-decoration: none;
  font-size: 0.88rem;
}

.ap-footer__links a:hover {
  color: var(--ap-link-hover);
}

.ap-footer__bottom {
  border-top: 1px solid var(--ap-border);
  padding: 14px 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--ap-text-muted);
}

.ap-footer__bottom a {
  color: var(--ap-text-muted);
  text-decoration: none;
}

.ap-footer__bottom a:hover {
  color: var(--ap-text);
}

.ap-back-top {
  position: fixed;
  right: 20px;
  bottom: 24px;
  z-index: 900;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: var(--ap-accent);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.25s, visibility 0.25s, transform 0.25s, background 0.2s;
  box-shadow: var(--ap-shadow);
}

.ap-back-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.ap-back-top:hover {
  background: var(--ap-accent-hover);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1199.98px) {
  .ap-layout__grid {
    grid-template-columns: 220px minmax(0, 1fr) 260px;
    gap: 14px;
  }

  .ap-top-carousel__track:not(.slick-initialized) .ap-top-carousel__slide {
    flex: 0 0 calc(16.66% - 8px);
    min-width: 90px;
  }

  .ap-catalog__grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }
}

@media (max-width: 991.98px) {
  .ap-layout__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .ap-sidebar {
    position: static;
    display: none;
    padding-left: 0;
    padding-right: 0;
  }

  .ap-sidebar::before,
  .ap-sidebar::after {
    display: none;
  }

  .ap-sidebar.is-mobile-open {
    display: block;
  }

  .ap-sidebar--left.is-mobile-open {
    order: -1;
  }

  .ap-sidebar--right {
    display: block;
  }

  .ap-top-carousel__track:not(.slick-initialized) .ap-top-carousel__slide {
    flex: 0 0 calc(20% - 8px);
    min-width: 85px;
  }

  .ap-header__burger {
    display: inline-flex;
  }

  .ap-header__logo-text {
    display: none;
  }

  .ap-header__search {
    max-width: none;
  }

  .ap-footer__grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 767.98px) {
  .ap-header__top {
    flex-wrap: wrap;
  }

  .ap-header__search {
    order: 3;
    flex: 1 1 100%;
    margin: 0;
  }

  .ap-header__actions .ap-btn--ghost {
    display: none;
  }

  .ap-catalog {
    padding: 14px;
  }

  .ap-catalog__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .ap-top-carousel__track:not(.slick-initialized) .ap-top-carousel__slide {
    flex: 0 0 calc(25% - 8px);
    min-width: 80px;
  }

  .ap-footer__grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

@media (max-width: 399.98px) {
  .ap-catalog__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .ap-card__title {
    font-size: 0.78rem;
  }
}

/* Single project page */
.ap-project {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
}

.ap-project__watch {
  min-width: 0;
}

.ap-project__header {
  text-align: left;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--ap-border);
}

.ap-project__title {
  margin: 0;
  font-size: clamp(1.25rem, 2.2vw, 1.65rem);
  font-weight: 800;
  line-height: 1.3;
  color: var(--ap-text);
}

.ap-project__alt {
  margin: 6px 0 0;
  font-size: 0.84rem;
  color: var(--ap-text-muted);
}

.ap-project__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ap-project__tags--stack {
  flex-direction: column;
  align-items: flex-start;
  flex-wrap: nowrap;
  gap: 6px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ap-project__tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--ap-border);
  background: var(--ap-surface-2);
  color: var(--ap-text);
  font-size: 0.74rem;
  font-weight: 700;
  text-decoration: none;
  line-height: 1.2;
  transition: border-color 0.2s, color 0.2s;
}

a.ap-project__tag:hover {
  border-color: var(--ap-link);
  color: var(--ap-link);
}

.ap-project__tag--sub,
.ap-project__tag--dub {
  border-color: rgba(232, 76, 60, 0.45);
  background: linear-gradient(180deg, rgba(232, 76, 60, 0.22) 0%, rgba(192, 57, 43, 0.18) 100%);
  color: #ffb4a8;
}

/* Poster + meta row */
.ap-project__summary {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: start;
}

@media (min-width: 576px) {
  .ap-project__summary {
    grid-template-columns: minmax(130px, 28%) minmax(0, 1fr);
    gap: 20px 24px;
    align-items: stretch;
  }
}

/* Info block — portal panel style */
.ap-project__meta-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.ap-project__meta-col .ap-project__info-panel {
  flex: 1;
  margin-bottom: 0;
}

.ap-project__info-panel .ap-sidebar__title {
  color: var(--ap-text);
}

.ap-info {
  min-width: 0;
  padding: 12px 14px 14px;
}

.ap-info__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 20px;
}

@media (min-width: 640px) {
  .ap-info__grid {
    grid-template-columns: 1fr 1fr;
  }
}

.ap-info__col {
  min-width: 0;
}

.ap-info__field {
  margin-bottom: 14px;
}

.ap-info__field:last-child {
  margin-bottom: 0;
}

.ap-info__label {
  margin-bottom: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ap-text-muted);
}

.ap-info__value {
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--ap-text);
}

.ap-info__link {
  color: var(--ap-link);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.ap-info__link:hover {
  color: var(--ap-link-hover);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ap-info__link--nohref {
  color: var(--ap-text);
  font-weight: 500;
  cursor: default;
}

.ap-info__link--nohref:hover {
  color: var(--ap-text);
  text-decoration: none;
}

.ap-info__text {
  color: var(--ap-text);
  font-weight: 500;
}

.ap-info__text--plain {
  color: var(--ap-text-muted);
  font-weight: 400;
}

.ap-info__sep {
  color: var(--ap-text-muted);
  font-weight: 400;
}

.ap-project__poster-col {
  min-width: 0;
}

.ap-project__description {
  min-width: 0;
}

.ap-project__panel {
  padding: 12px 14px;
  background: var(--ap-surface);
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius);
}

.ap-project__panel--desc {
  margin: 0;
}

.ap-project__poster {
  position: relative;
  border-radius: var(--ap-radius);
  overflow: hidden;
  border: 1px solid var(--ap-border);
  box-shadow: var(--ap-shadow);
  max-width: 200px;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .ap-project__poster {
    max-width: none;
    margin: 0;
  }
}

.ap-project__poster img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: cover;
}

.ap-project__rating {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 800;
  color: #0f1117;
  background: var(--ap-rating-average);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.ap-project__rating--is-excellent { background: var(--ap-rating-excellent); }
.ap-project__rating--is-good { background: var(--ap-rating-good); }
.ap-project__rating--is-average { background: var(--ap-rating-average); }
.ap-project__rating--is-low { background: var(--ap-rating-low); }

.ap-project__stats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
}

.ap-project__stats--vertical {
  grid-template-columns: 1fr;
}

.ap-project__stat {
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.ap-project__stat:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.ap-project__stat:first-child {
  padding-top: 0;
}

.ap-project__stat--row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  border-radius: 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.ap-project__stat--row:last-child {
  border-bottom: 0;
}

.ap-project__stat-label {
  display: block;
  margin-bottom: 0;
  flex: 0 0 auto;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ap-text-muted);
  white-space: nowrap;
}

.ap-project__stat-value {
  display: block;
  flex: 0 1 auto;
  text-align: right;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ap-text);
  white-space: nowrap;
}

.ap-project__stat-value--rating {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  color: #0f1117;
  background: var(--ap-rating-average);
}

.ap-project__stat-value--is-excellent { background: var(--ap-rating-excellent); }
.ap-project__stat-value--is-good { background: var(--ap-rating-good); }
.ap-project__stat-value--is-average { background: var(--ap-rating-average); }
.ap-project__stat-value--is-low { background: var(--ap-rating-low); }

.ap-project__staff {
  list-style: none;
  margin: 12px 0 0;
  padding: 12px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.ap-project__staff-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 0;
}

.ap-project__staff-item--row {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.ap-project__staff-item--row .ap-project__staff-label {
  margin-bottom: 0;
  white-space: nowrap;
}

.ap-project__staff-item--row .ap-project__staff-value {
  text-align: right;
  white-space: nowrap;
}

.ap-project__staff-item + .ap-project__staff-item {
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.ap-project__staff-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ap-text-muted);
}

.ap-project__staff-value {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ap-text);
}

.ap-project__section-title {
  margin: 0 0 8px;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ap-text-muted);
}

.ap-project__description-body {
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--ap-text-muted);
}

.ap-project__description-body p:last-child {
  margin-bottom: 0;
}

.ap-project__description-body a {
  color: var(--ap-link);
}

section, .section-padding {
  padding: 10px 0;
  position: relative;
}
/* Screenshots — full width strip */
.ap-project__screenshots {
  min-width: 0;
  margin-top: 20px;
}

.ap-project__panel--screens {
  padding: 16px 18px;
}

.ap-project__screenshots .ap-project__section-title {
  margin-bottom: 8px;
}

.ap-project__screenshots-track {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.ap-project__screenshots-track::-webkit-scrollbar {
  height: 6px;
}

.ap-project__screenshots-track::-webkit-scrollbar-thumb {
  background: var(--ap-border-light);
  border-radius: 999px;
}

.ap-project__screenshot {
  flex: 0 0 auto;
  width: min(280px, 46vw);
  scroll-snap-align: start;
  display: block;
  border-radius: var(--ap-radius-sm);
  overflow: hidden;
  border: 1px solid var(--ap-border);
  aspect-ratio: 16 / 9;
  transition: border-color 0.2s, transform 0.2s;
}

.ap-project__screenshot:hover,
.ap-project__screenshot:focus {
  border-color: var(--ap-accent);
  transform: translateY(-2px);
}

.ap-project__screenshot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Player */
.ap-project__player-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.ap-project__player-tab {
  border: 1px solid var(--ap-border);
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--ap-surface);
  color: var(--ap-text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.ap-project__player-tab:hover {
  color: var(--ap-text);
  border-color: var(--ap-border-light);
}

.ap-project__player-tab.is-active {
  background: rgba(255, 107, 44, 0.18);
  border-color: var(--ap-accent);
  color: #fff;
}

.ap-project__player-panel {
  display: none;
}

.ap-project__player-panel.is-active {
  display: block;
}

.ap-project__player-panel .ap-project__episodes {
  margin-top: 10px;
}

.ap-project__player {
  border-radius: var(--ap-radius);
  overflow: hidden;
  background: #000;
  border: 1px solid var(--ap-border);
  box-shadow: var(--ap-shadow);
}

.ap-project__player-head {
  padding: 12px 16px;
  background: var(--ap-surface-2);
  border-bottom: 1px solid var(--ap-border);
}

.ap-project__player-label {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--ap-text);
}

.ap-project__player-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.ap-project__player-update {
  margin: 0 0 12px;
  font-size: 0.85rem;
  color: var(--ap-muted);
}

.ap-project__player-update-label {
  font-weight: 700;
  color: var(--ap-text);
  margin-right: 6px;
}

.ap-project__player-video {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  object-fit: contain;
  background: #000;
}

.ap-project__player-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  padding: 24px;
  color: var(--ap-muted);
  font-size: 0.95rem;
  text-align: center;
}

.ap-project__downloads {
  margin-top: 16px;
}

.ap-project__downloads-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ap-project__download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--ap-border);
  background: var(--ap-surface);
  color: var(--ap-text);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.ap-project__download-btn:hover {
  background: var(--ap-surface-2);
  border-color: rgba(255, 255, 255, 0.18);
  color: #fff;
}

/* Episodes */
.ap-project__episodes {
  margin-top: 16px;
  padding: 16px;
  background: var(--ap-surface);
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius);
}

.ap-project__episodes-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.ap-project__episodes-tab {
  border: 1px solid var(--ap-border);
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--ap-surface-2);
  color: var(--ap-text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.ap-project__episodes-tab:hover {
  color: var(--ap-text);
  border-color: var(--ap-border-light);
}

.ap-project__episodes-tab.is-active {
  background: rgba(255, 107, 44, 0.18);
  border-color: var(--ap-accent);
  color: #fff;
}

.ap-project__episodes-panel {
  display: none;
}

.ap-project__episodes-panel.is-active {
  display: block;
}

.ap-project__episodes-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ap-project__episode {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--ap-radius-sm);
  background: var(--ap-surface-2);
  border: 1px solid var(--ap-border);
  color: var(--ap-text);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.ap-project__episode:hover {
  border-color: var(--ap-accent);
  color: #fff;
}

.ap-project__episode.is-active {
  background: var(--ap-accent) !important;
  border-color: var(--ap-accent) !important;
  color: #fff !important;
  box-shadow: 0 0 0 2px rgba(255, 107, 44, 0.25);
}

/* Similar projects */
.ap-project-similar {
  margin: 0 0 12px;
}

.ap-project-similar__panel {
  margin-bottom: 0;
}

.ap-project-similar__grid {
  margin: 0;
  padding: 10px 12px 12px;
}

/* Comments section */
.ap-project-comments-wrap {
  margin-top: 0;
  margin-bottom: 24px;
  padding-top: 12px;
  border-top: 1px solid var(--ap-border);
}

.ap-project-comment-form {
  margin-bottom: 8px;
}

.ap-project-comment-form .comment-reply-title,
.ap-project-comments__title {
  margin: 0 0 18px;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--ap-text);
}

.ap-project-comments {
  margin-bottom: 0;
  padding-top: 8px;
  border-top: 0;
}

.ap-project-comments__header {
  margin-bottom: 14px;
}

.ap-comments__list {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
}

.ap-comments__item {
  margin: 0 0 14px;
  padding: 0;
}

.ap-comments__item .children {
  list-style: none;
  margin: 14px 0 0 16px;
  padding: 0 0 0 14px;
  border-left: 2px solid var(--ap-border);
}

.ap-comment {
  display: flex;
  gap: 12px;
  padding: 14px;
  background: var(--ap-surface);
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius);
}

.ap-comment__avatar-img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

.ap-comment__body {
  flex: 1;
  min-width: 0;
}

.ap-comment__header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
  margin-bottom: 8px;
}

.ap-comment__author {
  font-style: normal;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--ap-text);
}

.ap-comment__author a {
  color: var(--ap-link);
  text-decoration: none;
}

.ap-comment__time {
  font-size: 0.75rem;
  color: var(--ap-text-muted);
}

.ap-comment__content {
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--ap-text-muted);
}

.ap-comment__content p:last-child {
  margin-bottom: 0;
}

.ap-comment__reply a {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ap-accent);
  text-decoration: none;
}

.ap-comment__reply a:hover {
  color: var(--ap-accent-hover);
}

.ap-comment__moderation,
.ap-comments__closed {
  font-size: 0.84rem;
  color: var(--ap-text-muted);
}

.ap-comments__nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  font-size: 0.84rem;
}

.ap-comments__nav a {
  color: var(--ap-link);
  text-decoration: none;
}

.ap-comment-form {
  padding: 18px;
  background: var(--ap-surface);
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius);
}

.ap-comment-form .comment-reply-title {
  margin: 0 0 14px;
  font-size: 1rem;
  font-weight: 800;
  color: var(--ap-text);
}

.ap-comment-form .comment-form {
  display: grid;
  gap: 0;
}

@media (min-width: 768px) {
  .ap-comment-form .comment-form {
    grid-template-columns: 1fr 1fr;
    column-gap: 14px;
  }

  .ap-comment-form__field--comment,
  .ap-comment-form .form-submit {
    grid-column: 1 / -1;
  }
}

.ap-comment-form__field {
  margin: 0 0 12px;
}

.ap-comment-form__field label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ap-text-muted);
}

.ap-comment-form__field input,
.ap-comment-form__field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius-sm);
  background: var(--ap-bg);
  color: var(--ap-text);
  font-size: 0.88rem;
}

.ap-comment-form__field input:focus,
.ap-comment-form__field textarea:focus {
  outline: none;
  border-color: var(--ap-accent);
  box-shadow: 0 0 0 2px rgba(255, 107, 44, 0.15);
}

.ap-comment-form__field textarea {
  min-height: 120px;
  resize: vertical;
}

.ap-comment-form__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 22px;
  border: 0;
  border-radius: var(--ap-radius-sm);
  background: var(--ap-accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.ap-comment-form__submit:hover {
  background: var(--ap-accent-hover);
}

.ap-main .main-container {
  padding: 0 !important;
}

.ap-main .container {
  max-width: none;
  padding: 0;
  width: 100%;
}

/* Legacy single overrides inside portal */
.ap-main .anime-poster,
.ap-main .anime-player,
.ap-main .anime-episodes,
.ap-main .anime-screenshots {
  max-width: 100%;
}

.ap-main .into-title,
.ap-main h1,
.ap-main h2,
.ap-main h3,
.ap-main h4,
.ap-main h5 {
  color: var(--ap-text);
}

.ap-main p,
.ap-main li {
  color: var(--ap-text-muted);
}

/* Hide legacy Anime Heaven header/footer if still present */
body.body-inner #header.header-two,
body.body-inner #footer.footer {
  display: none !important;
}

/* Override legacy section backgrounds on front page */
body.body-inner .bg3 {
  background: transparent !important;
  padding: 0 !important;
}

body.body-inner .section-title,
body.body-inner .section-sub-title {
  color: var(--ap-text);
}

body.body-inner .filter-button .nav-tabs .nav-link {
  color: var(--ap-text-muted);
  border-color: var(--ap-border);
}

body.body-inner .filter-button .nav-tabs .nav-link.active {
  color: #fff;
  background: rgba(255, 107, 44, 0.18);
  border-color: var(--ap-accent);
}

/* --------------------------------------------------------------------------
   Schedule simple (admin-editable)
   -------------------------------------------------------------------------- */
.ap-schedule-simple__title {
  margin: 0;
  padding: 12px 14px;
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
  border-bottom: 1px solid var(--ap-border);
  background: var(--ap-surface-2);
  color: var(--ap-text);
}

.ap-schedule-simple__content {
  padding: 10px 14px 14px;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--ap-text-muted);
}

.ap-schedule-simple__content p {
  margin: 0 0 6px;
}

.ap-schedule-simple__content p:last-child {
  margin-bottom: 0;
}

.ap-schedule-simple__content strong {
  display: block;
  margin: 10px 0 4px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ef7f1a;
}

.ap-schedule-simple__content strong:first-child {
  margin-top: 0;
}

.ap-schedule-simple__content a {
  color: var(--ap-link);
  text-decoration: none;
  font-weight: 600;
}

.ap-schedule-simple__content a:hover {
  color: var(--ap-link-hover);
  text-decoration: underline;
}

.ap-schedule-simple__empty {
  margin: 0;
  padding: 12px 14px;
  font-size: 0.84rem;
  color: var(--ap-text-muted);
}

/* --------------------------------------------------------------------------
   Schedule accordion (legacy)
   -------------------------------------------------------------------------- */
.ap-schedule {
  background: #f8e8d8;
  border-color: #e8872e;
  color: #4a3424;
}

.ap-schedule__header {
  padding: 10px 12px 8px;
  text-align: center;
  border-bottom: 1px solid rgba(232, 135, 46, 0.35);
}

.ap-schedule__title {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 800;
  color: #d35400;
}

.ap-schedule__notice {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.4;
  color: #6b4a34;
}

.ap-schedule__accordion {
  padding: 0;
}

.ap-schedule__day {
  border-top: 1px solid rgba(255, 255, 255, 0.45);
}

.ap-schedule__day-btn {
  width: 100%;
  border: 0;
  padding: 9px 10px;
  background: #ef7f1a;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s;
}

.ap-schedule__day-btn:hover,
.ap-schedule__day.is-open .ap-schedule__day-btn {
  background: #d96f12;
}

.ap-schedule__panel {
  background: #f3dcc8;
  padding: 8px 10px 10px;
}

.ap-schedule__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ap-schedule__item {
  position: relative;
  border-top: 1px solid rgba(255, 255, 255, 0.35);
}

.ap-schedule__item:first-child {
  border-top: 0;
}

.ap-schedule__link {
  display: block;
  padding: 6px 2px;
  color: #7a3f12;
  text-decoration: none;
  font-size: 0.76rem;
  line-height: 1.35;
}

.ap-schedule__link:hover {
  color: #4a2408;
}

.ap-schedule__link-time {
  white-space: nowrap;
}

.ap-schedule__tooltip {
  display: none;
}

.ap-schedule__footer {
  margin: 0;
  padding: 8px 10px 10px;
  text-align: center;
  font-size: 0.68rem;
  line-height: 1.35;
  color: #c0392b;
}

.ap-schedule__empty {
  margin: 0;
  font-size: 0.76rem;
  color: #6b4a34;
}

.ap-schedule__flyout {
  position: fixed;
  z-index: 1200;
  max-width: 360px;
  pointer-events: none;
}

.ap-schedule__flyout.is-visible {
  display: block !important;
}

.ap-schedule__flyout .ap-schedule__tooltip-inner {
  display: flex;
  gap: 10px;
  padding: 12px;
  background: rgba(255, 236, 179, 0.97);
  border: 1px solid #e8872e;
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  color: #4a3424;
}

.ap-schedule__flyout .ap-schedule__tooltip-title {
  display: block;
  margin-bottom: 4px;
  font-size: 0.84rem;
  color: #7a3f12;
}

.ap-schedule__flyout .ap-schedule__tooltip-time {
  display: inline-block;
  margin-bottom: 6px;
  font-size: 0.72rem;
  color: #9a5b22;
}

.ap-schedule__flyout p {
  margin: 0;
  font-size: 0.76rem;
  line-height: 1.45;
}

.ap-schedule__flyout .ap-schedule__tooltip-poster img {
  width: 90px;
  height: auto;
  border-radius: 4px;
  display: block;
}

/* --------------------------------------------------------------------------
   Highlights & goals
   -------------------------------------------------------------------------- */
.ap-highlights__title,
.ap-goals__title {
  margin: 0;
  padding: 12px 14px;
  font-size: 0.9rem;
  font-weight: 700;
  border-bottom: 1px solid var(--ap-border);
  background: var(--ap-surface-2);
}

.ap-highlights__links {
  list-style: none;
  margin: 0;
  padding: 8px 0;
}

.ap-highlights__links a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  color: var(--ap-link);
  text-decoration: none;
  font-size: 0.86rem;
}

.ap-highlights__links a:hover {
  background: rgba(110, 168, 255, 0.06);
}

.ap-highlights__order-btn {
  display: block;
  width: calc(100% - 24px);
  margin: 4px 12px 14px;
  padding: 11px 14px;
  border: 0;
  border-radius: var(--ap-radius-sm);
  background: linear-gradient(180deg, #ef7f1a, #d96f12);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.35;
  cursor: pointer;
  transition: filter 0.2s;
}

.ap-highlights__order-btn:hover {
  filter: brightness(1.06);
}

.ap-goals__item {
  padding: 12px 14px 14px;
  border-top: 1px solid var(--ap-border);
}

.ap-goals__item:first-of-type {
  border-top: 0;
}

.ap-goals__event {
  margin: 0 0 8px;
  font-size: 0.84rem;
  line-height: 1.35;
  color: var(--ap-text);
}

.ap-goals__stats {
  margin: 0 0 8px;
  font-size: 0.78rem;
  color: var(--ap-text-muted);
}

.ap-goals__bar {
  height: 10px;
  border-radius: 999px;
  background: var(--ap-bg);
  overflow: hidden;
  margin-bottom: 10px;
}

.ap-goals__bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ef7f1a, #f5b041);
}

.ap-goals__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: var(--ap-radius-sm);
  background: var(--ap-accent);
  color: #fff;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 700;
}

.ap-goals__btn:hover {
  background: var(--ap-accent-hover);
  color: #fff;
}

.ap-goals__empty {
  margin: 0;
  padding: 12px 14px;
  font-size: 0.84rem;
  color: var(--ap-text-muted);
}

/* --------------------------------------------------------------------------
   Order modal
   -------------------------------------------------------------------------- */
.ap-order-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.ap-order-modal[hidden] {
  display: none !important;
}

.ap-order-modal.is-open {
  display: flex !important;
}

.ap-order-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
}

.ap-order-modal__dialog {
  position: relative;
  width: min(960px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: var(--ap-surface);
  border: 1px solid var(--ap-border);
  border-radius: 12px;
  padding: 18px;
  box-shadow: var(--ap-shadow);
}

.ap-order-modal__close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: 0;
  background: transparent;
  color: var(--ap-text-muted);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.ap-order-modal__title {
  margin: 0 0 16px;
  padding-right: 28px;
  font-size: 1.2rem;
}

.ap-order-modal__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.ap-order-modal__tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.ap-order-modal__tab {
  border: 1px solid var(--ap-border);
  background: var(--ap-bg-elevated);
  color: var(--ap-text-muted);
  padding: 7px 14px;
  border-radius: var(--ap-radius-sm);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.84rem;
}

.ap-order-modal__tab.is-active {
  color: #fff;
  border-color: var(--ap-accent);
  background: rgba(255, 107, 44, 0.2);
}

.ap-order-modal__tab-panel[hidden] {
  display: none !important;
}

.ap-order-modal__video {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
}

.ap-order-modal__video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.ap-order-modal__text {
  padding: 12px;
  background: var(--ap-bg-elevated);
  border: 1px solid var(--ap-border);
  border-radius: 8px;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--ap-text-muted);
}

.ap-order-modal__placeholder {
  margin: 0;
  padding: 24px;
  text-align: center;
  color: var(--ap-text-muted);
}

.ap-order-modal__field {
  display: block;
  margin-bottom: 12px;
}

.ap-order-modal__field span {
  display: block;
  margin-bottom: 6px;
  font-size: 0.82rem;
  font-weight: 600;
}

.ap-order-modal__field input,
.ap-order-modal__field textarea {
  width: 100%;
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius-sm);
  background: var(--ap-bg-elevated);
  color: var(--ap-text);
  padding: 10px 12px;
  font-size: 0.88rem;
}

.ap-order-modal__submit {
  width: 100%;
  border: 0;
  border-radius: var(--ap-radius-sm);
  padding: 11px 14px;
  background: var(--ap-accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.ap-order-modal__submit:hover {
  background: var(--ap-accent-hover);
}

body.ap-order-modal-open {
  overflow: hidden;
}

@media (max-width: 767.98px) {
  .ap-order-modal__grid {
    grid-template-columns: 1fr;
  }

  .ap-schedule__flyout {
    max-width: calc(100vw - 24px);
  }
}
