.bar nav { grid-template-columns: repeat(5,minmax(0,1fr)); }
.bar nav::before { width: calc((100% - 8px) / 5); }
.bar nav:has(#videos-tab[aria-pressed=true]) { --pill-offset: 400%; }
@media (min-width: 761px) and (max-width: 960px) {
  .bar nav button { flex-direction: column; gap: 2px; padding: 4px 7px; font-size: 12px; }
}
@media (max-width: 760px) {
  .bar nav::before { width: calc((100% - max(8px, env(safe-area-inset-right)) - max(8px, env(safe-area-inset-left))) / 5); }
}
#home-video-link {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; text-align: left;
  width: 100%; min-width: 0; padding: 8px 14px 8px 8px; border: 1px solid var(--line);
  border-radius: 17px; background: var(--paper); color: var(--ink); font: inherit;
}
.home-video-art {
  display: grid; place-items: center; flex: 0 0 84px; aspect-ratio: 16 / 9; border-radius: 11px;
  background: var(--light-tint) center / cover;
}
.home-video-art::before {
  content: ''; width: 28px; height: 25px; background: #141619dc;
  border-radius: 8px; grid-area: 1/1;
}
.home-video-art::after { content: ''; grid-area: 1/1; border: solid transparent; border-width: 5px 0 5px 8px; border-left-color: var(--highlight-text); }
.home-video-label { display: grid; min-width: 0; gap: 3px; }
.home-video-label strong { font-size: 16px; }
.home-video-label span { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-video-arrow { flex: none; color: var(--highlight-text); margin-left: auto; }
#videos-panel { margin-block: clamp(16px,3vw,36px); min-width: 0; }
.videos-view .heading, .videos-view .layout, .videos-view #load-warning,
#videos-panel [hidden], #videos-panel[hidden] { display: none; }
#video-feed-status { color: var(--muted); }
#video-feed-status:empty { display: none; }
.video-heading, .video-heading h2, .video-toolbar, .video-actions, #video-playlist {
  display: flex; align-items: center; gap: 8px;
}
.video-heading, .video-toolbar { justify-content: space-between; flex-wrap: wrap; }
.video-heading { margin: 3px 0 7px; }
.video-heading h2 { margin: 0; font-size: clamp(18px,2vw,27px); letter-spacing: -.025em; color: var(--ink); }
.video-heading a, .video-toolbar a { display: inline-flex; align-items: center; min-height: 44px; color: var(--highlight-text); font-weight: 600; font-size: 13px; text-decoration: none; }
#video-rail {
  display: grid; gap: 18px 20px; max-width: 1120px; margin: 16px auto 0; padding-inline: 0; grid-template-columns: minmax(0,1fr);
}
#video-rail:empty { display: none; }
.video-card {
  min-width: 0; overflow: hidden; align-self: start; background: var(--paper);
  border: 0; border-radius: 16px;
}
.video-card.is-playing { box-shadow: inset 0 0 0 1px var(--highlight); }
.video-card > button {
  display: block; width: 100%; border: 0; padding: 0; background: transparent; cursor: pointer;
}
.video-card > button:focus-visible { outline-offset: -3px; position: relative; z-index: 1; }
.video-card #video-player { margin: 0; border-radius: 0; }
.video-card #video-frame { min-height: 0; }
.video-card .video-toolbar { border-bottom: 1px solid var(--line); }
@media (min-width: 900px) {
  #video-rail { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
#video-rail .video-thumb {
  display: block; position: relative; overflow: hidden; aspect-ratio: 16 / 9;
  width: 100%; padding: 0; background: var(--paper);
}
#video-rail img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.video-thumb::after {
  content: ''; position: absolute; inset: auto auto 8px 8px; width: 36px; height: 32px;
  border-radius: 10px; background: #111724dc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 2v12l10-6z' fill='%23fff'/%3E%3C/svg%3E") center / 12px no-repeat;
}
#video-rail .video-name {
  display: block; padding: 10px 14px 13px; color: var(--ink); font-size: clamp(14px,1.6vw,17px); font-weight: 600;
  overflow: hidden; overflow-wrap: anywhere; line-height: 1.35;
}
.video-card:not(.is-playing) .video-name { cursor: pointer; }
.video-card.is-playing .video-name { color: var(--highlight-text); }
#video-player { overflow: hidden; border-radius: 16px; background: var(--paper); margin-bottom: 12px; }
#video-frame { aspect-ratio: 16 / 9; min-height: 200px; background: #111; }
#video-frame iframe { display: block; height: 100%; width: 100%; border: 0; }
.video-toolbar { padding: 0 12px; }
.video-actions { flex-wrap: wrap; }
#video-playlist, #video-close, #notify-retry, #video-retry {
  padding: 8px 12px; min-height: 44px; background: var(--control); border: 0;
  color: var(--ink); font: inherit; font-size: 13px; font-weight: 600; border-radius: 12px;
}
#video-close { background: transparent; color: var(--muted); }
#video-playlist svg { color: var(--highlight-text); }
#video-notifications {
  margin-top: 10px; border-top: 1px solid var(--line); color: var(--ink);
  font-size: 14px;
}
#video-notifications summary { width: fit-content; padding: 13px 0; cursor: pointer; }
#video-notifications fieldset { padding: 0; margin: 0; border: 0; display: flex; flex-wrap: wrap; gap: 8px; }
#video-notifications label {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px;
  min-height: 44px; border-radius: 12px; background: var(--paper); cursor: pointer;
}
#video-notifications input { accent-color: var(--highlight); width: 16px; height: 16px; }
#notify-status { color: var(--muted); }
#notify-status:empty { display: none; }
@media (hover: hover) {
  .video-heading a:hover, .video-toolbar a:hover, #video-close:hover { color: var(--ink); }
  #video-playlist:hover { color: var(--highlight-text); }
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .video-heading a, .video-toolbar a, #video-close, #video-playlist { transition: color .24s ease-in-out; }
}

@media (prefers-reduced-motion: no-preference) {
  html:has(body.videos-view) { scroll-behavior: smooth; }
  .video-card {
    transform-origin: center top;
    transition: transform .32s cubic-bezier(.2,.75,.25,1), box-shadow .32s ease, border-color .24s ease;
  }
  .video-card.is-playing {
    transform: translateY(-2px);
    box-shadow: 0 9px 24px rgb(0 0 0 / .24);
  }
  .video-card #video-frame { animation: video-reveal .28s ease-out; }
  @keyframes video-reveal { from { opacity: .55; } to { opacity: 1; } }
  .video-name, .video-toolbar a, #video-close { transition: color .22s ease; }
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .video-card:not(.is-playing):hover { transform: translateY(-1px); }
}