* {
  box-sizing: border-box;
}

.home-eyebrow {
  margin: 0 0 5px;
  color: #526581;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.random-ayah-card {
  max-width: 760px;
  margin-top: 18px;
  padding: 22px;
  border: 1px solid #dfe7f3;
  border-radius: 14px;
  background: linear-gradient(145deg, #ffffff, #f8fbff);
  transition: opacity 120ms ease;
}

.random-ayah-card.is-loading,
.search-results.is-loading {
  opacity: 0.55;
}

.random-ayah-reference {
  margin: 0 0 14px;
  color: #44618b;
  font-size: 13px;
  font-weight: 700;
}

.random-ayah-arabic {
  direction: rtl;
  margin: 0 0 16px;
  color: #0f2f78;
  font-family: "Scheherazade New", "Amiri Quran", "Noto Naskh Arabic", serif;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.9;
}

.random-ayah-translation {
  font-size: 16px;
}

.random-ayah-read {
  margin-top: 18px;
}

.text-btn {
  margin: 10px 0 0;
  padding: 7px 0;
  border: 0;
  background: transparent;
  color: var(--brand-deep);
  font-weight: 600;
}

.text-btn:hover {
  background: transparent;
  color: #123d8f;
  text-decoration: underline;
}

.home-summary {
  margin: 20px 0 12px;
  color: #64748b;
  font-size: 13px;
}

.search-card {
  max-width: 900px;
  margin: 20px auto;
  padding: clamp(16px, 4vw, 28px);
  border: 1px solid #dfe7f3;
  border-radius: 14px;
  background: #ffffff;
}

.search-card-heading h2 {
  margin: 0 0 8px;
}

.search-input-wrap {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding: 6px 7px 6px 14px;
  border: 1px solid #cfdcf0;
  border-radius: 12px;
  background: #f8fbff;
}

.search-input-wrap input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
}

.search-input-wrap button {
  padding: 9px 16px;
  border-radius: 9px;
}

.search-status {
  min-height: 20px;
  margin: 10px 0;
  color: #64748b;
  font-size: 13px;
}

.search-results {
  display: grid;
  gap: 10px;
  transition: opacity 120ms ease;
}

.search-result {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid #e1e9f5;
  border-radius: 12px;
  background: #ffffff;
  color: var(--text);
  text-align: left;
}

.search-result:hover {
  background: #f7faff;
}

.search-result-surah {
  grid-template-columns: auto 1fr auto;
  align-items: center;
}

.search-result-ref {
  color: #2b5ca4;
  font-size: 13px;
  font-weight: 700;
}

.search-result-arabic,
.arabic-name {
  direction: rtl;
  font-family: "Scheherazade New", "Amiri Quran", "Noto Naskh Arabic", serif;
}

.search-result-arabic {
  color: #0f2f78;
  font-size: 24px;
  line-height: 1.75;
}

.search-result-translation {
  color: #334155;
  line-height: 1.55;
}

.reader-status {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(360px, calc(100vw - 36px));
  margin: 0;
  padding: 0;
  border-radius: 10px;
  background: #0f172a;
  color: #ffffff;
  font-size: 13px;
  z-index: 100;
}

.reader-status:not(:empty) {
  padding: 10px 14px;
}

.reader-error {
  color: #b42318;
}

:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-soft: #f8fbff;
  --line: #d9e5f6;
  --brand: #2b6eea;
  --brand-deep: #1f57bb;
  --text: #0f172a;
  --muted: #4b5c78;
  --sticky-header-height: 58px;
  --sticky-app-top-height: 118px;
}

body {
  margin: 0;
  font-family: "Figtree", "Inter", "Segoe UI", Arial, sans-serif;
  background: #ffffff;
  color: var(--text);
}

.container {
  max-width: none;
  margin: 0;
  width: 100%;
  padding: 10px 14px 24px;
}

.site-header h1 {
  margin: 0;
}

