/* Borderless image centered in the viewport, with an outside close control. */
body.hidamari.kd-refined dialog.kd-work-preview {position:fixed;inset:0;margin:auto;box-sizing:border-box;width:fit-content;height:fit-content;max-width:calc(100vw - 48px);max-height:calc(100dvh - 112px);padding:0;border:0;border-radius:0;background:transparent;overflow:visible;box-shadow:none;}
body.hidamari.kd-refined dialog.kd-work-preview::backdrop {background:rgb(8 8 8 / .75);}
body.hidamari.kd-refined dialog.kd-work-preview img {display:block;width:auto;height:auto;max-width:calc(100vw - 48px);max-height:calc(100dvh - 112px);object-fit:contain;margin:0;border:0;border-radius:0;}
body.hidamari.kd-refined dialog.kd-work-preview button {position:absolute;top:-48px;right:-12px;width:44px;height:44px;min-width:44px;min-height:44px;padding:0;display:grid;place-items:center;border:0;border-radius:0;background:transparent;color:#fff;font:32px/1 Arial,sans-serif;cursor:pointer;}
body.hidamari.kd-refined dialog.kd-work-preview button:focus-visible {outline:2px solid #fff;outline-offset:-4px;}
/* Circular close control aligned with the image's upper-right edge. */
body.hidamari.kd-refined dialog.kd-work-preview button {top:-52px;right:0;border:1px solid #fff;border-radius:50%;font-size:28px;}
body.hidamari.kd-refined dialog.kd-work-preview button:focus-visible {outline:2px solid #fff;outline-offset:4px;}
/* Place the unframed cross directly on the image corner. */
body.hidamari.kd-refined dialog.kd-work-preview button {top:-22px;right:-22px;border:0;border-radius:0;background:transparent;color:#fff;text-shadow:0 1px 3px rgba(0,0,0,.8);}
/* Separate the close hit area from the image by 8px; align right edges. */
body.hidamari.kd-refined dialog.kd-work-preview button {top:-52px;right:0;border:0;border-radius:0;background:transparent;text-shadow:none;}
/* User preference: close via backdrop or Escape, without a visible close button. */
body.hidamari.kd-refined dialog.kd-work-preview button {display:none;}
/* Do not outline the image container when the modal receives focus. */
body.hidamari.kd-refined dialog.kd-work-preview,
body.hidamari.kd-refined dialog.kd-work-preview:focus-visible {outline:none!important;}
body.hidamari.kd-refined dialog.kd-work-preview button {display:grid;top:-52px;right:0;border:0;background:transparent;}
body.hidamari.kd-refined dialog.kd-work-preview button:focus:not(:focus-visible) {outline:none;}
body.hidamari.kd-refined dialog.kd-work-preview button:focus-visible {outline:2px solid #fff;outline-offset:2px;}
