@font-face {
  font-family: "Lateef";
  src: url("vendor/fonts/lateef.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Scheherazade New";
  src: url("vendor/fonts/scheherazade-new.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Amiri Quran";
  src: url("vendor/fonts/amiri-quran.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "BalooWord";
  src: url("vendor/fonts/baloo2-word.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
:root {
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --ink: #0f2547;
  --muted: #8494ab;
  --ink2: #47617e;
  --bg: #f2f5fa;
  --card: #ffffff;
  --line: #dbe4f0;
  --gold: #dd9500;
  --soft: #eef4ff;
  --radius: 18px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--ink); min-height: 100vh;
}
::selection { background: #bfd4fb; }
button { font: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible {
  outline: 3px solid var(--gold); outline-offset: 2px;
}

/* header (fleet template) */
.app-header {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-icon { width: 44px; height: 44px; border-radius: 11px; }
.wordmark { font-family: "BalooWord", -apple-system, sans-serif; font-size: 26px; font-weight: 700; line-height: 1; color: var(--ink); letter-spacing: 0.2px; }
.wordmark-ku { color: var(--blue); }
.tagline { font-size: 9.5px; letter-spacing: 0.5px; color: var(--muted); margin-top: 3px; font-weight: 600; line-height: 1.28; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.lang-toggle { display: flex; background: #e8eef7; border-radius: 999px; padding: 2px; }
.lang-btn { border: 0; background: transparent; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--muted); min-height: 28px; }
.lang-btn.lang-active { background: var(--blue); color: #fff; box-shadow: 0 1px 3px rgba(15, 37, 71, 0.18); }
.version-badge { font-size: 12px; font-weight: 600; color: var(--blue); background: #e3ecfd; padding: 5px 10px; border-radius: 999px; }

.container { max-width: 560px; margin: 0 auto; padding: 18px 16px 28px; }
.group-label { font-size: 13px; font-weight: 700; letter-spacing: 0.4px; color: var(--muted); margin: 16px 2px 8px; text-transform: uppercase; }

/* cards & buttons (fleet template) */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 16px;
  box-shadow: 0 2px 8px rgba(15, 37, 71, 0.05), 0 10px 22px rgba(15, 37, 71, 0.05);
}
.btn { border: 0; border-radius: 14px; padding: 13px 18px; font-size: 15.5px; font-weight: 600; text-align: center; min-height: 48px; }
.btn-secondary { background: #e8eef7; color: var(--ink); }
.btn-small { padding: 8px 14px; font-size: 14px; min-height: 42px; border-radius: 11px; }
.btn-block { width: 100%; margin-top: 12px; }
.summary-box { background: var(--soft); border-radius: 14px; padding: 13px; font-weight: 700; color: var(--ink); text-align: center; }
.pn-main { display: block; font-size: 16.5px; font-weight: 800; }
.pn-sub { display: block; font-size: 13.5px; font-weight: 600; color: var(--muted); margin-top: 3px; }

/* mode segmented control */
.seg { display: flex; background: #e8eef7; border-radius: 999px; padding: 3px; gap: 2px; }
.seg-btn { flex: 1; border: 0; background: transparent; padding: 9px 6px; border-radius: 999px; font-size: 14px; font-weight: 700; color: var(--muted); min-height: 42px; }
.seg-btn.seg-active { background: var(--blue); color: #fff; box-shadow: 0 1px 3px rgba(15, 37, 71, 0.18); }

/* progress */
.progress-card { margin-top: 12px; }
.progress-track { height: 10px; background: #e8eef7; border-radius: 999px; overflow: hidden; margin-top: 12px; }
.progress-fill { height: 100%; width: 0%; background: var(--blue); border-radius: 999px; transition: width 0.35s ease; }
.progress-fill.full { background: #12a150; }

/* dzikir cards */
.dz-card { margin-top: 14px; }
.dz-head { display: flex; align-items: center; gap: 8px; }
.dz-num { font-size: 12.5px; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.dz-title { font-size: 15px; font-weight: 700; color: var(--ink); flex: 1; line-height: 1.3; }
.dz-badge { font-size: 12.5px; font-weight: 800; color: var(--blue-dark); background: #e3ecfd; padding: 4px 9px; border-radius: 999px; font-variant-numeric: tabular-nums; flex: none; }
.dz-card.done { border-color: #bfe6cf; }
.dz-card.done .dz-badge { background: #e2f3ea; color: #0a5c39; }
.dz-ar {
  font-family: "Lateef", "Scheherazade New", "Amiri Quran", serif;
  font-size: 33px; line-height: 2.05; text-align: start; text-align-last: start; text-justify: none; margin-top: 12px; color: var(--ink);
}
.dz-card.done .dz-ar { opacity: 0.55; }
.dz-latin { margin-top: 10px; font-size: 14.5px; line-height: 1.55; color: var(--ink2); font-style: italic; }
.dz-tr { margin-top: 8px; font-size: 14.5px; line-height: 1.55; color: var(--ink); }
.dz-note { margin-top: 10px; background: #fdf6dd; border-radius: 12px; padding: 10px 12px; font-size: 13.5px; line-height: 1.5; color: #6b5200; }
.dz-note b { font-weight: 800; }
.dz-ref { margin-top: 10px; font-size: 12.5px; font-weight: 600; color: var(--muted); line-height: 1.45; }
.counter-btn {
  width: 100%; margin-top: 14px; min-height: 58px; border: 0; border-radius: 14px;
  background: var(--blue); color: #fff; display: flex; align-items: center; justify-content: center; gap: 9px;
  transition: transform 0.08s ease, background 0.2s ease;
}
.counter-btn:active { transform: scale(0.98); background: var(--blue-dark); }
.cnt-num { font-size: 23px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.cnt-lab { font-size: 13px; font-weight: 600; opacity: 0.85; }
.counter-btn.done { background: #e2f3ea; color: #0a5c39; }
.counter-btn.done:active { background: #d3ecdd; }

/* footer (fleet template) */
.dev-footer { margin-top: 30px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.dev-by { position: relative; font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; padding: 13px 18px; }
.dev-credit { display: inline-flex; align-items: center; gap: 4px; color: var(--blue); font-weight: 700; text-decoration: none; }
.dev-credit svg { color: var(--blue); flex: none; }
.about-toggle { background: none; border: 0; padding: 6px 10px; font: inherit; font-size: 12.5px; font-weight: 600; letter-spacing: 0.02em; color: var(--muted); cursor: pointer; min-height: 36px; }
.beetle-walker { position: absolute; left: 4%; top: 88%; width: 15px; height: 15px; color: #2563eb; pointer-events: none; animation: beetle-walk 11s linear infinite; }
.beetle-walker svg { display: block; }
@keyframes beetle-walk {
  0% { left: 4%; top: 88%; transform: translate(-50%, -50%) rotate(-180deg); }
  7% { left: 4%; top: 88%; transform: translate(-50%, -50%) rotate(-270deg); }
  38% { left: 96%; top: 88%; transform: translate(-50%, -50%) rotate(-270deg); }
  47% { left: 96%; top: 12%; transform: translate(-50%, -50%) rotate(-360deg); }
  78% { left: 4%; top: 12%; transform: translate(-50%, -50%) rotate(-450deg); }
  87% { left: 4%; top: 88%; transform: translate(-50%, -50%) rotate(-540deg); }
  100% { left: 4%; top: 88%; transform: translate(-50%, -50%) rotate(-540deg); }
}
@media (prefers-reduced-motion: reduce) { .beetle-walker { animation: none; display: none; } }

/* about sheet (fleet template) */
.overlay {
  position: fixed; inset: 0; background: rgba(10, 35, 32, 0.5);
  display: flex; align-items: flex-end; justify-content: center; z-index: 50;
}
.sheet {
  background: var(--card); border-radius: 22px 22px 0 0; width: 100%; max-width: 560px;
  padding: 18px 18px 30px; max-height: 82vh; overflow: auto;
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.sheet-title { font-family: "BalooWord", -apple-system, sans-serif; font-size: 20px; font-weight: 700; }
.sheet-p { font-size: 14.5px; line-height: 1.55; color: var(--ink); margin-top: 10px; }
.cal-nav {
  width: 42px; height: 42px; border-radius: 50%; border: 1.5px solid var(--line);
  background: var(--card); color: var(--ink); font-size: 21px; font-weight: 700; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; flex: none;
}

/* reader (one card at a time) */
.pos-line { text-align: center; font-size: 13px; font-weight: 700; color: var(--muted); margin: 16px 0 0; letter-spacing: 0.3px; }
.reader-card { margin-top: 10px; }
.btn-primary { background: var(--blue); color: #fff; }
.counter-circle {
  width: 108px; height: 108px; border-radius: 50%; border: 0; margin: 18px auto 4px;
  background: var(--blue); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35), inset 0 -4px 0 rgba(0, 0, 0, 0.12);
  transition: transform 0.08s ease, background 0.15s ease;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.counter-circle:active { transform: scale(0.94); background: var(--blue-dark); }
.cc-num { font-size: 36px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.cc-lab { font-size: 11.5px; font-weight: 600; opacity: 0.85; }
.counter-done { text-align: center; margin: 18px auto 4px; font-size: 16px; font-weight: 800; color: #0a5c39; padding: 12px; }
.done-next { margin-top: 16px; }
.reader-nav { display: flex; gap: 10px; margin-top: 14px; }
.nav-btn { flex: 1; }
.nav-btn:disabled { opacity: 0.4; cursor: default; }
.sound-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 2px 2px; margin-top: 10px; border-top: 1px solid #e3eaf5; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.switch { width: 46px; height: 27px; border-radius: 999px; border: 0; background: #cbd5e1; position: relative; cursor: pointer; transition: background 0.2s; flex: none; padding: 0; }
.switch .knob { position: absolute; top: 3px; left: 3px; width: 21px; height: 21px; border-radius: 50%; background: #fff; transition: left 0.2s; box-shadow: 0 1px 3px rgba(15, 35, 75, 0.25); }
.switch.on { background: #2563eb; }
.switch.on .knob { left: 22px; }

/* progress card icon toggles + tajwid legend */
.prog-top { display: flex; gap: 10px; align-items: stretch; }
.prog-grow { flex: 1; }
.prog-icons { display: flex; flex-direction: column; gap: 8px; justify-content: center; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%; border: 1.5px solid var(--line);
  background: var(--card); color: var(--blue); display: inline-flex; align-items: center; justify-content: center; flex: none;
}
.icon-btn.off { color: #a3b3c7; }
.icon-btn.off svg { opacity: 0.6; }
.tw-switch-row { display: flex; align-items: center; justify-content: space-between; padding: 4px 0 2px; }
.tw-switch-label { font-size: 15px; font-weight: 700; }
.tw-switch { width: 52px; height: 30px; border-radius: 999px; border: none; background: #ccd6e4; position: relative; cursor: pointer; flex: none; padding: 0; }
.tw-switch .tw-knob { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: left .18s ease; box-shadow: 0 1px 3px rgba(16, 42, 120, .25); }
.tw-switch.on { background: var(--blue); }
.tw-switch.on .tw-knob { left: 25px; }
.tw-rows { margin-top: 6px; }
.tw-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid #edf1f7; }
.tw-dot { width: 12px; height: 12px; border-radius: 50%; margin-top: 3px; flex: none; }
.tw-name { font-size: 14px; font-weight: 700; }
.tw-desc { font-size: 13px; line-height: 1.45; color: var(--muted); }
