.media-gallery { position:relative; background:#080c06; margin:16px 0; border:1px solid var(--line2); min-width:0; }
body .media-gallery>img { display:block; width:100%; height:auto; max-height:600px; aspect-ratio:16/9; object-fit:contain; margin:0!important; border-radius:0; }
body .media-gallery>img[hidden] { display:none!important; }
.media-gallery .gallery-counter { position:absolute; top:12px; right:12px; color:#fff; background:#000b; padding:4px 9px; border-radius:16px; font-size:12px; pointer-events:none; }
body .media-gallery>button { position:absolute; top:50%; transform:translateY(-50%); border:1px solid #a5b48a; background:#0a100bdf; color:#fff; border-radius:50%; width:42px; height:42px; font-size:28px; line-height:1; cursor:pointer; z-index:2; }
.media-gallery .gallery-prev{left:10px}.media-gallery .gallery-next{right:10px}
[contenteditable=true] .media-gallery { display:flex; flex-wrap:wrap; gap:6px; padding:8px; outline:1px dashed var(--green-dim); }
body [contenteditable=true] .media-gallery>img { width:120px; max-height:90px; }
.gallery-editor-list { display:grid; gap:8px; max-height:35vh; overflow:auto; margin:12px 0; }
.gallery-editor-item { display:flex; align-items:center; gap:8px; }
.gallery-editor-item img { width:70px; height:50px; object-fit:contain; }
.gallery-editor-item input { min-width:0; flex:1; }
.table-cell-selected { outline:2px solid var(--green); outline-offset:-3px; background-color:#91ab5333; }
body :is(.wiki-view-content,.art-body,.ed-editor,.p-text) table { display:table; table-layout:fixed; max-width:100%; border-collapse:collapse; }
body :is(.wiki-view-content,.art-body,.ed-editor,.p-text) :is(td,th) { overflow-wrap:anywhere; }
body .news-compose { max-width:1100px; width:100%; }
body .news-compose .ed-card { overflow:visible; }
body .news-compose .tb { position:sticky; top:0; z-index:30; background:var(--panel); max-height:45dvh; overflow:auto; }
body .news-compose .ed-editor { max-height:none; }
.wiki-view-title [data-custom-icon] .terminal-icon { width:28px; height:28px; }

body :is(.wiki-view,.wiki-editor) .wiki-view-content p, body .ed-editor p { margin:0 0 10px; }
body .medal-progress { appearance:none; border:0; border-radius:4px; background:var(--line2); overflow:hidden; display:block; margin-top:7px; }
.medal-progress::-webkit-progress-bar { background:var(--line2); }
.medal-progress::-webkit-progress-value { background:var(--green); }
.medal-progress::-moz-progress-bar { background:var(--green); }
@media(max-width:550px) {
  .gallery-editor-item { flex-wrap:wrap; }
  .gallery-editor-item input { flex-basis:calc(100% - 80px); }
  body .medal-xp-form { flex-basis:100%; align-items:center; }
  body .medal-xp-form input[type=number] { width:100px; flex-basis:100px; }
  body .news-compose { padding:16px; }
}

.media-gallery { touch-action:pan-y pinch-zoom; }
button,select { touch-action:manipulation; }
body .wiki-view .wiki-view-content table, body .wiki-editor .wiki-view-content table { display:table; table-layout:fixed; max-width:100%; }
body .media-gallery>button { border-radius:50%!important; min-height:42px; padding:0; }
