* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --txt: var(--text-main);
  --tmut: var(--text-softer);
  --bdr: var(--border-subtle);
  --bg-main: #0a0f1a;
  --bg-elevated: #111827;
  --bg-elevated-soft: rgba(17, 24, 39, 0.7);
  --bg-card: #1e293b;
  --bg-card-soft: rgba(15, 23, 42, 0.85);
  --gold: #e8c547;
  --surf2: #1a2332;
  --tdim: #64748b;
  --grn: #22c55e;
  --border-subtle: #1e293b;
  --border-strong: #334155;
  --accent: #6ee7b7;
  --accent-soft: rgba(16, 185, 129, 0.2);
  --accent-strong: #10b981;
  --text-main: #e2e8f0;
  --text-soft: #94a3b8;
  --text-softer: #64748b;
  --text-hero: #f1f5f9;
  --warning: #fbbf24;
  --shadow-strong: 0 20px 60px rgba(0, 0, 0, 0.7);
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 8px;
  --transition-fast: 0.15s ease-out;
  --transition-med: 0.25s ease-out;
}

body {
  background: var(--bg-main);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #020617;
}

::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 3px;
}

input,
select,
button {
  font-family: inherit;
}

.ctr {
  max-width: 660px;
  margin: 0 auto;
}

/* View transitions */

#app {
  min-height: 100vh;
  transition: opacity var(--transition-med), transform var(--transition-med);
}

/* Keep fixed overlays truly viewport-fixed while menu open. */
body.menu-open #app {
  transform: none !important;
}

/* Same fix for feedback iframe overlay. */
body.fb-open #app {
  transform: none !important;
}

/* Ensure bottom audio bar stays viewport-fixed on all browsers. */
body.abar-open #app {
  transform: none !important;
}

.view-enter {
  opacity: 0;
  transform: translateY(4px);
}

.view-enter-active {
  opacity: 1;
  transform: translateY(0);
}

/* Header / home */

.hdr {
  position: sticky;
  top: 0;
  z-index: 10;
  background: radial-gradient(circle at top, rgba(45, 212, 191, 0.12), transparent 55%) var(--bg-main);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 16px;
}

.hdr--home {
  padding: 20px 16px 8px;
}

.hdr--home .topbar {
  margin-bottom: 4px;
}

.hdr--home .title {
  margin: 0 0 4px;
}

.hdr--home .sub {
  margin: 0;
}

.hdr--home .home-tools {
  margin-top: 16px;
}

.home-body {
  padding: 8px 16px 16px;
}

.home-view .surah-filter-tabs {
  margin-bottom: 8px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.topbar--welcome {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}

/* Beat `.topbar { display: flex }` when both classes apply (some embedded previews reorder CSS). */
.topbar.topbar--welcome {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}

.topbar-welcome-left {
  justify-self: start;
}

.topbar-mid {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  min-height: 32px;
  flex-shrink: 0;
}

.topbar--welcome .topbar-mid {
  justify-self: center;
}

.topbar--welcome .topbar-right {
  justify-self: end;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.topbar-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  overflow: hidden;
  display: block;
  flex-shrink: 0;
  object-fit: cover;
  vertical-align: middle;
}

.topbar-spacer {
  width: 40px;
}

.topbar-fill {
  flex: 1;
  min-width: 8px;
}

.topbar-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
}

.topbar-lang {
  display: flex;
  align-items: center;
}

.ui-lang-select {
  appearance: none;
  -webkit-appearance: none;
  background: rgba(2, 6, 23, 0.65);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  color: var(--text-main);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 28px 6px 10px;
  max-width: 150px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 14px;
}

.ui-lang-select:hover {
  border-color: rgba(16, 185, 129, 0.35);
}

.ui-lang-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.15);
}

.home-tools {
  margin-top: 14px;
  padding: 0;
}

.home-tools .search-wrap {
  margin-top: 0;
}

.bm-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.bm-chip {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: var(--text-main);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 9px;
  border-radius: 999px;
  cursor: pointer;
}

.bm-chip:hover {
  background: rgba(16, 185, 129, 0.2);
}

.qb-toast {
  position: fixed;
  left: 50%;
  bottom: 88px;
  transform: translateX(-50%);
  z-index: 200;
  max-width: min(92vw, 360px);
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
  box-shadow: var(--shadow-strong);
  pointer-events: none;
}

