:root {
  color-scheme: dark;
  --bg: #0b0613;
  --bg-soft: #120923;
  --panel: rgba(27, 14, 48, .78);
  --panel-solid: #1a0d2f;
  --panel-hover: rgba(48, 25, 78, .88);
  --purple: #6f38a7;
  --purple-bright: #9b5de5;
  --gold: #d7ad4d;
  --gold-light: #f5da8c;
  --gold-dark: #8f631d;
  --text: #f7f4fb;
  --muted: #a99db8;
  --muted-2: #766b85;
  --danger: #ff6577;
  --success: #46d69a;
  --line: rgba(255, 255, 255, .09);
  --shadow: 0 22px 70px rgba(0, 0, 0, .42);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --sidebar: 248px;
  --category: 218px;
  --topbar: 84px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

html[data-cinema] {
  --bg: #030303;
  --bg-soft: #08060b;
  --panel: rgba(15, 13, 18, .84);
  --panel-solid: #111014;
  --panel-hover: rgba(31, 28, 35, .94);
  --purple: #4d385c;
  --purple-bright: #8f6d9e;
}

* { box-sizing: border-box; }
html, body { width: 100%; min-height: 100%; margin: 0; background: var(--bg); color: var(--text); }
body { overflow: hidden; }
button, input, select { font: inherit; }
button { color: inherit; }
button, [role="button"] { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 3px; }
img { display: block; max-width: 100%; }
svg { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.is-hidden { display: none !important; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.mobile-only { display: none; }

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 14% 0%, rgba(98, 43, 157, .2), transparent 28%),
    radial-gradient(circle at 88% 94%, rgba(215, 173, 77, .09), transparent 25%),
    linear-gradient(145deg, rgba(255, 255, 255, .018), transparent 40%);
  z-index: 0;
}

.glass-panel {
  background: linear-gradient(145deg, rgba(255,255,255,.055), rgba(255,255,255,.018)), var(--panel);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035), 0 18px 50px rgba(0,0,0,.17);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* Login */
.login-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 28px;
  overflow: auto;
  background:
    linear-gradient(115deg, rgba(7,3,13,.98), rgba(17,7,34,.88)),
    radial-gradient(circle at 70% 20%, #3b1762, transparent 45%);
}
.login-screen::after {
  content: "";
  position: fixed;
  inset: 0;
  opacity: .12;
  pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(to bottom, black, transparent 80%);
}
.ambient { position: fixed; border-radius: 50%; filter: blur(4px); opacity: .4; animation: float 12s ease-in-out infinite; }
.ambient-one { width: 420px; height: 420px; left: -180px; top: -160px; background: radial-gradient(circle, rgba(117,54,181,.68), transparent 67%); }
.ambient-two { width: 380px; height: 380px; right: -140px; bottom: -130px; background: radial-gradient(circle, rgba(215,173,77,.28), transparent 67%); animation-delay: -5s; }
@keyframes float { 50% { transform: translate3d(24px, -16px, 0) scale(1.07); } }
.login-card {
  position: relative;
  z-index: 2;
  width: min(460px, 100%);
  padding: 38px;
  border-radius: 30px;
  box-shadow: var(--shadow), 0 0 0 1px rgba(215,173,77,.07);
  animation: cardIn .65s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(20px) scale(.98); } }
