/* RFLANCER — پایه، کامپوننت‌ها و صفحات اپ مشتری
 * فقط توکن‌های معنایی tokens.css را می‌خواند. RTL، فونت لوکال، بدون وابستگی.
 *
 *   ۱. پایه            ۴. صفحه‌ی ورود (gate)
 *   ۲. عناصر برند      ۵. داشبورد (home)
 *   ۳. کامپوننت‌ها     ۶. نمایشگر (viewer)      ۷. حرکت، چاپ
 */

/* ================================================================== *
 * ۱. پایه
 * ================================================================== */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

/* پس‌زمینه فقط روی html: پس‌زمینه‌ی خودِ body روی لایه‌های z-index منفی
   (سایه‌ی پایین صفحه، نمودار تزئینی) کشیده می‌شود و پنهانشان می‌کند. */
html { background: var(--bg); }

html,
body {
  margin: 0;
  padding: 0;
  color: var(--text-2);
  font-family: var(--font-fa);
  font-size: 16px;
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* سایه‌ی ملایم پایین صفحه، مثل صفحات کاتالوگ */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg) 52%, var(--bg-shade) 100%);
  pointer-events: none;
}

h1, h2, h3, h4 {
  margin: 0;
  color: var(--text-1);
  font-weight: 800;
  line-height: var(--lh-tight);
  text-wrap: balance;
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); font-weight: 700; }
h3 { font-size: var(--fs-h3); font-weight: 700; }

p { margin: 0; }

a { color: var(--accent); text-underline-offset: 4px; }
a:hover { color: var(--accent-hover); }

b, strong { font-weight: 700; color: var(--text-1); }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

::selection { background: var(--accent-ring); color: var(--text-1); }

:focus-visible {
  outline: 2px solid var(--accent-graphic);
  outline-offset: 3px;
}

[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.muted { color: var(--text-3); font-size: var(--fs-sm); }

/* ================================================================== *
 * ۲. عناصر برند
 * ================================================================== */

/* کیکر لاتین — آبی، حروف بزرگ، فاصله‌دار؛ امضای بصری کاتالوگ.
   خودش همیشه چپ‌به‌راست است؛ در صفحه‌ی فارسی به لبه‌ی راست می‌چسبد، در انگلیسی به چپ. */
.kicker {
  margin: 0;
  direction: ltr;
  unicode-bidi: isolate;
  text-align: left;
  font-family: var(--font-display);
  font-size: var(--fs-kicker);
  font-weight: 400;
  line-height: 1.7;
  letter-spacing: var(--track-kicker);
  text-transform: uppercase;
  color: var(--accent);
}
html[dir="rtl"] .kicker {
  text-align: right;
  /* فاصله‌ی حروفِ بعد از آخرین حرف، لبه‌ی راست را عقب می‌اندازد */
  margin-right: calc(var(--track-kicker) * -1);
}

.kicker-muted { color: var(--text-faint); }

/* عدد و کد با Michroma — همیشه ارقام لاتین، مثل شماره‌ی صفحات کاتالوگ */
.readout,
.mono {
  direction: ltr;
  unicode-bidi: isolate;
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  direction: ltr;
  color: var(--text-1);
  text-decoration: none;
  flex: none;
}
.brand:hover { color: var(--text-1); }

.brand-mark { width: 26px; height: 26px; flex: none; color: var(--text-1); }
.brand-mark .pt { fill: var(--accent-graphic); }

.brand-word {
  font-family: var(--font-display);
  font-size: 0.8125rem;
  letter-spacing: var(--track-word);
  line-height: 1;
  white-space: nowrap;
}
.brand-word i {
  font-style: normal;
  color: var(--text-3);
  margin-inline-start: 0.5em;
}

.topbar {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  min-height: var(--topbar-h);
  padding-inline: var(--gutter);
}

.brand-desc {
  padding-inline-start: var(--s-4);
  border-inline-start: 1px solid var(--line);
  color: var(--text-3);
  font-size: var(--fs-xs);
  line-height: 1.5;
  white-space: nowrap;
}

/* توجه: عنصری که direction: ltr دارد، ویژگی‌های منطقی‌اش هم چپ‌به‌راست حساب
   می‌شود. پس «هل دادن به انتهای نوار» کارِ این ظرف است که جهت صفحه را به ارث می‌برد،
   نه کارِ خودِ .page-index. */
.topbar-end {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  margin-inline-start: auto;
}

/* کلید زبان — هم‌شکلِ کلید تم در راهنمای طراحی */
.lang-switch {
  display: inline-flex;
  flex: none;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  direction: ltr;
}
.lang-switch a {
  padding: 4px 10px;
  border-radius: var(--r-pill);
  color: var(--text-3);
  font-family: var(--font-display);
  font-size: 0.5625rem;
  letter-spacing: 0.14em;
  line-height: 1.6;
  text-decoration: none;
  transition: background var(--dur-1), color var(--dur-1);
}
.lang-switch a:hover { color: var(--text-1); }
.lang-switch a[aria-current] { background: var(--primary-bg); color: var(--primary-fg); }

.page-index {
  direction: ltr;
  unicode-bidi: isolate;
  font-family: var(--font-display);
  font-size: var(--fs-kicker);
  letter-spacing: var(--track-kicker);
  color: var(--text-faint);
  white-space: nowrap;
}

/* پانویس صفحه — خط مویی، یادداشت در راست و شماره‌ی صفحه در چپ */
.page-foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-6);
  margin-inline: var(--gutter);
  padding-block: var(--s-4) var(--s-6);
  border-top: 1px solid var(--line);
  color: var(--text-3);
  font-size: var(--fs-xs);
  line-height: 1.8;
}
.page-foot a { color: inherit; }
.page-foot a:hover { color: var(--accent); }
.page-no {
  direction: ltr;
  font-family: var(--font-display);
  font-size: var(--fs-kicker);
  letter-spacing: 0.2em;
  color: var(--text-faint);
  flex: none;
}

.icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-sm { width: 16px; height: 16px; }
.icon-fill { fill: currentColor; stroke: none; }

/* ================================================================== *
 * ۳. کامپوننت‌ها
 * ================================================================== */

/* --- دکمه --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-1);
  font-family: var(--font-fa);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: background var(--dur-1) var(--ease-out),
    border-color var(--dur-1) var(--ease-out),
    color var(--dur-1) var(--ease-out),
    transform var(--dur-1) var(--ease-out);
}
.btn:active { transform: translateY(1px); }
.btn:disabled,
.btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--primary-bg); color: var(--primary-fg); }
.btn-primary:hover { background: var(--primary-hover); color: var(--primary-fg); }

.btn-ghost { border-color: var(--line-strong); color: var(--text-1); }
.btn-ghost:hover { border-color: var(--text-1); background: var(--line-faint); color: var(--text-1); }

.btn-quiet { color: var(--text-3); padding-inline: 14px; }
.btn-quiet:hover { color: var(--text-1); background: var(--line-faint); }

.btn-lg { min-height: 56px; padding-inline: 28px; font-size: 1rem; border-radius: 12px; }
.btn-sm { min-height: 36px; padding-inline: 14px; font-size: 0.8125rem; gap: 8px; }
.btn-block { width: 100%; }

.btn .icon { transition: transform var(--dur-2) var(--ease-out); }
.btn-primary:hover .icon-go { transform: translateX(-4px); }

/* پیکان «رفتن» در فارسی رو به چپ است؛ در صفحه‌ی چپ‌به‌راست آینه می‌شود. پیکان «برگشت» برعکس. */
html[dir="ltr"] .icon-go,
html[dir="ltr"] .alert-go,
html[dir="ltr"] .icon-back { transform: scaleX(-1); }
html[dir="ltr"] .btn-primary:hover .icon-go { transform: scaleX(-1) translateX(-4px); }

.btn[aria-busy="true"] { pointer-events: none; }
.btn[aria-busy="true"] .icon-go { display: none; }
.btn[aria-busy="true"]::after {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-inline-end-color: transparent;
  animation: spin 0.7s linear infinite;
}

/* --- کارت --- */

.card {
  background: var(--surface);
  border: 1px solid var(--surface-edge);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-2);
  padding: clamp(18px, 2.4vw, 28px);
}

.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-4);
  margin-bottom: var(--s-5);
}
.card-head h3 { font-size: var(--fs-h3); }

/* --- هشدار --- */

.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text-1);
  font-size: var(--fs-sm);
  line-height: 1.85;
  text-decoration: none;
}
.alert .icon { margin-top: 3px; }
.alert-danger { background: var(--danger-tint); border-color: var(--danger-line); }
.alert-danger .icon, .alert-danger b { color: var(--danger); }
.alert-warn { background: var(--warn-tint); border-color: var(--warn-line); }
.alert-warn .icon, .alert-warn b { color: var(--warn); }
.alert-info { background: var(--accent-tint); border-color: var(--accent-ring); }
.alert-info .icon, .alert-info b { color: var(--accent); }
.alert-ok { background: var(--ok-tint); border-color: var(--ok-line); }
.alert-ok .icon, .alert-ok b { color: var(--ok); }

a.alert { transition: border-color var(--dur-1), transform var(--dur-2) var(--ease-out); }
a.alert:hover { border-color: var(--accent-graphic); color: var(--text-1); }
a.alert .alert-go { margin-inline-start: auto; align-self: center; color: var(--accent); }
a.alert:hover .alert-go { transform: translateX(-3px); }
html[dir="ltr"] a.alert:hover .alert-go { transform: scaleX(-1) translateX(-3px); }

/* --- برچسب وضعیت --- */

.pill,
.mine-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.7;
  color: var(--text-2);
  white-space: nowrap;
}
.pill::before,
.mine-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.pill-ok, .s-answered { color: var(--ok); border-color: var(--ok-line); background: var(--ok-tint); }
.pill-warn { color: var(--warn); border-color: var(--warn-line); background: var(--warn-tint); }
.pill-danger { color: var(--danger); border-color: var(--danger-line); background: var(--danger-tint); }
.pill-info, .s-new { color: var(--accent); border-color: var(--accent-ring); background: var(--accent-tint); }
.s-seen { color: var(--text-2); }
.s-closed { color: var(--text-faint); }

/* --- فیلد فرم --- */

.field,
.rfp-field,
.rfp-form label {
  display: grid;
  gap: 7px;
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: 500;
  line-height: 1.6;
}

.input,
.rfp-form input[type="text"],
.rfp-form select,
.rfp-form textarea,
.mark-note,
.cmsg-form textarea {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-raised);
  color: var(--text-1);
  font-family: var(--font-fa);
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.6;
  user-select: text;
  transition: border-color var(--dur-1), box-shadow var(--dur-1);
}

.rfp-form textarea,
.cmsg-form textarea {
  min-height: 92px;
  padding: 11px 14px;
  line-height: 1.9;
  resize: vertical;
}

.input::placeholder,
.rfp-form ::placeholder,
.mark-note::placeholder,
.cmsg-form ::placeholder { color: var(--text-faint); opacity: 1; }

.input:hover,
.rfp-form input[type="text"]:hover,
.rfp-form select:hover,
.rfp-form textarea:hover { border-color: var(--line-strong); }

.input:focus,
.rfp-form input[type="text"]:focus,
.rfp-form select:focus,
.rfp-form textarea:focus,
.mark-note:focus,
.cmsg-form textarea:focus {
  outline: 0;
  border-color: var(--accent-graphic);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.rfp-form select {
  appearance: none;
  -webkit-appearance: none;
  padding-inline-end: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238e9097' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 12px center;
}
html[dir="ltr"] .rfp-form select { background-position: right 12px center; }

.field-hint { color: var(--text-3); font-size: var(--fs-xs); font-weight: 400; }

/* بله/خیر به شکل کلید */
.rfp-field.rfp-check {
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-raised);
  cursor: pointer;
}
.rfp-field.rfp-check input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  width: 42px;
  height: 24px;
  margin: 0;
  border-radius: var(--r-pill);
  background: var(--line-strong);
  cursor: pointer;
  transition: background var(--dur-2) var(--ease-out);
}
.rfp-field.rfp-check input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 3px;
  inset-inline-start: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.3);
  transition: transform var(--dur-2) var(--ease-out);
}
.rfp-field.rfp-check input[type="checkbox"]:checked { background: var(--accent-graphic); }
.rfp-field.rfp-check input[type="checkbox"]:checked::after { transform: translateX(-18px); }
html[dir="ltr"] .rfp-field.rfp-check input[type="checkbox"]:checked::after { transform: translateX(18px); }

