/* Tasabeeh 4.9.6 — screenshot fixes. Loaded last. */

/* ---- Settings: no filter-chip wall, professional grouped page ---- */
#settings-tab-nav,
.settings-chip-nav,
nav.settings-chip-nav {
  display: none !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: 0 !important;
}
#view-settings .settings-scroll {
  padding: 12px 14px calc(var(--dock, 64px) + 28px);
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}
#view-settings .settings-header-banner {
  border-radius: 18px;
  padding: 16px 18px 14px;
  margin-bottom: 12px;
}
#view-settings .banner-sub { margin: 6px 0 0; font-size: 0.86rem; line-height: 1.45; }
#view-settings .settings-search-inp {
  width: 100%;
  box-sizing: border-box;
  min-height: 46px;
  border-radius: 14px;
  padding: 10px 14px;
  margin: 0 0 14px;
  font-size: 0.95rem;
}
#view-settings .settings-group,
#view-settings section.settings-group {
  border-radius: 16px;
  margin-bottom: 12px;
  overflow: hidden;
  max-width: 100%;
}
#view-settings .settings-item,
#view-settings .sp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  min-height: 48px;
  max-width: 100%;
  box-sizing: border-box;
}
#view-settings .settings-item strong { font-size: 0.95rem; }
#view-settings .settings-item p { font-size: 0.78rem; line-height: 1.4; margin: 2px 0 0; }

/* ---- Azan prayer times: never clip, never collide ---- */
#view-azan #prayer-grid,
#view-azan .times {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 8px !important;
  padding: 8px 4px !important;
  overflow: visible !important;
  background: transparent !important;
  border: 0 !important;
  min-height: 0 !important;
}
#view-azan #prayer-grid article,
#view-azan .times article {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  width: 100% !important;
  min-height: 48px !important;
  height: auto !important;
  aspect-ratio: auto !important;
  border-radius: 14px !important;
  padding: 10px 16px !important;
  overflow: visible !important;
  box-sizing: border-box !important;
}
#view-azan #prayer-grid article .k,
#view-azan .times article .k {
  font-size: 0.95rem !important;
  font-weight: 700 !important;
  white-space: nowrap !important;
  overflow: visible !important;
  text-overflow: unset !important;
  max-width: none !important;
  line-height: 1.3 !important;
  flex: 0 0 auto !important;
}
#view-azan #prayer-grid article .t,
#view-azan .times article .t {
  font-size: 1.05rem !important;
  font-weight: 800 !important;
  font-variant-numeric: tabular-nums !important;
  white-space: nowrap !important;
  overflow: visible !important;
  letter-spacing: 0.4px !important;
  flex: 0 0 auto !important;
}
#view-azan #prayer-grid article.soon,
#view-azan .times article.soon {
  outline: none !important;
  border: 1.5px solid #D4AF37 !important;
  box-shadow: 0 0 14px rgba(212, 175, 55, 0.32) !important;
  transform: none !important;
}
#view-azan .note,
#view-azan #azan-note {
  line-height: 1.5;
  padding: 0 4px 8px;
  overflow-wrap: anywhere;
}
@media (min-width: 520px) {
  #view-azan #prayer-grid,
  #view-azan .times {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* ---- Mushaf: sebha never covers hint, close, or ayah marks ---- */
body[data-view="quran"] .subha-launcher,
body.view-quran .subha-launcher,
#view-quran:not([hidden]) ~ * .subha-launcher,
#view-quran:not([hidden]) .subha-launcher,
body[data-view="quran"] #subha-launcher {
  bottom: calc(var(--dock, 64px) + 108px + env(safe-area-inset-bottom, 0px)) !important;
  left: 14px !important;
  right: auto !important;
}
.mushaf-fs-hint,
.mushaf-reader-hint,
[class*="full-read"],
.quran-help-bar {
  padding-inline-end: 96px !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  z-index: 30;
}
.ayah-end, .ayah-num, .mushaf-ayah-mark, .verse-num {
  position: relative;
  z-index: 2;
  line-height: 1;
}

