:root {
  --bg: #030404;
  --panel: #0a0c0d;
  --panel-2: #111416;
  --surface: rgba(12, 14, 15, .98);
  --surface-2: rgba(17, 20, 22, .98);
  --field: #090b0c;
  --field-text: #f6f7f8;
  --line: #222629;
  --text: #f6f7f8;
  --muted: #8f979f;
  --accent: #8b5cf6;
  --accent-2: #49b8ad;
  --glow-a: transparent;
  --glow-b: transparent;
  --shadow: 0 20px 60px rgba(0, 0, 0, .28);
  --radius: 8px;
}

/* Global detail v2: a focused title page with tabs, metadata rail, cast and community reviews. */
body.global-mode .global-detail-redesign {
  width: min(1420px, calc(100vw - 72px));
  min-height: calc(100vh - 108px);
  padding: 24px 0 80px;
}

body.global-mode .global-detail-redesign .global-detail-backdrop {
  inset: -4% -10% 42%;
  opacity: .42;
  filter: saturate(.82) contrast(1.04);
  mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,.88) 46%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,.88) 46%, transparent 100%);
}

body.global-mode .global-detail-redesign .global-detail-shade {
  background: linear-gradient(180deg, rgba(6,7,12,.52), rgba(6,7,12,.82) 43%, var(--bg) 70%), linear-gradient(90deg, rgba(6,7,12,.92) 0%, rgba(6,7,12,.58) 48%, rgba(6,7,12,.82) 100%);
}

.global-detail-redesign .global-detail-nav {
  min-height: 46px;
  margin-bottom: 18px;
}

.global-detail-redesign .global-detail-hero {
  grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
  gap: clamp(28px, 4.5vw, 72px);
  width: min(1040px, 100%);
  min-height: 360px;
  margin: 0 auto 34px;
  padding: 22px 0 20px;
}

