:root,
:root[data-theme="clean-light"] {
  color-scheme:light;
  --page:#f1f3f0; --paper:#fff; --ink:#202522; --muted:#66706a;
  --line:#d9ded9; --line-strong:#bac4bc; --header:#e7ece7; --hover:#f1f6f1; --row-alt:#fafcf9;
  --accent:#316b3b; --accent-hover:#27582f; --link:#2b6538;
  --button-text:#303632; --button-bg:#f7f9f6; --button-border:#aab5ac; --button-hover:#fff;
  --primary-text:#fff; --active-filter:#24652f; --badge-text:#fff; --badge-bg:#a83f3a;
  --success:#267137; --error:#a33d36; --success-bg:#edf7ef; --error-bg:#faefee;
  --subtle-bg:#f1f4f0; --panel-highlight:#fffaf0; --poster-bg:#e1e6e1; --gallery-bg:#edf0ed; --comment-bg:#fafcf9;
  --imdb:#705916; --toast-bg:#303632; --toast-text:#fff; --shadow:#18211b33;
  --feed-release-columns:58px minmax(300px,1fr) 48px 54px 50px 84px 42px 42px 108px;
  --tracked-release-columns:58px minmax(300px,1fr) 48px 54px 50px 84px 42px 42px 70px;
  --search-release-columns:58px minmax(300px,1fr) 54px 84px 42px 42px 36px;
}