.v-btn-taf {
  font-size: 10px;
  font-weight: 700;
  max-width: 100px;
  padding: 3px 5px;
  line-height: 1.1;
  white-space: normal;
  text-align: center;
}

.menu-btn {
  background: rgba(2, 6, 23, 0.6);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  cursor: pointer;
  border-radius: 12px;
  padding: 6px 10px;
  font-size: 16px;
  line-height: 1;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.menu-btn:hover {
  background: rgba(2, 6, 23, 0.95);
  transform: translateY(-0.5px);
}

.page-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-hero);
  flex: 1;
  min-width: 0;
  text-align: center;
  padding: 0 4px;
}

.menu-ovl {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 100;
  backdrop-filter: blur(2px);
  /* Ensure overlay covers viewport and doesn't scroll */
  overflow: hidden;
}

.menu-drawer {
  width: min(320px, 86vw);
  height: 100vh;
  background: rgba(17, 24, 39, 0.96);
  border-right: 1px solid var(--border-strong);
  box-shadow: var(--shadow-strong);
  padding: 16px 12px;
  position: fixed;
  left: 0;
  top: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.menu-title {
  font-size: 12px;
  color: var(--text-soft);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 4px 8px 10px;
}

.menu-item {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text-main);
  padding: 10px 10px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 14px;
  transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}

.menu-item:hover {
  background: rgba(30, 41, 59, 0.85);
  transform: translateY(-0.5px);
}

.menu-item.on {
  background: rgba(16, 185, 129, 0.16);
  color: var(--accent);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.page-card {
  background: var(--bg-elevated-soft);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 14px;
}

.page-h {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-hero);
  margin-bottom: 8px;
}

.page-p {
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.7;
}

.page-p.about-main {
  color: var(--txt);
  white-space: pre-line;
}

.page-p.about-credit {
  font-size: 11px;
  color: var(--tmut);
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--bdr);
  white-space: pre-line;
}

.page-p.about-website {
  margin-top: 12px;
  color: var(--txt);
}

.page-p.about-website .about-site-link {
  color: var(--gold);
}

.page-p.about-contact {
  margin-top: 12px;
  color: var(--txt);
}

.page-p.about-contact .about-email {
  color: var(--gold);
}

.page-p.about-blessing {
  margin-top: 10px;
  color: var(--txt);
}

.fb-form {
  background: var(--bg-elevated-soft);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 14px;
}

.fb-h {
  font-size: 12px;
  color: var(--text-soft);
  margin-bottom: 6px;
  line-height: 1.4;
}

.fb-in {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--text-main);
  outline: none;
  font-size: 14px;
}

.fb-ta {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--text-main);
  outline: none;
  font-size: 14px;
  resize: vertical;
}

.fb-ok {
  background: #1d4ed8;
  color: white;
  border: none;
  border-radius: 12px;
  padding: 10px 16px;
  font-weight: 700;
  cursor: pointer;
}

.fb-ok:hover {
  filter: brightness(1.05);
}

.typeform-wrap {
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated-soft);
}

.typeform-frame {
  width: 100%;
  min-height: 520px;
  height: min(72vh, 820px);
  border: 0;
  display: block;
}

.typeform-setup-note .page-h {
  margin-bottom: 6px;
}

.bismillah {
  text-align: center;
  font-size: 28px;
  color: var(--accent);
  font-family: serif;
  margin-bottom: 4px;
}

.title {
  font-size: 18px;
  font-weight: 700;
  margin: 8px 0 2px;
  color: var(--text-hero);
  text-align: center;
}

.sub {
  font-size: 12px;
  color: var(--text-softer);
  text-align: center;
}

.search-wrap {
  position: relative;
  margin-top: 12px;
}

.search-wrap svg {
  position: absolute;
  left: 12px;
  top: 11px;
  width: 16px;
  height: 16px;
  color: #475569;
}

.search {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 10px 12px 10px 36px;
  color: var(--text-main);
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.search:focus {
  border-color: var(--border-strong);
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.4);
  background: #020617;
}

.surah-list-sidebar {
  display: flex;
  flex-direction: column;
}

