/* Desktop picker styling and shared, collection-independent panel geometry. */
@media(min-width:761px){
 .gremlin-gallery-picker .gremlin-select,.views-collection .gremlin-select{min-width:0;width:100%;font:400 16px/1.4 Arial,sans-serif}
 .gremlin-select .ts-control{min-height:44px;padding:10px 34px 10px 12px;border:1px solid var(--ink,#ccc);border-radius:0;background:var(--paper,#171426);color:var(--ink,#eee);box-shadow:none;font:inherit;line-height:22px;box-sizing:border-box}
 .gremlin-select.ts-wrapper.single .ts-control,.gremlin-select.ts-wrapper.single.input-active .ts-control{background:var(--paper,#171426);color:var(--ink,#eee);box-shadow:none}
 .gremlin-select.single .ts-control:after{border-top-color:var(--ink,#eee)}
 .gremlin-select .ts-control input{color:inherit;font:inherit}
 .gremlin-select .ts-dropdown{z-index:60;margin:5px 0 0;border:1px solid var(--ink,#ccc);border-radius:0;background:var(--paper,#171426);color:var(--ink,#eee);box-shadow:0 8px 24px #0005;font:400 16px/1.4 Arial,sans-serif}
 .gremlin-select .ts-dropdown .dropdown-input-wrap{padding:8px;border-bottom:1px solid var(--line,#777)}
 .gremlin-select .ts-dropdown .dropdown-input{width:100%;min-height:44px;padding:8px 10px;background:var(--field,var(--paper));color:var(--ink);border:1px solid var(--line);font:inherit}
 .gremlin-select .ts-dropdown-content{max-height:min(400px,50dvh);overscroll-behavior:contain}
 .gremlin-select .ts-dropdown .option,.gremlin-select .ts-dropdown .no-results{min-height:44px;padding:11px 12px;white-space:normal;overflow-wrap:anywhere}
 .gremlin-select .ts-dropdown .active{background:var(--accent,#ffd26b);color:var(--accent-ink,#141021)}
 .gremlin-select .ts-dropdown .selected:not(.active){background:var(--panel,#242036);color:var(--ink,#eee);font-weight:700}
 .gremlin-select .ts-dropdown .optgroup-header{padding:9px 12px;background:var(--panel,#242036);color:var(--muted,#ccc);font:700 13px/1.4 Arial,sans-serif}
 .gremlin-select.focus .ts-control{outline:3px solid var(--focus,var(--accent));outline-offset:3px}
 .gallery-music-heading .gremlin-gallery-picker{width:min(100%,560px)}
 .gremlin-format-options{display:flex;flex-wrap:wrap;gap:6px;min-width:0}
 .gremlin-format-options label{position:relative;display:flex;min-width:0;cursor:pointer}
 .gremlin-format-options input{position:absolute;opacity:0;width:1px;height:1px}
 .gremlin-format-options span{display:flex;align-items:center;justify-content:center;min-height:44px;padding:9px 12px;border:1px solid var(--ink,#ccc);background:var(--paper,#171426);color:var(--ink,#eee);font:400 14px/1.4 Arial,sans-serif}
 .gremlin-format-options input:checked+span{border-color:var(--accent,#ffd26b);background:var(--accent,#ffd26b);color:var(--accent-ink,#141021)}
 .gremlin-format-options input:focus-visible+span{outline:3px solid var(--focus,var(--accent));outline-offset:3px}
 .gremlin-gallery-tools>[data-gallery-wallpaper-format]{min-width:0}
 .gremlin-gallery[data-gallery-mode="wallpapers"] .gremlin-gallery-tools{grid-template-columns:minmax(0,1fr) minmax(0,3fr);grid-template-areas:"tabs tabs" "picker view" "search search";align-items:start}
 .gremlin-gallery-tools>[data-gallery-wallpaper-picker],.gremlin-gallery-tools>[data-gallery-wallpaper-format]{align-items:start;align-content:start}
 [data-gallery-wallpaper-format] .views-format,[data-gallery-wallpaper-picker] .views-collection{display:grid;gap:6px;font:700 12px/1.4 Arial,sans-serif;color:var(--muted)}
 .gremlin-gallery[data-gallery-mode="wallpapers"] .gremlin-gallery-tools>[hidden]{display:none!important}
 /* Reserve both format rows for every collection, including a single format. */
 .gremlin-gallery-tools [data-gallery-wallpaper-format] .gremlin-format-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:repeat(2,44px);grid-auto-rows:44px;gap:6px;height:94px;overflow-x:hidden;overflow-y:auto;align-content:start}
 .gremlin-gallery-tools [data-gallery-wallpaper-format] .gremlin-format-options label{max-width:100%;height:44px}
 .gremlin-gallery-tools [data-gallery-wallpaper-format] .gremlin-format-options span{width:100%;height:44px;min-height:44px;padding:4px 8px;font-size:13px;line-height:16px;text-align:center;white-space:normal;overflow-wrap:anywhere;overflow:hidden}
 .gremlin-gallery-tools [data-gallery-wallpaper-format] .gremlin-format-options input:focus-visible+span{outline-offset:-4px}
 /* A wrapped collection title must not change the control's height. */
 .gremlin-gallery-tools .gremlin-select .ts-control{height:66px;min-height:66px;align-content:center;overflow:hidden}
 .gremlin-gallery-tools .gremlin-select .ts-control>.item{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;max-width:100%;line-height:22px}
 .gremlin-gallery-tools .gremlin-select .ts-control>input{min-width:0;max-width:100%}
}
.gremlin-pswp{--pswp-bg:var(--paper,#111);--pswp-icon-color:var(--ink,#eee);--pswp-icon-color-secondary:var(--paper,#111);--pswp-icon-stroke-color:var(--paper,#111);color:var(--ink,#eee);font:400 16px/1.4 Arial,sans-serif}
.gremlin-pswp *{box-sizing:border-box}
.gremlin-pswp .pswp__top-bar{background:var(--panel,#16131e)}
.gremlin-pswp .pswp__button--native-fullscreen{color:var(--ink,#eee);font-size:30px}
.gremlin-pswp .pswp__gremlin-footer{position:absolute;left:0;right:0;bottom:0;display:grid;grid-template-columns:minmax(0,1fr) auto auto;grid-template-areas:"caption caption caption" "formats source actions" "notice notice notice";align-items:end;gap:8px 12px;padding:14px 24px;background:var(--panel,#16131e);border-top:1px solid var(--line,#777);pointer-events:auto}
.gremlin-pswp-caption{margin:0;grid-column:1/-1;max-height:3em;overflow:auto;font:700 18px/1.4 var(--font-heading,Arial,sans-serif)}
.gremlin-pswp-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px}
.gremlin-pswp-caption{grid-area:caption}
.gremlin-pswp .pswp__gremlin-footer>.gremlin-format-options{grid-area:formats}
.gremlin-pswp-source{grid-area:source;display:grid;gap:6px;min-width:0;font:700 12px/1.4 Arial,sans-serif;color:var(--muted,#ccc)}
.gremlin-pswp-source select{min-height:44px;max-width:100%;padding:10px 12px;border:1px solid var(--ink,#ccc);background:var(--paper,#111);color:var(--ink,#eee);font:400 14px/22px Arial,sans-serif}
.gremlin-pswp-actions{grid-area:actions;flex-wrap:wrap}
.gremlin-pswp .gremlin-format-options span{width:100%;height:100%}
.gremlin-pswp-actions button,.gremlin-pswp-actions a{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:9px 14px;border:1px solid var(--ink,#ccc);border-radius:0;background:var(--paper,#111);color:var(--ink,#eee);font:400 15px/1.4 Arial,sans-serif;text-decoration:none;cursor:pointer}
.gremlin-pswp-actions .gremlin-pswp-download,.gremlin-pswp-actions button[aria-pressed="true"]{background:var(--accent,#ffd26b);color:var(--accent-ink,#141021);border-color:var(--accent,#ffd26b)}
.gremlin-pswp :focus-visible{outline:3px solid var(--focus,var(--accent,#ffd26b));outline-offset:3px}
.gremlin-pswp [hidden]{display:none!important}
.gremlin-pswp-notice{grid-area:notice;font-size:13px}
.gremlin-pswp-notice:empty{display:none}
.gremlin-pswp--pixel .pswp__img{image-rendering:pixelated}
.gremlin-pswp--crt .pswp__zoom-wrap::after{content:"";position:absolute;inset:0;pointer-events:none;background:repeating-linear-gradient(to bottom,transparent 0 3px,#0003 3px 4px),radial-gradient(ellipse at center,transparent 52%,#0005 100%);box-shadow:inset 0 0 22px #0005}
.gremlin-pswp-fallback{position:relative;width:100%;height:100%;display:flex;align-items:center;justify-content:center}
.gremlin-pswp-fallback img{width:100%;height:100%;object-fit:contain}
.gremlin-pswp-fallback p{position:absolute;bottom:0;padding:10px;background:var(--panel,#111);color:var(--ink,#eee);font-size:14px}
@media(min-width:761px) and (max-width:1100px){.gremlin-pswp .pswp__gremlin-footer{grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"caption caption" "formats formats" "source actions" "notice notice"}.gremlin-pswp-actions{flex-wrap:wrap}}

/* The same row budget in every mode keeps the image at one vertical position.
   Explicit rows also reserve the search slot while it is hidden for wallpapers. */
@media(min-width:761px){
 .gremlin-gallery .gremlin-gallery-tools{grid-template-rows:44px 124px 68px;align-items:start}
 .gremlin-gallery .gremlin-gallery-tools>.gremlin-gallery-collections{height:44px;min-width:0}
 .gremlin-gallery .gremlin-gallery-collections button{height:44px;min-width:0;overflow:hidden}
 .gremlin-gallery .gremlin-gallery-tools>[data-gallery-library],.gremlin-gallery .gremlin-gallery-tools>[data-gallery-views],.gremlin-gallery .gremlin-gallery-tools>[data-gallery-wallpaper-picker],.gremlin-gallery .gremlin-gallery-tools>[data-gallery-wallpaper-format]{min-height:0;align-items:start;align-content:start;min-width:0}
 .gremlin-gallery .gremlin-gallery-tools>.gremlin-gallery-search{min-height:0;align-self:start}
 .gremlin-gallery .gremlin-gallery-tools>[data-gallery-views],.gremlin-gallery .gremlin-gallery-tools>[data-gallery-periods],.gremlin-gallery .gremlin-gallery-tools>[data-gallery-effects],.gremlin-gallery .gremlin-gallery-tools>[data-gallery-actions]{align-self:start;margin-top:22px}
}
@media(max-width:760px){
 .gremlin-gallery .gremlin-gallery-tools{grid-template-rows:auto 72px 72px 44px 44px 72px;align-items:start}
 .gremlin-gallery .gremlin-gallery-collections{min-width:0}
 .gremlin-gallery .gremlin-gallery-collections button{min-width:0;overflow-wrap:anywhere}
 .gremlin-gallery .gremlin-gallery-tools>[data-gallery-library],.gremlin-gallery .gremlin-gallery-tools>[data-gallery-views],.gremlin-gallery .gremlin-gallery-tools>[data-gallery-wallpaper-picker],.gremlin-gallery .gremlin-gallery-tools>[data-gallery-wallpaper-format],.gremlin-gallery .gremlin-gallery-tools>.gremlin-gallery-search{min-height:0;align-items:start;align-content:start;align-self:start;min-width:0}
 .gremlin-gallery .gremlin-gallery-tools select{height:44px;min-height:44px;width:100%;min-width:0}
}
