:root {
  color-scheme: dark;
  --bg: #020504;
  --bg-2: #05100c;
  --surface: #07140f;
  --surface-2: #0a1d15;
  --surface-3: #0d281d;
  --line: rgba(75, 214, 139, 0.24);
  --line-strong: rgba(91, 242, 157, 0.56);
  --text: #f2f5ef;
  --muted: #aab6ad;
  --soft: #d7ded7;
  --accent: #56e28b;
  --accent-2: #9cffbd;
  --danger: #f2c98d;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --radius: 8px;
  --page: min(1120px, calc(100vw - 40px));
  --serif: Georgia, "Times New Roman", "Noto Naskh Arabic", "Traditional Arabic", serif;
  --sans: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --rail-progress: 0%;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  letter-spacing: 0;
  overflow-x: hidden;
  overscroll-behavior-y: contain;
}

[hidden] {
  display: none !important;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  content: "";
  background:
    linear-gradient(180deg, rgba(2, 5, 4, 0.96), rgba(2, 7, 5, 0.92)),
    repeating-linear-gradient(90deg, rgba(86, 226, 139, 0.025) 0 1px, transparent 1px 140px),
    repeating-linear-gradient(0deg, rgba(86, 226, 139, 0.018) 0 1px, transparent 1px 140px);
}

.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 0 20%, rgba(29, 105, 66, 0.11) 42%, transparent 67%),
    linear-gradient(255deg, transparent 0 38%, rgba(46, 152, 96, 0.08) 54%, transparent 78%);
  opacity: 0.95;
}

a {
  color: inherit;
}

button {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 24px;
  padding: 22px max(20px, calc((100vw - var(--page)) / 2));
  border-bottom: 1px solid rgba(118, 225, 164, 0.14);
  background: rgba(2, 5, 4, 0.78);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.42rem;
  line-height: 1;
  text-decoration: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  color: var(--accent);
}

.brand-mark path {
  fill: none;
  stroke: currentColor;
  stroke-linejoin: round;
  stroke-width: 2.4;
}

.date-line {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.86rem;
  white-space: nowrap;
}

.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.prayer-link {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  border-bottom: 1px solid rgba(86, 226, 139, 0.45);
  color: var(--soft);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  transition:
    color 180ms ease,
    border-color 180ms ease;
}

.prayer-link:hover,
.prayer-link:focus-visible {
  border-color: var(--accent);
  color: var(--accent-2);
  outline: none;
}

.icon-button {
  display: inline-grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--soft);
  cursor: pointer;
  transition:
    color 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    transform 180ms ease;
}

.icon-button:hover,
.icon-button:focus-visible,
.icon-button.active {
  border-color: var(--line);
  background: rgba(86, 226, 139, 0.08);
  color: var(--accent-2);
  outline: none;
  transform: translateY(-1px);
}

.icon-button.small {
  width: 32px;
  height: 32px;
}

.icon-button svg {
  width: 21px;
  height: 21px;
}

.icon-button path,
.icon-button circle {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.75;
}

.app-shell {
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: 0;
  width: var(--page);
  margin: 0 auto;
  padding: 22px 0 56px;
}

.reading-rail {
  position: sticky;
  top: 104px;
  align-self: start;
  display: grid;
  width: 76px;
  min-height: 0;
  justify-items: center;
  gap: 16px;
  padding-top: 2px;
  contain: layout;
}

.content-flow {
  min-width: 0;
  width: 100%;
}

.rail-line {
  position: absolute;
  top: 33px;
  bottom: 88px;
  left: 37px;
  width: 1px;
  background:
    linear-gradient(
      to bottom,
      var(--accent) 0 var(--rail-progress),
      rgba(86, 226, 139, 0.1) var(--rail-progress) 100%
    );
  transition: background 420ms ease;
}

.rail-items {
  position: relative;
  display: grid;
  gap: 16px;
}

.rail-button {
  position: relative;
  z-index: 1;
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(2, 5, 4, 0.86);
  color: var(--soft);
  font-family: var(--serif);
  font-size: 0.96rem;
  text-decoration: none;
  transition:
    color 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease,
    transform 260ms ease;
  will-change: transform;
}

