:root {
  --topbar-height: 60px;
  --bg: #141414;
  --panel: #181818;
  --panel-2: #202020;
  --line: rgba(255, 255, 255, 0.1);
  --text: #ffffff;
  --muted: #b3b3b3;
  --red: #e50914;
  --red-dark: #b20710;
  --soft: rgba(255, 255, 255, 0.12);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  background: var(--bg);
  color: var(--text);
  font-family: Inter, Roboto, "Noto Sans", Helvetica, Arial, sans-serif;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
  touch-action: manipulation;
}

/* ── Mobile performance ──────────────────────────────── */
button {
  cursor: pointer;
}

.rail {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.cat-drawer,
.episodes-panel {
  will-change: transform;
}

.next-ep-banner {
  will-change: transform, opacity;
}

.sidebar,
.cat-drawer-list,
.episodes-panel-list {
  -webkit-overflow-scrolling: touch;
}

/* Toast de notificação */
.app-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(25, 25, 25, 0.96);
  color: #fff;
  padding: 10px 22px;
  border-radius: 24px;
  font-size: 0.88rem;
  font-weight: 500;
  z-index: 9999;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.55);
  pointer-events: none;
  white-space: nowrap;
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: toast-in 0.22s ease;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

button {
  border: 0;
  cursor: pointer;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    linear-gradient(rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.86)),
    url("https://images.unsplash.com/photo-1517604931442-7e0c8ed2963c?auto=format&fit=crop&w=2200&q=80") center / cover;
}

.login-card {
  width: min(460px, 100%);
  padding: 34px;
  border-radius: 8px;
  background: rgba(20, 20, 20, 0.9);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  letter-spacing: 0;
  color: var(--red);
  text-transform: uppercase;
}

.brand-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: var(--red);
  color: #fff;
}

.app-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(12px);
}

.app-modal {
  width: min(440px, 100%);
  padding: 24px;
  border-radius: 8px;
  background: rgba(20, 20, 20, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow);
}

.app-modal h3 {
  margin: 18px 0 8px;
  font-size: clamp(1.4rem, 3vw, 2rem);
}

.login-card h1 {
  margin: 30px 0 10px;
  font-size: clamp(2rem, 8vw, 3.1rem);
  line-height: 1;
  letter-spacing: 0;
}

.login-card p,
.muted {
  color: var(--muted);
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 24px 0;
  padding: 4px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.tab {
  min-height: 42px;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-weight: 700;
}

.tab.active {
  color: #fff;
  background: var(--red);
}

.field {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}

.field label {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.field input,
.field textarea,
.field select,
.search-box {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  background: #262626;
  color: #fff;
  outline: 0;
}

.field input,
.field select,
.search-box {
  min-height: 48px;
  padding: 0 14px;
}

.field textarea {
  min-height: 92px;
  padding: 14px;
  resize: vertical;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.icon-btn {
  min-height: 44px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-weight: 800;
  transition: transform 0.16s ease, background 0.16s ease, opacity 0.16s ease;
}

.primary-btn {
  width: 100%;
  color: #fff;
  background: var(--red);
}

.primary-btn:hover {
  background: var(--red-dark);
  transform: translateY(-1px);
}

.primary-btn:disabled {
  cursor: wait;
  opacity: 0.68;
  transform: none;
}

.login-status {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  margin: 12px 0 16px;
  border-radius: 6px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.88rem;
  line-height: 1.35;
}

.login-status.error {
  color: #fff;
  background: rgba(229, 9, 20, 0.18);
  border-color: rgba(229, 9, 20, 0.58);
}

.login-status.success {
  color: #fff;
  background: rgba(28, 154, 84, 0.18);
  border-color: rgba(28, 154, 84, 0.58);
}

.secondary-btn {
  padding: 0 18px;
  color: #111;
  background: #fff;
}

.ghost-btn {
  padding: 0 18px;
  color: #fff;
  background: rgba(109, 109, 110, 0.72);
}

.icon-btn {
  width: 44px;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.icon-btn:disabled,
.episode-nav-btn:disabled {
  opacity: 0.38;
  cursor: default;
}

.episode-nav-btn {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 6px;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  font-size: 0.84rem;
  font-weight: 900;
  white-space: nowrap;
}

.app-shell {
  min-height: 100vh;
  padding-top: var(--topbar-height);
  background: var(--bg);
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  min-height: var(--topbar-height);
  padding: 0 clamp(16px, 3vw, 48px);
  background: linear-gradient(180deg, rgba(10, 10, 10, 0.98), rgba(10, 10, 10, 0.82));
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.topbar-section {
  font-size: clamp(0.95rem, 2vw, 1.2rem);
  font-weight: 700;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tv-icon-btn {
  min-width: 44px;
  min-height: 44px;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-dot {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--red);
  font-weight: 900;
}

.page {
  padding: 0 clamp(14px, 3vw, 48px) 50px;
}

/* ── Focus TV — indicador de foco para D-pad ─────────── */
:focus { outline: none; }

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px rgba(229, 9, 20, 0.22);
  border-radius: 6px;
  position: relative;
  z-index: 10;
}

.card:focus-visible {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red), 0 10px 28px rgba(0, 0, 0, 0.5);
  transform: scale(1.07) translateY(-4px);
  z-index: 5;
}

.hub-btn:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px rgba(229, 9, 20, 0.28), 0 10px 36px rgba(0, 0, 0, 0.6);
  transform: scale(1.07);
}

.side-item:focus-visible {
  background: var(--red);
  color: #fff;
  outline: none;
  box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.4);
}

/* ── Home Hub ────────────────────────────────────────── */
.home-hub {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 60px);
  padding: clamp(18px, 4vw, 58px);
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(128px, 1fr));
  gap: clamp(12px, 1.8vw, 24px);
  width: min(1280px, 94vw);
}

