/* ═══ فونت‌ها: از مسیر static/fonts بارگذاری می‌شوند (بدون وابستگی به Google Fonts) ═══ */
@font-face{font-family:"Vazirmatn";font-style:normal;font-display:swap;font-weight:100 900;
  src:url("fonts/vazirmatn-arabic-wght-normal.woff2") format("woff2-variations"),url("fonts/vazirmatn-arabic-wght-normal.woff2") format("woff2");
  unicode-range:U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC,U+102E0-102FB,U+10E60-10E7E,U+10EC2-10EC4,U+10EFC-10EFF,U+1EE00-1EE03,U+1EE05-1EE1F,U+1EE21-1EE22,U+1EE24,U+1EE27,U+1EE29-1EE32,U+1EE34-1EE37,U+1EE39,U+1EE3B,U+1EE42,U+1EE47,U+1EE49,U+1EE4B,U+1EE4D-1EE4F,U+1EE51-1EE52,U+1EE54,U+1EE57,U+1EE59,U+1EE5B,U+1EE5D,U+1EE5F,U+1EE61-1EE62,U+1EE64,U+1EE67-1EE6A,U+1EE6C-1EE72,U+1EE74-1EE77,U+1EE79-1EE7C,U+1EE7E,U+1EE80-1EE89,U+1EE8B-1EE9B,U+1EEA1-1EEA3,U+1EEA5-1EEA9,U+1EEAB-1EEBB,U+1EEF0-1EEF1}
@font-face{font-family:"Vazirmatn";font-style:normal;font-display:swap;font-weight:100 900;
  src:url("fonts/vazirmatn-latin-wght-normal.woff2") format("woff2-variations"),url("fonts/vazirmatn-latin-wght-normal.woff2") format("woff2");
  unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Amiri Quran";font-style:normal;font-display:swap;font-weight:400;
  src:url("fonts/amiri-quran-arabic-400-normal.woff2") format("woff2");
  unicode-range:U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC,U+102E0-102FB,U+10E60-10E7E,U+10EC2-10EC4,U+10EFC-10EFF,U+1EE00-1EE03,U+1EE05-1EE1F,U+1EE21-1EE22,U+1EE24,U+1EE27,U+1EE29-1EE32,U+1EE34-1EE37,U+1EE39,U+1EE3B,U+1EE42,U+1EE47,U+1EE49,U+1EE4B,U+1EE4D-1EE4F,U+1EE51-1EE52,U+1EE54,U+1EE57,U+1EE59,U+1EE5B,U+1EE5D,U+1EE5F,U+1EE61-1EE62,U+1EE64,U+1EE67-1EE6A,U+1EE6C-1EE72,U+1EE74-1EE77,U+1EE79-1EE7C,U+1EE7E,U+1EE80-1EE89,U+1EE8B-1EE9B,U+1EEA1-1EEA3,U+1EEA5-1EEA9,U+1EEAB-1EEBB,U+1EEF0-1EEF1}

/* ══════════════════════════════════════════════════════════════════════
   کارگاه ترجمهٔ قرآن — استایل‌شیت
   فهرست:  ۱ توکن‌ها · ۲ پایه · ۳ اجزای مشترک · ۴ نوار بالا · ۵ ورق آیه
           ۶ تب‌ها و بلوک‌ها · ۷ ترجمه/نسخه‌ها · ۸ گردش‌کار · ۹ منابع و تاریخچه
           ۱۰ مدیریت · ۱۱ واژه‌نامه · ۱۲ خواننده · ۱۳ ورود/خالی · ۱۴ واکنش‌گرایی
   ایدهٔ بصری: «جدول» — قاب دوخطِ لاجوردی و زرین صفحه‌های قرآنِ خطی — فقط روی ورق آیه
   و مدالیون شمارهٔ آیه؛ بقیهٔ رابط عمداً آرام، تخت و کم‌رنگ است تا متن آیه بدرخشد.
   ══════════════════════════════════════════════════════════════════════ */

/* ── ۱) توکن‌ها ─────────────────────────────────────────────────────── */
:root {
  color-scheme: light;

  /* مرکب و کاغذ */
  --ink: #1b2438;
  --ink-2: #3a4560;
  --muted: #5d677d;
  --bg: #f2f3f7;
  --surface: #ffffff;
  --surface-2: #f7f8fb;
  --line: #dfe3ec;
  --line-strong: #c3cadb;

  /* لاجورد — رنگ اصلی */
  --lapis: #1e3f7c;
  --lapis-hover: #16305f;
  --lapis-deep: #152d59;
  --lapis-tint: #e8eef9;
  --lapis-line: #b7c7e6;

  /* فیروزه‌ای — انجام‌شده / جاری */
  --teal: #0d7a72;
  --teal-ink: #0a5f59;
  --teal-tint: #e3f4f1;
  --teal-line: #a5dbd3;

  /* زرین — تذهیب و هشدار */
  --gold-rule: #d4b56a;
  --gold-ink: #7a5510;
  --gold-tint: #fbf3df;
  --gold-line: #e6cf94;

  /* روناس — خطر */
  --madder: #a2333a;
  --madder-tint: #fbeceb;
  --madder-line: #eab7b5;

  --focus: #2f63c7;

  --r-sm: 6px;
  --r: 8px;
  --r-lg: 12px;
  --shadow-pop: 0 14px 36px rgb(27 36 56 / 18%);

  --top: 3.75rem;
  --page: 68rem;

  --font-ui: "Vazirmatn", "Noto Sans Arabic", Tahoma, system-ui, sans-serif;
  --font-quran: "Amiri Quran", "Amiri", "Scheherazade New", "Noto Naskh Arabic", "Traditional Arabic", serif;
}

/* ── ۲) پایه ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html.modal-open { overflow: hidden; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.85 var(--font-ui);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
h1, h2, h3, h4 { margin: 0; line-height: 1.5; font-weight: 700; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; }
a { color: var(--lapis); text-underline-offset: .25em; }
a:hover { color: var(--lapis-hover); }
bdi { unicode-bidi: isolate; }
small { font-size: .8125rem; }
pre, code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
::selection { background: var(--lapis-line); }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; inset-block-start: .5rem; inset-inline-start: .5rem; z-index: 100;
  padding: .5rem 1rem; border-radius: var(--r); background: var(--lapis); color: #fff; text-decoration: none;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

.muted, .note, .field-hint { color: var(--muted); font-size: .875rem; line-height: 1.75; }
.stack { display: grid; gap: 1rem; align-content: start; }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.link { display: inline-flex; align-items: center; gap: .35rem; font-size: .9rem; font-weight: 600; text-decoration: none; }
.link:hover { text-decoration: underline; }
.dev-note {
  padding: .5rem .75rem; border: 1px dashed var(--line-strong); border-radius: var(--r);
  color: var(--muted); font-size: .8125rem; line-height: 1.7;
}
.dev-key { color: var(--muted); font-family: ui-monospace, Menlo, monospace; font-size: .8125rem; }
.current-work-label { color: var(--teal-ink); font-size: .75rem; font-weight: 700; white-space: nowrap; }

/* ── ۳) اجزای مشترک ─────────────────────────────────────────────────── */
.icon {
  width: 1.25em; height: 1.25em; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
}

/* دکمه */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 2.5rem; padding: .35rem 1rem;
  border: 1px solid var(--line-strong); border-radius: var(--r);
  background: var(--surface); color: var(--lapis);
  font: inherit; font-size: .9375rem; font-weight: 600; line-height: 1.5; text-decoration: none; cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--lapis-tint); border-color: var(--lapis-line); color: var(--lapis-hover); }
