/* HLSPLAY approved visual system. Loaded after the legacy component sheets.
   Presentation/heroes remain in presentation.css; geometry is shared here. */
:root {
  color-scheme: dark;
  --canvas: #090a0c;
  --surface: #141518;
  --surface-elevated: #191a1d;
  --text: #f2efe8;
  --text-muted: #a9abb1;
  --muted: var(--text-muted);
  --text-faint: #8a8e97;
  --accent: #e31332;
  --accent-bright: #ff304c;
  --accent-soft: rgb(227 19 50 / .10);
  --progress-rest: #414248;
  --line: rgb(255 255 255 / .10);
  --line-soft: rgb(255 255 255 / .045);
  --hover: rgb(255 255 255 / .045);
  --field-surface: rgb(28 29 32 / .74);
  --header-surface: rgb(9 10 12 / .83);
  --sidebar-surface: rgb(9 10 12 / .94);
  --glass-surface: rgb(30 31 34 / .72);
  --glass-background: linear-gradient(180deg, rgb(255 255 255 / .10), rgb(28 29 32 / .52) 62%, rgb(41 35 38 / .52));
  --glass-border: rgb(255 255 255 / .19);
  --glass-shadow: inset 0 1px 0 rgb(255 255 255 / .10), 0 5px 18px rgb(0 0 0 / .16);
  --control-shadow: inset 0 1px 0 rgb(255 255 255 / .10), 0 8px 24px rgb(0 0 0 / .20), 0 6px 14px rgb(227 19 50 / .10);
  --dialog-shadow: 0 28px 100px rgb(0 0 0 / .48);
  --media-surface: #1c1e21;
  --header-height: 80px;
  --sidebar-width: 220px;
  --sidebar-rail: 72px;
  --page-gutter: 32px;
  --radius-cover: 12px;
  --radius-field: 12px;
  --radius-action: 999px;
  --motion-fast: 120ms;
  --motion-normal: 180ms;
  --scrollbar-thumb: #ba1831;
  --scrollbar-thumb-hover: #f42c49;
  --scrollbar-thumb-active: #ff526a;
  --scrollbar-horizontal-thumb: #3b3d43;
  --scrollbar-horizontal-thumb-hover: #51545c;
  --scrollbar-horizontal-thumb-active: #646871;
  --ui-favorite-outline: url('/assets/ui/favorito-play-contorno.svg');
  --ui-favorite-filled: url('/assets/ui/favorito-play-preenchido.svg');
  --ui-moon: url('/assets/ui/lua-tema.svg');
  --ui-play: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m8 4 12 8-12 8Z' fill='black'/%3E%3C/svg%3E");
  --ui-search: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5' fill='none' stroke='black' stroke-width='1.8'/%3E%3Cpath d='m16 16 5 5' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
  --ds-canvas: var(--canvas);
  --ds-surface: var(--surface);
  --ds-surface-elevated: var(--surface-elevated);
  --ds-text: var(--text);
  --ds-muted: var(--text-muted);
  --ds-accent: var(--accent);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--canvas);
  color: var(--text);
  font-synthesis: none;
}
html[data-theme='light'] {
  color-scheme: light;
  --canvas: #f3f4f6;
  --surface: #fff;
  --surface-elevated: #e9ebef;
  --text: #15161a;
  --text-muted: #595d66;
  --text-faint: #686d77;
  --accent: #d5102d;
  --accent-bright: #bb0924;
  --accent-soft: rgb(213 16 45 / .075);
  --progress-rest: #cdd0d6;
  --line: rgb(21 22 26 / .13);
  --line-soft: rgb(21 22 26 / .055);
  --hover: rgb(21 22 26 / .045);
  --field-surface: rgb(255 255 255 / .78);
  --header-surface: rgb(243 244 246 / .90);
  --sidebar-surface: rgb(243 244 246 / .97);
  --glass-surface: rgb(255 255 255 / .80);
  --glass-background: linear-gradient(180deg, rgb(255 255 255 / .95), rgb(235 237 241 / .68) 68%, rgb(229 225 229 / .65));
  --glass-border: rgb(21 22 26 / .18);
  --glass-shadow: inset 0 1px 0 #fff, 0 5px 18px rgb(21 22 26 / .05);
  --control-shadow: inset 0 1px 0 #fff, 0 6px 20px rgb(21 22 26 / .07), 0 5px 12px rgb(213 16 45 / .07);
  --dialog-shadow: 0 24px 90px rgb(21 22 26 / .19);
  --scrollbar-thumb: #c51b36;
  --scrollbar-thumb-hover: #e52b47;
  --scrollbar-thumb-active: #a70d27;
  --scrollbar-horizontal-thumb: #c8cbd1;
  --scrollbar-horizontal-thumb-hover: #b7bac2;
  --scrollbar-horizontal-thumb-active: #a6aab4;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--header-height) + 24px); }
body { min-width: 320px; margin: 0; background: var(--canvas); color: var(--text); }
/* Firefox shares one thumb colour across both axes. These are the horizontal
   shelves and tabs; vertical page, sidebar, picker and dialog rails stay red. */
:is(.channel-row, .home-shelves .hs-row, .sg-opening-cards, .sg-discovery-row, .sg-actor-row, .sh-featured-list, .sh-channel-featured, .catalog-tabs) {
  --scrollbar-thumb: var(--scrollbar-horizontal-thumb);
  --scrollbar-thumb-hover: var(--scrollbar-horizontal-thumb-hover);
  --scrollbar-thumb-active: var(--scrollbar-horizontal-thumb-active);
}
/* Keep native scrolling, keyboard support and platform hit testing. The named
   shelves have enough specificity to override their later component sheets. */
html, body *, body :is(.channel-row, .home-shelves .hs-row, .sg-opening-cards, .sh-featured-list, .sh-team-picker-list, #app-sidebar, #player-screen[data-context='sagas'] #saga-queue-films, .catalog-tabs, dialog, [role='dialog']) {
  scrollbar-width: thin !important;
  scrollbar-color: var(--scrollbar-thumb) transparent !important;
}
html:hover, body *:hover, body :is(.channel-row, .home-shelves .hs-row, .sg-opening-cards, .sh-featured-list, .sh-team-picker-list, #app-sidebar, #player-screen[data-context='sagas'] #saga-queue-films, .catalog-tabs, dialog, [role='dialog']):hover {
  scrollbar-color: var(--scrollbar-thumb-hover) transparent !important;
}
html:active, body :is(.channel-row, .home-shelves .hs-row, .sg-opening-cards, .sh-featured-list, .sh-team-picker-list, #app-sidebar, #player-screen[data-context='sagas'] #saga-queue-films, .catalog-tabs, dialog, [role='dialog']):active {
  scrollbar-color: var(--scrollbar-thumb-active) transparent !important;
}
/* Chromium's standard non-auto properties take precedence over its pseudo
   elements. Reset them only where WebKit scrollbars are supported, so these
   browsers get exact 6px vertical / 3px horizontal rails; Firefox keeps thin. */
@supports selector(::-webkit-scrollbar) {
  html, body *, body :is(.channel-row, .home-shelves .hs-row, .sg-opening-cards, .sh-featured-list, .sh-team-picker-list, #app-sidebar, #player-screen[data-context='sagas'] #saga-queue-films, .catalog-tabs, dialog, [role='dialog']),
  html:is(:hover,:active), body *:hover, body :is(.channel-row, .home-shelves .hs-row, .sg-opening-cards, .sh-featured-list, .sh-team-picker-list, #app-sidebar, #player-screen[data-context='sagas'] #saga-queue-films, .catalog-tabs, dialog, [role='dialog']):is(:hover,:active) {
    scrollbar-width: auto !important;
    scrollbar-color: auto !important;
  }
  ::-webkit-scrollbar { width: 6px; height: 3px; background: transparent; }
  body #app-sidebar::-webkit-scrollbar { display: block; }
  ::-webkit-scrollbar-track { background: transparent; border-radius: 999px; }
  ::-webkit-scrollbar-thumb { min-width: 28px; min-height: 28px; border-radius: 999px; background: var(--scrollbar-thumb); }
  ::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); }
  ::-webkit-scrollbar-thumb:active { background: var(--scrollbar-thumb-active); }
  ::-webkit-scrollbar-thumb:horizontal { background: var(--scrollbar-horizontal-thumb); }
  ::-webkit-scrollbar-thumb:horizontal:hover { background: var(--scrollbar-horizontal-thumb-hover); }
  ::-webkit-scrollbar-thumb:horizontal:active { background: var(--scrollbar-horizontal-thumb-active); }
  ::-webkit-scrollbar-corner { background: transparent; }
}
@media (forced-colors: active) {
  html, body *, body :is(.channel-row, .home-shelves .hs-row, .sg-opening-cards, .sh-featured-list, .sh-team-picker-list, #app-sidebar, #player-screen[data-context='sagas'] #saga-queue-films, .catalog-tabs, dialog, [role='dialog']),
  html:is(:hover,:active), body *:is(:hover,:active), body :is(.channel-row, .home-shelves .hs-row, .sg-opening-cards, .sh-featured-list, .sh-team-picker-list, #app-sidebar, #player-screen[data-context='sagas'] #saga-queue-films, .catalog-tabs, dialog, [role='dialog']):is(:hover,:active) { scrollbar-color: auto !important; scrollbar-width: auto !important; }
  ::-webkit-scrollbar { width: 14px; height: 14px; }
  ::-webkit-scrollbar-thumb, ::-webkit-scrollbar-thumb:is(:hover,:active),
  ::-webkit-scrollbar-thumb:horizontal, ::-webkit-scrollbar-thumb:horizontal:is(:hover,:active) { background: CanvasText; }
  ::-webkit-scrollbar-track { background: Canvas; }
}
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
button, a, summary, input, select { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button { color: var(--text); }
button, .secondary-button, .glass-action {
  min-height: 44px;
  padding: 11px 20px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-action);
  background: var(--glass-surface);
  background-image: var(--glass-background);
  box-shadow: var(--glass-shadow);
  font-size: 13px;
  font-weight: 550;
  line-height: 1.35;
  cursor: pointer;
  transition: background-color var(--motion-fast), border-color var(--motion-fast), color var(--motion-fast), box-shadow var(--motion-fast);
  text-decoration: none;
}
button:hover:where(body[data-input-modality="mouse"] *), .secondary-button:hover:where(body[data-input-modality="mouse"] *), .glass-action:hover:where(body[data-input-modality="mouse"] *) {
  border-color: var(--text-faint);
  background-color: var(--surface-elevated);
  color: var(--text);
  transform: none;
}
button:active, .secondary-button:active { transform: none; }
button:disabled, input:disabled, select:disabled { opacity: .45; cursor: not-allowed; }
button:disabled:hover:where(body[data-input-modality="mouse"] *) { border-color: var(--glass-border); background-color: var(--glass-surface); box-shadow: var(--glass-shadow); }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible, .channel-row:focus-visible {
  outline: 2px solid var(--accent-bright); outline-offset: 4px;
}
.glass-primary, #catalog-connect, #sync-create, #series-resume, #episode-watch-through, #next-episode-play, #load {
  border-color: color-mix(in srgb, var(--glass-border), var(--accent) 28%);
  box-shadow: var(--control-shadow);
  background-color: var(--glass-surface);
  background-image: var(--glass-background);
}
.glass-primary:hover:where(body[data-input-modality="mouse"] *), #catalog-connect:hover:where(body[data-input-modality="mouse"] *), #sync-create:hover:where(body[data-input-modality="mouse"] *), #series-resume:hover:where(body[data-input-modality="mouse"] *) { border-color: var(--accent); }
@supports (backdrop-filter: blur(8px)) {
  .glass-action, .glass-primary, #catalog-connect, #sync-create, #change-account { backdrop-filter: blur(14px); }
}
input[type='text'], input[type='url'], input[type='password'], input[type='search'], input[type='number'], input[type='date'], select, textarea {
  min-width: 0;
  min-height: 46px;
  width: 100%;
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-field);
  background-color: var(--field-surface);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .035);
  outline: none;
}
select { padding-right: 36px; background-position: calc(100% - 18px) 21px, calc(100% - 13px) 21px; }
select option { background: var(--surface); color: var(--text); }
input::placeholder, textarea::placeholder { color: var(--text-faint); opacity: 1; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[readonly] { color: var(--text-muted); }
.field { min-width: 0; gap: 8px; }
.field > span, .field small { color: var(--text-muted); }
.field > span { font-size: 12px; font-weight: 500; }
.eyebrow, .section-kicker { color: var(--accent-bright); }
.intro, .note, .stream-info { color: var(--text-muted); }
code { color: var(--text-muted); }

/* Shared fixed header and navigation. */
.shell { width: 100%; max-width: none; margin: 0; padding: calc(var(--header-height) + 24px) var(--page-gutter) 32px; }
.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 40;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 26px;
  height: var(--header-height);
  min-height: var(--header-height);
  padding: 0 var(--page-gutter);
  margin: 0;
  background: linear-gradient(180deg, var(--header-surface), var(--header-surface) 82%, transparent);
  backdrop-filter: blur(12px);
}
.brand { flex: 0 0 230px; color: var(--accent); font-size: 29px; font-weight: 900; letter-spacing: -.075em; line-height: 1; text-decoration: none; white-space: nowrap; }
.brand span { margin-left: 0; color: var(--text); }
.catalog-tabs { display: flex; flex: 1 1 auto; flex-wrap: nowrap; align-items: center; gap: 5px; width: auto; padding: 0; order: 0; }
.catalog-tabs button, #tab-favorites { min-height: 44px; padding: 10px 17px; border: 1px solid transparent; border-radius: 18px; background: transparent; box-shadow: none; color: var(--text-muted); white-space: nowrap; font-size: 13px; font-weight: 550; }
.catalog-tabs button:hover:where(body[data-input-modality="mouse"] *) { color: var(--text); background: var(--hover); }
.catalog-tabs button[aria-pressed='true'], #tab-favorites[aria-pressed='true'] {
  color: var(--text);
  background: linear-gradient(180deg, var(--accent-soft), transparent 72%);
  border-color: var(--accent);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .08), 0 5px 16px rgb(227 19 50 / .14);
}
#favorites-count { min-width: 0; margin-left: 3px; padding: 0; border-radius: 0; background: transparent; color: var(--text-faint); font-size: 10px; }
.header-tools { display: flex; flex: 0 1 auto; align-items: center; gap: 16px; min-width: 0; }
#theme-toggle { position: relative; flex: 0 0 36px; width: 36px; min-height: 44px; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; color: var(--text-muted); font-size: 0; }
#theme-toggle::before { content: ''; display: block; width: 22px; height: 22px; margin: auto; background: currentColor; -webkit-mask: var(--ui-moon) center / contain no-repeat; mask: var(--ui-moon) center / contain no-repeat; }
#theme-toggle:hover:where(body[data-input-modality="mouse"] *) { color: var(--text); background: transparent; }
#theme-toggle > svg, #theme-toggle > img { display: none; }
.header-search { position: relative; display: block; width: clamp(160px, 16vw, 280px); min-width: 0; }
.header-search::before { content: ''; position: absolute; left: 15px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); background: var(--text-muted); -webkit-mask: var(--ui-search) center / contain no-repeat; mask: var(--ui-search) center / contain no-repeat; pointer-events: none; }
#header-search { width: 100%; min-height: 44px; padding: 10px 15px 10px 44px; border-radius: 999px; font-size: 12px; }
.header-search > span:not(.sr-only) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
#change-account { flex: 0 0 auto; min-height: 44px; padding: 10px 21px; border-radius: 16px; font-size: 12px; white-space: nowrap; }
#mobile-menu { display: none; position: relative; width: 44px; height: 44px; min-height: 44px; padding: 0; border: 0; background: transparent; box-shadow: none; color: var(--text); font-size: 0; }
#mobile-menu::before { content: ''; display: block; width: 18px; height: 2px; margin: auto; border-radius: 2px; background: currentColor; box-shadow: 0 -6px currentColor, 0 6px currentColor; }