/* ---- Radio: sadaqa text and reviews ---- */
.spiritual-heart-pill,
.sadaqa-line,
#sadaqa-heart,
.spiritual-card p,
.radio-sadaqa {
  max-width: 100%;
  white-space: normal !important;
  overflow-wrap: break-word;
  line-height: 1.55 !important;
  padding-inline: 8px;
  box-sizing: border-box;
}
.reviews-empty {
  text-align: center;
  padding: 18px 12px;
  color: #cbd8d0;
  font-size: 0.92rem;
  line-height: 1.5;
}
.reviews-empty .reviews-retry {
  display: inline-block;
  margin-top: 10px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(212, 175, 55, 0.4);
  background: rgba(20, 48, 35, 0.85);
  color: #fff3b0;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

/* old expand-on-root rules removed — see follow-up sheet */

/* Keep chrome inside the phone frame */
.view, .settings-view, .chassis {
  max-width: 100vw;
  overflow-x: hidden;
}


/* ===== 4.9.6 follow-up: screenshots 12 Nov 13:30 ===== */

/* Daily wird must NEVER appear on the app chrome — only inside the sebha sheet */
body > .subha-wird,
#app > .subha-wird,
#subha-root > .subha-wird,
.subha-root > .subha-wird,
.subha-head .subha-wird,
#subha-root.is-expanded,
.subha-root.is-expanded,
.subha-head.is-expanded {
  /* un-blow the earlier mistaken expand on the root */
}
#subha-root.is-expanded,
.subha-root.is-expanded {
  width: auto !important;
  max-width: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
}
body > .subha-wird,
#app > .subha-wird,
#subha-root > .subha-wird,
.subha-root > .subha-wird {
  display: none !important;
}

/* Smaller in-app floating head */
.subha-head {
  width: 52px !important;
  height: 52px !important;
  min-width: 52px !important;
  min-height: 52px !important;
}

/* Professional sebha sheet */
.subha-sheet {
  position: fixed;
  inset: 0;
  z-index: 260;
  display: none;
  pointer-events: none;
}
.subha-sheet.open { display: block; pointer-events: auto; }
.subha-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.52);
}
.subha-sheet-card {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: calc(var(--dock, 64px) + env(safe-area-inset-bottom, 0px) + 10px);
  max-width: 440px;
  margin: 0 auto;
  max-height: min(78vh, 640px);
  overflow-y: auto;
  background: linear-gradient(175deg, #163326 0%, #0a1a13 55%, #06120d 100%);
  border: 1px solid rgba(212,175,55,0.5);
  border-radius: 26px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.65), 0 0 0 1px rgba(212,175,55,0.12);
  padding: 18px 18px 20px;
  color: #faf6e8;
  animation: subha-sheet-in 0.28s ease;
}
@keyframes subha-sheet-in {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.subha-sheet-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.subha-sheet-kicker {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: #d4af37;
  font-weight: 800;
}
.subha-sheet-close {
  border: 0;
  background: rgba(255,255,255,0.08);
  color: #fff3b0;
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
}
.subha-sheet-dhikr {
  margin: 8px 0 4px;
  font-size: 1.35rem;
  line-height: 1.65;
  font-weight: 800;
  color: #fff8e0;
  text-align: center;
}
.subha-sheet-virtue {
  margin: 0 0 12px;
  font-size: 0.8rem;
  line-height: 1.5;
  color: #b7c9bf;
  text-align: center;
}
.subha-sheet-count {
  text-align: center;
  font-size: 3.2rem;
  font-weight: 800;
  color: #d4af37;
  line-height: 1;
  margin: 4px 0 14px;
  font-variant-numeric: tabular-nums;
}
.subha-sheet-plus {
  display: block;
  width: 100%;
  min-height: 56px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(160deg, #e8c97a, #c9a44a);
  color: #06120d;
  font-size: 1.4rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(212,175,55,0.28);
}
.subha-sheet-plus:active { transform: scale(0.98); }
.subha-sheet-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.subha-sheet-row button {
  flex: 1;
  min-height: 42px;
  border-radius: 12px;
  font: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
}
.subha-sheet-cycle {
  border: 1px solid rgba(212,175,55,0.4);
  background: rgba(212,175,55,0.08);
  color: #fff3b0;
}
.subha-sheet-reset {
  border: 1px solid rgba(244, 63, 94, 0.4);
  background: rgba(244, 63, 94, 0.08);
  color: #ffb4c0;
  /* far from the +1 — sits on the opposite side of the row, visually distant */
}
.subha-sheet-float {
  display: block;
  width: 100%;
  margin-top: 10px;
  min-height: 40px;
  border-radius: 12px;
  border: 1px dashed rgba(212,175,55,0.35);
  background: transparent;
  color: #c9b56a;
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
}
.subha-sheet .subha-wird {
  display: block !important;
  margin-top: 16px;
  padding: 12px 12px 6px;
  border-top: 1px solid rgba(212,175,55,0.22);
  font-size: 0.86rem;
  color: #fff3b0;
  line-height: 1.5;
  max-height: none;
  overflow: visible;
}
.subha-sheet .subha-wird h4 {
  margin: 0 0 8px;
  font-size: 0.9rem;
  color: #d4af37;
}
.subha-wird-remain {
  background: rgba(212,175,55,0.12);
  border-radius: 12px;
  padding: 8px 10px;
  margin-bottom: 8px;
  color: #fff8e0;
  font-weight: 700;
}
.subha-sheet .subha-wird li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.subha-sheet .subha-wird .done { opacity: 0.5; text-decoration: line-through; }

/* Azan: notes never overlap times; no leftover ovals; rows always readable */
#view-azan #prayer-grid,
#view-azan .times {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  position: relative !important;
  z-index: 2;
  margin: 8px 0 14px !important;
  background: transparent !important;
  border: 0 !important;
  min-height: 0 !important;
  grid-template-columns: none !important;
}
#view-azan #prayer-grid article,
#view-azan .times article {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  position: relative !important;
  z-index: 2;
  width: 100% !important;
  min-height: 52px !important;
  height: auto !important;
  aspect-ratio: auto !important;
  border-radius: 14px !important;
  padding: 10px 16px !important;
  overflow: visible !important;
  background: rgba(12, 32, 24, 0.92) !important;
  border: 1px solid rgba(212,175,55,0.18) !important;
  transform: none !important;
}
#view-azan #prayer-grid article::before,
#view-azan #prayer-grid article::after,
#view-azan .times article::before,
#view-azan .times article::after {
  content: none !important;
  display: none !important;
  background: none !important;
}
#view-azan .azan-actions { display:flex; flex-wrap:wrap; gap:8px; }
#view-azan #azan-note,
#view-azan .note,
#view-azan .azan-note {
  position: static !important;
  display: block !important;
  z-index: 1;
  margin: 8px 0 24px !important;
  padding: 12px 14px !important;
  background: rgba(8, 22, 16, 0.95) !important;
  border-radius: 12px !important;
  border: 1px solid rgba(212,175,55,0.15);
  line-height: 1.6 !important;
  color: #b7c9bf;
  font-size: 0.8rem;
  max-width: 100%;
  float: none !important;
  clear: both !important;
  overflow-wrap: anywhere;
}
/* Give lists room so Mazen/sebha never cover the last review */
#reviews-list, .reviews, #view-radio, #view-azan {
  padding-bottom: calc(var(--dock, 64px) + 72px);
}