.hub-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1.4vh, 14px);
  min-height: clamp(126px, 22vh, 230px);
  padding: clamp(14px, 2vw, 26px);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #fff;
  transition: background 0.18s, transform 0.18s, box-shadow 0.18s, border-color 0.18s;
  cursor: pointer;
}

.hub-btn:hover {
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(229, 9, 20, 0.5);
  transform: scale(1.04);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
}

.hub-icon {
  color: var(--red);
  width: clamp(2.35rem, 4vw, 4.25rem);
  height: clamp(2.35rem, 4vw, 4.25rem);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hub-icon svg {
  width: 100%;
  height: 100%;
}

.hub-label {
  font-size: clamp(0.82rem, 1.25vw, 1.08rem);
  font-weight: 900;
  letter-spacing: 0.02em;
  text-align: center;
  line-height: 1.2;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.hub-count {
  font-size: 0.72rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 8px;
  border-radius: 12px;
}

/* ── Content grid responsivo ─────────────────────────── */
.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(clamp(128px, 15vw, 178px), 1fr));
  gap: clamp(10px, 1.25vw, 16px);
}

/* ── Search overlay ──────────────────────────────────── */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(5, 5, 5, 0.97);
  display: flex;
  flex-direction: column;
  padding: 0;
  backdrop-filter: blur(20px);
}

.search-overlay-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px clamp(16px, 4vw, 48px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(20, 20, 20, 0.9);
}

.search-overlay-icon {
  font-size: 1.4rem;
  color: var(--muted);
  flex-shrink: 0;
}

.search-overlay-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: #fff;
  font-size: clamp(1rem, 2vw, 1.3rem);
  font-weight: 500;
  padding: 10px 16px;
  min-height: 48px;
}

.search-overlay-input:focus {
  outline: 2px solid var(--red);
  background: rgba(255, 255, 255, 0.1);
}

.search-overlay-results {
  flex: 1;
  overflow-y: auto;
  padding: 20px clamp(16px, 4vw, 48px);
}

.search-hint {
  text-align: center;
  color: var(--muted);
  padding: 60px 0;
  font-size: 1.1rem;
}