.global-detail-redesign .global-detail-poster-shell { width: 220px; }
.global-detail-redesign .global-detail-poster-shell .poster,
.global-detail-redesign .global-detail-poster-shell .cover-fallback,
.global-detail-redesign .global-detail-poster { border-radius: 14px; box-shadow: 0 25px 50px rgba(0,0,0,.32); }
.global-detail-redesign .global-detail-copy { max-width: 780px; }
.global-detail-redesign .global-detail-copy h1 { max-width: 740px; font-size: clamp(34px, 4.4vw, 60px); line-height: 1.02; }
.global-detail-redesign .global-detail-kicker { color: #bca2ff; font-size: 9px; letter-spacing: .14em; }
.global-detail-redesign .global-detail-rating-line { display: flex; align-items: center; gap: 10px; margin-top: 13px; color: var(--global-muted); font-size: 11px; }
.global-detail-redesign .global-detail-rating-line strong { display: inline-flex; align-items: center; gap: 6px; color: #f8d568; font-size: 14px; }
.global-detail-redesign .global-detail-rating-line strong i { font-size: 12px; }
.global-detail-redesign .global-detail-tags { margin-top: 14px; }
.global-detail-redesign .global-detail-summary { max-width: 680px; margin-top: 16px; font-size: 13px; line-height: 1.65; }
.global-detail-redesign .global-detail-actions { margin-top: 20px; }
.global-detail-redesign .global-detail-actions .btn { min-height: 40px; border-radius: 10px; }

.global-detail-tabs {
  display: flex;
  gap: 4px;
  align-items: center;
  overflow-x: auto;
  margin-bottom: 14px;
  padding: 5px;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 14px;
  background: rgba(10,12,19,.56);
  scrollbar-width: none;
}
.global-detail-tabs::-webkit-scrollbar { display: none; }
.global-detail-tabs .btn { min-height: 34px; padding: 0 14px; border: 0; border-radius: 9px; color: var(--global-muted); background: transparent; white-space: nowrap; font-size: 11px; }
.global-detail-tabs .btn:hover, .global-detail-tabs .btn.active { color: #fff; background: rgba(139,92,246,.22); }
.global-detail-tab-panel { display: none; min-width: 0; }
.global-detail-tab-panel.is-active { display: block; }
.global-detail-redesign .global-detail-lower { grid-template-columns: minmax(0, 1fr) 306px; gap: 24px; }
.global-detail-redesign .global-detail-aside { gap: 14px; }
.global-detail-redesign .global-detail-panel { border-radius: 14px; }
.global-detail-redesign .global-panel-head { padding: 18px 20px 15px; }
.global-detail-redesign .global-panel-head h2 { font-size: 20px; }
.global-detail-redesign .global-episode-list.is-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.global-detail-redesign .global-episode-list.is-grid .global-episode-row { min-height: 188px; }
.global-detail-redesign .global-episode-list.is-grid .global-episode-thumb { aspect-ratio: 16 / 8.7; }

.global-rating-summary { display: flex; align-items: center; gap: 13px; padding: 16px 18px 7px; }
.global-rating-summary > strong { color: #fff; font-size: 32px; line-height: 1; }
.global-rating-summary > span { display: grid; gap: 4px; color: #f8d568; font-size: 11px; }
.global-rating-summary > span small { color: var(--global-muted); font-size: 9px; }
.global-rating-bars { display: grid; gap: 7px; padding: 10px 18px 18px; }
.global-rating-bars > span { display: grid; grid-template-columns: 12px minmax(0, 1fr) 26px; align-items: center; gap: 7px; }
.global-rating-bars b { color: var(--global-muted); font-size: 9px; font-weight: 600; }
.global-rating-bars i { display: block; height: 4px; border-radius: 999px; background: linear-gradient(90deg, #a78bfa var(--rating-width), rgba(255,255,255,.08) var(--rating-width)); }
.global-rating-bars small { color: var(--global-muted); font-size: 8px; text-align: right; }

.global-facts-expanded { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.global-detail-description { padding: 4px 20px 20px; }
.global-detail-description h3 { margin: 0 0 6px; color: #fff; font-size: 14px; }
.global-detail-description p { margin: 0; color: var(--global-muted); font-size: 12px; line-height: 1.7; }
.global-empty-detail { display: grid; place-items: center; gap: 8px; min-height: 210px; padding: 28px; color: var(--global-muted); text-align: center; }
.global-empty-detail i { color: #b197ff; font-size: 26px; }
.global-empty-detail strong { color: #fff; font-size: 15px; }
.global-empty-detail span { max-width: 340px; font-size: 11px; line-height: 1.55; }

.global-cast-grid { display: grid; gap: 2px; padding: 8px 10px 12px; }
.global-cast-person { display: grid; grid-template-columns: 38px minmax(0, 1fr); align-items: center; gap: 9px; padding: 7px 5px; border-radius: 9px; }
.global-cast-person:hover { background: rgba(255,255,255,.055); }
.global-cast-person > img, .global-cast-placeholder { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 50%; object-fit: cover; background: rgba(139,92,246,.18); color: #c4b5fd; }
.global-cast-person > span:last-child { display: grid; min-width: 0; gap: 3px; }
.global-cast-person strong { overflow: hidden; color: #fff; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.global-cast-person small { overflow: hidden; color: var(--global-muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.global-family-panel { margin-top: 18px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.08); }
.global-family-panel header { display: flex; gap: 8px; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.global-family-panel header small { color: #bca2ff; font-size: 9px; font-weight: 800; letter-spacing: .12em; }
.global-family-panel h3 { margin: 0; color: #fff; font-size: 15px; }
.global-family-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.global-family-item { display: grid; grid-template-columns: 45px minmax(0, 1fr); gap: 9px; align-items: center; min-width: 0; padding: 7px; border: 1px solid rgba(255,255,255,.1); border-radius: 10px; color: inherit; background: rgba(255,255,255,.035); text-decoration: none; }
.global-family-item:hover { border-color: rgba(167,139,250,.55); background: rgba(139,92,246,.12); }
.global-family-item img, .global-family-placeholder { display: grid; width: 45px; height: 58px; place-items: center; border-radius: 7px; object-fit: cover; background: rgba(139,92,246,.18); color: #c4b5fd; }
.global-family-item > span:last-child { display: grid; gap: 3px; min-width: 0; }
.global-family-item small { overflow: hidden; color: #c4b5fd; font-size: 8px; font-weight: 800; text-transform: uppercase; }
.global-family-item strong { overflow: hidden; color: #fff; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.global-family-item em { overflow: hidden; color: var(--global-muted); font-size: 8px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.global-family-empty { display: flex; gap: 8px; align-items: center; color: var(--global-muted); font-size: 11px; }

.global-review-block { padding: 20px; }
.global-review-form-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid rgba(255,255,255,.09); }
.global-review-form-head small { color: #bca2ff; font-size: 9px; font-weight: 800; letter-spacing: .14em; }
.global-review-form-head h3 { margin: 5px 0 0; color: #fff; font-size: 19px; }
.global-review-form-head > span { color: var(--global-muted); font-size: 10px; }
.global-review-composer { padding: 15px 0; border-bottom: 1px solid rgba(255,255,255,.09); }
.global-review-login { display: flex; align-items: center; gap: 9px; color: var(--global-muted); font-size: 11px; }
.global-review-login > i { color: #b197ff; font-size: 18px; }
.global-review-login .btn { margin-left: auto; }
.global-review-form { display: grid; gap: 11px; }
.global-review-form textarea { width: 100%; min-height: 88px; resize: vertical; border: 1px solid rgba(255,255,255,.12); border-radius: 11px; padding: 12px; color: #fff; background: rgba(255,255,255,.045); font: inherit; font-size: 12px; outline: none; }
.global-review-form textarea:focus { border-color: rgba(167,139,250,.7); }
.global-review-rating-input { display: flex; align-items: center; gap: 4px; }
.global-review-rating-input > span { margin-right: 5px; color: var(--global-muted); font-size: 10px; }
.global-review-rating-input .btn { min-width: 29px; height: 29px; padding: 0; border: 0; border-radius: 7px; color: var(--global-muted); background: rgba(255,255,255,.05); font-size: 10px; }
.global-review-rating-input .btn i { margin-left: 2px; color: #f8d568; font-size: 9px; }
.global-review-rating-input .btn.active { color: #fff; background: rgba(139,92,246,.3); }
.global-review-form-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.global-review-form-actions small { color: var(--global-muted); font-size: 10px; }
.global-review-form-actions > div { display: flex; gap: 8px; }
.global-review-list { display: grid; gap: 10px; padding-top: 15px; }
.global-review-card { padding: 13px; border: 1px solid rgba(255,255,255,.1); border-radius: 11px; background: rgba(255,255,255,.035); }
.global-review-card-head { display: flex; align-items: center; gap: 8px; }
.global-review-avatar { display: grid; width: 30px; height: 30px; place-items: center; overflow: hidden; border-radius: 50%; color: #c4b5fd; background: rgba(139,92,246,.2); }
.global-review-avatar img { width: 100%; height: 100%; object-fit: cover; }
.global-review-card-head > span:nth-child(2) { display: grid; gap: 3px; }
.global-review-card-head strong { color: #fff; font-size: 11px; }
.global-review-card-head small { color: #f8d568; font-size: 9px; }
.global-review-card-head time { margin-left: auto; color: var(--global-muted); font-size: 9px; }
.global-review-card p { margin: 9px 0 0; color: rgba(245,246,252,.74); font-size: 11px; line-height: 1.6; }

@media (max-width: 900px) {
  body.global-mode .global-detail-redesign { width: min(100% - 30px, 720px); }
  .global-detail-redesign .global-detail-lower { grid-template-columns: minmax(0, 1fr); }
  .global-detail-redesign .global-detail-aside { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  body.global-mode .global-detail-redesign { width: calc(100% - 22px); padding-top: 12px; }
  body.global-mode .global-detail-redesign .global-detail-backdrop { inset: -2% -18% 53%; opacity: .48; }
  .global-detail-redesign .global-detail-nav { min-height: 42px; margin-bottom: 5px; }
  .global-detail-redesign .global-detail-nav .btn { min-height: 34px; padding-inline: 10px; font-size: 10px; }
  .global-detail-redesign .global-detail-nav .btn span { display: none; }
  .global-detail-redesign .global-detail-hero { grid-template-columns: 100px minmax(0, 1fr); align-items: start; gap: 15px; min-height: 0; margin-bottom: 18px; padding: 15px 0 18px; }
  .global-detail-redesign .global-detail-poster-shell { width: 100px; }
  .global-detail-redesign .global-detail-copy h1 { margin-top: 6px; font-size: clamp(26px, 8vw, 38px); line-height: 1.02; }
  .global-detail-redesign .global-detail-original { margin-top: 6px; font-size: 10px; }
  .global-detail-redesign .global-detail-rating-line { margin-top: 8px; font-size: 9px; }
  .global-detail-redesign .global-detail-rating-line strong { font-size: 12px; }
  .global-detail-redesign .global-detail-tags { gap: 4px; margin-top: 9px; }
  .global-detail-redesign .global-detail-tags span { padding: 4px 7px; font-size: 8px; }
  .global-detail-redesign .global-detail-summary { grid-column: 1 / -1; margin-top: 3px; font-size: 11px; line-height: 1.55; }
  .global-detail-redesign .global-detail-actions { grid-column: 1 / -1; margin-top: 9px; }
  .global-detail-redesign .global-detail-actions .btn { flex: 1; min-width: 0; padding-inline: 8px; font-size: 10px; }
  .global-detail-tabs { margin-bottom: 10px; border-radius: 11px; }
  .global-detail-tabs .btn { min-height: 32px; padding-inline: 10px; font-size: 9px; }
  .global-detail-redesign .global-episode-list.is-grid { grid-template-columns: minmax(0, 1fr); }
  .global-detail-redesign .global-episode-list.is-grid .global-episode-row { min-height: 0; }
  .global-detail-redesign .global-detail-aside { grid-template-columns: minmax(0, 1fr); }
  .global-facts-expanded { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .global-review-block { padding: 15px; }
  .global-review-login { align-items: flex-start; flex-wrap: wrap; }
  .global-review-login .btn { margin-left: 0; }
  .global-review-form-actions { align-items: flex-start; flex-direction: column; }
  .global-review-form-actions > div { width: 100%; }
  .global-review-form-actions > div .btn { flex: 1; }
}

/* Detail v2 final cascade: keeps the wide editorial composition after legacy detail rules. */
body.global-mode .global-detail-redesign { width: min(1420px, calc(100vw - 72px)); padding: 24px 0 80px; }
body.global-mode .global-detail-redesign .global-detail-hero { grid-template-columns: minmax(180px, 220px) minmax(0, 1fr); width: min(1040px, 100%); min-height: 360px; margin: 0 auto 34px; padding: 22px 0 20px; gap: clamp(28px, 4.5vw, 72px); }
body.global-mode .global-detail-redesign .global-detail-poster-shell { width: 220px; }
body.global-mode .global-detail-redesign .global-detail-copy { max-width: 780px; }
body.global-mode .global-detail-redesign .global-detail-copy h1 { max-width: 740px; font-size: clamp(34px, 4.4vw, 60px); line-height: 1.02; }
body.global-mode .global-detail-redesign .global-detail-lower { grid-template-columns: minmax(0, 1fr) 306px; gap: 24px; }
body.global-mode .global-detail-redesign .global-detail-aside { gap: 14px; }
body.global-mode .global-detail-redesign .global-detail-tab-panel { display: none; }
body.global-mode .global-detail-redesign .global-detail-tab-panel.is-active { display: block; }

@media (max-width: 900px) {
  body.global-mode .global-detail-redesign { width: min(100% - 30px, 720px); }
  body.global-mode .global-detail-redesign .global-detail-lower { grid-template-columns: minmax(0, 1fr); }
  body.global-mode .global-detail-redesign .global-detail-aside { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  body.global-mode .global-detail-redesign { width: calc(100% - 22px); padding-top: 12px; }
  body.global-mode .global-detail-redesign .global-detail-hero { grid-template-columns: 100px minmax(0, 1fr); align-items: start; width: 100%; min-height: 0; margin-bottom: 18px; padding: 15px 0 18px; gap: 15px; }
  body.global-mode .global-detail-redesign .global-detail-poster-shell { width: 100px; }
  body.global-mode .global-detail-redesign .global-detail-copy h1 { font-size: clamp(26px, 8vw, 38px); }
  body.global-mode .global-detail-redesign .global-detail-summary,
  body.global-mode .global-detail-redesign .global-detail-actions { grid-column: 1 / -1; }
  body.global-mode .global-detail-redesign .global-detail-aside { grid-template-columns: minmax(0, 1fr); }
}

/* Global catalog: cinematic glass workspace */
body.global-mode {
  --global-ink: #f8f9ff;
  --global-muted: rgba(232, 235, 246, .66);
  --global-edge: rgba(255, 255, 255, .14);
  --global-glass: rgba(16, 19, 28, .58);
  --global-glass-strong: rgba(18, 21, 31, .78);
  background-color: #07080c;
  background-image:
    radial-gradient(900px 520px at 12% -12%, rgba(139, 92, 246, .18), transparent 68%),
    radial-gradient(780px 460px at 92% 14%, rgba(56, 189, 248, .10), transparent 70%);
  color: var(--global-ink);
}

body.global-mode .hero {
  position: sticky;
  top: 0;
  z-index: 80;
  border-bottom-color: rgba(255, 255, 255, .10);
  background: rgba(7, 8, 12, .68);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .16);
  backdrop-filter: blur(26px) saturate(145%);
  -webkit-backdrop-filter: blur(26px) saturate(145%);
}

body.global-mode .hero .topbar {
  display: flex;
  min-height: 70px;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  width: min(1480px, calc(100% - 48px));
  padding: 10px 0;
}

body.global-mode .brand-home .brand-mark {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 13px;
  background: linear-gradient(145deg, #9c6bff, #6336cc);
  box-shadow: 0 8px 22px rgba(111, 67, 222, .32), inset 0 1px 0 rgba(255, 255, 255, .38);
}

body.global-mode .brand-home h1 {
  font-size: 18px;
  letter-spacing: -.01em;
}

body.global-mode .brand-home .sub {
  color: rgba(235, 238, 250, .52);
}

.global-topbar-nav:not([hidden]) {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-left: auto;
}

.global-topbar-link,
.global-topbar-icon {
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: rgba(235, 238, 250, .66);
  font-size: 12px;
  font-weight: 700;
}

.global-topbar-link {
  padding: 7px 13px;
}

.global-topbar-link:hover,
.global-topbar-link:focus-visible,
.global-topbar-link.active {
  border-color: rgba(255, 255, 255, .13);
  background: rgba(255, 255, 255, .09);
  color: #fff;
}

.global-topbar-actions:not([hidden]) {
  display: flex;
  align-items: center;
  gap: 7px;
}

.global-topbar-icon {
  width: 38px;
  min-width: 38px;
  padding: 0;
  border-color: rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .08);
  color: #fff;
}

body.global-mode .app.container-xxl {
  width: min(1480px, 100%);
  padding-top: 34px;
}

body.global-mode .catalog-heading {
  min-height: 70px;
  margin-bottom: 22px;
  border-bottom-color: rgba(255, 255, 255, .10);
}

body.global-mode .catalog-heading span {
  color: #bfa7ff;
}

body.global-mode .catalog-heading h2 {
  font-size: clamp(32px, 4vw, 52px);
  letter-spacing: -.035em;
}

body.global-mode .catalog-heading .stats {
  color: rgba(235, 238, 250, .58);
}

body.global-mode .catalog-controls {
  border-color: var(--global-edge);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(255, 255, 255, .10), transparent 38%), var(--global-glass);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .13), 0 18px 50px rgba(0, 0, 0, .18);
  backdrop-filter: blur(24px) saturate(135%);
  -webkit-backdrop-filter: blur(24px) saturate(135%);
}

body.global-mode .catalog-controls .search-filter-panel,
body.global-mode .catalog-controls .searchbox,
body.global-mode .catalog-controls .filters,
body.global-mode .catalog-controls .catalog-toolbar {
  background: transparent;
}

body.global-mode .catalog-controls input,
body.global-mode .catalog-controls select,
body.global-mode .catalog-controls .select-btn,
body.global-mode .catalog-controls .btn {
  border-color: rgba(255, 255, 255, .13);
  background: rgba(255, 255, 255, .065);
  color: var(--global-ink);
}

body.global-mode .catalog-controls input::placeholder {
  color: rgba(235, 238, 250, .48);
}

body.global-mode .catalog-controls .primary.btn {
  border-color: rgba(255, 255, 255, .18);
  background: linear-gradient(145deg, #9c6bff, #6d3bd8);
  box-shadow: 0 8px 20px rgba(111, 67, 222, .24), inset 0 1px 0 rgba(255, 255, 255, .26);
}

.global-catalog-view {
  display: grid;
  gap: 28px;
  margin: 0 0 34px;
}

.global-catalog-view[hidden] {
  display: none;
}

.global-spotlight {
  position: relative;
  min-height: 500px;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid var(--global-edge);
  border-radius: 28px;
  background: #12141b;
  box-shadow: 0 26px 70px rgba(0, 0, 0, .30), inset 0 1px 0 rgba(255, 255, 255, .16);
}

.global-spotlight-backdrop,
.global-spotlight-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.global-spotlight-backdrop {
  z-index: 0;
  background: var(--global-spotlight-image) center / cover no-repeat;
  filter: saturate(1.12) contrast(1.04);
  transform: scale(1.035);
}

.global-spotlight-backdrop::after {
  position: absolute;
  inset: 0;
  content: "";
  background: var(--global-spotlight-image) center / contain no-repeat;
  filter: saturate(1.04) contrast(1.02);
  opacity: .46;
}

.global-spotlight-shade {
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(6, 7, 11, .97) 0%, rgba(6, 7, 11, .82) 33%, rgba(6, 7, 11, .28) 70%, rgba(6, 7, 11, .56) 100%),
    linear-gradient(0deg, rgba(6, 7, 11, .82), transparent 42%, rgba(6, 7, 11, .16));
}

.global-spotlight-content {
  position: relative;
  z-index: 2;
  display: flex;
  width: min(690px, 68%);
  min-height: 500px;
  flex-direction: column;
  justify-content: center;
  padding: clamp(30px, 5vw, 72px);
}

.global-spotlight-kicker,
.global-spotlight-meta,
.global-spotlight-actions,
.global-spotlight-progress {
  display: flex;
  align-items: center;
}

.global-spotlight-kicker {
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 17px;
  color: #c2a9ff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .14em;
}

.global-spotlight-kicker b {
  max-width: 45%;
  overflow: hidden;
  color: rgba(235, 238, 250, .56);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-spotlight-content h1 {
  max-width: 680px;
  margin: 0;
  color: #fff;
  font-size: clamp(38px, 5vw, 72px);
  font-weight: 800;
  letter-spacing: -.045em;
  line-height: .98;
  text-wrap: balance;
}

.global-spotlight-meta {
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 20px;
  color: rgba(241, 243, 251, .78);
  font-size: 12px;
  font-weight: 700;
}

.global-audio-badge {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 3px 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: #fff;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .06em;
}

.global-audio-badge.is-latino {
  border-color: rgba(251, 113, 133, .46);
  background: rgba(244, 63, 94, .80);
}

.global-audio-badge.is-sub {
  border-color: rgba(196, 181, 253, .42);
  background: rgba(124, 58, 237, .72);
}

.global-spotlight-content p {
  display: -webkit-box;
  max-width: 610px;
  margin: 18px 0 0;
  overflow: hidden;
  color: rgba(239, 241, 249, .70);
  font-size: 14px;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.global-spotlight-actions {
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 26px;
}

.global-spotlight-actions .btn {
  min-height: 42px;
  border-radius: 12px;
  font-size: 12px;
}

.global-spotlight-actions .primary.btn {
  padding-inline: 18px;
}

.global-spotlight-actions .glass-action,
.global-spotlight-save {
  border-color: rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .10);
  color: #fff;
  backdrop-filter: blur(16px) saturate(135%);
  -webkit-backdrop-filter: blur(16px) saturate(135%);
}

.global-spotlight-save {
  width: 42px;
  min-width: 42px;
  padding: 0;
}

.global-spotlight-progress {
  gap: 6px;
  margin-top: 38px;
}

.global-spotlight-progress span {
  width: 25px;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .27);
}

.global-spotlight-progress span.is-active {
  width: 46px;
  background: #a67cff;
}

.global-spotlight-poster {
  position: absolute;
  z-index: 2;
  right: clamp(34px, 7vw, 100px);
  bottom: -70px;
  width: clamp(170px, 17vw, 265px);
  transform: rotate(4deg);
  filter: drop-shadow(0 25px 32px rgba(0, 0, 0, .40));
  opacity: .88;
  pointer-events: none;
}

.global-feature-poster {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 17px;
  object-fit: cover;
}

.global-catalog-navigation {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 1px 5px;
  scrollbar-width: none;
}

.global-catalog-navigation::-webkit-scrollbar,
.global-rail-track::-webkit-scrollbar { display: none; }

.global-filter-chip {
  display: inline-flex;
  min-height: 36px;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-color: rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .06);
  color: rgba(238, 240, 250, .70);
  font-size: 11px;
}

.global-filter-chip.active,
.global-filter-chip:hover,
.global-filter-chip:focus-visible {
  border-color: rgba(178, 143, 255, .52);
  background: rgba(139, 92, 246, .22);
  color: #fff;
}

.global-result-count {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding-left: 12px;
  color: rgba(235, 238, 250, .48);
  font-size: 11px;
  white-space: nowrap;
}

.global-catalog-rails {
  display: grid;
  gap: 34px;
}

.global-rail {
  min-width: 0;
}

.global-rail-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.global-rail-head span {
  color: #ac8bff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .16em;
}

.global-rail-head h2 {
  margin: 5px 0 0;
  color: #fff;
  font-size: clamp(20px, 2.3vw, 28px);
  font-weight: 780;
  letter-spacing: -.025em;
}

.global-rail-next {
  width: 34px;
  min-width: 34px;
  min-height: 34px;
  border-color: rgba(255, 255, 255, .13);
  background: rgba(255, 255, 255, .07);
  color: rgba(255, 255, 255, .80);
}

.global-rail-track {
  display: grid;
  grid-auto-columns: minmax(170px, 190px);
  grid-auto-flow: column;
  gap: 14px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding: 2px 2px 12px;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}

.global-card {
  min-width: 0;
  scroll-snap-align: start;
}

.global-card-media {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 15px;
  background: rgba(255, 255, 255, .07);
  box-shadow: 0 12px 25px rgba(0, 0, 0, .22), inset 0 1px 0 rgba(255, 255, 255, .12);
}

.global-card-media .poster,
.global-card-media .cover-fallback {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .24s ease, filter .24s ease;
}

.global-card:hover .global-card-media .poster,
.global-card:focus-within .global-card-media .poster {
  filter: brightness(.78) saturate(1.12);
  transform: scale(1.045);
}

.global-card-topline {
  position: absolute;
  top: 9px;
  right: 9px;
  left: 9px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  color: rgba(255, 255, 255, .88);
  font-size: 9px;
  font-weight: 750;
  text-shadow: 0 1px 5px rgba(0, 0, 0, .55);
}

.global-card-topline > span:first-child {
  max-width: 70%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-card-topline .global-audio-badge {
  min-height: 20px;
  padding: 3px 6px;
  font-size: 8px;
}

.global-card-play {
  position: absolute;
  right: 50%;
  bottom: 50%;
  z-index: 3;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .48);
  border-radius: 50%;
  background: rgba(16, 14, 25, .48);
  color: #fff;
  opacity: 0;
  transform: translate(50%, 50%) scale(.84);
  transition: opacity .2s ease, transform .2s ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.global-card:hover .global-card-play,
.global-card:focus-within .global-card-play {
  opacity: 1;
  transform: translate(50%, 50%) scale(1);
}

.global-card-copy {
  position: relative;
  min-width: 0;
  padding: 10px 2px 0;
}

.global-card-title {
  display: block;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  padding: 0;
  border: 0;
  background: transparent;
  color: #f7f8ff;
  font-size: 12px;
  font-weight: 760;
  line-height: 1.3;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-card-title:hover,
.global-card-title:focus-visible { color: #c3a8ff; }

.global-card-meta {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: rgba(235, 238, 250, .52);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-card-genres {
  display: flex;
  gap: 5px;
  margin-top: 6px;
  overflow: hidden;
}

.global-card-genres span {
  overflow: hidden;
  color: rgba(199, 177, 255, .76);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-card-genres span + span::before { content: "·"; margin-right: 5px; color: rgba(255, 255, 255, .34); }

.global-card-actions {
  position: absolute;
  top: 6px;
  right: 0;
  display: flex;
  gap: 4px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .16s ease, transform .16s ease;
}

.global-card:hover .global-card-actions,
.global-card:focus-within .global-card-actions {
  opacity: 1;
  transform: translateY(0);
}

.global-card-actions .btn {
  width: 27px;
  min-width: 27px;
  min-height: 27px;
  padding: 0;
  border-color: rgba(255, 255, 255, .15);
  background: rgba(12, 13, 19, .72);
  color: #fff;
}

.global-empty-state {
  display: grid;
  min-height: 260px;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  padding: 34px;
  border: 1px solid var(--global-edge);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(255, 255, 255, .09), transparent 45%), var(--global-glass);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .13), 0 20px 55px rgba(0, 0, 0, .18);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.global-empty-icon {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border: 1px solid rgba(190, 163, 255, .36);
  border-radius: 21px;
  background: rgba(139, 92, 246, .20);
  color: #c3a8ff;
  font-size: 25px;
}

.global-empty-state small { color: #bda4ff; font-size: 9px; font-weight: 800; letter-spacing: .16em; }
.global-empty-state h2 { margin: 7px 0 0; color: #fff; font-size: 25px; }
.global-empty-state p { max-width: 560px; margin: 8px 0 0; color: var(--global-muted); font-size: 13px; line-height: 1.55; }

body.global-mode #results.grid {
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 26px 15px;
}

body.global-mode #results .card {
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 17px;
  background: linear-gradient(145deg, rgba(255, 255, 255, .07), transparent 42%), rgba(14, 16, 23, .52);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 14px 35px rgba(0, 0, 0, .16);
}

body.global-mode #results .card .info { padding: 9px 3px 4px; }
body.global-mode #results .card .poster-wrap { border-radius: 12px; }

body.global-mode .media-detail-page {
  max-width: 1280px;
  margin-inline: auto;
  border-color: rgba(255, 255, 255, .12);
  border-radius: 25px;
  background: linear-gradient(145deg, rgba(255, 255, 255, .06), transparent 32%), rgba(12, 14, 21, .68);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .10), 0 24px 70px rgba(0, 0, 0, .20);
  backdrop-filter: blur(24px) saturate(125%);
  -webkit-backdrop-filter: blur(24px) saturate(125%);
}

body.global-mode .media-detail-hero { padding: clamp(20px, 4vw, 50px); }
body.global-mode .media-detail-body { padding: 0 clamp(20px, 4vw, 50px) clamp(24px, 4vw, 50px); }
body.global-mode .episodes-section,
body.global-mode .media-trailer-panel,
body.global-mode .media-facts { border-color: rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .055); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
body.global-mode .episode-card { border-color: rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .065); }

body.global-mode.theme-glass {
  --global-ink: #20232d;
  --global-muted: rgba(48, 53, 66, .70);
  --global-edge: rgba(255, 255, 255, .72);
  --global-glass: rgba(255, 255, 255, .42);
  --global-glass-strong: rgba(255, 255, 255, .64);
  background-color: #edf1f6;
  background-image: radial-gradient(720px 430px at 10% -10%, rgba(183, 153, 255, .22), transparent 70%), radial-gradient(680px 440px at 94% 14%, rgba(111, 210, 224, .18), transparent 70%);
}

body.global-mode.theme-glass .hero { background: rgba(255, 255, 255, .52); border-bottom-color: rgba(255, 255, 255, .78); }
body.global-mode.theme-glass .global-topbar-link { color: rgba(35, 39, 49, .70); }
body.global-mode.theme-glass .global-topbar-link:hover,
body.global-mode.theme-glass .global-topbar-link:focus-visible,
body.global-mode.theme-glass .global-topbar-link.active { background: rgba(255, 255, 255, .56); color: #20232d; }
body.global-mode.theme-glass .catalog-heading h2,
body.global-mode.theme-glass .global-rail-head h2,
body.global-mode.theme-glass .global-card-title { color: #20232d; }
body.global-mode.theme-glass .catalog-heading .stats,
body.global-mode.theme-glass .global-card-meta { color: rgba(48, 53, 66, .64); }
body.global-mode.theme-glass .global-filter-chip { border-color: rgba(255, 255, 255, .82); background: rgba(255, 255, 255, .36); color: rgba(35, 39, 49, .72); }
body.global-mode.theme-glass .global-filter-chip.active { background: rgba(139, 92, 246, .20); color: #33205f; }
body.global-mode.theme-glass .global-result-count { color: rgba(48, 53, 66, .58); }
body.global-mode.theme-glass .global-card { border-radius: 17px; }
body.global-mode.theme-glass .global-card-copy { color: #20232d; }
body.global-mode.theme-glass #results .card { border-color: rgba(255, 255, 255, .76); background: rgba(255, 255, 255, .32); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .92), 0 14px 35px rgba(63, 70, 87, .12); }
body.global-mode.theme-glass .global-empty-state { color: #20232d; background: rgba(255, 255, 255, .46); }
body.global-mode.theme-glass .global-empty-state h2 { color: #20232d; }
body.global-mode.theme-glass .global-empty-state p { color: rgba(48, 53, 66, .70); }

@media (max-width: 760px) {
  body.global-mode .hero .topbar { width: calc(100% - 28px); min-height: 62px; gap: 10px; }
  body.global-mode .brand-home .sub { display: none; }
  body.global-mode .brand-home h1 { font-size: 16px; }
  .global-topbar-nav:not([hidden]) { display: none; }
  body.global-mode .app.container-xxl { padding-top: 21px; }
  body.global-mode .catalog-heading { min-height: 64px; margin-bottom: 15px; }
  body.global-mode .catalog-heading h2 { font-size: 35px; }
  .global-spotlight { min-height: 585px; border-radius: 22px; }
  .global-spotlight-shade { background: linear-gradient(0deg, rgba(6, 7, 11, .98) 5%, rgba(6, 7, 11, .72) 50%, rgba(6, 7, 11, .22) 100%); }
  .global-spotlight-content { width: 100%; min-height: 585px; justify-content: end; padding: 30px 22px 25px; }
  .global-spotlight-kicker { align-items: start; flex-direction: column; gap: 7px; margin-bottom: 12px; }
  .global-spotlight-kicker b { max-width: 100%; }
  .global-spotlight-content h1 { max-width: 90%; font-size: clamp(35px, 11vw, 52px); }
  .global-spotlight-content p { max-width: 100%; font-size: 12px; -webkit-line-clamp: 3; }
  .global-spotlight-meta { margin-top: 14px; font-size: 11px; }
  .global-spotlight-actions { margin-top: 18px; }
  .global-spotlight-actions .primary.btn { flex: 1; }
  .global-spotlight-poster { top: 27px; right: 22px; bottom: auto; width: 112px; transform: rotate(4deg); opacity: .82; }
  .global-spotlight-progress { margin-top: 23px; }
  .global-catalog-navigation { margin-inline: -2px; }
  .global-result-count { display: none; }
  .global-catalog-rails { gap: 27px; }
  .global-rail-head { margin-bottom: 11px; }
  .global-rail-head h2 { font-size: 21px; }
  .global-rail-head span { font-size: 8px; }
  .global-rail-track { grid-auto-columns: 154px; gap: 11px; }
  .global-card-media { border-radius: 13px; }
  .global-card-title { font-size: 11px; }
  .global-card-actions { opacity: 1; transform: none; }
  .global-card-actions .btn { width: 25px; min-width: 25px; min-height: 25px; }
  .global-card-play { display: none; }
  .global-empty-state { grid-template-columns: 1fr; gap: 14px; padding: 25px 20px; }
  body.global-mode #results.grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px 10px; }
}

/* Library dashboard redesign: dense desktop workspace with a responsive activity rail. */
#libraryTab[hidden] { display: none !important; }
#libraryTab {
  --library-panel: color-mix(in srgb, var(--panel) 86%, transparent);
  --library-panel-strong: color-mix(in srgb, var(--surface) 88%, transparent);
  --library-edge: color-mix(in srgb, var(--line) 86%, transparent);
  min-width: 0;
}
.library-heading { margin-bottom: 20px; border: 0; }
.library-heading h2 { letter-spacing: -.035em; }
.library-heading .stats { border: 0; padding: 0; background: transparent; color: var(--muted); font-size: 12px; }
.library-dashboard { display: grid; grid-template-columns: minmax(0, 1fr) minmax(286px, 320px); gap: 22px; align-items: start; }
.library-main-column, .library-sidebar, .library-browser-panel, .library-collections-panel { min-width: 0; }
.library-overview { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0 0 26px; border: 0; }
.library-overview-item {
  display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 10px; min-height: 92px; padding: 16px;
  border: 1px solid var(--library-edge); border-radius: 14px; background: linear-gradient(145deg, var(--library-panel-strong), var(--library-panel));
  color: var(--text); text-align: left; transition: border-color .2s ease, transform .2s ease, background .2s ease;
}
.library-overview-item:hover, .library-overview-item.active { border-color: color-mix(in srgb, var(--accent) 58%, var(--library-edge)); background: color-mix(in srgb, var(--accent-soft) 60%, var(--library-panel)); transform: translateY(-2px); }
.library-overview-item:last-child { border-right: 1px solid var(--library-edge); }
.library-overview-item > i { width: 38px; height: 38px; border: 0; border-radius: 11px; background: var(--accent-soft); color: var(--accent); font-size: 17px; }
.library-overview-item:nth-child(2) > i { color: #7cc5ff; background: rgba(67, 139, 206, .17); }
.library-overview-item:nth-child(3) > i { color: #88e085; background: rgba(64, 184, 91, .16); }
.library-overview-item:nth-child(4) > i { color: #ff7eaa; background: rgba(234, 73, 116, .16); }
.library-overview-item span { gap: 3px; }
.library-overview-item strong { font-size: 18px; }
.library-overview-item small { margin: 0; color: var(--text); font-size: 12px; font-weight: 700; text-transform: none; }
.library-overview-item em { color: var(--muted); font-size: 10px; font-style: normal; }
.library-section-head, .library-side-head { display: flex; gap: 14px; align-items: center; justify-content: space-between; min-width: 0; }
.library-section-head { margin-bottom: 12px; }
.library-section-head > div > span, .library-side-head h3 { color: var(--text); }
.library-section-head > div > span { color: var(--accent); font-size: 9px; font-weight: 800; letter-spacing: .08em; }
.library-section-head h3 { margin: 3px 0 0; color: var(--text); font-size: 18px; letter-spacing: -.02em; }
.library-inline-link { display: inline-flex; gap: 7px; align-items: center; padding: 4px; border: 0; color: var(--accent); background: transparent; font-size: 11px; white-space: nowrap; }
.library-inline-link:hover { color: var(--text); }
.library-collections-panel { margin-bottom: 26px; }
.library-collection-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.library-collection-card { position: relative; min-width: 0; aspect-ratio: 1.58; overflow: hidden; border: 1px solid var(--library-edge); border-radius: 10px; background: var(--library-panel); transition: border-color .2s ease, transform .2s ease; }
.library-collection-card:hover, .library-collection-card.active { border-color: color-mix(in srgb, var(--accent) 62%, var(--library-edge)); transform: translateY(-2px); }
.library-collection-main { position: absolute; inset: 0; display: block; width: 100%; min-width: 0; padding: 0; overflow: hidden; border: 0; background: transparent; color: #fff; text-align: left; }
.library-collection-art-stack, .library-collection-art, .library-collection-shade { position: absolute; inset: 0; display: block; }
.library-collection-art { background-image: var(--library-art); background-position: center; background-size: cover; filter: saturate(.86); transition: transform .3s ease; }
.library-collection-art-1 { inset: 0 34% 0 0; }
.library-collection-art-2 { inset: 0 17% 0 33%; opacity: .9; }
.library-collection-art-3 { inset: 0 0 0 66%; opacity: .76; }
.library-collection-art-stack.is-count-1 .library-collection-art-1 { inset: 0; }
.library-collection-art-stack.is-count-1 .library-collection-art { inset: 0; width: 100%; height: 100%; }
.library-collection-art-stack.is-count-2 .library-collection-art-1 { inset: 0 50% 0 0; }
.library-collection-art-stack.is-count-2 .library-collection-art-2 { inset: 0 0 0 50%; }
.library-collection-main:hover .library-collection-art { transform: scale(1.04); }
.library-collection-shade { background: linear-gradient(180deg, rgba(5, 7, 13, .08) 12%, rgba(5, 7, 13, .82) 100%); }
.library-collection-copy { position: absolute; right: 10px; bottom: 9px; left: 10px; display: grid; gap: 2px; min-width: 0; }
.library-collection-copy small { color: rgba(255,255,255,.72); font-size: 8px; font-weight: 800; letter-spacing: .08em; }
.library-collection-copy strong, .library-collection-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.library-collection-copy strong { font-size: 13px; }
.library-collection-copy span { color: rgba(255,255,255,.72); font-size: 10px; }
.library-collection-delete { position: absolute; top: 8px; right: 8px; z-index: 2; width: 28px; min-width: 28px; height: 28px; padding: 0; border: 1px solid rgba(255,255,255,.18); border-radius: 50%; background: rgba(5,7,13,.64); color: #fff; opacity: 0; transition: opacity .2s ease; }
.library-collection-card:hover .library-collection-delete, .library-collection-card:focus-within .library-collection-delete { opacity: 1; }
.library-collection-art-stack.is-empty { display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 22px; }
.library-browser-panel { padding-top: 2px; }
.library-navigation { margin: 0 0 10px; padding: 0 0 10px; border-bottom: 1px solid var(--library-edge); }
.library-toolbar .left { gap: 2px; }
.library-toolbar .btn { min-height: 34px; padding-inline: 10px; color: var(--muted); font-size: 11px; }
.library-toolbar .btn.active { color: var(--text); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 55%, var(--library-edge)); }
.library-actions { gap: 8px; }
.library-actions #newListBtn { min-height: 34px; padding-inline: 12px; font-size: 11px; }
.library-content-tools { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; }
.library-search-field, .library-sort-field, .library-type-field { display: flex; gap: 8px; align-items: center; min-width: 0; }
.library-search-field { flex: 1 1 260px; position: relative; }
.library-search-field > i { position: absolute; left: 11px; color: var(--muted); pointer-events: none; }
.library-search-field input { width: 100%; padding-left: 32px; }
.library-sort-field, .library-type-field { flex: 0 1 170px; }
.library-sort-field > span, .library-type-field > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.library-content-tools .control { min-height: 36px; border-radius: 10px; font-size: 11px; }
.library-content { min-width: 0; }
.list-detail-head { margin-bottom: 10px; padding: 0 0 10px; }
.list-detail-actions .btn { min-height: 32px; padding-inline: 9px; font-size: 10px; }
.managed-list { display: grid; gap: 7px; }
.managed-list-item, .history-row { display: grid; grid-template-columns: 138px minmax(0, 1fr) auto; gap: 14px; align-items: center; min-height: 92px; padding: 8px; border: 1px solid var(--library-edge); border-radius: 11px; background: linear-gradient(90deg, var(--library-panel-strong), var(--library-panel)); }
.library-row-media { width: 138px; height: 76px; overflow: hidden; border-radius: 7px; }
.library-row-art, .library-side-art-image { display: grid; place-items: center; width: 100%; height: 100%; background-image: linear-gradient(90deg, rgba(5,7,13,.06), rgba(5,7,13,.4)), var(--library-art); background-position: center; background-size: cover; color: var(--muted); }
.library-row-art.is-empty, .library-side-art-image.is-empty { background: var(--accent-soft); color: var(--accent); }
.library-item-copy { display: grid; min-width: 0; gap: 4px; }
.library-item-copy strong { overflow: hidden; color: var(--text); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.library-item-copy span { color: var(--text); font-size: 11px; }
.library-item-copy small { display: -webkit-box; overflow: hidden; color: var(--muted); font-size: 10px; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.library-sidebar { display: grid; gap: 14px; }
.library-side-panel { min-width: 0; padding: 16px; border: 1px solid var(--library-edge); border-radius: 13px; background: linear-gradient(145deg, var(--library-panel-strong), var(--library-panel)); }
.library-side-head { margin-bottom: 13px; }
.library-side-head h3 { display: flex; gap: 8px; align-items: center; margin: 0; font-size: 15px; }
.library-side-head h3 i { color: var(--accent); font-size: 15px; }
.library-side-head .library-inline-link { font-size: 10px; }
.library-continue-row { display: grid; grid-template-columns: 54px minmax(0, 1fr) 28px; gap: 9px; align-items: center; min-width: 0; padding: 9px 0; border-top: 1px solid var(--library-edge); }
.library-continue-row:first-child { border-top: 0; padding-top: 0; }
.library-side-art { width: 54px; height: 42px; padding: 0; overflow: hidden; border: 0; border-radius: 7px; background: var(--panel); }
.library-side-copy { display: grid; gap: 3px; min-width: 0; }
.library-side-copy strong, .library-side-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.library-side-copy strong { color: var(--text); font-size: 11px; }
.library-side-copy span { color: var(--muted); font-size: 10px; }
.library-progress { display: block; height: 3px; overflow: hidden; border-radius: 99px; background: var(--line); }
.library-progress i { display: block; height: 100%; background: var(--accent); }
.library-play-btn { display: grid; width: 28px; height: 28px; place-items: center; padding: 0; border: 0; border-radius: 50%; color: #fff; background: var(--accent-soft); }
.library-side-empty { padding: 8px 0; color: var(--muted); font-size: 11px; }
.library-activity-row { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 9px; align-items: center; width: 100%; padding: 9px 0; border: 0; border-top: 1px solid var(--library-edge); color: var(--text); background: transparent; text-align: left; }
.library-activity-row:first-child { border-top: 0; padding-top: 0; }
.library-activity-icon { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 9px; color: var(--accent); background: var(--accent-soft); }
.library-activity-row > span:last-child { display: grid; gap: 2px; min-width: 0; }
.library-activity-row strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.library-activity-row small { color: var(--muted); font-size: 9px; }
.library-shortcuts #libraryShortcuts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.library-shortcut { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 2px 6px; align-items: center; min-width: 0; padding: 9px; border: 1px solid var(--library-edge); border-radius: 9px; color: var(--text); background: transparent; text-align: left; }
.library-shortcut:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--library-edge)); background: var(--accent-soft); }
.library-shortcut > span { grid-row: span 2; display: grid; width: 26px; height: 26px; place-items: center; border-radius: 8px; color: var(--accent); background: var(--accent-soft); }
.library-shortcut strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.library-shortcut small { color: var(--muted); font-size: 9px; }
.library-create-list { display: flex; gap: 6px; justify-content: center; width: 100%; margin-top: 10px; padding: 8px; border: 1px solid color-mix(in srgb, var(--accent) 50%, var(--library-edge)); border-radius: 8px; color: var(--accent); background: var(--accent-soft); font-size: 11px; }
@media (max-width: 1180px) {
  .library-dashboard { grid-template-columns: minmax(0, 1fr) 286px; gap: 16px; }
  .library-collection-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .library-dashboard { grid-template-columns: 1fr; }
  .library-sidebar { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
  .library-side-panel { height: 100%; }
  .library-collection-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .library-heading { align-items: start; }
  .library-heading .stats { display: none; }
  .library-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .library-overview-item { min-height: 80px; padding: 12px; }
  .library-overview-item > i { width: 32px; height: 32px; }
  .library-overview-item strong { font-size: 16px; }
  .library-collection-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .library-navigation { align-items: stretch; flex-direction: column; gap: 8px; }
  .library-toolbar { overflow-x: auto; }
  .library-toolbar .left { flex-wrap: nowrap; width: max-content; }
  .library-actions { justify-content: space-between; }
  .library-content-tools { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .library-search-field { grid-column: 1 / -1; }
  .library-sort-field, .library-type-field { width: 100%; }
  .managed-list-item, .history-row { grid-template-columns: 84px minmax(0, 1fr) auto; gap: 9px; min-height: 74px; }
  .library-row-media { width: 84px; height: 58px; }
  .library-item-copy small { display: none; }
  .history-actions { gap: 3px; }
  .library-sidebar { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .library-collection-grid { gap: 7px; }
  .library-collection-copy { right: 7px; bottom: 7px; left: 7px; }
  .library-collection-copy strong { font-size: 11px; }
  .library-collection-copy span { font-size: 9px; }
  .library-collection-delete { opacity: 1; top: 5px; right: 5px; }
  .library-view-toggle { width: 112px; }
  .library-actions #newListBtn span { display: none; }
  .library-actions #newListBtn { width: 36px; padding: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .global-card-media .poster,
  .global-card-play,
  .global-card-actions { transition: none; }
}

html,
body {
  min-width: 0;
  background: var(--bg);
}

body {
  padding-bottom: 92px;
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  letter-spacing: 0;
}

.hero {
  position: relative;
  top: 0;
  z-index: 60;
  width: 100%;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: #050606;
  box-shadow: none;
  backdrop-filter: blur(18px) saturate(120%);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
}

.hero .topbar {
  width: min(1680px, calc(100% - 40px));
  min-height: 54px;
  margin: 0 auto;
  padding: 9px 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.brand-home {
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.brand-home .brand-mark {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border: 1px solid color-mix(in srgb, var(--accent) 70%, #fff);
  border-radius: 8px;
  background: var(--accent);
  box-shadow: none;
}

.brand-home h1 {
  margin: 0;
  font-size: 17px;
  line-height: 1.05;
}

.brand-home .sub {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.search-filter-panel {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(280px, 1.4fr) minmax(540px, 2fr);
  gap: 10px;
  margin: 0 auto 22px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: none;
}

.search-filter-panel .searchbox,
.search-filter-panel .filters {
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.search-filter-panel .searchbox {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--field);
}

.searchbox input {
  min-width: 0;
  min-height: 40px;
  border: 0;
  background: transparent;
}

.searchbox .primary {
  min-width: 98px;
  min-height: 40px;
  border-radius: 999px;
}

.search-filter-panel .filters {
  display: grid;
  grid-template-columns: 1.2fr repeat(5, minmax(96px, 1fr));
  gap: 6px;
  padding: 3px;
}

.filters select {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--field);
  padding-inline: 12px;
  text-overflow: ellipsis;
}

.filters select:first-child,
.filters select:last-child { border-radius: 999px; }

.app.container-xxl {
  width: min(1680px, 100%);
  max-width: none;
  padding: 30px 20px 52px;
}

.bottom-nav {
  position: fixed;
  right: auto;
  bottom: max(16px, env(safe-area-inset-bottom));
  left: 50%;
  z-index: 100;
  display: flex;
  width: max-content;
  max-width: calc(100vw - 24px);
  gap: 4px;
  padding: 6px;
  border: 1px solid color-mix(in srgb, var(--line) 85%, #fff);
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel) 96%, transparent);
  box-shadow: 0 16px 48px rgba(0, 0, 0, .52);
  transform: translateX(-50%);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.bottom-nav .navbtn {
  display: grid;
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
}

.bottom-nav .navbtn span { display: none; }

.bottom-nav .navbtn.active {
  border-color: color-mix(in srgb, var(--accent) 48%, transparent);
  background: color-mix(in srgb, var(--accent) 17%, var(--panel));
  box-shadow: none;
  color: #fff;
}

.bottom-nav .navbtn::before,
.bottom-nav .navbtn::after { display: none; }

.bottom-nav .navbtn .ico {
  margin: 0;
  font-size: 18px;
}

.toolbar {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 18px;
  padding: 0 0 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.toolbar .left,
.toolbar .right {
  gap: 6px;
  min-width: 0;
}

.btn,
.control,
.form-control,
select,
input,
textarea,
.select-btn {
  border-radius: 8px;
}

.btn {
  border-color: var(--line);
  border-radius: 999px;
  box-shadow: none;
}

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

.catalog-heading {
  display: flex;
  min-height: 84px;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.catalog-heading span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .16em;
}

.catalog-heading h2 {
  margin: 5px 0 0;
  font-size: 38px;
  font-weight: 750;
  line-height: 1;
}

.catalog-heading .stats {
  padding-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.ghost.btn,
.smallbtn.btn,
.select-btn,
.control,
.form-control,
select,
input,
textarea {
  border-color: var(--line);
  background: var(--field);
}

.ghost.btn:hover,
.smallbtn.btn:hover,
.select-btn:hover {
  border-color: color-mix(in srgb, var(--accent-2) 55%, var(--line));
  background: var(--panel-2);
}

.grid {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 23px 13px;
}

.card {
  position: relative;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.card:hover {
  background: transparent;
  box-shadow: none;
  transform: translateY(-2px);
}

.poster-wrap,
.poster,
.card .poster-wrap {
  overflow: hidden;
  border-radius: 8px;
}

.card .poster {
  aspect-ratio: 2 / 3;
  background: var(--panel);
  object-fit: cover;
  transition: filter .18s ease, transform .18s ease, box-shadow .18s ease;
}

.card:hover .poster {
  box-shadow: 0 14px 34px rgba(0, 0, 0, .38);
  filter: brightness(.86);
  transform: scale(1.012);
}

.card .info {
  padding: 9px 1px 4px;
}

.card .title {
  min-height: 0;
  margin: 0 0 5px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.card .meta {
  color: var(--muted);
  font-size: 10px;
}

.card .genres {
  display: flex;
  gap: 4px;
  margin-top: 5px;
  overflow: hidden;
}

.card .genre,
.card .genres .tag,
.source-pill,
.api-chip,
.badge {
  border-radius: 999px;
}

.card .badges {
  inset: 7px 7px auto;
  gap: 5px;
}

.card .badge {
  padding: 4px 7px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(4, 5, 5, .78) !important;
  color: rgba(255, 255, 255, .82);
  font-size: 8px;
  font-weight: 700;
  backdrop-filter: blur(10px);
}

.card .genres .tag {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 9px;
}

.card .genres .tag + .tag::before {
  content: "·";
  margin-right: 4px;
  color: #596168;
}

.card .actions {
  position: absolute;
  top: 8px;
  right: 7px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 0;
}

.card .actions .btn {
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border-color: rgba(255, 255, 255, .16);
  background: rgba(4, 5, 5, .82);
  backdrop-filter: blur(10px);
}

@media (hover: hover) {
  .card .actions {
    opacity: 0;
    pointer-events: none;
    transform: translateY(4px);
    transition: opacity .16s ease, transform .16s ease;
  }

  .card:hover .actions,
  .card:focus-within .actions {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }
}

.query-hints,
.infinite-status,
.empty,
.notice {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
}

.managed-ad-slot {
  position: relative;
  width: min(970px, 100%);
  min-height: calc(var(--managed-ad-height, 90px) + 30px);
  margin: 28px auto 12px;
  padding: 22px 12px 8px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--line) 84%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 78%, transparent);
  content-visibility: auto;
  contain: layout paint;
}

.managed-ad-slot[hidden],
.managed-ad-slot:has(ins[data-ad-status="unfilled"]) {
  display: none !important;
}

.managed-ad-label {
  position: absolute;
  top: 5px;
  left: 10px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: uppercase;
}

.managed-ad-frame,
.managed-ad-slot .adsbygoogle {
  display: block;
  width: 100%;
  min-height: 90px;
  border: 0;
  background: transparent;
}

.managed-house-ad {
  display: grid;
  width: 100%;
  min-height: 88px;
  place-items: center;
}

.managed-smartlink-ad {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  margin: 6px auto 0;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
}

.managed-smartlink-ad:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 52%, var(--line));
}

.managed-house-ad img {
  display: block;
  width: 100%;
  max-width: 970px;
  max-height: 180px;
  object-fit: contain;
}

.detail-inline-ad,
.episode-after-player-ad {
  width: min(980px, calc(100% - 32px));
}

.catalog-feed-ad,
.search-feed-ad,
.community-feed-ad {
  margin-block: 30px 10px;
}

.library-rail-ad {
  width: 100%;
  min-height: calc(var(--managed-ad-height, 250px) + 26px);
  margin: 0;
}

.library-feed-ad {
  margin-top: 24px;
}

.managed-ad-overlay {
  position: fixed;
  inset: auto 0 0;
  z-index: 60;
  width: 1px;
  min-height: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  overflow: visible;
  border: 0;
  background: transparent;
  pointer-events: none;
}

body.theme-glass .managed-ad-slot {
  border-color: rgba(255, 255, 255, .72);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .42), rgba(255, 255, 255, .14)),
    rgba(255, 255, 255, .16);
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, .9),
    inset -1px -1px 0 rgba(80, 89, 108, .12),
    0 16px 44px rgba(67, 75, 94, .12);
  backdrop-filter: blur(26px) saturate(180%);
  -webkit-backdrop-filter: blur(26px) saturate(180%);
}

body.theme-glass .managed-ad-overlay {
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.catalog-pagination-shell,
.community-pager {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 18px 0;
}

#libraryTab,
#communityTab,
#profileTab,
#settingsTab,
#routeTab {
  min-width: 0;
}

.settings-shell,
.profile-shell,
.community-page {
  width: min(1280px, 100%);
  margin: 0 auto;
}

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

.settings-panel,
.profile-panel,
.community-section,
.community-hero,
.public-profile-section,
.public-profile-hero {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.settings-panel {
  min-width: 0;
  padding: 20px 0;
}

.episode-page,
.servers-container {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.server-group,
.episode-card,
.community-card,
.community-user-card,
.managed-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: none;
}

.settings-panel.sources-panel,
.settings-panel.profile-socials-panel,
.profile-panel {
  grid-column: 1 / -1;
}

.settings-panel h2,
.community-section h3,
.profile-panel h2 {
  font-size: 15px;
}

.setting-row {
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

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

.setting-row span,
.panel-copy {
  color: var(--muted);
  font-size: 11px;
}

.source-category-tabs,
.source-settings-tools {
  border-color: var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.source-settings-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.source-setting {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: none;
}

.library-view-toggle,
.segmented,
.mini-segment {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}

.managed-list-item,
.list-row,
.history-row {
  border-color: var(--line);
  border-radius: 6px;
  background: var(--panel);
}

.community-page {
  display: grid;
  gap: 14px;
}

.community-hero {
  padding: 18px;
}

.community-hero h2 {
  margin: 4px 0;
  font-size: 22px;
}

.community-section {
  padding: 15px;
}

.community-grid,
.community-user-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 9px;
}

.community-card,
.community-user-card,
.community-user-row {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: none;
}

.community-card {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
}

.community-cover {
  width: 92px;
  min-height: 128px;
  border-radius: 5px 0 0 5px;
}

.community-title,
.community-user-card strong,
.community-owner span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-actions .btn {
  width: 34px;
  min-width: 34px;
  padding: 0;
}

.profile-overview,
.profile-grid-layout {
  gap: 12px;
}

.profile-hero-card,
.profile-side-panel,
.profile-metric,
.profile-data-card,
.profile-card {
  border-color: var(--line);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: none;
}

.profile-banner,
.public-profile-hero {
  min-height: 220px;
  background-position: center;
  background-size: cover;
}

.detail-modal,
.drawer-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 28px 80px rgba(0, 0, 0, .48);
}

.detail-modal-head {
  border-bottom: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
  background: var(--panel);
}

.route-page,
.media-page,
.episode-page {
  min-width: 0;
}

.episode-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: none;
}

.server-group,
.servers-container {
  padding: 12px;
}

.toast {
  border-radius: 6px;
  background: var(--panel-2);
}

body.theme-light .hero,
body.theme-light .bottom-nav {
  background: rgba(255, 255, 255, .94);
}

body.theme-light .card:hover {
  background: #fff;
  box-shadow: 0 14px 32px rgba(15, 23, 42, .12);
}

body.theme-uiv2 .hero,
body.theme-uiv2 .bottom-nav {
  background: rgba(3, 3, 3, .95);
}

body.theme-glass .hero,
body.theme-glass .bottom-nav {
  background: color-mix(in srgb, var(--glass-bg) 82%, transparent);
  border-color: var(--glass-border);
  box-shadow: var(--glass-inset);
}

@media (max-width: 1180px) {
  .search-filter-panel {
    grid-template-columns: 1fr;
  }

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

  .filters select {
    border: 1px solid var(--line);
    border-radius: 999px;
  }

  .filters select:nth-child(3n),
  .filters select:nth-last-child(-n+3) {
    border: 1px solid var(--line);
    border-radius: 999px;
  }
}

@media (max-width: 760px) {
  body { padding-bottom: 82px; }

  .hero {
    position: relative;
  }

  .hero .topbar {
    width: calc(100% - 20px);
  }

  .search-filter-panel { width: 100%; }

  .brand-home .sub { display: none; }

  .search-filter-panel .filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filters select,
  .filters select:nth-child(3n),
  .filters select:nth-last-child(-n+3) {
    border: 1px solid var(--line);
    border-radius: 999px;
  }

  .filters select:nth-child(2n),
  .filters select:nth-last-child(-n+2) {
    border: 1px solid var(--line);
    border-radius: 999px;
  }

  .app.container-xxl {
    padding: 12px 10px 34px;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar .left {
    width: 100%;
    overflow: visible;
    flex-wrap: wrap;
    padding-bottom: 0;
  }

  .toolbar .left .select-btn {
    flex: 1 1 145px;
  }

  .toolbar .right {
    width: 100%;
    flex: 0 0 auto;
    justify-content: flex-end;
  }

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

  .card .title { font-size: 11px; }
  .card .meta { font-size: 9px; }
  .card .genres { display: none; }
  .card .info { padding: 7px 4px 5px; }
  .card .actions { top: 42px; }

  .settings-shell {
    grid-template-columns: 1fr;
  }

  .settings-panel.sources-panel,
  .settings-panel.profile-socials-panel,
  .profile-panel {
    grid-column: auto;
  }

  .source-settings-list {
    grid-template-columns: 1fr;
  }

  .community-grid,
  .community-user-grid {
    grid-template-columns: 1fr;
  }

  .community-section,
  .community-hero,
  .settings-panel {
    padding: 12px;
  }

  .profile-banner,
  .public-profile-hero {
    min-height: 170px;
  }
}

@media (max-width: 430px) {
  .catalog-heading {
    min-height: 68px;
    margin-bottom: 14px;
    padding-bottom: 14px;
  }

  .catalog-heading h2 { font-size: 30px; }

  .search-filter-panel .searchbox {
    grid-template-columns: minmax(0, 1fr) 42px;
  }

  .searchbox .primary {
    width: 42px;
    min-width: 42px;
    padding: 0;
  }

  .searchbox .primary span { display: none; }

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

  .bottom-nav .navbtn {
    width: 39px;
    min-width: 39px;
    height: 39px;
    min-height: 39px;
  }

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

  .community-cover {
    width: 78px;
    min-height: 112px;
  }
}

/* Community responsive workspace */
.community-section-title {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
}

.community-section-title > div {
  min-width: 0;
}

.community-section-title > div > span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .14em;
}

.community-section-icon {
  display: grid;
  width: 34px;
  min-width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  color: var(--accent);
}

.community-section-search {
  display: flex;
  width: min(340px, 100%);
  align-items: center;
  gap: 4px;
  margin: -4px 0 14px auto;
  padding-left: 12px;
}

.community-page .empty {
  grid-column: 1 / -1;
  width: 100%;
  max-width: none;
}

.community-user-main strong,
.community-user-main small {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 700px) {
  #communityTab,
  #communityBox,
  .community-page {
    width: 100%;
  }

  .community-page {
    display: grid;
    gap: 0;
  }

  .community-hero {
    display: block;
    min-height: 0;
    margin-bottom: 8px;
    padding: 18px 16px 15px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: color-mix(in srgb, var(--accent) 5%, var(--panel));
  }

  .community-hero .eyebrow {
    font-size: 8px;
  }

  .community-hero h2 {
    max-width: 330px;
    margin: 8px 0 6px;
    font-size: 28px;
    line-height: 1.03;
  }

  .community-hero p {
    max-width: 350px;
    font-size: 11px;
    line-height: 1.55;
  }

  .community-overview {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-top: 16px;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .community-overview > div {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    min-width: 0;
    min-height: 54px;
    align-content: center;
    gap: 1px 6px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
  }

  .community-overview > div:last-child {
    border-right: 1px solid var(--line);
  }

  .community-overview i {
    grid-row: 1 / span 2;
    font-size: 15px;
  }

  .community-overview strong {
    min-width: 0;
    font-size: 14px;
  }

  .community-overview span {
    overflow: hidden;
    font-size: 8px;
    text-overflow: ellipsis;
  }

  .community-discovery-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    border-bottom: 0;
  }

  .community-section,
  .community-discovery-grid .community-section {
    min-width: 0;
    padding: 20px 0;
    border-bottom: 1px solid var(--line);
    background: transparent;
  }

  .community-admin-section {
    padding-left: 0;
    border-top: 0;
    border-left: 0;
  }

  .community-section-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    margin-bottom: 13px;
  }

  .community-section-head h3 {
    overflow: hidden;
    font-size: 17px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .community-section-head small {
    display: block;
    overflow: hidden;
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .community-section-head > strong {
    width: 32px;
    min-width: 32px;
    height: 32px;
    border-radius: 8px;
  }

  .community-section-search {
    width: 100%;
    min-width: 0;
    margin: 0 0 13px;
    flex-basis: auto;
  }

  .community-grid-compact {
    display: flex;
    width: 100%;
    gap: 9px;
    margin: 0;
    padding: 0 1px 7px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-padding-inline: 1px;
  }

  .community-grid-compact > .community-card {
    width: min(280px, 82vw);
    flex: 0 0 min(280px, 82vw);
    grid-template-columns: 1fr;
    grid-template-rows: 132px minmax(0, 1fr);
    min-height: 260px;
  }

  .community-grid-compact > .community-card .community-cover {
    width: 100%;
    min-height: 132px;
    border-radius: 7px 7px 0 0;
  }

  .community-grid-compact > .empty {
    min-width: 100%;
    flex: 0 0 100%;
  }

  .community-user-rail {
    display: flex;
    width: 100%;
    gap: 8px;
    padding-bottom: 5px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
  }

  .community-user-rail > .community-user-card {
    width: min(190px, 58vw);
    min-height: 126px;
    flex: 0 0 min(190px, 58vw);
    scroll-snap-align: start;
  }

  .community-user-rail > .empty {
    min-width: 100%;
    flex: 0 0 100%;
  }

  .community-lists-section .community-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 9px;
  }

  .community-lists-section .community-card {
    grid-template-columns: 104px minmax(0, 1fr);
    grid-template-rows: minmax(138px, 1fr);
    min-height: 138px;
  }

  .community-lists-section .community-cover {
    width: 104px;
    min-height: 100%;
    padding: 10px;
    border-radius: 7px 0 0 7px;
  }

  .community-lists-section .community-cover strong,
  .community-lists-section .community-cover small {
    display: none;
  }

  .community-lists-section .community-card-body {
    grid-template-rows: auto auto minmax(0, 1fr) auto auto;
    height: 100%;
    gap: 5px;
    padding: 10px;
  }

  .community-lists-section .community-card-body p {
    min-height: 0;
    -webkit-line-clamp: 2;
  }

  .community-lists-section .community-card-meta {
    display: flex;
    gap: 10px;
    justify-content: flex-start;
  }

  .community-lists-section .community-actions {
    display: flex;
    gap: 5px;
    overflow-x: auto;
  }

  .community-user-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .community-user-card {
    min-width: 0;
    min-height: 132px;
    padding: 16px 9px 11px;
  }

  .community-user-card img,
  .community-user-card .community-user-avatar {
    width: 48px;
    height: 48px;
  }

  .community-user-like {
    top: 7px;
    right: 7px;
  }

  .community-page .empty {
    display: grid;
    min-height: 86px;
    place-items: center;
    padding: 14px;
    border-style: solid;
    border-color: var(--line);
    color: var(--muted);
    font-size: 11px;
    line-height: 1.5;
    text-align: center;
  }

  .community-pager {
    align-items: center;
    padding: 14px 0 0;
  }
}

/* Miraku final pass: the header is a navigation layer, never a framed card. */
body.global-mode > .hero,
body.global-mode > .hero .topbar,
body.global-mode > .hero.app-shell,
body.global-mode > .hero.app-shell .topbar {
  border: 0 !important;
  border-top: 0 !important;
  border-right: 0 !important;
  border-bottom: 0 !important;
  border-left: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
}

body.global-mode > .hero {
  background: linear-gradient(180deg, rgba(7, 8, 12, .92), rgba(7, 8, 12, .68)) !important;
}

body.global-mode > .hero .topbar {
  width: min(1480px, calc(100% - 44px));
  min-height: 68px;
  padding-block: 9px;
}

.brand-home {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
}

.brand-home .miraku-mark,
body.global-mode .brand-home .miraku-mark {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border: 0 !important;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
}

.miraku-logo {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 0 7px rgba(167, 126, 255, .34));
  animation: miraku-logo-glow 3.8s ease-in-out infinite;
}

.miraku-spark { transform-origin: 50% 50%; }
.miraku-spark-main { animation: miraku-spark-pulse 3.8s ease-in-out infinite; }
.miraku-spark-small { animation: miraku-spark-pulse 3.8s .55s ease-in-out infinite; }
.miraku-spark-dot { animation: miraku-spark-pulse 3.8s 1.1s ease-in-out infinite; }

.brand-home h1 {
  margin: 0;
  color: #f7f4ff;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.02em;
}

@keyframes miraku-logo-glow {
  0%, 100% { filter: drop-shadow(0 0 6px rgba(167, 126, 255, .28)); }
  50% { filter: drop-shadow(0 0 13px rgba(167, 126, 255, .72)); }
}

@keyframes miraku-spark-pulse {
  0%, 100% { opacity: .78; transform: scale(.94); }
  50% { opacity: 1; transform: scale(1.06); }
}

/* Search is a full route: keep its input and all filters in the route surface. */
.search-page #searchPageSlot,
body.global-mode .search-page #searchPageSlot {
  display: block;
  width: 100%;
  min-width: 0;
}

.search-page #catalogMainContent,
body.global-mode .search-page #catalogMainContent,
body.global-mode #searchPageSlot #catalogMainContent {
  display: block !important;
  width: 100%;
  min-width: 0;
  visibility: visible !important;
}

.search-page .catalog-controls {
  display: block;
  margin-top: 0;
  padding: 14px;
}

.search-page .search-filter-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.search-page .search-filter-panel .filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
  padding: 0;
}

.search-page .search-filter-panel .searchbox {
  min-height: 48px;
}

.search-page .catalog-toolbar {
  margin-top: 12px;
  padding: 0;
  border-top: 1px solid var(--global-edge, var(--line));
}

/* Preserve the artwork, then use a soft cover layer only as ambient fill. */
body.global-mode .global-spotlight-backdrop {
  background: transparent !important;
  filter: none !important;
  transform: none !important;
}

body.global-mode .global-spotlight-backdrop::before,
body.global-mode .global-spotlight-backdrop::after {
  position: absolute;
  inset: -7%;
  content: "";
  background-image: var(--global-spotlight-image);
  background-repeat: no-repeat;
  pointer-events: none;
}

body.global-mode .global-spotlight-backdrop::before {
  background-position: center;
  background-size: cover;
  filter: blur(26px) saturate(.9);
  opacity: .42;
  transform: scale(1.08);
}

body.global-mode .global-spotlight-backdrop::after {
  inset: 0;
  background-position: center right;
  background-size: contain;
  filter: saturate(1.06) contrast(1.02);
  opacity: .56;
}

body.global-mode .global-spotlight-shade {
  background:
    linear-gradient(90deg, rgba(5, 6, 10, .96) 0%, rgba(5, 6, 10, .80) 35%, rgba(5, 6, 10, .32) 72%, rgba(5, 6, 10, .55) 100%),
    linear-gradient(0deg, rgba(5, 6, 10, .86), transparent 48%, rgba(5, 6, 10, .12));
}

body.global-mode .global-spotlight-poster {
  right: clamp(34px, 6vw, 100px);
  bottom: 22px;
  width: clamp(155px, 16vw, 238px);
  transform: rotate(2deg);
}

body.global-mode .global-feature-poster {
  object-fit: contain;
  background: rgba(6, 7, 11, .48);
}

/* Playback uses a stable video frame; source embeds cannot dictate page width. */
.episode-page .global-player-layout {
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 320px);
  gap: 24px;
}

.episode-page:not(.global-player-page) .global-player-layout {
  grid-template-columns: minmax(0, 1fr);
}

.global-player-main,
.global-player-main .player-container,
.global-player-main .servers-container {
  min-width: 0;
  max-width: 100%;
}

.global-player-main .player-container,
.episode-page .player-container {
  width: 100%;
  height: auto;
  min-height: 0 !important;
  max-height: none;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 16px;
}

.global-player-main .player-container iframe,
.global-player-main .player-container video,
.episode-page .player-container iframe,
.episode-page .player-container video {
  display: block;
  width: 100% !important;
  height: 100% !important;
  min-width: 0;
  min-height: 0;
  border: 0;
  object-fit: contain;
}

.global-player-page .episode-head h2 {
  max-width: min(920px, 100%);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-player-page .player-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  margin: 0 0 10px;
}

.global-player-page .player-external-fallback {
  min-height: 0;
  justify-content: flex-start;
  margin: 8px 0 0;
}

.global-player-page .player-external-fallback-link {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .05);
}

.episode-page .servers-container {
  margin-top: 14px;
  padding: 12px;
  border-radius: 15px;
  overflow: hidden;
}

.global-player-queue {
  max-height: min(650px, calc(100vh - 40px));
}

.global-queue-list {
  max-height: 520px;
}

@media (max-width: 1180px) {
  .search-page .search-filter-panel .filters { grid-template-columns: repeat(3, minmax(120px, 1fr)); }
  .episode-page .global-player-layout { grid-template-columns: minmax(0, 1fr) 280px; }
}

@media (max-width: 900px) {
  .episode-page .global-player-layout { grid-template-columns: minmax(0, 1fr); }
  .global-player-queue { position: static; max-height: 480px; }
  .global-queue-list { max-height: 350px; }
}

@media (max-width: 760px) {
  body.global-mode > .hero .topbar { width: calc(100% - 20px); min-height: 60px; }
  body.global-mode .brand-home .miraku-mark { width: 34px; height: 34px; flex-basis: 34px; }
  body.global-mode .brand-home h1 { font-size: 17px; }
  .search-page .search-filter-panel .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search-page .search-filter-panel .filters select { min-width: 0; width: 100%; }
  body.global-mode .global-spotlight {
    min-height: 590px;
    border-radius: 20px;
  }
  body.global-mode .global-spotlight-backdrop::before,
  body.global-mode .global-spotlight-backdrop::after {
    background-image: var(--global-spotlight-mobile-image, var(--global-spotlight-image));
    background-position: center top;
    background-size: cover;
  }
  body.global-mode .global-spotlight-backdrop::before { opacity: .34; }
  body.global-mode .global-spotlight-backdrop::after { opacity: .62; }
  body.global-mode .global-spotlight-shade {
    background: linear-gradient(180deg, rgba(5, 6, 10, .08) 0%, rgba(5, 6, 10, .16) 25%, rgba(5, 6, 10, .70) 62%, rgba(5, 6, 10, .98) 88%, #05060a 100%);
  }
  body.global-mode .global-spotlight-content {
    min-height: 590px;
    justify-content: flex-end;
    padding: 250px 22px 24px;
  }
  body.global-mode .global-spotlight-poster { display: none; }
  .global-player-page .episode-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
  .global-player-page .episode-nav .btn { min-width: 0; padding-inline: 8px; }
  .global-player-page .episode-nav .btn span { display: none; }
  .global-player-page .episode-head { align-items: flex-start; gap: 10px; }
  .global-player-page .episode-head h2 { max-width: 100%; font-size: clamp(23px, 7vw, 34px); white-space: normal; }
  .global-player-page .episode-check-btn { width: auto; max-width: 100%; }
  .global-player-page .player-toolbar { justify-content: flex-start; }
  .global-player-main .player-container,
  .episode-page .player-container { border-radius: 12px; }
  .global-player-main .player-container iframe,
  .global-player-main .player-container video,
  .episode-page .player-container iframe,
  .episode-page .player-container video { border-radius: 11px; }
  .episode-page .servers-container { padding: 9px; }
  .server-language-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .server-language-tabs::-webkit-scrollbar { display: none; }
}

/* Last cascade: overrides legacy route limits and framed topbar rules. */
html body.global-mode > .hero,
html body.global-mode > .hero .topbar,
html body.global-mode > .hero .topbar::before,
html body.global-mode > .hero .topbar::after {
  width: min(1480px, calc(100% - 32px)) !important;
  max-width: none !important;
  margin-inline: auto !important;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
}

body.global-mode main.app.app-shell.container-xxl,
body.global-mode main.app.app-shell,
body.global-mode #catalogTab,
body.global-mode #searchTab,
body.global-mode #routeTab,
body.global-mode .global-catalog-view,
body.global-mode .global-catalog-rails,
body.global-mode .global-detail-page,
body.global-mode .global-player-page {
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
}

body.global-mode main.app.app-shell.container-xxl { margin-inline: 0 !important; padding-inline: clamp(16px, 3.2vw, 64px) !important; }
body.global-mode .global-detail-page,
body.global-mode .global-player-page { min-height: calc(100vh - 86px); margin-inline: auto !important; }

#routeTab.has-route-backdrop::before,
#routeTab.has-route-backdrop::after {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-height: none !important;
  background-position: center center !important;
  z-index: -2 !important;
}
#routeTab.has-route-backdrop::before { background-size: cover !important; opacity: .42 !important; transform: scale(1.035) !important; }
#routeTab.has-route-backdrop::after { z-index: -1 !important; background: linear-gradient(90deg, rgba(5,7,13,.88), rgba(5,7,13,.48) 45%, rgba(5,7,13,.72)), linear-gradient(180deg, rgba(5,7,13,.24), rgba(5,7,13,.56) 58%, var(--bg) 100%) !important; }

body.global-mode .global-detail-backdrop,
body.global-mode .global-detail-shade { inset: 0 !important; mask: none !important; -webkit-mask: none !important; transform: none !important; }
body.global-mode .global-detail-backdrop { background-position: center center !important; background-size: cover !important; opacity: .22 !important; }
body.global-mode .global-detail-shade { background: linear-gradient(90deg, rgba(5,7,13,.78), rgba(5,7,13,.42) 52%, rgba(5,7,13,.68)), linear-gradient(180deg, rgba(5,7,13,.18), rgba(5,7,13,.68) 65%, var(--bg) 100%) !important; }

.episode-page-backdrop,
.episode-page-shade { position: absolute; inset: 0; pointer-events: none; }
.episode-page-backdrop { z-index: -3; background: var(--episode-page-backdrop) center / cover no-repeat; filter: saturate(.78) brightness(.62); opacity: .27; transform: scale(1.035); }
.episode-page-shade { z-index: -2; background: linear-gradient(90deg, rgba(5,7,13,.9), rgba(5,7,13,.48) 50%, rgba(5,7,13,.82)), linear-gradient(180deg, rgba(5,7,13,.28), var(--bg) 88%); }
.episode-page > :not(.episode-page-backdrop):not(.episode-page-shade) { position: relative; z-index: 1; }

.global-detail-tags .genre-link,
.genres .genre-link { appearance: none; cursor: pointer; font: inherit; line-height: 1; text-decoration: none; }
.global-detail-tags .genre-link:hover,
.global-detail-tags .genre-link:focus-visible,
.genres .genre-link:hover,
.genres .genre-link:focus-visible { border-color: rgba(167,139,250,.72); color: #fff; background: rgba(139,92,246,.24); }
.summary-mobile { display: none; }
.global-detail-description-copy { max-width: 900px; margin: 0; padding: 18px 20px 24px; line-height: 1.75; }
.global-similar-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding: 18px 20px 22px; }
.global-cast-person small { display: block; white-space: normal; }

@media (max-width: 900px) {
  body.global-mode main.app.app-shell.container-xxl { padding-inline: 14px !important; }
  .global-similar-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-inline: 14px; }
}

@media (max-width: 640px) {
  html body.global-mode > .hero .topbar { width: calc(100% - 16px) !important; border-radius: 22px !important; }
  .global-similar-grid { grid-template-columns: minmax(0, 1fr); }
  .summary-desktop { display: none; }
  .summary-mobile { display: inline; }
  .global-detail-summary { display: block; max-height: 5.1em; overflow: hidden; }
  .global-detail-description-copy { max-height: 8.2em; overflow: hidden; line-height: 1.55; }
}

/* Final catalog-media geometry: this intentionally stays last so legacy
   responsive blocks cannot turn similar posters into landscape cards. */
body.global-mode .global-similar-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 16px !important;
  align-items: start;
}
body.global-mode .global-similar-grid .global-card-media {
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  aspect-ratio: 2 / 3 !important;
  overflow: hidden !important;
}
body.global-mode .global-similar-grid .global-card-media > img,
body.global-mode .global-similar-grid .global-card-media .poster,
body.global-mode .global-similar-grid .global-card-media .cover-fallback {
  display: block;
  width: 100% !important;
  height: 100% !important;
  aspect-ratio: auto !important;
  object-fit: cover !important;
}
@media (max-width: 1120px) {
  body.global-mode .global-similar-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}
@media (max-width: 760px) {
  body.global-mode .global-similar-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 12px !important; }
}

/* Global similar titles use the same poster geometry as the home catalogue. */
body.global-mode .global-similar-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 18px !important;
}

body.global-mode .global-similar-grid .global-card-media {
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  aspect-ratio: 2 / 3 !important;
  overflow: hidden !important;
}

body.global-mode .global-similar-grid .global-card-media .poster,
body.global-mode .global-similar-grid .global-card-media .cover-fallback {
  width: 100% !important;
  height: 100% !important;
  aspect-ratio: auto !important;
  object-fit: cover !important;
}

@media (max-width: 1000px) {
  body.global-mode .global-similar-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}

@media (max-width: 640px) {
  body.global-mode .global-similar-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 12px !important; }
}

/* Miraku polish pass: keep the shell borderless, restore pill metadata and make
   long-running catalog views progressively fill without a manual add button. */
html body.global-mode > .hero.app-shell,
html body.global-mode > .hero.app-shell::before,
html body.global-mode > .hero.app-shell::after,
html body.global-mode > .hero.app-shell .topbar,
html body.global-mode > .hero.app-shell .topbar::before,
html body.global-mode > .hero.app-shell .topbar::after {
  border: 0 !important;
  border-bottom: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  background-clip: padding-box !important;
}

html body.global-mode > .hero.app-shell .global-topbar-nav {
  border: 1px solid rgba(255,255,255,.11) !important;
  box-shadow: 0 10px 28px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.06) !important;
}

.global-detail-tags,
.media-detail-content .genres,
.global-card-genres,
.genres {
  align-items: center;
}

.global-detail-tags > span,
.global-detail-tags > button,
.global-detail-tags .genre-link,
.media-detail-content .genres > .tag,
.media-detail-content .genres > .genre-link,
.global-card-genres > span,
.genres > .tag,
.genres > .genre-link {
  display: inline-flex !important;
  width: auto !important;
  min-width: 0 !important;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  padding: 6px 11px !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  border-radius: 999px !important;
  background: rgba(255,255,255,.06) !important;
  color: rgba(245,247,255,.84) !important;
  font-size: 11px !important;
  line-height: 1 !important;
  white-space: nowrap;
}

.global-detail-tags .global-detail-audio,
.genres > .audio-tag,
.global-card-genres > .audio-tag {
  border-color: rgba(167,139,250,.48) !important;
  background: rgba(139,92,246,.18) !important;
  color: #d8c7ff !important;
  font-weight: 800;
}

.global-detail-tags .global-detail-audio.is-latino,
.genres > .audio-latino,
.global-card-genres > .audio-latino {
  border-color: rgba(52,211,153,.5) !important;
  background: rgba(16,185,129,.17) !important;
  color: #a7f3d0 !important;
}

.global-rating-summary > span {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px;
}

.global-rating-summary > span > i {
  display: inline-block;
  line-height: 1;
}

.global-rating-summary > span small {
  flex: 0 0 100%;
  width: 100%;
  margin-top: 3px;
}

.global-similar-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 16px !important;
}

.global-similar-grid .global-card-media {
  aspect-ratio: 2 / 3;
  max-height: 310px;
}

.global-similar-grid .global-card-copy {
  padding: 8px 2px 0;
}

.global-similar-grid .global-card-title {
  font-size: 12px;
}

.global-similar-grid .global-card-meta,
.global-similar-grid .global-card-genres {
  font-size: 9px;
}

.global-rail-load-more,
.global-rail-head-actions .global-rail-load-more {
  display: none !important;
}

body.auth-checking {
  background:
    radial-gradient(circle at 18% 18%, rgba(139,92,246,.16), transparent 31%),
    radial-gradient(circle at 84% 74%, rgba(56,189,248,.09), transparent 34%),
    #06070b;
}

body.auth-checking .auth-gate {
  padding: clamp(16px, 4vw, 48px);
}

body.auth-checking .auth-card {
  width: min(900px, 100%);
  min-height: 430px;
  border: 1px solid rgba(196,181,253,.22) !important;
  border-radius: 26px !important;
  background: linear-gradient(135deg, rgba(18,16,31,.96), rgba(8,11,18,.96)) !important;
  box-shadow: 0 34px 100px rgba(0,0,0,.48), inset 0 1px 0 rgba(255,255,255,.08) !important;
}

body.auth-checking .auth-boot-visual {
  min-height: 430px;
  border-right: 1px solid rgba(196,181,253,.14) !important;
  background:
    radial-gradient(circle at 50% 47%, rgba(167,139,250,.22), transparent 22%),
    linear-gradient(145deg, rgba(36,25,64,.94), rgba(8,11,18,.96));
}

body.auth-checking .auth-boot-visual::before {
  position: absolute;
  inset: 14% 14% 28%;
  border: 1px solid rgba(196,181,253,.24);
  border-radius: 50%;
  content: "";
  animation: loading-orbit 12s linear infinite;
}

body.auth-checking .auth-orbit-svg {
  inset: 18% 9%;
  width: 82%;
  height: 64%;
}

body.auth-checking .auth-boot-posters span {
  border-color: rgba(196,181,253,.18);
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(255,255,255,.08), rgba(255,255,255,.025));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}

body.auth-checking .auth-card-content {
  padding: clamp(28px, 5vw, 58px);
  gap: 13px;
}

body.auth-checking .auth-card-content h1 {
  font-size: clamp(32px, 5vw, 52px) !important;
  letter-spacing: -.03em;
}

body.auth-checking .auth-card-content p {
  max-width: 390px;
  font-size: 12px;
}

@media (max-width: 1120px) {
  .global-similar-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}

@media (max-width: 760px) {
  .global-similar-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 12px !important; }
  .global-similar-grid .global-card-media { max-height: none; }
  .global-detail-actions .btn { flex: 1 1 auto; }
  body.auth-checking .auth-card { grid-template-columns: 1fr; min-height: 0; }
  body.auth-checking .auth-boot-visual { min-height: 250px; border-right: 0 !important; border-bottom: 1px solid rgba(196,181,253,.14) !important; }
  body.auth-checking .auth-card-content { padding: 28px 24px 32px; }
}

@media (max-width: 420px) {
  .global-similar-grid { gap: 9px !important; }
  .global-similar-grid .global-card-title { font-size: 11px; }
  .global-detail-tags > span,
  .global-detail-tags > button,
  .media-detail-content .genres > .tag,
  .global-card-genres > span { min-height: 25px; padding: 5px 8px !important; font-size: 9px !important; }
}

/* Miraku route shell: the global catalogue and media pages own the full canvas. */
html body.global-mode > .hero,
html body.global-mode > .hero::before,
html body.global-mode > .hero::after,
html body.global-mode > .hero .topbar,
html body.global-mode > .hero .topbar::before,
html body.global-mode > .hero .topbar::after {
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  background-image: none !important;
}

html body.global-mode > .hero .topbar {
  width: min(1480px, calc(100% - 32px)) !important;
  max-width: none !important;
  margin-inline: auto !important;
  border-radius: 999px !important;
}

body.global-mode main.app.app-shell.container-xxl,
body.global-mode main.app.app-shell,
body.global-mode #catalogTab,
body.global-mode #searchTab,
body.global-mode #routeTab,
body.global-mode #libraryTab,
body.global-mode #communityTab,
body.global-mode #profileTab,
body.global-mode #settingsTab,
body.global-mode #adminTab {
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
}

body.global-mode main.app.app-shell.container-xxl {
  margin-inline: 0 !important;
  padding-inline: clamp(16px, 3.2vw, 64px) !important;
}

body.global-mode .global-catalog-view,
body.global-mode .global-catalog-rails,
body.global-mode .global-catalog-navigation,
body.global-mode .search-page,
body.global-mode .global-detail-page,
body.global-mode .global-player-page {
  width: 100% !important;
  max-width: none !important;
}

body.global-mode .global-detail-page,
body.global-mode .global-player-page {
  margin-inline: auto !important;
  min-height: calc(100vh - 86px);
}

/* Backdrops are page atmosphere, never a clipped card decoration. */
#routeTab.has-route-backdrop::before,
#routeTab.has-route-backdrop::after {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-height: none !important;
  z-index: -2 !important;
  background-position: center center !important;
}

#routeTab.has-route-backdrop::before {
  background-size: cover !important;
  filter: saturate(.82) brightness(.72) !important;
  opacity: .42 !important;
  transform: scale(1.035) !important;
}

#routeTab.has-route-backdrop::after {
  z-index: -1 !important;
  background:
    linear-gradient(90deg, rgba(5,7,13,.88) 0%, rgba(5,7,13,.48) 45%, rgba(5,7,13,.72) 100%),
    linear-gradient(180deg, rgba(5,7,13,.24) 0%, rgba(5,7,13,.56) 58%, var(--bg) 100%) !important;
}

body.global-mode .global-detail-backdrop,
body.global-mode .global-detail-shade {
  inset: 0 !important;
  mask: none !important;
  -webkit-mask: none !important;
  transform: none !important;
}

body.global-mode .global-detail-backdrop {
  background-position: center center !important;
  background-size: cover !important;
  opacity: .22 !important;
}

body.global-mode .global-detail-shade {
  background:
    linear-gradient(90deg, rgba(5,7,13,.78), rgba(5,7,13,.42) 52%, rgba(5,7,13,.68)),
    linear-gradient(180deg, rgba(5,7,13,.18), rgba(5,7,13,.68) 65%, var(--bg) 100%) !important;
}

.episode-page-backdrop,
.episode-page-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.episode-page-backdrop {
  z-index: -3;
  background: var(--episode-page-backdrop) center / cover no-repeat;
  filter: saturate(.78) brightness(.62);
  opacity: .27;
  transform: scale(1.035);
}

.episode-page-shade {
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(5,7,13,.9), rgba(5,7,13,.48) 50%, rgba(5,7,13,.82)),
    linear-gradient(180deg, rgba(5,7,13,.28), var(--bg) 88%);
}

.episode-page > :not(.episode-page-backdrop):not(.episode-page-shade) {
  position: relative;
  z-index: 1;
}

/* Genre chips are actual navigation controls, with a compact mobile summary. */
.genre-link {
  cursor: pointer;
  text-decoration: none;
}

.global-detail-tags .genre-link,
.genres .genre-link {
  appearance: none;
  font: inherit;
  line-height: 1;
}

.global-detail-tags .genre-link:hover,
.global-detail-tags .genre-link:focus-visible,
.genres .genre-link:hover,
.genres .genre-link:focus-visible {
  border-color: rgba(167,139,250,.72);
  color: #fff;
  background: rgba(139,92,246,.24);
}

.summary-mobile { display: none; }
.global-detail-description-copy { max-width: 900px; margin: 0; padding: 18px 20px 24px; color: var(--global-muted); line-height: 1.75; }

.global-similar-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 18px 20px 22px;
}

.global-similar-grid .global-card { min-width: 0; }
.global-cast-person small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: normal; }

/* Loading and onboarding use one visual system instead of an empty black box. */
.loading-state {
  position: relative;
  width: min(100%, 1480px) !important;
  max-width: none !important;
  min-height: 320px;
  overflow: hidden;
  border: 1px solid rgba(167,139,250,.22);
  border-radius: 24px;
  background:
    radial-gradient(circle at 18% 20%, rgba(139,92,246,.22), transparent 30%),
    radial-gradient(circle at 82% 86%, rgba(56,189,248,.11), transparent 32%),
    linear-gradient(135deg, rgba(24,20,43,.96), rgba(8,10,17,.98));
  box-shadow: 0 24px 80px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.10);
}

.loading-state::before,
.loading-state::after {
  position: absolute;
  content: '';
  pointer-events: none;
  border: 1px solid rgba(167,139,250,.16);
  border-radius: 50%;
  animation: loading-orbit 7s linear infinite;
}

.loading-state::before { width: 360px; height: 360px; left: 9%; top: -38%; }
.loading-state::after { width: 540px; height: 540px; right: -10%; bottom: -90%; animation-direction: reverse; }

.loading-visual { filter: drop-shadow(0 12px 28px rgba(139,92,246,.18)); }
.loading-pulse-mark { transform: scale(1.18); }
.loading-pulse-mark i { color: #c4b5fd; text-shadow: 0 0 22px rgba(167,139,250,.78); animation: loading-star-pulse 1.8s ease-in-out infinite; }
.loading-signal { color: #c4b5fd; letter-spacing: .12em; }
.loading-track { background: rgba(255,255,255,.10); }
.loading-track span { background: linear-gradient(90deg, #7c3aed, #c4b5fd, #38bdf8); box-shadow: 0 0 18px rgba(167,139,250,.72); }

.auth-boot-visual { position: relative; overflow: hidden; background: radial-gradient(circle, rgba(139,92,246,.2), transparent 60%), linear-gradient(145deg, #191329, #090b11); }
.auth-boot-visual::after { position: absolute; inset: 12%; border: 1px solid rgba(196,181,253,.25); border-radius: 50%; content: ''; animation: loading-orbit 8s linear infinite; }
.auth-orbit-svg { position: absolute; inset: 12% 8%; width: 84%; height: 76%; overflow: visible; fill: none; stroke: rgba(196,181,253,.4); stroke-width: 1; animation: loading-orbit 14s linear infinite; }
.auth-orbit-svg path { stroke: rgba(56,189,248,.24); stroke-dasharray: 3 8; }
.auth-orbit-svg circle { fill: #c4b5fd; stroke: #fff; stroke-width: 2; filter: drop-shadow(0 0 8px rgba(196,181,253,.9)); }
.auth-boot-rings i { border-color: rgba(167,139,250,.44); animation: loading-ring-pulse 2.2s ease-in-out infinite; }
.auth-boot-rings i:nth-child(2) { animation-delay: .35s; }
.auth-boot-rings i:nth-child(3) { animation-delay: .7s; }

@keyframes loading-orbit { to { transform: rotate(360deg); } }
@keyframes loading-ring-pulse { 50% { opacity: .35; transform: scale(1.08); } }
@keyframes loading-star-pulse { 50% { transform: scale(1.18) rotate(8deg); opacity: .72; } }

@media (max-width: 900px) {
  body.global-mode main.app.app-shell.container-xxl { padding-inline: 14px !important; }
  .global-similar-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-inline: 14px; }
  .global-detail-description-copy { padding-inline: 14px; }
}

@media (max-width: 640px) {
  html body.global-mode > .hero .topbar { width: calc(100% - 16px) !important; border-radius: 22px !important; }
  .global-similar-grid { grid-template-columns: minmax(0, 1fr); }
  .summary-desktop { display: none; }
  .summary-mobile { display: inline; }
  .global-detail-summary { display: block; max-height: 5.1em; overflow: hidden; }
  .global-detail-description-copy { max-height: 8.2em; overflow: hidden; line-height: 1.55; }
  .loading-state { min-height: 390px; border-radius: 20px; }
  .loading-state::before { left: -30%; top: -15%; }
  .loading-state::after { right: -44%; bottom: -30%; }
}

/* EOF library cascade anchor */
#libraryTab .library-dashboard { grid-template-columns: minmax(0, 1fr) minmax(286px, 320px); }

/* Final library cascade: keep the dashboard layout ahead of legacy library rules. */
#libraryTab .library-dashboard { display: grid; grid-template-columns: minmax(0, 1fr) minmax(286px, 320px); gap: 22px; align-items: start; }
#libraryTab .library-main-column, #libraryTab .library-sidebar, #libraryTab .library-browser-panel { min-width: 0; }
#libraryTab .library-overview { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0 0 26px; border: 0; }
#libraryTab .library-overview-item { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 10px; min-height: 92px; padding: 16px; border: 1px solid var(--library-edge); border-radius: 14px; background: linear-gradient(145deg, var(--library-panel-strong), var(--library-panel)); text-align: left; }
#libraryTab .library-overview-item:last-child { border-right: 1px solid var(--library-edge); }
#libraryTab .library-overview-item > i { width: 38px; height: 38px; border: 0; border-radius: 11px; background: var(--accent-soft); }
#libraryTab .library-overview-item span { display: grid; gap: 3px; }
#libraryTab .library-overview-item strong { font-size: 18px; }
#libraryTab .library-overview-item small { margin: 0; color: var(--text); font-size: 12px; text-transform: none; }
#libraryTab .library-overview-item em { color: var(--muted); font-size: 10px; font-style: normal; }
#libraryTab .library-collections-panel { margin-bottom: 26px; }
#libraryTab .library-collection-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
#libraryTab .library-collection-card { position: relative; min-width: 0; aspect-ratio: 1.58; overflow: hidden; border: 1px solid var(--library-edge); border-radius: 10px; background: var(--library-panel); }
#libraryTab .library-collection-main { position: absolute; inset: 0; display: block; width: 100%; padding: 0; border: 0; background: transparent; text-align: left; }
#libraryTab .library-collection-art-stack, #libraryTab .library-collection-art, #libraryTab .library-collection-shade { position: absolute; inset: 0; display: block; }
#libraryTab .library-collection-art { background-image: var(--library-art); background-position: center; background-size: cover; }
#libraryTab .library-collection-art-1 { inset: 0 34% 0 0; }
#libraryTab .library-collection-art-2 { inset: 0 17% 0 33%; opacity: .9; }
#libraryTab .library-collection-art-3 { inset: 0 0 0 66%; opacity: .76; }
#libraryTab .library-collection-art-stack.is-count-1 .library-collection-art-1 { inset: 0; }
#libraryTab .library-collection-art-stack.is-count-1 .library-collection-art { inset: 0; width: 100%; height: 100%; }
#libraryTab .library-collection-art-stack.is-count-2 .library-collection-art-1 { inset: 0 50% 0 0; }
#libraryTab .library-collection-art-stack.is-count-2 .library-collection-art-2 { inset: 0 0 0 50%; }
#libraryTab .library-collection-shade { background: linear-gradient(180deg, rgba(5,7,13,.08), rgba(5,7,13,.84)); }
#libraryTab .library-collection-copy { position: absolute; right: 10px; bottom: 9px; left: 10px; display: grid; gap: 2px; min-width: 0; color: #fff; }
#libraryTab .library-collection-copy small { color: rgba(255,255,255,.72); font-size: 8px; font-weight: 800; }
#libraryTab .library-collection-copy strong, #libraryTab .library-collection-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#libraryTab .library-collection-copy strong { font-size: 13px; }
#libraryTab .library-collection-copy span { color: rgba(255,255,255,.72); font-size: 10px; }
#libraryTab .library-collection-delete { position: absolute; top: 8px; right: 8px; z-index: 2; width: 28px; min-width: 28px; height: 28px; padding: 0; border-radius: 50%; background: rgba(5,7,13,.64); opacity: 0; }
#libraryTab .library-collection-card:hover .library-collection-delete, #libraryTab .library-collection-card:focus-within .library-collection-delete { opacity: 1; }
#libraryTab .library-navigation { margin: 0 0 10px; padding: 0 0 10px; border-bottom: 1px solid var(--library-edge); }
#libraryTab .library-content-tools { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; }
#libraryTab .library-search-field { display: flex; position: relative; flex: 1 1 260px; align-items: center; }
#libraryTab .library-search-field > i { position: absolute; left: 11px; pointer-events: none; }
#libraryTab .library-search-field input { width: 100%; padding-left: 32px; }
#libraryTab .library-sort-field, #libraryTab .library-type-field { flex: 0 1 170px; }
#libraryTab .library-sort-field > span, #libraryTab .library-type-field > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
#libraryTab .managed-list-item, #libraryTab .history-row { display: grid; grid-template-columns: 138px minmax(0, 1fr) auto; gap: 14px; align-items: center; min-height: 92px; padding: 8px; border: 1px solid var(--library-edge); border-radius: 11px; background: linear-gradient(90deg, var(--library-panel-strong), var(--library-panel)); }
#libraryTab .library-row-media { width: 138px; height: 76px; padding: 0; overflow: hidden; border-radius: 7px; }
#libraryTab .library-row-art { display: grid; width: 100%; height: 100%; place-items: center; background-image: linear-gradient(90deg, rgba(5,7,13,.06), rgba(5,7,13,.4)), var(--library-art); background-position: center; background-size: cover; }
#libraryTab .library-item-copy { display: grid; min-width: 0; gap: 4px; }
#libraryTab .library-item-copy strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
#libraryTab .library-item-copy small { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
#libraryTab .library-sidebar { display: grid; gap: 14px; }
#libraryTab .library-side-panel { min-width: 0; padding: 16px; border: 1px solid var(--library-edge); border-radius: 13px; background: linear-gradient(145deg, var(--library-panel-strong), var(--library-panel)); }
#libraryTab .library-side-head { display: flex; gap: 12px; align-items: center; justify-content: space-between; min-width: 0; margin-bottom: 13px; }
#libraryTab .library-side-head h3 { display: flex; gap: 8px; align-items: center; margin: 0; font-size: 15px; }
#libraryTab .library-side-head h3 i { color: var(--accent); }
#libraryTab .library-continue-row { display: grid; grid-template-columns: 54px minmax(0, 1fr) 28px; gap: 9px; align-items: center; padding: 9px 0; border-top: 1px solid var(--library-edge); }
#libraryTab .library-continue-row:first-child, #libraryTab .library-activity-row:first-child { border-top: 0; padding-top: 0; }
#libraryTab .library-side-art { width: 54px; height: 42px; padding: 0; overflow: hidden; border: 0; border-radius: 7px; }
#libraryTab .library-side-art-image { display: grid; width: 100%; height: 100%; place-items: center; background-image: linear-gradient(90deg, rgba(5,7,13,.06), rgba(5,7,13,.4)), var(--library-art); background-position: center; background-size: cover; }
#libraryTab .library-side-copy { display: grid; gap: 3px; min-width: 0; }
#libraryTab .library-side-copy strong, #libraryTab .library-side-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#libraryTab .library-side-copy strong { font-size: 11px; }
#libraryTab .library-side-copy span { color: var(--muted); font-size: 10px; }
#libraryTab .library-progress { display: block; height: 3px; overflow: hidden; border-radius: 99px; background: var(--line); }
#libraryTab .library-progress i { display: block; height: 100%; background: var(--accent); }
#libraryTab .library-play-btn { display: grid; width: 28px; height: 28px; place-items: center; padding: 0; border: 0; border-radius: 50%; color: #fff; background: var(--accent-soft); }
#libraryTab .library-activity-row { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 9px; align-items: center; width: 100%; padding: 9px 0; border: 0; border-top: 1px solid var(--library-edge); text-align: left; }
#libraryTab .library-activity-icon { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 9px; color: var(--accent); background: var(--accent-soft); }
#libraryTab .library-activity-row > span:last-child { display: grid; gap: 2px; min-width: 0; }
#libraryTab .library-activity-row strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
#libraryTab .library-activity-row small { color: var(--muted); font-size: 9px; }
#libraryTab .library-shortcuts #libraryShortcuts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
#libraryTab .library-shortcut { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 2px 6px; align-items: center; min-width: 0; padding: 9px; border: 1px solid var(--library-edge); border-radius: 9px; text-align: left; }
#libraryTab .library-shortcut > span { grid-row: span 2; display: grid; width: 26px; height: 26px; place-items: center; border-radius: 8px; color: var(--accent); background: var(--accent-soft); }
#libraryTab .library-shortcut strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
#libraryTab .library-shortcut small { color: var(--muted); font-size: 9px; }
#libraryTab .library-create-list { display: flex; gap: 6px; justify-content: center; width: 100%; margin-top: 10px; padding: 8px; border: 1px solid color-mix(in srgb, var(--accent) 50%, var(--library-edge)); border-radius: 8px; color: var(--accent); background: var(--accent-soft); font-size: 11px; }
@media (max-width: 1180px) { #libraryTab .library-collection-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) { #libraryTab .library-dashboard { grid-template-columns: 1fr; } #libraryTab .library-sidebar { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 680px) {
  #libraryTab .library-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  #libraryTab .library-overview-item { min-height: 80px; padding: 12px; }
  #libraryTab .library-collection-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  #libraryTab .library-navigation { align-items: stretch; flex-direction: column; }
  #libraryTab .library-toolbar { overflow-x: auto; }
  #libraryTab .library-toolbar .left { flex-wrap: nowrap; width: max-content; }
  #libraryTab .library-content-tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #libraryTab .library-search-field { grid-column: 1 / -1; }
  #libraryTab .library-sort-field, #libraryTab .library-type-field { width: 100%; }
  #libraryTab .managed-list-item, #libraryTab .history-row { grid-template-columns: 84px minmax(0, 1fr) auto; gap: 9px; min-height: 74px; }
  #libraryTab .library-row-media { width: 84px; height: 58px; }
  #libraryTab .library-item-copy small { display: none; }
  #libraryTab .library-sidebar { grid-template-columns: 1fr; }
}
@media (max-width: 420px) { #libraryTab .library-collection-copy strong { font-size: 11px; } #libraryTab .library-collection-delete { opacity: 1; } #libraryTab .library-actions #newListBtn span { display: none; } #libraryTab .library-actions #newListBtn { width: 36px; padding: 0; } }

/* Final contrast and artwork rules for the light Glass surface. */
body.global-mode.theme-glass .brand-home h1 { color: #20232d !important; }
body.global-mode .global-spotlight.has-backdrop-art .global-spotlight-backdrop::after {
  background-position: center !important;
  background-size: cover !important;
  opacity: .48;
}
body.global-mode.theme-glass .global-player-page { color: #1c2030; }
body.global-mode.theme-glass .global-player-page .episode-head h2,
body.global-mode.theme-glass .global-player-page .episode-number-line,
body.global-mode.theme-glass .global-player-page .episode-title-line { color: #1c2030 !important; }
body.global-mode.theme-glass .global-player-page .episode-check-btn,
body.global-mode.theme-glass .global-player-page .player-toolbar .btn,
body.global-mode.theme-glass .global-player-page .global-player-context { color: rgba(28,32,48,.78); }
body.global-mode.theme-glass .global-player-page .episode-check-btn { border-color: rgba(79,63,145,.24); background: rgba(255,255,255,.42); }
body.global-mode.theme-glass .global-player-page .player-toolbar .btn { border-color: rgba(79,63,145,.18); background: rgba(255,255,255,.42); }

/* Final route surface precedence */
body.auth-locked #authGate .auth-card,
body.auth-locked.auth-checking #authGate .auth-card {
  display: grid;
  width: min(820px, 100%);
  grid-template-columns: minmax(240px, .8fr) minmax(280px, 1fr);
  justify-items: stretch;
  gap: 0;
  padding: 0;
  border-radius: 8px;
  text-align: left;
}

body.auth-locked.auth-checking #authGate .auth-card::after {
  display: none;
}

body.auth-locked #authGate .auth-mark,
body.auth-locked.auth-checking #authGate .auth-mark {
  position: absolute;
  top: 24px;
  left: 24px;
  width: 46px;
  height: 46px;
  grid-row: auto;
  font-size: 18px;
}

.community-section-head .community-section-title > .community-section-icon {
  display: grid;
  margin: 0;
  color: var(--accent);
  font-size: 18px;
  letter-spacing: 0;
}

.community-section-head .community-section-title > .community-section-icon i {
  font-size: inherit;
  line-height: 1;
}

body.auth-locked #authGate .auth-card-content h1,
body.auth-locked.auth-checking #authGate .auth-card-content h1 {
  margin: 0;
  font-size: 36px;
}

body.auth-locked #authGate .auth-card-content p,
body.auth-locked.auth-checking #authGate .auth-card-content p {
  max-width: 370px;
  margin: 0 0 4px;
  font-size: 11px;
}

.profile-overview {
  grid-template-columns: minmax(0, 1fr) 270px;
}

.profile-overview.has-profile-background {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background-image: linear-gradient(rgba(4, 4, 7, .55), rgba(4, 4, 7, .82)), var(--profile-bg);
  background-position: center;
  background-size: cover;
}

.profile-hero-card,
.profile-metrics,
.public-profile-editor,
.profile-side-panel {
  border-radius: 8px;
}

.profile-banner {
  min-height: 220px;
  background-image: var(--profile-banner);
  background-position: center;
  background-size: cover;
}

.profile-hero-content {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: end;
  gap: 14px;
}

.profile-metrics {
  grid-template-columns: 1fr;
}

.profile-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 14px;
}

.public-profile-hero {
  min-height: 0;
  border-radius: 8px;
}

.public-profile-banner {
  min-height: 250px;
  background-color: var(--panel-2);
  background-image: var(--public-banner);
  background-position: center;
  background-size: cover;
}

@media (max-width: 900px) {
  .profile-overview,
  .profile-workspace,
  .public-profile-layout {
    grid-template-columns: 1fr;
  }

  .profile-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .profile-metric {
    grid-template-columns: 1fr;
    min-height: 72px;
    justify-items: center;
    gap: 2px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .profile-metric:last-child {
    border-right: 0;
  }

  .profile-metric .bi,
  .profile-metric strong,
  .profile-metric span {
    grid-column: 1;
  }

  .profile-metric .bi { grid-row: 1; }
  .profile-metric strong { grid-row: 2; }
  .profile-metric span { grid-row: 3; }
}

@media (max-width: 700px) {
  body.auth-locked #authGate .auth-card,
  body.auth-locked.auth-checking #authGate .auth-card {
    grid-template-columns: 1fr;
    width: min(440px, 100%);
  }

  body.auth-locked #authGate .auth-card-content h1,
  body.auth-locked.auth-checking #authGate .auth-card-content h1 {
    font-size: 30px;
  }

  .profile-overview.has-profile-background,
  .public-profile-page.has-public-background {
    padding: 8px;
  }

  .profile-banner {
    min-height: 150px;
  }

  .profile-hero-content {
    grid-template-columns: 74px minmax(0, 1fr);
    align-items: start;
    gap: 11px;
    padding: 12px;
  }

  .profile-avatar {
    width: 74px;
    height: 74px;
    margin-top: -43px;
  }

  .profile-identity p,
  .profile-public-link {
    grid-column: 1 / -1;
  }

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

  .profile-metric,
  .profile-metric:last-child {
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .profile-metric:nth-child(2n) {
    border-right: 0;
  }

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

  .public-profile-banner {
    min-height: 150px;
  }

  .public-profile-identity {
    grid-template-columns: 82px minmax(0, 1fr);
    align-items: start;
    gap: 11px;
    padding: 0 13px 14px;
  }

  .public-profile-avatar {
    width: 82px;
    height: 82px;
    margin-top: -38px;
  }

  .public-profile-actions {
    grid-column: 1 / -1;
  }

  .public-profile-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Settings workspace */
.settings-layout {
  display: grid;
  width: min(1320px, 100%);
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 28px;
  margin: 0 auto;
}

.settings-index {
  position: sticky;
  top: 84px;
  display: grid;
  align-self: start;
  gap: 4px;
  padding: 10px 0;
}

.settings-index > span {
  padding: 0 10px 9px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .14em;
}

.settings-index a {
  display: flex;
  min-width: 0;
  min-height: 40px;
  align-items: center;
  gap: 9px;
  padding: 0 10px;
  border-left: 2px solid transparent;
  color: var(--muted);
  font-size: 11px;
}

.settings-index a:hover,
.settings-index a:focus-visible {
  border-left-color: var(--accent);
  color: var(--text);
}

.settings-index i {
  color: var(--accent);
  font-size: 14px;
}

.settings-content {
  display: grid;
  min-width: 0;
  gap: 16px;
}

.settings-content > .settings-panel {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  scroll-margin-top: 82px;
}

.settings-panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.settings-panel-head > span,
.settings-summary-icon {
  display: grid;
  width: 40px;
  min-width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 10%, var(--panel));
  color: var(--accent);
  font-size: 17px;
}

.settings-panel-head > div,
.credential-panel summary > div {
  min-width: 0;
}

.settings-panel-head small,
.credential-panel summary small,
.settings-font-block small {
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .14em;
}

.settings-panel-head h2,
.credential-panel summary h2 {
  margin: 2px 0;
  font-size: 17px;
}

.settings-panel-head p,
.credential-panel summary p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

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

.settings-option-group {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.settings-group-head {
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 10px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--line);
}

.settings-group-head > i {
  color: var(--accent);
  font-size: 17px;
}

.settings-group-head div {
  display: grid;
  min-width: 0;
}

.settings-group-head strong {
  font-size: 12px;
}

.settings-group-head span {
  color: var(--muted);
  font-size: 9px;
}

.settings-option-group .setting-row {
  min-height: 72px;
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
}

.settings-option-group .setting-row:last-child {
  border-bottom: 0;
}

.settings-option-group .setting-row > div:first-child {
  min-width: 0;
}

.settings-option-group .setting-row strong {
  font-size: 11px;
}

.settings-option-group .setting-row span {
  font-size: 9px;
}

.settings-appearance .theme-options {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.settings-font-block {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.settings-font-block h3 {
  margin: 2px 0 0;
  font-size: 13px;
}

.settings-font-block .font-options {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.settings-text-size {
  display: grid;
  align-content: start;
  gap: 6px;
}

.settings-text-size .mini-segment {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.credential-panel summary {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 12px;
  list-style: none;
}

.credential-panel summary::-webkit-details-marker {
  display: none;
}

.settings-summary-chevron {
  justify-self: end;
  transition: transform .18s ease;
}

.credential-panel[open] .settings-summary-chevron {
  transform: rotate(180deg);
}

.credential-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.credential-panel .settings-actions {
  justify-content: flex-end;
  margin-top: 14px;
}

.source-settings-search {
  display: flex;
  min-width: min(310px, 100%);
  align-items: center;
  gap: 7px;
  padding-left: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
}

.source-settings-search i {
  color: var(--muted);
}

.source-settings-search .form-control {
  border: 0;
  background: transparent;
}

.source-settings-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0 10px;
}

.source-settings-heading h3 {
  margin: 0;
}

.source-settings-heading span {
  color: var(--muted);
  font-size: 9px;
}

.settings-content .source-settings-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-height: min(720px, 68vh);
  padding-right: 5px;
  overflow-y: auto;
}

.source-disabled-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.source-disabled-details[open] summary i {
  transform: rotate(180deg);
}

/* Personal profile workspace */
.profile-session {
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 14px 0 18px;
}

.profile-session-status {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
}

.profile-session-status > div {
  display: grid;
  min-width: 0;
}

.profile-session-status small {
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .14em;
}

.profile-session-status strong {
  font-size: 13px;
}

.profile-session-status span {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-session-icon {
  display: grid;
  width: 40px;
  min-width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  color: var(--accent);
}

.profile-session-tools {
  display: flex;
  gap: 6px;
}

.profile-login-panel {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(210px, .45fr) minmax(0, 1fr);
  max-width: none;
  gap: 10px;
  margin-top: 10px;
}

.profile-login-panel .auth-email-form {
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
}

.profile-guest {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, .45fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.profile-guest-copy {
  padding: 34px;
}

.profile-guest-icon {
  display: grid;
  width: 54px;
  height: 54px;
  margin-bottom: 24px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  border-radius: 8px;
  color: var(--accent);
  font-size: 23px;
}

.profile-guest small,
.profile-guest-integrations small,
.profile-identity small,
.profile-editor-head small,
.profile-side-panel small {
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .14em;
}

.profile-guest h3 {
  max-width: 480px;
  margin: 6px 0 8px;
  font-size: 28px;
}

.profile-guest p {
  max-width: 600px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

.profile-guest-features {
  display: flex;
  gap: 7px;
  margin-top: 22px;
  flex-wrap: wrap;
}

.profile-guest-features span {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 9px;
}

.profile-guest-features i {
  color: var(--accent);
}

.profile-guest-integrations {
  padding: 24px;
  border-left: 1px solid var(--line);
  background: var(--panel);
}

.profile-guest-integrations h3,
.profile-side-panel h3 {
  margin: 3px 0 14px;
  font-size: 14px;
}

.profile-overview {
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 12px;
}

.profile-overview.has-profile-background {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background-image: linear-gradient(rgba(4, 4, 7, .55), rgba(4, 4, 7, .82)), var(--profile-bg);
  background-position: center;
  background-size: cover;
}

.profile-hero-card,
.profile-metrics,
.public-profile-editor,
.profile-side-panel {
  border-radius: 8px;
}

.profile-banner {
  min-height: 220px;
  background-image: var(--profile-banner);
  background-position: center;
  background-size: cover;
}

.profile-hero-content {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: end;
  gap: 14px;
}

.profile-avatar {
  width: 92px;
  height: 92px;
  margin-top: -58px;
}

.profile-identity {
  min-width: 0;
}

.profile-identity h3 {
  margin: 3px 0 1px;
  font-size: 22px;
}

.profile-identity p {
  max-width: 720px;
  margin: 7px 0 0;
  font-size: 10px;
}

.profile-metrics {
  grid-template-columns: 1fr;
}

.profile-metric {
  min-height: 58px;
}

.profile-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 14px;
}

.profile-editor-head,
.profile-editor-section-head {
  display: flex;
  align-items: center;
  gap: 11px;
}

.profile-editor-head > span {
  display: grid;
  width: 40px;
  min-width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: 8px;
  color: var(--accent);
}

.profile-editor-head h3 {
  margin: 2px 0;
  font-size: 17px;
}

.profile-editor-head p,
.profile-editor-section-head span {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
}

.profile-editor-section {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.profile-editor-section-head {
  margin-bottom: 12px;
}

.profile-editor-section-head > i {
  color: var(--accent);
  font-size: 16px;
}

.profile-editor-section-head div {
  display: grid;
}

.profile-editor-section-head strong {
  font-size: 11px;
}

.profile-socials-panel {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.profile-socials-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
}

.profile-socials-panel summary span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-socials-panel summary i {
  color: var(--accent);
}

.profile-socials-panel .profile-form-grid {
  padding: 12px;
  border-top: 1px solid var(--line);
}

.profile-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  margin-top: 14px;
}

.profile-actions > span {
  margin-right: auto;
  color: var(--muted);
  font-size: 9px;
}

.profile-side-panel {
  align-self: start;
}

.profile-side-heading {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

/* Public profiles */
.public-profile-page {
  display: grid;
  width: min(1240px, 100%);
  gap: 14px;
  margin: 0 auto;
}

.public-profile-page.has-public-background {
  padding: 16px;
  border-radius: 8px;
  background-image: linear-gradient(rgba(3, 3, 6, .72), rgba(3, 3, 6, .94)), var(--public-profile-bg);
  background-attachment: fixed;
  background-position: center;
  background-size: cover;
}

.public-profile-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.public-profile-nav > span {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 9px;
}

.public-profile-hero {
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.public-profile-banner {
  min-height: 250px;
  background-color: var(--panel-2);
  background-image: var(--public-banner);
  background-position: center;
  background-size: cover;
}

.public-profile-identity {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: end;
  gap: 16px;
  padding: 0 22px 20px;
}

.public-profile-avatar {
  width: 112px;
  height: 112px;
  margin-top: -58px;
  border: 4px solid var(--surface);
  border-radius: 50%;
  background: var(--panel);
}

.public-profile-avatar img,
.public-profile-avatar .avatar-fallback {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.public-profile-main {
  min-width: 0;
  padding-top: 12px;
}

.public-profile-main h2 {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  margin: 2px 0;
  font-size: 26px;
}

.public-profile-handle {
  color: var(--muted);
  font-size: 11px;
}

.public-profile-badges {
  display: flex;
  gap: 7px;
  margin-top: 7px;
  flex-wrap: wrap;
}

.public-profile-actions {
  padding-bottom: 2px;
}

.public-profile-like {
  min-width: 64px;
  justify-content: center;
}

.public-profile-like.liked {
  color: #ef4444;
}

.public-profile-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.public-profile-stats > div {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  min-height: 62px;
  align-content: center;
  gap: 1px 7px;
  padding: 10px 16px;
  border-right: 1px solid var(--line);
}

.public-profile-stats > div:last-child {
  border-right: 0;
}

.public-profile-stats i {
  grid-row: 1 / span 2;
  align-self: center;
  color: var(--accent);
}

.public-profile-stats strong {
  font-size: 16px;
}

.public-profile-stats span {
  color: var(--muted);
  font-size: 9px;
}

.public-profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 24px;
}

.public-profile-feed {
  min-width: 0;
}

.public-profile-section {
  padding: 22px 0;
}

.public-profile-section-head {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 14px;
}

.public-profile-section-head > span {
  display: grid;
  width: 36px;
  min-width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: 8px;
  color: var(--accent);
}

.public-profile-section-head small,
.public-profile-about small {
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .14em;
}

.public-profile-section-head h3 {
  margin: 2px 0;
  font-size: 17px;
}

.public-profile-section-head p,
.public-profile-about p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.public-featured-grid {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

.public-profile-about {
  position: sticky;
  top: 84px;
  display: grid;
  align-self: start;
  gap: 0;
  border-top: 1px solid var(--line);
}

.public-profile-about section {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.public-profile-about h3 {
  margin: 3px 0 7px;
  font-size: 15px;
}

.public-profile-about .public-socials {
  margin-top: 9px;
}

/* Contextual loading system */
.loading-state {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 320px;
  grid-template-rows: minmax(0, 1fr) auto auto;
  gap: 18px;
  overflow: hidden;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.loading-visual {
  display: grid;
  min-width: 0;
  align-content: center;
}

.loading-copy {
  display: grid;
  gap: 3px;
}

.loading-copy small {
  color: var(--accent);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .14em;
}

.loading-copy strong {
  color: var(--text);
  font-size: 15px;
}

.loading-copy span {
  color: var(--muted);
  font-size: 10px;
}

.loading-track,
.auth-progress {
  height: 3px;
  overflow: hidden;
  border-radius: 3px;
  background: color-mix(in srgb, var(--accent) 12%, var(--panel-2));
}

.loading-track span,
.auth-progress span {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  animation: loading-track 1.2s ease-in-out infinite;
}

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

.loading-catalog i {
  display: grid;
  gap: 7px;
}

.loading-catalog b {
  aspect-ratio: 2 / 3;
  border-radius: 7px;
  background: var(--panel-2);
}

.loading-catalog span,
.loading-catalog small,
.loading-detail b,
.loading-player > b,
.loading-profile b,
.loading-collection b {
  display: block;
  height: 8px;
  border-radius: 4px;
  background: var(--panel-2);
}

.loading-catalog small {
  width: 62%;
  height: 6px;
}

.loading-detail {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 20px;
}

.loading-detail > i {
  aspect-ratio: 2 / 3;
  border-radius: 7px;
  background: var(--panel-2);
}

.loading-detail > span {
  display: grid;
  align-content: center;
  gap: 13px;
}

.loading-detail b:nth-child(1) {
  width: 68%;
  height: 22px;
}

.loading-detail b:nth-child(2) {
  width: 42%;
}

.loading-detail b:nth-child(3),
.loading-detail b:nth-child(4) {
  width: 88%;
}

.loading-player {
  display: grid;
  gap: 9px;
}

.loading-player > i {
  display: grid;
  min-height: 170px;
  place-items: center;
  border-radius: 7px;
  background: var(--panel-2);
}

.loading-player > i span {
  width: 36px;
  height: 36px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .85s linear infinite;
}

.loading-player > b {
  width: 58%;
}

.loading-player > b:last-child {
  width: 34%;
}

.loading-profile {
  position: relative;
  min-height: 180px;
  overflow: hidden;
  border-radius: 7px;
  background: var(--panel-2);
}

.loading-profile > i {
  position: absolute;
  bottom: 22px;
  left: 22px;
  width: 64px;
  height: 64px;
  border: 4px solid var(--surface);
  border-radius: 50%;
  background: var(--panel);
}

.loading-profile > b {
  position: absolute;
  bottom: 50px;
  left: 102px;
  width: 38%;
}

.loading-profile > b:last-child {
  bottom: 31px;
  width: 24%;
}

.loading-collection {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.loading-collection i {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  min-height: 82px;
  align-items: center;
  gap: 9px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.loading-collection span {
  width: 58px;
  height: 64px;
  border-radius: 6px;
  background: var(--panel-2);
}

.loading-pulse-mark {
  position: relative;
  display: grid;
  width: 74px;
  height: 74px;
  margin: auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--accent);
  font-size: 22px;
}

.loading-pulse-mark span {
  position: absolute;
  inset: -10px;
  border: 1px solid color-mix(in srgb, var(--accent) 36%, transparent);
  border-radius: inherit;
  animation: loading-ring 1.5s ease-out infinite;
}

.loading-pulse-mark span:last-child {
  animation-delay: .5s;
}

.loading-state .loading-catalog b,
.loading-state .loading-catalog span,
.loading-state .loading-catalog small,
.loading-state .loading-detail > i,
.loading-state .loading-detail b,
.loading-state .loading-player > i,
.loading-state .loading-player > b,
.loading-state .loading-profile,
.loading-state .loading-collection span,
.loading-state .loading-collection b {
  background-image: linear-gradient(105deg, transparent 28%, color-mix(in srgb, var(--text) 8%, transparent) 48%, transparent 68%);
  background-size: 220% 100%;
  animation: loading-shimmer 1.4s linear infinite;
}

.community-page .loading-state {
  min-height: 112px;
  grid-template-columns: 92px minmax(0, 1fr);
  grid-template-rows: 1fr 3px;
  gap: 10px 14px;
  align-items: center;
  padding: 13px;
}

.community-page .loading-state .loading-copy {
  align-self: center;
}

.community-page .loading-state .loading-track {
  grid-column: 1 / -1;
}

.community-page .loading-collection {
  grid-template-columns: repeat(3, 1fr);
}

.community-page .loading-collection i {
  display: block;
  min-height: 72px;
  padding: 0;
  border: 0;
}

.community-page .loading-collection span {
  width: 100%;
  height: 72px;
}

.community-page .loading-collection b {
  display: none;
}

.auth-gate {
  display: grid;
  min-height: 100svh;
  place-items: center;
  padding: 20px;
}

.auth-card,
body.auth-checking .auth-card {
  position: relative;
  display: grid;
  width: min(820px, 100%);
  grid-template-columns: minmax(240px, .8fr) minmax(280px, 1fr);
  justify-items: stretch;
  gap: 0;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  text-align: left;
}

body.auth-checking .auth-card::after {
  display: none;
}

.auth-boot-visual {
  position: relative;
  min-height: 370px;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--accent) 7%, var(--panel));
}

.auth-boot-visual .auth-mark,
body.auth-checking .auth-boot-visual .auth-mark {
  position: absolute;
  top: 24px;
  left: 24px;
  z-index: 3;
  width: 46px;
  height: 46px;
  font-size: 18px;
}

.auth-boot-rings {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 190px;
  height: 190px;
  transform: translate(-50%, -50%);
}

.auth-boot-rings i {
  position: absolute;
  inset: 0;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--line));
  border-radius: 50%;
  animation: auth-ring 2.8s ease-in-out infinite;
}

.auth-boot-rings i:nth-child(2) {
  inset: 24px;
  animation-delay: .28s;
}

.auth-boot-rings i:nth-child(3) {
  inset: 48px;
  animation-delay: .56s;
}

.auth-boot-posters {
  position: absolute;
  right: 18px;
  bottom: 20px;
  left: 18px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  align-items: end;
}

.auth-boot-posters span {
  display: block;
  height: 104px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-2);
  transform: translateY(12px);
}

.auth-boot-posters span:nth-child(2) {
  height: 128px;
  transform: none;
}

.auth-card-content {
  display: grid;
  align-content: center;
  gap: 11px;
  padding: 34px;
}

.auth-kicker {
  color: var(--accent);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .14em;
}

.auth-card-content h1,
body.auth-checking .auth-card-content h1 {
  margin: 0;
  font-size: 36px;
}

.auth-card-content p,
body.auth-checking .auth-card-content p {
  max-width: 370px;
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

body.auth-checking .auth-card-content {
  align-content: center;
}

body.auth-checking .auth-card-content #authGateLogin,
body.auth-checking .auth-card-content .auth-email-form,
body.auth-checking .auth-card-content #authGateStatus {
  display: none;
}

@keyframes loading-track {
  0% { transform: translateX(-110%); }
  55% { transform: translateX(95%); }
  100% { transform: translateX(260%); }
}

@keyframes loading-shimmer {
  from { background-position: 180% 0; }
  to { background-position: -40% 0; }
}

@keyframes loading-ring {
  from { opacity: .7; transform: scale(.72); }
  to { opacity: 0; transform: scale(1.16); }
}

@keyframes auth-ring {
  0%, 100% { opacity: .28; transform: scale(.92); }
  50% { opacity: .82; transform: scale(1); }
}

@media (max-width: 900px) {
  .settings-layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .settings-index {
    position: sticky;
    top: 58px;
    z-index: 18;
    display: flex;
    padding: 7px;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    backdrop-filter: blur(16px) saturate(130%);
  }

  .settings-index > span {
    display: none;
  }

  .settings-index a {
    min-width: max-content;
    border: 0;
    border-radius: 7px;
  }

  .settings-option-grid,
  .profile-workspace,
  .public-profile-layout {
    grid-template-columns: 1fr;
  }

  .settings-content .source-settings-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-overview {
    grid-template-columns: 1fr;
  }

  .profile-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .profile-metric {
    grid-template-columns: 1fr;
    min-height: 72px;
    justify-items: center;
    gap: 2px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .profile-metric:last-child {
    border-right: 0;
  }

  .profile-metric .bi,
  .profile-metric strong,
  .profile-metric span {
    grid-column: 1;
  }

  .profile-metric .bi { grid-row: 1; }
  .profile-metric strong { grid-row: 2; }
  .profile-metric span { grid-row: 3; }

  .profile-side-panel {
    position: static;
  }

  .public-profile-about {
    position: static;
    order: -1;
  }
}

@media (max-width: 700px) {
  .settings-content > .settings-panel {
    padding: 14px;
  }

  .settings-panel-head {
    align-items: flex-start;
  }

  .settings-appearance .theme-options {
    grid-template-columns: 1fr;
  }

  .settings-font-block {
    grid-template-columns: 1fr;
  }

  .settings-font-block .font-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .credential-fields,
  .settings-content .source-settings-list {
    grid-template-columns: 1fr;
  }

  .source-settings-heading {
    display: grid;
  }

  .profile-session {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .profile-session-tools {
    overflow-x: auto;
  }

  .profile-session-tools .btn {
    flex: 0 0 auto;
  }

  .profile-login-panel,
  .profile-login-panel .auth-email-form,
  .profile-guest {
    grid-template-columns: 1fr;
  }

  .profile-guest-copy {
    padding: 24px 18px;
  }

  .profile-guest h3 {
    font-size: 24px;
  }

  .profile-guest-integrations {
    padding: 18px;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .profile-overview.has-profile-background,
  .public-profile-page.has-public-background {
    padding: 8px;
  }

  .profile-banner {
    min-height: 150px;
  }

  .profile-hero-content {
    grid-template-columns: 74px minmax(0, 1fr);
    align-items: start;
    gap: 11px;
    padding: 12px;
  }

  .profile-avatar {
    width: 74px;
    height: 74px;
    margin-top: -43px;
  }

  .profile-identity h3 {
    font-size: 18px;
  }

  .profile-identity p,
  .profile-public-link {
    grid-column: 1 / -1;
  }

  .profile-public-link {
    width: fit-content;
    margin: 0;
  }

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

  .profile-metric {
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .profile-metric:nth-child(2n) {
    border-right: 0;
  }

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

  .public-profile-editor,
  .profile-side-panel {
    padding: 14px;
  }

  .profile-form-grid {
    grid-template-columns: 1fr;
  }

  .profile-form-grid .wide {
    grid-column: 1;
  }

  .profile-actions {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .profile-actions > span {
    width: 100%;
  }

  .public-profile-nav > span {
    display: none;
  }

  .public-profile-banner {
    min-height: 150px;
  }

  .public-profile-identity {
    grid-template-columns: 82px minmax(0, 1fr);
    align-items: start;
    gap: 11px;
    padding: 0 13px 14px;
  }

  .public-profile-avatar {
    width: 82px;
    height: 82px;
    margin-top: -38px;
  }

  .public-profile-main {
    padding-top: 10px;
  }

  .public-profile-main h2 {
    overflow-wrap: anywhere;
    font-size: 21px;
  }

  .public-profile-actions {
    grid-column: 1 / -1;
  }

  .public-profile-like {
    width: 100%;
  }

  .public-profile-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .public-profile-stats > div {
    border-bottom: 1px solid var(--line);
  }

  .public-profile-stats > div:nth-child(2n) {
    border-right: 0;
  }

  .public-profile-stats > div:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .public-featured-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px 7px;
  }

  .loading-state {
    min-height: 280px;
    padding: 18px;
  }

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

  .loading-catalog i:nth-child(n + 4) {
    display: none;
  }

  .loading-detail {
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 13px;
  }

  .auth-card,
  body.auth-checking .auth-card {
    grid-template-columns: 1fr;
    width: min(440px, 100%);
  }

  .auth-boot-visual {
    min-height: 155px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .auth-boot-rings {
    width: 118px;
    height: 118px;
  }

  .auth-boot-posters {
    right: 12px;
    bottom: 10px;
    left: auto;
    width: 150px;
  }

  .auth-boot-posters span {
    height: 64px;
  }

  .auth-boot-posters span:nth-child(2) {
    height: 82px;
  }

  .auth-card-content {
    padding: 22px 18px;
  }

  .auth-card-content h1,
  body.auth-checking .auth-card-content h1 {
    font-size: 30px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .loading-track span,
  .auth-progress span,
  .loading-state *,
  .auth-boot-rings i {
    animation: none !important;
  }
}

/* Route architecture v3 */
:root {
  --line-strong: #393542;
  --accent-strong: #7c3aed;
  --accent-soft: rgba(139, 92, 246, .15);
  --radius-sm: 7px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

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

.auth-gate {
  min-height: 100svh;
  background: var(--bg);
}

.auth-card {
  width: min(420px, 100%);
  gap: 12px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-card h1 {
  color: var(--text);
  font-size: 34px;
}

.auth-card p {
  color: var(--muted);
  font-size: 12px;
}

.auth-mark {
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  box-shadow: none;
}

body.auth-checking .auth-card {
  position: relative;
  display: grid;
  width: min(460px, calc(100vw - 28px));
  grid-template-columns: 48px minmax(0, 1fr);
  justify-items: start;
  gap: 3px 13px;
  overflow: hidden;
  padding: 16px;
  border-radius: 16px;
  text-align: left;
}

body.auth-checking .auth-card::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--accent);
  transform-origin: left;
  animation: boot-progress 1.35s cubic-bezier(.4, 0, .2, 1) infinite;
}

body.auth-checking .auth-mark {
  width: 48px;
  height: 48px;
  grid-row: 1 / span 2;
  font-size: 20px;
}

body.auth-checking .auth-card h1 {
  align-self: end;
  margin: 0;
  font-size: 17px;
}

body.auth-checking .auth-card p {
  align-self: start;
  max-width: none;
  margin: 0;
  font-size: 10px;
}

@keyframes boot-progress {
  0% { transform: scaleX(.08); opacity: .55; }
  62% { transform: scaleX(.78); opacity: 1; }
  100% { transform: scaleX(1); opacity: 0; }
}

.app.container-xxl {
  width: min(1660px, 100%);
  padding: 28px clamp(12px, 2vw, 32px) 60px;
}

.route-heading {
  display: flex;
  min-height: 92px;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 22px;
  padding: 0 0 20px;
  border-bottom: 1px solid var(--line);
}

.route-heading > div {
  min-width: 0;
}

.route-heading span,
.detail-kicker,
.episodes-section > header span {
  display: block;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .16em;
}

.route-heading h2 {
  margin: 6px 0 0;
  color: var(--text);
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 760;
  line-height: 1;
}

.route-heading .stats {
  padding-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.hero {
  background: color-mix(in srgb, var(--bg) 92%, transparent);
}

.hero .topbar {
  min-height: 58px;
}

.brand-home .brand-mark {
  border: 0;
  border-radius: 9px;
  background: var(--accent);
}

.brand-home .brand-mark::after {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(255, 255, 255, .42);
  border-radius: 5px;
}

.brand-home h1 {
  color: var(--text);
  font-size: 16px;
}

.brand-home .sub {
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn,
.select-btn,
.control,
.form-control,
select,
input,
textarea {
  border-color: var(--line);
  background: var(--field);
  color: var(--text);
  box-shadow: none;
}

.btn {
  min-height: 38px;
  border-radius: 999px;
  font-weight: 650;
}

.btn:hover,
.btn:focus-visible,
.select-btn:hover {
  border-color: var(--line-strong);
  background: var(--panel-2);
  color: var(--text);
}

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

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

.btn.active,
.segmented .btn.active,
.mini-segment .btn.active {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  background: var(--accent-soft);
  color: var(--text);
}

.bottom-nav {
  border-color: var(--line);
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  box-shadow: 0 18px 54px rgba(0, 0, 0, .48);
}

.bottom-nav .navbtn {
  border: 0;
  background: transparent;
}

.bottom-nav .navbtn.active {
  border: 0;
  background: var(--accent);
}

/* Catalog */
.catalog-controls {
  margin-bottom: 24px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.search-filter-panel {
  grid-template-columns: minmax(320px, 1.45fr) minmax(620px, 2fr);
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.search-filter-panel .searchbox {
  min-height: 44px;
  border-color: var(--line);
  background: var(--field);
}

.searchbox input {
  min-height: 42px;
  padding-inline: 15px;
  color: var(--text);
}

.searchbox input::placeholder {
  color: var(--muted);
}

.searchbox .primary {
  min-height: 38px;
  margin: 2px;
}

.search-filter-panel .filters {
  grid-template-columns: 1.35fr repeat(5, minmax(100px, 1fr));
  gap: 6px;
  padding: 0;
}

.filters select {
  min-height: 44px;
  border-radius: 999px;
  padding-inline: 12px 28px;
}

.catalog-toolbar {
  min-height: 44px;
  margin: 10px 0 0;
  padding: 10px 0 0;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.catalog-toolbar .btn {
  min-height: 34px;
  padding: 6px 11px;
}

.catalog-toolbar .select-btn {
  min-height: 34px;
  border-radius: 999px;
}

.catalog-toolbar .select-btn select {
  min-height: 32px;
  border: 0;
  background: transparent;
}

#results.grid,
#watchedBox.grid {
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 24px 14px;
}

.card {
  min-width: 0;
}

.poster-wrap,
.poster,
.card .poster-wrap {
  border-radius: var(--radius-sm);
}

.card .poster {
  border: 1px solid color-mix(in srgb, var(--line) 74%, transparent);
  background: var(--panel);
}

.card .title {
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.card .meta,
.card .genres .tag {
  color: var(--muted);
}

.card .actions .btn {
  border-color: rgba(255, 255, 255, .2);
  background: rgba(5, 5, 7, .82);
  color: #fff;
}

.query-hints,
.infinite-status,
.empty,
.notice,
.community-empty,
.profile-empty-state {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--muted);
}

/* Library */
.library-heading {
  align-items: end;
}

.library-heading p {
  max-width: 620px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.library-heading .stats {
  align-self: center;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  white-space: nowrap;
}

.library-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 8px 0 18px;
  border-block: 1px solid var(--line);
}

.library-overview[hidden] {
  display: none;
}

.library-overview-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 14px 18px;
  border-right: 1px solid var(--line);
}

.library-overview-item:last-child {
  border-right: 0;
}

.library-overview-item > i {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--accent);
  background: var(--surface);
  font-size: 16px;
}

.library-overview-item span {
  display: grid;
  min-width: 0;
}

.library-overview-item strong {
  font-size: 20px;
  line-height: 1;
}

.library-overview-item small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.library-workspace {
  display: block;
}

.library-navigation {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.library-toolbar {
  flex: 1 1 auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.library-toolbar .left {
  display: flex;
  width: auto;
  gap: 4px;
  flex-wrap: wrap;
}

.library-toolbar .btn {
  width: auto;
  min-height: 38px;
  justify-content: center;
  border-color: transparent;
  border-radius: 999px;
  background: transparent;
}

.library-toolbar .btn i {
  width: 18px;
  text-align: center;
}

.library-toolbar .btn.active {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  background: var(--accent-soft);
  color: var(--accent);
}

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

.library-actions #newListBtn {
  min-height: 38px;
  border-radius: 999px;
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.library-view-toggle {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  margin: 0;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  width: 122px;
}

.library-view-toggle .btn {
  min-width: 0;
  min-height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
}

.library-view-toggle .btn span {
  display: none;
}

.library-content {
  min-width: 0;
}

.library-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}

.list-row,
.managed-list-item,
.history-row {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.list-row {
  position: relative;
  min-width: 0;
  min-height: 88px;
  overflow: hidden;
}

.list-row.active {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  background: var(--accent-soft);
}

.list-row-main {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 18px;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-width: 0;
  min-height: 88px;
  padding: 9px 48px 9px 9px;
  border: 0;
  background: transparent;
  text-align: left;
}

.list-row-cover {
  display: block;
  width: 54px;
  height: 68px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--panel);
}

.list-row-cover-fallback {
  display: grid;
  place-items: center;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 20px;
}

.list-row-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.list-row-copy small {
  color: var(--accent);
  font-size: 8px;
  font-weight: 800;
}

.list-row-copy strong,
.list-row-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-row-copy strong {
  color: var(--text);
  font-size: 13px;
}

.list-row-copy span {
  color: var(--muted);
  font-size: 10px;
}

.list-row-arrow {
  color: var(--muted);
}

.list-row-delete {
  position: absolute;
  top: 50%;
  right: 9px;
  width: 32px;
  min-width: 32px;
  height: 32px;
  padding: 0;
  transform: translateY(-50%);
}

.list-detail-head {
  display: flex;
  gap: 18px;
  align-items: end;
  justify-content: space-between;
  margin: 0 0 14px;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--line);
}

.list-detail-title {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.list-detail-title > small {
  color: var(--accent);
  font-size: 9px;
  font-weight: 800;
}

.list-detail-title > span {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.list-detail-title strong {
  overflow: hidden;
  font-size: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-detail-title p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.list-visibility {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  flex: 0 0 auto;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 750;
  text-transform: uppercase;
}

.list-visibility.is-public {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  color: var(--accent);
  background: var(--accent-soft);
}

.list-detail-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}

.list-detail-actions .btn {
  min-height: 36px;
  border-radius: 999px;
}

.list-detail-actions .btn span {
  display: inline;
}

.managed-list,
.history-list {
  gap: 8px;
}

.managed-list-item {
  grid-template-columns: 66px minmax(0, 1fr) auto;
  padding: 9px;
}

.managed-list-item .history-poster {
  width: 66px;
  border-radius: var(--radius-sm);
}

.history-actions .btn span {
  display: none;
}

.history-actions .btn {
  width: 36px;
  min-width: 36px;
  height: 36px;
  padding: 0;
}

.library-empty-state {
  display: flex;
  gap: 14px;
  align-items: center;
  min-height: 128px;
  padding: 22px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  color: var(--muted);
}

.library-empty-state > i {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 20px;
}

.library-empty-state > div {
  display: grid;
  gap: 4px;
}

.library-empty-state strong {
  color: var(--text);
  font-size: 14px;
}

.library-empty-state span {
  font-size: 11px;
}

/* Community */
.community-page {
  width: 100%;
  gap: 0;
}

.community-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: end;
  min-height: 110px;
  padding: 0 0 22px;
  border-bottom: 1px solid var(--line);
}

.community-hero .eyebrow {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: .14em;
}

.community-hero h2 {
  margin: 7px 0 5px;
  font-size: clamp(28px, 4vw, 42px);
}

.community-hero p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.community-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(78px, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.community-overview > div {
  display: grid;
  grid-template-columns: auto 1fr;
  min-width: 86px;
  gap: 1px 7px;
  padding: 11px 13px;
  border-right: 1px solid var(--line);
}

.community-overview > div:last-child {
  border-right: 0;
}

.community-overview i {
  grid-row: 1 / span 2;
  align-self: center;
  color: var(--accent);
}

.community-overview strong {
  font-size: 15px;
  line-height: 1;
}

.community-overview span {
  color: var(--muted);
  font-size: 9px;
}

.community-discovery-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(240px, .45fr);
  gap: 28px;
  border-bottom: 1px solid var(--line);
}

.community-section {
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}

.community-discovery-grid .community-section {
  border-bottom: 0;
}

.community-admin-section {
  padding-left: 24px;
  border-left: 1px solid var(--line);
}

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

.community-section-head > div > span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .14em;
}

.community-section-head h3 {
  margin: 0 0 3px;
  font-size: 17px;
}

.community-section-head small {
  color: var(--muted);
  font-size: 10px;
}

.community-section-head > strong {
  display: grid;
  min-width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  font-size: 10px;
}

.community-search {
  min-width: min(290px, 100%);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--field);
}

.community-search .control {
  min-height: 38px;
  border: 0;
  background: transparent;
}

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

.community-grid-compact {
  display: flex;
  gap: 9px;
  overflow-x: auto;
  padding-bottom: 5px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.community-grid-compact > * {
  width: min(300px, 78vw);
  flex: 0 0 min(300px, 78vw);
  scroll-snap-align: start;
}

.community-card {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 144px minmax(0, 1fr);
  min-height: 280px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.community-cover {
  display: grid;
  width: 100%;
  min-height: 144px;
  align-content: end;
  padding: 14px;
  border-radius: 0;
  background-position: center;
  background-size: cover;
}

.community-cover strong {
  color: #fff;
  font-size: 15px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .7);
}

.community-cover small {
  color: rgba(255, 255, 255, .78);
  font-size: 9px;
}

.community-card-body {
  display: grid;
  align-content: start;
  min-width: 0;
  gap: 7px;
  padding: 12px;
}

.community-card-body p {
  display: -webkit-box;
  min-height: 32px;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.community-owner {
  color: var(--muted);
  font-size: 10px;
}

.community-card-meta {
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.community-actions {
  margin-top: auto;
}

.community-actions .btn {
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
}

.community-user-grid {
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
}

.community-user-card {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 118px;
  padding: 18px 14px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.community-user-main {
  display: grid;
  min-width: 0;
  justify-items: center;
  text-align: center;
}

.community-user-card img,
.community-user-card .community-user-avatar {
  width: 54px;
  height: 54px;
  margin-bottom: 8px;
  border: 2px solid color-mix(in srgb, var(--accent) 45%, var(--line));
  border-radius: 50%;
}

.community-user-card strong,
.community-user-card small {
  max-width: 100%;
}

.community-user-like {
  top: 10px;
  right: 10px;
}

.community-user-like.liked {
  color: #ef4444;
}

.community-user-rail {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
}

.community-admin-section .community-user-card {
  min-height: 104px;
}

/* Profile */
.profile-shell {
  display: grid;
  width: 100%;
  gap: 24px;
}

.profile-session {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 14px 0 20px;
  border-bottom: 1px solid var(--line);
}

.profile-card {
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.profile-icon {
  color: var(--accent);
  font-size: 30px;
}

.profile-card strong {
  font-size: 14px;
}

.profile-card span {
  color: var(--muted);
  font-size: 11px;
}

.profile-session .settings-actions {
  display: flex;
  margin: 0;
}

.profile-login-panel {
  grid-column: 1 / -1;
  max-width: 760px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.profile-overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  padding: 0;
  border: 0;
  background: transparent;
}

.profile-overview.has-profile-background::before {
  display: none;
}

.profile-hero-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.profile-banner {
  min-height: 190px;
  border: 0;
  border-radius: 0;
  background: var(--panel-2);
}

.profile-hero-content {
  min-height: 112px;
  padding: 16px 18px 18px;
}

.profile-avatar {
  width: 82px;
  height: 82px;
  margin-top: -54px;
  border: 4px solid var(--surface);
  border-radius: 50%;
}

.profile-identity h3 {
  font-size: 20px;
}

.profile-identity p {
  max-width: 660px;
  color: var(--muted);
}

.profile-metrics {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.profile-metric {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  min-height: 68px;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.profile-metric:last-child {
  border-bottom: 0;
}

.profile-metric .bi {
  grid-row: 1;
  color: var(--accent);
}

.profile-metric strong {
  grid-column: 3;
  font-size: 18px;
}

.profile-metric span {
  grid-column: 2;
  grid-row: 1;
}

.profile-grid-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, .7fr);
  gap: 16px;
}

.public-profile-editor,
.profile-side-panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.profile-form-grid {
  gap: 12px;
}

.profile-form-grid label,
.field label {
  color: var(--muted);
  font-size: 11px;
}

.profile-data-card {
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.profile-data-card:last-child {
  border-bottom: 0;
}

/* Settings and theme system */
.settings-shell {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
  width: 100%;
}

.settings-shell > .settings-panel:first-child {
  grid-column: span 7;
}

.settings-shell > .theme-panel {
  grid-column: span 5;
}

.settings-shell > .credential-panel {
  grid-column: span 5;
}

.settings-panel.sources-panel {
  grid-column: 1 / -1;
}

.settings-panel {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.settings-panel h2 {
  margin: 0 0 14px;
  font-size: 16px;
}

.settings-panel summary {
  color: var(--text);
}

.setting-row {
  min-height: 64px;
  padding: 12px 0;
  border-color: var(--line);
}

.setting-row strong {
  color: var(--text);
  font-size: 13px;
}

.setting-row span,
.panel-copy {
  color: var(--muted);
  font-size: 11px;
}

.form-check-input {
  border-color: var(--line-strong);
  background-color: var(--panel-2);
}

.form-check-input:checked {
  border-color: var(--accent);
  background-color: var(--accent);
}

.theme-options {
  display: grid;
  width: 100%;
  max-height: none !important;
  grid-template-columns: 1fr;
  gap: 7px;
  overflow: visible !important;
}

.theme-option {
  position: relative;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 20px;
  min-height: 76px;
  align-items: center;
  gap: 11px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel);
  color: var(--text);
  text-align: left;
}

.theme-option:hover {
  border-color: var(--line-strong);
  background: var(--panel-2);
}

.theme-option.active {
  border-color: color-mix(in srgb, var(--accent) 64%, var(--line));
  background: var(--accent-soft);
  box-shadow: none;
}

.theme-preview {
  position: relative;
  display: block;
  width: 72px;
  height: 52px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--preview-bg);
}

.theme-preview i {
  position: absolute;
  display: block;
  background: var(--preview-panel);
}

.theme-preview i:first-child {
  inset: 6px 44px 6px 6px;
}

.theme-preview i:nth-child(2) {
  inset: 7px 6px 28px 32px;
}

.theme-preview i:nth-child(3) {
  inset: 29px 6px 7px 32px;
  background: var(--preview-accent);
}

.theme-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.theme-copy > span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.theme-copy strong {
  color: var(--text);
  font-size: 12px;
}

.theme-copy small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.theme-copy em {
  width: fit-content;
  margin: 0;
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 8px;
  font-style: normal;
  font-weight: 800;
  text-transform: uppercase;
}

.theme-copy em[data-status="default"] {
  border-color: color-mix(in srgb, var(--accent) 44%, var(--line));
  color: var(--accent-2);
}

.theme-check {
  color: var(--accent);
}

.font-options {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  padding: 4px;
}

.font-options .btn {
  min-width: 0;
  overflow: hidden;
  border: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-settings-tools {
  margin-bottom: 18px;
}

.source-search {
  border-color: var(--line);
  background: var(--field);
}

.source-category-tabs {
  border-color: var(--line);
  border-radius: var(--radius-md);
  background: var(--panel);
}

.source-category-chip {
  border-color: var(--line);
  background: var(--field);
  color: var(--muted);
}

.source-category-chip.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.source-settings-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-height: min(760px, 70vh);
  overflow: auto;
  padding-right: 4px;
  overscroll-behavior: contain;
  scrollbar-color: var(--line-strong) transparent;
}

.source-setting {
  border-color: var(--line);
  border-radius: var(--radius-md);
  background: var(--panel);
  box-shadow: none;
}

.source-setting-icon {
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent-2);
}

.source-pill {
  background: var(--panel-2);
  color: var(--muted);
}

/* Detail and playback routes */
#routeTab.has-route-backdrop::before {
  position: absolute;
  inset: 0 0 auto;
  height: min(580px, 64vw);
  background-position: center 18%;
}

#routeTab.has-route-backdrop::after {
  position: absolute;
  inset: 0 0 auto;
  height: min(590px, 66vw);
  background:
    linear-gradient(90deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 70%, transparent) 45%, color-mix(in srgb, var(--bg) 55%, transparent) 72%, var(--bg) 100%),
    linear-gradient(180deg, color-mix(in srgb, var(--bg) 18%, transparent), var(--bg) 96%);
}

.media-detail-page {
  position: relative;
  width: min(1420px, 100%);
  margin: 0 auto;
  gap: 0;
}

.media-detail-page:not(.has-backdrop) {
  padding-top: 58px;
}

.media-detail-page.has-backdrop {
  margin-inline: auto;
  padding: clamp(170px, 25vw, 330px) 0 30px;
  border-radius: 0;
}

.media-detail-nav {
  position: absolute;
  top: 24px;
  left: 0;
  z-index: 2;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
}

.media-detail-nav .btn,
.detail-source-label {
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(5, 5, 7, .74);
  color: #fff;
  backdrop-filter: blur(12px);
}

.detail-source-label {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
}

.media-detail-hero {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) 270px;
  gap: 26px;
  align-items: end;
}

.media-poster-shell {
  width: 190px;
}

.media-page-poster {
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: var(--radius-md);
  background: var(--panel);
  box-shadow: 0 26px 64px rgba(0, 0, 0, .42);
}

.media-detail-content {
  min-width: 0;
  padding-bottom: 4px;
}

.detail-kicker {
  color: color-mix(in srgb, var(--text) 70%, transparent);
}

.media-page-title {
  max-width: 900px;
  margin: 8px 0 8px;
  color: var(--text);
  font-size: clamp(34px, 5vw, 68px);
  font-weight: 780;
  line-height: .98;
}

.detail-original-title {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
}

.media-detail-content .genres {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.media-detail-content .genres .tag {
  padding: 5px 8px;
  border: 1px solid color-mix(in srgb, var(--line) 76%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel) 74%, transparent);
  color: var(--text);
  font-size: 9px;
}

.media-detail-content .synopsis {
  display: -webkit-box;
  max-width: 780px;
  margin: 14px 0;
  overflow: hidden;
  color: color-mix(in srgb, var(--text) 82%, transparent);
  font-size: 13px;
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.media-detail-content .modal-actions {
  margin-top: 16px;
}

.media-detail-content .modal-actions .btn {
  border-color: color-mix(in srgb, var(--line) 78%, transparent);
  background: color-mix(in srgb, var(--panel) 82%, transparent);
  backdrop-filter: blur(12px);
}

.media-facts {
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  backdrop-filter: blur(14px);
}

.media-facts .source-box {
  margin: 0;
  padding: 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.media-facts .info-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 0;
}

.media-facts .info {
  min-width: 0;
  padding: 11px;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.media-facts .info:nth-child(2n) {
  border-right: 0;
}

.media-facts .info:nth-last-child(-n+2) {
  border-bottom: 0;
}

.media-facts .info:hover {
  background: var(--panel-2);
  transform: none;
}

.media-facts .info b {
  color: var(--muted);
  font-size: 9px;
}

.media-facts .info b .bi {
  color: var(--accent-2);
}

.media-facts .info span {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-detail-body {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, .55fr);
  gap: 28px;
  margin-top: 38px;
  align-items: start;
}

.media-detail-body > :only-child {
  grid-column: 1 / -1;
}

.episodes-section {
  min-width: 0;
  padding: 0;
  border: 0;
}

.episodes-section > header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.episodes-section > header h2 {
  margin: 5px 0 0;
  font-size: 22px;
}

.episodes-section > header strong {
  color: var(--muted);
  font-size: 10px;
}

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

.episode-card {
  min-height: 72px;
  padding: 7px;
  border-color: var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.episode-card:hover {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
  background: var(--panel-2);
}

.episode-thumb,
.episode-thumb-fallback {
  border-radius: 5px;
}

.episode-card-info span {
  color: var(--text);
  font-size: 11px;
}

.media-trailer-panel {
  position: sticky;
  top: 78px;
  padding: 10px;
  border-color: var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.media-trailer-panel h3 {
  font-size: 13px;
}

.media-trailer-panel iframe {
  border-radius: var(--radius-sm);
}

.media-trailer--blurred iframe {
  filter: blur(20px) saturate(.45) brightness(.66);
  transform: scale(1.05);
  pointer-events: none;
}

.episode-page {
  width: min(1280px, 100%);
  margin: 0 auto;
  gap: 14px;
}

.episode-nav {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.episode-head {
  padding: 10px 0 0;
}

.episode-head h2 {
  font-size: clamp(26px, 4vw, 44px);
}

.player-toolbar {
  margin: 0;
}

.player-container {
  position: relative;
  min-height: 260px;
  border-color: var(--line);
  border-radius: var(--radius-md);
  background: #000;
}

.player-external-fallback {
  display: flex;
  justify-content: flex-end;
  min-height: 30px;
  margin-top: 7px;
}

.player-external-fallback[hidden] {
  display: none;
}

.player-external-fallback-link {
  max-width: 100%;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 11px;
  text-decoration: none;
}

.player-external-fallback-link:hover,
.player-external-fallback-link:focus-visible {
  border-color: var(--accent);
  color: var(--text);
}

.servers-container {
  padding: 0;
}

.server-group {
  padding: 14px 0;
  border-color: var(--line);
  border-radius: 0;
  background: transparent;
}

.server-buttons {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 7px;
}

.server-buttons .active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
  box-shadow: none;
}

/* Public profile and route surfaces */
.public-profile-page {
  width: min(1240px, 100%);
  gap: 20px;
}

.public-profile-back {
  width: fit-content;
}

.public-profile-hero {
  min-height: 250px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.public-profile-section {
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.detail-modal,
.drawer-panel,
.terms-dialog {
  border-color: var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
}

.detail-modal-head {
  border-color: var(--line);
  background: var(--panel);
}

.toast {
  border-color: var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--text);
}

/* Theme-specific materials */
body.theme-glass {
  --glass-fill: rgba(255, 255, 255, .42);
  --glass-fill-strong: rgba(255, 255, 255, .68);
  --glass-edge: rgba(255, 255, 255, .88);
  --glass-edge-soft: rgba(255, 255, 255, .58);
  --glass-depth: rgba(67, 75, 94, .16);
  background: #edf1f6;
}

body.theme-glass::before {
  content: "";
  position: fixed;
  inset: -18vh -12vw;
  z-index: -3;
  pointer-events: none;
  background:
    linear-gradient(118deg, #f9fbfd 0 22%, #dbe4ef 22% 38%, #f4f7fa 38% 57%, #e5ddf2 57% 73%, #f7f9fc 73% 100%);
  filter: blur(54px) saturate(112%);
  transform: scale(1.08);
}

body.theme-glass::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  opacity: .42;
  background:
    linear-gradient(112deg, transparent 0 30%, rgba(255, 255, 255, .74) 30% 31%, transparent 31% 62%, rgba(135, 112, 183, .10) 62% 63%, transparent 63%),
    linear-gradient(22deg, rgba(255, 255, 255, .44), transparent 48%);
}

body.theme-glass .catalog-controls,
body.theme-glass .settings-panel,
body.theme-glass .profile-hero-card,
body.theme-glass .profile-metrics,
body.theme-glass .public-profile-editor,
body.theme-glass .profile-side-panel,
body.theme-glass .community-card,
body.theme-glass .community-user-card,
body.theme-glass .list-row,
body.theme-glass .managed-list-item,
body.theme-glass .history-row,
body.theme-glass .media-facts,
body.theme-glass .media-trailer-panel,
body.theme-glass .bottom-nav {
  border-color: var(--glass-edge-soft);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .13), transparent 34%),
    linear-gradient(180deg, var(--glass-fill-strong), var(--glass-fill));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .96),
    inset 1px 0 0 rgba(255, 255, 255, .58),
    inset 0 -1px 0 rgba(99, 107, 123, .10),
    0 18px 48px var(--glass-depth);
  backdrop-filter: blur(28px) saturate(165%) brightness(1.04);
  -webkit-backdrop-filter: blur(28px) saturate(165%) brightness(1.04);
}

body.theme-glass .hero {
  border-color: rgba(255, 255, 255, .72);
  background: rgba(255, 255, 255, .46);
  box-shadow: inset 0 -1px 0 rgba(104, 111, 127, .10);
  backdrop-filter: blur(34px) saturate(150%);
  -webkit-backdrop-filter: blur(34px) saturate(150%);
}

body.theme-glass .bottom-nav {
  border-color: var(--glass-edge);
  border-radius: 999px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, .94), rgba(255, 255, 255, .48) 52%, rgba(176, 153, 226, .18)),
    rgba(255, 255, 255, .50);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .42),
    inset 0 -1px 0 rgba(105, 112, 128, .12),
    inset 1px 0 0 rgba(255, 255, 255, .84),
    0 16px 48px rgba(63, 70, 87, .20);
}

body.theme-glass .btn,
body.theme-glass .select-btn,
body.theme-glass .filters select,
body.theme-glass .control,
body.theme-glass .form-control,
body.theme-glass input,
body.theme-glass select,
body.theme-glass textarea,
body.theme-glass .source-category-chip,
body.theme-glass .theme-option {
  border-color: rgba(255, 255, 255, .76);
  background:
    linear-gradient(155deg, rgba(255, 255, 255, .82), rgba(255, 255, 255, .28)),
    rgba(255, 255, 255, .38);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .16),
    inset 0 -1px 0 rgba(93, 101, 118, .10);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
}

body.theme-glass .btn:hover,
body.theme-glass .select-btn:hover,
body.theme-glass .source-category-chip:hover,
body.theme-glass .theme-option:hover {
  border-color: rgba(255, 255, 255, .96);
  background:
    linear-gradient(155deg, rgba(255, 255, 255, .96), rgba(255, 255, 255, .46)),
    rgba(255, 255, 255, .58);
}

body.theme-glass .primary.btn,
body.theme-glass .bottom-nav .navbtn.active,
body.theme-glass .source-category-chip.active {
  border-color: rgba(255, 255, 255, .34);
  background:
    linear-gradient(155deg, rgba(255, 255, 255, .22), transparent 42%),
    color-mix(in srgb, var(--accent) 78%, rgba(22, 14, 40, .68));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .42),
    inset 0 -1px 0 rgba(35, 12, 70, .24),
    0 8px 24px rgba(87, 47, 168, .24);
}

body.theme-glass .card .poster,
body.theme-glass .media-page-poster,
body.theme-glass .community-cover,
body.theme-glass .profile-banner {
  border-color: rgba(255, 255, 255, .18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .12),
    0 18px 44px rgba(0, 0, 0, .30);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  body.theme-glass .catalog-controls,
  body.theme-glass .settings-panel,
  body.theme-glass .profile-hero-card,
  body.theme-glass .profile-metrics,
  body.theme-glass .public-profile-editor,
  body.theme-glass .profile-side-panel,
  body.theme-glass .community-card,
  body.theme-glass .community-user-card,
  body.theme-glass .list-row,
  body.theme-glass .managed-list-item,
  body.theme-glass .history-row,
  body.theme-glass .media-facts,
  body.theme-glass .media-trailer-panel,
  body.theme-glass .bottom-nav {
    background: rgba(246, 248, 252, .96);
  }
}

body.theme-light .hero {
  background: rgba(245, 245, 247, .92);
}

body.theme-light .bottom-nav {
  background: rgba(255, 255, 255, .94);
}

body.theme-light .card .actions .btn,
body.theme-light .media-detail-nav .btn,
body.theme-light .detail-source-label {
  color: #fff;
}

body.theme-uiv2 .route-heading h2,
body.theme-uiv2 .media-page-title,
body.theme-uiv2 .community-hero h2 {
  font-family: "Fjalla One", var(--ui-font);
  font-weight: 400;
}

@media (max-width: 1180px) {
  .search-filter-panel {
    grid-template-columns: 1fr;
  }

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

  .source-settings-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .media-detail-hero {
    grid-template-columns: 170px minmax(0, 1fr);
  }

  .media-poster-shell {
    width: 170px;
  }

  .media-facts {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(240px, .8fr) 1fr;
  }

  .media-facts .source-box {
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }
}

@media (max-width: 900px) {
  .library-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .library-overview-item:nth-child(2) {
    border-right: 0;
  }

  .library-overview-item:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .library-navigation {
    align-items: stretch;
    flex-direction: column;
  }

  .library-toolbar .left {
    display: flex;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }

  .library-toolbar .btn {
    width: auto;
    flex: 0 0 auto;
  }

  .library-actions {
    justify-content: space-between;
  }

  .library-view-toggle {
    width: 132px;
  }

  .profile-overview,
  .profile-grid-layout {
    grid-template-columns: 1fr;
  }

  .profile-metrics {
    grid-template-columns: repeat(3, 1fr);
  }

  .profile-metric {
    grid-template-columns: 1fr;
    justify-items: center;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .profile-metric:last-child {
    border-right: 0;
  }

  .profile-metric .bi,
  .profile-metric strong,
  .profile-metric span {
    grid-column: 1;
  }

  .profile-metric .bi { grid-row: 1; }
  .profile-metric strong { grid-row: 2; }
  .profile-metric span { grid-row: 3; }

  .settings-shell > .settings-panel:first-child,
  .settings-shell > .theme-panel,
  .settings-shell > .credential-panel {
    grid-column: 1 / -1;
  }

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

  .media-trailer-panel {
    position: static;
  }
}

@media (max-width: 700px) {
  .app.container-xxl {
    padding: 14px 10px 42px;
  }

  .route-heading {
    min-height: 74px;
    margin-bottom: 14px;
    padding-bottom: 14px;
  }

  .route-heading h2 {
    font-size: 30px;
  }

  .catalog-controls {
    padding: 8px;
  }

  .search-filter-panel .filters {
    display: flex;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .filters select {
    width: 146px;
    flex: 0 0 146px;
  }

  .catalog-toolbar {
    align-items: flex-start;
  }

  .catalog-toolbar .left {
    display: flex;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }

  .catalog-toolbar .btn {
    flex: 0 0 auto;
  }

  .catalog-toolbar #gridBtn span,
  .catalog-toolbar #listBtn span,
  .catalog-toolbar #clearBtn span {
    display: none;
  }

  .catalog-toolbar #gridBtn,
  .catalog-toolbar #listBtn,
  .catalog-toolbar #clearBtn {
    width: 34px;
    min-width: 34px;
    padding: 0;
  }

  #results.grid,
  #watchedBox.grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 15px 8px;
  }

  .community-section {
    padding: 22px 0;
  }

  .community-hero {
    grid-template-columns: 1fr;
    gap: 18px;
    align-items: stretch;
  }

  .community-overview {
    width: 100%;
  }

  .community-overview > div {
    min-width: 0;
    padding: 9px;
  }

  .community-discovery-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .community-admin-section {
    padding-left: 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .community-section-head {
    align-items: end;
    flex-flow: row wrap;
  }

  .community-search {
    width: 100%;
    flex-basis: 100%;
  }

  .community-grid,
  .community-user-grid {
    grid-template-columns: 1fr;
  }

  .community-grid-compact {
    display: flex;
  }

  .profile-session {
    grid-template-columns: 1fr;
  }

  .profile-session .settings-actions {
    flex-wrap: wrap;
  }

  .profile-overview {
    gap: 10px;
  }

  .profile-banner {
    min-height: 150px;
  }

  .profile-hero-content {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .profile-public-link {
    margin-left: 0;
  }

  .source-settings-list {
    grid-template-columns: 1fr;
  }

  #routeTab.has-route-backdrop::before,
  #routeTab.has-route-backdrop::after {
    height: 260px;
  }

  .media-detail-page.has-backdrop {
    padding-top: 185px;
  }

  .media-detail-nav {
    top: 10px;
  }

  .media-detail-hero {
    grid-template-columns: 118px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
  }

  .media-poster-shell {
    width: 118px;
    grid-column: 1;
    grid-row: 1 / span 5;
  }

  .media-detail-content {
    display: contents;
  }

  .detail-kicker,
  .media-page-title,
  .detail-original-title,
  .media-detail-content .genres {
    grid-column: 2;
  }

  .media-page-title {
    margin-top: 6px;
    font-size: clamp(27px, 9vw, 40px);
  }

  .media-detail-content .genres {
    margin-top: 8px;
  }

  .media-detail-content .genres .tag:nth-child(n+5) {
    display: none;
  }

  .media-detail-content .synopsis {
    grid-column: 1 / -1;
    display: block;
    max-width: none;
    margin: 4px 0 0;
    overflow: visible;
    -webkit-line-clamp: 3;
  }

  .media-detail-content .modal-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
    margin-top: 8px;
  }

  .media-detail-content .modal-actions .btn {
    min-width: 0;
    min-height: 42px;
    justify-content: flex-start;
    padding: 8px 11px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .media-detail-content .modal-actions .btn span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .media-facts {
    grid-column: 1 / -1;
    display: block;
  }

  .media-facts .source-box {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .media-detail-body {
    gap: 20px;
    margin-top: 26px;
  }

  .episodes-grid {
    grid-template-columns: 1fr;
  }

  .episode-nav {
    gap: 5px;
  }

  .episode-nav .btn span {
    display: none;
  }

  .player-container {
    min-height: 190px;
  }
}

@media (max-width: 430px) {
  #results.grid,
  #watchedBox.grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .library-heading {
    align-items: end;
  }

  .library-heading p {
    display: none;
  }

  .library-overview-item {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 8px;
    padding: 11px 10px;
  }

  .library-overview-item > i {
    width: 30px;
    height: 30px;
    font-size: 13px;
  }

  .library-overview-item strong {
    font-size: 17px;
  }

  .library-toolbar .btn {
    min-height: 36px;
    min-width: 0;
    gap: 4px;
    padding-inline: 5px;
    font-size: 10px;
  }

  .library-toolbar .btn span {
    display: inline;
  }

  .library-toolbar .left {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2px;
    overflow: visible;
  }

  .library-toolbar .btn i {
    width: auto;
  }

  .library-actions #newListBtn span {
    display: inline;
  }

  .library-list-grid {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    margin-inline: -10px;
    padding-inline: 10px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .list-row {
    width: min(310px, calc(100vw - 46px));
    flex: 0 0 min(310px, calc(100vw - 46px));
    scroll-snap-align: start;
  }

  .list-detail-head {
    align-items: stretch;
    flex-direction: column;
    gap: 11px;
  }

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

  .list-detail-actions .btn {
    width: 100%;
    min-width: 0;
    justify-content: center;
  }

  .list-detail-actions .btn span {
    display: inline;
  }

  .managed-list-item,
  .history-row {
    grid-template-columns: 56px minmax(0, 1fr) auto;
  }

  .managed-list-item .history-poster,
  .history-poster {
    width: 56px;
  }

  .profile-metrics {
    grid-template-columns: 1fr;
  }

  .profile-metric {
    grid-template-columns: 30px 1fr auto;
    justify-items: start;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .profile-metric .bi { grid-column: 1; grid-row: 1; }
  .profile-metric span { grid-column: 2; grid-row: 1; }
  .profile-metric strong { grid-column: 3; grid-row: 1; }

  .settings-panel {
    padding: 14px;
  }

  .theme-option {
    grid-template-columns: 62px minmax(0, 1fr) 18px;
  }

  .theme-preview {
    width: 62px;
  }

  .font-options {
    grid-template-columns: 1fr;
  }

  .media-detail-hero {
    grid-template-columns: 102px minmax(0, 1fr);
    gap: 11px;
  }

  .media-poster-shell {
    width: 102px;
  }

  .media-page-title {
    font-size: clamp(24px, 8.8vw, 34px);
  }

  .media-facts {
    margin-top: 8px;
  }

  .episode-card {
    grid-template-columns: 72px minmax(0, 1fr) auto;
  }

  .episode-thumb,
  .episode-thumb-fallback {
    width: 72px;
  }
}

@media (max-width: 700px) {
  #communityTab,
  #communityBox,
  .community-page {
    width: 100%;
  }

  .community-page {
    gap: 0;
  }

  .community-hero {
    display: block;
    min-height: 0;
    margin-bottom: 8px;
    padding: 18px 16px 15px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: color-mix(in srgb, var(--accent) 5%, var(--panel));
  }

  .community-hero h2 {
    max-width: 330px;
    margin: 8px 0 6px;
    font-size: 28px;
    line-height: 1.03;
  }

  .community-hero p {
    max-width: 350px;
    font-size: 11px;
    line-height: 1.55;
  }

  .community-overview {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-top: 16px;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .community-overview > div,
  .community-overview > div:last-child {
    grid-template-columns: 22px minmax(0, 1fr);
    min-width: 0;
    min-height: 54px;
    align-content: center;
    gap: 1px 6px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
  }

  .community-overview span {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .community-discovery-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    border-bottom: 0;
  }

  .community-section,
  .community-discovery-grid .community-section {
    min-width: 0;
    padding: 20px 0;
    border-bottom: 1px solid var(--line);
    background: transparent;
  }

  .community-admin-section {
    padding-left: 0;
    border-top: 0;
    border-left: 0;
  }

  .community-section-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    margin-bottom: 13px;
  }

  .community-section-head h3,
  .community-section-head small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .community-section-head > strong {
    width: 32px;
    min-width: 32px;
    height: 32px;
    border-radius: 8px;
  }

  .community-section-search {
    width: 100%;
    min-width: 0;
    margin: 0 0 13px;
  }

  .community-grid-compact {
    display: flex;
    width: 100%;
    gap: 9px;
    margin: 0;
    padding: 0 1px 7px;
    overflow-x: auto;
  }

  .community-grid-compact > .community-card {
    width: min(280px, 82vw);
    flex: 0 0 min(280px, 82vw);
    grid-template-columns: 1fr;
    grid-template-rows: 132px minmax(0, 1fr);
    min-height: 260px;
  }

  .community-grid-compact > .community-card .community-cover {
    width: 100%;
    min-height: 132px;
    border-radius: 7px 7px 0 0;
  }

  .community-grid-compact > .empty {
    min-width: 100%;
    flex: 0 0 100%;
  }

  .community-user-rail {
    display: flex;
    width: 100%;
    gap: 8px;
    padding-bottom: 5px;
    overflow-x: auto;
  }

  .community-user-rail > .community-user-card {
    width: min(190px, 58vw);
    min-height: 126px;
    flex: 0 0 min(190px, 58vw);
  }

  .community-user-rail > .empty {
    min-width: 100%;
    flex: 0 0 100%;
  }

  .community-lists-section .community-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 9px;
  }

  .community-lists-section .community-card {
    grid-template-columns: 104px minmax(0, 1fr);
    grid-template-rows: minmax(138px, 1fr);
    min-height: 138px;
  }

  .community-lists-section .community-cover {
    width: 104px;
    min-height: 100%;
    padding: 10px;
    border-radius: 7px 0 0 7px;
  }

  .community-lists-section .community-cover strong,
  .community-lists-section .community-cover small {
    display: none;
  }

  .community-lists-section .community-card-body {
    grid-template-rows: auto auto minmax(0, 1fr) auto auto;
    height: 100%;
    gap: 5px;
    padding: 10px;
  }

  .community-lists-section .community-actions {
    display: flex;
    gap: 5px;
    overflow-x: auto;
  }

  .community-user-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .community-user-card {
    min-width: 0;
    min-height: 132px;
    padding: 16px 9px 11px;
  }

  .community-user-card img,
  .community-user-card .community-user-avatar {
    width: 48px;
    height: 48px;
  }

  .community-page .empty {
    display: grid;
    min-height: 86px;
    place-items: center;
    padding: 14px;
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: 11px;
    line-height: 1.5;
    text-align: center;
  }

  .community-pager {
    align-items: center;
    padding: 14px 0 0;
  }
}

/* Route overrides must remain last. */

.profile-overview {
  grid-template-columns: minmax(0, 1fr) 270px;
}

.profile-banner {
  min-height: 220px;
  background-image: var(--profile-banner);
  background-position: center;
  background-size: cover;
}

.profile-hero-content {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: end;
  gap: 14px;
}

.profile-metrics {
  grid-template-columns: 1fr;
}

.profile-workspace {
  grid-template-columns: minmax(0, 1fr) 300px;
}

.public-profile-hero {
  min-height: 0;
  border-radius: 8px;
}

.public-profile-banner {
  min-height: 250px;
  background-image: var(--public-banner);
  background-position: center;
  background-size: cover;
}

@media (max-width: 900px) {
  .profile-overview,
  .profile-workspace,
  .public-profile-layout {
    grid-template-columns: 1fr;
  }

  .profile-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .profile-metric {
    grid-template-columns: 1fr;
    min-height: 72px;
    justify-items: center;
    gap: 2px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .profile-metric:last-child {
    border-right: 0;
  }

  .profile-metric .bi,
  .profile-metric strong,
  .profile-metric span {
    grid-column: 1;
  }

  .profile-metric .bi { grid-row: 1; }
  .profile-metric strong { grid-row: 2; }
  .profile-metric span { grid-row: 3; }
}

@media (max-width: 700px) {
  .profile-banner {
    min-height: 150px;
  }

  .profile-hero-content {
    grid-template-columns: 74px minmax(0, 1fr);
    align-items: start;
    gap: 11px;
    padding: 12px;
  }

  .profile-avatar {
    width: 74px;
    height: 74px;
    margin-top: -43px;
  }

  .profile-identity p,
  .profile-public-link {
    grid-column: 1 / -1;
  }

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

  .profile-metric,
  .profile-metric:last-child {
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .profile-metric:nth-child(2n) {
    border-right: 0;
  }

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

  .public-profile-banner {
    min-height: 150px;
  }

  .public-profile-identity {
    grid-template-columns: 82px minmax(0, 1fr);
    align-items: start;
    gap: 11px;
    padding: 0 13px 14px;
  }

  .public-profile-avatar {
    width: 82px;
    height: 82px;
    margin-top: -38px;
  }

  .public-profile-actions {
    grid-column: 1 / -1;
  }

  .public-profile-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

#results > .loading-state,
#watchedBox > .loading-state,
#publicFeatured > .loading-state,
.servers-container > .loading-state {
  grid-column: 1 / -1;
}

body.theme-glass {
  --glass-bg: rgba(255, 255, 255, .46);
  --glass-bg-2: rgba(255, 255, 255, .72);
  --glass-bg-soft: rgba(238, 243, 249, .38);
  --glass-shine: rgba(255, 255, 255, .68);
  --glass-border: rgba(255, 255, 255, .82);
  --glass-inset: inset 0 1px 0 rgba(255, 255, 255, .92), inset 0 -1px 0 rgba(87, 96, 116, .08);
  --glass-blur: 28px;
}

body.theme-glass :is(
  .profile-metric,
  .profile-data-card,
  .profile-socials-panel,
  .community-section,
  .community-hero,
  .public-profile-section,
  .server-group
) {
  border-color: rgba(255, 255, 255, .62);
  background: rgba(255, 255, 255, .20);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .72);
  backdrop-filter: blur(12px) saturate(130%);
  -webkit-backdrop-filter: blur(12px) saturate(130%);
}

body.theme-glass :is(
  .settings-option-group,
  .profile-editor-section,
  .public-profile-about,
  .profile-account-grid
) {
  border-color: rgba(255, 255, 255, .58);
  background: rgba(255, 255, 255, .16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .54);
}

body.theme-glass .settings-index {
  border-color: rgba(255, 255, 255, .58);
  background: rgba(255, 255, 255, .28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .62);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}

.profile-banner:not(.has-profile-banner),
.public-profile-banner:not(.has-public-banner) {
  background-image:
    linear-gradient(128deg, color-mix(in srgb, var(--accent) 18%, var(--panel-2)) 0 34%, transparent 34% 68%, color-mix(in srgb, var(--accent) 8%, var(--panel-2)) 68%),
    linear-gradient(35deg, var(--panel-2), color-mix(in srgb, var(--surface) 82%, var(--accent)));
}

body.theme-glass {
  --glass-bg: rgba(255, 255, 255, .20);
  --glass-bg-2: rgba(255, 255, 255, .42);
  --glass-bg-soft: rgba(224, 232, 243, .18);
  --glass-shine: rgba(255, 255, 255, .76);
  --glass-border: rgba(255, 255, 255, .74);
  --glass-inset:
    inset 1px 1px 0 rgba(255, 255, 255, .96),
    inset -1px -1px 0 rgba(78, 88, 108, .10),
    inset 10px -14px 30px -32px rgba(109, 40, 217, .72),
    inset -12px 10px 34px -34px rgba(37, 99, 235, .58);
  --glass-blur: 30px;
  background: #edf2f8;
}

body.theme-glass::before {
  inset: -8vh -6vw;
  background:
    linear-gradient(116deg, transparent 0 18%, rgba(132, 106, 190, .17) 18% 27%, transparent 27% 58%, rgba(79, 125, 181, .12) 58% 68%, transparent 68%),
    linear-gradient(28deg, #f9fbfe 0 22%, #dce6f1 22% 39%, #f4f7fb 39% 62%, #e5dff0 62% 76%, #fbfcfe 76%);
  filter: blur(16px) saturate(118%);
  transform: scale(1.03);
}

body.theme-glass::after {
  opacity: .74;
  background:
    repeating-linear-gradient(128deg, transparent 0 118px, rgba(255, 255, 255, .36) 118px 120px, transparent 120px 236px),
    linear-gradient(180deg, rgba(255, 255, 255, .14), transparent 45%, rgba(122, 92, 177, .05));
}

body.theme-glass :is(
  .glass,
  .auth-card,
  .hero,
  .search-filter-panel,
  .toolbar,
  .bottom-nav,
  .settings-panel,
  .theme-option,
  .source-setting,
  .source-category-tabs,
  .drawer-panel,
  .detail-modal,
  .card,
  .list-row,
  .managed-list-item,
  .history-row,
  .profile-socials-panel,
  .profile-hero-card,
  .community-card,
  .community-user-card,
  .episode-page,
  .episode-card,
  .servers-container,
  .notice,
  .toast
) {
  border-color: var(--glass-border);
  background:
    linear-gradient(112deg, rgba(255, 255, 255, .46), rgba(255, 255, 255, .10) 34%, rgba(226, 234, 246, .12) 68%, rgba(255, 255, 255, .32)),
    rgba(255, 255, 255, .18);
  background-clip: padding-box;
  box-shadow:
    var(--glass-inset),
    0 1px 2px rgba(50, 60, 78, .08),
    0 16px 42px rgba(55, 66, 88, .14);
  backdrop-filter: blur(var(--glass-blur)) saturate(185%) contrast(1.04);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(185%) contrast(1.04);
}

body.theme-glass :is(
  input,
  select,
  textarea,
  .form-control,
  .control,
  .ghost,
  .smallbtn,
  .linkbtn,
  .select-btn,
  .source-category-chip,
  .api-chip,
  .community-user-like,
  .mini-segment .btn
) {
  border-color: rgba(255, 255, 255, .70);
  background:
    linear-gradient(150deg, rgba(255, 255, 255, .46), rgba(255, 255, 255, .10)),
    rgba(255, 255, 255, .16);
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, .90),
    inset -1px -1px 0 rgba(83, 94, 115, .10),
    0 6px 18px rgba(58, 70, 94, .10);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
}

body.theme-glass :is(
  .profile-metric,
  .profile-data-card,
  .settings-option-group,
  .profile-editor-section,
  .public-profile-about,
  .community-section,
  .public-profile-section,
  .server-group
) {
  border-color: rgba(255, 255, 255, .48);
  background:
    linear-gradient(125deg, rgba(255, 255, 255, .22), transparent 44%),
    rgba(255, 255, 255, .08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .62),
    inset 0 -1px 0 rgba(81, 92, 113, .06);
  backdrop-filter: blur(12px) saturate(145%);
  -webkit-backdrop-filter: blur(12px) saturate(145%);
}

body.theme-glass .bottom-nav {
  border-color: rgba(255, 255, 255, .90);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, .60), rgba(255, 255, 255, .16) 56%, rgba(139, 92, 246, .10)),
    rgba(255, 255, 255, .20);
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, .98),
    inset -1px -1px 0 rgba(76, 87, 108, .12),
    inset 12px -16px 34px -35px rgba(109, 40, 217, .85),
    0 14px 40px rgba(53, 64, 85, .18);
  backdrop-filter: blur(34px) saturate(190%);
  -webkit-backdrop-filter: blur(34px) saturate(190%);
}

body.theme-glass .bottom-nav .navbtn.active,
body.theme-glass .primary.btn,
body.theme-glass .source-category-chip.active {
  border-color: rgba(255, 255, 255, .66);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .36), transparent 46%),
    color-mix(in srgb, var(--accent) 74%, rgba(255, 255, 255, .18));
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, .72),
    inset -1px -1px 0 rgba(60, 35, 112, .22),
    0 8px 20px rgba(109, 40, 217, .24);
}

body.theme-glass .settings-index {
  border: 1px solid rgba(255, 255, 255, .64);
  background: rgba(255, 255, 255, .14);
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, .78),
    0 10px 28px rgba(55, 67, 89, .10);
  backdrop-filter: blur(22px) saturate(170%);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
}

.settings-index {
  scrollbar-width: none;
}

.settings-index::-webkit-scrollbar {
  display: none;
}

/* Adult content protection */
.poster-wrap,
.media-poster-shell,
.modal-poster-shell,
.episode-card {
  overflow: hidden;
}

.poster--blurred-adult,
.adult-blur .poster,
.adult-blur .cover-fallback {
  filter: blur(16px) saturate(.52) brightness(.76);
  transform: scale(1.08);
}

.episode-thumb--blurred {
  filter: blur(20px) saturate(.48) brightness(.72);
  transform: scale(1.16);
}

#routeTab.adult-backdrop-blurred::before {
  filter: blur(28px) saturate(.42) brightness(.62);
  transform: scale(1.08);
  transform-origin: center top;
}

#routeTab.adult-backdrop-blurred::after {
  background:
    linear-gradient(90deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 78%, transparent) 48%, var(--bg) 100%),
    linear-gradient(180deg, color-mix(in srgb, var(--bg) 34%, transparent), var(--bg) 94%);
}

.detail-route-labels {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.adult-protection-label {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid color-mix(in srgb, #ef4444 42%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, #450a0a 78%, transparent);
  color: #fecaca;
  font-size: 10px;
  font-weight: 750;
  backdrop-filter: blur(12px);
}

.protection-setting {
  border-color: color-mix(in srgb, var(--accent) 26%, var(--line));
  background: color-mix(in srgb, var(--accent-soft) 48%, var(--surface));
}

.protection-setting.is-disabled {
  opacity: .58;
}

/* Notifications */
.notification-stack {
  position: fixed;
  z-index: 1300;
  right: max(16px, env(safe-area-inset-right));
  bottom: calc(88px + env(safe-area-inset-bottom));
  display: grid;
  width: min(390px, calc(100vw - 28px));
  gap: 9px;
  pointer-events: none;
}

.app-notification {
  --notification-color: var(--accent);
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  overflow: hidden;
  padding: 11px 42px 12px 11px;
  border: 1px solid color-mix(in srgb, var(--notification-color) 34%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  color: var(--text);
  box-shadow: 0 20px 54px rgba(0, 0, 0, .28);
  opacity: 0;
  pointer-events: auto;
  transform: translateY(14px) scale(.98);
  transition: opacity .2s ease, transform .2s ease;
  backdrop-filter: blur(22px) saturate(150%);
}

.app-notification.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.notification-success { --notification-color: #22c55e; }
.notification-error { --notification-color: #ef4444; }
.notification-warning { --notification-color: #f59e0b; }
.notification-info { --notification-color: var(--accent); }

.notification-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--notification-color) 16%, transparent);
  color: var(--notification-color);
  font-size: 17px;
}

.notification-copy {
  min-width: 0;
}

.notification-copy strong,
.notification-copy p {
  display: block;
}

.notification-copy strong {
  margin-bottom: 2px;
  font-size: 12px;
}

.notification-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.notification-action {
  min-height: 30px;
  padding: 0 9px;
  border: 0;
  border-radius: 6px;
  background: color-mix(in srgb, var(--notification-color) 16%, transparent);
  color: var(--notification-color);
  font: inherit;
  font-size: 10px;
  font-weight: 750;
}

.notification-close,
.install-prompt-dismiss {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
}

.notification-progress {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--notification-color);
  transform-origin: left;
  animation: notificationProgress var(--notification-duration, 4200ms) linear forwards;
}

@keyframes notificationProgress {
  to { transform: scaleX(0); }
}

/* Confirmations */
.app-confirm-dialog {
  width: min(440px, calc(100vw - 28px));
  max-width: none;
  padding: 0;
  overflow: visible;
  border: 0;
  background: transparent;
  color: var(--text);
  opacity: 0;
  transform: translateY(16px) scale(.98);
  transition: opacity .18s ease, transform .18s ease;
}

.app-confirm-dialog.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.app-confirm-dialog::backdrop {
  background: rgba(2, 4, 8, .68);
  backdrop-filter: blur(8px);
}

.app-confirm-panel {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 13px;
  padding: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .42);
}

.app-confirm-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-2);
  font-size: 19px;
}

.app-confirm-icon.danger {
  background: color-mix(in srgb, #ef4444 15%, transparent);
  color: #ef4444;
}

.app-confirm-copy {
  min-width: 0;
}

.app-confirm-copy > span {
  color: var(--accent-2);
  font-size: 8px;
  font-weight: 800;
}

.app-confirm-copy h2 {
  margin: 3px 0 6px;
  font-size: 18px;
}

.app-confirm-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.app-confirm-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 3px;
}

.app-confirm-actions .danger {
  border-color: color-mix(in srgb, #ef4444 42%, var(--line));
  background: #dc2626;
  color: #fff;
}

/* Install prompt */
.install-prompt {
  position: fixed;
  z-index: 1400;
  left: 50%;
  bottom: calc(92px + env(safe-area-inset-bottom));
  display: grid;
  width: min(560px, calc(100vw - 28px));
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 14px 16px;
  padding: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 96%, transparent);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .42);
  color: var(--text);
  opacity: 0;
  transform: translate(-50%, 24px) scale(.98);
  transition: opacity .24s ease, transform .24s ease;
  backdrop-filter: blur(28px) saturate(160%);
}

.install-prompt.show {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.install-app-icon {
  display: grid;
  width: 70px;
  height: 70px;
  place-items: center;
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .24), transparent 54%),
    linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 16px 36px color-mix(in srgb, var(--accent) 30%, transparent);
  font-size: 28px;
  font-weight: 850;
}

.install-prompt-copy {
  min-width: 0;
  padding-right: 24px;
}

.install-eyebrow {
  color: var(--accent-2);
  font-size: 9px;
  font-weight: 800;
}

.install-prompt-copy h2 {
  margin: 3px 0 5px;
  font-size: 20px;
}

.install-prompt-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.install-steps {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.install-steps > div {
  display: flex;
  min-width: 0;
  min-height: 48px;
  align-items: center;
  gap: 9px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--muted);
  font-size: 10px;
}

.install-steps i {
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 17px;
}

.install-steps b {
  color: var(--text);
}

.install-prompt-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

body.theme-glass .app-notification,
body.theme-glass .install-prompt,
body.theme-glass .app-confirm-panel {
  border-color: rgba(255, 255, 255, .78);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .5), rgba(255, 255, 255, .16)),
    rgba(255, 255, 255, .2);
  box-shadow:
    0 28px 72px rgba(67, 75, 94, .2),
    inset 1px 1px 0 rgba(255, 255, 255, .92),
    inset -1px -1px 0 rgba(80, 89, 108, .15);
  backdrop-filter: blur(34px) saturate(190%) contrast(1.04);
}

@media (max-width: 640px) {
  .managed-ad-slot,
  .detail-inline-ad,
  .episode-after-player-ad {
    width: 100%;
    min-height: calc(var(--managed-ad-height, 50px) + 28px);
    margin: 12px auto;
    border-radius: 7px;
  }

  .library-rail-ad {
    display: none !important;
  }

  .catalog-feed-ad,
  .search-feed-ad,
  .community-feed-ad,
  .library-feed-ad,
  .detail-inline-ad,
  .episode-after-player-ad {
    margin-block: 22px 8px;
  }

  .notification-stack {
    right: 10px;
    bottom: calc(82px + env(safe-area-inset-bottom));
    width: calc(100vw - 20px);
  }

  .install-prompt {
    bottom: calc(78px + env(safe-area-inset-bottom));
    width: calc(100vw - 18px);
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 11px;
    padding: 14px;
  }

  .install-app-icon {
    width: 56px;
    height: 56px;
    font-size: 22px;
  }

  .install-prompt-copy h2 {
    font-size: 17px;
  }

  .install-steps {
    grid-template-columns: 1fr;
  }

  .install-steps > div {
    min-height: 42px;
  }

  .install-prompt-actions .btn {
    flex: 1 1 0;
  }

  .app-confirm-panel {
    grid-template-columns: 42px minmax(0, 1fr);
    padding: 15px;
  }

  .app-confirm-icon {
    width: 42px;
    height: 42px;
  }

  .app-confirm-actions .btn {
    flex: 1 1 0;
  }
}

/* Contextual loading V2 */
.loading-state {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 360px;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, .5fr);
  grid-template-rows: minmax(0, 1fr) 4px;
  gap: 24px 32px;
  align-items: stretch;
  overflow: hidden;
  padding: clamp(22px, 3vw, 38px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 94%, var(--accent) 6%);
}

.loading-state::before {
  position: absolute;
  inset: 0;
  border: 1px solid color-mix(in srgb, var(--text) 3%, transparent);
  border-radius: inherit;
  pointer-events: none;
  content: "";
}

.loading-stage {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 252px;
  align-items: center;
  padding: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--panel-2) 72%, transparent);
}

.loading-visual {
  width: 100%;
  align-content: center;
}

.loading-signal {
  position: absolute;
  top: 13px;
  left: 14px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
}

.loading-signal > i,
.loading-status-list span > i {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--line-strong);
}

.loading-signal > i {
  background: var(--accent);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 10%, transparent);
  animation: loading-signal 1.25s ease-in-out infinite;
}

.loading-copy {
  display: grid;
  min-width: 0;
  align-content: center;
  gap: 7px;
}

.loading-copy > small {
  color: var(--accent);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .14em;
}

.loading-copy > strong {
  max-width: 380px;
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.06;
}

.loading-copy > span {
  max-width: 360px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.loading-status-list {
  display: grid;
  gap: 0;
  margin-top: 18px;
  border-top: 1px solid var(--line);
}

.loading-status-list > span {
  display: flex;
  min-height: 34px;
  align-items: center;
  gap: 9px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
}

.loading-status-list > span.is-active {
  color: var(--text);
}

.loading-status-list > span.is-active > i {
  background: var(--accent);
  animation: loading-status 1.1s ease-in-out infinite;
}

.loading-track {
  grid-column: 1 / -1;
  align-self: end;
}

.loading-catalog {
  display: grid;
  grid-template-columns: repeat(6, minmax(70px, 1fr));
  align-items: end;
  gap: clamp(8px, 1.4vw, 16px);
  padding-top: 18px;
}

.loading-catalog i {
  display: grid;
  min-width: 0;
  gap: 8px;
  animation: loading-card-float 2.2s ease-in-out infinite;
}

.loading-catalog i:nth-child(2n) {
  animation-delay: -.65s;
}

.loading-catalog i:nth-child(3n) {
  animation-delay: -1.1s;
}

.loading-catalog i.is-featured {
  transform: translateY(-12px);
}

.loading-catalog b {
  width: 100%;
  aspect-ratio: 2 / 3;
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: var(--radius-sm);
}

.loading-catalog span,
.loading-catalog small {
  width: 88%;
}

.loading-catalog small {
  width: 56%;
}

.loading-detail {
  display: grid;
  grid-template-columns: minmax(110px, 28%) minmax(0, 1fr);
  gap: clamp(18px, 3vw, 34px);
  align-items: center;
  padding: 22px 2%;
}

.loading-detail > i {
  width: 100%;
  max-width: 190px;
  aspect-ratio: 2 / 3;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.loading-detail > span {
  display: grid;
  min-width: 0;
  gap: 13px;
}

.loading-detail > span > b:nth-child(1) {
  width: 78%;
  height: 28px;
}

.loading-detail > span > b:nth-child(2) {
  width: 48%;
  height: 10px;
}

.loading-detail > span > b:nth-child(n + 3) {
  width: 94%;
  height: 8px;
}

.loading-detail > span > em {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.loading-detail > span > em small {
  width: 54px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
}

.loading-player {
  display: grid;
  gap: 12px;
}

.loading-player > i {
  display: grid;
  min-height: 205px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.loading-play-ring {
  position: relative;
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  animation: loading-ring-spin 1.7s linear infinite;
}

.loading-play-ring::before {
  width: 0;
  height: 0;
  margin-left: 4px;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 11px solid var(--accent);
  content: "";
}

.loading-player > em {
  display: flex;
  gap: 8px;
}

.loading-player > em b {
  width: 92px;
  height: 28px;
  border-radius: 999px;
}

.loading-profile {
  position: relative;
  display: grid;
  min-height: 220px;
  align-content: end;
  padding: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.loading-profile > span {
  position: absolute;
  inset: 0 0 42%;
  background: color-mix(in srgb, var(--accent) 12%, var(--panel-2));
}

.loading-profile > i {
  position: relative;
  width: 72px;
  height: 72px;
  margin-bottom: 10px;
  border: 5px solid var(--panel);
  border-radius: 50%;
  background: var(--surface);
}

.loading-profile > b {
  position: relative;
  width: 48%;
  height: 10px;
  margin-bottom: 8px;
}

.loading-profile > b:nth-of-type(2) {
  width: 30%;
  height: 7px;
}

.loading-profile > em {
  position: absolute;
  right: 18px;
  bottom: 18px;
  display: flex;
  gap: 7px;
}

.loading-profile > em small {
  width: 54px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
}

.loading-collection {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.loading-collection i {
  display: grid;
  min-width: 0;
  min-height: 184px;
  grid-template-rows: minmax(0, 1fr) 9px 7px;
  gap: 9px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.loading-collection span {
  width: 100%;
  height: auto;
  border-radius: 0;
}

.loading-collection b,
.loading-collection small {
  width: calc(100% - 18px);
  margin: 0 9px;
}

.loading-collection small {
  height: 7px;
  margin-bottom: 10px;
  border-radius: 4px;
  background: var(--panel-2);
}

.loading-state :is(
  .loading-catalog b,
  .loading-catalog span,
  .loading-catalog small,
  .loading-detail > i,
  .loading-detail b,
  .loading-player > i,
  .loading-player > em b,
  .loading-profile,
  .loading-profile > i,
  .loading-profile > b,
  .loading-collection span,
  .loading-collection b,
  .loading-collection small
) {
  background-image: linear-gradient(105deg, transparent 28%, color-mix(in srgb, var(--text) 9%, transparent) 48%, transparent 68%);
  background-size: 220% 100%;
  animation: loading-shimmer 1.45s linear infinite;
}

/* Community V4 */
.community-page {
  display: grid;
  width: 100%;
  gap: 0;
}

.community-hero {
  display: grid;
  min-height: 238px;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .62fr);
  align-items: center;
  gap: clamp(28px, 6vw, 84px);
  padding: clamp(30px, 5vw, 66px) 0;
  border-bottom: 1px solid var(--line);
}

.community-hero-copy {
  min-width: 0;
}

.community-hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .13em;
}

.community-hero .eyebrow i {
  font-size: 14px;
}

.community-hero h2 {
  max-width: 760px;
  margin: 12px 0 10px;
  font-size: clamp(32px, 5vw, 58px);
  line-height: 1.02;
}

.community-hero p {
  max-width: 650px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.community-overview {
  display: grid;
  grid-template-columns: 1fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.community-overview > div {
  display: grid;
  min-width: 0;
  min-height: 70px;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
}

.community-overview > div:last-child {
  border-bottom: 0;
}

.community-overview > div > i {
  display: grid;
  width: 42px;
  height: 42px;
  grid-row: auto;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: 50%;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  font-size: 17px;
}

.community-overview > div > span {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.community-overview strong {
  color: var(--text);
  font-size: 20px;
  line-height: 1;
}

.community-overview small {
  color: var(--muted);
  font-size: 10px;
}

.community-section {
  min-width: 0;
  padding: clamp(26px, 4vw, 44px) 0;
  border-bottom: 1px solid var(--line);
}

.community-section-head {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.community-section-title {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.community-section-icon {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  border-radius: 50%;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  font-size: 18px;
}

.community-section-title > div {
  min-width: 0;
}

.community-section-title > div > span {
  display: block;
  margin: 0 0 3px;
  color: var(--accent);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .13em;
}

.community-section-head h3 {
  margin: 0;
  font-size: 20px;
}

.community-section-head small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.community-section-head > strong {
  display: grid;
  min-width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text);
  font-size: 12px;
}

.community-section-head-with-search {
  align-items: end;
}

.community-search {
  display: flex;
  width: min(340px, 100%);
  min-width: 240px;
  min-height: 42px;
  align-items: center;
  gap: 9px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--field);
}

.community-search > i {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 15px;
}

.community-search .control {
  width: 100%;
  min-height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
}

.community-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.community-grid-compact {
  display: flex;
  gap: 13px;
  overflow-x: auto;
  padding: 2px 1px 10px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.community-grid-compact > * {
  width: min(320px, 78vw);
  flex: 0 0 min(320px, 78vw);
  scroll-snap-align: start;
}

.community-card {
  display: grid;
  min-width: 0;
  grid-template-rows: 164px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  transition: border-color .18s ease, transform .18s ease;
}

.community-card:hover {
  border-color: color-mix(in srgb, var(--accent) 34%, var(--line));
  transform: translateY(-2px);
}

.community-cover {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 164px;
  align-items: flex-end;
  justify-content: space-between;
  padding: 14px;
  overflow: hidden;
  border-radius: 0;
  background-position: center;
  background-size: cover;
}

.community-cover-count {
  position: absolute;
  top: 11px;
  right: 11px;
  display: inline-flex;
  min-height: 29px;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 999px;
  color: #fff;
  background: rgba(7, 8, 12, .62);
  font-size: 10px;
  backdrop-filter: blur(10px);
}

.community-cover-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.community-cover-copy strong {
  overflow: hidden;
  color: #fff;
  font-size: 16px;
  text-overflow: ellipsis;
  text-shadow: 0 2px 14px rgba(0, 0, 0, .85);
  white-space: nowrap;
}

.community-cover-copy small {
  color: rgba(255, 255, 255, .76);
  font-size: 9px;
}

.community-card-body {
  display: grid;
  min-width: 0;
  grid-template-rows: auto minmax(34px, 1fr) auto;
  gap: 11px;
  padding: 14px;
}

.community-card-heading {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.community-title {
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-owner {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
}

.community-owner span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-card-body > p {
  display: -webkit-box;
  min-height: 34px;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.community-card-footer {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}

.community-card-meta {
  display: flex;
  min-width: 0;
  gap: 10px;
  padding: 0;
  border: 0;
}

.community-card-meta > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
}

.community-card-meta .liked {
  color: #ef4444;
}

.community-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
  margin: 0;
}

.community-actions .btn {
  width: 38px;
  min-width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 50%;
  font-size: 16px;
}

.community-actions .liked {
  color: #ef4444;
}

.community-people-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(270px, .3fr);
  gap: clamp(24px, 4vw, 48px);
}

.community-people-layout > .community-section {
  border-bottom: 0;
}

.community-admin-section {
  padding-left: 28px;
  border-left: 1px solid var(--line);
}

.community-user-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

.community-user-card {
  display: grid;
  min-width: 0;
  min-height: 142px;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 13px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  transition: border-color .18s ease, transform .18s ease;
}

.community-user-card:hover {
  border-color: color-mix(in srgb, var(--accent) 34%, var(--line));
  transform: translateY(-2px);
}

.community-user-card-top {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.community-user-main {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
  text-align: left;
}

.community-avatar-shell {
  position: relative;
  display: block;
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
}

.community-user-card img,
.community-user-card .community-user-avatar {
  display: grid;
  width: 58px;
  height: 58px;
  margin: 0;
  place-items: center;
  overflow: hidden;
  border: 2px solid color-mix(in srgb, var(--accent) 42%, var(--line));
  border-radius: 50%;
  object-fit: cover;
}

.community-avatar-shell > .public-verified-check {
  position: absolute;
  right: -1px;
  bottom: -1px;
  padding: 2px;
  border-radius: 50%;
  color: var(--accent);
  background: var(--surface);
  font-size: 16px;
}

.community-user-identity {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.community-user-identity strong,
.community-user-identity small {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-user-identity strong {
  color: var(--text);
  font-size: 13px;
}

.community-user-identity small {
  color: var(--muted);
  font-size: 9px;
}

.community-user-like {
  position: static;
  display: inline-flex;
  min-width: 44px;
  height: 40px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--field);
  font-size: 12px;
}

.community-user-like > i {
  font-size: 17px;
}

.community-user-like.liked {
  border-color: color-mix(in srgb, #ef4444 34%, var(--line));
  color: #ef4444;
  background: color-mix(in srgb, #ef4444 8%, var(--field));
}

.community-user-open {
  display: flex;
  min-width: 0;
  min-height: 32px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
}

.community-user-open > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-user-open > i {
  color: var(--accent);
  font-size: 14px;
}

.community-user-rail {
  display: grid;
  gap: 10px;
}

.community-user-rail .community-user-card {
  min-height: 130px;
}

.community-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding-top: 20px;
}

.community-pager > span {
  min-width: 52px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.community-pager .btn {
  min-height: 40px;
}

.community-page .loading-state {
  min-height: 190px;
  grid-template-columns: minmax(0, 1.3fr) minmax(180px, .7fr);
  grid-template-rows: minmax(0, 1fr) 3px;
  gap: 14px 20px;
  padding: 14px;
}

.community-page .loading-stage {
  min-height: 158px;
  padding: 14px;
}

.community-page .loading-copy > strong {
  font-size: 18px;
}

.community-page .loading-copy > span {
  font-size: 10px;
}

.community-page .loading-status-list {
  margin-top: 8px;
}

.community-page .loading-status-list > span {
  min-height: 25px;
}

.community-page .loading-signal {
  display: none;
}

.community-page .loading-collection {
  height: 126px;
}

.community-page .loading-collection i {
  min-height: 126px;
}

.community-page .loading-profile {
  min-height: 132px;
}

body.theme-glass .community-hero {
  padding-right: clamp(18px, 3vw, 38px);
  padding-left: clamp(18px, 3vw, 38px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, .16);
  box-shadow: var(--glass-inset), 0 18px 42px rgba(60, 70, 90, .12);
  backdrop-filter: blur(24px) saturate(170%);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
}

@keyframes loading-signal {
  0%,
  100% { opacity: .45; transform: scale(.86); }
  50% { opacity: 1; transform: scale(1); }
}

@keyframes loading-status {
  0%,
  100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 25%, transparent); }
  50% { box-shadow: 0 0 0 5px transparent; }
}

@keyframes loading-card-float {
  0%,
  100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

@keyframes loading-ring-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 900px) {
  .loading-state {
    grid-template-columns: minmax(0, 1fr) minmax(220px, .55fr);
    gap: 20px;
  }

  .loading-catalog {
    grid-template-columns: repeat(4, minmax(58px, 1fr));
  }

  .loading-catalog i:nth-child(n + 5) {
    display: none;
  }

  .community-hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  .community-overview {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .community-overview > div {
    min-height: 68px;
    grid-template-columns: 34px minmax(0, 1fr);
    padding: 10px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .community-overview > div:last-child {
    border-right: 0;
  }

  .community-overview > div > i {
    width: 34px;
    height: 34px;
    font-size: 14px;
  }

  .community-people-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .community-admin-section {
    padding-left: 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .community-user-rail {
    display: flex;
    overflow-x: auto;
    padding-bottom: 8px;
  }

  .community-user-rail > .community-user-card {
    width: min(270px, 74vw);
    flex: 0 0 min(270px, 74vw);
  }
}

@media (max-width: 700px) {
  .loading-state {
    min-height: 430px;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 228px auto 3px;
    gap: 17px;
    padding: 14px;
    border-radius: var(--radius-md);
  }

  .loading-stage {
    min-height: 228px;
    padding: 14px;
  }

  .loading-copy {
    padding: 2px 3px;
  }

  .loading-copy > strong {
    font-size: 24px;
  }

  .loading-status-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    margin-top: 10px;
    border: 0;
  }

  .loading-status-list > span {
    min-height: 44px;
    align-items: flex-start;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: 8px;
    line-height: 1.35;
  }

  .loading-status-list > span > i {
    margin-top: 2px;
  }

  .loading-catalog {
    gap: 8px;
  }

  .loading-detail {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 16px;
    padding: 22px 0 4px;
  }

  .loading-player > i {
    min-height: 168px;
  }

  .community-hero {
    min-height: 0;
    margin: 0;
    padding: 28px 0;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
  }

  body.theme-glass .community-hero {
    padding: 22px 16px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
  }

  .community-hero h2 {
    max-width: 430px;
    margin: 10px 0 8px;
    font-size: clamp(30px, 10vw, 42px);
  }

  .community-hero p {
    font-size: 11px;
    line-height: 1.55;
  }

  .community-overview {
    gap: 0;
    margin-top: 2px;
  }

  .community-overview > div {
    display: grid;
    min-height: 76px;
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 6px;
    padding: 9px 5px;
    text-align: center;
  }

  .community-overview > div > i {
    width: 32px;
    height: 32px;
  }

  .community-overview > div > span {
    justify-items: center;
  }

  .community-overview strong {
    font-size: 17px;
  }

  .community-overview small {
    max-width: 88px;
    overflow: hidden;
    font-size: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .community-section {
    padding: 24px 0;
  }

  .community-section-head,
  .community-section-head-with-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
  }

  .community-section-head-with-search .community-search {
    grid-column: 1 / -1;
  }

  .community-section-icon {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
    font-size: 16px;
  }

  .community-section-head .community-section-title > .community-section-icon {
    font-size: 16px;
  }

  .community-section-head h3 {
    font-size: 18px;
  }

  .community-section-head small {
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .community-search {
    width: 100%;
    min-width: 0;
    min-height: 46px;
  }

  .community-grid-compact {
    margin-right: calc(var(--page-pad, 16px) * -1);
    padding-right: var(--page-pad, 16px);
  }

  .community-grid-compact > .community-card {
    width: min(292px, 80vw);
    flex-basis: min(292px, 80vw);
  }

  .community-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .community-lists-section .community-card {
    min-height: 166px;
    grid-template-columns: 112px minmax(0, 1fr);
    grid-template-rows: 1fr;
  }

  .community-lists-section .community-cover {
    min-height: 100%;
    padding: 10px;
  }

  .community-lists-section .community-cover-count {
    top: 8px;
    right: 8px;
    min-height: 25px;
    padding: 0 8px;
  }

  .community-lists-section .community-cover-copy strong,
  .community-lists-section .community-cover-copy small {
    display: none;
  }

  .community-lists-section .community-card-body {
    gap: 7px;
    padding: 11px;
  }

  .community-card-footer {
    align-items: flex-end;
  }

  .community-card-meta {
    display: grid;
    gap: 4px;
  }

  .community-actions {
    max-width: 88px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .community-actions .btn {
    width: 40px;
    min-width: 40px;
    height: 40px;
  }

  .community-user-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .community-user-card {
    min-height: 168px;
    gap: 11px;
    padding: 12px;
  }

  .community-user-card-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 40px;
    gap: 7px;
  }

  .community-user-main {
    display: grid;
    min-width: 0;
    justify-items: start;
    gap: 8px;
  }

  .community-avatar-shell,
  .community-user-card img,
  .community-user-card .community-user-avatar {
    width: 54px;
    height: 54px;
  }

  .community-user-like {
    width: 40px;
    min-width: 40px;
    height: 40px;
    padding: 0;
  }

  .community-user-like span {
    display: none;
  }

  .community-user-open {
    min-height: 38px;
  }

  .community-page .loading-state {
    min-height: 310px;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 158px auto 3px;
    gap: 12px;
  }

  .community-page .loading-stage {
    min-height: 158px;
  }

  .community-page .loading-status-list {
    display: none;
  }
}

@media (max-width: 360px) {
  .community-user-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .community-user-card-top,
  .community-user-main {
    display: flex;
  }

  .community-user-like span {
    display: inline;
  }

  .community-user-like {
    width: auto;
    min-width: 44px;
    padding: 0 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .loading-state *,
  .community-card,
  .community-user-card {
    animation: none !important;
    transition: none !important;
  }
}

body.onboarding-open {
  overflow: hidden;
}

html:has(body.onboarding-open) {
  overflow: hidden;
}

.onboarding-gate {
  position: fixed;
  z-index: 10050;
  inset: 0;
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: clamp(18px, 4vw, 48px);
  overflow-x: hidden;
  overflow-y: auto;
  background: color-mix(in srgb, var(--bg) 91%, #151022);
  isolation: isolate;
}

.onboarding-gate[hidden] {
  display: none;
}

.onboarding-ambient {
  position: fixed;
  z-index: -1;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: clamp(16px, 3vw, 42px);
  padding: 7vh 5vw;
  opacity: .22;
  overflow: hidden;
  pointer-events: none;
}

.onboarding-ambient span {
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.onboarding-ambient span:nth-child(2) {
  transform: translateY(12vh);
  background: color-mix(in srgb, var(--accent-2) 8%, transparent);
}

.onboarding-ambient span:nth-child(3) {
  transform: translateY(-9vh);
}

.onboarding-panel {
  box-sizing: border-box;
  width: min(940px, 100%);
  max-width: 100%;
  min-height: min(700px, calc(100dvh - 40px));
  display: grid;
  grid-template-rows: auto auto auto minmax(250px, 1fr) auto auto;
  padding: clamp(22px, 4vw, 48px);
  border: 1px solid color-mix(in srgb, var(--line) 88%, var(--accent));
  border-radius: 24px;
  background: color-mix(in srgb, var(--panel) 96%, transparent);
  box-shadow: 0 34px 100px rgba(0, 0, 0, .46), inset 0 1px rgba(255, 255, 255, .08);
}

body.theme-glass .onboarding-gate {
  background: rgba(235, 239, 248, .78);
  backdrop-filter: blur(30px) saturate(125%);
  -webkit-backdrop-filter: blur(30px) saturate(125%);
}

body.theme-glass .onboarding-panel {
  border-color: rgba(255, 255, 255, .82);
  background: rgba(255, 255, 255, .58);
  box-shadow: 0 30px 90px rgba(54, 61, 79, .2), inset 0 1px 0 rgba(255, 255, 255, .95);
  backdrop-filter: blur(36px) saturate(145%);
  -webkit-backdrop-filter: blur(36px) saturate(145%);
}

.onboarding-head,
.onboarding-brand,
.onboarding-actions,
.onboarding-source-summary > div {
  display: flex;
  align-items: center;
}

.onboarding-head {
  justify-content: space-between;
}

.onboarding-brand {
  gap: 12px;
}

.onboarding-brand > div {
  display: grid;
  gap: 2px;
}

.onboarding-brand b {
  font-size: 16px;
}

.onboarding-brand small,
.onboarding-source-summary small {
  color: var(--muted);
  font-size: 12px;
}

.onboarding-mark,
.onboarding-logout {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line));
  border-radius: 13px;
}

.onboarding-mark {
  background: var(--accent);
  color: #fff;
  font-size: 20px;
  font-weight: 900;
}

.onboarding-logout {
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
}

.onboarding-progress {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin: clamp(26px, 5vh, 48px) 0 0;
}

.onboarding-progress::before,
.onboarding-progress > i {
  position: absolute;
  top: 16px;
  left: 10%;
  width: 80%;
  height: 2px;
  content: "";
  background: var(--line);
}

.onboarding-progress > i {
  width: 0;
  max-width: 80%;
  background: var(--accent);
  transform-origin: left;
  transition: width .32s ease;
}

.onboarding-progress > span {
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 7px;
  color: var(--muted);
}

.onboarding-progress b {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  font-size: 12px;
}

.onboarding-progress em {
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.onboarding-progress span.active {
  color: var(--text);
}

.onboarding-progress span.active b {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.onboarding-progress span.current b {
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 16%, transparent);
}

.onboarding-copy {
  max-width: 630px;
  padding: clamp(24px, 4vh, 38px) 0 18px;
}

.onboarding-copy > span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.onboarding-copy h1 {
  margin: 7px 0 8px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.05;
  letter-spacing: 0;
}

.onboarding-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.onboarding-steps {
  min-height: 0;
}

.onboarding-step {
  animation: onboarding-enter .28s ease;
}

.onboarding-step[hidden] {
  display: none;
}

@keyframes onboarding-enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.onboarding-fields,
.onboarding-social-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.onboarding-fields label,
.onboarding-social-grid label {
  display: grid;
  min-width: 0;
  gap: 8px;
}

.onboarding-fields .wide {
  grid-column: 1 / -1;
}

.onboarding-fields label > span,
.onboarding-social-grid label > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.onboarding-fields label > span em {
  color: color-mix(in srgb, var(--muted) 70%, transparent);
  font-size: 10px;
  font-style: normal;
  text-transform: uppercase;
}

.onboarding-fields input,
.onboarding-fields textarea,
.onboarding-social-grid input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: 0;
  background: var(--panel-2);
  color: var(--text);
}

.onboarding-fields textarea {
  min-height: 104px;
  resize: vertical;
}

.onboarding-fields input:focus,
.onboarding-fields textarea:focus,
.onboarding-social-grid input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}

.onboarding-fields label > small {
  color: var(--muted);
  font-size: 10px;
}

.onboarding-username {
  position: relative;
}

.onboarding-username i {
  position: absolute;
  top: 50%;
  left: 14px;
  color: var(--muted);
  font-style: normal;
  transform: translateY(-50%);
}

.onboarding-username input {
  padding-left: 34px;
}

.onboarding-social-grid label {
  position: relative;
  grid-template-columns: 22px 110px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 7px 8px 7px 14px;
  border-bottom: 1px solid var(--line);
}

.onboarding-social-grid label > i {
  color: var(--accent);
  font-size: 17px;
}

.onboarding-social-grid input {
  min-height: 42px;
}

.onboarding-source-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.onboarding-source-summary > div {
  gap: 12px;
}

.onboarding-source-summary > div > i {
  color: var(--accent);
  font-size: 22px;
}

.onboarding-source-summary span {
  display: grid;
  gap: 2px;
}

.onboarding-source-summary button {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.onboarding-source-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 9px;
  max-height: 330px;
  padding-right: 5px;
  overflow: auto;
}

.onboarding-source-group {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel-2) 72%, transparent);
}

.onboarding-source-group > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.onboarding-source-group > header span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.onboarding-source-group > header i { color: var(--accent); }
.onboarding-source-group > header b { color: var(--text); }

.onboarding-source-group > div {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.onboarding-source {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel-2) 90%, transparent);
  cursor: pointer;
}

.onboarding-source:has(input:checked) {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
  background: color-mix(in srgb, var(--accent) 9%, var(--panel-2));
}

.onboarding-source-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  overflow: hidden;
  border-radius: 10px;
  background: var(--panel);
  color: var(--accent);
}

.onboarding-source-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.onboarding-source > span:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.onboarding-source b,
.onboarding-source small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.onboarding-source b {
  font-size: 12px;
}

.onboarding-source small {
  color: var(--muted);
  font-size: 10px;
}

.onboarding-source input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.onboarding-source > i {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: transparent;
}

.onboarding-source input:checked + i {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.onboarding-source:has(input:disabled) {
  opacity: .48;
  cursor: not-allowed;
}

.onboarding-appearance {
  display: grid;
  gap: 14px;
  max-height: 390px;
  padding-right: 5px;
  overflow: auto;
}

.onboarding-preference-block {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel-2) 82%, transparent);
}

.onboarding-preference-block > header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.onboarding-preference-block > header > i {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
}

.onboarding-preference-block > header > div { display: grid; gap: 2px; }
.onboarding-preference-block header b { font-size: 12px; }
.onboarding-preference-block header small { color: var(--muted); font-size: 10px; }

.onboarding-theme-options { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
.onboarding-font-options { grid-template-columns: repeat(4, minmax(0, 1fr)); }

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

.onboarding-choice-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.onboarding-preference-block:first-child .onboarding-choice-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.onboarding-toggle-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel-2) 82%, transparent);
}

.onboarding-toggle-card > span:first-child { display: flex; align-items: center; gap: 10px; }
.onboarding-toggle-card > span:first-child > i { color: var(--accent); font-size: 20px; }
.onboarding-toggle-card > span:first-child > span { display: grid; gap: 2px; }
.onboarding-toggle-card b { font-size: 12px; }
.onboarding-toggle-card small { color: var(--muted); font-size: 10px; }

.onboarding-adult-mode {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  min-height: 250px;
  padding: clamp(22px, 5vw, 44px);
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--line));
  border-radius: 20px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 12%, var(--panel-2)), var(--panel));
}

.onboarding-adult-icon {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line));
  border-radius: 20px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 30px;
}

.onboarding-adult-copy > span { color: var(--accent); font-size: 9px; font-weight: 900; }
.onboarding-adult-copy h2 { margin: 6px 0 8px; font-size: 26px; }
.onboarding-adult-copy p { max-width: 560px; margin: 0; color: var(--muted); line-height: 1.6; }

.onboarding-adult-switch { display: grid; justify-items: center; gap: 8px; cursor: pointer; }
.onboarding-adult-switch input { position: absolute; opacity: 0; }
.onboarding-adult-switch > span { position: relative; width: 62px; height: 34px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel-2); }
.onboarding-adult-switch > span::after { position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: var(--muted); content: ''; transition: transform .2s ease, background .2s ease; }
.onboarding-adult-switch input:checked + span { border-color: var(--accent); background: var(--accent-soft); }
.onboarding-adult-switch input:checked + span::after { background: var(--accent); transform: translateX(28px); }
.onboarding-adult-switch b { font-size: 10px; }

.onboarding-adult-note {
  grid-column: 2 / -1;
  display: flex;
  align-items: center;
  gap: 9px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.onboarding-adult-note i { color: var(--accent); }

.onboarding-source-empty {
  grid-column: 1 / -1;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.onboarding-error {
  margin: 14px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(244, 63, 94, .34);
  border-radius: 10px;
  background: rgba(244, 63, 94, .1);
  color: #fb7185;
  font-size: 12px;
}

.onboarding-actions {
  gap: 12px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.onboarding-actions .btn {
  min-height: 46px;
  padding-inline: 17px;
}

.onboarding-lock {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-right: auto;
  color: var(--muted);
  font-size: 11px;
}

.onboarding-lock i {
  color: var(--accent-2);
}

.onboarding-spin {
  animation: onboarding-spin .8s linear infinite;
}

@keyframes onboarding-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 760px) {
  .onboarding-gate {
    place-items: start center;
    padding: 0;
  }

  .onboarding-panel {
    width: 100%;
    min-height: 100dvh;
    padding: 20px 16px max(18px, env(safe-area-inset-bottom));
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .onboarding-progress {
    margin-top: 24px;
  }

  .onboarding-copy {
    padding: 25px 0 17px;
  }

  .onboarding-copy h1 {
    font-size: 30px;
  }

  .onboarding-fields,
  .onboarding-social-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 13px;
  }

  .onboarding-social-grid label {
    grid-template-columns: 22px 90px minmax(0, 1fr);
  }

  .onboarding-source-list {
    grid-template-columns: minmax(0, 1fr);
    max-height: 330px;
  }

  .onboarding-source-group > div,
  .onboarding-preference-grid,
  .onboarding-theme-options,
  .onboarding-font-options {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .onboarding-adult-mode {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 16px;
    min-height: 0;
    padding: 20px;
  }

  .onboarding-adult-icon { width: 58px; height: 58px; font-size: 24px; }
  .onboarding-adult-copy { grid-column: 1 / -1; grid-row: 2; }
  .onboarding-adult-switch { grid-column: 2; grid-row: 1; }
  .onboarding-adult-note { grid-column: 1 / -1; grid-row: 3; }

  .onboarding-lock {
    display: none;
  }

  .onboarding-actions {
    position: sticky;
    bottom: 0;
    z-index: 2;
    margin: 16px -16px -18px;
    padding: 13px 16px max(14px, env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--panel) 94%, transparent);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }

  .onboarding-actions .primary {
    margin-left: auto;
  }
}

@media (max-width: 520px) {
  .onboarding-progress em { display: none; }
  .onboarding-progress { margin-bottom: 2px; }
}

/* Final responsive corrections */
.community-people-layout,
.community-users-section,
.community-admin-section,
.community-user-grid,
.community-user-rail {
  min-width: 0;
}

.community-admin-section {
  overflow: hidden;
}

.community-user-rail {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  overflow: visible;
  padding-bottom: 0;
}

.community-user-card {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.community-user-card-top,
.community-user-main,
.community-user-identity {
  max-width: 100%;
}

.community-user-main {
  flex: 1 1 auto;
}

.community-user-like {
  align-self: start;
}

.public-profile-page {
  position: relative;
  gap: 14px;
}

.public-profile-page.has-public-background {
  padding: clamp(10px, 2vw, 18px);
  background-attachment: scroll;
}

.public-profile-hero {
  position: relative;
  display: grid;
  min-height: clamp(300px, 34vw, 430px);
  align-items: end;
  isolation: isolate;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--panel);
}

.public-profile-banner {
  position: absolute;
  z-index: -2;
  inset: 0;
  min-height: 0;
  background-color: var(--panel-2);
  background-image: var(--public-banner);
  background-position: center;
  background-size: cover;
  transform: scale(1.01);
}

.public-profile-banner::after {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(3, 3, 7, .8), rgba(3, 3, 7, .28) 62%, rgba(3, 3, 7, .52)),
    linear-gradient(180deg, rgba(3, 3, 7, .08) 25%, rgba(3, 3, 7, .92) 100%);
  content: "";
}

.public-profile-identity {
  position: relative;
  z-index: 1;
  display: grid;
  width: 100%;
  grid-template-columns: 112px minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(14px, 2.5vw, 24px);
  padding: clamp(110px, 18vw, 210px) clamp(18px, 3vw, 34px) clamp(20px, 3vw, 32px);
}

.public-profile-avatar {
  width: 112px;
  height: 112px;
  margin: 0;
  border-color: rgba(255, 255, 255, .72);
  box-shadow: 0 18px 42px rgba(0, 0, 0, .32);
}

.public-profile-main {
  align-self: center;
  padding: 0;
}

.public-profile-main h2,
.public-profile-main .eyebrow {
  color: #fff;
}

.public-profile-handle,
.public-profile-hero .public-profile-joined {
  color: rgba(255, 255, 255, .72);
}

.public-profile-actions {
  align-self: end;
  padding: 0;
}

.public-profile-hero .public-profile-like {
  min-height: 42px;
  border-color: rgba(255, 255, 255, .24);
  background: rgba(8, 8, 13, .58);
  color: #fff;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.public-profile-stats {
  margin: 0;
}

.public-profile-layout {
  align-items: start;
}

.loading-kind-profile .loading-stage {
  padding: clamp(22px, 4vw, 42px);
}

.loading-kind-profile .loading-visual {
  display: grid;
  width: 100%;
  place-items: center;
}

.loading-kind-profile .loading-profile {
  width: min(520px, 100%);
  min-height: 246px;
  margin: 0 auto;
}

@media (max-width: 900px) {
  .community-user-rail {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .community-user-rail > .community-user-card {
    width: 100%;
    flex: initial;
  }

  .public-profile-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .public-profile-about {
    position: static;
    order: -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
  }

  .public-profile-about section {
    min-width: 0;
    padding: 16px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .public-profile-about section:last-child {
    border-right: 0;
  }
}

@media (max-width: 700px) {
  .community-user-grid,
  .community-user-rail {
    grid-template-columns: minmax(0, 1fr);
  }

  .community-user-card {
    min-height: 128px;
  }

  .community-user-card-top,
  .community-user-main {
    display: flex;
  }

  .community-user-like {
    width: auto;
    min-width: 44px;
    padding: 0 10px;
  }

  .community-user-like span {
    display: inline;
  }

  .public-profile-page.has-public-background {
    padding: 8px;
  }

  .public-profile-hero {
    min-height: 344px;
    border-radius: var(--radius-md);
  }

  .public-profile-identity {
    grid-template-columns: 78px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 112px 14px 15px;
  }

  .public-profile-avatar {
    width: 78px;
    height: 78px;
    margin: 0;
  }

  .public-profile-main h2 {
    font-size: clamp(21px, 7vw, 28px);
  }

  .public-profile-actions {
    grid-column: 1 / -1;
    width: 100%;
  }

  .public-profile-like {
    width: 100%;
  }

  .public-profile-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .public-profile-about {
    grid-template-columns: minmax(0, 1fr);
  }

  .public-profile-about section,
  .public-profile-about section:last-child {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .public-profile-about section:last-child {
    border-bottom: 0;
  }

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

  .loading-kind-profile {
    min-height: 458px;
    grid-template-rows: 224px auto 3px;
  }

  .loading-kind-profile .loading-stage {
    min-height: 224px;
    padding: 12px;
  }

  .loading-kind-profile .loading-profile {
    min-height: 196px;
  }

  .notification-stack {
    bottom: calc(78px + env(safe-area-inset-bottom));
    gap: 6px;
  }

  .app-notification {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 9px;
    padding: 10px 38px 11px 10px;
  }

  .notification-icon {
    width: 34px;
    height: 34px;
    font-size: 15px;
  }

  .notification-copy strong {
    font-size: 11px;
  }

  .notification-copy p {
    font-size: 10px;
    line-height: 1.4;
  }

  .notification-action {
    grid-column: 2;
    width: fit-content;
  }
}

/* Keep global media surfaces above the legacy catalog cascade. */
body.global-mode .global-card-media {
  overflow: hidden;
  border-radius: 15px;
}

body.global-mode .global-feature-poster-shell {
  display: block;
  overflow: hidden;
  border-radius: 17px;
}

body.global-mode .global-feature-poster {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 17px;
  object-fit: cover;
}

@media (max-width: 760px) {
  body.global-mode .global-card-media { border-radius: 13px; }
}

/* Expanded global categories stay in the page flow and paginate instead of becoming an endless rail. */
.global-expanded-category {
  min-width: 0;
  padding: 4px 0 30px;
}
.global-expanded-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(255,255,255,.10);
}
.global-expanded-head span { color: #bca2ff; font-size: 9px; font-weight: 800; letter-spacing: .16em; }
.global-expanded-head h2 { margin: 5px 0 0; color: #fff; font-size: clamp(25px, 3vw, 36px); letter-spacing: -.025em; }
.global-expanded-head p { margin: 6px 0 0; color: var(--global-muted, var(--muted)); font-size: 12px; }
.global-expanded-head > strong { color: rgba(255,255,255,.58); font-size: 11px; white-space: nowrap; }
.global-expanded-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 28px 15px;
}
.global-expanded-grid .global-card { min-width: 0; }
.global-expanded-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,.09);
  color: var(--global-muted, var(--muted));
  font-size: 11px;
}
.global-expanded-pagination > div { display: flex; flex-wrap: wrap; gap: 6px; }
.global-expanded-pagination .btn { min-width: 32px; min-height: 32px; padding: 0 9px; }
.global-expanded-pagination .btn.active { border-color: rgba(167,139,250,.6); color: #fff; background: rgba(139,92,246,.25); }

@media (max-width: 1080px) {
  .global-expanded-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .global-expanded-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px 12px; }
}
@media (max-width: 560px) {
  .global-expanded-head { align-items: start; flex-direction: column; gap: 5px; }
  .global-expanded-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 11px; }
  .global-expanded-pagination { align-items: stretch; flex-direction: column; }
  .global-expanded-pagination > div { justify-content: center; }
}

/* The global header is a surface boundary, not a framed card. */
body.global-mode .hero {
  border: 0 !important;
  border-bottom: 0 !important;
  border-radius: 0 !important;
}
body.global-mode .hero .topbar { border: 0 !important; outline: 0 !important; }

/* Miraku global navigation is a compact top dock; the legacy floating dock stays for source mode only. */
body.global-mode { padding-bottom: 0 !important; }
body.global-mode .bottom-nav { display: none !important; }
body.global-mode .hero .topbar { width: min(1480px, calc(100% - 44px)); }
.global-topbar-nav:not([hidden]) {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  padding: 4px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 999px;
  background: rgba(12,13,18,.72);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 10px 28px rgba(0,0,0,.16);
  backdrop-filter: blur(18px) saturate(135%);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
}
.global-topbar-link { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 6px 12px; }
.global-topbar-link i { color: rgba(255,255,255,.52); font-size: 11px; }
.global-topbar-link.active i, .global-topbar-link:hover i, .global-topbar-link:focus-visible i { color: #d6c5ff; }
.global-topbar-actions:not([hidden]) { margin-left: 20px; }
.global-topbar-adult,
.global-topbar-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 999px;
  background: rgba(255,255,255,.07);
  color: rgba(255,255,255,.86);
  font-size: 12px;
  font-weight: 750;
}
.global-topbar-adult i { color: #bca2ff; }
.global-topbar-login { min-width: 67px; border-color: rgba(139,92,246,.7); background: #7c4dff; color: #fff; }
.global-topbar-login:hover, .global-topbar-login:focus-visible { background: #9069ff; }
body.global-mode.theme-glass .global-topbar-nav:not([hidden]) { border-color: rgba(255,255,255,.72); background: rgba(255,255,255,.54); box-shadow: 0 12px 32px rgba(68,74,92,.12), inset 0 1px 0 rgba(255,255,255,.92); }
body.global-mode.theme-glass .global-topbar-link { color: rgba(28,32,48,.68); }
body.global-mode.theme-glass .global-topbar-link.active { background: rgba(255,255,255,.72); color: #1c2030; }
body.global-mode.theme-glass .global-topbar-link i { color: #7351c8; }
body.global-mode.theme-glass .global-topbar-adult { color: #283047; background: rgba(255,255,255,.45); border-color: rgba(255,255,255,.75); }

@media (max-width: 760px) {
  body.global-mode .hero .topbar { width: calc(100% - 28px); }
  body.global-mode .global-topbar-actions:not([hidden]) { margin-left: auto; gap: 5px; }
  body.global-mode .global-topbar-adult { display: none; }
  body.global-mode .global-topbar-login { min-width: 58px; padding-inline: 10px; }
}

/* Miraku route surfaces: home, search, detail and watch share one visual language. */
body.global-mode #catalogHomeSlot #catalogMainContent { display: none; }
body.global-mode #searchPageSlot #catalogMainContent { display: block; }

.search-page {
  position: relative;
  min-height: calc(100vh - 130px);
  padding-bottom: 80px;
}

.search-heading {
  align-items: end;
  margin-bottom: 22px;
}

.search-heading p {
  max-width: 620px;
  margin: 8px 0 0;
  color: var(--global-muted, var(--muted));
  font-size: 13px;
  line-height: 1.55;
}

.search-page-intro {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  padding: 18px 20px;
  border: 1px solid var(--global-edge, var(--line));
  border-radius: 18px;
  background: linear-gradient(125deg, rgba(255,255,255,.085), transparent 58%), var(--global-glass, var(--surface));
  box-shadow: 0 18px 50px rgba(0,0,0,.12), inset 0 1px 0 rgba(255,255,255,.11);
}

.search-page-icon {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 1px solid rgba(167,139,250,.42);
  border-radius: 16px;
  color: #c7afff;
  background: rgba(139,92,246,.15);
  font-size: 21px;
}

.search-page-intro small,
.global-panel-head small,
.global-player-kicker {
  color: #bca2ff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .16em;
}

.search-page-intro h3 { margin: 3px 0 3px; font-size: 18px; }
.search-page-intro p { margin: 0; color: var(--global-muted, var(--muted)); font-size: 12px; }
body.global-mode .search-page .catalog-controls {
  margin-top: 0;
  border-color: var(--global-edge);
  background: linear-gradient(145deg, rgba(255,255,255,.10), transparent 38%), var(--global-glass);
}

.global-detail-page,
.global-player-page {
  position: relative;
  isolation: isolate;
  width: min(1240px, 100%);
  min-height: calc(100vh - 120px);
  margin: 0 auto;
  overflow: hidden;
  color: var(--global-ink, var(--ink));
}

.global-detail-backdrop {
  position: absolute;
  z-index: -3;
  inset: -8% -7% 30%;
  background: var(--global-detail-backdrop) center / cover no-repeat;
  filter: saturate(.9) contrast(1.05);
  opacity: .58;
  transform: scale(1.04);
}

.global-detail-shade {
  position: absolute;
  z-index: -2;
  inset: 0;
  background: linear-gradient(180deg, rgba(6,7,11,.58), rgba(6,7,11,.79) 34%, var(--bg) 66%), linear-gradient(90deg, rgba(6,7,11,.9), transparent 70%);
}

.global-detail-nav,
.global-player-brandbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 58px;
  margin-bottom: 20px;
}

.global-detail-brand,
.global-player-brandbar > span {
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .02em;
}

.global-detail-brand i,
.global-player-brandbar > span i { margin-right: 7px; color: #a78bfa; }
.global-detail-provider { color: var(--global-muted, var(--muted)); font-size: 11px; }

.global-detail-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(180px, 235px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(24px, 5vw, 68px);
  min-height: 460px;
  padding: 26px 0 48px;
}

.global-detail-poster-shell {
  width: min(235px, 100%);
  justify-self: center;
  filter: drop-shadow(0 22px 38px rgba(0,0,0,.42));
}

.global-detail-poster-shell .poster,
.global-detail-poster-shell .cover-fallback,
.global-detail-poster { display: block; width: 100%; aspect-ratio: 2 / 3; border-radius: 18px; object-fit: cover; }
.global-detail-copy { max-width: 720px; }
.global-detail-kicker { color: rgba(255,255,255,.68); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.global-detail-copy h1 { max-width: 820px; margin: 10px 0 0; color: #fff; font-size: clamp(38px, 6vw, 76px); line-height: .98; letter-spacing: -.025em; }
.global-detail-original { margin: 10px 0 0; color: rgba(255,255,255,.58); font-size: 14px; }
.global-detail-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.global-detail-tags span { padding: 7px 11px; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; color: rgba(255,255,255,.82); background: rgba(255,255,255,.075); font-size: 11px; }
.global-detail-tags .global-detail-audio { border-color: rgba(196,181,253,.5); color: #e9ddff; background: rgba(139,92,246,.27); font-weight: 800; }
.global-detail-tags .global-detail-audio.is-latino { border-color: rgba(52,211,153,.52); color: #b7f7dc; background: rgba(16,185,129,.2); }
.global-detail-summary { max-width: 680px; margin: 22px 0 0; color: rgba(245,246,252,.76); font-size: 14px; line-height: 1.7; }
.global-detail-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 24px; }
.global-detail-actions .btn { min-height: 42px; border-radius: 12px; }
.global-detail-coverage { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 20px; color: rgba(255,255,255,.56); font-size: 11px; }
.global-detail-coverage i { margin-right: 6px; color: #b197ff; }

.global-detail-lower {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, .75fr);
  align-items: start;
  gap: 18px;
  padding-bottom: 70px;
}

.global-detail-panel {
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 18px;
  background: linear-gradient(140deg, rgba(255,255,255,.075), transparent 50%), rgba(13,15,23,.68);
  box-shadow: 0 22px 60px rgba(0,0,0,.17), inset 0 1px 0 rgba(255,255,255,.09);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.global-panel-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; padding: 20px 20px 16px; border-bottom: 1px solid rgba(255,255,255,.09); }
.global-panel-head h2 { margin: 4px 0 0; color: #fff; font-size: 22px; }
.global-panel-head p { margin: 5px 0 0; color: var(--global-muted); font-size: 11px; }
.global-panel-head > strong { color: rgba(255,255,255,.55); font-size: 11px; white-space: nowrap; }
.global-season-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 14px 20px 0; scrollbar-width: none; }
.global-season-tabs::-webkit-scrollbar { display: none; }
.global-season-tab { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px; border: 1px solid rgba(255,255,255,.11); border-radius: 10px; color: rgba(255,255,255,.62); background: rgba(255,255,255,.04); white-space: nowrap; }
.global-season-tab b { color: #c4b5fd; font-size: 10px; }
.global-season-tab.active { border-color: rgba(167,139,250,.55); color: #fff; background: rgba(139,92,246,.21); }
.global-episode-list { display: grid; gap: 1px; padding: 10px 10px 14px; }
.global-episode-row { display: grid; grid-template-columns: 108px minmax(0, 1fr) 24px; align-items: center; gap: 13px; width: 100%; padding: 9px; border: 0; border-radius: 12px; color: #fff; text-align: left; background: transparent; }
.global-episode-row:hover, .global-episode-row:focus-visible { background: rgba(255,255,255,.075); }
.global-episode-row[hidden] { display: none; }
.global-episode-thumb { display: block; width: 108px; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 9px; background: rgba(255,255,255,.07); }
.global-episode-thumb img, .global-episode-thumb .episode-thumb, .global-episode-thumb .episode-thumb-fallback { width: 100%; height: 100%; object-fit: cover; }
.global-episode-copy { display: grid; min-width: 0; gap: 4px; }
.global-episode-copy b { color: #c4b5fd; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.global-episode-copy strong { overflow: hidden; color: #fff; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.global-episode-copy small { color: var(--global-muted); font-size: 11px; }
.global-episode-row > i { color: #a78bfa; font-size: 18px; }
.global-inline-empty { display: grid; place-items: center; gap: 8px; min-height: 150px; color: var(--global-muted); font-size: 12px; text-align: center; }
.global-inline-empty i { color: #b197ff; font-size: 25px; }
.global-content-trailer { grid-column: 1 / -1; display: grid; gap: 12px; margin: 3px 6px 8px; padding: 14px; border: 1px solid rgba(167,139,250,.24); border-radius: 14px; background: linear-gradient(135deg, rgba(139,92,246,.12), rgba(255,255,255,.035)); }
.global-content-trailer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.global-content-trailer-head small { color: #bca2ff; font-size: 9px; font-weight: 800; letter-spacing: .14em; }
.global-content-trailer-head h3 { margin: 4px 0 0; color: #fff; font-size: 16px; }
.global-trailer-frame { width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 10px; background: #050507; }
.global-trailer-frame iframe, .global-trailer-frame video { display: block; width: 100%; height: 100%; border: 0; object-fit: contain; }
.global-trailer-link { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 70px; border: 1px solid rgba(167,139,250,.22); border-radius: 10px; color: #d9ccff; background: rgba(139,92,246,.08); text-decoration: none; }
.global-trailer-link i { color: #b197ff; font-size: 18px; }
.global-detail-aside { display: grid; gap: 18px; position: sticky; top: 20px; }
.global-facts-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; padding: 10px; }
.global-facts-grid > div { display: grid; gap: 4px; min-height: 88px; padding: 12px; border-radius: 11px; background: rgba(255,255,255,.035); }
.global-facts-grid i { color: #b197ff; font-size: 15px; }
.global-facts-grid small { color: var(--global-muted); font-size: 10px; }
.global-facts-grid strong { overflow: hidden; color: #fff; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.global-source-list { display: flex; flex-wrap: wrap; gap: 8px; padding: 16px; }
.global-source-chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 10px; border: 1px solid rgba(255,255,255,.12); border-radius: 9px; color: rgba(255,255,255,.72); background: rgba(255,255,255,.05); font-size: 10px; }
.global-source-chip i { color: #b197ff; }

.global-player-page { padding-bottom: 60px; }
.global-player-brandbar { margin-bottom: 10px; }
.global-player-page .episode-nav { margin-bottom: 12px; }
.global-player-page .episode-head { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 18px; padding: 0; border: 0; }
.global-player-page .episode-head h2 { margin: 5px 0 0; color: #fff; font-size: clamp(24px, 4vw, 42px); }
.global-player-page .episode-title-line { display: block; margin-top: 5px; color: var(--global-muted); }
.global-player-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; align-items: start; gap: 18px; }
.global-player-main { min-width: 0; }
.global-player-main .player-container { min-height: min(68vh, 680px); border: 1px solid rgba(255,255,255,.13); border-radius: 18px; background: #050609; box-shadow: 0 26px 70px rgba(0,0,0,.38); }
.global-player-main .player-container iframe, .global-player-main .player-container video { border-radius: 17px; }
.global-player-main .servers-container { margin-top: 14px; border: 1px solid rgba(255,255,255,.1); border-radius: 16px; background: rgba(255,255,255,.045); }
.global-player-queue { position: sticky; top: 20px; max-height: min(720px, calc(100vh - 40px)); overflow: hidden; border: 1px solid rgba(255,255,255,.12); border-radius: 17px; background: rgba(13,15,23,.72); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.global-player-queue > header { padding: 17px; border-bottom: 1px solid rgba(255,255,255,.09); }
.global-player-queue > header small { color: #bca2ff; font-size: 9px; font-weight: 800; letter-spacing: .14em; }
.global-player-queue > header h3 { margin: 4px 0 2px; color: #fff; font-size: 17px; }
.global-player-queue > header span { color: var(--global-muted); font-size: 11px; }
.global-queue-list { max-height: 590px; overflow-y: auto; padding: 8px; }
.global-queue-row { display: grid; grid-template-columns: 76px minmax(0, 1fr) 16px; align-items: center; gap: 9px; width: 100%; padding: 7px; border: 1px solid transparent; border-radius: 10px; color: #fff; text-align: left; background: transparent; }
.global-queue-row:hover, .global-queue-row.active { border-color: rgba(167,139,250,.4); background: rgba(139,92,246,.14); }
.global-queue-thumb { display: block; width: 76px; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 7px; }
.global-queue-thumb img, .global-queue-thumb .episode-thumb, .global-queue-thumb .episode-thumb-fallback { width: 100%; height: 100%; object-fit: cover; }
.global-queue-row > span:not(.global-queue-thumb) { display: grid; min-width: 0; gap: 4px; }
.global-queue-row b { color: #c4b5fd; font-size: 9px; }
.global-queue-row strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.global-queue-row > i { color: #a78bfa; }
.global-player-context { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 14px; padding: 14px 16px; border: 1px solid rgba(255,255,255,.1); border-radius: 13px; color: var(--global-muted); background: rgba(255,255,255,.04); font-size: 11px; }
.global-player-context i { margin-right: 6px; color: #b197ff; }

body.global-mode.theme-glass .global-detail-shade { background: linear-gradient(180deg, rgba(255,255,255,.16), rgba(244,247,255,.8) 64%, rgba(239,242,250,.96)); }
body.global-mode.theme-glass .global-detail-copy h1,
body.global-mode.theme-glass .global-detail-brand,
body.global-mode.theme-glass .global-player-brandbar > span,
body.global-mode.theme-glass .global-panel-head h2,
body.global-mode.theme-glass .global-episode-copy strong,
body.global-mode.theme-glass .global-facts-grid strong { color: #1c2030; }
body.global-mode.theme-glass .global-detail-summary,
body.global-mode.theme-glass .global-detail-kicker,
body.global-mode.theme-glass .global-detail-original,
body.global-mode.theme-glass .global-detail-coverage,
body.global-mode.theme-glass .global-panel-head p,
body.global-mode.theme-glass .global-panel-head > strong,
body.global-mode.theme-glass .global-episode-copy small,
body.global-mode.theme-glass .global-facts-grid small { color: rgba(28,32,48,.68); }
body.global-mode.theme-glass .global-detail-panel,
body.global-mode.theme-glass .global-player-queue { border-color: rgba(255,255,255,.78); background: rgba(255,255,255,.48); box-shadow: 0 20px 55px rgba(71,79,102,.14), inset 0 1px 0 rgba(255,255,255,.9); }
body.global-mode.theme-glass .global-player-main .player-container { border-color: rgba(255,255,255,.82); }
body.global-mode.theme-glass .global-detail-tags span,
body.global-mode.theme-glass .global-source-chip,
body.global-mode.theme-glass .global-player-context { color: rgba(28,32,48,.76); border-color: rgba(255,255,255,.78); background: rgba(255,255,255,.36); }

/* Detail pages use the available desktop canvas and keep episode density under control. */
body.global-mode .global-detail-page,
body.global-mode .global-player-page { width: min(1500px, calc(100vw - 72px)); }
body.global-mode .global-detail-hero { grid-template-columns: minmax(220px, 270px) minmax(0, 1fr); gap: clamp(34px, 6vw, 92px); min-height: 520px; }
body.global-mode .global-detail-copy { max-width: 900px; }
body.global-mode .global-detail-lower { grid-template-columns: minmax(0, 1.8fr) minmax(300px, .72fr); gap: 26px; }
.global-episodes-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px 4px; }
.global-episode-page-count { color: var(--global-muted); font-size: 11px; }
.global-episode-list.is-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 14px 16px 18px; }
.global-episode-list.is-grid .global-episode-row { grid-template-columns: minmax(0, 1fr) 24px; align-items: end; gap: 8px; padding: 0 0 10px; }
.global-episode-list.is-grid .global-episode-thumb { width: 100%; aspect-ratio: 16 / 8.5; grid-column: 1 / -1; }
.global-episode-list.is-grid .global-episode-copy strong { white-space: normal; line-height: 1.3; }
.global-episode-list.is-grid .global-episode-copy small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.global-episode-list.is-grid .global-episode-row > i { align-self: end; }
.global-episode-pagination { padding: 0 16px 18px; }
.server-language-tabs { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 10px; }
.server-language-tab { min-height: 34px; padding: 0 12px; border-radius: 999px; color: var(--muted); background: color-mix(in srgb, var(--panel) 74%, transparent); }
.server-language-tab.active { color: var(--text); border-color: color-mix(in srgb, #8b5cf6 58%, var(--line)); background: color-mix(in srgb, #8b5cf6 18%, var(--panel)); }

@media (max-width: 760px) {
  body.global-mode .global-detail-page,
  body.global-mode .global-player-page { width: 100%; }
  body.global-mode .global-detail-hero { grid-template-columns: 96px minmax(0, 1fr); gap: 16px; min-height: 0; }
  .global-episodes-toolbar { align-items: flex-start; flex-direction: column; padding-inline: 14px; }
  .global-episode-list.is-grid { grid-template-columns: minmax(0, 1fr); padding-inline: 12px; }
}

@media (max-width: 900px) {
  .global-detail-lower { grid-template-columns: minmax(0, 1fr); }
  .global-detail-aside { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .global-player-layout { grid-template-columns: minmax(0, 1fr); }
  .global-player-queue { position: static; max-height: none; }
  .global-queue-list { max-height: 390px; }
}

@media (max-width: 640px) {
  .search-page-intro { grid-template-columns: 44px minmax(0, 1fr); padding: 14px; }
  .search-page-icon { width: 44px; height: 44px; border-radius: 13px; font-size: 17px; }
  .global-detail-page, .global-player-page { width: 100%; }
  .global-detail-nav, .global-player-brandbar { min-height: 48px; margin-bottom: 8px; }
  .global-detail-provider { display: none; }
  .global-detail-hero { grid-template-columns: 96px minmax(0, 1fr); gap: 16px; min-height: 0; padding: 18px 0 30px; }
  .global-detail-poster-shell { width: 96px; align-self: start; }
  .global-detail-poster-shell .poster, .global-detail-poster-shell .cover-fallback, .global-detail-poster { border-radius: 12px; }
  .global-detail-copy h1 { font-size: clamp(27px, 9vw, 42px); }
  .global-detail-kicker { font-size: 9px; letter-spacing: .06em; }
  .global-detail-tags { gap: 5px; margin-top: 11px; }
  .global-detail-tags span { padding: 5px 8px; font-size: 9px; }
  .global-detail-summary { grid-column: 1 / -1; margin-top: 5px; font-size: 12px; line-height: 1.55; }
  .global-detail-actions { grid-column: 1 / -1; margin-top: 12px; }
  .global-detail-actions .btn { flex: 1; min-width: 0; padding-inline: 10px; font-size: 11px; }
  .global-detail-coverage { grid-column: 1 / -1; margin-top: 10px; font-size: 10px; }
  .global-detail-aside { grid-template-columns: minmax(0, 1fr); }
  .global-panel-head { padding: 15px; }
  .global-panel-head h2 { font-size: 18px; }
  .global-episode-row { grid-template-columns: 88px minmax(0, 1fr) 18px; gap: 9px; padding: 7px; }
  .global-episode-thumb { width: 88px; }
  .global-episode-copy strong { font-size: 12px; }
  .global-player-page .episode-head { align-items: start; flex-direction: column; gap: 10px; }
  .global-player-page .episode-check-btn { width: 100%; }
  .global-player-main .player-container { min-height: 52vh; border-radius: 12px; }
  .global-player-main .player-container iframe, .global-player-main .player-container video { border-radius: 11px; }
}

/* Global navigation refinements: route-aware, compact on mobile, and explicit adult switch. */
body.global-mode .hero .topbar {
  width: min(1480px, calc(100% - 44px));
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
}

body.global-mode .global-topbar-nav:not([hidden]) {
  display: flex;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

body.global-mode .global-topbar-nav::-webkit-scrollbar { display: none; }
body.global-mode .global-topbar-link { white-space: nowrap; }
body.global-mode .global-topbar-adult {
  gap: 7px;
  min-width: 66px;
  border-color: rgba(255,255,255,.14);
}

body.global-mode .global-adult-switch {
  display: inline-flex;
  width: 27px;
  height: 16px;
  align-items: center;
  padding: 2px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  transition: background .2s ease, border-color .2s ease;
}

body.global-mode .global-adult-switch > span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,.78);
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
  transition: transform .2s ease, background .2s ease;
}

body.global-mode .global-topbar-adult.is-active {
  border-color: #ef4444;
  color: #fecaca;
  box-shadow: 0 0 0 1px rgba(239,68,68,.22), 0 0 18px rgba(239,68,68,.16);
}

body.global-mode .global-topbar-adult.is-active .global-adult-switch {
  border-color: rgba(239,68,68,.7);
  background: #ef4444;
}

body.global-mode .global-topbar-adult.is-active .global-adult-switch > span {
  background: #fff;
  transform: translateX(10px);
}

body.global-mode .global-spotlight-content h1 {
  max-width: min(62vw, 720px);
  font-size: clamp(34px, 4.2vw, 62px);
  letter-spacing: -.035em;
}

body.global-mode .global-spotlight-content h1.is-long-title {
  max-width: min(56vw, 610px);
  font-size: clamp(29px, 3.35vw, 49px);
  line-height: 1.04;
}

body.global-mode .global-spotlight-poster {
  right: clamp(38px, 8vw, 110px);
  bottom: 24px;
  width: clamp(145px, 15vw, 220px);
  opacity: .96;
  transform: rotate(3deg);
}

body.global-mode .global-feature-poster-shell,
body.global-mode .global-feature-poster {
  border-radius: 20px;
  box-shadow: 0 24px 50px rgba(0,0,0,.34), 0 0 0 1px rgba(255,255,255,.15);
}

@media (max-width: 760px) {
  body.global-mode .hero .topbar { width: calc(100% - 20px); min-height: 62px; gap: 7px; }
  body.global-mode .global-topbar-nav:not([hidden]) { flex: 1; justify-content: flex-start; }
  body.global-mode .global-topbar-link { width: 36px; min-width: 36px; justify-content: center; padding-inline: 0; }
  body.global-mode .global-topbar-link span { display: none; }
  body.global-mode .global-topbar-actions:not([hidden]) { margin-left: 0; gap: 5px; }
  body.global-mode .global-topbar-icon { width: 36px; min-width: 36px; }
  body.global-mode .global-topbar-adult { display: inline-flex !important; min-width: 58px; padding-inline: 8px; }
  body.global-mode .global-topbar-login { min-width: 58px; padding-inline: 9px; }
  body.global-mode .global-spotlight-poster { top: 24px; right: 18px; bottom: auto; width: 100px; }
body.global-mode .global-spotlight-content h1,
body.global-mode .global-spotlight-content h1.is-long-title { max-width: 90%; font-size: clamp(29px, 8.5vw, 45px); }
}

/* Global rails: actions belong to the artwork, while navigation stays separate. */
.global-card-media { isolation: isolate; }

.global-card-hit {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: inherit;
  text-align: inherit;
}

.global-card-actions {
  top: auto;
  right: auto;
  bottom: 9px;
  left: 9px;
  z-index: 5;
  gap: 5px;
}

.global-card-actions .btn {
  border-color: rgba(255, 255, 255, .24);
  background: rgba(8, 9, 14, .76);
  box-shadow: 0 5px 14px rgba(0, 0, 0, .22), inset 0 1px 0 rgba(255, 255, 255, .12);
  backdrop-filter: blur(12px) saturate(130%);
  -webkit-backdrop-filter: blur(12px) saturate(130%);
}

.global-rail-head-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
}

.global-rail-head-actions .btn {
  width: 34px;
  min-width: 34px;
  min-height: 34px;
  border-color: rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .07);
  color: rgba(255, 255, 255, .82);
}

.global-rail-head-actions .global-rail-load-more {
  border-color: rgba(166, 124, 255, .35);
  background: rgba(139, 92, 246, .15);
  color: #cebaff;
}

.global-rail-head-actions .btn:disabled { cursor: not-allowed; opacity: .38; }

.global-rail-track {
  touch-action: pan-x;
  overscroll-behavior-x: contain;
}

@media (max-width: 760px) {
  .global-spotlight-backdrop {
    background-image: var(--global-spotlight-mobile-image, var(--global-spotlight-image));
    background-position: center top;
    background-size: cover;
    filter: saturate(1.08) contrast(1.03);
    opacity: .38;
  }

  .global-spotlight-backdrop::after {
    background-image: var(--global-spotlight-mobile-image, var(--global-spotlight-image));
    background-position: center top;
    background-size: contain;
    background-repeat: no-repeat;
    filter: saturate(1.04) contrast(1.02);
    opacity: .84;
  }

  .global-spotlight-shade {
    background: linear-gradient(180deg, rgba(6, 7, 11, .10) 0%, rgba(6, 7, 11, .25) 30%, rgba(6, 7, 11, .70) 62%, rgba(6, 7, 11, .98) 86%, #06070b 100%);
  }

  .global-spotlight-content { min-height: 585px; justify-content: end; padding-top: 265px; }
  .global-spotlight-poster { display: none; }
  .global-rail-head-actions .btn { width: 32px; min-width: 32px; min-height: 32px; }
  .global-card-actions { opacity: 1; transform: none; }
}

/* The topbar is navigation, never a framed panel, in any theme or initial state. */
.hero,
.hero .topbar {
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
}
.hero::before,
.hero::after,
.hero .topbar::before,
.hero .topbar::after {
  display: none !important;
  content: none !important;
}
body.global-mode .global-topbar-login.is-profile {
  background: rgba(255,255,255,.10);
  border-color: rgba(255,255,255,.20);
}
body.global-mode.theme-glass .global-topbar-login.is-profile {
  background: rgba(255,255,255,.66);
  border-color: rgba(100,83,170,.24);
  color: #29203f;
}

/* Wide media workspace: details and playback should use the desktop canvas. */
#routeTab #pageRoot { width: 100%; }
.media-detail-page,
.episode-page { width: min(1560px, calc(100vw - 72px)); }
.media-detail-page.has-backdrop { padding-top: clamp(210px, 22vw, 360px); }
.media-detail-hero { grid-template-columns: minmax(220px, 285px) minmax(0, 1fr) minmax(290px, 350px); gap: clamp(30px, 4vw, 78px); align-items: center; }
.media-poster-shell { width: min(285px, 100%); }
.media-detail-content { max-width: 930px; }
.media-page-title { max-width: 950px; font-size: clamp(38px, 4.6vw, 76px); }
.media-detail-body { grid-template-columns: minmax(0, 1.72fr) minmax(320px, .68fr); gap: 34px; margin-top: 52px; }
.episodes-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.episodes-grid.episodes-list { grid-template-columns: minmax(0, 1fr); }
.episodes-toolbar { margin-bottom: 12px; }
.episode-page { max-width: 1560px; }
.episode-page .global-player-layout { grid-template-columns: minmax(0, 1fr) 330px; gap: 26px; }
.episode-page .player-container { min-height: min(72vh, 820px); }
.episode-page .servers-container { margin-top: 18px; }
.server-choice { display: flex; min-width: 0; gap: 6px; }
.server-choice > [data-server] { min-width: 0; flex: 1; }

@media (max-width: 1180px) {
  .media-detail-page,
  .episode-page { width: min(100%, calc(100vw - 36px)); }
  .media-detail-hero { grid-template-columns: minmax(190px, 230px) minmax(0, 1fr); gap: 28px; }
  .media-poster-shell { width: min(230px, 100%); }
  .media-facts { grid-column: 1 / -1; }
  .media-detail-body { grid-template-columns: minmax(0, 1fr); }
  .media-trailer-panel { position: static; }
  .episodes-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .episode-page .global-player-layout { grid-template-columns: minmax(0, 1fr) 280px; }
}

@media (max-width: 700px) {
  .media-detail-page,
  .episode-page { width: 100%; }
  .media-detail-page.has-backdrop { padding-top: 185px; }
  .media-detail-hero { grid-template-columns: 118px minmax(0, 1fr); gap: 14px; }
  .media-poster-shell { width: 118px; }
  .media-page-title { font-size: clamp(27px, 9vw, 42px); }
  .episodes-grid,
  .episodes-grid.episodes-list { grid-template-columns: minmax(0, 1fr); }
  .episode-page .global-player-layout { grid-template-columns: minmax(0, 1fr); }
  .episode-page .player-container { min-height: 52vh; }
}

/* Final cascade guard for the Miraku shell and responsive player. */
body.global-mode > .hero,
body.global-mode > .hero .topbar {
  border: 0 !important;
  border-top: 0 !important;
  border-right: 0 !important;
  border-bottom: 0 !important;
  border-left: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  background-clip: padding-box !important;
}

html body.global-mode > .hero.app-shell,
html body.global-mode > .hero.app-shell .topbar {
  background: transparent !important;
  border-color: transparent !important;
}

html body.global-mode > .hero.app-shell {
  padding: 0 !important;
}

.brand-home .miraku-mark::before,
.brand-home .miraku-mark::after {
  display: none !important;
  content: none !important;
  border: 0 !important;
  box-shadow: none !important;
}

.brand-home .miraku-mark,
body.global-mode .brand-home .miraku-mark {
  width: 38px !important;
  height: 38px !important;
  flex: 0 0 38px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.brand-home .miraku-logo {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 0 7px rgba(167, 126, 255, .34));
  animation: miraku-logo-glow 3.8s ease-in-out infinite;
}

.brand-home h1 { margin: 0; color: #f7f4ff; font-size: 18px; line-height: 1; }

/* The backdrop gets a blurred cover fill plus a complete, contained artwork layer. */
body.global-mode .global-spotlight-backdrop {
  background: transparent !important;
  filter: none !important;
  transform: none !important;
}

body.global-mode .global-spotlight-backdrop::before,
body.global-mode .global-spotlight-backdrop::after {
  position: absolute;
  content: "";
  pointer-events: none;
  background-image: var(--global-spotlight-image);
  background-repeat: no-repeat;
}

body.global-mode .global-spotlight-backdrop::before {
  inset: -8%;
  background-position: center;
  background-size: cover;
  filter: blur(26px) saturate(.9);
  opacity: .42;
  transform: scale(1.08);
}

body.global-mode .global-spotlight-backdrop::after {
  inset: 0;
  background-position: center right;
  background-size: contain;
  filter: saturate(1.06) contrast(1.02);
  opacity: .56;
}

body.global-mode .global-spotlight-poster {
  right: clamp(34px, 6vw, 100px) !important;
  bottom: 22px !important;
  width: clamp(155px, 16vw, 238px) !important;
  transform: rotate(2deg) !important;
}

body.global-mode .global-feature-poster { object-fit: cover; background: transparent; }

body.global-mode .global-spotlight-poster .global-feature-poster-shell {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border: 0;
  border-radius: 17px;
  background: transparent;
}

body.global-mode .global-spotlight-poster .global-feature-poster {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 100%;
  aspect-ratio: auto;
  border: 0;
  object-fit: cover;
  background: transparent;
}

/* Search must expose the actual query and filter controls on its own route. */
.search-page #searchPageSlot,
.search-page #catalogMainContent,
body.global-mode .search-page #catalogMainContent,
body.global-mode #searchPageSlot #catalogMainContent {
  display: block !important;
  width: 100%;
  min-width: 0;
  visibility: visible !important;
}

.search-page .catalog-controls { display: block; margin-top: 0; padding: 14px; }
.search-page .search-filter-panel { grid-template-columns: minmax(0, 1fr); gap: 12px; margin: 0; padding: 0; border: 0; background: transparent; }
.search-page .search-filter-panel .filters { grid-template-columns: repeat(4, minmax(120px, 1fr)); gap: 8px; padding: 0; }
.search-page .catalog-toolbar { margin-top: 12px; padding: 0; border-top: 1px solid var(--global-edge, var(--line)); }

/* Embeds stay inside a predictable 16:9 frame; the queue no longer creates a second page. */
.episode-page .global-player-layout { grid-template-columns: minmax(0, 1.45fr) minmax(280px, 320px) !important; gap: 24px; }
.episode-page:not(.global-player-page) .global-player-layout { grid-template-columns: minmax(0, 1fr) !important; }
.global-player-main .player-container,
.episode-page .player-container {
  width: 100%;
  height: auto;
  min-height: 0 !important;
  max-height: none;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 16px;
}
.global-player-main .player-container iframe,
.global-player-main .player-container video,
.episode-page .player-container iframe,
.episode-page .player-container video {
  display: block;
  width: 100% !important;
  height: 100% !important;
  min-width: 0;
  min-height: 0;
  border: 0;
  object-fit: contain;
}
.global-player-page .episode-head h2 { max-width: min(920px, 100%); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.global-player-page .player-toolbar { display: flex; justify-content: flex-end; gap: 7px; margin: 0 0 10px; }
.global-player-page .player-external-fallback { min-height: 0; justify-content: flex-start; margin: 8px 0 0; }
.global-player-page .player-external-fallback-link { border-radius: 999px; background: rgba(255,255,255,.05); }
.episode-page .servers-container { margin-top: 14px; padding: 12px; border-radius: 15px; overflow: hidden; }
.global-player-queue { max-height: min(650px, calc(100vh - 40px)); }
.global-queue-list { max-height: 520px; }

@media (max-width: 1180px) {
  .search-page .search-filter-panel .filters { grid-template-columns: repeat(3, minmax(120px, 1fr)); }
  .episode-page .global-player-layout { grid-template-columns: minmax(0, 1fr) 280px !important; }
}

@media (max-width: 900px) {
  .episode-page .global-player-layout { grid-template-columns: minmax(0, 1fr) !important; }
  .global-player-queue { position: static; max-height: 480px; }
  .global-queue-list { max-height: 350px; }
}

@media (max-width: 760px) {
  body.global-mode > .hero .topbar { width: calc(100% - 20px); min-height: 60px; }
  body.global-mode .brand-home .miraku-mark { width: 34px !important; height: 34px !important; flex-basis: 34px !important; }
  body.global-mode .brand-home h1 { font-size: 17px; }
  .search-page .search-filter-panel .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search-page .search-filter-panel .filters select { width: 100%; min-width: 0; }
  body.global-mode .global-spotlight-backdrop::before,
  body.global-mode .global-spotlight-backdrop::after {
    background-image: var(--global-spotlight-mobile-image, var(--global-spotlight-image));
    background-position: center top;
    background-size: cover;
  }
  body.global-mode .global-spotlight-backdrop::before { opacity: .34; }
  body.global-mode .global-spotlight-backdrop::after { opacity: .62; }
  body.global-mode .global-spotlight-poster { display: none; }
  .global-player-page .episode-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
  .global-player-page .episode-nav .btn { min-width: 0; padding-inline: 8px; }
  .global-player-page .episode-nav .btn span { display: none; }
  .global-player-page .episode-head { align-items: flex-start; gap: 10px; }
  .global-player-page .episode-head h2 { max-width: 100%; font-size: clamp(23px, 7vw, 34px); white-space: normal; }
  .global-player-page .episode-check-btn { width: auto; max-width: 100%; }
  .global-player-page .player-toolbar { justify-content: flex-start; }
  .global-player-main .player-container, .episode-page .player-container { border-radius: 12px; }
  .episode-page .servers-container { padding: 9px; }
  .server-language-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .server-language-tabs::-webkit-scrollbar { display: none; }
}

/* Terminal cascade for full-width global routes and full-page backdrops. */
html body.global-mode > .hero,
html body.global-mode > .hero .topbar,
html body.global-mode > .hero .topbar::before,
html body.global-mode > .hero .topbar::after {
  width: min(1480px, calc(100% - 32px)) !important;
  max-width: none !important;
  margin-inline: auto !important;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
}
body.global-mode main.app.app-shell.container-xxl,
body.global-mode main.app.app-shell,
body.global-mode #catalogTab,
body.global-mode #searchTab,
body.global-mode #routeTab,
body.global-mode .global-catalog-view,
body.global-mode .global-catalog-rails,
body.global-mode .global-detail-page,
body.global-mode .global-player-page {
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
}
body.global-mode main.app.app-shell.container-xxl { margin-inline: 0 !important; padding-inline: clamp(16px, 3.2vw, 64px) !important; }
body.global-mode .global-detail-page,
body.global-mode .global-player-page { min-height: calc(100vh - 86px); margin-inline: auto !important; }
#routeTab.has-route-backdrop::before,
#routeTab.has-route-backdrop::after { position: fixed !important; inset: 0 !important; width: 100vw !important; height: 100vh !important; max-height: none !important; background-position: center center !important; z-index: -2 !important; }
#routeTab.has-route-backdrop::before { background-size: cover !important; opacity: .42 !important; transform: scale(1.035) !important; }
#routeTab.has-route-backdrop::after { z-index: -1 !important; background: linear-gradient(90deg, rgba(5,7,13,.88), rgba(5,7,13,.48) 45%, rgba(5,7,13,.72)), linear-gradient(180deg, rgba(5,7,13,.24), rgba(5,7,13,.56) 58%, var(--bg) 100%) !important; }
body.global-mode .global-detail-backdrop,
body.global-mode .global-detail-shade { inset: 0 !important; mask: none !important; -webkit-mask: none !important; transform: none !important; }
body.global-mode .global-detail-backdrop { background-position: center center !important; background-size: cover !important; opacity: .22 !important; }
body.global-mode .global-detail-shade { background: linear-gradient(90deg, rgba(5,7,13,.78), rgba(5,7,13,.42) 52%, rgba(5,7,13,.68)), linear-gradient(180deg, rgba(5,7,13,.18), rgba(5,7,13,.68) 65%, var(--bg) 100%) !important; }
.episode-page-backdrop,
.episode-page-shade { position: absolute; inset: 0; pointer-events: none; }
.episode-page-backdrop { z-index: -3; background: var(--episode-page-backdrop) center / cover no-repeat; filter: saturate(.78) brightness(.62); opacity: .27; transform: scale(1.035); }
.episode-page-shade { z-index: -2; background: linear-gradient(90deg, rgba(5,7,13,.9), rgba(5,7,13,.48) 50%, rgba(5,7,13,.82)), linear-gradient(180deg, rgba(5,7,13,.28), var(--bg) 88%); }
.episode-page > :not(.episode-page-backdrop):not(.episode-page-shade) { position: relative; z-index: 1; }
.global-detail-tags .genre-link,
.genres .genre-link { appearance: none; cursor: pointer; font: inherit; line-height: 1; text-decoration: none; }
.global-detail-tags .genre-link:hover,
.global-detail-tags .genre-link:focus-visible,
.genres .genre-link:hover,
.genres .genre-link:focus-visible { border-color: rgba(167,139,250,.72); color: #fff; background: rgba(139,92,246,.24); }
.summary-mobile { display: none; }
.global-detail-description-copy { max-width: 900px; margin: 0; padding: 18px 20px 24px; line-height: 1.75; }
.global-similar-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding: 18px 20px 22px; }
.global-cast-person small { display: block; white-space: normal; }
@media (max-width: 900px) {
  body.global-mode main.app.app-shell.container-xxl { padding-inline: 14px !important; }
  .global-similar-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-inline: 14px; }
}
@media (max-width: 640px) {
  html body.global-mode > .hero .topbar { width: calc(100% - 16px) !important; border-radius: 22px !important; }
  .global-similar-grid { grid-template-columns: minmax(0, 1fr); }
  .summary-desktop { display: none; }
  .summary-mobile { display: inline; }
  .global-detail-summary { display: block; max-height: 5.1em; overflow: hidden; }
  .global-detail-description-copy { max-height: 8.2em; overflow: hidden; line-height: 1.55; }
}

/* Final catalog-media geometry: keep similar titles in poster proportions. */
.global-similar-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 16px !important;
  align-items: start;
}
.global-similar-grid .global-card { min-width: 0; }
.global-similar-grid .global-card-media {
  position: relative !important;
  display: block !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  aspect-ratio: 2 / 3 !important;
  overflow: hidden !important;
}
.global-similar-grid .global-card-hit {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
}
.global-similar-grid .global-card-media > img,
.global-similar-grid .global-card-media .poster,
.global-similar-grid .global-card-media .cover-fallback {
  display: block;
  width: 100% !important;
  height: 100% !important;
  aspect-ratio: auto !important;
  object-fit: cover !important;
}
@media (max-width: 1120px) {
  .global-similar-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}
@media (max-width: 760px) {
  .global-similar-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 12px !important; }
}
