/* ===== WHOdns — Light Mode ===== */
:root {
  --bg: #f6f6f3;
  --paper: #fff;
  --ink: #15171c;
  --muted: #6b7280;
  --line: #ebebe6;
  --accent: #0d9488;
  --accent-2: #0b7d72;
  --accent-soft: #e8f5f3;
  --shadow: 0 4px 24px -8px rgba(0,0,0,.12);
  --shadow-lg: 0 18px 40px -20px rgba(0,0,0,.22);
  --radius: 16px;
}

/* ===== Dark Mode ===== */
[data-theme="dark"] {
  --bg: #0d0f14;
  --paper: #161820;
  --ink: #e2e4ec;
  --muted: #7e899e;
  --line: #252836;
  --accent: #14b8a6;
  --accent-2: #0d9488;
  --accent-soft: rgba(20,184,166,.13);
  --shadow: 0 4px 24px -8px rgba(0,0,0,.55);
  --shadow-lg: 0 18px 40px -20px rgba(0,0,0,.75);
}
[data-theme="dark"] body {
  background: var(--bg);
  background-image: none;
}
[data-theme="dark"] .side {
  background: rgba(20,22,30,.97);
}
[data-theme="dark"] .field { background: var(--paper); }
[data-theme="dark"] .field input { color: var(--ink); }
[data-theme="dark"] input[type=text],
[data-theme="dark"] input[type=password],
[data-theme="dark"] input[type=email],
[data-theme="dark"] input[type=number],
[data-theme="dark"] input[type=search],
[data-theme="dark"] input[type=tel],
[data-theme="dark"] input[type=url],
[data-theme="dark"] input[type=date],
[data-theme="dark"] input[type=time],
[data-theme="dark"] input[type=datetime-local],
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--line);
}
/* در دارک‌مود آیکن انتخابگر تاریخ/ساعت مرورگر روشن شود تا دیده شود */
[data-theme="dark"] input[type=date]::-webkit-calendar-picker-indicator,
[data-theme="dark"] input[type=time]::-webkit-calendar-picker-indicator,
[data-theme="dark"] input[type=datetime-local]::-webkit-calendar-picker-indicator { filter: invert(1) opacity(.7); }
[data-theme="dark"] input::placeholder { color: var(--muted); }
[data-theme="dark"] .card { background: var(--paper); border-color: var(--line); }
[data-theme="dark"] .dns-block { border-color: var(--line); }
[data-theme="dark"] .dns-block-hd { background: rgba(255,255,255,.04); border-color: var(--line); }
[data-theme="dark"] .nav a { color: #bcc5d6; }
[data-theme="dark"] .nav a:hover { background: var(--accent-soft); color: var(--accent); }
[data-theme="dark"] .nav a.on { background: var(--accent); color: #fff; }
[data-theme="dark"] .nav a.sub { color: var(--muted); border-color: var(--line); }
[data-theme="dark"] .tool { background: var(--paper); border-color: var(--line); }
[data-theme="dark"] .tool h4 { color: var(--ink); }
[data-theme="dark"] .net-tab { background: var(--paper); border-color: var(--line); color: var(--ink); }
[data-theme="dark"] th { color: var(--muted); background: transparent; }
[data-theme="dark"] td { color: var(--ink); }
[data-theme="dark"] .finding { background: var(--paper); border-color: var(--line); }
[data-theme="dark"] .adv-inner { background: var(--paper); border-color: var(--line); }
[data-theme="dark"] .ok-msg { background: #062c1e; border-color: #064f30; color: #6ee7b7; }
[data-theme="dark"] label { color: #bcc5d6; }
[data-theme="dark"] input[type=file] { background: var(--paper); border-color: var(--line); color: var(--muted); }
[data-theme="dark"] .codebox { background: #080a0e; }
[data-theme="dark"] .codebox button { background: #1a1c26; }
[data-theme="dark"] .tog { border-color: var(--line); color: var(--muted); }
[data-theme="dark"] .tog:hover { background: var(--accent-soft); color: var(--accent); }
[data-theme="dark"] .tog.on { background: var(--accent); border-color: var(--accent); color: #fff; }
[data-theme="dark"] .side-foot { border-color: var(--line); }
[data-theme="dark"] .ctrl-btn { border-color: var(--line); color: var(--muted); }
[data-theme="dark"] .ctrl-btn:hover { border-color: var(--accent); color: var(--accent); }
[data-theme="dark"] .navg { color: var(--muted); }
[data-theme="dark"] .brand .t { color: var(--muted); }
[data-theme="dark"] .nav-grp-row { color: #bcc5d6; }
[data-theme="dark"] .nav-grp-row:hover { background: var(--accent-soft); color: var(--accent); }
[data-theme="dark"] .nav-grp-row.on { background: var(--accent); color: #fff; }
[data-theme="dark"] .nav-grp-row.sub-parent { color: var(--accent); }
[data-theme="dark"] .mob-header { background: var(--paper); border-color: var(--line); }
[data-theme="dark"] code { background: var(--accent-soft); }

/* Logo dark/light mode */
.logo-dark { display: none !important; }
[data-theme="dark"] .logo-light { display: none !important; }
[data-theme="dark"] .logo-dark { display: block !important; }

/* Country flag images */
.flag-img { vertical-align: middle; border-radius: 2px; display: inline-block; }

/* ── Fonts by language ── */
html[lang="fa"] body { font-family: 'Peyda', 'Vazirmatn', system-ui, sans-serif; }
html[lang="en"] body { font-family: 'Vazirmatn', system-ui, sans-serif; }

/* ── Lazy-loading progress bar ── */
#lazy-bar {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0;
  background: var(--accent);
  z-index: 9999;
  transition: width .38s cubic-bezier(.4,0,.2,1), opacity .3s;
  pointer-events: none;
  border-radius: 0 3px 3px 0;
}
#lazy-bar.done { opacity: 0; }

/* ── Skeleton shimmer ── */
.skel-wrap { margin-top: 20px; }
.skel-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 20px;
  margin-bottom: 16px;
}
.skel-line {
  height: 13px;
  border-radius: 7px;
  margin-bottom: 11px;
  background: linear-gradient(
    90deg,
    var(--line) 0%,
    var(--accent-soft) 40%,
    var(--line) 80%
  );
  background-size: 300% 100%;
  animation: skel-shimmer 1.6s infinite linear;
}
.skel-line:last-child { margin-bottom: 0; }
.skel-line.w-80  { width: 80%; }
.skel-line.w-60  { width: 60%; }
.skel-line.w-40  { width: 40%; }
.skel-line.w-30  { width: 30%; }
.skel-line.h-big { height: 24px; margin-bottom: 16px; }
.skel-row { display: flex; gap: 12px; margin-bottom: 11px; }
.skel-row .skel-line { margin-bottom: 0; flex: 1; }
@keyframes skel-shimmer {
  0%   { background-position:  300% 0; }
  100% { background-position: -100% 0; }
}
[data-theme="dark"] .skel-line {
  background: linear-gradient(
    90deg,
    var(--line) 0%,
    rgba(255,255,255,.07) 40%,
    var(--line) 80%
  );
  background-size: 300% 100%;
  animation: skel-shimmer 1.6s infinite linear;
}

/* ── Lazy result fade-in ── */
.lazy-in {
  animation: lazy-appear .32s cubic-bezier(.2,0,.3,1) both;
}
@keyframes lazy-appear {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0);    }
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Vazirmatn', system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(58rem 28rem at 100% -8%, #e6f3f1 0, transparent 55%),
    radial-gradient(48rem 24rem at -8% 0, #f1efe9 0, transparent 50%);
}
a { color: var(--accent); text-decoration: none; }
.mono { font-family: 'JetBrains Mono', monospace; direction: ltr; unicode-bidi: embed; }

/* ── Layout ── */
.shell { display: flex; min-height: 100vh; }

.side {
  width: 260px;
  min-width: 260px;
  max-width: 260px;
  flex: none;
  border-inline-end: 1px solid var(--line);
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(8px);
  padding: 20px 14px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  /* اسکرول‌بار پنهان شود ولی اسکرول با موس کار کند (عرض ثابت بماند) */
  scrollbar-width: none;        /* Firefox */
  -ms-overflow-style: none;     /* IE/Edge legacy */
}
.side::-webkit-scrollbar { width: 0; height: 0; display: none; }      /* Chrome/Safari */
.nav { scrollbar-width: none; -ms-overflow-style: none; }
.nav::-webkit-scrollbar { width: 0; height: 0; display: none; }

.brand {
  font-weight: 800;
  font-size: 21px;
  letter-spacing: -.5px;
  padding: 4px 10px 14px;
  flex: none;
}
.brand b { color: var(--accent); }
.brand .t { color: var(--muted); font-size: 11px; font-weight: 500; margin-top: 2px; }

.nav { flex: 1; overflow-y: auto; }

/* ── فیلتر سریع سایدبار ── */
.nav-filter-wrap { padding: 0 2px 6px; flex: none; display: flex; min-width: 0; }
.nav-filter {
  flex: 1 1 auto; width: 100%; min-width: 0; box-sizing: border-box;
  padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--paper); color: var(--ink); font: inherit; font-size: 12.5px;
}
.nav-filter:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
/* حالت فیلتر: سرگروه‌ها پنهان، بدنه‌ها باز، بخش‌های بی‌نتیجه حذف */
.nav.filtering .nav-sec-head { display: none; }
.nav.filtering .nav-sec > .nav-sec-body { display: block !important; }
.nav.filtering .nav-sec.nf-empty { display: none; }

.navg {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted);
  margin: 16px 10px 6px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
/* زیرعنوان گروه: توضیح کوتاه قابلیت‌ها زیر عنوان هر بخش */
.navg .navg-sub {
  display: block;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  opacity: .72;
  margin-top: 1px;
}

/* ── گروه‌های آکاردئونی سایدبار (برای خلوت‌شدن منو) ── */
.nav-sec-head {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  width: 100%; background: none; border: 0; cursor: pointer; text-align: start;
  padding: 8px 10px; margin: 8px 0 0; border-radius: 10px;
  font-family: inherit;
  transition: background .12s, color .12s;
}
.nav-sec-head:hover { background: var(--accent-soft); color: var(--accent-2); }
.nav-sec-head .navg-t { flex: 1; }
.nav-sec-head .ng-arr { transition: transform .15s; }
.nav-sec.open > .nav-sec-head .ng-arr { transform: rotate(90deg); }
/* جمع‌شدن فقط وقتی JS فعال است (nav-acc توسط JS اضافه می‌شود) تا بدون JS منو مخفی نماند */
.nav.nav-acc .nav-sec:not(.open) > .nav-sec-body { display: none; }

.nav a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 10px;
  color: #374151;
  font-size: 13.5px;
  font-weight: 500;
  transition: background .12s, color .12s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav a:hover { background: var(--accent-soft); color: var(--accent-2); }
.nav a.on { background: var(--accent); color: #fff; }
.nav a .ic {
  width: 16px; height: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  flex: none; opacity: .85;
}
.nav a .ic svg { width: 16px; height: 16px; }

/* Sub-items */
.nav a.sub {
  font-size: 12.5px;
  padding: 6px 10px 6px 22px;
  color: var(--muted);
  margin-inline-start: 10px;
  border-inline-start: 2px solid var(--line);
  border-radius: 0;
}
[dir="rtl"] .nav a.sub { border-radius: 0 8px 8px 0; }
[dir="ltr"] .nav a.sub { border-radius: 8px 0 0 8px; }
.nav a.sub:hover { background: var(--accent-soft); color: var(--accent-2); border-color: var(--accent); }
.nav a.sub.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); font-weight: 600; }
.nav a.sub .ic { opacity: .7; }

/* Nav group (collapsible Network Tools) */
.nav-grp-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 10px;
  color: #374151;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background .12s, color .12s;
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
}
.nav-grp-row:hover { background: var(--accent-soft); color: var(--accent-2); }
.nav-grp-row.on { background: var(--accent); color: #fff; }
.nav-grp-row.sub-parent { color: var(--accent); font-weight: 600; }
.nav-grp-row .ic { width: 16px; height: 16px; display: inline-flex; align-items: center; justify-content: center; flex: none; opacity: .85; }
.nav-grp-row .ic svg { width: 16px; height: 16px; }
.nav-grp-row span:not(.ic):not(.ng-arr) { flex: 1; }
.ng-arr {
  font-size: 14px;
  display: inline-block;
  transition: transform .2s;
  color: var(--muted);
  flex: none;
  margin-inline-start: auto;
}
.nav-grp.open .ng-arr { transform: rotate(90deg); }
.nav-grp-body { display: none; }
.nav-grp.open .nav-grp-body { display: block; }

/* Sidebar footer controls */
.side-foot {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 12px 6px 6px;
  margin-top: 8px;
  border-top: 1px solid var(--line);
  flex: none;
}

/* Control buttons (theme / lang) */
.ctrl-btn {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  transition: border-color .12s, color .12s, background .12s;
  display: flex;
  align-items: center;
  gap: 4px;
  line-height: 1;
}
.ctrl-btn svg { width: 14px; height: 14px; }
.ctrl-btn:hover { border-color: var(--accent); color: var(--accent); }
a.ctrl-btn { text-decoration: none; }

/* اکشن‌های هر ردیف فایل: دکمه‌های هم‌اندازه و مرتب کنار هم */
.file-actions { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
.file-actions form { margin: 0; display: inline-flex; }
.file-actions .ctrl-btn { width: 32px; height: 30px; padding: 0; justify-content: center; }
.ctrl-btn-danger:hover { border-color: #dc2626; color: #dc2626; }

/* تقویم شمسی (jalalidatepicker) در دارک‌مود whodns — پاپ‌آپ روی body بیرون از صفحه است */
[data-theme="dark"] jdp-container { background: #161a24; color: #e8ebf2; box-shadow: 0 6px 24px rgba(0,0,0,.55); }
[data-theme="dark"] jdp-container .jdp-day,
[data-theme="dark"] jdp-container .jdp-months,
[data-theme="dark"] jdp-container .jdp-years { color: #e8ebf2; fill: #e8ebf2; }
[data-theme="dark"] jdp-container .jdp-month,
[data-theme="dark"] jdp-container .jdp-month select,
[data-theme="dark"] jdp-container .jdp-year,
[data-theme="dark"] jdp-container .jdp-year select,
[data-theme="dark"] jdp-container .jdp-time select { background: #161a24; color: #e8ebf2; }
[data-theme="dark"] jdp-container .jdp-day-name { background: rgba(255,255,255,.06); color: #cbd5e1; }
[data-theme="dark"] jdp-container .jdp-day.not-in-month { color: #64748b; }
[data-theme="dark"] jdp-container .jdp-day:not(.disabled-day):hover { background: rgba(255,255,255,.12); }
[data-theme="dark"] jdp-container .jdp-icon-plus,
[data-theme="dark"] jdp-container .jdp-icon-minus { border-color: rgba(255,255,255,.15); fill: #e8ebf2; }
[data-theme="dark"] jdp-container .jdp-time-container .jdp-time select { background: rgba(255,255,255,.06); }

/* Powered by IranServer — credit (tiny, fills empty space next to theme/lang) */
.powered-by {
  margin-inline-start: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  line-height: 1.15;
  text-align: end;
  font-size: 8.5px;
  color: var(--muted);   /* «قدرت گرفته از / Powered by» خاکستری */
  opacity: .9;
  max-width: 100px;
  white-space: nowrap;
  transition: opacity .12s;
}
.powered-by b { font-size: 10px; font-weight: 700; color: var(--muted); }  /* «ایران‌سرور / IranServer» خاکستری */
.powered-by:hover { opacity: 1; }
.powered-by:hover span { color: var(--accent); }                 /* لیبل: هاور سبز */
.powered-by:hover b { color: #2635d9; }                          /* برند: هاور آبی (لایت) */
[data-theme="dark"] .powered-by:hover b { color: #818cf8; }      /* برند: هاور آبی روشن‌تر برای خوانایی روی دارک */

/* Side close button (mobile only) */
.side-close {
  display: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 8px;
  margin-bottom: 4px;
  align-self: flex-end;
  transition: color .12s;
}
.side-close svg { width: 18px; height: 18px; }
.side-close:hover { color: var(--ink); }

/* Mobile header */
.mob-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 60;
}

/* Hamburger button */
.ham-btn {
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  border-radius: 8px;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  transition: .12s;
}
.ham-btn svg { width: 18px; height: 18px; }
.ham-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Overlay behind mobile sidebar */
.side-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.48);
  z-index: 90;
}
.side-overlay.vis { display: block; }

.main {
  flex: 1;
  min-width: 0;
  padding: 32px 36px 64px;
}
.main-inner {
  max-width: 960px;
  margin: 0 auto;
}

/* صفحهٔ تمام‌عرض (مثل «داستان ما»): بدون پدینگِ .main و بدون سقفِ عرضِ ستون.
   محتوا خودش با کانتینرهای داخلی (مثل .st-wrap) عرضش را کنترل می‌کند. بدون سرریز افقی
   چون از عرضِ واقعیِ ناحیهٔ محتوا استفاده می‌شود (نه 100vw که با اسکرول‌بار مشکل دارد). */
.main.main-bleed { padding: 0; }
.main-inner-bleed { max-width: none; margin: 0; width: 100%; }

/* ── وسط‌چین عمودی عنوان/زیرعنوان/جعبهٔ جستجو تا وقتی نتیجه‌ای نیامده ── */
@media (min-width: 861px) {
  .main { display: flex; flex-direction: column; }
  .main-inner {
    width: 100%;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
  }
  /* اگر کارت/نتیجه/اسکلت/خطایی روی صفحه نیست، محتوای ابتدایی به مرکز عمودی برود */
  .main-inner:not(:has(.card)):not(:has(.result-actions)):not(:has(.err)):not(:has(.ok-msg)):not(:has(.skel-wrap)):not(:has(.dns-sec)) {
    justify-content: center;
  }
}

.ph { margin: 0 0 4px; font-size: 26px; font-weight: 800; letter-spacing: -.6px; text-align: center; }
.psub { color: var(--muted); font-size: 14px; margin: 0 0 24px; text-align: center; }

/* ── Cards ── */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
  position: relative;
}
.card h3 { margin: 0 0 14px; font-size: 15.5px; font-weight: 800; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

/* ── Forms ── */
.form-center { max-width: 640px; margin: 0 auto; }

.field {
  display: flex;
  gap: 8px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 7px;
  box-shadow: var(--shadow-lg);
  max-width: 640px;
  margin: 0 auto 12px;
  width: 100%;
}
.field input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 16px;
  padding: 11px 13px;
  font-family: 'JetBrains Mono', monospace;
  direction: ltr;
  text-align: left;
  min-width: 0;
  color: var(--ink);
}
.field button {
  border: 0;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  border-radius: 11px;
  padding: 0 22px;
  white-space: nowrap;
  transition: background .12s;
  flex: none;
}
.field button:hover { background: var(--accent-2); }

label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 5px; color: #374151; }

input[type=text],
input[type=password],
input[type=email],
input[type=number],
input[type=search],
input[type=tel],
input[type=url],
input[type=date],
input[type=time],
input[type=datetime-local],
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  background: #fcfcfb;
  outline: 0;
  transition: border-color .15s, box-shadow .15s;
  color: var(--ink);
}
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea {
  min-height: 130px;
  font-family: 'JetBrains Mono', monospace;
  direction: ltr;
  text-align: left;
  font-size: 12.5px;
  line-height: 1.6;
  resize: vertical;
}
/* متن‌نویس معمولی (تیکت و…): فونت اصلی سایت + جهت خودکار بر اساس زبان متن.
   حالت پیش‌فرض textarea بالا برای جعبه‌های کد/گواهی (mono و LTR) است. */
textarea.ta-text {
  font-family: inherit;
  font-size: 14px;
  direction: inherit;
  unicode-bidi: plaintext;
  text-align: start;
  line-height: 1.9;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  border-radius: 11px;
  padding: 11px 22px;
  margin-top: 14px;
  transition: background .12s, transform .1s;
}
.btn:hover { background: var(--accent-2); transform: translateY(-1px); }
.btn:active { transform: none; }
.btn.ghost { background: var(--accent-soft); color: var(--accent-2); }
.btn.ghost:hover { background: var(--accent); color: #fff; }

.err { color: #dc2626; font-size: 14px; margin-top: 12px; text-align: center; }
.ok-msg {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #047857;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 14px;
  margin-bottom: 16px;
}
.hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }

/* ── سرورهای ذخیره‌شده (SSH/FTP) ── */
.srv-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.srv-row:last-child { border-bottom: 0; padding-bottom: 0; }
.srv-info { display: flex; flex-direction: column; gap: 2px; }
.srv-info b { font-size: 13.5px; }
.srv-info .mono { font-size: 11.5px; color: var(--muted); }
.srv-actions { display: flex; gap: 6px; }
.srv-save { margin: 14px 0 4px; padding: 12px; background: var(--bg); border-radius: 10px; }
.srv-save-check { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 600; cursor: pointer; }
.srv-save-check input { width: auto; }
/* فرم ویرایش درون‌خطی سرور ذخیره‌شده — تمام‌عرض، زیر همان ردیف */
.srv-edit { flex-basis: 100%; width: 100%; margin-top: 12px; padding-top: 14px; border-top: 1px dashed var(--line); }
.srv-edit label { margin-top: 10px; }

/* ── پنل فایل‌منیجر SSH (زیر ترمینال + صفحهٔ مستقل) ── */
.ssh-fm-card { margin-top: 16px; padding: 0; overflow: hidden; }
.ssh-fm-head {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  background: none; border: 0; cursor: pointer; padding: 13px 18px;
  font: inherit; font-weight: 800; font-size: 14px; color: var(--ink);
}
.ssh-fm-head:hover { background: var(--bg); }
.ssh-fm-head .ng-arr.open { transform: rotate(90deg); }
#ssh-fm-body { padding: 0 14px 14px; }
.fm-loading { padding: 18px; text-align: center; color: var(--muted); font-size: 13px; }
.fm-busy { opacity: .55; pointer-events: none; }
.fm-crumbs { font-size: 12px; padding: 8px 2px; }
.fm-toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin: 8px 0 12px; }
.fm-toolbar form { display: flex; gap: 6px; align-items: center; }
.fm-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }

/* ── SSH web terminal ── */
.ssh-term {
  background: #0c0e13;
  border: 1px solid #1c1f29;
  border-radius: 12px;
  padding: 14px 16px;
  height: 60vh;
  min-height: 320px;
  overflow-y: auto;
  cursor: text;
  box-shadow: var(--shadow);
}
.ssh-out {
  color: #cdd6e4;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  direction: ltr;
  text-align: left;
}
.ssh-echo { color: #5eead4; }
.ssh-err  { color: #fca5a5; }
.ssh-input-row { display: flex; align-items: center; gap: 4px; direction: ltr; }
.ssh-prompt { color: #5eead4; font-size: 12.5px; white-space: pre; flex: none; }
.ssh-cmd {
  flex: 1;
  background: transparent !important;
  border: 0 !important;
  outline: 0 !important;
  color: #e6edf6 !important;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  padding: 2px 0 !important;
  box-shadow: none !important;
}

/* ── Monitoring page ── */
/* همهٔ کارت‌های مانیتورینگ در یک ستون با عرض یکسان و وسط‌چین قرار می‌گیرند تا
   صفحه مرتب و ریسپانسیو بماند (پیش‌تر کارت فرم باریک‌تر از بقیه بود و به‌هم می‌ریخت). */
.mon-wrap { max-width: 760px; margin: 0 auto; width: 100%; }
.mon-wrap .card { width: 100%; box-sizing: border-box; }

/* ── پنل کاربری: عنوان و همهٔ کارت‌ها در یک عرض یکدست و وسط‌چین ── */
.acct-wrap { max-width: 520px; margin: 0 auto; width: 100%; }
.acct-wrap .card { width: 100%; box-sizing: border-box; }

/* ── پنل مدیریت: تب‌ها، فرم‌ها و جدول‌ها در یک ستون وسط‌چین (پیش‌تر چپ‌چین/نامتوازن بود) ── */
.admin-wrap { max-width: 880px; margin: 0 auto; width: 100%; }
.admin-wrap > .card,
.admin-wrap > .ssl-alert,
.admin-wrap > .ok-msg,
.admin-wrap > .err { margin-left: auto; margin-right: auto; box-sizing: border-box; }
.admin-wrap > .card { width: 100%; }

/* ── نمای تیکت: رشتهٔ پیام‌ها و فرم پاسخ در یک ستون خوانا و وسط‌چین ── */
.tk-wrap { max-width: 720px; margin: 0 auto; width: 100%; }
.tk-wrap .card { width: 100%; box-sizing: border-box; }

/* ── Uptime bars (monitoring) ── */
.up-bars { display: flex; gap: 2px; align-items: flex-end; margin-top: 12px; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; min-height: 28px; }
.up-bar { width: 7px; height: 26px; border-radius: 2px; flex: none; background: var(--line); }
.up-bar.ok  { background: #16a34a; }
.up-bar.bad { background: #dc2626; }

/* آمار آپ‌تایم/تأخیر هر پایشگر */
.mon-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 8px; margin-top: 12px; padding: 10px 12px;
  background: var(--bg); border-radius: 10px; font-size: 12px;
}
.mon-stats div { display: flex; flex-direction: column; gap: 1px; align-items: center; text-align: center; }
.mon-stats span { color: var(--muted); font-size: 10.5px; }
.mon-stats b { font-size: 13px; }

/* دکمه‌های اقدام هر پایشگر — هم‌ارتفاع و هم‌اندازه (فرم‌ها و لینک با هم) */
.mon-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; align-items: stretch; }
.mon-actions > form { margin: 0; display: flex; }
.mon-actions .btn {
  margin: 0; padding: 7px 14px; font-size: 12.5px; line-height: 1.2;
  box-sizing: border-box; height: 34px; white-space: nowrap;
}
.mon-actions .btn.danger { color: #b91c1c; }

/* فهرست رخدادهای قطعی */
.mon-inc { margin-top: 10px; font-size: 12px; }
.mon-inc summary { cursor: pointer; color: var(--muted); font-weight: 600; }
.mon-inc ul { margin: 8px 0 0; padding-inline-start: 18px; color: var(--muted); }
.mon-inc li { margin-bottom: 3px; }

/* link-styled button (e.g. resend OTP) */
.linklike {
  background: none;
  border: 0;
  color: var(--accent);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 6px;
  text-decoration: underline;
}
.linklike:hover { color: var(--accent-2); }

/* ── SSL trust alert ── */
.ssl-alert {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #fee2e2;
  border: 1px solid #fca5a5;
  color: #991b1b;
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 18px;
}
.ssl-alert-ic { font-size: 20px; line-height: 1.3; flex: none; }
.ssl-alert-title { font-weight: 800; font-size: 14px; margin-bottom: 4px; }
.ssl-alert-list { margin: 0; padding-inline-start: 18px; font-size: 13px; line-height: 1.7; }
.ssl-alert-list li { margin: 0; }
[data-theme="dark"] .ssl-alert { background: #2d0c0c; border-color: #7f1d1d; color: #fca5a5; }

/* ── File input ── */
input[type=file] {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border: 2px dashed var(--line);
  border-radius: 10px;
  background: #fcfcfb;
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
  font-family: inherit;
  transition: .15s;
}
input[type=file]:hover { border-color: var(--accent); background: var(--accent-soft); }
input[type=file]::file-selector-button {
  background: var(--accent-soft);
  color: var(--accent-2);
  border: none;
  padding: 5px 12px;
  border-radius: 7px;
  font-family: inherit;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  margin-left: 10px;
  transition: .15s;
}
input[type=file]::file-selector-button:hover { background: var(--accent); color: #fff; }

/* ── Score ring + cats ── */
.scoreCard { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.ring { position: relative; width: 120px; height: 120px; flex: none; }
.ring svg { transform: rotate(-90deg); }
.ring .g { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring .g b { font-size: 38px; font-weight: 800; line-height: 1; }
.ring .g i { font-size: 12px; color: var(--muted); font-style: normal; }
.cats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 11px; margin: 18px 0; }
.cat { background: var(--paper); border: 1px solid var(--line); border-radius: 13px; padding: 13px; }
.cat .top { display: flex; justify-content: space-between; align-items: baseline; }
.cat .lbl { font-size: 12px; color: var(--muted); }
.cat .sc { font-size: 22px; font-weight: 800; margin-top: 2px; }
.cat .sc small { font-size: 11px; color: var(--muted); font-weight: 500; }
.bar { height: 6px; background: #f0f0ec; border-radius: 99px; margin-top: 8px; overflow: hidden; }
.bar i { display: block; height: 100%; }
[data-theme="dark"] .bar { background: var(--line); }

/* ── Tables / kv ── */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: right; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
[dir="ltr"] th, [dir="ltr"] td { text-align: left; }
th { color: var(--muted); font-weight: 600; font-size: 12px; }
td .mono, .v { font-family: 'JetBrains Mono', monospace; direction: ltr; unicode-bidi: embed; font-size: 12.5px; word-break: break-all; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.badge { display: inline-block; font-size: 11px; font-weight: 700; border-radius: 7px; padding: 3px 10px; font-family: 'Vazirmatn', system-ui, sans-serif; }
.b-ok { background: #ecfdf5; color: #047857; }
.b-warn { background: #fef3c7; color: #b45309; }
.b-bad { background: #fee2e2; color: #b91c1c; }
[data-theme="dark"] .b-ok { background: #052e1c; color: #6ee7b7; }
[data-theme="dark"] .b-warn { background: #2d1f06; color: #fcd34d; }
[data-theme="dark"] .b-bad { background: #2d0c0c; color: #fca5a5; }

/* ── پیوست‌های تیکت (پیش‌نمایش تصویر و فایل) ── */
.tk-att-img { margin: 0; width: 132px; }
.tk-att-img a { display: block; }
.tk-att-img img {
  width: 132px; height: 100px; object-fit: cover;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg);
  display: block; transition: filter .15s;
}
.tk-att-img a:hover img { filter: brightness(.92); }
.tk-att-img figcaption {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  margin-top: 4px; font-size: 11px;
}
.tk-att-img .tk-att-name {
  color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 80px;
}
.tk-att-file {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 9px;
  padding: 6px 11px; font-size: 12.5px;
}
.tk-att-file a { color: var(--accent-2); font-weight: 700; text-decoration: none; }
.tk-att-meta { color: var(--muted); font-size: 11px; }

/* ── Tabs ── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tabs a { padding: 9px 14px; font-weight: 700; font-size: 13.5px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.on { color: var(--accent); border-color: var(--accent); }

/* ── Code block ── */
.codebox { position: relative; background: #0f1115; border-radius: 12px; padding: 14px; margin-top: 12px; }
.codebox pre { margin: 0; color: #9be8dc; font-family: 'JetBrains Mono', monospace; direction: ltr; text-align: left; font-size: 12px; white-space: pre-wrap; word-break: break-all; max-height: 360px; overflow: auto; }
.codebox .tools { display: flex; gap: 6px; justify-content: flex-end; margin-bottom: 10px; }
.codebox button { border: 0; background: #22252c; color: #9ca3af; font-family: 'Vazirmatn'; font-size: 11px; border-radius: 7px; padding: 5px 11px; cursor: pointer; transition: color .12s; }
.codebox button:hover { color: #5eead4; }

/* ── Result Actions ── */
.result-actions {
  display: flex;
  gap: 7px;
  justify-content: flex-start;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.result-actions button {
  border: 0;
  cursor: pointer;
  background: var(--accent-soft);
  color: var(--accent-2);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  border-radius: 9px;
  padding: 6px 13px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background .12s, color .12s, transform .1s;
}
.result-actions button:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-1px);
}
.result-actions button:active { transform: none; }
[data-theme="dark"] .result-actions button { background: var(--accent-soft); color: var(--accent); }
[data-theme="dark"] .result-actions button:hover { background: var(--accent); color: #fff; }

/* ── Home dashboard ── */
.dash { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.tool {
  display: block;
  position: relative;                     /* برای دکمهٔ علاقه‌مندی */
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.tool:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow-lg); }

/* ── داشبورد شخصی: ستارهٔ علاقه‌مندی + جمع‌کردن گروه‌ها ── */
.tool-fav {
  position: absolute; top: 10px; inset-inline-end: 10px;
  width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 8px; background: transparent; color: var(--muted);
  cursor: pointer; opacity: 0; transition: opacity .12s, color .12s, background .12s;
}
.tool-fav svg { width: 16px; height: 16px; }
.tool:hover .tool-fav, .tool-fav.on, .tool-fav:focus-visible { opacity: 1; }
.tool-fav:hover { background: var(--accent-soft); color: var(--accent); }
.tool-fav.on { color: #eab308; }
@media (pointer: coarse) { .tool-fav { opacity: .55; } }

.grp-hidden { display: none !important; }
.tools-more {
  display: block; margin: 4px auto 0; padding: 10px 22px;
  border: 1px dashed var(--line); border-radius: 12px; background: var(--paper);
  color: var(--muted); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
  transition: color .12s, border-color .12s, background .12s;
}
.tools-more:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.tools-more .tm-arr { font-size: 11px; opacity: .7; }
.tool .ic { font-size: 20px; }
.tool h4 { margin: 8px 0 4px; font-size: 15.5px; font-weight: 800; color: var(--ink); }
.tool p { margin: 0; font-size: 13px; color: var(--muted); }
.tool-ic { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; margin-bottom: 10px; flex: none; }
.tool-ic svg { width: 22px; height: 22px; }

.hero { text-align: center; padding: 26px 0 30px; }
.hero h1 { font-size: 34px; font-weight: 800; letter-spacing: -1px; margin: 0 0 10px; }
.hero h1 span { color: var(--accent); }
.hero p { color: var(--muted); max-width: 520px; margin: 0 auto; }
.pill { display: inline-block; font-size: 12px; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 6px 14px; margin-bottom: 18px; font-weight: 600; }
.eng { font-size: 11px; color: var(--muted); }

/* ── DNS Advanced Settings ── */
.adv-box {
  margin: 14px auto 0;
  max-width: 640px;
}
.adv-box summary {
  font-size: 13px;
  color: var(--accent);
  cursor: pointer;
  padding: 6px 2px;
  list-style: none;
  user-select: none;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.adv-box summary::-webkit-details-marker { display: none; }
.adv-box summary::before { content: '▸'; transition: transform .2s; display: inline-block; flex: none; }
.adv-box[open] summary::before { transform: rotate(90deg); }
/* RTL: فلش باید به سمت چپ (جهت متن) باشد و هنگام باز شدن رو به پایین بچرخد */
[dir="rtl"] .adv-box summary::before { content: '◂'; }
[dir="rtl"] .adv-box[open] summary::before { transform: rotate(-90deg); }
.adv-inner {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 16px 18px;
  margin-top: 8px;
  box-shadow: var(--shadow);
}
.adv-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.adv-row:last-child { margin-bottom: 0; }
.adv-row > label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  min-width: 60px;
  padding-top: 8px;
  flex: none;
}
.toggle-group, .resolver-opts { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }

.tog {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1.5px solid var(--line);
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
  font-family: inherit;
  font-weight: 500;
  user-select: none;
  color: var(--ink);
}
.tog:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-2); }
.tog.on { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
.tog input[type=radio],
.tog input[type=checkbox] { display: none; }
.res-custom-input { margin-top: 0 !important; }

/* ── DNS blocks ── */
.dns-sections { display: grid; grid-template-columns: 1fr; gap: 14px; }
.dns-block { border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.dns-block-hd { background: #f8f8f5; padding: 9px 12px; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); }
.dns-block table { margin: 0; width: 100%; }
.dns-block td { padding: 8px 14px; border-bottom: 1px solid var(--line); word-break: break-word; }
.dns-block tr:last-child td { border-bottom: 0; }
.dns-block td:first-child { width: 64px; flex: none; }
.dns-block td.v { font-size: 12.5px; max-width: 0; overflow-wrap: anywhere; }
.dns-type-badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 5px; font-family: 'JetBrains Mono', monospace; }
.dns-type-badge.a    { background: #dbeafe; color: #1d4ed8; }
.dns-type-badge.aaaa { background: #ede9fe; color: #6d28d9; }
.dns-type-badge.ns   { background: #ecfdf5; color: #047857; }
.dns-type-badge.mx   { background: #fef3c7; color: #b45309; }
.dns-type-badge.txt  { background: #fff7ed; color: #c2410c; }
.dns-type-badge.cname{ background: #fdf2f8; color: #a21caf; }
.dns-type-badge.caa  { background: #f0fdf4; color: #15803d; }
.dns-type-badge.soa  { background: #f8fafc; color: #475569; }

/* ── Nameserver refresh (Availability) ── */
.ns-refresh {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 8px;
  padding: 5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color .12s, color .12s, background .12s;
}
.ns-refresh svg { width: 14px; height: 14px; display: block; }
.ns-refresh:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.ns-refresh:disabled { opacity: .6; cursor: default; }
.ns-refresh.spin svg { animation: ns-spin .7s linear infinite; }
@keyframes ns-spin { to { transform: rotate(360deg); } }
.ns-table tr.ns-updated td { animation: ns-flash 0.9s ease; }
@keyframes ns-flash {
  0%   { background: var(--accent-soft); }
  100% { background: transparent; }
}
[data-theme="dark"] .ns-refresh { border-color: var(--line); }

/* ── Network tools tabs ── */
.net-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 0 0 22px;
}
.net-tab {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 13px;
  padding: 13px 15px;
  cursor: pointer;
  transition: border-color .12s, background .12s, transform .12s;
  text-decoration: none;
  color: var(--ink);
}
.net-tab:hover { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-1px); }
.net-tab.on { border-color: var(--accent); background: var(--accent-soft); }
.net-tab.on .net-tab-en { color: var(--accent); }
.net-tab-en { font-weight: 700; font-size: 14px; }
.net-tab-fa { color: var(--muted); font-size: 11.5px; margin-top: 3px; }

/* ── Form group utilities ── */
.input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.proto-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

/* ── Propagation summary ── */
.prop-summary { display:flex; gap:20px; align-items:center; flex-wrap:wrap; }
.prop-stat .n { font-size:34px; font-weight:800; line-height:1; }
.prop-stat .l { font-size:12px; color:var(--muted); margin-top:4px; }

/* ── Scroll to top (minimal) ── */
.to-top {
  position: fixed;
  bottom: 22px;
  inset-inline-end: 22px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--accent);
  box-shadow: var(--shadow);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity .22s ease, transform .22s ease, visibility .22s, background .12s, color .12s, border-color .12s;
  z-index: 80;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover { background: var(--accent); color: #fff; border-color: var(--accent); transform: translateY(-2px); }
.to-top svg { width: 20px; height: 20px; }
@media (max-width: 600px) {
  .to-top { bottom: 16px; inset-inline-end: 16px; width: 38px; height: 38px; }
}

/* ── Print / Screenshot ── */
@media print {
  .side, .mob-header,
  .result-actions,
  .to-top,
  form,
  .net-tabs,
  .ph,
  .psub { display: none !important; }
  body { background: #fff !important; background-image: none !important; }
  .shell { display: block; }
  .main { padding: 0 !important; max-width: none !important; }
  .card { box-shadow: none !important; border: 1px solid #ccc !important; page-break-inside: avoid; }
}

/* ── Responsive ── */
@media (max-width: 960px) {
  .net-tabs { grid-template-columns: repeat(2, 1fr); }
  .grid2 { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  /* Show mobile header */
  .mob-header { display: flex; }

  /* Hide sidebar close button on desktop */
  .side-close { display: flex; }

  /* Hide side-foot theme/lang controls on mobile (use mob-header instead) */
  .side-foot .ctrl-btn { display: flex; }

  .shell { display: block; }

  /* Sidebar off-canvas */
  .side {
    position: fixed;
    top: 0;
    height: 100vh;
    width: 280px;
    z-index: 100;
    transition: transform .26s cubic-bezier(.4,0,.2,1);
    background: var(--paper);
    backdrop-filter: none;
    overflow-y: auto;
  }
  /* RTL: slide from right */
  [dir="rtl"] .side {
    right: 0;
    left: auto;
    transform: translateX(100%);
    border-inline-end: 0;
    border-inline-start: 1px solid var(--line);
  }
  /* LTR: slide from left */
  [dir="ltr"] .side {
    left: 0;
    right: auto;
    transform: translateX(-100%);
    border-inline-start: 0;
    border-inline-end: 1px solid var(--line);
  }
  .side.open { transform: translateX(0) !important; }

  /* Main content gets padding-top for fixed mobile header */
  .main { padding: 20px 14px 60px; }

  .field { max-width: 100%; }
  .adv-box { max-width: 100%; }
  .kv { grid-template-columns: 110px 1fr; }
  .main-inner { max-width: 100%; }
}

@media (max-width: 600px) {
  .net-tabs { grid-template-columns: 1fr 1fr; }
  .input-row { grid-template-columns: 1fr; }
  .ph { font-size: 22px; }
  .main { padding: 14px 12px 50px; }
  .card { padding: 16px; }
  .hero h1 { font-size: 26px; }
  .dash { grid-template-columns: 1fr; }
}

/* ── LTR (English) overrides ── */
[dir="ltr"] .nav a.sub {
  padding: 6px 22px 6px 10px;
}
[dir="ltr"] .kv { direction: ltr; }
[dir="ltr"] th, [dir="ltr"] td { text-align: left; }
[dir="ltr"] .prop-summary { flex-direction: row; }

/* ===== صفحهٔ ورود / ثبت‌نام ===== */
.auth-wrap {
  width: 100%;
  min-height: calc(100vh - 130px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 0;
  box-sizing: border-box;
}
.auth-card {
  width: 100%;
  max-width: 410px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  padding: 34px 30px 30px;
  box-sizing: border-box;
}
.auth-head { text-align: center; margin-bottom: 24px; }
.auth-logo {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 16px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-logo svg { width: 26px; height: 26px; }
.auth-title { margin: 0 0 7px; font-size: 22px; font-weight: 800; letter-spacing: -.4px; color: var(--ink); }
.auth-sub { margin: 0; font-size: 13.5px; line-height: 1.75; color: var(--muted); }

.auth-form { margin: 0; }
.auth-label { display: block; font-size: 13px; font-weight: 600; margin: 0 0 8px; color: var(--ink); }

.auth-card .auth-input {
  width: 100%;
  box-sizing: border-box;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 13px 15px;
  font-family: inherit;
  font-size: 15px;
  background: var(--bg);
  color: var(--ink);
  outline: 0;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.auth-card .auth-input:focus {
  border-color: var(--accent);
  background: var(--paper);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.auth-card .auth-input::placeholder { color: var(--muted); opacity: .6; }
.auth-card .auth-phone { direction: ltr; text-align: left; font-family: 'JetBrains Mono', monospace; letter-spacing: 1px; }
.auth-card .auth-otp {
  direction: ltr;
  text-align: center;
  letter-spacing: 12px;
  padding-inline-start: 27px; /* جبران letter-spacing تا واقعاً وسط بنشیند */
  font-size: 24px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
}

.auth-btn {
  width: 100%;
  margin-top: 20px;
  border: 0;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  border-radius: 12px;
  padding: 14px 20px;
  transition: background .14s, transform .1s;
}

/* ══════════════════ Mail Tester ══════════════════ */
.mt-wrap { width: 100%; max-width: 100%; margin: 0 auto; }
.mt-head { text-align: center; margin-bottom: 18px; }
.mt-badge {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--accent-soft); color: var(--accent-2);
  font-size: 12px; font-weight: 700; border-radius: 999px;
  padding: 6px 14px; margin-bottom: 14px;
}
[data-theme="dark"] .mt-badge { color: var(--accent); }
.mt-head .ph { margin-bottom: 6px; }
.mt-head .psub { max-width: 560px; margin-inline: auto; margin-bottom: 0; }

/* پنل مرکزی گام‌ها */
.mt-panel {
  max-width: 560px; margin: 0 auto 18px;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 26px 26px 24px; text-align: center;
}
.mt-stepline {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  font-weight: 800; font-size: 14.5px; margin-bottom: 14px;
}
.mt-stepline-2 { margin-top: 24px; }
.mt-num {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 800; font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center;
}
.mt-num-txt { color: var(--ink); }

.mt-address-box {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg); border: 1px solid var(--accent);
  border-radius: 12px; padding: 8px; padding-inline-start: 14px;
  max-width: 440px; margin: 0 auto;
}
[data-theme="dark"] .mt-address-box { background: rgba(20,184,166,.08); }
.mt-address-box.mt-flash { animation: mt-flash 1.4s ease; }
@keyframes mt-flash {
  0%   { box-shadow: 0 0 0 0 rgba(13,148,136,.5); border-color: var(--accent); }
  30%  { box-shadow: 0 0 0 6px rgba(13,148,136,.18); }
  100% { box-shadow: 0 0 0 0 rgba(13,148,136,0); }
}
.mt-address {
  flex: 1; min-width: 0; direction: ltr; text-align: right;
  font-family: 'JetBrains Mono', monospace; font-size: 16px; font-weight: 700;
  color: var(--accent-2); background: none; padding: 0; word-break: break-all; line-height: 1.5;
}
[data-theme="dark"] .mt-address { color: var(--accent); }
.mt-copy {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  border: 0; background: var(--accent); color: #fff;
  font-family: inherit; font-weight: 700; font-size: 12.5px;
  border-radius: 9px; padding: 8px 13px; transition: all .14s; white-space: nowrap;
}
.mt-copy:hover { background: var(--accent-2); }
.mt-copy.ok { background: #16a34a; }

.mt-check-btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 0; cursor: pointer; background: var(--accent); color: #fff;
  font-family: inherit; font-weight: 800; font-size: 14.5px;
  border-radius: 12px; padding: 12px 26px; transition: background .14s, transform .1s;
}
.mt-check-btn:hover { background: var(--accent-2); }
.mt-check-btn:active { transform: translateY(1px); }
.mt-check-btn:disabled { opacity: .7; cursor: default; }
.mt-check-btn.loading svg { animation: mt-spin .9s linear infinite; }
.mt-hint { color: var(--muted); font-size: 12px; margin-top: 12px; }

/* لینک ظریف آدرس جدید (زیر باکس آدرس) */
.mt-newaddr {
  display: inline-block; margin-top: 12px; font-size: 12.5px;
  color: var(--muted); text-decoration: none; border-bottom: 1px dashed var(--muted);
  padding-bottom: 1px; transition: color .14s, border-color .14s;
}
.mt-newaddr:hover { color: var(--accent); border-color: var(--accent); }

/* دکمهٔ «تست بعدی» در پایان گزارش */
.mt-newtest { text-align: center; margin-top: 22px; }
.mt-newtest-note {
  color: #16a34a; font-size: 13px; font-weight: 600; margin: 0 0 12px; line-height: 1.7;
}
[data-theme="dark"] .mt-newtest-note { color: #4ade80; }
.mt-newtest-btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  background: var(--accent-soft); color: var(--accent-2);
  border: 1px solid var(--accent); border-radius: 12px;
  padding: 11px 22px; font-weight: 700; font-size: 13.5px;
  font-family: inherit; text-decoration: none; transition: all .14s;
}
.mt-newtest-btn:hover { background: var(--accent); color: #fff; }
[data-theme="dark"] .mt-newtest-btn { color: var(--accent); }
[data-theme="dark"] .mt-newtest-btn:hover { color: #fff; }

.mt-config-note {
  background: #fffbeb; border: 1px solid #fde68a; color: #92400e;
  border-radius: 12px; padding: 12px 14px; font-size: 13px; margin-bottom: 16px; line-height: 1.7;
}
[data-theme="dark"] .mt-config-note { background: #2a2410; border-color: #4d3f12; color: #fcd34d; }

.mt-result { margin-top: 10px; }

/* انتظار */
.mt-waiting {
  text-align: center; padding: 44px 20px; background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.mt-spinner {
  width: 44px; height: 44px; margin: 0 auto 16px; border-radius: 50%;
  border: 4px solid var(--line); border-top-color: var(--accent);
  animation: mt-spin .8s linear infinite;
}
@keyframes mt-spin { to { transform: rotate(360deg); } }
.mt-waiting-txt { font-weight: 800; font-size: 15px; }
.mt-waiting-sub { color: var(--muted); font-size: 13px; margin-top: 6px; }

.mt-msg { text-align: center; padding: 22px; border-radius: var(--radius); font-size: 14px; margin-top: 8px; line-height: 1.7; }
.mt-msg-wait { background: var(--accent-soft); color: var(--accent-2); }
[data-theme="dark"] .mt-msg-wait { color: var(--accent); }
.mt-msg-fatal { background: #fee2e2; color: #b91c1c; }
[data-theme="dark"] .mt-msg-fatal { background: #2c1414; color: #fca5a5; }

/* کارت امتیاز */
.mt-score-card {
  display: flex; gap: 30px; align-items: center;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 28px 32px; margin: 14px 0 18px; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.mt-score-card::before {
  content: ''; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 6px;
}
.mt-score-card.mt-good::before { background: #16a34a; }
.mt-score-card.mt-warn::before { background: #d97706; }
.mt-score-card.mt-bad::before  { background: #dc2626; }

.mt-gauge { position: relative; width: 130px; height: 130px; flex: 0 0 auto; }
.mt-gauge svg { width: 130px; height: 130px; display: block; }
.mt-gauge-bg { fill: none; stroke: var(--line); stroke-width: 10; }
.mt-gauge-fg { fill: none; stroke-width: 10; stroke-linecap: round; transition: stroke-dasharray .9s ease; }
.mt-good .mt-gauge-fg { stroke: #16a34a; }
.mt-warn .mt-gauge-fg { stroke: #d97706; }
.mt-bad  .mt-gauge-fg { stroke: #dc2626; }
.mt-gauge-num {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 46px; font-weight: 800; letter-spacing: -1.5px;
  font-variant-numeric: tabular-nums;
}
.mt-good .mt-gauge-num { color: #16a34a; }
.mt-warn .mt-gauge-num { color: #d97706; }
.mt-bad  .mt-gauge-num { color: #dc2626; }

.mt-score-side { flex: 1; min-width: 0; }
.mt-score-top { display: flex; align-items: baseline; gap: 10px; }
.mt-score-grade {
  font-size: 34px; font-weight: 800; line-height: 1;
}
.mt-good .mt-score-grade { color: #16a34a; }
.mt-warn .mt-score-grade { color: #d97706; }
.mt-bad  .mt-score-grade { color: #dc2626; }
.mt-score-outof { font-size: 13px; color: var(--muted); font-weight: 600; }
.mt-score-verdict { color: var(--muted); font-size: 14px; margin-top: 8px; line-height: 1.7; }

.mt-meta { margin-bottom: 16px; }
.mt-meta .kv { grid-template-columns: 140px 1fr; }
.mt-meta .kv dd { word-break: break-word; }

/* بخش‌های آکاردئونی */
.mt-sec {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 14px; margin-bottom: 10px; overflow: hidden;
  transition: border-color .14s, box-shadow .14s;
}
.mt-sec.open { box-shadow: var(--shadow); }
.mt-sec-head {
  width: 100%; display: flex; align-items: center; gap: 13px;
  background: none; border: 0; cursor: pointer; text-align: start;
  padding: 15px 18px; font-family: inherit; color: var(--ink);
}
.mt-sec-head:hover { background: var(--accent-soft); }
.mt-sec-icon { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: #fff; }
.mt-sec-icon svg { width: 16px; height: 16px; }
.mt-good > .mt-sec-head .mt-sec-icon { background: #16a34a; }
.mt-warn > .mt-sec-head .mt-sec-icon { background: #d97706; }
.mt-bad  > .mt-sec-head .mt-sec-icon { background: #dc2626; }
.mt-sec-title { flex: 1; min-width: 0; font-weight: 700; font-size: 14.5px; }
.mt-sec-note { display: block; font-weight: 400; font-size: 12px; color: var(--muted); margin-top: 3px; }
.mt-sec-points {
  font-weight: 800; font-size: 16px; font-family: 'JetBrains Mono', monospace;
  min-width: 42px; text-align: end;
}
.mt-sec-points.mt-good { color: #16a34a; }
.mt-sec-points.mt-warn { color: #d97706; }
.mt-sec-points.mt-bad  { color: #dc2626; }
.mt-sec-arrow { color: var(--muted); font-size: 22px; line-height: 1; transition: transform .18s; transform: rotate(90deg); }
.mt-sec.open .mt-sec-arrow { transform: rotate(-90deg); }
html[dir="rtl"] .mt-sec-arrow { transform: rotate(90deg); }
html[dir="rtl"] .mt-sec.open .mt-sec-arrow { transform: rotate(-90deg); }
.mt-sec-body { display: none; padding: 2px 18px 12px; }
.mt-sec.open .mt-sec-body { display: block; }

.mt-item {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 11px 0; border-top: 1px solid var(--line);
}
.mt-item:first-child { border-top: 0; }
.mt-item-icon { flex: 0 0 auto; width: 19px; height: 19px; margin-top: 1px; }
.mt-item-icon svg { width: 19px; height: 19px; }
.mt-item.mt-good .mt-item-icon { color: #16a34a; }
.mt-item.mt-bad  .mt-item-icon { color: #dc2626; }
.mt-item.mt-warn .mt-item-icon { color: #d97706; }
.mt-item.mt-info .mt-item-icon { color: var(--muted); }
.mt-item-text { flex: 1; min-width: 0; }
.mt-item-label { display: block; font-size: 13.5px; font-weight: 600; word-break: break-word; }
.mt-item-detail { display: block; font-size: 12.5px; color: var(--muted); margin-top: 3px; word-break: break-word; direction: ltr; text-align: start; }
.mt-item-points { flex: 0 0 auto; font-family: 'JetBrains Mono', monospace; font-size: 13px; font-weight: 800; margin-top: 1px; }
.mt-item-points.mt-bad  { color: #dc2626; }
.mt-item-points.mt-good { color: #16a34a; }

.mt-foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 16px; direction: ltr; }

@media (max-width: 560px) {
  .mt-panel { padding: 22px 16px 20px; }
  .mt-address { font-size: 14px; }
  .mt-score-card { gap: 18px; padding: 20px; flex-direction: column; text-align: center; }
  .mt-score-card::before { width: 100%; height: 6px; bottom: auto; }
  .mt-score-top { justify-content: center; }
  .mt-gauge, .mt-gauge svg { width: 116px; height: 116px; }
  .mt-gauge-num { font-size: 40px; }
  .mt-meta .kv { grid-template-columns: 110px 1fr; }
}
.auth-btn:hover { background: var(--accent-2); transform: translateY(-1px); }
.auth-btn:active { transform: none; }

.auth-hint {
  font-size: 12.5px;
  color: var(--muted);
  margin: 10px 2px 0;
  line-height: 1.75;
}
/* شمارش معکوس انقضای کد یک‌بارمصرف — فونت رابط (نه مونو) تا فارسی درست نمایش داده شود */
.auth-timer {
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin: 12px 0 2px;
  font-variant-numeric: tabular-nums;
}
.auth-timer.expired { color: #dc2626; font-weight: 700; }
/* چیپ شمارهٔ قفل‌شده در مراحل بعد از ورود شماره */
.auth-phone-lock {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 12px; margin-bottom: 14px; font-size: 13px; font-weight: 600;
}
.auth-phone-lock a { color: var(--accent); font-size: 12px; font-weight: 600; }
.auth-hint .mono {
  font-family: 'JetBrains Mono', monospace;
  direction: ltr;
  display: inline-block;
  unicode-bidi: bidi-override;
  font-weight: 600;
  color: var(--ink);
}

.auth-divider { height: 1px; background: var(--line); margin: 22px -6px 0; }
.auth-alt { margin-top: 16px; text-align: center; }
.auth-resend {
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--accent);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 8px;
  border-radius: 8px;
  transition: color .14s, background .14s;
}
.auth-resend:hover { color: var(--accent-2); background: var(--accent-soft); }

.auth-err {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.65;
  margin-bottom: 20px;
  text-align: start;
}
[data-theme="dark"] .auth-err {
  background: rgba(220,38,38,.12);
  border-color: rgba(220,38,38,.34);
  color: #fca5a5;
}

.auth-foot {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  margin: 20px auto 0;
  max-width: 380px;
  line-height: 1.75;
}

@media (max-width: 600px) {
  .auth-wrap { min-height: calc(100vh - 90px); padding: 16px 0; }
  .auth-card { padding: 28px 22px 24px; border-radius: 18px; }
  .auth-title { font-size: 20px; }
}

/* ===== Command palette (Ctrl/⌘ + K) ===== */
.cmdk {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(10,12,16,.45);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  padding-top: 12vh;
}
.cmdk.vis { display: block; }
.cmdk-box {
  width: 92%;
  max-width: 560px;
  margin: 0 auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: cmdk-in .16s ease both;
}
@keyframes cmdk-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
#cmdk-input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  padding: 16px 18px;
  font-family: inherit;
  font-size: 16px;
  color: var(--ink);
  outline: 0;
  box-shadow: none;
}
#cmdk-input:focus { box-shadow: none; border-color: var(--line); }
.cmdk-list { list-style: none; margin: 0; padding: 6px; max-height: 52vh; overflow-y: auto; }
.cmdk-item {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border-radius: 10px; cursor: pointer;
}
.cmdk-item.on { background: var(--accent-soft); }
.cmdk-item .cmdk-t { font-weight: 600; font-size: 14px; color: var(--ink); }
.cmdk-item.on .cmdk-t { color: var(--accent-2); }
.cmdk-item .cmdk-s { font-size: 11.5px; color: var(--muted); font-family: 'JetBrains Mono', monospace; }
.cmdk-empty { padding: 22px; text-align: center; color: var(--muted); font-size: 13px; }
.cmdk-foot {
  display: flex; gap: 14px; justify-content: flex-end;
  padding: 9px 14px; border-top: 1px solid var(--line);
  font-size: 11px; color: var(--muted);
}
[data-theme="dark"] .cmdk { background: rgba(0,0,0,.6); }

/* دکمهٔ بازکنندهٔ پالت در سایدبار */
.cmdk-trigger {
  display: flex; align-items: center; gap: 8px; width: 100%;
  margin: 0 0 6px; padding: 8px 10px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  color: var(--muted); font-family: inherit; font-size: 12.5px; cursor: pointer;
  transition: border-color .12s, color .12s;
}
.cmdk-trigger:hover { border-color: var(--accent); color: var(--accent-2); }
.cmdk-trigger .ic { width: 15px; height: 15px; display: inline-flex; flex: none; opacity: .8; }
.cmdk-trigger .ic svg { width: 15px; height: 15px; }
.cmdk-trigger .cmdk-trigger-t { flex: 1; text-align: start; }
.cmdk-trigger kbd {
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 5px;
  padding: 1px 6px; color: var(--muted);
}

/* ===== Breadcrumb ===== */
.crumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--muted); margin: 0 2px 14px;
}
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent-2); }
.crumbs .crumb-sep { opacity: .5; }
.crumbs .crumb-cur { color: var(--ink); font-weight: 600; }

/* ===== FAQ ===== */
.faq { max-width: 760px; margin: 36px auto 0; }
.faq-h { font-size: 18px; font-weight: 800; margin: 0 0 14px; text-align: center; }
.faq-item {
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
  padding: 0; margin-bottom: 10px; overflow: hidden;
}
.faq-item summary {
  cursor: pointer; list-style: none; padding: 14px 16px;
  font-weight: 600; font-size: 14px; color: var(--ink);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; color: var(--accent); font-size: 20px; font-weight: 400; flex: none; transition: transform .2s; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item .faq-a { padding: 0 16px 15px; color: var(--muted); font-size: 13.5px; line-height: 1.9; }
@media (max-width: 600px) { .faq { margin-top: 26px; } }

/* ===== Toast ===== */
.toast-box {
  position: fixed; bottom: 22px; inset-inline-start: 50%;
  transform: translateX(-50%);
  z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
}
.toast {
  background: #15171c; color: #fff;
  font-size: 13px; font-weight: 600;
  padding: 10px 18px; border-radius: 12px;
  box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(10px);
  transition: opacity .22s ease, transform .22s ease;
  max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-err { background: #b91c1c; }
[data-theme="dark"] .toast { background: #e2e4ec; color: #15171c; }
[data-theme="dark"] .toast-err { background: #fca5a5; color: #2d0c0c; }

/* ===== ستون یکدست صفحات ابزار (فرم = نتیجه = FAQ، وسط‌چین و ریسپانسیو) ===== */
/* همیشه جای اسکرول‌بار رزرو شود تا باز/بسته شدن FAQ باعث پرش افقی نشود */
html { scrollbar-gutter: stable; }

.main-inner.tool-view { max-width: 820px; }
/* فرم‌ها و کادرها هم‌عرض ستون شوند (نه باریک‌تر از نتایج) */
.main-inner.tool-view .field,
.main-inner.tool-view .form-center,
.main-inner.tool-view form > .input-row,
.main-inner.tool-view .faq { max-width: 100%; width: 100%; margin-inline: auto; }
.main-inner.tool-view .card { width: 100%; box-sizing: border-box; }
.main-inner.tool-view .faq { margin-top: 30px; }
/* جعبه‌های کد و textarea نتیجه هرگز از کادر بیرون نزنند */
.main-inner.tool-view .codebox pre,
.main-inner.tool-view textarea { max-width: 100%; }
.codebox pre { overflow-x: auto; }

/* وسط‌چین عمودی صفحات ابزار وقتی محتوا کوتاه است (safe = اگر بلند شد از بالا، بدون قطع‌شدن) */
@media (min-width: 861px) {
  .main-inner.tool-view { justify-content: safe center; }
}

/* ===== Speed test (رابط دیجیتال — بدون گِیج عقربه‌ای) ===== */
.st-live { display: flex; align-items: baseline; justify-content: center; gap: 8px; margin: 22px 0 10px; }
.st-live-num { font-size: 64px; font-weight: 800; line-height: 1; color: var(--ink);
  font-variant-numeric: tabular-nums; letter-spacing: -1px; min-width: 2ch; }
.st-live-unit { font-size: 16px; color: var(--muted); font-weight: 600; }
.st-live-phase { font-size: 12px; color: var(--accent); margin-inline-start: 6px; }
.st-bar { height: 8px; border-radius: 6px; background: var(--line); overflow: hidden; max-width: 420px; margin: 0 auto 20px; }
.st-bar-fill { height: 100%; width: 0; background: var(--accent); border-radius: 6px; transition: width .2s ease; }
.st-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 12px; margin-top: 14px;
}
.st-cell {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 13px;
  padding: 14px 8px;
}
.st-cell.st-main { background: var(--accent-soft); border-color: transparent; }
.st-cell .st-lbl { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.st-cell b { font-size: 24px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.st-cell i { font-size: 10.5px; color: var(--muted); font-style: normal; }
.st-cell.st-main b { font-size: 30px; color: var(--accent-2); }
@media (max-width: 560px) {
  .st-grid { grid-template-columns: 1fr 1fr; }
  .st-live-num { font-size: 52px; }
  .st-cell.st-main b { font-size: 26px; }
}

/* ===== File sharing ===== */
.file-notice { max-width: 760px; margin: 0 auto 18px; background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); border-radius: 12px; padding: 14px 16px; }
.file-notice-h { display: flex; align-items: center; gap: 8px; color: var(--accent-2); margin-bottom: 8px; font-size: 14px; }
.file-notice-list { margin: 0; padding-inline-start: 20px; color: var(--ink); font-size: 13px; line-height: 1.85; }
.file-notice-list li { margin: 0; }
.fdrop {
  border: 2px dashed var(--line); border-radius: 14px;
  padding: 26px 18px; text-align: center; cursor: pointer;
  color: var(--muted); transition: border-color .15s, background .15s;
}
.fdrop:hover, .fdrop.over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-2); }
.fdrop .fdrop-ic { color: var(--accent); margin-bottom: 8px; }
.fdrop b { color: var(--ink); }
.fq-item {
  background: var(--bg); border: 1px solid var(--line); border-radius: 11px;
  padding: 11px 13px; margin-top: 10px;
}
.fq-item.ok { border-color: #a7f3d0; }
.fq-item.err { border-color: #fca5a5; }
.fq-name { font-size: 13px; font-weight: 600; word-break: break-all; margin-bottom: 7px; }
.fq-track { height: 7px; background: var(--line); border-radius: 99px; overflow: hidden; }
.fq-bar { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.fq-item.ok .fq-bar { background: #16a34a; }
.fq-msg { margin-top: 7px; font-size: 12px; color: var(--muted); }
.fq-link { display: flex; gap: 6px; }
.fq-link input {
  flex: 1; font-family: 'JetBrains Mono', monospace; font-size: 11.5px;
  padding: 6px 9px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--paper); color: var(--ink); direction: ltr;
}
.fq-link button {
  border: 0; background: var(--accent-soft); color: var(--accent-2);
  border-radius: 8px; padding: 0 12px; font-family: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
}
.fq-link button:hover { background: var(--accent); color: #fff; }