/* ===== 4.9.6 header reverse + contextual drawer ===== */
/* Brand (logo + تسابيح) on the LEFT; menu + user + Mesue on the RIGHT, menu at the right edge. */
header.top {
  direction: ltr !important;
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
}
header.top .top-leading {
  justify-self: auto !important;
  margin-inline-end: auto !important;
  order: 1 !important;
  min-width: 0 !important;
}
header.top .top-trailing {
  direction: rtl !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 8px !important;
  justify-self: auto !important;
  flex-shrink: 0 !important;
  order: 2 !important;
  margin: 0 !important;
}
header.top .brand {
  direction: ltr !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}
header.top .brand-logo {
  cursor: default !important;
}
header.top .top-menu-btn {
  position: relative !important;
  width: 42px !important;
  height: 42px !important;
  min-width: 42px !important;
  min-height: 42px !important;
  padding: 0 !important;
  border-radius: 13px !important;
  border: 1.5px solid rgba(232, 201, 92, 0.75) !important;
  background: linear-gradient(160deg, rgba(245, 220, 120, 0.38) 0%, rgba(154, 116, 24, 0.55) 100%) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45), 0 0 10px rgba(212, 175, 55, 0.35), inset 0 1px 0 rgba(255, 243, 176, 0.35) !important;
  color: #FFF8D0 !important;
  animation: tas-menu-pulse 1.7s ease-out 0s 3 !important;
}
header.top .top-menu-btn:hover,
header.top .top-menu-btn:focus-visible,
header.top .top-menu-btn[aria-expanded="true"] {
  background: linear-gradient(160deg, #F0D56A 0%, #C6A03A 100%) !important;
  border-color: #FFF3B0 !important;
  transform: scale(1.05) !important;
}
.top-menu-bars {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 18px;
  height: 16px;
  margin: 0 auto;
}
.top-menu-bars i {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: #FFF8D0;
  box-shadow: 0 0 6px rgba(255, 243, 176, 0.7);
  font-style: normal;
}
header.top .top-menu-btn:hover .top-menu-bars i,
header.top .top-menu-btn[aria-expanded="true"] .top-menu-bars i {
  background: #06100C;
  box-shadow: none;
}
@keyframes tas-menu-pulse {
  0%, 100% { box-shadow: 0 4px 14px rgba(0,0,0,.45), 0 0 0 0 rgba(232, 201, 92, .55); }
  45% { box-shadow: 0 4px 18px rgba(0,0,0,.5), 0 0 0 8px rgba(232, 201, 92, 0); }
}
@media (prefers-reduced-motion: reduce) {
  header.top .top-menu-btn { animation: none !important; }
}

/* Drawer: only the active tab's content; hide the cross-tab switcher. Stay inside the screen. */
#mesue-drawer-nav { display: none !important; height: 0 !important; overflow: hidden !important; padding: 0 !important; margin: 0 !important; border: 0 !important; }
#mesue-smart-drawer {
  max-width: 100vw !important;
  width: min(100vw, 26rem) !important;
  right: 0 !important;
  left: auto !important;
  overflow-x: hidden !important;
  box-sizing: border-box !important;
}
#mesue-smart-drawer-backdrop.open,
#mesue-smart-drawer.open { max-width: 100vw; }
#mesue-drawer-content {
  overflow-x: hidden !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* t304: كومبو صوت الأذان في صف مستقل من غير تداخل */