/* --- جدول مشخصات: همان ردیف‌های مویی کاتالوگ --- */

.kv { margin: 0; }
.kv > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-4);
  padding-block: 11px;
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-sm);
}
.kv > div:first-child { border-top: 1px solid var(--line-strong); }
.kv > div:last-child { border-bottom: 0; padding-bottom: 0; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; color: var(--text-1); font-weight: 600; text-align: end; }
.kv dd.mono { font-weight: 400; font-size: 0.75rem; letter-spacing: 0.1em; }

/* --- اعلان شناور --- */

.toast {
  position: fixed;
  inset-inline: 0;
  bottom: calc(86px + env(safe-area-inset-bottom, 0px));
  z-index: var(--z-toast);
  display: flex;
  align-items: center;
  gap: var(--s-3);
  width: max-content;
  max-width: calc(100vw - 24px);
  margin-inline: auto;
  padding-block: 8px;
  padding-inline: 18px 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: var(--surface-raised);
  box-shadow: var(--shadow-3);
  color: var(--text-1);
  font-size: var(--fs-sm);
  line-height: 1.6;
  animation: rise var(--dur-3) var(--ease-out) both;
}
.toast-plain { padding: 10px 20px; }
.toast-err { border-color: var(--danger-line); }
.toast.is-leaving { animation: sink var(--dur-2) var(--ease-in-out) both; }

/* ================================================================== *
 * ۴. صفحه‌ی ورود — یک کار (وارد کردن کد)، یک قهرمان (نمودار)
 * ================================================================== */

.gate { min-height: 100vh; min-height: 100dvh; }

/* قاب جدا از <body> است: overflow روی body به viewport منتقل می‌شود و چیزی را
   نمی‌بُرد؛ نمودار عمداً از لبه‌ی صفحه بیرون می‌زند و باید درون همین قاب بریده شود. */
.gate-frame {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  overflow: clip;
}

.gate-main {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(24px, 5vw, 88px);
  width: 100%;
  max-width: 1360px;
  margin-inline: auto;
  padding: clamp(16px, 4vh, 56px) var(--gutter);
}

.gate-copy { max-width: 500px; justify-self: end; width: 100%; }

.gate-copy h1 {
  margin-top: var(--s-5);
  font-size: var(--fs-display);
  line-height: 1.28;
}

.lead {
  margin-top: var(--s-4);
  max-width: 40ch;
  color: var(--text-2);
  font-size: 1.0625rem;
}

.gate-copy .alert { margin-top: var(--s-6); }

.code-form { margin-top: var(--s-8); }

.code-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--s-3);
  color: var(--text-1);
  font-size: var(--fs-sm);
  font-weight: 600;
}
.code-label .kicker { color: var(--text-faint); letter-spacing: 0.18em; margin: 0; }

.code-field { position: relative; }

/* بدون JS: یک فیلد متنی درشت و سالم */
.code-input {
  width: 100%;
  min-height: 68px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface-raised);
  color: var(--text-1);
  font-family: var(--font-display);
  font-size: clamp(1rem, 0.8rem + 1vw, 1.25rem);
  letter-spacing: 0.18em;
  text-align: center;
  text-transform: uppercase;
}
.code-input::placeholder { color: var(--text-faint); opacity: 0.7; }
.code-input:focus { outline: 0; border-color: var(--accent-graphic); box-shadow: 0 0 0 3px var(--accent-ring); }
.code-input-plain { font-family: var(--font-fa); letter-spacing: normal; text-transform: none; }

/* با JS: ورودی واقعی نامرئی روی خانه‌ها می‌نشیند — پیست و کیبورد موبایل سالم می‌مانند */
.code-field.is-enhanced .code-input {
  position: absolute;
  inset: 0;
  z-index: 2;
  height: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: transparent;
  -webkit-text-fill-color: transparent;
  caret-color: transparent;
  font-size: 16px;
  letter-spacing: 0;
  cursor: text;
}
.code-field.is-enhanced .code-input::placeholder { color: transparent; }
.code-field.is-enhanced .code-input::selection { background: transparent; }

.code-cells {
  display: none;
  align-items: center;
  gap: clamp(5px, 1.2vw, 10px);
  direction: ltr;
}
.code-field.is-enhanced .code-cells { display: flex; }

/* خانه‌ها همان «کد سفارش» کاتالوگ‌اند */
.code-group {
  flex: 1 1 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: center;
  min-height: 68px;
  padding-inline: clamp(4px, 1.1vw, 14px);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface-raised);
  box-shadow: var(--shadow-1), inset 0 1px 0 var(--surface-edge);
  transition: border-color var(--dur-1), box-shadow var(--dur-1);
}
.code-field:focus-within .code-group.is-active {
  border-color: var(--accent-graphic);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.code-group.is-full { border-color: var(--text-1); }

.code-slot {
  position: relative;
  height: 1.7em;
  font-family: var(--font-display);
  font-size: clamp(0.9375rem, 0.62rem + 1.4vw, 1.3125rem);
  line-height: 1.7em;
  text-align: center;
  color: var(--text-1);
}
.code-slot:empty::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0.32em;
  width: 9px;
  height: 1.5px;
  margin-left: -4.5px;
  background: var(--line-strong);
  opacity: 0.6;
}
.code-field:focus-within .code-slot.is-caret::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 18%;
  width: 1.5px;
  height: 64%;
  background: var(--accent-graphic);
  animation: blink 1.1s steps(1) infinite;
}
.code-slot.is-new { animation: pop var(--dur-2) var(--ease-out); }

.code-dash { flex: none; width: clamp(5px, 1.2vw, 10px); height: 1.5px; background: var(--line-strong); }

.code-field.is-shaking .code-cells,
.code-field.is-shaking .code-input { animation: shake 0.4s var(--ease-in-out); }

.code-hint {
  min-height: 1.9em;
  margin-top: var(--s-2);
  color: var(--warn);
  font-size: var(--fs-xs);
  line-height: 1.9;
}

.code-form .btn { margin-top: var(--s-1); }

/* ورود مدیر روی گوشی: دیدنِ رمز هنگامِ تایپ (غلطِ تایپیِ بی‌صدا = «رمز نادرست») */
.show-pass {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  margin-top: var(--s-3);
  color: var(--text-2);
  font-size: var(--fs-sm);
  cursor: pointer;
}
.show-pass input { width: 18px; height: 18px; accent-color: var(--primary-bg); }

.gate-note {
  display: flex;
  gap: var(--s-2);
  margin-top: var(--s-5);
  color: var(--text-3);
  font-size: var(--fs-xs);
  line-height: 1.9;
}
.gate-note .icon { margin-top: 4px; color: var(--text-faint); }

/* --- نمودار قطبی --- */

.gate-visual {
  width: 100%;
  max-width: 660px;
  justify-self: start;
  color: var(--text-1);
}

.scope { position: relative; aspect-ratio: 1; cursor: crosshair; }

.dial { display: block; width: 100%; height: 100%; overflow: visible; }
.dial .plate { fill: url(#plate-grad); }
.dial .hair { fill: none; stroke: currentColor; stroke-width: 1; opacity: 0.2; vector-effect: non-scaling-stroke; }
.dial .hair-dash { stroke-dasharray: 2 6; opacity: 0.17; }
.dial .cross { opacity: 0.13; }
.dial .tick { fill: none; stroke: currentColor; opacity: 0.32; }
.dial .tick-major { opacity: 0.7; }
.dial text {
  fill: currentColor;
  opacity: 0.42;
  font-family: var(--font-display);
  font-size: 8.5px;
  letter-spacing: 0.18em;
  text-anchor: middle;
  dominant-baseline: middle;
}
.dial text.el { font-size: 6.5px; text-anchor: start; opacity: 0.32; }
.dial .hub { fill: currentColor; opacity: 0.85; }

/* حلقه‌ی بیرونی یک‌بار «کشیده» می‌شود، بعد نمودار شروع به کار می‌کند */
.dial .ring { stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0.34; animation: draw-ring 1.3s var(--ease-in-out) 0.15s forwards; }
.dial .tick { animation: fade 0.9s var(--ease-out) 0.7s both; }

.scope-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

.scope-panel {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.4vw, 28px);
  direction: ltr;
  margin: var(--s-2) 9% 0;
  padding-top: var(--s-3);
  border-top: 1px solid var(--line);
  font-family: var(--font-display);
  font-size: 0.5625rem;
  letter-spacing: 0.2em;
  color: var(--text-faint);
  white-space: nowrap;
}
.scope-panel b { margin-inline-start: 7px; color: var(--text-1); font-weight: 400; font-variant-numeric: tabular-nums; }
.scope-mode { margin-right: auto; color: var(--accent); }
.scope-mode::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 8px;
  border-radius: 50%;
  background: currentColor;
  vertical-align: 1px;
  animation: blink 2.4s steps(1) infinite;
}

/* تبلت و موبایل: نمودار بالای فرم می‌ماند — کوچک‌تر، بدون برچسب، ولی زنده */
@media (max-width: 900px) {
  .gate-main { grid-template-columns: 1fr; align-items: start; gap: var(--s-4); padding-top: 0; }
  .gate-copy { max-width: 540px; justify-self: center; }
  .gate-visual { order: -1; justify-self: center; width: min(62vw, 300px); }
  .gate-visual .dial text { display: none; }
  .scope-panel { display: none; }
  .scope { cursor: default; }
  .gate-copy h1 { margin-top: var(--s-3); }
  .code-form { margin-top: var(--s-6); }
}

@media (max-width: 560px) {
  .brand-desc,
  .page-index { display: none; } /* جا برای کلید زبان */
  .gate-visual { width: min(52vw, 220px); }
  .gate-copy h1 { font-size: clamp(1.625rem, 7.4vw, 2.125rem); }
  .lead { font-size: 1rem; }
  .code-group, .code-input { min-height: 56px; border-radius: 10px; }
}

@media (max-height: 640px) and (max-width: 900px) {
  .gate-visual { display: none; } /* گوشیِ کوتاه یا کیبوردِ باز: فرم مقدم است */
}

/* ================================================================== *
 * ۵. داشبورد — فقط آنچه کارفرما لازم دارد: کاتالوگ‌هایش، پاسخ‌ها، و یک فرم درخواست
 * ================================================================== */

.home { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }

/* خروج: کنارِ کلیدِ زبان، آرام — کارِ اصلیِ این صفحه نیست. پیکان در فارسی رو به راست (بیرونِ صفحه) */
.signout { display: flex; margin: 0; }
.signout .btn { gap: 6px; padding-inline: 10px; }
html[dir="rtl"] .icon-out { transform: scaleX(-1); }
@media (max-width: 430px) {
  .signout .btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .signout .btn { min-width: 40px; padding-inline: 8px; }
}

.home-main {
  flex: 1;
  display: grid;
  gap: clamp(28px, 5vh, 56px);
  align-content: start;
  padding-block: clamp(20px, 5vh, 56px) var(--s-18);
}

.welcome { display: grid; gap: 2px; }
.home-hello { color: var(--text-3); font-size: var(--fs-body); }
.welcome h1 { font-size: var(--fs-display); line-height: 1.25; overflow-wrap: anywhere; }

.alerts { display: grid; gap: var(--s-3); margin-top: calc(var(--s-4) * -1); }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-4);
  margin-bottom: var(--s-5);
  padding-bottom: var(--s-4);
  border-bottom: 1px solid var(--line-strong);
}
.section-head > div { display: grid; gap: 4px; }
.section-head h2 { font-size: var(--fs-h2); font-weight: 800; }