.btn-primary { background: var(--lapis); border-color: var(--lapis); color: #fff; }
.btn-primary:hover { background: var(--lapis-hover); border-color: var(--lapis-hover); color: #fff; }
.btn-quiet { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-quiet:hover { background: rgb(30 63 124 / 8%); border-color: transparent; color: var(--lapis); }
.btn-danger { color: var(--madder); border-color: var(--madder-line); }
.btn-danger:hover { background: var(--madder-tint); border-color: var(--madder); color: var(--madder); }
.btn-danger-solid { background: var(--madder); border-color: var(--madder); color: #fff; }
.btn-danger-solid:hover { background: #862a30; border-color: #862a30; color: #fff; }
.btn-sm { min-height: 2rem; padding: .15rem .75rem; font-size: .875rem; }
.btn-icon { width: 2.5rem; padding: 0; }
.btn-sm.btn-icon { width: 2rem; }
.btn-block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .6; cursor: not-allowed; }
.btn .icon { width: 1.15em; height: 1.15em; }
.spinner {
  width: 1em; height: 1em; flex: none; border-radius: 50%;
  border: 2px solid currentColor; border-inline-end-color: transparent; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* برچسب */
.chip {
  display: inline-flex; align-items: center; gap: .3rem; padding: 0 .65rem;
  border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface-2); color: var(--ink-2);
  font-size: .8125rem; font-weight: 600; line-height: 1.75; white-space: nowrap;
}
.chip .icon { width: 1em; height: 1em; }
.chip-teal { background: var(--teal-tint); border-color: var(--teal-line); color: var(--teal-ink); }
.chip-gold { background: var(--gold-tint); border-color: var(--gold-line); color: var(--gold-ink); }
.chip-red { background: var(--madder-tint); border-color: var(--madder-line); color: var(--madder); }
.chip-lapis { background: var(--lapis-tint); border-color: var(--lapis-line); color: var(--lapis); }
.tab-count {
  min-width: 1.5rem; padding: 0 .4rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line);
  color: var(--ink-2); font-size: .75rem; font-weight: 700; line-height: 1.5; text-align: center; font-variant-numeric: tabular-nums;
}

/* فرم */
.field { display: grid; gap: .35rem; min-width: 0; }
.field > label, .field > span:first-child { font-size: .9rem; font-weight: 600; color: var(--ink); }
.optional { color: var(--muted); font-size: .8125rem; font-weight: 400; }
input, select, textarea {
  width: 100%; min-height: 2.5rem; padding: .45rem .75rem;
  border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); color: var(--ink);
  font: inherit; font-size: .9375rem; line-height: 1.6;
}
input::placeholder, textarea::placeholder { color: #7c8598; }
textarea { min-height: 6rem; line-height: 1.9; resize: vertical; }
select {
  appearance: none; padding-inline-end: .75rem; padding-inline-start: 2.25rem; cursor: pointer;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235d677d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat left .65rem center / 1.1rem;
}
input:hover, select:hover, textarea:hover { border-color: #9aa5bf; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 0; border-color: var(--focus); }
input[type="checkbox"], input[type="radio"] { width: 1.1rem; min-height: 0; height: 1.1rem; padding: 0; accent-color: var(--lapis); flex: none; }
input[type="file"] { padding: .4rem .6rem; }
.input-sm { width: auto; min-height: 2rem; padding: .15rem .6rem; font-size: .875rem; }
select.input-sm { padding-inline-start: 2rem; }
.inline-fields { display: flex; align-items: center; gap: .5rem; }
.inline-fields > input, .inline-fields > select { flex: 1; min-width: 0; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(13rem, 100%), 1fr)); gap: .85rem 1rem; }
.fieldset { display: grid; gap: .85rem; margin: 0; padding: 1rem; border: 1px solid var(--line); border-radius: var(--r); min-width: 0; }
.fieldset > legend { padding-inline: .4rem; font-size: .9rem; font-weight: 700; }
.counter { margin-top: -.15rem; text-align: end; color: var(--muted); font-size: .8125rem; font-variant-numeric: tabular-nums; }
.check { display: inline-flex; align-items: center; gap: .5rem; font-size: .9375rem; cursor: pointer; }
.confirm-check { display: flex; align-items: center; gap: .4rem; color: var(--ink-2); font-size: .8125rem; cursor: pointer; }
.js .confirm-check { display: none; }
.no-js [data-nojs] { display: revert; }
.js [data-nojs] { display: none; }
.no-js [data-toggle-password] { display: none; }

.choice-group { display: grid; gap: .5rem; margin: 0; padding: 0; border: 0; min-width: 0; }
.choice-group > legend { padding: 0; margin-bottom: .4rem; font-size: .9rem; font-weight: 700; }
.choice {
  display: flex; align-items: flex-start; gap: .75rem; padding: .7rem 1rem;
  border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); cursor: pointer;
}
.choice:hover { border-color: var(--lapis-line); background: var(--surface-2); }
.choice:has(input:checked) { border-color: var(--lapis); background: var(--lapis-tint); box-shadow: inset 0 0 0 1px var(--lapis); }
.choice input { margin-top: .4rem; }
.choice-body { display: grid; }
.choice-body small { color: var(--muted); line-height: 1.7; }

/* توضیح‌کادر */
.callout {
  display: flex; align-items: flex-start; gap: .6rem; padding: .7rem .9rem;
  border: 1px solid var(--lapis-line); border-radius: var(--r); background: var(--lapis-tint);
  font-size: .9375rem; line-height: 1.75;
}
.callout > .icon { margin-top: .22rem; color: var(--lapis); }
.callout ul { margin: .3rem 0 0; padding-inline-start: 1.2rem; }
.callout-warn { background: var(--gold-tint); border-color: var(--gold-line); }
.callout-warn > .icon { color: var(--gold-ink); }
.callout-danger { background: var(--madder-tint); border-color: var(--madder-line); }
.callout-danger > .icon { color: var(--madder); }

/* کارت */
.card {
  display: grid; gap: .85rem; align-content: start; min-width: 0;
  padding: 1.1rem 1.25rem; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface);
}
.card-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; }
.card-head h3, .card-head h4 { font-size: 1.0625rem; }
.card-head-end { margin-inline-start: auto; }
.card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.empty {
  padding: 1.25rem; border: 1px dashed var(--line-strong); border-radius: var(--r-lg); background: var(--surface);
  color: var(--muted); text-align: center; font-size: .9375rem;
}

