:root { color-scheme:dark; --background:#090b10; --panel:#12151e; --line:#262c3b; --text:#f0f2f9; --muted:#a5aebe; --accent:#b897ff; }
* { box-sizing:border-box; } [hidden] { display:none!important; }
body { margin:0; background:var(--background); color:var(--text); font:15px/1.5 system-ui,Arial,sans-serif; }
button,input,select { font:inherit; color:inherit; border:1px solid var(--line); border-radius:7px; background:#171b27; padding:9px 12px; }
button { cursor:pointer; background:#a282ee; color:#100b1c; font-weight:650; min-height:40px; }
button:hover { filter:brightness(1.14); } button.secondary { background:#242a39; color:var(--text); }
button:disabled { opacity:.6; cursor:wait; }
button:focus,input:focus,select:focus,video:focus,a:focus { outline:2px solid #e5dcff; outline-offset:2px; }
a { color:inherit; } h1,h2,h3,p { margin:0; } h2 { font-size:1.35rem; letter-spacing:-.025em; }
p { color:var(--muted); } label { display:block; } label input,label select { display:block; width:100%; margin-top:5px; }
input,select { min-width:0; } ul { margin:0; padding:0; list-style:none; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; }
.topbar { display:flex; align-items:center; gap:20px; height:70px; padding:0 25px; background:#0b0d13; border-bottom:1px solid var(--line); }
.brand { display:flex; align-items:center; gap:8px; color:#fff; text-decoration:none; font-size:1.25rem; font-weight:760; letter-spacing:-.05em; }
.brand-logo { display:block; object-fit:contain; }
.brand-symbol { display:flex; align-items:center; justify-content:center; background:var(--accent); color:#130f1e; border-radius:9px; width:31px; height:31px; font-size:24px; }
.topbar h1 { font-size:1.12rem; font-weight:550; padding-left:20px; border-left:1px solid var(--line); }
#device { margin-left:auto; color:var(--muted); font-size:.8rem; } #clock { font-size:.84rem; }
#update { font-size:.8rem; padding:6px 10px; min-height:34px; }
.app-layout { display:flex; min-height:calc(100vh - 70px); background:radial-gradient(ellipse at 80% 15%,#261e3e55,transparent 55%); }
.rail { flex:none; width:104px; padding:18px 10px; border-right:1px solid var(--line); background:#0c0e14; display:flex; flex-direction:column; gap:7px; }
.rail button { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px; min-height:66px; font-size:.74rem; border-color:transparent; background:transparent; color:var(--muted); font-weight:500; }
.rail button span { font-size:23px; line-height:1.25; }
.rail button[aria-pressed="true"] { color:var(--accent); background:#211a31; border-color:#4a385f; }
.workspace { flex:1; min-width:0; padding:23px; }
.alert { background:#351d25; border:1px solid #65404c; color:#ffd4d9; border-radius:7px; padding:9px 12px; margin-bottom:12px; overflow-wrap:break-word; }
.announcement { padding:10px 12px; background:#211d32; border:1px solid #49405e; margin-bottom:12px; border-radius:7px; }
.subtle { color:var(--muted); font-size:.84rem; } .legal { margin-top:22px; max-width:63ch; font-size:.83rem; }
.playlist-layout { display:grid; grid-template-columns:minmax(0,1.4fr) minmax(260px,1fr); gap:36px; align-items:start; padding:4vh 2vw; }
.playlist-layout h2 { margin-bottom:7px; } .source-tiles { display:flex; flex-wrap:wrap; gap:12px; margin:23px 0 12px; }
.source-tile { display:grid; grid-template-columns:1fr auto; align-items:center; min-width:140px; max-width:240px; background:#171b27; border:1px solid #32384a; border-radius:12px; padding:13px; gap:7px; }
.source-tile>button:first-child { grid-column:1/-1; display:grid; justify-items:start; gap:7px; background:transparent; color:var(--text); padding:0; border:0; text-align:left; overflow-wrap:anywhere; }
.source-symbol { display:flex; align-items:center; justify-content:center; width:47px; height:47px; font-size:26px; border-radius:50%; color:var(--accent); background:#2d243f; }
.source-tile small { color:var(--muted); font-size:.71rem; } .source-tile .remove { background:transparent; color:#e6a7ae; border:0; min-height:26px; padding:3px; font-size:.74rem; }
.add-tile { margin:0 0 16px; display:flex; align-items:center; gap:10px; background:#262138; color:#d7c4ff; border:1px dashed #76608f; }
.add-tile span { font-size:24px; } .pair-card { background:#151923; padding:22px; border:1px solid #303749; border-radius:12px; text-align:center; }
.portal-address { background:#242b3a; padding:9px; border-radius:7px; font-size:.9rem; margin:15px 0; overflow-wrap:break-word; color:#e0d1ff; }
#pairing label { display:grid; background:#242b3a; padding:9px; border-radius:7px; margin:12px 0; font-size:.85rem; color:var(--muted); }
#code { color:var(--text); letter-spacing:.1em; font-size:1.4rem; } #qr { border-radius:6px; margin:4px auto 8px; max-width:100%; }
#pair-id { margin-top:12px; overflow-wrap:anywhere; font-size:.7rem; }
.catalog-layout { display:grid; grid-template-columns:190px minmax(200px,.85fr) minmax(280px,1.35fr); gap:13px; align-items:start; }
.categories-panel,.results-panel,.preview-panel { min-width:0; } .categories-panel { padding-right:13px; border-right:1px solid var(--line); }
.source-label { font-size:.76rem; color:var(--muted); margin-bottom:13px; } .categories-panel input { width:100%; font-size:.79rem; padding:8px; }
.view-tabs { display:grid; margin:10px 0; padding-bottom:10px; border-bottom:1px solid var(--line); gap:3px; }
.view-tabs button,.categories button { display:flex; justify-content:space-between; align-items:center; gap:8px; background:transparent; border:1px solid transparent; color:var(--muted); text-align:left; font-size:.83rem; padding:8px; font-weight:450; width:100%; }
.categories { overflow-y:auto; max-height:calc(100vh - 360px); }
.categories button[aria-pressed="true"],.view-tabs button[aria-pressed="true"] { background:#262035; border-color:#4c3e65; color:#e3d5ff; }
.categories button span:first-child { overflow-wrap:anywhere; }
.categories button span:last-child,.view-tabs button span { font-size:.72rem; color:#b6a0d9; }
.catalog-toolbar { display:flex; gap:7px; margin-bottom:8px; } .catalog-toolbar input { width:100%; font-size:.84rem; padding:8px; }
.catalog-toolbar select { width:130px; font-size:.75rem; padding:7px; } .catalog-layout:not(.on-demand) .catalog-toolbar select { display:none; }
#list-status { font-size:.78rem; margin:6px 0 10px; overflow-wrap:break-word; }
.item-list { overflow:auto; max-height:calc(100vh - 235px); padding:3px; }
.item-list button { width:100%; display:flex; align-items:center; gap:9px; min-height:48px; text-align:left; margin-bottom:4px; background:#151923; color:var(--text); border:1px solid #272e3c; font-weight:450; font-size:.86rem; }
.item-list button[aria-pressed="true"] { color:#eadfff; background:#2c2340; border-color:#9c7fc8; }
.item-image { display:block; width:35px; height:36px; object-fit:contain; background:#222736; border-radius:3px; flex:none; }
.item-placeholder { display:flex; align-items:center; justify-content:center; width:35px; height:36px; border-radius:4px; background:linear-gradient(150deg,#34304b,#161c2a); color:#ae9bce; font-size:20px; flex:none; }
.item-caption { overflow-wrap:anywhere; } .preview-panel { background:#10131b; padding:12px; border:1px solid var(--line); border-radius:9px; }
.preview-stage { position:relative; width:100%; aspect-ratio:16/9; min-height:160px; background:#000; display:flex; align-items:center; justify-content:center; overflow:hidden; border-radius:5px; }
.preview-stage video { width:100%; height:100%; } #preview-empty { text-align:center; padding:15px; }
#preview-empty span { font-size:48px; color:#8b769f; } #preview-empty p { font-size:.82rem; }
.eyebrow { color:#b7a3d4; font-size:.72rem; text-transform:uppercase; letter-spacing:.07em; margin:16px 0 5px; }
.preview-panel h2 { font-size:1.13rem; overflow-wrap:anywhere; } .preview-actions { display:flex; gap:8px; margin-top:18px; flex-wrap:wrap; }
.preview-actions button { font-size:.79rem; } .on-demand { grid-template-columns:190px minmax(0,1fr); }
.on-demand .preview-panel { grid-column:2; margin-top:4px; } .on-demand .results-panel { min-width:0; }
.on-demand .item-list { display:grid; grid-template-columns:repeat(auto-fill,minmax(125px,1fr)); gap:12px; max-height:calc(100vh - 200px); align-items:stretch; }
.on-demand .item-list li { min-width:0; } .on-demand .item-list button { display:flex; flex-direction:column; align-items:stretch; padding:5px; height:100%; margin:0; gap:8px; }
.on-demand .item-image,.on-demand .item-placeholder { width:100%; aspect-ratio:2/3; height:auto; min-height:125px; object-fit:cover; font-size:36px; }
.on-demand .item-caption { padding:0 5px 5px; font-size:.8rem; }
.home-hero { min-height:235px; padding:33px; border:1px solid #40304e; border-radius:12px; background:radial-gradient(ellipse at 90% 20%,#66469b88,transparent 60%),linear-gradient(130deg,#1c1827,#12131b); }
.home-hero h2 { font-size:clamp(1.8rem,4vw,3rem); max-width:23ch; line-height:1.12; } .home-hero p { margin:12px 0 18px; max-width:60ch; } .home-hero .eyebrow { margin:0 0 12px; }
.shelf { margin-top:26px; } .shelf h2 { font-size:1.1rem; margin-bottom:12px; } .poster-row { display:flex; overflow-x:auto; gap:12px; padding:3px 3px 10px; }
.poster-row li { width:132px; flex:none; } .poster-row button { display:grid; padding:5px; width:100%; background:#171b27; color:var(--text); text-align:left; font-size:.78rem; height:100%; }
.poster-row .item-image,.poster-row .item-placeholder { width:100%; height:162px; object-fit:cover; font-size:34px; margin-bottom:7px; }
.settings-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; max-width:850px; margin:24px 0; }
.settings-grid label { padding:17px; border:1px solid var(--line); border-radius:9px; background:#141823; font-size:.85rem; } .settings-grid button { min-height:75px; text-align:left; }
.modal-backdrop { position:fixed; inset:0; z-index:10; background:#000b; display:flex; align-items:center; justify-content:center; padding:20px; }
.source-dialog { width:460px; max-width:100%; max-height:92vh; overflow:auto; padding:22px; border:1px solid #53617a; background:#1d2636; border-radius:11px; box-shadow:0 24px 80px #0008; }
.source-dialog h2 { margin-bottom:17px; font-size:1.1rem; } .source-dialog label { font-size:.83rem; margin-bottom:12px; }
.source-dialog input,.source-dialog select { background:#172030; border-color:#4c5a70; } .source-dialog .consent { display:flex; align-items:start; gap:8px; margin-top:14px; color:var(--muted); font-size:.76rem; }
.consent input { width:16px; height:16px; margin-top:3px; flex:none; } .dialog-actions { display:flex; gap:10px; } .dialog-actions button { flex:1; font-size:.82rem; }
#reload,#more,#retry { margin-top:13px; font-size:.83rem; }
@media(max-width:900px) {
  .rail { width:80px; padding:12px 6px; } .rail button { font-size:.65rem; min-height:58px; } .workspace { padding:15px; }
  .catalog-layout { grid-template-columns:150px minmax(140px,.9fr) minmax(190px,1.25fr); gap:9px; }
  .on-demand { grid-template-columns:150px minmax(0,1fr); } .categories-panel { padding-right:8px; } .topbar { gap:12px; padding-inline:16px; } #device { display:none; }
}
@media(max-width:900px) and (orientation:portrait) {
  .topbar { height:59px; padding-inline:13px; gap:10px; } .topbar h1 { font-size:.9rem; padding-left:10px; } .brand { font-size:1rem; } .brand-symbol { width:26px; height:26px; }
  #clock { margin-left:auto; font-size:.7rem; } #update { position:fixed; bottom:78px; right:15px; z-index:6; }
  .app-layout { min-height:calc(100vh - 59px); padding-bottom:78px; }
  .rail { position:fixed; bottom:0; inset-inline:0; z-index:5; flex-direction:row; width:100%; padding:7px 5px; gap:2px; border:0; border-top:1px solid var(--line); justify-content:space-around; }
  .rail button { flex:1; min-height:51px; padding:2px; font-size:.62rem; } .rail button span { font-size:20px; }
  .playlist-layout { grid-template-columns:1fr; gap:22px; padding:8px 0; } .pair-card { max-width:460px; } .catalog-layout,.on-demand { grid-template-columns:1fr; }
  .categories-panel { border:0; padding:0; } .categories-panel .source-label { display:flex; align-items:center; gap:10px; } .source-label select { margin:0; }
  .view-tabs { display:flex; gap:5px; margin:10px 0 5px; padding-bottom:5px; } .view-tabs button { justify-content:center; }
  .categories { display:flex; gap:5px; overflow:auto; max-height:none; margin:8px 0; } .categories button { width:auto; flex:none; max-width:210px; padding:7px; border-color:var(--line); font-size:.76rem; }
  .catalog-layout:not(.on-demand) .preview-panel { grid-row:2; margin-bottom:9px; } .on-demand .preview-panel { grid-column:auto; }
  .item-list { max-height:50vh; } .on-demand .item-list { grid-template-columns:repeat(2,minmax(0,1fr)); max-height:none; }
  .settings-grid { grid-template-columns:1fr; gap:10px; } .home-hero { padding:23px; } .source-dialog { max-height:86vh; }
}
@media(max-width:690px) and (orientation:landscape) {
  .rail { width:64px; }
  .workspace { padding:10px; }
  .playlist-layout { grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:12px; padding:0; }
  .catalog-layout { grid-template-columns:minmax(0,1fr) minmax(0,1.15fr) minmax(0,1.5fr); }
  .on-demand { grid-template-columns:minmax(0,1fr) minmax(0,2.5fr); }
  .source-dialog { max-height:calc(100vh - 40px); }
}
