/* 4.8.11 (t280u): side-menu screens are full-screen pages inside the phone frame
   (no floating side panel, no horizontal overflow), header with back button, المفضلة screen, mute button. */
html, body { max-width: 100%; overflow-x: hidden; }

#mesue-smart-drawer {
  inset: 0 !important; left: 0 !important; right: 0 !important;
  width: 100% !important; max-width: 100% !important; min-width: 0 !important;
  height: 100vh; height: 100dvh !important;
  border: 0 !important; border-radius: 0 !important; box-shadow: none !important;
  background: #07120D !important;
  transform: translateX(100%);
  overflow: hidden !important;
}
#mesue-smart-drawer.open { transform: none !important; }
#mesue-smart-drawer-backdrop.open { background: #07120D !important; backdrop-filter: none !important; }
body.mesue-drawer-open #subha-bubble-root, body.mesue-drawer-open .subha-head, body.mesue-drawer-open .mushaf-reader-dock { display: none !important; }

#mesue-smart-drawer .mesue-drawer-header {
  flex: 0 0 auto; display: flex !important; justify-content: flex-start !important; align-items: center; gap: 10px;
  padding: 10px 14px !important; min-height: 56px;
  background: #0B1B14 !important; border-bottom: 1px solid rgba(212,175,55,.22) !important;
}
#mesue-smart-drawer .mesue-drawer-back {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  font-size: 1.25rem; line-height: 1; color: #FFF3B0; background: rgba(212,175,55,.10);
  border: 1px solid rgba(212,175,55,.35); cursor: pointer; padding: 0;
}
#mesue-smart-drawer .mesue-drawer-titlebox {
  flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 1.02rem; color: #FFF3B0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#mesue-smart-drawer #mesue-drawer-title { overflow: hidden; text-overflow: ellipsis; }

#mesue-smart-drawer .mesue-drawer-nav {
  flex: 0 0 auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px;
  padding: 8px 14px; border-bottom: 1px solid rgba(212,175,55,.15); background: #0A1812;
}
#mesue-smart-drawer .mesue-drawer-nav button {
  display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0;
  padding: 7px 2px; border-radius: 12px; font: inherit; font-size: .78rem; font-weight: 700;
  color: #E9DFC0; background: rgba(255,255,255,.03); border: 1px solid rgba(212,175,55,.18); cursor: pointer;
}
#mesue-smart-drawer .mesue-drawer-nav button span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
#mesue-smart-drawer .mesue-drawer-nav button.active { background: linear-gradient(135deg, #D4AF37, #9A7418); color: #06100C; border-color: transparent; }

#mesue-smart-drawer .mesue-drawer-body {
  flex: 1 1 auto; min-height: 0; overflow-y: auto !important; overflow-x: hidden !important;
  padding: 14px 14px calc(24px + var(--sab-x, 0px)) !important; -webkit-overflow-scrolling: touch;
}
/* everything inside a menu page stays inside the screen */
#mesue-smart-drawer .mesue-drawer-body * { max-width: 100%; }
#mesue-smart-drawer .mesue-drawer-body input,
#mesue-smart-drawer .mesue-drawer-body select,
#mesue-smart-drawer .mesue-drawer-body textarea { min-width: 0; }
#mesue-smart-drawer [style*="display:flex"], #mesue-smart-drawer [style*="display: flex"],
#mesue-smart-drawer .drawer-action-row, #mesue-smart-drawer .drawer-input-row,
#mesue-smart-drawer .mushaf-drawer-tools > div, #mesue-smart-drawer .mushaf-top { flex-wrap: wrap; }
#mesue-smart-drawer .drawer-chips-scroll { flex-wrap: nowrap !important; overflow-x: auto !important; max-width: 100%; }
#mesue-smart-drawer .drawer-chips-scroll > * { max-width: none; flex: 0 0 auto; }
#mesue-smart-drawer .mushaf-drawer-tools { position: static !important; width: auto !important; margin: 0 0 12px !important; }
#mesue-smart-drawer .mushaf-drawer-tools .pill, #mesue-smart-drawer .mushaf-more { position: static !important; }

/* settings rows: select + preview button wrap instead of overflowing */
.sp-inline { flex-wrap: wrap; min-width: 0; max-width: 100%; }
.sp-inline select { min-width: 0; max-width: 100%; flex: 1 1 150px; }

/* favorites screen */
.fav-screen { display: block; }
.fav-screen .fav-group { margin: 0 0 14px; }
.fav-screen .fav-glabel { color: #D4AF37; font-size: .82rem; font-weight: 700; margin: 0 2px 6px; }
.fav-screen .fav-row {
  display: flex; align-items: center; gap: 8px; width: 100%; margin: 0 0 8px; padding: 10px 12px;
  background: rgba(255,255,255,.035); border: 1px solid rgba(212,175,55,.18); border-radius: 14px; contain-intrinsic-size: auto 56px;
}
.fav-screen .fav-name {
  flex: 1 1 auto; min-width: 0; text-align: right; background: none; border: 0; padding: 0; font: inherit; font-weight: 700;
  color: #FAF6E8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
}
.fav-screen .fav-go {
  flex: 0 0 auto; padding: 6px 12px; border-radius: 99px; font: inherit; font-size: .8rem; font-weight: 700;
  color: #06100C; background: linear-gradient(135deg, #D4AF37, #9A7418); border: 0; cursor: pointer;
}
.fav-screen .fav-star { flex: 0 0 auto; }
.fav-screen .fav-empty { text-align: center; color: rgba(255,243,176,.75); padding: 48px 16px; line-height: 1.9; }
.fav-screen .fav-empty small { color: rgba(255,243,176,.55); }
.fav-screen .fav-empty-ic { font-size: 2.4rem; color: #D4AF37; margin-bottom: 6px; }

/* volume: speaker icon is a real mute button */
button.vol-icon {
  flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; padding: 0;
  background: rgba(212,175,55,.10); border: 1px solid rgba(212,175,55,.35); color: #FFF3B0; cursor: pointer; font-size: 1.05rem !important;
}
button.vol-icon[aria-pressed="true"] { background: rgba(180,60,60,.25); border-color: rgba(255,120,120,.5); }
#mesue-smart-drawer .mushaf-top-row, #mesue-smart-drawer .mushaf-meta-row { display: flex !important; flex-wrap: wrap !important; gap: 6px !important; align-items: center; max-width: 100%; overflow: visible !important; }
#mesue-smart-drawer .mushaf-top-row .reciter { flex: 1 1 140px; min-width: 0; width: auto !important; }
/* the hidden subha head was still display:grid at the top corner, covering the menu logo and stealing taps */
.subha-head[hidden] { display: none !important; }
/* beat the global gold-button rule (royal-theme: button{... !important}) where it hurts */
#mesue-smart-drawer .fav-screen button.fav-name { background: none !important; border: 0 !important; box-shadow: none !important; color: #FAF6E8 !important; transform: none !important; }
#mesue-smart-drawer .fav-screen button.fav-go { background: linear-gradient(135deg, #D4AF37, #9A7418) !important; color: #06100C !important; border: 0 !important; box-shadow: none !important; }
#mesue-smart-drawer .mesue-drawer-nav button.active { background: linear-gradient(135deg, #D4AF37, #9A7418) !important; color: #06100C !important; border-color: transparent !important; box-shadow: 0 4px 14px rgba(212,175,55,.35) !important; }