:root[data-theme="warm-light"] {
  color-scheme:light; --page:#f5f1e9; --paper:#fffdf8; --ink:#2d2923; --muted:#71695d; --line:#dfd5c6; --line-strong:#c5b8a5; --header:#eee5d7; --hover:#faf3e6; --row-alt:#fcf9f3; --accent:#865724; --accent-hover:#6d451b; --link:#775020; --button-text:#3a332a; --button-bg:#faf6ee; --button-border:#b7a994; --button-hover:#fffdf8; --primary-text:#fff; --active-filter:#7c4b16; --badge-text:#fff; --badge-bg:#a34842; --success:#44733d; --error:#a0443e; --success-bg:#f0f6ea; --error-bg:#faefec; --subtle-bg:#f3ece1; --panel-highlight:#fff7e6; --poster-bg:#e8dfd2; --gallery-bg:#efe7dc; --comment-bg:#fcf8f0; --imdb:#735511; --toast-bg:#3b342c; --toast-text:#fff; --shadow:#3c2e2033;
}
:root[data-theme="slate-light"] {
  color-scheme:light; --page:#eef1f4; --paper:#fbfcfd; --ink:#202934; --muted:#63707d; --line:#d3dae1; --line-strong:#b5c0cb; --header:#e1e7ec; --hover:#eef4f8; --row-alt:#f7f9fb; --accent:#466987; --accent-hover:#35546e; --link:#315f87; --button-text:#293540; --button-bg:#f3f6f8; --button-border:#a9b5c0; --button-hover:#fff; --primary-text:#fff; --active-filter:#315f87; --badge-text:#fff; --badge-bg:#a6424d; --success:#397448; --error:#a33f49; --success-bg:#edf6ef; --error-bg:#f9edef; --subtle-bg:#edf1f4; --panel-highlight:#fff9eb; --poster-bg:#dce3e8; --gallery-bg:#e7edf1; --comment-bg:#f7f9fb; --imdb:#715b1b; --toast-bg:#29343f; --toast-text:#fff; --shadow:#1a273433;
}
:root[data-theme="soft-blue"] {
  color-scheme:light; --page:#edf4f7; --paper:#fbfdfe; --ink:#1f3038; --muted:#607680; --line:#cfdee4; --line-strong:#abc1cb; --header:#dbe9ee; --hover:#ebf6fa; --row-alt:#f5fafc; --accent:#326f88; --accent-hover:#285b70; --link:#226887; --button-text:#293b43; --button-bg:#f1f7f9; --button-border:#a5bbc4; --button-hover:#fff; --primary-text:#fff; --active-filter:#236984; --badge-text:#fff; --badge-bg:#9c4652; --success:#33734b; --error:#a2424d; --success-bg:#eaf6ef; --error-bg:#faedef; --subtle-bg:#e9f1f4; --panel-highlight:#fff9eb; --poster-bg:#d9e5e9; --gallery-bg:#e3edf1; --comment-bg:#f4f9fb; --imdb:#70591a; --toast-bg:#283b44; --toast-text:#fff; --shadow:#18333d33;
}
:root[data-theme="graphite-dark"] {
  color-scheme:dark; --page:#191b1e; --paper:#23262a; --ink:#e4e7e9; --muted:#9ca4aa; --line:#3a3f45; --line-strong:#535a61; --header:#2d3136; --hover:#2c3236; --row-alt:#202327; --accent:#83aa84; --accent-hover:#97bd98; --link:#8eb9dc; --button-text:#e0e4e6; --button-bg:#2c3035; --button-border:#5a6269; --button-hover:#363b41; --primary-text:#132016; --active-filter:#9ac89c; --badge-text:#fff; --badge-bg:#c95e56; --success:#7fbd88; --error:#df746c; --success-bg:#26382a; --error-bg:#422927; --subtle-bg:#2a2e33; --panel-highlight:#332f24; --poster-bg:#30353a; --gallery-bg:#2d3236; --comment-bg:#282c30; --imdb:#d2b65e; --toast-bg:#e3e7e9; --toast-text:#202427; --shadow:#0008;
}
:root[data-theme="midnight-dark"] {
  color-scheme:dark; --page:#0f1720; --paper:#17212c; --ink:#e2e9ef; --muted:#93a5b4; --line:#293846; --line-strong:#405264; --header:#1f2b37; --hover:#1d2c39; --row-alt:#141d27; --accent:#76a9d4; --accent-hover:#8cbae0; --link:#80b6e3; --button-text:#e1e9ef; --button-bg:#202c38; --button-border:#4a6073; --button-hover:#293948; --primary-text:#0d1c28; --active-filter:#91c6ee; --badge-text:#fff; --badge-bg:#c75f70; --success:#73b68b; --error:#df7480; --success-bg:#193528; --error-bg:#41262d; --subtle-bg:#1c2834; --panel-highlight:#302d24; --poster-bg:#23303b; --gallery-bg:#222e39; --comment-bg:#1b2631; --imdb:#d6b961; --toast-bg:#e3eaf0; --toast-text:#17212a; --shadow:#0009;
}
:root[data-theme="charcoal-teal"] {
  color-scheme:dark; --page:#151d1d; --paper:#202929; --ink:#e0e7e5; --muted:#96a7a3; --line:#35413f; --line-strong:#4b5b57; --header:#293432; --hover:#293936; --row-alt:#1c2525; --accent:#69aea2; --accent-hover:#7dc0b4; --link:#78c2b5; --button-text:#dce6e3; --button-bg:#293432; --button-border:#526560; --button-hover:#34423f; --primary-text:#10201d; --active-filter:#83c7bb; --badge-text:#fff; --badge-bg:#c66860; --success:#79ba85; --error:#dd766d; --success-bg:#23372a; --error-bg:#432b29; --subtle-bg:#283231; --panel-highlight:#343026; --poster-bg:#303b39; --gallery-bg:#2b3634; --comment-bg:#26302f; --imdb:#d0b65d; --toast-bg:#dfe7e4; --toast-text:#1d2926; --shadow:#0008;
}
:root[data-theme="deep-purple"] {
  color-scheme:dark; --page:#1c1722; --paper:#292231; --ink:#e9e4ec; --muted:#aba1b1; --line:#413748; --line-strong:#5b4d65; --header:#342b3d; --hover:#372e41; --row-alt:#251f2c; --accent:#a78bc0; --accent-hover:#b99ed0; --link:#bea1d5; --button-text:#e8e1ec; --button-bg:#352d3e; --button-border:#665671; --button-hover:#403649; --primary-text:#24162d; --active-filter:#c0a2d8; --badge-text:#fff; --badge-bg:#cb6671; --success:#81b78a; --error:#df7781; --success-bg:#29372c; --error-bg:#482a32; --subtle-bg:#332b3b; --panel-highlight:#393127; --poster-bg:#39303f; --gallery-bg:#352d3c; --comment-bg:#302838; --imdb:#d5b969; --toast-bg:#ece5f0; --toast-text:#271e2d; --shadow:#0008;
}
:root[data-theme="forest"] {
  color-scheme:dark; --page:#142019; --paper:#1e2c24; --ink:#e3e9e5; --muted:#98a99d; --line:#34483b; --line-strong:#4a6252; --header:#293b30; --hover:#2a3e31; --row-alt:#1a271f; --accent:#7faf76; --accent-hover:#94c18a; --link:#8dbc84; --button-text:#dfe8e2; --button-bg:#293a30; --button-border:#546b5b; --button-hover:#344a3a; --primary-text:#142415; --active-filter:#9ac58f; --badge-text:#fff; --badge-bg:#ca6b57; --success:#83bf7f; --error:#df7967; --success-bg:#263c29; --error-bg:#432b27; --subtle-bg:#29382f; --panel-highlight:#383326; --poster-bg:#304138; --gallery-bg:#2a3a31; --comment-bg:#25352b; --imdb:#d2ba63; --toast-bg:#e4ebe6; --toast-text:#1c2b21; --shadow:#0008;
}
:root[data-theme="burgundy"] {
  color-scheme:dark; --page:#241719; --paper:#321f22; --ink:#eee5e6; --muted:#b3a1a3; --line:#4c3438; --line-strong:#69494f; --header:#3e292d; --hover:#462e33; --row-alt:#2d1c1f; --accent:#c1848c; --accent-hover:#d398a0; --link:#d5969e; --button-text:#eee3e5; --button-bg:#412b2f; --button-border:#74525a; --button-hover:#4d3338; --primary-text:#2b1519; --active-filter:#d99aa2; --badge-text:#241719; --badge-bg:#e1a058; --success:#8dbb83; --error:#e08680; --success-bg:#30382a; --error-bg:#552f31; --subtle-bg:#3d292d; --panel-highlight:#453328; --poster-bg:#432f33; --gallery-bg:#3e2b2e; --comment-bg:#392629; --imdb:#dbbd69; --toast-bg:#eee5e6; --toast-text:#321f22; --shadow:#0008;
}
:root:root[data-theme="graphite-dark"],
:root:root[data-theme="midnight-dark"],
:root:root[data-theme="charcoal-teal"],
:root:root[data-theme="deep-purple"],
:root:root[data-theme="forest"] { --badge-bg:#9d4145; }

* { box-sizing:border-box; }
html { overflow-y:scroll; }
body { margin:0; min-width:900px; color:var(--ink); background:var(--page); font:13px/1.3 Arial,"Helvetica Neue",sans-serif; }
button { font:inherit; cursor:pointer; }
.app-shell { width:min(1680px,calc(100% - 28px)); margin:0 auto 28px; }
.topbar { display:flex; align-items:center; justify-content:space-between; min-height:48px; gap:18px; border-bottom:1px solid var(--line-strong); }
.brand { color:var(--accent); font-size:18px; font-weight:700; text-decoration:none; }
.topbar-controls { display:flex; align-items:center; justify-content:flex-end; gap:14px; min-width:0; }
.theme-control { display:flex; align-items:center; gap:6px; color:var(--muted); font-size:12px; white-space:nowrap; }
.theme-control select { width:142px; height:27px; padding:2px 24px 2px 7px; color:var(--ink); background:var(--button-bg); border:1px solid var(--button-border); border-radius:3px; font:inherit; }
.theme-control select:hover,.theme-control select:focus-visible { background:var(--button-hover); border-color:var(--accent); outline:0; }
.feed-status,.page-status,.row-count,.imdb-status { color:var(--muted); font-size:12px; }
.imdb-status.error { color:var(--error); }
.app-version { color:var(--muted); font-size:11px; white-space:nowrap; }
.feed-status.error,.page-status.error { color:var(--error); }
.compact-button { display:inline-flex; align-items:center; justify-content:center; min-height:28px; padding:4px 10px; color:var(--button-text); background:var(--button-bg); border:1px solid var(--button-border); border-radius:3px; text-decoration:none; white-space:nowrap; }
.compact-button:hover,.compact-button:focus-visible { background:var(--button-hover); border-color:var(--accent); outline:0; }
.compact-button.primary { color:var(--primary-text); background:var(--accent); border-color:var(--accent); }
.compact-button.primary:hover,.compact-button.primary:focus-visible { background:var(--accent-hover); }
.compact-button.danger { color:var(--error); }
.compact-button:disabled { opacity:.58; cursor:progress; }
.svg-sprite { position:absolute; width:0; height:0; overflow:hidden; }
.icon-button { display:inline-flex; align-items:center; justify-content:center; flex:0 0 28px; width:28px; height:27px; padding:4px; color:var(--button-text); background:var(--button-bg); border:1px solid var(--button-border); border-radius:3px; }
.icon-button:hover,.icon-button:focus-visible { color:var(--accent); background:var(--button-hover); border-color:var(--accent); outline:0; }
.icon-button.primary,.icon-button.active { color:var(--primary-text); background:var(--accent); border-color:var(--accent); }
.icon-button.danger { color:var(--error); }
.icon-button:disabled { opacity:.55; cursor:progress; }
.action-icon,.icon-button svg { width:16px; height:16px; color:inherit; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; pointer-events:none; }
.view { padding-top:15px; }
.hidden { display:none !important; }
.view-heading,.page-toolbar { display:flex; align-items:center; gap:10px; margin-bottom:8px; }
.view-heading { justify-content:space-between; }
.view-heading > div { display:flex; align-items:baseline; gap:9px; }
.toolbar-title { min-width:0; flex:1; }
h1 { margin:0; font-size:17px; line-height:1.2; }
.eyebrow { margin:0 0 2px; color:var(--muted); font-size:11px; }
.page-status { min-height:20px; padding:0 2px 5px; }
.source-button { margin-left:auto; }
.heading-actions,.catalog-tabs,.catalog-nav-actions { display:flex; align-items:center; gap:6px; }
.catalog-tabs { margin-bottom:10px; border-bottom:1px solid var(--line-strong); }
.catalog-nav-actions { margin-left:auto; }
.catalog-tab { position:relative; display:inline-flex; align-items:center; justify-content:center; width:42px; min-height:36px; padding:6px; color:var(--muted); background:transparent; border:0; border-bottom:2px solid transparent; }
.catalog-tab svg { width:19px; height:19px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.catalog-tab .tab-badge { position:absolute; top:0; right:0; }
.catalog-tab:hover,.catalog-tab:focus-visible { color:var(--accent); outline:0; }
.catalog-tab.active { color:var(--ink); border-bottom-color:var(--accent); font-weight:700; }
.tab-badge,.unread-badge { display:inline-block; min-width:18px; padding:1px 5px; color:var(--badge-text); background:var(--badge-bg); border-radius:9px; font-size:10px; font-weight:700; text-align:center; }

.category-section { margin:0 0 14px; }
.category-heading-row { display:flex; align-items:center; justify-content:space-between; gap:10px; min-height:25px; }
.category-heading-main { display:flex; align-items:center; min-width:0; }
.category-heading { display:flex; align-items:baseline; gap:6px; margin:0 0 4px; padding:0 2px; font-size:14px; }
.category-count { color:var(--muted); font-size:11px; font-weight:400; }
.active-filters { display:flex; gap:5px; }
.mobile-category-controls,.mobile-list-controls,.mobile-tracked-change,.phone-release-row { display:none; }
.active-filter-chip { display:inline-flex; align-items:center; gap:4px; height:23px; padding-left:7px; color:var(--active-filter); background:var(--subtle-bg); border:1px solid var(--active-filter); border-radius:12px; font-size:11px; font-weight:700; }
.active-filter-chip .filter-reset { width:21px; height:21px; flex-basis:21px; padding:3px; border:0; border-left:1px solid var(--line); border-radius:0 10px 10px 0; }
.release-table-scroll { overflow-x:auto; border:1px solid var(--line-strong); background:var(--paper); }
.release-table { min-width:880px; }
.release-grid { display:grid; align-items:center; width:100%; }
.feed-release-grid { grid-template-columns:var(--feed-release-columns); }
.tracked-release-grid { grid-template-columns:var(--tracked-release-columns); }
.search-release-grid { grid-template-columns:var(--search-release-columns); }
.release-header { position:sticky; z-index:1; top:0; height:32px; color:var(--ink); background:var(--header); border-bottom:1px solid var(--line-strong); font-size:11px; font-weight:700; }
.release-header > *,.release-row > * { min-width:0; padding:0 8px; border-right:1px solid var(--line); }
.release-header > *:last-child,.release-row > *:last-child { border-right:0; }
.column-heading { display:flex; align-items:center; height:31px; padding-right:3px !important; }
.sort-button { display:flex; align-items:center; justify-content:space-between; min-width:0; flex:1; height:31px; padding:0; color:inherit; background:transparent; border:0; font-weight:700; text-align:left; }
.sort-button.numeric { justify-content:flex-end; gap:4px; }
.sort-button:hover,.sort-button:focus-visible { color:var(--accent); outline:0; }
.sort-indicator { width:9px; color:var(--accent); text-align:center; }
.filter-button { display:inline-flex; align-items:center; justify-content:center; flex:0 0 22px; width:22px; height:24px; padding:3px; color:var(--muted); background:transparent; border:0; }
.filter-button .action-icon { width:14px; height:14px; }
.filter-button:hover,.filter-button:focus-visible { color:var(--accent); outline:0; }
.filter-button.active { color:var(--active-filter); outline:0; text-shadow:0 0 1px var(--active-filter); }
.action-heading { text-align:center; }
.release-row { height:34px; border-bottom:1px solid var(--line); white-space:nowrap; }
.release-row:last-child { border-bottom:0; }
.release-row:nth-child(even) { background:var(--row-alt); }
.release-row:hover { background:var(--hover); }
.release-date { color:var(--muted); font-variant-numeric:tabular-nums; }
.release-year,.release-comments,.release-imdb,.release-size,.release-peers { text-align:right; font-variant-numeric:tabular-nums; }
.release-imdb { color:var(--imdb); font-weight:700; }
.release-seeders { color:var(--success); font-weight:700; }
.release-leechers { color:var(--error); font-weight:700; }
.release-title-cell { overflow:hidden; position:relative; height:33px; padding-top:0 !important; padding-bottom:0 !important; }
.release-title-text { display:inline-block; max-width:none; height:33px; padding:0; color:var(--ink); background:none; border:0; line-height:33px; text-align:left; text-decoration:none; white-space:nowrap; transform:translateX(0); transition:transform 160ms ease-out; will-change:transform; }
.release-title-text:hover,.release-title-text:focus-visible { color:var(--link); text-decoration:underline; outline:0; }
.release-title-cell.is-overflowing:hover .release-title-text { transform:translateX(calc(-1 * var(--marquee-distance))); transition-delay:140ms; transition-duration:var(--marquee-duration); transition-timing-function:linear; }
.release-action { display:flex; justify-content:center; gap:4px; padding:0 4px !important; }
.release-action .icon-button,.tracked-row-actions .icon-button { width:26px; height:24px; flex-basis:26px; }
.action-placeholder { width:26px; }
.tracked-row-actions { display:flex; justify-content:flex-end; gap:5px; }
.tracked-row-actions .row-action { min-width:auto; }
.tracked-release-item.has-unread > .release-row { background:var(--panel-highlight); }
.tracked-change-panel { padding:6px 12px 8px 66px; background:var(--panel-highlight); border-bottom:1px solid var(--line); white-space:normal; }
.tracked-change-current { display:flex; gap:7px; align-items:center; }
.tracked-change-current div { overflow-wrap:anywhere; }
.change-fragment { color:var(--accent); font-weight:700; }
.tracked-history { margin-top:7px; }
.tracked-history > summary { display:flex; align-items:center; gap:5px; cursor:pointer; color:var(--muted); font-size:11px; }
.tracked-history > summary .action-icon { width:13px; height:13px; }
.tracked-history ol { margin:7px 0 0; padding-left:22px; }
.tracked-history li + li { margin-top:7px; }
.tracked-history time { color:var(--muted); font-size:11px; }
.empty-state { padding:28px; color:var(--muted); text-align:center; }
.results-count { padding:5px 3px 0; color:var(--muted); font-size:11px; text-align:right; }
.filter-popover { position:fixed; z-index:20; width:224px; padding:10px; background:var(--paper); border:1px solid var(--line-strong); border-radius:3px; box-shadow:0 5px 18px var(--shadow); }
.filter-popover > strong { display:block; margin-bottom:7px; }
.filter-popover label { display:grid; grid-template-columns:38px minmax(0,1fr); align-items:center; gap:6px; margin-top:5px; color:var(--muted); font-size:11px; }
.filter-popover input { min-width:0; height:27px; padding:3px 6px; color:var(--ink); background:var(--button-bg); border:1px solid var(--line-strong); font:inherit; }
.mobile-filter-popover { position:fixed; z-index:21; right:8px; left:8px; width:auto; padding:12px; background:var(--paper); border:1px solid var(--line-strong); border-radius:4px; box-shadow:0 5px 18px var(--shadow); }
.mobile-filter-popover > strong { display:block; margin-bottom:8px; }
.mobile-filter-popover label { display:grid; grid-template-columns:74px minmax(0,1fr); align-items:center; gap:8px; margin-top:7px; color:var(--muted); font-size:12px; }
.mobile-filter-popover input { min-width:0; height:44px; padding:6px 8px; color:var(--ink); background:var(--button-bg); border:1px solid var(--line-strong); font-size:16px; }
.mobile-sort-popover { position:fixed; z-index:21; right:8px; left:8px; width:auto; padding:12px; background:var(--paper); border:1px solid var(--line-strong); border-radius:4px; box-shadow:0 5px 18px var(--shadow); }
.mobile-sort-popover > strong { display:block; margin-bottom:8px; }
.mobile-sort-popover label { display:grid; grid-template-columns:74px minmax(0,1fr); align-items:center; gap:8px; margin-top:7px; color:var(--muted); font-size:12px; }
.mobile-sort-popover select { min-width:0; height:44px; padding:6px 8px; color:var(--ink); background:var(--button-bg); border:1px solid var(--line-strong); font-size:16px; }
.filter-actions { display:flex; justify-content:flex-end; gap:6px; margin-top:9px; }
.filter-actions .icon-button { width:28px; height:25px; padding:4px; }

.inline-alternatives { padding:7px 8px 6px 58px; background:var(--subtle-bg); border-bottom:1px solid var(--line-strong); }
.inline-alternatives > p { margin:3px 0; color:var(--muted); }
.inline-alternatives.error > p { color:var(--error); }
.inline-list { border:1px solid var(--line); background:var(--paper); }
.inline-release-row { display:grid; grid-template-columns:58px minmax(240px,1fr) 84px 42px 42px 34px; align-items:center; min-height:31px; border-bottom:1px solid var(--line); }
.inline-release-row:last-child { border-bottom:0; }
.inline-release-row > * { min-width:0; padding:0 7px; }
.inline-release-row > button:not(.icon-button) { overflow:hidden; color:var(--link); background:none; border:0; text-align:left; text-overflow:ellipsis; white-space:nowrap; }
.inline-release-row .icon-button { width:25px; height:23px; padding:3px; }

.detail-layout { max-width:1240px; }
.detail-top { display:grid; grid-template-columns:minmax(260px,400px) minmax(0,1fr); gap:18px; align-items:start; padding:14px; background:var(--paper); border:1px solid var(--line-strong); }
.detail-poster { width:100%; max-width:400px; aspect-ratio:2 / 3; overflow:hidden; background:var(--poster-bg); border:1px solid var(--line); }
.detail-poster img { display:block; width:100%; height:100%; object-fit:cover; }
.detail-poster-placeholder { display:flex; align-items:center; justify-content:center; width:100%; height:100%; padding:15px; color:var(--muted); text-align:center; }
.detail-release-title { margin:0 0 12px; font-size:19px; line-height:1.25; overflow-wrap:anywhere; }
.detail-imdb { min-height:25px; margin:-4px 0 8px; color:var(--imdb); font-size:15px; font-weight:700; }
.detail-summary { min-width:0; display:flex; flex-direction:column; align-items:flex-start; }
.detail-primary-actions { display:flex; gap:6px; margin-top:8px; }
.detail-inline-description { width:100%; margin-top:18px; }
.detail-inline-description h3 { margin:0 0 8px; font-size:15px; }
.detail-toolbar { flex-wrap:wrap; }
.detail-fields { display:grid; grid-template-columns:150px minmax(160px,1fr) 140px minmax(160px,1fr); margin:0; border-top:1px solid var(--line); border-left:1px solid var(--line); }
.detail-fields dt,.detail-fields dd { min-height:34px; margin:0; padding:8px 9px; border-right:1px solid var(--line); border-bottom:1px solid var(--line); }
.detail-fields dt { color:var(--muted); background:var(--subtle-bg); font-weight:700; }
.detail-fields dd { min-width:0; overflow-wrap:anywhere; }
.detail-section { margin-top:12px; padding:13px 14px; background:var(--paper); border:1px solid var(--line-strong); }
.detail-section h2 { margin:0 0 10px; font-size:15px; }
.detail-description { margin:0; line-height:1.55; white-space:pre-wrap; overflow-wrap:anywhere; }
.technical-grid { display:grid; grid-template-columns:170px minmax(160px,1fr) 160px minmax(160px,1fr); margin:0; border-top:1px solid var(--line); border-left:1px solid var(--line); }
.technical-grid dt,.technical-grid dd { min-height:33px; margin:0; padding:7px 8px; border-right:1px solid var(--line); border-bottom:1px solid var(--line); }
.technical-grid dt { color:var(--muted); background:var(--subtle-bg); font-weight:700; }
.technical-source-list { display:grid; grid-template-columns:180px minmax(0,1fr); margin:0; border-top:1px solid var(--line); border-left:1px solid var(--line); }
.technical-source-list dt,.technical-source-list dd { min-height:34px; margin:0; padding:8px 9px; border-right:1px solid var(--line); border-bottom:1px solid var(--line); overflow-wrap:anywhere; white-space:pre-wrap; }
.technical-source-list dt { color:var(--muted); background:var(--subtle-bg); font-weight:700; }
.technical-source-list .files-value { padding:0; }
.files-disclosure > summary { min-height:33px; padding:8px 9px; cursor:pointer; font-weight:700; }
.files-disclosure[open] > summary { border-bottom:1px solid var(--line); }
.files-disclosure .file-list-content { margin:0; padding:9px; }
.technical-empty,.file-empty { margin:0; color:var(--muted); }
.audio-track { display:grid; grid-template-columns:48px 110px minmax(180px,1fr) 90px 90px 90px 90px; min-height:34px; border:1px solid var(--line); border-bottom:0; }
.audio-track:last-child { border-bottom:1px solid var(--line); }
.audio-track > span { min-width:0; padding:8px; border-right:1px solid var(--line); overflow-wrap:anywhere; }
.audio-track > span:last-child { border-right:0; }
.audio-track.header { min-height:30px; color:var(--muted); background:var(--subtle-bg); font-size:11px; font-weight:700; }
.audio-empty,.subtitle-empty { color:var(--muted); }
.subtitle-list { margin:0; padding-left:19px; }
.subtitle-list li + li { margin-top:4px; }
.optional-sections { padding:0; overflow:hidden; }
.source-optional-section + .source-optional-section { border-top:1px solid var(--line); }
.source-optional-section > summary { padding:10px 14px; cursor:pointer; font-weight:700; }
.source-optional-section[open] > summary { background:var(--subtle-bg); border-bottom:1px solid var(--line); }
.optional-content { padding:12px 14px; }
.optional-content pre { max-height:540px; overflow:auto; margin:0; padding:11px; background:var(--subtle-bg); border:1px solid var(--line); font:12px/1.35 ui-monospace,SFMono-Regular,Menlo,monospace; white-space:pre; }
.optional-text { line-height:1.5; white-space:pre-wrap; overflow-wrap:anywhere; }
.optional-loading,.empty-inline { margin:0; color:var(--muted); }
.optional-loading.error { color:var(--error); }
.source-gallery { display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:8px; }
.source-gallery a { display:block; min-height:90px; background:var(--gallery-bg); border:1px solid var(--line); }
.source-gallery img { display:block; width:100%; height:130px; object-fit:cover; }
.comments-list { display:grid; gap:9px; }
.comment { padding:10px; background:var(--comment-bg); border:1px solid var(--line); }
.comment-head { display:flex; gap:9px; align-items:baseline; margin-bottom:5px; }
.comment-author { font-weight:700; }
.comment-date { color:var(--muted); font-size:11px; }
.comment-rating { margin-left:auto; color:var(--imdb); font-size:12px; }
.comment-text { margin:0; line-height:1.45; white-space:pre-wrap; overflow-wrap:anywhere; }
.toast { position:fixed; z-index:5; right:16px; bottom:16px; max-width:380px; padding:9px 11px; color:var(--toast-text); background:var(--toast-bg); border-radius:3px; box-shadow:0 5px 18px var(--shadow); }
.toast.error { color:var(--badge-text); background:var(--error); }
.file-list { border:1px solid var(--line); }
.file-row { display:grid; grid-template-columns:minmax(0,1fr) 110px; min-height:33px; border-bottom:1px solid var(--line); }
.file-row:last-child { border-bottom:0; }
.file-row > span { min-width:0; padding:8px 9px; overflow-wrap:anywhere; }
.file-row > span + span { border-left:1px solid var(--line); text-align:right; font-variant-numeric:tabular-nums; }
.file-row.header { color:var(--muted); background:var(--subtle-bg); font-size:11px; font-weight:700; }
.app-footer { margin-top:18px; padding:10px 2px; border-top:1px solid var(--line); color:var(--muted); font-size:10px; }
.app-footer a { color:inherit; }

@media (prefers-reduced-motion:reduce) {
  .release-title-cell.is-overflowing:hover .release-title-text { transform:none; transition:none; }
}

@media (max-width:1100px) {
  body { min-width:0; }
  .app-shell { width:calc(100% - 16px); }
  .topbar,.topbar-controls { flex-wrap:wrap; }
  .release-table-scroll { max-width:100%; }
  .detail-fields,.technical-grid,.technical-source-list { grid-template-columns:145px minmax(0,1fr); }
  .audio-track { grid-template-columns:42px 95px minmax(150px,1fr) 80px 80px 80px 80px; font-size:12px; }
}

@media (max-width:768px) {
  html,body { max-width:100%; overflow-x:hidden; }
  .app-shell { width:calc(100% - 16px); margin-bottom:16px; }
  .topbar { align-items:flex-start; gap:7px; padding:8px 0; }
  .brand { width:100%; font-size:17px; }
  .topbar-controls { width:100%; justify-content:flex-start; gap:6px 10px; }
  .theme-control { flex:1 1 190px; }
  .theme-control select { width:min(150px,55vw); }
  .feed-status,.imdb-status { flex:1 1 150px; }
  .app-version { margin-left:auto; }
  .view { padding-top:10px; }
  .view-heading,.page-toolbar { align-items:flex-start; flex-wrap:wrap; }
  .view-heading > div { min-width:0; flex-wrap:wrap; }
  .heading-actions { margin-left:auto; }
  .catalog-tabs { overflow-x:auto; }
  .catalog-tab { min-height:42px; }

  .category-section { margin-bottom:18px; }
  .category-heading-row { align-items:flex-start; flex-direction:column; gap:5px; margin-bottom:5px; }
  .category-heading { font-size:15px; }
  .active-filters { max-width:100%; flex-wrap:wrap; }
  .active-filter-chip { min-height:32px; height:auto; }
  .active-filter-chip .filter-reset { width:32px; height:30px; flex-basis:32px; }
  .release-table-scroll { overflow:visible; border:0; background:transparent; }
  .release-table { min-width:0; width:100%; }
  .release-header { position:static; display:flex; height:auto; min-height:0; flex-wrap:wrap; gap:3px; padding:4px; border:1px solid var(--line-strong); border-radius:4px; }
  .release-header > * { flex:1 1 72px; height:40px; padding:0 3px; border:1px solid var(--line); border-radius:3px; }
  .release-header > *:last-child { border-right:1px solid var(--line); }
  .release-header .action-heading { display:none; }
  .column-heading { height:40px; }
  .sort-button { height:38px; padding-left:5px; }
  .filter-button { width:40px; height:38px; flex-basis:40px; }
  .filter-button .action-icon { width:17px; height:17px; }

  .release-row { height:auto; min-height:0; margin-top:8px; padding:9px; gap:6px 8px; background:var(--paper); border:1px solid var(--line-strong); border-radius:4px; white-space:normal; }
  .release-row:nth-child(even) { background:var(--row-alt); }
  .release-row > * { min-width:0; padding:2px 0; border:0; }
  .feed-release-grid,.tracked-release-grid { grid-template-columns:repeat(4,minmax(0,1fr)); grid-template-areas:"title title title title" "date year comments imdb" "size size seed leech" "actions actions actions actions"; }
  .search-release-grid { grid-template-columns:repeat(4,minmax(0,1fr)); grid-template-areas:"title title title title" "date comments size size" "seed leech actions actions"; }
  .release-row .release-title-cell { grid-area:title; height:auto; overflow:visible; padding-bottom:7px; border-bottom:1px solid var(--line); }
  .release-row .release-title-text { display:block; width:100%; height:auto; min-height:40px; color:var(--ink); font-size:14px; font-weight:700; line-height:1.35; text-align:left; white-space:normal; overflow-wrap:anywhere; transform:none !important; transition:none; }
  .release-row .release-date { grid-area:date; }
  .release-row .release-year { grid-area:year; }
  .release-row .release-comments { grid-area:comments; }
  .release-row .release-imdb { grid-area:imdb; font-size:14px; }
  .release-row .release-size { grid-area:size; }
  .release-row .release-seeders { grid-area:seed; }
  .release-row .release-leechers { grid-area:leech; }
  .release-row .release-action,.release-row .tracked-row-actions { grid-area:actions; justify-content:flex-end; margin-top:2px; padding-top:7px; border-top:1px solid var(--line); }
  .release-row .release-year,.release-row .release-comments,.release-row .release-imdb,.release-row .release-size,.release-row .release-peers { text-align:left; }
  .release-row .release-date::before { content:"Дата "; }
  .release-row .release-year::before { content:"Год "; }
  .release-row .release-comments::before { content:"Комм. "; }
  .release-row .release-imdb::before { content:"IMDb "; color:var(--muted); font-size:11px; font-weight:400; }
  .release-row .release-size::before { content:"Размер "; }
  .release-row .release-seeders::before { content:"S "; color:var(--muted); font-weight:400; }
  .release-row .release-leechers::before { content:"L "; color:var(--muted); font-weight:400; }
  .release-row .release-date::before,.release-row .release-year::before,.release-row .release-comments::before,.release-row .release-size::before { color:var(--muted); font-size:10px; }
  .release-action .icon-button,.tracked-row-actions .icon-button,.inline-release-row .icon-button,.detail-primary-actions .icon-button,.heading-actions .icon-button { width:44px; height:44px; flex-basis:44px; padding:11px; }
  .action-placeholder { display:none; }

  .tracked-release-item { margin-top:8px; }
  .tracked-release-item .release-row { margin-top:0; }
  .tracked-change-panel { padding:10px; border:1px solid var(--line-strong); border-top:0; border-radius:0 0 4px 4px; }
  .tracked-change-current { align-items:flex-start; flex-wrap:wrap; }
  .tracked-change-current .change-fragment { flex:1 1 100%; }
  .tracked-history > summary { min-height:40px; font-size:12px; }
  .tracked-history ol { padding-left:20px; }
  .tracked-history li div { overflow-wrap:anywhere; }

  .inline-alternatives { max-width:100%; margin-top:-1px; padding:8px; border:1px solid var(--line-strong); }
  .inline-list { border:0; background:transparent; }
  .inline-release-row { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); grid-template-areas:"inline-title inline-title inline-title inline-title" "inline-date inline-size inline-seed inline-leech" "inline-action inline-action inline-action inline-action"; gap:6px 8px; min-height:0; margin-bottom:7px; padding:8px; background:var(--paper); border:1px solid var(--line); border-radius:3px; }
  .inline-release-row:last-child { border-bottom:1px solid var(--line); }
  .inline-release-row > * { min-width:0; padding:2px 0; }
  .inline-release-row .inline-release-title { grid-area:inline-title; min-height:40px; padding-bottom:7px; border-bottom:1px solid var(--line); font-weight:700; line-height:1.35; white-space:normal; overflow-wrap:anywhere; }
  .inline-release-row > button.inline-release-title:not(.icon-button) { overflow:visible; text-overflow:clip; white-space:normal; }
  .inline-release-date { grid-area:inline-date; color:var(--muted); }
  .inline-release-size { grid-area:inline-size; }
  .inline-release-row .release-seeders { grid-area:inline-seed; }
  .inline-release-row .release-leechers { grid-area:inline-leech; }
  .inline-release-action { grid-area:inline-action; display:flex; justify-content:flex-end; padding-top:5px; border-top:1px solid var(--line); }
  .inline-release-date::before { content:"Дата "; }
  .inline-release-size::before { content:"Размер "; color:var(--muted); font-size:10px; }
  .inline-release-row .release-seeders::before { content:"S "; color:var(--muted); font-weight:400; }
  .inline-release-row .release-leechers::before { content:"L "; color:var(--muted); font-weight:400; }

  .filter-popover { right:8px; left:8px !important; width:auto; max-width:none; }
  .filter-popover label { grid-template-columns:70px minmax(0,1fr); }
  .filter-popover input { height:44px; font-size:16px; }
  .filter-actions .icon-button { width:44px; height:44px; padding:11px; }

  .detail-layout { width:100%; max-width:100%; }
  .detail-top { grid-template-columns:1fr; gap:12px; padding:10px; }
  .detail-poster { width:min(100%,300px); max-width:300px; justify-self:center; }
  .detail-summary { width:100%; }
  .detail-release-title { font-size:18px; }
  .detail-primary-actions { width:100%; flex-wrap:wrap; }
  .detail-inline-description { margin-top:14px; }
  .detail-section { max-width:100%; padding:10px; overflow-wrap:anywhere; }
  .detail-fields,.technical-grid,.technical-source-list { display:block; border-top:1px solid var(--line); }
  .detail-fields dt,.technical-grid dt,.technical-source-list dt { min-height:0; padding:7px 8px 3px; border-bottom:0; }
  .detail-fields dd,.technical-grid dd,.technical-source-list dd { min-height:0; padding:4px 8px 9px; border-bottom:1px solid var(--line); white-space:pre-wrap; overflow-wrap:anywhere; }
  .technical-source-list .files-value { padding:0; }
  .audio-track { grid-template-columns:40px 86px minmax(0,1fr); min-width:0; font-size:11px; }
  .audio-track > span { padding:6px; }
  .file-row { grid-template-columns:minmax(0,1fr) 76px; }
  .file-row > span { padding:7px; overflow-wrap:anywhere; word-break:break-word; }
  .optional-content { max-width:100%; padding:9px; overflow:hidden; }
  .optional-content pre { max-width:100%; overflow:auto; }
  .optional-text,.comment-text,.comment p { overflow-wrap:anywhere; word-break:break-word; }
  .source-gallery { grid-template-columns:repeat(auto-fill,minmax(min(130px,100%),1fr)); }
  .comment-head { align-items:flex-start; flex-wrap:wrap; }
  .comment-rating { margin-left:0; }
  .toast { right:8px; bottom:8px; left:8px; max-width:none; }
}

@media (max-width:600px) {
  body { padding-top:env(safe-area-inset-top); padding-right:env(safe-area-inset-right); padding-bottom:env(safe-area-inset-bottom); padding-left:env(safe-area-inset-left); }
  .category-section { margin-bottom:20px; }
  .category-heading-row { gap:4px; margin-bottom:2px; }
  .category-heading-main { width:100%; gap:6px; }
  .category-heading { min-width:0; flex:1 1 auto; margin:0; padding-left:4px; font-size:15px; }
  .category-count { font-size:11px; }
  .mobile-category-controls { display:flex; flex:0 0 auto; align-items:center; gap:0; }
  .mobile-list-controls { display:flex; justify-content:flex-end; min-height:44px; }
  .mobile-filter-button,.mobile-sort-button { display:inline-flex; align-items:center; justify-content:center; width:44px; height:44px; padding:11px; color:var(--muted); background:transparent; border:0; border-radius:50%; }
  .mobile-filter-button .action-icon,.mobile-sort-button .action-icon { width:19px; height:19px; }
  .mobile-filter-button.active { color:var(--accent); background:var(--panel-highlight); }
  .mobile-sort-button.active { color:var(--accent); }
  .mobile-sort-status { margin-right:1px; color:var(--accent); font-size:11px; font-weight:700; white-space:nowrap; }
  .active-filters { width:100%; gap:4px; padding-left:4px; }
  .active-filters:empty { display:none; }
  .active-filter-chip { min-height:24px; height:24px; padding-left:7px; background:var(--subtle-bg); border:0; border-radius:12px; font-size:11px; }
  .active-filter-chip .filter-reset { width:24px; height:24px; flex-basis:24px; padding:5px; border-left:0; }

  .release-header,.release-row,.inline-release-row { display:none; }
  .release-table-body { border-top:1px solid var(--line); }
  .phone-release-row { display:flex; min-width:0; flex-direction:column; gap:3px; padding:7px 4px 6px; background:transparent; border-bottom:1px solid var(--line); }
  .phone-release-row:hover { background:var(--hover); }
  .phone-release-row.has-unread { background:var(--panel-highlight); }
  .phone-release-title { display:block; width:100%; height:21px; padding:0; overflow:hidden; color:var(--ink); background:none; border:0; font-size:15.5px; font-weight:600; line-height:21px; text-align:left; text-overflow:ellipsis; white-space:nowrap; }
  .phone-release-title-track { display:inline-block; min-width:100%; white-space:nowrap; transform:translateX(0); }
  .phone-release-title.is-overflowing { text-overflow:ellipsis; }
  .phone-release-title:focus-visible { color:var(--link); outline:1px solid var(--accent); outline-offset:2px; }
  .phone-meta { display:flex; min-width:0; align-items:center; flex-wrap:wrap; gap:0; font-variant-numeric:tabular-nums; }
  .phone-meta span { display:inline-flex; align-items:center; min-width:0; white-space:nowrap; }
  .phone-meta span + span::before { content:"·"; margin:0 6px; color:var(--muted); font-weight:400; }
  .phone-meta-primary { color:var(--ink); font-size:12.5px; }
  .phone-meta-secondary { color:var(--muted); font-size:11.5px; }
  .phone-imdb { color:var(--imdb); font-weight:700; }
  .phone-comments .action-icon { width:12px; height:12px; margin-right:3px; }
  .phone-seeders { color:var(--success); font-weight:700; }
  .phone-leechers { color:var(--error); font-weight:700; }
  .phone-release-bottom { display:flex; min-width:0; align-items:center; justify-content:space-between; gap:4px; min-height:44px; margin-top:-2px; }
  .phone-release-bottom .phone-meta-secondary { flex:1 1 auto; }
  .phone-release-actions { display:flex; flex:0 0 auto; min-height:44px; align-items:center; justify-content:flex-end; gap:0; }
  .phone-release-actions .icon-button { width:44px; height:44px; flex-basis:44px; padding:12px; color:var(--muted); background:transparent; border:0; border-radius:50%; }
  .phone-release-actions .icon-button svg { width:19px; height:19px; }
  .phone-release-actions .icon-button:hover,.phone-release-actions .icon-button:focus-visible { color:var(--accent); background:var(--button-hover); }
  .phone-release-actions .icon-button.active { color:var(--accent); background:var(--panel-highlight); }
  .phone-release-actions .icon-button.danger { color:var(--error); }
  .phone-release-actions .icon-button:active,.mobile-filter-button:active,.mobile-sort-button:active { color:var(--primary-text); background:var(--accent); transform:scale(.94); }

  .phone-tracked-change { display:flex; min-width:0; align-items:center; gap:5px; padding-left:7px; color:var(--accent); border-left:2px solid var(--badge-bg); font-size:11.5px; }
  .phone-tracked-change > span:last-child { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .tracked-change-panel > .tracked-change-current { display:none; }
  .tracked-change-panel:not(.has-history) { display:none; }
  .tracked-change-panel { margin:0; padding:7px 8px 9px 12px; background:var(--subtle-bg); border-width:0 0 1px; border-radius:0; }
  .tracked-history { margin-top:0; }

  .inline-alternatives { margin:0 0 0 8px; padding:0 0 3px 10px; background:var(--subtle-bg); border-width:0 0 1px 2px; border-color:var(--line-strong); }
  .inline-list { border:0; background:transparent; }
  .inline-list .phone-release-row { padding-right:5px; padding-left:5px; }
  .inline-alternatives .results-count { padding:5px 8px 3px 0; }

  .detail-top { padding:12px; }
  .detail-section { padding:12px; }
  .toast { bottom:max(8px,env(safe-area-inset-bottom)); }
}

@media (max-width:600px) and (prefers-reduced-motion:no-preference) {
  .phone-release-title.is-phone-marquee-active { text-overflow:clip; }
  .phone-release-title.is-phone-marquee-active .phone-release-title-track { animation:phone-title-marquee var(--phone-marquee-duration) linear 1 both; }
}
@keyframes phone-title-marquee { 0%,8% { transform:translateX(0); } 92%,100% { transform:translateX(calc(-1 * var(--phone-marquee-distance))); } }
