/* ================================================================
   Quran exam — design layer over theme.css
   Forest #1B4332 · Night #10291F · Gold #C9A84C / #E8C97A
   Paper #FCFAF3 (question pages only) · Mist #EEF2EE
================================================================ */

@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazirmatn.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'UthmanTaha';
  src: url('../fonts/UthmanTaha.woff2') format('woff2'), url('../fonts/UthmanTaha.ttf') format('truetype');
  font-weight: 400;
  font-display: block;
}
/* KFGQPC Hafs: fills in what Uthman Taha lacks (waqf signs, sakt, imala, small letters). */
@font-face {
  font-family: 'UthmanicHafs';
  src: url('../fonts/UthmanicHafs.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'UthmanTaha';
  src: url('../fonts/UthmanTaha-Bold.woff2') format('woff2');
  font-weight: 700;
  font-display: block;
}

:root {
  --forest: #1B4332;
  --night: #10291F;
  --paper: #FCFAF3;
  --paper-edge: #EFE6CC;
  --mist: #EEF2EE;
  --bg: var(--mist);
  --ring: 0 0 0 3px rgba(201,168,76,.45);
  --girih: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cg fill='none' stroke='%23C9A84C' stroke-opacity='.13' stroke-width='1'%3E%3Cpath d='M36 6 44 28 66 36 44 44 36 66 28 44 6 36 28 28Z'/%3E%3Cpath d='M15 15h42v42H15z' transform='rotate(45 36 36)'/%3E%3Cpath d='M15 15h42v42H15z'/%3E%3C/g%3E%3C/svg%3E");
  --star: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='%23C9A84C'%3E%3Cpath d='M5 5h10v10H5z'/%3E%3Cpath d='M5 5h10v10H5z' transform='rotate(45 10 10)'/%3E%3C/g%3E%3C/svg%3E");
}

body { background: var(--mist); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.btn:focus-visible { box-shadow: var(--ring); outline: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* Quranic text: questions, options, verses */
.qt {
  font-family: 'UthmanTaha', 'UthmanicHafs', 'Vazirmatn', serif;
  font-size: 1.8rem;
  line-height: 2.2;
  font-feature-settings: 'kern', 'liga', 'calt', 'mark', 'mkmk';
  text-rendering: optimizeLegibility;
  word-spacing: .04em;
  white-space: pre-wrap;
  unicode-bidi: plaintext;
}
.qt-sm { font-size: 1.5rem; line-height: 2.05; }

/* ── Header ──────────────────────────────────────────────────────────────── */
.site-header {
  background: var(--girih) center/72px, linear-gradient(180deg, var(--night) 0%, var(--forest) 100%);
  text-align: center; position: relative; box-shadow: none;
  border-bottom: 0;
}
.site-header::before { display: none; }
.site-header::after {
  content: ''; position: absolute; inset: auto 0 0 0; height: 4px;
  background: linear-gradient(var(--gold), var(--gold)) top/100% 1px no-repeat,
              linear-gradient(var(--gold-2), var(--gold-2)) bottom/100% 2px no-repeat;
}
.hdr-top { padding: 22px 16px 16px; }
.hdr-logo {
  width: 92px; height: 92px; object-fit: contain; display: block; margin: 0 auto 10px;
  filter: brightness(0) saturate(100%) invert(76%) sepia(50%) saturate(580%) hue-rotate(4deg) brightness(1.04) contrast(1.1) drop-shadow(0 2px 10px rgba(0,0,0,.45));
}
.hdr-sub { color: rgba(255,255,255,.78); font-size: 13.5px; line-height: 1.8; margin: 0; letter-spacing: .01em; }
.hdr-main {
  font-family: 'UthmanTaha', 'UthmanicHafs', 'Vazirmatn', serif; font-weight: 700;
  color: var(--gold-2); font-size: 30px; line-height: 1.7; margin: 2px 0 0;
  text-shadow: 0 2px 14px rgba(0,0,0,.35);
}
.hdr-nav {
  display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 4px;
  padding: 8px 16px 14px; background: none;
}
.hdr-nav a {
  color: rgba(255,255,255,.82); font-size: 14px; padding: 6px 16px; border-radius: 999px;
  border: 1px solid transparent; transition: background .18s, color .18s, border-color .18s; white-space: nowrap;
}
.hdr-nav a:hover { color: var(--gold-2); border-color: rgba(201,168,76,.35); }
.hdr-nav a.active { color: var(--night); background: var(--gold); border-color: var(--gold); font-weight: 600; }
.hdr-sep { color: rgba(255,255,255,.25); padding: 0 4px; user-select: none; }
.hdr-user { color: rgba(255,255,255,.6); font-size: 13px; padding: 4px 8px; direction: ltr; font-family: ui-monospace, Menlo, Consolas, monospace; }
.hdr-nav a.hdr-logout { color: #FCA5A5; }
.hdr-nav a.hdr-logout:hover { border-color: rgba(252,165,165,.4); color: #FECACA; }

.site-header.compact .hdr-top { padding: 10px 16px 12px; display: flex; align-items: center; justify-content: center; gap: 12px; }
.site-header.compact .hdr-logo { width: 46px; height: 46px; margin: 0; }
.site-header.compact .hdr-sub { display: none; }
.site-header.compact .hdr-main { font-size: 21px; margin: 0; }
@media (max-width: 600px) {
  .hdr-main { font-size: 23px; }
  .hdr-sub { font-size: 12px; }
  .hdr-logo { width: 72px; height: 72px; }
  .hdr-nav a { font-size: 13px; padding: 5px 12px; }
  .site-header.compact .hdr-main { font-size: 17px; }
  .site-header.compact .hdr-logo { width: 36px; height: 36px; }
  .cartouche > span { padding: 0 36px; }
}

.main-content { padding-top: 34px; }
.site-footer { background: var(--night); }
.site-footer .geo-border { background: linear-gradient(var(--gold), var(--gold)) top/100% 1px no-repeat; height: 1px; }

/* Flash */
.flash { border-radius: var(--radius-sm); border-width: 1px; border-inline-start-width: 4px; }

/* ── Ornament: double gold rule frame used for "pages" ───────────────────── */
.paper {
  background: var(--star) top 10px right 10px/16px no-repeat, var(--star) top 10px left 10px/16px no-repeat,
              var(--star) bottom 10px right 10px/16px no-repeat, var(--star) bottom 10px left 10px/16px no-repeat,
              var(--paper);
  border: 1px solid var(--gold);
  box-shadow: inset 0 0 0 6px var(--paper), inset 0 0 0 7px rgba(201,168,76,.55), var(--shadow);
  border-radius: 6px;
}

/* Sarlawh cartouche: the surah-title panel of a mushaf */
.cartouche {
  --h: 46px; position: relative; display: inline-grid; place-items: center; height: var(--h);
  min-width: 150px; padding: 0 2px; background: var(--gold);
  clip-path: polygon(18px 0, calc(100% - 18px) 0, 100% 50%, calc(100% - 18px) 100%, 18px 100%, 0 50%);
}
.cartouche > span {
  display: grid; place-items: center; height: calc(var(--h) - 4px); width: calc(100% - 2px); padding: 0 42px;
  background: radial-gradient(circle at 26px 50%, var(--gold) 2.5px, transparent 3px),
              radial-gradient(circle at calc(100% - 26px) 50%, var(--gold) 2.5px, transparent 3px),
              var(--forest);
  clip-path: polygon(17px 0, calc(100% - 17px) 0, 100% 50%, calc(100% - 17px) 100%, 17px 100%, 0 50%);
  color: var(--gold-2); font-family: 'UthmanTaha', 'UthmanicHafs', 'Vazirmatn', serif; font-weight: 700; font-size: 1.45rem; line-height: 1;
  padding-top: 4px; white-space: nowrap;
}
.title-band { display: flex; align-items: center; gap: 14px; }
.title-band::before, .title-band::after {
  content: ''; flex: 1; height: 5px;
  background: linear-gradient(var(--gold), var(--gold)) top/100% 1px no-repeat,
              linear-gradient(var(--gold), var(--gold)) bottom/100% 1px no-repeat;
  opacity: .7;
}

/* ── Login ───────────────────────────────────────────────────────────────── */
.login-split {
  display: grid; grid-template-columns: 1fr 1.05fr; max-width: 900px; margin: 10px auto 30px;
  background: #fff; border-radius: 18px; overflow: hidden; box-shadow: var(--shadow-lg);
}
.login-aside {
  background: var(--girih) center/72px, linear-gradient(160deg, var(--forest), var(--night));
  color: #fff; padding: 44px 34px; display: flex; flex-direction: column; justify-content: center; gap: 30px;
}
.verse-frame { text-align: center; border: 1px solid rgba(201,168,76,.6); outline: 1px solid rgba(201,168,76,.3); outline-offset: 5px; border-radius: 4px; padding: 18px 14px 12px; }
.verse-frame .qt { color: var(--gold-2); font-size: 2.25rem; line-height: 1.9; white-space: normal; }
.verse-frame small { display: block; color: rgba(255,255,255,.6); font-size: .78rem; margin-top: 4px; }
.facts { list-style: none; display: grid; gap: 10px; }
.facts li { display: flex; align-items: baseline; gap: 10px; font-size: .9rem; color: rgba(255,255,255,.82); }
.facts b { color: var(--gold-2); font-size: 1.35rem; min-width: 2.6em; text-align: center; font-variant-numeric: tabular-nums; }
.login-form-side { padding: 44px 40px; display: flex; flex-direction: column; justify-content: center; }
.login-form-side h2 { color: var(--forest); font-size: 1.25rem; margin-bottom: 4px; }
.login-form-side .lead { color: var(--text-3); font-size: .86rem; margin-bottom: 24px; }
.login-form-side .form-group { margin-bottom: 16px; }
.login-form-side input { font-size: 1.05rem !important; letter-spacing: .03em; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-left: 64px !important; }
.pw-toggle {
  position: absolute; left: 8px; top: 50%; transform: translateY(-50%); background: none; border: 0; cursor: pointer;
  font-family: inherit; font-size: .78rem; color: var(--green-2); padding: 4px 8px; border-radius: 6px;
}
.pw-toggle:hover { background: var(--green-bg); }
.login-box { border-top: 0; border-radius: 18px; }
@media (max-width: 760px) {
  .login-split { grid-template-columns: 1fr; border-radius: 14px; margin-top: 0; }
  .login-aside { order: 2; }
  .login-aside { padding: 26px 22px; gap: 18px; }
  .verse-frame .qt { font-size: 1.8rem; }
  .facts { grid-template-columns: repeat(3, 1fr); text-align: center; }
  .facts li { flex-direction: column; align-items: center; gap: 0; font-size: .74rem; }
  .login-form-side { padding: 28px 22px; }
}

/* Oral competition entry (no login) */
.oral-band { max-width: 900px; margin: 0 auto 22px; padding: 22px 28px 26px; text-align: center; }
.oral-lead { color: var(--text-2); font-size: .9rem; margin: 12px auto 0; max-width: 560px; }
.oral-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; max-width: 520px; margin: 16px auto 0; }
.oral-actions .btn { width: 100%; }
@media (max-width: 760px) { .oral-band { padding: 18px 16px 20px; margin-bottom: 16px; } .oral-actions { grid-template-columns: 1fr 1fr; gap: 10px; } .oral-actions .btn { padding: 13px 8px; font-size: 1rem; } }

/* ── Participant home ────────────────────────────────────────────────────── */
.narrow { max-width: 720px; margin: 0 auto; }
.greeting { text-align: center; margin-bottom: 22px; }
.greeting h2 { color: var(--forest); font-size: 1.35rem; }
.greeting p { color: var(--text-3); font-size: .9rem; }
.user-chip { display: inline-flex; gap: 8px; align-items: center; background: #fff; border: var(--border); color: var(--green); border-radius: 30px; padding: 3px 14px; font-size: .85rem; font-weight: 600; }

.steps { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); margin: 0 0 22px; counter-reset: step; }
.steps li { position: relative; text-align: center; font-size: .82rem; color: var(--text-3); padding-top: 40px; counter-increment: step; }
.steps li::before {
  content: counter(step, persian); position: absolute; top: 0; left: 50%; transform: translateX(-50%); z-index: 1;
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700;
  background: #fff; border: 1.5px solid var(--gray-2); color: var(--text-3);
}
.steps li + li::after { content: ''; position: absolute; top: 15px; left: 50%; width: 100%; height: 2px; background: var(--gray-2); }
.steps li.done::before { content: '✓'; background: var(--green-2); border-color: var(--green-2); color: #fff; }
.steps li.done + li::after, .steps li.done::after { background: var(--green-3); }
.steps li.current { color: var(--forest); font-weight: 700; }
.steps li.current::before { background: var(--gold); border-color: var(--gold); color: var(--night); box-shadow: var(--ring); }

.exam-ticket { padding: 0; overflow: hidden; }
.ticket-head { padding: 22px 26px 6px; }
.fact-row { display: flex; justify-content: center; flex-wrap: wrap; border-block: 1px dashed var(--gray-2); margin: 14px 0 0; }
.fact-row div { flex: 1; min-width: 120px; padding: 14px 10px; text-align: center; }
.fact-row div + div { border-inline-start: 1px dashed var(--gray-2); }
.fact-row b { display: block; font-size: 1.7rem; color: var(--forest); line-height: 1.25; font-variant-numeric: tabular-nums; }
.fact-row small { color: var(--text-3); font-size: .78rem; }
.ticket-body { padding: 18px 26px 26px; }
.rules { list-style: none; margin: 0 0 22px; display: grid; gap: 2px; }
.rules li { position: relative; padding: 5px 24px 5px 0; font-size: .9rem; color: var(--text-2); }
.rules li::before { content: ''; position: absolute; right: 4px; top: 14px; width: 7px; height: 7px; background: var(--gold); transform: rotate(45deg); }
.resume-note { margin-top: 12px; font-size: .86rem; color: var(--text-2); }
.resume-note b { color: var(--forest); font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.mt { margin-top: 16px; }
.muted { color: var(--text-3); font-size: .85rem; }
.btn-xl { padding: 15px 44px; font-size: 1.08rem; border-radius: 12px; }

/* ── Exam ────────────────────────────────────────────────────────────────── */
body.exam-mode { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body.exam-mode .main-content { padding-top: 18px; }
.exam-wrap { max-width: 860px; margin: 0 auto; position: relative; z-index: 41; }

.exam-bar {
  position: sticky; top: 0; z-index: 60; display: flex; align-items: center; gap: 16px;
  background: rgba(255,255,255,.96); backdrop-filter: blur(6px); border: var(--border); border-radius: 14px;
  box-shadow: var(--shadow); padding: 10px 14px 14px; margin-bottom: 18px; overflow: hidden;
}
.timer-box { display: flex; flex-direction: column; align-items: center; line-height: 1.2; }
.timer-label { font-size: .68rem; color: var(--text-3); }
.timer {
  font-variant-numeric: tabular-nums; font-weight: 800; font-size: 1.45rem; color: var(--forest);
  min-width: 96px; text-align: center; direction: ltr; letter-spacing: .02em;
}
.timer.warn { color: #8A5000; }
.timer.danger { color: var(--red); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .5; } }
.exam-progress { flex: 1; min-width: 0; }
.progress-txt { font-size: .82rem; color: var(--text-2); margin-bottom: 5px; }
.progress-txt b { color: var(--forest); font-variant-numeric: tabular-nums; }
.meter { height: 6px; border-radius: 6px; background: var(--gray-2); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--green-3), var(--green-2)); border-radius: 6px; transition: width .3s; margin-inline-start: auto; }
.time-meter { position: absolute; inset: auto 0 0 0; height: 3px; background: rgba(201,168,76,.18); }
.time-meter i { display: block; height: 100%; width: 0; background: var(--gold); margin-inline-start: auto; transition: width 1s linear; }
.exam-bar.danger .time-meter i { background: var(--red-2); }
.save-state { font-size: .74rem; color: var(--text-3); min-width: 80px; text-align: center; }
.save-state.err { color: var(--red); font-weight: 600; }

.q-card { padding: 22px 34px 24px; position: relative; }
.q-card[hidden] { display: none; }
.q-card.enter { animation: pageIn .28s ease both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.q-head { margin-bottom: 4px; }
.q-meta { text-align: center; font-size: .78rem; color: var(--text-3); margin-top: 6px; }
.q-meta .flag-tag { display: none; color: #8A5000; background: #FFF3CD; border-radius: 10px; padding: 1px 9px; margin-inline-start: 6px; }
.q-card.flagged .q-meta .flag-tag { display: inline; }
.q-text { color: var(--text); margin: 16px 0 18px; }
.opts { display: flex; flex-direction: column; gap: 10px; }
.opt {
  display: flex; align-items: center; gap: 14px; cursor: pointer; padding: 6px 16px; min-height: 60px;
  border: 1px solid var(--paper-edge); border-radius: 10px; background: #fff;
  transition: border-color .18s, background .18s, box-shadow .18s, transform .12s;
}
.opt:hover { border-color: var(--green-3); }
.opt:active { transform: scale(.995); }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt-label {
  flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  border: 1.5px solid var(--gray-2); color: var(--text-2); font-weight: 700; font-size: .82rem; background: #fff; transition: inherit;
}
.opt.checked { border-color: var(--green-2); background: #EDF5F0; box-shadow: 0 0 0 1px var(--green-2); }
.opt.checked .opt-label { background: var(--forest); border-color: var(--forest); color: var(--gold-2); }
.opt:focus-within { box-shadow: var(--ring); }
.q-tools { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; }
.link-btn {
  background: none; border: 0; font-family: inherit; font-size: .82rem; color: var(--green-2); cursor: pointer;
  padding: 6px 10px; border-radius: 8px; display: inline-flex; align-items: center; gap: 6px;
}
.link-btn:hover { background: rgba(45,106,79,.08); }
.link-btn[aria-pressed="true"] { color: #8A5000; background: #FFF3CD; }

.q-pager { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; margin-top: 16px; }
.q-pager .btn { padding: 12px 18px; }
.q-pager [data-go="prev"] { justify-self: start; }
.q-pager [data-go="next"] { justify-self: end; min-width: 150px; }
.pager-pos { font-size: .85rem; color: var(--text-2); background: #fff; border: var(--border); border-radius: 999px; padding: 6px 14px; cursor: pointer; font-family: inherit; }

.grid-card { margin-top: 18px; }
.grid-title { font-size: .85rem; font-weight: 700; color: var(--forest); margin-bottom: 12px; }
.q-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 6px; }
.q-grid button {
  position: relative; font-family: inherit; height: 38px; border-radius: 8px; border: 1px solid var(--gray-2);
  background: #fff; color: var(--text-2); cursor: pointer; font-size: .85rem; transition: background .15s, border-color .15s;
}
.q-grid button:hover { border-color: var(--green-3); }
.q-grid button.done { background: var(--green-2); border-color: var(--green-2); color: #fff; }
.q-grid button.flag::after { content: ''; position: absolute; top: -3px; left: -3px; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); border: 2px solid #fff; }
.q-grid button.current { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--gold); font-weight: 800; }
.grid-legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: .76rem; color: var(--text-3); margin-top: 12px; }
.grid-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-inline-end: 5px; border: 1px solid var(--gray-2); background: #fff; }
.grid-legend i.done { background: var(--green-2); border-color: var(--green-2); }
.grid-legend i.flag { background: var(--gold); border-color: var(--gold); border-radius: 50%; }

.watermark {
  position: fixed; inset: 0; pointer-events: none; z-index: 40; overflow: hidden; opacity: .05;
  display: flex; flex-wrap: wrap; align-content: flex-start; gap: 70px 90px; padding: 40px; transform: rotate(-24deg) scale(1.4);
  font-size: 1.1rem; font-weight: 800; color: var(--forest); direction: ltr;
}
.focus-warning {
  display: none; position: fixed; inset: 0; background: rgba(16,41,31,.94); z-index: 900; color: #fff;
  align-items: center; justify-content: center; text-align: center; padding: 24px;
}
.focus-warning.show { display: flex; }
.focus-warning > div { max-width: 420px; }
.focus-warning h3 { color: var(--gold-2); font-size: 1.25rem; margin-bottom: 10px; }
.focus-warning p { margin-bottom: 18px; opacity: .9; line-height: 1.9; }

.confirm-box { text-align: center; padding: 12px 14px 6px; line-height: 1.9; }
.confirm-box p { margin-bottom: 8px; }
.confirm-actions { display: flex; gap: 10px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.modal-sm { max-width: 440px; }

@media (max-width: 720px) {
  body.exam-mode .main-content { padding: 12px 10px 96px; }
  .exam-bar { gap: 10px; padding: 8px 10px 12px; border-radius: 12px; flex-wrap: wrap; }
  .exam-progress { order: 3; flex-basis: 100%; }
  .save-state { order: 2; flex: 1; text-align: left; min-width: 0; }
  .timer { font-size: 1.25rem; min-width: 80px; }
  .q-card { padding: 18px 18px 20px; }
  .qt { font-size: 1.6rem; }
  .qt-sm { font-size: 1.38rem; }
  .cartouche { --h: 40px; min-width: 120px; }
  .cartouche > span { font-size: 1.2rem; padding: 0 36px; }
  .opt { padding: 4px 10px; gap: 10px; min-height: 54px; }
  .opt-label { width: 30px; height: 30px; }
  .q-pager {
    position: fixed; inset: auto 0 0 0; z-index: 70; margin: 0; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: rgba(255,255,255,.97); backdrop-filter: blur(6px); border-top: 1px solid var(--gray-2); box-shadow: 0 -4px 20px rgba(27,67,50,.08);
  }
  .q-pager .btn { padding: 12px 14px; }
  .q-pager [data-go="next"] { min-width: 0; }
}
@media print { body.exam-mode * { display: none !important; } }

/* ── Result ──────────────────────────────────────────────────────────────── */
.result-page { max-width: 560px; margin: 0 auto; padding: 34px 30px 30px; text-align: center; }
.result-page h2 { color: var(--forest); font-size: 1.25rem; margin: 18px 0 4px; }
.result-page .success-intro { margin-bottom: 18px; }
.score-ring {
  --p: 0; width: 176px; height: 176px; border-radius: 50%; margin: 6px auto 20px; display: grid; place-items: center;
  background: conic-gradient(var(--gold) calc(var(--p) * 1%), rgba(201,168,76,.18) 0);
  box-shadow: 0 0 0 6px var(--paper), 0 0 0 7px rgba(201,168,76,.5);
}
.score-ring > div {
  width: 146px; height: 146px; border-radius: 50%; background: var(--forest); display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.score-ring b { font-size: 3rem; color: var(--gold-2); line-height: 1.1; font-variant-numeric: tabular-nums; }
.score-ring small { color: rgba(255,255,255,.7); font-size: .8rem; }
.result-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.result-tiles div { border-radius: 10px; padding: 10px; text-align: center; font-size: .8rem; }
.result-tiles b { display: block; font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.t-ok { background: var(--green-bg); color: #1B5E20; }
.t-bad { background: var(--red-bg); color: var(--red); }
.t-none { background: #fff; color: var(--text-2); border: 1px solid var(--paper-edge); }
.result-page .success-info { background: #fff; border-color: var(--paper-edge); text-align: right; }

/* ── Admin ───────────────────────────────────────────────────────────────── */
thead th:first-child, thead th:last-child { border-radius: 0; }
.table-wrap { overflow: hidden; overflow-x: auto; border-radius: 12px; }
thead tr { background: var(--forest); }
thead th { position: sticky; top: 0; }
.admin-wide { max-width: 1260px; margin: 0 auto; }
.admin-bar { border-radius: 12px; }
.stat-strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); background: #fff; border: var(--border);
  border-radius: 12px; box-shadow: var(--shadow-xs); margin-bottom: 18px; overflow: hidden;
}
.stat-strip > div { padding: 14px 18px; border-inline-start: 1px solid var(--gray-2); }
.stat-strip > div:first-child { border-inline-start: 0; }
.stat-strip b { display: block; font-size: 1.55rem; color: var(--forest); line-height: 1.3; font-variant-numeric: tabular-nums; }
.stat-strip small { font-size: .76rem; color: var(--text-3); }
.stat-strip .warn b { color: var(--red); }
.table-wrap table.compact { min-width: 760px; }
td.ltr, .ltr { direction: ltr; text-align: right; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .86rem; }
.q-row-text { max-width: 560px; }
.q-row-text .qt { font-size: 1.15rem; line-height: 1.95; white-space: normal; }
.q-correct { color: var(--green); font-weight: 700; }
tr.inactive { opacity: .5; }
.inline-form { display: inline; }
.inline-form input[type=text] {
  padding: 5px 8px; border: 1.5px solid var(--gray-2); border-radius: var(--radius-xs); font-family: inherit; font-size: .82rem; width: 170px;
}
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .grow { flex: 1; }
.toolbar input[type=search], .toolbar input[type=number] {
  padding: 8px 12px; border: 1.5px solid var(--gray-2); border-radius: var(--radius-sm); font-family: inherit; font-size: .88rem; background: #fff;
}
.toolbar input[type=search] { min-width: 260px; }
.harakat-bar { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 2px; }
.harakat-bar button {
  font-family: 'UthmanTaha', 'UthmanicHafs', serif; font-size: 1.45rem; line-height: 1; width: 40px; height: 40px; cursor: pointer;
  background: var(--paper); border: 1px solid var(--paper-edge); border-radius: 8px; color: var(--forest); padding-bottom: 6px;
}
.harakat-bar button:hover { background: var(--green-bg); border-color: var(--green-3); }
.harakat-bar small { align-self: center; color: var(--text-3); font-size: .75rem; margin-right: 6px; }
textarea.qt-input, input.qt-input { font-family: 'UthmanTaha', 'UthmanicHafs', 'Vazirmatn', serif !important; font-size: 1.35rem !important; line-height: 2 !important; }
.opt-edit { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; margin-bottom: 10px; }
.opt-edit .correct-pick { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--text-3); cursor: pointer; white-space: nowrap; }
.opt-edit .correct-pick input { accent-color: var(--green); width: 18px; height: 18px; }
.opt-edit.is-correct input[type=text] { border-color: var(--green-3); background: var(--green-bg); }
.preview-box { padding: 22px 26px; }
.preview-box .opt { cursor: default; }
.help-pre { background: var(--paper); border-radius: var(--radius-sm); padding: 12px 16px; font-size: .9rem; white-space: pre-wrap; border: 1px solid var(--paper-edge); }
.detail-opt { padding: 2px 12px; border-radius: var(--radius-xs); margin: 3px 0; display: flex; gap: 10px; align-items: center; }
.detail-opt.correct { background: var(--green-bg); }
.detail-opt.picked-wrong { background: var(--red-bg); }
.tag { font-size: .72rem; padding: 1px 8px; border-radius: 10px; font-family: 'Vazirmatn', sans-serif; white-space: nowrap; }
.tag-ok { background: #D8F3E3; color: #1B5E20; }
.tag-bad { background: #FFE0E0; color: var(--red); }
.tag-warn { background: #FFF3CD; color: #8A5000; }
.badge-progress { background: #E8F0FE; color: #1a56c4; border: 1px solid #A8C4FA; }

/* Printable credential cards */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
.cred-card { border: 1px dashed #999; padding: 14px 16px; text-align: center; page-break-inside: avoid; break-inside: avoid; }
.cred-card h4 { font-size: .85rem; color: var(--green); margin-bottom: 6px; }
.cred-card .row { display: flex; justify-content: space-between; font-size: .9rem; margin: 3px 0; }
.cred-card .row b { direction: ltr; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.05rem; letter-spacing: .04em; }
.cred-card .url { font-size: .7rem; color: #666; direction: ltr; margin-top: 6px; }
@media print {
  .no-print, .site-header, .site-footer, .flash-container { display: none !important; }
  body { background: #fff; }
  .main-content { padding: 0; max-width: none; }
}
