.video-library-page { background: #fffafb; position: relative; isolation: isolate; }
.home-video-band { padding-block: 48px 56px; background: #f2f8f6; }
.home-video-band .section-heading { margin-bottom: 24px; align-items: center; }
.home-video-band .section-heading h2 { margin: 0; font-size: 26px; letter-spacing: 0; }
.home-video-band .library-video { background: transparent; border-color: #d4e3dd; }
.home-video-band [data-home-video-status][hidden] { display: none; }
@media (max-width: 560px) {
  .home-video-band { padding-block: 32px 40px; }
  .home-video-band .section-heading { gap: 16px; flex-wrap: wrap; }
  .home-video-band .section-heading h2 { font-size: 22px; }
}
.video-library-page::before { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: url('/todofuken/landmarks-frame.png') center top / 1440px auto no-repeat; opacity: .3; }
.video-library { padding-block: 32px 80px; min-height: 75vh; }
.video-library-heading { display: flex; align-items: center; gap: 20px; padding-bottom: 28px; }
.video-library-heading img { width: 88px; height: 88px; object-fit: contain; }
.video-library-heading h1 { font-size: 30px; margin: 0; letter-spacing: 0; }
.video-channel { margin-left: auto; color: #973c56; border-bottom: 1px solid currentColor; font-size: 14px; }
.video-controls { position: relative; isolation: isolate; padding-block: 28px; }
.video-controls::before { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: #fff3f7; box-shadow: 0 0 0 100vmax #fff3f7; clip-path: inset(0 -100vmax); }
.video-type { display: flex; gap: 6px; border: 0; padding: 0; margin: 0 0 20px; }
.video-type label { position: relative; cursor: pointer; }
.video-type input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.video-type span { display: block; padding: 12px 20px; border-radius: 6px; background: #f3edf0; font-size: 14px; font-weight: 700; }
.video-type input:checked + span { background: #8e4f66; color: white; }
.video-type input:focus-visible + span { outline: 3px solid #397a78; outline-offset: 3px; }
.video-controls-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.video-library button, #cast-dialog button, .video-sort select { min-height: 44px; border: 1px solid #d8c9ce; border-radius: 6px; background: white; padding: 10px 16px; color: #604039; font: inherit; font-size: 14px; cursor: pointer; }
.video-library button:disabled { opacity: .45; cursor: default; }
.video-library button:hover:not(:disabled), #cast-dialog button:hover { background: #f8edf2; }
.video-sort { display: flex; align-items: center; gap: 10px; margin-left: auto; font-size: 13px; }
.selected-cast { display: flex; gap: 8px; flex-wrap: wrap; }
.selected-cast:not(:empty) { padding-top: 16px; }
.video-library .selected-person { background: #eaf4f1; border-color: #bad4cc; }
.video-results-heading { display: flex; justify-content: flex-end; padding: 22px 0; }
.video-results-heading h2 { display: none; }
.video-results-heading p { margin: 0; font-size: 14px; font-variant-numeric: tabular-nums; }
.video-library-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 30px 24px; }
.library-video { min-width: 0; background: #fff; border-bottom: 1px solid #e7dade; padding-bottom: 18px; }
.library-video-link { display: block; color: inherit; text-decoration: none; }
.library-video-media { aspect-ratio: 16 / 9; overflow: hidden; position: relative; border-radius: 6px; background: #eae3e6; }
.library-video-media img { width: 100%; height: 100%; object-fit: cover; }
.library-video-play { position: absolute; right: 12px; bottom: 12px; display: grid; place-items: center; width: 40px; height: 32px; border-radius: 6px; color: white; background: #b83f58; font-size: 15px; }
.library-video-info { display: flex; justify-content: space-between; gap: 8px; margin-top: 14px; font-size: 11px; color: #806d72; flex-wrap: wrap; }
.library-video-type { font-weight: 700; color: #8e4f66; }
.library-video h3 { font-size: 16px; line-height: 1.7; margin: 8px 0 12px; overflow-wrap: anywhere; letter-spacing: 0; }
.library-video-link:hover h3 { color: #a84062; text-decoration: underline; }
.library-video-cast { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.library-video-cast a { font-size: 12px; color: #38786c; text-decoration: underline; text-underline-offset: 3px; }
.video-library-empty { text-align: center; padding: 64px 16px; background: #ffffffb8; }
#cast-dialog { width: min(760px,calc(100% - 32px)); max-height: min(82dvh,760px); padding: 24px; border: 1px solid #e3d5dc; border-radius: 8px; color: #604039; box-sizing: border-box; }
#cast-dialog[open] { display: flex; flex-direction: column; gap: 16px; }
#cast-dialog::backdrop { background: #31252c80; }
body:has(#cast-dialog[open]) { overflow: hidden; }
.cast-dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.cast-dialog-heading h2 { font-size: 20px; margin: 0; letter-spacing: 0; }
#cast-dialog #close-cast { font-size: 24px; padding: 0; width: 44px; flex-shrink: 0; }
.cast-match-label { margin: 0; font-size: 13px; color: #836a76; }
#cast-search { width: 100%; min-height: 44px; padding: 10px 12px; box-sizing: border-box; border: 1px solid #d8c9ce; border-radius: 5px; font: inherit; font-size: 14px; }
.cast-dialog-scroll { overflow-y: auto; min-height: 0; overscroll-behavior: contain; }
.cast-options { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.cast-option { display: flex; align-items: center; gap: 8px; min-height: 58px; padding: 8px; border: 1px solid #e8dee3; border-radius: 6px; cursor: pointer; font-size: 12px; overflow-wrap: anywhere; }
.cast-option:has(input:checked) { background: #eaf4f1; border-color: #6da296; }
.cast-option input { accent-color: #397a6a; flex: 0 0 16px; }
.cast-portrait { flex: 0 0 38px; width: 38px; height: 42px; overflow: hidden; position: relative; }
.cast-portrait img { position: absolute; width: 200%; max-width: none; height: auto; left: -2%; top: -2%; }
.cast-dialog-footer { display: flex; justify-content: space-between; gap: 12px; padding-top: 12px; border-top: 1px solid #e8dee3; }
#cast-dialog #done-cast { background: #8e4f66; color: white; border-color: #8e4f66; }
.video-library-page [hidden] { display: none !important; }
.video-library-page :focus-visible { outline: 3px solid #397a78; outline-offset: 3px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media(max-width: 850px) { .video-library-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } .cast-options { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media(max-width: 560px) {
  .video-library { padding-top: 20px; }
  .video-library-heading { flex-wrap: wrap; gap: 12px; }
  .video-library-heading h1 { font-size: 26px; }
  .video-library-heading img { width: 64px; height: 64px; }
  .video-channel { margin-left: 0; width: 100%; border: 0; text-decoration: underline; }
  .video-type { gap: 4px; }
  .video-type label { flex: 1; min-width: 0; }
  .video-type span { padding: 10px 6px; font-size: 12px; text-align: center; height: 100%; box-sizing: border-box; display: grid; place-items: center; }
  .video-sort { margin-left: 0; width: 100%; justify-content: space-between; }
  .video-library-grid { grid-template-columns: minmax(0,1fr); }
  #cast-dialog { padding: 16px; width: 100%; max-width: none; max-height: 88dvh; margin: auto 0 0; border-radius: 8px 8px 0 0; }
  .cast-option { gap: 5px; padding: 6px; font-size: 11px; }
  .cast-portrait { flex-basis: 30px; width: 30px; height: 36px; }
}