/* جزئیات بازشو */
.disclosure > summary {
  display: flex; align-items: center; gap: .5rem; padding: .4rem 0;
  color: var(--lapis); font-weight: 600; cursor: pointer; list-style: none;
}
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary::before {
  content: ""; width: 1rem; height: 1rem; flex: none; background: currentColor; transition: transform .15s;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m15 18-6-6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m15 18-6-6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
}
.disclosure[open] > summary::before { transform: rotate(-90deg); }
.disclosure > :not(summary) { margin-top: .6rem; }
.disclosure-block { padding: .35rem 1rem; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.disclosure-block[open] { padding-bottom: 1rem; }
.disclosure-quiet > summary { color: var(--muted); font-size: .875rem; font-weight: 500; }
.summary-hint { color: var(--muted); font-size: .8125rem; font-weight: 400; }

/* پنجرهٔ گفتگو */
.modal {
  width: min(38rem, calc(100vw - 1.5rem)); max-height: calc(100dvh - 2rem); padding: 0;
  border: 0; border-radius: var(--r-lg); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-pop);
}
.modal-sm { width: min(28rem, calc(100vw - 1.5rem)); }
.modal::backdrop { background: rgb(21 32 56 / 55%); }
.modal[open] { display: flex; flex-direction: column; overflow: hidden; animation: modal-in .16s ease-out; }
.modal > form { display: flex; flex-direction: column; min-height: 0; flex: 1; }
@keyframes modal-in { from { opacity: 0; transform: translateY(.5rem); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem 1.25rem; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 1.125rem; }
.modal-body { flex: 1; min-height: 0; overflow: auto; padding: 1.1rem 1.25rem; }
.modal-foot { display: flex; justify-content: flex-end; gap: .5rem; padding: .85rem 1.25rem; border-top: 1px solid var(--line); background: var(--surface-2); }

/* پیام‌های سامانه */
.flash-region { display: grid; gap: .5rem; }
.flash {
  display: flex; align-items: center; gap: .6rem; padding: .7rem .9rem;
  border: 1px solid var(--lapis-line); border-radius: var(--r); background: var(--lapis-tint); font-size: .9375rem;
}
.flash-close { display: grid; place-items: center; width: 1.75rem; height: 1.75rem; margin-inline-start: auto; padding: 0; border: 0; border-radius: var(--r-sm); background: none; color: inherit; cursor: pointer; }
.flash-close:hover { background: rgb(255 255 255 / 18%); }
.js .flash-region {
  position: fixed; inset-block-end: 1rem; inset-inline: 0; z-index: 90; width: min(32rem, calc(100% - 2rem)); margin-inline: auto;
}
.js .flash { border-color: transparent; background: var(--ink); color: #fff; box-shadow: var(--shadow-pop); animation: modal-in .2s ease-out; }
.js .flash .icon { color: #9db8ee; }

/* جدول داده */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.data-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.data-table th, .data-table td { padding: .65rem .9rem; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; }
.data-table thead th { background: var(--surface-2); color: var(--ink-2); font-size: .8125rem; font-weight: 700; white-space: nowrap; }
.data-table tbody tr:last-child > * { border-bottom: 0; }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table td { font-variant-numeric: tabular-nums; }
.data-table small { display: block; color: var(--muted); }
.data-table tbody th { font-weight: 600; }
.empty-cell { padding: 1.5rem !important; color: var(--muted); text-align: center !important; }

/* ستون ضمنیِ گریدهای تک‌ستونه نباید با رشتهٔ بلند و نشکن (مثل نام افزونه) از ظرف بیرون بزند */
.page, .workspace, .tabpanel, .block, .stack, .card, .admin-section, .reader-page,
.stage-panel, .stage-exec, .stage-result, .pref-item, .compare-body, .result-body, .run-form,
.verse-translation { grid-template-columns: minmax(0, 1fr); }
bdi, .note, .admin-node-list li, .data-table td, .data-table th { overflow-wrap: anywhere; }

/* ── ۴) نوار بالا و منوها ───────────────────────────────────────────── */
.topbar {
  position: sticky; inset-block-start: 0; z-index: 40;
  display: flex; align-items: center; gap: 1rem; min-height: var(--top); padding: .5rem 1.25rem;
  border-bottom: 1px solid var(--line); background: var(--surface);
}
.brand { display: flex; align-items: center; gap: .65rem; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
.brand-mark {
  display: grid; place-items: center; width: 2.25rem; height: 2.25rem; flex: none;
  border-radius: var(--r); background: var(--lapis); color: #fff; outline: 1px solid var(--gold-rule); outline-offset: 2px;
}
.brand-mark .icon { width: 1.35rem; height: 1.35rem; stroke-width: 1.6; }
.brand-text { display: grid; line-height: 1.35; }
.brand-text strong { font-size: 1rem; }
.brand-text small { color: var(--muted); font-size: .75rem; }
.top-context { display: flex; align-items: center; gap: .6rem; color: var(--ink-2); }
.top-context .separator { color: var(--line-strong); }
.topbar-actions { display: flex; align-items: center; gap: .4rem; margin-inline-start: auto; }
.account-name { display: inline-flex; align-items: center; gap: .5rem; font-size: .9375rem; font-weight: 600; }

.pop { position: relative; }
.location { display: inline-flex; align-items: center; gap: .5rem; }
.pop-panel {
  position: absolute; inset-block-start: calc(100% + .5rem); inset-inline-start: 0; z-index: 60;
  padding: .5rem; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-pop);
}
.menu-panel-end { inset-inline-start: auto; inset-inline-end: 0; }

.location-trigger {
  display: inline-flex; align-items: center; gap: .6rem; min-height: 2.5rem; padding: .3rem .85rem;
  border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface);
  color: var(--ink); font: inherit; font-size: .9375rem; font-weight: 700; cursor: pointer;
}
.location-trigger:hover, .location-trigger[aria-expanded="true"] { border-color: var(--lapis); background: var(--lapis-tint); }
.location-trigger [lang="ar"] { font-family: var(--font-quran); font-size: 1.2rem; font-weight: 400; color: var(--lapis); }
.location-trigger .icon { color: var(--muted); }
.location-panel { display: grid; gap: 1rem; width: min(30rem, calc(100vw - 2rem)); padding: 1rem; }
.surah-form { display: grid; gap: .35rem; }
.surah-form > label { font-size: .875rem; font-weight: 600; }
.surah-search-field { position: relative; }
.surah-search-field > .icon {
  position: absolute; inset-inline-start: .7rem; inset-block-start: 50%; transform: translateY(-50%);
  width: 1rem; height: 1rem; color: var(--muted); pointer-events: none;
}
.surah-search-field input { width: 100%; padding-inline-start: 2.25rem; }
.surah-list {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .25rem;
  max-height: 12rem; margin: .15rem 0 0; padding: .35rem; overflow: auto; list-style: none;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2);
}
.surah-option {
  display: flex; align-items: center; gap: .55rem; width: 100%; min-height: 2.35rem; padding: .35rem .55rem;
  border: 0; border-radius: var(--r-sm); background: transparent; color: var(--ink); font: inherit; text-align: start; cursor: pointer;
}
.surah-option:hover, .surah-option:focus-visible { background: var(--lapis-tint); outline: none; }
.surah-option.is-current { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-strong); }
.surah-option .surah-no { min-width: 1.8rem; color: var(--muted); font-size: .8125rem; font-variant-numeric: tabular-nums; }
.surah-option .surah-name { font-family: var(--font-quran); font-size: 1.05rem; color: var(--lapis); }
.surah-list-empty { margin: .15rem .25rem 0; }
.ayah-picker-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .5rem; }
.ayah-picker-head h2 { font-size: .9375rem; }
.ayah-picker-head [lang="ar"] { font-family: var(--font-quran); font-size: 1.15rem; font-weight: 400; color: var(--lapis); }
.ayah-picker-head .input-sm { width: 8.5rem; }
.ayah-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(2.75rem, 100%), 1fr)); gap: .25rem;
  max-height: 14rem; margin: 0; padding: .35rem; overflow: auto; list-style: none;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2);
}
.ayah-grid a {
  display: grid; place-items: center; min-height: 2.25rem; border-radius: var(--r-sm);
  color: var(--ink); font-size: .875rem; font-weight: 600; text-decoration: none; font-variant-numeric: tabular-nums;
}
.ayah-grid a:hover { background: var(--lapis-tint); }
.ayah-grid a[aria-current="page"] { background: var(--lapis); color: #fff; }
.ayah-grid-empty { padding: .25rem .5rem; }

.menu-panel { display: grid; gap: .1rem; min-width: 15.5rem; }
.menu-heading { margin: .45rem .75rem .1rem; color: var(--muted); font-size: .8125rem; font-weight: 700; }
.menu-user { margin: .2rem .5rem .35rem; padding: .2rem .25rem .5rem; border-bottom: 1px solid var(--line); font-weight: 700; }
.menu-item {
  display: flex; align-items: center; gap: .65rem; width: 100%; padding: .5rem .75rem;
  border: 0; border-radius: var(--r-sm); background: none; color: var(--ink);
  font: inherit; font-size: .9375rem; text-align: start; text-decoration: none; cursor: pointer;
}
.menu-item:hover, .menu-item:focus-visible { background: var(--lapis-tint); color: var(--ink); }
.menu-item .icon { color: var(--lapis); }
.menu-item small { margin-inline-start: auto; color: var(--muted); }
.menu-item.is-disabled { color: var(--muted); cursor: not-allowed; }
.menu-item.is-disabled:hover { background: none; }
.menu-item.is-disabled .icon { color: var(--muted); }

.account-trigger {
  display: inline-flex; align-items: center; gap: .5rem; min-height: 2.5rem; padding: .2rem .55rem .2rem .7rem;
  border: 1px solid transparent; border-radius: 999px; background: none; color: var(--ink);
  font: inherit; font-size: .9375rem; font-weight: 600; cursor: pointer;
}
.account-trigger:hover, .account-trigger[aria-expanded="true"] { background: var(--surface-2); border-color: var(--line); }
.avatar {
  display: grid; place-items: center; width: 1.9rem; height: 1.9rem; flex: none;
  border-radius: 50%; background: var(--lapis-tint); color: var(--lapis); font-size: .9rem; font-weight: 700;
}

/* ── ۵) صفحه و ورق آیه ─────────────────────────────────────────────── */
.page { display: grid; gap: 1.25rem; align-content: start; width: min(100%, var(--page)); margin-inline: auto; padding: 1.25rem 1rem 4rem; }
.page-head { display: grid; gap: .25rem; padding-block: .5rem; }
.page-head h1 { font-size: 1.75rem; }

.verse-sheet {
  position: relative; padding: clamp(1rem, 2.4vw, 1.5rem) clamp(1.1rem, 4vw, 3rem) 1rem;
  border: 1.5px solid var(--lapis); border-radius: var(--r-lg); background: var(--surface);
}
.verse-sheet::before {
  content: ""; position: absolute; inset: 5px; pointer-events: none;
  border: 1px solid var(--gold-rule); border-radius: calc(var(--r-lg) - 4px); opacity: .8;
}
.verse-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1rem; padding-inline: .35rem; }
.verse-title { display: flex; align-items: center; gap: 1rem; font-size: 1.25rem; }
.surah-name { color: var(--lapis); font-family: var(--font-quran); font-size: 1.75rem; font-weight: 400; line-height: 1.6; }
.verse-num { display: inline-flex; align-items: center; gap: .55rem; color: var(--muted); font-size: .9375rem; font-weight: 500; }
.ayah-badge {
  display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem; flex: none;
  border: 1.5px solid var(--lapis); border-radius: 50%; background: var(--surface);
  box-shadow: inset 0 0 0 3px var(--surface), inset 0 0 0 4px var(--gold-rule);
  color: var(--lapis); font-size: .875rem; font-weight: 700; line-height: 1; text-decoration: none; font-variant-numeric: tabular-nums;
}
a.ayah-badge:hover { background: var(--lapis-tint); box-shadow: inset 0 0 0 3px var(--lapis-tint), inset 0 0 0 4px var(--gold-rule); }
.verse-pager { display: flex; gap: .4rem; }
.pager-btn {
  display: inline-flex; align-items: center; gap: .3rem; min-height: 2.5rem; padding: .3rem .8rem;
  border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface);
  color: var(--lapis); font-size: .9375rem; font-weight: 600; text-decoration: none;
}
.pager-btn:hover { background: var(--lapis-tint); border-color: var(--lapis-line); }
.pager-btn.is-disabled { opacity: .4; pointer-events: none; }

