/* ============================================================
   Dal — styles.css
   Midnight navy · champagne gold · time-adaptive sky
   ============================================================ */

:root {
  --ink: #ede6d4;
  --ink-dim: rgba(237, 230, 212, 0.62);
  --ink-faint: rgba(237, 230, 212, 0.38);
  --gold: #c9a227;
  --gold-bright: #e8c96a;
  --gold-deep: #9a7b1e;
  --gold-glow: rgba(201, 162, 39, 0.32);
  --navy-deepest: #070d1c;
  --card: rgba(237, 230, 212, 0.045);
  --card-strong: rgba(237, 230, 212, 0.08);
  --line: rgba(201, 162, 39, 0.16);
  --line-soft: rgba(237, 230, 212, 0.09);
  --pass: #8fbf7f;
  --fail: #c96a5a;
  --font-display: 'Fraunces', Georgia, serif;
  --font-ui: 'Manrope', -apple-system, 'Segoe UI', sans-serif;
  --font-arabic: 'Amiri', 'Geeza Pro', 'Times New Roman', serif;
  --font-quran: 'Amiri Quran', 'Amiri', 'Geeza Pro', serif;
  --nav-h: 76px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { height: 100%; }

body {
  min-height: 100%;
  font-family: var(--font-ui);
  font-size: 15px;
  color: var(--ink);
  background: var(--navy-deepest);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

/* ---------- Time-adaptive sky (two crossfading layers) ---------- */
.sky {
  position: fixed;
  inset: 0;
  z-index: -3;
  opacity: 0;
  transition: opacity 24s ease;
  pointer-events: none;
}
.sky.lit { opacity: 1; }

/* Starfield — only visible in night phases */
#stars {
  position: fixed;
  inset: 0;
  z-index: -2;
  opacity: 0;
  transition: opacity 8s ease;
  pointer-events: none;
}
#stars.visible { opacity: 1; }
.star {
  position: absolute;
  border-radius: 50%;
  background: #ede6d4;
  animation: twinkle 4s ease-in-out infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: 0.15; }
  50% { opacity: 0.85; }
}

/* Girih — faint 8-fold star lattice over everything */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='168' height='168' viewBox='0 0 168 168'%3E%3Cg fill='none' stroke='%23c9a227' stroke-opacity='0.10' stroke-width='1'%3E%3Cpath d='M84 34 L98.9 69.1 L134 84 L98.9 98.9 L84 134 L69.1 98.9 L34 84 L69.1 69.1 Z'/%3E%3Cpath d='M84 48.6 L94.5 73.5 L119.4 84 L94.5 94.5 L84 119.4 L73.5 94.5 L48.6 84 L73.5 73.5 Z' transform='rotate(22.5 84 84)'/%3E%3Ccircle cx='84' cy='84' r='7' /%3E%3Cpath d='M0 84 L34 84 M134 84 L168 84 M84 0 L84 34 M84 134 L84 168'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 168px 168px;
  -webkit-mask-image: radial-gradient(130% 100% at 50% 0%, rgba(0,0,0,0.5), transparent 75%);
          mask-image: radial-gradient(130% 100% at 50% 0%, rgba(0,0,0,0.5), transparent 75%);
}

/* ---------- App shell ---------- */
#app {
  max-width: 480px;
  margin: 0 auto;
  padding: calc(14px + env(safe-area-inset-top)) 20px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom));
  min-height: 100vh;
}

.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 10px 2px 20px;
}
.wordmark {
  font-family: var(--font-display);
  font-weight: 420;
  font-size: 26px;
  letter-spacing: 0.06em;
}
.wordmark .ar {
  font-family: var(--font-arabic);
  color: var(--gold-bright);
  font-size: 22px;
  margin-inline-start: 8px;
}
.masthead .loc-chip {
  font-size: 12px;
  color: var(--ink-dim);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 5px 12px;
  background: var(--card);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-family: inherit;
}
.loc-chip .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--gold); }

/* ---------- Views & transitions ---------- */
.view { display: none; }
.view.active { display: block; animation: viewIn 0.42s cubic-bezier(0.22, 0.9, 0.3, 1) both; }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.view-title {
  font-family: var(--font-display);
  font-weight: 380;
  font-size: 30px;
  letter-spacing: 0.01em;
  margin: 4px 0 4px;
}
.view-sub { color: var(--ink-dim); font-size: 13.5px; margin-bottom: 22px; }

