/* Gold Data Program — بيانات ذهبية */
@font-face {
  font-family: "Amiri Quran";
  src: url("fonts/AmiriQuran-Regular.ttf") format("truetype");
  font-display: swap;
}
:root {
  --ink: #1f2a24;
  --ink-soft: #52605a;
  --bg: #f2f0ea;
  --panel: #ffffff;
  --line: #dcd8cc;
  --green: #146b4a;
  --green-dark: #0d4f36;
  --gold: #b98a2f;
  --gold-soft: #f4e9d2;
  --red: #b3372f;
  --red-soft: #fbe9e7;
  --amber: #9a6b00;
  --amber-soft: #fdf3d7;
  --violet: #5b4a8a;
  --violet-soft: #ece7f7;
  --cream: #fbf7ec;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(31, 42, 36, .08);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", "Noto Naskh Arabic", Tahoma, sans-serif;
  background: var(--bg); color: var(--ink);
  font-size: 16px; line-height: 1.55;
}
#app { max-width: 1180px; margin: 0 auto; padding: 14px 16px 70px; }

/* ---------- top bar ---------- */
header.topbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 4px 14px;
}
header.topbar[hidden] { display: none; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand h1 { margin: 0; font-size: inherit; line-height: 1; }
/* the product name «نَتْلُو»: the interface face, bold, with room above for its vowel marks
   (the Quranic face lifts marks far above display-size letters) */
button.brand-name { font-size: 26px; font-weight: 700; line-height: 1.5; color: var(--green-dark);
  padding: 0 6px; border: 0; border-radius: 8px; background: none; }
button.brand-name:hover { color: var(--green); }
button.brand-name:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.brand .sub { color: #7a5a17; font-size: 13px; font-weight: 600; }   /* 5.6:1 on the page — the lighter gold was 2.7:1 */
.topbar .spacer { flex: 1; }
[role="button"]:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--panel); border: 1px solid var(--line);
  padding: 4px 12px; border-radius: 999px; font-size: 13px; color: var(--ink-soft);
}
.chip b { color: var(--green-dark); }