.arabic-ayah {
  max-width: 58rem; margin: 1.25rem auto .75rem; color: var(--ink); text-align: center; text-wrap: balance;
  font-family: var(--font-quran); font-size: 2.4rem; line-height: 2.3; font-feature-settings: "liga", "calt";
}
.arabic-ayah.short { font-size: 3rem; }
.arabic-ayah.medium { font-size: 2.5rem; }
.arabic-ayah.long { font-size: 2.1rem; }
.arabic-ayah.extended { font-size: 1.8rem; line-height: 2.4; }

.verse-rule { display: flex; align-items: center; gap: .75rem; max-width: 30rem; margin: 1rem auto 1.25rem; }
.verse-rule::before, .verse-rule::after { content: ""; flex: 1; height: 1px; background: var(--gold-rule); opacity: .7; }
.verse-rule span { width: .5rem; height: .5rem; border: 1.5px solid var(--gold-rule); transform: rotate(45deg); }

.verse-translation { max-width: 46rem; margin-inline: auto; }
.translation-text { color: var(--ink); font-size: 1.25rem; line-height: 2.15; }
.translation-text.small { font-size: 1.0625rem; line-height: 2; }
.verse-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .75rem; margin-top: .6rem; }
.verse-empty { padding: .5rem 0; color: var(--muted); text-align: center; }
.verse-foot { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: 1rem; padding: .75rem .35rem 0; border-top: 1px dashed var(--line-strong); }
.verse-foot-spacer { flex: 1; }
.verse-new-run { display: inline-flex; margin: 0; }
.revision-switch { display: flex; align-items: center; gap: .5rem; }
.revision-switch label { color: var(--muted); font-size: .875rem; cursor: help; }
.revision-switch select { min-width: 4.75rem; }

.next-step {
  display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; padding: .9rem 1.1rem;
  border: 1px solid var(--lapis-line); border-radius: var(--r-lg); background: var(--lapis-tint);
}
.next-step-icon { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; flex: none; border-radius: 50%; background: var(--lapis); color: #fff; }
.next-step-body { flex: 1 1 16rem; }
.next-step-body h2 { font-size: 1.0625rem; }
.next-step-body p { color: var(--ink-2); font-size: .9375rem; line-height: 1.7; }
.next-step.is-done { border-color: var(--teal-line); background: var(--teal-tint); }
.next-step.is-done .next-step-icon { background: var(--teal); }

/* ── ۶) تب‌ها و بلوک‌ها ────────────────────────────────────────────── */
.workspace { display: grid; gap: 1.25rem; align-content: start; min-width: 0; }
.tabbar {
  position: sticky; inset-block-start: calc(var(--top) + .5rem); z-index: 30;
  display: flex; gap: .25rem; padding: .3rem; overflow-x: auto; scrollbar-width: thin;
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: 0 2px 10px rgb(27 36 56 / 7%);
}
.no-js .tabbar { display: none; }
.tab {
  display: inline-flex; flex: 1 1 auto; align-items: center; justify-content: center; gap: .5rem; min-height: 2.6rem; padding: .3rem 1rem;
  border: 0; border-radius: var(--r); background: none; color: var(--ink-2);
  font: inherit; font-size: .9375rem; font-weight: 600; white-space: nowrap; cursor: pointer;
}
.tab:hover { background: var(--surface-2); color: var(--ink); }
.tab.is-active { background: var(--lapis); color: #fff; }
.tab.is-active .tab-count { background: rgb(255 255 255 / 18%); border-color: transparent; color: #fff; }

.tabpanel { display: grid; gap: 1.25rem; align-content: start; min-width: 0; scroll-margin-top: calc(var(--top) + 5rem); }
.js .tabpanel:not(.is-active) { display: none; }
.tabpanel:focus { outline: none; }
.tabpanel:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; border-radius: var(--r); }
.panel-title { padding-top: 1rem; border-top: 1px solid var(--line-strong); font-size: 1.25rem; }
.js .panel-title { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); border: 0; }

.block { display: grid; gap: .9rem; align-content: start; scroll-margin-top: calc(var(--top) + 5rem); }
.block-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem; }
.block-head h3 { display: flex; align-items: center; gap: .5rem; font-size: 1.1875rem; }
.block-head h3 .icon { color: var(--lapis); }
.block-head > .btn { margin-inline-start: auto; }
.block-lead { margin-top: -.4rem; }

/* ── ۷) ترجمه، پیشنهاد و نسخه‌ها ───────────────────────────────────── */
.start-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(20rem, 100%), 1fr)); gap: 1rem; }
.start-card { gap: 1rem; padding: 1.25rem 1.4rem; }
.start-card h3 { display: flex; align-items: center; gap: .5rem; font-size: 1.1875rem; }
.start-card h3 .icon { color: var(--lapis); }
.run-form { display: grid; gap: .6rem; justify-items: start; }
.model-options { width: 100%; }
.model-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(14rem, 100%), 1fr)); gap: .75rem; margin-top: .75rem; }
.model-options .field { margin-top: .5rem; }

.inline-cta {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1rem; padding: .9rem 1.1rem;
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface);
}
.inline-cta strong { display: block; }
.decision-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1rem; padding: .75rem 1rem;
  border: 1px dashed var(--line-strong); border-radius: var(--r); background: var(--surface-2);
}
.decision-bar p { display: grid; }