.surah-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.surah-filter-pill {
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
  background: var(--surf2);
  color: var(--tdim);
}

.surah-filter-pill:hover {
  color: var(--text-soft);
}

.surah-filter-pill--active {
  background: var(--gold);
  color: var(--bg-main);
}

.surah-filter-pill--active:hover {
  color: var(--bg-main);
}

.juz-group-hdr {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
  padding: 12px 8px 6px;
  user-select: none;
}

.juz-group-hdr-btn {
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.juz-group-hdr-btn:hover {
  opacity: 0.9;
}

.rev-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.rev-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.rev-dot--meccan {
  background: var(--gold);
}

.rev-dot--medinan {
  background: var(--grn);
}

/* Surah cards */

.ch-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 8px;
  background: transparent;
  border: none;
  border-bottom: 1px solid #020617;
  cursor: pointer;
  text-align: left;
  color: var(--text-main);
  border-radius: 12px;
  transition: background var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.ch-btn:hover {
  background: rgba(15, 23, 42, 0.9);
  border-color: var(--border-subtle);
  transform: translateY(-1px);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.7);
}

.ch-num {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(16, 185, 129, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 13px;
  font-family: monospace;
  flex-shrink: 0;
}

.ch-name {
  font-weight: 600;
  font-size: 14px;
}

.ch-ar {
  font-size: 20px;
  color: var(--accent);
  font-family: serif;
}

.ch-meta {
  font-size: 11px;
  color: var(--text-softer);
  margin-top: 2px;
}

/* Surah view */

.s-hdr {
  position: sticky;
  top: 0;
  z-index: 10;
  background: radial-gradient(circle at top, rgba(59, 130, 246, 0.14), transparent 50%) var(--bg-main);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-subtle);
}

.s-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 16px;
  row-gap: 6px;
}

.back-btn {
  background: none;
  border: none;
  color: var(--text-main);
  cursor: pointer;
  padding: 4px;
  font-size: 20px;
  border-radius: 999px;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.back-btn:hover {
  background: rgba(15, 23, 42, 0.9);
  transform: translateX(-1px);
}

.s-title {
  font-weight: 600;
  font-size: 14px;
}

.s-title-btn {
  background: none;
  border: none;
  padding: 2px 4px;
  margin: -2px -4px;
  color: var(--text-main);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 10px;
}

.s-title-btn:hover {
  background: rgba(15, 23, 42, 0.85);
}

.s-chev {
  color: var(--text-softer);
  font-size: 12px;
  transform: translateY(0.5px);
}

.s-ar {
  color: var(--accent);
  font-family: serif;
}

.s-meta {
  font-size: 11px;
  color: var(--text-softer);
}

.pill {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.pill-on {
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.5);
}

.pill-off {
  background: #020617;
  color: #94a3b8;
}

.pill:hover {
  transform: translateY(-0.5px);
}

/* Verse */

.verse {
  border-bottom: 1px solid rgba(30, 41, 59, 0.5);
  padding: 20px 0;
}

.verse-hl {
  background: rgba(232, 197, 71, 0.08);
  outline: 2px solid rgba(232, 197, 71, 0.35);
  border-radius: 14px;
  padding-left: 10px;
  padding-right: 10px;
}

.juz-marker {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--gold);
  font-size: 12px;
  margin: 16px 0;
  cursor: pointer;
}

.juz-line {
  flex: 1;
  height: 1px;
  background: var(--gold);
  opacity: 0.3;
}

.surah-ovl {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.72);
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.surah-modal {
  width: min(600px, 92vw);
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  box-shadow: var(--shadow-strong);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.surah-modal-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 10px;
}

.surah-modal-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-hero);
}

.surah-modal-x {
  background: transparent;
  border: none;
  color: var(--text-soft);
  font-size: 18px;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 10px;
}

.surah-modal-x:hover {
  background: rgba(30, 41, 59, 0.7);
  color: var(--text-main);
}

.surah-modal-search {
  margin: 0 14px 12px;
  width: calc(100% - 28px);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--text-main);
  outline: none;
}

.surah-modal-search:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(232, 197, 71, 0.15);
}

.surah-modal-list {
  overflow: auto;
  padding: 0 8px 10px;
}

.surah-modal-empty {
  padding: 14px;
  color: var(--text-soft);
  font-size: 13px;
}

