:root {
  --bg: #f7f8f6;
  --surface: #ffffff;
  --surface-soft: #f0f5f3;
  --surface-warm: #fff4ee;
  --ink: #17201d;
  --muted: #68746f;
  --line: #dfe6e2;
  --line-strong: #cad7d0;
  --coral: #d95d47;
  --coral-dark: #b94332;
  --teal: #0f8b7d;
  --teal-dark: #0a655b;
  --plum: #6f4a8e;
  --gold: #be8230;
  --danger: #b42318;
  --shadow: 0 18px 50px rgba(24, 38, 33, .10);
  --shadow-soft: 0 12px 30px rgba(24, 38, 33, .08);
  --radius: 8px;
  --container: 1200px;
  --tap: 44px;
  --primary: var(--teal);
  --card: var(--surface);
  --text: var(--ink);
  --text-muted: var(--muted);
  --font-serif: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 18% 0%, rgba(15, 139, 125, .10), transparent 28rem),
    linear-gradient(180deg, #fbfcfa 0%, var(--bg) 36rem);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(15, 139, 125, .26);
  outline-offset: 3px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

img,
svg {
  display: block;
}

img {
  max-width: 100%;
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

svg path[fill],
.button--primary svg path,
.player-frame__button svg path {
  fill: currentColor;
  stroke: none;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  left: 12px;
  top: 12px;
  z-index: 1000;
  transform: translateY(-140%);
  border-radius: var(--radius);
  padding: 10px 14px;
  color: #fff;
  background: var(--ink);
}

.skip-link:focus {
  transform: translateY(0);
}

.container,
.page {
  width: min(100% - 32px, var(--container));
  margin: 0 auto;
}

.site-shell {
  min-height: 100dvh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid rgba(223, 230, 226, .92);
  background: rgba(247, 248, 246, .92);
  backdrop-filter: blur(18px);
}

.topbar__inner {
  width: min(100% - 32px, var(--container));
  min-height: 72px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto;
  gap: 18px;
  align-items: center;
}

.brand {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 800;
}

.brand__mark {
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--coral), var(--teal));
  box-shadow: 0 8px 22px rgba(15, 139, 125, .26);
  font-size: 16px;
  font-weight: 900;
}

.top-search {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}

.top-search svg {
  position: absolute;
  left: 14px;
  width: 19px;
  height: 19px;
  color: var(--muted);
  pointer-events: none;
}

.top-search input,
.search-form input,
.filter-control,
.filter-select,
.folder-hub-search input,
.report-select,
.report-textarea,
.comment-input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  outline: none;
}

.top-search input {
  padding: 0 14px 0 44px;
}

.top-search input:focus,
.search-form input:focus,
.filter-control:focus,
.filter-select:focus,
.folder-hub-search input:focus,
.report-select:focus,
.report-textarea:focus,
.comment-input:focus {
  border-color: rgba(15, 139, 125, .65);
  box-shadow: 0 0 0 4px rgba(15, 139, 125, .12);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.nav__link,
.nav__icon,
.nav__user,
.button,
.filter-submit,
.page-link,
.btn-login,
.btn-register,
.comment-submit,
.report-submit-btn,
.film-share-btn,
.follow-btn,
.ep-show-more,
.ep-mark-all {
  min-height: var(--tap);
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
}

.nav__link,
.nav__icon,
.nav__user {
  border: 0;
  padding: 0 13px;
  background: transparent;
  color: var(--muted);
  white-space: nowrap;
}

.nav__icon {
  width: var(--tap);
  padding: 0;
}

.nav__link:hover,
.nav__link.active,
.nav__icon:hover {
  color: var(--ink);
  background: var(--surface-soft);
}

.nav__login {
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
}

.nav__user {
  position: relative;
  width: var(--tap);
  padding: 0;
  border: 1px solid var(--line);
  background: var(--surface);
}

.nav__user img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
}

.nav-follow-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  min-height: 18px;
  border-radius: 999px;
  padding: 0 5px;
  color: #fff;
  background: var(--coral);
  font-size: 11px;
  line-height: 18px;
  text-align: center;
}

.main-content {
  padding: 28px 0 72px;
}

.page {
  display: block;
}

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) 360px;
  gap: 24px;
  align-items: start;
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(110deg, rgba(23, 32, 29, .96) 0%, rgba(23, 32, 29, .84) 46%, rgba(23, 32, 29, .20) 100%),
    var(--hero-image) center right 18% / auto 115% no-repeat,
    #17201d;
  color: #fff;
  box-shadow: var(--shadow);
}

