/* ===== 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"] select,
[data-theme="dark"] textarea {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--line);
}
[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; }

.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); }

/* 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;
}

/* ── وسط‌چین عمودی عنوان/زیرعنوان/جعبهٔ جستجو تا وقتی نتیجه‌ای نیامده ── */
@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],
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; }

/* ── پنل فایل‌منیجر 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; }

/* ── 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-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 { position: absolute; top: 8px; inset-inline-start: 8px; display: flex; gap: 6px; }
.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;
  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 .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;
}
.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-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; }
}