.rail-button:focus {
  outline: none;
}

.rail-button:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 4px;
}

.rail-button:hover,
.rail-button.active {
  border-color: var(--accent);
  background: rgba(7, 28, 19, 0.92);
  color: var(--accent-2);
  box-shadow:
    0 0 0 6px rgba(86, 226, 139, 0.08),
    0 12px 30px rgba(0, 0, 0, 0.32);
}

.rail-button.active {
  transform: scale(1.045);
}

.rail-button.active::after {
  position: absolute;
  inset: -4px;
  border: 1px solid rgba(86, 226, 139, 0.24);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.rail-hint {
  position: relative;
  z-index: 1;
  width: 82px;
  min-height: 40px;
  margin: 0;
  color: var(--accent-2);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.45;
  text-align: center;
  text-transform: uppercase;
}

.rail-hint.is-changing {
  animation: hintLift 360ms ease;
}

.day-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 6px 0 18px;
  border-bottom: 1px solid rgba(118, 225, 164, 0.13);
}

html:not([data-active-section="verse"]) .day-note {
  display: none;
}

.lockline {
  margin: 0;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.day-note p:not(.lockline) {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.7;
  text-align: right;
  overflow-wrap: anywhere;
}

.sections {
  display: grid;
}

.daily-section {
  position: relative;
  min-height: calc(100svh - 112px);
  display: grid;
  align-content: center;
  overflow: hidden;
  padding: clamp(34px, 5vh, 58px) 0;
  border-bottom: 1px solid rgba(118, 225, 164, 0.12);
  scroll-margin-top: 108px;
}

.daily-section.is-past {
  display: none;
}

#verse {
  min-height: calc(100svh - 132px);
  padding-top: clamp(28px, 4vh, 44px);
}

.daily-section::before,
.daily-section::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.daily-section::before {
  inset: 12% -12% 8% 12%;
  background: linear-gradient(118deg, transparent 0 36%, rgba(86, 226, 139, 0.045) 52%, transparent 72%);
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 680ms ease,
    transform 680ms ease;
}

.daily-section::after {
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(86, 226, 139, 0.72), transparent);
  opacity: 0;
  transform: scaleX(0);
  transform-origin: left;
}

.daily-section.is-current::before {
  opacity: 1;
  transform: translateY(0);
}

.daily-section.is-current::after,
.daily-section.snap-focus::after {
  animation: sectionSweep 900ms ease forwards;
}

.daily-section.band {
  margin-inline: 0;
  padding-inline: 36px;
  background: linear-gradient(180deg, rgba(86, 226, 139, 0.025), rgba(86, 226, 139, 0));
}

.section-kicker {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: clamp(14px, 2.4vh, 22px);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.section-kicker::after {
  width: 42px;
  height: 1px;
  content: "";
  background: var(--accent);
}

.content-block {
  position: relative;
  z-index: 1;
  max-width: 820px;
  min-width: 0;
  transition:
    transform 520ms ease,
    filter 520ms ease;
}

.daily-section.is-current .content-block {
  filter: drop-shadow(0 18px 48px rgba(0, 0, 0, 0.18));
}

.daily-section.is-current .section-kicker {
  animation: kickerSlide 520ms ease both;
}

.daily-section.is-current .source-row,
.daily-section.is-current .revelation-card,
.daily-section.is-current .dhikr-counter,
.daily-section.is-current .story-note {
  animation: detailRise 620ms ease both;
}

.daily-section.snap-focus .content-block {
  animation: sectionSettle 720ms ease;
}

.title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px 18px;
  margin-bottom: 22px;
}

.section-title {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.8rem, 3.55vw, 3.35rem);
  font-weight: 400;
  line-height: 1.05;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent-2);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.15;
}

.arabic {
  margin: 0 0 12px;
  color: var(--text);
  font-family: var(--serif);
  font-size: clamp(1.7rem, 3.85vw, 3.5rem);
  font-weight: 400;
  line-height: 1.45;
  text-align: right;
  direction: rtl;
  overflow-wrap: anywhere;
}

