/* ============================================================
   Quran Mini — style.css
   Reader shell styles only. The now-playing card and its
   verse expand/collapse animation live in play-card.css.
   ============================================================ */

:root {
  /* Extended tokens (were hard-coded in style.css) */
  --color-accent-outline: color-mix(in oklch, var(--color-accent) 20%, transparent);
  --color-on-accent: #FFFFFF;
  --shadow-popover: 0 16px 40px rgb(0 0 0 / 0.14);
  --shadow-thumb: 0 1px 4px rgb(0 0 0 / 0.1);
  /* Shared Arabic-text scale: reader verses (.verse-arabic) and the
     font-size preview sample (.fs-sample) render at the same computed
     size via the identical calc below. */
  --fs-arabic-scale: 1.4;
}

/* Dark-mode surface adjustments: deepen shadows so raised surfaces
   still read against the dark background. */
html[data-theme="dark"] {
  --shadow-popover: 0 16px 40px rgb(0 0 0 / 0.55);
  --shadow-thumb: 0 1px 4px rgb(0 0 0 / 0.5);
}
body {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
}
main {
  flex: 1;
}
/* ---- Shared components (merged across sections) ---- */

/* Icon buttons */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  flex-shrink: 0;
}

/* Vertical list columns */
.picker-list,
.bookmark-list,
.menu-list {
  display: flex;
  flex-direction: column;
}

.verse {
  padding: 1rem 1.5rem;
  scroll-margin-block-start: 4.5rem;
}
.chapter-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(1.5rem, 6vw, 2.75rem) 1rem 1.5rem;
  text-align: center;
}
.chapter-label {
  color: var(--color-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.8px;
  line-height: 1.2;
  text-transform: uppercase;
}
.chapter-arabic-name {
  margin: 0.65rem 0 0.25rem;
  color: var(--color-ink);
  font-family: 'v7-surah-name', serif;
  font-size: clamp(
    calc(2rem * var(--font-scale)),
    calc(7vw * var(--font-scale)),
    calc(3rem * var(--font-scale))
  );
  line-height: 1.2;
}
.chapter-title {
  color: var(--color-ink);
  font-family: Lora, var(--font-serif);
  font-size: calc(24px * var(--font-scale));
  font-weight: 600;
  line-height: 1.25;
}
.chapter-details {
  margin-top: 0.45rem;
  color: var(--color-muted);
  font-size: 13px;
  line-height: 1.4;
}
.chapter-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 180px);
  gap: 12px;
  margin-top: 1.15rem;
}
.ornament-rule {
  display: block;
  flex: 1 1 36px;
  height: 1px;
  background: var(--color-border);
}
.ornament-diamond {
  flex: 0 0 auto;
  color: var(--color-muted);
  font-size: 9px;
  line-height: 1;
}
/* Bottom borders */
.verse,
.picker-row,
.bookmark-item,
.menu-row {
  border-bottom: 1px solid var(--color-border);
}

/* Eyebrow labels */
.surah-info,
.section-label {
  color: var(--color-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.6px;
}

.surah-info {
  white-space: nowrap;
}

/* Card layout: fs-preview & progress-card */
.fs-preview,
.progress-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
}

/* fs-preview sets the 16px base the preview controls scale from */
.fs-preview {
  font-size: calc(16px * var(--font-scale));
}

/* Reading typography */
.bismillah,
.verse-text,
.fs-sample {
  color: var(--color-ink);
  font-family: var(--font-serif);
}

/* Reading text (em sizes scale from the 16px bases above) */
.verse-text {
  font-size: 1em;       /* 16px */
  line-height: 1.75em;  /* 28px */
}

/* The preview sample must render at exactly the reader Arabic verse
   size: identical calc using the shared --fs-arabic-scale. */
.fs-sample {
  font-size: calc(16px * var(--font-scale) * var(--fs-arabic-scale));
  line-height: 1.75em;  /* keep the preview's own line-height ratio */
}

/* Flex info columns */
.picker-row__info {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 3px;
}

/* Meta rows */
.progress-meta,
.bookmark-item__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bookmark-item__meta {
  gap: 8px;
}

/* List item labels */
.picker-row__name,
.menu-row__label {
  font-size: 15px;
  font-weight: 500;
  color: var(--color-ink);
}

.picker-row__name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.menu-row__label {
  flex: 1 1 0;
}

/* ---- App shell ---- */
.reader {
  width: 480px;
  max-width: 100%;
  margin: 0 auto;
  background: var(--color-bg);
  font-size: calc(16px * var(--font-scale));
}