#view-azan .azan-voice-picker,
#view-azan .azan-sound,
#view-azan #azan-sound-wrap,
#view-azan label[for="azan-sound-select"] {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  grid-column: 1 / -1 !important;
  position: relative !important;
  z-index: 8;
  margin: 12px 0 18px !important;
  float: none !important;
  overflow: visible !important;
  inset: auto !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  transform: none !important;
}
#view-azan #azan-sound-select,
#view-azan .azan-voice-picker select {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  min-height: 48px;
  font-size: 16px;
  position: relative;
  z-index: 9;
  background: #0e2218;
  color: #faf6e8;
  border: 1px solid rgba(212,175,55,0.45);
  border-radius: 12px;
  padding: 10px 12px;
  appearance: auto;
  -webkit-appearance: menulist;
  margin: 6px 0 0;
  float: none !important;
  transform: none !important;
}
#view-azan .azan-actions {
  display: flex !important;
  flex-wrap: wrap;
  gap: 8px;
  grid-template-columns: none !important;
  width: 100%;
  position: relative;
  z-index: 2;
}
#view-azan .azan-times,
#view-azan .azan-grid,
#view-azan .prayer-row,
#view-azan .azan-notes,
#view-azan .azan-note {
  position: relative;
  z-index: 1;
  clear: both;
}

/* t304b: زر السبحة شمال، مازن يمين؛ كومبو الأذان في مكانه الطبيعي */
#subha-launcher,
.subha-launcher,
button#subha-launcher {
  left: 12px !important;
  right: auto !important;
}
#view-azan .azan-voice-picker {
  position: static !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  width: 100% !important;
  max-width: 100% !important;
  grid-column: 1 / -1 !important;
  float: none !important;
  inset: auto !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  transform: none !important;
  margin: 14px 0 8px !important;
  z-index: 3;
  background: #0e2218 !important;
}
#view-azan .times,
#view-azan #prayer-grid {
  position: relative !important;
  z-index: 1;
  overflow: visible;
  margin-bottom: 8px;
}
#view-azan #azan-note,
#view-azan .note,
#view-azan .azan-note {
  position: static !important;
  display: block !important;
  clear: both !important;
  float: none !important;
  inset: auto !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  transform: none !important;
  margin: 12px 0 20px !important;
  z-index: 1;
  width: 100%;
}