/* --- نمای حوزه‌های کاری ---
 * کارتِ دوبخشی، با همان دستورِ زبانِ کارتِ کاتالوگ (متن + «جلد»): فهرستِ شماره‌دارِ حوزه‌ها و یک
 * «برگه‌ی نقشه»ی تیره که طرحِ خطیِ حوزه‌ی انتخاب‌شده را نشان می‌دهد (_caps.html ، _field_art.html).
 * برگه مثل جلدهای تیره‌ی ROZAN رنگِ خام دارد و در هر دو تمِ رابط همان می‌ماند. انتخاب و نمایشِ
 * خودکار با caps.js است؛ زمان‌سنجِ نمایشِ خودکار خودِ انیمیشنِ «caps-dwell» است، پس مکث = paused. */

.caps {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.06fr);
  gap: clamp(12px, 1.8vw, 24px);
  padding: 12px;
  padding-inline-start: clamp(12px, 1.6vw, 20px);
  border: 1px solid var(--surface-edge);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}

/* فهرست: دو ستونِ پنج‌تایی، ستون‌به‌ستون شماره می‌خورد (۰۱–۰۵ ، ۰۶–۱۰) */
.caps-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(5, minmax(0, 1fr));
  grid-auto-flow: column;
  column-gap: clamp(8px, 1.4vw, 20px);
  margin: 0;
  padding: 2px 0;
  list-style: none;
}
.caps-list li { display: grid; border-bottom: 1px solid var(--line-faint); }
.caps-list li:nth-child(5n) { border-bottom: 0; }

.cap {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 14px;
  align-content: center;
  align-items: baseline;
  width: 100%;
  min-height: 58px;
  margin-block: 3px;
  padding: 7px 14px;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: var(--text-2);
  text-align: start;
  transition: background-color var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease-out),
    box-shadow var(--dur-2) var(--ease-out);
}
.cap::before {
  content: "";
  position: absolute;
  inset-block: 13px;
  inset-inline-start: 0;
  width: 2px;
  border-radius: 2px;
  background: var(--accent-graphic);
  transform: scaleY(0);
  transition: transform var(--dur-3) var(--ease-out);
}
.cap-no {
  grid-row: span 2;
  direction: ltr;
  color: var(--text-faint);
  font-family: var(--font-display);
  font-size: 0.625rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  transition: color var(--dur-2) var(--ease-out);
}
.cap-name { font-size: 0.9375rem; font-weight: 650; line-height: 1.5; text-wrap: balance; }
.cap-latin {
  grid-column: 2;
  color: var(--text-faint);
  font-family: var(--font-display);
  font-size: 0.5rem;
  letter-spacing: 0.12em;
  line-height: 1.7;
  text-align: left;
  text-transform: uppercase;
  transition: color var(--dur-2) var(--ease-out);
}
html[dir="rtl"] .cap-latin { text-align: right; }
.cap:hover { background: var(--line-faint); color: var(--text-1); }
.cap:focus-visible { outline-offset: -2px; }
.cap.is-active { background: var(--surface-raised); box-shadow: var(--shadow-1), inset 0 0 0 1px var(--surface-edge); color: var(--text-1); }
.cap.is-active::before { transform: none; }
.cap.is-active .cap-no, .cap.is-active .cap-latin { color: var(--accent); }

/* برگه‌ی نقشه */
.caps-stage {
  --art-fg: #e9edf1;
  --art-accent: #74abdc;
  --art-glow: #cfe8ff;
  --art-fill: rgb(255 255 255 / 0.055);
  --art-solid: #27313c;
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 330px;
  overflow: hidden;
  border-radius: var(--r-md);
  background:
    radial-gradient(62% 76% at 50% 40%, rgb(116 171 220 / 0.15), transparent 72%),
    linear-gradient(165deg, #20252d 0%, #17191e 55%, #101114 100%);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.07), 0 18px 34px -22px rgb(0 0 0 / 0.9);
  color: #f5f6f7;
}
/* کاغذِ شطرنجیِ محو و چهار نشانه‌ی گوشه، مثل برگه‌ی نقشه‌کشی */
.caps-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgb(255 255 255 / 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / 0.045) 1px, transparent 1px);
  background-position: center;
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(78% 84% at 50% 42%, #000 25%, transparent 88%);
  mask-image: radial-gradient(78% 84% at 50% 42%, #000 25%, transparent 88%);
}
.caps-figs { position: relative; min-height: 0; }
.caps-figs::after {
  --c: rgb(255 255 255 / 0.3);
  content: "";
  position: absolute;
  inset: 11px;
  pointer-events: none;
  background:
    linear-gradient(var(--c), var(--c)) top left / 13px 1px no-repeat, linear-gradient(var(--c), var(--c)) top left / 1px 13px no-repeat,
    linear-gradient(var(--c), var(--c)) top right / 13px 1px no-repeat, linear-gradient(var(--c), var(--c)) top right / 1px 13px no-repeat,
    linear-gradient(var(--c), var(--c)) bottom left / 13px 1px no-repeat, linear-gradient(var(--c), var(--c)) bottom left / 1px 13px no-repeat,
    linear-gradient(var(--c), var(--c)) bottom right / 13px 1px no-repeat, linear-gradient(var(--c), var(--c)) bottom right / 1px 13px no-repeat;
}
.cap-fig {
  position: absolute;
  inset: clamp(10px, 1.4vw, 16px) clamp(18px, 2.6vw, 30px);
  visibility: hidden;
  opacity: 0;
  transform: scale(0.965);
  transition: opacity 0.45s var(--ease-out), transform 0.8s var(--ease-out), visibility 0s linear 0.45s;
}
.cap-fig.is-active { visibility: visible; opacity: 1; transform: none; transition-delay: 0s; }

/* طرح‌ها — کلاس‌ها در _field_art.html توضیح داده شده‌اند */
.cap-art { display: block; width: 100%; height: 100%; overflow: visible; direction: ltr; }
.cap-art * { fill: none; stroke: var(--art-fg); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.cap-art .f-body { fill: var(--art-fill); }
.cap-art .f-solid { fill: var(--art-solid); }
.cap-art .f-ground { fill: rgb(255 255 255 / 0.075); stroke: none; }
.cap-art .f-thin { stroke-width: 1; opacity: 0.55; }
.cap-art .f-faint { stroke-width: 1; opacity: 0.2; }
.cap-art .f-axis { stroke-width: 1; stroke-dasharray: 12 3 2 3; opacity: 0.4; }
.cap-art .f-dash { stroke-width: 1; stroke-dasharray: 3 4; opacity: 0.5; }
.cap-art .f-ticks { stroke-width: 5; stroke-linecap: butt; stroke-dasharray: 0.12 0.88; opacity: 0.45; }   /* pathLength = تعدادِ تیک‌ها */
.cap-art .f-bar { stroke-width: 4; stroke-linecap: butt; }
.cap-art .f-accent { stroke: var(--art-accent); stroke-width: 1.7; opacity: 1; }
.cap-art .f-accent.f-bar { stroke-width: 4; }
.cap-art .f-node { fill: var(--art-accent); stroke: none; }
.cap-art .f-px { fill: var(--art-accent); stroke: none; }
.cap-art .f-dot { fill: var(--art-fg); stroke: none; }
.cap-art .f-glow { fill: var(--art-glow); stroke: none; filter: drop-shadow(0 0 5px var(--art-accent)); }
.cap-art .f-label {
  fill: var(--art-fg);
  stroke: none;
  opacity: 0.5;
  font-family: var(--font-display);
  font-size: 7px;
  letter-spacing: 0.16em;
  text-anchor: middle;
}
.cap-art .f-label.f-strong { opacity: 0.85; }
.cap-art .f-draw { stroke-dasharray: 1; }
.cap-art .f-march { stroke-dasharray: 5 5; }
.cap-art .f-flow { stroke: var(--art-glow); stroke-width: 2.2; stroke-dasharray: 0.06 0.94; stroke-dashoffset: 1; opacity: 0; }
.cap-art .f-scan { stroke: var(--art-glow); stroke-width: 1.2; opacity: 0; }
.cap-art .f-rock { transform: rotate(-8deg); }

.cap-fig.is-active .f-draw { animation: cap-draw 1.2s var(--ease-out) both; }
.cap-fig.is-active .f-march { animation: cap-march 1.5s linear infinite; }
.cap-fig.is-active .f-flow { opacity: 0.95; animation: cap-flow 3.4s linear 0.5s infinite both; }
.cap-fig.is-active .f-scan { opacity: 0.75; animation: cap-scan 4.2s var(--ease-in-out) infinite alternate; }
.cap-fig.is-active .f-rock { animation: cap-rock 7s var(--ease-in-out) infinite alternate; }

@keyframes cap-draw { from { stroke-dashoffset: 1; } }
@keyframes cap-march { to { stroke-dashoffset: -20; } }
@keyframes cap-flow { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes cap-scan { to { transform: translateY(180px); } }
@keyframes cap-rock { from { transform: rotate(-12deg); } to { transform: rotate(-3deg); } }
@keyframes caps-dwell { from { transform: scaleX(0); } }

/* پلاکِ پایینِ برگه: شماره و نامِ طرح، توقف/ادامه، و ده تکه‌ی پیشرفت روی لبه‌ی بالایش */
.caps-plate {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 48px;
  padding: 8px 16px;
  padding-inline-end: 10px;
  background: rgb(8 9 11 / 0.3);
}
.caps-now { display: flex; flex: 1 1 0; align-items: baseline; gap: 12px; min-width: 0; color: #f5f6f7; }
.caps-fig-no { flex: none; direction: ltr; color: #9cc4e8; font-family: var(--font-display); font-size: 0.5625rem; letter-spacing: 0.18em; }
.caps-fig-no b { color: inherit; font-weight: 400; }
.caps-fig-name { flex: 0 1 auto; min-width: 0; overflow: hidden; font-size: 0.9375rem; font-weight: 700; line-height: 1.6; text-overflow: ellipsis; white-space: nowrap; }
.caps-fig-latin {
  flex: 0 100 auto;   /* اول این کوتاه می‌شود، نه نامِ فارسی */
  min-width: 0;
  overflow: hidden;
  color: rgb(245 246 247 / 0.5);
  font-family: var(--font-display);
  font-size: 0.5rem;
  letter-spacing: 0.14em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}
.caps-segs { position: absolute; inset-inline: 16px; top: -1px; display: flex; gap: 4px; }
.caps-seg { position: relative; flex: 1; height: 2px; overflow: hidden; border-radius: 1px; background: rgb(255 255 255 / 0.13); }
.caps-seg::after { content: ""; position: absolute; inset: 0; background: #9cc4e8; transform: scaleX(0); transform-origin: right center; }
html[dir="ltr"] .caps-seg::after { transform-origin: left center; }
.caps-seg.is-active::after { transform: none; }
.caps.is-live .caps-seg.is-active::after { animation: caps-dwell var(--caps-dwell, 5.6s) linear both; }
.caps.is-held .caps-seg.is-active::after { animation-play-state: paused; }

.caps-toggle {
  display: grid;
  flex: none;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid rgb(255 255 255 / 0.16);
  border-radius: 50%;
  background: none;
  color: rgb(245 246 247 / 0.78);
  transition: border-color var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease-out);
}
.caps-toggle:hover { border-color: rgb(255 255 255 / 0.42); color: #fff; }
.caps-toggle:focus-visible { outline-color: #9cc4e8; outline-offset: 2px; }
.caps-toggle svg { width: 11px; height: 11px; fill: currentColor; }
.caps-toggle .ic-play, .caps-toggle[aria-pressed="true"] .ic-pause { display: none; }
.caps-toggle[aria-pressed="true"] .ic-play { display: block; }

@media (max-width: 1000px) {
  .cap-latin { display: none; }
  .cap { min-height: 52px; }
}
@media (max-width: 860px) {
  .caps { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 10px; }
  .caps-stage { order: -1; min-height: 0; height: clamp(214px, 46vw, 340px); }
  .caps-list { grid-template-rows: repeat(5, auto); padding: 0 2px; }
  .cap { min-height: 42px; margin-block: 2px; padding: 4px 10px; column-gap: 10px; }
  .cap::before { inset-block: 10px; }
  .cap-name { font-size: 0.875rem; }
}
@media (max-width: 560px) {
  .caps-plate { gap: 10px; min-height: 44px; padding-inline-start: 12px; }
  .caps-segs { inset-inline: 12px; gap: 3px; }
  .caps-now { gap: 8px; }
  .caps-fig-latin { display: none; }
  .caps-fig-name { font-size: 0.875rem; }
  .cap-art .f-label { font-size: 8.5px; }
  .cap-art .f-more { display: none; }
  .cap-name { font-size: 0.8125rem; line-height: 1.45; }
}
@media (prefers-reduced-motion: reduce) {
  .cap-art .f-flow, .cap-art .f-scan { display: none; }
}

/* --- کارت کاتالوگ --- */

.cat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); }
.cat-grid[data-count="1"] { grid-template-columns: minmax(0, 1fr); }

.cat-card {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1fr);   /* تصویر تقریباً نیمی از کارت است */
  gap: clamp(14px, 2vw, 24px);
  align-items: center;
  padding: 12px;
  padding-inline-end: clamp(14px, 2vw, 24px);
  border: 1px solid var(--surface-edge);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  transition: box-shadow var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out);
}
.cat-card:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); }
.cat-card.is-pending { opacity: 0.6; }
.cat-card.is-pending:hover { transform: none; box-shadow: var(--shadow-1); }
.cat-grid[data-count="1"] .cat-card { grid-template-columns: minmax(0, 0.62fr) minmax(0, 1fr); padding: 16px; padding-inline-end: clamp(18px, 4vw, 56px); }

/* تصویرِ کارت. صفحه‌ی اولِ کاتالوگ را نمی‌گیریم (هر درخواستِ صفحه در گزارش بازدید ثبت می‌شود و
   کارت نباید «یک صفحه از کاتالوگ» به نظر برسد)؛ هر خانواده‌ی محصول طرحِ خطیِ خودش را دارد
   (_cover_art.html) و مدیر می‌تواند عکسِ خودش را بگذارد. زمینه حال‌وهوای خودِ کاتالوگ است:
   paper = جلدهای روشن SAMT، ink = جلدهای تیره‌ی ROZAN. رنگ‌ها عمداً خام‌اند — در تم تیره‌ی
   رابط هم همان می‌مانند. */
.cover {
  --cover-fg: #16171b;
  --cover-dim: #6e7078;
  --cover-line: rgb(22 23 27 / 0.2);
  --cover-accent: #2a6699;
  --cover-fill: rgb(255 255 255 / 0.55);
  --cover-shadow: rgb(22 23 27 / 0.1);
  position: relative;
  isolation: isolate;
  display: grid;
  aspect-ratio: 842 / 596;
  overflow: hidden;
  border-radius: var(--r-md);
  background: linear-gradient(165deg, #eeeff0 0%, #e0e1e3 48%, #cfd0d5 100%);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.7), 0 14px 30px -18px rgb(10 11 14 / 0.6);
  color: var(--cover-fg);
  text-decoration: none;
  container-type: inline-size;
}
.cover-ink {
  --cover-fg: #f5f6f7;
  --cover-dim: #8d939b;
  --cover-line: rgb(255 255 255 / 0.16);
  --cover-accent: #74abdc;
  --cover-fill: rgb(255 255 255 / 0.045);
  --cover-shadow: rgb(0 0 0 / 0.45);
  background: linear-gradient(165deg, #20242b 0%, #18191d 55%, #111215 100%);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.07), 0 14px 30px -18px rgb(0 0 0 / 0.9);
}
.cover:hover { color: var(--cover-fg); }

/* مطلق، نه درونِ جریان: وگرنه ارتفاعِ ذاتیِ SVG از قابِ پهنِ موبایل بیرون می‌زد و پایه‌ی طرح بریده می‌شد */
.cover-art { position: absolute; top: 7%; left: 4%; width: 92%; height: 89%; overflow: visible; transition: transform var(--dur-3) var(--ease-out); }
.cat-card:hover .cover-art { transform: scale(1.035); }
.cover-art * { fill: none; stroke: var(--cover-fg); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.cover-art .a-fill { fill: var(--cover-fill); }
.cover-art .a-thin { stroke-width: 1; opacity: 0.5; }
.cover-art .a-dash { stroke-width: 1; stroke-dasharray: 2 5; opacity: 0.38; }
.cover-art .a-accent { stroke: var(--cover-accent); stroke-width: 1.7; }
.cover-art .a-move { stroke-dasharray: 5 5; }
.cover-art .a-fade1 { opacity: 0.6; }
.cover-art .a-fade2 { opacity: 0.3; }
.cover-art .a-dot { fill: var(--cover-fg); stroke: none; }
.cover-art .a-glow { fill: var(--cover-accent); stroke: none; }
.cover-art .a-shadow { fill: var(--cover-shadow); stroke: none; }
.cover-art .a-letter { fill: var(--cover-accent); stroke: none; font-family: var(--font-display); font-size: 13px; letter-spacing: 0.1em; text-anchor: middle; }

.cover-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform var(--dur-3) var(--ease-out); }
.cat-card:hover .cover-photo { transform: scale(1.04); }

.cover-brand {
  position: absolute;
  top: 8%;
  left: 7%;   /* مثل خودِ کاتالوگ‌ها: نامِ برند بالا-چپ، در هر دو زبان */
  direction: ltr;
  color: var(--cover-dim);
  font-size: clamp(0.4375rem, 3.4cqw, 0.6875rem);
}
.cover.has-photo .cover-brand { display: none; }

.cat-body { display: grid; gap: 6px; align-content: center; min-width: 0; }
.cat-body h3 { font-size: clamp(1.0625rem, 0.95rem + 0.5vw, 1.25rem); font-weight: 800; line-height: 1.4; overflow-wrap: anywhere; }
.cat-grid[data-count="1"] .cat-body h3 { font-size: clamp(1.375rem, 1.1rem + 1.2vw, 1.875rem); }
.cat-body h3 a { color: inherit; text-decoration: none; }
.cat-body h3 a:hover { color: var(--accent); }
.cat-product {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  color: var(--text-2);
  font-size: var(--fs-sm);
  line-height: 1.75;
}
.cat-meta { color: var(--text-3); font-size: var(--fs-xs); }
.cat-meta a { color: var(--accent); text-decoration: none; }
.cat-meta a:hover { text-decoration: underline; }

/* تا کجا خوانده — یک خط مویی، نه یک نمودار */
.cat-progress { height: 2px; margin-top: 4px; border-radius: 1px; background: var(--line); }
.cat-progress i { display: block; width: var(--p); height: 100%; border-radius: 1px; background: var(--text-1); }

.cta-group { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: var(--s-3); }
.cat-order { border-color: var(--accent-ring); color: var(--accent); }
.cat-order:hover { border-color: var(--accent); background: var(--accent-tint); color: var(--accent-hover); }

/* --- درخواست‌ها: ردیف‌های مویی --- */

.req-list { margin: 0; padding: 0; list-style: none; }
.req-list a {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: var(--s-4);
  padding: 14px 6px;
  border-bottom: 1px solid var(--line);
  color: var(--text-1);
  font-size: var(--fs-sm);
  text-decoration: none;
  transition: background var(--dur-1), padding var(--dur-2) var(--ease-out);
}
.req-list a:hover { background: var(--line-faint); padding-inline: 12px; }
.req-list .icon { color: var(--text-faint); }
.req-no { min-width: 3.4em; font-size: 0.75rem; color: var(--accent); }
.req-cat { display: grid; gap: 1px; min-width: 0; font-weight: 600; }
.req-cat, .req-cat small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.req-cat small { color: var(--text-3); font-size: var(--fs-xs); font-weight: 400; }
.req-code { font-family: var(--font-display); font-size: 0.6875rem; letter-spacing: 0.04em; }
.req-date { color: var(--text-3); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }

/* --- فرم درخواست، آخرِ صفحه --- */

.request-new {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(20px, 4vw, 64px);
  padding: clamp(20px, 3.2vw, 40px);
  background: var(--panel-grad);
  border-color: var(--panel-line);
}
.request-copy { display: grid; gap: var(--s-2); align-content: start; }
.request-copy h2 { font-size: var(--fs-h1); font-weight: 800; }
.request-copy p:last-child { margin-top: var(--s-2); color: var(--text-2); max-width: 36ch; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); }
.request-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-4); margin-top: var(--s-1); }
.request-actions .field-hint { flex: 1 1 220px; }

