/* Native media-library layout inspired by the supplied Emby recording.
   Tokens/navigation and non-home pages are owned by emby-theme.css. */
.hero.home-carousel {
  --hero-category-height: 190px;
  position: relative;
  isolation: isolate;
  width: 100%;
  max-width: none;
  min-height: 0;
  margin: calc(-1 * var(--header-height, 100px)) 0 0;
  border: 0;
  border-radius: 0;
  background: var(--bg, #101014);
  overflow: clip;
  touch-action: pan-y pinch-zoom;
}
.home-carousel .hero-slides { display: grid; position: relative; overflow: hidden; }
.home-carousel .hero-slide {
  grid-area: 1 / 1;
  display: flex;
  align-items: center;
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: clamp(600px, 70svh, 900px);
  padding: var(--header-height, 100px) 0 72px;
  background: var(--bg, #101014);
  transform: translate3d(0, 0, 0);
}
.home-carousel .hero-slide[hidden] { display: none !important; }
.home-carousel .hero-slide.is-entering, .home-carousel .hero-slide.is-leaving { will-change: transform; }
.home-carousel .hero-slide.is-leaving { pointer-events: none; }
.home-carousel .hero-cover { position: absolute; inset: 0; background: var(--surface, #1c1c22); }
.home-carousel .hero-cover picture { display: block; width: 100%; height: 100%; }
.home-carousel .hero-cover img {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
  filter: none;
}
.home-carousel .hero-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, #101014f0 0%, #101014cf 22%, #10101466 52%, #10101400 78%), linear-gradient(0deg, #101014 0%, #101014a8 8%, #10101400 38%);
}
.home-carousel .hero-content {
  position: relative;
  z-index: 1;
  width: min(780px, 62%);
  max-width: none;
  min-height: 0;
  padding: 70px 0 34px var(--page-gutter, 4vw);
}
.home-carousel .hero-label { display: inline-flex; align-items: center; gap: 12px; color: #dee7eb; font-size: 12px; font-weight: 600; letter-spacing: .12em; }
.home-carousel .hero-label b { background: transparent; padding: 2px 5px; border: 1px solid #ffffff50; border-radius: 4px; color: #e9edf0; font-size: 10px; font-weight: 500; letter-spacing: 0; }
.home-carousel h1 {
  margin: 19px 0 15px;
  color: #f3f6fa;
  font-size: clamp(32px, 3.75vw, 64px);
  font-weight: 760;
  line-height: 1.17;
  letter-spacing: -.035em;
  text-wrap: balance;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
  text-shadow: 0 2px 24px #10101450;
}
.home-carousel .hero-sub { margin: 0 0 16px; color: #c6d0d7; font-size: 14px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.home-carousel .hero-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; line-height: 1.6; color: #c5cfd6; }
.home-carousel .hero-meta > span { overflow-wrap: anywhere; min-width: 0; }
.home-carousel .hero-meta a { color: inherit; }
.home-carousel .hero-description { margin: 22px 0 17px; max-width: 53ch; font-size: 15px; line-height: 1.8; color: #d1d8df; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.home-carousel .hero-tags { display: flex; gap: 7px; flex-wrap: wrap; }
.home-carousel .hero-tags .tag-chip { border-color: #ffffff28; background: #1c1c229c; color: #dce4eb; padding: 4px 8px; font-size: 11px; border-radius: 6px; }
.home-carousel .hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.home-carousel .hero-actions .button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 12px 22px; border-radius: 10px; font-size: 14px; font-weight: 650; }
.home-carousel .hero-actions .button-primary { background: #f3f6fa; color: #1c1c22; border: 1px solid #f3f6fa; box-shadow: none; }
.home-carousel .hero-actions .button-primary:hover { background: #dce5eb; border-color: #dce5eb; color: #1c1c22; }
.home-carousel .hero-actions .button-quiet { background: #1c1c2270; border: 1px solid #ffffff50; color: #f3f6fa; }
.home-carousel .hero-actions .button-quiet:hover { background: #26333ecc; border-color: #ffffff85; }
.home-carousel .hero-actions svg { width: 20px; height: 20px; }
.home-carousel .is-current .hero-content > h1 { animation: emby-hero-copy 720ms cubic-bezier(.16, 1, .3, 1) both; }
.home-carousel .is-current .hero-content > .hero-description { animation: emby-hero-copy 720ms 100ms cubic-bezier(.16, 1, .3, 1) both; }
.home-carousel .is-current .hero-content > .hero-actions { animation: emby-hero-actions 720ms 200ms cubic-bezier(.16, 1, .3, 1) both; }
@keyframes emby-hero-copy { from { opacity: 0; transform: translate3d(0, 24px, 0); } to { opacity: 1; transform: translate3d(0, 0, 0); } }
/* Fade the bottom row in place so entry motion cannot create a temporary scroll range. */
@keyframes emby-hero-actions { from { opacity: 0; } to { opacity: 1; } }
.home-carousel .hero-work-index { position: absolute; right: var(--page-gutter, 4vw); bottom: 130px; display: flex; align-items: center; gap: 18px; color: #ffffffab; }
.hero-work-index > span { font-size: 72px; font-weight: 350; line-height: 1; letter-spacing: -.07em; font-variant-numeric: tabular-nums; }
.hero-work-index > small { max-width: 4em; line-height: 1.8; font-size: 11px; letter-spacing: .06em; }
.home-carousel .hero-controls {
  position: absolute;
  z-index: 2;
  right: var(--page-gutter, 4vw);
  bottom: calc(var(--hero-category-height) + 18px);
  display: flex;
  align-items: center;
  gap: 2px;
  padding-bottom: 10px;
}
.home-carousel .hero-controls button, .home-categories .rail-controls button { display: inline-flex; justify-content: center; align-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 10px; background: #1018216b; color: #f3f6fa; cursor: pointer; transition: background 180ms, transform 180ms, opacity 180ms; }
.home-carousel .hero-controls button:hover, .home-categories .rail-controls button:hover { background: #ffffff20; }
.home-carousel .hero-controls button:active, .home-categories .rail-controls button:active { transform: scale(.98); }
.home-carousel .hero-controls button:disabled, .home-categories .rail-controls button:disabled { opacity: .35; cursor: default; }
.home-carousel .hero-controls svg, .home-categories .rail-controls svg { width: 20px; height: 20px; }
.home-carousel .hero-pagination { display: flex; gap: 0; }
.home-carousel .hero-pagination button { width: 44px; border-radius: 0; background: transparent; }
.home-carousel [data-hero-index]::before { content: ''; width: 5px; height: 5px; border-radius: 10px; background: #ffffff60; transition: background 180ms, transform 180ms; }
.home-carousel [data-hero-index][aria-current="true"]::before { width: 5px; background: #f3f6fa; transform: scale(1.5); }
.home-carousel .hero-position { position: static; width: auto; height: auto; padding: 0 12px 0 0; margin: 0; clip-path: none; overflow: visible; white-space: nowrap; color: #d2dce2; font-size: 12px; font-variant-numeric: tabular-nums; }
.home-carousel .hero-autoplay-hint, .home-carousel .hero-control-label, .card-action-label { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.home-carousel .hero-progress { position: absolute; bottom: 0; left: 0; right: 0; height: 2px; border-radius: 2px; overflow: hidden; background: #ffffff25; }
.home-carousel .hero-progress > span { display: block; height: 100%; width: 100%; background: #f3f6fa; transform: scaleX(0); transform-origin: left; }
.home-categories { position: relative; z-index: 2; margin-top: -20px; padding: 0 var(--page-gutter, 4vw) 18px; min-height: var(--hero-category-height); }
.category-rail-heading { display: flex; justify-content: space-between; align-items: center; min-height: 44px; margin-bottom: 1px; color: #c4cfd8; font-size: 12px; letter-spacing: .06em; }
.home-categories .rail-controls { display: flex; gap: 5px; }
.home-categories .rail-controls button { width: 44px; height: 44px; background: transparent; }
.home-categories .category-rail-track { display: grid; grid-auto-flow: column; grid-auto-columns: clamp(185px, 17.3vw, 310px); grid-template-rows: auto; gap: 18px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scrollbar-width: none; padding: 14px 10px 18px; margin: -2px -10px 0; scroll-padding-inline: 10px; }
.category-rail-track::-webkit-scrollbar { display: none; }
.category-rail-item { min-width: 0; scroll-snap-align: start; }
.category-rail-item.reveal-visible { animation: emby-category-entry 700ms var(--reveal-delay, 0ms) cubic-bezier(.16, 1, .3, 1) both; }
@keyframes emby-category-entry { from { opacity: 0; transform: translate3d(0, 24px, 0); } to { opacity: 1; transform: none; } }
.category-tile { position: relative; display: flex; align-items: center; gap: 12px; min-height: 80px; height: 100%; padding: 17px; overflow: hidden; border-radius: 12px; border: 1px solid #ffffff0e; background: #18222d; color: #f3f6fa; transform-origin: center; transition: transform 700ms cubic-bezier(0, 1.75, .25, 1), border-color 180ms, background 180ms; }
.category-tile > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .7; }
.category-tile.has-artwork::after { position: absolute; content: ''; inset: 0; background: linear-gradient(0deg, #101014db, #10101466); }
.category-tile-copy { position: relative; z-index: 1; display: flex; flex-direction: column; min-width: 0; }
.category-tile-copy strong { font-size: clamp(16px, 1.4vw, 21px); line-height: 1.35; font-weight: 650; overflow-wrap: anywhere; }
.category-tile-copy small { color: #c1cdd5; font-size: 11px; }
.category-tile > svg { position: relative; z-index: 1; flex: none; width: 19px; height: 19px; margin-left: auto; }
.category-symbol { position: absolute; right: 18px; top: 14px; color: #8196a54d; }
.category-symbol svg { width: 45px; height: 45px; }
.category-tile:focus-visible { transform: scale(1.1); border-color: var(--accent, #8ab4ff); }
.hero.hero-empty { display: flex; align-items: center; min-height: 550px; padding: calc(var(--header-height, 100px) + 70px) var(--page-gutter, 4vw) 80px; }
.hero.hero-empty h1 { margin-bottom: 16px; }
.hero.hero-empty p { color: var(--muted, #a9b4c2); margin-bottom: 28px; }
#app > .content-band, .home-page > .content-band { max-width: 1800px; margin: 0 auto; padding: 36px var(--page-gutter, 4vw) 24px; border: 0; background: transparent; }
#app > .home-poster-band, .home-page > .home-poster-band { padding-top: 14px; }
.content-band .section-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.content-band .section-title .kicker { display: block; margin-bottom: 7px; color: var(--muted, #a9b4c2); font-size: 11px; letter-spacing: .08em; }
.content-band .section-title h2 { margin: 0; font-size: clamp(21px, 1.7vw, 27px); font-weight: 650; line-height: 1.3; letter-spacing: -.025em; }
.section-title .see-all { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 7px; min-height: 44px; color: #b5c2cb; font-size: 12px; }
.section-title .see-all svg { width: 17px; height: 17px; }
.content-band > .poster-grid:not(.search-grid), .poster-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 26px 20px; align-items: start; }
.poster-card, .video-card { min-width: 0; background: transparent; border: 0; border-radius: 0; box-shadow: none; transition: none; }
.poster-card { display: flex; flex-direction: column; }
.poster-card:hover, .video-card:hover { transform: none; border: 0; box-shadow: none; }
.poster-frame { position: relative; display: block; width: 100%; aspect-ratio: 2 / 3; border-radius: 12px; background: var(--surface, #1c1c22); overflow: hidden; }
.poster-cover-link, .video-cover-link { display: block; width: 100%; height: 100%; }
.poster-frame img { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; object-fit: contain; object-position: center; transition: transform 420ms cubic-bezier(.16, 1, .3, 1); filter: none; }
.poster-card:hover img { filter: none; transform: none; }
.poster-shade, .video-gradient { display: block; position: absolute; inset: 0; opacity: 0; background: #1010147a; pointer-events: none; transition: opacity 180ms; }
.card-play { position: absolute; z-index: 1; left: 50%; top: 50%; width: 54px; height: 54px; display: flex; justify-content: center; align-items: center; border: 1px solid #ffffff80; border-radius: 50%; background: #f3f6fa; color: #1c1c22; opacity: 0; transform: translate(-50%, calc(-50% + 8px)); transition: opacity 180ms, transform 240ms, background 180ms; }
.card-play svg { width: 24px; height: 24px; }
.card-play:hover { background: #d9e5e9; color: #1c1c22; }
.card-favorite { position: absolute; z-index: 2; bottom: 10px; right: 10px; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 1px solid #ffffff50; border-radius: 10px; background: #1c1c22cc; color: #f3f6fa; opacity: 0; transform: translateY(6px); cursor: pointer; transition: opacity 180ms, transform 240ms, background 180ms; }
.card-favorite svg { width: 20px; height: 20px; }
.card-favorite:hover { background: #283642; }
.card-favorite[aria-pressed="true"], .card-favorite.active { color: var(--accent, #8ab4ff); border-color: var(--accent, #8ab4ff); }
.card-favorite[aria-busy="true"] { cursor: progress; }
.poster-card .poster-caption { position: static; padding: 12px 0 0; min-width: 0; }
.poster-caption strong { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; color: var(--text, #f3f6fa); font-size: 14px; font-weight: 600; line-height: 1.5; }
.poster-caption small { display: none; }
.poster-info, .search-grid .poster-info { display: flex; flex-direction: column; align-items: stretch; gap: 5px; min-height: 0; padding: 5px 0 0; color: var(--muted, #a9b4c2); font-size: 11px; line-height: 1.6; }
.poster-info > span:last-child { display: flex; flex-wrap: wrap; gap: 4px; }
.poster-info .tag-chip { padding: 1px 5px; border: 1px solid #ffffff0e; background: transparent; border-radius: 4px; font-size: 10px; line-height: 1.6; color: #9babb7; }
.video-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 25px 20px; }
.video-thumb { position: relative; height: auto; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 12px; background: var(--surface, #1c1c22); }
.video-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 420ms cubic-bezier(.16, 1, .3, 1); filter: none; }
.video-card:hover .video-thumb img { transform: none; filter: none; }
.video-thumb .duration { position: absolute; z-index: 1; right: 10px; top: 10px; bottom: auto; padding: 3px 6px; border-radius: 5px; background: #101014a8; color: #f3f6fa; font-size: 10px; pointer-events: none; }
.video-copy { padding: 12px 0 0; }
.video-copy strong { color: var(--text, #f3f6fa); font-size: 14px; font-weight: 600; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; white-space: normal; overflow: hidden; }
.video-copy span { font-size: 11px; color: var(--muted, #a9b4c2); margin-top: 5px; line-height: 1.6; }
.video-copy > span { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.video-card .video-copy > span .creator-link { display: inline; color: inherit; font: inherit; text-decoration: none; text-underline-offset: 3px; }
.video-card .video-copy > span .creator-link:hover,
.video-card .video-copy > span .creator-link:active { color: var(--accent-text, var(--accent, #8ab4ff)); text-decoration: underline; }
.video-card .video-copy > span .creator-link:focus-visible { color: var(--accent-text, var(--accent, #8ab4ff)); outline: 2px solid var(--accent, #8ab4ff); outline-offset: -2px; }
.poster-frame:focus-within .poster-shade, .video-thumb:focus-within .video-gradient { opacity: 1; }
.poster-frame:focus-within img, .video-thumb:focus-within img { transform: scale(1.035); }
.poster-frame:focus-within .card-play, .video-thumb:focus-within .card-play { opacity: 1; transform: translate(-50%, -50%); }
.poster-frame:focus-within .card-favorite, .video-thumb:focus-within .card-favorite { opacity: 1; transform: none; }
.poster-card a:focus-visible, .video-card a:focus-visible, .card-favorite:focus-visible, .category-tile:focus-visible, .home-carousel button:focus-visible, .home-carousel .button:focus-visible { outline: 2px solid var(--accent, #8ab4ff); outline-offset: 3px; }
.poster-cover-link:focus-visible, .video-cover-link:focus-visible { outline-offset: -3px !important; }
.empty-state > svg { width: 32px; height: 32px; color: var(--muted, #a9b4c2); }
.empty-state .button { margin-top: 12px; }
@media (hover: hover) and (pointer: fine) {
  .category-tile:hover { transform: scale(1.1); border-color: #ffffff55; background: #23333f; }
  .poster-frame:hover .poster-shade, .video-thumb:hover .video-gradient { opacity: 1; }
  .poster-frame:hover img, .video-thumb:hover img { transform: scale(1.035); }
  .poster-frame:hover .card-play, .video-thumb:hover .card-play { opacity: 1; transform: translate(-50%, -50%); }
  .poster-frame:hover .card-favorite, .video-thumb:hover .card-favorite { opacity: 1; transform: none; }
}
@media (hover: none), (pointer: coarse) {
  .card-favorite { opacity: 1; transform: none; width: 44px; height: 44px; right: 7px; bottom: 7px; background: #1c1c22e8; }
  .card-play { opacity: 1; width: 44px; height: 44px; left: 7px; top: auto; bottom: 7px; transform: none; background: #f3f6faed; }
  .poster-frame:focus-within .card-play, .video-thumb:focus-within .card-play { transform: none; }
  .card-play svg { width: 21px; height: 21px; }
}
@media (min-width: 1700px) {
  .home-carousel .hero-content { width: min(890px, 57%); }
  .content-band > .poster-grid:not(.search-grid), .poster-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .home-carousel .hero-content { width: 69%; }
  .home-carousel .hero-work-index { display: none; }
  .content-band > .poster-grid:not(.search-grid), .poster-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .hero.home-carousel { --hero-category-height: 181px; }
  .home-carousel .hero-slide { min-height: max(680px, calc(100svh - 62px)); padding: calc(var(--header-height, 124px) + 160px) 0 0; display: flex; align-items: flex-end; }
  .home-carousel .hero-cover { inset: 0; height: 100%; }
  .home-carousel .hero-cover img { object-fit: cover; object-position: center 32%; }
  .home-carousel .hero-cover::after { background: linear-gradient(0deg, #101014 0%, #101014e6 12%, #101014a6 34%, #10101410 68%), linear-gradient(180deg, #10101480 0%, #10101400 30%); }
  .home-carousel .hero-content { position: relative; width: 100%; max-width: none; padding: 0 var(--page-gutter, 16px) 92px; }
  .home-carousel h1 { min-height: 2.48em; font-size: clamp(27px, 6.8vw, 38px); line-height: 1.24; letter-spacing: -.025em; margin: 12px 0 10px; -webkit-line-clamp: 2; }
  .home-carousel .hero-label { font-size: 10px; }
  .home-carousel .hero-sub { display: none; }
  .home-carousel .hero-meta { gap: 5px 14px; font-size: 11px; }
  .home-carousel .hero-description { min-height: 3.5em; font-size: 13px; line-height: 1.75; margin: 14px 0 13px; -webkit-line-clamp: 2; display: -webkit-box; }
  .home-carousel .hero-tags .tag-chip { font-size: 10px; }
  .home-carousel .hero-actions { margin-top: 20px; gap: 10px; }
  .home-carousel .hero-actions .button { min-height: 46px; font-size: 13px; padding: 10px 18px; }
  .home-carousel .hero-controls { left: var(--page-gutter, 16px); right: var(--page-gutter, 16px); bottom: calc(var(--hero-category-height) + 10px); gap: 8px; }
  .home-carousel .hero-position { font-size: 12px; padding-right: 4px; margin-right: auto; }
  .home-carousel .hero-pagination { display: none; }
  .home-carousel .hero-controls button { height: 44px; }
  .home-categories { margin-top: 0; padding-bottom: 10px; }
  .home-categories .category-rail-track { grid-auto-columns: 180px; gap: 16px; }
  .category-tile { min-height: 64px; padding: 15px; }
  #app > .content-band, .home-page > .content-band { padding-top: 28px; padding-bottom: 10px; }
  .content-band .section-title { margin-bottom: 17px; }
  .content-band .section-title .kicker { font-size: 10px; }
  .content-band .section-title h2 { font-size: 22px; }
  .content-band > .poster-grid:not(.search-grid), .poster-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px 13px; }
  .video-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 13px; }
  .poster-frame, .video-thumb { border-radius: 10px; }
  .poster-caption strong, .video-copy strong { font-size: 13px; }
  .poster-info .tag-chip { font-size: 9px; }
}
@media (max-width: 480px) {
  .content-band > .poster-grid:not(.search-grid), .poster-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .video-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; }
  .content-band .section-title h2 { font-size: 20px; }
  .section-title .see-all { font-size: 11px; gap: 4px; }
  .home-carousel .hero-content { padding-bottom: 92px; }
  .video-thumb .duration { right: 6px; top: 6px; font-size: 9px; }
  .poster-info { font-size: 10px; }
}
@media (max-height: 600px) and (min-width: 769px) {
  .home-carousel .hero-slide { min-height: 540px; padding-bottom: 66px; }
  .home-carousel .hero-content { padding-top: 35px; }
  .home-carousel h1 { font-size: 34px; }
  .home-carousel .hero-description { margin-top: 14px; }
}
/* Fixed viewport-derived stage: artwork and copy never set its dimensions. */
.hero.home-carousel { --hero-category-height:132px; height:max(640px,100svh); min-height:0; margin:0; }
.home-carousel .hero-slides { position:absolute; inset:0; height:100%; }
.home-carousel .hero-slide { height:100%; min-height:0; padding:0; }
.home-carousel .hero-cover { inset:0; height:100%; }
.home-carousel .hero-cover img { object-fit:cover; object-position:center 35%; }
.home-carousel .hero-cover::after { background:linear-gradient(90deg,#101014ed 0%,#101014b8 25%,#10101433 58%,transparent 82%),linear-gradient(0deg,#101014d9,transparent 52%); }
.home-carousel .hero-content { position:absolute; left:var(--page-gutter,4vw); bottom:calc(var(--hero-category-height) + 66px); width:min(850px,60%); max-height:calc(100% - var(--hero-category-height) - 90px); overflow-y:auto; overflow-x:hidden; scrollbar-width:thin; scrollbar-color:#ffffff60 transparent; padding:5px 3px; scroll-padding-block:4px; }
.home-carousel h1 { min-height:2.34em; }
.home-carousel .hero-description { min-height:3.6em; }
.home-carousel .hero-tags { flex-wrap:nowrap; overflow:hidden; max-height:32px; }
.home-carousel .hero-tags .tag-chip { flex-shrink:0; max-width:180px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.home-carousel .hero-meta { flex-wrap:nowrap; overflow:hidden; }
.home-carousel .hero-meta > span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.home-carousel .hero-work-index { display:none; }
.home-carousel .hero-pagination { display:flex; gap:0; }
.home-carousel .hero-controls { left:auto; right:var(--page-gutter,4vw); bottom:calc(var(--hero-category-height) + 12px); padding:0; gap:2px; }
.home-carousel .hero-position { position:absolute; width:1px; height:1px; margin:-1px; padding:0; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.home-carousel .hero-progress { display:none; }
.home-carousel > .home-categories { position:absolute; left:0; right:0; bottom:16px; margin:0; min-height:0; padding:0 var(--page-gutter,4vw); }
.home-categories .category-rail-heading { display:none; }
.home-categories .category-rail-track { padding-block:12px; }
.home-categories .category-tile { min-height:80px; background:#1c1c22d9; border-color:#ffffff24; }
.home-categories .category-tile-copy strong { color:#f3f6fa; }
.home-categories .category-tile-copy small { color:#d4dce5; }
.hero.hero-empty { padding:80px var(--page-gutter); }
@media(max-width:1100px) and (min-width:769px) {
  .home-carousel .hero-content { width:72%; }
  .home-carousel h1 { font-size:clamp(30px,3.8vw,44px); }
}
@media(max-width:768px) {
  .hero.home-carousel { --hero-category-height:76px; height:max(600px,calc(100svh - 62px)); }
  .home-carousel .hero-slide { padding:0; min-height:0; }
  .home-carousel .hero-cover { inset:0; height:100%; }
  .home-carousel .hero-cover img { object-position:center 32%; }
  .home-carousel .hero-cover::after { background:linear-gradient(0deg,#101014ef 0%,#101014cf 24%,#10101460 50%,#10101400 80%); }
  .home-carousel .hero-content { left:var(--page-gutter,16px); width:calc(100% - 2 * var(--page-gutter,16px)); bottom:calc(var(--hero-category-height) + 38px); max-height:calc(47% - var(--hero-category-height) - 38px); padding:6px 0; }
  .home-carousel h1 { min-height:2.5em; font-size:clamp(22px,5.8vw,26px); line-height:1.25; max-width:none; margin:0 0 6px; letter-spacing:-.025em; }
  .home-carousel :is(.hero-label,.hero-sub,.hero-meta,.hero-description,.hero-tags) { display:none; }
  .home-carousel .hero-meta { font-size:11px; line-height:1.5; gap:10px; }
  .home-carousel .hero-description { min-height:3.5em; margin-block:12px; }
  .home-carousel .hero-actions { margin-top:8px; }
  .home-carousel .hero-controls { left:auto; right:var(--page-gutter,16px); bottom:var(--hero-category-height); gap:2px; }
  .home-carousel .hero-position { margin:0; }
  .home-carousel > .home-categories { bottom:4px; }
  .home-categories .category-rail-track { padding-block:4px; }
  .home-categories .category-rail-track { grid-auto-columns:140px; gap:12px; }
  .home-categories .category-tile { min-height:64px; padding:9px 12px; }
  .home-categories .category-tile-copy strong { font-size:15px; }
}
@media(max-width:768px) and (max-height:640px) {
  .hero.home-carousel { height:calc(100svh - 62px); min-height:500px; }
  .home-carousel .hero-content { bottom:calc(var(--hero-category-height) + 32px); }
}
@media(max-height:600px) and (min-width:769px) {
  .hero.home-carousel { height:600px; }
  .home-carousel .hero-content { bottom:calc(var(--hero-category-height) + 50px); }
  .home-carousel h1 { font-size:32px; margin-block:10px; }
  .home-carousel .hero-description { margin-block:12px; }
  .home-carousel .hero-actions { margin-top:8px; }
}
/* Compact visible marks; transparent hit extensions retain forgiving touch targets. */
.home-carousel .hero-controls { background:transparent; border-radius:0; }
.home-carousel .hero-pagination { display:flex; gap:0; }
.home-carousel .hero-pagination button { position:relative; width:28px; min-width:28px; height:44px; margin-top:-12px; padding:12px 0 0; border:0; border-radius:0; background:transparent; box-shadow:none; }
.home-carousel .hero-pagination button::after { content:""; position:absolute; inset:0; pointer-events:none; }
.home-carousel .hero-pagination button:hover,.home-carousel .hero-pagination button:active { background:transparent; transform:none; }
.home-carousel [data-hero-index]::before { width:7px; height:7px; border-radius:50%; background:#ffffff55; }
.home-carousel [data-hero-index][aria-current="true"]::before { width:7px; background:#ffffffdf; transform:none; }
.home-carousel .hero-pagination button:disabled { opacity:1; }
.home-carousel .hero-actions .button { position:relative; min-height:38px; height:38px; padding:0 14px; gap:6px; font-size:13px; line-height:1.4; border-radius:7px; }
.home-carousel .hero-actions .button::after { content:""; position:absolute; inset:-4px 0; }
.home-carousel .hero-actions svg { width:16px; height:16px; }
@media(max-width:768px) {
  .home-carousel .hero-actions .button { min-height:34px; height:34px; padding:0 12px; font-size:12px; }
  .home-carousel .hero-actions .button::after { inset:-6px 0; }
  .home-carousel .hero-controls { bottom:var(--hero-category-height); }
  .home-carousel .hero-position { position:absolute; margin:-1px; }
  .poster-frame .card-play,.video-thumb .card-play,.poster-frame .card-favorite,.video-thumb .card-favorite { width:44px; height:44px; border:0; background:transparent; box-shadow:none; isolation:isolate; }
  .poster-frame .card-play,.video-thumb .card-play { left:1px; bottom:1px; top:auto; transform:none; }
  .poster-frame:focus-within .card-play,.video-thumb:focus-within .card-play { transform:none; }
  .poster-frame .card-favorite,.video-thumb .card-favorite { right:1px; bottom:1px; }
  .poster-frame .card-play::before,.video-thumb .card-play::before,.poster-frame .card-favorite::before,.video-thumb .card-favorite::before { content:""; position:absolute; inset:7px; border-radius:50%; z-index:-1; background:#f3f6fae6; }
  .poster-frame .card-favorite::before,.video-thumb .card-favorite::before { background:#1c1c22c7; }
  .poster-frame .card-play svg,.video-thumb .card-play svg,.poster-frame .card-favorite svg,.video-thumb .card-favorite svg { width:16px; height:16px; }
}

@media (prefers-reduced-motion: reduce) {
  .home-carousel .hero-content > *, .home-carousel .is-current .hero-content > *, .category-rail-item.reveal-visible, .category-tile, .poster-frame img, .video-thumb img, .card-play, .card-favorite, .poster-shade, .video-gradient, .home-carousel .hero-controls button { animation: none !important; transition: none !important; }
  .category-tile:hover, .category-tile:focus-visible, .poster-frame:hover img, .poster-frame:focus-within img, .video-thumb:hover img, .video-thumb:focus-within img { transform: none !important; }
  .category-rail-track { scroll-behavior: auto !important; }
}

/* Portrait shelves keep their six-cover desktop rhythm. */
.home-shelf.home-shelf-portrait .poster-frame img {
  object-fit: cover;
  object-position: center;
}
.home-shelf {
  padding-top: 24px !important;
  padding-bottom: 14px !important;
}
.home-shelf + .home-shelf { padding-top: 12px !important; }
.home-shelf .section-title { margin-bottom: 14px; }
@media (max-width: 768px) {
  .home-shelf { padding-top: 20px !important; padding-bottom: 9px !important; }
  .home-shelf + .home-shelf { padding-top: 9px !important; }
  .home-shelf .section-title { margin-bottom: 11px; }
}

/* Each shelf owns its columns so older poster/video grid rules cannot
   override the geometry selected for its artwork. */
.home-shelf { --home-shelf-columns: 5; }
.home-shelf-portrait { --home-shelf-columns: 6; }
.home-shelf .home-shelf-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; }
.home-shelf .home-shelf-row { display: grid; grid-template-columns: repeat(var(--home-shelf-columns), minmax(0, 1fr)); gap: 24px 16px; align-items: start; min-width: 0; }
.home-shelf-inner { max-width: 1800px; margin: 0 auto; }
.home-shelf .section-title { align-items: center; }
.home-shelf .section-title > div { min-width: 0; }
.home-shelf .section-title h2 { overflow-wrap: anywhere; }
.home-shelf .section-actions { display: inline-flex; align-items: center; gap: 15px; flex: 0 0 auto; }
.home-shelf .shelf-refresh { display: inline-flex; align-items: center; gap: 5px; min-height: 44px; padding: 0 4px; border: 0; background: transparent; color: var(--muted, #a9b4c2); font-size: 12px; cursor: pointer; }
.home-shelf .shelf-refresh svg { width: 15px; height: 15px; }
.home-shelf .shelf-refresh:hover, .home-shelf .shelf-refresh:focus-visible { color: var(--text, #f3f6fa); }
.home-shelf .shelf-refresh.is-refreshing svg { animation: shelf-spin 350ms ease both; }
@keyframes shelf-spin { to { transform: rotate(180deg); } }
.home-shelf .video-card, .home-shelf .poster-card { min-width: 0; }
.home-shelf .video-thumb, .home-shelf .poster-frame { border: 1px solid transparent; transition: border-color 180ms, box-shadow 180ms; }
.home-shelf .video-card:hover .video-thumb, .home-shelf .poster-card:hover .poster-frame,
.home-shelf .video-card:focus-within .video-thumb, .home-shelf .poster-card:focus-within .poster-frame { border-color: color-mix(in srgb, var(--accent, #8ab4ff) 60%, transparent); box-shadow: 0 12px 30px #0000002b; }
.home-shelf .video-card:hover .video-thumb img, .home-shelf .video-card:focus-within .video-thumb img,
.home-shelf .poster-card:hover .poster-frame img, .home-shelf .poster-card:focus-within .poster-frame img { transform: scale(1.045); }
.home-shelf .video-copy strong, .home-shelf .poster-caption strong { white-space: nowrap; text-overflow: ellipsis; }

@media (max-width: 1023px) and (min-width: 769px) {
  .home-shelf { --home-shelf-columns: 4; }
}
@media (max-width: 768px) {
  .home-shelf { --home-shelf-columns: 2; }
  .home-shelf .section-actions { gap: 8px; }
  .home-shelf .shelf-refresh span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .home-shelf .shelf-refresh { min-width: 44px; justify-content: center; }
  .home-shelf .home-shelf-grid { grid-template-columns: repeat(var(--home-shelf-columns), minmax(0, 1fr)); gap: 20px 12px; }
  .home-shelf .home-shelf-grid > .home-shelf-row { display: contents; }
  .home-shelf .video-copy strong, .home-shelf .poster-caption strong { white-space: normal; }
}

/* The card preset keeps its popular works and categories in normal flow. */
.home-page { min-width: 0; }
.home-popular-band { padding: 26px var(--page-gutter, 4vw) 14px; }
.home-popular-inner { position: relative; max-width: 1800px; margin-inline: auto; }
.home-popular-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px 18px; align-items: start; }
.home-popular-controls { display: none; }
.home-popular-grid .video-thumb { aspect-ratio: 16 / 9; }
.home-popular-grid :is(.video-thumb,.poster-frame) img { object-fit: cover; }
.home-popular-grid :is(.video-copy,.poster-caption) { padding-top: 12px; }
.home-popular-grid :is(.video-copy,.poster-caption) strong { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; min-height: 3em; font-size: clamp(14px,1.2vw,18px); line-height: 1.5; white-space: normal; overflow-wrap: anywhere; }
.home-popular-grid :is(.video-card,.poster-card):focus-within :is(.video-thumb,.poster-frame) { outline: 1px solid var(--accent); outline-offset: -1px; }
.home-categories.home-category-band { position: relative; inset: auto; max-width: 1800px; min-height: 0; margin: 0 auto; padding: 0 var(--page-gutter,4vw) 4px; }
.home-category-band .category-rail-track { margin-top: 0; }
@media (max-width: 1023px) {
  .home-popular-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .home-popular-band { padding-top: 18px; padding-bottom: 10px; }
  .home-popular-grid { display: flex; gap: 12px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; touch-action: auto; }
  .home-popular-grid::-webkit-scrollbar { display: none; }
  .home-popular-grid > :is(.video-card,.poster-card) { flex: 0 0 100%; min-width: 0; scroll-snap-align: start; }
  .home-popular-grid > [data-reveal] { opacity: 1; transform: none; animation: none; }
  .home-popular-controls { display: block; position: absolute; z-index: 4; top: 0; left: 0; width: 100%; aspect-ratio: 16 / 9; pointer-events: none; }
  .home-popular-dots { position: absolute; right: 8px; bottom: 8px; display: flex; border-radius: 999px; background: transparent; pointer-events: auto; }
  .home-popular-dots::before { content: ''; position: absolute; inset: 7px 0; border-radius: inherit; background: #1010148c; pointer-events: none; }
  .home-popular-dot { position: relative; display: grid; place-items: center; flex: none; width: 32px; height: 32px; margin: 0; padding: 0; border: 0; border-radius: 50%; color: #f3f6fa; background: transparent; cursor: pointer; transition: background-color 160ms ease, transform 120ms ease; }
  .home-popular-dot + .home-popular-dot { margin-inline-start: -8px; }
  .home-popular-dot::before { content: ''; width: 5px; height: 5px; border-radius: 999px; background: #ffffffb3; transition: width 160ms ease, background-color 160ms ease; }
  .home-popular-dot[aria-current="true"]::before { width: 12px; background: #f3f6fa; }
  .home-popular-dot:hover { background: #ffffff1f; }
  .home-popular-dot:active { transform: scale(.92); background: #ffffff2e; }
  .home-popular-dot:focus-visible { outline: 2px solid #f3f6fa; outline-offset: -3px; }
  .home-popular-dot:disabled { opacity: .4; cursor: not-allowed; }
  .home-popular-grid :is(.video-copy,.poster-caption) { padding-top: 9px; }
  .home-popular-grid :is(.video-copy,.poster-caption) strong { font-size: 16px; line-height: 1.45; }
  .home-categories.home-category-band { padding-bottom: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .home-popular-grid { scroll-behavior: auto; }
  .home-popular-dot,
  .home-popular-dot::before { transition: none; }
  .home-popular-dot:active { transform: none; }
}

/* Mobile editorial copy stays below the artwork focal point while preserving
   the fixed viewport stage and compact five-dot controls. */
@media(max-width:768px) {
  .home-carousel .hero-content {
    bottom:calc(var(--hero-category-height) + 42px);
    max-height:none;
    overflow:visible;
    padding:0;
    scrollbar-width:none;
  }
  .home-carousel .hero-content::-webkit-scrollbar { display:none; }
  .home-carousel h1 {
    min-height:0;
    margin:0 0 7px;
    font-size:clamp(22px,5.7vw,26px);
    line-height:1.2;
  }
  .home-carousel :is(.hero-label,.hero-sub,.hero-tags) { display:none; }
  .home-carousel .hero-meta {
    display:flex;
    align-items:center;
    flex-wrap:nowrap;
    gap:6px;
    min-width:0;
    font-size:11px;
    line-height:1.5;
    color:#d4dce4;
  }
  .home-carousel .hero-meta > span { display:flex; align-items:center; min-width:0; flex:0 0 auto; }
  .home-carousel .hero-meta > span:nth-child(2) { flex:0 1 auto; }
  .home-carousel .hero-meta > span:nth-child(2) a { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .home-carousel .hero-meta > span + span::before { content:"·"; flex:0 0 auto; margin-right:6px; color:#ffffff80; }
  .home-carousel .hero-description {
    display:-webkit-box;
    min-height:0;
    max-width:44ch;
    margin:8px 0 9px;
    color:#d8dee5;
    font-size:12px;
    line-height:1.55;
    -webkit-box-orient:vertical;
    -webkit-line-clamp:2;
    overflow:hidden;
  }
  .home-carousel .hero-actions { margin-top:0; }
}
@media(max-width:360px), (max-width:768px) and (max-height:640px) {
  .home-carousel .hero-content { bottom:calc(var(--hero-category-height) + 36px); }
  .home-carousel h1 { font-size:22px; }
  .home-carousel .hero-meta { font-size:10px; gap:4px; }
  .home-carousel .hero-meta > span + span::before { margin-right:4px; }
  .home-carousel .hero-description { margin-block:6px 8px; font-size:11px; line-height:1.45; }
}

/* Shelf refresh updates its existing row; the status does not move cards. */
.home-shelf-inner { position: relative; }
.home-refresh-status { min-height: 18px; margin: -5px 0 10px; color: var(--muted); font-size: 12px; line-height: 18px; }
.home-shelf .shelf-refresh:disabled { cursor: progress; opacity: .6; }
.home-shelf .shelf-refresh:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.home-shelf .shelf-refresh:not(:disabled):active { transform: translateY(1px); }

/* The route-owned waiting view contains no account or cached work content. */
#app.is-home-waiting { display: none !important; }
.home-route-wait { padding: 24px var(--page-gutter, 4vw) 48px; background: var(--bg); }
.home-wait-status { margin: 0 0 20px; color: var(--muted); font-size: 14px; }
.home-wait-hero { min-height: clamp(320px, 54svh, 680px); display: flex; flex-direction: column; justify-content: flex-end; gap: 16px; padding: clamp(24px, 5vw, 64px); border-radius: 12px; background: var(--surface); }
.home-wait-hero span, .home-wait-heading, .home-wait-card span, .home-wait-card i { display: block; background: var(--surface-2); border-radius: 5px; }
.home-wait-hero span { width: min(400px, 70%); height: 18px; }
.home-wait-hero span:first-child { width: min(500px, 90%); height: 38px; }
.home-wait-hero span:last-child { width: 120px; height: 38px; margin-top: 12px; }
.home-wait-shelf { margin-top: 32px; }
.home-wait-heading { width: 120px; height: 24px; margin-bottom: 20px; }
.home-wait-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 20px; }
.home-wait-card span { aspect-ratio: 16 / 9; border-radius: 12px; }
.home-wait-card i { width: 88%; height: 12px; margin-top: 12px; }
.home-wait-card i:last-child { width: 55%; }
.home-unavailable { min-height: 55svh; max-width: 640px; margin: auto; padding: 72px 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.home-status-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: var(--surface); color: var(--muted); }
.home-status-icon svg { width: 26px; height: 26px; }
.home-unavailable h1 { margin: 24px 0 10px; font-size: clamp(22px, 3vw, 30px); }
.home-unavailable p { margin: 0; color: var(--muted); line-height: 1.7; }
.home-status-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 26px; }
.home-status-actions .button { min-height: 44px; transition: background-color .18s ease, transform .18s ease; }
.home-status-actions .button:active { transform: translateY(1px); }
.home-status-actions .button:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
@media (max-width: 768px) {
  .home-wait-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .home-wait-card:nth-child(n+3) { display: none; }
  .home-wait-hero { min-height: 340px; }
}
@media (prefers-reduced-motion: reduce) {
  .home-shelf .shelf-refresh.is-refreshing svg { animation: none; }
  .home-status-actions .button { transition: none; }
}
