/* Catalogue browsing: /dramas, /genres/<g>, /tropes/<t>, /formats/<f>, /search (10 Nov 2026). Cards reuse .posters. */
.browse .crumbs a, .browse .crumbs span { display: inline-flex; align-items: center; min-height: 44px; }
.browse .page-head { padding-bottom: 8px; }
.browse .page-head .lede { max-width: 66ch; }
.b-tools { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px 24px; margin-top: 26px; padding: 14px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.b-tools .chip { text-decoration: none; }
.chip[aria-current="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.sorts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; font-size: 14.5px; }
.sorts .label { margin-right: 4px; }
.sorts a { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); font-weight: 600; text-decoration: none; border-bottom: 2px solid transparent; }
.sorts a:hover { color: var(--fg); }
.sorts a[aria-current="true"] { color: var(--fg); border-bottom-color: var(--fg); }
.browse .sec { padding-top: 40px; }
.browse .shelf + .sec { padding-top: 56px; }
.b-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 28px 18px; }
.browse .poster h2, .bx .poster h2, .tp .poster h2 { font: 600 16px/1.3 var(--font-body); letter-spacing: 0; margin: 8px 0 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.browse .poster:hover h2, .bx .poster:hover h2 { text-decoration: underline; text-underline-offset: 3px; }
.browse .poster .frame img, .bx .poster .frame img, .tp .poster .frame img, .poster .frame .cover.ph { aspect-ratio: 3 / 4; width: 100%; height: auto; object-fit: cover; }
.shelf .posters { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 40px; }
.pager .pages { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; justify-content: center; }
.pager .pages a, .pager .pages span { display: inline-grid; place-items: center; min-width: 44px; height: 44px; border-radius: 999px; font: 600 14px var(--font-mono); color: var(--fg); text-decoration: none; }
.pager .pages a:hover { background: var(--fg-soft); }
.pager .pages [aria-current="page"] { background: var(--fg); color: var(--bg); }
.pager .pages .gap { min-width: 20px; color: var(--muted); }
.facets .chips { flex-wrap: wrap; }
.facets .chip { text-decoration: none; }
.b-search { display: flex; gap: 10px; margin-top: 22px; max-width: 560px; }
.b-search input { flex: 1; min-width: 0; height: 46px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--fg); font: 500 16px var(--font-body); }
.b-search input:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
.facet-list { list-style: none; margin: 32px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0 28px; }
.facet-list a { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 52px; border-top: 1px solid var(--border); color: var(--fg); text-decoration: none; font-weight: 600; }
.facet-list a:hover span:first-child { text-decoration: underline; text-underline-offset: 3px; }
.facet-list .ct { font: 500 13px var(--font-mono); color: var(--muted); }
@media (max-width: 1100px) { .b-grid, .shelf .posters { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 760px) { .b-grid, .shelf .posters { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 520px) {
  .b-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shelf .posters { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 14px; padding-bottom: 6px; }
  .shelf .poster { flex: 0 0 42%; scroll-snap-align: start; }
  .pager .btn { padding: 0 12px; }
}

/* ── Browse (/dramas): filters aside + results; a bottom sheet on phones (owner, 18 Nov 2026) ── */
.bx { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 0 36px; padding-top: 8px; }
.bx-aside { position: relative; padding: 4px 28px 40px 0; border-right: 1px solid var(--border); }
.bx-aside h1 { font-size: clamp(30px, 3.2vw, 40px); margin: 6px 0 18px; }
.bx-search { position: relative; display: flex; align-items: center; }
.bx-search svg { position: absolute; left: 14px; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.bx-search input { width: 100%; height: 46px; padding: 0 14px 0 38px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--fg); font: 500 15.5px var(--font-body); }
.bx-search input:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
.bx-active { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 14px 0 6px; padding: 10px 12px; border-radius: var(--r); background: var(--fg-softer); font-size: 14px; }
.bx-active p { margin: 0; color: var(--muted); }
.bx-active .pill { all: unset; cursor: pointer; font: 600 12.5px var(--font-body); padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); }
.bx-active .pill:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
.bx-active .pill[hidden] { display: none; }
.bx-open { display: none; width: 100%; margin-top: 12px; }
.bx-group { margin-top: 22px; }
.bx-group .label { margin: 0 0 4px; }
.bx-group .hint, .bx-scroll > .hint { margin: 0 0 8px; font-size: 12.5px; color: var(--muted); }
.bx-group .chips { gap: 6px; }
.bx-group .chip { height: 34px; padding: 0 12px; font-size: 13.5px; text-decoration: none; }
.chip.off { opacity: .4; cursor: default; }
.chip.off:hover { border-color: var(--border); background: var(--surface); }
.chips.collapsed .chip.extra { display: none; }
html:not(.js) .chips.collapsed .chip.extra { display: inline-flex; }
.chip.dashed { border-style: dashed; color: var(--muted); }
.bx-scroll > .hint { margin-top: 22px; }
.bx-sheet-head, .bx-sheet-foot { display: none; }
.bx-results { min-width: 0; padding-bottom: 40px; }
.bx-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; padding: 10px 0 18px; }
.bx-head p { margin: 0; font-size: 15px; color: var(--muted); }
.bx-head p b, .bx-head .of { color: var(--fg); font-weight: 700; }
.bx-tools { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.bx-sel { display: inline-flex; align-items: center; gap: 8px; }
.bx-sel select { height: 38px; padding: 0 30px 0 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--fg); font: 500 14px var(--font-body); }
.bx .b-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 28px 16px; }
.bx-empty { padding: 28px 0; color: var(--muted); }
.bx-more { display: flex; margin: 30px auto 0; }
.bx-more[hidden], .bx-pager[hidden] { display: none; }
.fx-head .paired { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 18px; }
.fx-head .paired .chip { height: 32px; font-size: 13.5px; text-decoration: none; }
.browse > .bx-head { margin-top: 26px; border-top: 1px solid var(--border); padding-top: 18px; }
/* A–Z indexes (/tropes, /genres) and app A–Z folds */
.az { position: sticky; top: 64px; z-index: 5; display: flex; flex-wrap: wrap; gap: 2px; margin-top: 26px; padding: 8px 0; background: color-mix(in oklch, var(--bg) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.az a { display: inline-grid; place-items: center; min-width: 34px; height: 34px; border-radius: 8px; font: 600 14px var(--font-mono); color: var(--fg); text-decoration: none; }
.az a:hover { background: var(--fg-soft); }
.az-group { scroll-margin-top: 120px; }
.az-group h2 { margin: 34px 0 6px; font-size: 26px; color: var(--accent); border-bottom: 1px solid var(--line-strong); padding-bottom: 6px; }
.az-group .facet-list { margin-top: 0; }
.az-group .facet-list a { border-top: 0; border-bottom: 1px solid var(--border); }
.az-fold summary { cursor: pointer; font: 600 16px var(--font-body); padding: 14px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.az-links { columns: 3 220px; column-gap: 28px; list-style: none; margin: 14px 0 0; padding: 0; }
.az-links li { break-inside: avoid; padding: 4px 0; font-size: 14.5px; }
.az-links a { color: var(--fg); text-decoration: none; }
.az-links a:hover { text-decoration: underline; text-underline-offset: 3px; }
.empty-watch[hidden], .ml-actions[hidden], .bx-empty[hidden] { display: none; }
.ml-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 34px; }
.ml-actions p { margin: 0; flex-basis: 100%; }
@media (max-width: 760px) {
  .bx { grid-template-columns: 1fr; }
  .bx-aside { border-right: 0; padding: 0 0 6px; }
  html.js .bx-open { display: flex; }
  html.js .bx-sheet { position: fixed; inset: auto 0 0 0; z-index: 60; height: 86dvh; display: flex; flex-direction: column; background: var(--bg); border-radius: 18px 18px 0 0;
    box-shadow: 0 -8px 30px color-mix(in oklch, black 25%, transparent); transform: translateY(105%); transition: transform .25s ease; visibility: hidden; }
  html.js .bx-sheet.open { transform: none; visibility: visible; }
  html.js .bx-sheet-head, html.js .bx-sheet-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
  html.js .bx-sheet-foot { border-bottom: 0; border-top: 1px solid var(--border); padding-bottom: max(14px, env(safe-area-inset-bottom)); }
  html.js .bx-sheet-foot .btn { flex: 1; }
  .bx-sheet-head .icon-btn { all: unset; cursor: pointer; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 999px; font-size: 18px; }
  html.js .bx-scroll { flex: 1; overflow-y: auto; padding: 0 18px 18px; overscroll-behavior: contain; }
  .bx-scrim { position: fixed; inset: 0; z-index: 55; background: color-mix(in oklch, black 45%, transparent); }
  html.sheet-open { overflow: hidden; }
  .bx .b-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 22px 12px; }
  .az { top: 56px; }
}
@media (prefers-reduced-motion: reduce) { html.js .bx-sheet { transition: none; } }