/* ---- Top nav ---- */
.top-nav {
  width: 100%;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 10;
  height: 3.5rem;
  line-height: 3.5rem;
}

.top-nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 640px;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 1rem;
}

.chapter-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.chapter-name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--color-ink);
  white-space: nowrap;
}

.chevron {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: var(--color-muted);
}

.dot-sep {
  color: var(--color-faint);
  font-size: 14px;
  font-weight: 400;
  white-space: nowrap;
}

.juz-selector {
  display: flex;
  align-items: center;
  gap: 3px;
}

.juz-label {
  color: var(--color-muted);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

.juz-chevron {
  flex-shrink: 0;
  width: 13px;
  height: 13px;
  color: var(--color-muted);
}

/* Single set of nav actions; CSS shows/reorders per viewport */
.top-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
}

.top-actions .trigger svg {
  color: var(--color-ink);
}

.icon-bookmark {
  width: 19px;
  height: 19px;
}

.icon-font-size {
  width: 20px;
  height: 20px;
}

.icon-menu {
  width: 21px;
  height: 21px;
}

.icon-ellipsis {
  display: none;
  width: 20px;
  height: 20px;
}

/* Search box: desktop only (mobile uses the menu popover) */
.top-search {
  display: none;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px;
  background: var(--color-surface);
  border-radius: var(--radius-sm);
}

.top-search .icon-search {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: var(--color-muted);
}

.top-search__input {
  flex: 1 1 0;
  min-width: 0;
  background: transparent;
  border: 0;
  font: inherit;
  font-size: 13px;
  color: var(--color-ink);
  outline: none;
}

.top-search__input::placeholder {
  color: var(--color-muted);
}

/* Theme button: desktop only (mobile uses the menu popover) */
.trigger.theme-trigger {
  display: none;
}

/* ---- Popover triggers ---- */
.trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: inherit;
}

.trigger.is-active .chapter-name,
.trigger.is-active .juz-label {
  color: var(--color-accent);
}

.trigger.is-active .chevron,
.trigger.is-active .juz-chevron {
  color: var(--color-accent);
  transform: rotate(180deg);
}

.top-actions .trigger.is-active svg {
  color: var(--color-accent);
}

/* ---- Content ---- */
.content {
  padding: 2rem 0.5rem;
}

.chapter-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 2rem 24px;
}

.bismillah {
  width: min(260px, 72%);
  margin: 0 auto 1.5rem;
  color: var(--color-ink);
  text-align: center;
}
.bismillah img {
  display: block;
  width: 100%;
  height: auto;
}
/* The Bismillah artwork is supplied with black/default fills, so in dark
   mode we invert it to white. Scoped to dark theme only; light mode and
   other images are unaffected. */
html[data-theme="dark"] .bismillah img {
  filter: invert(1);
}

/* ---- Verses ---- */
.verse-row {
  display: flex;
  align-items: start;
  gap: 16px;
}

.verse-number {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-lg);
  outline: 1px solid var(--color-border);
}

.verse-number span {
  color: var(--color-muted);
  font-size: 11px;
  font-weight: 600;
}

.verse-content {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.verse-arabic {
  font-family: 'QPCV2-p1', var(--font-serif);
  font-size: calc(16px * var(--font-scale) * var(--fs-arabic-scale));
  line-height: 2;
  direction: rtl;
  text-align: right;
  color: var(--color-ink);
}

.verse-text {
  flex: none;
  /* Temporary: hide the English translation (Arabic-only view). */
  display: none;
}

.verse-actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex-shrink: 0;
}

.verse-actions svg {
  width: 16px;
  height: 16px;
  color: var(--color-faint);
}

.verse-actions .icon-btn.is-bookmarked svg {
  color: var(--color-accent);
}

.verse-actions .icon-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  transition: background-color 0.2s ease;
}

.verse-actions .icon-btn.is-bookmarked {
  background: var(--color-accent-soft);
}

.verse.is-targeted {
  outline: 1px solid var(--color-accent-outline);
  background: var(--color-accent-soft);
  animation: verse-target-highlight 1.6s ease both;
}

@keyframes verse-target-highlight {
  0%,
  100% {
    background: transparent;
  }
  20%,
  70% {
    background: var(--color-accent-soft);
  }
}

.bookmark-item--new {
  background: var(--color-accent-soft);
  border-radius: var(--radius-sm);
  outline: 1px solid var(--color-accent-outline);
  animation: bookmark-highlight 1.8s ease both;
}

@keyframes bookmark-highlight {
  from { background: var(--color-accent-soft); }
  to { background: transparent; }
}

