
.hifz-top-toolbar-wrap {
  width: 100%;
  max-width: 1150px;
  margin: 0.75rem auto;
  position: relative;
}

.hifz-nav-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.hifz-nav-center {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.hifz-nav-btn,
.hifz-bookmark-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.5rem;
  padding: 0 1rem;
  background: #fff;
  color: #374151;
  font-size: 0.875rem;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.hifz-inline-toolbar--normal {
  width: 100%;
  position: relative;
  z-index: 300;
  overflow: visible;
}

.hifz-toolbar-row--normal {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.55rem;
  padding: 0.3rem 0.35rem;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.hifz-toolbar-group {
  display: flex;
  align-items: center;
  min-width: 0;
}

.hifz-toolbar-group-actions {
  justify-content: flex-start;
}

.hifz-toolbar-group-selectors {
  justify-content: center;
  gap: 0.55rem;
  min-width: 0;
  flex-wrap: nowrap;
}

.hifz-toolbar-group-audio {
  justify-content: flex-end;
}

.hifz-fullscreen-dock--normal {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  position: relative;
}

.hifz-toolbar-pill-btn,
#hifzToolbarRepeatCountBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  height: 30px;
  min-width: 0;
  padding: 0 0.55rem;
  background: #fff;
  color: #1f2937;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: none;
  white-space: nowrap;
}

.hifz-fullscreen-label {
  font-weight: 700;
  font-size: 0.74rem;
  line-height: 1;
}

.hifz-inline-audio {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  min-width: 0;
  max-width: 270px;
  height: 34px;
  padding: 0 0.55rem;
  border: 1px solid #dfe3ea;
  border-radius: 12px;
  background: #fff;
  box-shadow: none;
}

.hifz-progress-shell {
  position: relative;
  height: 0.38rem;
  flex: 1 1 auto;
  min-width: 48px;
  border-radius: 9999px;
  background: #ebe4cf;
  overflow: hidden;
}

.hifz-progress-fill {
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  bottom: 0;
  width: 0;
  border-radius: 9999px;
  background: linear-gradient(90deg, #a8c93c 0%, #cfe17e 100%);
}

.hifz-volume-range {
  width: 3rem;
  accent-color: #cabf9b;
}

.hifz-volume-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: #1f2937;
  padding: 0;
  font-size: 0.85rem;
}

.hifz-inline-select {
  height: 38px;
  padding: 0 0.8rem;
  font-size: 0.88rem;
  font-weight: 700;
  border: 1px solid #e7ebf0;
  border-radius: 12px;
  background: #fff;
}

.hifz-selector-field {
  position: relative;
  flex: 0 0 170px;
  min-width: 170px;
}

.hifz-selector-trigger {
  width: 100%;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  text-align: start;
  box-shadow: none;
}

.hifz-selector-trigger-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.88rem;
  font-weight: 700;
}

.hifz-selector-trigger-icon {
  font-size: 0.65rem;
  color: #6b7280;
  flex: 0 0 auto;
}

.hifz-native-select-hidden {
  display: none !important;
}

.hifz-selector-panel {
  position: absolute;
  top: calc(100% + 0.45rem);
  inset-inline-start: 0;
  z-index: 250;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.14);
  padding: 0.8rem;
}

.hifz-selector-panel.hidden {
  display: none !important;
}

.hifz-selector-panel-list {
  width: min(92vw, 320px);
}

.hifz-selector-panel-surah {
  width: min(92vw, 860px);
  inset-inline-start: 0;
  inset-inline-end: auto;
}

.hifz-selector-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.8rem;
}

.hifz-selector-panel-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #7c4a17;
}

.hifz-selector-close {
  width: 2.1rem;
  height: 2.1rem;
  border: none;
  border-radius: 9999px;
  background: #f3efe8;
  color: #857667;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.hifz-selector-search-wrap {
  margin-bottom: 0.8rem;
}

.hifz-selector-search {
  width: 100%;
  height: 2.2rem;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  padding: 0 0.85rem;
  outline: none;
  font-size: 0.82rem;
  font-weight: 600;
}

.hifz-selector-search:focus {
  border-color: #c9a16b;
  box-shadow: 0 0 0 3px rgba(201, 161, 107, 0.14);
}

.hifz-selector-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.hifz-selector-list-scroll {
  max-height: 340px;
  overflow-y: auto;
  padding-inline-end: 0.2rem;
}