/* ---------- Ornamental divider ---------- */
.flourish {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 26px 0 18px;
  color: var(--gold);
}
.flourish::before, .flourish::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line) 40%, var(--line) 60%, transparent);
}
.flourish svg { opacity: 0.8; flex: none; }

/* ---------- Prayer view ---------- */
.date-block { text-align: center; margin: 4px 0 22px; }
.hijri {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 420;
  color: var(--gold-bright);
  letter-spacing: 0.02em;
}
.gregorian { font-size: 13px; color: var(--ink-dim); margin-top: 5px; letter-spacing: 0.04em; }

.ring-wrap { display: grid; place-items: center; position: relative; margin: 6px auto 10px; width: 252px; height: 252px; }
.ring-wrap svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: rgba(237, 230, 212, 0.08); stroke-width: 2.5; }
.ring-fill {
  fill: none;
  stroke: url(#ringGold);
  stroke-width: 2.5;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear;
  filter: drop-shadow(0 0 6px var(--gold-glow));
}
.ring-center { text-align: center; }
.ring-label { font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-dim); }
.ring-prayer { font-family: var(--font-display); font-size: 34px; font-weight: 400; margin: 6px 0 2px; }
.ring-count {
  font-size: 20px;
  color: var(--gold-bright);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.ring-count.tick { opacity: 0.25; transform: translateY(4px); }
.ring-at { font-size: 12.5px; color: var(--ink-faint); margin-top: 6px; }

.times { margin-top: 20px; display: flex; flex-direction: column; gap: 9px; }
.prayer-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 18px;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: var(--card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.prayer-row .p-name { font-weight: 600; font-size: 14.5px; letter-spacing: 0.03em; }
.prayer-row .p-ar { font-family: var(--font-arabic); color: var(--ink-faint); font-size: 15px; margin-inline-start: 8px; }
.prayer-row .p-time { margin-inline-start: auto; font-variant-numeric: tabular-nums; font-size: 15px; color: var(--ink-dim); }
.prayer-row.past { opacity: 0.5; }
.prayer-row.current {
  border-color: var(--line);
  background: linear-gradient(90deg, rgba(201, 162, 39, 0.12), rgba(201, 162, 39, 0.03) 65%);
  box-shadow: 0 0 24px rgba(201, 162, 39, 0.07), inset 0 0 0 1px rgba(201, 162, 39, 0.12);
}
.prayer-row.current .p-time { color: var(--gold-bright); font-weight: 600; }
.prayer-row .now-chip, .prayer-row .next-chip {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  font-weight: 700;
}
.prayer-row .now-chip { background: var(--gold); color: #1a1508; }
.prayer-row .next-chip { border: 1px solid var(--line); color: var(--gold-bright); }

/* ---------- Cards / generic ---------- */
.card {
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  background: var(--card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 20px;
}

.btn {
  font-family: var(--font-ui);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--gold-bright);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 11px 22px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}
.btn:active { transform: scale(0.97); background: rgba(201, 162, 39, 0.1); }
.btn-solid {
  background: linear-gradient(135deg, var(--gold-bright), var(--gold) 55%, var(--gold-deep));
  color: #1a1508;
  border: none;
  box-shadow: 0 4px 18px rgba(201, 162, 39, 0.25);
}
.btn-ghost { border-color: var(--line-soft); color: var(--ink-dim); }
.btn:disabled { opacity: 0.45; pointer-events: none; }

input, select, textarea {
  font-family: var(--font-ui);
  font-size: 15px;
  color: var(--ink);
  background: rgba(7, 13, 28, 0.55);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 11px 14px;
  width: 100%;
  outline: none;
  transition: border-color 0.2s ease;
}
input:focus, textarea:focus { border-color: var(--gold); }
label.field { display: block; margin-bottom: 14px; }
label.field span { display: block; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-dim); margin-bottom: 7px; }

/* ---------- Arabic ---------- */
.arabic { font-family: var(--font-arabic); direction: rtl; text-align: right; }

/* ---------- Quran ---------- */
.surah-search { margin-bottom: 16px; }
.surah-list { display: flex; flex-direction: column; gap: 8px; }
.surah-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: start;
  padding: 13px 16px;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: var(--card);
  color: var(--ink);
  font-family: var(--font-ui);
  cursor: pointer;
  transition: border-color 0.2s ease;
}
.surah-item:active { border-color: var(--line); }
.surah-num {
  width: 38px; height: 38px;
  flex: none;
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--gold-bright);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='M20 2 L24.6 10.2 L33 8.4 L31.2 16.8 L38 20 L31.2 23.2 L33 31.6 L24.6 29.8 L20 38 L15.4 29.8 L7 31.6 L8.8 23.2 L2 20 L8.8 16.8 L7 8.4 L15.4 10.2 Z' fill='none' stroke='%23c9a227' stroke-opacity='0.55' stroke-width='1.4'/%3E%3C/svg%3E") center/contain no-repeat;
}
.surah-item .s-en { font-weight: 600; font-size: 14.5px; }
.surah-item .s-meta { font-size: 11.5px; color: var(--ink-faint); margin-top: 3px; }
.surah-item .s-ar { margin-inline-start: auto; font-family: var(--font-arabic); font-size: 18px; color: var(--ink-dim); }
.surah-item .cached-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--gold); margin-inline-start: 8px; flex: none; }