.hero {
  position: relative;
  min-height: min(68vh, 680px);
  display: flex;
  align-items: flex-end;
  padding: 80px clamp(18px, 4vw, 58px) 58px;
  margin: 0 calc(clamp(18px, 4vw, 58px) * -1) 28px;
  background:
    linear-gradient(90deg, #141414 0%, rgba(20, 20, 20, 0.72) 42%, rgba(20, 20, 20, 0.14) 100%),
    linear-gradient(0deg, #141414 0%, rgba(20, 20, 20, 0) 34%),
    var(--hero-image) center / cover;
}

.hero-content {
  max-width: 680px;
}

.eyebrow {
  color: var(--red);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

.hero h2 {
  margin: 10px 0 12px;
  font-size: clamp(2.4rem, 8vw, 5.6rem);
  line-height: 0.94;
  letter-spacing: 0;
}

.hero p {
  max-width: 620px;
  color: #e5e5e5;
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: clamp(10px, 2vh, 20px);
}

.section {
  margin: 28px 0 38px;
}

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

.section h3 {
  margin: 0;
  font-size: clamp(1.25rem, 2.6vw, 1.8rem);
}

.rail-title-btn {
  min-height: 36px;
  padding: 0;
  border-radius: 6px;
  color: #fff;
  background: transparent;
  font-size: clamp(1.25rem, 2.6vw, 1.8rem);
  font-weight: 900;
  text-align: left;
}

.rail-title-btn:hover {
  color: var(--red);
}

.category-title-btn {
  min-height: 38px;
  padding: 0;
  border-radius: 6px;
  color: #fff;
  background: transparent;
  font-size: clamp(1.25rem, 2.6vw, 1.8rem);
  font-weight: 900;
  text-align: left;
}

.category-title-btn:hover {
  color: var(--red);
}

.rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: clamp(140px, 17vw, 210px);
  gap: 14px;
  overflow-x: auto;
  padding: 6px 4px 16px;
  scroll-snap-type: x mandatory;
}

.rail::-webkit-scrollbar,
.content-grid::-webkit-scrollbar,
.channel-list::-webkit-scrollbar,
.episode-list::-webkit-scrollbar {
  height: 10px;
  width: 10px;
}

.rail::-webkit-scrollbar-thumb,
.content-grid::-webkit-scrollbar-thumb,
.channel-list::-webkit-scrollbar-thumb,
.episode-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
}

.card {
  position: relative;
  min-height: 118px;
  overflow: hidden;
  border-radius: 8px;
  background: #242424;
  color: #fff;
  border: 1px solid transparent;
  scroll-snap-align: start;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  transition: transform 0.18s ease, border 0.18s ease;
}

.card:hover {
  transform: translateY(-4px) scale(1.015);
  border-color: var(--red);
}

.thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--img) center / cover, linear-gradient(135deg, #2d2d2d, #111);
}

.poster .thumb {
  aspect-ratio: 2 / 3;
}

.card-body {
  padding: 9px 10px 10px;
}

.card-title {
  min-height: 20px;
  font-weight: 800;
  font-size: clamp(0.82rem, 1.05vw, 0.98rem);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.75rem;
  margin-top: 4px;
}

.progress {
  height: 4px;
  width: 100%;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
}

.progress > span {
  display: block;
  height: 100%;
  width: var(--value, 40%);
  background: var(--red);
}

.card-actions {
  position: absolute;
  inset: 10px 10px auto auto;
  display: flex;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.16s ease;
}

.card:hover .card-actions {
  opacity: 1;
}

.tiny-btn {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  color: #fff;
  background: rgba(0, 0, 0, 0.62);
  display: grid;
  place-items: center;
}

.layout-live {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: start;
}

/* ── Category side drawer ─────────────────────────────── */
.cat-drawer {
  position: fixed;
  left: 0;
  top: var(--topbar-height);
  bottom: 0;
  z-index: 150;
  display: flex;
  align-items: stretch;
  transform: translateX(0);
  pointer-events: auto;
}

.cat-drawer.open {
  transform: translateX(0);
}

.cat-drawer-body {
  width: 260px;
  background: rgba(8, 8, 8, 0.97);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(24px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 6px 0 32px rgba(0, 0, 0, 0.6);
  flex-shrink: 0;
}

.cat-drawer-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px 0 16px;
  scroll-padding-block: 42vh;
}

.cat-drawer-list::-webkit-scrollbar {
  width: 4px;
}
.cat-drawer-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
}

.cat-drawer-item {
  display: block;
  width: 100%;
  padding: 10px 18px;
  text-align: left;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.14s, color 0.14s;
  border-left: 3px solid transparent;
}

.cat-drawer-item:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  border-left-color: var(--red);
}

.cat-drawer-item.active {
  background: rgba(229, 9, 20, 0.92);
  color: #fff;
  border-left-color: #fff;
}

.cat-drawer-item--special {
  color: #fff;
  font-weight: 600;
}

.cat-drawer-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 6px 14px;
}

body.has-cat-drawer .page {
  padding-left: calc(260px + clamp(14px, 3vw, 48px));
}

