:root {
  color-scheme: dark;
  --bg: #0d2435;
  --panel: #111127;
  --panel-strong: #162f42;
  --text: #eefaf7;
  --muted: rgba(255, 255, 255, 0.58);
  --accent: #00d9a7;
  --accent-alt: #2ef2c2;
  --danger: #ff6b6b;
  --line: rgba(255, 255, 255, 0.1);
  --surface: rgba(255, 255, 255, 0.06);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  padding: 8px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(13, 36, 53, 0.94);
  backdrop-filter: blur(18px);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-lockup img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  object-position: left center;
}

.brand-lockup h1 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
}

.brand-lockup p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.topbar-actions,
.tools-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.icon-button,
.primary-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  min-height: 36px;
  padding: 0 12px;
  font-size: 13px;
}

.primary-button {
  width: 100%;
  background: var(--accent);
  color: #02100d;
  border-color: transparent;
  font-weight: 800;
}

.primary-button.is-loading,
.icon-button.is-loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.primary-button.is-loading::before,
.icon-button.is-loading::before,
.status-text.loading::before {
  content: "";
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  animation: spin 0.72s linear infinite;
}

.layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: calc(100vh - 58px);
  flex: 1;
}

.player-region,
.sidebar,
.panel {
  background: transparent;
}

.player-region {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 16px;
  gap: 14px;
  overflow: auto;
}

.video-frame {
  position: relative;
  background: #000;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

video {
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
  object-fit: contain;
}

.video-frame::before {
  content: "";
  position: absolute;
  inset: 12%;
  background: var(--poster-logo) center / contain no-repeat;
  opacity: 0.68;
  pointer-events: none;
}

.video-frame.has-video::before {
  display: none;
}

.player-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  color: rgba(255, 255, 255, 0.78);
  text-align: center;
  padding: 24px;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.8);
}

.player-overlay[hidden] {
  display: none;
}

.player-overlay p.loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.player-overlay p.loading::before {
  content: "";
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  animation: spin 0.72s linear infinite;
}

.now-bar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 0 2px;
  align-items: center;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent-alt);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.now-bar h2,
.panel h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0;
}

.now-bar p,
.panel p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--accent-alt);
  font-size: 12px;
  font-weight: 800;
}

