.mast-nav { min-height: 64px; }
.search { display: flex; margin-left: auto; width: min(340px, 40%); align-items: center; overflow: hidden; background: #1c1c23; border: 1px solid var(--line); border-radius: 8px; }
.search input { min-width: 0; flex: 1; border: 0; background: transparent; color: inherit; padding: 9px 12px; }
.search input:focus-visible { outline-offset: -2px; }
.search button, .nav-action { background: transparent; border: 0; padding: 9px 12px; color: #f6f3f7; }
.catalog-shell { padding-block: 13px 60px; }
.channel-nav { display: flex; gap: 23px; align-items: center; min-height: 43px; margin-bottom: 17px; border-bottom: 1px solid var(--line); font-size: .94rem; }
.channel-nav a { position: relative; padding-block: 12px; color: var(--muted); }
.channel-nav [aria-current] { color: #fff; font-weight: 700; }
.channel-nav [aria-current]::after { content: ""; position: absolute; inset: auto 0 -1px; height: 2px; border-radius: 2px; background: #ff777e; }
.catalog-layout { display: grid; grid-template-columns: 218px minmax(0, 1fr); gap: 25px; }
.filters-panel { background: #18181e; border: 1px solid var(--line); border-radius: 12px; padding: 15px; align-self: start; }
.filters-panel summary { font-size: 1rem; cursor: pointer; font-weight: 750; }
#genre-filter { display: grid; gap: 3px; margin-top: 9px; }
#genre-filter a { border-radius: 7px; padding: 9px; color: #e7e3eb; font-size: .91rem; }
#genre-filter a:hover { background: #262631; }
#genre-filter [aria-current] { background: #38252d; color: #ffb5bc; font-weight: 750; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 1px 0 16px; }
.section-title h1 { font-size: clamp(1.25rem, 2.4vw, 1.75rem); margin: 0; letter-spacing: -.025em; }
#result-label { color: var(--muted); font-size: .88rem; margin: -6px 0 14px; }
#bio, #notice, .work-meta { color: var(--muted); }
#notice:empty { display: none; }
.works { display: grid; grid-template-columns: repeat(auto-fill,minmax(min(100%, 148px), 1fr)); gap: 18px 13px; }
.work { min-width: 0; }
.work-art { position: relative; display: block; aspect-ratio: 3 / 4; overflow: hidden; border-radius: 9px; background-color: #23232d; border: 1px solid #33333e; }
.work-art img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .22s ease; }
.work-art:hover img { transform: scale(1.05); }
.work-art::after { content: ""; position: absolute; inset: 45% 0 0; background: linear-gradient(transparent,#101014b9); pointer-events: none; }
.work-genre, .work-count { position: absolute; z-index: 1; padding: 3px 6px; border-radius: 5px; background: #17171ddc; color: white; font-size: .75rem; }
.work-genre { top: 7px; left: 7px; }.work-count { bottom: 7px; right: 7px; }
.work h2 { font-size: .97rem; margin: 8px 0 3px; line-height: 1.4; overflow-wrap: anywhere; }
.work-meta, .work-author { font-size: .84rem; margin: 0; line-height: 1.5; }
.work-author { display: inline-block; color: #ffacb1; }
#home-shelves { display: grid; gap: 23px; }
.shelf-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 11px; }
.shelf-header h2 { margin: 0; font-size: 1.21rem; letter-spacing: -.025em; }
.shelf-tools { display: flex; align-items: center; gap: 7px; }
.shelf-tools a { color: var(--muted); font-size: .88rem; padding: 5px 0 5px 6px; white-space: nowrap; }
.shelf-tools a:hover { color: #fff; }
.shelf-step { border: 1px solid var(--line); background: #22222c; color: #fff; border-radius: 6px; width: 32px; height: 31px; line-height: 1; font-size: 1.28rem; }
.shelf-step:disabled { cursor: default; opacity: .42; }
.shelf-track { display: grid; grid-auto-flow: column; grid-auto-columns: clamp(146px, 16%, 188px); gap: 13px; overflow-x: auto; overscroll-behavior-inline: contain; scroll-snap-type: x proximity; padding: 3px 2px 8px; scrollbar-width: thin; }
.shelf-track .work { scroll-snap-align: start; }
#paging { display: flex; gap: 10px; margin-top: 20px; }
.nav-action { display: none; }
@media(max-width:720px) {
  #home-shelves { gap: 18px; }
  .shelf-track { grid-auto-columns: clamp(134px, 40%, 172px); gap: 10px; }
  .shelf-header { margin-bottom: 7px; }
  .mast-nav { flex-wrap: wrap; gap: 0 10px; min-height: 56px; }
  .mast-nav nav { display: none; }
  .nav-action { margin-left: auto; display: block; }
  .search { display: none; order: 3; margin: 0 0 9px; width: 100%; }
  .search.is-open { display: flex; }
  .catalog-shell { padding-top: 2px; }
  .channel-nav { min-height: 42px; margin-bottom: 11px; }
  .catalog-layout { grid-template-columns: minmax(0,1fr); gap: 11px; }
  .filters-panel { padding: 8px 12px; }
  #genre-filter { display: flex; flex-wrap: wrap; }
  .works { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px 10px; }
  .section-title { margin-bottom: 12px; }
}
@media(prefers-reduced-motion:reduce) { .work-art img { transition:none; } }

.continue-watching:not([hidden]) {
  display: inline-flex;
  margin-block: .75rem 1rem;
  padding: .75rem 1rem;
  border-radius: .75rem;
  font-weight: 650;
}

.home-ranking { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; list-style: none; padding: 0; margin: 0; }
.rank-card { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; background: #1d1b25; border: 1px solid var(--line); }
.rank-card:hover { border-color: #ff777e; }
.rank-number { width: 1.45rem; flex: none; text-align: center; font-weight: 750; font-variant-numeric: tabular-nums; color: var(--muted); }
.home-ranking li:nth-child(-n+3) .rank-number { color: #ff8592; }
.rank-cover { width: 35px; height: 46px; flex: none; overflow: hidden; border-radius: 5px; background: #262631; }
.rank-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.rank-copy { min-width: 0; display: grid; gap: 3px; }
.rank-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-copy small { color: var(--muted); }
@media(max-width:720px) { .home-ranking { grid-template-columns: 1fr; } }
