/* نسخه 1.69.0: صفحه‌های ختم قرآن (/khatm/…). روی reader-tools.css (.rt، .rt-card، .rt-stats، --rt-ac) و account.css (.acc-msg) سوار است
   و رنگ‌ها از متغیرهای تم (--line، --surface، --muted، --ink) می‌آیند تا هر ۷ تم درست بماند. حرکت فقط transform و opacity، زیر ۲۰۰ms. */
.kh-lead { max-width: 65ch; color: var(--muted); margin: -6px 0 22px; line-height: 1.9; }
.kh-grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.kh-card { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: inherit; text-decoration: none; }
.kh-card h3 { font-size: 16px; line-height: 1.6; margin: 0; }
.kh-card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.8; }
.kh-card-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 13px; }
@media (hover: hover) and (pointer: fine) {
  .kh-card { transition: transform 160ms ease-out; }
  .kh-card:hover { transform: translateY(-2px); }
}
.kh-badge { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--surface-alt, rgba(0,0,0,.06)); color: var(--ink); }
.kh-badge.is-done { background: #00805f; color: #fff; }
.kh-badge.is-closed { background: #6b7280; color: #fff; }
.kh-bar { height: 8px; border-radius: 999px; background: var(--surface-alt, rgba(0,0,0,.08)); overflow: hidden; }
.kh-bar i { display: block; height: 100%; border-radius: inherit; background: var(--rt-ac); }
.kh-form { display: grid; gap: 12px; }
.kh-form .kh-row { display: flex; flex-wrap: wrap; gap: 12px; }
.kh-form label { display: grid; gap: 6px; flex: 1 1 200px; font-weight: 600; font-size: 14px; }
.kh-form input, .kh-form select, .kh-form textarea { min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; font-weight: 400; }
.kh-form textarea { min-height: 88px; resize: vertical; }
.kh-form small { color: var(--muted); font-weight: 400; }
.kh-check { display: flex !important; align-items: center; gap: 8px; flex: 0 0 auto !important; }
.kh-check input { min-height: 0; width: 20px; height: 20px; }
@media (pointer: coarse) { .kh-form input, .kh-form select, .kh-form textarea { font-size: 16px; } }
.kh-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.kh-actions form { margin: 0; }
.kh-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.kh-intent { font-size: 17px; line-height: 2; margin: 0 0 12px; }
/* جدول سهم‌ها: هر خانه یک دکمه یا نشانه ۴۴ پیکسلی؛ رنگ و نشانه هر دو وضعیت را می‌گویند (نه فقط رنگ). */
.kh-shares { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 8px; list-style: none; padding: 0; margin: 0; }
.kh-shares.is-many { grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 6px; }
.kh-share { position: relative; display: grid; place-items: center; min-height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; font-variant-numeric: tabular-nums; text-decoration: none; }
button.kh-share { cursor: pointer; width: 100%; }
.kh-share.is-reserved { background: repeating-linear-gradient(135deg, transparent 0 6px, rgba(0,0,0,.06) 6px 12px), var(--surface); color: var(--muted); }
.kh-share.is-done { background: #00805f; border-color: #00805f; color: #fff; }
.kh-share.is-mine { outline: 3px solid var(--rt-ac); outline-offset: 1px; font-weight: 700; }
.kh-share.is-queued::after { content: "…"; position: absolute; inset-block-start: 0; inset-inline-end: 4px; font-size: 13px; }
.kh-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 0 0 12px; padding: 0; list-style: none; color: var(--muted); font-size: 13px; }
.kh-legend span { display: inline-block; width: 16px; height: 16px; margin-inline-end: 6px; vertical-align: -3px; border-radius: 4px; border: 1px solid var(--line); }
.kh-legend .l-done { background: #00805f; }
.kh-legend .l-reserved { background: repeating-linear-gradient(135deg, transparent 0 3px, rgba(0,0,0,.2) 3px 6px); }
.kh-legend .l-mine { outline: 2px solid var(--rt-ac); }
.kh-mine { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.kh-mine li { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; }
.kh-copy { display: flex; gap: 8px; flex-wrap: wrap; }
.kh-copy input { flex: 1 1 260px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); direction: ltr; text-align: left; }
.kh-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.kh-table th, .kh-table td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: start; }
.kh-scroll { position: relative; overflow-x: auto; }
.kh-offline { padding: 10px 14px; border-radius: 10px; background: #8a5300; color: #fff; margin: 0 0 14px; }
.kh-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
details.kh-more > summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
@media (prefers-reduced-motion: reduce) { .kh-card { transition: none; } }
.kh-fieldset { display: grid; gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 0; }
.kh-fieldset legend { font-weight: 700; padding: 0 6px; }
.kh-danger { color: #b42318; border-color: currentColor; }
html[data-theme="night"] .kh-danger, html[data-theme="dark"] .kh-danger { color: #ff9b8f; }
/* نسخه 1.69.1: ۶۰۴ صفحه ختم انفرادی در ۳۰ بخش جمع‌شدنی (جزء)؛ فقط بخش صفحه بعدی باز است. */
.kh-group { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; }
.kh-group > summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 44px; padding: 0 14px; cursor: pointer; font-weight: 700; }
.kh-group > summary .kh-group-count { color: var(--muted); font-weight: 400; font-size: 14px; font-variant-numeric: tabular-nums; }
.kh-group > .kh-shares { padding: 0 12px 12px; }
/* نسخه 1.69.1: فیلدهای فرم ختم با Tab حلقه فوکوس دیدنی نداشتند (پیمایش صفحه‌کلید)؛ همان رنگ تأکید صفحه. :focus-within و نه
   :focus-visible، چون دکمه تقویم درون فیلد تاریخ فوکوس را درون خود فیلد می‌گیرد و خود فیلد دیگر :focus نیست. */
.kh-form :is(input, select, textarea):focus-within,
.kh-copy input:focus-within {
  outline: 2px solid var(--rt-ac);
  outline-offset: 2px;
}
/* نسخه 1.70.0: نشان وضعیت‌های تازه ختم (فعال و در انتظار) و جدول‌های مدیریت. */
.kh-badge.is-active { background: var(--rt-ac); color: #fff; }
html:is([data-theme="night"], [data-theme="dark"]) .kh-badge.is-active { color: #111; }
.kh-badge.is-wait { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.kh-facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0 0 12px; font-size: 14px; }
.kh-facts dt { color: var(--muted); }
.kh-facts dd { margin: 0; }
.kh-inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.kh-inline label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
.kh-inline :is(input, select) { min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; font-weight: 400; }
.kh-inline :is(input, select):focus-within { outline: 2px solid var(--rt-ac); outline-offset: 2px; }
@media (pointer: coarse) { .kh-inline :is(input, select) { font-size: 16px; } }
.kh-table form { margin: 0; display: inline-flex; gap: 6px; flex-wrap: wrap; }
/* نسخه 1.70.0: بند درون پیام «پایان مهلت» ختم انفرادی رنگ خود پیام را می‌گیرد (رنگ کم‌رنگ بند در تم‌های روشن کنتراست را زیر ۴.۵ می‌برد). */
.kh .acc-msg p { color: inherit; margin: 0 0 10px; }
/* رنگ پیام خطا روی پس‌زمینه کم‌رنگ خودش در تم‌های روشن به ۴.۵ نمی‌رسید؛ با کمی رنگ متن اصلی تیره‌تر (و در تم‌های تیره روشن‌تر) می‌شود. */
.kh .acc-msg.is-error { color: color-mix(in srgb, var(--error) 78%, var(--ink)); }
/* نسخه 1.92.0: نوع گروه قرآنی (سه گزینه با توضیح) و تیک «تأیید عضویت» با توضیح زیرش، در _GroupFields.cshtml. */
.kh-choices { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px 12px; margin: 0; display: grid; gap: 8px; min-width: 0; }
.kh-choices legend { font-weight: 600; font-size: 14px; padding: 0 6px; }
.kh-form .kh-choice { display: flex; align-items: flex-start; gap: 10px; font-weight: 400; padding: 8px; border-radius: 10px; cursor: pointer; }
.kh-form .kh-choice:has(input:checked) { background: color-mix(in srgb, var(--accent, var(--ink)) 9%, transparent); }
.kh-form .kh-choice input { min-height: 0; width: 20px; height: 20px; margin-top: 2px; flex: 0 0 auto; }
.kh-choice span, .kh-check-note span { display: grid; gap: 2px; }
.kh-check-note { align-items: flex-start !important; font-weight: 600; }
.kh-check-note input { margin-top: 2px; }
.kh-pending { display: grid; gap: 8px; }
/* نسخه 1.93.0: صفحه پیوند دعوت گروه و فهرست دعوت‌ها و پیوندهای مدیر. */
.kh-invite { max-width: 640px; margin-inline: auto; display: grid; gap: 12px; }
.kh-invite-kicker { margin: 0; color: var(--muted); font-weight: 600; }
.kh-invite-act { display: grid; gap: 10px; justify-items: start; }
.kh-invite-act p { margin: 0; }
.kh-linkbox { width: 100%; min-width: 0; min-height: 36px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; direction: ltr; }
.kh-linkrow { display: flex; gap: 6px; align-items: center; min-width: 0; }
.kh-linkrow .kh-linkbox { flex: 1 1 auto; }
.kh-sub { margin: 18px 0 6px; font-size: 16px; }

/* نسخه 1.94.0: تصویر گروه (یا حرف نخست نام) کنار عنوان، تالار گفتگو، انتخاب نقش و دلیل لغو ختم. */
.kh-head h1 { flex: 1 1 auto; min-width: 0; }
.kh-gimg { flex: 0 0 auto; width: 56px; height: 56px; border-radius: 14px; object-fit: cover; border: 1px solid var(--line); }
.kh-gimg.is-letter { display: inline-grid; place-items: center; font-size: 24px; font-weight: 700; background: var(--surface-alt, rgba(0,0,0,.06)); color: var(--ink); }
.kh-posts { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.kh-posts li { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.kh-posts p { margin: 4px 0 6px; white-space: pre-wrap; overflow-wrap: anywhere; }
.kh-post-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; font-size: 14px; }
.kh-small { min-height: 32px; padding: 2px 10px; font-size: 13px; }
.kh-role { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.kh-role select { min-height: 36px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; }
.kh-grow { flex: 1 1 220px; display: grid; gap: 4px; min-width: 0; }
.kh-grow input { min-height: 40px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; }
.kh-gimg.is-sm { width: 40px; height: 40px; border-radius: 10px; font-size: 18px; }
.kh-card .kh-head h3 { flex: 1 1 auto; min-width: 0; }
/* نسخه 1.94.0: نوار مرحله‌های فرم ساخت گروه (khatm.js stepForm). */
.kh-stepnav { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0 0 12px; padding: 0; counter-reset: khs; }
.kh-stepnav li { counter-increment: khs; display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 6px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; color: var(--muted, inherit); }
.kh-stepnav li::before { content: counter(khs); display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-alt, rgba(0,0,0,.06)); font-weight: 700; }
.kh-stepnav li[aria-current="step"] { border-color: currentColor; color: var(--ink); font-weight: 700; }
.kh-stepnav li.is-done::before { content: "✓"; }
.kh-step[hidden] { display: none; }
/* شماره مرحله به رقم زبان صفحه (فارسی و عربی)، مثل SiteText.Num. */
html[lang^="fa"] .kh-stepnav li::before { content: counter(khs, persian); }
html[lang^="ar"] .kh-stepnav li::before { content: counter(khs, arabic-indic); }
html[lang^="fa"] .kh-stepnav li.is-done::before, html[lang^="ar"] .kh-stepnav li.is-done::before { content: "✓"; }

/* نسخه 1.94.50 (D-15): قفل ویرایش و حذف ختم پس از نخستین خواندن. */
.kh-lockset { display: contents; border: 0; padding: 0; margin: 0; min-width: 0; }
.kh-lockset:disabled input, .kh-lockset:disabled select, .kh-lockset:disabled textarea, .kh-lockset:disabled button,
.kh-form [data-kh-lock]:disabled { opacity: .6; cursor: not-allowed; }
.kh-note { margin: 0 0 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb, currentColor 5%, transparent); line-height: 1.8; }
.kh-hint { font-size: .875rem; opacity: .85; }

/* نسخه 1.94.51 (D-16): فرم مکان (کشور با پرچم، استان، شهر) و نمایش مکان. */
.kh-place { display: grid; gap: 8px; border: 0; padding: 0; margin: 0; min-width: 0; }
.kh-place legend { font-weight: 700; padding: 0; margin-bottom: 6px; }
.kh-place-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.kh-place-grid > label { min-width: 0; }
.kh-place-grid select { width: 100%; min-width: 0; }
.kh-place-row { display: flex; align-items: center; gap: 8px; }
.kh-place-row select { flex: 1; }
.kh-place-flag, .kh-place-badge img { flex: none; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .12); object-fit: cover; }
.kh-place-flag[hidden], .kh-place-badge img[hidden] { display: none; }
.kh-place-badge { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
p.kh-place-badge { margin: 4px 0 10px; }
.kh-place-badge[hidden] { display: none; }
.kh-place .kh-req { color: inherit; }
.kh-place .kh-opt { font-weight: 400; }

/* نسخه 1.98.1 (خواست مالک): پرچم کشور درون خود کادر کشور، پیش از نام کشور، مثل صفحه ورود. */
.kh-place-row { position: relative; }
.kh-place-row .kh-place-flag { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); z-index: 1; pointer-events: none; }
.kh-place-row.has-flag select { padding-inline-start: 46px; }

/* نسخه 1.98.1 (خواست مالک، مثل صفحه ورود): فهرست بازشوی جستجودار کشور (با پرچم)، استان/ایالت و شهر. */
.kh-cc-host { position: relative; }
.kh-cc-hit { position: absolute; inset: 0; z-index: 2; cursor: pointer; }
.kh-cc-host select:disabled ~ .kh-cc-hit { display: none; }
.kh-cc-pop { position: fixed; z-index: 10000; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line, #dce5e0); border-radius: 12px; background: var(--surface, #fff); color: var(--ink, #263a32); box-shadow: 0 14px 34px rgba(0, 0, 0, .18); }
.kh-cc-pop[hidden] { display: none; }
.kh-cc-search { flex: none; min-height: 44px; margin: 8px; padding: 6px 12px; border: 1px solid var(--line, #dce5e0); border-radius: 10px; background: var(--surface, #fff); color: inherit; font: inherit; font-size: 16px; }
.kh-cc-list { flex: 1; min-height: 0; margin: 0; padding: 0 6px 6px; overflow-y: auto; overscroll-behavior: contain; list-style: none; }
.kh-cc-list li { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 6px 10px; border-radius: 8px; cursor: pointer; }
.kh-cc-list li[hidden] { display: none; }
.kh-cc-list li.is-active { background: var(--surface-alt, #eef3f0); }
.kh-cc-list li[aria-selected="true"] { font-weight: 700; }
.kh-cc-flag { flex: none; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .12); object-fit: cover; }
.kh-cc-empty { margin: 0; padding: 10px 14px 14px; color: var(--muted, #5f6e66); }
