/* Phone and tablet refinements. Desktop keeps the existing cinema layout. */
.cd-mobile-search { display: none; }
.cd-filter-field {
  display: flex;
  flex: 1 1 140px;
  min-width: 0;
  flex-direction: column;
  gap: 0.35rem;
  color: var(--cd-muted);
  font-size: 0.75rem;
  font-weight: 600;
}
.cd-filter-field select { width: 100%; min-width: 0; font-weight: 400; }
.cd-filter-bar { align-items: end; }
.cd-menu-backdrop[hidden] { display: none; }
.cd-menu-backdrop {
  position: fixed;
  inset: 72px 0 0;
  z-index: 49;
  border: 0;
  background: rgba(0, 0, 0, 0.65);
  touch-action: none;
}
.cd-mobile-search-submit {
  min-width: 48px;
  min-height: 44px;
  flex-shrink: 0;
  border: 0;
  border-radius: 999px;
  background: var(--cd-gold);
  color: var(--cd-bg);
  font-weight: 700;
}
:where(a, button, input, select, textarea):focus-visible {
  outline: 2px solid var(--cd-gold);
  outline-offset: 3px;
}

@media (max-width: 1260px) {
  body.cd-menu-open { overflow: hidden; }
  .cd-mobile-drawer {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    max-height: calc(100vh - 72px);
    max-height: calc(100dvh - 72px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  }
  .cd-mobile-toggle { width: 44px; height: 44px; flex-shrink: 0; }
  .cd-mobile-drawer .cd-dropdown-link { min-height: 44px; display: flex; align-items: center; }
  .cd-mobile-drawer .cd-search-input:focus-visible { outline: none; }
}

@media (max-width: 768px) {
  .cd-mobile-search {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border: 1px solid var(--cd-border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
  }
  .cd-search-input, .cd-input, .cd-select, .cd-textarea,
  input[type="password"], input[type="email"] { font-size: 16px; }
  .cd-input, .cd-select, .cd-textarea { max-width: 100%; min-width: 0; }
  .cd-tabs { max-width: 100%; flex-wrap: wrap; border-radius: 18px; }
  .cd-tab { min-height: 44px; }
  .cd-filter-bar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    padding: 1rem;
  }
  .cd-filter-bar > input:not([type="hidden"]), .cd-filter-bar > button { grid-column: 1 / -1; }
  .cd-filter-bar > input, .cd-filter-bar > select {
    width: 100%;
    min-width: 0 !important;
    min-height: 46px;
  }
  .cd-filter-field select { min-height: 46px; padding-left: 0.65rem; padding-right: 0.4rem; }
  .cd-hero-actions { flex-wrap: wrap; }
  .cd-card-panel, .cd-table-wrap, .cd-hero-info { min-width: 0; }
  .cd-section-head { gap: 0.75rem; align-items: flex-start; }
  .cd-section-head > :first-child { min-width: 0; }
  .cd-section-more { flex-shrink: 0; }
}

@media (max-width: 640px) {
  .cd-header { height: 64px; }
  .cd-header.is-overlay { margin-bottom: -64px; }
  .cd-header-inner { gap: 0.5rem; }
  .cd-header-left { flex: 1 1 auto; }
  .cd-header-actions { flex-shrink: 0; gap: 0.4rem; }
  .cd-menu-backdrop { top: 64px; }
  .cd-mobile-drawer {
    top: 64px;
    max-height: calc(100vh - 64px);
    max-height: calc(100dvh - 64px);
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .cd-header-actions .cd-member-link, .cd-header-actions .cd-account-pill {
    width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    border-radius: 12px;
  }
  .cd-member-link > span, .cd-account-name { display: none; }
  .cd-brand { gap: 0.5rem; }
  .cd-brand-title { font-size: 1rem; }
  .cd-brand-mark { width: 34px; height: 34px; }
  .cd-page-pad { padding-top: 1.5rem; padding-bottom: 2rem; }
  .cd-section-title { font-size: 1.35rem; overflow-wrap: anywhere; }
  .cd-card-panel { padding: 1.1rem; border-radius: 16px; }
  .cd-card-panel .cd-input, .cd-card-panel .cd-select { min-width: 0 !important; }
  .cd-admin-fields { grid-template-columns: minmax(0, 1fr) !important; }
  .cd-grid-6, .cd-actors-grid { gap: 0.8rem; }
  .cd-card-title { font-size: 0.875rem; line-height: 1.4; }
  .cd-ep-btn { min-height: 44px; max-width: 100%; padding: 0.6rem 0.85rem; overflow-wrap: anywhere; }
  .cd-ep-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(74px, 1fr)); }
  .cd-detail-hero { min-height: 0 !important; padding-top: 5.5rem; padding-bottom: 1.5rem; }
  .cd-detail-hero #cd-detail-grid { gap: 1.25rem; }
  .cd-detail-hero #cd-detail-grid > .cd-poster { width: 128px; max-width: 128px; }
  #cd-detail-grid .cd-hero-title { font-size: 1.75rem !important; line-height: 1.2; }
  #cd-detail-grid form { flex-wrap: wrap; max-width: 100%; }
  #cd-detail-grid form select { min-width: 0; max-width: 100%; }
  .cd-detail-hero .cd-hero-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.65rem; }
  .cd-detail-hero .cd-hero-actions > .cd-play-cta,
  .cd-detail-hero .cd-hero-actions > form { grid-column: 1 / -1; }
  .cd-detail-hero .cd-hero-actions > .cd-play-cta { justify-content: center; }
  .cd-detail-hero .cd-hero-actions > button { padding: 0.75rem 0.4rem !important; }
  .cd-profile-identity { min-width: 0; width: 100%; }
  .cd-profile-identity > div { min-width: 0; overflow-wrap: anywhere; }
  .cd-profile-identity .cd-avatar { flex-shrink: 0; }
  .cd-profile-identity h1 { font-size: 1.25rem !important; }
  .cd-profile-identity > div > div { flex-wrap: wrap; }
  .cd-landing-hero {
    min-height: 0 !important;
    padding-top: 6rem !important;
    padding-bottom: 2.5rem !important;
  }
  .cd-landing-hero .cd-hero-title { font-size: clamp(1.8rem, 7.8vw, 2.5rem) !important; line-height: 1.2; }
  .cd-landing-hero .cd-hero-badge { font-size: 0.65rem; }
  .cd-landing-hero .cd-hero-title + p { font-size: 0.9375rem !important; }
  .cd-landing-search { border-radius: 18px !important; flex-wrap: wrap; padding: 0.5rem !important; }
  .cd-landing-search .cd-search-input { flex-basis: 100%; padding: 0.6rem !important; }
  .cd-landing-search > button { width: 100%; min-height: 46px; }
  .cd-watch-page { padding-top: 1rem; }
  .cd-player-shell { border-radius: 12px; }
  .cd-player-stage .plyr__controls { gap: 2px; padding: 8px 6px; }
  .cd-player-stage .plyr__volume { min-width: 0; max-width: 64px; }
  .cd-player-stage .plyr__time--duration,
  .cd-player-stage [data-plyr="pip"] { display: none; }
  .cd-watch-controls { padding: 0.85rem !important; gap: 0.85rem !important; }
  .cd-watch-controls > div { min-width: 0; width: 100%; }
  .cd-watch-controls a, .cd-watch-controls button, .cd-watch-controls select { min-height: 44px !important; max-width: 100%; }
  .cd-watch-controls .cd-ep-btn { text-align: center; }
  .cd-watch-page .cd-shortcut-bar { display: none; }
  #cd-actor-grid > div { min-width: 0; overflow-wrap: anywhere; }
  .cd-topics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .cd-topics-grid > * { min-width: 0; }
  .cd-footer { padding-top: 2rem; }
  .cd-footer-col > div:first-child { flex-wrap: wrap; }
  .cd-footer-links a { min-height: 44px; display: inline-flex; align-items: center; }
  .cd-scroll-top { right: 1rem; bottom: max(1rem, env(safe-area-inset-bottom)); }
}

@media (max-width: 360px) {
  .cd-container { padding-left: 0.75rem; padding-right: 0.75rem; }
  .cd-brand { gap: 0.35rem; }
  .cd-brand-title { font-size: 0.875rem; }
  .cd-brand-mark { width: 30px; height: 30px; }
  .cd-header-actions { gap: 0.25rem; }
  .cd-filter-bar { padding: 0.75rem; }
}

@media (prefers-reduced-motion: reduce) {
  .cd-mobile-drawer.open { animation: none; }
}

@media (hover: none) {
  .cd-card:hover, a.cd-card-panel:hover, details.cd-card-panel:hover { transform: none; }
}