@media (prefers-reduced-motion: reduce) {
  .bookmark-item--new {
    animation: none;
  }

  .verse.is-targeted {
    animation: none;
  }
}

/* ---- Footer / progress ---- */
.footer {
  width: 100%;
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
  position: sticky;
  bottom: 0;
  z-index: 10;
}

.footer__inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 640px;
  max-width: 100%;
  margin: 0 auto;
}

.progress-label {
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.progress-percent {
  color: var(--color-accent);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.progress-track,
.progress-fill {
  height: 4px;
  border-radius: 2px;
}

.progress-track {
  display: flex;
  background: var(--color-border);
  overflow: hidden;
}

.progress-fill {
  background: var(--color-accent);
}

.progress-fill--57 {
  width: 57%;
}

.progress-fill--21 {
  width: 21%;
}

/* ---- Popovers (native Popover API) ---- */
[popover] {
  position: fixed;
  inset: 3.5rem 0 auto 0;
  width: 100%;
  max-width: 640px;
  scrollbar-width: thin;
  margin: 0 auto;
  padding: 1rem 0;
  border: 0;
  background: var(--color-bg);
  color: var(--color-ink);
  box-shadow: var(--shadow-popover);
  max-height: fit-content;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-8px);
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    opacity 0.18s ease,
    transform 0.18s ease,
    overlay 0.18s allow-discrete,
    display 0.18s allow-discrete;
}

[popover]:popover-open {
  opacity: 1;
  transform: translateY(0);
}

@starting-style {
  [popover]:popover-open {
    opacity: 0;
    transform: translateY(-8px);
  }
}

[popover]::backdrop {
  background: transparent;
}

body:has([popover]:popover-open) {
  overflow: hidden;
}

.popover__inner {
  margin: 0 auto;
  max-height: 65vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1rem;
}

/* ---- About popover ---- */
#about-popover .popover__inner > div {
  padding: 1rem 2rem;
}

.about-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  padding: 0.5rem 0 0.25rem;
}

.about-label {
  color: var(--color-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.8px;
  line-height: 1.2;
  text-transform: uppercase;
}

.about-logo {
  width: 72px;
  height: 72px;
  margin: 0.75rem 0 0.25rem;
}

/* The logo is drawn from the shared icons.svg sprite via <use>. The book
   follows currentColor so it can switch with the theme, while the bookmark
   marks stay green. No filter is applied to the whole logo. */
.about-logo .about-logo-book {
  color: var(--color-ink);
}

.about-logo .about-logo-bookmarks {
  color: #2d7d5b;
}

html[data-theme="dark"] .about-logo .about-logo-book {
  color: #fff;
}

.about-title {
  color: var(--color-ink);
  font-family: Lora, var(--font-serif);
  font-size: 24px;
  font-weight: 600;
}

.about-content {
  padding: 1rem 0 0.25rem;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--color-body);
}

.about-content p {
  margin-bottom: 1rem;
  text-wrap: balance;
}

.about-content p:last-child {
  margin-bottom: 0;
}

.about-content a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.about-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: min(100%, 180px);
  margin: 1rem auto 1.5rem;
}

.about-sections {
  border-top: 1px solid var(--color-border);
  padding-top: 1.25rem;
}

.about-section {
  padding-bottom: 1.5rem;
}

.about-section__label {
  color: var(--color-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.about-entry {
  margin-bottom: 1.1rem;
}

.about-entry:last-child {
  margin-bottom: 0;
}

.about-entry__title {
  color: var(--color-ink);
  font-weight: 600;
}

.about-entry__desc {
  color: var(--color-muted);
  font-size: 14px;
  line-height: 1.65;
}

/* ---- Search field ---- */
.search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 14px;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  position: sticky;
  top: 0;
  z-index: 1;
  box-shadow: 0 4px 8px color-mix(in oklch, var(--color-bg) 80%, transparent);
}

.search-input {
  flex: 1 1 0;
  min-width: 0;
  background: transparent;
  border: 0;
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--color-ink);
  outline: none;
}

.search-input::placeholder {
  color: var(--color-muted);
}

.search-input::-webkit-search-cancel-button {
  cursor: pointer;
}

.icon-search {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: var(--color-muted);
}

/* ---- Picker lists (chapter / juz) ---- */
.picker-empty {
  padding: 16px 0;
  text-align: center;
  color: var(--color-muted);
  font-size: 14px;
}

.picker-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  color: inherit;
  text-decoration: none;
}

.picker-row:hover {
  background: var(--color-surface);
}

.picker-row--active .picker-row__name {
  color: var(--color-accent);
  font-weight: 600;
}

