/* Khalwati R112: a single compact toolbar and a quiet footer. */
html,body.mq-body{margin:0!important;width:100%;height:100%;overflow:hidden!important;}
body.mq-body .mq-app{
  position:fixed;inset:0;box-sizing:border-box;width:100%;height:100vh;height:100dvh;
  display:grid;grid-template-columns:minmax(0,1fr);
  grid-template-rows:auto minmax(0,1fr) auto 6px;
  min-width:0;min-height:0;overflow:hidden;isolation:isolate;
}
body.mq-body .mq-top{
  grid-row:1;display:grid;grid-template-columns:44px minmax(0,1fr) auto;
  gap:4px;align-items:center;min-width:0;min-height:0;
  padding:calc(4px + env(safe-area-inset-top,0px)) max(6px,env(safe-area-inset-right,0px)) 4px max(6px,env(safe-area-inset-left,0px));
  border-bottom:1px solid var(--mq-gold-soft);box-shadow:0 2px 7px rgba(0,0,0,.08);
}
body.mq-body .mq-home{
  display:grid!important;place-items:center;box-sizing:border-box;width:44px;height:44px;
  border:1px solid rgba(232,207,150,.28);border-radius:11px;
  background:rgba(255,255,255,.055);color:#f3dfa6;text-decoration:none;
}
body.mq-body .mq-home svg{width:23px;height:23px;stroke-width:1.8;}
body.mq-body .mq-surah{
  box-sizing:border-box;display:flex;justify-content:center;align-items:flex-start;
  width:100%!important;min-width:0!important;height:44px;min-height:44px;
  padding:3px 7px;gap:1px;background:transparent;border-radius:8px;
}
body.mq-body .mq-surah span{font-size:16px;line-height:1.3;}
body.mq-body .mq-surah small{font-size:11px;line-height:1.2;}
body.mq-body .mq-tools{display:grid;grid-auto-flow:column;grid-auto-columns:48px;gap:0;min-width:0;}
body.mq-body .mq-tools .mq-tool{box-sizing:border-box;min-width:0;width:48px;height:44px;padding:2px;gap:1px;border-radius:9px;}
body.mq-body .mq-main{grid-row:2;min-width:0;min-height:0;overflow:hidden;}
body.mq-body .mq-stage{min-width:0;min-height:0;}
body.mq-body .mq-bottom{
  grid-row:3;gap:8px;padding:4px max(10px,env(safe-area-inset-right,0px)) calc(4px + env(safe-area-inset-bottom,0px)) max(10px,env(safe-area-inset-left,0px));
  min-width:0;min-height:0;box-shadow:none;
}
body.mq-body .mq-nav{width:44px;height:44px;box-sizing:border-box;font-size:20px;}
body.mq-body #kr112-footer{
  grid-row:4;box-sizing:border-box;height:6px;min-height:0;
  margin:0;padding:0;border:0;border-top:1px solid var(--mq-gold);
  background:linear-gradient(90deg,#073b2e,#0b503d,#073b2e);pointer-events:none;
}
@media(max-width:660px){
  body.mq-body .mq-tools{grid-auto-columns:44px;}
  body.mq-body .mq-tools .mq-tool{width:44px;height:44px;}
  body.mq-body .mq-tool span{display:none;}
  body.mq-body .mq-tool svg{width:22px;height:22px;}
  body.mq-body .mq-surah span{font-size:15px;}
}
@media(max-width:360px){
  body.mq-body .mq-top{grid-template-columns:40px minmax(0,1fr) auto;gap:2px;}
  body.mq-body .mq-home{width:40px;height:44px;}
  body.mq-body .mq-tools{grid-auto-columns:40px;}
  body.mq-body .mq-tools .mq-tool{width:40px;}
  body.mq-body .mq-surah{padding-inline:4px;}
  body.mq-body .mq-surah span{font-size:14px;}
  body.mq-body .mq-surah small{font-size:10px;}
}
@media(orientation:landscape) and (max-height:500px){
  body.mq-body .mq-surah{flex-direction:column;align-items:flex-start;gap:1px;}
}
@media print{
  body.mq-body .mq-top,body.mq-body .mq-bottom,body.mq-body #kr112-footer{display:none!important;}
  body.mq-body .mq-app{grid-template-rows:0 minmax(0,1fr) 0 0;}
}