.sidebar,
.preview-panel,
.settings-panel,
.details-panel {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.sidebar {
  position: sticky;
  top: 88px;
  padding: 12px;
}

.side-item {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  text-align: left;
  font-weight: 700;
}

.side-item.active,
.side-item:hover {
  color: #fff;
  background: var(--red);
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(clamp(128px, 15vw, 178px), 1fr));
  gap: clamp(10px, 1.25vw, 16px);
}

.channel-logo {
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  padding: clamp(14px, 2vw, 20px);
  background:
    radial-gradient(circle at top right, rgba(229, 9, 20, 0.52), transparent 32%),
    linear-gradient(135deg, #303030, #111);
}

.channel-logo--image {
  background: var(--img) center / contain no-repeat, linear-gradient(135deg, #191919, #050505);
}

.channel-logo strong {
  font-size: clamp(1.25rem, 2.5vw, 1.8rem);
}

.preview-panel {
  position: sticky;
  top: 88px;
  overflow: hidden;
}

.preview-screen {
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  background: #050505;
  color: var(--muted);
}

.preview-panel .card-body {
  padding: 16px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.filters .search-box,
.filters select {
  max-width: 300px;
}

.detail-hero {
  position: relative;
  min-height: calc(100vh - var(--topbar-height));
  display: grid;
  align-items: end;
  padding: clamp(28px, 6vh, 72px) clamp(18px, 4vw, 58px) clamp(22px, 5vh, 46px);
  margin: 0 calc(clamp(18px, 4vw, 58px) * -1);
  background:
    linear-gradient(90deg, #141414 0%, rgba(20, 20, 20, 0.76) 44%, rgba(20, 20, 20, 0.1) 100%),
    linear-gradient(0deg, #141414 0%, rgba(20, 20, 20, 0) 34%),
    var(--hero-image) center / cover;
}

.detail-copy {
  max-width: min(760px, 72vw);
}

.detail-copy h2 {
  margin: clamp(6px, 1.4vh, 12px) 0;
  font-size: clamp(1.75rem, min(5.6vw, 8vh), 4.5rem);
  line-height: 1;
}

.detail-copy > .muted {
  display: -webkit-box;
  max-width: 680px;
  margin: clamp(8px, 1.8vh, 14px) 0;
  font-size: clamp(0.82rem, min(1.2vw, 2.2vh), 1.05rem);
  line-height: 1.42;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: clamp(8px, 1.6vh, 12px) 0;
}

.pill {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  font-size: clamp(0.72rem, 1.4vh, 0.84rem);
  font-weight: 800;
}

.episode-list {
  display: grid;
  gap: 12px;
}

.episode {
  display: grid;
  grid-template-columns: 190px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--line);
}

.episode-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.episode-action-btn {
  min-height: 36px;
  padding: 0 12px;
  font-size: 0.82rem;
  white-space: nowrap;
}

.episode.watched {
  border-color: rgba(229, 9, 20, 0.36);
  background: rgba(229, 9, 20, 0.08);
}

.episode .thumb {
  position: relative;
  border-radius: 6px;
}

.episode-check {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--red);
  font-size: 0.9rem;
  font-weight: 900;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.38);
}

.episode-status {
  width: fit-content;
  margin-top: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.episode-status.watched {
  background: var(--red);
}

.continue-series-list {
  display: grid;
  gap: 14px;
}

.continue-series-card {
  padding: 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--line);
}

.continue-series-main {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.continue-series-main .thumb {
  border-radius: 6px;
}

.continue-series-copy {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.continue-episodes {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.continue-episode-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border-radius: 6px;
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.06);
  text-align: left;
}

.continue-episode-item:hover:not(:disabled),
.continue-episode-item.active {
  background: rgba(229, 9, 20, 0.18);
  border-color: rgba(229, 9, 20, 0.34);
}

.continue-episode-item span,
.continue-episode-item em {
  color: var(--muted);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 800;
  text-transform: uppercase;
}

.continue-episode-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.continue-episode-item.watched em {
  color: var(--red);
}

.player-shell {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #000;
  color: #fff;
}

.video-stage {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.video-stage video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain !important;
  background: #000;
  display: block;
  margin: auto;
}

.player-placeholder {
  max-width: 640px;
  padding: 28px;
  text-align: center;
  color: var(--muted);
}

.player-placeholder strong {
  display: block;
  margin-bottom: 10px;
  color: #fff;
  font-size: 2rem;
}

.resume-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.46);
}

.resume-panel {
  width: min(520px, 100%);
  padding: 24px;
  border-radius: 8px;
  background: rgba(20, 20, 20, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.resume-panel h3 {
  margin: 8px 0;
  font-size: clamp(1.4rem, 4vw, 2.2rem);
}

.player-ui {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(180deg, transparent 0%, transparent 52%, rgba(0, 0, 0, 0.86) 100%);
  opacity: 1;
  transition: opacity 0.22s ease;
}

.player-shell.idle .player-ui {
  opacity: 0;
  pointer-events: none;
}

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

.player-bottom {
  width: min(1120px, 100%);
  padding: 16px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.46);
  border: 1px solid rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(12px);
}

.player-title-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin: 10px 0;
}

.player-title-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

.player-title {
  font-weight: 900;
  font-size: clamp(1rem, 2vw, 1.45rem);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

.control-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.time-bar {
  width: 100%;
  accent-color: var(--red);
}

.volume {
  width: 110px;
  accent-color: var(--red);
}

.quick-channels,
.live-epg-panel {
  position: absolute;
  right: 24px;
  bottom: 170px;
  width: min(330px, 36vw);
  max-height: min(460px, calc(100vh - 230px));
  overflow: auto;
  padding: 12px;
  border-radius: 8px;
  background: rgba(20, 20, 20, 0.86);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.live-epg-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.live-epg-current {
  padding: 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.live-epg-current strong,
.live-epg-current span {
  display: block;
}

.live-epg-current strong {
  margin: 4px 0;
  color: #fff;
  font-size: 1rem;
}

.live-epg-current span {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.live-epg-list {
  overflow-y: auto;
  padding-right: 2px;
}

.quick-channel {
  width: 100%;
  min-height: 42px;
  padding: 0 10px;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  text-align: left;
}

.quick-channel span,
.quick-channel em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quick-channel span {
  color: #fff;
  font-weight: 800;
  white-space: nowrap;
}

.quick-channel em {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.quick-channel:hover,
.quick-channel.active {
  color: #fff;
  background: rgba(229, 9, 20, 0.78);
}

.quick-channel:hover em,
.quick-channel.active em {
  color: rgba(255, 255, 255, 0.86);
}

/* ── Next episode banner ────────────────────────────── */
.next-ep-banner {
  position: absolute;
  bottom: 130px;
  right: 24px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  background: rgba(15, 15, 15, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(16px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.next-ep-label {
  color: #ccc;
  font-size: 0.88rem;
  white-space: nowrap;
}

/* ── Episodes side panel ────────────────────────────── */
.episodes-panel {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(360px, 85vw);
  z-index: 5;
  display: flex;
  flex-direction: column;
  background: rgba(10, 10, 10, 0.96);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  transform: translateX(-100%);
  transition: transform 0.28s ease;
  backdrop-filter: blur(20px);
}

.episodes-panel.open {
  transform: translateX(0);
}

.ep-watched-badge {
  font-size: 0.65rem;
  color: var(--red);
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 3px;
}

.ep-watched-badge::before {
  content: "✓";
  font-size: 0.7rem;
}

.ep-now-badge {
  width: fit-content;
  margin-top: 3px;
  padding: 3px 7px;
  border-radius: 999px;
  color: #fff;
  background: var(--red);
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
}

.episode-panel-item.watched {
  border-color: rgba(229, 9, 20, 0.34);
  background: rgba(229, 9, 20, 0.08);
}

.ep-check-icon {
  background: var(--red);
}

.episodes-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.episodes-panel-head h3 {
  font-size: 1rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin: 0;
}

.episodes-now {
  display: block;
  margin-top: 4px;
  color: var(--red);
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.25;
}

.episodes-panel-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 0 8px;
}

.episodes-panel-season {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 10px 16px;
  font-size: 0.72rem;
  color: #fff;
  background: rgba(10, 10, 10, 0.98);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.36);
}

.episode-panel-item {
  display: flex;
  align-items: flex-start;
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  border: none;
  color: #ccc;
  text-align: left;
  cursor: pointer;
  gap: 12px;
  transition: background 0.15s;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.episode-panel-item:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.episode-panel-item.active {
  background: rgba(229, 9, 20, 0.24);
  color: #fff;
  box-shadow: inset 4px 0 0 var(--red);
}

.episode-panel-item:disabled {
  opacity: 0.3;
  cursor: default;
}

.ep-thumb {
  width: 90px;
  height: 54px;
  flex-shrink: 0;
  border-radius: 4px;
  background-size: cover;
  background-position: center;
  background-color: rgba(255, 255, 255, 0.06);
  position: relative;
  overflow: hidden;
}

.ep-playing-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(229, 9, 20, 0.72);
  font-size: 0.9rem;
  color: #fff;
}

/* ── Feedback visual de seek por duplo-toque ─────────── */
.seek-feedback {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 1.4rem;
  font-weight: 800;
  z-index: 6;
  pointer-events: none;
  animation: seek-pop 0.65s ease forwards;
}

.seek-feedback-left  { left: 15%; }
.seek-feedback-right { right: 15%; }

@keyframes seek-pop {
  0%   { opacity: 1; transform: translateY(-50%) scale(1); }
  60%  { opacity: 1; transform: translateY(-50%) scale(1.15); }
  100% { opacity: 0; transform: translateY(-50%) scale(1.25); }
}

.ep-thumb-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--red);
  max-width: 100%;
}

.ep-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 2px;
}

.ep-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ep-duration {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--muted);
  margin-left: 6px;
}

.ep-desc {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.settings-panel {
  max-width: 900px;
  padding: 22px;
}

.profile-user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 18px;
  margin-bottom: 16px;
  width: fit-content;
}

.profile-user-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.profile-user-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

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

.empty {
  min-height: 240px;
  display: grid;
  place-items: center;
  padding: 26px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.load-more {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 70px;
}

body.light {
  --bg: #f5f5f5;
  --panel: #fff;
  --panel-2: #ededed;
  --line: rgba(0, 0, 0, 0.1);
  --text: #111;
  --muted: #555;
  background: var(--bg);
  color: var(--text);
}

body.light .app-shell,
body.light .topbar,
body.light .field input,
body.light .field select,
body.light .field textarea,
body.light .search-box {
  background: var(--bg);
  color: var(--text);
}

@media (max-width: 1080px) {
  .hub-grid {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
  }

  .layout-live {
    grid-template-columns: 200px 1fr;
  }

  .cat-drawer-body {
    width: 220px;
  }

  .cat-drawer {
    transform: translateX(0);
  }

  body.has-cat-drawer .page {
    padding-left: calc(220px + clamp(14px, 3vw, 48px));
  }

  .preview-panel {
    display: none;
  }
}

@media (max-width: 760px) {
  .home-hub {
    align-items: start;
    min-height: calc(100vh - 60px);
  }

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

  .hub-btn {
    min-height: 118px;
  }

  .topbar {
    grid-template-columns: 1fr auto;
    gap: 14px;
    padding-top: 0;
    padding-bottom: 0;
  }

  .topbar-section {
    display: none;
  }

  .nav {
    grid-column: 1 / -1;
    justify-content: flex-start;
    overflow-x: auto;
    order: 3;
  }

  .top-actions .search-box {
    display: none;
  }

  .hero,
  .detail-hero {
    min-height: calc(100vh - var(--topbar-height));
  }

  .detail-copy {
    max-width: 88vw;
  }

  .detail-copy > .muted {
    -webkit-line-clamp: 3;
  }

  .layout-live {
    grid-template-columns: 1fr;
  }

  .cat-drawer-body {
    width: 200px;
  }

  .cat-drawer {
    transform: translateX(0);
  }

  body.has-cat-drawer .page {
    padding-left: calc(200px + 14px);
  }

  .sidebar {
    position: static;
    display: flex;
    overflow-x: auto;
    gap: 8px;
  }

  .side-item {
    white-space: nowrap;
  }

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

  .setting-grid {
    grid-template-columns: 1fr;
  }

  .episode {
    grid-template-columns: 120px 1fr;
  }

  .episode .ghost-btn {
    grid-column: 1 / -1;
  }

  .continue-series-main {
    grid-template-columns: 120px minmax(0, 1fr);
  }

  .continue-episode-item {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .continue-episode-item em {
    grid-column: 2;
  }

  .quick-channels {
    display: none;
  }

  .live-epg-panel {
    display: none;
  }

  .player-ui {
    padding: 14px;
  }

  .player-shell.resume-active .player-ui {
    display: none;
  }

  .player-bottom {
    padding: 12px;
  }

  .player-title-row {
    grid-template-columns: 40px minmax(0, 1fr) 40px;
    gap: 8px;
  }

  .volume {
    display: none;
  }
}

@media (max-width: 480px) {
  .login-card {
    padding: 24px;
  }

  .tabs {
    grid-template-columns: 1fr;
  }

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

  .rail {
    grid-auto-columns: 46vw;
  }
}

/* ══════════════════════════════════════════
   BOTTOM NAVIGATION
══════════════════════════════════════════ */
:root {
  --bottomnav-height: 64px;
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottomnav-height);
  display: flex;
  align-items: stretch;
  background: rgba(14, 14, 14, 0.97);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 200;
  backdrop-filter: blur(16px);
}

.bottom-nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: transparent;
  color: var(--muted);
  font-size: 0;
  border: none;
  padding: 8px 0;
  transition: color 0.15s;
}

.bottom-nav-btn.active {
  color: var(--red);
}

.bottom-nav-icon {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.bottom-nav-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Empurra o conteúdo para cima do bottom nav */
.app-shell {
  padding-bottom: var(--bottomnav-height);
}

/* Player cobre tudo — sem bottom nav */
#slot-player:not(:empty) ~ #slot-bottomnav {
  display: none;
}

/* ══════════════════════════════════════════
   HOME SCREEN — MOBILE
══════════════════════════════════════════ */
.home-screen {
  min-height: calc(100vh - var(--topbar-height) - var(--bottomnav-height));
  overflow-y: auto;
}

.home-featured {
  position: relative;
  width: 100%;
  height: min(56vw, 320px);
  overflow: hidden;
}

.home-featured-media {
  position: absolute;
  inset: 0;
}

.home-featured-backdrop {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
}

.home-preview-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-featured-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.08) 0%,
    rgba(0,0,0,0.2) 40%,
    rgba(20,20,20,0.95) 100%
  );
}

