#gallery .character-image-grid img{object-fit:contain;object-position:center}
#gallery .character-image-grid a{background:#eaf0f6}
.character-viewer{position:fixed;inset:0;width:100%;height:100%;max-width:none;max-height:none;box-sizing:border-box;margin:0;padding:0;border:0;background:rgba(8,13,23,.97);color:#fff;overflow:hidden}
.character-viewer::backdrop{background:#080d17}
.character-viewer[open]{display:grid;grid-template-rows:56px minmax(0,1fr) 56px}
.character-viewer header{display:flex;align-items:center;justify-content:space-between;padding:0 16px;gap:12px}
.character-viewer button{min-width:44px;min-height:44px;border:1px solid #ffffff70;border-radius:8px;background:#182233;color:#fff;font-size:22px;cursor:pointer}
.character-viewer button:disabled{opacity:.3;cursor:default}
.character-viewer button:focus-visible{outline:3px solid #9ec8ff;outline-offset:2px}
.character-viewer-stage{position:relative;min-height:0;display:flex;align-items:center;justify-content:center;padding:0 64px;touch-action:pan-y}
.character-viewer-stage img{display:block;max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain}
.character-viewer-stage img[hidden]{display:none}
.character-viewer-prev,.character-viewer-next{position:absolute;top:50%;transform:translateY(-50%);z-index:1}
.character-viewer-prev{left:12px}.character-viewer-next{right:12px}
.character-viewer-stage button{min-width:30px;min-height:34px;width:30px;height:34px;padding:0;font-size:18px;border-radius:6px}
.character-viewer footer{text-align:center;font-size:14px;padding:8px 16px}
.character-viewer[open]{grid-template-rows:auto minmax(0,1fr) auto}
.character-viewer header{min-height:56px;flex-wrap:wrap;padding:6px 12px}
.character-viewer .viewer-counter-actions{display:flex;align-items:center;gap:12px}
.character-viewer .viewer-counter-actions [data-delete-image]{min-width:0;min-height:30px;background:#482735;border-color:#d58a9b;padding:3px 8px;font-size:12px}
.character-viewer .viewer-counter-actions [hidden]{display:none}
.character-viewer-actions{display:flex;justify-content:center;align-items:center;gap:8px;flex-wrap:wrap}
.character-viewer-actions a,.character-viewer-actions button{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:0 12px;border:1px solid #9ec8ff;border-radius:8px;color:#fff;background:#23456c;font-size:14px;text-decoration:none}
.character-viewer-actions [hidden]{display:none}
.character-viewer [data-status]:not(:empty){display:block;margin-bottom:8px}
@media(max-width:620px){.character-viewer-stage{padding:0 4px}.character-viewer-prev{left:4px}.character-viewer-next{right:4px}.character-viewer-stage button{background:#182233b8}.character-viewer footer{padding-bottom:max(8px,env(safe-area-inset-bottom))}}

.character-viewer-actions [data-delete-image]{background:#482735;border-color:#d58a9b}