.sidebar {
  padding: 10px;
  max-height: calc(100vh - 58px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--panel);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.is-activated .activation-panel {
  display: none;
}

.needs-activation {
  min-height: 100vh;
  overflow: hidden;
}

.needs-activation .topbar,
.needs-activation .mode-panel,
.needs-activation .player-region,
.needs-activation .category-panel,
.needs-activation .sidebar-device-panel {
  display: none;
}

.needs-activation .layout {
  display: block;
  min-height: 100vh;
  padding: 0;
}

.needs-activation .sidebar {
  display: contents;
  width: auto;
  max-height: none;
  padding: 0;
  border: 0;
  background: transparent;
}

.needs-activation .activation-panel {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
  gap: clamp(24px, 5vw, 56px);
  align-items: center;
  justify-content: center;
  padding: clamp(28px, 6vw, 72px);
  border: 0;
  border-radius: 0;
  background:
    radial-gradient(circle at 78% 22%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 34%),
    linear-gradient(135deg, color-mix(in srgb, var(--panel) 76%, #020706), var(--bg));
  overflow: auto;
}

.needs-activation .activation-panel h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.05;
}

.needs-activation .activation-panel p {
  margin: 12px 0 0;
  max-width: 480px;
  font-size: 17px;
  line-height: 1.45;
  color: color-mix(in srgb, var(--text) 72%, transparent);
}

.activation-copy {
  max-width: 620px;
}

.activation-brand {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: clamp(28px, 5vw, 42px);
}

.activation-brand img {
  width: clamp(64px, 9vw, 86px);
  height: clamp(64px, 9vw, 86px);
  object-fit: contain;
  object-position: left center;
}

.activation-brand strong,
.activation-brand span {
  display: block;
}

.activation-brand strong {
  font-size: clamp(30px, 4vw, 42px);
  font-weight: 800;
  line-height: 1.05;
}

.activation-brand span {
  margin-top: 5px;
  color: var(--accent-alt);
  font-size: clamp(15px, 1.7vw, 18px);
}

.activation-code-card {
  padding: clamp(22px, 4vw, 36px);
  border: 1px solid color-mix(in srgb, var(--accent) 34%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
}

.needs-activation .identity-box {
  margin: 0;
}

.panel {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.identity-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, transparent);
  border-radius: 8px;
  background: rgba(0, 217, 167, 0.06);
}

.identity-box span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.identity-box strong {
  overflow-wrap: anywhere;
  font-size: 14px;
  letter-spacing: 0;
  line-height: 1.25;
}

.identity-box strong:first-of-type {
  color: var(--accent);
  font-size: clamp(30px, 2.4vw, 42px);
  font-weight: 900;
  letter-spacing: 2px;
  text-align: center;
  white-space: nowrap;
}

.sidebar-device-panel {
  display: grid;
  gap: 5px;
  margin-top: auto;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.sidebar-device-panel span {
  color: rgba(255, 255, 255, 0.42);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.sidebar-device-panel strong {
  color: rgba(255, 255, 255, 0.78);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input,
select {
  min-height: 36px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--text);
  outline: none;
  font-size: 14px;
}

input:focus,
select:focus {
  border-color: color-mix(in srgb, var(--accent) 78%, white);
}

.top-search {
  flex: 1;
  max-width: 520px;
}

.top-search span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.status-text {
  min-height: 18px;
}

.status-text.loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.status-text.error {
  color: var(--danger);
}

.global-loading {
  position: fixed;
  z-index: 1200;
  left: 50%;
  bottom: 22px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: min(520px, calc(100vw - 32px));
  min-height: 44px;
  transform: translateX(-50%);
  padding: 10px 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 38%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel) 92%, black);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.38);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.needs-activation .global-loading {
  bottom: clamp(18px, 4vw, 34px);
}

.ios-install-prompt {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: grid;
  align-items: end;
  padding: 18px;
  background: rgba(0, 0, 0, 0.58);
}

.ios-install-prompt[hidden] {
  display: none;
}

.ios-install-card {
  position: relative;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 16px;
  width: min(560px, 100%);
  margin: 0 auto;
  padding: 18px;
  padding-bottom: max(18px, env(safe-area-inset-bottom));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(10, 28, 24, 0.98);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

.ios-install-card img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 8px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.ios-install-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}

.ios-install-content {
  min-width: 0;
  padding-right: 26px;
}

.ios-install-content h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.14;
}

.ios-install-copy {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.ios-install-content ol {
  margin: 14px 0 0;
  padding-left: 19px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  line-height: 1.5;
}

.ios-install-content li + li {
  margin-top: 4px;
}

.ios-install-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 16px;
}

.loading-spinner {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border: 2px solid color-mix(in srgb, var(--accent) 86%, white);
  border-right-color: transparent;
  border-radius: 999px;
  animation: spin 0.72s linear infinite;
}

.loading-card {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  color: color-mix(in srgb, var(--text) 82%, transparent);
  font-size: 13px;
  font-weight: 800;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.list-window-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.channel-list {
  overflow: auto;
  display: grid;
  gap: 6px;
  padding-right: 2px;
  min-height: 0;
}

.load-more-button {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.load-more-button:hover {
  border-color: color-mix(in srgb, var(--accent) 72%, white);
  background: color-mix(in srgb, var(--panel-strong) 78%, var(--accent) 22%);
}

.channel-card {
  display: grid;
  grid-template-columns: 56px 48px minmax(0, 1fr) 34px;
  gap: 10px;
  align-items: start;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.favorite-button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.62);
  font-size: 18px;
  line-height: 1;
  display: grid;
  place-items: center;
  padding: 0;
}

.favorite-button:hover,
.favorite-button.active {
  border-color: color-mix(in srgb, var(--accent-alt) 72%, white);
  background: color-mix(in srgb, var(--panel-strong) 74%, var(--accent-alt) 26%);
  color: var(--accent-alt);
}

.channel-card:hover,
.channel-card.active {
  border-color: color-mix(in srgb, var(--accent) 72%, white);
  background: color-mix(in srgb, var(--panel-strong) 78%, var(--accent) 22%);
}

.channel-logo {
  width: 48px;
  aspect-ratio: 1;
  border-radius: 6px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.08);
  padding: 6px;
}

.channel-number {
  color: rgba(255, 255, 255, 0.42);
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.channel-card strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.channel-main {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.channel-subtitle {
  display: block;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  flex: 1;
  min-height: 0;
}

.category-panel select {
  display: none;
}

.mode-panel {
  display: grid;
  gap: 4px;
}

.mode-button {
  width: 100%;
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  padding: 0 10px;
  background: transparent;
  color: rgba(255, 255, 255, 0.66);
  font-size: 13px;
  font-weight: 800;
  text-align: left;
}

.mode-button:hover,
.mode-button.active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.mode-button.active {
  box-shadow: inset 3px 0 0 var(--accent);
}

.sidebar-section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 2px 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  font-weight: 800;
}

.sidebar-section-title small {
  color: rgba(255, 255, 255, 0.36);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.category-list {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 3px;
  padding-right: 2px;
}

.tree-section-label {
  padding: 10px 10px 4px;
  color: rgba(255, 255, 255, 0.34);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.country-section {
  display: grid;
  gap: 2px;
}

.tree-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  gap: 3px;
  align-items: center;
  min-width: 0;
}

.country-button,
.category-button {
  width: 100%;
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  padding: 0 10px;
  background: transparent;
  color: rgba(255, 255, 255, 0.66);
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tree-favorite-button {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 6px;
  padding: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.42);
  font-size: 17px;
  line-height: 1;
}

.tree-favorite-button:hover,
.tree-favorite-button.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent-alt);
}

.country-button {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
}

.tree-chevron {
  color: rgba(255, 255, 255, 0.36);
  font-size: 11px;
  text-align: center;
}

.country-groups {
  display: grid;
  gap: 2px;
  padding-left: 16px;
}

.category-button:hover,
.category-button.active,
.country-button:hover,
.country-button.active,
.country-button.expanded {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.category-button.active,
.country-button.active {
  box-shadow: inset 3px 0 0 var(--accent);
}

.channel-section {
  min-height: 0;
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.12);
}

.guide-section,
.catchup-section,
.media-section {
  min-height: 420px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.12);
}

