.quran-page {
  padding-bottom: 72px;
}

.quran-topnav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 997;
  background: #00695c;
}

.quran-topnav .brand-logo {
  font-size: 1.1rem;
  width: 55%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quran-main {
  padding-top: 64px;
  min-height: calc(100vh - 64px);
}

.quran-container {
  width: 100%;
  max-width: 720px;
}

.quran-view.hidden {
  display: none;
}

.quran-ayah-card {
  border-radius: 12px;
}

.quran-ref-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.quran-arabic {
  font-family: "Amiri", serif;
  font-size: 1.75rem;
  line-height: 2.2;
  text-align: right;
  margin: 0 0 16px;
}

.quran-meta h6 {
  margin: 0 0 4px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.quran-meta p {
  margin: 0 0 12px;
}

.mono {
  font-family: "Roboto Mono", "Courier New", monospace;
  font-size: 0.95rem;
}

.wbw-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.wbw-tile {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 8px 10px;
  min-width: 72px;
  text-align: center;
  background: #fafafa;
}

.wbw-tile .wbw-ar {
  font-family: "Amiri", serif;
  font-size: 1.2rem;
  line-height: 1.4;
}

.wbw-tile .wbw-id {
  font-size: 0.75rem;
  color: #616161;
}

.wbw-en {
  font-size: 0.85rem;
  margin: 0;
}

.full-width-btn {
  width: 100%;
  margin-top: 12px;
}

.quran-ref-form .input-field {
  margin-top: 0;
}

.surah-collection {
  border: none;
  margin: 0;
}

.surah-collection .collection-item {
  cursor: pointer;
}

.surah-collection .collection-item.active {
  background: #e0f2f1;
}

.search-results .collection-item {
  cursor: pointer;
}

.search-results .result-ref {
  font-weight: 500;
  color: #00695c;
}

.search-results .search-snippet mark.hl {
  background: rgba(255, 193, 7, 0.45);
  color: inherit;
  padding: 0 0.12em;
  border-radius: 3px;
}

.search-hint,
.search-summary {
  font-size: 0.85rem;
}

.quran-bottom-tabs {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 998;
  display: flex;
  background: #fff;
  border-top: 1px solid #e0e0e0;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.quran-tab {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px 0 6px;
  color: #757575;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
}

.quran-tab i {
  font-size: 22px;
}

.quran-tab span {
  font-size: 0.65rem;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.small-chip {
  height: auto;
  line-height: 1.3;
  padding: 4px 10px;
  font-size: 0.8rem;
}

.root-chip {
  border: none;
  cursor: pointer;
  background: #e0f2f1;
  color: #00695c;
}

.wbw-root {
  display: block;
  margin: 4px auto 0;
  border: none;
  background: #e8f5e9;
  color: #2e7d32;
  border-radius: 4px;
  font-size: 0.7rem;
  padding: 2px 6px;
  cursor: pointer;
}

.related-list .collection-item,
.index-topic-btn {
  cursor: pointer;
}

.index-topic-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  border: none;
  background: #fff;
  border-bottom: 1px solid #eee;
  padding: 12px 4px;
  text-align: left;
}

.index-group-title {
  margin: 16px 0 8px;
  font-size: 0.85rem;
  text-transform: uppercase;
  color: #757575;
}

.index-breadcrumb {
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.link-btn {
  border: none;
  background: none;
  color: #00695c;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
}

.ayah-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ayah-chip {
  cursor: pointer;
}

.roots-letter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0;
}

.letter-chip {
  border: 1px solid #e0e0e0;
  background: #fafafa;
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
}

.treebank-word {
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eee;
}

.treebank-ar {
  font-family: "Amiri", serif;
  font-size: 1.1rem;
  margin-bottom: 6px;
}

.treebank-segs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.hidden {
  display: none !important;
}

.quran-tab.active {
  color: #00695c;
}

#quran-error {
  padding: 8px 16px;
}

#quran-error.hidden {
  display: none;
}

.page-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.page-input-wrap {
  margin: 0;
  width: 4.5rem;
}

.page-input-wrap input {
  margin-bottom: 0;
  text-align: center;
}

.page-of {
  font-size: 0.9rem;
}

.page-search-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
  margin-bottom: 12px;
}

.page-search-form .input-field {
  flex: 1;
  min-width: 12rem;
  margin-top: 0;
}

.page-meta {
  margin: 0 0 12px;
}

.page-search-btn {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.page-mushaf {
  font-family: 'Amiri', serif;
  font-size: 1.65rem;
  line-height: 2.1;
  text-align: justify;
  padding: 16px 18px;
  margin: 0 0 20px;
  border: 2px solid #b2dfdb;
  border-radius: 8px;
  background: #004d40;
  color: #f5f5f5;
}

.page-surah-banner {
  display: block;
  width: 100%;
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  color: #b2dfdb;
  margin: 8px 0 12px;
  padding: 6px 12px;
  border: 1px solid #4db6ac;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.15);
}

.page-ayah-segment {
  display: inline;
}

.page-ayah-segment.active .page-ayah-text {
  background: rgba(128, 203, 196, 0.35);
  border-radius: 3px;
}

.page-ayah-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.55em;
  height: 1.55em;
  margin: 0 0.1em;
  padding: 0 0.15em;
  border: 1px solid #4db6ac;
  border-radius: 50%;
  font-size: 0.52em;
  line-height: 1;
  vertical-align: middle;
  color: #b2dfdb;
  font-family: 'Amiri', serif;
  font-weight: 700;
}

.page-bottom {
  display: grid;
  gap: 20px;
}

.page-translations-list {
  display: grid;
  gap: 12px;
}

.page-translation-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 12px;
  align-items: start;
}

.page-tr-ref {
  font-weight: 600;
  color: #00695c;
  white-space: nowrap;
}

.page-translation-item p {
  margin: 0;
  line-height: 1.55;
}

.page-ayah-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.page-ayah-btn.active {
  background: #00695c;
  color: #fff;
}

@media (min-width: 600px) {
  .quran-arabic {
    font-size: 2rem;
  }
}

.hadith-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-bottom: 12px;
}

.hadith-ref-wrap {
  flex: 1;
  min-width: 8rem;
  margin: 0;
}

.hadith-ref-wrap input {
  margin-bottom: 0;
}

.hadith-book-collection .collection-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hadith-book-count {
  font-size: 0.75rem;
  min-width: 2.5rem;
}