.proposal .translation-text { padding: .25rem 0; }
.translator-note { padding: .5rem .75rem; border-radius: var(--r); background: var(--surface-2); }
.feedback-list { display: grid; gap: .6rem; margin: 0; padding: 0; list-style: none; }
.feedback-list li { padding: .6rem .8rem; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.feedback-list small { color: var(--muted); }

.version.is-current { border-color: var(--teal); }
.decisions { display: grid; margin: .25rem 0 0; padding: 0; overflow: hidden; list-style: none; border: 1px solid var(--line); border-radius: var(--r); }
.decision {
  display: grid; grid-template-columns: auto 13rem auto; justify-content: start; align-items: center; gap: .75rem 1rem;
  padding: .6rem .9rem; background: var(--surface);
}
.decision + .decision { border-top: 1px solid var(--line); }
.decision-mark {
  display: grid; place-items: center; width: 1.75rem; height: 1.75rem; flex: none;
  border: 1.5px solid var(--line-strong); border-radius: 50%; color: #fff;
}
.decision-mark .icon { width: 1rem; height: 1rem; stroke-width: 2.5; }
.decision:not(.is-done) .decision-mark .icon { opacity: 0; }
.decision.is-done .decision-mark { border-color: var(--teal); background: var(--teal); }
.decision-text { display: grid; line-height: 1.55; }
.decision-text strong { font-size: .9375rem; }
.decision-text small { color: var(--muted); }
.decision-action { display: grid; justify-items: start; gap: .3rem; }
.decision-action form { display: flex; align-items: center; gap: .6rem; }
.decision-action:empty { display: none; }

.candidate-toolbar { display: flex; justify-content: flex-end; margin-top: .65rem; }
.candidate-compare { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(18rem, 1fr); gap: .65rem; margin-top: .6rem; padding: .15rem .1rem .6rem; overflow-x: auto; overscroll-behavior-inline: contain; scroll-snap-type: inline proximity; }
.candidate-compare-item { display: grid; align-content: start; gap: .45rem; padding: .85rem .9rem; border: 1px solid var(--lapis-line); border-radius: var(--r-lg); background: var(--lapis-tint); scroll-snap-align: start; }
.candidate-compare-item h4 { color: var(--lapis); font-size: .8rem; }
.candidate-compare-item p { color: var(--ink); font-size: .98rem; font-weight: 600; line-height: 1.95; }
.candidate-list { display: grid; grid-template-columns: minmax(0,1fr); gap: .55rem; margin-top: .75rem; }
.candidate-card { overflow: clip; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.candidate-card:hover { border-color: var(--lapis-line); box-shadow: 0 4px 16px rgb(27 36 56 / 8%); }
.candidate-card[open] { border-color: var(--lapis-line); }
.candidate-summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.35rem; padding: .7rem .85rem .7rem 1rem; cursor: pointer; list-style: none; }
.candidate-summary::-webkit-details-marker { display: none; }
.candidate-summary:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.candidate-main { display: grid; gap: .25rem; min-width: 0; flex: 1; }
.candidate-topline { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.candidate-index { color: var(--muted); font-size: .75rem; font-weight: 700; }
.candidate-translation { color: var(--lapis-deep); font-size: 1.02rem; font-weight: 680; line-height: 1.95; overflow-wrap: anywhere; }
.candidate-more { display: inline-flex; align-items: center; gap: .35rem; flex: none; color: var(--lapis); font-size: .75rem; font-weight: 650; white-space: nowrap; }
.candidate-more .icon { width: 1rem; height: 1rem; transition: transform .15s; }
.candidate-card[open] .candidate-more .icon { transform: rotate(180deg); }
.candidate-details { display: grid; gap: 0; border-top: 1px solid var(--line); background: var(--surface-2); }
.candidate-detail-row { display: grid; grid-template-columns: minmax(9rem, 13rem) minmax(0,1fr); gap: .75rem 1rem; padding: .7rem .9rem; }
.candidate-detail-row + .candidate-detail-row { border-top: 1px solid var(--line); }
.candidate-detail-row strong { color: var(--muted); font-size: .8rem; }
.candidate-detail-row p { line-height: 1.85; }
.footnote-list { display: grid; gap: .4rem; margin: .75rem 0 0; padding-inline-start: 1.4rem; color: var(--ink-2); }

/* ── ۸) گردش‌کار هوش مصنوعی ────────────────────────────────────────── */
.wf-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem 2rem; }
.wf-progress { display: grid; flex: 1 1 18rem; gap: .5rem; }
.progress { height: .5rem; overflow: hidden; border-radius: 999px; background: var(--line); }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--teal); }
.wf-layout { display: grid; grid-template-columns: 17.5rem minmax(0, 1fr); align-items: start; gap: 1.25rem; }
.stage-list {
  position: sticky; inset-block-start: calc(var(--top) + 4.75rem);
  display: grid; gap: .2rem; padding: .4rem; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface);
}
.stage {
  display: flex; align-items: center; gap: .7rem; padding: .5rem .6rem; border: 0; border-radius: var(--r);
  background: none; color: var(--ink); font: inherit; text-align: start; cursor: pointer;
}
.stage:hover { background: var(--surface-2); }
.stage.is-active { background: var(--lapis-tint); box-shadow: inset 0 0 0 1px var(--lapis-line); }
.stage-mark {
  display: grid; place-items: center; width: 1.85rem; height: 1.85rem; flex: none;
  border: 1.5px solid var(--lapis); border-radius: 50%; color: var(--lapis);
}
.stage-mark .icon { width: 1rem; height: 1rem; stroke-width: 2.2; }
.stage-text { display: grid; line-height: 1.45; }
.stage-text strong { font-size: .9375rem; }
.stage-text small { color: var(--muted); }
.state-done .stage-mark { border-color: var(--teal); background: var(--teal); color: #fff; }
.state-locked .stage-mark { border-color: var(--line-strong); background: var(--surface-2); color: var(--muted); }
.state-locked strong { color: var(--ink-2); }
.state-failed .stage-mark, .state-rejected .stage-mark { border-color: var(--madder); background: var(--madder-tint); color: var(--madder); }
.state-stale .stage-mark { border-color: var(--gold-rule); background: var(--gold-tint); color: var(--gold-ink); }

.stage-panels { min-width: 0; }
.stage-panel {
  display: grid; gap: 1rem; align-content: start; padding: 1.25rem; scroll-margin-top: calc(var(--top) + 5rem);
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface);
}
.js .stage-panel:not(.is-active) { display: none; }
.stage-panel:focus { outline: none; }
.stage-panel:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.stage-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.stage-head h3 { font-size: 1.25rem; }
.deps { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; padding: .6rem .8rem; border-radius: var(--r); background: var(--surface-2); font-size: .9rem; }
.deps ul { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; padding: 0; list-style: none; }
.dep {
  display: inline-flex; align-items: center; gap: .3rem; padding: 0 .65rem;
  border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--ink-2); font-size: .8125rem;
}
.dep .icon { width: .95em; height: .95em; }
.dep.is-done { border-color: var(--teal-line); background: var(--teal-tint); color: var(--teal-ink); }
.stage-exec { display: grid; justify-items: start; gap: .6rem; padding: .9rem 1rem; border: 1px solid var(--lapis-line); border-radius: var(--r); background: var(--lapis-tint); }
.stage-result {
  display: grid; gap: 1rem; min-width: 0; padding: 1rem;
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface-2);
}
.stage-result.has-output { border-color: var(--lapis-line); background: linear-gradient(180deg,var(--lapis-tint) 0, var(--surface-2) 8rem); }
.stage-result-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1rem; }
.stage-result-title { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.stage-result-title > div { display: grid; gap: .1rem; }
.stage-result-title > div > strong { font-size: 1.02rem; }
.stage-result-title small { color: var(--muted); font-size: .8125rem; line-height: 1.65; }
.stage-result-icon, .stage-result-empty-icon {
  display: grid; place-items: center; width: 2.35rem; height: 2.35rem; flex: none;
  border: 1px solid var(--lapis-line); border-radius: 50%; background: var(--surface); color: var(--lapis);
}
.stage-result-icon .icon, .stage-result-empty-icon .icon { width: 1.1rem; height: 1.1rem; }
.stage-result-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .45rem; }
.stage-output-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .15rem; }
.stage-output-tools .btn { min-height: 1.9rem; padding-inline: .55rem; font-size: .8rem; }
.stage-result-empty { display: flex; align-items: flex-start; gap: .75rem; padding: .9rem; border: 1px dashed var(--line-strong); border-radius: var(--r); background: var(--surface); }
.stage-result-empty > div { display: grid; gap: .15rem; }
.stage-result-empty strong { font-size: .9375rem; }
.result-body { display: grid; gap: .75rem; min-width: 0; }
.result-body blockquote { margin: 0; padding: .7rem .9rem; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.stage-output-full { padding: .1rem 0; }
.stage-output-group { display: grid; gap: .9rem; }
.stage-output-field { display: grid; gap: .4rem; min-width: 0; }
.stage-output-label { color: var(--muted); font-size: .78rem; font-weight: 700; letter-spacing: .01em; }
.stage-output-value { min-width: 0; }
.stage-output-value > p { color: var(--ink); line-height: 1.95; overflow-wrap: anywhere; }

/* خروجی‌های تکرارشونده عمداً یک‌ستونه‌اند: مقایسهٔ سریع، نه داشبورد چندستونه. */
.stage-output-collection { display: grid; grid-template-columns: minmax(0,1fr); gap: .55rem; align-items: start; }
.stage-output-record {
  min-width: 0; overflow: clip; border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface); box-shadow: 0 2px 9px rgb(27 36 56 / 5%); transition: border-color .15s, box-shadow .15s, transform .15s;
}
.stage-output-record:hover { border-color: var(--lapis-line); box-shadow: 0 5px 18px rgb(27 36 56 / 9%); }
.stage-output-record[open] { border-color: var(--lapis-line); box-shadow: 0 7px 22px rgb(27 36 56 / 8%); }
.stage-output-record-summary {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.35rem; padding: .7rem .85rem .7rem 1rem;
  background: var(--surface); cursor: pointer; list-style: none; user-select: none;
}
.stage-output-record-summary::-webkit-details-marker { display: none; }
.stage-output-record-summary:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.stage-output-record[open] > .stage-output-record-summary { border-bottom: 1px solid var(--line); background: linear-gradient(90deg,var(--surface-2),var(--surface)); }
.stage-output-record-main { display: grid; gap: .28rem; min-width: 0; flex: 1; }
.stage-output-record-topline { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem; min-width: 0; }
.stage-record-kicker {
  display: inline-flex; align-items: center; min-height: 1.45rem; padding: 0 .48rem;
  border: 1px solid var(--lapis-line); border-radius: 999px; background: var(--lapis-tint); color: var(--lapis);
  font-size: .7rem; font-weight: 750; line-height: 1.45; white-space: nowrap;
}
.stage-record-title { color: var(--ink-2); font-size: .82rem; line-height: 1.6; overflow-wrap: anywhere; }
.stage-output-primary {
  display: block; min-width: 0; color: var(--ink); font-size: .98rem; font-weight: 560; line-height: 1.9;
  white-space: normal; overflow-wrap: anywhere;
}
.stage-output-primary.is-translation { color: var(--lapis-deep); font-size: 1.02rem; font-weight: 680; }
.stage-output-primary.is-muted { color: var(--muted); font-size: .88rem; font-weight: 450; }
.stage-output-record-meta { display: inline-flex; align-items: center; gap: .35rem; flex: none; color: var(--lapis); font-size: .75rem; font-weight: 650; white-space: nowrap; }
.stage-output-record-meta .icon { width: 1rem; height: 1rem; transition: transform .15s; }
.stage-output-record[open] > .stage-output-record-summary .stage-output-record-meta .icon { transform: rotate(180deg); }
.stage-output-record-body { display: grid; gap: .7rem; padding: .9rem 1rem 1rem; background: var(--surface); }
.stage-output-record-body > .stage-output-field + .stage-output-field { padding-top: .7rem; border-top: 1px solid var(--line); }