@media (max-width: 900px) {
  .cat-grid { grid-template-columns: minmax(0, 1fr); }
  .request-new { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  /* موبایل: تصویر بالای کارت و تمام‌عرض — بندانگشتیِ ۱۱۶ پیکسلی برای یک طرحِ خطی خیلی کوچک بود */
  .cat-card,
  .cat-grid[data-count="1"] .cat-card { grid-template-columns: minmax(0, 1fr); padding: 10px; gap: 12px; }
  .cat-card .cover { aspect-ratio: 2 / 1; }
  .cat-body { padding: 0 6px 6px; }
  .cat-card .cta-group .btn-primary { flex: 1; }
  .cat-grid[data-count="1"] .cat-body h3 { font-size: 1.125rem; }
  .form-row { grid-template-columns: 1fr; }
  .req-list a { grid-template-columns: auto minmax(0, 1fr) auto; row-gap: 4px; }
  .req-list .req-date { grid-column: 2; }
  .req-list .icon { display: none; }
}

/* ================================================================== *
 * ۶. نمایشگر — همیشه تم ink تا کاغذ کاتالوگ برجسته بماند
 * ================================================================== */

.viewer-body { overflow-x: auto; overscroll-behavior-y: none; }
.viewer-body::before { background: var(--bg); }

.viewer-top {
  position: fixed;
  top: 0;
  inset-inline: 0;
  z-index: var(--z-bar);
  display: flex;
  align-items: center;
  gap: var(--s-4);
  height: var(--topbar-h);
  padding-inline: clamp(10px, 2.4vw, 24px);
  border-bottom: 1px solid var(--line);
  background: rgb(24 25 29 / 0.88);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
}

.back-home {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding-inline: 10px 14px;
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: var(--fs-sm);
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--dur-1), color var(--dur-1);
}
.back-home:hover { background: var(--line-faint); color: var(--text-1); }

.doc-title {
  min-width: 0;
  padding-inline-start: var(--s-4);
  border-inline-start: 1px solid var(--line);
  overflow: hidden;
  color: var(--text-1);
  font-size: 0.9375rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.viewer-top-end {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  min-width: 0;
  margin-inline-start: auto;
}

.stamp-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 30vw;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  color: var(--text-3);
  font-size: var(--fs-xs);
  line-height: 1.6;
  white-space: nowrap;
}
.stamp-chip span { overflow: hidden; text-overflow: ellipsis; }
.stamp-chip .icon { color: var(--accent); }

.read-progress {
  position: absolute;
  inset-inline: 0;
  bottom: -1px;
  height: 2px;
  transform-origin: right center;
  transform: scaleX(var(--progress, 0));
  background: var(--accent-graphic);
  box-shadow: 0 0 10px var(--accent-ring);
}

/* اطلاعیه‌ی مهر — صادقانه، ولی مزاحم مطالعه نیست */
.stamp-notice {
  position: fixed;
  top: calc(var(--topbar-h) + 14px);
  inset-inline: 0;
  z-index: var(--z-notice);
  display: flex;
  align-items: center;
  gap: var(--s-4);
  width: max-content;
  max-width: calc(100vw - 24px);
  margin-inline: auto;
  padding-block: 10px;
  padding-inline: 16px 10px;
  border: 1px solid var(--panel-line);
  border-radius: var(--r-md);
  background: var(--panel-grad);
  box-shadow: var(--shadow-3);
  color: var(--text-1);
  font-size: var(--fs-sm);
  line-height: 1.8;
  animation: drop var(--dur-3) var(--ease-out) both;
}
.stamp-notice > .icon { color: var(--accent); }
.stamp-notice.is-leaving { animation: lift var(--dur-2) var(--ease-in-out) both; }