.site-header {
  background: #f3f7fc;
  border-bottom: 1px solid #dde7f5;
  padding: 8px 10px;
  border-radius: 10px;
  position: sticky;
  top: 0;
  z-index: 60;
  transform: translateY(0);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.site-header.header-hidden {
  transform: translateY(calc(-100% - 12px));
  box-shadow: none;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-title {
  font-weight: 800;
  color: var(--brand-deep);
  letter-spacing: 0.2px;
}

.subtitle {
  margin-top: 8px;
  color: #475569;
}

.site-nav {
  display: none;
  flex-direction: column;
  gap: 8px;
  margin: 18px 0;
}

.site-nav.is-open {
  display: flex;
}

.menu-toggle {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.menu-toggle:hover {
  background: #f1f5f9;
}

.menu-toggle i {
  font-size: 18px;
}

.site-link {
  text-decoration: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  padding: 9px 12px;
  border-radius: 999px;
  font-size: 14px;
}

.site-link.active,
.site-link:hover {
  background: var(--brand);
  color: #ffffff;
  border-color: var(--brand);
}

.content-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 14px;
}

.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.primary-link {
  display: inline-block;
  margin-top: 8px;
  text-decoration: none;
  background: var(--brand);
  color: #ffffff;
  border-radius: 8px;
  padding: 10px 12px;
}

.primary-link:hover {
  background: var(--brand-deep);
}

.status {
  margin: 12px 0 16px;
  color: #334155;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 14px;
}

.tab-btn {
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  cursor: pointer;
}

.tab-btn.active {
  background: #0ea5e9;
  color: #ffffff;
  border-color: #0ea5e9;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.settings-btn {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.settings-btn i {
  font-size: 16px;
}

.app-top {
  background: var(--surface);
  border-bottom: 1px solid #e7edf7;
  border-radius: 0;
  padding: 8px 0 10px;
  margin: 2px 0 8px;
  position: sticky;
  top: var(--sticky-header-height);
  z-index: 40;
  transition: top 180ms ease, padding 180ms ease, box-shadow 180ms ease;
}

.app-top.is-compact {
  padding-top: 5px;
  padding-bottom: 6px;
  box-shadow: 0 5px 14px rgba(15, 23, 42, 0.07);
}

.app-top.is-compact .app-tab {
  padding-top: 7px;
  padding-bottom: 7px;
}

.app-top.is-compact .reader-toolbar {
  margin-top: 4px;
}

.app-top.is-compact .surah-menu-toggle {
  font-size: 23px;
}

.app-quran-select {
  margin-bottom: 10px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.reader-toolbar {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  justify-content: start;
  align-items: center;
}

.compact-field select {
  border-radius: 999px;
  padding: 10px 14px;
  border-color: #cfe0fb;
}

.reader-toolbar .compact-field {
  display: none;
}

.reader-toolbar .surah-select-field {
  display: none;
}

.reader-toolbar .verse-select-field {
  display: none;
}

.reader-toolbar .verse-select-field.is-visible {
  display: block;
}

.app-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.app-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  border-radius: 0;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #4a5c79;
  cursor: pointer;
  font-weight: 600;
}

.app-tab.active {
  color: #1e3a8a;
  border-bottom-color: #1e3a8a;
}

.surah-menu {
  position: relative;
}

.surah-menu-toggle {
  border: none;
  background: transparent;
  color: #0f2f78;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 30px;
  font-family: "Scheherazade New", "Amiri Quran", "Noto Naskh Arabic", serif;
  line-height: 1.1;
  padding: 2px 0;
}

.surah-menu-toggle i {
  font-size: 14px;
  color: #5f6f89;
}

.surah-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: min(460px, calc(100vw - 28px));
  max-height: 70vh;
  overflow: auto;
  background: #ffffff;
  border: 1px solid #dfe8f6;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(12, 24, 56, 0.12);
  padding: 10px;
  display: none;
  z-index: 80;
}

.surah-menu:hover .surah-menu-panel,
.surah-menu.open .surah-menu-panel {
  display: block;
}

.surah-menu-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid #e2eaf8;
  border-radius: 999px;
  padding: 4px;
  background: #f9fbff;
  margin-bottom: 10px;
}

.surah-menu-tab {
  border: none;
  background: transparent;
  color: #60718e;
  border-radius: 999px;
  padding: 7px 8px;
  font-size: 14px;
  cursor: default;
}

.surah-menu-tab.active {
  background: #ffffff;
  color: #123d8f;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  font-weight: 600;
}

.surah-menu-search {
  width: 100%;
  border: 1px solid #e3ebf8;
  background: #f7f9fc;
  border-radius: 999px;
  padding: 10px 12px;
  margin-bottom: 10px;
}

.surah-menu-list {
  display: grid;
  gap: 4px;
}

.surah-menu-item {
  width: 100%;
  border: none;
  background: transparent;
  color: #0d2f72;
  text-align: left;
  border-radius: 12px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 36px 1fr;
  align-items: center;
  gap: 6px;
}

.surah-menu-item:hover {
  background: #f6f9ff;
}

.surah-menu-item.active {
  background: #f0f5ff;
  font-weight: 700;
}

.app-feature {
  display: none;
}

.app-feature.active {
  display: block;
}

.field {
  display: grid;
  gap: 6px;
}