/* Reader */
.reader-head { text-align: center; padding: 8px 0 4px; }
.reader-surah-ar { font-family: var(--font-quran); font-size: 34px; color: var(--gold-bright); }
.reader-surah-en { font-family: var(--font-display); font-size: 17px; margin-top: 6px; }
.reader-meta { font-size: 12px; color: var(--ink-faint); margin-top: 5px; letter-spacing: 0.06em; }
.bismillah {
  font-family: var(--font-quran);
  font-size: 26px;
  text-align: center;
  margin: 22px 0 8px;
  color: var(--ink);
  opacity: 0.92;
}
.ayah-card {
  padding: 22px 4px 18px;
  border-bottom: 1px solid var(--line-soft);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.22, 0.9, 0.3, 1);
}
.ayah-card.in { opacity: 1; transform: none; }
.ayah-ar {
  font-family: var(--font-quran);
  font-size: 27px;
  line-height: 2.15;
  direction: rtl;
  text-align: right;
}
.ayah-ar .marker {
  font-family: var(--font-arabic);
  color: var(--gold);
  font-size: 0.72em;
  padding: 0 4px;
}
.ayah-en { margin-top: 12px; font-size: 14px; line-height: 1.75; color: var(--ink-dim); }
.reader-note { text-align: center; color: var(--ink-faint); font-size: 12.5px; padding: 18px 12px; }
.loader { display: flex; justify-content: center; padding: 48px 0; }
.loader .crescent-spin {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--gold);
  border-inline-end-color: var(--gold);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 2px; }
.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch .track {
  position: absolute; inset: 0;
  border-radius: 999px;
  background: var(--card-strong);
  border: 1px solid var(--line-soft);
  transition: background 0.25s ease;
  pointer-events: none;
}
.switch .track::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--ink-dim);
  transition: transform 0.25s ease, background 0.25s ease;
}
.switch input:checked + .track { background: rgba(201, 162, 39, 0.35); border-color: var(--line); }
.switch input:checked + .track::after { transform: translateX(18px); background: var(--gold-bright); }

/* ---------- Qibla ---------- */
.compass-wrap { display: grid; place-items: center; margin: 18px auto 8px; width: 292px; height: 292px; position: relative; }
.compass-rose { width: 100%; height: 100%; }
.needle-group { transition: none; }
.qibla-readout { text-align: center; margin-top: 14px; }
.qibla-deg { font-family: var(--font-display); font-size: 34px; color: var(--gold-bright); font-variant-numeric: tabular-nums; }
.qibla-hint { color: var(--ink-dim); font-size: 13px; margin-top: 6px; line-height: 1.6; }
.qibla-aligned-note { color: var(--gold-bright); font-size: 13px; margin-top: 4px; min-height: 18px; font-weight: 600; letter-spacing: 0.06em; }
#enableCompass { margin: 18px auto 0; display: block; }