/* ---------- generic ---------- */
.view { display: none; }
.view.active { display: block; animation: fadein .18s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; } }
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 20px; margin-bottom: 14px;
}
.card h2 { margin: 0 0 6px; font-size: 18px; color: var(--green-dark); }
.card h3 { margin: 14px 0 6px; font-size: 15.5px; }
.muted { color: var(--ink-soft); font-size: 13.5px; }
.small { font-size: 12.5px; }
.en { font-size: 12px; color: var(--ink-soft); direction: ltr; }
button {
  font-family: inherit; font-size: 15px; cursor: pointer;
  border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel); color: var(--ink); padding: 9px 18px;
  transition: all .15s;
}
button:hover { border-color: var(--green); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.primary { background: var(--green); border-color: var(--green); color: #fff; font-weight: 600; }
button.primary:hover { background: var(--green-dark); }
button.danger { background: var(--red-soft); border-color: #e2b1ac; color: var(--red); }
button.gold { background: var(--gold-soft); border-color: var(--gold); color: #7a5a17; font-weight: 600; }
button.big { font-size: 17px; padding: 13px 26px; }
input, select, textarea {
  font-family: inherit; font-size: 15px; color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 12px; background: #fff; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid #bcd9cc; border-color: var(--green); }
/* the 100% width above is for text fields: a checkbox stays a box beside its label */
input[type="checkbox"], input[type="radio"] { width: auto; padding: 0; margin: 0; margin-inline-end: 6px;
  vertical-align: middle; accent-color: var(--green); }
label.f { display: block; margin-bottom: 12px; }
label.f > span { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 4px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 18px; }
@media (max-width: 760px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.notice {
  border-radius: 10px; padding: 10px 14px; font-size: 13.5px; margin: 10px 0;
  background: var(--gold-soft); border: 1px solid #e3cf9c; color: #6b5316;
}
.notice.red { background: var(--red-soft); border-color: #e2b1ac; color: var(--red); }
.notice.green { background: #e5f2ec; border-color: #b9d9ca; color: var(--green-dark); }

/* ---------- badges ---------- */
.badge {
  display: inline-block; font-size: 11.5px; font-weight: 700;
  border-radius: 7px; padding: 1.5px 8px; vertical-align: middle;
}
.badge.jali { background: var(--red-soft); color: var(--red); }
.badge.khafi { background: var(--amber-soft); color: var(--amber); }
.badge.variant { background: var(--violet-soft); color: var(--violet); }
.badge.cls { background: #e8eef4; color: #33556e; font-weight: 600; }

/* ---------- home ---------- */
.home-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.action-card {
  background: var(--panel); border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 22px; cursor: pointer; box-shadow: var(--shadow); transition: all .15s;
}
.action-card:hover { border-color: var(--green); transform: translateY(-2px); }
.action-card .icon { font-size: 30px; }
.action-card h3 { margin: 8px 0 4px; color: var(--green-dark); }

/* ---------- surah / mode cards ---------- */
.pick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.pick {
  border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--panel);
  padding: 16px; text-align: center; cursor: pointer; transition: all .15s;
}
.pick:hover, .pick.sel { border-color: var(--green); background: #f0f7f3; }
.pick .ar { font-family: "Amiri Quran", serif; font-size: 30px; color: var(--green-dark); }
.pick .meta { font-size: 12.5px; color: var(--ink-soft); margin-top: 4px; }
.pick.mode .icon { font-size: 26px; }

/* ---------- mushaf ---------- */
.mushaf {
  background: var(--cream); border: 1px solid #e6dcc3; border-radius: var(--radius);
  padding: 26px 30px; box-shadow: inset 0 0 40px rgba(185, 138, 47, .06);
  direction: rtl;
}
.mushaf .basmalah {
  text-align: center; font-family: "Amiri Quran", serif; font-size: 26px;
  color: var(--green-dark); margin-bottom: 14px;
}
.mushaf .surah-title {
  text-align: center; font-family: "Amiri Quran", serif; font-size: 22px;
  color: var(--gold); border: 1.5px solid var(--gold); border-radius: 999px;
  width: fit-content; margin: 0 auto 14px; padding: 2px 34px; background: #fff9;
}
.mushaf .qtext {
  font-family: "Amiri Quran", serif; font-size: 34px; line-height: 2.35;
  text-align: justify; color: #23301f;
}
@media (max-width: 640px) { .mushaf .qtext { font-size: 27px; } .mushaf { padding: 18px; } }
.qword { position: relative; border-radius: 8px; padding: 0 2px; }
.qword.err-word { background: var(--red-soft); box-shadow: 0 2px 0 var(--red); }
.qword.err-word.khafi { background: var(--amber-soft); box-shadow: 0 2px 0 var(--amber); }
.qword.err-word.variant { background: var(--violet-soft); box-shadow: 0 2px 0 var(--violet); }
.ayah-block.err-ayah { background: var(--red-soft); border-radius: 10px; box-shadow: 0 2px 0 var(--red); }
.ayah-block.err-ayah.khafi { background: var(--amber-soft); box-shadow: 0 2px 0 var(--amber); }
.errnum {
  position: absolute; top: -13px; inset-inline-start: -7px;
  min-width: 21px; height: 21px; border-radius: 999px;
  background: var(--red); color: #fff; font-size: 12.5px; font-weight: 700;
  font-family: "Segoe UI", Tahoma, sans-serif;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 4px; box-shadow: 0 1px 4px rgba(0,0,0,.25); z-index: 2; line-height: 1;
}
.errnum.khafi { background: var(--amber); }
.errnum.variant { background: var(--violet); }
.errnum.inline {
  position: static; display: inline-flex;
  margin-inline-end: 5px; vertical-align: 8px;
  border: 1.5px solid #fff;
}
.ayah-mark {
  font-family: "Amiri Quran", serif; color: var(--gold); font-size: .85em;
  margin: 0 4px; user-select: none;
}
.surah-level-flags { margin-bottom: 10px; display: flex; gap: 8px; flex-wrap: wrap; direction: rtl; }
.surah-flag {
  background: var(--red-soft); border: 1px dashed var(--red); color: var(--red);
  border-radius: 999px; font-size: 13px; padding: 3px 12px; font-weight: 600;
}
.surah-flag.khafi { background: var(--amber-soft); border-color: var(--amber); color: var(--amber); }

/* ---------- plan builder ---------- */
.plan-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
@media (max-width: 980px) { .plan-layout { grid-template-columns: 1fr; } }
.errlist { max-height: 72vh; overflow-y: auto; padding-inline-end: 4px; }
.cls-group h4 {
  margin: 14px 0 6px; font-size: 13.5px; color: var(--ink-soft);
  border-bottom: 1px solid var(--line); padding-bottom: 3px;
}
.err-item {
  display: flex; gap: 10px; align-items: flex-start;
  border: 1.5px solid var(--line); border-radius: 12px; background: var(--panel);
  padding: 10px 12px; margin-bottom: 8px; cursor: pointer; transition: all .12s;
}
.err-item:hover { border-color: var(--green); }
.err-item.sel { border-color: var(--green); background: #f0f7f3; }
.err-item.probe.sel { border-color: var(--violet); background: var(--violet-soft); }
.err-item input[type=checkbox] { width: 18px; height: 18px; margin-top: 4px; accent-color: var(--green); }
.err-item .forms { font-family: "Amiri Quran", serif; font-size: 21px; margin: 2px 0; }
.err-item .forms .ok { color: var(--green-dark); }
.err-item .forms .bad { color: var(--red); }
.err-item .forms .arrow { color: var(--ink-soft); font-size: 15px; margin: 0 7px; }
.err-item .ttl { font-weight: 700; font-size: 14.5px; }
.err-item .how { font-size: 13px; color: var(--ink-soft); }
.plan-count {
  position: sticky; top: 0; z-index: 3; background: var(--panel);
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px;
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px; box-shadow: var(--shadow);
}
.plan-count b { font-size: 18px; color: var(--green-dark); }

/* ---------- record view ---------- */
.rec-layout { display: grid; grid-template-columns: 1.35fr 1fr; gap: 14px; align-items: start; }
@media (max-width: 980px) { .rec-layout { grid-template-columns: 1fr; } }
.guide-item {
  border-inline-start: 4px solid var(--red); background: var(--panel);
  border-radius: 10px; box-shadow: var(--shadow); padding: 10px 14px; margin-bottom: 9px;
}
.guide-item.khafi { border-inline-start-color: var(--amber); }
.guide-item.variant { border-inline-start-color: var(--violet); }
.guide-item .num {
  display: inline-flex; min-width: 22px; height: 22px; border-radius: 999px;
  background: var(--red); color: #fff; font-weight: 700; font-size: 13px;
  align-items: center; justify-content: center; margin-inline-end: 8px;
}
.guide-item.khafi .num { background: var(--amber); }
.guide-item.variant .num { background: var(--violet); }
.guide-item .forms { font-family: "Amiri Quran", serif; font-size: 22px; }
.guide-item .forms .ok { color: var(--green-dark); }
.guide-item .forms .bad { color: var(--red); }
.guide-item .how { font-size: 13.5px; color: var(--ink-soft); margin-top: 2px; }
.guide-item .meaning { font-size: 12.5px; color: var(--red); margin-top: 2px; }

.recorder {
  position: sticky; bottom: 0; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 18px; margin-top: 14px;
}
@media (max-width: 980px) {
  /* single-column: keep the controls reachable while reading the guide below */
  .recorder { position: fixed; inset-inline: 8px; bottom: 8px; z-index: 20;
              box-shadow: 0 -4px 24px rgba(31,42,36,.25); }
  .rec-layout { padding-bottom: 230px; }
  .recorder #rec-after { max-height: 40vh; overflow-y: auto; }
  .tempo-card { margin-bottom: 240px; }   /* clear the fixed recorder */
}
.recorder .row { justify-content: center; }
#vu { width: 100%; height: 42px; background: #10241b; border-radius: 8px; }
.rec-btn {
  width: 74px; height: 74px; border-radius: 999px; border: 3px solid var(--red);
  background: #fff; color: var(--red); font-size: 26px; font-weight: 700;
}
.rec-btn.recording { background: var(--red); color: #fff; animation: pulse 1.2s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(179,55,47,.4);} 50% { box-shadow: 0 0 0 14px rgba(179,55,47,0);} }
.timer { font-size: 26px; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink); min-width: 90px; text-align: center; }

/* ---------- review ---------- */
.sess-row {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
  padding: 10px 16px; margin-bottom: 8px; cursor: pointer;
}
.sess-row:hover { border-color: var(--green); }
.take-card { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); padding: 14px 16px; margin-bottom: 12px; }
.take-card audio { width: 100%; margin: 8px 0; }
.outcome-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.outcome-row .forms { font-family: "Amiri Quran", serif; font-size: 19px; }
.outcome-row select { width: auto; }
.status-pill { font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 10px; }
.status-pill.kept { background: #e5f2ec; color: var(--green-dark); }
.status-pill.recorded { background: var(--amber-soft); color: var(--amber); }
.status-pill.discarded { background: #eee; color: #777; }

/* ---------- progress ---------- */
.gauge { margin-bottom: 12px; }
.gauge .bar { height: 14px; background: #e7e4da; border-radius: 999px; overflow: hidden; }
.gauge .fill { height: 100%; background: linear-gradient(90deg, var(--green), #2fa273); border-radius: 999px; }
.gauge .lbl { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 3px; }
table.cov { border-collapse: collapse; width: 100%; font-size: 14px; }
table.cov th, table.cov td { border: 1px solid var(--line); padding: 6px 10px; text-align: center; }
table.cov th { background: #f2efe6; }

.chips-wrap { display: inline-flex; gap: 4px; flex-wrap: wrap; max-width: 46%; }
.filter-bar { background: #f5f2ea; border: 1px solid var(--line); border-radius: 10px;
              padding: 8px 12px; margin-bottom: 10px; gap: 8px; }
.filter-bar select { width: auto; padding: 6px 10px; font-size: 13.5px; }
.note-flag { font-size: 13px; cursor: help; }
/* plan monitor */
.monitor { border-width: 2px; transition: background .2s, border-color .2s; }
.monitor.idle { border-style: dashed; }
.monitor.good { border-color: #b9d9ca; background: #f3faf6; }
.monitor.warn { border-color: #e3cf9c; background: #fffbf0; }
.monitor.bad { border-color: #e2b1ac; background: #fdf3f2; }
.mon-head { font-weight: 800; font-size: 15.5px; margin-bottom: 4px; }
.monitor.good .mon-head { color: var(--green-dark); }
.monitor.warn .mon-head { color: #7a5a17; }
.monitor.bad .mon-head { color: var(--red); }
.mon-item { background: #fff; border: 1px solid var(--line); border-inline-start: 4px solid var(--line);
            border-radius: 10px; padding: 8px 12px; margin-top: 8px; }
.mon-item.conflict { border-inline-start-color: var(--red); }
.mon-item.duplicate { border-inline-start-color: var(--violet); }
.mon-item.caution { border-inline-start-color: var(--amber); }
.mon-item.combined { border-inline-start-color: var(--green); }
.mon-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.mon-sev { font-weight: 700; }
.mon-pair { background: #e8eef4; color: #33556e; border-radius: 999px; padding: 0 10px; font-weight: 700; }
.mon-where { color: var(--ink-soft); font-family: "Amiri Quran", serif; font-size: 17px; }
.mon-msg { font-size: 13.5px; margin-top: 3px; line-height: 1.75; }
.mon-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.q-inline { font-family: "Amiri Quran", serif; font-size: 21px; color: var(--green-dark); font-weight: normal; }
.mon-pill { padding: 3px 10px; font-weight: 700; }
.mon-pill.good { color: var(--green-dark); border-color: #b9d9ca; }
.mon-pill.warn { color: #7a5a17; border-color: #e3cf9c; }
.mon-pill.bad { color: var(--red); border-color: #e2b1ac; background: var(--red-soft); }
.cand-hint { font-size: 12.5px; margin-top: 4px; font-weight: 700; }
.cand-hint.conflict { color: var(--red); }
.cand-hint.dup { color: var(--violet); }
.err-item.cand-conflict { border-style: dashed; opacity: .78; }
.plan-row { border-bottom: 1px dashed var(--line); padding: 4px 6px; border-radius: 8px; }
.plan-row-conflict { background: var(--red-soft); }
.flag { font-size: 14px; cursor: help; }
.qword.site-conflict { outline: 2px dashed var(--red); outline-offset: 3px; animation: monPulse 1.6s ease-in-out infinite; }
.ayah-block.site-conflict { outline: 2px dashed var(--red); outline-offset: 4px; border-radius: 10px; }
.qword.site-combined { box-shadow: 0 3px 0 var(--green) !important; }
@keyframes monPulse { 0%, 100% { outline-color: var(--red); } 50% { outline-color: transparent; } }
.link-btn { background: transparent; border: none; color: var(--red); text-decoration: underline; }
.link-btn:hover { border: none; }
.link-btn.quiet { color: var(--ink-soft); }
.guide-item.combined-guide { border-inline-start-color: var(--green); background: #f3faf6; }

/* custom error: checked before it is added */
div.f { margin-bottom: 12px; }
.f-label-row { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 13.5px; font-weight: 600; margin-bottom: 4px; }
.seed-btn { background: transparent; border: 1px dashed #b9d9ca; color: var(--green-dark);
  padding: 1px 9px; font-size: 12px; border-radius: 999px; font-weight: 600; }
.seed-btn:hover { background: #f0f7f3; }
input.q-input { font-family: "Amiri Quran", "Segoe UI", serif; font-size: 21px; padding: 5px 12px; line-height: 1.9; }
.draft-check { border: 2px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 2px 0 12px;
  background: #fff; transition: background .2s, border-color .2s, opacity .2s; }
.draft-check.idle { border-style: dashed; background: var(--cream); }
.draft-check.good { border-color: #b9d9ca; background: #f3faf6; }
.draft-check.warn { border-color: #e3cf9c; background: #fffbf0; }
.draft-check.dup { border-color: #cbbfe6; background: #f6f3fc; }
.draft-check.bad { border-color: #e2b1ac; background: #fdf3f2; }
.draft-check.stale > :not(.dc-head) { opacity: .55; }
.draft-check.flash { animation: dcFlash .9s ease-in-out 2; }
@keyframes dcFlash { 50% { box-shadow: 0 0 0 5px rgba(179, 55, 47, .18); } }
.dc-head { font-weight: 800; font-size: 14.5px; }
.draft-check.good .dc-head { color: var(--green-dark); }
.draft-check.warn .dc-head { color: #7a5a17; }
.draft-check.dup .dc-head { color: var(--violet); }
.draft-check.bad .dc-head { color: var(--red); }
.dc-msg { font-size: 13.5px; line-height: 1.8; margin-top: 2px; }
.dc-tip { font-size: 12.5px; color: var(--ink-soft); margin-top: 4px; }
.dc-reading { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.dc-reading .muted.small { flex-basis: 100%; }
.dc-chip { background: #e8eef4; color: #33556e; border-radius: 999px; padding: 1px 10px; font-size: 12.5px; font-weight: 600; }
.mon-item.hint { border-inline-start-color: var(--gold); background: #fffdf6; }
.mon-item.catalog { border-inline-start-color: var(--green); background: #f6fbf8; }
.qword[data-a] { cursor: default; }
#plan-mushaf .qword[data-a] { cursor: pointer; border-radius: 6px; }
#plan-mushaf .qword[data-a]:hover { background: rgba(185, 138, 47, .12); }
.qword.site-draft { outline: 2px dotted var(--gold); outline-offset: 3px; background: var(--gold-soft); border-radius: 6px; }
.ayah-block.site-draft { outline: 2px dotted var(--gold); outline-offset: 4px; border-radius: 10px; }

/* catalog manager */
.cat-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.cat-tab { display: inline-flex; align-items: center; gap: 8px; }
.cat-tab.on { border-color: var(--green); background: #f0f7f3; font-weight: 700; }
.pend-dot { background: var(--red); color: #fff; border-radius: 999px; font-size: 11.5px;
            padding: 0 7px; min-width: 20px; text-align: center; font-weight: 700; }
.badge.added { background: #e3eefb; color: #1d4f82; }
.badge.new { background: var(--gold); color: #fff; }
.new-badge { display: inline-block; background: var(--gold); color: #fff; border-radius: 999px;
             font-size: 12px; font-weight: 700; padding: 1px 10px; vertical-align: middle;
             font-family: "Segoe UI", Tahoma, sans-serif; }
.guide-added { border-color: #e3cf9c; background: #fffbf0; }
.proposal-row { display: flex; gap: 12px; flex-wrap: wrap; border: 1px solid var(--line);
                border-radius: 12px; padding: 10px 14px; margin-bottom: 8px; background: var(--panel); }
.proposal-row .forms { font-family: "Amiri Quran", serif; font-size: 20px; margin: 2px 0; }
.proposal-row .forms .ok { color: var(--green-dark); }
.proposal-row .forms .bad { color: var(--red); }
.proposal-row .how { font-size: 13px; color: var(--ink-soft); }
.proposal-row.added, .proposal-row.dismissed, .proposal-row.inactive { opacity: .6; }
.picker { padding: 16px 18px; }
.picker .qtext { font-size: 27px; line-height: 2.2; }
.picker .pick-w, .picker .pick-a { cursor: pointer; transition: background .12s, color .12s; }
.picker .pick-w:hover { background: #e3f1ea; }
.picker .pick-a:hover, .picker .pick-a.picked { color: var(--red); }
.picker.dim .qtext { opacity: .4; }
.site-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--red-soft);
             color: var(--red); border-radius: 999px; padding: 2px 4px 2px 10px; font-size: 13px; }
.site-chip button { padding: 0 8px; border-radius: 999px; line-height: 1.5; }
.sess-row.empty-sess { opacity: .62; border-style: dashed; }
.sess-row.empty-sess:hover { opacity: 1; }
.seg-box { border: 1px dashed var(--line); border-radius: 10px; padding: 6px 12px; margin: 8px 0; }
.seg-box summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--green-dark); }
.seg-box audio { margin: 0; }
.assign-wrap select { padding: 4px 8px; font-size: 13px; }
@page { size: A4; margin: 10mm; }
@media print {
  .no-print, header.topbar, footer, #toast { display: none !important; }
  .view { display: none; }
  #view-guide.active, #view-consent.active { display: block; }
  .card, .guide-item { box-shadow: none; break-inside: avoid; }
  .consent-copy { break-inside: auto; }
  body { background: #fff; }
}
/* the consent copy, headed by the company that issues it */
.doc-letterhead { display: flex; align-items: center; justify-content: space-between; gap: 12px 18px; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--line); border-bottom: 3px solid var(--green-dark);
  border-radius: var(--radius); padding: 14px 18px; margin-bottom: 14px; }
.doc-letterhead img { height: 44px; width: auto; }
.doc-issuer { display: flex; flex-direction: column; gap: 2px; }
.doc-issuer b { font-size: 16px; }
.doc-issuer span { font-size: 13px; color: var(--ink-soft); }
.doc-close { text-align: center; color: var(--ink-soft); font-size: 12.5px; line-height: 1.8; margin: 6px 0 0; }
/* the guardian's paper form: text, its English version, then spaces to write and sign in */
.guardian-form h4 { margin: 14px 0 4px; font-size: 15px; color: var(--green-dark); }
.guardian-form p, .guardian-form ul { margin: 4px 0; line-height: 1.9; }
.guardian-form ul { padding-inline-start: 22px; }
.guardian-en { margin-top: 18px; padding-top: 10px; border-top: 1px dashed #e3cf9c; }
.sign-table { width: 100%; border-collapse: collapse; margin-top: 20px; font-size: 14px; break-inside: avoid; }
.sign-table caption { caption-side: top; text-align: start; font-weight: 700; padding-bottom: 6px; }
.sign-table th, .sign-table td { border: 1px solid #52605a; padding: 6px 10px; vertical-align: middle; }
.sign-table th { width: 40%; text-align: start; font-weight: 600; }
.sign-table th span { display: block; font-size: 11.5px; font-weight: 400; color: var(--ink-soft); }
.sign-table td { height: 13mm; }
.sign-table .sign-sign td { height: 22mm; }
.sign-option { display: inline-flex; align-items: center; gap: 6px; margin: 2px 0; margin-inline-end: 18px; }
.sign-box { display: inline-block; flex: none; width: 4.5mm; height: 4.5mm; border: 1.5px solid var(--ink); }
.sign-en { display: block; font-size: 11.5px; color: var(--ink-soft); }
@media print {                                   /* after the screen rules, so paper gets a plain letterhead */
  .doc-letterhead { border: 0; border-bottom: 2px solid #0d4f36; border-radius: 0; padding: 0 0 8px; }
  .doc-letterhead img { height: 40px; }
}
/* ---------- printed documents: the A4 sheets buildDocPages lays out ----------
   A sheet is a fixed box a little smaller than A4, printed on a page without margins: the letterhead at
   its head; the title, page count, contact and copyright at its foot; the document between. The slack keeps a sheet on its page even
   when a printer or the dialog adds a few millimetres of margin. These rules are the same on screen,
   where the sheets are measured, and on paper, so nothing here may depend on the medium. */
#doc-pages { display: none; }
#doc-pages.measuring { display: block; position: fixed; top: 0; left: 0; visibility: hidden; pointer-events: none; }
.doc-sheet { box-sizing: border-box; width: 200mm; height: 284mm; margin: 0 auto; padding: 10mm 11mm 6mm;
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; background: #fff; color: var(--ink);
  font-size: 14.5px; -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  -webkit-print-color-adjust: exact; print-color-adjust: exact; break-after: page; }
.doc-sheet:last-child { break-after: auto; }
.doc-sheet .doc-letterhead { flex-wrap: nowrap; background: none; border: 0; border-bottom: 2px solid var(--green-dark); border-radius: 0;
  padding: 0 0 2.5mm; margin: 0 0 5mm; }
.doc-sheet .doc-letterhead img { height: 10.5mm; }
.doc-sheet .doc-issuer b { font-size: 15px; }
.doc-sheet .doc-issuer span { font-size: 12px; }
.dp-body { position: relative; min-height: 0; }   /* not clipped: a line a pixel long lands in the gap above the foot */
.dp-body > :first-child, .dp-cont > :first-child { margin-top: 0; }
.dp-foot { margin-top: 3mm; padding-top: 2mm; border-top: 1px solid var(--line); font-size: 11px; line-height: 1.5; color: var(--ink-soft); }
.dp-foot-row { display: flex; align-items: baseline; justify-content: space-between; gap: 6mm; }
.dp-num { display: flex; gap: 3mm; white-space: nowrap; }
.dp-close { margin-top: 0.6mm; font-size: 10px; text-align: center; }
/* the document's own blocks as paper: no card chrome, nothing scrolls */
.doc-sheet .card { background: none; border: 0; border-radius: 0; box-shadow: none; padding: 0; margin: 0 0 7mm; }
.doc-sheet .table-wrap { max-height: none; overflow: visible; border-radius: 0; }
.doc-sheet .consent-meta { table-layout: fixed; }                  /* a table split over sheets keeps its columns */
.doc-sheet .consent-meta th { width: 30%; white-space: normal; }
.doc-sheet .guide-item { box-shadow: none; }
.doc-sheet .dp-cont.guardian-en, .doc-sheet .dp-cont.consent-text-en { border-top: 0; padding-top: 0; }
@media print {
  body.doc-print { background: #fff; }
  body.doc-print #app, body.doc-print #toast, body.doc-print dialog, body.doc-print #print-area { display: none !important; }
  body.doc-print #doc-pages { display: block; }
}

/* ---------- electronic consent ---------- */
.consent-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin: 10px 0; background: #fff; }
.consent-card.done { background: #e5f2ec; border-color: #b9d9ca; color: var(--green-dark); }
.consent-card.declined { background: var(--gold-soft); border-color: #e3cf9c; color: #6b5316; }
.consent-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.consent-doc { max-height: min(60vh, 540px); overflow: auto; padding: 4px 16px 12px; border: 1px solid #e6dcc3; border-radius: 10px;
  background: var(--cream); line-height: 1.9; font-size: 15px; overscroll-behavior: contain; }
.consent-doc:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.consent-doc h3 { margin: 12px 0 2px; font-size: 17px; color: var(--green-dark); }
.consent-doc h4 { margin: 14px 0 4px; font-size: 15px; color: var(--green-dark); }
.consent-doc p, .consent-doc ul { margin: 4px 0; }
.consent-doc ul { padding-inline-start: 22px; }
.consent-doc details { margin-top: 16px; border-top: 1px dashed #e3cf9c; padding-top: 8px; text-align: left; }
.consent-doc summary { cursor: pointer; font-weight: 600; color: var(--ink-soft); }
.consent-declaration { font-weight: 600; }
.consent-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.consent-actions button { flex: 1 1 200px; min-height: 46px; }
.consent-msg { margin: 8px 0 0; color: var(--red); }
.consent-copy h2 { font-size: 18px; }
.consent-meta { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.consent-meta th { text-align: start; white-space: nowrap; padding: 6px 8px; color: var(--ink-soft); font-weight: 600; vertical-align: top; width: 1%; }
.consent-meta td { padding: 6px 8px; overflow-wrap: anywhere; }
.consent-meta tr + tr > * { border-top: 1px solid var(--line); }
.consent-copy .table-wrap { max-height: none; }
.consent-text { background: var(--cream); border: 1px solid #e6dcc3; border-radius: 10px;
  padding: 4px 16px 12px; line-height: 1.9; font-size: 14px; overflow-wrap: anywhere; }
.consent-text h4 { margin: 12px 0 2px; font-size: 14.5px; color: var(--green-dark); }
.consent-text p, .consent-text ul { margin: 2px 0; }
.consent-text ul { padding-inline-start: 22px; }
.consent-text-en { margin-top: 14px; padding-top: 8px; border-top: 1px dashed #e3cf9c; }
.consent-meta code { font-size: 12px; overflow-wrap: anywhere; }
.consent-card.done .link-btn { color: var(--green-dark); }
.consent-end { display: block; height: 1px; }
@media (max-width: 520px) {
  .consent-doc { padding: 2px 12px 10px; font-size: 14.5px; }
  .consent-meta th { white-space: normal; width: 36%; }
}

/* login */
.login-box { max-width: 420px; margin: 10vh auto; text-align: center; }
.login-brand { margin: 0; font-size: 52px; font-weight: 700; line-height: 1.6; color: var(--green-dark); }
.login-sub { margin: 0 0 12px; font-size: 16px; font-weight: 600; color: var(--ink-soft); }
#toast {
  position: fixed; bottom: 18px; inset-inline-start: 50%; transform: translateX(50%);
  background: var(--ink); color: #fff; border-radius: 10px; padding: 10px 22px;
  font-size: 14.5px; opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 99;
}
#toast.show { opacity: .96; }
/* footer: data provenance, then the company that makes the platform */
footer { text-align: center; color: var(--ink-soft); font-size: 12px; margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line); }
footer p { margin: 0; text-wrap: balance; }
.footer-note { margin-bottom: 18px; }
.footer-logo { display: block; width: auto; height: 36px; margin: 0 auto 10px; }
.footer-brand p { font-size: 12.5px; line-height: 1.7; }

/* custom error → catalog */
.catalog-opt { display: flex; gap: 8px; align-items: flex-start; background: #f6fbf8; border: 1px solid #cfe5da;
  border-radius: 10px; padding: 8px 10px; margin: 0 0 10px; cursor: pointer; font-size: 13.5px; }
.catalog-opt[hidden] { display: none; }
.catalog-opt input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--green); flex: none; }
.catalog-opt b { color: var(--green-dark); }

/* ---------- tempo analysis (تحليل الإيقاع / الحدر) ---------- */
.badge.hadr { background: #e5f2ec; color: var(--green-dark); }
.tp {
  --tp-accent: #146b4a; --tp-grid: #e8e5dc; --tp-base: #cfcabb;
  --tp-b1: #7fb99c; --tp-b2: #4a9a75; --tp-b3: #237b57; --tp-b4: #0d5238;   /* ordinal ramp, validated */
}
.tempo-card h2 { margin-bottom: 10px; }
.tp-head { display: flex; gap: 18px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; }
.tp-head .k-label, .tp-kpi .k-label { font-size: 12.5px; color: var(--ink-soft); }
.tp-hero { display: flex; align-items: baseline; gap: 8px; }
.tp-hero-num { font-size: 60px; font-weight: 700; line-height: 1.05; color: var(--ink); }
.tp-hero-unit { font-size: 16px; color: var(--ink-soft); }
.tp-deltas { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--ink-soft); }
.tp-head-side { flex: 1; min-width: 240px; max-width: 520px; }
.tp-verdict { border-radius: 10px; padding: 9px 13px; font-size: 14px; line-height: 1.7; border: 1px solid var(--line); }
.tp-verdict.reached { background: #e5f2ec; border-color: #b9d9ca; color: var(--green-dark); }
.tp-verdict.short { background: var(--amber-soft); border-color: #e3cf9c; color: #6b5316; }
.tp-verdict.neutral { background: #f7f5ef; color: var(--ink); }
/* pace gauge */
.tp-gauge { position: relative; margin: 38px 0 34px; }
.tp-track { display: flex; gap: 2px; height: 12px; }
.tp-band { position: relative; height: 100%; min-width: 4px; cursor: help; }
.tp-band.b1 { background: var(--tp-b1); border-start-start-radius: 6px; border-end-start-radius: 6px; }
.tp-band.b2 { background: var(--tp-b2); }
.tp-band.b3 { background: var(--tp-b3); }
.tp-band.b4 { background: var(--tp-b4); border-start-end-radius: 6px; border-end-end-radius: 6px; }
.tp-band-lbl { position: absolute; top: 16px; inset-inline-start: 4px; font-size: 12px; color: var(--ink-soft); white-space: nowrap; }
.tp-marker { position: absolute; top: 6px; width: 24px; height: 24px; margin-inline-start: -12px; transform: translateY(-50%); cursor: help; }
.tp-marker::before { content: ""; position: absolute; inset: 5px; border-radius: 999px; }
.tp-marker.me::before { background: var(--ink); box-shadow: 0 0 0 2px #fff; }
.tp-marker.ref::before { inset: 7px; background: #fff; border: 2px solid var(--ink-soft); }
.tp-marker-lbl { position: absolute; bottom: 22px; inset-inline-start: 50%; transform: translateX(50%);
  font-size: 12.5px; white-space: nowrap; color: var(--ink); font-weight: 700; }
.tp-marker.ref .tp-marker-lbl { bottom: auto; top: 40px; font-weight: 400; color: var(--ink-soft); }
/* KPI tiles */
.tp-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 10px; margin: 8px 0 16px; }
.tp-kpi { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fff; }
.tp-kpi .k-value { font-size: 26px; font-weight: 700; line-height: 1.25; color: var(--ink); }
.tp-kpi .k-unit { font-size: 12.5px; font-weight: 400; color: var(--ink-soft); margin-inline-start: 4px; }
.tp-kpi .k-sub { font-size: 12px; color: var(--ink-soft); }
.tp-h { margin: 14px 0 6px; font-size: 15px; }
/* timeline: tempo curve over the ayah strip, time right → left */
.tp-timeline-wrap { position: relative; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px 6px; background: #fff; }
.tp-curve-box { position: relative; height: 64px; }
.tp-curve { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.tp-line { fill: none; stroke: var(--tp-accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.tp-area { fill: var(--tp-accent); opacity: .1; }
.tp-ref-line { stroke: var(--tp-base); stroke-width: 1; }
.tp-ref-lbl { position: absolute; inset-inline-end: 0; transform: translateY(-110%); font-size: 11.5px; color: var(--ink-soft); background: #fffc; padding: 0 4px; }
.tp-ref-lbl.below { transform: translateY(10%); }
.tp-crosshair { position: absolute; top: 0; bottom: -34px; width: 1px; background: var(--ink-soft); pointer-events: none; }
.tp-strip { position: relative; height: 26px; margin-top: 6px; border-bottom: 1px solid var(--tp-grid); }
.tp-ayah { position: absolute; top: 2px; height: 20px; background: var(--tp-accent); border-radius: 4px; cursor: pointer;
  color: #fff; font-size: 12px; display: flex; align-items: center; justify-content: center; overflow: visible; }
.tp-ayah:hover, .tp-ayah:focus-visible { background: var(--green-dark); outline: 2px solid var(--gold-soft); }
.tp-playhead { position: absolute; top: -6px; bottom: -4px; width: 2px; margin-inline-start: -1px; background: var(--red); pointer-events: none; }
.tp-marks { position: relative; height: 26px; }
.tp-stop, .tp-join { position: absolute; top: 1px; width: 24px; height: 24px; margin-inline-start: -12px; padding: 0;
  border: none; background: transparent; font-size: 13px; line-height: 24px; text-align: center; cursor: pointer; border-radius: 6px; }
.tp-stop.mid { color: var(--amber); font-weight: 700; }
.tp-stop:hover, .tp-join:hover, .tp-stop:focus-visible, .tp-join:focus-visible { background: #f2efe6; }
.tp-axis { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--ink-soft); direction: rtl; }
/* per-ayah columns */
.tp-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 18px; }
@media (max-width: 760px) { .tp-grid { grid-template-columns: 1fr; } }
.tp-bars { position: relative; display: flex; align-items: stretch; gap: 2px; height: 150px; padding-top: 16px;
  padding-inline-end: 74px; border-bottom: 1px solid var(--tp-base); }
.tp-bars-ref { position: absolute; inset-inline: 0; border-top: 1px solid var(--tp-base); pointer-events: none; }
.tp-bars-ref span { position: absolute; inset-inline-end: 0; top: -9px; width: 72px; font-size: 11.5px; line-height: 16px; color: var(--ink-soft); text-align: end; background: #fff; }
.tp-col { flex: 1; display: flex; flex-direction: column; align-items: center; min-width: 24px; cursor: pointer; border-radius: 6px; }
.tp-col:hover, .tp-col:focus-visible { background: #f6f4ee; outline: none; }
.tp-col-plot { position: relative; flex: 1; width: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.tp-col-bar { width: min(24px, 70%); background: var(--tp-accent); border-radius: 4px 4px 0 0; min-height: 2px; }
.tp-col-val { font-size: 12px; color: var(--ink); font-weight: 700; margin-bottom: 2px; }
.tp-col-lbl { height: 22px; line-height: 22px; font-size: 12px; color: var(--ink-soft); }
.tp-facts { margin: 0; padding-inline-start: 0; list-style: none; font-size: 14px; line-height: 1.9; }
.tp-mids { border: 1px solid #e3cf9c; background: var(--amber-soft); border-radius: 10px; padding: 8px 10px; margin-top: 8px; }
.tp-list { display: flex; flex-direction: column; gap: 4px; }
.tp-list-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tp-list-row button, .tp-facts button { padding: 2px 10px; }
.tp-table { margin-top: 12px; }
.tp-table summary { cursor: pointer; font-size: 13.5px; color: var(--ink-soft); }
.tp-table table { margin-top: 8px; font-variant-numeric: tabular-nums; }
.tp-method { margin-top: 12px; line-height: 1.8; }
.tp-tip { position: fixed; z-index: 60; max-width: 280px; background: var(--ink); color: #fff; border-radius: 8px;
  padding: 6px 10px; font-size: 12.5px; line-height: 1.6; white-space: pre-line; pointer-events: none;
  box-shadow: 0 4px 14px rgba(0,0,0,.2); }
.tp-tip::first-line { font-weight: 700; font-size: 14px; }
.tp-strip-line { margin-top: 8px; font-size: 14px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: center; }
.tp-strip-line b { font-size: 20px; }
.tp-chip { font-size: 12.5px; border-radius: 999px; padding: 2px 10px; background: #f2efe6; color: var(--ink); }
.tp-chip.fast { background: #e5f2ec; color: var(--green-dark); }
.tp-details { margin: 6px 0; }
.tp-details > summary { cursor: pointer; font-size: 14px; font-weight: 700; color: var(--green-dark); }
.tp-details .tp { margin-top: 8px; }

/* ---------- reciter ↔ supervisor ---------- */
.link-sup { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-soft); }
.link-sup select { width: auto; padding: 3px 8px; font-size: 13px; }
.inbox { border-inline-start: 4px solid var(--line); }
.inbox.due { border-inline-start-color: var(--green); }
.inbox-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.inbox-row:last-child { border-bottom: none; }
.inbox-row.due b:first-child { color: var(--green-dark); }

/* ---------- bulk codes, batches, reciter name ---------- */
.code-field { display: flex; gap: 6px; align-items: center; }
.code-field input { flex: 1; letter-spacing: .06em; }
.code-eye { padding: 8px 12px; }
.pending-name { color: var(--ink-soft); font-style: italic; }
.batch-row { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; background: #fff; }
.batch-main { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.batch-meter { height: 6px; border-radius: 999px; background: #e5f2ec; margin: 8px 0 6px; overflow: hidden; }
.batch-meter .fill { height: 100%; background: var(--green); border-radius: 999px; }
.batch-stats { display: flex; gap: 6px 16px; flex-wrap: wrap; color: var(--ink-soft); }
.batch-stats b { color: var(--ink); }
.batch-actions { margin-top: 6px; }
.bulk-result { margin-top: 12px; }
.table-wrap { max-height: 360px; overflow: auto; border-radius: 8px; }
.codes-table code { font-size: 15px; letter-spacing: .04em; }
/* ---------- phones and touch ---------- */
@media (pointer: coarse), (max-width: 480px) {
  /* controls tall enough for a finger (WCAG 2.2's floor is 24 px; ~40 px is comfortable) */
  button, select, input:not([type="checkbox"]):not([type="radio"]) { min-height: 40px; }
  button.small, select.small, .link-btn { min-height: 36px; }
  input[type="checkbox"], input[type="radio"], .err-item input[type=checkbox] { width: 20px; height: 20px; }
  .kbd-hint { display: none; }                   /* the space-bar shortcut means nothing on a touch screen */
}
@media (max-width: 560px) {
  /* header: the name and «خروج» on the first line, the account and session chips below */
  header.topbar { gap: 8px 10px; padding: 6px 2px 10px; }
  .topbar .brand { flex: 1 1 auto; min-width: 0; gap: 8px; }
  .topbar .spacer { display: none; }
  #btn-logout { order: 1; }
  .topbar .chip { order: 2; max-width: 100%; min-width: 0; }
  .topbar .chip b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* home cards: icon beside the title instead of tall tiles */
  .home-actions { gap: 10px; }
  .action-card { display: grid; grid-template-columns: auto 1fr; column-gap: 14px; align-items: center; padding: 14px 16px; }
  .action-card .icon { grid-row: 1 / span 2; font-size: 28px; }
  .action-card h3 { margin: 0 0 2px; font-size: 16px; }
  .card { padding: 16px 14px; }
  /* the pinned recorder leaves more of the muṣḥaf in view */
  .recorder { padding: 10px 12px; }
  #vu { height: 30px; }
  .rec-btn { width: 62px; height: 62px; font-size: 22px; }
  .timer { font-size: 22px; min-width: 70px; }
  .recorder .rec-note { font-size: 11.5px; line-height: 1.5; }
  .rec-layout { padding-bottom: 190px; }
  /* new codes: one readable card per code instead of a squeezed table */
  .codes-table, .codes-table tbody { display: block; }
  .codes-table tr:first-child { display: none; }
  .codes-table tr { display: grid; grid-template-columns: 2.2em auto 1fr; grid-template-areas: "n name name" "n code code" "n link img";
    gap: 4px 10px; align-items: center; padding: 10px 6px; border-bottom: 1px solid var(--line); }
  table.codes-table td { display: block; border: 0; padding: 0; background: none; text-align: start; }   /* beats table.cov td */
  .codes-table td:nth-child(1) { grid-area: n; align-self: start; font-weight: 700; }
  .codes-table td:nth-child(2) { grid-area: name; }
  .codes-table td:nth-child(3) { grid-area: code; }
  .codes-table td:nth-child(3) code { white-space: nowrap; font-size: 17px; }
  .codes-table td:nth-child(4) { grid-area: link; }
  .codes-table td:nth-child(5) { grid-area: img; }
}
.reciter-banner { display: flex; flex-direction: column; gap: 4px; }
.reciter-banner button { padding: 2px 10px; margin-inline-start: 6px; }
.name-dialog { border: none; border-radius: 16px; padding: 22px 24px; max-width: 420px; width: calc(100% - 32px);
  box-shadow: 0 20px 60px rgba(0,0,0,.25); direction: rtl; }
.name-dialog::backdrop { background: rgba(16, 36, 27, .45); }
.name-dialog h2 { margin: 0 0 6px; color: var(--green-dark); font-size: 19px; }
.name-dialog input { font-size: 17px; margin: 4px 0 2px; }
.alert-dialog { max-width: 520px; }
.dialog-list { margin: 8px 0 14px; padding-inline-start: 20px; line-height: 1.9; font-size: 14px; }
#alert-dialog-actions { gap: 8px; flex-wrap: wrap; }
#print-area { display: none; }
/* login cards print only while body.printing-cards is set (the guide has its own print rules) */
@media print {
  body.printing-cards { background: #fff; }
  body.printing-cards #app, body.printing-cards #toast, body.printing-cards dialog { display: none !important; }
  body.printing-cards #print-area { display: block; }
  /* 2 × 5 self-contained cut-outs per sheet: 5 × 50 mm + 4 × 5 mm gaps = 270 mm of 277 mm.
     The inline inset keeps the outer cut lines printable: Chromium lays the 190 mm page out
     at a whole 719 px but clips at 718.14 px, which erased the right border of every
     right-hand card. */
  body.printing-cards .print-page { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 50mm; gap: 5mm;
    padding-inline: 1mm; break-after: page; }
  body.printing-cards .print-page:last-child { break-after: auto; }
  /* a muṣḥaf-page frame: green rule outside, gold hairline inside (Chromium prints borders in whole
     CSS px: 0.6 mm → 2 px, 0.15 mm → 1 px); colours print as designed */
  body.printing-cards .print-card { position: relative; box-sizing: border-box; border: 0.6mm solid #0d4f36; border-radius: 3.2mm;
    display: grid; grid-template-columns: minmax(0, 1fr) 33mm; overflow: hidden; break-inside: avoid; color: #1f2a24;
    -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body.printing-cards .print-card::after { content: ""; position: absolute; inset: 0.9mm; border: 0.15mm solid #b98a2f; border-radius: 2.3mm; }
  /* ≈ 41 mm of content in a 44 mm column: nothing may shrink */
  body.printing-cards .pc-body { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
    min-width: 0; padding: 2.4mm 3.1mm 2.4mm 3mm; }
  body.printing-cards .pc-body > * { flex-shrink: 0; }
  body.printing-cards .pc-brand { display: flex; align-items: center; gap: 1.3mm; font-weight: 700; font-size: 12pt; line-height: 1.3; color: #0d4f36; }
  body.printing-cards .pc-star { position: relative; width: 3.1mm; height: 3.1mm; }
  body.printing-cards .pc-star::before, body.printing-cards .pc-star::after { content: ""; position: absolute; inset: 0.45mm; background: #b98a2f; }
  body.printing-cards .pc-star::after { transform: rotate(45deg); }
  body.printing-cards .pc-label { margin-top: 0.3mm; font-size: 8pt; line-height: 1.3; color: #52605a; }
  body.printing-cards .pc-code { margin: 0.9mm 0; padding: 1mm 2.2mm; border: 0.15mm solid #b9d9ca; border-radius: 1.8mm; background: #eef5f1;
    font: 700 15.5pt/1.25 "DejaVu Sans Mono", Consolas, "Courier New", monospace; letter-spacing: .03em; }
  body.printing-cards .pc-url { font: 8pt/1.3 "DejaVu Sans Mono", Consolas, "Courier New", monospace; }
  body.printing-cards .pc-steps { display: flex; gap: 2.8mm; margin: 1mm 0 0; padding: 0; list-style: none; font-size: 7pt; line-height: 1.55; white-space: nowrap; }
  body.printing-cards .pc-steps li { display: flex; align-items: center; gap: 0.8mm; }
  body.printing-cards .pc-steps span { display: grid; place-items: center; width: 2.7mm; height: 2.7mm; color: #fff; font-weight: 700; line-height: 1; }
  body.printing-cards .pc-tail { width: 100%; margin-top: 0.9mm; }
  body.printing-cards .pc-line { font-size: 7.5pt; line-height: 1.35; color: #52605a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  body.printing-cards .pc-note { font-size: 7.5pt; line-height: 1.35; color: #7a5a17; }
  body.printing-cards .pc-stub { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #fbf7ec; }
  body.printing-cards .pc-stub::before { content: ""; position: absolute; inset-block: 2.2mm; inset-inline-start: 0; border-inline-start: 0.2mm dashed #b98a2f; }
  body.printing-cards .pc-no { position: absolute; top: 1.7mm; inset-inline-end: 2.9mm; font-size: 7pt; line-height: 1; color: #8a8a8a; }
  body.printing-cards .pc-qr { padding: 0.6mm; border: 0.15mm solid #e6dcc3; border-radius: 1.2mm; background: #fff; }
  body.printing-cards .pc-qr svg { display: block; width: 26mm; height: 26mm; }
  body.printing-cards .pc-qr-cap { margin-top: 0.8mm; font-size: 7.5pt; line-height: 1.3; color: #52605a; }
  body.printing-cards .pc-logo { display: block; width: 20mm; height: auto; margin-top: 2.2mm; }
}
