/* The comment reel. Visual direction: research/youtube-art-direction.md. */

/* Tokens. A tint swaps these four and nothing else. */
.yt-page {
  --room: #191922; --room-rgb: 25 25 34;
  --words: #fff8e7;
  --action: #dbff46;
  --mark: #ff83be;
  --side: 20px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --rail: 52px;
  --thumb: 72px;
  --floor: .68;           /* no text sits on less scrim than this */
}
:root[data-theme=night] .yt-page { --room: #171625; --room-rgb: 23 22 37; --words: #f0edff; --action: #d8d0ff; --mark: #ff83be; }
:root[data-theme=bubblegum] .yt-page { --room: #3f173a; --room-rgb: 63 23 58; --words: #fff1f4; --action: #ffdf83; --mark: #ffacd4; }

html:has(.yt-page) { height: 100%; background: #191922; color-scheme: dark; }
.yt-page {
  display: block;
  height: 100svh;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--room);
  color: var(--words);
  font: 700 12px/1.4 var(--mono);
  -webkit-text-size-adjust: 100%;
}
.yt-page a { color: inherit; }
.yt-page button { color: inherit; }
.yt-page button:disabled { opacity: 1; }
.yt-page :is(a, button, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--action);
  outline-offset: 3px;
  box-shadow: 0 0 0 3px var(--room);
}
.yt-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- the room ---------- */
.yt-backdrop {
  position: fixed;
  z-index: -2;
  inset: 0;
  overflow: hidden;
  background-color: var(--room);
}
/* The picture. On a tall screen a wide frame that covered the full height would show a sliver of
   itself, so it fills the upper part of the screen, soft but recognisable, and dissolves into the
   room where the words begin. An optional .yt-wash copy carries its colour to the bottom edge. */
.yt-backdrop img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 64svh;
  object-fit: cover;
  object-position: 50% 40%;
  transform: scale(1.05);
  filter: blur(var(--soft, 6px)) saturate(1.15);
  -webkit-mask-image: linear-gradient(#000 70%, transparent);
  mask-image: linear-gradient(#000 70%, transparent);
}
.yt-backdrop img.yt-wash {
  height: 100%;
  transform: scale(1.3);
  filter: blur(44px) saturate(1.4);
  -webkit-mask-image: none;
  mask-image: none;
}
/* Fail-safe: without a wash copy the one picture must still cover the whole viewport. */
.yt-backdrop img:only-child { height: 100%; -webkit-mask-image: none; mask-image: none; }
/* Base wash and grain. */
.yt-backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.88' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath fill='%23fff8e7' opacity='.06' filter='url(%23n)' d='M0 0h120v120H0z'/%3E%3C/svg%3E"),
    rgb(var(--room-rgb) / .06);
}
/* comma's own light art: the emergency picture, and the consent screen. */
.yt-light-0 { background-image: radial-gradient(46vmax 46vmax at 86% 12%, #dbff46d9, #dbff4640 46%, transparent 70%), radial-gradient(44vmax 44vmax at 104% 62%, #ff83becc, #ff83be38 46%, transparent 70%), radial-gradient(52vmax 52vmax at 10% 100%, #6860f0a6, transparent 68%); }
.yt-light-1 { background-image: radial-gradient(46vmax 46vmax at 80% 8%, #ff83bed9, #ff83be40 46%, transparent 70%), radial-gradient(50vmax 50vmax at 4% 30%, #6860f0a6, transparent 68%), radial-gradient(40vmax 40vmax at 102% 58%, #dbff46b3, #dbff4630 46%, transparent 70%); }
.yt-light-2 { background-image: radial-gradient(42vmax 42vmax at 58% -2%, #dbff46d9, #dbff4640 46%, transparent 70%), radial-gradient(54vmax 54vmax at 98% 30%, #6860f0bf, transparent 68%), radial-gradient(40vmax 40vmax at -4% 44%, #ff83beb3, #ff83be30 46%, transparent 70%); }
.yt-light-3 { background-image: radial-gradient(40vmax 40vmax at 12% 8%, #ff83bed9, #ff83be40 46%, transparent 70%), radial-gradient(46vmax 46vmax at 78% 22%, #dbff46cc, #dbff4638 46%, transparent 70%), radial-gradient(52vmax 52vmax at 104% 70%, #6860f0a6, transparent 68%); }
.yt-light-4 { background-image: radial-gradient(48vmax 48vmax at 92% 26%, #ff83bed9, #ff83be40 46%, transparent 70%), radial-gradient(42vmax 42vmax at 26% 2%, #dbff46cc, #dbff4638 46%, transparent 70%), radial-gradient(50vmax 50vmax at 30% 62%, #6860f08c, transparent 68%); }

/* ---------- top line ---------- */
.yt-mast {
  position: fixed;
  z-index: 5;
  top: 0; left: 0; right: 0;
  padding: var(--safe-top) var(--side) 0;
  border: 0;
  background: none;
  pointer-events: none;
}
.yt-card::before, .yt-gate::before {            /* top band of the scrim, behind the top line and credit */
  content: "";
  position: fixed;
  z-index: -1;
  inset: 0 0 auto;
  height: calc(var(--safe-top) + 128px);
  background: linear-gradient(rgb(var(--room-rgb) / .74), rgb(var(--room-rgb) / var(--floor)) calc(var(--safe-top) + 64px), transparent);
  pointer-events: none;
}
.yt-topline { display: flex; align-items: center; justify-content: space-between; height: 44px; pointer-events: auto; }
.yt-wordmark { font: 900 30px/1 var(--display); letter-spacing: -.02em; }
.yt-wordmark span { color: var(--mark); }
.yt-head-tools { display: flex; align-items: center; gap: 4px; margin-right: -10px; }
.yt-counter { font: 700 11px/1 var(--mono); letter-spacing: -.02em; }

/* ··· and its sheet */
.yt-menu > summary { display: grid; place-items: center; width: 44px; height: 44px; list-style: none; cursor: pointer; }
.yt-menu > summary::-webkit-details-marker { display: none; }
.yt-menu[open] > summary::before { content: ""; position: fixed; inset: 0; background: rgb(var(--room-rgb) / .55); cursor: default; }
.yt-drawer {
  position: fixed;
  z-index: 7;
  left: 0; right: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  max-height: 82svh;
  overflow-y: auto;
  padding: 10px var(--side) calc(14px + var(--safe-bottom));
  border-radius: 14px 14px 0 0;
  background: var(--words);
  color: var(--room);
}
.yt-drawer::before { content: ""; flex: none; align-self: center; width: 36px; height: 4px; margin-bottom: 6px; border-radius: 2px; background: rgb(var(--room-rgb) / .25); }
.yt-menu-context { display: contents; }
.yt-page .yt-drawer :is(button, .feedback-link, .yt-menu-context > a, .yt-editorial summary) {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  border-radius: 0;
  box-shadow: none;
  min-height: 52px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid rgb(var(--room-rgb) / .14);
  background: none;
  color: var(--room);
  font: 900 24px/1 var(--display);
  font-family: Barlow, Space, 'Arial Narrow', sans-serif;   /* Space Mono supplies ↗ as text, not emoji */
  font-variant-emoji: text;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.yt-drawer .icon { width: 20px; height: 20px; }
.yt-page .yt-drawer [data-yt-discover][aria-current=page] { display: none; }
.yt-drawer [data-yt-saved-count] { margin-left: auto; font: 700 12px/1 var(--mono); }
.yt-drawer [data-yt-moderation] { display: contents; }
.yt-editorial summary { list-style: none; }
.yt-editorial summary::-webkit-details-marker { display: none; }
.yt-editorial p { margin: 10px 0 14px; font: 400 20px/1.3 var(--serif); }
.yt-legal { display: flex; flex-wrap: wrap; gap: 0 16px; margin-top: 10px; }
.yt-legal a { display: inline-flex; align-items: center; min-height: 44px; font: 700 11px/1.3 var(--mono); text-underline-offset: 3px; }
.yt-drawer small { font: 700 11px/1.4 var(--mono); }
.yt-views { display: block; padding: 12px 0 0; font: 700 11px/1.4 var(--mono); }

/* picture credit: the visible CC BY line, opening the full credit */
.yt-visual-credit {
  position: fixed;
  z-index: 6;
  top: calc(var(--safe-top) + 34px);
  left: var(--side);
  max-width: calc(100vw - 2 * var(--side));
  font: 700 10px/1.3 var(--mono);
}
.yt-visual-credit summary { display: block; min-height: 44px; overflow: hidden; max-width: calc(100vw - 2 * var(--side)); padding: 9px 0; list-style: none; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.yt-visual-credit summary::-webkit-details-marker { display: none; }
.yt-visual-credit > div {
  width: min(330px, calc(100vw - 2 * var(--side)));
  padding: 12px 14px;
  border-radius: 4px;
  background: var(--words);
  color: var(--room);
  font: 700 11px/1.45 var(--mono);
}
.yt-visual-credit p { margin: 0 0 8px; }
.yt-visual-credit > div a { display: inline-flex; align-items: center; min-height: 44px; margin-right: 12px; }

/* ---------- the card ---------- */
.yt-main, [data-youtube-deck] { height: 100%; }
[data-youtube-deck] { display: flex; flex-direction: column; }
[data-yt-slot] { flex: 1 1 0; min-height: 0; }
.yt-card {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 100%;
  padding: calc(var(--safe-top) + 76px) var(--side) 12px;
  border: 0;
  background: none;
  box-shadow: none;
}
.yt-copy { position: relative; display: flex; flex-direction: column; min-height: 0; max-height: 100%; }
.yt-copy::before {            /* words band: the dark follows the comment */
  content: "";
  position: absolute;
  z-index: -1;
  top: -110px;
  bottom: -100svh;
  left: calc(-1 * var(--side));
  width: 100vw;
  background: linear-gradient(transparent, rgb(var(--room-rgb) / var(--floor)) 110px, rgb(var(--room-rgb) / .82));
  pointer-events: none;
}
.yt-words, .yt-source { padding: 0; border: 0; background: none; }
.yt-words { display: flex; flex-direction: column; min-height: 0; }
.yt-words::before { content: none; }
.yt-comment-scroll { min-height: 2.2em; max-height: 46svh; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; font-size: var(--quote); }
.yt-comment-scroll::-webkit-scrollbar { display: none; }
.yt-quote {
  margin: 0;
  padding: 0 0 .08em;
  font: 400 var(--quote)/1.04 var(--serif);
  letter-spacing: -.02em;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}
.yt-quote[data-length=short] { --quote: clamp(36px, 12.3vw, 52px); }
.yt-quote[data-length=medium] { --quote: clamp(26px, 8vw, 32px); line-height: 1.12; }
.yt-quote[data-length=long] { --quote: 22px; line-height: 1.22; letter-spacing: -.01em; }
/* measured tiers override the character-count guess */
[data-yt-fit=medium] .yt-quote { --quote: clamp(26px, 8vw, 32px); line-height: 1.12; }
[data-yt-fit=long] .yt-quote { --quote: 22px; line-height: 1.22; letter-spacing: -.01em; }
.yt-card:not([data-yt-expanded]) .yt-comment-scroll:has(+ .yt-read-all:not([hidden])) {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(#000 calc(100% - 2.4em), transparent);
  mask-image: linear-gradient(#000 calc(100% - 2.4em), transparent);
}
.yt-read-all { align-self: flex-start; min-height: 44px; margin: -4px 0 -8px; padding: 0; border: 0; background: none; font: 700 12px/1 var(--mono); text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
[data-yt-expanded] .yt-comment-scroll { max-height: none; overflow-y: auto; -webkit-mask-image: none; mask-image: none; }
[data-yt-expanded] .yt-copy::before { top: -40px; background: linear-gradient(transparent, rgb(var(--room-rgb) / .88) 40px); }
.yt-byline { display: flex; flex-wrap: wrap; align-items: center; gap: 0 14px; margin-top: 12px; font: 700 12px/1.3 var(--mono); }
.yt-byline a { display: inline-flex; align-items: center; min-height: 32px; text-decoration: none; overflow-wrap: anywhere; }
.yt-byline a:hover { text-decoration: underline; text-underline-offset: 3px; }
.yt-credit { font: inherit; }
.yt-likes { color: inherit; font: inherit; }

/* Play, directly under the comment, beside the untouched official preview */
.yt-source { display: flex; flex: none; flex-direction: column; margin-top: 14px; }
.yt-play-strip { display: flex; align-items: stretch; gap: 12px; height: var(--thumb); }
.yt-thumbnail { flex: none; height: var(--thumb); }
.yt-thumbnail img { display: block; width: auto; height: var(--thumb); }   /* intrinsic ratio; no radius, filter, crop or overlay */
.yt-thumbnail img:not([width]) { aspect-ratio: auto 16 / 9; }
.yt-play {
  display: flex;
  flex: 1 1 0;
  align-items: center;
  gap: 10px;
  min-width: 96px;
  padding: 0 20px;
  border: 0;
  border-radius: 4px;
  background: var(--action);
  color: var(--room);
  box-shadow: 3px 3px 0 var(--room);
  font: 900 32px/1 var(--display);
  text-transform: lowercase;
  cursor: pointer;
}
.yt-page .yt-play { color: var(--room); }
.yt-play .icon { width: 22px; height: 22px; color: var(--room); }
.yt-play:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--room); }
.yt-stage { border: 0; background: none; }
.yt-stage iframe { display: block; width: calc(100% + 2 * var(--side)); max-width: none; margin-inline: calc(-1 * var(--side)); aspect-ratio: 16 / 9; min-height: 200px; border: 0; background: #000; }
.yt-card[data-playing] .yt-play-strip { display: none; }
.yt-stop { align-self: flex-end; min-height: 44px; padding: 0; border: 0; background: none; font: 700 11px/1 var(--mono); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.yt-video-info { display: block; margin-top: 12px; }
.yt-source-title {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  font: 900 22px/1.02 var(--display);
  letter-spacing: -.005em;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
.yt-attribution { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 2px; }
.yt-uploader { min-width: 0; margin: 0; font: 700 11px/1.3 var(--mono); overflow-wrap: anywhere; }
.yt-uploader a { display: inline-flex; align-items: center; min-height: 32px; text-decoration: none; }
.yt-watch { flex: none; margin: 0; }
.yt-provider-mark { display: flex; align-items: center; min-height: 44px; padding-left: 10px; }
.yt-provider-mark picture { display: block; padding: 0; background: none; }
/* The room is dark: show YouTube's dark-background mark. Delete this line once the markup's default src is /brand/youtube-dark.svg. */
.yt-provider-mark img { display: block; width: 90px; height: 20px; }

/* ---------- rail ---------- */
.yt-controls {
  position: relative;
  z-index: 1;
  display: flex;
  flex: none;
  align-items: center;
  gap: 0;
  height: calc(var(--rail) + var(--safe-bottom));
  margin: 0;
  padding: 0 calc(var(--side) - 10px) var(--safe-bottom);
  background: none;
}
.yt-controls button {
  display: grid;
  place-items: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: none;
  box-shadow: none;
  cursor: pointer;
}
.yt-controls .icon { width: 24px; height: 24px; stroke-width: 2; }
.yt-controls [data-yt-prev] { margin-left: auto; }
.yt-controls :is([data-yt-prev], [data-yt-next]) .icon { transform: rotate(90deg); }   /* the reel moves vertically */
.yt-controls button:disabled { opacity: .38; cursor: default; }
[data-yt-save][aria-pressed=true] .icon { fill: var(--mark); stroke: var(--words); }

/* ---------- states ---------- */
.yt-empty, [data-yt-end] {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 14px;
  padding: 0 var(--side) calc(var(--rail) + var(--safe-bottom) + 24px);
  border: 0;
  background:
    linear-gradient(rgb(var(--room-rgb) / .35), rgb(var(--room-rgb) / .9) 62%),
    radial-gradient(46vmax 46vmax at 86% 12%, #dbff46d9, #dbff4640 46%, transparent 70%),
    radial-gradient(44vmax 44vmax at 104% 62%, #ff83becc, #ff83be38 46%, transparent 70%),
    radial-gradient(52vmax 52vmax at 10% 100%, #6860f0a6, transparent 68%),
    var(--room);
}
.yt-empty h2, [data-yt-end] h2 { margin: 0; font: 400 clamp(36px, 11vw, 56px)/1.04 var(--serif); letter-spacing: -.02em; }
.yt-empty p, [data-yt-end] p { margin: -4px 0 6px; font: 700 12px/1.4 var(--mono); }
.yt-empty :is(button, a):not([hidden]) ~ :is(button, a), [data-yt-end] :is(button, a):not([hidden]) ~ :is(button, a) { min-height: 44px; padding: 0; background: none; box-shadow: none; color: var(--words); font: 700 12px/1 var(--mono); text-decoration: underline; text-underline-offset: 4px; text-transform: none; }
.yt-empty :is(button, a), [data-yt-end] :is(button, a) {
  display: inline-flex;
  align-items: center;
  min-height: 52px;
  margin: 0;
  padding: 0 20px;
  border: 0;
  border-radius: 4px;
  background: var(--action);
  color: var(--room);
  box-shadow: 3px 3px 0 #0006;
  font: 900 26px/1 var(--display);
  text-decoration: none;
  text-transform: lowercase;
}
.toast { border: 0; border-radius: 4px; background: var(--words); color: var(--room); box-shadow: none; font: 700 12px/1.3 var(--mono); }

/* ---------- consent: the cold open ---------- */
.yt-gate {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  width: auto;
  height: 100svh;
  margin: 0;
  padding: 0 var(--side) calc(28px + var(--safe-bottom));
  border: 0;
  background: none;
  box-shadow: none;
}
.yt-gated .yt-topline .yt-wordmark { visibility: hidden; }
.yt-gate-copy { position: relative; display: block; max-width: 620px; padding: 0; }
.yt-gate-copy::before { content: ""; position: absolute; z-index: -1; top: -110px; bottom: -100svh; left: calc(-1 * var(--side)); width: 100vw; background: linear-gradient(transparent, rgb(var(--room-rgb) / var(--floor)) 110px, rgb(var(--room-rgb) / .9)); pointer-events: none; }
.yt-gate h1 { margin: 0 0 18px; font-size: 0; line-height: 0; }
.yt-gate h1 .yt-wordmark { font-size: clamp(64px, 20vw, 96px); line-height: .9; }
.yt-gate-lead { margin: 0; font: 400 clamp(36px, 10.4vw, 56px)/1.04 var(--serif); letter-spacing: -.02em; text-wrap: balance; }
.yt-gate-sub { margin: 14px 0 0; font: 700 12px/1.4 var(--mono); }
.yt-gate form { display: block; margin: 24px 0 0; }
.yt-enter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 64px;
  padding: 0 20px;
  border: 0;
  border-radius: 4px;
  background: var(--action);
  box-shadow: 3px 3px 0 var(--room);
  font: 900 32px/1 var(--display);
  text-transform: lowercase;
  cursor: pointer;
}
.yt-page .yt-enter { color: var(--room); }
.yt-enter .icon { width: 26px; height: 26px; }
.yt-consent { max-width: 56ch; margin: 18px 0 0; font: 700 11px/1.5 var(--mono); }
.yt-consent a { text-underline-offset: 3px; }

/* ---------- the third-forward invitation: a cream bar in place of the top line ---------- */
.yt-mast:has(> .feed-account-prompt) .yt-topline { display: none; }
.yt-page .feed-account-prompt {
  grid-template-columns: minmax(0, 1fr) auto 44px;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  margin: 4px 0 0;
  padding: 5px 0 5px 12px;
  border-radius: 4px;
  background: var(--words);
  color: var(--room);
  box-shadow: none;
  font: 900 19px/1 var(--display);
  text-transform: lowercase;
}
/* While the bar is up the picture credit moves below it instead of hiding under it. */
.yt-page:has(.yt-mast > .feed-account-prompt) .yt-visual-credit { top: calc(var(--safe-top) + 58px); }
.yt-page .feed-invite-register {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 16px;
  background: var(--room);
  color: var(--words);
  font: 900 16px/1 var(--display);
  text-decoration: none;
  text-transform: lowercase;
}
.yt-page .feed-invite-dismiss { color: var(--room); }
/* the one swipe hint: words, not a chip */
.yt-page .feed-cue {
  top: auto !important;
  right: auto !important;
  bottom: calc(var(--safe-bottom) + 4px) !important;
  left: 50% !important;
  transform: translateX(-50%);
  padding: 0 0 0 4px;
  border: 0;
  background: none;
  box-shadow: none;
  color: var(--words);
  font: 700 11px/1 var(--mono);
  text-transform: lowercase;
}
.yt-page .feed-cue::after { content: none; }
.yt-page .feed-cue-arrow { color: var(--words); font: 700 14px/1 var(--mono); }

/* ---------- wide screens: a lower third over the whole frame ---------- */
@media (min-width: 720px) {
  .yt-page { --side: clamp(32px, 4.5vw, 72px); --thumb: 108px; --soft: 10px; }
  .yt-backdrop img { height: 100%; -webkit-mask-image: none; mask-image: none; }
  .yt-wordmark { font-size: 36px; }
  .yt-visual-credit { top: calc(var(--safe-top) + 38px); }
  .yt-copy { width: min(760px, 100%); }
  .yt-copy::before { top: -160px; background: linear-gradient(transparent, rgb(var(--room-rgb) / var(--floor)) 160px, rgb(var(--room-rgb) / .82)); }
  .yt-quote[data-length=short] { --quote: clamp(52px, 5.4vw, 88px); }
  .yt-quote[data-length=medium], [data-yt-fit=medium] .yt-quote { --quote: clamp(34px, 3.3vw, 48px); }
  .yt-quote[data-length=long], [data-yt-fit=long] .yt-quote { --quote: clamp(24px, 2.1vw, 30px); }
  .yt-page .feed-account-prompt { width: min(100%, 520px); margin-inline: 0 auto; }
  .yt-source { max-width: calc(var(--thumb) * 16 / 9 + 12px + 340px); }
  .yt-card[data-playing] .yt-source { max-width: none; }
  .yt-play { flex: 0 1 340px; padding: 0 28px; font-size: 44px; }
  .yt-play .icon { width: 30px; height: 30px; }
  .yt-source-title { font-size: 30px; }
  /* Leave the comment its lines: the player gives up width before the words are clipped. */
  .yt-stage iframe { width: min(100%, max(356px, calc((100svh - 520px) * 16 / 9))); margin-inline: 0; }
  .yt-gate-copy { width: min(620px, 100%); }
  .yt-enter { width: auto; min-width: 320px; }
  .yt-drawer { position: absolute; top: 46px; right: 0; bottom: auto; left: auto; width: 340px; max-height: 76svh; padding: 4px 18px 14px; border-radius: 8px; box-shadow: 0 18px 50px #0008; }
  .yt-drawer::before { content: none; }
  .yt-menu { position: relative; }
  .yt-menu[open] > summary::before { background: none; }
}
/* rotated phones and short windows: comment left, play right */
@media (orientation: landscape) and (max-height: 540px) {
  .yt-page { --thumb: 72px; --side: max(20px, env(safe-area-inset-left, 0px)); }
  .yt-card { justify-content: flex-end; padding-top: calc(var(--safe-top) + 52px); }
  .yt-copy { display: grid; grid-template-columns: 55fr 45fr; align-items: end; gap: 28px; width: 100%; }
  .yt-quote[data-length=short] { --quote: clamp(28px, 4.6vw, 40px); }
  .yt-quote[data-length=medium] { --quote: 24px; }
  .yt-quote[data-length=long] { --quote: 18px; }
  .yt-source { margin-top: 0; }
  .yt-play { padding: 0 20px; font-size: 32px; }
  .yt-play .icon { width: 22px; height: 22px; }
  .yt-source-title { font-size: 20px; -webkit-line-clamp: 2; }
  .yt-controls { height: calc(44px + var(--safe-bottom)); }
  .yt-backdrop img { height: 100%; -webkit-mask-image: none; mask-image: none; }
}
@media (max-width: 359px) {
  .yt-page { --side: 16px; }
  .yt-play { padding: 0 14px; font-size: 28px; }
}
@media (prefers-reduced-motion: no-preference) {
  .yt-play { transition: transform .08s ease, box-shadow .08s ease; }
}
@media (forced-colors: active) {
  .yt-play, .yt-enter { border: 2px solid ButtonText; }
  .yt-provider-mark img { content: normal; }
}