/* ---------- Athkar ---------- */
.pills { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 18px; scrollbar-width: none; }
.pills::-webkit-scrollbar { display: none; }
.pill {
  flex: none;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-dim);
  border: 1px solid var(--line-soft);
  background: var(--card);
  padding: 9px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.pill.active { color: #1a1508; background: linear-gradient(135deg, var(--gold-bright), var(--gold)); border-color: transparent; font-weight: 700; }

.dhikr-card { margin-bottom: 14px; overflow: hidden; }
.dhikr-ar { font-family: var(--font-arabic); font-size: 21px; line-height: 2; direction: rtl; text-align: right; }
.dhikr-translit { font-style: italic; color: var(--ink-dim); font-size: 12.5px; line-height: 1.7; margin-top: 12px; }
.dhikr-meaning { font-size: 13.5px; line-height: 1.7; color: var(--ink-dim); margin-top: 10px; }
.dhikr-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
.dhikr-source { font-size: 11px; color: var(--gold); letter-spacing: 0.04em; line-height: 1.5; flex: 1; }
.count-btn {
  flex: none;
  min-width: 76px;
  font-family: var(--font-ui);
  font-size: 13.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--gold-bright);
  background: rgba(201, 162, 39, 0.08);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 11px 18px;
  cursor: pointer;
  transition: transform 0.12s ease;
}
.count-btn:active { transform: scale(0.94); }
.count-btn.pulse { animation: pulse 0.35s ease; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 var(--gold-glow); }
  100% { box-shadow: 0 0 0 14px rgba(201, 162, 39, 0); }
}
.count-btn.done { background: linear-gradient(135deg, var(--gold-bright), var(--gold)); color: #1a1508; border-color: transparent; }
.dhikr-card.done-card { opacity: 0.55; }
.athkar-reset { margin: 6px auto 0; display: block; }
.del-dhikr { background: none; border: none; color: var(--fail); font-size: 12px; cursor: pointer; font-family: inherit; padding: 6px 0; }

.add-form .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- Tools hub ---------- */
.tool-cards { display: flex; flex-direction: column; gap: 12px; }
.tool-card {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  text-align: start;
  padding: 20px;
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  background: var(--card);
  color: var(--ink);
  font-family: var(--font-ui);
  cursor: pointer;
  transition: border-color 0.2s ease;
}
.tool-card:active { border-color: var(--line); }
.tool-card .t-icon {
  width: 46px; height: 46px;
  flex: none;
  display: grid; place-items: center;
  border-radius: 14px;
  background: rgba(201, 162, 39, 0.09);
  border: 1px solid var(--line);
  color: var(--gold-bright);
}
.tool-card .t-name { font-family: var(--font-display); font-size: 18px; font-weight: 450; }
.tool-card .t-desc { font-size: 12.5px; color: var(--ink-dim); margin-top: 4px; line-height: 1.5; }
.tool-card .chev { margin-inline-start: auto; color: var(--ink-faint); flex: none; }

/* ---------- Sheets (overlay pages) ---------- */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 40;
  background:
    radial-gradient(120% 60% at 50% -5%, rgba(201, 162, 39, 0.06), transparent 60%),
    linear-gradient(180deg, #0a1122 0%, var(--navy-deepest) 100%);
  transform: translateY(100%);
  transition: transform 0.44s cubic-bezier(0.32, 0.72, 0.2, 1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  visibility: hidden;
}
.sheet.open { transform: translateY(0); visibility: visible; }
.sheet-inner { max-width: 480px; margin: 0 auto; padding: calc(12px + env(safe-area-inset-top)) 20px calc(40px + env(safe-area-inset-bottom)); }
.sheet-bar { display: flex; align-items: center; gap: 12px; padding: 8px 0 18px; position: sticky; top: 0; z-index: 5; }
.back-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(10, 17, 34, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line-soft);
  color: var(--ink-dim);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  border-radius: 999px;
  padding: 9px 16px;
  cursor: pointer;
}
.sheet-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 450;
  background: rgba(10, 17, 34, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 8px 18px;
}

/* ---------- Tasbih ---------- */
.tasbih-stage { display: grid; place-items: center; padding: 20px 0 8px; }
.tasbih-btn {
  position: relative;
  width: 272px; height: 272px;
  border-radius: 50%;
  border: none;
  background: radial-gradient(circle at 38% 30%, rgba(201, 162, 39, 0.16), rgba(201, 162, 39, 0.03) 55%), var(--card);
  box-shadow: inset 0 0 0 1px var(--line), 0 18px 50px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  display: grid;
  place-items: center;
  color: var(--ink);
  transition: transform 0.1s ease;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}
.tasbih-btn:active { transform: scale(0.975); }
.tasbih-btn.beat { animation: beat 0.32s ease; }
@keyframes beat {
  0% { box-shadow: inset 0 0 0 1px var(--line), 0 0 0 0 var(--gold-glow); }
  100% { box-shadow: inset 0 0 0 1px var(--line), 0 0 0 26px rgba(201, 162, 39, 0); }
}
.tasbih-btn svg.tasbih-ring { position: absolute; inset: -10px; width: calc(100% + 20px); height: calc(100% + 20px); transform: rotate(-90deg); pointer-events: none; }
.tasbih-count { font-family: var(--font-display); font-size: 76px; font-weight: 320; font-variant-numeric: tabular-nums; line-height: 1; }
.tasbih-sub { font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-dim); margin-top: 10px; }
.tasbih-cycles { color: var(--gold-bright); font-size: 13px; margin-top: 6px; min-height: 18px; }
.tasbih-controls { display: flex; justify-content: center; gap: 10px; margin-top: 26px; }
.tasbih-complete { animation: completeGlow 1s ease; }
@keyframes completeGlow {
  0%, 100% { filter: none; }
  35% { filter: drop-shadow(0 0 34px var(--gold-glow)) brightness(1.25); }
}

