/* Teleseerr cinema library: warm neutrals, one amber action color. */
:root {
  color-scheme: dark;
  --background: #111213;
  --foreground: #f6f3ed;
  --card: #1b1c1e;
  --card-foreground: #f6f3ed;
  --muted: #252628;
  --muted-foreground: #aaa9a5;
  --primary: #f2bd63;
  --primary-foreground: #20190f;
  --accent: #2c2922;
  --accent-foreground: #f6f3ed;
  --border: #333437;
  --input: #393a3d;
  --ring: #f2bd63;
  --link: #f2bd63;
  --destructive: #f49a93;
  --radius: 12px;
}
:root[data-theme="light"] { color-scheme: light; --background: #f7f6f2; --foreground: #202122; --card: #ffffff; --card-foreground: #202122; --muted: #ebeae5; --muted-foreground: #62625e; --primary: #8b5a09; --primary-foreground: #ffffff; --accent: #f0e3c8; --accent-foreground: #202122; --border: #d9d8d2; --input: #cecdc6; --ring: #8b5a09; --link: #8b5a09; --destructive: #ac302d; }
body { line-height: 1.5; }
button, input, select { font: inherit; }
button { touch-action: manipulation; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible { outline: 2px solid var(--ring); outline-offset: 4px; }
a { color: var(--link); text-underline-offset: 3px; }
[hidden] { display: none !important; }
#app { max-width: 480px; padding: 0 0 calc(108px + env(safe-area-inset-bottom)); }
.top-bar { display: block; position: relative; padding: 14px 20px 0; background: var(--background); }
.browse-header { padding: 0 20px; }
.masthead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.brand { display: inline-flex; gap: 10px; align-items: center; text-decoration: none; color: var(--foreground); font-size: 25px; font-weight: 750; letter-spacing: -.8px; }
.brand-mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: #f2bd63; color: #20190f; }
.profile-btn { width: 44px; height: 44px; border: 0; border-radius: 50%; color: var(--foreground); }
.discovery-intro { margin: 0 0 16px; }
.discovery-intro h1 { font-size: clamp(25px, 6.5vw, 30px); line-height: 1.15; letter-spacing: -.9px; font-weight: 730; }
.discovery-intro p { margin-top: 8px; color: var(--muted-foreground); font-size: 14px; }
.search-bar { display: flex; gap: 10px; align-items: center; padding: 0 14px; height: 48px; border: 1px solid var(--border); border-radius: 12px; background: var(--muted); color: var(--muted-foreground); }
.search-bar input { border: 0; background: none; border-radius: 0; min-width: 0; padding: 12px 0; font-size: 15px; color: var(--foreground); }
.search-bar:focus-within { outline: 2px solid var(--ring); outline-offset: 2px; }
.search-bar input:focus-visible { outline: 0; }
.browse-tabs { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); margin-top: 18px; border-bottom: 1px solid var(--border); }
.browse-tab { border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 10px 4px; font-size: 14px; font-weight: 500; min-height: 44px; }
.browse-tab.active { background: none; color: var(--foreground); border-bottom-color: var(--primary); font-weight: 700; }
.primary-nav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); z-index: 30; width: min(100%,480px); padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); background: var(--background); border-top: 1px solid var(--border); display: flex; gap: 0; overflow: visible; }
.primary-nav .tab { transition: color 120ms ease-out, border-color 120ms ease-out; text-decoration: none; flex: 1; min-width: 0; min-height: 55px; padding: 5px 3px; border: 0; border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted-foreground); font-size: 11px; font-weight: 600; background: none; }
.primary-nav .tab svg { display: block; width: 23px; height: 23px; }
.primary-nav .tab.active { color: var(--primary); background: none; }
body:not([data-screen="trending"]) .discovery-intro { display: none; }
body:is([data-screen="detail"],[data-screen="admin"],[data-screen="profile"],[data-screen="requests"]) .browse-tabs { display: none; }
body:is([data-screen="admin"],[data-screen="profile"],[data-screen="requests"]) .search-bar { display: none; }
body:not([data-screen="trending"]) .masthead { margin-bottom: 12px; }
body[data-screen="detail"] .search-bar { display: none; }
#trending-view { padding-top: 24px; }
.slider-section { margin-bottom: 27px; }
.slider-header { padding: 0 20px 12px; }
.slider-title { font-size: 20px; font-weight: 700; letter-spacing: -.45px; }
.slider-row { align-items: flex-start; padding: 0 20px 6px; gap: 12px; scroll-padding-left: 20px; }
.slider-card { width: 126px; padding: 0; border: 0; background: none; color: var(--foreground); text-align: left; font: inherit; }
.slider-card-poster { width: 100%; height: 186px; border-radius: 10px; }
.slider-card-img-wrap { border-radius: 10px; }
.slider-card-title { font-size: 13px; font-weight: 600; line-height: 1.3; margin-top: 8px; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.slider-card-sub { font-size: 12px; margin-top: 3px; color: var(--muted-foreground); }
.badge, .slider-card .badge { font-size: 10px; line-height: 1.4; font-weight: 600; padding: 4px 7px; border-radius: 6px; background: #242c27; color: #b4dfbc; border: 1px solid #516254; }
.badge-requested { background: #3d321f; color: #f3d39b; border-color: #705a34; }
.badge-downloading, .badge-approved { background: #2d2b23; color: #f4d295; border-color: #705a34; }
.badge-declined { color: #efb3ad; background: #3a2523; border-color: #74504c; }
/* Browse controls form separate rows with the same gutter as the posters. */
:is(#movies-view, #tv-view, #anime-view) { padding-top: 24px; }
.filter-bar { gap: 10px; padding: 0 20px; margin-bottom: 18px; }
.filter-btn { min-height: 44px; padding: 8px 14px; gap: 6px; font-size: 13px; }
.genre-chips { gap: 10px; padding: 0 20px; margin-bottom: 24px; }
:is(#movies-view, #tv-view, #anime-view) .media-grid { padding-top: 0; column-gap: 16px; row-gap: 24px; }
.media-grid { padding: 18px 20px; gap: 18px 12px; grid-template-columns: repeat(3,minmax(0,1fr)); }
.media-card { padding: 0; border: 0; background: var(--card); color: var(--foreground); text-align: left; font: inherit; }
.card-title { font-size: 12px; }
.page-heading { padding: 14px 0 24px; }
.page-heading h1 { font-size: 31px; font-weight: 720; letter-spacing: -.8px; line-height: 1.15; }
.page-heading > p:last-child { color: var(--muted-foreground); font-size: 14px; margin-top: 8px; }
.section-kicker { font-size: 11px; text-transform: uppercase; letter-spacing: 1.4px; color: var(--primary); font-weight: 600; margin-bottom: 8px; }
#admin-view, #requests-view, #profile-view { padding: 0 20px; }
.people-tools { display: flex; gap: 16px; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.people-search { display: flex; align-items: center; gap: 8px; width: min(55%,230px); color: var(--muted-foreground); }
.people-search input { background: none; border: 0; color: var(--foreground); width: 100%; min-width: 0; font-size: 14px; height: 44px; }
.text-link { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; white-space: nowrap; text-decoration: none; }
.admin-section { margin: 0 0 28px; padding: 0; }
.admin-section-title { color: var(--foreground); font-size: 15px; font-weight: 650; text-transform: none; letter-spacing: 0; margin-bottom: 5px; }
#admin-user-count { display: inline-flex; justify-content: center; align-items: center; margin-left: 6px; width: 22px; height: 22px; border-radius: 6px; background: var(--muted); color: var(--muted-foreground); font-size: 11px; }
.section-description { font-size: 12px; color: var(--muted-foreground); margin-bottom: 17px; }
.admin-user-row { display: block; padding: 16px; margin: 0 0 10px; border: 1px solid var(--border); border-radius: 14px; background: var(--card); }
.person-identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.person-avatar { display: grid; place-items: center; width: 38px; height: 38px; flex-shrink: 0; border-radius: 50%; background: var(--muted); color: var(--foreground); font-size: 15px; font-weight: 600; }
.admin-user-info { flex: 1; min-width: 0; gap: 2px; }
.person-name { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; text-transform: capitalize; color: var(--foreground); font-size: 15px; font-weight: 600; }
.owner-label { color: var(--primary); font-size: 10px; font-weight: 500; border: 1px solid var(--border); padding: 1px 5px; border-radius: 4px; text-transform: none; }
.admin-user-seerr { font-size: 12px; color: var(--muted-foreground); overflow-wrap: anywhere; }
.person-permissions { margin-top: 15px; padding-top: 13px; border-top: 1px solid var(--border); display: flex; gap: 14px; align-items: center; justify-content: space-between; }
.permission-title, .permission-description { display: block; }
.permission-title { font-size: 13px; font-weight: 550; }
.permission-description { margin-top: 2px; font-size: 11px; line-height: 1.5; color: var(--muted-foreground); }
.permission-switch { position: relative; width: 48px; height: 44px; flex-shrink: 0; cursor: pointer; display: grid; place-items: center; }
.permission-switch input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; margin: 0; z-index: 1; }
.permission-switch > span { display: block; position: relative; width: 40px; height: 24px; border: 1px solid var(--input); border-radius: 99px; background: var(--muted); }
.permission-switch > span::after { content: ""; display: block; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted-foreground); transition: transform 130ms ease-out; }
.permission-switch input:checked + span { background: var(--primary); border-color: var(--primary); }
.permission-switch input:checked + span::after { transform: translateX(16px); background: var(--primary-foreground); }
.permission-switch input:disabled { cursor: default; }
.permission-switch input:disabled + span { opacity: .55; }
.permission-switch input:focus-visible + span { outline: 2px solid var(--ring); outline-offset: 4px; }
.person-details { margin-top: 10px; }
.person-details summary { cursor: pointer; color: var(--muted-foreground); font-size: 11px; min-height: 32px; display: flex; align-items: center; gap: 5px; }
.person-details summary::before { content: "+"; font-size: 15px; }
.person-details[open] summary::before { content: "−"; }
.person-account { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; padding: 8px 0 0; font-size: 11px; color: var(--muted-foreground); }
.person-account code { color: var(--foreground); font: inherit; font-variant-numeric: tabular-nums; }
.admin-unlink-btn { border: 0; padding: 6px 0; min-height: 32px; display: inline-flex; align-items: center; gap: 6px; font-size: 11px; }
.admin-add-person { border-top: 1px solid var(--border); padding-top: 16px; }
.admin-add-person > summary { cursor: pointer; font-size: 15px; font-weight: 600; min-height: 44px; }
.admin-link-form { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; }
.admin-field { font-size: 12px; color: var(--muted-foreground); }
.admin-input { display: block; width: 100%; margin-top: 6px; min-height: 44px; font-size: 16px; }
.admin-btn { min-height: 44px; background: var(--primary); color: var(--primary-foreground); border-radius: 8px; }
.request-list { display: grid; gap: 12px; }
.request-item { margin: 0; background: var(--card); border: 1px solid var(--border); padding: 12px; border-radius: 12px; gap: 14px; }
.request-title { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 14px; }
.request-poster { width: 56px; height: 84px; border-radius: 6px; }
.request-meta { gap: 7px; }
.request-date { color: var(--muted-foreground); font-size: 11px; }
.quick-btn, .back-btn, .detail-link, .genre-chip, .load-more { min-height: 44px; border-radius: 8px; }
.quick-btn.primary, .request-bar button { background: var(--primary); color: var(--primary-foreground); }
.quick-btn.secondary { background: var(--muted); border-color: transparent; }
.request-bar { bottom: calc(73px + env(safe-area-inset-bottom)); padding: 12px 20px; border-top: 1px solid var(--border); background: var(--background); }
.detail-status { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.detail-title { font-size: 25px; letter-spacing: -.6px; }
.detail-overview { font-size: 14px; line-height: 1.7; color: var(--muted-foreground); }
.download-management { margin: 20px 16px; }
.episode-section-header .detail-section-title { color: var(--foreground); font-size: 18px; text-transform: none; letter-spacing: -.3px; }
.episode-overview { font-size: 12px; color: var(--muted-foreground); margin: 12px 0; }
.episode-overview strong { font-weight: 500; }
.episode-season { border: 1px solid var(--border); background: var(--card); border-radius: 12px; margin-top: 10px; }
.episode-season summary { font-size: 15px; padding: 15px; }
.season-status { font-size: 10px; border-radius: 5px; }
.season-status-downloading { background: #3d321f; color: #f3d39b; }
.episode-heading { font-size: 13px; }
.episode-row { padding: 16px; }
.episode-row > p { font-size: 11px; color: var(--muted-foreground); margin-top: 5px; }
.episode-state-available { color: #a2dcb1; }
.episode-state-missing, .episode-state-failed, .episode-state-attention { color: #f3d39b; }
.season-recovery { font-size: 12px; }
.season-recovery button { margin-top: 8px; }
.release-card { background: var(--card); border-radius: 10px; padding: 14px; border: 1px solid var(--border); }
.release-card strong { overflow-wrap: anywhere; }
.release-card p { font-size: 12px; color: var(--muted-foreground); margin: 5px 0; }
.download-summary-active, .download-status-importing { color: var(--primary); }
.download-progress { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.empty { font-size: 14px; color: var(--muted-foreground); padding: 30px 20px; }
.toast { bottom: calc(100px + env(safe-area-inset-bottom)); background: var(--foreground); color: var(--background); border: 0; border-radius: 10px; max-width: calc(100vw - 40px); }
.spinner { border-top-color: var(--primary); }
@media (min-width: 900px) {
  #app { max-width: 1440px; padding: 0 28px 60px; }
  .top-bar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 16px 20px; margin-bottom: 24px; border-bottom: 1px solid var(--border); background: var(--background); }
  .top-bar .profile-btn { display: none; }
  .primary-nav { position: static; top: auto; bottom: auto; left: auto; right: auto; transform: none; width: auto; margin: 0; padding: 0; border: 0; background: var(--background); gap: 8px; }
  .primary-nav .tab { flex: 0 1 auto; min-height: 44px; padding: 8px 18px; flex-direction: row; gap: 8px; font-size: 14px; color: var(--foreground); border-radius: 0; border-bottom: 2px solid transparent; }
  .primary-nav .tab.active { color: var(--primary); background: none; border-bottom-color: var(--primary); }
  body .top-bar .masthead { margin-bottom: 0; }
  .discovery-intro h1 { font-size: 38px; }
  .discovery-intro p { font-size: 16px; }
  .search-bar { width: 100%; max-width: none; }
  .browse-tabs { width: 100%; max-width: none; }
  .slider-card { width: 155px; }
  .slider-card-poster { height: 228px; }
  .media-grid { grid-template-columns: repeat(6,minmax(0,1fr)); }
  #admin-view { max-width: 820px; margin: 0 auto; }
  #admin-users-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
  .admin-user-row { margin: 0; }
  .page-heading { padding-top: 30px; }
  .request-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .request-bar { bottom: 0; }
  .detail-backdrop { height: 340px; border-radius: 16px; }
  .detail-overview { max-width: 760px; }
}
@media (max-width: 359px) {
  .top-bar, .browse-header, #admin-view, #requests-view, #profile-view { padding-left: 14px; padding-right: 14px; }
  .discovery-intro h1 { font-size: 24px; }
  .filter-bar, .genre-chips, :is(#movies-view, #tv-view, #anime-view) .media-grid { padding-left: 14px; padding-right: 14px; }
  .search-bar input { font-size: 13px; }
  .people-tools { gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

.request-bar { display: flex; align-items: center; gap: 12px; }
.request-bar button { flex: 1; width: auto; margin: 0; min-height: 48px; }
.request-bar-4k { display: flex; align-items: center; gap: 6px; margin: 0; padding: 0; min-height: 44px; font-size: 13px; }
.request-bar-4k input { accent-color: var(--primary); width: 18px; height: 18px; }
.detail-status svg, .pill svg { vertical-align: middle; }
.card-rating { display: inline-flex; gap: 3px; align-items: center; }
:root[data-theme="light"] .episode-state-available { color: #246b35; }
:root[data-theme="light"] .episode-state-missing, :root[data-theme="light"] .episode-state-failed, :root[data-theme="light"] .episode-state-attention { color: #80570f; }
:root[data-theme="light"] .download-status-available, :root[data-theme="light"] .download-summary-available { color: #246b35; }
:root[data-theme="light"] .download-summary-attention, :root[data-theme="light"] .download-status-failed, :root[data-theme="light"] .download-status-stalled { color: #80570f; }
.people-search input::placeholder { color: var(--muted-foreground); opacity: 1; }
.text-link, .brand { min-height: 44px; }
.person-details summary, .admin-unlink-btn { min-height: 44px; }
.admin-pending-actions button, .seerr-user-row button { min-height: 44px; }
.request-list { padding: 0; }

/* Troubleshooting keeps details secondary and actions close to their context. */
.support-dialog { width:min(620px,calc(100vw - 24px)); max-height:90dvh; padding:24px; color:var(--text,#f6f3ed); background:var(--bg,#17191b); border:1px solid #ffffff20; border-radius:24px; box-shadow:0 24px 100px #0009; }
.support-dialog::backdrop { background:#0009; backdrop-filter:blur(5px); }
.support-dialog header { display:flex; justify-content:space-between; align-items:center; gap:16px; margin-bottom:24px; }
.support-dialog h2 { margin:0; font-size:28px; }
.support-dialog h3 { margin:0 0 10px; }
.support-dialog p { line-height:1.55; overflow-wrap:anywhere; }
.support-dialog label { display:grid; gap:8px; margin:18px 0; font-size:14px; }
.support-dialog input,.support-dialog select,.support-dialog textarea { width:100%; box-sizing:border-box; background:#ffffff09; color:inherit; border:1px solid #8886; border-radius:12px; padding:12px; font:inherit; }
.support-dialog select option { color:#161719; }
.support-library { padding:18px; margin:14px 0; border:1px solid #8884; border-radius:16px; }
.support-transfer { border-top:1px solid #8883; margin-top:12px; padding-top:12px; }
.support-muted { color:var(--text-secondary,#aaa); font-size:13px; }
.support-dialog button { margin:4px 4px 4px 0; min-height:44px; }
.support-preferences { margin-top:24px; }
.help-entry { display:flex; gap:8px; flex-wrap:wrap; margin:18px 0; }
.request-management { display:flex; gap:8px; flex-wrap:wrap; margin-top:12px; }
.request-item { flex-wrap:wrap; }
.report-state { color:#f2bd63; text-transform:capitalize; }
.service-banner { display:block; width:100%; border:0; padding:12px 20px; background:#59431d; color:#ffe0a3; text-align:center; font:inherit; cursor:pointer; }
.support-dialog .pending-season { display:flex; align-items:center; gap:12px; }
.support-dialog .pending-season input { width:22px; height:22px; accent-color:#f2bd63; }

/* Shared responsive surfaces: titles, dialogs, detail actions and intermediate widths. */
.media-card { aspect-ratio: auto; overflow: visible; background: transparent; align-self: start; min-width: 0; }
.media-card-artwork { position: relative; aspect-ratio: 2/3; overflow: hidden; border-radius: 10px; background: var(--muted); }
.media-card-artwork img { height: 100%; }
.poster-placeholder { display: grid; place-items: center; height: 100%; color: var(--muted-foreground); }
.media-card .card-title { position: static; padding: 8px 0 0; background: none; color: var(--foreground); font-size: 13px; line-height: 1.4; min-height: calc(2.8em + 8px); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.card-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 4px; font-size: 12px; color: var(--muted-foreground); }
.card-meta .card-rating { color: inherit; }
.badge.badge-requested { background: #3d321f; color: #f3d39b; border-color: #705a34; }
.badge.badge-downloading, .badge.badge-approved { background: #2d2b23; color: #f4d295; border-color: #705a34; }
.badge.badge-declined { color: #efb3ad; background: #3a2523; border-color: #74504c; }
.profile-card { margin: 16px 0; }
.profile-header > div:last-child, .person-info { min-width: 0; }
.profile-name, .profile-id, .detail-title, .person-name { overflow-wrap: anywhere; }
.request-item { align-items: flex-start; flex-wrap: nowrap; }
.request-info { min-width: 0; }
.request-title { color: var(--foreground); text-decoration: none; overflow-wrap: anywhere; }
.request-title:hover { text-decoration: underline; }
.request-title svg { flex-shrink: 0; }
.request-management button { max-width: 100%; white-space: normal; }
.person-info .person-name { font-size: clamp(24px,3vw,36px); line-height: 1.2; }
.cast-card { padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: center; }
.detail-status, #detail-view > .help-entry { margin-left: 16px; margin-right: 16px; }
.request-bar { left: 50%; right: auto; transform: translateX(-50%); width: min(100%,480px); }
.request-bar button { max-width: none; white-space: normal; overflow-wrap: anywhere; }
body:has(#request-bar) #app { padding-bottom: calc(190px + env(safe-area-inset-bottom)); }
.support-dialog { width: min(680px,calc(100vw - 24px)); max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); margin: auto; color: var(--foreground); background: var(--card); border-color: var(--border); overflow-wrap: anywhere; }
.support-dialog header { position: sticky; top: -24px; z-index: 1; padding: 12px 0; margin-top: -12px; background: var(--card); }
.support-dialog header > div { min-width: 0; }
.support-dialog header > button { flex: 0 0 44px; width: 44px; height: 44px; padding: 0; margin: 0; }
.support-dialog h2 { font-size: clamp(22px,4vw,28px); line-height: 1.2; }
.support-dialog input, .support-dialog select, .support-dialog textarea { font-size: 16px; background: var(--muted); color: var(--foreground); border-color: var(--input); }
.support-dialog select option { color: var(--foreground); background: var(--card); }
.support-muted { color: var(--muted-foreground); }
.support-dialog summary { min-height: 44px; padding: 8px 0; cursor: pointer; }
.report-state { color: var(--primary); }
.filter-dropdown { top: auto; width: min(100%,560px); max-width: 100vw; max-height: calc(100dvh - 16px); margin: 0 auto; color: var(--foreground); border: 1px solid var(--border); }
.filter-dropdown::backdrop { background: #0008; }
.filter-dialog-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; }
.filter-dialog-header h2 { margin: 0; font-size: 20px; }
.filter-dialog-header button { flex-shrink: 0; min-width: 44px; padding: 0; }
.filter-range-row input { min-width: 0; width: 100%; font-size: 16px; min-height: 44px; }
.filter-select, .filter-actions button { min-height: 44px; font-size: 16px; }
@media (max-width: 599px) {
  .search-bar input { font-size: 16px; }
  .support-dialog { padding: 16px; border-radius: 18px; }
  .support-dialog header { top: -16px; }
  .support-library { padding: 14px; }
}
@media (max-width: 359px) {
  .media-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .detail-poster { width: 88px; height: 132px; }
  .detail-title { font-size: 23px; }
}
@media (min-width: 600px) and (max-width: 899px) {
  #app { max-width: 900px; padding-left: 20px; padding-right: 20px; }
  .primary-nav, .request-bar { width: min(100%,900px); }
  .media-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .request-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (min-width: 600px) {
  .media-card .card-title { font-size: 14px; }
  .filter-dropdown { inset: 0; margin: auto; max-width: calc(100vw - 48px); max-height: min(680px,calc(100dvh - 48px)); border-radius: 18px; padding: 24px; animation: none; }
}
@media (min-width: 900px) {
  .request-bar { width: min(calc(100% - 56px),1384px); }
  body:has(#request-bar) #app { padding-bottom: 120px; }
  #profile-view { max-width: 720px; margin: 0 auto; }
  .detail-poster { width: 160px; height: 240px; }
  .detail-poster-row { gap: 24px; }
  .detail-title { font-size: 36px; }
  .detail-meta, .detail-genre-tags, .detail-status, .detail-links, .detail-credits { font-size: 14px; }
  .episode-heading { flex-direction: row; align-items: baseline; justify-content: space-between; gap: 20px; }
  .episode-heading strong { flex: 1; min-width: 0; }
  .episode-state { flex-shrink: 0; }
  .episode-row { font-size: 14px; }
}
body:has(dialog[open]) { overflow: hidden; }
.service-banner { width: auto; margin: 0 20px 20px; border-radius: 10px; }
#detail-view > :is(.detail-poster-row,.detail-tagline,.detail-meta,.detail-genres,.detail-links,.detail-overview,.detail-section), #detail-view > .cast-grid { padding-left: 20px; padding-right: 20px; }
#detail-view > :is(.detail-status,.help-entry) { margin-left: 20px; margin-right: 20px; }
.download-management { margin-left: 20px; margin-right: 20px; }
@media (max-width: 359px) {
  .service-banner, .download-management, #detail-view > :is(.detail-status,.help-entry) { margin-left: 14px; margin-right: 14px; }
  #detail-view > :is(.detail-poster-row,.detail-tagline,.detail-meta,.detail-genres,.detail-links,.detail-overview,.detail-section), #detail-view > .cast-grid { padding-left: 14px; padding-right: 14px; }
}
.support-dialog .pending-season { min-height: 44px; margin: 8px 0; }
.support-dialog input[type="checkbox"] { padding: 0; }

.download-progress > summary { min-height: 48px; cursor: pointer; }
@media (min-width: 900px) { html { scrollbar-gutter: stable; } }
/* Keep one document scroller so route restoration and fixed actions agree. */
html { height: auto; min-height: 100%; overflow-x: clip; }
body { height: auto; min-height: 100dvh; overflow-x: clip; }
html:has(dialog[open]) { overflow: hidden; }
body:is([data-screen="login"],[data-screen="unlinked"]) .browse-header { display: none; }
body:is([data-screen="login"],[data-screen="unlinked"]) #app { padding: 0; }
.unlinked-screen { min-height: 100dvh; max-width: 600px; margin: 0 auto; }
@media (min-width: 900px) { .genre-chips { flex-wrap: wrap; overflow: visible; } }
input::placeholder, textarea::placeholder { color: var(--muted-foreground); opacity: 1; }

/* Wide screens keep the same alignment while making room for more titles. */
@media (min-width: 1200px) {
  .media-grid { grid-template-columns: repeat(auto-fill,minmax(155px,1fr)); }
  .slider-card { width: 172px; }
  .slider-card-poster { height: 258px; }
}
.rail-controls { display: none; align-items: center; gap: 8px; }
.rail-controls[hidden] { display: none; }
@media (min-width: 900px) {
  .rail-controls:not([hidden]) { display: flex; }
  .rail-controls button { width: 44px; height: 44px; border: 1px solid var(--border); border-radius: 50%; color: var(--foreground); background: var(--background); font-size: 22px; cursor: pointer; }
  .rail-controls button:disabled { opacity: .3; cursor: default; }
}
.app-update { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 0 20px 20px; padding: 12px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); color: var(--foreground); }
.app-update button { min-height: 44px; padding: 8px 16px; border: 0; border-radius: 8px; background: var(--foreground); color: var(--background); cursor: pointer; font-weight: 600; }
/* Padding already supplies rail gutters; legacy spacer items offset snap edges. */
.slider-row::before, .slider-row::after { display: none; }