/* سیگنال‌های تصمیم‌گیری: اطمینان، ریسک، هشدار و وضعیت در نمای بسته هم دیده می‌شوند. */
.stage-signal {
  display: inline-flex; align-items: center; gap: .25rem; min-height: 1.45rem; padding: 0 .48rem;
  border: 1px solid var(--line-strong); border-radius: 999px; font-size: .69rem; font-weight: 700; line-height: 1.4; white-space: nowrap;
}
.stage-signal .icon { width: .9rem; height: .9rem; }
.stage-signal.chip-teal { border-color: var(--teal-line); background: var(--teal-tint); color: var(--teal-ink); }
.stage-signal.chip-gold { border-color: var(--gold-line); background: var(--gold-tint); color: var(--gold-ink); }
.stage-signal.chip-red { border-color: var(--madder-line); background: var(--madder-tint); color: var(--madder); }
.stage-signal.chip-lapis { border-color: var(--lapis-line); background: var(--lapis-tint); color: var(--lapis); }

.stage-output-points { display: grid; gap: .5rem; padding-inline-start: 1.25rem; }
.stage-output-points li { padding-inline-start: .15rem; }
.stage-output-points li::marker { color: var(--gold-ink); }
.stage-output-points p { margin: 0; }
.stage-output-field.role-translation { gap: .5rem; padding: .9rem 1rem; border: 1px solid var(--lapis-line); border-inline-start: 4px solid var(--lapis); border-radius: var(--r); background: var(--lapis-tint); }
.stage-output-field.role-translation .stage-output-label { color: var(--lapis); }
.stage-output-field.role-translation .stage-output-value > p { font-size: 1.075rem; font-weight: 650; line-height: 2.05; }
.stage-output-field.role-translation-muted { padding: .75rem .9rem; border-radius: var(--r); background: var(--surface-2); }
.stage-output-field.role-arabic { padding: .8rem .9rem; border: 1px solid var(--line); border-radius: var(--r); background: #fff; }
.stage-output-field.role-arabic .stage-output-value > p { color: var(--lapis-deep); font-family: var(--font-quran); font-size: 1.35rem; line-height: 2.1; }
.stage-output-field.role-rationale { padding: .7rem .8rem; border-inline-start: 3px solid var(--gold-rule); background: rgb(251 243 223 / 35%); }
.stage-output-field.role-warning { padding: .7rem .8rem; border: 1px solid var(--gold-line); border-radius: var(--r); background: var(--gold-tint); }
.stage-output-field.role-positive { padding: .7rem .8rem; border: 1px solid var(--teal-line); border-radius: var(--r); background: var(--teal-tint); }
.stage-output-field.role-status { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem .75rem; padding: .55rem .7rem; border-radius: var(--r); background: var(--surface-2); }
.stage-output-field.role-status .stage-output-value { font-weight: 700; }
.stage-output-field.is-signal { padding: .68rem .8rem; border: 1px solid var(--line); border-radius: var(--r); }
.stage-output-field.is-signal .stage-output-label { display: flex; align-items: center; gap: .35rem; }
.stage-output-field.is-signal .stage-output-label .icon { width: 1rem; height: 1rem; flex: none; }
.stage-output-field.is-signal.tone-teal { border-color: var(--teal-line); background: var(--teal-tint); }
.stage-output-field.is-signal.tone-teal .stage-output-label { color: var(--teal-ink); }
.stage-output-field.is-signal.tone-gold { border-color: var(--gold-line); background: var(--gold-tint); }
.stage-output-field.is-signal.tone-gold .stage-output-label { color: var(--gold-ink); }
.stage-output-field.is-signal.tone-red { border-color: var(--madder-line); background: var(--madder-tint); }
.stage-output-field.is-signal.tone-red .stage-output-label { color: var(--madder); }
.stage-output-field.is-signal.tone-lapis { border-color: var(--lapis-line); background: var(--lapis-tint); }
.stage-output-field.is-signal.tone-lapis .stage-output-label { color: var(--lapis); }

.json {
  direction: ltr; text-align: left; max-height: 20rem; margin: 0; padding: .75rem; overflow: auto;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); font-size: .8125rem; line-height: 1.6; white-space: pre-wrap; word-break: break-word;
}
.stage-foot { display: flex; justify-content: flex-end; }
.bulk-grid { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1rem; margin-top: .75rem; }
.range-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem; }
.range-form .field { min-width: 6.5rem; }
.bulk .callout { margin-top: .5rem; }

/* ── ۹) منابع و تاریخچه ────────────────────────────────────────────── */
.refresh-card {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1rem; padding: .9rem 1.1rem;
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface);
}
.refresh-card strong { display: block; }
.source-zone { display: grid; gap: .7rem; padding: 1rem; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.source-zone-live { border-inline-start: 4px solid var(--lapis); }
.source-zone-frozen { border-inline-start: 4px solid var(--line-strong); background: var(--surface-2); }
.source-zone-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; }
.source-zone-head > div { display: grid; gap: .08rem; }
.source-zone-head h3 { font-size: 1.08rem; }
.source-zone-eyebrow { color: var(--muted); font-size: .72rem; font-weight: 750; }
.pref-list, .source-list { display: grid; gap: .6rem; margin: 0; padding: 0; list-style: none; }
.pref-item { display: grid; gap: .45rem; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.pref-item.has-conflict { border-color: var(--gold-line); background: var(--gold-tint); }
.pref-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem 1.25rem; }
.pref-ar { color: var(--lapis); font-family: var(--font-quran); font-size: 1.6rem; line-height: 1.9; }
.pref-fa { font-size: 1.0625rem; }
.pref-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; }
.source-item { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem 1rem; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.source-item > div { min-width: 0; flex: 1; }
.source-detail { width: 100%; min-width: 0; }
.source-detail > summary { display: flex; align-items: center; flex-wrap: wrap; gap: .3rem .5rem; cursor: pointer; }
.source-detail > summary .chip { margin-inline-start: auto; }
.source-detail[open] > summary { margin-bottom: .5rem; }
.source-text { margin-top: .5rem; }
.source-text summary { cursor: pointer; color: var(--lapis); font-size: .8125rem; }
.source-text > div { max-height: 16rem; margin-top: .45rem; padding: .65rem .75rem; overflow: auto; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); white-space: pre-wrap; overflow-wrap: anywhere; unicode-bidi: plaintext; }
.source-select { display: inline-flex; align-items: center; gap: .35rem; margin-top: .55rem; font-size: .8125rem; }