/* ---------- Screener ---------- */
.screen-result { margin-top: 18px; }
.verdict-banner {
  text-align: center;
  padding: 22px;
  border-radius: 20px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
}
.verdict-banner .v-word { font-family: var(--font-display); font-size: 27px; font-weight: 450; }
.verdict-banner .v-note { font-size: 12.5px; margin-top: 7px; color: var(--ink-dim); line-height: 1.6; }
.verdict-compliant { background: linear-gradient(135deg, rgba(143, 191, 127, 0.12), rgba(201, 162, 39, 0.08)); }
.verdict-compliant .v-word { color: var(--pass); }
.verdict-non { background: rgba(201, 106, 90, 0.1); }
.verdict-non .v-word { color: var(--fail); }
.verdict-questionable .v-word { color: var(--gold-bright); }
.screen-line {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 2px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13.5px;
}
.screen-line:last-child { border-bottom: none; }
.screen-line .s-label { font-weight: 600; }
.screen-line .s-work { color: var(--ink-dim); font-size: 12.5px; margin-top: 5px; line-height: 1.65; font-variant-numeric: tabular-nums; }
.badge { margin-inline-start: auto; flex: none; font-size: 10.5px; font-weight: 800; letter-spacing: 0.12em; padding: 5px 11px; border-radius: 999px; }
.badge-pass { color: var(--pass); border: 1px solid rgba(143, 191, 127, 0.4); background: rgba(143, 191, 127, 0.08); }
.badge-fail { color: var(--fail); border: 1px solid rgba(201, 106, 90, 0.4); background: rgba(201, 106, 90, 0.08); }
.badge-na { color: var(--ink-faint); border: 1px solid var(--line-soft); }
.check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
.check-item {
  display: flex; align-items: center; gap: 9px;
  font-size: 12.5px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--card);
  cursor: pointer;
}
.check-item input { width: auto; accent-color: var(--gold); margin: 0; flex: none; }

/* ---------- Settings ---------- */
.settings-group { margin-bottom: 26px; }
.settings-group h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--gold-bright);
  margin-bottom: 12px;
}
.offset-row { display: flex; align-items: center; justify-content: space-between; padding: 9px 2px; }
.offset-row .o-name { font-size: 14px; font-weight: 600; }
.stepper { display: flex; align-items: center; gap: 2px; }
.stepper button {
  width: 34px; height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: var(--card);
  color: var(--gold-bright);
  font-size: 17px;
  cursor: pointer;
  font-family: inherit;
}
.stepper .o-val { min-width: 58px; text-align: center; font-variant-numeric: tabular-nums; font-size: 14px; color: var(--ink-dim); }
.settings-note { font-size: 12px; color: var(--ink-faint); line-height: 1.65; margin-top: 10px; }