[hidden] {
  display: none !important;
}

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

.channel-section-head h2 {
  margin: 0;
  font-size: 17px;
}

.channel-epg {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 6px;
  min-width: 0;
}

.channel-epg-empty {
  display: block;
  color: var(--muted);
  font-size: 12px;
  min-height: 28px;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(22, 33, 62, 0.54);
}

.channel-programme {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  padding: 6px 8px;
  background: rgba(22, 33, 62, 0.82);
  color: rgba(255, 255, 255, 0.7);
  text-align: left;
  min-width: 0;
}

.channel-programme:hover,
.channel-programme.current {
  background: color-mix(in srgb, var(--accent) 26%, rgba(22, 33, 62, 0.82));
  color: #fff;
}

.channel-programme.current {
  box-shadow: inset 0 0 0 1px var(--accent);
}

.channel-programme.catchup,
.programme-card.catchup {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent-alt) 70%, transparent);
  cursor: pointer;
}

.channel-programme.catchup:hover,
.programme-card.catchup:hover {
  background: color-mix(in srgb, var(--accent-alt) 24%, rgba(22, 33, 62, 0.82));
  color: #fff;
}

.channel-programme b,
.programme-card b {
  color: var(--accent-alt);
  font-size: 10px;
  text-transform: uppercase;
}

.channel-programme strong,
.channel-programme span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-programme strong {
  font-size: 12px;
}

.channel-programme span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.guide-list {
  display: grid;
  gap: 6px;
}

