@font-face { font-family: Vazirmatn; src: url(/fonts/vazirmatn.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
:root {
  --bg: #f6f6f3; --card: #ffffff; --text: #1d1e20; --muted: #6b6d72; --line: rgba(0,0,0,.12); --line-strong: rgba(0,0,0,.22);
  --accent: #1f6feb; --on-accent: #ffffff; --ok-bg: #e5f4e8; --ok: #1e7b34; --warn-bg: #fbf0d9; --warn: #8a5a00;
  --bad-bg: #fbe7e7; --bad: #b42323; --stage: #0d0e10; --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #16171a; --card: #1f2024; --text: #ececed; --muted: #9a9ca3; --line: rgba(255,255,255,.12); --line-strong: rgba(255,255,255,.24);
    --accent: #4c8dff; --ok-bg: #173822; --ok: #7fd697; --warn-bg: #3a2e12; --warn: #f2c46b; --bad-bg: #3d1c1c; --bad: #ff8f8f; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: Vazirmatn, Tahoma, sans-serif; line-height: 1.7; -webkit-text-size-adjust: 100%; }
main { max-width: 560px; margin: 0 auto; padding: max(16px, env(safe-area-inset-top)) 16px 24px; }
h1 { font-size: 24px; font-weight: 600; margin: 24px 0 4px; }
.sub { color: var(--muted); margin: 0 0 24px; }
button { font: inherit; color: var(--text); background: var(--card); border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: 10px 14px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; }
button:active { transform: scale(.98); }
button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
button.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
button.danger { color: var(--bad); border-color: var(--bad); }
button.wide { width: 100%; margin-top: 12px; }
button[hidden], [hidden] { display: none !important; }
.choice { width: 100%; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 14px; text-align: right;
  padding: 18px; margin-bottom: 12px; background: var(--card); }
.choice svg { grid-row: 1 / 3; width: 32px; height: 32px; align-self: center; }
.choice .t { font-size: 18px; font-weight: 600; }
.choice .d { font-size: 13px; color: var(--muted); }
.choice:disabled { opacity: .55; cursor: default; }
.note { color: var(--muted); font-size: 14px; min-height: 1.7em; }
.note.err { color: var(--bad); }
.stage { position: relative; background: var(--stage); border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 9; margin-top: 8px; }
.stage video { width: 100%; height: 100%; object-fit: contain; display: block; background: var(--stage); }
.stage:fullscreen { border-radius: 0; aspect-ratio: auto; }
.stage-msg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 16px;
  color: #d8d9dc; font-size: 15px; pointer-events: none; }
.stage-msg:empty { display: none; }
.chips, .status { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; align-items: center; }
.status { justify-content: space-between; font-size: 14px; color: var(--muted); }
.chip { font-size: 13px; padding: 3px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--muted); }
.chip.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.chip.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.chip.bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); margin-left: 6px; vertical-align: 1px; }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); }
.linkbox { display: flex; gap: 8px; }
.linkbox input { flex: 1; min-width: 0; font: inherit; font-size: 14px; padding: 8px 12px; border-radius: var(--radius); border: 1px solid var(--line-strong);
  background: var(--card); color: var(--accent); }
.qr { display: flex; justify-content: center; margin: 14px 0 4px; }
.qr svg { width: 168px; height: 168px; background: #fff; border-radius: 8px; padding: 6px; }
.controls { display: flex; gap: 8px; margin-top: 12px; }
.controls button { flex: 1; }
.banner { margin-top: 12px; padding: 10px 14px; border-radius: var(--radius); background: var(--warn-bg); color: var(--warn); font-size: 14px; }
.foot { text-align: center; margin-top: 28px; font-size: 14px; }
.foot a { color: var(--muted); }