.hero__content {
  width: min(620px, 100%);
  padding: 34px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, .78);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 2px;
  background: var(--coral);
}

.hero h1,
.hero h2 {
  max-width: 11ch;
  margin-top: 18px;
  font-size: clamp(38px, 6vw, 68px);
  line-height: .98;
  letter-spacing: 0;
}

.hero-feature {
  width: min(420px, 100%);
  margin-top: 18px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: grid;
  gap: 3px;
  background: rgba(255, 255, 255, .08);
}

.hero-feature span {
  color: rgba(255, 255, 255, .62);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.hero-feature strong {
  overflow: hidden;
  color: #fff;
  font-size: 16px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero__lead {
  max-width: 560px;
  margin-top: 18px;
  color: rgba(255, 255, 255, .82);
  font-size: 18px;
}

.hero__actions,
.score-row,
.meta-row,
.footer-nav,
.folder-link-strip__list,
.film-lists,
.comment-login-cta__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero__actions {
  margin-top: 26px;
}

.button {
  border: 1px solid transparent;
  padding: 0 17px;
  white-space: nowrap;
  transition: transform .18s ease, background .18s ease, border-color .18s ease, color .18s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button--primary,
.filter-submit,
.comment-submit,
.report-submit-btn,
.film-share-btn,
.follow-btn {
  color: #fff;
  background: var(--coral);
}

.button--primary:hover,
.filter-submit:hover,
.comment-submit:hover,
.report-submit-btn:hover,
.film-share-btn:hover,
.follow-btn:hover {
  background: var(--coral-dark);
}

.button--ghost {
  color: #fff;
  border-color: rgba(255, 255, 255, .28);
  background: rgba(255, 255, 255, .08);
}

.button--light,
.btn-login,
.btn-register {
  color: var(--ink);
  border: 1px solid var(--line);
  background: var(--surface);
}

.button--teal {
  color: #fff;
  background: var(--teal);
}

.hero__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 30px;
  max-width: 560px;
}

.stat {
  min-height: 84px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: var(--radius);
  padding: 12px;
  background: rgba(255, 255, 255, .08);
}

.stat strong {
  display: block;
  font-size: 24px;
  line-height: 1.1;
}

.stat span {
  display: block;
  margin-top: 6px;
  color: rgba(255, 255, 255, .68);
  font-size: 13px;
  line-height: 1.35;
}

.side-panel,
.content-panel,
.poster-card,
.detail-poster,
.detail-head,
.folder-hub-hero,
.folder-hub-card,
.auth-card,
.profile-card,
.search-card,
.admin-card,
.history-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.side-panel {
  overflow: hidden;
}

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

.panel-head h2 {
  font-size: 18px;
  line-height: 1.25;
}

.panel-link {
  color: var(--teal-dark);
  font-size: 14px;
  font-weight: 800;
}

.update-list {
  display: grid;
}

.update-item {
  min-height: 76px;
  padding: 12px 16px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.update-item:last-child {
  border-bottom: 0;
}

.update-thumb {
  width: 44px;
  height: 56px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--surface-soft);
}

.update-title {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.update-meta {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.episode-pill {
  min-width: 42px;
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--teal-dark);
  background: #e5f4f1;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.quick-section {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.quick-card {
  min-height: 118px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--surface);
  box-shadow: 0 8px 22px rgba(24, 38, 33, .06);
  transition: transform .18s ease, border-color .18s ease;
}

.quick-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.quick-card svg {
  width: 22px;
  height: 22px;
  color: var(--coral);
}

.quick-card strong {
  display: block;
  margin-top: 12px;
  font-size: 15px;
  line-height: 1.22;
}

.quick-card span span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.section {
  margin-top: 34px;
}

.section--featured {
  padding-top: 4px;
}

.section__head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.section__head h2 {
  font-size: clamp(24px, 4vw, 34px);
  line-height: 1.08;
}

.section__head p {
  max-width: 560px;
  color: var(--muted);
}

.filters,
.filter-bar {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  background: var(--surface);
}

.filter-control,
.filter-select {
  padding: 0 12px;
  background: var(--surface-soft);
}

.filter-submit,
.filter-reset {
  border: 0;
  padding: 0 14px;
}

.filter-reset {
  color: var(--muted);
}

.poster-grid,
.dorama-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
}

.poster-grid--compact,
.related-section .dorama-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.poster-card {
  min-width: 0;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(24, 38, 33, .07);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.poster-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 16px 34px rgba(24, 38, 33, .12);
  transform: translateY(-2px);
}

.poster-card__image {
  position: relative;
  aspect-ratio: 2 / 3;
  display: block;
  overflow: hidden;
  background: var(--surface-soft);
}

.poster-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .28s ease;
}

