/* An explicit viewing area enlarges even small saved profile photos. */
body dialog.nw-photo-viewer{position:fixed!important;inset:0!important;box-sizing:border-box!important;width:96vw!important;height:96dvh!important;max-width:none!important;max-height:none!important;margin:auto!important;padding:0!important;background:#000!important;color:#d8d5d0;border:0!important;box-shadow:none!important;overflow:hidden!important}
body dialog.nw-photo-viewer::backdrop{background:#000f}
body dialog.nw-photo-viewer:not([open]){display:none!important}
body dialog.nw-photo-viewer>img{display:block!important;width:100%!important;height:100%!important;max-width:none!important;max-height:none!important;object-fit:contain!important;margin:0!important;border:0!important;border-radius:0!important}
body dialog.nw-photo-viewer>button.nw-photo-close{position:absolute!important;z-index:2;top:max(8px,env(safe-area-inset-top))!important;right:max(8px,env(safe-area-inset-right))!important;display:flex!important;align-items:center;justify-content:center;width:44px!important;height:44px!important;min-height:44px!important;padding:0!important;margin:0!important;border:1px solid #ffffff55!important;border-radius:50%!important;background:#08080bd9!important;color:#fff!important;-webkit-text-fill-color:#fff!important;box-shadow:none!important;font:32px/1 Arial,sans-serif!important;cursor:pointer}
body dialog.nw-photo-viewer>.nw-photo-actions{position:absolute;z-index:2;bottom:max(12px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);display:flex;justify-content:center;gap:10px;max-width:calc(100% - 24px);}
body dialog.nw-photo-viewer .nw-photo-actions>a{display:block;width:max-content;min-height:44px;box-sizing:border-box;margin:0;padding:9px 16px;font:14px/1.6 Arial,sans-serif;background:#08080bdd;color:#d8d5d0!important;-webkit-text-fill-color:#d8d5d0!important;border:1px solid #625c60;text-decoration:none;white-space:nowrap}
body dialog.nw-photo-viewer .nw-photo-actions>[hidden]{display:none!important}
body dialog.nw-photo-viewer>[hidden]{display:none!important}
body dialog.nw-photo-viewer :is(button,a):focus-visible{outline:2px solid #e68b9b;outline-offset:2px}
html:has(.nw-photo-viewer[open]){overflow:hidden}
@media(max-width:650px){body dialog.nw-photo-viewer{width:100vw!important;height:100dvh!important}}
body #buddypress .nw-photo-image{display:block!important;width:max-content;max-width:100%;margin:10px 0;cursor:zoom-in;background:none!important;border:0!important;padding:0!important}
body #buddypress .nw-photo-image img{display:block!important;width:auto!important;height:auto!important;max-width:min(220px,100%)!important;max-height:180px!important;object-fit:contain;border:1px solid #4a4144!important}
body #buddypress .nw-photo-composer{display:flex;flex-wrap:wrap;align-items:center;gap:10px;padding:12px 0;color:#bcb9b3;background:transparent;border:0}
body #buddypress .nw-photo-composer>small{flex-basis:100%;font:12px/1.7 Arial,sans-serif;color:#aaa6a1}
body #buddypress .nw-photo-status{flex-basis:100%;margin:0;font:13px/1.7 Arial,sans-serif;color:#d8d5d0}
body #buddypress .nw-photo-composer>[hidden],body #buddypress .nw-photo-composer label[hidden]{display:none!important}
body #buddypress .nw-photo-upload-label{display:inline-flex;flex-direction:column;align-items:flex-start;gap:7px;padding:8px 12px;border:1px solid #625c60;background:#19191c;color:#d8d5d0;font:14px/1.6 Arial,sans-serif;cursor:pointer;box-sizing:border-box;max-width:100%}
body #buddypress .nw-photo-upload-label input{max-width:100%;font:12px/1.7 Arial,sans-serif;background:#19191c;color:#d8d5d0;border:0}
body #buddypress .nw-photo-composer button,body #buddypress .nw-albums button{min-height:44px;padding:8px 12px;border:1px solid #625c60;background:#19191c;color:#d8d5d0;font:13px/1.6 Arial,sans-serif}
body #buddypress .nw-photo-help{font:12px/1.7 Arial,sans-serif;color:#aaa6a1}
body #buddypress .nw-photo-album{border-top:1px solid #3d3639;padding:18px 0;margin:18px 0}
body #buddypress .nw-photo-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
body #buddypress .nw-photo-grid figure{margin:0;padding:0;min-width:0}
body #buddypress .nw-photo-grid .nw-photo-image{width:100%;margin:0 0 8px}
body #buddypress .nw-photo-grid .nw-photo-image img{width:100%!important;max-width:100%!important;height:140px!important;object-fit:cover}
body #buddypress .nw-photo-grid button{font-size:11px;padding:5px 8px}
body #buddypress .avatar-history-table{background:#111113;color:#d8d5d0;border:1px solid #51494c}
body #buddypress .avatar-history-table :is(th,td){background:#111113;color:#d8d5d0;border-color:#51494c}
body #buddypress .avatar-history-table .selected td{background:#272327;color:#eeeae5}
body #buddypress .avatar-history-table .selected img{outline:2px solid #e68b9b;outline-offset:3px}
body #buddypress .nw-cover-view{position:absolute;inset:0;width:100%;height:100%;background:transparent;border:0;cursor:zoom-in;}
body #buddypress .nw-cover-view:focus-visible{outline:2px solid #e68b9b;outline-offset:-4px}
@media(max-width:650px){body #buddypress .nw-photo-grid{grid-template-columns:repeat(2,minmax(0,1fr))}body #buddypress .nw-photo-grid .nw-photo-image img{height:130px!important}}

/* Preserve detail instead of stretching tiny legacy avatars across the screen. */
body dialog.nw-photo-viewer>img{position:absolute;inset:0;margin:auto;max-width:min(100%,var(--nw-view-width,100%))!important;max-height:min(100%,var(--nw-view-height,100%))!important}

/* NiteWave · center photo viewing and use a hand for clickable photos · 2026-11-21 */
body dialog.nw-photo-viewer>img {
  position:absolute!important;
  top:50%!important;
  left:50%!important;
  right:auto!important;
  bottom:auto!important;
  transform:translate(-50%,-50%)!important;
  margin:0!important;
  width:min(calc(100% - 32px),var(--nw-view-width,100%))!important;
  height:min(calc(100% - 160px),var(--nw-view-height,100%))!important;
  max-width:calc(100% - 32px)!important;
  max-height:calc(100% - 160px)!important;
  object-fit:contain!important;
}
body :is([data-nw-photo-view],[data-nw-photo-view] img,.nw-photo-image,.nw-photo-image img,.nw-cover-view,.nw-cover-photo-control summary,#item-header-avatar summary,#item-header-avatar img,.activity-avatar img,.acomment-avatar img) {
  cursor:pointer!important;
}