.brand-lockup { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 26px; }
.brand-lockup img { width: 205px; height: auto; }
.brand-lockup > span { padding: 7px 10px; color: var(--gold-light); border: 1px solid rgba(215,173,77,.25); border-radius: 999px; background: rgba(215,173,77,.07); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; }
.login-copy { margin-bottom: 26px; }
.eyebrow { color: var(--gold); font-size: 11px; font-weight: 800; letter-spacing: .18em; }
.login-copy h1 { margin: 9px 0 8px; font-size: clamp(28px, 5vw, 38px); line-height: 1.08; letter-spacing: -.035em; }
.login-copy p:last-child { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.field { display: block; position: relative; margin: 0 0 17px; }
.field > span { display: block; margin-bottom: 8px; color: #ddd5e7; font-size: 12px; font-weight: 700; }
.field input {
  width: 100%; height: 52px; padding: 0 15px; color: var(--text); background: rgba(5,3,9,.43); border: 1px solid rgba(255,255,255,.12); border-radius: 13px; transition: border-color .2s, box-shadow .2s, background .2s;
}
.field input:hover { background: rgba(5,3,9,.58); }
.field input:focus { border-color: rgba(215,173,77,.72); box-shadow: 0 0 0 4px rgba(215,173,77,.1); outline: none; }
.field input::placeholder { color: #6f657c; }
.password-field input { padding-right: 66px; }
.field-action { position: absolute; right: 10px; bottom: 9px; height: 34px; padding: 0 10px; border: 0; border-radius: 8px; color: var(--gold-light); background: transparent; cursor: pointer; font-size: 11px; font-weight: 800; }
.remember-row { display: flex; align-items: center; gap: 10px; margin: 1px 0 20px; color: var(--muted); cursor: pointer; font-size: 13px; }
.remember-row input { position: absolute; opacity: 0; }
.checkmark { width: 18px; height: 18px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.2); border-radius: 5px; background: rgba(255,255,255,.04); }
.remember-row input:checked + .checkmark { border-color: var(--gold); background: linear-gradient(135deg, var(--gold-light), var(--gold-dark)); }
.remember-row input:checked + .checkmark::after { content: "✓"; color: #231606; font-size: 12px; font-weight: 900; }
.primary-button, .secondary-button {
  border: 0; border-radius: 13px; min-height: 48px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer; font-weight: 800; transition: transform .2s, box-shadow .2s, filter .2s;
}
.primary-button { width: 100%; color: #241706; background: linear-gradient(135deg, var(--gold-light), var(--gold) 50%, var(--gold-dark)); box-shadow: 0 12px 30px rgba(151,103,29,.24); }
.primary-button:hover { transform: translateY(-2px); filter: brightness(1.06); box-shadow: 0 16px 35px rgba(151,103,29,.32); }
.primary-button:disabled { cursor: wait; opacity: .72; }
.primary-button.small { width: auto; min-height: 43px; padding-inline: 22px; }
.secondary-button { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); }
.secondary-button:hover { background: rgba(255,255,255,.11); }
.form-error { min-height: 20px; margin: 13px 0 0; color: var(--danger); text-align: center; font-size: 12px; line-height: 1.5; }
.security-note { margin: 16px 0 0; color: var(--muted-2); font-size: 10px; line-height: 1.55; text-align: center; }

/* App shell */
.app-shell { position: fixed; inset: 0; z-index: 2; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); background: transparent; }
.sidebar { position: relative; z-index: 20; display: flex; flex-direction: column; min-width: 0; padding: 22px 16px 16px; background: rgba(13,7,24,.9); border-right: 1px solid var(--line); backdrop-filter: blur(24px); }
.sidebar-brand { display: flex; align-items: center; justify-content: space-between; height: 58px; padding: 2px 10px 14px; }
.sidebar-brand img { width: 170px; }
.main-nav { display: flex; flex-direction: column; gap: 4px; margin-top: 11px; overflow: auto; scrollbar-width: none; }
.main-nav::-webkit-scrollbar { display: none; }
.nav-item { position: relative; min-height: 46px; width: 100%; padding: 0 12px; display: flex; align-items: center; gap: 13px; color: var(--muted); border: 0; border-radius: 12px; background: transparent; cursor: pointer; text-align: left; transition: .2s ease; }
.nav-item svg { width: 19px; height: 19px; flex: 0 0 auto; }
.nav-item span { flex: 1; font-size: 13px; font-weight: 680; }
.nav-item b { min-width: 22px; height: 20px; padding: 0 6px; display: grid; place-items: center; color: var(--gold-light); background: rgba(215,173,77,.1); border-radius: 999px; font-size: 10px; }
.nav-item:hover { color: var(--text); background: rgba(255,255,255,.055); transform: translateX(2px); }
.nav-item.is-active { color: var(--text); background: linear-gradient(90deg, rgba(111,56,167,.36), rgba(111,56,167,.12)); box-shadow: inset 0 0 0 1px rgba(165,98,222,.13); }
.nav-item.is-active::before { content: ""; position: absolute; left: 0; width: 3px; height: 23px; border-radius: 0 4px 4px 0; background: linear-gradient(var(--gold-light), var(--gold-dark)); box-shadow: 0 0 14px rgba(215,173,77,.42); }
.nav-item.is-active svg { color: var(--gold-light); }
.nav-divider { height: 1px; margin: 10px 9px; background: var(--line); }
.nav-group-title { padding: 10px 12px 3px; color: var(--muted-2); font-size: 9px; font-weight: 850; letter-spacing: .08em; }
.nav-item.sub-item { min-height: 39px; padding-left: 20px; gap: 10px; }
.nav-item.sub-item svg { width: 16px; height: 16px; }
.nav-item.sub-item span { font-size: 11px; }
.sidebar-footer { margin-top: auto; padding-top: 12px; }
.nav-item.compact { min-height: 40px; }
.nav-item.danger:hover { color: #ff8795; background: rgba(255,101,119,.08); }
.connection-card { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.025); }
.connection-card div { min-width: 0; }
.connection-card strong, .connection-card small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.connection-card strong { font-size: 11px; }
.connection-card small { margin-top: 3px; color: var(--muted-2); font-size: 9px; }
.status-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px rgba(70,214,154,.1), 0 0 14px rgba(70,214,154,.5); }
.sidebar-scrim { display: none; }
.workspace { min-width: 0; min-height: 0; display: flex; flex-direction: column; padding: 16px; }
.topbar { position: relative; z-index: 5; min-height: var(--topbar); display: flex; align-items: center; gap: 22px; padding: 14px 18px 14px 22px; border-radius: var(--radius-lg); }
.page-heading { min-width: 150px; }
.page-heading span { display: block; color: var(--gold); font-size: 9px; font-weight: 800; letter-spacing: .18em; }
.page-heading h2 { margin: 4px 0 0; font-size: 22px; letter-spacing: -.02em; }
.topbar-actions { min-width: 0; margin-left: auto; display: flex; align-items: center; gap: 10px; }
.search-box { width: min(360px, 34vw); height: 46px; padding: 0 12px; display: flex; align-items: center; gap: 9px; color: var(--muted); border: 1px solid var(--line); border-radius: 13px; background: rgba(4,2,8,.32); }
.search-box svg { width: 17px; }
.search-box input { min-width: 0; flex: 1; color: var(--text); border: 0; outline: 0; background: transparent; font-size: 12px; }
.search-box input::placeholder { color: var(--muted-2); }
.search-box kbd { min-width: 23px; height: 23px; display: grid; place-items: center; color: var(--muted-2); border: 1px solid var(--line); border-radius: 6px; font-size: 10px; }
.control-select, .player-toolbar select { height: 44px; padding: 0 34px 0 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 12px; outline: none; background-color: rgba(4,2,8,.32); cursor: pointer; font-size: 11px; }
.content-count { padding: 8px 10px; color: var(--muted-2); border-radius: 9px; background: rgba(255,255,255,.035); font-size: 10px; white-space: nowrap; }
.content-layout { min-height: 0; flex: 1; display: grid; grid-template-columns: var(--category) minmax(0, 1fr); gap: 14px; padding-top: 14px; }
.content-layout.no-categories { grid-template-columns: minmax(0, 1fr); }
.category-panel { min-height: 0; padding: 14px 10px; border-radius: var(--radius-lg); overflow: hidden; }
.panel-title { height: 38px; padding: 0 8px; display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.panel-title b { min-width: 24px; padding: 4px 7px; color: var(--gold-light); background: rgba(215,173,77,.08); border-radius: 999px; text-align: center; }
.category-list { height: calc(100% - 38px); display: flex; flex-direction: column; gap: 3px; padding: 5px 2px 16px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(215,173,77,.25) transparent; }
.category-item { position: relative; width: 100%; min-height: 42px; padding: 0 11px; display: flex; align-items: center; gap: 8px; color: var(--muted); border: 0; border-radius: 10px; background: transparent; cursor: pointer; text-align: left; transition: .18s; }
.category-item span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 650; }
.category-item i { width: 5px; height: 5px; border-radius: 50%; background: var(--muted-2); }
.category-item:hover { color: var(--text); background: rgba(255,255,255,.045); }
.category-item.is-active { color: var(--text); background: linear-gradient(90deg, rgba(215,173,77,.13), rgba(215,173,77,.025)); }
.category-item.is-active i { background: var(--gold-light); box-shadow: 0 0 9px rgba(215,173,77,.65); }
.content-stage { position: relative; min-width: 0; min-height: 0; padding: 2px 4px 16px 2px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(215,173,77,.25) transparent; }
.welcome-hero { min-height: 230px; padding: 34px; display: flex; align-items: center; justify-content: space-between; gap: 30px; border-radius: var(--radius-xl); overflow: hidden; }
.welcome-hero h3 { max-width: 600px; margin: 10px 0; font-size: clamp(26px, 4vw, 46px); line-height: 1.04; letter-spacing: -.04em; }
.welcome-hero p { max-width: 590px; margin: 0; color: var(--muted); line-height: 1.6; }
.welcome-hero img { opacity: .7; filter: drop-shadow(0 16px 35px rgba(0,0,0,.3)); }
.content-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 19px 14px; padding: 4px 2px 28px; }
.poster-card { position: relative; min-width: 0; animation: itemIn .35s ease both; }
@keyframes itemIn { from { opacity: 0; transform: translateY(9px); } }
.poster-button { width: 100%; padding: 0; color: inherit; border: 0; background: none; cursor: pointer; text-align: left; }
.poster-media { position: relative; display: block; aspect-ratio: 2 / 3; overflow: hidden; border-radius: 16px; background: linear-gradient(145deg, #281541, #0f081b); border: 1px solid rgba(255,255,255,.075); box-shadow: 0 13px 28px rgba(0,0,0,.22); transition: transform .25s ease, border-color .25s, box-shadow .25s; }
.poster-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease, filter .3s; }
.poster-shade { position: absolute; inset: 35% 0 0; background: linear-gradient(transparent, rgba(5,2,9,.84)); opacity: .7; }
.poster-card:hover .poster-media, .poster-button:focus-visible .poster-media { transform: translateY(-5px) scale(1.015); border-color: rgba(215,173,77,.38); box-shadow: 0 22px 45px rgba(0,0,0,.38), 0 0 0 1px rgba(215,173,77,.09); }
.poster-card:hover .poster-media img { transform: scale(1.05); filter: saturate(1.05); }
.play-fab { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; display: grid; place-items: center; color: #241706; border-radius: 50%; background: linear-gradient(135deg, var(--gold-light), var(--gold-dark)); box-shadow: 0 12px 25px rgba(0,0,0,.35); opacity: 0; transform: translate(-50%, -42%) scale(.8); transition: .25s; }
.play-fab svg { width: 19px; height: 19px; margin-left: 2px; fill: currentColor; stroke: none; }
.poster-card:hover .play-fab, .poster-button:focus-visible .play-fab { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.rating-badge { position: absolute; left: 9px; top: 9px; padding: 5px 7px; color: #fff1bd; border: 1px solid rgba(215,173,77,.24); border-radius: 8px; background: rgba(10,5,17,.72); backdrop-filter: blur(8px); font-size: 9px; }
.watch-progress { position: absolute; left: 9px; right: 9px; bottom: 9px; height: 4px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.2); }
.watch-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-dark), var(--gold-light)); }
.poster-copy { display: block; padding: 10px 3px 0; }
.poster-copy strong, .poster-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.poster-copy strong { font-size: 12px; letter-spacing: -.01em; }
.poster-copy small { margin-top: 5px; color: var(--muted-2); font-size: 9px; text-transform: capitalize; }
.favorite-button { width: 37px; height: 37px; display: grid; place-items: center; color: var(--muted); border: 1px solid var(--line); border-radius: 11px; background: rgba(13,7,24,.72); cursor: pointer; transition: .2s; }
.favorite-button:hover { color: var(--text); background: var(--panel-hover); }
.favorite-button.is-active { color: #ff7695; border-color: rgba(255,118,149,.27); background: rgba(255,118,149,.1); }
.favorite-button.is-active svg { fill: currentColor; }
.card-favorite { position: absolute; right: 8px; top: 8px; width: 34px; height: 34px; z-index: 3; opacity: 0; backdrop-filter: blur(10px); }
.poster-card:hover .card-favorite, .card-favorite.is-active, .card-favorite:focus-visible { opacity: 1; }
.live-poster-media { aspect-ratio: 1 / 1; padding: 15px; }
.live-poster-media img { object-fit: contain; border-radius: 12px; background: rgba(255,255,255,.025); }
.live-poster-media .poster-shade { inset: 48% 0 0; }
.live-card-badge { position: absolute; left: 9px; bottom: 9px; z-index: 2; display: inline-flex; align-items: center; gap: 5px; padding: 5px 7px; color: #ffb7c0; border: 1px solid rgba(255,101,119,.2); border-radius: 8px; background: rgba(10,5,17,.78); backdrop-filter: blur(8px); font-size: 8px; font-weight: 850; }
.live-card-badge i { width: 5px; height: 5px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 7px var(--danger); animation: pulse 1.4s infinite; }
.virtual-list { height: 100%; min-height: 420px; overflow-y: auto; padding: 4px 4px 18px 0; }
.virtual-viewport, .virtual-spacer { position: relative; width: 100%; }
.live-row { display: flex; align-items: center; border-radius: 14px; overflow: hidden; transition: background .2s, border-color .2s; }
.live-row:hover { border-color: rgba(215,173,77,.22); background: var(--panel-hover); }
.live-main { min-width: 0; flex: 1; height: 100%; padding: 7px 11px; display: flex; align-items: center; gap: 13px; color: inherit; border: 0; background: transparent; cursor: pointer; text-align: left; }
.live-main img { width: 52px; height: 52px; object-fit: contain; border-radius: 10px; background: rgba(255,255,255,.05); }
.channel-number { width: 28px; color: var(--muted-2); font-size: 10px; text-align: center; }
.live-copy { min-width: 0; flex: 1; }
.live-copy strong, .live-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-copy strong { font-size: 12px; }
.live-copy small { margin-top: 5px; color: var(--muted-2); font-size: 9px; }
.live-pill { display: inline-flex; align-items: center; gap: 5px; padding: 5px 7px; color: #ffacb5; border-radius: 7px; background: rgba(255,101,119,.08); font-size: 8px; font-weight: 900; letter-spacing: .1em; }
.live-pill i { width: 5px; height: 5px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 7px var(--danger); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.live-row > .favorite-button { margin-right: 11px; }
.empty-state { min-height: 55vh; display: grid; place-items: center; align-content: center; text-align: center; }
.empty-state img { opacity: .34; }
.empty-state h3 { margin: 14px 0 7px; }
.empty-state p { margin: 0; color: var(--muted); font-size: 12px; }
.skeleton-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 20px 14px; padding: 4px; }
.skeleton-card i, .skeleton-card span, .skeleton-card small { display: block; border-radius: 10px; background: linear-gradient(90deg, rgba(255,255,255,.035), rgba(255,255,255,.09), rgba(255,255,255,.035)); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
.skeleton-card i { aspect-ratio: 2/3; border-radius: 16px; }
.skeleton-card span { width: 76%; height: 11px; margin-top: 11px; }
.skeleton-card small { width: 45%; height: 8px; margin-top: 7px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.load-sentinel { height: 10px; display: grid; place-items: center; transition: height .2s; }
.load-sentinel span { width: 20px; height: 20px; border: 2px solid rgba(255,255,255,.12); border-top-color: var(--gold); border-radius: 50%; opacity: 0; animation: spin .8s linear infinite; transition: opacity .2s; }
.load-sentinel.is-loading { height: 48px; }
.load-sentinel.is-loading span { opacity: 1; }

/* Player */
.player-drawer { position: fixed; inset: 0; z-index: 500; visibility: hidden; pointer-events: none; }
.player-backdrop { position: absolute; inset: 0; background: rgba(3,2,6,.78); opacity: 0; backdrop-filter: blur(16px); transition: opacity .28s; }
.player-surface { position: absolute; inset: 26px; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; border: 1px solid rgba(255,255,255,.1); border-radius: 24px; background: #050307; box-shadow: 0 30px 90px rgba(0,0,0,.65); opacity: 0; transform: translateY(22px) scale(.985); transition: opacity .3s, transform .3s; }
.player-open .player-drawer { visibility: visible; pointer-events: auto; }
.player-open .player-backdrop { opacity: 1; }
.player-open .player-surface { opacity: 1; transform: none; }
.player-header { min-height: 78px; padding: 12px 18px; display: flex; align-items: center; justify-content: space-between; gap: 20px; background: linear-gradient(180deg, #140a22, #09050e); border-bottom: 1px solid var(--line); }
.now-playing { min-width: 0; display: flex; align-items: center; gap: 13px; }
.now-playing img { width: 52px; height: 52px; object-fit: contain; border-radius: 12px; background: rgba(255,255,255,.05); }
.now-playing div { min-width: 0; }
.now-playing span { color: var(--gold); font-size: 8px; font-weight: 900; letter-spacing: .16em; }
.now-playing h3, .now-playing p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.now-playing h3 { margin: 3px 0; font-size: 15px; }
.now-playing p { margin: 0; color: var(--muted); font-size: 9px; }
.player-actions { display: flex; gap: 8px; }
.icon-button { width: 42px; height: 42px; display: grid; place-items: center; color: var(--muted); border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.045); cursor: pointer; transition: .2s; }
.icon-button:hover { color: var(--text); border-color: rgba(215,173,77,.28); background: rgba(215,173,77,.08); }
.video-frame { position: relative; min-height: 0; background: #000; overflow: hidden; }
.video-js { width: 100% !important; height: 100% !important; font-family: inherit; }
.video-js .vjs-control-bar { height: 4.1em; background: linear-gradient(transparent, rgba(0,0,0,.88)); }
.video-js .vjs-big-play-button { width: 72px; height: 72px; margin: -36px 0 0 -36px; border: 1px solid rgba(255,255,255,.28); border-radius: 50%; background: linear-gradient(135deg, rgba(215,173,77,.92), rgba(143,99,29,.92)); line-height: 70px; box-shadow: 0 18px 35px rgba(0,0,0,.4); }
.video-js .vjs-play-progress, .video-js .vjs-volume-level { background: var(--gold); }
.video-js .vjs-load-progress { background: rgba(255,255,255,.22); }
.buffer-overlay { position: absolute; inset: 0; z-index: 12; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 12px; color: var(--muted); background: rgba(0,0,0,.24); pointer-events: none; opacity: 0; transition: opacity .2s; }
.buffer-overlay.is-visible { opacity: 1; }
.spinner { width: 28px; height: 28px; display: inline-block; border: 2px solid rgba(255,255,255,.14); border-top-color: var(--gold); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.video-error { position: absolute; inset: 0; z-index: 13; display: grid; place-items: center; align-content: center; gap: 8px; background: rgba(5,2,8,.9); text-align: center; }
.video-error strong { color: var(--danger); }
.video-error-message { max-width: 560px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.player-toolbar { min-height: 82px; padding: 12px 16px; display: flex; align-items: center; gap: 11px; border-radius: 0; border-inline: 0; border-bottom: 0; }
.player-toolbar label { display: grid; gap: 5px; color: var(--muted-2); font-size: 8px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.player-toolbar select { width: 125px; height: 38px; }
.epg-now { min-width: 250px; margin-left: auto; display: grid; grid-template-columns: minmax(0, 1fr) 170px; align-items: center; gap: 20px; }
.epg-now div:first-child { min-width: 0; }
.epg-now span, .epg-now strong, .epg-now small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.epg-now span { color: var(--gold); font-size: 8px; font-weight: 800; }
.epg-now strong { margin: 3px 0; font-size: 11px; }
.epg-now small { color: var(--muted-2); font-size: 9px; }
.epg-progress { height: 5px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.1); }
.epg-progress i { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--gold-dark), var(--gold-light)); transition: width .5s; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 600; display: grid; place-items: center; padding: 26px; visibility: hidden; pointer-events: none; }
.modal-scrim { position: absolute; inset: 0; background: rgba(3,1,6,.82); opacity: 0; backdrop-filter: blur(14px); transition: opacity .25s; }
.details-card { position: relative; width: min(1020px, 100%); max-height: min(88vh, 850px); overflow: auto; border-radius: 26px; opacity: 0; transform: translateY(18px) scale(.985); transition: .28s; }
.modal.is-open { visibility: visible; pointer-events: auto; }
.modal.is-open .modal-scrim { opacity: 1; }
.modal.is-open .details-card { opacity: 1; transform: none; }
.modal-close { position: sticky; float: right; top: 15px; right: 15px; z-index: 5; margin: 15px 15px -57px 0; background: rgba(5,2,9,.68); backdrop-filter: blur(10px); }
.details-backdrop { height: 260px; background-position: center 25%; background-size: cover; border-radius: 26px 26px 0 0; opacity: .75; }
.details-body { position: relative; display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 26px; padding: 0 30px 24px; margin-top: -100px; }
.details-poster { width: 180px; aspect-ratio: 2/3; object-fit: cover; border: 1px solid rgba(255,255,255,.15); border-radius: 17px; background: var(--panel-solid); box-shadow: 0 20px 40px rgba(0,0,0,.44); }
.details-copy { align-self: end; padding-bottom: 5px; }
.details-copy h2 { margin: 8px 0 10px; font-size: clamp(28px, 4vw, 44px); line-height: 1.05; letter-spacing: -.04em; }
.details-copy > p { max-width: 720px; margin: 14px 0 18px; color: #bbb0c7; font-size: 12px; line-height: 1.7; }
.details-meta { display: flex; flex-wrap: wrap; gap: 7px; }
.details-meta span { padding: 5px 8px; color: #d8cfdf; border: 1px solid var(--line); border-radius: 7px; background: rgba(255,255,255,.04); font-size: 9px; }
.details-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.details-extra { padding: 0 30px 30px; }
.details-loading { min-height: 120px; display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--muted); font-size: 12px; }
.inline-error { padding: 18px; color: #d9cfe2; border: 1px dashed rgba(255,255,255,.12); border-radius: 13px; background: rgba(255,255,255,.025); font-size: 12px; text-align: center; }
.info-strip { padding: 18px; border-radius: 14px; background: rgba(255,255,255,.035); border: 1px solid var(--line); }
.info-strip strong { color: var(--gold-light); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
.info-strip p { margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.season-tabs { display: flex; gap: 8px; padding-bottom: 15px; overflow-x: auto; }
.season-tab { min-width: max-content; padding: 9px 13px; color: var(--muted); border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.03); cursor: pointer; font-size: 10px; font-weight: 700; }
.season-tab.is-active { color: #231606; border-color: transparent; background: linear-gradient(135deg, var(--gold-light), var(--gold-dark)); }
.episode-list { display: grid; gap: 9px; }
.episode-card { width: 100%; min-height: 90px; padding: 9px; display: grid; grid-template-columns: 130px minmax(0,1fr) 36px; align-items: center; gap: 14px; color: inherit; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.025); cursor: pointer; text-align: left; transition: .2s; }
.episode-card:hover { border-color: rgba(215,173,77,.24); background: rgba(215,173,77,.05); transform: translateX(3px); }
.episode-card img { width: 130px; height: 74px; object-fit: cover; border-radius: 10px; }
.episode-card span { min-width: 0; }
.episode-card small { color: var(--gold); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.episode-card strong { display: block; margin: 4px 0; font-size: 12px; }
.episode-card p { margin: 0; color: var(--muted-2); font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.episode-card > svg { width: 27px; height: 27px; color: var(--gold); }
.catchup-list { display: grid; gap: 8px; }
.catchup-card { width: 100%; min-height: 66px; padding: 10px 14px; display: grid; grid-template-columns: minmax(0,1fr) auto 30px; align-items: center; gap: 14px; color: inherit; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.025); cursor: pointer; text-align: left; }
.catchup-card:hover { border-color: rgba(215,173,77,.25); background: rgba(215,173,77,.05); }
.catchup-card small, .catchup-card strong { display: block; }
.catchup-card small { color: var(--muted-2); font-size: 8px; }
.catchup-card strong { margin-top: 5px; font-size: 11px; }
.catchup-card b { color: var(--muted); font-size: 9px; }
.catchup-card svg { color: var(--gold); }

/* Toast and startup */
.toast-stack { position: fixed; right: 20px; bottom: 20px; z-index: 1000; display: grid; gap: 9px; pointer-events: none; }
.toast { min-width: 250px; max-width: min(390px, calc(100vw - 40px)); padding: 13px 15px; color: #e8e1ef; border: 1px solid rgba(70,214,154,.2); border-radius: 12px; background: rgba(17,12,24,.92); box-shadow: 0 16px 40px rgba(0,0,0,.36); backdrop-filter: blur(15px); opacity: 0; transform: translateY(10px); transition: .25s; font-size: 11px; }
.toast.error { border-color: rgba(255,101,119,.25); }
.toast.is-visible { opacity: 1; transform: none; }
.startup-loader { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; align-content: center; gap: 20px; background: #090411; transition: opacity .35s, visibility .35s; }
.startup-loader img { width: 90px; animation: breathe 1.6s ease-in-out infinite; }
.startup-loader.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
@keyframes breathe { 50% { transform: scale(1.06); filter: drop-shadow(0 0 20px rgba(215,173,77,.25)); } }

/* Responsive */
@media (max-width: 1180px) {
  :root { --sidebar: 216px; --category: 190px; }
  .content-grid, .skeleton-grid { grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); }
  .epg-now { grid-template-columns: minmax(0,1fr) 110px; }
  .player-toolbar select { width: 105px; }
}

@media (max-width: 900px) {
  :root { --category: 180px; }
  .mobile-only { display: grid; }
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(290px, 84vw); transform: translateX(-102%); transition: transform .28s ease; box-shadow: 20px 0 60px rgba(0,0,0,.5); }
  .sidebar-open .sidebar { transform: none; }
  .sidebar-scrim { position: fixed; inset: 0; z-index: 19; display: block; visibility: hidden; opacity: 0; background: rgba(0,0,0,.62); backdrop-filter: blur(5px); transition: .25s; }
  .sidebar-open .sidebar-scrim { visibility: visible; opacity: 1; }
  .workspace { padding: 10px; }
  .topbar { min-height: 74px; padding: 10px 12px; }
  .page-heading { min-width: 115px; }
  .page-heading h2 { font-size: 18px; }
  .content-count { display: none; }
  .search-box { width: min(300px, 36vw); }
  .player-surface { inset: 10px; }
  .player-toolbar { flex-wrap: wrap; }
  .epg-now { width: 100%; margin: 3px 0 0; grid-template-columns: minmax(0,1fr) 140px; }
}

@media (max-width: 700px) {
  body { overflow: hidden; }
  .login-screen { padding: 14px; }
  .login-card { padding: 25px 20px; border-radius: 22px; }
  .brand-lockup img { width: 175px; }
  .brand-lockup > span { display: none; }
  .workspace { padding: 7px; }
  .topbar { align-items: flex-start; flex-wrap: wrap; gap: 8px; border-radius: 16px; }
  .page-heading { flex: 1; padding-top: 3px; }
  .topbar-actions { order: 3; width: 100%; display: grid; grid-template-columns: minmax(0,1fr) 116px; }
  .search-box { width: 100%; }
  .search-box kbd { display: none; }
  .control-select { width: 100%; }
  .content-layout { grid-template-columns: minmax(0,1fr); padding-top: 8px; }
  .category-panel { min-height: auto; height: 62px; padding: 8px; border-radius: 14px; }
  .panel-title { display: none; }
  .category-list { height: 100%; padding: 0; flex-direction: row; gap: 6px; overflow-x: auto; overflow-y: hidden; }
  .category-item { width: auto; min-width: max-content; min-height: 44px; padding-inline: 13px; border: 1px solid var(--line); background: rgba(255,255,255,.025); }
  .category-item i { display: none; }
  .content-stage { padding-right: 0; }
  .content-grid, .skeleton-grid { grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px 8px; }
  .poster-media { border-radius: 12px; }
  .poster-copy strong { font-size: 10px; }
  .poster-copy small { font-size: 8px; }
  .card-favorite { opacity: 1; width: 30px; height: 30px; border-radius: 9px; }
  .virtual-list { min-height: 360px; }
  .live-main { gap: 9px; padding-inline: 7px; }
  .live-main img { width: 44px; height: 44px; }
  .channel-number { display: none; }
  .live-pill { display: none; }
  .player-surface { inset: 0; border: 0; border-radius: 0; }
  .player-header { min-height: 68px; padding: 8px 10px; }
  .now-playing img { width: 44px; height: 44px; }
  .now-playing h3 { max-width: 45vw; }
  .player-toolbar { max-height: 154px; padding: 8px; overflow-y: auto; }
  .player-toolbar label { flex: 1; }
  .player-toolbar select { width: 100%; }
  .epg-now { grid-template-columns: minmax(0,1fr); }
  .epg-progress { display: none; }
  .modal { padding: 0; }
  .details-card { width: 100%; max-height: 100%; height: 100%; border-radius: 0; }
  .details-backdrop { height: 220px; border-radius: 0; }
  .details-body { grid-template-columns: 110px minmax(0,1fr); gap: 15px; padding: 0 16px 20px; margin-top: -70px; }
  .details-poster { width: 110px; border-radius: 13px; }
  .details-copy h2 { font-size: 24px; }
  .details-copy > p { max-height: 84px; overflow: auto; font-size: 10px; }
  .details-extra { padding: 0 16px 20px; }
  .episode-card { grid-template-columns: 96px minmax(0,1fr) 26px; gap: 10px; }
  .episode-card img { width: 96px; height: 58px; }
}

@media (max-width: 450px) {
  .content-grid, .skeleton-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .login-copy h1 { font-size: 29px; }
  .details-body { grid-template-columns: 88px minmax(0,1fr); }
  .details-poster { width: 88px; }
  .details-copy h2 { font-size: 21px; }
  .details-actions { grid-column: 1 / -1; }
  .details-actions .primary-button, .details-actions .secondary-button { flex: 1; }
  .catchup-card { grid-template-columns: minmax(0,1fr) auto; }
  .catchup-card svg { display: none; }
}

@media (hover: none) {
  .play-fab { opacity: .85; transform: translate(-50%, -50%) scale(.82); }
  .card-favorite { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* VOD playback controls */
.video-js .vjs-kaidn-seek-button { position: relative; width: 4.2em; min-width: 4.2em; font-size: 1em; }
.video-js .vjs-kaidn-seek-button .vjs-icon-placeholder { display: none; }
.video-js .vjs-kaidn-seek-visual { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.video-js .vjs-kaidn-seek-visual i { position: absolute; font-style: normal; font-size: 2.05em; line-height: 1; opacity: .96; }
.video-js .vjs-kaidn-seek-visual b { position: relative; z-index: 1; margin-top: .1em; font-size: .78em; line-height: 1; }
.video-js .vjs-playback-rate { min-width: 4.2em; }
.video-js .vjs-playback-rate .vjs-playback-rate-value { font-size: 1.15em; line-height: 3.6em; }
.video-js:not(.kaidn-vod-mode) .vjs-kaidn-seek-button,
.video-js:not(.kaidn-vod-mode) .vjs-playback-rate { display: none !important; }
.kaidn-seek-feedback { position: absolute; top: 50%; left: 63%; z-index: 20; min-width: 88px; padding: 11px 15px; color: #fff; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; background: rgba(0,0,0,.68); box-shadow: 0 10px 30px rgba(0,0,0,.35); opacity: 0; transform: translate(-50%, -50%) scale(.86); transition: opacity .16s, transform .16s; pointer-events: none; font-size: 12px; font-weight: 900; text-align: center; }
.kaidn-seek-feedback.is-back { left: 37%; }
.kaidn-seek-feedback.is-visible { opacity: 1; transform: translate(-50%, -50%) scale(1); }

@media (max-width: 700px) {
  .video-js .vjs-kaidn-seek-button { width: 3.5em; min-width: 3.5em; }
  .video-js .vjs-kaidn-seek-visual i { font-size: 1.8em; }
  .video-js .vjs-kaidn-seek-visual b { font-size: .7em; }
  .video-js .vjs-playback-rate { min-width: 3.6em; }
  .kaidn-seek-feedback { min-width: 76px; padding: 9px 12px; font-size: 11px; }
}

/* Smart Sources — optimized VOD source selection and fallback */
.source-lab {
  order: -1;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(300px, 1.7fr) auto minmax(240px, 1fr);
  align-items: end;
  gap: 8px;
  padding: 9px;
  border: 1px solid rgba(215,173,77,.18);
  border-radius: 12px;
  background: linear-gradient(180deg, #2b1639, #1d1028);
}
.source-lab .source-select-label { min-width: 0; }
.source-lab .source-select-label select {
  width: 100%;
  min-width: 0;
  color-scheme: dark;
  color: #ffffff !important;
  background: #180d22 !important;
  font-size: 12px;
  font-weight: 800;
  border: 2px solid rgba(242,201,103,.72) !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.025);
}
.source-lab .source-select-label select option {
  color: #ffffff !important;
  background: #180d22 !important;
  font-weight: 800;
}
.source-lab .source-select-label select optgroup {
  color: #f2c967;
  background: #4a285e;
  font-weight: 900;
}
.source-lab .source-select-label select:focus { outline: 3px solid rgba(242,201,103,.28); outline-offset: 1px; }
.source-lab .source-select-label { color: #fff; font-weight: 900; }
.source-action {
  min-height: 38px;
  padding: 0 12px;
  color: #d9d0e1;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #341c45;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  font-size: 9px;
  font-weight: 800;
  transition: .2s;
}
.source-action:hover { border-color: rgba(242,201,103,.82); background: #4a285e; }
.source-action.primary { color: #241707; border-color: transparent; background: linear-gradient(135deg, var(--gold-light), var(--gold-dark)); }
.source-action:disabled { opacity: .55; cursor: wait; }
.source-status {
  min-width: 0;
  align-self: center;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
}
.source-status[data-state="success"] { color: #72dda9; }
.source-status[data-state="failed"] { color: #ff8e9e; }
.source-status[data-state="testing"] { color: var(--gold-light); }

@media (max-width: 1180px) {
  .source-lab { grid-template-columns: minmax(260px, 1fr) auto; }
  .source-status { grid-column: 1 / -1; }
}

@media (max-width: 700px) {
  .player-toolbar { max-height: 270px; }
  .source-lab { grid-template-columns: 1fr 1fr; align-items: stretch; }
  .source-select-label, .source-status { grid-column: 1 / -1; }
  .source-action { width: 100%; padding-inline: 8px; font-size: 8px; white-space: normal; }
}

/* Smart source controls occupy a full first row in the player toolbar. */
.player-toolbar { flex-wrap: wrap; }


/* Automatic source diagnosis shown only after all approved playback methods fail. */
.source-diagnostic {
  width: min(720px, calc(100% - 28px));
  max-height: min(48vh, 430px);
  overflow: auto;
  margin-top: 8px;
  padding: 12px;
  color: #f7f2fb;
  border: 1px solid rgba(242,201,103,.34);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(42,21,55,.98), rgba(20,10,29,.98));
  box-shadow: 0 16px 44px rgba(0,0,0,.42);
  text-align: right;
}
.source-diagnostic-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.source-diagnostic-head b { color: var(--gold-light); font-size: 12px; }
.source-diagnostic-head button,
.source-diagnostic-play {
  min-height: 32px;
  padding: 0 12px;
  color: #fff;
  border: 1px solid rgba(242,201,103,.42);
  border-radius: 9px;
  background: #4a285e;
  font-family: inherit;
  font-size: 9px;
  font-weight: 900;
  cursor: pointer;
}
.source-diagnostic-head button:hover,
.source-diagnostic-play:hover { background: #63357d; border-color: var(--gold-light); }
.source-diagnostic-head button:disabled,
.source-diagnostic-play:disabled { opacity: .55; cursor: wait; }
.source-diagnostic-summary { margin: 0 0 9px; color: #fff; font-size: 11px; line-height: 1.7; }
.source-diagnostic-recommendation {
  margin-bottom: 10px;
  padding: 9px 10px;
  border: 1px solid rgba(114,221,169,.3);
  border-radius: 10px;
  background: rgba(35,108,76,.2);
  color: #a7f2cd;
  font-size: 10px;
  line-height: 1.7;
}
.source-diagnostic-warning {
  margin-bottom: 10px;
  padding: 9px 10px;
  border: 1px solid rgba(255,142,158,.25);
  border-radius: 10px;
  background: rgba(119,33,49,.2);
  color: #ffb4c0;
  font-size: 10px;
  line-height: 1.7;
}
.source-diagnostic-grid { display: grid; gap: 7px; }
.source-diagnostic-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 12px;
  padding: 9px 10px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  background: rgba(255,255,255,.035);
}
.source-diagnostic-row > b { color: #fff; font-size: 10px; white-space: nowrap; }
.source-diagnostic-row > div { min-width: 0; }
.source-diagnostic-row p { margin: 0; color: #d8cfdf; font-size: 9px; line-height: 1.65; }
.source-diagnostic-row small { display: block; margin-top: 3px; color: #a99bb3; font-size: 8px; line-height: 1.6; }
.source-diagnostic-badge { display: inline-flex; align-items: center; min-height: 20px; margin-inline-start: 7px; padding: 0 7px; border-radius: 999px; font-size: 8px; font-weight: 900; }
.source-diagnostic-badge.is-playable { color: #0d3525; background: #72dda9; }
.source-diagnostic-badge.is-likely { color: #33250a; background: #f2c967; }
.source-diagnostic-badge.is-unknown { color: #251a31; background: #c9acd9; }
.source-diagnostic-badge.is-unsupported,
.source-diagnostic-badge.is-unavailable { color: #3a1018; background: #ff8e9e; }
.source-diagnostic-loading { display: flex; align-items: center; gap: 9px; color: #d8cfdf; font-size: 10px; }
.source-diagnostic-loading .spinner { width: 18px; height: 18px; }
.source-diagnostic-play { width: 100%; margin-top: 10px; color: #241707; border-color: transparent; background: linear-gradient(135deg, var(--gold-light), var(--gold-dark)); }

@media (max-width: 700px) {
  .video-error { padding: 10px; overflow: auto; }
  .source-diagnostic { width: 100%; max-height: 52vh; padding: 10px; }
  .source-diagnostic-row { grid-template-columns: 1fr; }
}

/* v1.9.4: compact external-player fallback for shared hosting. */
.external-player-fallback {
  width: min(720px, calc(100% - 28px));
  margin-top: 10px;
  padding: 13px;
  border: 1px solid rgba(114,221,169,.38);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(25,84,61,.92), rgba(23,13,31,.98));
  box-shadow: 0 14px 38px rgba(0,0,0,.35);
  text-align: right;
}
.external-player-copy b { display: block; color: #b7f5d5; font-size: 13px; }
.external-player-copy p { margin: 5px 0 10px; color: #eee7f2; font-size: 10px; line-height: 1.75; }
.external-player-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.external-player-actions button {
  min-height: 38px;
  padding: 0 14px;
  color: #fff;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 10px;
  background: #4a285e;
  font-family: inherit;
  font-size: 9px;
  font-weight: 900;
  cursor: pointer;
}
.external-player-actions button:hover { background: #63357d; border-color: var(--gold-light); }
.external-player-actions button:disabled { opacity: .55; cursor: wait; }
.external-player-actions .external-player-primary {
  color: #211506;
  border-color: transparent;
  background: linear-gradient(135deg, #b7f5d5, #72dda9);
}
.external-player-fallback > small { display: block; margin-top: 9px; color: #c7bcd0; font-size: 8px; line-height: 1.6; }
.source-diagnostic-details {
  width: min(720px, calc(100% - 28px));
  margin-top: 8px;
  color: #d9d0e1;
  text-align: right;
}
.source-diagnostic-details > summary {
  width: fit-content;
  margin-inline-start: auto;
  padding: 6px 10px;
  color: #c7bcd0;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 9px;
  background: rgba(36,20,47,.92);
  font-size: 9px;
  font-weight: 800;
  cursor: pointer;
}
.source-diagnostic-details[open] > summary { color: var(--gold-light); border-color: rgba(242,201,103,.4); }
.source-diagnostic-details .source-diagnostic { width: 100%; max-height: min(42vh, 380px); }
@media (max-width: 700px) {
  .external-player-fallback, .source-diagnostic-details { width: 100%; }
  .external-player-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .external-player-actions .external-player-primary { grid-column: 1 / -1; }
  .external-player-actions button { width: 100%; min-height: 42px; }
}