.home-featured-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 14px 16px;
  gap: 10px;
}

.home-featured-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.home-featured-tag {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--red);
}

.home-featured-title {
  font-size: clamp(1.1rem, 5vw, 1.6rem);
  font-weight: 900;
  line-height: 1.15;
  margin: 0;
  text-shadow: 0 1px 6px rgba(0,0,0,0.8);
}

.home-featured-sub {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0;
}

.home-featured-progress-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.home-featured-progress-bar {
  flex: 1;
  height: 3px;
  background: rgba(255,255,255,0.25);
  border-radius: 2px;
  overflow: hidden;
}

.home-featured-progress-fill {
  height: 100%;
  background: var(--red);
  border-radius: 2px;
}

.home-featured-remaining {
  font-size: 0.7rem;
  color: var(--muted);
  white-space: nowrap;
}

.home-featured-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.home-play-btn {
  font-size: 0.9rem;
  padding: 9px 18px;
}

.home-rails {
  padding: 4px 0 8px;
}

.home-empty-state {
  padding: 40px 24px;
  text-align: center;
}

/* ══════════════════════════════════════════
   CATEGORY PILLS ROW
══════════════════════════════════════════ */
.cat-pills-row {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 10px 0 6px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.cat-pills-scroll {
  flex: 1;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 12px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.cat-pills-scroll::-webkit-scrollbar { display: none; }

.cat-pill {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 20px;
  background: rgba(255,255,255,0.08);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.cat-pill.active,
.cat-pill:active {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}

.cat-pills-all {
  flex-shrink: 0;
  padding: 6px 12px;
  font-size: 0.85rem;
  border-left: 1px solid rgba(255,255,255,0.08);
  margin-left: 2px;
}

/* ══════════════════════════════════════════
   PAGE RAILS LAYOUT (movies/series)
══════════════════════════════════════════ */
.page-rails-layout {
  display: flex;
  flex-direction: column;
}

.page-rails {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 8px;
}

/* Layout selector: desktop/TV keep the horizontal hub; phones get portrait app chrome. */
body.desktop-layout .app-shell {
  padding-bottom: 0;
}

body.desktop-layout .bottom-nav {
  display: none;
}

body.mobile-layout {
  background: #141414;
}

body.mobile-layout .app-shell {
  min-height: 100svh;
  padding-top: calc(var(--topbar-height) + env(safe-area-inset-top, 0px));
  padding-bottom: calc(var(--bottomnav-height) + env(safe-area-inset-bottom, 0px));
}

body.mobile-layout.player-open .app-shell {
  padding-top: 0;
  padding-bottom: 0;
}

body.mobile-layout.player-open .topbar,
body.mobile-layout.player-open .bottom-nav {
  display: none;
}

body.mobile-layout .topbar {
  min-height: calc(var(--topbar-height) + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  background: rgba(20, 20, 20, 0.96);
}

body.mobile-layout .page {
  padding-left: 0;
  padding-right: 0;
  padding-bottom: calc(var(--bottomnav-height) + 18px);
}

body.mobile-layout .section {
  margin: 14px 0 22px;
}

body.mobile-layout .section-head {
  padding: 0 14px;
  margin-bottom: 10px;
}

body.mobile-layout .section h3,
body.mobile-layout .category-title-btn,
body.mobile-layout .rail-title-btn {
  font-size: 1.08rem;
}

body.mobile-layout .rail {
  grid-auto-columns: 34vw;
  gap: 10px;
  padding: 4px 14px 12px;
  scrollbar-width: none;
}

body.mobile-layout .rail::-webkit-scrollbar {
  display: none;
}

body.mobile-layout .card {
  min-height: 0;
  border-radius: 8px;
  background: #1f1f1f;
  box-shadow: none;
}

body.mobile-layout .card:hover,
body.mobile-layout .card:focus-visible {
  transform: none;
}

body.mobile-layout .card-actions {
  opacity: 1;
  top: 6px;
  right: 6px;
  gap: 5px;
}

body.mobile-layout .tiny-btn {
  width: 30px;
  height: 30px;
  font-size: 0.82rem;
}

body.mobile-layout .content-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0 14px;
}

body.mobile-layout .home-featured {
  height: min(78vw, 430px);
  min-height: 300px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

body.mobile-layout .home-featured-overlay {
  padding: 18px 16px;
}

body.mobile-layout .home-featured-title {
  max-width: 92vw;
}

body.mobile-layout .home-featured-actions .secondary-btn,
body.mobile-layout .home-featured-actions .ghost-btn {
  min-height: 40px;
  padding: 0 16px;
}

body.mobile-layout .bottom-nav {
  height: calc(var(--bottomnav-height) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

body.mobile-layout .cat-pills-row {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(20, 20, 20, 0.96);
  backdrop-filter: blur(12px);
  padding-top: 8px;
  padding-bottom: 8px;
  margin-bottom: 8px;
  min-height: 54px;
}

body.mobile-layout .page-rails {
  overflow: visible;
  padding-top: 2px;
}

body.mobile-layout .cat-drawer {
  top: calc(var(--topbar-height) + env(safe-area-inset-top, 0px));
  bottom: calc(var(--bottomnav-height) + env(safe-area-inset-bottom, 0px));
  width: 100vw;
  background: rgba(0, 0, 0, 0.48);
}

body.mobile-layout .cat-drawer-body {
  width: min(82vw, 310px);
  max-height: 100%;
}

body.mobile-layout.has-cat-drawer .page {
  padding-left: 0;
}

body.mobile-layout .detail-hero {
  min-height: auto;
  padding: 190px 16px 24px;
  margin: 0;
}

body.mobile-layout .detail-copy {
  max-width: 100%;
}

body.mobile-layout .episode-list,
body.mobile-layout .settings-panel {
  padding: 0 14px;
}

body.mobile-layout .episode {
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
}

body.mobile-layout .episode .thumb {
  align-self: start;
}

body.mobile-layout .episode .muted {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 6px 0 0;
}

body.mobile-layout .episode-actions {
  grid-column: 1 / -1;
  justify-content: flex-end;
}

body.mobile-layout .episode-action-btn {
  min-height: 34px;
  padding: 0 10px;
  font-size: 0.78rem;
}

body.mobile-layout .home-rails .section:first-child .rail {
  grid-auto-columns: 46vw;
}

body.mobile-layout .home-rails .section:first-child .card-body {
  padding-right: 8px;
}

body.mobile-layout .home-rails .section:first-child .meta {
  display: none;
}

body.mobile-layout .home-rails .section:first-child .progress {
  margin-top: 8px;
}

@media (max-width: 420px) {
  body.mobile-layout .rail {
    grid-auto-columns: 36vw;
  }

  body.mobile-layout .rail .card:not(.poster) {
    min-width: 52vw;
  }
}