.reading-options {
  margin: 10px 0 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.reading-options[hidden] {
  display: none;
}

.reader-page-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 2px 8px;
  border-bottom: 1px solid #e7edf7;
  background: #ffffff;
  position: sticky;
  top: calc(var(--sticky-header-height) + var(--sticky-app-top-height));
  z-index: 35;
}

.reader-page-info-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #4b5b78;
  font-weight: 600;
}

.top-bookmark-btn {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #5c6f8f;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.top-bookmark-btn:hover {
  background: #eef4ff;
}

.reader-page-info-secondary {
  margin: 0;
  color: #6b7890;
  font-size: 14px;
}

.verses-viewport {
  max-height: none;
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 12px;
}

.reader-pane {
  position: relative;
}

.side-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: -46px;
  transform: none;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.side-page-btn-left {
  left: 0;
}

.side-page-btn-right {
  right: 0;
}

.page-info-top {
  margin: 6px 0 12px;
  color: #334155;
  font-size: 14px;
}

.reader-heading {
  margin: 6px 0 0;
  font-size: 20px;
  color: #1e3a8a;
}

.pagination {
  display: none;
}

label {
  font-size: 14px;
  color: #334155;
}

select,
input,
button,
textarea {
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  font-size: 14px;
  font-family: inherit;
}

button {
  background: var(--brand);
  color: white;
  border: none;
  cursor: pointer;
}

button:hover {
  background: var(--brand-deep);
}

.secondary-btn {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
}

.secondary-btn:hover {
  background: #f1f5f9;
}

.actions {
  align-self: end;
}

.verses {
  display: grid;
  gap: 0;
}

.verse {
  background: #ffffff;
  border: none;
  border-bottom: 1px solid #e6ecf5;
  border-radius: 0;
  padding: 14px 2px 16px;
}

.small-card,
.single-ayah,
.search-panel,
.bookmarks-panel {
  max-width: 720px;
}

.small-card {
  margin-bottom: 10px;
}

.verse-number {
  font-size: 13px;
  color: #2f4b77;
  margin-bottom: 8px;
  font-weight: 600;
}

.arabic {
  direction: rtl;
  font-family: "Scheherazade New", "Amiri Quran", "Noto Naskh Arabic", serif;
  font-size: 40px;
  line-height: 1.9;
  margin: 2px 0 12px;
  color: #0f2f78;
}

.english {
  margin: 0;
  color: #1e293b;
  line-height: 1.6;
}

.verse-actions {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.action-btn {
  padding: 8px 10px;
  font-size: 13px;
}

.search-panel {
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
}

.bookmarks-panel {
  margin-top: 18px;
}

.bookmark-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 8px;
}

.bookmark-link {
  border: none;
  background: transparent;
  color: #0369a1;
  padding: 0;
  cursor: pointer;
}

.bookmark-link:hover {
  text-decoration: underline;
}

.meta-block {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #dbe7fb;
}

.tafsir-block {
  background: #f8fbff;
}

.meta-label {
  margin: 0 0 6px;
  font-size: 12px;
  color: #5b6b88;
}

.ayah-actions {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eef2fa;
}

.ayah-bookmark-btn,
.ayah-play-btn,
.ayah-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--brand-deep);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.ayah-bookmark-btn i,
.ayah-play-btn i,
.ayah-icon-btn i {
  font-size: 15px;
}

.toggle-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  padding: 10px 12px;
}

.toggle-field label {
  margin: 0;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  accent-color: var(--brand);
}

.app-tab i,
.secondary-btn i {
  font-size: 14px;
}

.plain-list {
  margin: 0;
  padding-left: 18px;
  color: #1e293b;
}

.plain-list li {
  margin-bottom: 6px;
}

@media (min-width: 600px) {
  .container {
    padding: 24px 20px 36px;
  }

  .site-nav {
    max-width: 420px;
  }

  .feature-grid {
    grid-template-columns: 1fr 1fr;
  }

  .reading-options {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 900px) {
  .feature-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .site-nav {
    max-width: 520px;
  }

  .arabic {
    font-size: 42px;
  }

  .side-page-btn {
    top: 50%;
    transform: translateY(-50%);
  }

  .side-page-btn-left {
    left: -50px;
  }

  .side-page-btn-right {
    right: -50px;
  }
}

@media (max-width: 599px) {
  .app-tab {
    flex-direction: column;
    gap: 3px;
    font-size: 11px;
  }

  .app-tabs {
    gap: 2px;
  }

  .reader-page-info {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .search-result-surah {
    grid-template-columns: auto 1fr;
  }

  .search-result-surah .arabic-name {
    grid-column: 2;
  }

  .search-input-wrap {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .search-input-wrap button {
    grid-column: 1 / -1;
  }

  .arabic {
    font-size: 34px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-header,
  .app-top {
    transition: none;
  }
}