.hifz-selector-list-item {
  width: 100%;
  min-height: 2.4rem;
  border: 1px solid #ece7df;
  border-radius: 13px;
  background: #fff;
  padding: 0.35rem 0.65rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  text-align: start;
  font-size: 0.82rem;
  font-weight: 600;
  color: #3f3f46;
  cursor: pointer;
  transition: all 0.18s ease;
}

.hifz-selector-list-item:hover,
.hifz-selector-list-item.is-active {
  border-color: #d7c6a8;
  background: #faf7f2;
  color: #7c4a17;
}

.hifz-selector-check {
  opacity: 0;
  color: #3b82f6;
}

.hifz-selector-list-item.is-active .hifz-selector-check {
  opacity: 1;
}

.hifz-surah-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.65rem;
  max-height: 400px;
  overflow-y: auto;
  padding-inline-end: 0.2rem;
}

.hifz-surah-item {
  border: 1px solid #ece7df;
  border-radius: 13px;
  background: #fff;
  min-height: 2.45rem;
  padding: 0.35rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.05rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.18s ease;
  text-decoration: none;
  color: inherit;
}

.hifz-surah-item:hover,
.hifz-surah-item.is-active {
  border-color: #d7c6a8;
  background: #faf7f2;
}

.hifz-surah-item-number {
  font-size: 0.68rem;
  font-weight: 700;
  color: #7b7b84;
}

.hifz-surah-item-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: #7c4a17;
}

.hifz-main-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 280px;
  gap: 24px;
}

.mushaf-stage {
  position: relative;
}

.mushaf-side-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-70%);
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 9999px;
  background: #fff;
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
  z-index: 50;
  transition: all 0.2s ease;
}

.mushaf-side-nav i {
  font-size: 1rem;
  line-height: 1;
}

.mushaf-side-nav-left {
  left: 0;
  transform: translate(-120%, -50%);
}

.mushaf-side-nav-right {
  right: 0;
  transform: translate(120%, -50%);
}

.mushaf-side-nav:hover {
  background: rgba(31, 41, 55, 1);
}

.hifz-toolbar-hitbox {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: transparent;
  pointer-events: auto;
}

@media (max-width: 1180px) {
  .hifz-toolbar-row--normal {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }

  .hifz-toolbar-group-audio,
  .hifz-toolbar-group-actions,
  .hifz-toolbar-group-selectors {
    justify-content: center;
  }

  .hifz-toolbar-group-selectors {
    flex-wrap: wrap;
  }

  .hifz-selector-field {
    flex: 1 1 180px;
    min-width: 160px;
  }

  .hifz-inline-audio {
    max-width: 320px;
  }
}

@media (max-width: 980px) {
  .hifz-surah-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .hifz-selector-panel-surah {
    width: min(92vw, 640px);
  }
}

@media (max-width: 640px) {
  .hifz-toolbar-row--normal {
    padding: 0.25rem 0.2rem;
  }

  .hifz-fullscreen-dock--normal {
    flex-wrap: wrap;
    justify-content: center;
  }

  .hifz-toolbar-pill-btn,
  #mushafFullscreenBtn,
  #hifzToolbarRepeatCountBtn {
    min-width: 0;
    height: 30px;
    padding: 0 0.5rem;
    font-size: 0.72rem;
  }

  .hifz-selector-field {
    width: 100%;
    flex: 1 1 100%;
    min-width: 100%;
  }

  .hifz-inline-select {
    height: 36px;
    font-size: 0.84rem;
  }

  .hifz-selector-panel-list,
  .hifz-selector-panel-surah {
    width: min(94vw, 360px);
    inset-inline-start: 50%;
    inset-inline-end: auto;
    transform: translateX(-50%);
  }

  .hifz-surah-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 340px;
  }

  .hifz-inline-audio {
    max-width: 100%;
    height: 34px;
  }
}





#hifzAyahPlayBtn {
  position: fixed;
  z-index: 10050;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

#hifzAyahPlayBtn.hidden {
  opacity: 0;
  transform: scale(0.85);
}

#hifzAyahPlayBtn:not(.hidden) {
  opacity: 1;
  transform: scale(1);
}


.hifz-toolbar-group-audio .hifz-inline-audio > * {
  display: none;
}

.hifz-toolbar-group-audio .hifz-volume-icon,
.hifz-toolbar-group-audio #miniVolume {
  display: inline-flex !important;
}