.surah-modal-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 14px;
  color: var(--text-main);
  text-align: left;
}

.surah-modal-row:hover {
  background: rgba(30, 41, 59, 0.55);
}

.surah-modal-row.on {
  box-shadow: 0 0 0 1px rgba(232, 197, 71, 0.4);
  background: rgba(232, 197, 71, 0.08);
}

.surah-modal-num {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: rgba(232, 197, 71, 0.18);
  color: var(--gold);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.surah-modal-row.on .surah-modal-num {
  background: var(--gold);
  color: var(--bg-main);
}

.surah-modal-mid {
  flex: 1;
  min-width: 0;
}

.surah-modal-name {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.surah-modal-ar {
  color: var(--accent);
  font-family: serif;
  font-size: 18px;
  direction: rtl;
}

.fb-ovl {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 450;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  overscroll-behavior: contain;
}

.fb-modal {
  width: min(800px, 80vw);
  height: 80vh;
  background: #ffffff;
  border-radius: 14px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-strong);
}

@media (prefers-color-scheme: dark) {
  .fb-modal {
    background: #0b1220;
  }
}

.fb-x {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(2, 6, 23, 0.65);
  color: var(--text-main);
  cursor: pointer;
}

.fb-x:hover {
  background: rgba(2, 6, 23, 0.9);
}

.fb-iframe {
  width: 100%;
  height: 100%;
  border: 0;
}


.v-ctrl {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.v-num {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--accent);
  font-family: monospace;
}

.v-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  color: var(--text-softer);
  font-size: 16px;
  transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}

.v-btn:hover {
  background: #020617;
  transform: translateY(-0.5px);
}

.v-btn.on {
  color: var(--accent);
}

.v-btn.bm {
  color: var(--warning);
}

/* WBW */

.wbw-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  direction: rtl;
  margin-bottom: 14px;
}

.wbw-word {
  text-align: center;
  padding: 4px 6px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--text-main);
  min-width: 36px;
  background: transparent;
}

.wbw-word:hover {
  background: rgba(30, 41, 59, 0.7);
  transform: translateY(-0.5px);
}

.wbw-word.hl {
  background: rgba(16, 185, 129, 0.25);
  outline: 2px solid rgba(16, 185, 129, 0.6);
}

.wbw-word.hl .w-ar {
  color: var(--accent);
}

.w-ar {
  font-size: 22px;
  font-family: serif;
  color: var(--text-hero);
  line-height: 1.5;
}

.w-tr {
  font-size: 9px;
  color: var(--text-softer);
  margin-top: 1px;
}

.w-en {
  font-size: 9px;
  color: var(--accent-strong);
}

.arabic-line {
  font-size: 26px;
  line-height: 2;
  text-align: right;
  direction: rtl;
  font-family: serif;
  margin-bottom: 14px;
  color: var(--text-hero);
}

.translit-line {
  font-size: 12px; /* slightly smaller than .trans */
  color: #8b9dc3;
  font-style: italic;
  line-height: 1.6;
  direction: ltr;
  text-align: left;
  margin: 2px 0 4px;
  letter-spacing: 0.02em;
}

.translit-line b {
  color: #6b7280; /* muted gray for silent letters */
  font-weight: 500;
}

.translit-line u {
  text-decoration: underline dotted;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  text-decoration-color: #a5b4fc; /* subtle accent */
}

.kz-translit-line {
  font-size: 13px; /* slightly smaller than Kyrgyz trans */
  color: #fbbf24; /* muted gold */
  font-style: italic;
  line-height: 1.6;
  direction: ltr;
  text-align: left;
  margin: 2px 0 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
}

.kz-translit-tag {
  font-size: 10px;
  font-style: normal;
  color: rgba(251, 191, 36, 0.75);
  border: 1px solid rgba(251, 191, 36, 0.25);
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.kz-translit-text {
  color: rgba(251, 191, 36, 0.92);
}

mark.qhl {
  background: rgba(245, 158, 11, 0.22);
  color: #fbbf24;
  padding: 0 2px;
  border-radius: 4px;
}

.trans-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.trans-row .trans {
  flex: 1;
  min-width: 0;
  margin: 0;
}

.ky-static-audio-btn {
  flex-shrink: 0;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  color: #94a3b8;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.ky-static-audio-btn:hover {
  background: rgba(30, 41, 59, 0.95);
  color: var(--accent);
}

.trans {
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.8;
}

/* Tafsir */

.taf-box {
  margin-top: 12px;
  padding: 14px;
  background: var(--bg-elevated-soft);
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
}

.taf-box p {
  margin: 0 0 8px;
  line-height: 1.7;
}

.taf-box b,
.taf-box strong {
  color: var(--accent);
}

.taf-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.taf-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}