/* --- صفحات --- */

.pages {
  --zoom: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(16px, 3vh, 32px);
  width: max-content;
  min-width: 100%;
  padding: calc(var(--topbar-h) + clamp(16px, 3vh, 32px)) 12px calc(120px + env(safe-area-inset-bottom, 0px));
  /* زوم دوانگشتی را خودمان می‌گیریم تا نسخه‌ی DPI بالاتر بیاید، نه بزرگ‌نمایی مات مرورگر */
  touch-action: pan-x pan-y;
}

.page-slot {
  position: relative;
  flex: none;
  /* --sbw: پهنای اسکرول‌بار عمودی (viewer.js اندازه می‌گیرد) — 100vw آن را هم می‌شمارد */
  width: calc(min(100vw - 24px - var(--sbw, 0px), var(--base-w, 960px)) * var(--zoom));
  border-radius: 6px;
  background: var(--surface);
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.04), 0 22px 50px -24px rgb(0 0 0 / 0.9);
  scroll-margin-top: calc(var(--topbar-h) + 16px);
}

.page-slot canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  transition: filter var(--dur-2) var(--ease-out);
}

/* جای‌نگهدار — شماره‌ی صفحه به سبک کاتالوگ */
.page-slot .ph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 6px;
  color: var(--text-faint);
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 3vw, 2rem);
  letter-spacing: 0.2em;
  direction: ltr;
}
.page-slot .ph::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgb(255 255 255 / 0.045) 50%, transparent 70%);
  transform: translateX(-100%);
  animation: shimmer 1.8s var(--ease-in-out) infinite;
}
.page-slot.is-failed .ph::after { display: none; }
.page-slot .ph-retry {
  display: grid;
  gap: 12px;
  justify-items: center;
  font-family: var(--font-fa);
  font-size: var(--fs-sm);
  letter-spacing: 0;
  direction: rtl;
  color: var(--text-3);
}
html[dir="ltr"] .page-slot .ph-retry { direction: ltr; }

body.obscured .page-slot canvas { filter: blur(18px) brightness(0.8); }
body.obscured::after {
  content: "برای ادامه‌ی مطالعه به این پنجره برگردید";
  position: fixed;
  top: 50%;
  inset-inline: 0;
  z-index: var(--z-notice);
  width: max-content;
  max-width: 90vw;
  margin-inline: auto;
  padding: 10px 22px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: var(--surface-raised);
  box-shadow: var(--shadow-3);
  color: var(--text-1);
  font-size: var(--fs-sm);
  transform: translateY(-50%);
  pointer-events: none;
}

/* --- نشان‌گذاری --- */

.mark-btn {
  position: absolute;
  top: 12px;
  inset-inline-start: 12px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgb(255 255 255 / 0.14);
  border-radius: 50%;
  background: rgb(24 25 29 / 0.62);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #f5f6f7;
  opacity: 0;
  transform: scale(0.92);
  transition: opacity var(--dur-2), transform var(--dur-2) var(--ease-out), color var(--dur-1), background var(--dur-1);
}
.page-slot:hover .mark-btn,
.mark-btn:focus-visible,
.mark-btn.on { opacity: 1; transform: none; }
.mark-btn:hover { background: rgb(24 25 29 / 0.85); }
.mark-btn.on { color: var(--star); }
.mark-btn.on .icon { fill: currentColor; }
.mark-btn.is-popping .icon { animation: pop var(--dur-3) var(--ease-out); }
@media (hover: none) { .mark-btn { opacity: 0.85; transform: none; } }

/* --- ریل صفحات (دسکتاپ) --- */

.page-rail {
  position: fixed;
  top: 50%;
  inset-inline-end: 14px;
  z-index: var(--z-rail);
  display: none;
  flex-direction: column;
  max-height: min(70vh, 640px);
  padding: 10px 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgb(31 32 36 / 0.72);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transform: translateY(-50%);
}
.rail-tick {
  position: relative;
  flex: 1 1 14px;
  min-height: 3px;
  max-height: 16px;
  width: 30px;
  padding: 0;
  border: 0;
  background: none;
}
.rail-tick::before {
  content: "";
  position: absolute;
  top: 50%;
  inset-inline-end: 4px;
  width: 9px;
  height: 1.5px;
  margin-top: -0.75px;
  border-radius: 1px;
  background: var(--line-strong);
  transition: width var(--dur-2) var(--ease-out), background var(--dur-1);
}
.rail-tick:hover::before { width: 15px; background: var(--text-1); }
.rail-tick.is-current::before { width: 20px; background: var(--accent); box-shadow: 0 0 8px var(--accent-ring); }
.rail-tick.is-marked::after {
  content: "";
  position: absolute;
  top: 50%;
  inset-inline-start: 1px;
  width: 5px;
  height: 5px;
  margin-top: -2.5px;
  background: var(--star);
  transform: rotate(45deg);
}
.rail-tip {
  position: absolute;
  top: 50%;
  left: calc(100% + 10px);
  padding: 3px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface-raised);
  color: var(--text-1);
  font-family: var(--font-display);
  font-size: 0.625rem;
  letter-spacing: 0.12em;
  direction: ltr;
  opacity: 0;
  transform: translateY(-50%);
  pointer-events: none;
  transition: opacity var(--dur-1);
}
.rail-tick:hover .rail-tip,
.rail-tick:focus-visible .rail-tip { opacity: 1; }
@media (min-width: 1100px) and (hover: hover) { .page-rail { display: flex; } }

/* --- داک پایین --- */

.viewer-bar {
  position: fixed;
  inset-inline: 0;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  z-index: var(--z-bar);
  display: flex;
  align-items: center;
  gap: 6px;
  width: max-content;
  max-width: calc(100vw - 12px);
  margin-inline: auto;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: rgb(31 32 36 / 0.9);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  backdrop-filter: blur(16px) saturate(1.3);
  box-shadow: var(--shadow-3);
  transition: inset-inline-end var(--dur-3) var(--ease-out);
}

.dock-group { display: flex; align-items: center; gap: 2px; }
.dock-zoom { direction: ltr; } /* − همیشه چپ، + همیشه راست */
.dock-sep { flex: none; width: 1px; height: 22px; margin-inline: 2px; background: var(--line-strong); }

.dock-btn {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-2);
  transition: background var(--dur-1), color var(--dur-1);
}
.dock-btn:hover { background: rgb(255 255 255 / 0.07); color: var(--text-1); }
.dock-btn:disabled { opacity: 0.3; cursor: default; background: transparent; }

.viewer-bar .btn { min-height: 40px; border-radius: 10px; }

.page-ind { display: flex; align-items: center; gap: 6px; padding-inline: 4px; direction: ltr; }

#page-jump {
  width: 46px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-sunken);
  color: var(--text-1);
  font-family: var(--font-display);
  font-size: 0.75rem;
  text-align: center;
  appearance: textfield;
  -moz-appearance: textfield;
}
#page-jump::-webkit-outer-spin-button,
#page-jump::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
#page-jump:focus { outline: 0; border-color: var(--accent-graphic); box-shadow: 0 0 0 3px var(--accent-ring); }

#page-total,
.zoom-ind {
  font-family: var(--font-display);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  color: var(--text-3);
  white-space: nowrap;
}

.zoom-ind {
  min-width: 52px;
  height: 32px;
  padding: 0 4px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: center;
  direction: ltr;
}
.zoom-ind:hover { background: rgb(255 255 255 / 0.07); color: var(--text-1); }

.count-chip {
  position: absolute;
  top: 3px;
  inset-inline-end: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--r-pill);
  background: var(--accent-graphic);
  color: #fff;
  font-family: var(--font-fa);
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--surface);
}
.chip-alert { background: #d9483d; }

@media (max-width: 760px) {
  .dock-zoom, .dock-zoom + .dock-sep, #btn-full, #btn-full + .dock-sep { display: none; }
  .stamp-chip { display: none; }
}
@media (max-width: 430px) {
  .dock-step { display: none; }
  .viewer-bar { gap: 3px; padding: 5px; }
  .viewer-bar .btn { padding-inline: 12px; font-size: 0.78125rem; }
  .back-home span { display: none; }
  .doc-title { font-size: var(--fs-sm); }
  .stamp-notice { gap: 10px; padding-block: 8px; padding-inline: 12px 8px; font-size: var(--fs-xs); }
  .stamp-notice > .icon { display: none; }
}

/* --- برگه‌ها: فرم درخواست، نشان‌ها، درخواست‌های من --- */

.rfp-modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-sheet);
  display: flex;
  justify-content: flex-end;
  background: var(--scrim);
  animation: fade var(--dur-2) var(--ease-out) both;
}
.rfp-modal[hidden] { display: none; }

.rfp-box {
  display: flex;
  flex-direction: column;
  width: min(460px, 100%);
  height: 100%;
  border-inline-start: 1px solid var(--line-strong);
  background: var(--surface);
  box-shadow: var(--shadow-3);
  animation: sheet-side var(--dur-3) var(--ease-out) both;
}

.rfp-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-4);
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--line);
}
.rfp-head > div { display: grid; gap: 4px; }
.rfp-head h2 { font-size: 1.1875rem; font-weight: 800; }

.rfp-head button {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  margin-block-start: -4px;
  margin-inline-end: -6px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-3);
  transition: background var(--dur-1), color var(--dur-1);
}
.rfp-head button:hover { background: var(--line-faint); color: var(--text-1); }

.sheet-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 22px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.sheet-body > :last-child { margin-bottom: 22px; }
.sheet-body > .rfp-form:last-child { margin-bottom: 0; } /* پایش دکمه‌های چسبان است */

/* زیر ۱۱۰۰px برگه مودال است: صفحه‌ی پشتش اسکرول نخورد */
@media (max-width: 1099px) { body.sheet-open { overflow: hidden; } }

.rfp-intro { margin-bottom: var(--s-5); color: var(--text-3); font-size: var(--fs-sm); line-height: 1.9; }

.rfp-form { display: grid; gap: var(--s-4); }
#rfp-fields { display: grid; gap: var(--s-4); }
#rfp-fields:empty { display: none; }

.form-legend {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-top: var(--s-2);
  color: var(--text-1);
  font-size: var(--fs-sm);
  font-weight: 700;
}
.form-legend::after { content: ""; flex: 1; height: 1px; background: var(--line); }
#rfp-fields:empty + .form-legend { margin-top: 0; }

.rfp-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: var(--s-2);
  margin: 6px -22px 0 !important;
  padding: 14px 22px calc(16px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.rfp-actions .btn-primary { flex: 1; }

.ghost-btn {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-2);
  font-size: var(--fs-xs);
  font-weight: 600;
  transition: border-color var(--dur-1), color var(--dur-1);
}
.ghost-btn:hover { border-color: var(--text-1); color: var(--text-1); }

.rfp-msg {
  display: flex;
  gap: var(--s-3);
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  line-height: 1.8;
  color: var(--text-1);
}
.rfp-msg .icon { margin-top: 3px; }
.rfp-msg.ok { background: var(--ok-tint); border-color: var(--ok-line); }
.rfp-msg.ok .icon { color: var(--ok); }
.rfp-msg.err { background: var(--danger-tint); border-color: var(--danger-line); }
.rfp-msg.err .icon { color: var(--danger); }

/* نشان‌ها */
.marks-list { display: grid; gap: var(--s-3); }
.mark-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--s-2);
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-raised);
}
.mark-go {
  min-width: 52px;
  height: 46px;
  padding: 0 8px;
  border: 0;
  border-radius: 9px;
  background: var(--accent-tint);
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  direction: ltr;
  transition: background var(--dur-1), color var(--dur-1);
}
.mark-go:hover { background: var(--accent-graphic); color: #fff; }
.mark-row .mark-note { border-color: transparent; background: transparent; padding-inline: 8px; }
.mark-row .mark-note:hover { border-color: var(--line); }
.mark-del {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-faint);
  transition: background var(--dur-1), color var(--dur-1);
}
.mark-del:hover { background: var(--danger-tint); color: var(--danger); }

