@font-face {
  font-family: "Uthmanic Hafs";
  src: url("/uthmanic-hafs.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Amiri Quran";
  src: url("/amiri-quran.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f4f3ee;
  --paper-deep: #ece9df;
  --ink: #1f2824;
  --muted: #646a61;
  --green: #235347;
  --green-soft: #e6eee9;
  --gold: #9d8351;
  --gold-soft: #dfd3b8;
  --gold-light: #eadfbf;
  --line: rgba(61, 68, 62, 0.18);
  --shadow: 0 16px 42px rgba(35, 38, 32, 0.1);
  --reader-overlay: rgba(244, 243, 238, 0.92);
  --pattern-color: rgba(157, 131, 81, 0.052);
  --pattern-strong: rgba(157, 131, 81, 0.18);
  --reader-glow: rgba(35, 83, 71, 0.055);
  --arabic-ink: #151d19;
  --translation-ink: #26312d;
  --surface: rgba(255, 255, 255, 0.68);
  --field-bg: rgba(255, 255, 255, 0.82);
  --sidebar-bg: rgba(244, 243, 238, 0.9);
  --warning-bg: rgba(245, 238, 214, 0.68);
  --warning-text: #5b4b25;
  --blue: #2367a2;
  --blue-deep: #174f80;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

:root[data-theme="night"] {
  color-scheme: dark;
  --paper: #101713;
  --paper-deep: #18231d;
  --ink: #f4ead6;
  --muted: #c7baa2;
  --green: #9de2bd;
  --green-soft: rgba(83, 145, 112, 0.26);
  --gold: #d9b96f;
  --gold-soft: rgba(217, 185, 111, 0.35);
  --gold-light: #5d4e2d;
  --line: rgba(222, 201, 151, 0.23);
  --shadow: 0 20px 54px rgba(0, 0, 0, 0.42);
  --reader-overlay: rgba(24, 35, 29, 0.92);
  --pattern-color: rgba(217, 185, 111, 0.06);
  --pattern-strong: rgba(217, 185, 111, 0.2);
  --reader-glow: rgba(157, 226, 189, 0.07);
  --arabic-ink: #fff5dd;
  --translation-ink: #eadfc8;
  --surface: rgba(21, 30, 25, 0.74);
  --field-bg: rgba(10, 15, 12, 0.58);
  --sidebar-bg: rgba(16, 23, 19, 0.9);
  --warning-bg: rgba(76, 60, 30, 0.38);
  --warning-text: #f0dcaa;
  --blue: #73b7ff;
  --blue-deep: #4a9fec;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(35, 83, 71, 0.038), transparent 260px),
    linear-gradient(90deg, rgba(157, 131, 81, 0.045), transparent 22%, transparent 78%, rgba(157, 131, 81, 0.038)),
    var(--paper);
  background-size: auto;
}

a {
  color: inherit;
}

.site-shell {
  position: relative;
  min-height: 100vh;
}

.site-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent, var(--pattern-color), transparent) top center / min(720px, 82vw) 1px no-repeat,
    linear-gradient(90deg, transparent, var(--pattern-color), transparent) 50% 96px / min(620px, 78vw) 1px no-repeat;
  opacity: 0.9;
}

.topbrand {
  display: inline-block;
  width: max-content;
  justify-self: center;
  border: 0;
  padding: 0;
  color: var(--green);
  background: transparent;
  cursor: pointer;
  font: inherit;
  text-decoration: none;
}

.display-menu {
  position: relative;
  min-width: 0;
}

.display-menu__button {
  display: inline-grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 42px;
  max-width: 300px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 11px;
  color: var(--ink);
  background: var(--surface);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  text-align: left;
}

.display-menu__button[aria-expanded="true"] {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(185, 147, 75, 0.18);
}

.display-menu__button:focus-visible,
.display-menu__options button:focus-visible {
  outline: 3px solid rgba(185, 147, 75, 0.42);
  outline-offset: 2px;
}

.display-menu__current {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.display-menu__chevron {
  color: var(--gold);
  transition: transform 160ms ease;
}

.display-menu__button[aria-expanded="true"] .display-menu__chevron {
  transform: rotate(180deg);
}

.display-menu__panel {
  position: absolute;
  z-index: 55;
  top: calc(100% + 8px);
  left: 0;
  width: min(360px, calc(100vw - 32px));
  max-height: min(70vh, 520px);
  overflow: auto;
  border: 1px solid var(--gold-soft);
  border-radius: 8px;
  padding: 10px;
  background: var(--paper);
  box-shadow: 0 20px 52px rgba(0, 0, 0, 0.24);
}

.display-menu__panel[hidden] {
  display: none;
}

.display-menu__group {
  margin: 4px 6px 7px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.display-menu__options {
  display: grid;
  gap: 4px;
}

.display-menu__options button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-align: left;
}

.display-menu__options button:hover:not(:disabled) {
  border-color: var(--gold-soft);
  background: var(--surface);
}

.display-menu__options button[aria-checked="true"] {
  color: #ffffff;
  background: var(--green);
}

:root[data-theme="night"] .display-menu__options button[aria-checked="true"] {
  color: #102018;
}

.display-menu__options button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.display-menu__pending {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.display-menu__note {
  margin: 4px 6px 2px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.topbrand__title {
  font-size: 1.18rem;
  font-weight: 800;
  line-height: 1.15;
}

.topbrand__subtitle {
  color: var(--muted);
  font-size: 0.9rem;
}

.sura-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sura-list a {
  display: grid;
  grid-template-columns: 2.2rem minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  height: var(--sura-row-height);
  min-height: var(--sura-row-height);
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  text-align: center;
}

.sura-list a:hover,
.sura-list a:focus-visible {
  border-color: var(--gold);
  outline: none;
  background: rgba(234, 219, 182, 0.45);
}

.sura-list a[aria-current="page"],
.sura-list a[data-current-sura="true"] {
  border-color: rgba(15, 81, 56, 0.4);
  background: var(--green-soft);
  color: var(--green);
  font-weight: 700;
}

.sura-option {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 2px 8px;
  line-height: 1.2;
}

.sura-option__name {
  font-weight: 800;
}

.sura-option__meaning {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
}

.sura-list a[aria-current="page"] .sura-option__meaning,
.sura-list a[data-current-sura="true"] .sura-option__meaning {
  color: var(--green);
  opacity: 0.82;
}

.sura-number {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--gold-soft);
  border-radius: 999px;
  color: var(--green);
  font-size: 0.84rem;
}

.content {
  min-width: 0;
  padding: 28px clamp(16px, 4vw, 54px) 132px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto minmax(240px, 1fr);
  gap: 12px;
  align-items: center;
  margin: -28px auto 18px;
  padding: 14px 0 12px;
  max-width: 960px;
  background:
    linear-gradient(var(--paper), var(--paper)),
    var(--paper);
}

.topbar__left,
.topbar__right {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.topbar__left {
  justify-content: flex-start;
}

.topbar__right {
  justify-content: flex-end;
}

.topbrand {
  justify-items: center;
  text-align: center;
}

.toggle {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.toggle button,
.fullscreen-button,
.compact-control {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  padding: 0 12px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
}

.toggle button[aria-pressed="true"] {
  background: var(--green);
  color: white;
}

.toggle button:focus-visible,
.fullscreen-button:focus-visible,
.compact-control:focus-visible,
.topbrand:focus-visible {
  outline: 3px solid rgba(185, 147, 75, 0.55);
  outline-offset: 2px;
}

.fullscreen-button {
  border: 1px solid var(--line);
  background: var(--surface);
}

.compact-control {
  display: none;
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface);
  font-weight: 700;
  white-space: nowrap;
}

.fullscreen-button[aria-pressed="true"] {
  background: var(--green);
  color: #ffffff;
}

.project-dialog {
  width: min(calc(100vw - 32px), 680px);
  max-height: min(86vh, 720px);
  margin: auto;
  border: 1px solid var(--gold-soft);
  border-radius: 8px;
  padding: 0;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
  overflow: auto;
}

.project-dialog:not([open]) {
  display: none;
}

.project-dialog::backdrop {
  background: rgba(8, 14, 11, 0.68);
  backdrop-filter: blur(3px);
}

.project-dialog__surface {
  position: relative;
  padding: 28px 30px 32px;
}

.project-dialog__close {
  position: sticky;
  z-index: 2;
  top: 12px;
  float: right;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin: -12px -12px 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--green);
  background: var(--paper);
  cursor: pointer;
  font: inherit;
  font-size: 1.6rem;
  line-height: 1;
}

.project-dialog__back {
  position: absolute;
  z-index: 2;
  top: 12px;
  left: 4px;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--green);
  background: var(--paper);
  cursor: pointer;
  font: inherit;
  font-size: 2rem;
  line-height: 1;
}

.project-dialog__back[hidden],
.project-dialog__view[hidden] {
  display: none;
}

.project-dialog__close:hover,
.project-dialog__close:focus-visible,
.project-dialog__back:hover,
.project-dialog__back:focus-visible {
  border-color: var(--gold);
  outline: 3px solid rgba(185, 147, 75, 0.35);
  outline-offset: 2px;
}

.project-dialog__header {
  padding: 2px 50px 20px;
  text-align: center;
}

.project-dialog__header p,
.project-dialog__header h2,
.project-dialog__section p {
  margin: 0;
}

.project-dialog__header p {
  color: var(--gold);
  font-weight: 800;
}

.project-dialog__header h2 {
  margin-top: 4px;
  color: var(--green);
  font-size: 1.7rem;
  line-height: 1.2;
}

.project-dialog__section {
  padding: 18px 0;
  border-top: 1px solid var(--line);
  color: var(--translation-ink);
  line-height: 1.68;
}

.project-dialog__section--first {
  border-top: 0;
  padding-top: 4px;
}

.project-dialog__section:last-child {
  padding-bottom: 0;
}

.project-dialog__section h3 {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 1.08rem;
  line-height: 1.3;
}

.project-dialog__section p + p {
  margin-top: 10px;
}

.project-dialog__link {
  display: inline-block;
  margin-top: 10px;
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
}

.project-dialog__link:hover,
.project-dialog__link:focus-visible {
  color: var(--blue-deep);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.project-dialog__steps {
  display: grid;
  gap: 9px;
  margin: 0;
  padding-left: 1.3rem;
}

.project-menu {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding-top: 6px;
}

.project-menu button {
  display: grid;
  align-content: center;
  gap: 5px;
  min-height: 104px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  color: var(--ink);
  background: var(--surface);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.project-menu button:hover,
.project-menu button:focus-visible {
  border-color: var(--gold);
  outline: 3px solid rgba(185, 147, 75, 0.25);
  outline-offset: 1px;
}

.project-menu strong {
  color: var(--green);
  font-size: 1.05rem;
}

.project-menu span {
  color: var(--muted);
  line-height: 1.4;
}

.saved-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  max-width: 420px;
  margin: 0 auto 16px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.saved-tabs button,
.saved-tools button,
.saved-ayah__actions button,
.note-dialog__actions button:first-child {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  padding: 8px 12px;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.saved-tabs button[aria-selected="true"] {
  color: #ffffff;
  background: var(--green);
}

.saved-ayahs {
  min-height: 150px;
  border-top: 1px solid var(--line);
}

.saved-ayahs__empty {
  padding: 36px 12px;
  color: var(--muted);
  text-align: center;
}

.saved-ayah {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.saved-ayah__open {
  display: grid;
  gap: 5px;
  width: 100%;
  border: 0;
  padding: 0;
  color: var(--translation-ink);
  background: transparent;
  cursor: pointer;
  font: inherit;
  line-height: 1.45;
  text-align: left;
}

.saved-ayah__open strong {
  color: var(--green);
}

.saved-ayah__open span {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.saved-ayah__open:hover strong,
.saved-ayah__open:focus-visible strong {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.saved-ayah__note {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-left: 3px solid var(--gold);
  background: var(--surface);
  white-space: pre-wrap;
}

.saved-ayah__actions,
.saved-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.saved-ayah__actions button,
.saved-tools button {
  min-height: 34px;
  padding: 5px 8px;
  color: var(--blue);
}

.saved-ayah__actions button:hover,
.saved-ayah__actions button:focus-visible,
.saved-tools button:hover,
.saved-tools button:focus-visible {
  background: var(--green-soft);
  outline: none;
}

.saved-tools {
  justify-content: center;
  margin-top: 18px;
}

.saved-privacy {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

.project-feedback-form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.project-feedback-form label {
  display: grid;
  gap: 6px;
  color: var(--green);
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
}

.project-feedback-form input,
.project-feedback-form textarea {
  width: 100%;
  border: 1px solid rgba(89, 73, 43, 0.28);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--field-bg);
  font: inherit;
  text-align: left;
}

.project-feedback-form input::placeholder,
.project-feedback-form textarea::placeholder {
  color: var(--muted);
  opacity: 0.82;
}

.project-feedback-form textarea {
  min-height: 124px;
  resize: vertical;
}

.project-feedback-form input:focus,
.project-feedback-form textarea:focus {
  border-color: var(--blue);
  outline: 3px solid rgba(29, 105, 179, 0.2);
}

.project-feedback-form .form-status {
  margin: 0;
}

.project-feedback-form .contact-submit {
  justify-self: center;
}

body.dialog-open {
  overflow: hidden;
}

.note-dialog {
  width: min(calc(100vw - 32px), 560px);
  max-height: min(86vh, 680px);
  margin: auto;
  border: 1px solid var(--gold-soft);
  border-radius: 8px;
  padding: 0;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
}

.note-dialog:not([open]) {
  display: none;
}

.note-dialog::backdrop {
  background: rgba(8, 14, 11, 0.68);
  backdrop-filter: blur(3px);
}

.note-dialog__surface {
  position: relative;
  padding: 26px 28px 28px;
}

.note-dialog__close {
  top: 12px;
}

.note-dialog__field {
  display: grid;
  gap: 7px;
  color: var(--green);
  font-weight: 700;
}

.note-dialog__field textarea {
  width: 100%;
  min-height: 160px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--ink);
  background: var(--field-bg);
  font: inherit;
  line-height: 1.55;
  resize: vertical;
}

.note-dialog__field textarea:focus {
  border-color: var(--blue);
  outline: 3px solid rgba(29, 105, 179, 0.2);
}

.note-dialog__privacy {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

.note-dialog__actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
}

.reader-shell {
  position: relative;
  max-width: 960px;
  margin: 0 auto;
  padding: clamp(20px, 4vw, 44px);
  border: 1px solid rgba(185, 147, 75, 0.56);
  border-radius: 8px;
  background:
    linear-gradient(var(--reader-overlay), var(--reader-overlay)),
    linear-gradient(180deg, var(--reader-glow), transparent 48%),
    linear-gradient(90deg, rgba(157, 131, 81, 0.055), transparent 16%, transparent 84%, rgba(157, 131, 81, 0.045)),
    var(--paper-deep);
  background-size: auto;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.reader-shell::before,
.reader-shell::after {
  content: "";
  position: absolute;
  inset: 14px;
  pointer-events: none;
  border: 1px solid rgba(185, 147, 75, 0.23);
  border-radius: 6px;
}

.reader-shell::after {
  inset: 24px;
  border-color: rgba(15, 81, 56, 0.16);
  background:
    linear-gradient(90deg, transparent, var(--pattern-strong), transparent) top center / 62% 1px no-repeat,
    linear-gradient(90deg, transparent, var(--pattern-strong), transparent) bottom center / 62% 1px no-repeat;
}

.reader {
  position: relative;
  z-index: 1;
}

.contact-reader {
  padding-top: 8px;
}

.contact-exit {
  position: absolute;
  top: 0;
  right: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--green);
  background: var(--surface);
  font-weight: 800;
  text-decoration: none;
}

.contact-exit:hover,
.contact-exit:focus-visible {
  border-color: var(--gold);
  outline: 3px solid rgba(185, 147, 75, 0.35);
  outline-offset: 2px;
}

.contact-reader .sura-heading {
  padding-right: 90px;
  padding-left: 90px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.92rem;
}

.breadcrumb a {
  color: var(--green);
  text-decoration: none;
}

.sura-heading {
  position: relative;
  display: grid;
  gap: 8px;
  margin-bottom: 24px;
  padding: 12px 0 22px;
  text-align: center;
}

.sura-heading::before,
.sura-heading::after {
  content: "";
  justify-self: center;
  width: min(360px, 78%);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.sura-heading::after {
  width: min(420px, 84%);
  margin-top: 8px;
}

.sura-heading h1 {
  margin: 0;
  color: var(--green);
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1.04;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.18);
}

.sura-heading p {
  margin: 0;
  color: var(--muted);
}

.basmala {
  margin: 2px auto 10px;
  padding: 12px 16px 15px;
  border-bottom: 1px solid rgba(185, 147, 75, 0.28);
  text-align: center;
}

.basmala__arabic {
  margin: 0;
  color: var(--arabic-ink);
  font-family: "Uthmanic Hafs", "Amiri Quran", "Traditional Arabic", "Scheherazade New", "Amiri", serif;
  font-size: clamp(2rem, 5.2vw, 3rem);
  line-height: 1.8;
}

.basmala__bosnian {
  margin: 2px 0 0;
  color: var(--translation-ink);
  font-size: clamp(1rem, 1.85vw, 1.16rem);
  line-height: 1.6;
}

.ayah-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ayah {
  position: relative;
  padding: 20px 0 22px;
  border-radius: 8px;
  touch-action: manipulation;
  transition: opacity 180ms ease, filter 180ms ease, background-color 180ms ease;
}

.ayah::after {
  content: "";
  position: absolute;
  right: 8%;
  bottom: 0;
  left: 8%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(157, 131, 81, 0.34), transparent);
}

.ayah:last-child::after {
  display: none;
}

.ayah:hover {
  background:
    linear-gradient(90deg, transparent, rgba(157, 131, 81, 0.055), transparent);
}

body.ayah-focus-mode .ayah:not(.is-focused) {
  opacity: 0.2;
  filter: blur(1.4px);
}

.ayah.is-focused {
  z-index: 2;
  margin-inline: -12px;
  padding: 28px 18px 30px;
  border: 1px solid var(--gold-soft);
  background: var(--surface);
  box-shadow: var(--shadow);
  cursor: zoom-out;
}

.ayah.is-focused::after {
  display: none;
}

.ayah.is-focused .ayah__arabic {
  font-size: clamp(2.55rem, 6.5vw, 4.15rem);
}

.ayah.is-focused .ayah__bosnian {
  font-size: clamp(1.2rem, 2.7vw, 1.52rem);
}

.ayah.is-focused .ayah__transcription {
  font-size: clamp(1.1rem, 2.5vw, 1.42rem);
}

.ayah-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.ayah-actions button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 11px;
  color: var(--green);
  background: var(--paper);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.ayah-actions button:hover,
.ayah-actions button:focus-visible {
  border-color: var(--gold);
  outline: 3px solid rgba(185, 147, 75, 0.25);
  outline-offset: 1px;
}

.ayah-actions button[aria-pressed="true"] {
  color: #ffffff;
  background: var(--green);
}

.ayah__arabic {
  margin: 0 0 14px;
  direction: rtl;
  color: var(--arabic-ink);
  font-family: "Uthmanic Hafs", "Amiri Quran", "Traditional Arabic", "Scheherazade New", "Amiri", serif;
  font-size: clamp(2rem, 5.5vw, 3.25rem);
  line-height: 1.9;
  text-align: right;
}

.ayah__transcription {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: clamp(1rem, 1.85vw, 1.16rem);
  line-height: 1.7;
}

.ayah__bosnian {
  margin: 0;
  color: var(--translation-ink);
  font-size: clamp(1.05rem, 2vw, 1.24rem);
  line-height: 1.75;
}

.ayah__meta {
  display: inline-grid;
  place-items: center;
  vertical-align: middle;
  width: 34px;
  height: 34px;
  margin-inline-end: 8px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  color: var(--green);
  background: var(--gold-light);
  box-shadow: inset 0 0 0 3px var(--paper-deep);
  font-family: "Segoe UI", sans-serif;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
}

.ayah__meta--bosnian {
  display: none;
  vertical-align: middle;
}

.reader-nav {
  position: fixed;
  z-index: 40;
  right: auto;
  bottom: 14px;
  left: 50%;
  width: min(calc(100vw - 32px), 960px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, auto) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  transform: translateX(-50%);
}

.reader-nav__link {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--green);
  background: var(--surface);
  text-decoration: none;
}

.reader-nav__link--next {
  text-align: right;
}

.reader-nav__label {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.1;
}

.reader-nav__name {
  font-weight: 800;
  line-height: 1.15;
}

.reader-nav__link:hover,
.reader-nav__link:focus-visible {
  border-color: var(--gold);
  outline: none;
  background: rgba(234, 219, 182, 0.35);
}

.sura-menu {
  --sura-row-height: 64px;
  --sura-visible-rows: 5;
  position: relative;
  z-index: 4;
}

.sura-menu::before {
  content: "";
  position: absolute;
  right: 0;
  bottom: 100%;
  left: 0;
  height: 10px;
}

.sura-menu__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--gold-soft);
  border-radius: 8px;
  padding: 10px 16px;
  color: var(--green);
  background: var(--surface);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.sura-menu__button:hover,
.sura-menu__button:focus-visible {
  border-color: var(--gold);
  outline: 3px solid rgba(185, 147, 75, 0.35);
  outline-offset: 2px;
}

.sura-menu__panel {
  position: absolute;
  left: 50%;
  bottom: 100%;
  display: none;
  width: min(84vw, 420px);
  height: min(58vh, calc(var(--sura-row-height) * var(--sura-visible-rows)));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  scroll-snap-type: y proximity;
  scrollbar-width: none;
  transform: translateX(-50%);
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}

.sura-menu__panel[data-user-scrolling="true"] {
  scroll-behavior: auto;
  scroll-snap-type: none;
}

.sura-menu__panel::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.sura-menu:focus-within .sura-menu__panel,
.sura-menu[data-open="true"] .sura-menu__panel {
  display: block;
}

@media (hover: hover) and (pointer: fine) {
  .sura-menu:hover .sura-menu__panel {
    display: block;
  }
}

.notice {
  max-width: 960px;
  margin: 18px auto 0;
  padding: 12px 14px;
  border: 1px solid rgba(22, 96, 156, 0.2);
  border-radius: 8px;
  color: var(--translation-ink);
  background: var(--surface);
  font-size: 0.95rem;
  line-height: 1.58;
}

.notice p {
  margin: 0;
}

.notice p + p {
  margin-top: 8px;
}

.notice__button {
  display: inline;
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
}

.notice__button:hover,
.notice__button:focus-visible {
  color: var(--blue-deep);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.contact-submit:hover,
.contact-submit:focus-visible {
  background: var(--blue-deep);
  outline: 3px solid rgba(29, 105, 179, 0.3);
  outline-offset: 2px;
}

.notice__privacy {
  display: inline;
  color: var(--green);
  font-weight: 700;
  text-decoration: none;
}

.notice__privacy:hover,
.notice__privacy:focus-visible {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.demo-warning {
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid rgba(185, 147, 75, 0.5);
  border-radius: 8px;
  background: var(--warning-bg);
  color: var(--warning-text);
}

.contact-story {
  margin: 0 0 22px;
  padding: 0 0 0 16px;
  border-left: 3px solid var(--gold);
}

.contact-story h2 {
  margin: 0 0 10px;
  color: var(--green);
  font-size: 1.18rem;
  line-height: 1.25;
}

.contact-story p {
  margin: 0;
  color: var(--translation-ink);
  line-height: 1.72;
}

.contact-story p + p {
  margin-top: 12px;
}

.source-list {
  display: grid;
  gap: 10px;
  color: var(--translation-ink);
  line-height: 1.72;
}

.source-list h2 {
  margin: 18px 0 0;
  color: var(--green);
  font-size: 1.12rem;
  line-height: 1.25;
}

.source-list h2:first-child {
  margin-top: 0;
}

.source-list p {
  margin: 0;
}

.source-list a {
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
}

.source-list a:hover,
.source-list a:focus-visible {
  color: var(--blue-deep);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.contact-note {
  max-width: 720px;
  margin: 0 auto 20px;
  color: var(--translation-ink);
  font-size: 1rem;
  line-height: 1.7;
}

.mail-note {
  margin: -8px 0 22px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.65;
}

.contact-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  max-width: 640px;
  margin: 0 auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.28);
}

.form-hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.contact-form label {
  display: grid;
  gap: 6px;
  color: var(--green);
  font-size: 0.95rem;
  font-weight: 700;
}

.contact-form label:nth-of-type(3),
.contact-form label:nth-of-type(4),
.form-status,
.contact-submit {
  grid-column: 1 / -1;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  border: 1px solid rgba(89, 73, 43, 0.28);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--field-bg);
  font: inherit;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: var(--muted);
  opacity: 0.82;
}

.contact-form textarea {
  min-height: 128px;
  resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--blue);
  outline: 3px solid rgba(29, 105, 179, 0.2);
}

.form-status {
  min-height: 1.5em;
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.55;
}

.form-status[data-state="success"] {
  color: var(--green);
  font-weight: 700;
}

.form-status[data-state="error"] {
  color: #9b2c2c;
  font-weight: 700;
}

:root[data-theme="night"] .form-status[data-state="error"] {
  color: #ffb4a8;
}

.contact-submit {
  justify-self: center;
  min-height: 46px;
  border: 1px solid var(--blue);
  border-radius: 8px;
  padding: 11px 28px;
  color: #ffffff;
  background: var(--blue);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.contact-submit:disabled {
  cursor: wait;
  opacity: 0.7;
}

.mode-ar .ayah__bosnian,
.mode-ar .ayah__transcription,
.mode-ar .basmala__bosnian,
.mode-bs .ayah__arabic,
.mode-bs .ayah__transcription,
.mode-bs .basmala__arabic,
.mode-both .ayah__transcription,
.mode-bs-tr .ayah__arabic,
.mode-ar-tr .ayah__bosnian {
  display: none;
}

.mode-bs .ayah__meta--bosnian,
.mode-bs-tr .ayah__meta--bosnian {
  display: inline-grid;
}

@media (max-width: 820px) {
  .content {
    padding: 16px 12px 128px;
  }

  .topbar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: -16px;
    padding: 10px 0 12px;
    align-items: center;
  }

  .topbrand {
    grid-column: 1 / -1;
    grid-row: 1;
    justify-items: center;
    text-align: center;
  }

  .topbar__left {
    grid-column: 1;
    grid-row: 2;
  }

  .display-menu,
  .display-menu__button {
    width: 100%;
  }

  .display-menu__button {
    display: flex;
    justify-content: center;
    padding-inline: 6px;
    font-size: 0.86rem;
  }

  .display-menu__current {
    display: none;
  }

  .display-menu__panel {
    position: absolute;
    z-index: 70;
    top: calc(100% + 8px);
    right: auto;
    bottom: auto;
    left: 0;
    left: 2px;
    width: auto;
    max-height: min(50vh, 260px);
  }

  .topbar__right {
    display: contents;
  }

  .desktop-control {
    display: none;
  }

  .mobile-control {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .fullscreen-button {
    grid-column: 2;
    grid-row: 2;
    width: 100%;
    padding-inline: 6px;
    font-size: 0.86rem;
    font-weight: 700;
    white-space: nowrap;
  }

  .mobile-theme-control {
    grid-column: 3;
    grid-row: 2;
  }

  .reader-shell {
    padding: 22px 16px;
  }

  .reader-shell::before,
  .reader-shell::after {
    inset: 9px;
  }

  .reader-shell::after {
    inset: 15px;
  }

  .ayah.is-focused {
    margin-inline: -6px;
    padding: 26px 12px 28px;
  }

  .topbar__left,
  .topbar__right {
    justify-content: stretch;
  }

  .reader-nav {
    right: auto;
    bottom: 8px;
    left: 50%;
    width: calc(100vw - 16px);
    grid-template-columns: minmax(0, 1fr) minmax(128px, 0.9fr) minmax(0, 1fr);
    gap: 6px;
    padding: 8px;
  }

  .reader-nav__link,
  .sura-menu__button {
    min-height: 46px;
    padding: 8px 9px;
  }

  .reader-nav__name {
    font-size: 0.9rem;
  }

  .sura-menu {
    --sura-row-height: 60px;
  }

  .sura-menu__panel {
    bottom: calc(100% + 8px);
    width: min(94vw, 360px);
    height: min(54vh, calc(var(--sura-row-height) * var(--sura-visible-rows)));
    scroll-behavior: auto;
    touch-action: none;
  }

  .sura-list a {
    gap: 8px;
    padding-inline: 10px;
  }

  .sura-option {
    gap: 1px 6px;
  }

  .sura-option__meaning {
    font-size: 0.8rem;
  }

  .contact-exit {
    position: static;
    width: max-content;
    margin: 0 0 12px auto;
  }

  .contact-form {
    grid-template-columns: 1fr;
    max-width: 100%;
    padding: 14px;
  }

  .contact-reader .sura-heading {
    padding-right: 0;
    padding-left: 0;
  }

  .project-dialog {
    width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
  }

  .project-dialog__surface {
    padding: 20px 18px 24px;
  }

  .project-dialog__close {
    top: 8px;
    margin: -8px -6px 0 8px;
  }

  .project-dialog__back {
    top: 8px;
    left: 8px;
    margin: 0;
  }

  .project-dialog__header {
    padding-right: 42px;
    padding-left: 42px;
  }

  .project-menu {
    grid-template-columns: 1fr;
  }

  .project-menu button {
    min-height: 76px;
    padding: 14px 16px;
  }

  .note-dialog {
    width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
  }

  .note-dialog__surface {
    padding: 20px 18px 22px;
  }

  .ayah-actions button {
    flex: 1 1 auto;
    padding-inline: 8px;
  }
}

@media (max-width: 520px) {
  .compact-control,
  .fullscreen-button {
    min-height: 42px;
    padding-inline: 5px;
    font-size: 0.82rem;
  }

  .reader-nav__name {
    display: none;
  }

  .reader-nav {
    grid-template-columns: 1fr minmax(118px, 1.1fr) 1fr;
  }
}

body.reading-fullscreen {
  overflow-x: hidden;
}

body.reading-fullscreen .content {
  padding-inline: clamp(10px, 2vw, 28px);
}

body.reading-fullscreen .reader-shell,
:fullscreen .reader-shell {
  max-width: none;
  min-height: calc(100vh - 190px);
}

body.reading-fullscreen .notice,
:fullscreen .notice {
  display: none;
}

/* iPhone Safari cannot fullscreen ordinary web content, so this uses all available page space. */
body.reading-fullscreen.reading-fullscreen-fallback .site-shell {
  min-height: 100dvh;
}

body.reading-fullscreen.reading-fullscreen-fallback .content {
  padding: max(8px, env(safe-area-inset-top)) 10px max(8px, env(safe-area-inset-bottom));
}

body.reading-fullscreen.reading-fullscreen-fallback .reader-shell {
  min-height: calc(100dvh - 16px);
}

body.reading-fullscreen.reading-fullscreen-fallback .topbar {
  position: fixed;
  z-index: 60;
  top: max(8px, env(safe-area-inset-top));
  left: 50%;
  width: min(calc(100vw - 16px), 960px);
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
  transform: translateX(-50%);
  transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease;
}

body.reading-fullscreen.reading-fullscreen-fallback .reader-nav {
  transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease;
}

body.reading-fullscreen.reading-fullscreen-fallback.reading-ui-hidden .topbar {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 16px));
}

body.reading-fullscreen.reading-fullscreen-fallback.reading-ui-hidden .reader-nav {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, calc(100% + 24px));
}

@media (orientation: landscape) and (max-width: 1000px) {
  body.reading-fullscreen .content {
    padding-top: 8px;
    padding-bottom: 8px;
  }

  body.reading-fullscreen .topbar {
    position: fixed;
    z-index: 60;
    top: 8px;
    left: 50%;
    width: min(calc(100vw - 16px), 960px);
    margin: 0;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
    box-shadow: var(--shadow);
    transform: translateX(-50%);
    transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease;
  }

  body.reading-fullscreen .reader-nav {
    transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease;
  }

  body.reading-fullscreen .reader-shell {
    min-height: calc(100vh - 16px);
  }

  body.reading-fullscreen.reading-ui-hidden .topbar {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, calc(-100% - 16px));
  }

  body.reading-fullscreen.reading-ui-hidden .reader-nav {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, calc(100% + 24px));
  }
}