.translit {
  margin: 0 0 12px;
  color: var(--soft);
  font-family: var(--serif);
  font-size: clamp(1rem, 1.55vw, 1.28rem);
  font-style: italic;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.meaning,
.quote-text {
  margin: 0;
  color: var(--text);
  font-family: var(--serif);
  font-size: clamp(1.2rem, 2.25vw, 1.95rem);
  line-height: 1.36;
}

.body-text,
.explain,
.effect,
.moral {
  max-width: 780px;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.explain,
.effect,
.moral {
  margin-top: 18px;
}

.mini-label {
  display: block;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.source-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.88rem;
}

.revelation-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 12px;
  max-width: 820px;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid rgba(86, 226, 139, 0.2);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(86, 226, 139, 0.08), rgba(86, 226, 139, 0.02)),
    rgba(2, 5, 4, 0.42);
  overflow: hidden;
}

.revelation-card::before {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(110deg, transparent 0 34%, rgba(86, 226, 139, 0.11) 50%, transparent 66%);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-120%);
}

.daily-section.is-current .revelation-card::before {
  animation: cardGlint 1100ms ease 260ms;
}

.revelation-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

.context-link {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  align-items: center;
  gap: 8px;
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
}

.context-link svg {
  width: 16px;
  height: 16px;
}

.context-link path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.source-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--soft);
  text-decoration: none;
  transition: color 180ms ease;
}

.source-link:hover,
.source-link:focus-visible {
  color: var(--accent-2);
  outline: none;
}

.source-link svg {
  width: 17px;
  height: 17px;
  color: var(--accent);
}

.source-link path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.count-chip {
  display: inline-flex;
  align-items: center;
  margin-bottom: 14px;
  padding: 6px 11px;
  border-left: 2px solid var(--accent);
  background: rgba(86, 226, 139, 0.08);
  color: var(--accent-2);
  font-size: 0.82rem;
  font-weight: 700;
}

.dhikr-counter {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 10px;
  margin: 18px 0 4px;
}