.empty {
  display: grid;
  justify-items: center;
  gap: var(--s-3);
  padding: var(--s-10) var(--s-4);
  color: var(--text-3);
  font-size: var(--fs-sm);
  text-align: center;
}
.empty .icon { width: 30px; height: 30px; color: var(--text-faint); stroke-width: 1.3; }

/* درخواست‌های من */
.mine-list { display: grid; gap: var(--s-4); }

.mine-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-raised);
}

.mine-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: var(--s-3); }
.mine-head b { font-size: 0.9375rem; }
.mine-head b span { font-family: var(--font-display); font-size: 0.75rem; font-weight: 400; letter-spacing: 0.06em; color: var(--accent); margin-inline-start: 4px; }
.mine-date { margin-inline-start: auto; color: var(--text-3); font-size: var(--fs-xs); }
/* درخواست‌ها مالِ کدند، نه یک کاتالوگ؛ هر کارت می‌گوید دربارهٔ کدام است */
.mine-catalog { margin: -4px 0 var(--s-3); color: var(--text-3); font-size: var(--fs-xs); }

.mine-items { margin: 0; padding: 0; list-style: none; font-size: var(--fs-sm); }
.mine-items li {
  display: flex;
  justify-content: space-between;
  gap: var(--s-4);
  padding-block: 8px;
  border-bottom: 1px solid var(--line);
  line-height: 1.7;
}
.mine-items li:first-child { border-top: 1px solid var(--line-strong); }
.mine-items li span { color: var(--text-3); }
.mine-items li b { font-weight: 600; text-align: end; }

.mine-meta { margin-top: var(--s-3); color: var(--text-3); font-size: var(--fs-xs); }

.mine-note {
  margin-top: var(--s-3);
  padding: 10px 14px;
  border-inline-start: 2px solid var(--line-strong);
  background: var(--line-faint);
  color: var(--text-2);
  font-size: var(--fs-sm);
  line-height: 1.9;
  white-space: pre-wrap;
}

.mine-thread { margin-top: var(--s-4); padding-top: var(--s-4); border-top: 1px dashed var(--line-strong); }
.mine-thread h4 { margin-bottom: var(--s-3); color: var(--text-3); font-size: var(--fs-xs); font-weight: 500; }

.cmsg { max-width: 88%; margin-bottom: var(--s-2); padding: 9px 13px; border: 1px solid var(--line); border-radius: 14px; }
.cmsg-head { display: flex; align-items: center; gap: 8px; color: var(--text-3); font-size: 0.6875rem; }
.cmsg-head b { font-size: var(--fs-xs); }
.cmsg p { margin-top: 2px; color: var(--text-1); font-size: var(--fs-sm); line-height: 1.9; white-space: pre-wrap; }
.cmsg-them { border-color: var(--panel-line); border-start-start-radius: 4px; background: var(--panel-grad); }
.cmsg-them .cmsg-head b { color: var(--accent); }
.cmsg-me { margin-inline-start: auto; border-start-end-radius: 4px; background: var(--surface); }

.cmsg-form { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: var(--s-2); margin-top: var(--s-3); }
.cmsg-form textarea { min-height: 46px; padding-block: 9px; }
.cmsg-form button {
  min-height: 46px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--r-sm);
  background: var(--primary-bg);
  color: var(--primary-fg);
  font-size: var(--fs-sm);
  font-weight: 600;
}
.cmsg-form button:hover { background: var(--primary-hover); }
.cmsg-form button:disabled { opacity: 0.5; }

.mine-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); margin-top: var(--s-4); }
.mine-locked { color: var(--text-faint); font-size: var(--fs-xs); }

.mine-history { margin-top: var(--s-3); padding-top: var(--s-3); border-top: 1px dashed var(--line-strong); }
.mine-history .rev { margin-bottom: var(--s-3); font-size: var(--fs-xs); }
.mine-history .rev-no { color: var(--accent); font-weight: 700; }
.mine-history .rev-date { margin-inline-start: 8px; color: var(--text-faint); }
.mine-history ul { margin: 4px 0 0; padding-inline-start: 18px; color: var(--text-3); line-height: 1.9; }

/* دسکتاپ: برگه کنار کاتالوگ می‌نشیند تا هنگام نوشتن، جدول مشخصات دیده شود */
@media (min-width: 1100px) {
  .rfp-modal { top: var(--topbar-h); background: transparent; pointer-events: none; animation: none; }
  .rfp-box { pointer-events: auto; box-shadow: 24px 0 60px -30px rgb(0 0 0 / 0.8); }
  html[dir="ltr"] .rfp-box { box-shadow: -24px 0 60px -30px rgb(0 0 0 / 0.8); }
  body.sheet-open .pages { padding-inline-end: 472px; }
  body.sheet-open .page-slot { width: calc(min(100vw - 496px - var(--sbw, 0px), var(--base-w, 960px)) * var(--zoom)); }
  body.sheet-open .viewer-bar,
  body.sheet-open .stamp-notice { inset-inline-end: 460px; max-width: calc(100vw - 472px); }
  body.sheet-open .page-rail { display: none; }
}

/* موبایل: برگه از پایین بالا می‌آید */
@media (max-width: 700px) {
  .rfp-modal { align-items: flex-end; }
  .rfp-box {
    width: 100%;
    height: auto;
    max-height: 92vh;
    max-height: 92dvh;
    border: 0;
    border-top: 1px solid var(--line-strong);
    border-radius: 20px 20px 0 0;
    animation-name: sheet-up;
  }
  .rfp-head { position: relative; padding-top: 26px; }
  .rfp-head::before {
    content: "";
    position: absolute;
    top: 9px;
    left: 50%;
    width: 38px;
    height: 4px;
    margin-left: -19px;
    border-radius: 2px;
    background: var(--line-strong);
  }
}

/* --- «کد سفارش» ---
 * همان صفحه‌ی ORDERING CODE خودِ کاتالوگ، این بار زنده: خانه‌های کد با Michroma، شماره و نامِ جایگاه
 * زیرشان، خط تیره میانِ گروه‌ها. کد همیشه چپ‌به‌راست خوانده می‌شود (dir=ltr روی خودِ ردیف).
 * سازنده یک «برگه» است (#order-sheet — در دسکتاپ کنارِ کاتالوگ می‌نشیند تا جدولِ خودِ کاتالوگ هم دیده
 * شود) و سه راهِ همیشه‌پیدا دارد تا تهِ کاتالوگ گم نشود: نوارِ بالای صفحه‌ی اول (.order-strip)،
 * دکمه‌ی داک (.dock-order) و کارتِ پایانِ کاتالوگ (.order-panel). نوار و کارت خواهرِ .pages هستند،
 * نه فرزندش: زوم فقط صفحه‌ها را بزرگ می‌کند و این‌ها هم‌عرضِ پنجره می‌مانند. */

.order-strip,
.order-panel {
  position: sticky;            /* با اسکرولِ افقیِ زوم جابه‌جا نشود */
  inset-inline: 0;
  width: calc(100vw - var(--sbw, 0px));
  padding-inline: 12px;
}
/* نوار با عرضِ خودش تصمیم می‌گیرد چه نشان دهد (برگه‌ی کناری که باز شود، باریک‌تر می‌شود) */
.order-strip { padding-top: calc(var(--topbar-h) + clamp(14px, 2.4vh, 24px)); container: orderstrip / inline-size; }
body.has-order .pages { padding-top: clamp(14px, 2.4vh, 24px); padding-bottom: clamp(16px, 3vh, 32px); }
.order-panel { padding-bottom: calc(128px + env(safe-area-inset-bottom, 0px)); scroll-margin-top: calc(var(--topbar-h) + 16px); }
.order-panel[hidden], .order-strip[hidden] { display: none; }
/* اطلاعیه‌ی مهر بالای صفحه می‌نشست، درست روی همین نوار؛ در کاتالوگِ دارای کد سفارش بالای داک می‌آید */
body.has-order .stamp-notice { top: auto; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); animation-name: rise; }

