.catalog-kinds { display: flex; flex-wrap: wrap; gap: 22px; margin: 0 0 24px; }
.library-shell .catalog-kinds button, .library-shell .season-tabs button { padding: 7px 0; border: 0; border-bottom: 2px solid transparent; border-radius: 0; min-height: 39px; background: transparent; color: #a6b5c6; font-weight: 500; }
.library-shell .catalog-kinds button[aria-pressed="true"], .library-shell .season-tabs button[aria-pressed="true"] { color: #edf1f5; border-bottom-color: #87b7d8; }
.libraries-list { list-style: none; padding: 0; margin: 26px 0 38px; }
.libraries-list > li { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 23px 0; border-bottom: 1px solid #34475b; }
.libraries-list > li > div:first-child { min-width: 0; }
.libraries-list h2 { margin: 0 0 9px; font-size: 20px; font-weight: 500; overflow-wrap: anywhere; }
.libraries-list p { font-size: 13px; margin: 4px 0; }
.library-root { overflow-wrap: anywhere; white-space: pre-line; }
.libraries-list .movie-form-actions { flex-shrink: 0; align-items: center; gap: 18px; }
.libraries-form { max-width: 680px; }
.libraries-form fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.libraries-form legend { margin-bottom: 24px; font: 400 26px/1.3 Georgia, serif; }
.libraries-form label { display: block; }
.library-form-columns { display: grid; grid-template-columns: minmax(0, 1fr) 170px; gap: 20px; }
.libraries-form select { margin-bottom: 23px; height: 50px; }
.libraries-form textarea { width: 100%; min-height: 120px; resize: vertical; border: 1px solid #53657a; border-radius: 6px; padding: 12px 14px; background: #1c2c3f; color: #edf1f5; font: inherit; line-height: 1.7; margin-bottom: 0; }
.libraries-form textarea:focus-visible { outline: 2px solid #87b7d8; outline-offset: 3px; }
#libraries-status:empty { display: none; }
#libraries-status.is-error { color: #f1b4a8; }
.library-remove-dialog { width: min(480px, calc(100% - 36px)); border: 1px solid #53657a; border-radius: 10px; background: #14202e; color: #edf1f5; padding: 30px; }
.library-remove-dialog::backdrop { background: #060c14cc; }
.library-remove-dialog h2 { font: 400 28px/1.3 Georgia, serif; margin-top: 0; }
.library-remove-dialog p { line-height: 1.7; overflow-wrap: anywhere; }
.library-remove-dialog button { width: auto; padding: 0 16px; }
.series-heading { display: flex; align-items: flex-start; gap: 26px; margin: 26px 0; }
.series-heading img { width: 128px; height: 192px; object-fit: contain; border-radius: 5px; background: #192838; }
.series-heading > div { min-width: 0; }
.series-heading h2 { font: 400 clamp(28px, 4vw, 38px)/1.2 Georgia, serif; margin: 0 0 17px; overflow-wrap: anywhere; }
.series-heading p { max-width: 70ch; margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.season-tabs { display: flex; flex-wrap: wrap; gap: 12px 24px; margin-bottom: 25px; border-bottom: 1px solid #34475b; }
.episode-list { list-style: none; margin: 0; padding: 0; }
.episode-list > li { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; align-items: center; gap: 20px; padding: 20px 0; border-bottom: 1px solid #34475b; }
.episode-thumbnail { width: 150px; height: 84px; object-fit: cover; border-radius: 5px; background: #192838; display: grid; place-items: center; color: #a6b5c6; font: 26px Georgia, serif; }
.episode-thumbnail img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.episode-list h3 { margin: 0 0 9px; font-size: 16px; font-weight: 500; overflow-wrap: anywhere; }
.episode-list p { margin: 0; font-size: 13px; line-height: 1.65; color: #a6b5c6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.episode-actions { display: flex; align-items: center; gap: 14px; }
@media (max-width: 650px) {
  .library-nav { flex-wrap: wrap; gap: 12px 24px; }
  .libraries-list > li { align-items: flex-start; flex-direction: column; gap: 12px; }
  .library-form-columns { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .episode-list > li { grid-template-columns: 96px minmax(0, 1fr); gap: 13px; }
  .episode-thumbnail { width: 96px; height: 54px; }
  .episode-actions { grid-column: 2; }
  .series-heading img { width: 82px; height: 123px; }
  .series-heading { gap: 17px; }
}
.watch-state { display: grid; gap: 5px; align-content: start; min-height: 29px; margin-top: 8px; }
.video-list .watch-state { grid-area: watch; margin-top: 2px; height: 29px; min-width: 0; }
.video-list .watch-badge { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.watch-badge { font-size: 12px; line-height: 19px; color: #a6b5c6; }
.watch-badge.is-watched { color: #b9d8ef; }
.watch-badge.is-started { color: #edf1f5; }
.watch-progress { display: block; width: 100%; max-width: 320px; height: 3px; border: 0; border-radius: 2px; overflow: hidden; appearance: none; background: #34475b; color: #87b7d8; }
.watch-progress::-webkit-progress-bar { background: #34475b; }
.watch-progress::-webkit-progress-value { background: #87b7d8; transition: width .18s ease; }
.watch-progress::-moz-progress-bar { background: #87b7d8; }
.library-shell .watch-options, .movie-dialog .watch-options { width: 32px; min-height: 32px; padding: 0; margin: 0; border: 1px solid transparent; background: transparent; color: #b9cbde; font-size: 22px; line-height: 1; }
.library-shell .watch-options:hover, .movie-dialog .watch-options:hover { background: #1c2c3f; border-color: #53657a; }
.watch-menu { position: fixed; z-index: 40; min-width: 230px; padding: 6px; background: #1b2a3a; border: 1px solid #53657a; border-radius: 7px; box-shadow: 0 10px 40px #0005; }
#watch-menu button:hover { background: #30465b; }
#watch-menu button:disabled { color: #8295a8; cursor: default; }
.watch-feedback { position: fixed; z-index: 50; right: 22px; bottom: 20px; max-width: min(420px, calc(100vw - 44px)); margin: 0; padding: 12px 16px; border: 1px solid #53657a; border-radius: 7px; background: #1b2a3a; color: #edf1f5; font-size: 13px; line-height: 1.6; box-shadow: 0 6px 30px #0004; }
.watch-feedback.is-error { color: #f1b4a8; }
#series-watch { margin-top: 15px; }
#movie-watch { margin: 0 0 18px; }
.episode-list .watch-state { -webkit-line-clamp: unset; }
.episode-thumbnail { position: relative; }
.episode-thumbnail img { position: absolute; inset: 0; }

.catalog-custom-categories { display: contents; }
.library-shell .library-search { grid-template-columns: minmax(180px, 1fr) auto; gap: 16px; align-items: end; }
.library-shell .catalog-filter-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.catalog-filter-panel { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; padding: 20px; background: #192838; border: 1px solid #34475b; border-radius: 7px; }
.catalog-sort-panel { grid-column: 1 / -1; max-width: 360px; width: 100%; }
.library-shell [aria-expanded="true"].secondary { border-color: #87b7d8; color: #c2e0f3; }
#watch-menu button { display: block; width: 100%; min-height: 39px; padding: 9px 12px; margin: 0; border: 0; border-radius: 4px; background: transparent; color: #edf1f5; font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
#watch-menu button:focus-visible { outline: 2px solid #87b7d8; outline-offset: -2px; background: #30465b; }
#movie-dialog button.watch-options { min-height: 32px; width: 32px; padding: 0; align-self: center; }
@media (max-width: 740px) {
  .library-shell .library-search { grid-template-columns: minmax(0, 1fr); }
  .catalog-filter-panel { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 16px; }
  .libraries-list .movie-form-actions { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { .watch-progress::-webkit-progress-value { transition: none; } }