.picker-row__meta {
  font-size: 12px;
  color: var(--color-muted);
  white-space: nowrap;
}

.badge {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-pill);
  outline: 1px solid var(--color-border);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-muted);
}

.picker-row--active .badge {
  outline-color: var(--color-accent);
  color: var(--color-accent);
}

.icon-check,
.icon-chevron-right {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

.icon-check {
  color: var(--color-accent);
}

.icon-chevron-right {
  color: var(--color-faint);
}

/* ---- Font size panel (fs-preview/fs-sample shared) ---- */
.section-label--pad {
  display: block;
  margin-bottom: 1rem;
}

.fs-control {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 1rem;
}

.readout {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.readout__percent {
  font-size: 30px;
  font-weight: 600;
  color: var(--color-ink);
}

.readout__caption {
  padding-bottom: 4px;
  font-size: 13px;
  color: var(--color-muted);
}

.slider {
  width: 100%;
  height: 28px;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
}

.slider::-webkit-slider-runnable-track,
.slider::-moz-range-track,
.slider::-moz-range-progress {
  height: 4px;
  border-radius: 2px;
}

.slider::-webkit-slider-runnable-track {
  height: 4px;
  background:
    linear-gradient(
      to right,
      var(--color-accent) var(--fill, 40%),
      var(--color-border) var(--fill, 40%)
    );
}

.slider::-moz-range-track {
  background: var(--color-border);
}

.slider::-moz-range-progress {
  background: var(--color-accent);
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  margin-top: -9px;
  border-radius: 50%;
  background: var(--color-bg);
  outline: 4px solid var(--color-accent);
  box-shadow: var(--shadow-thumb);
}

.slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border: 4px solid var(--color-accent);
  border-radius: 50%;
  background: var(--color-bg);
  box-shadow: var(--shadow-thumb);
}

.scale-labels {
  display: flex;
  justify-content: space-between;
  color: var(--color-muted);
  font-size: 11.5px;
}

.reset-btn {
  width: 100%;
  height: 44px;
  border-radius: var(--radius-md);
  outline: 1px solid var(--color-border);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-ink);
}

.reset-btn:hover {
  background: var(--color-surface);
}

/* ---- Bookmarks ---- */
.bookmark-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 0 20px;
}

.bookmark-item__ref {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bookmark-item__link {
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.bookmark-item__link:hover .bookmark-item__ref {
  color: var(--color-accent);
}

.icon-bookmark-sm {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  color: var(--color-accent);
}

.icon-x {
  width: 16px;
  height: 16px;
  color: var(--color-faint);
}

.bookmark-item__text {
  font-family: var(--font-serif);
  font-size: 14.5px;
  line-height: 25px;
  color: var(--color-body);
}

.bookmark-item__text--arabic {
  direction: rtl;
  text-align: right;
  font-size: 1.4em;
  line-height: 1.8em;
  color: var(--color-ink);
}

.bookmark-item__date {
  font-size: 11.5px;
  color: var(--color-muted);
}

/* ---- Menu (progress-card shared) ---- */
.progress-card__stats {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.progress-card__percent {
  font-size: 34px;
  font-weight: 600;
  color: var(--color-ink);
}

.progress-card__detail {
  font-size: 12.5px;
  color: var(--color-muted);
  white-space: nowrap;
}

.menu-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 17px 0;
  text-align: left;
}

.menu-row__value {
  font-size: 13.5px;
  color: var(--color-muted);
  white-space: nowrap;
}

/* Also sizes the desktop theme button */
.icon-search--lg,
.icon-moon,
.icon-info {
  flex-shrink: 0;
  width: 19px;
  height: 19px;
  color: var(--color-ink);
}

.icon-chevron-right--sm {
  flex-shrink: 0;
  width: 17px;
  height: 17px;
  color: var(--color-faint);
}

.install-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 1rem;
}

.install-text {
  font-size: 13.5px;
  line-height: 22px;
  color: var(--color-muted);
}

.install-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--color-accent);
  color: var(--color-on-accent);
  font-size: 15px;
  font-weight: 600;
}

.icon-download {
  width: 17px;
  height: 17px;
  color: var(--color-on-accent);
}

/* ---- Theme picker ---- */
/* Keep the shell surfaces in step with the body during a theme switch. */
.top-nav,
.footer {
  transition: background-color 0.2s ease, color 0.2s ease;
}

.theme-list {
  display: flex;
  flex-direction: column;
}

.theme-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px 0;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  transition: background-color 0.2s ease;
}

.theme-row:last-child {
  border-bottom: 0;
}