/* ---------- Bottom navigation ---------- */
nav#tabbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 30;
  display: flex;
  justify-content: center;
  padding: 0 14px calc(10px + env(safe-area-inset-bottom));
  pointer-events: none;
}
.tab-pill {
  pointer-events: auto;
  display: flex;
  width: 100%;
  max-width: 440px;
  background: rgba(9, 15, 30, 0.72);
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  border: 1px solid var(--line-soft);
  border-radius: 24px;
  padding: 8px 6px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}
.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--ink-faint);
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 7px 0 5px;
  cursor: pointer;
  border-radius: 16px;
  transition: color 0.25s ease;
}
.tab svg { transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1); }
.tab.active { color: var(--gold-bright); }
.tab.active svg { transform: translateY(-2px); }
.tab .tab-dot { width: 4px; height: 4px; border-radius: 50%; background: transparent; transition: background 0.25s ease; }
.tab.active .tab-dot { background: var(--gold); }

/* ---------- Toast ---------- */
#toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + 24px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(16px);
  background: rgba(9, 15, 30, 0.92);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 13px;
  padding: 12px 20px;
  border-radius: 14px;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  z-index: 60;
  max-width: 86vw;
  text-align: center;
  line-height: 1.5;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.2s !important; }
  .sky { transition-duration: 0.8s !important; }
  .view.active { animation: none; }
  .ayah-card { opacity: 1; transform: none; transition: none; }
  .star { animation: none; opacity: 0.4; }
}

/* ---------- Recitation player ---------- */
#sheet-player {
  background:
    radial-gradient(120% 55% at 50% -5%, rgba(38, 66, 129, 0.28), transparent 60%),
    linear-gradient(180deg, #030711 0%, #050b1c 55%, #04070f 100%);
}
#sheet-player .sheet-inner { display: flex; flex-direction: column; min-height: 100vh; }
.player-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  padding: 12px 4px 20px;
}
.player-surah { font-family: var(--font-quran); font-size: 25px; color: var(--ink-dim); }
.player-ayah-ar {
  font-family: var(--font-quran);
  font-size: 31px;
  line-height: 2.15;
  direction: rtl;
  color: var(--ink);
  margin: 26px 0 6px;
  transition: color 0.6s ease, opacity 0.35s ease, transform 0.35s ease;
  max-height: 46vh;
  overflow-y: auto;
}
.player-ayah-ar.playing {
  color: var(--gold-bright);
  text-shadow: 0 0 34px rgba(201, 162, 39, 0.25);
}
.player-ayah-en {
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--ink-dim);
  margin-top: 14px;
  transition: opacity 0.35s ease, transform 0.35s ease;
  max-height: 22vh;
  overflow-y: auto;
}
.player-swap .player-ayah-ar, .player-swap .player-ayah-en { opacity: 0; transform: translateY(10px); }
.player-pos { margin-top: 20px; font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-faint); }
.player-note { font-size: 12px; color: var(--ink-faint); margin-top: 8px; min-height: 16px; line-height: 1.6; }

.player-progress { height: 3px; border-radius: 99px; background: rgba(237, 230, 212, 0.09); overflow: hidden; margin: 18px 2px 4px; }
.player-progress .fill { height: 100%; width: 0%; border-radius: 99px; background: linear-gradient(90deg, var(--gold), var(--gold-bright)); transition: width 0.4s linear; }

.player-controls { display: flex; align-items: center; justify-content: center; gap: 22px; padding: 14px 0 6px; }
.pc-btn {
  width: 54px; height: 54px;
  border-radius: 50%;
  border: 1px solid var(--line-soft);
  background: var(--card);
  color: var(--ink);
  display: grid; place-items: center;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.2s ease;
}
.pc-btn:active { transform: scale(0.93); }
.pc-btn.primary {
  width: 72px; height: 72px;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold) 55%, var(--gold-deep));
  color: #1a1508;
  border: none;
  box-shadow: 0 8px 30px rgba(201, 162, 39, 0.3);
}
.player-reciter { margin: 10px 0 4px; }
.player-reciter select {
  background: rgba(9, 15, 30, 0.75);
  font-size: 13.5px;
  text-align: center;
}
.listen-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(201, 162, 39, 0.1);
  border: 1px solid var(--line);
  color: var(--gold-bright);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  border-radius: 999px;
  padding: 9px 16px;
  cursor: pointer;
}