.revision-list { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; padding: 0; list-style: none; }
.revision-link {
  display: inline-flex; align-items: center; gap: .6rem; padding: .45rem .9rem;
  border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); color: var(--ink); text-decoration: none;
}
.revision-link:hover { background: var(--lapis-tint); color: var(--ink); }
.revision-link.is-selected { border-color: var(--lapis); background: var(--lapis-tint); }
.compare-picker { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem; }
.compare-body { display: grid; gap: .75rem; padding: 1rem 1.25rem; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.compare-body h4 { margin-top: .5rem; font-size: 1rem; }
.compare-pair { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.compare-pair > div { padding: .75rem; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.compare-pair small { color: var(--muted); font-weight: 700; }
.compare-list { display: grid; gap: .25rem; margin: 0; padding-inline-start: 1.2rem; }
.compare-feedback ul { margin: .25rem 0 0; padding-inline-start: 1.2rem; }
.timeline { display: grid; margin: 0; padding: 0; list-style: none; }
.timeline li { position: relative; display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .9rem; padding-block: .55rem; padding-inline-start: 1.6rem; }
.timeline li::before {
  content: ""; position: absolute; inset-inline-start: 0; inset-block-start: 1.05rem; width: .65rem; height: .65rem;
  border: 2px solid var(--lapis); border-radius: 50%; background: var(--surface);
}
.timeline li::after { content: ""; position: absolute; inset-inline-start: .3rem; inset-block: 1.9rem -.45rem; width: 1px; background: var(--line-strong); }
.timeline li:last-child::after { display: none; }
.timeline small { color: var(--muted); }

/* ── ۱۰) مدیریت ─────────────────────────────────────────────────────── */
.subnav {
  position: sticky; inset-block-start: calc(var(--top) + .5rem); z-index: 30;
  display: flex; gap: .25rem; padding: .3rem; overflow-x: auto; scrollbar-width: thin;
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: 0 2px 10px rgb(27 36 56 / 7%);
}
.subnav a { padding: .35rem .9rem; border-radius: var(--r); color: var(--ink-2); font-size: .9375rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.subnav a:hover { background: var(--surface-2); color: var(--ink); }
.subnav a[aria-current="location"] { background: var(--lapis); color: #fff; }
.cost-presets { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; padding-bottom: .7rem; border-bottom: 1px solid var(--line); }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(12rem, 100%), 1fr)); gap: .75rem; margin: 0; }
.metric { padding: .85rem 1.1rem; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.metric dt { color: var(--muted); font-size: .875rem; }
.metric dd { margin: .1rem 0 0; color: var(--lapis); font-size: 1.5rem; font-weight: 700; line-height: 1.5; font-variant-numeric: tabular-nums; }
.admin-section { display: grid; gap: 1rem; align-content: start; scroll-margin-top: calc(var(--top) + 4.75rem); padding-top: .75rem; }
.section-head { display: grid; gap: .1rem; }
.section-head h2 { font-size: 1.4rem; }
.admin-card .card-head { align-items: flex-start; }
.admin-card h3 { font-size: 1.125rem; }
.admin-node-list { display: grid; gap: .4rem; margin: .5rem 0 0; padding: 0; list-style: none; }
.admin-node-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .9rem; padding: .5rem .75rem; border-radius: var(--r); background: var(--surface-2); font-size: .9rem; }
.admin-node-list small { color: var(--muted); }
.admin-forms { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(20rem, 100%), 1fr)); gap: 1rem; }
.admin-form { align-content: space-between; }
.prompt-editor { display: grid; gap: 1rem; }
.prompt-editor textarea { width: 100%; font-family: inherit; }
.admin-contract { max-height: 18rem; overflow: auto; white-space: pre-wrap; font-size: .8rem; }
.filters { gap: 1rem; }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(11.5rem, 100%), 1fr)); gap: .75rem; }
.filter-actions { display: flex; gap: .5rem; }
.table-title { margin-top: .5rem; font-size: 1.1rem; }

/* ── ۱۱) واژه‌نامه ─────────────────────────────────────────────────── */
.lex-layout { display: grid; grid-template-columns: 20rem minmax(0, 1fr); align-items: start; gap: 1.25rem; }
.lex-index {
  position: sticky; inset-block-start: calc(var(--top) + 1rem); grid-template-rows: auto minmax(0, 1fr);
  max-height: calc(100dvh - var(--top) - 2rem); padding: 1rem; overflow: hidden;
}
.lex-search { display: grid; gap: .35rem; }
.lex-search > label { font-size: .875rem; font-weight: 600; }
.lex-terms { display: grid; gap: .15rem; margin: 0; padding: 0; overflow: auto; list-style: none; align-content: start; }
.lex-terms a { display: grid; gap: .05rem; padding: .5rem .75rem; border-radius: var(--r); color: var(--ink); text-decoration: none; }
.lex-terms a:hover { background: var(--surface-2); }
.lex-terms a[aria-current="page"] { background: var(--lapis-tint); box-shadow: inset 0 0 0 1px var(--lapis-line); }
.lex-terms small { color: var(--muted); }
.term-ar { color: var(--lapis); font-family: var(--font-quran); font-size: 1.4rem; line-height: 1.8; }
.lex-detail { min-height: 22rem; gap: 1rem; }
.lex-detail h3 { font-size: 1.0625rem; }
.lex-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.lex-detail-head h2 { color: var(--lapis); font-family: var(--font-quran); font-size: 2.4rem; font-weight: 400; line-height: 1.6; }
.lex-cards { display: grid; gap: .6rem; margin: 0; padding: 0; list-style: none; }
.lex-cards > li { display: grid; gap: .4rem; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.lex-cards > li.is-inactive { border-style: dashed; background: var(--surface); }
.lex-cards small { color: var(--muted); }
.rule-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.rule-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem .65rem; }
.scope-chips { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0; padding: 0; list-style: none; }
.lex-placeholder { display: grid; align-content: center; justify-items: center; gap: .4rem; min-height: 16rem; text-align: center; }

/* ── ۱۲) نمای خواننده ──────────────────────────────────────────────── */
.reader-topbar {
  position: sticky; inset-block-start: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: var(--top); padding: .5rem 1.25rem; border-bottom: 1px solid var(--line); background: var(--surface);
}
.reader-nav { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.size-control { display: inline-flex; align-items: center; gap: .1rem; margin-inline-end: .5rem; color: var(--muted); }
.no-js .size-control { display: none; }
.reader-page { display: grid; gap: 1.25rem; align-content: start; width: min(100%, 58rem); margin-inline: auto; padding: 1.5rem 1rem 4rem; }
.reader-heading { display: grid; justify-items: center; gap: .35rem; text-align: center; }
.reader-project { color: var(--muted); font-size: .9375rem; }
.reader-heading h1 { display: flex; align-items: center; justify-content: center; gap: 1rem; font-size: 1.4rem; }
.reader-heading h1 [lang="ar"], .reader-heading h1[lang="ar"] { color: var(--lapis); font-family: var(--font-quran); font-size: 2.2rem; font-weight: 400; line-height: 1.6; }
.reader-sheet { padding: clamp(1.25rem, 4vw, 2.5rem); }
.reader-ayah-panel { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 1rem; }
.reader-adjacent {
  display: grid; justify-items: center; gap: .1rem; min-width: 3rem; padding: .5rem; border-radius: var(--r);
  color: var(--lapis); text-decoration: none;
}
.reader-adjacent:hover { background: var(--lapis-tint); }
.reader-adjacent small { color: var(--muted); font-size: .75rem; }
.reader-adjacent.is-empty { visibility: hidden; }
.reader-arabic {
  margin: 0; text-align: center; text-wrap: balance;
  font-family: var(--font-quran); font-size: calc(2.4rem * var(--reader-scale, 1)); line-height: 2.3;
}
.reader-translation { max-width: 44rem; margin-inline: auto; font-size: calc(1.3rem * var(--reader-scale, 1)); line-height: 2.2; }
.reader-version-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .4rem .9rem; margin-top: 1rem; }
.reader-notice { max-width: 44rem; margin: 0 auto 1rem; }
.reader-unavailable { padding: 1rem 0; color: var(--muted); text-align: center; }
.reader-footnotes { max-width: 44rem; margin: 1.25rem auto 0; padding-top: 1rem; border-top: 1px solid var(--line); }
.reader-footnotes h2 { font-size: 1rem; }
.reader-footnotes ol { display: grid; gap: .35rem; margin: .5rem 0 0; padding-inline-start: 1.4rem; color: var(--ink-2); }
.reader-tech { max-width: 44rem; margin: 1rem auto 0; }
.reader-tech dl { display: grid; gap: .3rem; margin: 0; font-size: .8125rem; }
.reader-tech dl > div { display: flex; flex-wrap: wrap; gap: .25rem .75rem; }
.reader-tech dt { color: var(--muted); }
.reader-tech dd { margin: 0; overflow-wrap: anywhere; }