.theme-row:hover {
  background: var(--color-surface);
}

.theme-row:focus-visible,
.menu-row:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: -2px;
}

.theme-row__icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  color: var(--color-ink);
}

.theme-row__label {
  flex: 1 1 0;
  min-width: 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--color-ink);
}

.theme-row--active .theme-row__label {
  color: var(--color-accent);
  font-weight: 600;
}

.theme-row__check {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: var(--color-accent);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.theme-row--active .theme-row__check {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  body,
  .top-nav,
  .footer {
    transition: none;
  }

  .theme-row,
  .theme-row__check {
    transition: none;
  }
}

/* ---- Clear data popover ---- */
.data-clear__text {
  margin-bottom: 1rem;
  font-size: 13.5px;
  line-height: 22px;
  color: var(--color-muted);
}

.data-clear__actions {
  display: flex;
  gap: 12px;
}

.data-clear__btn {
  flex: 1 1 0;
  height: 44px;
  border-radius: var(--radius-md);
  outline: 1px solid var(--color-border);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-ink);
}

.data-clear__btn:hover {
  background: var(--color-surface);
}

.data-clear__btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.data-clear__btn--danger {
  background: #B3402F;
  outline: 0;
  color: #fff;
  font-weight: 600;
}

.data-clear__btn--danger:hover {
  background: #98382A;
}

.data-clear__btn--danger:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -2px;
}

html[data-theme="dark"] .data-clear__btn--danger {
  background: #C85A45;
}

html[data-theme="dark"] .data-clear__btn--danger:hover {
  background: #B3402F;
}

.data-clear__status {
  margin-top: 1rem;
  font-size: 13px;
  line-height: 20px;
  color: var(--color-muted);
}

/* ---- Desktop shell ---- */
.app-main {
  width: 100%;
}

.progress-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 1rem;
}

/* ---- Top bar brand (desktop only) ---- */
.top-brand {
  display: none;
}

.top-brand__logo {
  position: relative;
  display: block;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
}

.logo-qaf {
  position: absolute;
  left: 4.475px;
  top: 9.925px;
  width: 21.075px;
  height: 14px;
}

.logo-dots {
  position: absolute;
  left: 13.35px;
  top: 2.125px;
  width: 10.525px;
  height: 3.825px;
}

.top-brand__name {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-ink);
  white-space: nowrap;
}

/* ---- Desktop layout (>=1024px) ---- */
@media (min-width: 1024px) {
  .top-nav {
    height: 64px;
    line-height: 64px;
  }

  .top-nav__inner {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 32px;
  }

  .top-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    margin-right: 28px;
  }

  .popover__inner {
    max-width: 680px;
  }

  .chapter-name {
    font-family: var(--font-ui);
    font-size: 16px;
  }

  .top-actions {
    gap: 18px;
  }

  .top-search {
    display: flex;
    width: 240px;
  }

  .trigger.theme-trigger {
    display: inline-flex;
  }

  .icon-menu {
    display: none;
  }

  .icon-ellipsis {
    display: block;
  }

  /* Desktop order: search · font-size · bookmarks · theme · menu */
  .fontsize-trigger {
    order: 1;
  }

  .bookmark-trigger {
    order: 2;
  }

  .theme-trigger {
    order: 3;
  }

  .menu-trigger {
    order: 4;
  }

  .reader {
    width: 100%;
  }

  .content {
    max-width: 680px;
    margin: 0 auto;
    padding: 2rem;
  }

  .chapter-header {
    padding: 2.5rem 3rem 2rem;
  }

  .chapter-ornament {
    width: 200px;
  }

  .bismillah {
    width: min(280px, 60%);
  }

  .chapter-meta {
    gap: 8px;
    padding: 0 3rem 28px;
  }

  .bismillah {
    font-size: 1.1875em;   /* 19px */
    line-height: 1.5789em; /* 30px */
  }

  .verse-row {
    gap: 20px;
  }

  .verse-number {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-xl);
  }

  .verse-text {
    font-size: 1.125em;   /* 18px */
    line-height: 1.7778em; /* 32px */
  }

  .footer__inner {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    flex-direction: row;
    justify-content: center;
    align-items: center;
  }

  .progress-group {
    flex-direction: row;
    align-items: center;
    gap: 14px;
    padding: 2rem 1rem;
  }

  .progress-group .progress-meta {
    display: contents;
  }

  .progress-group .progress-track {
    order: 2;
    width: 160px;
  }

  .progress-group .progress-percent {
    order: 3;
  }

  [popover] {
    top: 4rem;
  }
}
