#paperGalleryPage{--gallery-blue:#527de0;--gallery-tint:#edf2ff;--gallery-mint:#e9f5ee;--gallery-line:var(--line,#e2e7ee);color:var(--ink,#283544)}
html[data-theme=dark] #paperGalleryPage{--gallery-blue:#a8beff;--gallery-tint:#252f48;--gallery-mint:#243a33}
#paperGalleryPage .kx-gallery-heading{align-items:center;gap:24px;margin-bottom:20px}
.kx-gallery-eyebrow{font-size:10px;font-weight:750;letter-spacing:.15em;color:var(--gallery-blue)}
#paperGalleryPage .kx-gallery-heading h1{margin:6px 0 8px;font-size:31px}
#paperGalleryPage .kx-gallery-heading p{font-size:14px;margin:0;color:var(--muted,#76808b)}
.kx-gallery-heading-actions{display:flex;gap:10px;flex-wrap:wrap;align-items:center}.kx-gallery-heading-actions button{min-height:44px;white-space:nowrap}
.kx-gallery-summary{display:flex;gap:22px;padding:16px 2px 23px;flex-wrap:wrap;color:var(--muted,#74818b);font-size:12px}.kx-gallery-summary>span{display:flex;align-items:baseline;gap:8px}.kx-gallery-summary b{color:var(--ink,#263948);font-size:23px;font-weight:750;font-variant-numeric:tabular-nums}
#paperGalleryPage .kx-gallery-filters{padding:18px 20px;background:var(--surface,#fff)!important;border:1px solid var(--gallery-line)!important;border-radius:19px}
.kx-gallery-search{display:grid;grid-template-columns:minmax(180px,1fr) 150px auto;align-items:center;gap:12px}.kx-gallery-search input,.kx-gallery-search select,.kx-gallery-page-controls select{border:1px solid var(--gallery-line);padding:12px 14px;border-radius:12px;color:var(--ink,#304555);background:var(--surface-soft,#f7f9fc);min-height:46px;width:100%;font:inherit;font-size:14px;box-sizing:border-box}.kx-gallery-search input::placeholder{color:var(--muted,#7d8794)}
.kx-gallery-refinements{border-top:1px solid var(--gallery-line);margin-top:14px;padding-top:12px}.kx-gallery-refinements>summary{font-size:12px;color:var(--muted,#75818c);cursor:pointer;font-weight:650;min-height:25px;line-height:25px}.kx-gallery-chips{display:flex;gap:6px;align-items:center;overflow-x:auto;padding:10px 0 3px;overscroll-behavior-x:contain}.kx-gallery-chips>span{flex-shrink:0;font-size:12px;color:var(--muted,#728675);padding-right:8px}.kx-gallery-chips button{white-space:nowrap;flex-shrink:0;font-size:12px;padding:7px 12px;min-height:36px!important;border-color:transparent!important;background:var(--surface-soft,#f5f7fc)!important;color:var(--muted,#677c6c)!important;box-shadow:none!important}#paperGalleryPage .kx-gallery-chips [aria-pressed=true]{background:var(--gallery-tint)!important;color:var(--gallery-blue)!important;border-color:var(--gallery-blue)!important}
.kx-gallery-status{font-size:12px;color:var(--muted,#677c6c);margin:17px 2px}.kx-gallery-error{padding:16px 20px;margin:14px 0;border:1px solid #d99c68;border-radius:16px;background:var(--accent-soft,#fff3e8);display:flex;align-items:center;justify-content:space-between;gap:16px}.kx-gallery-error p{margin:0;color:var(--ink,#77512e);line-height:1.7;font-size:14px}.kx-gallery-error button{flex:none}
.kx-gallery-grid{display:grid;grid-template-columns:280px minmax(0,1fr);gap:20px;align-items:start}.kx-gallery-directory{border:1px solid var(--gallery-line);background:var(--surface,#fff);border-radius:19px;overflow:hidden;position:sticky;top:18px}.kx-gallery-directory summary{font-weight:750;font-size:13px;padding:17px 19px;cursor:pointer;color:var(--ink,#374555);border-bottom:1px solid var(--gallery-line)}.kx-gallery-directory>.kx-gallery-list{max-height:76dvh;overflow-y:auto;padding:8px;overscroll-behavior:contain;scrollbar-width:thin}
#paperGalleryPage .kx-gallery-directory button{display:block;width:100%;text-align:left;background:transparent!important;border:1px solid transparent!important;box-shadow:none!important;margin:4px 0;padding:14px;border-radius:12px!important;white-space:normal;color:var(--ink,#314554)!important}.kx-gallery-directory button small{display:block;font-size:10px;color:var(--muted,#80909d);margin-bottom:7px}.kx-gallery-directory button span{display:block;font-size:13px;line-height:1.6;font-weight:650}.kx-gallery-directory button em{display:block;font-size:10px;color:var(--muted,#80909d);font-style:normal;margin-top:8px}#paperGalleryPage .kx-gallery-directory button:hover{background:var(--surface-soft,#f5f8fc)!important}#paperGalleryPage .kx-gallery-directory [aria-current=true]{background:var(--gallery-tint)!important;border-color:var(--gallery-blue)!important;color:var(--ink,#314554)!important}.kx-gallery-directory [aria-current=true] small{color:var(--gallery-blue)}
#paperGalleryPage .kx-gallery-stage{background:var(--surface,#fff)!important;border:1px solid var(--gallery-line)!important;border-radius:21px;overflow:hidden;min-width:0;box-shadow:0 10px 30px #263a5010}.kx-gallery-paper-head{padding:24px 25px 12px}.kx-gallery-paper-head h2{font-size:21px;line-height:1.6;margin:0;color:var(--ink,#314253)}.kx-gallery-paper-head p{font-size:12px;color:var(--muted,#7a8796);line-height:1.8;margin:10px 0 0}.kx-gallery-book-controls{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 20px;background:var(--surface-soft,#f5f7fb);border-block:1px solid var(--gallery-line)}.kx-gallery-book-controls strong{font-size:12px;font-variant-numeric:tabular-nums;color:var(--muted,#71818d)}.kx-gallery-book-controls button{background:var(--surface,#fff);min-height:40px!important;font-size:12px}.kx-gallery-actions{display:flex;flex-wrap:wrap;gap:8px;padding:14px 20px;align-items:center}.kx-gallery-actions button{font-size:12px;padding:9px 12px;min-height:40px!important}.kx-gallery-actions .primary{margin-right:auto}.kx-gallery-stage>iframe{display:block;width:100%;height:70dvh;min-height:430px;border:0;border-top:1px solid var(--gallery-line);border-bottom:1px solid var(--gallery-line);background:var(--surface,#fff)}.kx-gallery-preview-message{display:flex;align-items:center;justify-content:center;flex-direction:column;gap:10px;min-height:300px;margin:0 20px 20px;border:1px dashed var(--gallery-line);border-radius:15px;text-align:center;padding:24px;background:var(--surface-soft,#f6f8fc);color:var(--muted,#75828e)}.kx-gallery-preview-message p{max-width:420px;line-height:1.9;font-size:14px}.kx-gallery-page-controls{display:flex;align-items:center;gap:10px;justify-content:center;padding:16px;flex-wrap:wrap}.kx-gallery-page-controls select{max-width:56%;width:auto;flex:1;font-size:12px;min-height:42px}.kx-gallery-page-controls button{font-size:12px;min-height:42px}.kx-gallery-stage button:disabled{opacity:.4;cursor:not-allowed}.kx-gallery-stage[aria-busy=true] .kx-gallery-preview-message p:before{content:'';display:block;width:24px;height:24px;border:2px solid var(--gallery-line);border-top-color:var(--gallery-blue);border-radius:50%;margin:0 auto 18px;animation:kx-gallery-spin .8s linear infinite}@keyframes kx-gallery-spin{to{transform:rotate(360deg)}}
#paperGalleryPage [hidden]{display:none!important}#paperGalleryPage button:focus-visible,#paperGalleryPage summary:focus-visible{outline:3px solid var(--gallery-blue);outline-offset:2px}
@media(max-width:1200px){.kx-gallery-grid{grid-template-columns:235px minmax(0,1fr);gap:15px}.kx-gallery-actions{gap:7px;padding:12px}.kx-gallery-actions .primary{margin-right:0}}
@media(max-width:900px){.kx-gallery-grid{grid-template-columns:1fr}.kx-gallery-directory{position:static}.kx-gallery-directory>.kx-gallery-list{max-height:280px}.kx-gallery-stage>iframe{height:65dvh;min-height:400px}.kx-gallery-heading{align-items:flex-start!important}.kx-gallery-heading-actions{justify-content:flex-end}.kx-gallery-paper-head{padding:20px}.kx-gallery-page-controls{padding:14px}.kx-gallery-refinements{margin-top:12px}}
@media(max-width:600px){#paperGalleryPage .kx-gallery-heading{display:block;margin-bottom:10px}#paperGalleryPage .kx-gallery-heading h1{font-size:27px}.kx-gallery-heading-actions{justify-content:flex-start;margin-top:16px}.kx-gallery-heading-actions button{flex:1}.kx-gallery-summary{gap:16px;padding:14px 2px 18px;font-size:10px}.kx-gallery-summary b{font-size:20px}.kx-gallery-summary>span{gap:5px}#paperGalleryPage .kx-gallery-filters{padding:14px}.kx-gallery-search{grid-template-columns:1fr auto;gap:9px}.kx-gallery-search input{grid-column:1/-1}.kx-gallery-search select{min-width:0}.kx-gallery-search button{font-size:12px;min-height:46px!important}.kx-gallery-paper-head{padding:17px 16px 12px}.kx-gallery-paper-head h2{font-size:18px}.kx-gallery-paper-head p{font-size:11px}.kx-gallery-book-controls{padding:9px 12px}.kx-gallery-book-controls button{padding:8px 10px!important;font-size:11px}.kx-gallery-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}.kx-gallery-actions button{min-height:43px!important;width:100%;margin:0!important;padding:9px!important}.kx-gallery-stage>iframe{height:70dvh;min-height:370px}.kx-gallery-page-controls{padding:12px;gap:7px}.kx-gallery-page-controls select{order:-1;flex:1 0 100%;max-width:100%;font-size:14px}.kx-gallery-page-controls button{flex:1}.kx-gallery-preview-message{min-height:230px;padding:18px;margin:0 12px 14px}.kx-gallery-error{display:block;padding:16px}.kx-gallery-error button{margin-top:12px;width:100%}}
@media(prefers-reduced-motion:reduce){.kx-gallery-stage[aria-busy=true] .kx-gallery-preview-message p:before{animation:none}}

/* Keep long paper names inside the scrollable directory. */
#paperGalleryPage .kx-gallery-directory button{box-sizing:border-box;min-width:0;overflow-wrap:anywhere}
