/* Seen archive entries retain their color, including touch devices. */
#archive .tile svg{filter:grayscale(1) invert(var(--negative))}
#archive .tile.seen svg,#archive .tile:active svg,#archive .tile:focus-visible svg{filter:grayscale(0) invert(var(--negative))}
@media(hover:hover){#archive .tile:hover svg{filter:grayscale(0) invert(var(--negative))}}
#detail .chapter-close{position:fixed;right:16px;top:12px;z-index:45;padding:12px 16px;background:var(--bg);color:var(--fg);border:1px solid var(--line);min-height:44px}
#detail .chapter-top{padding-right:75px}
.gallery-frame>svg,.gallery-frame>img{cursor:zoom-in}
.gallery-frame>[role=button]:focus-visible{outline:3px solid var(--accent);outline-offset:-5px}
.gallery-pointer{position:fixed;z-index:60;pointer-events:none;padding:8px 11px;background:var(--bg);color:var(--fg);border:1px solid var(--line);font:700 10px 'Courier New',monospace;white-space:nowrap;transform:translate(14px,18px)}
#photoFocus{position:fixed;inset:0;width:100vw;height:100dvh;max-width:none;max-height:none;padding:0;margin:0;border:0;background:var(--bg);color:var(--fg);overflow:auto;animation:none}
#photoFocus::backdrop{background:#000b}
.focus-toolbar{position:fixed;top:12px;right:16px;z-index:3;display:flex;gap:8px}
.focus-toolbar button{background:var(--bg);color:var(--fg);border:1px solid var(--line);padding:12px 16px;min-height:44px;font-size:10px}
.focus-stage{min-height:100dvh;display:flex;align-items:center;justify-content:center;padding:65px 16px 20px;cursor:zoom-in}
.focus-stage>img,.focus-stage>svg{display:block;max-width:100%;width:auto;height:auto;max-height:calc(100dvh - 85px);filter:invert(var(--negative));object-fit:contain}
.focus-stage>svg{width:min(95vw,1100px);height:calc(100dvh - 85px)}
#photoFocus.zoomed .focus-stage{display:block;width:170vw;min-height:170dvh;cursor:zoom-out}
#photoFocus.zoomed .focus-stage>img,#photoFocus.zoomed .focus-stage>svg{width:100%;height:auto;max-width:none;max-height:none}
@media(pointer:coarse){.gallery-pointer{display:none!important}}
@media(max-width:760px){#detail .chapter-close{right:8px;top:8px;padding:10px 13px}.focus-toolbar{right:8px;top:8px}.focus-toolbar button{padding:10px;font-size:9px}}
@media(hover:none){#archive .tile:hover:not(.seen) svg{filter:grayscale(1) invert(var(--negative))}#archive .tile.seen svg,#archive .tile:active svg{filter:grayscale(0) invert(var(--negative))}}