.counter-tap,
.counter-reset,
.next-cue {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(86, 226, 139, 0.06);
  color: var(--soft);
  cursor: pointer;
  transition:
    background 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.counter-tap:hover,
.counter-tap:focus-visible,
.counter-reset:hover,
.counter-reset:focus-visible,
.next-cue:hover,
.next-cue:focus-visible {
  border-color: var(--accent);
  background: rgba(86, 226, 139, 0.11);
  color: var(--accent-2);
  outline: none;
  transform: translateY(-1px);
}

.counter-tap {
  display: grid;
  min-width: min(100%, 270px);
  min-height: 76px;
  justify-items: start;
  padding: 12px 16px;
}

.counter-number {
  color: var(--text);
  font-family: var(--serif);
  font-size: 2rem;
  line-height: 1;
}

.counter-label {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.counter-reset {
  min-width: 92px;
  padding: 0 16px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.counter-tap.pulse {
  animation: counterPress 260ms ease;
}

.next-cue {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  padding: 11px 13px;
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.next-cue svg {
  width: 17px;
  height: 17px;
  animation: arrowDrift 1450ms ease-in-out infinite;
}

.next-cue path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.quote-person {
  margin-top: 24px;
  color: var(--accent-2);
  font-size: 0.94rem;
}

.story-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.42fr);
  gap: 34px;
  align-items: start;
}

.story-note {
  border-left: 1px solid var(--line-strong);
  padding-left: 22px;
}

.story-action {
  margin-top: 18px;
  color: var(--soft);
  font-family: var(--serif);
  font-size: 1.08rem;
  line-height: 1.6;
}

.jump-menu {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  justify-items: end;
  padding: 76px max(20px, calc((100vw - var(--page)) / 2)) 20px;
  background: rgba(0, 0, 0, 0.36);
}

.jump-panel {
  width: min(320px, calc(100vw - 40px));
  height: max-content;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(5, 15, 11, 0.96);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.jump-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 12px 18px;
  border-bottom: 1px solid rgba(118, 225, 164, 0.13);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.jump-links {
  display: grid;
  padding: 8px;
}

.jump-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 12px;
  border-radius: 6px;
  color: var(--soft);
  font-size: 0.92rem;
  text-decoration: none;
}

.jump-links a:hover,
.jump-links a:focus-visible {
  background: rgba(86, 226, 139, 0.08);
  color: var(--accent-2);
  outline: none;
}

.saved-drawer {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: grid;
  justify-items: end;
  padding: 76px max(20px, calc((100vw - var(--page)) / 2)) 20px;
  background: rgba(0, 0, 0, 0.42);
}

.saved-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  width: min(460px, calc(100vw - 40px));
  max-height: min(760px, calc(100svh - 96px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(5, 15, 11, 0.97);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  overflow: hidden;
}

.saved-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 16px 14px;
  border-bottom: 1px solid rgba(118, 225, 164, 0.13);
}

.saved-header h2 {
  margin: 0;
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 400;
}

.saved-summary {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(118, 225, 164, 0.1);
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.saved-list {
  display: grid;
  gap: 12px;
  min-height: 0;
  overflow: auto;
  padding: 12px;
}

.saved-empty,
.saved-card {
  border: 1px solid rgba(86, 226, 139, 0.17);
  border-radius: var(--radius);
  background: rgba(86, 226, 139, 0.045);
}

.saved-empty {
  padding: 16px;
}

.saved-empty p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.saved-card {
  padding: 14px;
}

.saved-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.saved-date {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.saved-card h3,
.saved-reading h4 {
  margin: 6px 0 0;
  color: var(--text);
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.15;
}

.saved-card-head p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.saved-remove {
  flex: 0 0 auto;
  min-height: 32px;
  border: 1px solid rgba(86, 226, 139, 0.2);
  border-radius: var(--radius);
  background: transparent;
  color: var(--soft);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 0 10px;
  text-transform: uppercase;
}

.saved-remove:hover,
.saved-remove:focus-visible {
  border-color: var(--accent);
  color: var(--accent-2);
  outline: none;
}

.saved-card details {
  margin-top: 12px;
}

.saved-card summary {
  color: var(--accent-2);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.saved-reading-grid {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.saved-reading {
  border-left: 2px solid rgba(86, 226, 139, 0.42);
  padding-left: 12px;
}

.saved-reading p {
  margin: 8px 0 0;
  color: var(--soft);
  font-size: 0.9rem;
  line-height: 1.55;
}

.saved-reading .saved-note {
  color: var(--muted);
  font-size: 0.82rem;
}

.saved-arabic {
  color: var(--text) !important;
  direction: rtl;
  font-family: var(--serif);
  font-size: 1.25rem !important;
  line-height: 1.8 !important;
  text-align: right;
}

.saved-reading a {
  display: inline-flex;
  margin-top: 8px;
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
}

.saved-reading a:hover,
.saved-reading a:focus-visible {
  color: var(--accent);
  outline: none;
}

.toast {
  position: fixed;
  right: max(20px, calc((100vw - var(--page)) / 2));
  bottom: 24px;
  z-index: 50;
  max-width: min(360px, calc(100vw - 40px));
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(5, 15, 11, 0.95);
  color: var(--soft);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
  pointer-events: none;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  width: var(--page);
  margin: 0 auto;
  padding: 28px 0 42px 92px;
  color: var(--muted);
  font-size: 0.85rem;
}

.site-footer a {
  color: var(--soft);
  text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--accent-2);
  outline: none;
}

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 720ms ease,
    transform 720ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes railPulse {
  0%,
  100% {
    opacity: 0.45;
    transform: scale(0.95);
  }

  50% {
    opacity: 1;
    transform: scale(1.05);
  }
}

@keyframes hintLift {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes counterPress {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.025);
  }
}

@keyframes sectionSweep {
  0% {
    opacity: 0;
    transform: scaleX(0);
  }

  45% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: scaleX(1);
  }
}

@keyframes sectionSettle {
  0% {
    opacity: 0.68;
    transform: translateY(28px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes kickerSlide {
  0% {
    opacity: 0;
    transform: translateX(-12px);
  }

  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes detailRise {
  0% {
    opacity: 0.72;
    transform: translateY(14px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cardGlint {
  0% {
    opacity: 0;
    transform: translateX(-120%);
  }

  30% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translateX(120%);
  }
}

@keyframes arrowDrift {
  0%,
  100% {
    transform: translateY(-2px);
  }

  50% {
    transform: translateY(3px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
    animation-duration: 1ms !important;
  }
}

@media (max-width: 820px) {
  :root {
    --page: min(100vw - 28px, 720px);
  }

  .site-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    padding-block: 16px;
  }

  .header-actions {
    flex-shrink: 0;
    margin-left: auto;
  }

  .date-line {
    order: 3;
    width: 100%;
    font-size: 0.78rem;
  }

  .app-shell {
    grid-template-columns: 1fr;
    padding-top: 10px;
  }

  .reading-rail {
    position: sticky;
    top: 92px;
    z-index: 15;
    display: grid;
    width: auto;
    min-height: 0;
    justify-items: stretch;
    margin-inline: -14px;
    margin-bottom: 10px;
    padding: 6px 14px 8px;
    overflow: visible;
    background: rgba(2, 5, 4, 0.82);
    backdrop-filter: blur(16px);
  }

  html:not([data-active-section="verse"]) .reading-rail {
    margin-bottom: -54px;
  }

  .rail-line {
    display: none;
  }

  .rail-items {
    display: flex;
    width: 100%;
    gap: 10px;
    overflow-x: auto;
    padding: 0 0 3px;
    scrollbar-width: none;
  }

  .rail-items::-webkit-scrollbar {
    display: none;
  }

  .rail-hint {
    width: auto;
    min-height: 14px;
    justify-self: start;
    margin-left: 2px;
    text-align: left;
    font-size: 0.62rem;
  }

  .rail-button {
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    font-size: 0.82rem;
  }

  .day-note {
    display: grid;
    padding: 28px 0 26px;
  }

  .day-note p:not(.lockline) {
    max-width: none;
    text-align: left;
  }

  .daily-section,
  .daily-section.band {
    min-height: calc(100svh - 210px);
    margin-inline: 0;
    padding: 20px 0;
  }

  .section-kicker {
    align-items: flex-start;
    margin-bottom: 16px;
    line-height: 1.35;
  }

  .arabic {
    text-align: start;
  }

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

  .story-note {
    border-left: 0;
    border-top: 1px solid var(--line-strong);
    padding: 22px 0 0;
  }

  .site-footer {
    padding-left: 0;
  }
}

@media (max-width: 560px) {
  :root {
    --page: min(100vw - 64px, 720px);
  }

  .brand {
    font-size: 1.15rem;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
  }

  .header-actions {
    position: absolute;
    top: 14px;
    right: 12px;
    z-index: 2;
    display: flex !important;
    gap: 4px;
    margin-left: 0;
  }

  #shareButton {
    display: none;
  }

  .prayer-link {
    min-height: 34px;
    font-size: 0.72rem;
  }

  #menuButton {
    display: inline-grid !important;
  }

  .content-flow {
    padding-right: 28px;
  }

  .icon-button {
    width: 36px;
    height: 36px;
  }

  .daily-section {
    scroll-margin-top: 138px;
  }

  .title-row {
    display: grid;
    justify-items: start;
    margin-bottom: 14px;
  }

  .section-title {
    font-size: clamp(1.55rem, 8.6vw, 2.1rem);
  }

  .lockline,
  .day-note p:not(.lockline) {
    max-width: min(100%, 300px);
  }

  .arabic,
  .translit,
  .meaning,
  .quote-text,
  .body-text,
  .explain,
  .effect,
  .moral,
  .story-action {
    max-width: min(100%, 280px);
    width: 100%;
    word-break: break-word;
  }

  .arabic {
    font-size: clamp(1.2rem, 5vw, 1.48rem);
    line-height: 1.55;
    text-align: right;
    word-break: break-all;
  }

  .translit {
    font-size: 0.95rem;
  }

  .meaning,
  .quote-text {
    font-size: clamp(1.08rem, 5.3vw, 1.32rem);
    word-break: break-word;
  }

  .body-text,
  .explain,
  .effect,
  .moral {
    font-size: 0.9rem;
    line-height: 1.5;
  }

  .explain,
  .effect,
  .moral {
    margin-top: 12px;
  }

  .source-row {
    align-items: flex-start;
    display: grid;
    margin-top: 12px;
  }

  .revelation-card {
    grid-template-columns: 1fr;
    max-width: min(100%, 280px);
    padding: 14px;
  }

  .dhikr-counter {
    display: grid;
  }

  .counter-tap,
  .counter-reset,
  .next-cue {
    width: min(100%, 280px);
  }

  .next-cue {
    margin-top: 14px;
  }

  .counter-reset {
    min-height: 42px;
  }

  .site-footer {
    display: grid;
  }

  .saved-drawer {
    padding: 70px 10px 10px;
  }

  .saved-panel {
    width: 100%;
    max-height: calc(100svh - 80px);
  }

  .saved-card-head {
    display: grid;
  }

  .saved-remove {
    width: max-content;
  }
}

@media (max-width: 700px) {
  :root {
    --page: 100%;
  }

  body {
    min-height: 100svh;
    overflow-x: hidden;
  }

  body::before {
    background:
      linear-gradient(180deg, rgba(2, 5, 4, 0.98), rgba(3, 12, 8, 0.96)),
      repeating-linear-gradient(90deg, rgba(86, 226, 139, 0.018) 0 1px, transparent 1px 96px);
  }

  .ambient {
    opacity: 0.62;
  }

  .site-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding: 10px 12px 8px;
    background: rgba(2, 5, 4, 0.92);
  }

  .brand {
    gap: 8px;
    min-width: 0;
    font-size: 1.04rem;
  }

  .brand-mark {
    width: 30px;
    height: 30px;
  }

  .date-line {
    display: none;
  }

  .header-actions {
    position: static;
    grid-column: 2;
    grid-row: 1;
    gap: 4px;
    margin-left: 0;
  }

  #shareButton {
    display: none;
  }

  .prayer-link {
    min-height: 32px;
    padding: 0 8px;
    border: 1px solid rgba(86, 226, 139, 0.28);
    border-radius: 999px;
    font-size: 0.68rem;
    line-height: 1;
  }

  .icon-button {
    width: 32px;
    height: 32px;
  }

  .icon-button svg {
    width: 18px;
    height: 18px;
  }

  .app-shell {
    display: block;
    width: 100%;
    padding: 10px 12px calc(104px + env(safe-area-inset-bottom));
  }

  .content-flow {
    width: 100%;
    padding: 0 !important;
  }

  .day-note {
    display: none !important;
  }

  .sections {
    display: block;
  }

  .daily-section,
  .daily-section.band {
    display: none;
    height: calc(100dvh - 188px);
    min-height: calc(100dvh - 188px);
    max-height: calc(100dvh - 188px);
    align-content: start;
    margin: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 18px 14px 20px;
    border: 1px solid rgba(86, 226, 139, 0.18);
    border-radius: 16px;
    background:
      linear-gradient(160deg, rgba(86, 226, 139, 0.075), rgba(86, 226, 139, 0.018) 42%, rgba(2, 5, 4, 0.2)),
      rgba(4, 15, 10, 0.82);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.26);
    scrollbar-width: thin;
  }

  .daily-section.is-current {
    display: grid;
  }

  .daily-section::before {
    display: none;
  }

  .daily-section::after {
    opacity: 0.5;
  }

  .daily-section.is-current .content-block {
    filter: none;
  }

  .content-block,
  .story-grid,
  .story-note {
    max-width: 100%;
    min-width: 0;
  }

  .story-grid {
    display: grid;
    gap: 16px;
  }

  .story-note {
    border-left: 0;
    border-top: 1px solid rgba(86, 226, 139, 0.24);
    padding: 14px 0 0;
  }

  .section-kicker {
    gap: 8px;
    margin-bottom: 10px;
    font-size: 0.66rem;
    letter-spacing: 0.1em;
  }

  .section-kicker::after {
    width: 28px;
  }

  .title-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
  }

  .section-title {
    font-size: clamp(1.45rem, 7.4vw, 2.08rem);
    line-height: 1.08;
  }

  .tag {
    min-height: 22px;
    padding: 3px 8px;
    font-size: 0.65rem;
  }

  .count-chip {
    margin-bottom: 12px;
    padding: 5px 9px;
    font-size: 0.74rem;
  }

  .arabic,
  .translit,
  .meaning,
  .quote-text,
  .body-text,
  .explain,
  .effect,
  .moral,
  .story-action {
    max-width: none;
    width: 100%;
  }

  .arabic {
    margin-bottom: 10px;
    font-size: clamp(1.48rem, 8.8vw, 2.35rem);
    line-height: 1.55;
    overflow-wrap: anywhere;
    text-align: right;
    word-break: normal;
  }

  .translit {
    margin-bottom: 10px;
    font-size: 0.92rem;
    line-height: 1.45;
  }

  .meaning,
  .quote-text {
    font-size: clamp(1.1rem, 5.6vw, 1.42rem);
    line-height: 1.32;
  }

  .body-text,
  .explain,
  .effect,
  .moral,
  .story-action {
    font-size: 0.88rem;
    line-height: 1.52;
  }

  .explain,
  .effect,
  .moral {
    margin-top: 12px;
  }

  .mini-label {
    margin-bottom: 6px;
    font-size: 0.66rem;
  }

  .revelation-card {
    grid-template-columns: 1fr;
    gap: 10px;
    max-width: none;
    margin-top: 12px;
    padding: 12px;
  }

  .revelation-card p {
    font-size: 0.8rem;
    line-height: 1.48;
  }

  .source-row {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    font-size: 0.76rem;
  }

  .dhikr-counter {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    margin-top: 14px;
  }

  .counter-tap,
  .counter-reset {
    width: auto;
  }

  .counter-tap {
    min-height: 68px;
    padding: 10px 12px;
  }

  .counter-number {
    font-size: 1.75rem;
  }

  .counter-label {
    font-size: 0.62rem;
  }

  .counter-reset {
    min-width: 74px;
    min-height: 68px;
    padding: 0 10px;
  }

  .next-cue {
    position: sticky;
    bottom: 0;
    z-index: 2;
    width: 100%;
    justify-content: center;
    margin-top: 14px;
    padding: 10px 12px;
    background: rgba(5, 20, 13, 0.96);
    box-shadow: 0 -10px 24px rgba(2, 5, 4, 0.34);
  }

  .reading-rail {
    position: fixed;
    top: auto;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    left: 10px;
    z-index: 35;
    width: auto;
    gap: 6px;
    margin: 0 !important;
    padding: 8px;
    border: 1px solid rgba(86, 226, 139, 0.2);
    border-radius: 18px;
    background: rgba(3, 13, 9, 0.96);
    box-shadow: 0 18px 52px rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(18px);
    contain: none;
  }

  .rail-line {
    display: none;
  }

  .rail-items {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
    overflow: visible;
    padding: 0;
  }

  .rail-button {
    width: 100%;
    height: 34px;
    border-radius: 999px;
    font-size: 0.72rem;
  }

  .rail-button:hover,
  .rail-button.active {
    box-shadow: 0 0 0 3px rgba(86, 226, 139, 0.08);
    transform: none;
  }

  .rail-button.active::after {
    display: none;
  }

  .rail-hint {
    order: -1;
    width: auto;
    min-height: 12px;
    justify-self: stretch;
    margin: 0 0 4px;
    font-size: 0.58rem;
    line-height: 1.25;
    text-align: center;
  }

  .site-footer {
    display: none;
  }

  .jump-menu {
    padding: 64px 10px 102px;
  }

  .jump-panel {
    width: 100%;
  }

  .saved-drawer {
    padding: 8px;
  }

  .saved-panel {
    width: 100%;
    max-height: calc(100svh - 16px);
    border-radius: 16px;
  }
}
