:root{
  color-scheme:dark;
  --bg:#151820;
  --side:#1b202b;
  --panel:#202632;
  --panel2:#272e3d;
  --line:#353d50;
  --line2:#2c3343;
  --text:#eef1f7;
  --muted:#aeb7c8;
  --red:#bf3f59;
  --red2:#6e3144;
  --green:#7bd4aa;
  --amber:#edbd7f;
}

html,body{background:var(--bg);font-size:16px;line-height:1.5}
body{min-width:320px}
button,input,select,textarea{font-size:1rem}
button{border-radius:10px;min-height:44px;transition:background-color .15s,border-color .15s,transform .15s}
button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,a:focus-visible{outline:3px solid #f1a4b6;outline-offset:3px}
.primary{background:var(--red);border-color:var(--red);border-radius:10px;padding:11px 18px}
.primary:hover{background:#d34b66;border-color:#d34b66}
.reset-link{display:block;margin:14px 0 0;text-align:center;color:#f1a4b6}
.ghost{border-radius:10px;background:#262e3d}
.eyebrow{font-size:.75rem;letter-spacing:.1em;color:#ee96aa;font-family:inherit;font-weight:700}
.hidden{display:none!important}

/* Turn the former sidebar into a compact, persistent top navigation. */
.shell{display:block;min-height:100vh}
.sidebar{position:sticky;inset:auto;top:0;width:auto;height:auto;min-height:72px;padding:0 max(22px,calc((100vw - 1240px)/2));background:#1b202bf5;border:0;border-bottom:1px solid var(--line);display:flex;flex-direction:row;align-items:center;gap:24px;backdrop-filter:blur(14px);z-index:30}
.side-brand{height:auto;padding:0;border:0;font-size:1.4rem;letter-spacing:-.04em;color:var(--text)}
.side-brand b{color:#e7627e}
.side-section,.side-health{display:none}
.nav{display:flex;align-items:center;gap:5px}
.nav:first-of-type{flex:1}
.nav button{width:auto;border:0;border-radius:10px;padding:10px 15px;color:var(--muted);font-size:.9rem}
.nav button:hover{background:#2a3241}
.nav button.active{background:#412836;border:0;color:#ffdbe3}
.nav [data-view="tv"],.nav [data-view="movie"]{display:none}
.nav:last-of-type button{font-size:.82rem;padding-inline:12px}
.workspace{min-width:0}
.topbar{position:relative;top:auto;height:auto;min-height:58px;padding:10px max(22px,calc((100vw - 1240px)/2));background:#181c25;border-bottom:1px solid var(--line);display:flex;gap:18px;justify-content:flex-start;flex-wrap:wrap}
.top-title{display:none}
.service-pill{margin:0;color:var(--green);font-size:.78rem;font-family:inherit}
.user{margin-left:auto;font-size:.78rem;gap:18px}
.capacity{font-size:.75rem;border:0;background:#272e3b;border-radius:8px;padding:8px 12px}
.content{max-width:1240px;margin:auto;padding:0 24px 72px}
.tabs{height:auto;min-height:54px;padding:8px 0;border-bottom:1px solid var(--line);align-items:center;gap:5px}
.tabs:before{content:'Browse your library';color:var(--muted);font-size:.76rem;margin-right:7px}
.tabs button{padding:8px 13px;border:1px solid transparent;border-radius:999px;font-size:.82rem;color:var(--muted)}
.tabs button:hover,.tabs button.active{background:#293142;border-color:#414a60;color:#fff}
.tabs [data-tab="discover"],.tabs [data-tab="mine"],.tabs [data-support-tab]{display:none!important}
.help-open{margin-left:auto!important;padding:8px 13px!important;border:1px solid var(--line)!important;border-radius:999px!important}
.low{border:1px solid #8c5260;background:#3b252f;color:#ffd6df;border-radius:12px;padding:14px;margin-top:18px}

.discover-head{padding:44px 0 20px}
.discover-head h1{font-size:clamp(2rem,5vw,3.15rem);line-height:1.1;letter-spacing:-.045em;font-weight:650;margin:7px 0 13px}
.discover-head p{font-size:1rem;color:var(--muted);max-width:680px}
.discover-search{display:grid;grid-template-columns:1fr auto;gap:9px;padding:10px;background:var(--panel);border:1px solid var(--line);border-radius:16px;box-shadow:0 12px 32px #05070b22}
.types{grid-column:1/-1;display:flex;gap:7px;flex-wrap:wrap}
.types button{border:1px solid var(--line);border-radius:999px;padding:7px 15px;color:var(--muted);font-size:.86rem;min-height:38px}
.types button.active{background:#48536b;border-color:#62708d;color:#fff}
.discover-search input{border:0;border-radius:10px;background:#181d27;padding:13px 16px;font-size:1.08rem;min-width:0;color:var(--text)}
.search-input-wrap{position:relative;min-width:0}
.search-input-wrap input{display:block;width:100%;padding-right:50px}
.query-clear{position:absolute;right:7px;top:50%;transform:translateY(-50%);width:36px;height:36px;min-height:36px;padding:0;border:0;border-radius:50%;background:transparent;color:var(--muted);font-size:1.55rem;line-height:1}
.query-clear:hover{background:#303849;color:#fff}
.statusline{margin:14px 2px 20px;font-size:.78rem}
.results{grid-template-columns:repeat(4,minmax(0,1fr));gap:22px}
.media-card{display:block;padding:0;background:transparent;border:0;min-height:0}
.media-card>div:first-child{height:310px;border-radius:15px;overflow:hidden;background:#252c38}
.media-card img,.media-card .mini-poster{display:block;width:100%;height:100%;object-fit:cover;border:0;border-radius:15px;transition:transform .25s}
.media-card:hover img{transform:scale(1.025)}
.media-card>div:last-child{padding:14px 2px 0}
.media-card h3{font-size:1.05rem;line-height:1.25;margin:0 0 4px}
.media-card .meta{font-size:.72rem;font-family:inherit;letter-spacing:.04em}
.media-card .rating{font-size:.8rem}
.overview{font-size:.82rem;-webkit-line-clamp:2;min-height:2.45em}
.media-card .card-action{width:100%;margin-top:10px;border-color:#654052;background:#31232d;color:#f4a8b9;border-radius:10px}
.media-card .card-action:hover{background:#472d3a;border-color:#976077}
.media-card .exists{color:#a9e3c9;border-color:#396452;background:#21372f}
.empty{font-size:.9rem;border:1px dashed var(--line);border-radius:14px;background:#1e2430;padding:38px}

/* A centered title workspace makes long TV choices easier to scan and edit. */
.drawer-backdrop{display:grid;place-items:center;padding:18px;background:#07090db8;backdrop-filter:blur(3px)}
.drawer{position:relative;inset:auto;width:min(980px,100%);max-height:94vh;border:1px solid var(--line);border-radius:20px;background:var(--bg);box-shadow:0 30px 100px #0008;padding:0;overflow:auto}
.drawer-close{position:sticky;float:right;right:18px;top:16px;width:44px;height:44px;border:1px solid var(--line);border-radius:50%;background:#272f3e;color:#fff;z-index:4}
#drawer-content{padding:28px}
.detail-top{grid-template-columns:180px 1fr;gap:25px;padding-right:42px}
.detail-poster{width:180px;height:270px;border-radius:14px;border:0}
.detail-title{font-size:2rem;letter-spacing:-.035em}
.detail-copy{font-size:.95rem;line-height:1.65;color:#c4ccda}
.badge{border-radius:7px;background:#293242}
.badge.active{background:#3f3240;color:#ffd8e0}
.badge.complete{background:#203a34;color:#b6f3d6}
.badge.attention{background:#4a2b31;color:#ffd1d8}
.badge.unknown{background:#303745;color:#d7dde8}
.season{border-radius:12px;overflow:hidden;background:var(--panel);margin-top:10px}
.season-head{padding:14px 16px;background:var(--panel2);font-size:.9rem}
.episode{grid-template-columns:24px 76px 1fr auto;min-height:48px;padding:9px 16px;font-size:.85rem}
.episode small{font-size:.72rem}
.episode.downloaded{opacity:1;color:#8993a6}
.episode.requested{color:#c1b4d8}
.episode-tools{gap:8px}
.episode-tools button{border-radius:9px;background:#252d3b}
.request-selected{min-height:50px;font-size:1rem}
.removal-box{border-radius:12px;background:#2d2027}

.tv-quick-selection{padding:20px;border-radius:14px;background:var(--panel);margin:0 0 18px}
.tv-quick-selection h3{font-size:1.25rem;margin-bottom:6px}
.tv-quick-selection p{font-size:.88rem;color:var(--muted)}
.tv-quick-selection .tv-selection-summary{color:#ffc1cf;font-weight:650}
.tv-quick-selection select{border-radius:9px;background:#293142}
.tv-scope-note{border:1px solid #4e5970;border-radius:10px;padding:12px;background:#272e3d;color:#c5cedd;font-size:.8rem}

.request-review-dialog{width:min(720px,calc(100% - 28px));max-height:90vh;border:1px solid var(--line);border-radius:18px;background:var(--bg);color:var(--text);padding:0;box-shadow:0 30px 100px #0009}
.request-review-dialog::backdrop{background:#07090dba;backdrop-filter:blur(3px)}
.request-review-head,.request-review-actions{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:20px 24px;background:var(--panel);border-bottom:1px solid var(--line)}
.request-review-head h2{margin:3px 0 0}
.request-review-body{padding:22px 24px;overflow:auto}
.request-review-actions{border:0;border-top:1px solid var(--line)}
.request-review-list{line-height:1.8;color:#d5dbea}
.request-review-note{padding:13px;border-radius:10px;background:#3c322b;color:#ebd4b7;font-size:.84rem}

.download-panel,.issue-panel,.support-chat-panel,.support-guide,.support-history,.agent-panel,.admin-conversations{border-radius:16px;background:var(--panel)}
.download-panel{padding:22px}
.download-row{border-radius:10px;background:#272e3b;margin-top:8px;padding:14px}
.download-track{border-radius:999px;overflow:hidden}
.download-track span{background:linear-gradient(90deg,#b63b55,#ef718b)}
.request-card{margin-bottom:12px}
.request-progress{grid-template-columns:repeat(2,minmax(0,1fr));padding:14px}
.request-state{border-radius:8px;background:#272e3b}
.history-tools{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 18px}
.history-tools button{border-radius:999px;font-size:.82rem;background:#252d3a}
.history-tools button.active{background:#48536b;border-color:#697795;color:#fff}

.support-layout{gap:20px}
.support-chat{background:#1a1f2a}
.chat-message{border-radius:5px 15px 15px 15px;background:#2a3446}
.chat-message.user{border-radius:15px 5px 15px 15px;background:#432c3d}
.support-compose textarea,.help-other textarea,.admin-message{border-radius:10px;background:#181d27;font-size:1rem}
.guide-item,.conversation-card,.issue-card{border-radius:10px;background:#272e3a}
.support-prompts{display:grid;gap:8px;margin:14px 0 20px}
.support-prompt{text-align:left;background:#272f3f;color:#dbe2ee}
.guide-note{border-radius:10px;background:#3c322b}
.toast{border-radius:12px;bottom:22px;right:22px;background:#e7ecf5!important;color:#192231!important;border:0!important;box-shadow:0 14px 40px #0006;font-size:.88rem}

.library{border-collapse:separate;border-spacing:0;background:var(--panel);border-radius:14px;overflow:hidden}
.library th{top:0;background:#272e3b;padding:13px;font-size:.72rem}
.library td{padding:10px 13px}
.library tr:hover{background:#29303d}
.toolbar{padding-top:25px}
.toolbar select,.searchbox input{border-radius:9px;background:#202632}

@media(max-width:980px){
  .results{grid-template-columns:repeat(3,minmax(0,1fr))}
  .sidebar{padding:10px 18px;gap:14px;flex-wrap:wrap}
  .nav:first-of-type{order:3;flex-basis:100%;overflow:auto}
  .nav button{white-space:nowrap}
}
@media(max-width:720px){
  .results{grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
  .media-card>div:first-child{height:260px}
  .content{padding:0 16px 56px}
  .topbar{padding:10px 16px;align-items:flex-start}
  .user{width:100%;margin:0;justify-content:space-between}
  .tabs:before{display:none}
  .discover-head{padding-top:30px}
  .detail-top{grid-template-columns:105px 1fr;gap:15px}
  .detail-poster{width:105px;height:158px}
  .detail-title{font-size:1.45rem}
  #drawer-content{padding:18px}
  .request-progress{grid-template-columns:1fr}
}
@media(max-width:450px){
  .side-brand{font-size:1.18rem}
  .nav button{padding:9px 11px;font-size:.82rem}
  .results{gap:13px}
  .media-card>div:first-child{height:220px}
  .media-card h3{font-size:.95rem}
  .discover-search{grid-template-columns:1fr}
  .discover-search .primary{width:100%}
  .detail-top{grid-template-columns:82px 1fr}
  .detail-poster{width:82px;height:123px}
  .episode{grid-template-columns:22px 62px 1fr;gap:6px;padding:10px}
  .episode small{grid-column:3}
  .request-review-actions{align-items:stretch;flex-direction:column-reverse}
  .request-review-actions button{width:100%}
}