.reader-surah-list { padding: 0; overflow: hidden; }
.reader-surah-list::before { display: none; }
.surah-ayah { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1rem 1.25rem; padding: 1.5rem clamp(1rem, 3vw, 2rem); border-bottom: 1px solid var(--line); }
.surah-ayah:last-child { border-bottom: 0; }
.surah-ayah > .ayah-badge { margin-top: .6rem; }
.surah-ayah-body { display: grid; gap: .5rem; min-width: 0; }
.surah-ayah .reader-arabic { text-align: start; font-size: calc(2rem * var(--reader-scale, 1)); line-height: 2.3; }
.surah-ayah .reader-translation { margin-inline: 0; font-size: calc(1.125rem * var(--reader-scale, 1)); line-height: 2.1; }
.surah-ayah .reader-version-meta { justify-content: flex-start; margin-top: .25rem; }
.surah-ayah .reader-unavailable { text-align: start; padding: 0; }

/* ── ۱۳) ورود و صفحهٔ خالی ────────────────────────────────────────── */
.page-auth { background: var(--surface); }
.auth-shell { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100dvh; }
.auth-brand {
  position: relative; display: grid; align-content: center; justify-items: start; gap: 1rem; overflow: hidden;
  padding: clamp(2rem, 6vw, 5rem); background: var(--lapis-deep); color: #fff;
}
.auth-brand::after { content: ""; position: absolute; inset: 1.25rem; pointer-events: none; border: 1px solid rgb(212 181 106 / 55%); border-radius: var(--r-lg); }
.auth-ornament { position: absolute; inset-inline-end: -9rem; inset-block-end: -9rem; width: 34rem; height: 34rem; color: rgb(212 181 106 / 42%); }
.auth-brand-title { position: relative; font-size: clamp(1.75rem, 3vw, 2.5rem); font-weight: 800; line-height: 1.45; }
.auth-brand-text { position: relative; max-width: 26rem; color: rgb(255 255 255 / 82%); font-size: 1.0625rem; line-height: 2; }
.auth-card { display: grid; align-self: center; justify-self: center; gap: 1rem; width: min(26rem, calc(100% - 2rem)); padding: 2rem 0; }
.auth-card > .brand { margin-bottom: 1rem; }
.auth-card h1 { font-size: 1.75rem; }
.password-field { position: relative; }
.password-field input { padding-right: 2.9rem; }
.password-field .btn { position: absolute; inset-block-start: 50%; right: .3rem; transform: translateY(-50%); width: 2rem; min-height: 2rem; }

.empty-page { display: grid; align-content: center; justify-items: center; gap: .9rem; min-height: 100dvh; padding: 2rem; text-align: center; }
.empty-page h1 { font-size: 1.5rem; }
.empty-page p { max-width: 30rem; color: var(--ink-2); }
.empty-mark { width: 4rem; height: 4rem; color: var(--lapis); }
.empty-mark .icon { width: 100%; height: 100%; stroke-width: 1.1; }

/* ── ۱۴) واکنش‌گرایی، چاپ، حرکت ─────────────────────────────────────── */
@media (pointer: coarse) {
  .btn { min-height: 2.75rem; }
  .btn-sm { min-height: 2.5rem; }
  .tab { min-height: 2.9rem; }
}

@media (max-width: 900px) {
  .wf-layout, .lex-layout { grid-template-columns: 1fr; }
  .stage-list, .lex-index { position: static; }
  .lex-index { max-height: 22rem; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
}

@media (max-width: 720px) {
  .topbar { position: static; flex-wrap: wrap; gap: .5rem; padding: .5rem .75rem; }
  .topbar .brand-text small { display: none; }
  .location { flex-basis: 100%; order: 3; }
  .location-trigger { width: 100%; justify-content: space-between; }
  .location-panel { width: 100%; }
  .surah-list { grid-template-columns: 1fr; }
  .btn-label { display: none; }
  .account-trigger { padding-inline: .4rem; }
  .top-context { display: none; }
  .page { padding-inline: .75rem; }
  .verse-sheet { padding-inline: 1rem; }
  .verse-sheet::before { inset: 4px; }
  .pager-btn span { display: none; }
  .pager-btn { padding-inline: .75rem; }
  .arabic-ayah { font-size: 2rem; line-height: 2.2; }
  .arabic-ayah.short { font-size: 2.4rem; }
  .arabic-ayah.medium { font-size: 2.1rem; }
  .arabic-ayah.long { font-size: 1.8rem; }
  .arabic-ayah.extended { font-size: 1.55rem; }
  .translation-text { font-size: 1.125rem; }
  .tabbar { position: static; }
  .tab span:not(.tab-count) { font-size: .875rem; }
  .decision { grid-template-columns: auto minmax(0, 1fr); justify-content: stretch; }
  .decision-action { grid-column: 1 / -1; justify-items: stretch; }
  .decision-action form { flex-wrap: wrap; }
  .decision-action .btn { width: 100%; }
  .compare-pair { grid-template-columns: 1fr; }
  .stage-panel { padding: 1rem; }
  .stage-head { flex-direction: column; }
  .stage-result { padding: .8rem; }
  .stage-result-head, .stage-result-actions { align-items: stretch; }
  .stage-result-actions { width: 100%; justify-content: space-between; }
  .stage-output-tools { flex: 1 1 auto; }
  .stage-output-record-summary { align-items: flex-start; min-height: 3.8rem; padding: .7rem .75rem; }
  .stage-output-record-topline { gap: .3rem; }
  .stage-output-primary { font-size: .93rem; line-height: 1.85; }
  .stage-output-primary.is-translation { font-size: .97rem; }
  .stage-detail-label { display: none; }
  .candidate-summary { align-items: flex-start; padding: .7rem .75rem; }
  .candidate-translation { font-size: .97rem; }
  .candidate-more span { display: none; }
  .candidate-detail-row { grid-template-columns: 1fr; gap: .2rem; }
  .source-zone { padding: .8rem; }
  .start-grid { grid-template-columns: 1fr; }
  .subnav { position: static; }
  .lex-detail-head { flex-direction: column; }
  .reader-topbar { padding-inline: .75rem; }
  .reader-ayah-panel { grid-template-columns: 1fr; }
  .reader-adjacent { display: none; }
  .reader-arabic { font-size: calc(1.9rem * var(--reader-scale, 1)); }
  .reader-nav .btn span { display: none; }
  .surah-ayah { grid-template-columns: 1fr; gap: .5rem; }
  .surah-ayah > .ayah-badge { margin-top: 0; }
  .modal { max-height: calc(100dvh - 1rem); }
}

@media print {
  .topbar, .reader-topbar, .tabbar, .verse-pager, .verse-foot, .flash-region, .skip-link, dialog { display: none !important; }
  body { background: #fff; }
  .verse-sheet, .card { break-inside: avoid; }
  .js .tabpanel:not(.is-active) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ── اقدام‌های اصلی مترجم: همیشه نزدیک ورق آیه و مستقل از state ─────── */
.workbench-quick-actions {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1rem;
  padding: .85rem 1rem; border: 1px solid var(--lapis-line); border-radius: var(--r-lg);
  background: linear-gradient(135deg, var(--surface), var(--lapis-tint));
}
.workbench-quick-actions-copy { display: grid; gap: .15rem; min-width: 0; flex: 1 1 18rem; }
.workbench-quick-actions-copy strong { color: var(--ink); font-size: .95rem; }
.workbench-quick-actions-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.quick-run-form { margin: 0; }

@media (max-width: 720px) {
  .workbench-quick-actions { align-items: stretch; }
  .workbench-quick-actions-copy { flex-basis: 100%; }
  .workbench-quick-actions-buttons { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .workbench-quick-actions-buttons .btn { width: 100%; justify-content: center; min-height: 2.75rem; }
}

@media (max-width: 430px) {
  .workbench-quick-actions-buttons { grid-template-columns: 1fr; }
}
