/* Approved Lumeyi reference v20. Library styling is separate from the recording cinema. */
:root{--lumeyi-spectrum:linear-gradient(110deg,#ff6262,#ffad45,#ffe66a,#6de58a,#45dcef,#6790ff,#b779ff,#ff71c7)}
.lumeyi-brand{display:none}
.dubbing-mark{display:none}
.game-menu{position:relative;z-index:20}
.game-menu>summary{display:grid;place-items:center;width:44px;height:44px;list-style:none;cursor:pointer;border:1px solid #ffffff30;border-radius:12px;background:#171516;color:#f4f4f4}
.game-menu>summary::-webkit-details-marker{display:none}
.game-menu>summary svg{width:23px;height:23px;fill:currentColor}
.game-menu[open]{isolation:isolate}
.game-menu[open]>.connected-header{position:absolute;inset-inline-end:0;top:52px;display:flex;flex-direction:column;align-items:stretch;width:240px;padding:12px 12px 62px;background:#171717;border:1px solid #464646;border-radius:16px;box-shadow:0 14px 45px #000b;gap:8px}
.game-menu .connected-header a,.game-menu .connected-header button{display:flex!important;align-items:center;justify-content:center;gap:8px;margin:0;border-radius:9px;background:#222;color:#eee;border-color:#ffffff24;min-height:44px}
.game-menu #friends-button svg,#help-button svg{display:block;width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round}
.game-menu #help-button{position:absolute;top:244px;inset-inline-end:12px;width:216px;height:44px;border-radius:9px;display:flex;align-items:center;justify-content:center;gap:8px}
.game-menu #help-button:after{content:'إعدادات التجربة';font:12px LumeyiArabic,system-ui}
.game-menu>summary:focus-visible{outline:2px solid white;outline-offset:4px}
body[data-view=library]{color-scheme:dark;background:#080909;background-image:radial-gradient(ellipse at 82% 0%,#d4def507,transparent 52%),linear-gradient(160deg,#101213,#080909 65%);color:#f2f3f4}
body[data-view=library] #cinema-world,body[data-view=library] .shade{display:none}
body[data-view=library] main{max-width:1140px;padding:24px 32px 32px}
body[data-view=library] .game-head{display:grid;grid-template-areas:'title menu brand';grid-template-columns:1fr auto 1fr;align-items:center;gap:20px;margin:0 0 22px;padding:0;min-height:58px;border:0}
body[data-view=library] .game-head>div{grid-area:title;justify-self:start}
body[data-view=library] .game-head h1{display:flex;align-items:center;gap:10px;margin:0;font:700 23px/1.6 LumeyiArabic,system-ui;color:white}
body[data-view=library] .game-head h1:before{content:'';width:3px;height:31px;border-radius:4px;background:var(--lumeyi-spectrum);background-image:linear-gradient(#ff71c7,#b779ff,#6790ff,#45dcef,#6de58a,#ffe66a,#ffad45,#ff6262)}
body[data-view=library] .save-state{display:none}
body[data-view=library] .lumeyi-brand{grid-area:brand;justify-self:end;display:flex;align-items:center;gap:8px;color:white;text-decoration:none;direction:ltr}
.brand-star{display:block;position:relative;overflow:hidden;flex:0 0 49px;width:49px;height:51px}
.brand-star img{position:absolute;width:96px;height:96px;max-width:none;left:-23px;top:-11px;mix-blend-mode:screen}
.brand-wordmark{display:grid;gap:1px;line-height:1.2;text-align:center}
.brand-wordmark b{font:750 18px/1.1 'Segoe UI',Arial,sans-serif;letter-spacing:.5px}
.brand-wordmark>span{font:700 16px/1.3 LumeyiArabic,system-ui}
body[data-view=library] .game-menu{grid-area:menu}
body[data-view=library] .game-menu>summary{background:linear-gradient(#1d2022,#111314);border-color:#465058;border-radius:12px;box-shadow:inset 0 1px #ffffff0b}
body[data-view=library] .game-menu[open]>.connected-header{inset-inline-end:50%;transform:translateX(-50%)}
body[data-view=library] .game-menu #help-button{inset-inline-end:50%;transform:translateX(-50%)}
body[data-view=library] #library>.view-head{display:block;text-align:center;padding:0;margin:0 0 22px}
body[data-view=library] #library>.view-head .eyebrow{display:none}
body[data-view=library] #library h2{font:700 35px/1.4 LumeyiArabic,system-ui;letter-spacing:-.5px;margin:0 0 4px;color:#f8f8f8}
body[data-view=library] #library>.view-head p{font-size:14px;line-height:1.6;color:#b8bdc4;margin:0}
body[data-view=library] button{touch-action:manipulation}
body[data-view=library] .library-toolbar{margin:0 0 22px}
.library-search{display:flex;align-items:center;gap:14px;max-width:480px;min-width:0;width:100%;height:49px;padding:0 18px;margin:0 auto 22px;border:1px solid #444e59;background:linear-gradient(140deg,#1b2025,#171a1e);border-radius:30px;box-shadow:inset 0 1px #ffffff05}
.library-search svg{order:2;flex:0 0 21px;width:21px;height:21px;fill:none;stroke:#f0f2f6;stroke-width:1.65;stroke-linecap:round}
.library-search input{width:100%;min-width:0;height:44px;padding:0;border:0;background:transparent;color:white;font:14px LumeyiArabic,system-ui;outline:0;box-shadow:none}
.library-search input::placeholder{color:#c9cdd3;opacity:1}
.library-search:focus-within{border-color:#98afcc;box-shadow:0 0 0 3px #819cc41a}
.library-browse-row{display:grid;grid-template-columns:1fr auto 1fr;gap:14px;align-items:center}
.library-categories{grid-column:2;display:flex;align-items:center;justify-content:center;gap:0}
.category-tabs{display:flex;gap:11px;flex-wrap:nowrap}
.category-tabs button{position:relative;min-height:44px;min-width:104px;padding:6px 18px;border-radius:13px;border:1px solid #3b4146;background:linear-gradient(#1e2123,#111314);box-shadow:inset 0 1px #ffffff08;color:#f4f5f6;font-size:14px;white-space:nowrap}
.category-tabs button[aria-pressed=true],.library-tools button[aria-pressed=true],.library-tools button[aria-expanded=true],.cast-filter[data-active=true]{border:2px solid transparent;background:linear-gradient(#111314,#16191b) padding-box,var(--lumeyi-spectrum) border-box;color:white}
#scene-count{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.library-tools{grid-column:3;display:flex;justify-self:end;gap:10px}
.library-tools button{display:grid;align-content:center;justify-items:center;gap:2px;width:62px;height:58px;padding:4px;border:1px solid #4a535e;border-radius:13px;background:linear-gradient(#1c2024,#101315);box-shadow:inset 0 1px #ffffff08;color:white}
.library-tools button svg{width:24px;height:24px;display:block;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linejoin:round;stroke-linecap:round}
.library-tools button>span{font-size:9px;line-height:1.4;color:#e2e4e8}
#scene-favorites[aria-pressed=true] svg{fill:white;fill-opacity:.16}
.cast-finder{display:flex;flex-direction:column;margin:0 0 20px;padding:18px 0 0;border-top:1px solid #414951}
.cast-finder-heading{order:2;display:flex;justify-content:center;color:#bdc2c8;font-size:11px;line-height:1.5;margin:10px 0 0}
.cast-finder-heading>strong{display:none}
.cast-finder-heading>span:before{content:'ⓘ';font:14px/1 system-ui;margin-inline-end:7px;color:#e8e8e8}
.cast-filters{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:56px;max-width:820px;width:100%;margin:0 auto}
.cast-filter{display:grid;position:relative;grid-template-columns:1fr 24px;grid-template-rows:25px 44px;column-gap:8px;row-gap:5px;align-items:center;padding:0;min-width:0;min-height:74px;border:0;border-radius:0;background:transparent;box-shadow:none;color:#f3f4f5}
.cast-icon{grid-column:2;grid-row:1;display:grid;place-items:center;width:22px;height:22px;background:transparent;border:0;color:inherit}
.cast-icon svg{display:block;width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linejoin:round;stroke-linecap:round}
.cast-filter-copy{grid-column:1;grid-row:1 / 3;display:grid;grid-template-rows:25px 44px;row-gap:5px;text-align:center;pointer-events:none}
.cast-filter-copy strong{font:600 14px/25px LumeyiArabic,system-ui;color:#f3f4f5}
.cast-filter-copy>span{position:absolute;inset-inline:0;bottom:0;display:flex;align-items:center;justify-content:center;height:44px;background:linear-gradient(#242a31,#161a1f);border:1px solid #434c58;border-radius:12px;color:#eef0f4;font-size:13px;box-shadow:inset 0 1px #ffffff0b;white-space:nowrap}
.cast-chevron{position:absolute;bottom:15px;inset-inline-end:14px;color:white;font:17px/1 system-ui;pointer-events:none;z-index:1}
.cast-filter select{position:absolute;inset-inline:0;top:auto;bottom:0;width:100%;height:44px;min-height:44px;opacity:0;cursor:pointer;z-index:2;font:16px system-ui;color-scheme:dark}
.cast-filter[data-active=true]{border:0;background:transparent}
.cast-filter[data-active=true] .cast-filter-copy>span{border:2px solid transparent;background:linear-gradient(#14181e,#1b2026) padding-box,var(--lumeyi-spectrum) border-box}
.cast-filter:focus-within .cast-filter-copy>span{outline:2px solid #cbd8ef;outline-offset:3px}
.catalog-options{display:grid;grid-template-columns:1fr auto;gap:16px;align-items:end;margin:0 0 20px;padding:16px;border:1px solid #46515f;border-radius:14px;background:#14181b;color:#e8eaed}
.catalog-options .filter-field:has(select[hidden]),.catalog-options .kind-field{display:none}
.filter-field{display:grid;gap:6px;font-size:12px;color:#c5cbd2}
.catalog-options select{width:100%;max-width:none;min-height:44px;font:13px LumeyiArabic,system-ui;background:#22272e;color:white;border:1px solid #485460;border-radius:9px}
.catalog-options .filter-clear{min-height:44px;background:#23282f;border-color:#485460;color:#e3e7ef;font-size:12px}
body[data-view=library] .library-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px;max-width:none;width:100%;margin:0}
body[data-view=library] .scene-entry{position:relative;overflow:hidden;padding:8px 8px 0;border:1px solid #46515d;border-radius:18px;background:linear-gradient(135deg,#282d30,#15181a 60%);box-shadow:inset 0 1px #ffffff05,0 8px 20px #0002;transition:border-color .15s,transform .15s}
body[data-view=library] .scene-card{display:block;width:100%;padding:0;border:0;border-radius:0;background:transparent;color:white;text-align:center;box-shadow:none}
body[data-view=library] .sample-frame{position:relative;aspect-ratio:16/9;overflow:hidden;border:0;border-radius:12px;background:#070808}
body[data-view=library] .sample-frame img{display:block;width:100%;height:100%;object-fit:cover;margin:0;filter:none}
body[data-view=library] .sample-frame:before{content:'';position:absolute;z-index:1;width:54px;height:54px;border-radius:50%;background:#080b0fcc;top:50%;left:50%;transform:translate(-50%,-50%);box-shadow:0 1px 0 #ffffff30;backdrop-filter:blur(2px)}
body[data-view=library] .sample-frame:after{content:'';position:absolute;z-index:2;top:50%;left:50%;width:17px;height:22px;background:#fff;clip-path:polygon(0 0,100% 50%,0 100%);transform:translate(-38%,-50%)}
body[data-view=library] .scene-card>div:last-child{padding:10px 9px 12px;display:grid;gap:2px;background:transparent}
body[data-view=library] .scene-card strong{color:white;font:700 19px/1.5 LumeyiArabic,system-ui;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body[data-view=library] .scene-subtitle,body[data-view=library] .composition-meta,body[data-view=library] .card-cta{display:none!important}
body[data-view=library] .scene-meta{color:#b4bcc6;font-size:11px;line-height:1.4;margin:0}
body[data-view=library] .edition-badge{position:absolute;z-index:3;left:7px;right:auto;bottom:7px;margin:0;padding:3px 7px;border:1px solid #ffffff30;border-radius:5px;background:#0d1013c9!important;color:#e4e7eb!important;font-size:9px;line-height:1.4}
body[data-view=library] .scene-favorite{position:absolute;z-index:4;top:10px;right:10px;left:auto;width:44px;height:44px;min-height:44px;padding:0;display:grid;place-items:center;border:0;border-radius:50%;background:#0d1118b8;color:white;box-shadow:none;backdrop-filter:blur(5px)}
body[data-view=library] .scene-favorite svg{display:block;width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linejoin:round}
body[data-view=library] .scene-favorite[aria-pressed=true]{background:#f4f5f7;color:#151a20}
body[data-view=library] .scene-favorite[aria-pressed=true] svg{fill:currentColor;fill-opacity:.2}
.scene-empty{text-align:center;padding:36px 16px;border:1px solid #373e47;border-radius:16px;background:#121517;color:#e4e7eb}
.scene-empty p{color:#acb4c0;font-size:13px;margin:8px 0 16px}
.scene-empty button{background:#e8edf4;color:#11151b;border:0;font-size:13px}
body[data-view=library] .edition-info{border-top:1px solid #343a43;margin-top:24px;padding-top:10px;font-size:12px;color:#aab1bc}
.edition-info summary{display:flex;align-items:center;gap:10px;cursor:pointer;min-height:44px;list-style:none}
body[data-view=library] .edition-info summary{color:#bbc2cd}
.edition-info summary:after{content:'+';font:20px system-ui}.edition-info[open] summary:after{content:'−'}
.edition-info p{max-width:780px;line-height:1.8;padding:6px 0}
body[data-view=library] .creator-tools{margin:8px 0 0;padding:10px 12px;border:1px solid #313741;border-radius:12px;background:#111518;color:#aeb7c5;font-size:11px}
body[data-view=library] .creator-tools button{background:#1c222a;border-color:#455162;color:#e2e8f2;font-size:12px;min-height:44px}
body[data-view=library] footer{margin-top:12px;color:#858e9a;font-size:10px}
body[data-view=library] .end-session button{background:transparent;border-color:#343e49;color:#a8b3c2;font-size:12px}
body[data-view=library] button:focus-visible,body[data-view=library] a:focus-visible,body[data-view=library] summary:focus-visible{outline:2px solid #c5d4ef;outline-offset:3px}
@media(hover:hover){body[data-view=library] .scene-entry:hover{border-color:#8594a7;transform:translateY(-2px)}.category-tabs button:hover,.library-tools button:hover{color:white;border-color:#8492a5}}
@media(max-width:850px){body[data-view=library] main{padding:22px 24px}.library-browse-row{grid-template-columns:1fr auto;gap:12px}.library-categories{grid-column:1;justify-content:start}.library-tools{grid-column:2}.category-tabs{gap:7px}.category-tabs button{min-width:84px;padding-inline:12px}.cast-filters{gap:24px}}
@media(max-width:600px){
 body[data-view=library] main{padding:16px 14px 24px}
 body[data-view=library] .game-head{min-height:45px;margin-bottom:18px;gap:8px;grid-template-columns:1fr 44px 1fr}
 body[data-view=library] .game-head h1{font-size:18px;gap:6px}
 body[data-view=library] .game-head h1:before{height:25px;width:3px}
 body[data-view=library] .lumeyi-brand{gap:3px}
 .brand-star{width:36px;height:39px;flex-basis:36px}.brand-star img{width:72px;height:72px;left:-18px;top:-8px}
 .brand-wordmark b{font-size:13px;letter-spacing:.3px}.brand-wordmark>span{font-size:12px}
 body[data-view=library] .game-menu>summary{width:44px;height:44px;border-color:#ffffff16;background:transparent}
 body[data-view=library] #library>.view-head{margin:0 0 17px}
 body[data-view=library] #library h2{font-size:24px;line-height:1.5;margin-bottom:0}
 body[data-view=library] #library>.view-head p{font-size:11px;line-height:1.5}
 .library-search{height:45px;border-radius:14px;margin-bottom:14px;padding:0 12px;gap:8px}
 .library-search input{font-size:12px}.library-search svg{width:18px;height:18px;flex-basis:18px}
 .library-browse-row{display:flex;gap:6px;align-items:stretch}.library-categories{flex:1;min-width:0}.category-tabs{width:100%;gap:4px}.category-tabs button{flex:1;min-width:44px;padding:5px 1px;border-radius:10px;font-size:11px;min-height:46px}
 .library-tools{gap:4px;flex-shrink:0}.library-tools button{width:44px;height:46px;min-height:46px;border-radius:10px;padding:4px 0;gap:1px}.library-tools button svg{width:19px;height:19px}.library-tools button>span{font-size:8px;line-height:1.35}
 body[data-view=library] .library-toolbar{margin-bottom:16px}
 .cast-finder{margin-bottom:17px;padding-top:12px}.cast-filters{gap:10px;max-width:none}.cast-filter{grid-template-columns:1fr 19px;grid-template-rows:23px 44px;column-gap:2px;row-gap:3px}.cast-filter-copy{grid-template-rows:23px 44px;row-gap:3px}.cast-filter-copy strong{font-size:12px;line-height:23px}.cast-icon,.cast-icon svg{width:18px;height:18px}.cast-filter-copy>span{font-size:11px;border-radius:10px;padding-inline:18px}.cast-chevron{inset-inline-end:9px;font-size:15px}.cast-finder-heading{font-size:10px;margin-top:9px}
 body[data-view=library] .library-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 10px}
 body[data-view=library] .scene-entry{padding:5px 5px 0;border-radius:13px}
 body[data-view=library] .sample-frame{aspect-ratio:16/10;border-radius:9px}
 body[data-view=library] .sample-frame:before{width:43px;height:43px}.sample-frame:after{width:14px;height:18px}
 body[data-view=library] .scene-card>div:last-child{padding:8px 2px 9px;gap:0}
 body[data-view=library] .scene-card strong{font-size:13px;line-height:1.6}
 body[data-view=library] .scene-meta{display:none}
 body[data-view=library] .scene-favorite{width:44px;height:44px;top:5px;right:5px;background:#121722a8}.scene-favorite svg{width:19px;height:19px}
 body[data-view=library] .edition-badge{left:5px;bottom:5px;font-size:8px;padding:2px 5px}
 .catalog-options{grid-template-columns:minmax(0,1fr) auto;padding:12px;gap:9px}.filter-field{font-size:10px}.catalog-options select{font-size:11px}.catalog-options .filter-clear{padding:8px;font-size:10px}
 body[data-view=library] .edition-info{font-size:10px;margin-top:20px}.creator-tools{flex-wrap:wrap}.creator-tools button{width:100%}
}
@media(max-width:350px){body[data-view=library] main{padding-inline:10px}.brand-wordmark b{font-size:11px}.brand-wordmark>span{font-size:10px}.brand-star{width:32px;flex-basis:32px}.brand-star img{left:-20px}body[data-view=library] .game-head h1{font-size:16px}.library-browse-row{gap:4px}.category-tabs{gap:3px}.category-tabs button{font-size:10px}.library-tools{gap:3px}.library-tools button>span{font-size:7px}.cast-filters{gap:6px}.cast-filter-copy>span{font-size:10px}body[data-view=library] .scene-card strong{font-size:11px}}
@media(prefers-reduced-motion:reduce){body[data-view=library] .scene-entry{transition:none}body[data-view=library] .scene-entry:hover{transform:none}}

/* v22: one direct count group; secondary options appear only on request. */
body[data-view=library] .library-toolbar{margin-bottom:20px}
body[data-view=library] .library-search{margin-bottom:0}
body[data-view=library] .cast-finder{padding:0;border:0;margin:0 0 15px}
body[data-view=library] .cast-filters{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;max-width:none}
body[data-view=library] .cast-filter{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:58px;padding:6px 8px 6px 14px;border:1px solid #3c4651;border-radius:13px;background:#151a1e}
.counter-label{font-size:13px;color:#e3e8ee;font-weight:600;cursor:pointer}
.count-stepper{display:flex;align-items:center;direction:ltr;gap:0;min-width:0}
.count-stepper button{width:44px;height:44px;min-height:44px;flex-shrink:0;display:grid;place-items:center;padding:0;border:0;background:transparent;border-radius:9px;color:#e7ebf2}
.count-stepper button:hover{background:#ffffff0c}.count-stepper button:disabled{opacity:.2}
.count-stepper button svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round}
.count-input{display:block;width:58px;height:44px;min-height:44px;padding:0 2px;border:0;border-radius:8px;background:#ffffff05;box-shadow:inset 0 0 0 1px #ffffff0a;color:white;text-align:center;font:600 16px/44px LumeyiArabic,system-ui;direction:ltr}
.count-input::placeholder{font:11px LumeyiArabic,system-ui;color:#b8c1ce;opacity:1}
.count-input:focus-visible{outline:2px solid #bdcde5;outline-offset:2px}
body[data-view=library] .cast-filter[data-active=true]{border-color:#8595af;background:#1b222c}
body[data-view=library] .cast-finder-heading{margin-top:8px;justify-content:center;font-size:10px}
.library-quick-row{display:flex;align-items:center;gap:10px;margin:0 0 18px;min-height:44px}
.library-quick-row #scene-count{position:static;clip-path:none;overflow:visible;width:auto;height:auto;white-space:nowrap;font-size:12px;color:#9ca9bc;margin-inline-end:auto}
.library-quick-row button{display:flex;align-items:center;gap:8px;min-height:44px;border-radius:11px;border:1px solid #3d4857;background:#181e25;padding:9px 14px;font-size:12px;color:#dfe6f1;max-width:60%}
.library-quick-row button svg{display:block;width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}
.library-quick-row #filters-summary{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.library-quick-row #clear-library-filters{background:transparent;border-color:transparent;color:#abb8c9;font-size:11px;padding:8px 3px;flex-shrink:0}
.library-quick-row #filters-toggle[data-active=true]{background:linear-gradient(#161b22,#161b22) padding-box,var(--lumeyi-spectrum) border-box;border:1px solid transparent}
dialog.catalog-options{margin:auto;padding:22px;display:none;max-width:430px;width:calc(100% - 28px);max-height:calc(100dvh - 32px);overflow:auto;border:1px solid #485568;border-radius:22px;background:#151a20;color:#edf2f8;box-shadow:0 22px 100px #000a;grid-template-columns:1fr;gap:17px}
/* The legacy inline filter uses !important on mobile; this modal needs a single column. */
body[data-view=library] dialog.catalog-options[open]{display:grid;grid-template-columns:minmax(0,1fr)!important}
dialog.catalog-options::backdrop{background:#02050bb3;backdrop-filter:blur(4px)}
dialog.catalog-options .sheet-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0;border:0;padding:0}
dialog.catalog-options h3{font:700 20px/1.5 LumeyiArabic,system-ui;color:#f2f5f9}
dialog.catalog-options .sheet-heading button{display:grid;place-items:center;width:44px;height:44px;padding:0;border:0;border-radius:11px;background:#252d37;color:#ecf2fa;font:24px/1 system-ui}
dialog.catalog-options .filter-field.kind-field{display:grid}
dialog.catalog-options select{width:100%;max-width:none;height:48px;padding:7px 12px;font-size:13px;color:#f0f4fa;background:#232b36;border:1px solid #475668;border-radius:11px}
dialog.catalog-options .filter-field>span{font-size:12px;color:#bfcadc}
dialog.catalog-options #scene-favorites{display:flex;align-items:center;gap:10px;width:100%;min-height:48px;margin:0;padding:10px 12px;border:1px solid #475668;border-radius:11px;background:#232b36;color:#e5edf9;font-size:13px}
dialog.catalog-options #scene-favorites svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linejoin:round}
.toggle-indicator{display:block;width:20px;height:20px;margin-inline-start:auto;border:1px solid #9aa9be;border-radius:5px}
#scene-favorites[aria-pressed=true] .toggle-indicator{background:#eff4fc;color:#141c28;position:relative}
#scene-favorites[aria-pressed=true] .toggle-indicator:after{content:'';position:absolute;inset:4px 6px 5px 4px;border-right:2px solid;border-bottom:2px solid;transform:rotate(40deg)}
dialog.catalog-options #reset-scene-options{background:transparent;border:0;color:#b9c8da;font-size:12px;padding:4px;min-height:44px}
dialog.catalog-options #apply-scene-options{min-height:50px;width:100%;margin:0;border:0;border-radius:13px;background:#ecf2fa;color:#141b25;font-size:15px;box-shadow:none}
@media(max-width:1000px) and (min-width:601px){body[data-view=library] .cast-filter{flex-direction:column;gap:2px;padding:8px;min-height:83px}.counter-label{font-size:12px}}
@media(max-width:600px){
 body[data-view=library] .library-toolbar{margin-bottom:14px}
 body[data-view=library] .cast-filters{display:flex;flex-direction:column;gap:0;padding:0 10px;border:1px solid #3c4651;border-radius:14px;background:#151a1e}
 body[data-view=library] .cast-filter{padding:6px 0 6px 6px;min-height:56px;border:0;border-bottom:1px solid #ffffff0c;border-radius:0;background:transparent}
 body[data-view=library] .cast-filter:last-child{border-bottom:0}
 body[data-view=library] .cast-filter[data-active=true]{background:transparent;border-color:#ffffff0c}
 .counter-label{font-size:13px;padding-inline:8px}.count-input{width:62px}.count-input::placeholder{font-size:11px}
 body[data-view=library] .cast-finder{margin-bottom:10px}
 .library-quick-row{margin-bottom:16px;gap:8px;flex-wrap:wrap}.library-quick-row button{font-size:11px;padding:8px 11px;max-width:70%}.library-quick-row #scene-count{font-size:11px}.library-quick-row #clear-library-filters{font-size:10px}
 dialog.catalog-options{padding:18px;gap:15px}
}

/* v23: actual Lumeyi neutral tokens; compact casting without empty full-width rows. */
body[data-view=library]{--bg:#060606;--panel:#111111;--panel2:#1a1a1a;--line:#2b2b2b;--text:#f2f2f2;--muted:#aaa;background:var(--bg);background-image:none;color:var(--text)}
body[data-view=library] .game-head h1,body[data-view=library] #library h2{color:var(--text)}
body[data-view=library] #library>.view-head p{color:var(--muted)}
body[data-view=library] .library-search{border-color:var(--line);background:var(--panel);box-shadow:none}
body[data-view=library] .library-search input{color:var(--text)}
body[data-view=library] .library-search input::placeholder{color:var(--muted)}
body[data-view=library] .library-search svg{stroke:var(--text)}
body[data-view=library] .library-search:focus-within{border-color:#777;box-shadow:0 0 0 2px #ffffff0a}
body[data-view=library] .game-menu>summary{background:var(--panel);border-color:var(--line);box-shadow:none;color:var(--text)}
body[data-view=library] .game-menu[open]>.connected-header{background:var(--panel);border-color:var(--line)}
body[data-view=library] .game-menu .connected-header a,body[data-view=library] .game-menu .connected-header button,body[data-view=library] #help-button{background:var(--panel2);border-color:var(--line);color:var(--text)}
body[data-view=library] .cast-filters{max-width:760px;width:100%;margin-inline:auto;gap:8px}
body[data-view=library] .cast-filter{justify-content:center;padding:3px 8px;min-height:50px;gap:6px;border-radius:10px;background:var(--panel);border-color:var(--line)}
body[data-view=library] .counter-label{font-size:12px;line-height:1.5;color:var(--text);min-width:35px;text-align:center}
body[data-view=library] .count-input{background:var(--panel2);border-color:var(--line);box-shadow:none;color:var(--text);width:54px;font-size:15px}
body[data-view=library] .count-input::placeholder{color:var(--muted);font-size:10px}
body[data-view=library] .count-input:focus-visible{outline-color:var(--text)}
body[data-view=library] .count-stepper button{color:var(--text)}
body[data-view=library] .cast-filter[data-active=true]{border-color:#626262;background:var(--panel2)}
body[data-view=library] .cast-finder-heading{color:var(--muted);font-size:9px;margin-top:6px}
body[data-view=library] .library-quick-row button{background:var(--panel2);border-color:var(--line);color:var(--text)}
body[data-view=library] .library-quick-row #scene-count,body[data-view=library] .library-quick-row #clear-library-filters{color:var(--muted)}
body[data-view=library] .library-quick-row #filters-toggle[data-active=true]{background:linear-gradient(var(--panel2),var(--panel2)) padding-box,conic-gradient(#ff6262,#ffad45,#ffe66a,#6de58a,#45dcef,#6790ff,#b779ff,#ff71c7,#ff6262) border-box;border:1px solid transparent}
body[data-view=library] .scene-entry{background:var(--panel);border-color:var(--line);box-shadow:none}
body[data-view=library] .scene-entry:hover{border-color:#666}
body[data-view=library] .scene-card strong{color:var(--text)}
body[data-view=library] .scene-meta{color:var(--muted)}
body[data-view=library] .edition-badge{background:#111c!important;color:var(--text)!important}
body[data-view=library] .sample-frame:before{background:#000a}
body[data-view=library] .scene-favorite{background:#0009;color:var(--text)}
body[data-view=library] .scene-favorite[aria-pressed=true]{background:var(--text);color:var(--bg)}
body[data-view=library] .scene-empty{background:var(--panel);border-color:var(--line);color:var(--text)}
body[data-view=library] .scene-empty p{color:var(--muted)}
body[data-view=library] .scene-empty button{background:var(--text);color:var(--bg)}
body[data-view=library] .creator-tools{background:var(--panel);border-color:var(--line);color:var(--muted)}
body[data-view=library] .creator-tools button{background:var(--panel2);border-color:var(--line);color:var(--text)}
body[data-view=library] .edition-info{border-color:var(--line);color:var(--muted)}
body[data-view=library] .edition-info summary,body[data-view=library] footer{color:var(--muted)}
body[data-view=library] dialog.catalog-options{background:var(--panel);border-color:var(--line);color:var(--text)}
body[data-view=library] dialog.catalog-options h3{color:var(--text)}
body[data-view=library] dialog.catalog-options .filter-field>span{color:var(--muted)}
body[data-view=library] dialog.catalog-options select,body[data-view=library] dialog.catalog-options #scene-favorites,body[data-view=library] dialog.catalog-options .sheet-heading button{background:var(--panel2);border-color:var(--line);color:var(--text)}
body[data-view=library] dialog.catalog-options #reset-scene-options{color:var(--muted)}
body[data-view=library] dialog.catalog-options #apply-scene-options{background:var(--panel2);border:2px solid transparent;background:linear-gradient(var(--panel2),var(--panel2)) padding-box,conic-gradient(#ff6262,#ffad45,#ffe66a,#6de58a,#45dcef,#6790ff,#b779ff,#ff71c7,#ff6262) border-box;color:var(--text)}
body[data-view=library] .toggle-indicator{border-color:#777}
body[data-view=library] #scene-favorites[aria-pressed=true] .toggle-indicator{background:var(--text);color:var(--bg)}
body[data-view=library] button:focus-visible,body[data-view=library] a:focus-visible,body[data-view=library] summary:focus-visible{outline-color:var(--text)}
@media(max-width:1000px) and (min-width:601px){body[data-view=library] .cast-filter{flex-direction:row;padding:3px 4px;min-height:50px;gap:3px}.count-stepper button{width:44px}.counter-label{padding:0}}
@media(max-width:600px){
 body[data-view=library] .cast-filters{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;padding:0;background:transparent;border:0}
 body[data-view=library] .cast-filter{display:flex;flex-direction:column;align-items:stretch;justify-content:start;gap:3px;padding:5px;min-height:0;border:1px solid var(--line);border-radius:10px;background:var(--panel)}
 body[data-view=library] .cast-filter:last-child{border-bottom:1px solid var(--line)}
 body[data-view=library] .cast-filter[data-active=true]{border-color:#626262;background:var(--panel)}
 body[data-view=library] .counter-label{padding:0;font-size:11px;line-height:17px;min-width:0}
 body[data-view=library] .count-stepper{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:44px 44px;gap:0;width:100%}
 body[data-view=library] .count-input{grid-column:1/-1;grid-row:1;width:100%;min-width:0;height:44px;font-size:15px;line-height:44px}
 body[data-view=library] .count-stepper button{grid-row:2;width:100%;min-width:44px;height:44px;padding:0;background:transparent}
 body[data-view=library] .count-stepper button[data-step='-1']{grid-column:1}
 body[data-view=library] .count-stepper button[data-step='1']{grid-column:2}
 body[data-view=library] .count-stepper button svg{width:17px;height:17px}
 body[data-view=library] .cast-finder{margin-bottom:7px}
 body[data-view=library] .cast-finder-heading{font-size:9px;margin-top:5px}
}
@media(max-width:350px){body[data-view=library] .cast-filters{gap:5px}body[data-view=library] .cast-filter{padding:3px}body[data-view=library] .counter-label{font-size:10px}}
