/* ═══════════════════════════════════════════════════════════════
   Lissan ul Gaib — Light Garden theme (soft green, warm white, saffron).
   The light palette block below overrides the original Royal 3D colours;
   the 3D push geometry and layout are kept.
   Offline by design: the Urdu fonts live in vendor/fonts/, nothing is fetched.
   ═══════════════════════════════════════════════════════════════ */

@font-face {
  font-family: "Noto Nastaliq Urdu";
  src: url("vendor/fonts/NotoNastaliqUrdu-var.ttf") format("truetype-variations"),
       url("vendor/fonts/NotoNastaliqUrdu-var.ttf") format("truetype");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Amiri";
  src: url("vendor/fonts/Amiri-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Amiri";
  src: url("vendor/fonts/Amiri-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --gold-1: #ffe885;
  --gold-2: #f5b935;
  --gold-3: #b7791f;
  --cyan-glow: #00f5d4;
  --cyan: #67e8f9;
  --cyan-deep: #06b6d4;
  --pink-glow: #ff4d8d;
  --purple-deep: #1e1136;
  --emerald-bright: #10b981;
  --rose: #e11d48;

  --bg-deep: #0b071e;
  --panel-hi: rgba(26, 35, 71, 0.92);
  --panel-lo: rgba(15, 23, 42, 0.96);
  --inset: rgba(9, 13, 26, 0.9);
  --text: #f8fafc;
  --muted: #cbd5e1;
  --border: rgba(245, 185, 53, 0.45);

  --err-bg: rgba(225, 29, 72, 0.22);
  --err-fg: #ffe4e6;
  --warn-bg: rgba(146, 94, 6, 0.32);
  --warn-fg: #ffeec2;
  --ok-bg: rgba(16, 96, 60, 0.32);
  --ok-fg: #d6f5e4;
  --info-bg: rgba(30, 41, 59, 0.6);

  --nastaliq: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", "Urdu Typesetting", NafeesNastaleeq, serif;
  --naskh: "Amiri", "Traditional Arabic", "Segoe UI", serif;
  --sans: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--text);
  font-family: var(--nastaliq);
  line-height: 2.15;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 15% 15%, rgba(139, 92, 246, 0.35) 0%, transparent 45%),
    radial-gradient(circle at 85% 20%, rgba(6, 182, 212, 0.32) 0%, transparent 45%),
    radial-gradient(circle at 50% 85%, rgba(245, 158, 11, 0.25) 0%, transparent 50%),
    linear-gradient(135deg, #0b071e 0%, #111c38 50%, #072227 100%);
  background-attachment: fixed;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 26px 26px;
  pointer-events: none;
  z-index: 0;
}

.app { position: relative; z-index: 1; max-width: 1140px; margin: 0 auto; padding: 22px 16px 70px; }

.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.hidden { display: none !important; }
[hidden] { display: none !important; }
.mono { font-family: var(--sans); direction: ltr; display: inline-block; }
.muted { color: var(--muted); }

.skip {
  position: absolute; inset-inline-start: 0; top: -100px;
  background: var(--gold-2); color: #1a0f02; padding: 8px 16px; border-radius: 0 0 10px 10px;
  font-family: var(--sans); z-index: 20; transition: top .15s;
}
.skip:focus { top: 0; }

/* ─────────────── royal banner ─────────────── */
.hero {
  text-align: center;
  border: 2px solid var(--gold-2);
  border-bottom: 7px solid #8c580c;
  border-radius: 28px;
  background: linear-gradient(135deg, #2b1055 0%, #14365d 52%, #0d4b47 100%);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.65),
    0 0 35px rgba(245, 185, 53, 0.25),
    inset 0 2px 3px rgba(255, 255, 255, 0.35);
  padding: 26px 22px 20px;
  margin-bottom: 24px;
}
.bismillah {
  font-family: var(--naskh);
  font-size: 1.85rem;
  color: var(--gold-1);
  line-height: 2;
  text-shadow: 0 3px 0 #6b4205, 0 6px 18px rgba(255, 232, 133, 0.65);
}
.title {
  font-size: 2.65rem;
  font-weight: 700;
  margin: 4px 0 8px;
  line-height: 1.9;
  color: #fff;
  text-shadow:
    0 2px 0 #b7791f,
    0 4px 0 #784907,
    0 8px 24px rgba(0, 245, 212, 0.5);
}
.title .edition { color: var(--gold-1); font-size: .62em; text-shadow: 0 2px 0 #6b4205, 0 5px 16px rgba(255, 232, 133, .5); }
.subtitle {
  margin: 0;
  color: #a5f3fc;
  font-size: 1.05rem;
  background: rgba(0, 0, 0, 0.3);
  display: inline-block;
  padding: 4px 20px;
  border-radius: 999px;
  border: 1px solid rgba(0, 245, 212, 0.4);
}
.sheikh { color: #cbd5e1; font-size: .9rem; }
.privacy {
  display: inline-block; margin: 12px 0 0; padding: 4px 16px; border-radius: 99px;
  background: rgba(16, 185, 129, 0.16); border: 1px solid rgba(16, 185, 129, 0.55);
  color: #a7f3d0; font-size: .92rem;
}

/* ─────────────── 3D buttons ─────────────── */
.btn {
  appearance: none;
  font-family: var(--nastaliq); font-size: 1rem; line-height: 1.9;
  border-radius: 16px; padding: 6px 24px; cursor: pointer;
  color: #1a0f02;
  border: 1px solid #fff6c2;
  border-bottom: 6px solid #7c4a03;
  background: linear-gradient(180deg, #ffe885 0%, #f5b935 55%, #d98a12 100%);
  box-shadow: 0 8px 20px rgba(245, 185, 53, 0.4), inset 0 2px 1px rgba(255, 255, 255, 0.7);
  transition: transform .12s, border-bottom-width .12s, box-shadow .12s, filter .12s;
}
.btn.gold:hover:not(:disabled), .btn:not(.outline):not(.hl):hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(245, 185, 53, 0.55);
}
.btn:active:not(:disabled) { transform: translateY(4px); border-bottom-width: 2px; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4); }
.btn.outline {
  background: linear-gradient(180deg, #334155 0%, #1e293b 100%);
  color: #e0f2fe;
  border: 1px solid #94a3b8;
  border-bottom: 5px solid #0f172a;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
}
.btn.outline:hover:not(:disabled) { filter: brightness(1.18); transform: translateY(-2px); }
.btn.hl {
  background: linear-gradient(180deg, #67e8f9 0%, #06b6d4 60%, #0e7490 100%);
  color: #041f26;
  border: 1px solid #cffafe;
  border-bottom: 5px solid #164e63;
  box-shadow: 0 6px 18px rgba(6, 182, 212, 0.4);
}
.btn.hl:hover:not(:disabled) { filter: brightness(1.06); transform: translateY(-2px); }
.btn.tiny { font-size: .84rem; padding: 2px 12px; border-radius: 12px; border-bottom-width: 4px; }
.btn.big { font-size: 1.2rem; padding: 10px 36px; }
.btn.block { display: block; width: 100%; margin-top: 12px; font-size: 1.08rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; transform: none; filter: grayscale(.35); }
.btn:focus-visible, .tab:focus-visible, .dir:focus-visible, .qitem:focus-visible, .nbtn:focus-visible,
input:focus-visible, select:focus-visible, summary:focus-visible, canvas:focus-visible {
  outline: 3px solid #ffe885; outline-offset: 2px;
}

/* ─────────────── loader bar ─────────────── */
.loadbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px;
  background: linear-gradient(135deg, #1f294f 0%, #2e1747 100%);
  border: 2px solid var(--gold-2);
  border-bottom: 6px solid #925b09;
  border-radius: 22px; padding: 14px 20px; margin-bottom: 24px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
}
.loadstat { display: flex; align-items: center; gap: 12px; font-size: 1rem; color: #fef08a; line-height: 1.9; }
.dot {
  width: 18px; height: 18px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 30% 30%, #ff99ac, #e11d48);
  box-shadow: 0 0 16px #f43f5e;
}
.dot.loaded { background: radial-gradient(circle at 30% 30%, #a7f3d0, #059669); box-shadow: 0 0 18px #10b981; }
.loadbtns { display: flex; flex-wrap: wrap; gap: 10px; }
.loadbtns .apk-link { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }

/* ─────────────── notes ─────────────── */
.notes { margin: 10px 0; }
.note {
  padding: 10px 16px; border-radius: 14px; margin: 6px 0; font-size: .94rem; line-height: 2;
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.note-ok { background: var(--ok-bg); color: var(--ok-fg); border-color: rgba(16, 185, 129, 0.55); }
.note-warn { background: var(--warn-bg); color: var(--warn-fg); border-color: rgba(245, 158, 11, 0.6); }
.note-error { background: var(--err-bg); color: var(--err-fg); border-color: var(--rose); }
.note-info { background: var(--info-bg); color: var(--muted); border-color: rgba(56, 189, 248, 0.4); }
.note b { color: #fff; }
.note .ltr { font-family: var(--sans); direction: ltr; display: inline-block; unicode-bidi: embed; }
.spinner {
  display: inline-block; width: 12px; height: 12px; margin-inline-end: 8px; border-radius: 50%;
  border: 2px solid rgba(246, 226, 156, 0.35); border-top-color: var(--gold-1);
  animation: spin .8s linear infinite; vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─────────────── 3D step tabs ─────────────── */
.stepper { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 26px; perspective: 900px; }
.tab {
  appearance: none;
  position: relative; text-align: center; cursor: pointer; color: #fff;
  border-radius: 20px; padding: 12px 10px;
  font-family: var(--nastaliq); line-height: 1.8;
  border: 2px solid rgba(255, 255, 255, 0.22);
  transition: transform .18s cubic-bezier(.34, 1.56, .64, 1), filter .18s, border-color .18s, box-shadow .18s;
}
#tab1 { background: linear-gradient(180deg, #8b5cf6 0%, #5b21b6 100%); border-bottom: 7px solid #3b0764; box-shadow: 0 10px 20px rgba(139, 92, 246, 0.35); }
#tab2 { background: linear-gradient(180deg, #0ea5e9 0%, #0369a1 100%); border-bottom: 7px solid #082f49; box-shadow: 0 10px 20px rgba(14, 165, 233, 0.35); }
#tab3 { background: linear-gradient(180deg, #ec4899 0%, #be185d 100%); border-bottom: 7px solid #500724; box-shadow: 0 10px 20px rgba(236, 72, 153, 0.35); }
#tab4 { background: linear-gradient(180deg, #10b981 0%, #047857 100%); border-bottom: 7px solid #022c22; box-shadow: 0 10px 20px rgba(16, 185, 129, 0.35); }
.tab .num {
  display: inline-block; font-family: var(--sans); font-size: .72rem; font-weight: 800;
  letter-spacing: .04em; background: rgba(0, 0, 0, 0.35); color: var(--gold-1);
  border-radius: 99px; padding: 0 12px; margin-bottom: 3px; line-height: 1.9;
}
.tab .lbl { display: block; font-size: 1.02rem; font-weight: 700; text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5); }
.tab:hover:not(:disabled):not(.active) { transform: translateY(-4px) scale(1.02); filter: brightness(1.1); }
.tab.active {
  border-color: var(--gold-1);
  border-bottom-width: 3px;
  transform: translateY(3px);
  box-shadow: 0 0 28px rgba(255, 232, 133, 0.75), inset 0 0 15px rgba(255, 255, 255, 0.35);
}
.tab.done { border-color: var(--emerald-bright); }
.tab.done .num { color: #d1fae5; }
.tab:disabled, .tab.locked { cursor: not-allowed; opacity: .45; filter: grayscale(.35); transform: none; }

/* ─────────────── 3D stage panels ─────────────── */
.card {
  background: linear-gradient(160deg, var(--panel-hi) 0%, var(--panel-lo) 100%);
  border: 2px solid var(--border);
  border-bottom: 8px solid #090d1a;
  border-radius: 26px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.65), inset 0 1px 2px rgba(255, 255, 255, 0.2);
}
.card-head {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px;
  border-bottom: 2px solid rgba(245, 185, 53, 0.25); padding-bottom: 14px; margin-bottom: 20px;
}
.card-title {
  font-size: 1.55rem; margin: 0; font-weight: 700; color: var(--gold-1);
  text-shadow: 0 2px 10px rgba(245, 185, 53, 0.4);
}
.subcard {
  background: #090d1a; border: 2px solid rgba(245, 185, 53, 0.3);
  border-bottom: 6px solid #05070f; border-radius: 20px; padding: 16px; margin-top: 20px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45);
}
.subhead { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.subhead h3 { margin: 0; font-size: 1.1rem; color: var(--gold-1); }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.toolgroup { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.zoomval { font-family: var(--sans); font-size: .82rem; font-weight: 700; color: var(--cyan); min-width: 48px; text-align: center; }
.picked-badge { color: var(--gold-1); font-size: .98rem; }

/* ─────────────── protocol cards ─────────────── */
.proto { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.proto-step {
  position: relative; border-radius: 22px; padding: 20px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-bottom: 7px solid rgba(0, 0, 0, 0.5);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45);
  transition: all .25s;
}
.proto-step:nth-child(1) { background: linear-gradient(145deg, #3b1d6e 0%, #1f1147 100%); border-color: #a78bfa; border-bottom-color: #2e1065; }
.proto-step:nth-child(2) { background: linear-gradient(145deg, #0f4c5c 0%, #082933 100%); border-color: #38bdf8; border-bottom-color: #083344; }
.proto-step:nth-child(3) { background: linear-gradient(145deg, #5b1947 0%, #2d0b25 100%); border-color: #f472b6; border-bottom-color: #4a044e; }
.proto-step p { margin: 10px 0 14px; font-size: .98rem; }
.proto-step.done { border-color: #34d399; box-shadow: 0 0 28px rgba(16, 185, 129, 0.45); }
.badge {
  display: inline-block; background: rgba(0, 0, 0, 0.45); color: var(--gold-1);
  border: 1px solid var(--gold-1); border-radius: 99px; padding: 2px 16px; font-size: .9rem;
}
.dua {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.55), rgba(245, 185, 53, 0.15));
  border: 2px solid var(--gold-2); border-radius: 16px; padding: 16px; text-align: center; margin: 14px 0;
  box-shadow: inset 0 0 20px rgba(245, 185, 53, 0.2);
}
.dua-ar { font-family: var(--naskh); font-size: 1.7rem; color: #fff6b3; line-height: 1.85; }
.dua-tr { font-family: var(--sans); font-size: .88rem; color: var(--cyan); line-height: 1.6; }
.compass { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 12px 0 0; }
.dir {
  appearance: none;
  background: linear-gradient(180deg, #334155 0%, #1e293b 100%);
  border: 1px solid #94a3b8; border-bottom: 5px solid #0f172a;
  color: #fff; font-family: var(--nastaliq); font-size: .95rem; line-height: 1.9;
  padding: 8px 10px; border-radius: 12px; cursor: pointer; transition: all .12s;
}
.dir:hover { filter: brightness(1.15); }
.dir.blown, .dir[aria-pressed="true"] {
  background: linear-gradient(180deg, #10b981 0%, #059669 100%);
  border-color: #a7f3d0; border-bottom-color: #064e3b; color: #022c22; font-weight: 700;
  transform: translateY(2px); border-bottom-width: 3px;
}
.proto-foot { text-align: center; margin-top: 22px; padding-top: 16px; border-top: 2px solid rgba(255, 255, 255, 0.12); }
.ready { color: var(--cyan); font-size: 1.08rem; margin: 0 0 12px; }

/* ─────────────── questions ─────────────── */
.search {
  width: 100%;
  background: #0b132b; border: 2px solid #38bdf8; border-bottom: 5px solid #0369a1;
  border-radius: 16px; padding: 12px 20px; color: #fff;
  font-family: var(--nastaliq); font-size: 1.08rem; line-height: 2;
  margin-bottom: 20px; outline: none;
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.6);
}
.search:focus { border-color: var(--gold-1); box-shadow: inset 0 3px 8px rgba(0, 0, 0, .6), 0 0 18px rgba(255, 232, 133, .35); }
.qgrid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 14px; max-height: 490px; overflow-y: auto; padding: 6px;
}
.qitem {
  display: flex; align-items: center; gap: 14px; text-align: start;
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid rgba(56, 189, 248, 0.4); border-bottom: 6px solid #020617;
  border-radius: 16px; padding: 12px 16px; cursor: pointer; color: var(--text);
  font-family: var(--nastaliq); font-size: 1.02rem; line-height: 1.95;
  transition: all .14s ease;
}
.qitem:hover { transform: translateY(-3px); border-color: var(--gold-1); background: linear-gradient(180deg, #1e3a8a 0%, #172554 100%); }
.qitem.selected {
  background: linear-gradient(135deg, #b45309 0%, #78350f 100%);
  border: 2px solid var(--gold-1); border-bottom: 4px solid #451a03;
  transform: translateY(2px); box-shadow: 0 0 24px rgba(245, 185, 53, 0.55);
}
.qitem.is-blank { opacity: .6; font-style: italic; }
.qn {
  flex: none; min-width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(180deg, #f5b935 0%, #b45309 100%);
  border-bottom: 3px solid #451a03; color: #0f172a;
  font-family: var(--sans); font-weight: 800; font-size: 1.02rem;
  display: flex; align-items: center; justify-content: center; line-height: 1;
}
.emptymsg { color: var(--cyan); }

/* ─────────────── number tiles ─────────────── */
.banner {
  background: linear-gradient(90deg, #3b0764, #1e3a8a);
  border: 2px solid var(--gold-1); border-radius: 16px;
  padding: 10px 20px; margin-bottom: 14px; font-size: 1.12rem; color: var(--gold-1);
}
.rule { color: var(--muted); font-size: .94rem; margin: 0 0 12px; }
.numpick { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 6px; }
.field { display: flex; flex-direction: column; gap: 2px; font-size: .88rem; color: var(--muted); }
.numinput {
  background: #0b132b; border: 2px solid #38bdf8; border-bottom: 5px solid #0369a1;
  border-radius: 14px; color: #fff; font-family: var(--sans);
  font-size: 1.2rem; font-weight: 700; padding: 4px 14px; width: 140px; outline: none;
}
.numinput[aria-invalid="true"] { border-color: var(--rose); box-shadow: 0 0 12px rgba(225, 29, 72, 0.45); }
.errline { color: #fecdd3; font-size: .9rem; min-height: 1.6em; margin: 2px 0 8px; }
.ngrid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 12px; margin-top: 10px; }
.nbtn {
  appearance: none;
  background: linear-gradient(180deg, #312e81 0%, #1e1b4b 100%);
  border: 1px solid #818cf8; border-bottom: 6px solid #0f0d26;
  border-radius: 14px; padding: 10px 6px; color: #e0e7ff;
  font-family: var(--sans); font-size: 1.18rem; font-weight: 800;
  cursor: pointer; transition: all .12s; line-height: 1.5;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.4);
}
.nbtn:hover { background: linear-gradient(180deg, #4f46e5 0%, #3730a3 100%); transform: translateY(-3px); border-color: var(--gold-1); color: #fff; }
.nbtn.selected {
  background: linear-gradient(180deg, #ffe885 0%, #f59e0b 100%);
  color: #1e1b4b; border-color: #fff; border-bottom: 3px solid #78350f;
  transform: translateY(3px); box-shadow: 0 0 25px rgba(245, 158, 11, 0.8);
}

/* ─────────────── result stats ─────────────── */
.formula { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 0 0 24px; }
.pill {
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border: 2px solid #38bdf8; border-bottom: 6px solid #0369a1;
  border-radius: 18px; padding: 14px; text-align: center;
}
.pill.hi {
  background: linear-gradient(180deg, #422006 0%, #1c0f02 100%);
  border-color: var(--gold-1); border-bottom-color: #92400e;
  box-shadow: 0 0 25px rgba(245, 185, 53, 0.3);
}
.pill .k { display: block; font-size: .92rem; color: #93c5fd; line-height: 1.9; }
.pill .v { font-family: var(--sans); font-size: 2rem; font-weight: 800; color: var(--gold-1); line-height: 1.4; }
.srcline { font-size: .9rem; color: var(--cyan); margin: 0 0 6px; }

/* ─────────────── answer showcase ─────────────── */
.oracle {
  background: linear-gradient(145deg, #1e1b4b 0%, #0f172a 100%);
  border: 3px solid var(--gold-2); border-bottom: 8px solid #78350f;
  border-radius: 24px; padding: 24px; text-align: center; margin-bottom: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 35px rgba(245, 185, 53, 0.25);
}
.oracle-q { color: var(--gold-1); font-size: 1.35rem; margin-bottom: 6px; }
.oracle-lead { font-size: 1.02rem; color: var(--cyan); margin: 0 0 14px; }
.shot {
  background: #fffdf7;
  border: 4px solid #f59e0b;
  border-radius: 18px;
  padding: 12px;
  margin: 14px auto 0;
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
}
.shotmsg { color: #475569; font-family: var(--nastaliq); font-size: .95rem; margin: 6px; }
#cropCanvas { display: block; margin: 0 auto; max-width: 100%; height: auto; border-radius: 8px; image-rendering: auto; }

.stage { display: flex; justify-content: center; overflow: auto; padding: 10px 0; }
.pagebox { position: relative; line-height: 0; }
#pageCanvas {
  display: block; max-width: 100%; height: auto; border-radius: 8px; background: #fdfaf2;
  box-shadow: 0 0 0 3px #f59e0b, 0 12px 30px rgba(0, 0, 0, 0.55);
}
.overlay { position: absolute; inset: 0; }
.overlay.drawing { cursor: crosshair; }
.overlay .hl {
  position: absolute;
  border: 3px solid var(--rose);
  background: rgba(255, 215, 0, 0.34);
  border-radius: 4px;
  box-shadow: 0 0 14px rgba(225, 29, 72, 0.45);
  pointer-events: none;
}
.overlay .hl.manual { border-color: var(--emerald-bright); background: rgba(16, 185, 129, 0.22); box-shadow: 0 0 16px rgba(16, 185, 129, 0.5); }
.overlay .hl .tag {
  position: absolute; top: -1.9em; inset-inline-start: 0; font-family: var(--sans); font-size: 11px;
  color: #fff; background: var(--rose); border-radius: 6px 6px 0 0; padding: 0 6px; line-height: 1.6; white-space: nowrap;
}
.overlay .hl.manual .tag { background: var(--emerald-bright); color: #04140f; }
.overlay .hl .del {
  position: absolute; top: -1.9em; inset-inline-end: 0; width: 20px; height: 20px; line-height: 1;
  border: 0; border-radius: 6px 0 0 0; background: #8a1616; color: #fff; cursor: pointer; font-family: var(--sans); font-size: 13px;
}
.rubber { position: absolute; border: 2px dashed #fff; background: rgba(255, 255, 255, 0.18); pointer-events: none; }
.drawhint {
  background: rgba(16, 185, 129, 0.16); border: 1px solid var(--emerald-bright); color: #d1fae5;
  border-radius: 12px; padding: 6px 14px; font-size: .92rem; margin: 10px 0 0;
}
.keepnote { color: #a7f3d0; font-size: .88rem; text-align: center; margin: 10px 0 0; }

/* ─────────────── advanced / calibration ─────────────── */
.adv {
  background: var(--inset); border: 2px solid rgba(245, 185, 53, 0.32);
  border-bottom: 6px solid #05070f; border-radius: 20px; padding: 14px 18px; margin-top: 18px;
}
.adv summary { cursor: pointer; color: var(--gold-1); font-size: 1rem; }
.advgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-top: 14px; }
.advgrid .field, .advselpg .field {
  background: rgba(11, 19, 43, 0.8); border: 1px solid rgba(56, 189, 248, 0.3); border-radius: 12px; padding: 6px 12px;
}
.adv input[type="number"] {
  background: #0b132b; border: 1px solid rgba(56, 189, 248, 0.45); border-radius: 10px;
  color: var(--text); font-family: var(--sans); font-size: 1rem; padding: 3px 10px; width: 100%;
}
.advselpg { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-top: 12px; }
.advinset { font-size: .87rem; color: var(--muted); margin: 8px 0 0; line-height: 1.9; }
.advinset .ltr { font-family: var(--sans); direction: ltr; display: inline-block; unicode-bidi: embed; }
.handgrid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; align-items: end;
  margin-top: 14px; border-top: 1px dashed rgba(245, 185, 53, 0.4); padding-top: 12px;
}
.handgrid label { font-size: .8rem; color: var(--muted); font-family: var(--sans); }
.handgrid input {
  width: 100%; background: #0b132b; border: 1px solid rgba(56, 189, 248, 0.45);
  border-radius: 10px; color: var(--text); font-family: var(--sans); padding: 3px 8px;
}

/* ─────────────── modal / toast / footer ─────────────── */
.modal {
  position: fixed; inset: 0; z-index: 50; padding: 16px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(5, 3, 15, 0.8);
}
.modal-card {
  background: linear-gradient(160deg, #1a2347 0%, #0f172a 100%);
  border: 2px solid var(--gold-2); border-bottom: 8px solid #78350f;
  border-radius: 22px; padding: 22px; max-width: 540px; width: 100%;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.75);
}
.modal-card h2 { margin: 0 0 8px; font-size: 1.2rem; color: var(--gold-1); }
.modal-card p { margin: 6px 0; font-size: .96rem; }
.modal-card input {
  width: 100%; background: #0b132b; border: 1px solid rgba(56, 189, 248, 0.5);
  border-radius: 10px; color: var(--text); font-family: var(--sans); padding: 6px 12px;
}
.modal-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-start; margin-top: 16px; }
.toasts { position: fixed; bottom: 14px; inset-inline-start: 14px; z-index: 60; display: flex; flex-direction: column; gap: 8px; max-width: 92vw; }
.toast {
  background: linear-gradient(160deg, #1a2347, #0f172a);
  border: 1px solid var(--gold-2); border-bottom: 4px solid #78350f;
  color: var(--text); border-radius: 12px; padding: 8px 16px; font-size: .9rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}
.toast.t-err { border-color: var(--rose); border-bottom-color: #7f1d1d; background: #2a0d16; color: var(--err-fg); }

/* ═══════════════════════════════════════════════════════════════
   Light Garden theme — soft green, warm white, saffron.
   Overrides the Royal 3D palette; layout and 3D push geometry stay.
   ═══════════════════════════════════════════════════════════════ */
:root {
  color-scheme: light;
  --gold-1: #fbbf24;
  --gold-2: #f59e0b;
  --gold-3: #b45309;
  --cyan-glow: #34d399;
  --cyan: #0f766e;
  --cyan-deep: #0d9488;
  --pink-glow: #f97316;
  --purple-deep: #14532d;
  --emerald-bright: #16a34a;
  --rose: #dc2626;

  --bg-deep: #f7fbf4;
  --panel-hi: #ffffff;
  --panel-lo: #ffffff;
  --inset: #f5fbf6;
  --text: #1f3b2f;
  --muted: #5b7267;
  --border: #d5e9dc;

  --err-bg: #fee2e2;
  --err-fg: #991b1b;
  --warn-bg: #fff7e6;
  --warn-fg: #92400e;
  --ok-bg: #e8f7ee;
  --ok-fg: #14532d;
  --info-bg: #f0fdf4;
}

body {
  color: var(--text);
  background:
    radial-gradient(circle at 12% 8%, rgba(187, 247, 208, 0.55) 0%, transparent 42%),
    radial-gradient(circle at 88% 12%, rgba(253, 230, 138, 0.42) 0%, transparent 40%),
    radial-gradient(circle at 50% 100%, rgba(254, 215, 170, 0.28) 0%, transparent 52%),
    linear-gradient(160deg, #fbfdf9 0%, #f7fbf4 55%, #fffaf2 100%);
  background-attachment: fixed;
}
body::before {
  background-image: radial-gradient(rgba(22, 101, 52, 0.055) 1px, transparent 1px);
  background-size: 28px 28px;
}
::selection { background: #bbf7d0; color: #14532d; }
.skip { background: #15803d; color: #fff; }
.skip:focus { outline: 3px solid #f59e0b; }

/* banner */
.hero {
  border: 2px solid #cfe8d7;
  border-bottom: 7px solid #f3c98b;
  background: linear-gradient(135deg, #ffffff 0%, #f3fbf5 55%, #fff8ee 100%);
  box-shadow: 0 18px 40px rgba(21, 128, 61, 0.12), inset 0 1px 0 #fff;
}
.bismillah { color: #166534; text-shadow: 0 1px 0 #fff; }
.title { color: #14532d; text-shadow: 0 1px 0 #fff; }
.title::after {
  content: ""; display: block; width: 96px; height: 5px; margin: 2px auto 0;
  border-radius: 99px; background: linear-gradient(90deg, #16a34a, #f59e0b);
}
.title .edition, .sheikh { color: var(--muted); text-shadow: none; }
.subtitle {
  display: block;
  margin: 8px 0 0;
  padding: 0;
  color: #4f6a5c;
  background: transparent;
  border: 0;
  font-size: 1.08rem;
  line-height: 2;
}

/* buttons */
.btn {
  color: #fff;
  border: 1px solid #4ade80;
  border-bottom: 6px solid #065f46;
  background: linear-gradient(180deg, #22c55e 0%, #16a34a 55%, #15803d 100%);
  box-shadow: 0 8px 18px rgba(21, 128, 61, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn.gold:hover:not(:disabled), .btn:not(.outline):not(.hl):hover:not(:disabled) {
  filter: brightness(1.04);
  box-shadow: 0 12px 24px rgba(21, 128, 61, 0.24);
}
.btn:active:not(:disabled) { box-shadow: 0 3px 8px rgba(21, 128, 61, 0.22); }
.btn.gold {
  color: #3f2404;
  border: 1px solid #fef3c7;
  border-bottom: 6px solid #b45309;
  background: linear-gradient(180deg, #fde68a 0%, #fbbf24 50%, #f59e0b 100%);
  box-shadow: 0 8px 18px rgba(245, 158, 11, 0.26), inset 0 1px 0 #fffbeb;
}
.btn.gold:hover:not(:disabled) { filter: brightness(1.03); box-shadow: 0 12px 24px rgba(245, 158, 11, 0.3); }
.btn.outline {
  background: linear-gradient(180deg, #ffffff 0%, #f7fcf8 100%);
  color: #166534;
  border: 1px solid #a7d7b9;
  border-bottom: 5px solid #c2ddcb;
  box-shadow: 0 5px 14px rgba(21, 128, 61, 0.08);
}
.btn.outline:hover:not(:disabled) { filter: none; background: #f0fdf4; transform: translateY(-2px); box-shadow: 0 9px 18px rgba(21, 128, 61, 0.12); }
.btn.hl {
  background: linear-gradient(180deg, #ffffff 0%, #ecfdf5 100%);
  color: #0f766e;
  border: 1px solid #99f6e4;
  border-bottom: 5px solid #5eead4;
  box-shadow: 0 5px 14px rgba(13, 148, 136, 0.12);
}
.btn.hl:hover:not(:disabled) { filter: none; background: #f0fdfa; }
.btn:disabled { filter: grayscale(0.25); opacity: 0.5; }
.btn:focus-visible, .tab:focus-visible, .dir:focus-visible, .qitem:focus-visible, .nbtn:focus-visible,
input:focus-visible, select:focus-visible, summary:focus-visible, canvas:focus-visible {
  outline: 3px solid #f59e0b;
  outline-offset: 2px;
}

/* loader */
.loadbar {
  background: #ffffff;
  border: 2px solid #cfe8d7;
  border-bottom: 6px solid #b9dcc4;
  box-shadow: 0 12px 26px rgba(21, 128, 61, 0.08);
}
.loadstat { color: #166534; }
.dot { background: radial-gradient(circle at 30% 30%, #fde68a, #f59e0b); box-shadow: 0 0 12px rgba(245, 158, 11, 0.45); }
.dot.loaded { background: radial-gradient(circle at 30% 30%, #86efac, #16a34a); box-shadow: 0 0 14px rgba(22, 163, 74, 0.4); }

/* notes */
.note { color: var(--text); border-color: #d9ecdf; }
.note-ok { background: #e8f7ee; color: #14532d; border-color: #86efac; }
.note-warn { background: #fff7e6; color: #92400e; border-color: #fcd34d; }
.note-error { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.note-info { background: #f0fdf4; color: #3f5a4d; border-color: #bbf7d0; }
.note b { color: inherit; }
.spinner { border-color: #d1fae5; border-top-color: #16a34a; }

/* tabs */
.tab { color: #1f3b2f; border-color: #d9ecdf; }
.tab .num { background: #ffffff; color: #92400e; border: 1px solid #fde68a; }
.tab .lbl { text-shadow: none; }
#tab1 { background: linear-gradient(180deg, #ffffff, #f0fdf4); border-color: #bbf7d0; border-bottom-color: #86efac; box-shadow: 0 8px 18px rgba(22, 163, 74, 0.08); }
#tab2 { background: linear-gradient(180deg, #fffdf5, #fffbeb); border-color: #fde68a; border-bottom-color: #fcd34d; box-shadow: 0 8px 18px rgba(245, 158, 11, 0.09); }
#tab3 { background: linear-gradient(180deg, #fffaf5, #fff7ed); border-color: #fed7aa; border-bottom-color: #fdba74; box-shadow: 0 8px 18px rgba(249, 115, 22, 0.09); }
#tab4 { background: linear-gradient(180deg, #f7fdf9, #f0fdf4); border-color: #a7f3d0; border-bottom-color: #6ee7b7; box-shadow: 0 8px 18px rgba(22, 163, 74, 0.08); }
#tab1 .num { color: #166534; border-color: #bbf7d0; }
#tab2 .num { color: #92400e; border-color: #fde68a; }
#tab3 .num { color: #9a3412; border-color: #fed7aa; }
#tab4 .num { color: #065f46; border-color: #a7f3d0; }
#tab1.active, #tab2.active, #tab3.active, #tab4.active {
  color: #fff;
  background: linear-gradient(180deg, #22c55e 0%, #15803d 60%, #166534 100%);
  border-color: #fbbf24;
  border-bottom-color: #b45309;
  box-shadow: 0 0 0 3px #fef3c7, 0 10px 24px rgba(21, 128, 61, 0.25);
}
#tab1.active .num, #tab2.active .num, #tab3.active .num, #tab4.active .num {
  color: #fef3c7;
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.35);
}
.tab:hover:not(:disabled):not(.active) { filter: none; transform: translateY(-4px) scale(1.02); }
.tab.done { border-color: #f59e0b; }
.tab.done .num { color: #b45309; }
.tab:disabled, .tab.locked { filter: grayscale(0.35); }

/* cards */
.card {
  background: #ffffff;
  border: 2px solid #d9ecdf;
  border-bottom: 7px solid #c6dece;
  box-shadow: 0 16px 38px rgba(21, 128, 61, 0.08), inset 0 1px 0 #fff;
}
.card-head { border-bottom: 2px solid #e3f0e6; }
.card-title { color: #166534; text-shadow: none; }
.subcard {
  background: #f7fcf8;
  border: 2px solid #d5e9dc;
  border-bottom: 5px solid #c2ddcb;
  box-shadow: 0 10px 24px rgba(21, 128, 61, 0.06);
}
.subhead h3 { color: #166534; }
.zoomval { color: #b45309; }
.picked-badge { color: #15803d; }

/* protocol */
.proto-step { color: var(--text); border-color: #d9ecdf; border-bottom-color: #c6dece; box-shadow: 0 10px 24px rgba(21, 128, 61, 0.07); }
.proto-step:nth-child(1) { background: linear-gradient(145deg, #ffffff 0%, #f0fdf4 100%); border-color: #bbf7d0; border-bottom-color: #86efac; }
.proto-step:nth-child(2) { background: linear-gradient(145deg, #fffdf5 0%, #fffbeb 100%); border-color: #fde68a; border-bottom-color: #fcd34d; }
.proto-step:nth-child(3) { background: linear-gradient(145deg, #fffaf5 0%, #fff7ed 100%); border-color: #fed7aa; border-bottom-color: #fdba74; }
.proto-step.done { border-color: #22c55e; box-shadow: 0 0 0 3px #dcfce7, 0 10px 24px rgba(22, 163, 74, 0.14); }

/* protocol sub-tabs */
.protocol-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 18px; }
.ptab {
  appearance: none; display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--nastaliq); font-size: .98rem; line-height: 1.8; color: #166534;
  background: #fff; border: 1px solid #cfe8d7; border-bottom: 4px solid #b9dcc4;
  border-radius: 14px; padding: 4px 12px; cursor: pointer;
  transition: all .15s; box-shadow: 0 4px 10px rgba(21, 128, 61, 0.06);
}
.ptab:hover { background: #f0fdf4; border-color: #86efac; transform: translateY(-2px); }
.ptab .ptab-n {
  display: inline-grid; place-items: center; width: 24px; height: 24px; flex: none;
  border-radius: 50%; background: #fef3c7; border: 1px solid #fde68a;
  color: #92400e; font-family: var(--sans); font-size: .76rem; font-weight: 800; line-height: 1;
}
.ptab.active {
  color: #fff;
  background: linear-gradient(180deg, #22c55e 0%, #15803d 60%, #166534 100%);
  border-color: #fbbf24; border-bottom-color: #b45309;
  box-shadow: 0 0 0 3px #fef3c7, 0 8px 18px rgba(21, 128, 61, 0.22);
}
.ptab.active .ptab-n { background: rgba(255, 255, 255, 0.18); border-color: rgba(255, 255, 255, 0.4); color: #fef3c7; }
.ptab.done::after {
  content: "✓"; display: inline-grid; place-items: center; width: 18px; height: 18px;
  border-radius: 50%; background: #fbbf24; color: #3f2404;
  font-family: var(--sans); font-size: .72rem; font-weight: 800; line-height: 1;
}
.ptab.active.done::after { background: #fef3c7; }
.ptab:focus-visible, .ppanel:focus-visible { outline: 3px solid #f59e0b; outline-offset: 2px; }
.ppanels { margin-top: 0; }
.ppanels .ppanel.proto-step {
  background: linear-gradient(145deg, #ffffff 0%, #f7fcf8 100%);
  border-color: #d9ecdf; border-bottom-color: #c6dece;
  box-shadow: 0 10px 24px rgba(21, 128, 61, 0.07);
}
.ppanel .badge { margin-bottom: 4px; }
.ppanel.done { border-color: #22c55e; box-shadow: 0 0 0 3px #dcfce7, 0 10px 24px rgba(22, 163, 74, 0.14); }
.pnote {
  font-size: .9rem; color: #4f6a5c; background: #f0fdf4;
  border-inline-start: 4px solid #86efac; border-radius: 10px;
  padding: 8px 12px; margin: 0 0 14px; line-height: 1.9;
}
.dua-ar.long { font-size: 1.4rem; line-height: 2.1; text-align: right; }
.dua-tr.long { text-align: left; font-size: .8rem; line-height: 1.7; }
.dua-mean {
  font-size: .9rem; line-height: 1.95; color: #4f6a5c;
  margin: 12px 0 0; padding-top: 10px; border-top: 1px dashed #fcd34d; text-align: start;
}
.badge { background: #ecfdf5; color: #166534; border-color: #86efac; }
.dua {
  background: linear-gradient(135deg, #fffdf5, #fff7e6);
  border-color: #fcd34d;
  box-shadow: inset 0 0 20px rgba(251, 191, 36, 0.12);
}
.dua-ar { color: #14532d; }
.dua-tr { color: #8a6a14; }
.dir {
  background: linear-gradient(180deg, #ffffff, #f7fcf8);
  border: 1px solid #cfe8d7;
  border-bottom: 5px solid #badcc6;
  color: #166534;
}
.dir:hover { filter: none; background: #f0fdf4; }
.dir.blown, .dir[aria-pressed="true"] {
  background: linear-gradient(180deg, #22c55e, #16a34a);
  border-color: #86efac;
  border-bottom-color: #15803d;
  color: #fff;
}
.proto-foot { border-top: 2px solid #e3f0e6; }
.ready { color: #15803d; }

/* questions */
.search {
  background: #ffffff;
  border: 2px solid #bbf7d0;
  border-bottom: 5px solid #86efac;
  color: #1f3b2f;
  box-shadow: inset 0 2px 6px rgba(21, 128, 61, 0.05);
}
.search:focus { border-color: #f59e0b; box-shadow: 0 0 0 4px #fef3c7; }
.qgrid::-webkit-scrollbar { width: 10px; }
.qgrid::-webkit-scrollbar-thumb { background: #c6dece; border-radius: 99px; }
.qgrid::-webkit-scrollbar-track { background: #f3faf5; border-radius: 99px; }
.qitem {
  background: #ffffff;
  border: 1px solid #d9ecdf;
  border-bottom: 5px solid #c6dece;
  color: #1f3b2f;
  box-shadow: 0 4px 10px rgba(21, 128, 61, 0.04);
}
.qitem:hover { border-color: #fbbf24; background: #fffaf0; box-shadow: 0 8px 18px rgba(245, 158, 11, 0.12); }
.qitem.selected {
  background: linear-gradient(145deg, #16a34a, #15803d);
  border: 2px solid #fbbf24;
  border-bottom: 4px solid #b45309;
  color: #fff;
  box-shadow: 0 0 0 3px #fef3c7, 0 8px 18px rgba(21, 128, 61, 0.22);
}
.qn {
  background: linear-gradient(180deg, #fef3c7, #fbbf24);
  border-bottom: 3px solid #b45309;
  color: #3f2404;
}
.qitem.selected .qn { background: #ffffff; color: #166534; border-bottom-color: #d97706; }
.qitem.is-blank { opacity: 0.65; }
.emptymsg { color: #6b7f75; }

/* numbers */
.banner { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.rule, .field { color: var(--muted); }
.numinput {
  background: #ffffff;
  border: 2px solid #bbf7d0;
  border-bottom: 5px solid #86efac;
  color: #14532d;
}
.numinput:focus { border-color: #f59e0b; box-shadow: 0 0 0 4px #fef3c7; }
.numinput[aria-invalid="true"] { border-color: var(--rose); box-shadow: 0 0 0 3px #fee2e2; }
.errline { color: #b91c1c; }
.nbtn {
  background: #ffffff;
  border: 1px solid #d9ecdf;
  border-bottom: 5px solid #c6dece;
  color: #166534;
  box-shadow: 0 4px 10px rgba(21, 128, 61, 0.05);
}
.nbtn:hover { background: #f0fdf4; border-color: #86efac; color: #14532d; box-shadow: 0 8px 16px rgba(22, 163, 74, 0.12); }
.nbtn.selected {
  background: linear-gradient(180deg, #fde68a, #fbbf24);
  color: #3f2404;
  border-color: #ffffff;
  border-bottom: 3px solid #b45309;
  box-shadow: 0 0 0 3px #fff7e6, 0 6px 16px rgba(245, 158, 11, 0.24);
}

/* result */
.pill { background: #ffffff; border-color: #d9ecdf; border-bottom-color: #c6dece; }
.pill .k { color: #5b7267; }
.pill .v { color: #166534; }
.pill.hi {
  background: linear-gradient(180deg, #fffbeb, #fff7ed);
  border-color: #fbbf24;
  border-bottom-color: #d97706;
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.12);
}
.pill.hi .v { color: #b45309; }
.srcline { color: #6b7f75; }
.oracle {
  background: linear-gradient(145deg, #ffffff, #fffaf0);
  border: 3px solid #f5c469;
  border-bottom: 7px solid #e0a43a;
  box-shadow: 0 18px 40px rgba(245, 158, 11, 0.13);
}
.oracle-q { color: #14532d; }
.oracle-lead { color: #5b7267; }
.shot {
  background: #fffdf7;
  border: 4px solid #f5c469;
  box-shadow: 0 10px 26px rgba(180, 83, 9, 0.12);
}
.shotmsg { color: #5b7267; }
#pageCanvas { box-shadow: 0 0 0 3px #fbbf24, 0 12px 28px rgba(21, 128, 61, 0.16); }
.overlay .hl {
  border-color: #ea580c;
  background: rgba(251, 191, 36, 0.38);
  box-shadow: 0 0 12px rgba(234, 88, 12, 0.35);
}
.overlay .hl .tag { background: #ea580c; color: #fff; }
.overlay .hl.manual { border-color: #16a34a; background: rgba(34, 197, 94, 0.22); box-shadow: 0 0 14px rgba(22, 163, 74, 0.4); }
.overlay .hl.manual .tag { background: #16a34a; color: #fff; }
.overlay .hl .del { background: #b91c1c; }
.rubber { border-color: #16a34a; background: rgba(22, 163, 74, 0.12); }
.drawhint { background: #ecfdf5; border-color: #86efac; color: #166534; }
.keepnote { color: #166534; }

/* advanced */
.adv {
  background: #f7fcf8;
  border: 2px solid #d5e9dc;
  border-bottom: 5px solid #c2ddcb;
}
.adv summary { color: #166534; }
.advgrid .field, .advselpg .field { background: #ffffff; border-color: #d5e9dc; }
.adv input[type="number"], .handgrid input {
  background: #ffffff;
  border: 1px solid #bbf7d0;
  color: #1f3b2f;
}
.advinset { color: var(--muted); }
.handgrid { border-top: 1px dashed #b9dcc4; }
.handgrid label { color: var(--muted); }

/* modal / toast / footer */
.modal { background: rgba(18, 38, 28, 0.45); }
.modal-card {
  background: #ffffff;
  border: 2px solid #d9ecdf;
  border-bottom: 7px solid #f3c98b;
  box-shadow: 0 24px 60px rgba(18, 38, 28, 0.25);
}
.modal-card h2 { color: #166534; }
.modal-card input { background: #ffffff; border: 1px solid #bbf7d0; color: #1f3b2f; }
.toast {
  background: #ffffff;
  border: 1px solid #d9ecdf;
  border-bottom: 4px solid #f3c98b;
  color: #1f3b2f;
  box-shadow: 0 10px 26px rgba(21, 128, 61, 0.12);
}
.toast.t-err { border-color: #fca5a5; border-bottom-color: #dc2626; background: #fff5f5; color: #991b1b; }

/* ─────────────── responsive ─────────────── */
@media (max-width: 720px) {
  .stepper { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .ngrid { grid-template-columns: repeat(4, 1fr); }
  .formula { grid-template-columns: 1fr; }
  .hero { padding: 18px 12px 16px; border-radius: 22px; }
  .bismillah, .dua-ar { font-size: 1.3rem; }
  .title { font-size: 1.95rem; line-height: 1.9; }
  .subtitle { font-size: .98rem; line-height: 1.9; padding: 0; }
  .card { padding: 16px; border-radius: 20px; }
  .qgrid { grid-template-columns: 1fr; }
  .protocol-tabs {
    flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; margin-bottom: 14px;
    -webkit-overflow-scrolling: touch; scrollbar-width: thin;
  }
  .ptab { flex: none; font-size: .9rem; padding: 3px 10px; }
  .ptab .ptab-n { width: 22px; height: 22px; font-size: .72rem; }
  .ppanel { padding: 16px; }
  .dua-ar.long { font-size: 1.18rem; line-height: 2.05; }
  .dua-tr.long { font-size: .76rem; }
  .loadbar { justify-content: center; }
  .loadstat { width: 100%; justify-content: center; text-align: center; }
  .loadbtns { justify-content: center; }
  .toolbar { width: 100%; justify-content: center; }
}
@media (max-width: 380px) {
  .ngrid { grid-template-columns: repeat(3, 1fr); }
  .compass { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
}
@media print {
  body { background: #fff; color: #000; }
  .loadbar, .stepper, .toolbar, .adv, .toasts, #sec1, #sec2, #sec3 { display: none !important; }
}

/* ═══════════════════════════════════════════════════════════════
   Heritage Modern refinement — 2026-10-17
   Same green / ivory / saffron palette, quieter geometry:
   hairline frames, paper surfaces, editorial type, gold accents.
   ═══════════════════════════════════════════════════════════════ */
:root {
  --forest-950: #052e22;
  --forest-900: #0a3b2b;
  --forest-800: #0f5138;
  --forest-700: #166534;
  --forest-600: #1a7a4a;
  --ink: #16342a;
  --ink-2: #466052;
  --ink-3: #5c7165;
  --paper: #fffdf8;
  --paper-2: #fbf7ec;
  --line: #e2eee6;
  --line-strong: #cfe2d6;
  --gold-line: #e4cd97;
  --gold: #d9a441;
  --gold-deep: #a86e16;
  --gold-soft: #f7e7c2;
  --shadow-1: 0 1px 2px rgba(10, 59, 43, 0.05);
  --shadow-2: 0 14px 34px -24px rgba(10, 59, 43, 0.38);
  --shadow-3: 0 30px 70px -40px rgba(10, 59, 43, 0.5);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --text: var(--ink);
  --muted: var(--ink-2);
}

body {
  background:
    radial-gradient(1100px 620px at 100% -8%, rgba(251, 191, 36, 0.14) 0%, transparent 62%),
    radial-gradient(900px 700px at -12% 8%, rgba(134, 239, 172, 0.26) 0%, transparent 60%),
    radial-gradient(1200px 800px at 50% 108%, rgba(253, 230, 138, 0.16) 0%, transparent 60%),
    linear-gradient(180deg, #fcfdf9 0%, #f8fbf4 46%, #fdfaf3 100%);
  background-attachment: fixed;
}
body::before {
  background-image:
    radial-gradient(rgba(15, 81, 50, 0.042) 1px, transparent 1px),
    radial-gradient(rgba(168, 110, 22, 0.035) 1px, transparent 1px);
  background-size: 28px 28px, 56px 56px;
  background-position: 0 0, 14px 14px;
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, .65), transparent 72%);
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, .65), transparent 72%);
}
body::after {
  content: "";
  position: fixed; top: 0; inset-inline: 0; height: 3px; z-index: 5;
  background: linear-gradient(90deg, #166534, #d9a441 50%, #166534);
  opacity: .8; pointer-events: none;
}
::selection { background: #d9efdf; color: #0a3b2b; }

/* ── hero ── */
.hero {
  position: relative;
  border: 1px solid var(--gold-line);
  border-bottom: 1px solid var(--gold-line);
  border-radius: 30px;
  background:
    radial-gradient(120% 130% at 50% -20%, #ffffff 0%, #fbfdf7 48%, #fff7ea 100%);
  box-shadow: 0 1px 0 #fff inset, var(--shadow-3);
  padding: 34px 24px 30px;
  margin-bottom: 30px;
}
.hero::before {
  content: "";
  position: absolute; inset: 9px; border: 1px solid rgba(168, 110, 22, 0.16);
  border-radius: 22px; pointer-events: none;
}
.hero::after {
  content: "✦";
  position: absolute; left: 50%; bottom: -13px; transform: translateX(-50%);
  width: 26px; height: 26px; display: grid; place-items: center;
  font-size: .68rem; color: var(--gold-deep); background: var(--paper);
  border: 1px solid var(--gold-line); border-radius: 50%;
  box-shadow: 0 2px 6px rgba(10, 59, 43, 0.08); z-index: 2;
}
.bismillah { color: var(--forest-700); font-size: 1.7rem; line-height: 2; text-shadow: none; }
.title {
  color: var(--forest-900);
  font-size: clamp(2.25rem, 4.6vw, 3rem);
  line-height: 1.75;
  margin: 2px 0 6px;
  text-shadow: none;
}
.title::after {
  width: 132px; height: 1px; margin: 10px auto 0;
  background: linear-gradient(90deg, transparent, #c9a44f 18%, #0f5138 50%, #c9a44f 82%, transparent);
}
.subtitle {
  color: var(--ink-2);
  font-size: 1.05rem;
  line-height: 2.05;
  max-width: 640px;
  margin: 10px auto 0;
}

/* ── loader ── */
.loadbar {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 16px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-1), 0 14px 30px -30px rgba(10, 59, 43, 0.4);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.loadstat { color: var(--ink-2); font-size: .95rem; gap: 10px; }
.dot { width: 12px; height: 12px; background: radial-gradient(circle at 30% 30%, #f7d889, #d9a441); box-shadow: 0 0 0 4px rgba(217, 164, 65, 0.14); }
.dot.loaded { background: radial-gradient(circle at 30% 30%, #7bdcab, #15803d); box-shadow: 0 0 0 4px rgba(21, 128, 61, 0.13); }
.loadbtns .btn { font-size: .88rem; padding: 4px 14px; border-radius: 11px; }

/* ── main stepper ── */
.stepper { gap: 10px; perspective: none; margin-bottom: 28px; }
#tab1, #tab2, #tab3, #tab4 {
  background: #ffffff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-bottom: 1px solid var(--line-strong);
  border-radius: 16px;
  padding: 10px 12px 9px;
  box-shadow: var(--shadow-1);
  transform: none;
}
#tab1 { background: linear-gradient(180deg, #ffffff, #f6fcf8); }
#tab2 { background: linear-gradient(180deg, #fffefa, #fdf7e9); }
#tab3 { background: linear-gradient(180deg, #fffdf9, #fdf4e9); }
#tab4 { background: linear-gradient(180deg, #fbfffd, #f1faf5); }
.tab::before {
  content: ""; position: absolute; top: 0; inset-inline: 14px; height: 2px;
  border-radius: 0 0 2px 2px; background: var(--line-strong); opacity: .9;
}
#tab1::before { background: #1f7a4f; }
#tab2::before { background: #d9a441; }
#tab3::before { background: #d58a3a; }
#tab4::before { background: #17806a; }
.tab .num {
  background: transparent; border: 0; padding: 0; margin: 0 0 1px;
  color: var(--ink-3); font-size: .64rem; letter-spacing: .16em; line-height: 1.8;
}
.tab .lbl { color: var(--ink); font-size: .98rem; font-weight: 600; text-shadow: none; }
#tab1 .num, #tab2 .num, #tab3 .num, #tab4 .num { color: var(--ink-3); border-color: transparent; }
.tab:hover:not(:disabled):not(.active) {
  transform: translateY(-2px); filter: none;
  border-color: var(--gold-line);
  box-shadow: var(--shadow-2);
}
#tab1.active, #tab2.active, #tab3.active, #tab4.active {
  color: #ffffff;
  background: linear-gradient(180deg, #176c47 0%, #0f5138 55%, #0a3b2b 100%);
  border-color: #0b4430;
  border-bottom: 1px solid #082d20;
  transform: none;
  box-shadow:
    0 0 0 1px rgba(217, 164, 65, 0.55),
    0 16px 30px -20px rgba(6, 42, 29, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
}
#tab1.active::before, #tab2.active::before, #tab3.active::before, #tab4.active::before {
  background: linear-gradient(90deg, transparent, #f2d391, transparent);
}
#tab1.active .num, #tab2.active .num, #tab3.active .num, #tab4.active .num { color: #f2d391; background: transparent; border-color: transparent; }
#tab1.active .lbl, #tab2.active .lbl, #tab3.active .lbl, #tab4.active .lbl { color: #ffffff; }
.tab.done { border-color: var(--gold-line); }
.tab.done .num { color: var(--gold-deep); }
#tab1.active.done .num, #tab2.active.done .num, #tab3.active.done .num, #tab4.active.done .num { color: #f2d391; }
.tab:disabled, .tab.locked { filter: grayscale(0.4); opacity: .5; }

/* ── cards ── */
.card {
  background: linear-gradient(180deg, #ffffff 0%, #fffefb 100%);
  border: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 26px;
  padding: 26px;
  box-shadow: 0 1px 0 #ffffff inset, var(--shadow-3);
}
.card-head { border-bottom: 1px solid #eaf2ec; padding-bottom: 16px; margin-bottom: 22px; }
.card-title { color: var(--forest-800); font-size: 1.48rem; line-height: 1.9; text-shadow: none; }
.card-title, .oracle-q, .subhead h3, .hero .subtitle { text-wrap: balance; }
.card-head .btn { font-size: .88rem; padding: 5px 14px; border-radius: 11px; }
.picked-badge {
  color: var(--forest-700); font-size: .9rem;
  background: #f2f9f4; border: 1px solid #dcece2; border-radius: 99px; padding: 2px 12px;
}
.subcard {
  background: #fbfdf9;
  border: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  box-shadow: none;
}
.subhead h3 { color: var(--forest-800); font-size: 1.05rem; }
.toolbar .btn { font-size: .86rem; padding: 3px 12px; border-radius: 10px; border-bottom-width: 2px; }
.zoomval { color: var(--gold-deep); font-variant-numeric: tabular-nums; }

/* ── buttons ── */
.btn {
  border: 1px solid #1c6b46;
  border-bottom: 3px solid #0a3826;
  border-radius: 14px;
  padding: 8px 20px;
  font-size: .97rem;
  color: #ffffff;
  background: linear-gradient(180deg, #1f7a4f 0%, #0f5138 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.25) inset,
    0 12px 24px -18px rgba(6, 42, 29, 0.75);
  transition: transform .16s var(--ease), box-shadow .16s var(--ease), filter .16s, border-color .16s;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.04); box-shadow: 0 1px 0 rgba(255, 255, 255, .22) inset, 0 16px 28px -18px rgba(6, 42, 29, .75); }
.btn:active:not(:disabled) { transform: translateY(1px); border-bottom-width: 2px; box-shadow: 0 1px 2px rgba(6, 42, 29, .3); }
.btn.gold {
  color: #3c2606;
  border: 1px solid #e2b45a;
  border-bottom: 3px solid #a96f14;
  background: linear-gradient(180deg, #f9d777 0%, #edb143 100%);
  box-shadow: 0 1px 0 #fff8dc inset, 0 12px 24px -18px rgba(168, 110, 22, 0.75);
}
.btn.gold:hover:not(:disabled) { filter: brightness(1.03); box-shadow: 0 1px 0 #fff8dc inset, 0 16px 30px -18px rgba(168, 110, 22, 0.8); }
.btn.outline {
  color: var(--forest-800);
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-bottom: 3px solid #dbe9df;
  box-shadow: 0 6px 14px -12px rgba(10, 59, 43, 0.4);
}
.btn.outline:hover:not(:disabled) { background: #f7fbf8; box-shadow: var(--shadow-2); }
.btn.hl {
  color: #0c5c50;
  background: #f7fdfb;
  border: 1px solid #b9e6dc;
  border-bottom: 3px solid #c8ebe2;
  box-shadow: 0 6px 14px -12px rgba(13, 148, 136, 0.35);
}
.btn.hl:hover:not(:disabled) { background: #effcf9; }
.btn.tiny { font-size: .82rem; padding: 2px 12px; border-radius: 9px; border-bottom-width: 2px; }
.btn.big { font-size: 1.1rem; padding: 10px 30px; }
.btn:disabled { filter: grayscale(0.3); opacity: .48; }
.btn:focus-visible, .tab:focus-visible, .ptab:focus-visible, .dir:focus-visible, .qitem:focus-visible,
.nbtn:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, canvas:focus-visible,
.ppanel:focus-visible {
  outline: 2px solid #c58a1c;
  outline-offset: 3px;
}

/* ── protocol rail ── */
.protocol-tabs {
  gap: 6px;
  padding: 6px;
  margin: 0 0 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #f5faf6, #eff7f1);
  box-shadow: inset 0 1px 2px rgba(10, 59, 43, 0.04);
}
.ptab {
  border: 1px solid transparent;
  border-bottom: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--ink-2);
  box-shadow: none;
  padding: 5px 12px;
  font-size: .94rem;
  line-height: 1.75;
  transition: background .15s, color .15s, border-color .15s, box-shadow .15s, transform .15s;
}
.ptab:hover { background: rgba(255, 255, 255, 0.85); border-color: var(--line); color: var(--forest-800); transform: none; box-shadow: var(--shadow-1); }
.ptab .ptab-n {
  width: 22px; height: 22px;
  background: #fffaf0; border: 1px solid #ecd9ae; color: #936312;
  font-size: .7rem;
}
.ptab.active {
  color: #ffffff;
  border-color: #0b4430;
  background: linear-gradient(180deg, #176c47 0%, #0f5138 100%);
  box-shadow:
    0 0 0 1px rgba(217, 164, 65, 0.5),
    0 8px 16px -12px rgba(6, 42, 29, 0.6);
}
.ptab.active .ptab-n { background: rgba(255, 255, 255, 0.12); border-color: rgba(242, 211, 145, 0.5); color: #f2d391; }
.ptab.done::after { width: 16px; height: 16px; font-size: .64rem; background: #f2d391; color: #4a3208; }
.ptab.active.done::after { background: #f2d391; }

.ppanels { margin-top: 0; }
.ppanels .ppanel.proto-step {
  background: linear-gradient(180deg, #ffffff 0%, #fcfdf9 100%);
  border: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px;
  box-shadow: 0 1px 0 #ffffff inset, 0 20px 40px -40px rgba(10, 59, 43, 0.5);
}
.ppanel.done { border-color: #9fd3b3; box-shadow: 0 0 0 3px #e8f6ed, 0 20px 40px -40px rgba(10, 59, 43, 0.5); }
.badge {
  background: #fbf6e8; color: #8a5a12; border: 1px solid #e8d6a8;
  border-radius: 99px; padding: 2px 14px; font-size: .82rem;
}
.pnote {
  color: #4c6558; background: #f4faf5;
  border-inline-start: 3px solid #b7d8c4;
  border-radius: 8px;
}
.proto-foot { border-top: 1px solid #eaf2ec; margin-top: 24px; padding-top: 18px; }
.ready { color: var(--ink-2); font-size: 1rem; line-height: 2; }

/* ── dua manuscript ── */
.dua {
  position: relative;
  background:
    radial-gradient(420px 170px at 50% 0%, rgba(217, 164, 65, 0.09), transparent 70%),
    linear-gradient(180deg, #fffdf6, #fdf8ec);
  border: 1px solid var(--gold-line);
  border-radius: 18px;
  padding: 22px 20px;
  box-shadow:
    inset 0 0 0 4px #fffdf8,
    inset 0 0 0 5px rgba(228, 205, 151, 0.55),
    0 16px 34px -30px rgba(168, 110, 22, 0.45);
}
.dua::before, .dua::after {
  content: ""; position: absolute; width: 16px; height: 16px;
  border: 1px solid rgba(168, 110, 22, 0.4); pointer-events: none;
}
.dua::before { top: 12px; inset-inline-start: 12px; border-width: 1px 1px 0 0; border-start-start-radius: 5px; }
.dua::after { bottom: 12px; inset-inline-end: 12px; border-width: 0 0 1px 1px; border-end-end-radius: 5px; }
.dua-ar { color: #123f2e; }
.dua-ar.long { font-size: 1.32rem; line-height: 2.15; }
.dua-tr { color: #8f6a18; }
.dua-tr.long { font-size: .79rem; }
.dua-mean { font-size: .92rem; line-height: 2; color: #4c6558; border-top: 1px dashed var(--gold-line); }
.compass { gap: 9px; }
.dir {
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  color: var(--forest-800);
  border-radius: 11px;
  padding: 9px 12px;
  box-shadow: var(--shadow-1);
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.dir:hover { background: #f5fbf6; border-color: var(--gold-line); filter: none; }
.dir.blown, .dir[aria-pressed="true"] {
  background: linear-gradient(180deg, #1f7a4f, #0f5138);
  border-color: #0b4430;
  border-bottom-width: 1px;
  color: #ffffff;
  transform: none;
  box-shadow: 0 8px 16px -14px rgba(6, 42, 29, 0.6);
}

/* ── questions ── */
.search {
  border: 1px solid var(--line-strong);
  border-bottom: 2px solid var(--line-strong);
  border-radius: 13px;
  padding: 11px 16px;
  color: var(--ink);
  font-size: 1rem;
  box-shadow: inset 0 1px 3px rgba(10, 59, 43, 0.05);
}
.search:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(217, 164, 65, 0.16); }
.search::placeholder { color: #6b8175; opacity: 1; }
.qgrid { gap: 10px; max-height: 520px; padding: 2px; scrollbar-width: thin; scrollbar-color: #c9dccf transparent; }
.qitem {
  background: #ffffff;
  border: 1px solid var(--line);
  border-bottom: 1px solid var(--line-strong);
  border-radius: 13px;
  padding: 10px 12px;
  gap: 12px;
  color: var(--ink);
  font-size: 1rem;
  box-shadow: var(--shadow-1);
  transition: border-color .15s, box-shadow .15s, transform .15s, background .15s;
}
.qitem:hover {
  transform: translateY(-1px);
  border-color: var(--gold-line);
  background: #fffdf7;
  box-shadow: var(--shadow-2);
}
.qitem.selected {
  background: linear-gradient(135deg, #176c47 0%, #0f5138 100%);
  border: 1px solid #0b4430;
  border-bottom: 1px solid #0b4430;
  color: #ffffff;
  transform: none;
  box-shadow: 0 0 0 2px #f2d391, 0 14px 26px -20px rgba(6, 42, 29, 0.7);
}
.qn {
  min-width: 38px; height: 38px; border-radius: 9px;
  background: #fdf6e5; border: 1px solid #ecd9ae; border-bottom: 1px solid #ecd9ae;
  color: #8a5a12; font-size: .95rem; font-variant-numeric: tabular-nums;
}
.qitem.selected .qn { background: #fffdf6; color: var(--forest-800); border-color: #f2d391; border-bottom-color: #f2d391; }
.emptymsg { color: var(--ink-2); }

/* ── numbers ── */
.banner {
  background: #f4faf5; border: 1px solid #d9ebdf; border-radius: 12px;
  color: var(--forest-700); font-size: 1rem; padding: 8px 16px;
}
.rule { color: var(--ink-2); font-size: .92rem; }
.numinput {
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-bottom: 2px solid var(--line-strong);
  border-radius: 11px;
  color: var(--forest-800);
  font-size: 1.12rem;
  padding: 5px 12px;
}
.numinput:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(217, 164, 65, 0.16); }
.ngrid { gap: 9px; }
.nbtn {
  background: #ffffff;
  border: 1px solid var(--line);
  border-bottom: 1px solid var(--line-strong);
  border-radius: 11px;
  color: var(--forest-800);
  font-size: 1.08rem;
  padding: 8px 4px;
  box-shadow: var(--shadow-1);
  font-variant-numeric: tabular-nums;
  transition: background .15s, border-color .15s, transform .15s, box-shadow .15s;
}
.nbtn:hover { background: #f6fbf7; border-color: var(--gold-line); transform: translateY(-1px); box-shadow: var(--shadow-2); }
.nbtn.selected {
  background: linear-gradient(180deg, #f8d780, #e9ab38);
  border-color: var(--gold);
  border-bottom: 1px solid var(--gold);
  color: #3a2405;
  transform: none;
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 3px var(--gold-line), 0 10px 20px -16px rgba(168, 110, 22, 0.6);
}

/* ── result ── */
.formula { gap: 12px; margin-bottom: 22px; }
.pill {
  background: linear-gradient(180deg, #ffffff, #fffdf9);
  border: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 15px;
  padding: 14px 10px;
  box-shadow: var(--shadow-1);
}
.pill .k { color: var(--ink-3); font-size: .84rem; }
.pill .v { color: var(--forest-800); font-size: 2rem; font-variant-numeric: tabular-nums; }
.pill.hi {
  background: linear-gradient(180deg, #fffdf6, #fdf4e2);
  border-color: var(--gold-line);
  border-bottom-color: var(--gold-line);
  box-shadow: 0 0 0 1px #ffffff inset, 0 16px 30px -26px rgba(168, 110, 22, 0.5);
}
.pill.hi .v { color: var(--gold-deep); }
.srcline { color: var(--ink-2); }
.oracle {
  background:
    radial-gradient(500px 220px at 50% 0%, rgba(217, 164, 65, 0.1), transparent 70%),
    linear-gradient(180deg, #fffefb, #fdfaf2);
  border: 1px solid var(--gold-line);
  border-bottom: 1px solid var(--gold-line);
  border-radius: 24px;
  padding: 26px;
  box-shadow:
    inset 0 0 0 5px #fffdf8,
    inset 0 0 0 6px rgba(228, 205, 151, 0.5),
    0 30px 60px -50px rgba(10, 59, 43, 0.55);
}
.oracle-q { color: var(--forest-800); font-size: 1.28rem; }
.oracle-lead { color: var(--ink-2); font-size: 1rem; }
.shot {
  background: #ffffff;
  border: 1px solid var(--gold-line);
  border-radius: 15px;
  padding: 12px;
  box-shadow: 0 20px 40px -34px rgba(10, 59, 43, 0.5);
}
.shotmsg { color: var(--ink-2); }
#cropCanvas { border-radius: 5px; box-shadow: 0 0 0 1px #eadcbe; }
#pageCanvas { border-radius: 4px; box-shadow: 0 0 0 1px #d9b15c, 0 20px 50px -40px rgba(10, 59, 43, 0.5); }
.overlay .hl {
  border: 2px solid #d9661f;
  border-radius: 3px;
  background: rgba(251, 191, 36, 0.3);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.6), 0 0 14px rgba(217, 102, 31, 0.3);
}
.overlay .hl .tag { background: #c2571a; }
.overlay .hl.manual { border-color: #15803d; background: rgba(34, 197, 94, 0.2); box-shadow: 0 0 0 1px rgba(255, 255, 255, .6), 0 0 14px rgba(21, 128, 61, 0.35); }
.overlay .hl.manual .tag { background: #15803d; }
.drawhint { background: #f0faf3; border-color: #b7d8c4; color: var(--forest-700); }
.keepnote { color: var(--forest-700); }

/* ── advanced, modal, toast ── */
.adv {
  background: #fbfdf9;
  border: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 16px;
}
.adv summary { color: var(--forest-800); }
.advgrid .field, .advselpg .field { background: #ffffff; border-color: var(--line); border-radius: 10px; }
.adv input[type="number"], .handgrid input { background: #ffffff; border-color: var(--line-strong); border-radius: 8px; color: var(--ink); }
.handgrid { border-top: 1px dashed var(--line-strong); }
.modal { background: rgba(8, 35, 24, 0.42); }
.modal-card {
  background: var(--paper);
  border: 1px solid var(--gold-line);
  border-bottom: 1px solid var(--gold-line);
  border-radius: 22px;
  box-shadow: 0 40px 100px -50px rgba(6, 42, 29, 0.6);
}
.modal-card h2 { color: var(--forest-800); }
.modal-card input { background: #ffffff; border-color: var(--line-strong); border-radius: 9px; color: var(--ink); }
.toast {
  background: var(--paper);
  border: 1px solid var(--line);
  border-inline-start: 3px solid var(--gold);
  border-bottom: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  box-shadow: var(--shadow-2);
}
.toast.t-err { border-color: #f3c9c9; border-inline-start-color: #dc2626; background: #fff8f8; color: #991b1b; }

/* ── notes ── */
.note {
  color: var(--ink-2);
  background: #fbfdf9;
  border: 1px solid var(--line);
  border-inline-start: 3px solid #9ec9af;
  border-radius: 12px;
  padding: 9px 14px;
  font-size: .9rem;
  line-height: 1.95;
}
.note-ok { background: #f1faf4; color: #17553a; border-color: #d6ecdd; border-inline-start-color: #2f9e63; }
.note-info { background: #f6fbf7; color: var(--ink-2); border-color: var(--line); border-inline-start-color: #88bfa1; }
.note-warn { background: #fffbf0; color: #7c4a08; border-color: #f2e2bd; border-inline-start-color: #d9a441; }
.note-error { background: #fff7f7; color: #8f1d1d; border-color: #f1d2d2; border-inline-start-color: #c0392b; }
.note b { color: inherit; }

/* ── scrollbars ── */
* { scrollbar-width: thin; scrollbar-color: #c9dccf transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #c9dccf; border-radius: 99px; border: 3px solid #f8fbf4; }
::-webkit-scrollbar-thumb:hover { background: #a9c6b4; }
::-webkit-scrollbar-track { background: transparent; }

/* ── entrance motion ── */
@keyframes lgRise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.hero { animation: lgRise .5s var(--ease) both; }
.card:not(.hidden) { animation: lgRise .38s var(--ease) both; }

/* ── mobile refinement ── */
@media (max-width: 640px) {
  .app { padding: 14px 12px 48px; }
  .hero { padding: 24px 16px 22px; border-radius: 22px; margin-bottom: 26px; }
  .hero::before { inset: 6px; border-radius: 16px; }
  .hero::after { bottom: -11px; width: 22px; height: 22px; font-size: .6rem; }
  .bismillah { font-size: 1.38rem; line-height: 1.95; }
  .title { font-size: clamp(1.85rem, 8.5vw, 2.15rem); line-height: 1.85; }
  .title::after { width: 108px; margin-top: 6px; }
  .subtitle { font-size: .94rem; line-height: 1.95; margin-top: 8px; }
  .stepper { gap: 8px; }
  .tab { padding: 8px 8px 7px; border-radius: 13px; }
  .tab .num { font-size: .56rem; letter-spacing: .1em; }
  .tab .lbl { font-size: .88rem; }
  .card { padding: 18px; border-radius: 22px; }
  .card-head { padding-bottom: 12px; margin-bottom: 16px; }
  .card-title { font-size: 1.22rem; line-height: 1.85; }
  .protocol-tabs {
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    -webkit-mask-image: linear-gradient(to left, #000 0, #000 calc(100% - 20px), transparent 100%);
    mask-image: linear-gradient(to left, #000 0, #000 calc(100% - 20px), transparent 100%);
    padding: 5px; gap: 4px; border-radius: 13px; margin-bottom: 14px;
  }
  .protocol-tabs::-webkit-scrollbar { display: none; }
  .ptab { flex: none; scroll-snap-align: center; padding: 4px 9px; font-size: .86rem; border-radius: 9px; }
  .ptab .ptab-n { width: 20px; height: 20px; font-size: .64rem; }
  .note { font-size: .85rem; line-height: 1.9; padding: 8px 12px; }
  #downloadBtn { font-size: 1rem; line-height: 1.7; padding: 10px 14px; }
  .keepnote { font-size: .82rem; line-height: 1.9; }
  .ppanels .ppanel.proto-step, .ppanel { padding: 16px; border-radius: 16px; }
  .dua { padding: 16px 12px; border-radius: 15px; }
  .dua-ar.long { font-size: 1.1rem; line-height: 2.05; }
  .dua-tr.long { font-size: .74rem; }
  .dua-mean { font-size: .84rem; }
  .formula { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .pill { padding: 10px 5px; border-radius: 12px; }
  .pill .k { font-size: .74rem; line-height: 1.8; }
  .pill .v { font-size: 1.5rem; }
  .oracle { padding: 20px 12px; border-radius: 20px; }
  .shot { padding: 9px; }
  .loadbar { padding: 12px; border-radius: 14px; }
  .loadstat { font-size: .88rem; line-height: 1.9; }
  .loadbtns { width: 100%; gap: 8px; }
  .loadbtns .btn { flex: 1; font-size: .84rem; padding: 6px 10px; line-height: 1.6; }
  .loadbtns #installBtn { flex: 1 1 100%; }
  .loadbtns .apk-link { flex: 1 1 100%; }
}
@media (max-width: 380px) {
  .tab .lbl { font-size: .84rem; }
  .pill .k { font-size: .7rem; }
  .pill .v { font-size: 1.35rem; }
  .dua-ar.long { font-size: 1.04rem; }
  .ptab { font-size: .8rem; padding: 4px 6px; }
}