.taf-sel {
  font-size: 11px;
  background: var(--bg-elevated);
  color: var(--text-soft);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 3px 8px;
}

.taf-rate {
  font-size: 11px;
  background: var(--bg-elevated);
  color: var(--text-soft);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 3px 6px;
}

.taf-content {
  font-size: 12px;
  color: var(--text-soft);
  line-height: 1.8;
  max-height: 300px;
  overflow-y: auto;
}

/* Word panel */

.wpanel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 20;
  padding: 0 16px 16px;
}

.wpanel.up {
  bottom: 60px;
}

.wpanel-inner {
  max-width: 660px;
  margin: 0 auto;
  background: var(--bg-card-soft);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.7);
}

.wp-ar {
  font-size: 36px;
  font-family: serif;
  color: var(--accent);
}

.wp-tr {
  font-size: 14px;
  color: var(--text-soft);
  margin-top: 2px;
}

.wp-close {
  background: none;
  border: none;
  color: var(--text-softer);
  cursor: pointer;
  padding: 4px;
  font-size: 18px;
  border-radius: 999px;
}

.wp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.wp-card {
  background: #020617;
  border-radius: 10px;
  padding: 10px;
}

.wp-lbl {
  font-size: 10px;
  color: var(--text-softer);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.wp-val {
  font-size: 13px;
  color: var(--text-main);
  margin-top: 3px;
}

.wp-root {
  font-size: 18px;
  color: var(--accent);
  margin-top: 3px;
  font-family: serif;
  letter-spacing: 6px;
}

/* Audio bar */

.abar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border-subtle);
  padding: 10px 16px;
  z-index: 15;
}

.abar-inner {
  max-width: 660px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.abar-top {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.abar-seek-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
}

.abar-seek {
  flex: 1;
  accent-color: var(--gold);
}

.abar-rem {
  font-size: 12px;
  color: var(--text-soft);
  min-width: 52px;
  text-align: right;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.abar-bottom {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.abar-speeds {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.abar-speed {
  border: none;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  background: var(--surf2);
  color: var(--tdim);
}

.abar-speed.on {
  background: var(--gold);
  color: var(--bg-main);
}

.abar-continue {
  border: none;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  background: #020617;
  color: #94a3b8;
}

.abar-continue.on {
  background: var(--gold);
  color: var(--bg-main);
}

.abar-info {
  font-size: 13px;
  color: var(--text-soft);
}

.abar-info b {
  color: var(--accent);
  font-weight: 600;
}

.abar-btns {
  display: flex;
  align-items: center;
  gap: 4px;
}

.abar-btn {
  background: none;
  border: none;
  color: var(--text-main);
  cursor: pointer;
  padding: 6px;
  font-size: 16px;
  border-radius: 999px;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.abar-btn:hover {
  background: #020617;
  transform: translateY(-0.5px);
}

.abar-pause {
  background: var(--accent-strong);
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 8px 10px;
  border-radius: 50%;
  font-size: 16px;
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.6);
}

@media (max-width: 520px) {
  .abar {
    padding: 14px 16px;
  }

  .abar-speed {
    padding: 8px 12px;
  }

  .abar-continue {
    padding: 10px 14px;
  }
}

/* Loading */

.loading {
  text-align: center;
  padding: 60px;
  color: var(--text-softer);
  font-size: 13px;
}

.loading .spin {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-subtle);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 6px;
}

/* Small inline spinner (e.g. inside buttons) */
.spin {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid var(--border-subtle);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Responsive */

@media (max-width: 480px) {
  .s-bar {
    gap: 6px;
  }

  .s-title {
    font-size: 13px;
  }

  .s-ar {
    font-size: 15px;
  }

  .arabic-line {
    font-size: 22px;
  }

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

