/* Shared header entry; the existing player and handler remain unchanged. */
.app-header .header-tv-navigation{display:flex;align-items:center;gap:22px;min-width:0}
:is(.app-header,.feed-page-heading) .tv-mode-entry{
  --tv-entry-glass:var(--color-surface-hover);--tv-entry-ink:var(--color-text);
  appearance:none;display:inline-flex;align-items:center;justify-content:center;gap:8px;flex:none;
  width:120px;height:36px;padding:0 12px;border:1px solid var(--color-border-strong);border-radius:999px;
  background:linear-gradient(160deg,color-mix(in srgb,var(--tv-entry-ink) 5%,transparent),transparent 65%),var(--tv-entry-glass);
  color:var(--tv-entry-ink);font-family:inherit;font-size:13px;font-weight:600;line-height:1.2;white-space:nowrap;cursor:pointer;
  box-shadow:inset 0 1px 0 color-mix(in srgb,var(--tv-entry-ink) 7%,transparent);
  transition:border-color 180ms ease,box-shadow 180ms ease,transform 120ms ease;
}
:root[data-theme="light"] :is(.app-header,.feed-page-heading) .tv-mode-entry{--tv-entry-glass:var(--color-text);--tv-entry-ink:var(--color-bg);border-color:var(--color-text-secondary)}
:is(.app-header,.feed-page-heading) .tv-mode-entry svg{width:18px;height:18px;flex:none;stroke-width:1.6;color:var(--accent);pointer-events:none}
:is(.app-header,.feed-page-heading) .tv-mode-entry span{font-size:13px;font-weight:600}
@media(hover:hover) and (pointer:fine){
  :is(.app-header,.feed-page-heading) .tv-mode-entry:hover{border-color:color-mix(in srgb,var(--accent) 50%,var(--color-border-strong));box-shadow:inset 0 1px 0 color-mix(in srgb,var(--tv-entry-ink) 7%,transparent),0 0 10px color-mix(in srgb,var(--accent) 12%,transparent)}
}
:is(.app-header,.feed-page-heading) .tv-mode-entry:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
:is(.app-header,.feed-page-heading) .tv-mode-entry:active{transform:scale(.97);box-shadow:inset 0 1px 5px var(--color-overlay)}
/* Navigation is centered against the whole header, independent of both sides. */
.app-header .header-controls{display:contents}
@media(min-width:601px){
  .desktop-header-shell .app-header .header-inner{
    --header-control-reserve:590px;position:relative;display:flex;align-items:center;column-gap:16px;
  }
  .desktop-header-shell .app-header .header-inner>.brand{position:relative;inset:auto;width:240px;flex:0 1 240px;margin-right:auto}
  .desktop-header-shell .app-header .header-controls{display:flex;align-items:center;gap:16px;flex:none}
  .app-header .header-tv-navigation{flex:none}
  .desktop-header-shell .app-header .header-inner>.desktop-header-gallery-tabs{
    position:absolute;left:50%;transform:translateX(-50%);width:max-content;
    max-width:calc(100% - 2 * (var(--header-control-reserve) + 44px));
    margin:0;overflow-x:auto;overflow-y:hidden;
  }
}
@media(min-width:1101px) and (max-width:1350px){
  .app-header .desktop-header-gallery-tabs a{padding-inline:9px;font-size:13px}
}
@media(min-width:601px) and (max-width:1700px){
  .desktop-header-shell .app-header .header-inner{--header-control-reserve:425px}
  .desktop-header-shell .app-header .header-actions>.header-icon:first-child{width:40px;padding:0;justify-content:center}
  .desktop-header-shell .app-header .header-actions>.header-icon:first-child::after{content:none}
}
@media(min-width:601px) and (max-width:1350px){
  .desktop-header-shell .app-header .header-inner{--header-control-reserve:365px}
  .desktop-header-shell .app-header .header-actions>.desktop-header-create{width:44px;padding:0;justify-content:center}
  .desktop-header-shell .app-header .header-actions>.desktop-header-create span{display:none}
}
@media(min-width:601px) and (max-width:1100px){
  .desktop-header-shell .app-header .header-inner{--header-control-reserve:270px}
  .app-header .tv-mode-entry{width:44px;height:44px;min-width:44px;min-height:44px;padding:0;border-radius:14px}
  .app-header .tv-mode-entry span{display:none}
  .app-header .tv-mode-entry svg{width:21px;height:21px}
}
@media(min-width:601px) and (max-width:760px){
  .desktop-header-shell .app-header .header-inner{--header-control-reserve:220px;column-gap:8px}
  .desktop-header-shell .app-header .header-controls{gap:8px}
  .desktop-header-shell .app-header .header-inner>.brand{width:180px;flex-basis:180px}
  .desktop-header-shell .app-header .header-actions{gap:4px}
  .desktop-header-shell .app-header .header-actions>.header-icon,
  .desktop-header-shell .app-header .header-actions>.header-icon:first-child,
  .desktop-header-shell .app-header .header-actions>.desktop-header-create{width:32px}
  .desktop-header-shell .app-header .sign-in{padding-inline:7px}
}
/* At the existing mobile boundary, restore the entry to the Coub heading. */
.tv-mode-mobile-slot{display:none}
@media(max-width:600px){
  .app-header .header-tv-navigation{display:none}
  .feed-page-heading:has([data-tv-entry-mobile]){display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:10px 16px}
  .feed-page-heading:has([data-tv-entry-mobile]) h1{grid-column:1;grid-row:1;min-width:0}
  .feed-page-heading .tv-mode-mobile-slot{display:block;grid-column:2;grid-row:1;justify-self:end;margin:0}
  .feed-page-heading:has([data-tv-entry-mobile]) p{grid-column:1 / -1;grid-row:2;margin:0}
  .feed-page-heading .tv-mode-entry{width:116px;height:44px;min-height:44px;padding-inline:10px}
  :root[data-theme="light"] .feed-page-heading .tv-mode-entry{
    --tv-entry-glass:color-mix(in srgb,var(--color-surface) 80%,transparent);
    --tv-entry-ink:var(--color-text);border-color:var(--color-border-strong);
    box-shadow:inset 0 1px 0 color-mix(in srgb,var(--color-surface) 85%,transparent);
  }
  .feed-page-heading .tv-mode-entry:active{transform:scale(.98)}
  :root[data-theme="light"] .feed-page-heading .tv-mode-entry:active{
    background:color-mix(in srgb,var(--color-surface-2) 90%,transparent);
    box-shadow:inset 0 1px 3px color-mix(in srgb,var(--color-text) 10%,transparent);
  }
}
@media(prefers-reduced-motion:reduce){:is(.app-header,.feed-page-heading) .tv-mode-entry{transition:none}:is(.app-header,.feed-page-heading) .tv-mode-entry:active{transform:none}}
.coub-tv{position:fixed;inset:0;z-index:10000;background:#08090b;color:#fff;font-family:inherit;overflow:hidden;isolation:isolate}
.coub-tv::backdrop{background:#08090b}
.coub-tv .tv-stage{position:absolute;inset:0;pointer-events:none}
.coub-tv .tv-stage video{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;opacity:0;background:transparent}
.coub-tv .tv-welcome{position:absolute;inset:0;z-index:4;display:grid;place-items:center;text-align:center;padding:24px;background:#08090b;transition:opacity 650ms ease}
.coub-tv .tv-welcome[hidden]{display:none}
.coub-tv .tv-welcome-block{width:min(100%,440px);animation:tv-welcome-enter 650ms ease-out both}
.coub-tv .tv-welcome h2{font-family:"Figtree",-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;font-size:clamp(38px,6vw,64px);font-weight:400;line-height:1.1;letter-spacing:.12em;text-indent:.12em;color:#eeeae4;margin:0 0 18px}
.coub-tv .tv-subtitle{font-size:clamp(14px,1.6vw,16px);line-height:1.6;color:#a5a4ab;margin:0 0 30px;text-wrap:balance}
.coub-tv .tv-start{min-width:204px;min-height:48px;padding:12px 28px;border-radius:999px;background:var(--color-accent,#ff6b1a);border:1px solid transparent;color:#fff;font-weight:500;transition:background 180ms ease,transform 180ms ease,opacity 180ms ease}
.coub-tv .tv-start:not(:disabled):hover{background:var(--color-accent-hover,#ff8a4b)}
.coub-tv .tv-start:not(:disabled):active{transform:translateY(1px)}
.coub-tv .tv-start:disabled{opacity:.65;cursor:default}
.coub-tv .tv-loading-line{width:180px;height:2px;margin:22px auto 14px;background:#ffffff14;border-radius:2px;overflow:hidden}
.coub-tv .tv-loading-line span{display:block;width:60px;height:100%;background:linear-gradient(90deg,transparent,#ff6b1ab3,transparent);animation:tv-stream-loading 1.8s ease-in-out infinite}
.coub-tv:not([data-welcome-state="loading"]) .tv-loading-line span{animation:none;opacity:0}
.coub-tv .tv-readiness{min-height:40px;max-width:340px;margin:0 auto;color:#b6b4bb;font-size:13px;line-height:20px;text-wrap:balance}
.coub-tv .tv-sound-hint{margin:8px 0 0;color:#88868e;font-size:12px;line-height:20px}
.coub-tv.tv-playing .tv-welcome{opacity:0;pointer-events:none}
.coub-tv.tv-entering .tv-stage video{transition:opacity 650ms ease}
.coub-tv .tv-status{position:absolute;z-index:5;bottom:calc(160px + env(safe-area-inset-bottom));left:20px;right:20px;text-align:center;color:#eee;font-size:14px;text-shadow:0 1px 8px #000;margin:0;pointer-events:none}
@keyframes tv-welcome-enter{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}
@keyframes tv-stream-loading{from{transform:translateX(-60px)}to{transform:translateX(180px)}}
.coub-tv .tv-status[hidden]{display:none}
.coub-tv .tv-controls{position:absolute;z-index:5;bottom:0;left:0;right:0;display:flex;flex-direction:column;align-items:center;padding:64px max(16px,env(safe-area-inset-right)) calc(20px + env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left));background:linear-gradient(transparent,rgba(0,0,0,.6));transition:opacity .2s}
.coub-tv .tv-caption{position:absolute;z-index:5;bottom:calc(94px + env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);width:calc(100% - max(16px,env(safe-area-inset-left)) - max(16px,env(safe-area-inset-right)));opacity:0;pointer-events:none;transition:opacity 350ms ease;color:#eeeae4;text-decoration:none;display:flex;flex-direction:column;align-items:center;gap:5px;min-width:0;max-width:520px;text-align:center;text-shadow:0 2px 12px #0008}
.coub-tv.tv-caption-visible .tv-caption,.coub-tv .tv-caption:focus-visible{opacity:1;pointer-events:auto}
.coub-tv .tv-caption strong{max-width:100%;font-family:"Figtree",-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;font-size:clamp(16px,1.6vw,20px);font-weight:500;line-height:1.35;letter-spacing:-.015em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.coub-tv .tv-caption span{max-width:100%;font-size:12px;font-weight:400;line-height:1.5;letter-spacing:.015em;color:#b5b3bc;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.coub-tv .tv-actions{display:flex;align-items:center;gap:4px;padding:6px;border:1px solid #ffffff1f;border-radius:16px;background:rgba(18,19,22,.78);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);box-shadow:0 6px 24px #0003,inset 0 1px 0 #ffffff06;flex-shrink:0}
.coub-tv .tv-actions button,.coub-tv .tv-close{appearance:none;display:grid;place-items:center;width:44px;height:44px;min-width:44px;min-height:44px;padding:0;border:1px solid transparent;border-radius:10px;background:transparent;color:#e7e5ea;cursor:pointer;transition:background 160ms ease,border-color 160ms ease,color 160ms ease,opacity 200ms ease}
.coub-tv .tv-actions svg,.coub-tv .tv-close svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
.coub-tv .tv-actions button:not(:disabled):hover,.coub-tv .tv-close:hover{background:#ffffff0d;border-color:#ffffff12}
.coub-tv .tv-actions button[aria-pressed="true"]{background:#ffffff12;border-color:#ffffff1f;color:#fff}
.coub-tv .tv-actions button:not(:disabled):active,.coub-tv .tv-close:active{background:#ffffff20;border-color:#ffffff30}
.coub-tv .tv-actions button:disabled{opacity:.35;cursor:default}
.coub-tv .tv-close{position:absolute;z-index:5;top:max(16px,env(safe-area-inset-top));right:max(16px,env(safe-area-inset-right));border-radius:50%;border-color:#ffffff14;background:rgba(18,19,22,.65);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);box-shadow:0 4px 16px #0002}
.coub-tv :focus-visible{outline:2px solid #eeeae4;outline-offset:4px}
.coub-tv.tv-controls-hidden .tv-controls,.coub-tv.tv-controls-hidden .tv-close{opacity:0;pointer-events:none}
@media(max-width:600px){.coub-tv .tv-controls{padding-top:48px}.coub-tv .tv-caption{bottom:calc(90px + env(safe-area-inset-bottom))}.coub-tv .tv-status{font-size:12px;bottom:calc(160px + env(safe-area-inset-bottom))}}
@media(max-height:480px){.coub-tv .tv-welcome{padding:16px 16px 80px}.coub-tv .tv-welcome h2{font-size:32px;margin-bottom:12px}.coub-tv .tv-subtitle{margin-bottom:16px}.coub-tv .tv-sound-hint{margin-top:0}}
@media(prefers-reduced-motion:reduce){.coub-tv .tv-controls,.coub-tv .tv-caption,.coub-tv .tv-close,.coub-tv .tv-actions button,.coub-tv .tv-welcome,.coub-tv.tv-entering .tv-stage video,.coub-tv .tv-start{transition:none}.coub-tv .tv-welcome-block,.coub-tv .tv-loading-line span{animation:none}.coub-tv .tv-loading-line span{transform:translateX(60px)}}

/* One restrained channel-switch cover, held until a decoded frame can replace it. */
.coub-tv .tv-static{position:absolute;inset:0;z-index:6;pointer-events:none;background:#262628;opacity:1;transition:opacity 250ms ease}
.coub-tv .tv-static canvas{display:block;width:100%;height:100%;opacity:.85}
.coub-tv .tv-static::after{content:"";position:absolute;inset:0;background:repeating-linear-gradient(0deg,transparent 0 3px,rgba(0,0,0,.08) 3px 4px);pointer-events:none}
.coub-tv.tv-startup .tv-welcome{visibility:hidden;transition:none}
.coub-tv.tv-startup .tv-stage video{transition:none}
.coub-tv.tv-startup-reveal .tv-static{opacity:0}
@media(prefers-reduced-motion:reduce){
  .coub-tv .tv-static{background:#15161b;transition:opacity 160ms ease}
  .coub-tv .tv-static canvas,.coub-tv .tv-static::after{display:none}
}