.poster-card:hover .poster-card__image img {
  transform: scale(1.035);
}

.poster-card__rating,
.poster-card__status {
  position: absolute;
  z-index: 1;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.poster-card__rating {
  top: 9px;
  left: 9px;
  min-height: 30px;
  padding: 5px 9px;
  color: #fff;
  background: rgba(23, 32, 29, .86);
}

.poster-card__status {
  right: 9px;
  bottom: 9px;
  padding: 4px 8px;
  color: #963725;
  background: #ffe7df;
}

.poster-card__status.is-ongoing {
  color: var(--teal-dark);
  background: #e3f5f2;
}

.poster-card__body {
  padding: 11px;
}

.poster-card h3 {
  min-height: 40px;
  font-size: 15px;
  line-height: 1.28;
}

.meta-row {
  margin-top: 8px;
  gap: 6px;
}

.meta-row--genres {
  margin-top: 6px;
}

.tag {
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 8px;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 800;
}

.tag--coral {
  color: #963725;
  background: #ffe7df;
}

.tag--teal {
  color: var(--teal-dark);
  background: #e3f5f2;
}

.tag--plum {
  color: #5c377c;
  background: #f0e6f6;
}

.editorial-strip {
  margin-top: 22px;
  display: grid;
  grid-template-columns: 1.2fr repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.collection-card {
  min-height: 176px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  background: var(--surface-warm);
  box-shadow: 0 10px 24px rgba(24, 38, 33, .06);
}

.collection-card:first-child {
  color: #fff;
  background: linear-gradient(135deg, rgba(15, 139, 125, .96), rgba(111, 74, 142, .92)), var(--teal);
}

.collection-card h3 {
  font-size: 21px;
  line-height: 1.15;
}

.collection-card p {
  margin-top: 8px;
  color: rgba(23, 32, 29, .66);
}

.collection-card:first-child p {
  color: rgba(255, 255, 255, .76);
}

.collection-card > span:last-child {
  margin-top: 18px;
  font-weight: 900;
}

.detail-page {
  padding-bottom: 48px;
}

.detail-layout {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.detail-poster {
  position: sticky;
  top: 96px;
  overflow: hidden;
}

.detail-poster > img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
}

.watch-box {
  padding: 14px;
  display: grid;
  gap: 10px;
  background: var(--surface);
}

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

.detail-head {
  padding: 24px;
}

.crumbs,
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.crumbs a,
.breadcrumbs a,
.footer-nav a,
.content-panel a {
  color: var(--teal-dark);
}

.detail-title {
  margin-top: 12px;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.02;
  max-width: 850px;
}

.detail-subtitle {
  margin-top: 10px;
  color: var(--muted);
  font-size: 18px;
}

.detail-summary {
  margin-top: 20px;
  border-left: 3px solid var(--coral);
  padding: 2px 0 2px 16px;
}

.detail-summary h2 {
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.detail-summary p {
  max-width: 760px;
  margin-top: 8px;
  color: #303b36;
  font-size: 16px;
  line-height: 1.7;
}

.score-row {
  margin-top: 18px;
  align-items: center;
}

.score {
  min-height: 44px;
  border-radius: var(--radius);
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  background: #fff0d8;
  font-weight: 900;
}

.score svg {
  width: 18px;
  height: 18px;
  color: var(--gold);
  fill: var(--gold);
}

.spec-grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.spec {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: var(--surface-soft);
}

.spec span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.spec strong {
  display: block;
  margin-top: 4px;
  font-size: 15px;
}

.tabs {
  margin-top: 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 6px;
  overflow-x: auto;
}

.tab {
  min-height: 48px;
  border-bottom: 3px solid transparent;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-weight: 900;
  white-space: nowrap;
}

.tab.is-active,
.tab:hover {
  color: var(--ink);
  border-bottom-color: var(--coral);
}

.content-panel {
  margin-top: 18px;
  padding: 22px;
}

.content-panel h1,
.content-panel h2 {
  font-size: 24px;
  line-height: 1.2;
}

.content-panel h3 {
  font-size: 18px;
}

.content-panel p {
  margin-top: 12px;
  color: #39443f;
  line-height: 1.68;
}

.film-intent {
  margin-top: 18px;
  color: var(--muted);
}

.player-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.player-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.player-flags span {
  min-height: 30px;
  border-radius: 999px;
  padding: 5px 10px;
  display: inline-flex;
  align-items: center;
  color: var(--teal-dark);
  background: #e3f5f2;
  font-size: 12px;
  font-weight: 900;
}

.player-wrap {
  margin-top: 18px;
}

.player-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #fff;
  background-color: #17201d;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

.player-frame__button {
  width: 74px;
  height: 74px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(217, 93, 71, .96);
  box-shadow: 0 18px 46px rgba(0, 0, 0, .28);
}

.player-frame__button svg {
  width: 31px;
  height: 31px;
  margin-left: 4px;
}

.player-cover-label {
  align-self: end;
  margin-bottom: 24px;
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(23, 32, 29, .76);
  font-weight: 900;
}

.bm-controls,
.user-rating,
.detail-actions-grid,
.actions-cluster {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bm-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.bm-btn,
.ur-star,
.ur-clear,
.share-chip,
.folder-link-chip {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  background: var(--surface-soft);
  font-weight: 800;
}

.bm-btn.active,
.ur-star.is-set,
.follow-btn[aria-pressed="true"] {
  border-color: rgba(15, 139, 125, .34);
  color: var(--teal-dark);
  background: #e3f5f2;
}

.bm-btn-remove,
.ur-clear {
  color: var(--danger);
}

.actions-caption {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.detail-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.film-share {
  position: relative;
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.film-share-fallback {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.film-share-toast {
  color: var(--teal-dark);
  font-weight: 800;
}

.film-lists {
  margin-top: 16px;
  color: var(--muted);
}

.fl-stat b {
  color: var(--ink);
}

.folder-link-strip__list {
  margin-top: 12px;
}

.folder-link-chip {
  min-height: 58px;
  flex-direction: column;
  align-items: flex-start;
}

.folder-link-chip__title {
  font-weight: 900;
}

.folder-link-chip__meta {
  color: var(--muted);
  font-size: 13px;
}

.ep-season {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.ep-season-head {
  min-height: 50px;
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 900;
}

.ep-season-count,
.ep-status,
.ep-progress {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.ep-table {
  width: 100%;
  border-collapse: collapse;
}

.ep-table th,
.ep-table td {
  border-top: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: middle;
}

.ep-table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.ep-today {
  background: #fff4ee;
}

.ep-upcoming {
  color: var(--muted);
}

.ep-show-more,
.ep-mark-all {
  border: 1px solid var(--line);
  padding: 0 10px;
  background: var(--surface-soft);
}

.ep-watched {
  width: 18px;
  height: 18px;
}

.stills-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.still-thumb {
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-soft);
}

.still-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.still-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  place-items: center;
  padding: 24px;
}

.still-overlay:target {
  display: grid;
}

.still-overlay__bg {
  position: absolute;
  inset: 0;
  background: rgba(23, 32, 29, .82);
}

.still-overlay > img {
  position: relative;
  z-index: 1;
  max-height: 88vh;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.still-overlay__close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(23, 32, 29, .86);
  font-size: 28px;
}

.related-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.compact-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 10px;
  background: var(--surface);
}

.compact-card img {
  width: 64px;
  height: 86px;
  border-radius: 6px;
  object-fit: cover;
}

.compact-card strong {
  display: block;
  font-size: 14px;
  line-height: 1.25;
}

.compact-card span span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.comment-list {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.comment-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--surface-soft);
}

.comment-item--reply,
.comment-replies {
  margin-top: 10px;
}

.comment-meta {
  color: var(--muted);
  font-size: 13px;
}

.comment-body {
  margin-top: 8px;
}

.cm-reply-btn,
.cm-tool,
.cm-cancel-reply {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 10px;
  background: var(--surface);
}

.comment-form {
  margin-top: 18px;
  display: grid;
  gap: 10px;
}

.cm-toolbar {
  display: flex;
  gap: 8px;
}

.comment-input,
.report-textarea {
  min-height: 120px;
  padding: 12px;
  resize: vertical;
}

.comment-submit,
.report-submit-btn {
  border: 0;
  padding: 0 16px;
  justify-self: start;
}

.comment-note,
.comment-empty,
.comment-login-cta p,
.report-chars,
.report-status {
  color: var(--muted);
}

.faq details {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: var(--surface-soft);
}

.faq summary {
  cursor: pointer;
  font-weight: 900;
}

.report-modal-overlay,
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  background: rgba(23, 32, 29, .72);
  backdrop-filter: blur(8px);
}

.search-overlay.open,
.report-modal-overlay:not([hidden]) {
  display: grid;
  place-items: start center;
}

.search-overlay-inner {
  width: min(720px, calc(100% - 32px));
  margin-top: 12vh;
}

.search-close,
.report-modal-close {
  position: fixed;
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(23, 32, 29, .86);
  font-size: 28px;
}

.search-form-wrap {
  position: relative;
}

.search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 54px;
  gap: 8px;
}

.search-form input {
  min-height: 58px;
  padding: 0 18px;
  font-size: 18px;
}

.search-form button {
  border: 0;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--teal);
}

.search-form button svg {
  width: 22px;
  height: 22px;
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: min(420px, 60vh);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.search-dropdown a {
  padding: 10px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.search-dropdown img {
  width: 36px;
  height: 54px;
  border-radius: 4px;
  object-fit: cover;
}

.sd-title {
  display: block;
  font-weight: 900;
}

.sd-meta {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.report-modal {
  width: min(520px, calc(100% - 32px));
  margin-top: 12vh;
  border-radius: var(--radius);
  padding: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.report-form {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

.report-label {
  font-weight: 900;
}

.report-select {
  padding: 0 12px;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 calc(28px + env(safe-area-inset-bottom));
  color: var(--muted);
  background: rgba(255, 255, 255, .72);
}

.footer-nav {
  margin-bottom: 12px;
}

.footer-copy {
  margin-top: 6px;
  color: var(--muted);
}

.bottom-nav {
  display: none;
}

.pagination {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.page-link {
  min-width: 44px;
  border: 1px solid var(--line);
  padding: 0 12px;
  color: var(--ink);
  background: var(--surface);
}

.page-link.current {
  color: #fff;
  border-color: var(--teal);
  background: var(--teal);
}

.page-link--dots {
  opacity: .45;
}

.no-results,
.empty-panel {
  text-align: center;
}

.catalog-page,
.folder-page {
  padding-top: 20px;
  padding-bottom: 48px;
}

.catalog-hero {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .92), rgba(240, 245, 243, .92)),
    var(--surface);
  box-shadow: var(--shadow-soft);
}

.catalog-kicker {
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.catalog-title,
.hub-title {
  margin-top: 8px;
  font-size: clamp(32px, 5vw, 50px);
  line-height: 1.04;
}

.catalog-subtitle,
.hub-desc {
  max-width: 720px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.catalog-count {
  min-width: 150px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--surface);
}

.catalog-count strong {
  display: block;
  font-size: 34px;
  line-height: 1;
}

.catalog-count span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.catalog-chips {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.catalog-chips a {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  background: var(--surface);
  font-size: 13px;
  font-weight: 900;
}

.catalog-chips a:hover {
  border-color: rgba(15, 139, 125, .36);
  color: var(--teal-dark);
  background: #e3f5f2;
}

.catalog-page .filter-bar {
  margin-top: 16px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.folder-page .hub-header {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.folder-hub,
.auth-page,
.profile-page,
.search-page {
  padding-top: 20px;
  padding-bottom: 48px;
}

.folder-hub-hero {
  margin-top: 14px;
  padding: 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
}

.folder-hub-kicker {
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.folder-hub-hero h1 {
  margin-top: 8px;
  font-size: clamp(32px, 5vw, 54px);
  line-height: 1.02;
}

.folder-hub-hero p {
  max-width: 720px;
  margin-top: 12px;
  color: var(--muted);
}

.folder-hub-stats {
  display: grid;
  gap: 8px;
}

.folder-hub-stats span {
  border-radius: var(--radius);
  padding: 10px 12px;
  background: var(--surface-soft);
}

.folder-hub-section {
  margin-top: 24px;
}

.folder-hub-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.folder-hub-search {
  position: relative;
  margin-top: 14px;
}

.folder-hub-search input {
  padding: 0 44px 0 14px;
}

.folder-hub-search__clear {
  position: absolute;
  right: 6px;
  top: 6px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: var(--surface-soft);
}

.folder-hub-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.folder-hub-card {
  padding: 14px;
  display: grid;
  gap: 12px;
}

.folder-hub-card--media {
  grid-template-columns: 84px minmax(0, 1fr);
}

.folder-hub-card__poster img {
  width: 84px;
  height: 126px;
  border-radius: 6px;
  object-fit: cover;
}

.folder-hub-card__meta,
.folder-hub-empty {
  color: var(--muted);
  font-size: 13px;
}

.folder-hub-card__title {
  display: block;
  margin-top: 4px;
  font-size: 18px;
  font-weight: 900;
}

.folder-hub-card__desc {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.admin-toolbar {
  width: min(100% - 32px, var(--container));
  margin: 0 auto 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  background: var(--surface);
}

.admin-toolbar-label {
  font-weight: 900;
}

.admin-toolbar-form {
  margin: 0;
}

.admin-toolbar-btn {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  background: var(--surface-soft);
  font-weight: 800;
}

.admin-toolbar-btn-warn {
  color: #fff;
  border-color: var(--danger);
  background: var(--danger);
}

.admin-toolbar-btn-ok {
  color: #fff;
  border-color: var(--teal);
  background: var(--teal);
}

@media (max-width: 1100px) {
  .topbar__inner {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px 0;
  }

  .nav {
    justify-content: flex-start;
    overflow-x: auto;
  }

  .home-grid,
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .detail-poster {
    position: static;
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
  }

  .detail-poster > img {
    height: 100%;
  }

  .quick-section,
  .poster-grid,
  .dorama-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .filters,
  .filter-bar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .editorial-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .related-grid,
  .folder-hub-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .catalog-page .filter-bar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .container,
  .page,
  .topbar__inner {
    width: min(100% - 22px, var(--container));
  }

  .main-content {
    padding-top: 18px;
    padding-bottom: 92px;
  }

  .brand {
    font-size: 20px;
  }

  .top-search {
    display: none;
  }

  .nav__link:not(.nav__login) {
    display: none;
  }

  .hero {
    min-height: auto;
    background:
      linear-gradient(180deg, rgba(23, 32, 29, .84) 0%, rgba(23, 32, 29, .94) 100%),
      var(--hero-image) center top / cover no-repeat,
      #17201d;
  }

  .hero__content {
    padding: 26px 18px;
  }

  .hero__lead {
    font-size: 16px;
  }

  .hero__stats,
  .spec-grid,
  .filters,
  .filter-bar,
  .quick-section,
  .poster-grid,
  .dorama-grid,
  .editorial-strip,
  .related-grid,
  .stills-grid,
  .detail-actions-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .detail-poster {
    grid-template-columns: 130px minmax(0, 1fr);
  }

  .watch-box {
    align-content: center;
  }

  .detail-head,
  .content-panel {
    padding: 18px;
  }

  .folder-hub-hero {
    grid-template-columns: 1fr;
  }

  .catalog-hero,
  .player-head {
    align-items: flex-start;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .catalog-count {
    width: 100%;
  }

  .bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    min-height: 64px;
    border-top: 1px solid var(--line);
    padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 5px;
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(18px);
  }

  .bottom-nav a,
  .bottom-nav button {
    min-height: 48px;
    border: 0;
    border-radius: var(--radius);
    display: grid;
    place-items: center;
    color: var(--muted);
    background: transparent;
    font-size: 11px;
    font-weight: 800;
  }

  .bottom-nav a.active,
  .bottom-nav button:hover {
    color: var(--teal-dark);
    background: #e3f5f2;
  }

  .bottom-nav svg {
    width: 22px;
    height: 22px;
  }
}

@media (max-width: 460px) {
  .hero__stats,
  .spec-grid,
  .quick-section,
  .editorial-strip,
  .related-grid,
  .folder-hub-grid,
  .detail-actions-grid {
    grid-template-columns: 1fr;
  }

  .filters,
  .filter-bar,
  .catalog-page .filter-bar {
    grid-template-columns: 1fr;
  }

  .poster-grid,
  .dorama-grid,
  .stills-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-poster {
    grid-template-columns: 1fr;
  }

  .detail-poster > img {
    max-height: 520px;
  }

  .compact-card {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .ep-table {
    display: block;
    overflow-x: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
    animation-duration: .001ms !important;
  }
}
