:root {
  --bg: #f5f6f8; --card: #ffffff; --text: #1b1f24; --muted: #5f6b7a; --line: #d9dee5;
  --accent: #1f4e8c; --accent-text: #ffffff; --rec: #c62828; --ok: #2e7d32; --warn: #b26a00;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #121417; --card: #1c2026; --text: #e8eaed; --muted: #9aa4b1; --line: #313842;
          --accent: #6b9fe0; --accent-text: #0d1117; --rec: #ef5350; --ok: #66bb6a; --warn: #ffb74d; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
       font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
header { position: sticky; top: 0; z-index: 5; display: flex; gap: 10px; align-items: center;
         padding: 10px 16px; background: var(--card); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; color: var(--text); text-decoration: none; flex: 1; }
.who { color: var(--muted); font-size: 14px; }
.pending { background: var(--warn); color: #000; border-radius: 12px; padding: 2px 10px; font-size: 13px; }
main { max-width: 640px; margin: 0 auto; padding: 16px; }
h1 { font-size: 22px; margin: 4px 0 12px; }
h2 { font-size: 18px; margin: 20px 0 8px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 14px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
label { display: block; font-weight: 600; margin: 12px 0 4px; }
input, select, textarea { width: 100%; font: inherit; padding: 10px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--bg); color: var(--text); }
textarea { min-height: 60px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; margin: 10px 0; }
.check input { width: 22px; height: 22px; flex: none; margin-top: 2px; }
.req { color: var(--rec); font-size: 13px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1 1 140px; }
button, .btn { display: inline-block; font: inherit; font-weight: 600; padding: 12px 16px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card); color: var(--text); cursor: pointer; text-align: center;
  text-decoration: none; }
button.primary, .btn.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
button.danger { color: var(--rec); }
button:disabled { opacity: .5; }
.wide { width: 100%; margin-top: 14px; }
.list a { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line);
  color: var(--text); text-decoration: none; }
.list a:last-child { border-bottom: 0; }
.qid { font-weight: 700; color: var(--accent); }
.pa { font-family: "Noto Nastaliq Urdu", "Noto Naskh Arabic", serif; direction: rtl; text-align: right;
      font-size: 24px; line-height: 2.2; margin: 8px 0; }
.en { color: var(--muted); font-size: 14px; }
.recbtn { display: block; width: 120px; height: 120px; border-radius: 50%; margin: 18px auto 8px;
  background: var(--rec); color: #fff; border: 0; font-size: 18px; }
.recbtn.stop { border-radius: 24px; }
.timer { text-align: center; font-size: 28px; font-variant-numeric: tabular-nums; }
.meter { height: 10px; background: var(--line); border-radius: 5px; overflow: hidden; margin: 8px 0; }
.meter div { height: 100%; width: 0; background: var(--ok); transition: width .08s; }
audio { width: 100%; margin: 10px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 6px 10px; border-radius: 14px; border: 1px solid var(--line); font-size: 13px;
  background: var(--card); color: var(--text); }
.chip.done { background: var(--ok); color: #fff; border-color: var(--ok); }
.chip.skip { background: var(--muted); color: #fff; }
.chip.flag { background: var(--warn); color: #000; }
.chip.cur { outline: 3px solid var(--accent); }
.chip.local { border-style: dashed; }
.progress { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.progress div { height: 100%; background: var(--accent); }
.toast { position: fixed; left: 16px; right: 16px; bottom: 20px; max-width: 600px; margin: auto; z-index: 10;
  background: var(--text); color: var(--bg); padding: 12px 16px; border-radius: 10px; }
.warnbox { border-left: 4px solid var(--warn); padding: 8px 12px; background: var(--bg); margin: 10px 0; }
img.preview { max-width: 100%; max-height: 240px; border-radius: 8px; margin-top: 8px; }