/* Sidebar: one set of live categories and room controls, never duplicated. */
.app-sidebar { position: fixed; top: calc(var(--header-height) + 16px); bottom: 20px; left: var(--page-gutter); z-index: 30; width: var(--sidebar-width); padding: 0 4px 20px 0; overflow: auto; scrollbar-width: thin; scrollbar-color: var(--line) transparent; background: transparent; }
#sidebar-toggle { position: relative; width: 44px; height: 44px; margin: 0 0 20px 0; padding: 0; border-color: var(--line); border-radius: 50%; background: var(--glass-surface); box-shadow: var(--glass-shadow); font-size: 0; }
#sidebar-toggle::before { content: ''; position: absolute; left: 19px; top: 17px; width: 8px; height: 8px; border-left: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); }
.sidebar-navigation { display: grid; gap: 9px; margin-bottom: 30px; }
.sidebar-action { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='9' fill='none' stroke='black' stroke-width='1.7'/%3E%3Cpath d='m16 8-2.5 5.5L8 16l2.5-5.5Z' fill='black'/%3E%3C/svg%3E"); display: flex; align-items: center; gap: 15px; min-height: 44px; padding: 10px 12px; border: 0; border-radius: 11px; background: transparent; box-shadow: none; color: var(--text); font-size: 13px; font-weight: 500; text-align: left; }
.sidebar-action[data-nav='favorites'] { --nav-icon: var(--ui-favorite-outline); }
.sidebar-action[data-nav='sync'] { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='9' cy='7' r='3' fill='black'/%3E%3Ccircle cx='17.5' cy='8.5' r='2.5' fill='black'/%3E%3Cpath d='M2 21v-4a7 7 0 0 1 14 0v4Zm15-7a5 5 0 0 1 5 5v2h-4v-4a9 9 0 0 0-1-3Z' fill='black'/%3E%3C/svg%3E"); }
.sidebar-action .sidebar-icon, .sidebar-action:not(:has(.sidebar-icon, svg))::before { content: ''; flex: 0 0 20px; width: 20px; height: 20px; background: currentColor; -webkit-mask: var(--nav-icon) center / contain no-repeat; mask: var(--nav-icon) center / contain no-repeat; font-size: 0; }
.sidebar-action > svg { flex: 0 0 20px; width: 20px; height: 20px; }
.sidebar-action[data-nav='favorites'] .sidebar-icon { color: var(--accent-bright); }
.sidebar-action:hover:where(body[data-input-modality="mouse"] *) { background: var(--hover); box-shadow: none; }
.sidebar-action[aria-current='page'], .sidebar-action[aria-pressed='true'] { background: linear-gradient(90deg, var(--accent-soft), transparent); color: var(--text); box-shadow: inset 2px 0 var(--accent); }
.sidebar-categories { margin-top: 24px; }
.app-sidebar .category-sidebar { position: static; width: 100%; padding: 0; margin: 0; background: transparent; border: 0; box-shadow: none; }
.app-sidebar #categories-title { padding: 0 10px; margin: 0 0 13px; color: var(--text-muted); font-size: 12px; font-weight: 500; }
.app-sidebar #channel-categories { display: flex; flex-direction: column; gap: 1px; max-height: none; overflow: visible; }
.app-sidebar .category-button { display: block; flex: none; width: 100%; max-width: none; min-height: 40px; padding: 10px 13px; margin: 0; border: 0; border-radius: 10px; background: transparent; color: var(--text-muted); box-shadow: none; text-align: left; font-size: 12px; font-weight: 450; line-height: 1.45; }
.app-sidebar .category-button:hover:where(body[data-input-modality="mouse"] *) { background: var(--hover); color: var(--text); }
.app-sidebar .category-button[aria-pressed='true'] { color: var(--text); background: var(--accent-soft); box-shadow: inset 2px 0 var(--accent); }
.sidebar-footnote { margin: 28px 10px 0; color: var(--text-faint); font-size: 10px; line-height: 1.6; }
.sidebar-footnote > span { margin-right: 6px; font-size: 8px; }
.category-button::before { content: ''; display: inline-block; width: 15px; height: 15px; margin-right: 10px; vertical-align: -3px; background: currentColor; opacity: .8; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='3' y='3' width='7' height='7' rx='2' fill='none' stroke='black' stroke-width='1.7'/%3E%3Crect x='14' y='3' width='7' height='7' rx='2' fill='none' stroke='black' stroke-width='1.7'/%3E%3Crect x='3' y='14' width='7' height='7' rx='2' fill='none' stroke='black' stroke-width='1.7'/%3E%3Crect x='14' y='14' width='7' height='7' rx='2' fill='none' stroke='black' stroke-width='1.7'/%3E%3C/svg%3E") center / contain no-repeat; }
.favorites-category::before { color: var(--accent-bright); mask-image: var(--ui-favorite-outline); }
.sidebar-sports { margin: 24px 8px; color: var(--text-muted); }
.sidebar-sports button { width: 100%; padding: 10px 8px; border: 0; border-radius: 9px; background: transparent; box-shadow: none; color: var(--text-muted); text-align: left; font-size: 12px; }
.sidebar-sports button[aria-pressed='true'] { color: var(--text); background: var(--accent-soft); }
/* Local competition symbols carry their own charcoal/red artwork. Keep their
   colors in both themes; monochrome treatment remains for remote sport logos. */
#app-sidebar .sidebar-sports .sidebar-context-icon > img[src^='/assets/sports/competitions/'][src$='-v1.svg'] { filter: none; opacity: 1; }
.sidebar-backdrop { display: none; }
.app-main { min-width: 0; margin-left: 264px; padding: 0 0 0 8px; }
body:not(.connected):not(.hub-visible) .app-sidebar { display: none; }
body:not(.connected):not(.hub-visible) #mobile-menu { display: none; }
body:not(.connected):not(.hub-visible) .app-main { margin-left: 0; padding: 0; }
body.connection-open .app-sidebar { display: none; }
body.connection-open .app-main, body.connection-open.sidebar-collapsed.connected .app-main { margin-left: 0; padding: 0; }
body.connection-open #channel-catalog, body.connection-open #mobile-menu { display: none; }
body[data-view='favorites'] #channel-catalog { display: none; }
body[data-view='favorites'] #watch-history, body[data-mode='series'] #watch-history, body[data-mode='movie'] #watch-history { display: none; }
body.sidebar-collapsed .app-sidebar { width: var(--sidebar-rail); }
body.sidebar-collapsed.connected:not(.mobile-shell-active) .app-main, body.sidebar-collapsed.hub-visible:not(.mobile-shell-active) .app-main { margin-left: 104px; }
body.sidebar-collapsed #sidebar-toggle::before { left: 16px; transform: rotate(225deg); }
body.sidebar-collapsed .sidebar-action { justify-content: center; width: 48px; padding: 12px; }
body.sidebar-collapsed .sidebar-action > span:not(.sidebar-icon), body.sidebar-collapsed .sidebar-label { display: none; }
body.sidebar-collapsed .sidebar-categories, body.sidebar-collapsed .app-sidebar .category-sidebar, body.sidebar-collapsed .app-sidebar .sync-controls { display: none; }
body.sidebar-collapsed .sidebar-footnote, body.sidebar-collapsed .sidebar-sports { display: none; }

/* Open catalogue and the live channel cards. */
.card, .log-card, .catalog { border: 0; background: transparent; box-shadow: none; backdrop-filter: none; }
.catalog { display: block; padding: 0; margin: 0 0 32px; }
.catalog-content { min-width: 0; }
.catalog-heading { margin: 12px 0 24px; }
.catalog-heading h1 { max-width: none; font-size: clamp(27px, 2.65vw, 43px); font-weight: 650; line-height: 1.18; letter-spacing: -.035em; }
.catalog-heading .eyebrow { margin-bottom: 10px; font-size: 10px; letter-spacing: .15em; }
.catalog-filters { display: flex; align-items: end; flex-wrap: wrap; gap: 16px; }
.catalog-filters > .field:first-child { flex: 1; min-width: 180px; }
.catalog-filters #quality-default-control { flex: 0 0 230px; }
.catalog-filters input[type='search'] { padding-left: 17px; }
#channel-count { margin: 10px 0 25px; color: var(--text-muted); font-size: 12px; }
.channel-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 30px; }
.channel-shelf { min-width: 0; }
.channel-shelf > h2 { margin: 0 0 13px; color: var(--text); font-size: 20px; font-weight: 600; letter-spacing: -.025em; }
.channel-row { gap: 14px; padding: 3px 0 13px; scrollbar-color: var(--progress-rest) transparent; }
.channel-item { flex: 0 0 clamp(165px, 13.1vw, 228px); min-width: 0; border: 0; background: transparent; box-shadow: none; }
.channel-item:hover:where(body[data-input-modality="mouse"] *) { transform: translateY(-3px); }
.channel-item .channel-button { display: grid; gap: 8px; min-height: 0; padding: 0; border: 0; border-radius: var(--radius-cover); background: transparent; box-shadow: none; color: var(--text); font-size: 12px; text-align: left; }
.channel-item .channel-button:hover:where(body[data-input-modality="mouse"] *), .channel-item .channel-button:active { background: transparent; box-shadow: none; transform: none; }
.channel-item .channel-button > span:last-child { padding: 0 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.channel-artwork, .channel-button:nth-child(3n+2) .channel-artwork, .channel-button:nth-child(3n) .channel-artwork { aspect-ratio: 16 / 10; border: 0; border-radius: 10px; background: linear-gradient(145deg, #25272a, var(--media-surface)); box-shadow: 0 5px 12px rgb(0 0 0 / .10); }
.channel-artwork img { max-width: 82%; max-height: 62%; object-fit: contain; }
.channel-item[data-kind='movie'] .channel-artwork, .channel-item[data-kind='series'] .channel-artwork { aspect-ratio: 2 / 3; }
.channel-item[data-kind='movie'] img, .channel-item[data-kind='series'] img { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: cover; }
.channel-initials { color: #c1c3c8; font-size: 27px; letter-spacing: -.04em; }
.live-badge { position: absolute; left: 7px; bottom: 7px; min-width: 0; padding: 4px 7px; border: 0; border-radius: 999px; background: rgb(0 0 0 / .66); color: #f2efe8; font-size: 9px; font-weight: 500; letter-spacing: 0; }
.channel-quality-link { display: block; width: auto; min-height: 28px; margin: 3px 0 0; padding: 3px 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; color: var(--text-muted); font-size: 10px; font-weight: 450; }
.channel-quality-link:hover:where(body[data-input-modality="mouse"] *) { border-color: transparent; background: transparent; color: var(--text); }
.channel-now { border: 1px solid var(--line); border-radius: 12px; background: var(--surface-elevated); box-shadow: var(--dialog-shadow); }
.channel-now small { color: var(--accent-bright); }
.channel-now strong { color: var(--text); }
.channel-now span { color: var(--text-muted); }
.channel-grid { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 20px 16px; }
.catalog-content > .actions { justify-content: center; margin-top: 28px; }
#channel-page { color: var(--text-muted); font-size: 12px; }

/* The supplied bookmark/play symbol replaces every legacy yellow star. */
.favorite-toggle { top: 2px; right: 2px; z-index: 3; width: 44px; height: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 9px; background: transparent; box-shadow: none; color: var(--accent-bright); font-size: 0; }
.favorite-toggle::before, .favorite-symbol { content: ''; display: inline-block; width: 25px; height: 28px; background: currentColor; -webkit-mask: var(--ui-favorite-outline) center / contain no-repeat; mask: var(--ui-favorite-outline) center / contain no-repeat; }
.favorite-toggle[aria-pressed='true']::before, .favorite-symbol[data-saved='true'] { -webkit-mask-image: var(--ui-favorite-filled); mask-image: var(--ui-favorite-filled); }
.favorite-toggle:hover:where(body[data-input-modality="mouse"] *), .favorite-toggle:active { background: rgb(0 0 0 / .17); box-shadow: none; transform: none; color: var(--accent-bright); }
#player-favorite, #series-favorite { display: inline-flex; align-items: center; gap: 8px; color: var(--text); }
#player-favorite::before, #series-favorite::before { content: ''; width: 18px; height: 21px; flex: none; background: var(--accent-bright); -webkit-mask: var(--ui-favorite-outline) center / contain no-repeat; mask: var(--ui-favorite-outline) center / contain no-repeat; }
#player-favorite[aria-pressed='true']::before, #series-favorite[aria-pressed='true']::before { -webkit-mask-image: var(--ui-favorite-filled); mask-image: var(--ui-favorite-filled); }

/* Room controls share the narrow sidebar, preserving the original IDs. */
.app-sidebar .sync-controls { display: none; grid-template-columns: minmax(0, 1fr); align-items: stretch; gap: 14px; width: 100%; margin: 0 0 24px; padding: 0 8px; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
body[data-view='catalog'][data-mode='live'] .app-sidebar .sync-controls, body.sync-visible .app-sidebar .sync-controls { display: grid; }
body.sidebar-collapsed .app-sidebar .sync-controls { display: none; }
.app-sidebar .sync-heading { display: grid; gap: 8px; grid-column: 1 / -1; }
.app-sidebar .sync-heading h2 { color: var(--text); font-size: 13px; font-weight: 550; }
.app-sidebar .section-kicker { display: none; }
.app-sidebar .sync-status { color: var(--text-muted); font-size: 10px; }
.app-sidebar .sync-status i { flex: 0 0 6px; width: 6px; height: 6px; }
.app-sidebar #room-code { min-height: 42px; padding: 10px 12px; font-size: 12px; }
.app-sidebar .room-actions { display: grid; gap: 8px; }
.app-sidebar .room-actions button { width: 100%; min-height: 42px; font-size: 11px; }
.app-sidebar .sync-options { display: grid; gap: 10px; margin: 0; }
.app-sidebar .sync-help { color: var(--text-muted); font-size: 10px; line-height: 1.55; }
.toggle { color: var(--text-muted); font-size: 12px; }
.toggle > span { flex: 0 0 36px; background: var(--progress-rest); }
.toggle input:checked + span { background: var(--accent); }
.toggle input:focus-visible + span { outline: 2px solid var(--accent-bright); outline-offset: 4px; }
.app-sidebar .toggle { gap: 8px; font-size: 10px; }

/* First connection is a deliberate product screen, not a raw form. */
.login-screen { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 440px); align-items: center; gap: 64px; min-height: calc(100dvh - 160px); max-width: 1120px; margin: 0 auto; padding: 30px 12px 60px; }
.login-copy { margin: 0; max-width: 550px; }
.login-copy .eyebrow { margin-bottom: 18px; font-size: 10px; }
.login-copy h1 { font-size: clamp(38px, 4.5vw, 68px); font-weight: 650; line-height: 1.02; letter-spacing: -.055em; }
.login-copy .intro { max-width: 430px; margin-top: 24px; color: var(--text-muted); font-size: 14px; line-height: 1.7; }
.login-signature { display: flex; align-items: center; gap: 8px; height: 48px; margin-top: 38px; color: var(--accent); }
.login-signature > span { display: grid; place-items: center; width: 34px; font-size: 25px; }
.login-signature > i { width: 3px; height: 17px; border-radius: 4px; background: var(--text-faint); opacity: .45; }
.login-signature > i:nth-of-type(2) { height: 28px; opacity: .65; }
.login-signature > i:nth-of-type(3) { height: 10px; }
#channel-login { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 19px 16px; width: min(100%, 520px); padding: 30px; margin: 20px 0 36px; border: 1px solid var(--line-soft); border-radius: 22px; background: var(--surface); box-shadow: 0 20px 70px rgb(0 0 0 / .08); }
.login-screen #channel-login { width: 100%; margin: 0; }
.login-heading { grid-column: 1 / -1; margin: 0 0 3px; }
.login-heading h2, h2.login-heading { margin: 0 0 8px; font-size: 24px; font-weight: 600; letter-spacing: -.03em; }
.login-heading p { color: var(--text-muted); font-size: 12px; line-height: 1.6; }
#channel-login .actions { align-items: stretch; flex-direction: column; gap: 15px; }
#catalog-status { color: var(--text-muted); font-size: 11px; line-height: 1.55; }
#catalog-status[data-error='true'] { color: var(--accent-bright); }
#catalog-connect { min-height: 47px; width: 100%; }
.library-notice { margin: 16px 0; padding: 12px 16px; border: 0; border-left: 2px solid var(--accent); border-radius: 0; background: var(--hover); color: var(--text-muted); font-size: 12px; line-height: 1.6; }

/* Dialogs, manual tools and the full-screen player. */
dialog { color: var(--text); }
#series-details, #channel-quality-dialog, #episode-watch-confirm, .sports-channel-dialog, #content-details {
  max-height: calc(100dvh - 48px); padding: 28px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); color: var(--text); box-shadow: var(--dialog-shadow);
}
#series-details { width: min(760px, calc(100% - 40px)); }
#content-details { width: min(660px, calc(100% - 40px)); }
#content-details p { color: var(--text-muted); font-size: 13px; line-height: 1.7; }
#channel-quality-dialog { width: min(600px, calc(100% - 40px)); }
#episode-watch-confirm { width: min(480px, calc(100% - 40px)); }
.sports-channel-dialog { width: min(840px, calc(100% - 40px)); }
dialog::backdrop, #series-details::backdrop, #channel-quality-dialog::backdrop, #episode-watch-confirm::backdrop, .sports-channel-dialog::backdrop { background: rgb(0 0 0 / .72); backdrop-filter: blur(6px); }
.series-heading { align-items: center; gap: 18px; }
.series-heading h2, #episode-watch-title { color: var(--text); font-size: 23px; font-weight: 600; letter-spacing: -.03em; }
#series-status, #channel-quality-dialog p, #episode-watch-range, #episode-watch-target { color: var(--text-muted); font-size: 12px; line-height: 1.65; }
#series-details:has(#series-loading[aria-busy='true']) #series-status { display: none; }
.series-actions { gap: 10px; margin: 22px 0; }
.series-actions button { font-size: 12px; }
.quality-options { gap: 8px; }
.quality-options button { min-height: 48px; border-radius: 12px; color: var(--text-muted); }
.quality-options button[aria-pressed='true'] { color: var(--text); border-color: var(--accent); background-color: var(--accent-soft); }
#series-details .episode-list { display: grid; gap: 0; margin-top: 22px; }
#series-details .episode-row { border-color: var(--line-soft); background: transparent; }
#series-details .episode-row:hover:where(body[data-input-modality="mouse"] *) { background: var(--hover); }
#series-details .episode-play { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 58px; color: var(--text-muted); font-size: 12px; box-shadow: none; }
#series-details .episode-play::after { content: ''; flex: 0 0 14px; width: 14px; height: 16px; margin-right: 4px; background: var(--text-muted); -webkit-mask: var(--ui-play) center / contain no-repeat; mask: var(--ui-play) center / contain no-repeat; opacity: .8; }
#series-details .episode-play:hover:where(body[data-input-modality="mouse"] *) { color: var(--text); }
#series-details .episode-seen-toggle { min-height: 44px; color: var(--text-faint); background: transparent; box-shadow: none; }
#series-details .episode-seen-toggle[aria-pressed='true'], #series-details .episode-seen-toggle[aria-pressed='true']:hover:where(body[data-input-modality="mouse"] *) { color: var(--accent-bright); }
.episode-seen-tooltip { background: var(--surface-elevated); border-color: var(--line); color: var(--text); }
.episode-watch-actions { gap: 9px; }
.episode-watch-actions .episode-watch-cancel { border-color: transparent; background: transparent; box-shadow: none; color: var(--text-muted); }
.episode-watch-actions .episode-watch-cancel:hover:where(body[data-input-modality="mouse"] *) { background: var(--hover); color: var(--text); }
#player-screen { background: #050608; color: #f2efe8; }
#player-screen .player-card { background: #050608; border: 0; box-shadow: none; }
.player-toolbar { flex: none; align-items: center; gap: 12px; padding: 14px 20px; background: var(--surface); color: var(--text); border: 0; }
.player-toolbar h2 { min-width: 0; color: var(--text); font-size: 14px; font-weight: 550; }
.player-toolbar button { min-height: 40px; padding: 9px 15px; font-size: 11px; }
.player-fit-control { color: var(--text-muted); font-size: 10px; }
.player-fit-control select { min-height: 39px; max-width: 230px; padding: 9px 30px 9px 12px; font-size: 10px; background-position: calc(100% - 16px) 16px, calc(100% - 11px) 16px; }
#player-screen .video-wrap, #player-screen video { background: #050608; }
#player-screen .empty-state { color: #a9abb1; }
#player-screen .status-row { background: var(--surface); color: var(--text-muted); border: 0; }
#player-screen .stream-info { color: var(--text-muted); }
.next-episode-card { border-color: var(--line); background: var(--surface-elevated); color: var(--text); box-shadow: var(--dialog-shadow); }
.next-episode-card p { color: var(--accent-bright); }
#next-episode-countdown { color: var(--text-muted); }
.episode-controls { gap: 8px; }
.episode-controls-panel { color: var(--text); }
.episode-controls-panel > summary { min-height: 40px; padding: 10px 14px; border: 1px solid var(--glass-border); border-radius: 999px; background: var(--glass-surface); background-image: var(--glass-background); color: var(--text); box-shadow: var(--glass-shadow); }
.episode-controls-panel > summary:hover:where(body[data-input-modality="mouse"] *) { background-color: var(--surface-elevated); }
.episode-controls-form { z-index: 10; top: 78px; padding: 22px; border-color: var(--line); border-radius: 18px; background: var(--surface); color: var(--text); box-shadow: var(--dialog-shadow); }
.episode-controls-context, .episode-controls-hint, .episode-controls-status, .episode-controls-check, .episode-controls-field { color: var(--text-muted); }
.episode-controls-group, .episode-controls-actions { border-color: var(--line-soft); }
.episode-controls-group h3 { color: var(--text); font-weight: 550; }
.episode-controls-field input, .episode-controls-field select { border-color: var(--line); background-color: var(--field-surface); color: var(--text); }
.episode-controls-field input:focus, .episode-controls-field select:focus { outline-color: var(--accent-bright); }
.episode-controls-check input { accent-color: var(--accent); }
.episode-controls-status[data-error='true'] { color: var(--accent-bright); }
.advanced-settings { margin: 32px 0 0; padding: 0; border: 0; background: transparent; color: var(--text-muted); }
.advanced-settings > summary, .log-card > summary { padding: 14px 0; color: var(--text-muted); font-size: 11px; font-weight: 450; cursor: pointer; }
.advanced-settings .controls { padding: 20px 0; margin: 0; }
.log-card { margin: 12px 0 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.log-card summary span { background: var(--hover); color: var(--text-muted); }
.log-toolbar, #event-log { border: 0; }
.log-toolbar { padding: 0; }
.log-toolbar button { min-height: 36px; padding: 7px 10px; color: var(--text-muted); background: transparent; box-shadow: none; border: 0; }
#event-log li { border-color: var(--line-soft); color: var(--text-muted); }
#event-log time { color: var(--text-faint); }
#event-log .error span { color: var(--accent-bright); }
.note { font-size: 10px; line-height: 1.6; }
.history-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px 24px; }
.history-button.secondary-button { position: relative; min-height: 58px; padding: 10px 32px 10px 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; color: var(--text); }
.history-button.secondary-button:hover:where(body[data-input-modality="mouse"] *) { background: transparent; color: var(--text); }
.history-button::after { content: ''; position: absolute; width: 11px; height: 14px; right: 8px; top: 22px; background: var(--text-muted); mask: var(--ui-play) center / contain no-repeat; }
.history-button small { color: var(--text-muted); font-size: 11px; }
@media (min-width: 721px) {
  body.sidebar-collapsed .app-sidebar .category-sidebar, body.sidebar-collapsed .sidebar-sports { display: block; }
  body.sidebar-collapsed #categories-title { display: none; }
  body.sidebar-collapsed .app-sidebar .category-button { width: 44px; min-height: 44px; padding: 12px; font-size: 0; }
  body.sidebar-collapsed .category-button::before { display: block; width: 18px; height: 18px; margin: 0; }
}

/* Picker inherits the theme without changing its asynchronous renderer. */
.sports-channel-dialog .sc-channel-row { min-height: 72px; border: 0; border-radius: 0; background: transparent; box-shadow: none; color: var(--text); }
.sports-channel-dialog .sc-channel-row:hover:where(body[data-input-modality="mouse"] *) { background: var(--hover); }
.sc-hint, .sc-footnote, .sc-count, .sc-quality, .sc-program-time, .sc-unavailable, .sc-pager { color: var(--text-muted); }
.sc-requested-match, .sc-program-title { color: var(--text); }
.sc-requested-match { border-color: var(--accent); }
.sc-badge { color: var(--text-muted); }
.sc-badge img { background: transparent; }
.sc-close { min-height: 44px; width: 44px; height: 44px; border: 0; background: transparent; box-shadow: none; color: var(--text-muted); }
.sc-play { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 50%; color: var(--text-muted); font-size: 10px; }

/* Optional native progress hooks for the presentation module. */
.progress-track { height: 3px; overflow: visible; border-radius: 999px; background: var(--progress-rest); }
.progress-fill { position: relative; display: block; height: 100%; border-radius: inherit; background: var(--accent); box-shadow: 0 0 6px rgb(227 19 50 / .48); }
.progress-fill::after { content: ''; position: absolute; top: 50%; right: 0; width: 4px; height: 4px; transform: translate(50%, -50%); border-radius: 50%; background: var(--accent-bright); box-shadow: 0 0 8px 2px rgb(227 19 50 / .35); }
.progress-fill[style*='width: 0%'], .progress-fill[style*='width:0%'] { box-shadow: none; }
.progress-fill[style*='width: 0%']::after, .progress-fill[style*='width:0%']::after { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

@media (max-width: 1400px) {
  .topbar { gap: 16px; }
  .brand { flex-basis: 220px; font-size: 27px; }
  .catalog-tabs { gap: 1px; }
  .catalog-tabs button { padding: 10px 12px; font-size: 12px; }
  .header-tools { gap: 10px; }
  .header-search { width: clamp(150px, 15vw, 230px); }
  #change-account { padding-inline: 15px; }
}
@media (max-width: 1180px) {
  :root { --page-gutter: 24px; }
  .topbar { gap: 12px; }
  .brand { flex-basis: 170px; font-size: 25px; }
  .catalog-tabs button { padding-inline: 9px; font-size: 11px; }
  .header-search { width: 155px; }
  #change-account { max-width: 125px; padding-inline: 11px; font-size: 10px; }
  .header-tools { gap: 5px; }
  .login-screen { gap: 30px; grid-template-columns: minmax(0, 1fr) minmax(300px, 390px); }
}
@media (max-width: 980px) {
  :root { --header-height: 118px; --page-gutter: 20px; }
  .topbar { flex-wrap: wrap; align-content: center; justify-content: space-between; gap: 8px 18px; padding-top: 12px; padding-bottom: 6px; }
  .brand { flex: 1 1 auto; }
  .header-tools { flex: 0 1 auto; }
  .header-search { width: min(28vw, 230px); }
  #change-account { max-width: none; font-size: 11px; }
  .catalog-tabs { flex: 0 0 100%; order: 3; justify-content: center; gap: 6px; width: 100%; padding: 0; }
  .catalog-tabs button { min-height: 38px; padding: 8px 17px; font-size: 11px; }
  .app-sidebar { width: 188px; }
  .app-main { margin-left: 216px; padding: 0; }
  .sidebar-action { gap: 12px; font-size: 12px; }
  .login-screen { display: block; min-height: auto; max-width: 560px; padding: 20px 0 44px; }
  .login-copy { margin-bottom: 32px; }
  .login-copy h1 { max-width: 500px; font-size: 44px; }
  .login-copy .intro { max-width: 480px; margin-top: 16px; }
  .login-screen #channel-login { max-width: 480px; }
  .episode-controls-form { top: 126px; }
}
@media (max-width: 720px) {
  :root { --page-gutter: 16px; }
  .shell { padding-top: calc(var(--header-height) + 18px); }
  .topbar { gap: 8px 12px; }
  .brand { flex: 0 0 auto; font-size: 23px; }
  .header-tools { gap: 4px; flex: 1; justify-content: flex-end; }
  .header-search { width: min(31vw, 205px); }
  #header-search { min-height: 40px; padding-left: 34px; font-size: 10px; }
  .header-search::before { left: 12px; width: 15px; height: 15px; }
  #theme-toggle { flex-basis: 30px; width: 30px; }
  #theme-toggle::before { width: 20px; height: 20px; }
  #change-account { min-height: 40px; padding: 9px 10px; border-radius: 13px; font-size: 10px; }
  .catalog-tabs { justify-content: flex-start; gap: 4px; overflow: auto; }
  .catalog-tabs button { flex: 1 0 auto; min-height: 40px; padding: 8px 11px; font-size: 11px; border-radius: 14px; }
  .app-sidebar, body.sidebar-collapsed .app-sidebar { top: calc(var(--header-height) + 10px); bottom: 12px; left: 10px; width: 48px; padding: 0; overflow: visible; }
  #sidebar-toggle { margin-bottom: 18px; width: 42px; height: 42px; }
  .sidebar-navigation { gap: 10px; }
  .sidebar-action, body.sidebar-collapsed .sidebar-action { justify-content: center; width: 44px; min-height: 44px; padding: 12px; }
  .sidebar-action > span:not(.sidebar-icon), .sidebar-label { display: none; }
  .app-sidebar .category-sidebar, .sidebar-categories, .app-sidebar .sync-controls { display: none; }
  .app-main, body.sidebar-collapsed .app-main { margin-left: 54px; padding: 0; }
  body.sidebar-open .app-sidebar, body.sidebar-open.sidebar-collapsed .app-sidebar { z-index: 50; top: var(--header-height); bottom: 0; left: 0; width: min(280px, calc(100vw - 56px)); padding: 18px 20px 28px; overflow: auto; background: var(--sidebar-surface); box-shadow: 20px 0 60px rgb(0 0 0 / .25); }
  body.sidebar-open .sidebar-action, body.sidebar-open.sidebar-collapsed .sidebar-action { justify-content: flex-start; width: 100%; }
  body.sidebar-open .sidebar-action > span:not(.sidebar-icon), body.sidebar-open .sidebar-label { display: inline; }
  body.sidebar-open .sidebar-categories, body.sidebar-open .app-sidebar .category-sidebar { display: block; }
  body.sidebar-open[data-view='live'] .app-sidebar .sync-controls, body.sidebar-open.sync-visible .app-sidebar .sync-controls { display: grid; }
  body.sidebar-open #sidebar-toggle::before { left: 18px; transform: rotate(45deg); }
  .catalog-heading { margin-top: 6px; margin-bottom: 18px; }
  .catalog-heading h1 { font-size: 26px; }
  .catalog-filters { gap: 12px; }
  .catalog-filters > .field, .catalog-filters #quality-default-control { flex: 1 1 100%; min-width: 0; }
  .catalog-filters select { min-width: 0; }
  .channel-shelf > h2 { font-size: 17px; }
  .channel-item { flex-basis: 170px; }
  .channel-grid { grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); gap: 18px 12px; }
  .channel-list { gap: 24px; }
  .catalog-content > .actions { flex-direction: row; gap: 12px; }
  .catalog-content > .actions button { width: auto; font-size: 11px; padding-inline: 14px; }
  .login-copy h1 { font-size: 36px; }
  .login-copy .intro { font-size: 12px; }
  #channel-login { grid-template-columns: minmax(0, 1fr); padding: 24px 20px; }
  #channel-login .field-wide, #channel-login .login-heading { grid-column: 1; }
  #series-details, #channel-quality-dialog, #episode-watch-confirm, .sports-channel-dialog { padding: 22px 18px; border-radius: 16px; max-height: calc(100dvh - 30px); }
  .series-heading h2, #episode-watch-title { font-size: 20px; }
  .series-actions button { font-size: 11px; }
  .player-toolbar { padding: 10px 12px; gap: 9px; }
  .player-toolbar h2 { flex: 1 1 130px; font-size: 12px; }
  .player-toolbar button { min-height: 40px; padding: 8px 12px; font-size: 10px; }
  .player-fit-control { width: auto; flex: 1 1 160px; }
  .player-fit-control select { max-width: none; }
  .episode-controls-form { top: 118px; right: 12px; left: 12px; width: auto; padding: 18px; max-height: calc(100dvh - 140px); }
  .next-episode-card { right: 12px; bottom: 65px; padding: 16px; }
  .next-episode-card > div { flex-direction: column; }
  #event-log li { grid-template-columns: 58px 1fr; gap: 8px; padding: 10px 0; font-size: 10px; }
}
@media (max-width: 420px) {
  .brand { font-size: 21px; }
  .topbar { column-gap: 8px; }
  .header-search { width: 92px; }
  #change-account { position: relative; flex: 0 0 44px; width: 44px; max-width: 44px; min-height: 44px; padding: 0; font-size: 0; }
  #change-account::before { content: ''; display: block; width: 19px; height: 19px; margin: auto; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='9' cy='7' r='3' fill='none' stroke='black' stroke-width='1.7'/%3E%3Cpath d='M3 21v-3a6 6 0 0 1 10-4M14 10h8m-3-3 3 3-3 3' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='9' cy='7' r='3' fill='none' stroke='black' stroke-width='1.7'/%3E%3Cpath d='M3 21v-3a6 6 0 0 1 10-4M14 10h8m-3-3 3 3-3 3' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }
  #theme-toggle { flex-basis: 36px; width: 36px; }
  .catalog-tabs button { padding-inline: 9px; font-size: 10px; }
  #favorites-count { display: none; }
  .app-main, body.sidebar-collapsed .app-main { margin-left: 46px; }
  .channel-grid { grid-template-columns: minmax(0, 1fr); }
  .catalog-heading h1 { font-size: 23px; }
  .catalog-heading .eyebrow { font-size: 9px; }
}
/* A full-width search remains usable on small phones. The mobile drawer
   replaces the desktop rail rather than taking width from the catalogue. */
@media (max-width: 720px) {
  :root { --header-height: 160px; }
  .topbar { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px 44px; grid-template-rows: 44px 44px 40px; align-content: center; gap: 5px 8px; padding-top: 10px; padding-bottom: 10px; }
  #mobile-menu { display: block; grid-column: 1; grid-row: 1; }
  .brand { grid-column: 2; grid-row: 1; font-size: 24px; }
  .header-tools { display: contents; }
  #theme-toggle { grid-column: 3; grid-row: 1; width: 44px; min-height: 44px; }
  #change-account { position: relative; grid-column: 4; grid-row: 1; width: 44px; max-width: 44px; min-height: 44px; padding: 0; font-size: 0; }
  #change-account::before { content: ''; display: block; width: 19px; height: 19px; margin: auto; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='9' cy='7' r='3' fill='none' stroke='black' stroke-width='1.7'/%3E%3Cpath d='M3 21v-3a6 6 0 0 1 10-4M14 10h8m-3-3 3 3-3 3' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='9' cy='7' r='3' fill='none' stroke='black' stroke-width='1.7'/%3E%3Cpath d='M3 21v-3a6 6 0 0 1 10-4M14 10h8m-3-3 3 3-3 3' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }
  .header-search { grid-column: 1 / -1; grid-row: 2; width: 100%; }
  #header-search { min-height: 44px; padding-left: 41px; font-size: 12px; }
  .header-search::before { left: 15px; width: 18px; height: 18px; }
  .catalog-tabs { grid-column: 1 / -1; grid-row: 3; width: 100%; }
  .catalog-tabs button { min-height: 40px; padding-inline: 12px; font-size: 11px; }
  .app-sidebar, body.sidebar-collapsed .app-sidebar { display: none; }
  .app-main, body.sidebar-collapsed .app-main, body.sidebar-collapsed.connected .app-main, body.sidebar-collapsed.hub-visible .app-main { margin-left: 0; }
  body.sidebar-open .app-sidebar, body.sidebar-open.sidebar-collapsed .app-sidebar { display: block; }
  body.sidebar-open .sidebar-footnote, body.sidebar-open .sidebar-sports { display: block; }
  body.sidebar-open .sidebar-backdrop:not([hidden]) { position: fixed; inset: var(--header-height) 0 0; z-index: 45; display: block; width: 100%; height: auto; margin: 0; border: 0; border-radius: 0; background: rgb(0 0 0 / .55); box-shadow: none; }
  .episode-controls-form { top: 118px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  .channel-item:hover:where(body[data-input-modality="mouse"] *) { transform: none; }
}
/* External rating marks: one quiet visual language across heroes and cards. */
.service-rating { display: inline-flex; align-items: center; justify-content: flex-start; gap: 5px; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--text-muted, #a9abb1); font-size: 11px; font-weight: 500; line-height: 20px; font-variant-numeric: tabular-nums; white-space: nowrap; text-decoration: none; transition: color 180ms ease; }
.service-rating .service-rating-logo { display: block; flex: 0 0 16px; width: 16px; max-width: none; height: 16px; margin: 0 1px 0 0; object-fit: contain; filter: invert(1); opacity: .62; pointer-events: none; transition: opacity 180ms ease; }
.service-rating[data-source='imdb'] .service-rating-logo { flex-basis: 31px; width: 31px; height: 14px; opacity: .82; }
.service-rating .service-rating-value { color: var(--text, #f2efe8); font-size: inherit; }
.service-rating .service-rating-scale { margin-left: -4px; color: var(--text-muted, #a9abb1); font-size: .82em; }
a.service-rating:is(:hover:where(body[data-input-modality="mouse"] *), :focus-visible) { color: var(--accent-bright, #ed263d); }
a.service-rating:is(:hover:where(body[data-input-modality="mouse"] *), :focus-visible) .service-rating-logo { opacity: 1; }
[data-theme='light'] .service-rating .service-rating-logo { filter: none; }
@media (prefers-reduced-motion: reduce) { .service-rating, .service-rating .service-rating-logo { transition: none; } }
/* A live-only catch-up action lives with playback status, clear of the image. */
#player-screen .player-live-delay { display: flex; flex: 0 0 auto; align-items: center; gap: 12px; }
#player-screen .player-live-delay[hidden] { display: none; }
#player-screen .live-delay-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 34px; padding: 7px 12px; border-color: color-mix(in srgb, var(--accent) 26%, var(--line)); border-radius: 999px; font-size: 11px; font-weight: 500; white-space: nowrap; }
#player-screen .live-delay-icon { flex: 0 0 17px; width: 17px; height: 17px; color: var(--accent-bright, #ef2541); }
#player-live-delay-status { min-width: 100px; color: var(--text-muted); font-size: 10px; font-variant-numeric: tabular-nums; white-space: nowrap; }
#player-live-delay[data-state='near_live'] #player-live-delay-status::before { content: ''; display: inline-block; width: 5px; height: 5px; margin-right: 6px; border-radius: 50%; background: var(--accent-bright, #ef2541); box-shadow: 0 0 8px #e3133250; vertical-align: 1px; }
#player-live-delay[data-state='adjusting'] .live-delay-icon { animation: live-delay-pulse 850ms ease-in-out infinite alternate; }
@keyframes live-delay-pulse { from { opacity: .4; transform: translateX(-2px); } to { opacity: 1; transform: translateX(1px); } }
@media (max-width: 720px) { #player-screen .status-row:has(.player-live-delay:not([hidden])) { flex-wrap: wrap; gap: 8px 12px; padding-block: 10px; } #player-screen .player-live-delay { order: 2; flex-basis: 100%; justify-content: center; gap: 10px; } #player-screen .status-row:has(.player-live-delay:not([hidden])) .stream-info { margin-left: auto; } }
@media (prefers-reduced-motion: reduce) { #player-live-delay[data-state='adjusting'] .live-delay-icon { animation: none; } }