.catchup-day-controls {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-gutter: stable;
}

.catchup-day-button {
  flex: 0 0 auto;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.catchup-day-button:hover,
.catchup-day-button.active {
  border-color: color-mix(in srgb, var(--accent) 72%, white);
  background: color-mix(in srgb, var(--accent) 22%, rgba(255, 255, 255, 0.055));
  color: var(--text);
}

.guide-row {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.guide-row:hover {
  border-color: color-mix(in srgb, var(--accent) 72%, white);
}

.guide-channel {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
  cursor: pointer;
}

.guide-channel strong,
.guide-channel span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.guide-channel span span {
  color: var(--muted);
  font-size: 12px;
}

.guide-programmes {
  display: flex;
  gap: 6px;
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  padding-bottom: 2px;
  scrollbar-gutter: stable;
}

.guide-programmes::-webkit-scrollbar,
.catchup-day-controls::-webkit-scrollbar {
  height: 8px;
}

.guide-programmes::-webkit-scrollbar-thumb,
.catchup-day-controls::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 36%, rgba(255, 255, 255, 0.22));
}

.programme-card,
.guide-empty {
  flex: 0 0 220px;
  min-height: 54px;
  border: 0;
  border-radius: 6px;
  padding: 7px 8px;
  background: rgba(22, 33, 62, 0.82);
  color: rgba(255, 255, 255, 0.64);
  font-size: 12px;
}

.programme-card.current {
  border: 1px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 26%, rgba(22, 33, 62, 0.82));
  color: #fff;
}

.programme-card strong,
.programme-card span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.programme-card span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.media-view .video-frame,
.media-view .now-bar,
.guide-view .video-frame,
.guide-view .now-bar,
.catchup-view .video-frame,
.catchup-view .now-bar {
  display: none;
}

.media-list {
  display: grid;
  gap: 18px;
}

.media-country {
  display: grid;
  gap: 10px;
}

.media-country h3 {
  margin: 0;
  color: var(--text);
  font-size: 17px;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 14px;
}

.media-card {
  position: relative;
  display: grid;
  grid-template-rows: minmax(190px, 1fr) auto auto;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.media-favorite {
  position: absolute;
  z-index: 2;
  top: 16px;
  right: 16px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.34);
}

.media-card:hover,
.media-card.active {
  border-color: color-mix(in srgb, var(--accent) 72%, white);
  background: color-mix(in srgb, var(--panel-strong) 78%, var(--accent) 22%);
}

.media-card img {
  width: 100%;
  height: 100%;
  min-height: 190px;
  object-fit: cover;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
}

.media-card strong,
.media-card span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

@media (max-width: 760px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    max-height: none;
    order: 2;
    border-right: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  .category-list {
    display: none;
  }

  .category-panel {
    grid-template-rows: auto auto;
  }

  .category-panel select {
    display: block;
  }

  .player-region {
    order: 1;
  }

  .needs-activation .activation-panel {
    grid-template-columns: 1fr;
    align-content: center;
  }

  .video-frame {
    max-height: none;
  }

  .guide-row {
    grid-template-columns: 1fr;
  }

  .guide-programmes {
    display: flex;
    overflow-x: auto;
  }

  .programme-card,
  .guide-empty {
    flex-basis: 76vw;
  }
}

@media (max-width: 620px) {
  .topbar,
  .now-bar {
    align-items: stretch;
    flex-direction: column;
  }

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

  .topbar-actions {
    width: 100%;
  }

  .topbar-actions button {
    flex: 1;
  }

  .top-search {
    max-width: none;
    width: 100%;
  }

  .player-region {
    padding: 10px;
  }

  .channel-card {
    grid-template-columns: 44px 42px minmax(0, 1fr) 34px;
  }

  .ios-install-prompt {
    padding: 10px;
  }

  .ios-install-card {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .ios-install-card img {
    width: 56px;
    height: 56px;
  }

  .ios-install-content {
    padding-right: 0;
  }

  .ios-install-actions {
    grid-template-columns: 1fr;
  }
}
