/* Display-only: preserve every source pixel and the original aspect ratio. */
#mushaf-popup.mushaf-fit-dialog {width:min(96vw,1000px);max-height:96vh;padding:12px;border:1px solid #c9ad65;border-radius:16px;overflow:auto}
#mushaf-popup.mushaf-fit-dialog:has(#mushaf-reader) {
  box-sizing:border-box; width:min(98vw,1100px); height:98vh; height:98dvh;
  max-width:98vw; max-height:98vh; max-height:98dvh;
  margin:auto; padding:6px; border:1px solid #c9ad65; border-radius:12px;
  overflow:hidden; background:#fff;
}
#mushaf-popup::backdrop {background:rgb(17 34 30 / .65)}
#mushaf-popup #mushaf-popup-body {height:100%; min-height:0}
#mushaf-popup #mushaf-reader {
  box-sizing:border-box; position:relative; display:grid;
  grid-template-rows:auto minmax(0,1fr); gap:4px;
  height:100%; min-height:0; padding:0 0 34px; margin:0;
}
#mushaf-popup #mushaf-reader>.actions {
  display:grid; grid-template-columns:repeat(3,minmax(0,1fr));
  direction:rtl; align-items:stretch; gap:6px; margin:0; padding:0;
}
#mushaf-popup .actions>button {
  box-sizing:border-box; width:100%; min-width:0; min-height:42px;
  margin:0; padding:8px 4px; border-radius:7px; font-size:16px;
  line-height:1.35; box-shadow:none; align-self:stretch;
}
#mushaf-popup #mushaf-prev {grid-column:1; grid-row:1}
#mushaf-popup #mushaf-close {grid-column:2; grid-row:1}
#mushaf-popup #mushaf-next {grid-column:3; grid-row:1}
#mushaf-popup .actions>label {
  position:absolute; inset-inline:0; bottom:0; height:28px;
  display:flex; align-items:center; justify-content:center; gap:8px;
  margin:0; padding:0; font-size:14px; line-height:1;
}
#mushaf-popup #mushaf-page {width:auto; min-width:80px; height:28px; margin:0; padding:2px 8px; font-size:14px}
#mushaf-popup #mushaf-reader>.mushaf-image {
  display:block; box-sizing:border-box; width:100%; height:100%;
  min-height:0; max-width:100%; max-height:100%; margin:0; padding:0;
  object-fit:contain; object-position:center; border:0; border-radius:0;
}
@media(max-width:480px) {
  #mushaf-popup.mushaf-fit-dialog:has(#mushaf-reader) {width:100vw;max-width:100vw;height:100vh;height:100dvh;max-height:100dvh;padding:4px;border-radius:0}
  #mushaf-popup .actions>button {font-size:14px;min-height:40px;padding:7px 2px}
  #mushaf-popup #mushaf-reader>.actions {gap:4px}
}