.order-cta {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px clamp(14px, 2vw, 28px);
  width: min(100%, 1180px);
  margin-inline: auto;
  padding: 14px clamp(14px, 2vw, 24px);
  overflow: hidden;
  border: 1px solid var(--panel-line);
  border-radius: var(--r-lg);
  background: var(--panel-grad);
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.03), 0 18px 40px -26px rgb(0 0 0 / 0.9);
}
.order-cta::before {   /* خطِ آبیِ لبه: «این‌جا کاری می‌شود کرد» */
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 3px;
  background: var(--accent-graphic);
  box-shadow: 0 0 18px var(--accent-ring);
}
.order-cta-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--accent-ring);
  border-radius: 12px;
  background: var(--accent-tint);
  color: var(--accent);
}
.order-cta-copy { display: grid; gap: 2px; min-width: 0; }
.order-cta-copy h2 { font-size: 1.0625rem; font-weight: 800; line-height: 1.5; }
.order-cta-copy > p:last-child { color: var(--text-3); font-size: var(--fs-xs); line-height: 1.8; }
.order-cta-go { min-height: 42px; }
.order-cta-go.is-ready { background: var(--accent-graphic); color: #fff; }
.order-cta-go.is-ready:hover { background: var(--accent); color: #10151b; }

/* کدِ کوچک: همان خانه‌ها، فقط برای دیدن — با هر انتخاب در برگه به‌روز می‌شود */
.order-mini { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 4px 3px; min-height: 30px; max-width: 46ch; font-family: var(--font-display); }
.om-group { display: flex; gap: 3px; }
.om-cell {
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 28px;
  padding: 0 6px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface-raised);
  color: var(--text-1);
  font-size: 0.625rem;
  letter-spacing: 0.04em;
}
.om-cell.is-empty { border-style: dashed; border-color: var(--accent-graphic); background: var(--accent-tint); color: var(--accent); }
.om-cell.is-fixed { border-style: dotted; background: transparent; color: var(--text-3); }
.om-dash { align-self: center; color: var(--text-faint); font-size: 0.625rem; }

/* پایانِ کاتالوگ: همان دعوت، بزرگ‌تر و وسط‌چین — لحظه‌ای که مشتری خواندن را تمام کرده */
.order-cta-end {
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  gap: 14px;
  width: min(100%, 820px);
  padding: clamp(24px, 4vw, 44px) clamp(18px, 4vw, 48px);
  text-align: center;
}
.order-cta-end::before { inset-block: auto 0; inset-inline: 0; width: auto; height: 3px; }
.order-cta-end .order-cta-icon { width: 52px; height: 52px; border-radius: 15px; }
.order-cta-end .order-cta-copy { justify-items: center; gap: 6px; }
.order-cta-end .order-cta-copy h2 { font-size: var(--fs-h1); line-height: var(--lh-tight); }
.order-cta-end .order-cta-copy > p:last-child { max-width: 52ch; font-size: var(--fs-sm); line-height: 1.95; }
.order-cta-end .order-mini { justify-content: center; max-width: none; }
.order-cta-end .om-cell { min-width: 30px; height: 34px; font-size: 0.75rem; }
.order-cta-end .order-cta-go { min-height: 48px; padding-inline: 26px; }
html[dir="rtl"] .order-cta-end .kicker { margin-right: 0; text-align: center; }
.order-cta-end .kicker { text-align: center; }

/* دکمه‌ی داک: همیشه زیرِ دست، با رنگِ تأکید تا از ابزارهای خاکستری جدا بایستد */
.dock-order { position: relative; border-color: var(--accent-graphic); background: var(--accent-tint); color: var(--text-1); }
.dock-order:hover { background: rgb(116 171 220 / 0.24); color: var(--text-1); }
.dock-order .icon { color: var(--accent); }
.dock-order[aria-expanded="true"] { background: var(--accent-graphic); color: #fff; }
.dock-order[aria-expanded="true"] .icon { color: inherit; }
.order-dot { position: absolute; top: -3px; inset-inline-end: -3px; width: 10px; height: 10px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 2px var(--surface); }
.order-dot[hidden] { display: none; }

/* برگه‌ی سازنده: خانه‌ها به اندازه‌ی موبایل، دکمه‌ها چسبیده به پایین */
.order-sheet .sheet-body { display: grid; align-content: start; gap: var(--s-4); }
.order-sheet .rfp-intro { margin-bottom: 0; }
.order-sheet .order-cells { justify-content: flex-start; gap: 16px 4px; }
.order-sheet .oc-col { min-width: 46px; }
.order-sheet .oc-cell { min-width: 46px; height: 50px; padding: 0 9px; }
.order-sheet .oc-code { font-size: 1.0625rem; }
.order-sheet .oc-dash { height: 50px; padding-inline: 1px; line-height: 50px; }
.order-sheet .oc-label { max-width: 72px; font-size: 0.625rem; }
.order-sheet .order-code { flex-basis: 100%; font-size: 1.125rem; }
.order-sheet .order-decoded { grid-template-columns: minmax(0, 1fr); }
.order-sheet .order-foot { margin-top: 0; }
.order-sheet .order-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-2);
  margin: 0 -22px !important;
  padding: 14px 22px calc(16px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.order-sheet .order-actions .btn { min-height: 44px; padding-inline: 12px; font-size: var(--fs-sm); }
.order-sheet .order-actions .btn-primary { grid-column: 1 / -1; }

.order-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.order-tabs[hidden] { display: none; }
.order-tab {
  display: grid;
  gap: 2px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: transparent;
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-align: start;
  transition: border-color var(--dur-1), background var(--dur-1), color var(--dur-1);
}
.order-tab small { direction: ltr; color: var(--text-faint); font-family: var(--font-display); font-size: 0.625rem; font-weight: 400; letter-spacing: 0.08em; }
.order-tab:hover { border-color: var(--line-strong); color: var(--text-1); }
.order-tab[aria-selected="true"] { border-color: var(--accent-graphic); background: var(--accent-tint); color: var(--text-1); }

.order-stage { position: relative; }

.order-cells {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: center;
  gap: 18px 6px;
}
.oc-group { display: flex; align-items: flex-start; gap: 6px; }
.oc-dash { align-self: flex-start; height: 58px; padding-inline: 4px; color: var(--text-faint); font-family: var(--font-display); line-height: 58px; }

.oc-col { display: grid; justify-items: center; gap: 5px; width: min-content; min-width: 58px; }
.oc-cell {
  display: grid;
  place-items: center;
  min-width: 58px;
  height: 58px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--surface-raised);
  color: var(--text-1);
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.05) inset, 0 10px 22px -16px rgb(0 0 0 / 0.9);
  transition: border-color var(--dur-1), transform var(--dur-2) var(--ease-out), box-shadow var(--dur-1), background var(--dur-1);
}
button.oc-cell { cursor: pointer; }
button.oc-cell:hover { border-color: var(--accent-graphic); transform: translateY(-2px); }
button.oc-cell:focus-visible,
button.oc-cell[aria-expanded="true"] { outline: 0; border-color: var(--accent-graphic); box-shadow: 0 0 0 3px var(--accent-ring); }
.oc-code { font-family: var(--font-display); font-size: clamp(1.05rem, 1.7vw, 1.4rem); letter-spacing: 0.04em; white-space: nowrap; }
.oc-cell.is-empty { border-style: dashed; border-color: var(--accent-graphic); background: var(--accent-tint); color: var(--accent); }
.oc-cell.is-empty .oc-code { animation: blink 1.6s steps(1, end) infinite; }
.oc-cell.is-off { border-color: var(--warn-line); background: var(--warn-tint); color: var(--warn); }
.oc-cell.is-auto { border-color: var(--warn-line); color: var(--warn); }
.oc-cell.is-fixed { border-style: dotted; background: transparent; color: var(--text-3); box-shadow: none; }
.oc-cell.is-wanted { animation: shake 0.5s var(--ease-out); }
.oc-n { color: var(--text-faint); font-family: var(--font-display); font-size: 0.625rem; letter-spacing: 0.1em; }
.oc-label { max-width: 96px; color: var(--text-3); font-size: 0.6875rem; line-height: 1.5; text-align: center; text-wrap: balance; }

/* کدِ ساخته‌شده */
.order-result { display: grid; gap: 10px; padding: clamp(14px, 2vw, 20px); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-sunken); }
.order-code-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.order-code-label { color: var(--text-3); font-size: var(--fs-xs); font-weight: 600; }
.order-code {
  flex: 1 1 260px;
  min-width: 0;
  color: var(--text-1);
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 2.4vw, 1.75rem);
  letter-spacing: 0.06em;
  overflow-wrap: anywhere;
  text-align: left;
  user-select: all;
  -webkit-user-select: all;
}
.order-code.is-partial { color: var(--text-3); }
.order-status { color: var(--text-3); font-size: var(--fs-xs); line-height: 1.8; }
.order-status[data-tone="ok"] { color: var(--ok); }
.order-status[data-tone="warn"] { color: var(--warn); }

/* معنیِ هر جایگاه — همان «جدول رمزگشایی»، فقط برای کدِ خودِ مشتری */
.order-decoded { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 0 clamp(16px, 3vw, 40px); margin: 0; }
.od-row { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 10px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line-faint); font-size: var(--fs-xs); }
.od-row dt { display: flex; gap: 8px; color: var(--text-3); }
.od-n { flex: none; min-width: 1.6em; color: var(--accent); font-family: var(--font-display); font-size: 0.625rem; line-height: 2.2; }
.od-row dd { display: flex; gap: 8px; margin: 0; color: var(--text-1); }
.od-row dd b { flex: none; direction: ltr; font-family: var(--font-display); font-size: 0.6875rem; font-weight: 400; line-height: 2; }
.od-row.is-off dd { color: var(--warn); }
.od-none { color: var(--text-faint); }

.order-foot { margin-top: -6px; color: var(--text-faint); font-size: 0.6875rem; line-height: 1.8; }

/* پاپ‌آپِ هر خانه — زیرِ همان خانه باز می‌شود */
.oc-scrim { display: none; }
.oc-pop {
  position: absolute;
  z-index: 5;
  display: grid;
  gap: 8px;
  width: min(340px, calc(100% - 16px));
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-3);
  scroll-margin-block: calc(var(--topbar-h) + 16px) 120px;
  animation: drop var(--dur-2) var(--ease-out) both;
}
.oc-pop::before {
  content: "";
  position: absolute;
  top: -6px;
  left: calc(var(--arrow-x, 50%) - 6px);
  width: 11px;
  height: 11px;
  border: 1px solid var(--line-strong);
  border-right: 0;
  border-bottom: 0;
  background: var(--surface);
  transform: rotate(45deg);
}
.oc-pop-head { display: flex; align-items: center; gap: 10px; }
.oc-pop-head b { flex: 1; font-size: var(--fs-sm); }
.oc-pop-n { color: var(--accent); font-family: var(--font-display); font-size: 0.6875rem; }
.oc-pop-close { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--text-3); }
.oc-pop-close:hover { background: var(--line-faint); color: var(--text-1); }
.oc-pop-hint { color: var(--text-3); font-size: 0.6875rem; line-height: 1.8; }
.oc-pop-search { min-height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-sunken); color: var(--text-1); font: inherit; font-size: var(--fs-sm); }
.oc-pop-search:focus { outline: 0; border-color: var(--accent-graphic); box-shadow: 0 0 0 3px var(--accent-ring); }
.oc-pop-list { display: grid; gap: 2px; max-height: min(330px, 46vh); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.oc-pop-group { position: sticky; top: 0; z-index: 1; padding: 8px 8px 4px; background: var(--surface); color: var(--text-faint); font-size: 0.6875rem; font-weight: 600; }
.oc-pop-off { color: var(--warn); }
.oc-opt {
  display: grid;
  /* --code-w را order.js از بلندترین کدِ همان فهرست می‌گذارد (AH650S جا بگیرد و ستون‌ها هم‌تراز بمانند) */
  grid-template-columns: var(--code-w, 58px) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 44px;
  padding: 6px 8px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-1);
  font: inherit;
  font-size: var(--fs-sm);
  text-align: start;
}
.oc-opt[hidden] { display: none; }
.oc-opt:hover, .oc-opt:focus-visible { outline: 0; background: var(--line-faint); }
.oc-opt[aria-selected="true"] { background: var(--accent-tint); }
.oc-opt[aria-selected="true"] .icon { color: var(--accent); }
.oc-opt-code { direction: ltr; padding: 4px 6px; border: 1px solid var(--line); border-radius: 7px; font-family: var(--font-display); font-size: 0.75rem; text-align: center; white-space: nowrap; }
/* متنِ فنی («0.6 m · 8.2 – 12.4 GHz») با جهتِ خودش چیده شود، ولی در همان سمتِ متنِ فارسی بایستد */
.oc-opt-text { display: grid; gap: 1px; line-height: 1.6; text-align: right; }   /* ltr: بخش ۶٫۵ */
.oc-opt-text, .oc-opt-text small, .od-row dd span { unicode-bidi: plaintext; }
.oc-opt-text small { color: var(--text-faint); font-size: 0.6875rem; }
.oc-opt.is-off .oc-opt-code { border-color: var(--warn-line); color: var(--warn); }
.oc-opt.is-off .oc-opt-text { color: var(--text-2); }

.oc-num { display: flex; gap: 8px; }
.oc-num input { flex: 1; min-width: 0; min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-sunken); color: var(--text-1); direction: ltr; font-family: var(--font-display); font-size: 1rem; }
.oc-num input:focus { outline: 0; border-color: var(--accent-graphic); box-shadow: 0 0 0 3px var(--accent-ring); }
.oc-num-err { color: var(--danger); font-size: var(--fs-xs); }
.oc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.oc-chip { min-width: 44px; min-height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: transparent; color: var(--text-1); direction: ltr; font-family: var(--font-display); font-size: 0.75rem; }
.oc-chip:hover { border-color: var(--accent-graphic); background: var(--accent-tint); }

/* برگه‌ی درخواست: خلاصه‌ی کد و انتخابِ نوع */
.order-summary { display: grid; gap: 4px; margin-bottom: var(--s-4); padding: 14px 16px; border: 1px solid var(--panel-line); border-radius: var(--r-md); background: var(--panel-grad); }
.order-summary-label { color: var(--text-3); font-size: 0.6875rem; font-weight: 600; }
.order-summary-code { font-family: var(--font-display); font-size: 1.0625rem; font-weight: 400; letter-spacing: 0.05em; overflow-wrap: anywhere; text-align: left; }
.order-summary-code.is-partial { color: var(--text-3); font-family: inherit; font-size: var(--fs-sm); letter-spacing: 0; text-align: start; direction: inherit; }
.order-summary-title { color: var(--text-3); font-size: var(--fs-xs); }
.order-kinds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-bottom: var(--s-3); padding: 4px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-sunken); }
.order-kinds button { min-height: 38px; border: 0; border-radius: 9px; background: transparent; color: var(--text-2); font: inherit; font-size: var(--fs-sm); font-weight: 600; transition: background var(--dur-1), color var(--dur-1); }
.order-kinds button:hover { color: var(--text-1); }
.order-kinds button[aria-checked="true"] { background: var(--primary-bg); color: var(--primary-fg); }
.rfp-field[hidden] { display: none; }

/* --- تقویمِ انتخابِ روز (datepick.js): شمسی در فارسی، میلادی در انگلیسی و روسی ---
   شبکه‌ی ماه درونِ خودِ فرم باز می‌شود؛ لایه‌ی شناور نیست، پس زیرِ پرده‌ی هیچ برگه‌ای نمی‌ماند. */