/* ---------- Office wird ---------- */
.office-dots { display: flex; justify-content: center; gap: 8px; margin: 4px 0 18px; }
.office-dots .dot-step {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(237, 230, 212, 0.14);
  transition: background 0.3s ease, transform 0.3s ease;
}
.office-dots .dot-step.done { background: var(--gold-deep); }
.office-dots .dot-step.now { background: var(--gold-bright); transform: scale(1.35); box-shadow: 0 0 10px var(--gold-glow); }

.office-title {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 480;
  text-align: center;
  color: var(--gold-bright);
  margin-bottom: 12px;
}
.office-text {
  font-family: var(--font-arabic);
  font-size: 22px;
  line-height: 2.05;
  direction: rtl;
  text-align: center;
  max-height: 34vh;
  overflow-y: auto;
  padding: 2px 6px;
}
.office-tap-wrap { display: grid; place-items: center; padding: 22px 0 4px; }
.office-btn {
  position: relative;
  width: 190px; height: 190px;
  border-radius: 50%;
  border: none;
  background: radial-gradient(circle at 38% 30%, rgba(201, 162, 39, 0.16), rgba(201, 162, 39, 0.03) 55%), var(--card);
  box-shadow: inset 0 0 0 1px var(--line), 0 14px 40px rgba(0, 0, 0, 0.38);
  cursor: pointer;
  display: grid; place-items: center;
  color: var(--ink);
  transition: transform 0.1s ease;
  touch-action: manipulation;
  -webkit-user-select: none; user-select: none;
}
.office-btn:active { transform: scale(0.97); }
.office-btn.beat { animation: beat 0.32s ease; }
.office-btn svg.office-ring { position: absolute; inset: -9px; width: calc(100% + 18px); height: calc(100% + 18px); transform: rotate(-90deg); pointer-events: none; }
.office-count { font-family: var(--font-display); font-size: 52px; font-weight: 340; font-variant-numeric: tabular-nums; line-height: 1; }
.office-of { font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-dim); margin-top: 8px; display: block; }
.office-step-label { text-align: center; font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-faint); margin-top: 14px; }
.office-done-card { text-align: center; padding: 44px 20px; }
.office-done-card .big { font-family: var(--font-display); font-size: 26px; color: var(--gold-bright); margin-bottom: 10px; }

/* ---------- Reader: ayah jump & per-ayah actions ---------- */
.ayah-jump { display: flex; gap: 8px; max-width: 300px; margin: 18px auto 0; }
.ayah-jump input { text-align: center; font-size: 14px; padding: 10px 12px; }
.ayah-jump input::-webkit-outer-spin-button, .ayah-jump input::-webkit-inner-spin-button { -webkit-appearance: none; }
.ayah-jump .btn { flex: none; padding: 10px 18px; }

.ayah-card { cursor: pointer; }
.ayah-card.selected {
  background: linear-gradient(90deg, rgba(201, 162, 39, 0.07), transparent 70%);
  border-radius: 14px;
  border-bottom-color: var(--line);
  padding-left: 12px;
  padding-right: 12px;
}
.ayah-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.ayah-actions .btn { font-size: 12.5px; padding: 10px 18px; }

.ayah-card.flash { animation: ayahFlash 1.6s ease; }
@keyframes ayahFlash {
  0% { background: rgba(201, 162, 39, 0.16); border-radius: 14px; }
  100% { background: transparent; }
}
@media (prefers-reduced-motion: reduce) {
  .ayah-card.flash { animation: none; background: rgba(201, 162, 39, 0.08); border-radius: 14px; }
}

/* ---------- Player: playback speed ---------- */
.player-speed { display: flex; justify-content: center; gap: 8px; padding: 12px 0 4px; }
.speed-pill {
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink-dim);
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 8px 18px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.speed-pill.active {
  color: #1a1508;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  border-color: transparent;
}
