/* ============================================================
   🎓 (Update 46) مرکزِ آزمون — /exam-manager، /my-answer-sheets، /report-card — پیشوند: xc-
   هماهنگ با توکن‌هایِ exm- (آبیِ #2563eb)، حالتِ تیره، موبایل (bottom-sheet)، کاهشِ حرکت.
   ============================================================ */

/* 🔧 (Update 47) متغیرها روی پس‌زمینه‌ی مودال هم تعریف می‌شوند: مودال‌ها بیرونِ ظرفِ .xc رندر می‌شوند
   (مثلاً در «پاسخنامه‌هایِ من» و «کارنامه‌ی من») و بدونِ این، پس‌زمینه و حاشیه‌شان شفاف می‌ماند. */
.xc, .xc-modal-bg {
  --xc-bg: #f5f6fa; --xc-surface: #fff; --xc-surface-2: #f9fafb; --xc-border: #e5e7eb; --xc-border-strong: #d1d5db;
  --xc-text: #111827; --xc-text-2: #4b5563; --xc-text-3: #9ca3af;
  --xc-accent: #2563eb; --xc-accent-2: #1d4ed8; --xc-accent-bg: #eff6ff;
  --xc-ok: #16a34a; --xc-ok-bg: #f0fdf4; --xc-warn: #d97706; --xc-warn-bg: #fffbeb; --xc-bad: #dc2626; --xc-bad-bg: #fef2f2;
  --xc-info: #0284c7; --xc-info-bg: #f0f9ff; --xc-violet: #7c3aed; --xc-teal: #0d9488;
  --xc-radius: 16px; --xc-shadow: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.06);
}
.xc { direction: rtl; color: var(--xc-text); max-width: 1280px; margin: 0 auto; padding: 4px 4px 48px; font-family: inherit; }
.xc-modal-bg { direction: rtl; font-family: inherit; }
[data-theme="dark"] .xc, [data-theme="dark"] .xc-modal-bg {
  --xc-bg: #15161a; --xc-surface: #1c1d22; --xc-surface-2: #212228; --xc-border: rgba(255,255,255,.09); --xc-border-strong: rgba(255,255,255,.16);
  --xc-text: #f1f1ef; --xc-text-2: #b3b3ad; --xc-text-3: #7d7d77; --xc-accent-bg: rgba(37,99,235,.16);
  --xc-ok-bg: rgba(22,163,74,.14); --xc-warn-bg: rgba(217,119,6,.14); --xc-bad-bg: rgba(220,38,38,.14); --xc-info-bg: rgba(2,132,199,.14); --xc-shadow: none;
}
.xc *, .xc *::before, .xc *::after, .xc-modal-bg *, .xc-modal-bg *::before, .xc-modal-bg *::after { box-sizing: border-box; }
.xc a, .xc-modal-bg a { color: inherit; text-decoration: none; }
.xc-modal-bg a.xc-link { color: var(--xc-accent); }
.xc :is(button, a, input, select, textarea, label):focus-visible, .xc-modal-bg :is(button, a, input, select, textarea, label):focus-visible { outline: 3px solid rgba(37,99,235,.4); outline-offset: 2px; }
.xc .ltr, .xc-modal-bg .ltr { direction: ltr; unicode-bidi: isolate; }
.xc .muted, .xc-muted { color: var(--xc-text-3, #9ca3af); font-size: 12px; }

/* ── سربرگ و زبانه‌ها ── */
.xc-head { position: relative; overflow: hidden; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 18px 20px; border-radius: 22px; margin-bottom: 14px; color: #fff;
  background: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px) 0 0 / 24px 24px, linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px) 0 0 / 24px 24px,
    radial-gradient(110% 150% at 100% 0%, #3b82f6 0%, #1d4ed8 45%, #1e3a8a 100%);
  box-shadow: 0 18px 36px -24px rgba(30,64,175,.9); }
.xc-head.student { background: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px) 0 0 / 24px 24px, linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px) 0 0 / 24px 24px,
    radial-gradient(110% 150% at 100% 0%, #2dd4bf 0%, #0d9488 45%, #134e4a 100%); }
.xc-head-ic { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 27px; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.24); flex-shrink: 0; }
.xc-head-txt { flex: 1 1 260px; min-width: 0; }
.xc-head h1 { margin: 0; font-size: 21px; font-weight: 900; }
.xc-head p { margin: 4px 0 0; font-size: 12.5px; opacity: .9; line-height: 1.8; }
.xc-head-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.xc-head .xc-btn { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.26); color: #fff; }
.xc-head .xc-btn:hover:not(:disabled) { background: rgba(255,255,255,.24); }
.xc-head .xc-btn.primary { background: #fff; color: #1d4ed8; border-color: #fff; box-shadow: none; }
.xc-role { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 800; padding: 3px 10px; border-radius: 999px; background: rgba(255,255,255,.16); margin-inline-start: 6px; vertical-align: middle; }

.xc-tabs { position: sticky; top: 0; z-index: 20; display: flex; gap: 4px; padding: 6px; margin-bottom: 14px; border-radius: 16px; overflow-x: auto; scrollbar-width: none;
  background: color-mix(in srgb, var(--xc-surface) 92%, transparent); border: 1px solid var(--xc-border); box-shadow: var(--xc-shadow); backdrop-filter: blur(8px); }
.xc-tabs::-webkit-scrollbar { display: none; }
.xc-tab { flex: none; display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 9px 14px; border-radius: 11px; font: inherit; font-size: 13px; font-weight: 800; color: var(--xc-text-2); cursor: pointer; white-space: nowrap; transition: background .15s, color .15s; }
.xc-tab i { font-size: 17px; }
.xc-tab:hover:not(.on) { background: var(--xc-bg); color: var(--xc-text); }
.xc-tab.on { background: var(--xc-accent); color: #fff; box-shadow: 0 6px 14px -8px var(--xc-accent); }
.xc-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #f59e0b; color: #fff; font-size: 11px; font-weight: 900; display: inline-grid; place-items: center; }
.xc-tab.on .xc-count { background: #fff; color: var(--xc-accent); }

/* ── دکمه، فرم ── */
.xc-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--xc-border);
  background: var(--xc-surface); color: var(--xc-text); font: inherit; font-size: 13px; font-weight: 800; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .1s; text-decoration: none; }
.xc-btn:hover:not(:disabled) { border-color: color-mix(in srgb, var(--xc-accent) 40%, var(--xc-border)); }
.xc-btn:active:not(:disabled) { transform: scale(.98); }
.xc-btn:disabled, .xc-btn.disabled { opacity: .55; cursor: not-allowed; }
.xc-btn.disabled { pointer-events: none; }
.xc-btn.primary { background: var(--xc-accent); border-color: var(--xc-accent); color: #fff; box-shadow: 0 8px 18px -10px var(--xc-accent); }
.xc-btn.primary:hover:not(:disabled) { background: var(--xc-accent-2); }
.xc-btn.ok { background: var(--xc-ok); border-color: var(--xc-ok); color: #fff; }
.xc-btn.danger { color: var(--xc-bad); border-color: color-mix(in srgb, var(--xc-bad) 30%, var(--xc-border)); }
.xc-btn.danger:hover:not(:disabled) { background: var(--xc-bad); color: #fff; }
.xc-btn.ghost { background: transparent; }
.xc-btn.sm { min-height: 34px; padding: 0 12px; font-size: 12px; border-radius: 10px; }
.xc-btn.block { width: 100%; }
.xc-icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--xc-border); background: var(--xc-surface); color: var(--xc-text-2); display: inline-grid; place-items: center; font-size: 17px; cursor: pointer; flex-shrink: 0; transition: all .15s; }
.xc-icon-btn:hover:not(:disabled) { color: var(--xc-accent); background: var(--xc-accent-bg); }
.xc-icon-btn.danger:hover:not(:disabled) { color: #fff; background: var(--xc-bad); border-color: var(--xc-bad); }
.xc-icon-btn:disabled { opacity: .45; cursor: not-allowed; }
.xc-link { border: 0; background: none; padding: 0; font: inherit; font-size: 12.5px; font-weight: 800; color: var(--xc-accent); cursor: pointer; display: inline-flex; align-items: center; gap: 2px; }

.xc-input { width: 100%; border: 1px solid var(--xc-border); border-radius: 12px; background: var(--xc-surface); color: var(--xc-text); font: inherit; font-size: 13.5px; padding: 10px 12px; outline: none; transition: border-color .15s, box-shadow .15s; }
.xc-input:focus { border-color: var(--xc-accent); box-shadow: 0 0 0 4px rgba(37,99,235,.12); }
textarea.xc-input { resize: vertical; min-height: 70px; line-height: 1.9; }
.xc-input.num { width: 90px; text-align: center; }
.xc-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; min-width: 0; }
.xc-field > label { font-size: 12px; font-weight: 800; color: var(--xc-text-2); }
.xc-field small { font-size: 11px; color: var(--xc-text-3); font-weight: 600; }
.xc-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.xc-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.xc-search { position: relative; flex: 1 1 220px; min-width: 0; display: block; }
.xc-search > i { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--xc-text-3); pointer-events: none; }
.xc-search .xc-input { padding-right: 36px; }
.xc-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }

.xc-seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--xc-bg); border: 1px solid var(--xc-border); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.xc-seg::-webkit-scrollbar { display: none; }
.xc-seg.wrap { flex-wrap: wrap; overflow: visible; }
.xc-seg button { flex: none; display: inline-flex; align-items: center; gap: 5px; border: 0; background: transparent; color: var(--xc-text-2); font: inherit; font-size: 12.5px; font-weight: 800; padding: 7px 12px; border-radius: 9px; cursor: pointer; white-space: nowrap; }
.xc-seg button.on { background: var(--xc-surface); color: var(--xc-accent); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.xc-seg button:disabled { opacity: .5; cursor: not-allowed; }
.xc-seg button small { font-size: 10.5px; color: var(--xc-text-3); }

.xc-switch { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; cursor: pointer; min-height: 40px; }
.xc-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.xc-switch-ui { position: relative; width: 40px; height: 24px; border-radius: 999px; background: var(--xc-border-strong); transition: background .2s; flex-shrink: 0; }
.xc-switch-ui::after { content: ""; position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: right .2s; }
.xc-switch input:checked + .xc-switch-ui { background: var(--xc-accent); }
.xc-switch input:checked + .xc-switch-ui::after { right: 19px; }
.xc-switch input:focus-visible + .xc-switch-ui { outline: 3px solid rgba(37,99,235,.4); outline-offset: 2px; }

/* ── نشان، یادداشت، وضعیت ── */
.xc-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 999px; white-space: nowrap;
  background: var(--xc-surface-2, #f3f4f6); color: var(--xc-text-2, #4b5563); border: 1px solid transparent; }
.xc-chip.ok { background: var(--xc-ok-bg, #f0fdf4); color: var(--xc-ok, #16a34a); }
.xc-chip.warn { background: var(--xc-warn-bg, #fffbeb); color: var(--xc-warn, #d97706); }
.xc-chip.bad { background: var(--xc-bad-bg, #fef2f2); color: var(--xc-bad, #dc2626); }
.xc-chip.info { background: var(--xc-info-bg, #f0f9ff); color: var(--xc-info, #0284c7); }
.xc-chip.accent { background: var(--xc-accent-bg, #eff6ff); color: var(--xc-accent, #2563eb); }
.xc-chip .ti-loader-2 { animation: xc-rot 1s linear infinite; }
.xc-note { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; line-height: 1.9; padding: 10px 12px; border-radius: 12px; margin: 8px 0;
  background: var(--xc-accent-bg, #eff6ff); color: var(--xc-text-2, #374151); }
.xc-note > i { font-size: 18px; color: var(--xc-accent, #2563eb); flex-shrink: 0; margin-top: 2px; }
.xc-note.warn { background: var(--xc-warn-bg, #fffbeb); } .xc-note.warn > i { color: var(--xc-warn, #d97706); }
.xc-note.bad { background: var(--xc-bad-bg, #fef2f2); } .xc-note.bad > i { color: var(--xc-bad, #dc2626); }
.xc-note.ok { background: var(--xc-ok-bg, #f0fdf4); } .xc-note.ok > i { color: var(--xc-ok, #16a34a); }
.xc-spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-left-color: transparent; animation: xc-rot .7s linear infinite; display: inline-block; flex-shrink: 0; }
@keyframes xc-rot { to { transform: rotate(360deg); } }
.xc-progress { height: 8px; border-radius: 999px; background: var(--xc-accent-bg); overflow: hidden; }
.xc-progress span { display: block; height: 100%; background: linear-gradient(90deg, #60a5fa, var(--xc-accent)); transition: width .3s; }

.xc-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 40px 16px; border-radius: var(--xc-radius);
  background: var(--xc-surface); border: 1px dashed var(--xc-border-strong); color: var(--xc-text-2); }
.xc-empty > i { font-size: 40px; color: #93c5fd; }
.xc-empty b { font-size: 13.5px; }
.xc-empty.flat { border: 0; background: transparent; padding: 20px 8px; }
.xc-skel { border-radius: 14px; background: linear-gradient(90deg, var(--xc-bg), var(--xc-surface-2), var(--xc-bg)); background-size: 200% 100%; animation: xc-sh 1.2s infinite; }
.xc-skel.row { height: 72px; margin-bottom: 8px; } .xc-skel.tile { height: 104px; } .xc-skel.block { height: 220px; }
@keyframes xc-sh { to { background-position: -200% 0; } }

/* ── کارت‌ها و پیشخوان ── */
.xc-card { padding: 14px 16px; border-radius: 18px; background: var(--xc-surface); border: 1px solid var(--xc-border); box-shadow: var(--xc-shadow); min-width: 0; margin-bottom: 14px; }
.xc-card-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.xc-card-h h2, .xc-card-h h3 { margin: 0; font-size: 15px; font-weight: 900; display: flex; align-items: center; gap: 8px; }
.xc-card-h h2 > i, .xc-card-h h3 > i { color: var(--xc-accent); font-size: 19px; }
.xc-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin-bottom: 14px; }
.xc-kpi { --a: #2563eb; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; text-align: right; padding: 14px; border-radius: 18px;
  border: 1px solid var(--xc-border); background: var(--xc-surface); color: var(--xc-text); font: inherit; cursor: pointer; box-shadow: var(--xc-shadow); transition: transform .15s, border-color .15s; }
.xc-kpi:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--a) 45%, var(--xc-border)); }
.xc-kpi.amber { --a: #f59e0b; } .xc-kpi.red { --a: #ef4444; } .xc-kpi.green { --a: #16a34a; } .xc-kpi.violet { --a: #7c3aed; } .xc-kpi.teal { --a: #0d9488; }
.xc-kpi-ic { grid-row: 1 / 3; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; color: var(--a); background: color-mix(in srgb, var(--a) 13%, transparent); }
.xc-kpi-n { font-size: 22px; font-weight: 900; line-height: 1.2; }
.xc-kpi-l { font-size: 11.5px; color: var(--xc-text-3); font-weight: 700; }
.xc-kpi.alert .xc-kpi-ic { animation: xc-pulse 2s ease-in-out infinite; }
@keyframes xc-pulse { 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--a) 15%, transparent); } }
.xc-ov-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 14px; }
.xc-quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.xc-quick > button, .xc-quick > a { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; border: 1px solid var(--xc-border); background: var(--xc-surface-2);
  font: inherit; font-size: 12.5px; font-weight: 800; color: var(--xc-text); cursor: pointer; text-align: right; transition: transform .15s, border-color .15s; }
.xc-quick > :is(button, a):hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--xc-accent) 35%, var(--xc-border)); }
.xc-quick small { display: block; font-size: 11px; color: var(--xc-text-3); font-weight: 600; margin-top: 2px; }
.xc-qi { --a: #2563eb; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; color: var(--a); background: color-mix(in srgb, var(--a) 12%, transparent); flex-shrink: 0; }
.xc-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; counter-reset: s; }
.xc-steps li { display: flex; gap: 10px; align-items: flex-start; font-size: 12.5px; line-height: 1.9; color: var(--xc-text-2); }
.xc-steps li::before { counter-increment: s; content: counter(s); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
  background: var(--xc-accent-bg); color: var(--xc-accent); font-weight: 900; font-size: 12px; }
.xc-steps b { color: var(--xc-text); }

/* ── فهرستِ پاسخنامه‌ها ── */
.xc-list { display: flex; flex-direction: column; gap: 8px; transition: opacity .15s; }
.xc-busy { opacity: .6; pointer-events: none; }
.xc-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--xc-radius); background: var(--xc-surface); border: 1px solid var(--xc-border); box-shadow: var(--xc-shadow);
  cursor: pointer; transition: border-color .15s, transform .1s; text-align: right; font: inherit; color: inherit; width: 100%; }
.xc-row:hover { border-color: color-mix(in srgb, var(--xc-accent) 35%, var(--xc-border)); }
.xc-row-thumb { position: relative; width: 56px; height: 72px; border-radius: 10px; overflow: hidden; flex-shrink: 0; background: var(--xc-bg); display: grid; place-items: center; color: var(--xc-text-3); font-size: 22px; border: 1px solid var(--xc-border); }
.xc-row-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.xc-row-thumb b { position: absolute; left: 4px; bottom: 4px; font-size: 10px; font-weight: 900; background: rgba(17,24,39,.75); color: #fff; border-radius: 6px; padding: 1px 5px; }
.xc-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.xc-row-title { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.xc-row-title b { font-size: 13.5px; font-weight: 800; }
.xc-row-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11.5px; color: var(--xc-text-3); }
.xc-row-meta span { display: inline-flex; align-items: center; gap: 3px; }
.xc-row-score { text-align: center; min-width: 64px; }

/* حلقه‌ی نمره */
.xc-ring { --p: 0; --c: var(--xc-accent); width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
  background: radial-gradient(closest-side, var(--xc-surface) 76%, transparent 78% 100%), conic-gradient(var(--c) calc(var(--p) * 1%), var(--xc-border) 0); }
.xc-ring b { font-size: 14px; font-weight: 900; }
.xc-ring.lg { width: 92px; height: 92px; } .xc-ring.lg b { font-size: 22px; }
.xc-ring.sm { width: 44px; height: 44px; } .xc-ring.sm b { font-size: 12px; }
.xc-ring.good { --c: #16a34a; } .xc-ring.mid { --c: #d97706; } .xc-ring.low { --c: #dc2626; }

/* ── مودال ── */
.xc-modal-bg { position: fixed; inset: 0; z-index: 9000; background: rgba(15,23,42,.55); display: flex; align-items: center; justify-content: center; padding: 16px; animation: xc-in .15s ease; }
@keyframes xc-in { from { opacity: 0; } to { opacity: 1; } }
.xc-modal { width: min(920px, 100%); max-height: 92vh; overflow-y: auto; overscroll-behavior: contain; background: var(--xc-surface); color: var(--xc-text); border-radius: 22px; padding: 18px 18px 0;
  box-shadow: 0 30px 70px rgba(0,0,0,.3); direction: rtl; }
.xc-modal.xl { width: min(1180px, 100%); } .xc-modal.sm { width: min(560px, 100%); }
.xc-modal-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 14px; }
.xc-modal-h h3 { margin: 0; font-size: 16px; font-weight: 900; display: flex; align-items: center; gap: 8px; min-width: 0; overflow-wrap: anywhere; }
.xc-modal-h h3 > i { color: var(--xc-accent); }
.xc-modal-h p { margin: 4px 0 0; font-size: 12px; color: var(--xc-text-3); }
.xc-modal-f { position: sticky; bottom: 0; display: flex; gap: 8px; padding: 12px 0 16px; margin-top: 6px; background: var(--xc-surface); border-top: 1px solid var(--xc-border); flex-direction: row-reverse; flex-wrap: wrap; z-index: 2; }
.xc-modal-f .grow { flex: 1; }
.xc-modal { border: 1px solid var(--xc-border); box-shadow: 0 24px 60px -20px rgba(15,23,42,.45); }
.xc-readonly { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; border-radius: 12px; border: 1px dashed var(--xc-border-strong); background: var(--xc-surface-2); font-size: 13px; }
.xc-readonly > i { color: var(--xc-accent); font-size: 18px; }
select.xc-input option:disabled { color: var(--xc-text-3); }
.xc-section { padding: 14px; border-radius: 16px; background: var(--xc-surface-2); border: 1px solid var(--xc-border); margin-bottom: 12px; }
.xc-section > h4 { margin: 0 0 10px; font-size: 13.5px; font-weight: 900; display: flex; align-items: center; gap: 6px; }
.xc-section > h4 > i { color: var(--xc-accent); }
.xc-stepper { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.xc-stepper span { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; color: var(--xc-text-3); padding: 6px 10px; border-radius: 999px; background: var(--xc-bg); }
.xc-stepper span.on { background: var(--xc-accent); color: #fff; } .xc-stepper span.done { background: var(--xc-ok-bg); color: var(--xc-ok); }

/* ── انتخابِ دانش‌آموز/آزمون ── */
.xc-picks { display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow-y: auto; overscroll-behavior: contain; padding: 2px; }
.xc-pick { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--xc-border); background: var(--xc-surface); cursor: pointer; text-align: right; font: inherit; color: inherit; width: 100%; }
.xc-pick:hover:not(:disabled) { border-color: color-mix(in srgb, var(--xc-accent) 40%, var(--xc-border)); }
.xc-pick.on { border-color: var(--xc-accent); background: var(--xc-accent-bg); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.xc-pick:disabled { opacity: .55; cursor: not-allowed; }
.xc-pick-av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 13px; color: var(--xc-accent); background: var(--xc-accent-bg); flex-shrink: 0; }
.xc-pick-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.xc-pick-main b { font-size: 13px; }
.xc-pick-main small { font-size: 11px; color: var(--xc-text-3); }
.xc-selected { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--xc-accent-bg); margin-bottom: 10px; }

/* ── بارگذاریِ برگ‌ها ── */
.xc-up { border: 2px dashed color-mix(in srgb, var(--xc-accent) 30%, var(--xc-border)); border-radius: 16px; padding: 14px; background: color-mix(in srgb, var(--xc-accent) 3%, var(--xc-surface)); }
.xc-up-acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.xc-up-acts label { cursor: pointer; }
.xc-up-hint { text-align: center; font-size: 12px; color: var(--xc-text-3); margin-top: 8px; line-height: 1.9; }
.xc-up-pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin-top: 12px; }
.xc-up-page { position: relative; aspect-ratio: 3 / 4; border-radius: 12px; overflow: hidden; background: var(--xc-bg); border: 1px solid var(--xc-border); }
.xc-up-page img { width: 100%; height: 100%; object-fit: cover; }
.xc-up-page .n { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%; background: var(--xc-accent); color: #fff; font-size: 12px; font-weight: 900; display: grid; place-items: center; }
.xc-up-page .acts { position: absolute; inset: auto 0 0 0; display: flex; justify-content: center; gap: 4px; padding: 6px; background: linear-gradient(0deg, rgba(0,0,0,.6), transparent); }
.xc-up-page .acts button { width: 28px; height: 28px; border-radius: 8px; border: 0; background: rgba(255,255,255,.9); color: #111827; display: grid; place-items: center; cursor: pointer; font-size: 15px; }
.xc-up-page .acts button:disabled { opacity: .4; }
.xc-up-page.busy { display: grid; place-items: center; color: var(--xc-accent); }
.xc-hidden-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* ── کلیدِ پاسخ ── */
.xc-key-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px; }
.xc-key-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; background: var(--xc-surface); border: 1px solid var(--xc-border); }
.xc-key-row.miss { border-color: color-mix(in srgb, var(--xc-warn) 50%, var(--xc-border)); }
.xc-key-n { width: 30px; font-size: 12px; font-weight: 900; color: var(--xc-text-3); text-align: center; flex-shrink: 0; }
.xc-bubbles { display: flex; gap: 4px; }
.xc-bubble { width: 32px; height: 32px; border-radius: 50%; border: 1.5px solid var(--xc-border-strong); background: var(--xc-surface); color: var(--xc-text-2); font: inherit; font-size: 13px; font-weight: 900; cursor: pointer; display: grid; place-items: center; transition: all .12s; }
.xc-bubble:hover { border-color: var(--xc-accent); color: var(--xc-accent); }
.xc-bubble.on { background: var(--xc-accent); border-color: var(--xc-accent); color: #fff; }
.xc-bubble.right { background: var(--xc-ok); border-color: var(--xc-ok); color: #fff; }
.xc-bubble.wrong { background: var(--xc-bad); border-color: var(--xc-bad); color: #fff; }
.xc-desc-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) 90px; gap: 8px; align-items: start; padding: 8px; border-radius: 12px; background: var(--xc-surface); border: 1px solid var(--xc-border); margin-bottom: 6px; }
.xc-desc-row.miss { border-color: color-mix(in srgb, var(--xc-warn) 50%, var(--xc-border)); }

/* ── بازبینیِ پاسخنامه ── */
.xc-review { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 14px; align-items: start; }
.xc-pages { position: sticky; top: 0; display: flex; flex-direction: column; gap: 8px; }
.xc-page-view { position: relative; border-radius: 14px; overflow: hidden; border: 1px solid var(--xc-border); background: #0f172a; }
.xc-page-view img { display: block; width: 100%; max-height: 64vh; object-fit: contain; cursor: zoom-in; }
.xc-page-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.xc-page-tabs button { width: 48px; height: 62px; border-radius: 8px; overflow: hidden; border: 2px solid transparent; padding: 0; cursor: pointer; background: var(--xc-bg); }
.xc-page-tabs button.on { border-color: var(--xc-accent); }
.xc-page-tabs img { width: 100%; height: 100%; object-fit: cover; }
.xc-result-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px; border-radius: 16px; background: var(--xc-surface-2); border: 1px solid var(--xc-border); margin-bottom: 10px; }
.xc-result-stats { display: flex; gap: 6px; flex-wrap: wrap; }
.xc-why { padding: 10px 12px; border-radius: 12px; background: var(--xc-accent-bg); font-size: 12.5px; line-height: 2; margin-bottom: 10px; }
.xc-why b { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; color: var(--xc-accent); }
.xc-qtable { display: flex; flex-direction: column; gap: 6px; }
.xc-q { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 8px; align-items: start; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--xc-border); background: var(--xc-surface);
  border-inline-start: 4px solid var(--xc-border-strong); }
.xc-q.Correct { border-inline-start-color: var(--xc-ok); } .xc-q.Wrong { border-inline-start-color: var(--xc-bad); }
.xc-q.Partial { border-inline-start-color: var(--xc-warn); } .xc-q.Blank { border-inline-start-color: var(--xc-text-3); }
.xc-q-n { font-weight: 900; font-size: 13px; color: var(--xc-text-3); text-align: center; padding-top: 2px; }
.xc-q-body { min-width: 0; display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; line-height: 1.9; }
.xc-q-body .ans { color: var(--xc-text); overflow-wrap: anywhere; }
.xc-q-body .key { color: var(--xc-text-3); font-size: 11.5px; overflow-wrap: anywhere; }
.xc-q-body .why { color: var(--xc-text-2); font-size: 11.5px; }
.xc-q-score { font-weight: 900; font-size: 13px; white-space: nowrap; text-align: left; direction: ltr; }
.xc-q input.xc-input { padding: 6px 8px; font-size: 12.5px; }

/* ── کارنامه ── */
.xc-rc-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin-bottom: 14px; }
.xc-rc-cat { --a: #2563eb; display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 16px; border: 1px solid var(--xc-border); background: var(--xc-surface); cursor: pointer; text-align: right;
  font: inherit; color: inherit; transition: border-color .15s, transform .15s; position: relative; overflow: hidden; }
.xc-rc-cat:hover { transform: translateY(-2px); }
.xc-rc-cat.on { border-color: var(--a); box-shadow: 0 0 0 3px color-mix(in srgb, var(--a) 15%, transparent); }
.xc-rc-cat.empty { opacity: .6; }
.xc-rc-cat-top { display: flex; align-items: center; gap: 8px; }
.xc-rc-cat-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; color: var(--a); background: color-mix(in srgb, var(--a) 12%, transparent); flex-shrink: 0; }
.xc-rc-cat-top b { font-size: 12.5px; font-weight: 900; line-height: 1.5; }
.xc-rc-cat-nums { display: flex; align-items: baseline; gap: 8px; }
.xc-rc-cat-nums .avg { font-size: 22px; font-weight: 900; }
.xc-rc-cat-nums small { font-size: 11px; color: var(--xc-text-3); }
.xc-trend { font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; gap: 2px; }
.xc-trend.up { color: var(--xc-ok); } .xc-trend.down { color: var(--xc-bad); }
.xc-spark { width: 100%; height: 34px; display: block; }
.xc-cat-National { --a: #2563eb; } .xc-cat-School { --a: #0d9488; } .xc-cat-Teacher { --a: #7c3aed; } .xc-cat-Institute { --a: #ea580c; }
.xc-cat-Quiz { --a: #f59e0b; } .xc-cat-SelfTest { --a: #64748b; } .xc-cat-Counselor { --a: #db2777; }
.xc-entries { display: flex; flex-direction: column; gap: 8px; }
.xc-entry { --a: #2563eb; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--xc-surface); border: 1px solid var(--xc-border); border-inline-start: 4px solid var(--a); }
.xc-entry-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.xc-entry-main b { font-size: 13px; font-weight: 800; overflow-wrap: anywhere; }
.xc-entry-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11.5px; color: var(--xc-text-3); }
.xc-entry-meta span { display: inline-flex; align-items: center; gap: 3px; }
.xc-entry-detail { font-size: 11.5px; color: var(--xc-text-2); }

/* ── تأمینِ سوال ── */
.xc-supply { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 14px; align-items: start; }
.xc-tree { display: flex; flex-direction: column; gap: 2px; max-height: 360px; overflow-y: auto; overscroll-behavior: contain; padding: 4px; border: 1px solid var(--xc-border); border-radius: 12px; background: var(--xc-surface); }
.xc-tree label { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; font-size: 12.5px; cursor: pointer; }
.xc-tree label:hover { background: var(--xc-bg); }
.xc-tree label.l2 { padding-inline-start: 26px; font-size: 12px; color: var(--xc-text-2); }
.xc-tree label.l3 { padding-inline-start: 44px; font-size: 11.5px; color: var(--xc-text-3); }
.xc-tree input { width: 16px; height: 16px; accent-color: var(--xc-accent); flex-shrink: 0; }
.xc-avail { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 12px; }
.xc-avail button { display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: 12px; border: 1.5px solid var(--xc-border); background: var(--xc-surface); cursor: pointer; font: inherit; color: inherit; text-align: right; }
.xc-avail button.on { border-color: var(--xc-accent); background: var(--xc-accent-bg); }
.xc-avail b { font-size: 18px; font-weight: 900; }
.xc-avail small { display: block; font-size: 11px; color: var(--xc-text-3); }
.xc-qcards { display: flex; flex-direction: column; gap: 8px; }
.xc-qcard { padding: 12px; border-radius: 14px; border: 1px solid var(--xc-border); background: var(--xc-surface); }
.xc-qcard.off { opacity: .5; }
.xc-qcard-h { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.xc-qcard-h .n { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--xc-accent-bg); color: var(--xc-accent); font-weight: 900; font-size: 12px; flex-shrink: 0; }
.xc-qcard p { margin: 0 0 6px; font-size: 13px; line-height: 2; overflow-wrap: anywhere; }
.xc-qopts { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; font-size: 12px; color: var(--xc-text-2); list-style: none; padding: 0; margin: 0 0 6px; }
.xc-qopts li { display: flex; gap: 6px; align-items: flex-start; }
.xc-qopts li.ok { color: var(--xc-ok); font-weight: 800; }
.xc-qans { font-size: 12px; color: var(--xc-ok); background: var(--xc-ok-bg); border-radius: 8px; padding: 6px 8px; line-height: 1.9; }

/* ── واکنش‌گرا ── */
@media (max-width: 960px) {
  .xc-ov-grid, .xc-review, .xc-supply { grid-template-columns: 1fr; }
  .xc-pages { position: static; }
}
@media (max-width: 640px) {
  .xc { padding: 0 0 40px; }
  .xc-head { padding: 14px; border-radius: 18px; }
  .xc-head-ic { width: 42px; height: 42px; font-size: 22px; }
  .xc-head h1 { font-size: 18px; }
  .xc-head-acts { width: 100%; } .xc-head-acts .xc-btn { flex: 1; }
  .xc-grid2, .xc-grid3 { grid-template-columns: 1fr; }
  .xc-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .xc-kpi { padding: 12px; } .xc-kpi-n { font-size: 19px; }
  .xc-quick { grid-template-columns: 1fr; }
  .xc-modal-bg { padding: 0; align-items: flex-end; }
  .xc-modal, .xc-modal.xl, .xc-modal.sm { width: 100%; max-height: 94vh; border-radius: 22px 22px 0 0; }
  .xc-key-grid { grid-template-columns: 1fr; }
  .xc-desc-row { grid-template-columns: 30px minmax(0, 1fr); } .xc-desc-row > :last-child { grid-column: 2; }
  .xc-qopts { grid-template-columns: 1fr; }
  .xc-row { flex-wrap: wrap; }
  .xc-rc-cats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .xc *, .xc *::before, .xc *::after { animation: none !important; transition: none !important; }
}

/* ============================================================
   🎨 Update 48 — «طراحیِ آزمون» (xd-): ستونِ دسته‌ها + کارت‌هایِ آزمون + جادوگرِ ساخت
   ============================================================ */
.xc-chip.muted { background: var(--xc-bg); color: var(--xc-text-2); }

.xd-scope { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-radius: 14px; margin-bottom: 14px; font-size: 12.5px; line-height: 1.8;
  background: var(--xc-accent-bg); color: var(--xc-text); border: 1px solid color-mix(in srgb, var(--xc-accent) 18%, transparent); }
.xd-scope > i { font-size: 20px; color: var(--xc-accent); }
.xd-scope > span:not(.xd-scope-stat) { flex: 1 1 260px; }
.xd-scope.teacher { background: color-mix(in srgb, var(--xc-teal) 10%, var(--xc-surface)); border-color: color-mix(in srgb, var(--xc-teal) 22%, transparent); }
.xd-scope.teacher > i { color: var(--xc-teal); }
.xd-scope.school { background: color-mix(in srgb, var(--xc-violet) 9%, var(--xc-surface)); border-color: color-mix(in srgb, var(--xc-violet) 20%, transparent); }
.xd-scope.school > i { color: var(--xc-violet); }
.xd-scope-stat { font-weight: 900; font-size: 12px; color: var(--xc-text-2); background: var(--xc-surface); padding: 4px 10px; border-radius: 999px; border: 1px solid var(--xc-border); }

.xd-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
.xd-side { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; overscroll-behavior: contain; padding: 14px; border-radius: 18px;
  background: var(--xc-surface); border: 1px solid var(--xc-border); box-shadow: var(--xc-shadow); display: flex; flex-direction: column; gap: 10px; scrollbar-width: thin; }
.xd-side-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.xd-side-h h3 { margin: 0; font-size: 14.5px; font-weight: 900; display: flex; align-items: center; gap: 6px; } .xd-side-h h3 i { color: var(--xc-accent); }
.xd-side-hint { margin: 0; font-size: 11.5px; line-height: 1.8; color: var(--xc-text-3); display: flex; gap: 6px; } .xd-side-hint i { margin-top: 3px; }
.xd-cats { display: flex; flex-direction: column; gap: 12px; }
.xd-cat-group { display: flex; flex-direction: column; gap: 4px; }
.xd-cat-gh { font-size: 11px; font-weight: 900; color: var(--xc-text-3); letter-spacing: .2px; padding: 0 4px 2px; display: flex; align-items: center; gap: 5px; }
.xd-cat { position: relative; display: flex; align-items: center; border-radius: 12px; transition: background .15s; }
.xd-cat:hover { background: var(--xc-bg); }
.xd-cat.on { background: var(--xc-accent-bg); box-shadow: inset -3px 0 0 var(--xc-accent); }
.xd-cat-btn { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; border: 0; background: none; font: inherit; color: inherit; text-align: right; padding: 8px 10px; cursor: pointer; border-radius: 12px; }
.xd-cat-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; background: var(--xc-bg); color: var(--xc-accent); font-size: 17px; }
.xd-cat-ic.comp { color: var(--xc-violet); background: color-mix(in srgb, var(--xc-violet) 10%, var(--xc-surface)); }
.xd-cat.on .xd-cat-ic { background: var(--xc-accent); color: #fff; } .xd-cat.on .xd-cat-ic.comp { background: var(--xc-violet); }
.xd-cat-txt { display: flex; flex-direction: column; min-width: 0; }
.xd-cat-txt b { font-size: 13px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xd-cat-txt small { font-size: 11px; color: var(--xc-text-3); font-weight: 700; }
.xd-cat-del { opacity: 0; border: 0; background: none; color: var(--xc-text-3); width: 30px; height: 30px; border-radius: 8px; cursor: pointer; margin-inline-start: 4px; flex-shrink: 0; transition: all .15s; }
.xd-cat:hover .xd-cat-del, .xd-cat-del:focus-visible { opacity: 1; }
.xd-cat-del:hover { color: #fff; background: var(--xc-bad); }

.xd-main { min-width: 0; }
.xd-cat-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 16px 18px; border-radius: 18px; margin-bottom: 14px;
  background: var(--xc-surface); border: 1px solid var(--xc-border); box-shadow: var(--xc-shadow); }
.xd-crumbs { display: flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 800; color: var(--xc-text-3); }
.xd-cat-head h2 { margin: 4px 0 8px; font-size: 19px; font-weight: 900; }
.xd-cat-stats { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; font-weight: 700; color: var(--xc-text-2); }
.xd-cat-stats span { display: inline-flex; align-items: center; gap: 4px; } .xd-cat-stats i { color: var(--xc-accent); }
.xd-cat-stats .warn, .xd-cat-stats .warn i { color: var(--xc-warn); }

.xd-first { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding: 36px 16px; border-radius: 18px; border: 2px dashed var(--xc-border-strong); background: var(--xc-surface); }
.xd-first-ic { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; font-size: 30px; color: var(--xc-accent); background: var(--xc-accent-bg); }
.xd-first ol { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; counter-reset: s; }
.xd-first li { counter-increment: s; font-size: 12px; font-weight: 800; color: var(--xc-text-2); padding: 6px 12px; border-radius: 999px; background: var(--xc-bg); display: inline-flex; align-items: center; gap: 5px; }
.xd-first li::before { content: counter(s, persian) "."; color: var(--xc-accent); }

.xd-exams { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }
.xd-exam { position: relative; display: flex; gap: 12px; padding: 12px; border-radius: 18px; background: var(--xc-surface); border: 1px solid var(--xc-border); box-shadow: var(--xc-shadow); transition: border-color .15s, box-shadow .15s; min-width: 0; }
.xd-exam:hover { border-color: color-mix(in srgb, var(--xc-accent) 30%, var(--xc-border)); box-shadow: 0 12px 28px -18px rgba(30,64,175,.45); }
.xd-exam.live { border-color: color-mix(in srgb, var(--xc-accent) 55%, var(--xc-border)); box-shadow: 0 0 0 3px var(--xc-accent-bg); }
.xd-exam.past .xd-exam-cover { filter: saturate(.55); }
.xd-exam-cover { width: 76px; height: 100px; border-radius: 12px; overflow: hidden; flex-shrink: 0; background: linear-gradient(160deg, var(--xc-accent-bg), var(--xc-bg)); display: grid; place-items: center; color: var(--xc-accent); font-size: 28px; }
.xd-exam-cover img { width: 100%; height: 100%; object-fit: cover; }
.xd-exam-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.xd-exam-top { position: relative; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding-inline-end: 40px; }
.xd-more { position: absolute; top: -2px; left: 0; width: 32px; height: 32px; }
.xd-menu-bg { position: fixed; inset: 0; z-index: 40; }
.xd-menu { position: absolute; top: 34px; left: 0; z-index: 41; min-width: 210px; padding: 6px; border-radius: 14px; background: var(--xc-surface); border: 1px solid var(--xc-border);
  box-shadow: 0 18px 40px -16px rgba(15,23,42,.35); display: flex; flex-direction: column; animation: xc-in .12s ease; }
.xd-menu button, .xd-menu a { display: flex; align-items: center; gap: 8px; border: 0; background: none; font: inherit; font-size: 12.5px; font-weight: 700; color: var(--xc-text); padding: 9px 10px; border-radius: 9px; cursor: pointer; text-align: right; }
.xd-menu button:hover, .xd-menu a:hover { background: var(--xc-bg); color: var(--xc-accent); }
.xd-menu i { font-size: 16px; color: var(--xc-text-3); } .xd-menu :hover > i { color: inherit; }
.xd-menu .danger { color: var(--xc-bad); } .xd-menu .danger:hover { background: var(--xc-bad-bg); color: var(--xc-bad); }
.xd-menu hr { border: 0; border-top: 1px solid var(--xc-border); margin: 4px 0; }
.xd-exam-title { margin: 0; font-size: 14.5px; font-weight: 900; line-height: 1.6; overflow-wrap: anywhere; }
.xd-exam-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11.5px; font-weight: 700; color: var(--xc-text-2); }
.xd-exam-meta span { display: inline-flex; align-items: center; gap: 4px; } .xd-exam-meta i { color: var(--xc-text-3); font-size: 14px; }
.xd-topics { display: flex; flex-wrap: wrap; gap: 4px; }
.xd-topics span { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 8px; background: var(--xc-bg); color: var(--xc-text-2); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xd-topics span.more { background: var(--xc-accent-bg); color: var(--xc-accent); }
.xd-exam-acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 4px; }

/* جادوگر */
.xd-wiz { display: flex; flex-direction: column; }
.xd-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-bottom: 16px; counter-reset: x; }
.xd-step-pill { position: relative; display: flex; align-items: center; gap: 8px; border: 1px solid var(--xc-border); background: var(--xc-surface); font: inherit; color: var(--xc-text-2); padding: 8px 10px; border-radius: 14px; cursor: pointer; text-align: right; min-width: 0; transition: all .15s; }
.xd-step-pill .n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 900; background: var(--xc-bg); color: var(--xc-text-2); flex-shrink: 0; }
.xd-step-pill .t { font-size: 12.5px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xd-step-pill.done .n { background: var(--xc-ok); color: #fff; }
.xd-step-pill.on { border-color: var(--xc-accent); background: var(--xc-accent-bg); color: var(--xc-accent); }
.xd-step-pill.on .n { background: var(--xc-accent); color: #fff; }
.xd-pane { min-height: 320px; }
.xd-pane[hidden] { display: none !important; }
.xd-pane-grid { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 18px; }
.xd-chips-pick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.xd-chips-pick button { border: 1px solid var(--xc-border); background: var(--xc-surface); color: var(--xc-text-2); font: inherit; font-size: 12px; font-weight: 800; padding: 7px 12px; border-radius: 999px; cursor: pointer; }
.xd-chips-pick button.on { border-color: var(--xc-accent); background: var(--xc-accent); color: #fff; }
.xd-when { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; line-height: 1.8; padding: 10px 12px; border-radius: 12px; background: var(--xc-ok-bg); color: var(--xc-text); }
.xd-when > i { color: var(--xc-ok); font-size: 18px; margin-top: 2px; }
.xd-when.warn { background: var(--xc-warn-bg); } .xd-when.warn > i { color: var(--xc-warn); }
.xd-cover { position: relative; aspect-ratio: 3 / 4; border-radius: 16px; overflow: hidden; display: grid; place-items: center; background: linear-gradient(160deg, var(--xc-accent-bg), var(--xc-bg)); color: var(--xc-text-3); font-size: 40px; border: 1px dashed var(--xc-border-strong); margin-bottom: 8px; }
.xd-cover img { width: 100%; height: 100%; object-fit: cover; }
.xd-cover .xc-icon-btn { position: absolute; top: 8px; left: 8px; }

.xd-topic-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.xd-topic-pick { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.xd-book-fixed { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--xc-bg); font-size: 13px; } .xd-book-fixed i { color: var(--xc-accent); font-size: 18px; }
.xd-tree { display: flex; flex-direction: column; gap: 2px; max-height: 46vh; overflow-y: auto; overscroll-behavior: contain; padding: 4px; border-radius: 14px; border: 1px solid var(--xc-border); background: var(--xc-surface-2); }
.xd-node { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; cursor: pointer; font-size: 13px; transition: background .12s; }
.xd-node:hover { background: var(--xc-surface); }
.xd-node input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.xd-node .box { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--xc-border-strong); background: var(--xc-surface); display: grid; place-items: center; flex-shrink: 0; color: transparent; font-size: 13px; transition: all .12s; }
.xd-node .ttl { flex: 1; min-width: 0; }
.xd-node small { font-size: 10.5px; color: var(--xc-text-3); font-weight: 700; }
.xd-node.d0 .ttl { font-weight: 900; } .xd-node.d1 { padding-right: 30px; } .xd-node.d2 { padding-right: 50px; } .xd-node.d3 { padding-right: 70px; }
.xd-node.on { background: var(--xc-accent-bg); } .xd-node.on .box { background: var(--xc-accent); border-color: var(--xc-accent); color: #fff; }
.xd-node input:focus-visible + .box { outline: 3px solid rgba(37,99,235,.4); outline-offset: 2px; }
.xd-topic-sel { position: sticky; top: 0; padding: 12px; border-radius: 14px; background: var(--xc-bg); min-width: 0; }
.xd-topic-sel h4 { margin: 0 0 10px; font-size: 13px; font-weight: 900; display: flex; align-items: center; gap: 6px; }
.xd-sel-list { display: flex; flex-direction: column; gap: 6px; max-height: 42vh; overflow-y: auto; }
.xd-sel { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--xc-surface); border: 1px solid var(--xc-border); }
.xd-sel > span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.xd-sel b { font-size: 12.5px; font-weight: 800; overflow-wrap: anywhere; } .xd-sel small { font-size: 10.5px; color: var(--xc-text-3); }
.xd-sel button { border: 0; background: none; color: var(--xc-text-3); width: 26px; height: 26px; border-radius: 8px; cursor: pointer; flex-shrink: 0; }
.xd-sel button:hover { background: var(--xc-bad-bg); color: var(--xc-bad); }

.xd-src { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.xd-src-card { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: right; padding: 14px; border-radius: 16px; border: 2px solid var(--xc-border); background: var(--xc-surface); font: inherit; color: var(--xc-text); cursor: pointer; transition: all .15s; }
.xd-src-card i { font-size: 24px; color: var(--xc-text-3); } .xd-src-card b { font-size: 13.5px; font-weight: 900; } .xd-src-card small { font-size: 11.5px; color: var(--xc-text-3); line-height: 1.7; }
.xd-src-card.on { border-color: var(--xc-accent); background: var(--xc-accent-bg); } .xd-src-card.on i { color: var(--xc-accent); }
.xd-file { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; background: var(--xc-ok-bg); font-size: 12.5px; font-weight: 800; }
.xd-file > i { color: var(--xc-ok); font-size: 20px; } .xd-file a { flex: 1; color: var(--xc-text); }
.xd-key { margin-top: 6px; padding: 12px; border-radius: 16px; background: var(--xc-bg); }
.xd-key-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.xd-key-h h4 { margin: 0; font-size: 13.5px; font-weight: 900; display: flex; align-items: center; gap: 6px; } .xd-key-h h4 > i { color: var(--xc-accent); }
.xd-quick { display: flex; gap: 6px; align-items: center; flex: 0 1 340px; } .xd-quick .xc-input { padding: 7px 10px; font-family: ui-monospace, monospace; letter-spacing: 1px; }
.xd-key .xc-muted { display: block; margin: 6px 0 10px; line-height: 1.8; }
.xd-desc-list { display: flex; flex-direction: column; gap: 8px; }
.xd-desc { display: flex; align-items: flex-start; gap: 8px; padding: 8px; border-radius: 12px; background: var(--xc-surface); border: 1px solid var(--xc-border); }
.xd-desc.miss { border-color: color-mix(in srgb, var(--xc-warn) 50%, var(--xc-border)); }
.xd-desc .xc-key-n { margin-top: 10px; } .xd-desc textarea { flex: 1; resize: vertical; min-height: 58px; }
.xd-score { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 76px; flex-shrink: 0; } .xd-score small { font-size: 10.5px; color: var(--xc-text-3); font-weight: 800; }
.xd-score .xc-input { text-align: center; padding: 8px 4px; }
.xd-sum { margin-top: 8px; font-size: 12.5px; display: flex; align-items: center; gap: 6px; color: var(--xc-text-2); } .xd-sum.ok { color: var(--xc-ok); }

.xd-review { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.xd-review-card { display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: 16px; background: linear-gradient(135deg, var(--xc-accent-bg), var(--xc-surface)); border: 1px solid var(--xc-border); }
.xd-review-card img { width: 64px; height: 84px; object-fit: cover; border-radius: 10px; }
.xd-review-card h3 { margin: 0 0 6px; font-size: 16px; font-weight: 900; }
.xd-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.xd-checks li { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border-radius: 12px; font-size: 12.5px; line-height: 1.8; background: var(--xc-bg); }
.xd-checks li > i { font-size: 18px; margin-top: 2px; flex-shrink: 0; } .xd-checks li > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.xd-checks li.ok > i { color: var(--xc-ok); } .xd-checks li.warn { background: var(--xc-warn-bg); } .xd-checks li.warn > i { color: var(--xc-warn); }
.xd-checks li.bad { background: var(--xc-bad-bg); } .xd-checks li.bad > i { color: var(--xc-bad); } .xd-checks li.info > i { color: var(--xc-info); }

/* نتایج */
.xd-res-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.xd-res-kpis > div { padding: 12px; border-radius: 14px; background: var(--xc-bg); display: flex; flex-direction: column; gap: 2px; }
.xd-res-kpis b { font-size: 20px; font-weight: 900; } .xd-res-kpis span { font-size: 11.5px; color: var(--xc-text-3); font-weight: 800; }
.xd-table-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid var(--xc-border); }
.xd-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.xd-table th { text-align: right; font-size: 11px; font-weight: 900; color: var(--xc-text-3); background: var(--xc-surface-2); padding: 9px 12px; position: sticky; top: 0; white-space: nowrap; }
.xd-table td { padding: 9px 12px; border-top: 1px solid var(--xc-border); white-space: nowrap; }
.xd-table tbody tr:hover { background: var(--xc-surface-2); }
.xd-rank { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 999px; font-weight: 900; font-size: 12px; background: var(--xc-bg); }
.xd-rank.r1 { background: #fef3c7; color: #b45309; } .xd-rank.r2 { background: #e5e7eb; color: #374151; } .xd-rank.r3 { background: #fde2cf; color: #9a3412; }
.xd-score-pill { display: inline-block; min-width: 40px; text-align: center; padding: 2px 8px; border-radius: 8px; font-weight: 900; background: var(--xc-bg); }
.xd-score-pill.good { background: var(--xc-ok-bg); color: var(--xc-ok); } .xd-score-pill.mid { background: var(--xc-warn-bg); color: var(--xc-warn); } .xd-score-pill.low { background: var(--xc-bad-bg); color: var(--xc-bad); }
[data-theme="dark"] .xd-rank.r1 { background: rgba(245,158,11,.18); color: #fbbf24; } [data-theme="dark"] .xd-rank.r2 { background: rgba(255,255,255,.1); color: #e5e7eb; } [data-theme="dark"] .xd-rank.r3 { background: rgba(234,88,12,.18); color: #fb923c; }

@media (max-width: 1100px) {
  .xd-layout { grid-template-columns: 250px minmax(0, 1fr); }
  .xd-exams { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .xd-layout { grid-template-columns: minmax(0, 1fr); }
  .xd-side { position: static; max-height: none; }
  .xd-cats { flex-direction: row; overflow-x: auto; gap: 10px; padding-bottom: 4px; scroll-snap-type: x proximity; }
  .xd-cat-group { flex: 0 0 auto; min-width: 220px; scroll-snap-align: start; }
  .xd-cat-del { opacity: 1; }
  .xd-pane-grid, .xd-topic-layout { grid-template-columns: minmax(0, 1fr); }
  .xd-cover { aspect-ratio: 16 / 9; }
  .xd-steps .t { display: none; }
  .xd-step-pill { justify-content: center; }
}
@media (max-width: 560px) {
  .xd-src, .xd-res-kpis { grid-template-columns: 1fr 1fr; }
  .xd-src-card small { display: none; }
  .xd-exam-cover { width: 56px; height: 74px; }
  .xd-cat-head { padding: 14px; }
  .xd-cat-head .xc-btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .xd *, .xc-modal-bg * { animation: none !important; transition: none !important; }
}

/* ============================================================
   🆕 Update 51 — پنلِ «کاربرانِ آزمایشی» (sim-)
   ============================================================ */
.sim-live { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.16); color: #fff; font-size: 12px; font-weight: 800; }
.sim-live .dot { width: 9px; height: 9px; border-radius: 50%; background: #cbd5e1; }
.sim-live.on .dot { background: #4ade80; box-shadow: 0 0 0 0 rgba(74,222,128,.7); animation: sim-pulse 1.8s infinite; }
@keyframes sim-pulse { 70% { box-shadow: 0 0 0 9px rgba(74,222,128,0); } 100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); } }
.sim-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: 14px; align-items: start; }
.sim-acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sim-acts .grow { flex: 1; }
.sim-range { width: 100%; accent-color: var(--xc-accent); }
.sim-presets { display: flex; gap: 4px; flex-wrap: wrap; }
.sim-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
.sim-league-note { display: flex; gap: 6px; align-items: flex-start; font-size: 12px; line-height: 1.8; color: var(--xc-text-2, #4b5563); background: var(--xc-surface-2, #f8fafc); border-radius: 10px; padding: 8px 10px; margin: 0 0 10px; }
.sim-league-note a { color: var(--xc-primary, #2563eb); font-weight: 600; }
.sim-day { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 14px; background: var(--xc-surface-2); border: 1px solid var(--xc-border); min-width: 0; --lv: #94a3b8; border-top: 4px solid var(--lv); }
.sim-day.weak { --lv: #f97316; } .sim-day.mid { --lv: #eab308; } .sim-day.strong { --lv: #16a34a; } .sim-day.off { --lv: #94a3b8; opacity: .85; }
.sim-day.today { box-shadow: 0 0 0 2px var(--xc-accent); }
.sim-day-h { display: flex; align-items: center; justify-content: space-between; gap: 4px; font-size: 13px; }
.sim-levels { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.sim-levels button { border: 1px solid var(--xc-border); background: var(--xc-surface); color: var(--xc-text-2); font: inherit; font-size: 11px; font-weight: 800; padding: 5px 2px; border-radius: 8px; cursor: pointer; }
.sim-levels button.on { background: var(--lv); border-color: var(--lv); color: #fff; }
.sim-day-pct { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--xc-text-3); }
.sim-day-pct .xc-input.num { width: 64px; padding: 6px; }
.sim-bar { height: 6px; border-radius: 999px; background: var(--xc-bg); overflow: hidden; }
.sim-bar span { display: block; height: 100%; background: var(--lv); border-radius: inherit; transition: width .4s; }
.sim-day small { font-size: 10.5px; line-height: 1.6; }
.sim-av { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-size: 12px; font-weight: 900; color: #fff; margin-inline-end: 6px; vertical-align: middle; }
.sim-av.m { background: #3b82f6; } .sim-av.f { background: #ec4899; }
.sim-danger { border-color: color-mix(in srgb, var(--xc-bad) 35%, var(--xc-border)); }
.sim-flash { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 20060; display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-radius: 14px;
  font-size: 13px; font-weight: 800; color: #fff; box-shadow: 0 16px 40px -14px rgba(15,23,42,.5); max-width: calc(100vw - 32px); }
.sim-flash.ok { background: #16a34a; } .sim-flash.bad { background: #dc2626; }
@media (max-width: 1100px) { .sim-grid { grid-template-columns: minmax(0, 1fr); } .sim-week { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 560px) { .sim-week { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (prefers-reduced-motion: reduce) { .sim-live.on .dot { animation: none; } }