.dp { display: grid; gap: 8px; }
.dp-toggle { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 46px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-raised); color: var(--text-1); font: inherit; font-size: 0.9375rem; font-weight: 400; text-align: start; cursor: pointer; transition: border-color var(--dur-1), box-shadow var(--dur-1); }
.dp-toggle .icon { flex: none; color: var(--text-3); }
.dp-toggle.is-empty .dp-value { color: var(--text-faint); }
.dp-toggle:hover { border-color: var(--line-strong); }
.dp-toggle:focus-visible,
.dp-toggle[aria-expanded="true"] { outline: 0; border-color: var(--accent-graphic); box-shadow: 0 0 0 3px var(--accent-ring); }
.dp-panel { padding: 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-sunken); scroll-margin: 12px 0 104px; /* دکمه‌ی چسبانِ «ارسال» پایینِ برگه */ }
.dp-panel[hidden] { display: none; }
.dp-head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; margin-bottom: 6px; }
.dp-title { color: var(--text-1); font-size: var(--fs-sm); font-weight: 600; text-align: center; }
.dp-nav { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: var(--r-xs); background: transparent; color: var(--text-2); cursor: pointer; }
.dp-nav:hover:not(:disabled) { border-color: var(--line-strong); color: var(--text-1); }
.dp-nav:disabled { opacity: 0.32; cursor: default; }
.dp-week,
.dp-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.dp-week span { padding: 4px 0; color: var(--text-3); font-size: var(--fs-xs); font-weight: 500; text-align: center; }
.dp-day { display: grid; place-items: center; height: 38px; padding: 0; border: 1px solid transparent; border-radius: var(--r-xs); background: transparent; color: var(--text-1); font: inherit; font-size: var(--fs-sm); font-weight: 500; font-variant-numeric: tabular-nums; cursor: pointer; transition: background var(--dur-1), border-color var(--dur-1); }
.dp-day:hover:not(:disabled) { border-color: var(--line-strong); background: var(--surface-raised); }
.dp-day:focus-visible { outline: 0; border-color: var(--accent-graphic); box-shadow: 0 0 0 3px var(--accent-ring); }
.dp-day.is-off { color: var(--danger); }
.dp-day.is-today { border-color: var(--line-strong); }
.dp-day:disabled { color: var(--text-faint); opacity: 0.45; cursor: default; }
.dp-day[aria-pressed="true"] { border-color: var(--primary-bg); background: var(--primary-bg); color: var(--primary-fg); }
.dp-foot { display: flex; justify-content: flex-end; min-height: 0; }
.dp-clear { margin-top: 6px; padding: 4px 8px; border: 0; background: transparent; color: var(--text-3); font: inherit; font-size: var(--fs-xs); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.dp-clear:hover { color: var(--text-1); }
.dp-clear[hidden] { display: none; }

/* زمانِ پیشنهادیِ جلسه: روز + ساعت کنارِ هم؛ معادلِ «به وقت تهران» زیرشان */
.meet-when { display: grid; grid-template-columns: minmax(0, 1fr) 128px; gap: 8px; align-items: start; }
.meet-when > span { grid-column: 1 / -1; }
.meet-when select:disabled { opacity: 0.5; }
.meet-when .field-hint { grid-column: 1 / -1; }
.meet-when .field-hint[hidden] { display: none; }
@media (max-width: 420px) { .meet-when { grid-template-columns: minmax(0, 1fr); } }

/* «درخواست‌های من»: جلسه‌ای که زمانش قطعی شده، با راهِ افزودن به تقویم و پیوستن */
.mine-meeting { display: grid; gap: 10px; margin: 0 0 var(--s-3); padding: 12px 14px; border: 1px solid var(--accent-ring); border-radius: var(--r-sm); background: var(--accent-tint); }
.mine-meeting-when { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; color: var(--text-1); font-size: var(--fs-sm); }
.mine-meeting-when .icon { flex: none; color: var(--accent); }
.mine-meeting-when small { color: var(--text-3); font-size: var(--fs-xs); }
.mine-meeting-links { display: flex; flex-wrap: wrap; gap: 8px; }

/* «درخواست‌های من»: کدی که همراهِ درخواست ثبت شده */
.mine-code { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin: 0 0 var(--s-3); color: var(--text-3); font-size: var(--fs-xs); }
.mine-code b { direction: ltr; color: var(--text-1); font-family: var(--font-display); font-size: 0.8125rem; font-weight: 400; letter-spacing: 0.05em; overflow-wrap: anywhere; }

/* ریل: نشانه‌ی «کد سفارش»، پس از آخرین صفحه — برگه‌ی سازنده را باز می‌کند */
.rail-tick.rail-order { flex: 0 0 18px; margin-top: 6px; }
.rail-tick.rail-order::before { width: 7px; height: 7px; margin-top: -3.5px; border: 1.5px solid var(--accent-graphic); border-radius: 2px; background: transparent; }
.rail-tick.rail-order:hover::before { width: 9px; height: 9px; margin-top: -4.5px; background: var(--accent-tint); }

@media (min-width: 1100px) {
  body.sheet-open .order-strip,
  body.sheet-open .order-panel { padding-inline-end: 484px; }
}

/* نوار یک خط است: توضیحِ کامل مالِ کارتِ پایانی و خودِ برگه است */
.order-cta-strip .order-cta-copy > p:last-child { display: none; }
.order-cta-strip .order-cta-copy h2 { white-space: nowrap; }
.order-cta-strip .order-mini { flex-wrap: nowrap; max-width: none; }
.order-cta-strip .om-cell { min-width: 20px; height: 26px; padding: 0 5px; font-size: 0.5625rem; }
@container orderstrip (max-width: 1040px) {
  .order-cta-strip { grid-template-columns: auto minmax(0, 1fr) auto; }
  .order-cta-strip .order-mini { display: none; }
}
/* موبایل: یک ردیف — عنوان و یک دکمه‌ی پیکان؛ نوشته‌ی دکمه فقط برای صفحه‌خوان می‌ماند */
@container orderstrip (max-width: 520px) {
  .order-cta-strip { gap: 12px; padding: 10px 12px; padding-inline-start: 14px; }
  .order-cta-strip .order-cta-copy h2 { font-size: 0.9375rem; white-space: normal; }
  .order-cta-strip .order-cta-go { width: 44px; min-height: 44px; padding: 0; }
  .order-cta-strip .order-cta-go span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (max-width: 760px) {
  .dock-order { width: 40px; padding: 0; }
  .dock-order span { display: none; }
}

/* موبایل: پاپ‌آپ برگه‌ی پایینِ صفحه می‌شود و خانه‌ها گروه‌گروه می‌شکنند */
@media (max-width: 640px) {
  .order-cells { justify-content: flex-start; gap: 16px 4px; }
  .oc-col { min-width: 46px; }
  .oc-cell { min-width: 46px; height: 50px; padding: 0 9px; }
  .oc-dash { height: 50px; line-height: 50px; padding-inline: 1px; }
  .oc-label { max-width: 72px; font-size: 0.625rem; }
  .order-cta-icon { width: 38px; height: 38px; }
  body.oc-pop-open { overflow: hidden; }
  .oc-scrim { position: fixed; inset: 0; z-index: calc(var(--z-sheet) + 1); display: block; background: var(--scrim); animation: fade var(--dur-2) var(--ease-out) both; }
  .oc-pop {
    position: fixed;
    inset: auto 0 0 0 !important;
    z-index: calc(var(--z-sheet) + 2);
    width: 100%;
    max-height: 78dvh;
    padding: 18px 16px calc(16px + env(safe-area-inset-bottom, 0px));
    border: 0;
    border-top: 1px solid var(--line-strong);
    border-radius: 20px 20px 0 0;
    animation-name: sheet-up;
  }
  .oc-pop::before { display: none; }
  .oc-pop-list { max-height: 56dvh; }
}

/* ================================================================== *
 * ۶٫۵ نسخه‌ی انگلیسی — همان سیستم، چپ‌به‌راست
 * بیشترِ چیدمان با ویژگی‌های منطقی خودش برمی‌گردد؛ این‌ها استثناهای فیزیکی‌اند.
 * ================================================================== */

/* حروف لاتینِ Vazirmatn (بر پایه‌ی Roboto) همان متنِ انگلیسی کاتالوگ است. لاتین (و سیریلیک) به
   فاصله‌ی سطر کمتری نیاز دارد و — برخلاف فارسی — فشردگیِ ملایم حروف تیتر را می‌پذیرد.
   این‌ها به dir=ltr بسته‌اند، نه به lang=en، تا روسی و هر زبانِ چپ‌به‌راستِ بعدی هم همین را بگیرد. */
html[dir="ltr"] { --lh-body: 1.7; --lh-tight: 1.16; }
html[dir="ltr"] h1,
html[dir="ltr"] h2 { letter-spacing: -0.022em; }
html[dir="ltr"] h3 { letter-spacing: -0.01em; }
html[dir="ltr"] .gate-copy h1,
html[dir="ltr"] .welcome h1 { line-height: 1.12; }
html[dir="ltr"] .lead { max-width: 48ch; }
html[dir="ltr"] .alert,
html[dir="ltr"] .gate-note,
html[dir="ltr"] .rfp-intro,
html[dir="ltr"] .cmsg p,
html[dir="ltr"] .mine-note { line-height: 1.65; }

/* روسی: Vazirmatn حروفِ سیریلیک ندارد. اگر فقط سیریلیک به فونتِ سیستم می‌افتاد، یک جمله با دو قلم
   چیده می‌شد (لاتین و عدد از Vazirmatn، بقیه از سیستم)؛ پس کلِ متنِ روسی یک خانواده‌ی سیستمی می‌گیرد.
   Michroma (کیکرها و کدها) لاتین می‌ماند — آن‌ها در هر سه زبان انگلیسی‌اند. */
html[lang="ru"] {
  --font-fa: "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif;
  --font-display: "Michroma", "Eurostile Extended", "Microgramma D Extended", "Segoe UI", Roboto, sans-serif;
}
html[lang="ru"] h1,
html[lang="ru"] h2 { letter-spacing: -0.012em; }
/* نامِ جایگاه‌ها در روسی بلند است («Коаксиальное вращающееся сочленение»): کمی جای بیشتر و شکستنِ هجایی */
html[lang="ru"] .oc-label { max-width: 104px; hyphens: auto; -webkit-hyphens: auto; overflow-wrap: anywhere; }
html[lang="ru"] .order-sheet .oc-label { max-width: 84px; }

html[dir="ltr"] .read-progress { transform-origin: left center; }
html[dir="ltr"] .rail-tip { left: auto; right: calc(100% + 10px); }
html[dir="ltr"] .rfp-box { animation-name: sheet-side-ltr; }
html[dir="ltr"] .oc-opt-text { text-align: left; }
html[dir="ltr"] body.obscured::after { content: "Return to this window to keep reading"; }

@media (max-width: 700px) {
  html[dir="ltr"] .rfp-box { animation-name: sheet-up; }
}

/* ================================================================== *
 * ۷. حرکت، چاپ
 * ================================================================== */

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes draw-ring { to { stroke-dashoffset: 0; } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { 0% { transform: scale(0.7); opacity: 0.2; } 60% { transform: scale(1.12); } 100% { transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes sink { to { opacity: 0; transform: translateY(10px); } }
@keyframes drop { from { opacity: 0; transform: translateY(-12px); } }
@keyframes lift { to { opacity: 0; transform: translateY(-10px); } }
@keyframes sheet-side { from { transform: translateX(-32px); opacity: 0; } }
@keyframes sheet-side-ltr { from { transform: translateX(32px); opacity: 0; } }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } }
@keyframes shimmer { to { transform: translateX(100%); } }
@keyframes ping { 0% { transform: scale(0.6); opacity: 0.7; } 80%, 100% { transform: scale(2.1); opacity: 0; } }
@keyframes shake {
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(2px); }
}
@keyframes enter { from { opacity: 0; transform: translateY(10px); } }

.reveal { animation: enter 0.7s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 70ms); }

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

/* چاپ عملاً بی‌فایده می‌شود */
@media print {
  body { display: none !important; }
}
